================
@@ -9674,6 +9674,27 @@ TEST_P(ASTImporterOptionSpecificTestBase, 
ImportInstantiatedFromMember) {
   EXPECT_TRUE(ImportedPartialSpecialization->getInstantiatedFromMember());
 }
 
+TEST_P(ASTImporterOptionSpecificTestBase, ImportAnonymousEnum) {
+  const char *ToCode =
+      R"(
+      struct A {
+        enum { E1,E2} x;
+      };
+      )";
+  (void)getToTuDecl(ToCode, Lang_CXX11);
+  const char *Code =
+      R"(
+      struct A {
+        enum { E1,E2} x;
+      };
+      )";
+  Decl *FromTU = getTuDecl(Code, Lang_CXX11);
+  auto *FromE = FirstDeclMatcher<EnumDecl>().match(FromTU, enumDecl());
+  auto *ToE = Import(FromE, Lang_CXX11);
+  ASSERT_TRUE(ToE);
+  EXPECT_FALSE(ToE->enumerators().empty());
----------------
jcsxky wrote:

Done.

https://github.com/llvm/llvm-project/pull/93923
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to