FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.oliva / typename2.C
blobf0737cd53846e065802dc771ff78a4045383fa38
1 // Build don't link:
2 // Special g++ Options:
4 // Copyright (C) 1999 Free Software Foundation
6 // by Alexandre Oliva <oliva@dcc.unicamp.br>
7 // based on bug report by Nick Rasmussen <nick@jive.org>
9 // This is slightly different from typename1.C.  This one tests
10 // whether the implicit typename extension works.  gcc 2.95 reports:
12 // warning: lookup of `foo' finds `struct foo'
13 // warning:   instead of `baz<T>::foo' from dependent base class
14 // warning:   (use `typename baz::foo' if that's what you meant)
16 // But baz<T>::foo is not a base class, and `foo' should have been
17 // found in baz's scope.
19 struct foo;
21 template <class T> struct bar {
22   typedef int foo;
25 template <class T> struct baz {
26   typedef bar<T>::foo foo; // ERROR - implicit typename
27   void m(foo);