//Purpose: // Example of g++ diagnosing incomplete type for static class variable of // same type as inclosing template class. // //#define NON_NESTD template struct expr ; template < typename Arg0 > struct args1 { static const long size = 1; typedef Arg0 arg0; }; template < typename T > struct terminal { terminal (); typedef expr >type; typedef T arg0_type; }; template struct expr { typename Args::arg0 arg0; expr(); }; enum inp_numerals { inp_0 , inp_1 }; template < inp_numerals Num > struct inp { typedef typename terminal < inp >::type type ; static type const the_static ; }; #ifdef NON_NESTD terminal >::type the_static ; #endif int main() { void const*p=&(inp::the_static) ; return p!=0 ;}