[PATCH] D133248: [clang] Fix crash upon stray coloncolon token in C2x mode

Timm Bäder via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 5 22:00:28 PDT 2022


tbaeder added inline comments.


================
Comment at: clang/include/clang/Parse/Parser.h:863
   bool MightBeCXXScopeToken() {
-    return Tok.is(tok::identifier) || Tok.is(tok::coloncolon) ||
-           (Tok.is(tok::annot_template_id) &&
-            NextToken().is(tok::coloncolon)) ||
-           Tok.is(tok::kw_decltype) || Tok.is(tok::kw___super);
+    return (getLangOpts().CPlusPlus) &&
+           (Tok.is(tok::identifier) || Tok.is(tok::coloncolon) ||
----------------



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133248/new/

https://reviews.llvm.org/D133248



More information about the cfe-commits mailing list