| 1 |
// { dg-do compile } |
| 2 |
|
| 3 |
// Origin: Volker Reichelt <[email protected]> |
| 4 |
|
| 5 |
// PR c++/11616: Incorrect line number in diagnostics |
| 6 |
|
| 7 |
template <int> struct A |
| 8 |
{ |
| 9 |
static const int i=0; |
| 10 |
}; |
| 11 |
|
| 12 |
int baz() { return A<0>::i; } |
| 13 |
|
| 14 |
struct B |
| 15 |
{ |
| 16 |
static void foo (int); // { dg-message "B::foo|candidate expects" } |
| 17 |
}; |
| 18 |
|
| 19 |
template <typename T> struct C |
| 20 |
{ |
| 21 |
virtual void bar() const // { dg-message "required" } |
| 22 |
{ |
| 23 |
T::foo(); // { dg-error "no matching function" } |
| 24 |
} |
| 25 |
}; |
| 26 |
|
| 27 |
C<B> c; |
| 28 |
|
| 29 |
int k; |