OSDN Git Service

2014-02-26 Fabien Chene <fabien@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / template / error2.C
1 // { dg-do compile }
2
3 // Copyright (C) 2003 Free Software Foundation, Inc.
4 // Contributed by Nathan Sidwell 14 Aug 2003 <nathan@codesourcery.com>
5
6 // required from did not indicate the nested class
7
8 template<class T> struct X
9 {
10   T m;  // { dg-error "as type 'void'" "void" }
11         // { dg-error "incomplete type" "incomplate" { target *-*-* } 10 }
12         // { dg-error "invalid" "invalid" { target *-*-* } 10 }
13 };
14
15 template<class T >
16 struct Derived
17 {
18   class Nested : public X<T> // { dg-message "required" "" }
19   {
20   };
21   
22   Nested m; // { dg-message "required" "" }
23   
24   void Foo ();
25 };
26
27 void Foo (Derived<void> &x)
28 {
29   x.Foo (); // { dg-message "required" "" }
30 }