Debian Codegraph @

gcc/testsuite/g++.dg/template/qualttp20.C

raw
1 // { dg-do compile }
2 // { dg-options "-pedantic -pedantic-errors" }
3
4 // Copyright (C) 2001 Free Software Foundation, Inc.
5 // Contributed by Nathan Sidwell 15 Dec 2001 <[email protected]>
6
7 // PR 2645
8
9 struct AS
10 {
11 typedef void (myT) ();
12 struct L {};
13
14 };
15
16
17 template <typename T> struct B1 : T
18 {
19 typedef typename T::L __restrict__ r;// { dg-error "'__restrict__' qualifiers cannot" }
20 typedef typename T::myT __restrict__ p;
21
22 // The following are DR 295 dependent
23 typedef typename T::myT volatile *myvolatile;
24 typename T::myT volatile *a;
25 myvolatile b;
26 };
27 template <typename T> struct B2 : T
28 {
29 // The following are DR 295 dependent
30 typedef typename T::myT const *myconst;
31 typename T::myT const *a;
32 myconst b;
33 };
34
35 B1<AS> b1; // { dg-message "required" }
36 B2<AS> b2;