------- Comment #12 from news at derived-software dot ltd dot uk 2006-11-12 11:04 ------- >From Aleksey Gurtovoy (co-author Boost.MPL): [wrt to this bug] Actually, no, enums in the bug's subject and reduced test case are a red herring. For example, this still fails for me on 4.1.1:
template< int C > int assertion_failed(int); template< class > struct N { static int const value = 1; static int const t = sizeof( assertion_failed<value>(0) ); }; int main() { N<int> n; return n.t; } As a matter of fact, my current workaround for this issue involves _introducing_ an auxiliary enum for the values that are used in function templates' non-type arguments, e.g.: template< int C > int assertion_failed(int); template< class > struct N { static int const value = 1; enum { gcc_workaround = value }; static int const t = sizeof( assertion_failed<gcc_workaround>(0) ); // it compiles, yay! }; -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29518