2008-07-06 Kai Tietz <kai.tietz@onevision.com>
[official-gcc.git] / gcc / testsuite / g++.dg / parse / non-dependent2.C
blobef75c17aef39e87e9b6b5ae5eaf0fc65aed0b94f
1 // { dg-do compile }
3 // Copyright (C) 2003 Free Software Foundation, Inc.
4 // Contributed by Nathan Sidwell 16 Jul 2003 <nathan@codesourcery.com>
6 // A non-dependent field_decl can bind at parse time.
8 template <class T>
9 struct Foo {
10   int j; // we never see this one.
11   int k; // { dg-error "" "" }
12   
15 struct Baz 
17   int j;
18   int k; // { dg-error "" "" }
19   
22 template <class T>
23 struct Bar : public Foo<T>, Baz {
24   
25   int baz () { return j; } // binds to Baz::j
26   int foo () { return this->k; } // { dg-error "request for member" "" }
29 int main()
31   Bar<int> bar;
33   bar.baz ();
34   bar.foo (); // { dg-error "instantiated" "" }
35   
36   return 0;