1 // { dg-do compile }
2
3 // Origin: Volker Reichelt <reichelt@gcc.gnu.org>
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
baz()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 {
barC21 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;
30