sammccall created this revision.
sammccall added a reviewer: ilya-biryukov.
Herald added a subscriber: kadircet.
Herald added a project: All.
sammccall requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Fixes https://github.com/clangd/clangd/issues/1281


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D134243

Files:
  clang/lib/Parse/ParseDecl.cpp
  clang/test/CodeCompletion/using-enum.cpp


Index: clang/test/CodeCompletion/using-enum.cpp
===================================================================
--- /dev/null
+++ clang/test/CodeCompletion/using-enum.cpp
@@ -0,0 +1,7 @@
+enum class AAA { X, Y, Z };
+
+namespace N2 {
+  using enum AAA;
+  // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:4:14 %s | FileCheck 
-check-prefix=CHECK-CC1 %s
+  // CHECK-CC1: COMPLETION: AAA
+};
Index: clang/lib/Parse/ParseDecl.cpp
===================================================================
--- clang/lib/Parse/ParseDecl.cpp
+++ clang/lib/Parse/ParseDecl.cpp
@@ -4588,6 +4588,7 @@
     // Code completion for an enum name.
     cutOffParsing();
     Actions.CodeCompleteTag(getCurScope(), DeclSpec::TST_enum);
+    DS.SetTypeSpecError();
     return;
   }
 


Index: clang/test/CodeCompletion/using-enum.cpp
===================================================================
--- /dev/null
+++ clang/test/CodeCompletion/using-enum.cpp
@@ -0,0 +1,7 @@
+enum class AAA { X, Y, Z };
+
+namespace N2 {
+  using enum AAA;
+  // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:4:14 %s | FileCheck -check-prefix=CHECK-CC1 %s
+  // CHECK-CC1: COMPLETION: AAA
+};
Index: clang/lib/Parse/ParseDecl.cpp
===================================================================
--- clang/lib/Parse/ParseDecl.cpp
+++ clang/lib/Parse/ParseDecl.cpp
@@ -4588,6 +4588,7 @@
     // Code completion for an enum name.
     cutOffParsing();
     Actions.CodeCompleteTag(getCurScope(), DeclSpec::TST_enum);
+    DS.SetTypeSpecError();
     return;
   }
 
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to