2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.dg / template / qualttp20.C
blob6c68a3a2a8afc47e3c6d20565923ffd6485d0057
1 // { dg-do compile }
3 // Copyright (C) 2001 Free Software Foundation, Inc.
4 // Contributed by Nathan Sidwell 15 Dec 2001 <nathan@codesourcery.com>
6 // PR 2645
8 struct AS
10   typedef void (myT) ();
11   struct L {};
12   
16 template <typename T> struct B1 : T
18   typedef typename T::L __restrict__ r;// { dg-error "`__restrict' qualifiers cannot" "" }
19   typedef typename T::myT __restrict__ p;// { dg-warning "ignoring `__restrict'" "" { xfail *-*-* } }
21   // The following are DR 295 dependent
22   typedef typename T::myT volatile *myvolatile; // { dg-error "qualifiers" ""  }
23   typename T::myT volatile *a;    // { dg-error "qualifiers" "" }
24   myvolatile b;                  // { dg-error "qualifiers" "" }
26 template <typename T> struct B2 : T
28   // The following are DR 295 dependent
29   typedef typename T::myT const *myconst; // { dg-error "qualifiers" "" }
30   typename T::myT const *a; // { dg-error "qualifiers" "" }
31   myconst b; // { dg-error "qualifiers" "" }
34 B1<AS> b1;      // { dg-error "instantiated" "" }
35 B2<AS> b2;      // { dg-error "instantiated" "" }