Index: clang/docs/ReleaseNotes.rst =================================================================== --- clang/docs/ReleaseNotes.rst +++ clang/docs/ReleaseNotes.rst @@ -463,6 +463,10 @@ - Fix crash when passing a braced initializer list to a parentehsized aggregate initialization expression. (`#63008 `_). +- 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 `_). Bug Fixes to Compiler Builtins ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Index: clang/lib/Parse/ParseTentative.cpp =================================================================== --- clang/lib/Parse/ParseTentative.cpp +++ clang/lib/Parse/ParseTentative.cpp @@ -1651,7 +1651,8 @@ if (getLangOpts().CPlusPlus17) { if (TryAnnotateTypeOrScopeToken()) return TPResult::Error; - if (Tok.isNot(tok::identifier)) + // If we annotated then the current token should not still be :: + if (Tok.isNot(tok::annot_cxxscope)) 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 @@ -247,3 +247,11 @@ }; } + +namespace GH57495 { +template struct vector{}; + +void f() { + GH57495::vector.d; // expected-error {{cannot use dot operator on a type}} +} +}