------- Comment #2 from bangerth at dealii dot org 2007-10-12 13:04 -------
The rule for template non-type arguments of integral type is 14.3.2/1:
1 A template-argument for a non-type, non-template template-parameter
shall be one of:
-- an integral constant-expression of integral or enumeration type;
...
Integral constant-expressions are dealt with in 5.19/1:
An integral constant-expression can involve only literals
(_lex.literal_), enumerators, const variables or static data members
of integral or enumeration types initialized with constant expressions
(_dcl.init_), non-type template parameters of integral or enumeration
types, and sizeof expressions. Floating literals (_lex.fcon_) can
appear only if they are cast to integral or enumeration types. Only
type conversions to integral or enumeration types can be used. In
particular, except in sizeof expressions, functions, class objects,
pointers, or references shall not be used, and assignment, increment,
decrement, function-call, or comma operators shall not be used.
I do not know whether bool(1) is considered a function-call. Gcc rejects
it as a template argument. However, it does accept (bool)1.
W.
--
bangerth at dealii dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bangerth at dealii dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33744