[ms-compatibility] Recover better from missing 'typename' in sizeof #18817
Labels
bugzilla
Issues migrated from bugzilla
clang:diagnostics
New/improved warning or error message in Clang, but not in clang-tidy or static analyzer
Extended Description
Consider:
struct X { typedef int type; };
template void f() { sizeof(T::type); }
template void f();
Clang diagnoses this as:
:2:43: error: unexpected type name 'type': expected expression
template void f() { sizeof(T::type); }
^
:3:15: note: in instantiation of function template specialization 'f' requested here
template void f();
^
... but this sort of thing apparently happens inside MS system headers. We should support this case of missing 'typename' more elegantly -- perhaps we can teach TreeTransform to cope with this during instantiation.
The text was updated successfully, but these errors were encountered: