[PATCH] D157480: [clang-repl] Disambiguate global namespace identifiers

Jonas Hahnfeld via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 14 01:11:54 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rGba475a4a3440: [clang-repl] Disambiguate global namespace identifiers (authored by Hahnfeld).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157480

Files:
  clang/lib/Parse/ParseTentative.cpp
  clang/test/Interpreter/disambiguate-decl-stmt.cpp


Index: clang/test/Interpreter/disambiguate-decl-stmt.cpp
===================================================================
--- clang/test/Interpreter/disambiguate-decl-stmt.cpp
+++ clang/test/Interpreter/disambiguate-decl-stmt.cpp
@@ -38,6 +38,10 @@
 Dtor1::~Dtor1() { printf("Dtor1\n"); }
 Dtor1 d1;
 
+struct Dtor2 { ~Dtor2(); };
+::Dtor2::~Dtor2() { printf("Dtor2\n"); }
+Dtor2 d2;
+
 struct ANestedDtor { struct A1 { struct A2 { ~A2(); }; }; };
 ANestedDtor::A1::A2::~A2() { printf("Dtor A::A1::A2::~A2\n"); }
 
Index: clang/lib/Parse/ParseTentative.cpp
===================================================================
--- clang/lib/Parse/ParseTentative.cpp
+++ clang/lib/Parse/ParseTentative.cpp
@@ -62,6 +62,7 @@
   case tok::kw_static_assert:
   case tok::kw__Static_assert:
     return true;
+  case tok::coloncolon:
   case tok::identifier: {
     if (DisambiguatingWithExpression) {
       RevertingTentativeParsingAction TPA(*this);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D157480.549817.patch
Type: text/x-patch
Size: 949 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230814/b5791c00/attachment.bin>


More information about the cfe-commits mailing list