File tree Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -351,6 +351,8 @@ Bug Fixes to C++ Support
351
351
when one of the function had more specialized templates.
352
352
Fixes (`#82509 <https://github.com/llvm/llvm-project/issues/82509 >`_)
353
353
and (`#74494 <https://github.com/llvm/llvm-project/issues/74494 >`_)
354
+ - Fix an issue where missing set friend declaration in template class instantiation.
355
+ Fixes (#GH84368).
354
356
355
357
Bug Fixes to AST Handling
356
358
^^^^^^^^^^^^^^^^^^^^^^^^^
Original file line number Diff line number Diff line change @@ -1698,6 +1698,7 @@ Decl *TemplateDeclInstantiator::VisitClassTemplateDecl(ClassTemplateDecl *D) {
1698
1698
assert (!Owner->isDependentContext ());
1699
1699
Inst->setLexicalDeclContext (Owner);
1700
1700
RecordInst->setLexicalDeclContext (Owner);
1701
+ Inst->setObjectOfFriendDecl ();
1701
1702
1702
1703
if (PrevClassTemplate) {
1703
1704
Inst->setCommonPtr (PrevClassTemplate->getCommonPtr ());
Original file line number Diff line number Diff line change
1
+ // RUN: %clang_cc1 -std=c++20 -verify %s
2
+ // RUN: %clang_cc1 -std=c++23 -verify %s
3
+ // expected-no-diagnostics
4
+
5
+ template <class T > concept IsOk = requires () { typename T::Float; };
6
+
7
+ template <IsOk T> struct Thing ;
8
+
9
+ template <IsOk T> struct Foobar {
10
+ template <int > struct Inner {
11
+ template <IsOk T2> friend struct Thing ;
12
+ };
13
+ };
14
+
15
+ struct MyType { using Float=float ; };
16
+ Foobar<MyType>::Inner<0 > foobar;
You can’t perform that action at this time.
0 commit comments