forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reapply "[Clang][Sema] Always use latest redeclaration of primary tem…
…plate" (llvm#114569) This patch reapplies llvm#114258, fixing an infinite recursion bug in `ASTImporter` that occurs when importing the primary template of a class template specialization when the latest redeclaration of that template is a friend declaration in the primary template.
- Loading branch information
1 parent
8d0e660
commit 2e1b618
Showing
12 changed files
with
222 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
clang/test/ASTMerge/class-template-spec/Inputs/class-template-spec.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
namespace N0 { | ||
template<typename T> | ||
struct A { | ||
template<typename U> | ||
friend struct A; | ||
}; | ||
|
||
template struct A<long>; | ||
} // namespace N0 | ||
|
||
namespace N1 { | ||
template<typename T> | ||
struct A; | ||
|
||
template<typename T> | ||
struct A { | ||
template<typename U> | ||
friend struct A; | ||
}; | ||
|
||
template struct A<long>; | ||
} // namespace N1 | ||
|
||
namespace N2 { | ||
template<typename T> | ||
struct A { | ||
template<typename U> | ||
friend struct A; | ||
}; | ||
|
||
template<typename T> | ||
struct A; | ||
|
||
template struct A<long>; | ||
} // namespace N2 | ||
|
||
namespace N3 { | ||
struct A { | ||
template<typename T> | ||
friend struct B; | ||
}; | ||
|
||
template<typename T> | ||
struct B { }; | ||
|
||
template struct B<long>; | ||
} // namespace N3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// RUN: %clang_cc1 -emit-pch -o %t.1.ast %S/Inputs/class-template-spec.cpp | ||
// RUN: %clang_cc1 -ast-merge %t.1.ast -fsyntax-only -verify %s | ||
// expected-no-diagnostics | ||
|
||
template struct N0::A<short>; | ||
template struct N1::A<short>; | ||
template struct N2::A<short>; | ||
template struct N3::B<short>; |
Oops, something went wrong.