================
@@ -9674,6 +9674,40 @@ TEST_P(ASTImporterOptionSpecificTestBase, 
ImportInstantiatedFromMember) {
   EXPECT_TRUE(ImportedPartialSpecialization->getInstantiatedFromMember());
 }
 
+AST_MATCHER_P(EnumDecl, hasEnumConstName, StringRef, ConstName) {
+  for (EnumConstantDecl *D : Node.enumerators())
+    if (D->getName() == ConstName)
+      return true;
+  return false;
+}
+
+TEST_P(ASTImporterOptionSpecificTestBase, ImportAnonymousEnum) {
+  const char *ToCode =
+      R"(
+      struct A {
+        enum { E1, E2} x;
+        enum { E3, E4} y;
+      };
+      )";
+  Decl *ToTu = getToTuDecl(ToCode, Lang_CXX11);
+  auto *ToE = FirstDeclMatcher<EnumDecl>().match(
+      ToTu, enumDecl(hasEnumConstName("E1")));
----------------
jcsxky wrote:

Import test on the other enum has been added to make this test completely.

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