Debian Codegraph @

gcc/testsuite/g++.old-deja/g++.oliva/typename2.C

raw
1 // { dg-do assemble }
2 // { dg-options "" }
3
4 // Copyright (C) 1999 Free Software Foundation
5
6 // by Alexandre Oliva <[email protected]>
7 // based on bug report by Nick Rasmussen <[email protected]>
8
9 // This is slightly different from typename1.C. This one tests
10 // whether the implicit typename extension works. gcc 2.95 reports:
11
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)
15
16 // But baz<T>::foo is not a base class, and `foo' should have been
17 // found in baz's scope.
18
19 struct foo;
20
21 template <class T> struct bar {
22 typedef int foo;
23 };
24
25 template <class T> struct baz {
26 typedef bar<T>::foo foo; // { dg-error "need 'typename' before" "" { target c++17_down } }
27 void m(foo);
28 };