c++: Make *_cast<*> parsing more robust to errors [PR108438]
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.ns / template13.C
blobe8e5304dae0fa6e049f6199f928082a57d269066
1 // { dg-do compile }
2 // Templates defined outside must be declared inside
3 namespace bar
5   // trick it to provide some prior declaration
6   template<class T>
7   void foo();
8   template<class T>class X; // { dg-message "note: previous declaration" }
11 template <typename T>
12 T const
13 bar::foo(T const &a)     // { dg-error "" "" { xfail *-*-* } } not declared in bar - 
15   return a;
18 template<> void bar::foo<int>()     // { dg-error "different namespace" "" { target c++98_only } }
22 template<class T,class U>
23 class bar::X{};         // { dg-error "redeclared with 2 template parameter" }