[Bug c++/50248] [C++0x] unnecessary instantiation of constexpr constructor

2011-09-06 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50248

Jason Merrill jason at gcc dot gnu.org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED
   Target Milestone|--- |4.7.0

--- Comment #4 from Jason Merrill jason at gcc dot gnu.org 2011-09-06 
22:53:30 UTC ---
Fixed for 4.7.


[Bug c++/50248] [C++0x] unnecessary instantiation of constexpr constructor

2011-09-04 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50248

--- Comment #3 from Jason Merrill jason at gcc dot gnu.org 2011-09-05 
04:33:14 UTC ---
Author: jason
Date: Mon Sep  5 04:33:08 2011
New Revision: 178518

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=178518
Log:
PR c++/50248
Core 1358
* init.c (perform_member_init): Don't diagnose missing inits here.
(emit_mem_initializers): Or here.
* method.c (process_subob_fn): Don't instantiate constexpr ctors.
* semantics.c (cx_check_missing_mem_inits): New.
(explain_invalid_constexpr_fn): Call it.
(register_constexpr_fundef): Likewise.  Leave
DECL_DECLARED_CONSTEXPR_P set when the body is unsuitable.
(cxx_eval_call_expression): Adjust diagnostics.
(cxx_eval_constant_expression): Catch use of 'this' in a constructor.

Added:
trunk/gcc/testsuite/g++.dg/cpp0x/constexpr-template1.C
trunk/gcc/testsuite/g++.dg/cpp0x/constexpr-template2.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/init.c
trunk/gcc/cp/method.c
trunk/gcc/cp/semantics.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/g++.dg/cpp0x/constexpr-48089.C
trunk/gcc/testsuite/g++.dg/cpp0x/constexpr-ex1.C


[Bug c++/50248] [C++0x] unnecessary instantiation of constexpr constructor

2011-08-31 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50248

Jason Merrill jason at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2011-08-31
 AssignedTo|unassigned at gcc dot   |jason at gcc dot gnu.org
   |gnu.org |
Summary|[C++0x] tries to use|[C++0x] unnecessary
   |variadic constructor when   |instantiation of constexpr
   |it should use default   |constructor
   |constructor |
 Ever Confirmed|0   |1

--- Comment #2 from Jason Merrill jason at gcc dot gnu.org 2011-08-31 
13:29:33 UTC ---
The copy constructor isn't being defined, but the compiler is instantiating the
constexpr constructor to find out if it is really constexpr, and therefore
whether the implicitly-declared copy constructor should be declared constexpr.

We decided at Bloomington that we should just consider instantiations of
constexpr templates to be constexpr, not instantiate them to check.