| 1 |
// { dg-do compile } |
| 2 |
|
| 3 |
// Origin: Volker Reichelt <[email protected]> and |
| 4 |
// Alexandre Oliva <[email protected]> |
| 5 |
|
| 6 |
// PR c++/18757: ICE in get_innermost_template_args |
| 7 |
|
| 8 |
struct A |
| 9 |
{ |
| 10 |
template<typename> void foo(int); |
| 11 |
template<typename T> void bar(T t) { |
| 12 |
this->foo<typename T>(t); } // { dg-error "expected|parse error|no matching" } |
| 13 |
template<typename T> void bad(T t) { |
| 14 |
foo<typename T>(t); } // { dg-error "expected|parse error|no matching" } |
| 15 |
}; |
| 16 |
|
| 17 |
template <typename T> |
| 18 |
struct B |
| 19 |
{ |
| 20 |
void bar(T t) { |
| 21 |
A().bar<typename T>(t); } // { dg-error "expected|parse error|no matching" } |
| 22 |
void bad(T t) { |
| 23 |
B<typename T>::bar(t); } // { dg-error "invalid|qualified-id|not a template" } |
| 24 |
}; |
| 25 |
|
| 26 |
void baz() |
| 27 |
{ |
| 28 |
A().bar(0); |
| 29 |
A().bad(0); |
| 30 |
B<int>().bar(0); |
| 31 |
} |