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 @@ -376,6 +376,8 @@ Bug Fixes to C++ Support
376
376
- Fixed a crash in constant evaluation when trying to access a
377
377
captured ``this `` pointer in a lambda with an explicit object parameter.
378
378
Fixes (#GH80997)
379
+ - Fix an issue where missing set friend declaration in template class instantiation.
380
+ Fixes (#GH84368).
379
381
380
382
Bug Fixes to AST Handling
381
383
^^^^^^^^^^^^^^^^^^^^^^^^^
Original file line number Diff line number Diff line change @@ -1727,6 +1727,7 @@ Decl *TemplateDeclInstantiator::VisitClassTemplateDecl(ClassTemplateDecl *D) {
1727
1727
assert (!Owner->isDependentContext ());
1728
1728
Inst->setLexicalDeclContext (Owner);
1729
1729
RecordInst->setLexicalDeclContext (Owner);
1730
+ Inst->setObjectOfFriendDecl ();
1730
1731
1731
1732
if (PrevClassTemplate) {
1732
1733
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