//Purpose: // Example of g++ diagnosing incomplete type for static class variable of // same type as inclosing template class. // //#define NON_NESTD #define USE_PROTO #ifdef USE_PROTO #include #include using namespace boost; #else namespace proto { template < class X > struct terminal { typedef int type ; }; }//exit proto namespace #endif enum inp_numerals { inp_0 , inp_1 }; template < inp_numerals Num > struct inp { typedef typename proto:: terminal ::type type ; static const type c ; }; #ifdef NON_NESTD typedef proto::terminal >::type inp_0_type ; inp_0_type inp_0_val ; #endif int main() { void const*p=&(inp::c); return p!=0; }