The following invalid code snippet (compiled with "-std=c++0x") triggers an ICE since GCC 4.8.0 (when inheriting constructors were introduced): ==================================== struct A { constexpr A(int, int = i) {} static const int i; }; struct B : A { using A::A; }; constexpr B b(0); ==================================== bug.cc:12:16: error: 'constexpr B::B(int)' called in a constant expression constexpr B b(0); ^ bug.cc:9:12: note: 'constexpr B::B(int)' is not usable as a constexpr function because: using A::A; ^ bug.cc:9:12: internal compiler error: in synthesized_method_walk, at cp/method.c:1218 0x675548 synthesized_method_walk ../../gcc-4.8.0/gcc/cp/method.c:1217 0x679692 explain_implicit_non_constexpr(tree_node*) ../../gcc-4.8.0/gcc/cp/method.c:1481 0x69f68b explain_invalid_constexpr_fn(tree_node*) ../../gcc-4.8.0/gcc/cp/semantics.c:6379 0x69faf6 cxx_eval_call_expression ../../gcc-4.8.0/gcc/cp/semantics.c:6751 0x6a1142 cxx_eval_constant_expression ../../gcc-4.8.0/gcc/cp/semantics.c:7814 0x6a14a9 cxx_eval_constant_expression ../../gcc-4.8.0/gcc/cp/semantics.c:7835 0x6a4426 cxx_eval_outermost_constant_expr ../../gcc-4.8.0/gcc/cp/semantics.c:8115 0x5bd69d store_init_value(tree_node*, tree_node*, vec<tree_node*, va_gc, vl_embed>**, int) ../../gcc-4.8.0/gcc/cp/typeck2.c:722 0x540b40 check_initializer ../../gcc-4.8.0/gcc/cp/decl.c:5711 0x5537b5 cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int) ../../gcc-4.8.0/gcc/cp/decl.c:6328 0x62afeb cp_parser_init_declarator ../../gcc-4.8.0/gcc/cp/parser.c:16038 0x62b85e cp_parser_simple_declaration ../../gcc-4.8.0/gcc/cp/parser.c:10567 0x62d630 cp_parser_block_declaration ../../gcc-4.8.0/gcc/cp/parser.c:10448 0x6361fb cp_parser_declaration ../../gcc-4.8.0/gcc/cp/parser.c:10345 0x634ecd cp_parser_declaration_seq_opt ../../gcc-4.8.0/gcc/cp/parser.c:10231 0x636772 cp_parser_translation_unit ../../gcc-4.8.0/gcc/cp/parser.c:3807 0x636772 c_parse_file() ../../gcc-4.8.0/gcc/cp/parser.c:28186 0x73e504 c_common_parse_file() ../../gcc-4.8.0/gcc/c-family/c-opts.c:1046 Please submit a full bug report, [etc.]
Confirmed with trunk, I don't see the ICE with 4.8.2.
Maybe just a STRIP_TEMPLATE issue. Looking into it.
Sorry, I wanted to add to PR60389.
GCC 4.9.0 has been released
Author: jason Date: Mon Jul 14 05:25:37 2014 New Revision: 212507 URL: https://gcc.gnu.org/viewcvs?rev=212507&root=gcc&view=rev Log: PR c++/58511 * semantics.c (is_instantiation_of_constexpr): Return true for defaulted functions, too. (explain_invalid_constexpr_fn): Only use explain_implicit_non_constexpr if !DECL_DECLARED_CONSTEXPR_P. * method.c (explain_implicit_non_constexpr): Pass DECL_INHERITED_CTOR_BASE to explain_implicit_non_constexpr. Added: trunk/gcc/testsuite/g++.dg/cpp0x/constexpr-inhctor1.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/method.c trunk/gcc/cp/semantics.c trunk/gcc/testsuite/g++.dg/cpp0x/nsdmi3.C
Fixed on trunk.