Template inheritance: There are no arguments that depend on a template parameter
<p>I came across this error when compiling the following code. 
After doing some research and reading similar errors in different situations, I came up with the solution I needed. 
But I did not fully understood the undelying reason for the error and the fix. </p>

<pre><code>template &lt;typename T&gt;
class TestA {
    int a;
    T temp;

protected:
    int b; 

public: 
    int c;

    TestA(T te): a{10}, b{20}, c{30}, temp{te} {}

    int geta(){ return a; }
    int getb(){ return b; }
    int getc(){ return c; }
};

template &lt;typename T&gt;
class TestB {
    int atb;
    T tempb;

protected:
    int btb; 

public: 
    int ctb;

    TestB(T te) atb{10}, btb{20}, ctb{30}, tempb{te} {}
};

template &lt;typename T&gt;
class TestInh : public TestA&lt;T&gt;, public TestB&lt;T&gt; {
    int aa;
    T temptemp;

protected:
    int bb; 
    int b;

public: 
    int cc;

    TestInh(T te) : TestA&lt;T&gt;{te}, TestB&lt;T&gt;{te}, bb{10000}, b{-1000} {}

    int get_total() {
        // The error happens here!
        return geta();
    }
};

int main(int argc, char const *argv[]) {
    char text = 'a';
    TestInh&lt;char&gt; test(text);

    //std::cout &lt;&lt; test.geta() &lt;&lt; std::endl;
    std::cout &lt;&lt; test.get_total() &lt;&lt; std::endl;
    //std::cout &lt;&lt; test.c &lt;&lt; std::endl;
    return 0;
}
</code></pre>

<p>When compiling this code, I got this error: </p>

<pre><code>testtemplate.cc: In member function ‘int TestInh&lt;T&gt;::get_total()’:
testtemplate.cc:54:32: error: there are no arguments to ‘geta’ that depend on a template parameter, so a declaration of ‘geta’ must be available [-fpermissive]
int get_total() {return geta();}
                            ^
testtemplate.cc:54:32: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
</code></pre>

<p>It is solved by calling <code>this-&gt;geta()</code> instead of just <code>geta()</code>, but I do not fully understand why this cannot be resolved by the compiler.</p>

<p>Can someone please explain me why? </p>