We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Given the following code:
template<typename T1> struct A1 { template<typename T2> struct A2 { T2 t; }; }; template <typename K> void s(K k) { A1<K>::A2 a(2); // missing a `typename` at head! } void s() { s<double>(1.0); }
Diagnostics emitted by clang are not quite useful, it would be nice to emit a "missing typename" diagnostic (both gcc and msvc do it for this case).
<source>:15:13: error: expected ';' after expression 15 | A1<K>::A2 a(2); // missing a typenamea at head! | ^ | ; <source>:15:14: error: use of undeclared identifier 'a' 15 | A1<K>::A2 a(2); // missing a typename at head! | ^ <source>:15:11: error: use of class template 'A2' requires template arguments 15 | A1<K>::A2 a(2); // missing a typename at head! | ^ <source>:19:3: note: in instantiation of function template specialization 's<double>' requested here 19 | s<double>(1.0); | ^ <source>:10:10: note: template is declared here 9 | template<typename T2> | ~~~~~~~~~~~~~~~~~~~~~ 10 | struct A2 { T2 t; }; | ^
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Given the following code:
Diagnostics emitted by clang are not quite useful, it would be nice to emit a "missing typename" diagnostic (both gcc and msvc do it for this case).
The text was updated successfully, but these errors were encountered: