[Bug c++/53464] Invalid default value for non-type template parameter is accepted

2012-05-24 Thread daniel.kruegler at googlemail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53464

Daniel Krügler  changed:

   What|Removed |Added

 CC||daniel.kruegler at
   ||googlemail dot com

--- Comment #1 from Daniel Krügler  
2012-05-24 07:19:28 UTC ---
I don't see why the expression A::get() should not be a converted constant
expression of the type of the template parameter, please be more specific. The
rationale provided in the referenced link does not sound convincing to me. 

In the context of the instantiation the expression A::get() is a prvalue core
constant expression of int type, thus it is a literal constant expression of
int type. It is also a converted constant expression of type int, because
A::get() already has the type int (after instantiation).


[Bug c++/53464] Invalid default value for non-type template parameter is accepted

2012-05-24 Thread schaub.johannes at googlemail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53464

Johannes Schaub  changed:

   What|Removed |Added

 CC||schaub.johannes at
   ||googlemail dot com

--- Comment #2 from Johannes Schaub  
2012-05-24 07:51:09 UTC ---
Daniel, nice to meet you again :)

See my SO answer and Richard's opinion at
http://stackoverflow.com/a/10727719/34509 .


[Bug c++/53464] Invalid default value for non-type template parameter is accepted

2012-05-24 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53464

Jonathan Wakely  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||INVALID

--- Comment #3 from Jonathan Wakely  2012-05-24 
10:48:58 UTC ---
Invalid then, thanks.


[Bug c++/53464] Invalid default value for non-type template parameter is accepted

2012-05-24 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53464

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #4 from Jakub Jelinek  2012-05-24 
11:27:10 UTC ---
The testcase would be nice for the testsuite though.


[Bug c++/53464] Invalid default value for non-type template parameter is accepted

2012-05-24 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53464

--- Comment #5 from Paolo Carlini  2012-05-24 
11:39:10 UTC ---
Later today I will add it.


[Bug c++/53464] Invalid default value for non-type template parameter is accepted

2012-05-24 Thread paolo at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53464

--- Comment #6 from paolo at gcc dot gnu.org  
2012-05-24 15:12:45 UTC ---
Author: paolo
Date: Thu May 24 15:12:37 2012
New Revision: 187842

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=187842
Log:
2012-05-24  Paolo Carlini  

PR c++/53464
* g++.dg/cpp0x/constexpr-default1.C: New.


Added:
trunk/gcc/testsuite/g++.dg/cpp0x/constexpr-default1.C
Modified:
trunk/gcc/testsuite/ChangeLog