[cfe-dev] Flag for better diagnosing errors in member templates

Johannes Schaub schaub.johannes at googlemail.com
Sat Jun 30 08:39:49 PDT 2012


I would appreciate a clang flag that leads to better diagnosis in member 
templates. Consider

     template<typename T>
     struct A {
       template<typename U>
       void f(U u) {
         T t;
         // ...
       }
     };

     struct B;
     template struct A<B>;

A<B>::f's definition is ill-formed without a diagnostic being required 
and Clang does not diagnose it. But Clang aims for catching as many bugs 
as possible in user programs, and finding this bug appears to be 
possible with the current clang abilities.

What do you think?




More information about the cfe-dev mailing list