http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10618

--- Comment #9 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2011-09-21 
15:30:26 UTC ---
> 
> > test.cc:12:1: error: need ‘typename’ before ‘A<T>::k’ because ‘A<T>’ is a
> > dependent scope
> > test.cc:14:6: error: expected constructor, destructor, or type conversion
> > before ‘func2’
> 
> > Clang gives the correct output:
> > 
> > /tmp/webcompile/_10395_0.cc:12:1: error: missing 'typename' prior to 
> > dependent
> > type name 'A<T>::k'
> > A<T>::k func1(); 
> > ^~~~~~~
> > typename 
> > /tmp/webcompile/_10395_0.cc:14:4: error: no type named 'k' in 'B'
> > B::k func2();
> > ~~~^
> > 2 errors generated.
> 
> Huh? This is the same as G++'s output
> 

The second diagnostic from G++ does not make sense. Clang gives the correct
diagnostics in that case.

> If you instantiate the function template G++ trunk gives a better diagnostic
> than clang 3.0

Great! Let's say this is almost fixed then.

Reply via email to