| 1 |
// PR debug/80461 |
| 2 |
// { dg-do compile } |
| 3 |
// { dg-options "-g -O" } |
| 4 |
|
| 5 |
template <typename> class A; |
| 6 |
struct B |
| 7 |
{ |
| 8 |
template <typename T, typename U> |
| 9 |
static bool foo (U T::*) { return true; } |
| 10 |
}; |
| 11 |
template <typename, typename> class J; |
| 12 |
template <typename T, typename U, typename V, typename... W> |
| 13 |
class J<V (W...), U T::*> : public J<void(), U T::*> {}; |
| 14 |
template <typename T, typename U, typename... W> |
| 15 |
class J<void(W...), U T::*> : public B {}; |
| 16 |
template <typename V, typename... W> struct A<V (W...)> |
| 17 |
{ |
| 18 |
template <typename, typename> using K = int; |
| 19 |
template <typename L, typename = K<int, void>, typename = K<int, void>> A (L); |
| 20 |
}; |
| 21 |
template <typename V, typename... W> |
| 22 |
template <typename L, typename, typename> |
| 23 |
A<V (W...)>::A (L x) { J<V (), L>::foo (x); } |
| 24 |
struct N; |
| 25 |
volatile int v; |
| 26 |
|
| 27 |
template <class O, class P> |
| 28 |
void |
| 29 |
bar () |
| 30 |
{ |
| 31 |
O q; |
| 32 |
A<P> f = q; |
| 33 |
v++; |
| 34 |
} |
| 35 |
|
| 36 |
void |
| 37 |
baz () |
| 38 |
{ |
| 39 |
bar<int (N::*) (...) &, int()> (); |
| 40 |
bar<int (N::*) (...) const &, int()> (); |
| 41 |
bar<int (N::*) (...) volatile &, int()> (); |
| 42 |
} |