aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/concepts-friend13.C
blob: 3cc4505a7eff493276d6ef904c6611a6619079f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Verify we substitute the correct outer template arguments
// when instantiating a constrained template friend declared
// inside a partial specialization.
// { dg-do compile { target c++20 } }

template<class U>
  requires __is_same(int*, U)
void f() { };

template<class T>
struct A;

template<class T>
struct A<T*> {
  template<class U>
    requires __is_same(T, U)
  friend void f() { } // { dg-bogus "redefinition" }
};

template struct A<int*>;