Testcase: template< int C > int assertion_failed( int); template< class > struct N { static int const okay = 1; static int const t = sizeof( assertion_failed<okay>( 0)) ; }; int main() { N<int> n; return n.t; }
Note I could not find this bug filed so I filed it. Also note I found it while looking at PR 29518. Oh and the error message is: [pinskia@celery ~]$ ~/gcc-4.0/bin/gcc t.cc t.cc: In instantiation of ‘const int N<int>::t’: t.cc:13: instantiated from here t.cc:7: error: ‘N<int>::okay’ is not a valid template argument for type ‘int’ because it is a non-constant expression t.cc:7: error: no matching function for call to ‘assertion_failed(int)’
won't fix in GCC-4.0.x.