Index: clang/docs/ReleaseNotes.rst =================================================================== --- clang/docs/ReleaseNotes.rst +++ clang/docs/ReleaseNotes.rst @@ -160,6 +160,10 @@ `Issue 53628 `_ - The template arguments of a variable template being accessed as a member will now be represented in the AST. +- Fix C++17 mode assert when parsing malformed code and the compiler is + attempting to see if it could be type template for class template argument + deduction. This fixes + `Issue 57495 `_ Improvements to Clang's diagnostics Index: clang/lib/Parse/ParseTentative.cpp =================================================================== --- clang/lib/Parse/ParseTentative.cpp +++ clang/lib/Parse/ParseTentative.cpp @@ -1550,7 +1550,7 @@ if (getLangOpts().CPlusPlus17) { if (TryAnnotateTypeOrScopeToken()) return TPResult::Error; - if (Tok.isNot(tok::identifier)) + if (NextToken().isNot(tok::identifier)) break; } Index: clang/test/Parser/cxx1z-class-template-argument-deduction.cpp =================================================================== --- clang/test/Parser/cxx1z-class-template-argument-deduction.cpp +++ clang/test/Parser/cxx1z-class-template-argument-deduction.cpp @@ -248,3 +248,11 @@ }; } + +namespace GH57495 { +template struct vector{}; + +void f() { + GH57495::vector.d; // expected-error {{cannot use dot operator on a type}} +} +}