[clang] [clang][ASTImporter] skip TemplateTypeParmDecl in VisitTypeAliasTemplateDecl (PR #74919)

2023-12-08 Thread Qizhi Hu via cfe-commits
https://github.com/jcsxky created https://github.com/llvm/llvm-project/pull/74919 Skip checking `TemplateTypeParmDecl ` in `VisitTypeAliasTemplateDecl`. [Fix this crash](https://github.com/llvm/llvm-project/issues/74765) >From b3c28d66efb98dff8b8f879bda92341bf62f45d3 Mon Sep 17 00:00:00 2001 F

[clang] [clang][ASTImporter] skip TemplateTypeParmDecl in VisitTypeAliasTemplateDecl (PR #74919)

2023-12-08 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Qizhi Hu (jcsxky) Changes Skip checking `TemplateTypeParmDecl ` in `VisitTypeAliasTemplateDecl`. [Fix this crash](https://github.com/llvm/llvm-project/issues/74765) --- Full diff: https://github.com/llvm/llvm-project/pull/74919.diff 2 F

[clang] [clang][ASTImporter] skip TemplateTypeParmDecl in VisitTypeAliasTemplateDecl (PR #74919)

2023-12-10 Thread Qizhi Hu via cfe-commits
https://github.com/jcsxky updated https://github.com/llvm/llvm-project/pull/74919 >From e656aa2a3850f845987bb0ddc56b308d22d2dafd Mon Sep 17 00:00:00 2001 From: huqizhi Date: Sat, 9 Dec 2023 12:00:02 +0800 Subject: [PATCH] [clang][ASTImporter] skip TemplateTypeParmDecl in VisitTypeAliasTemplate

[clang] [clang][ASTImporter] skip TemplateTypeParmDecl in VisitTypeAliasTemplateDecl (PR #74919)

2023-12-12 Thread Balázs Kéri via cfe-commits
balazske wrote: The problem may be related to the fact that template parameter declarations can have the `TranslationUnitDecl` as parent until the template (with these parameters) is finally created. In the temporary phase the object (`TemplateTypeParmDecl`) is found with lookup if it has the

[clang] [clang][ASTImporter] skip TemplateTypeParmDecl in VisitTypeAliasTemplateDecl (PR #74919)

2023-12-12 Thread Balázs Kéri via cfe-commits
balazske wrote: The `VisitTypeAliasTemplateDecl` function should be re-designed to check for structural equivalence at import. The following test does not pass because an existing `TypeAliasTemplateDecl` declaration with the same name is always found and returned, without check for structural

[clang] [clang][ASTImporter] skip TemplateTypeParmDecl in VisitTypeAliasTemplateDecl (PR #74919)

2023-12-13 Thread Qizhi Hu via cfe-commits
jcsxky wrote: > The `VisitTypeAliasTemplateDecl` function should be re-designed to check for > structural equivalence at import. The following test does not pass because an > existing `TypeAliasTemplateDecl` declaration with the same name is always > found and returned, without check for struc

[clang] [clang][ASTImporter] skip TemplateTypeParmDecl in VisitTypeAliasTemplateDecl (PR #74919)

2023-12-13 Thread Qizhi Hu via cfe-commits
jcsxky wrote: > The problem may be related to the fact that template parameter declarations > can have the `TranslationUnitDecl` as parent until the template (with these > parameters) is finally created. In the temporary phase the object > (`TemplateTypeParmDecl`) is found with lookup if it ha

[clang] [clang][ASTImporter] skip TemplateTypeParmDecl in VisitTypeAliasTemplateDecl (PR #74919)

2023-12-13 Thread Balázs Kéri via cfe-commits
balazske wrote: `VisitTypeAliasTemplateDecl` looks wrong and some fix should be made, this PR is good for the fix. This import function is different from the others because `ConflictingDecls` is populated when an object with different type is found, but this is the correct way. I think that `T

[clang] [clang][ASTImporter] skip TemplateTypeParmDecl in VisitTypeAliasTemplateDecl (PR #74919)

2023-12-13 Thread Balázs Kéri via cfe-commits
balazske wrote: This code for the loop in `VisitTypeAliasTemplateDecl` should work: ``` for (auto *FoundDecl : FoundDecls) { if (!FoundDecl->isInIdentifierNamespace(IDNS)) continue; if (auto *FoundAlias = dyn_cast(FoundDecl)) { if (IsStructuralMatch(D, FoundAlias))

[clang] [clang][ASTImporter] skip TemplateTypeParmDecl in VisitTypeAliasTemplateDecl (PR #74919)

2023-12-13 Thread Balázs Kéri via cfe-commits
@@ -9284,6 +9284,29 @@ TEST_P(ASTImporterOptionSpecificTestBase, // EXPECT_EQ(ToF1Imported->getPreviousDecl(), ToF1); } +TEST_P(ASTImporterOptionSpecificTestBase, ImportTypeAliasTemplateDecl) { balazske wrote: I like better names for the test (`ImportTypeA

[clang] [clang][ASTImporter] skip TemplateTypeParmDecl in VisitTypeAliasTemplateDecl (PR #74919)

2023-12-13 Thread Qizhi Hu via cfe-commits
https://github.com/jcsxky updated https://github.com/llvm/llvm-project/pull/74919 >From e4e981ed4f545f3dd4cc709bab30468a8ceb3962 Mon Sep 17 00:00:00 2001 From: huqizhi Date: Sat, 9 Dec 2023 12:00:02 +0800 Subject: [PATCH] [clang][ASTImporter] skip TemplateTypeParmDecl in VisitTypeAliasTemplate

[clang] [clang][ASTImporter] skip TemplateTypeParmDecl in VisitTypeAliasTemplateDecl (PR #74919)

2023-12-13 Thread Qizhi Hu via cfe-commits
https://github.com/jcsxky updated https://github.com/llvm/llvm-project/pull/74919 >From a2dcc7f471237e78f374c204216c6574059aa950 Mon Sep 17 00:00:00 2001 From: huqizhi Date: Sat, 9 Dec 2023 12:00:02 +0800 Subject: [PATCH] [clang][ASTImporter] skip TemplateTypeParmDecl in VisitTypeAliasTemplate

[clang] [clang][ASTImporter] skip TemplateTypeParmDecl in VisitTypeAliasTemplateDecl (PR #74919)

2023-12-13 Thread Qizhi Hu via cfe-commits
jcsxky wrote: > The `VisitTypeAliasTemplateDecl` function should be re-designed to check for > structural equivalence at import. The following test does not pass because an > existing `TypeAliasTemplateDecl` declaration with the same name is always > found and returned, without check for struc

[clang] [clang][ASTImporter] skip TemplateTypeParmDecl in VisitTypeAliasTemplateDecl (PR #74919)

2023-12-19 Thread Balázs Kéri via cfe-commits
balazske wrote: > > Is import of `Callable` should be failed? I compiled this code > > ```c++ > struct S; > template > using Callable = S; > template > using Callable = S; > ``` > > and clang report an error. Yes the test was not exact, with the new code this import should fail. https://gi

[clang] [clang][ASTImporter] skip TemplateTypeParmDecl in VisitTypeAliasTemplateDecl (PR #74919)

2023-12-19 Thread Balázs Kéri via cfe-commits
@@ -1977,6 +1977,22 @@ static bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, D2->getTemplatedDecl()->getType()); } +static bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, +

[clang] [clang][ASTImporter] skip TemplateTypeParmDecl in VisitTypeAliasTemplateDecl (PR #74919)

2023-12-19 Thread Qizhi Hu via cfe-commits
https://github.com/jcsxky updated https://github.com/llvm/llvm-project/pull/74919 >From 583cbd47533ff1aa71874c502affc44ce5b5c107 Mon Sep 17 00:00:00 2001 From: huqizhi Date: Sat, 9 Dec 2023 12:00:02 +0800 Subject: [PATCH] [clang][ASTImporter] skip TemplateTypeParmDecl in VisitTypeAliasTemplate

[clang] [clang][ASTImporter] skip TemplateTypeParmDecl in VisitTypeAliasTemplateDecl (PR #74919)

2023-12-22 Thread Balázs Kéri via cfe-commits
https://github.com/balazske approved this pull request. https://github.com/llvm/llvm-project/pull/74919 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ASTImporter] skip TemplateTypeParmDecl in VisitTypeAliasTemplateDecl (PR #74919)

2023-12-24 Thread Qizhi Hu via cfe-commits
https://github.com/jcsxky closed https://github.com/llvm/llvm-project/pull/74919 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits