| 1 |
// { dg-do compile } |
| 2 |
// Origin: Ivan Godard <igodard at pacbell dot net> |
| 3 |
// PR c++/17447: Detect parameters of dependent types even in templates |
| 4 |
|
| 5 |
struct B; // { dg-message "forward declaration" } |
| 6 |
template<typename T> struct A { |
| 7 |
|
| 8 |
friend A& operator <<(A& a, B b) { return a; } // { dg-error "incomplete" } |
| 9 |
friend A& operator <<(A& a, T b) { return a; } |
| 10 |
|
| 11 |
void foo1(B b) {} // { dg-error "incomplete" } |
| 12 |
void foo1a(T b) {} |
| 13 |
|
| 14 |
B foo2(void) {} // { dg-error "incomplete" } |
| 15 |
T foo2a(void) {} |
| 16 |
|
| 17 |
void foo3(B b); |
| 18 |
}; |