re PR c++/24163 (dependent Base class scope examined during unqualified name lookup...
[platform/upstream/gcc.git] / gcc / testsuite / g++.dg / tc1 / dr213.C
1 // { dg-do compile }
2 // Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
3 // DR213: Lookup in dependent base classes
4
5 // We should emit an error at *instantiation* time because g(t) can't be
6 //  resolved to any function.
7
8 template <class T> struct A : T {
9   void h(T t) {
10     f(t);
11     g(t);     // { dg-message "" }
12   }
13 };
14
15 struct B {
16   void f(B);
17   void g(B) {}
18 };
19
20 void f(B) {}
21
22 int main()
23 {
24   A<B> ab;
25   B b;
26   ab.h(b);   // { dg-message "instantiated" }
27 }