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 7enum X{ a, b, c }; 8 9struct C 10{ 11 static void func (X &ref = a); // { dg-error "" } 12}; 13 14template <typename T> 15struct D 16{ 17 static void func (X &ref = a); // not an error at this point 18}; 19 20void Foo (X & obj) 21{ 22 D<int>::func (obj); 23 24 D<int>::func (); // { dg-error "" } 25} 26 27// { dg-prune-output "passing argument" } 28