FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / g++.dg / template / ttp3.C
blob05bd44a172eaf8f4e942787c587d707b36b62e77
1 // { dg-do compile }
3 // Copyright (C) 2001 Free Software Foundation, Inc.
4 // Contributed by Nathan Sidwell 29 Dec 2001 <nathan@codesourcery.com>
6 // PR 5213. We failed to spot that class List was a template, rather
7 // than a non-template or specialization
10 template <class T> class vector { };
12 class OUTER {
13   public:
14   template <class T>
15   class List { };
16   
17   vector<class List> data; // { dg-error "type/value mismatch|expected a type|ISO C" "" }
20 template <class T>
21 class List { };                 // { dg-bogus "previous declaration" "" { xfail *-*-* } }
23 // This next line should just do a lookup of 'class List', and then
24 // get a type/value mismatch. Instead we try and push 'class List'
25 // into the global namespace and get a redeclaration error.
26 vector<class List > data;       // { dg-bogus "`struct List' redeclared|type/value mismatch" "" { xfail *-*-* } }