shafik updated this revision to Diff 527937. shafik added a comment. - Update check to use tok::annot_cxxscope
CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134334/new/ https://reviews.llvm.org/D134334 Files: clang/docs/ReleaseNotes.rst clang/lib/Parse/ParseTentative.cpp clang/test/Parser/cxx1z-class-template-argument-deduction.cpp 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 <typename T> struct vector{}; + +void f() { + GH57495::vector.d; // expected-error {{cannot use dot operator on a type}} +} +} 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/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 <https://github.com/llvm/llvm-project/issues/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 <https://github.com/llvm/llvm-project/issues/57495>`_). Bug Fixes to Compiler Builtins ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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 <typename T> struct vector{}; + +void f() { + GH57495::vector.d; // expected-error {{cannot use dot operator on a type}} +} +} 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/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 <https://github.com/llvm/llvm-project/issues/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 <https://github.com/llvm/llvm-project/issues/57495>`_). Bug Fixes to Compiler Builtins ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits