c++: add fixed test [PR115616]
This got fixed by r15-2120. PR c++/115616 gcc/testsuite/ChangeLog: * g++.dg/template/friend83.C: New test.
This commit is contained in:
parent
f93a38f3fc
commit
ffd56dcc11
1 changed files with 24 additions and 0 deletions
24
gcc/testsuite/g++.dg/template/friend83.C
Normal file
24
gcc/testsuite/g++.dg/template/friend83.C
Normal file
|
@ -0,0 +1,24 @@
|
|||
// PR c++/115616
|
||||
// { dg-do compile { target c++20 } }
|
||||
|
||||
template <int X, int Y> void bar() {}
|
||||
|
||||
template <typename T>
|
||||
struct Reader
|
||||
{
|
||||
template <int X>
|
||||
friend void foo(Reader<T>);
|
||||
};
|
||||
|
||||
template <typename T, int Y>
|
||||
struct Writer
|
||||
{
|
||||
template <int X>
|
||||
friend void foo(Reader<T>) {bar<X, Y>();}
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
foo<10>(Reader<int>{});
|
||||
Writer<int, 20>{};
|
||||
}
|
Loading…
Add table
Reference in a new issue