http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27403



Jonathan Wakely <redi at gcc dot gnu.org> changed:



           What    |Removed                     |Added

----------------------------------------------------------------------------

             Status|UNCONFIRMED                 |RESOLVED

         Resolution|                            |INVALID



--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2013-01-19 
14:22:55 UTC ---

Wolfgang is right, the testcase is invalid, T() is parsed as a function type,

not an expression that value-initializes a T.



[temp.arg]p2, "In a template-argument, an ambiguity between a type-id and an

expression is resolved to a type-id, regardless of the form of the

corresponding template-parameter."



i.e. it doesn't matter that the argument is expecting a non-type parameter of

type int, because T() can be a type-id it is interpreted as one.



(This happened to be discussed last month on the committee reflectors)



Using T{} in C++11 works because that cannot be a type-id and is unambiguously

an initialization of T.

Reply via email to