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 "" }
12 };
13
14 template <typename T>
15 struct D
16 {
17 static void func (X &ref = a); // { dg-error "cannot bind non-const lvalue reference" }
18 };
19
Foo(X & obj)20 void Foo (X & obj)
21 {
22 D<int>::func (obj);
23
24 D<int>::func (); // { dg-message "when instantiating default argument for call" }
25 }
26