OSDN Git Service

PR c++/27177
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / template / defarg6.C
1 // Copyright (C) 2005 Free Software Foundation, Inc.
2 // Contributed by Nathan Sidwell 14 Oct 2005 <nathan@codesourcery.com>
3
4 // PR 21353 missing error.
5 // Origin:Andrew Pinski <pinskia@gcc.gnu.org>
6
7 enum X{ a, b, c };
8
9 struct C
10 {
11   static void func (X &ref = a); // { dg-error "default argument" "" }
12 };
13
14 template <typename T>
15 struct D
16 {
17   static void func (X &ref = a); // not an error at this point
18 };
19
20 void Foo (X & obj)
21 {
22   D<int>::func (obj);
23
24   D<int>::func (); // { dg-error "default argument" "" }
25 }