// { dg-do compile } // Copyright (C) 2003 Free Software Foundation, Inc. // Contributed by Nathan Sidwell 31 Jul 2003 // PR c++/11525 incorrect error about non-constant initalizer template class X; template class Y {}; template void Foo () { static const unsigned I = X::I; Y i; static const unsigned J = X::J; Y j; // { dg-error "non-constant" "" } } struct A { operator unsigned () const; }; template struct X { enum {I}; static A const J; }; void Baz () { Foo (); // { dg-error "instantiated" "" } }