[clang] [clang][ASTImport] fix issue on anonymous enum import (PR #93923)

2024-06-04 Thread Qizhi Hu via cfe-commits
https://github.com/jcsxky closed 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

[clang] [clang][ASTImport] fix issue on anonymous enum import (PR #93923)

2024-06-04 Thread Balázs Kéri via cfe-commits
https://github.com/balazske approved this pull request. 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

[clang] [clang][ASTImport] fix issue on anonymous enum import (PR #93923)

2024-06-03 Thread Qizhi Hu via cfe-commits
@@ -9674,6 +9674,40 @@ TEST_P(ASTImporterOptionSpecificTestBase, ImportInstantiatedFromMember) { EXPECT_TRUE(ImportedPartialSpecialization->getInstantiatedFromMember()); } +AST_MATCHER_P(EnumDecl, hasEnumConstName, StringRef, ConstName) { + for (EnumConstantDecl *D : Node.

[clang] [clang][ASTImport] fix issue on anonymous enum import (PR #93923)

2024-06-03 Thread Qizhi Hu via cfe-commits
@@ -9674,6 +9674,40 @@ TEST_P(ASTImporterOptionSpecificTestBase, ImportInstantiatedFromMember) { EXPECT_TRUE(ImportedPartialSpecialization->getInstantiatedFromMember()); } +AST_MATCHER_P(EnumDecl, hasEnumConstName, StringRef, ConstName) { + for (EnumConstantDecl *D : Node.

[clang] [clang][ASTImport] fix issue on anonymous enum import (PR #93923)

2024-06-03 Thread Qizhi Hu via cfe-commits
https://github.com/jcsxky updated https://github.com/llvm/llvm-project/pull/93923 >From 7e602ae8d3c7ca0c3218d8ce9106510c43b6295b Mon Sep 17 00:00:00 2001 From: huqizhi Date: Fri, 31 May 2024 13:12:41 +0800 Subject: [PATCH 1/2] [clang][ASTImport] fix issue on anonymous enum import --- clang/li

[clang] [clang][ASTImport] fix issue on anonymous enum import (PR #93923)

2024-06-03 Thread Balázs Kéri via cfe-commits
https://github.com/balazske commented: The change looks good, only the test can be made more exact. 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/

[clang] [clang][ASTImport] fix issue on anonymous enum import (PR #93923)

2024-06-03 Thread Balázs Kéri via cfe-commits
@@ -9674,6 +9674,40 @@ TEST_P(ASTImporterOptionSpecificTestBase, ImportInstantiatedFromMember) { EXPECT_TRUE(ImportedPartialSpecialization->getInstantiatedFromMember()); } +AST_MATCHER_P(EnumDecl, hasEnumConstName, StringRef, ConstName) { + for (EnumConstantDecl *D : Node.

[clang] [clang][ASTImport] fix issue on anonymous enum import (PR #93923)

2024-06-03 Thread Balázs Kéri via cfe-commits
@@ -9674,6 +9674,40 @@ TEST_P(ASTImporterOptionSpecificTestBase, ImportInstantiatedFromMember) { EXPECT_TRUE(ImportedPartialSpecialization->getInstantiatedFromMember()); } +AST_MATCHER_P(EnumDecl, hasEnumConstName, StringRef, ConstName) { + for (EnumConstantDecl *D : Node.

[clang] [clang][ASTImport] fix issue on anonymous enum import (PR #93923)

2024-06-03 Thread Balázs Kéri via cfe-commits
https://github.com/balazske edited 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

[clang] [clang][ASTImport] fix issue on anonymous enum import (PR #93923)

2024-05-31 Thread Qizhi Hu via cfe-commits
@@ -9674,6 +9674,27 @@ TEST_P(ASTImporterOptionSpecificTestBase, ImportInstantiatedFromMember) { EXPECT_TRUE(ImportedPartialSpecialization->getInstantiatedFromMember()); } +TEST_P(ASTImporterOptionSpecificTestBase, ImportAnonymousEnum) { + const char *ToCode = + R"( +

[clang] [clang][ASTImport] fix issue on anonymous enum import (PR #93923)

2024-05-31 Thread Qizhi Hu via cfe-commits
jcsxky wrote: > Does this work on the following code? > > ``` > struct A { > enum { E1,E2 } x; > enum { E3,E4 } y; > }; > ``` I have updated testcase according to your suggestion to demonstrate this solution works correctly on the testcase above. https://github.com/

[clang] [clang][ASTImport] fix issue on anonymous enum import (PR #93923)

2024-05-31 Thread Qizhi Hu via cfe-commits
https://github.com/jcsxky updated https://github.com/llvm/llvm-project/pull/93923 >From 7e602ae8d3c7ca0c3218d8ce9106510c43b6295b Mon Sep 17 00:00:00 2001 From: huqizhi Date: Fri, 31 May 2024 13:12:41 +0800 Subject: [PATCH 1/2] [clang][ASTImport] fix issue on anonymous enum import --- clang/li

[clang] [clang][ASTImport] fix issue on anonymous enum import (PR #93923)

2024-05-31 Thread Balázs Kéri via cfe-commits
@@ -9674,6 +9674,27 @@ TEST_P(ASTImporterOptionSpecificTestBase, ImportInstantiatedFromMember) { EXPECT_TRUE(ImportedPartialSpecialization->getInstantiatedFromMember()); } +TEST_P(ASTImporterOptionSpecificTestBase, ImportAnonymousEnum) { + const char *ToCode = + R"( +

[clang] [clang][ASTImport] fix issue on anonymous enum import (PR #93923)

2024-05-31 Thread Balázs Kéri via cfe-commits
https://github.com/balazske edited 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

[clang] [clang][ASTImport] fix issue on anonymous enum import (PR #93923)

2024-05-31 Thread Balázs Kéri via cfe-commits
https://github.com/balazske commented: Does this work on the following code? ``` struct A { enum { E1,E2 } x; enum { E3,E4 } y; }; ``` https://github.com/llvm/llvm-project/pull/93923 ___ cfe-commits mailing list cfe-commits@

[clang] [clang][ASTImport] fix issue on anonymous enum import (PR #93923)

2024-05-30 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Qizhi Hu (jcsxky) Changes Don't skip searching in `ToContext` during importing `EnumDecl`. And `IsStructuralMatch` in `StructralEquivalence` can make sure to determine whether the found result is match or not. --- Full diff: https://gith

[clang] [clang][ASTImport] fix issue on anonymous enum import (PR #93923)

2024-05-30 Thread Qizhi Hu via cfe-commits
https://github.com/jcsxky created https://github.com/llvm/llvm-project/pull/93923 Don't skip searching in `ToContext` during importing `EnumDecl`. And `IsStructuralMatch` in `StructralEquivalence` can make sure to determine whether the found result is match or not. >From 7e602ae8d3c7ca0c3218d