Hi,<div><br></div><div>I'm trying to compile a C++ project using clang and I'm getting some errors.</div><div>I've reduced my problem to the following code lines:</div><div><br></div><div><br></div><div><div>template<typename T></div>
<div>struct Base</div><div>{</div><div> void foo(int) {}</div><div>};</div><div><br></div><div>template<typename T></div><div>struct Derived : Base<T></div><div>{</div><div> void bar()</div><div> {</div>
<div> this->foo(2);</div><div> }</div><div><br></div><div> void foobar()</div><div> {</div><div> T c;</div><div> foo(c);</div><div> }</div><div>};</div><div><br></div><div>int main()</div>
<div>{</div><div> Derived<int> x;</div><div> x.bar(); //< OK</div><div> x.foobar(); //< ERROR</div><div>}</div></div><div><br></div><div><br></div><div>I get the following error:</div>
<div><br></div><div><br></div><div><div>/home/achauve/dev/c++/test_clang/test_clang.cpp:18:9: error: use of undeclared identifier 'foo'</div><div> foo(c);</div><div> ^</div><div> this-></div>
<div>/home/achauve/dev/c++/test_clang/test_clang.cpp:26:7: note: in instantiation of member function</div><div> 'Derived<int>::foobar' requested here</div><div> x.foobar();</div><div> ^</div><div>
/home/achauve/dev/c++/test_clang/test_clang.cpp:4:10: note: must qualify identifier to find this declaration in</div><div> dependent base class</div><div> void foo(int) {}</div><div> ^</div></div><div><br>
</div><div><br></div><div>In the case of foobar with a dependant template-parameter, shouldn't the identifier be found anyway? (gcc doesn't complain).</div><div><br></div><div>I've also looked in the directory clang/tests/cxx/temp but I'm not sure where I could put my test (what's the exact paragraph of the standard corresponding to this issue?).</div>
<div><br></div><div>I'm using clang-2.8 and also a snapshot from the trunk (clang version 2.9 (trunk 120732)) on Unbuntu 10.10 x86-64.</div><div><br></div><div>Thanks,</div><div><br></div><div>Cheers,</div><div>Adrien</div>