From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20441 invoked by alias); 2 Mar 2014 21:06:04 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 20425 invoked by uid 48); 2 Mar 2014 21:06:01 -0000 From: "reichelt at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/60389] New: [4.8/4,9 Regression] ICE with inheriting constructors and wrong usage of constexpr Date: Sun, 02 Mar 2014 21:06:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: ice-on-invalid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: reichelt at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-03/txt/msg00103.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60389 Bug ID: 60389 Summary: [4.8/4,9 Regression] ICE with inheriting constructors and wrong usage of constexpr Product: gcc Version: 4.9.0 Status: UNCONFIRMED Keywords: ice-on-invalid-code Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: reichelt at gcc dot gnu.org The following invalid code snippet (compiled with "-std=c++11") triggers an ICE since GCC 4.8.0: =========================================== struct A { template A(T...) {} }; struct B : A { using A::A; }; constexpr B b; =========================================== bug.cc:11:13: error: the type 'const B' of constexpr variable 'b' is not literal constexpr B b; ^ bug.cc:6:8: note: 'B' is not literal because: struct B : A ^ bug.cc:6:8: note: 'B' is not an aggregate, does not have a trivial default constructor, and has no constexpr constructor that is not a copy or move constructor bug.cc:8:12: note: 'template B::B(T ...)' is not usable as a constexpr function because: using A::A; ^ bug.cc:8:12: internal compiler error: tree check: expected function_decl, have template_decl in is_valid_constexpr_fn, at cp/semantics.c:7434 0xdc0f54 tree_check_failed(tree_node const*, char const*, int, char const*, ...) ../../gcc/gcc/tree.c:9192 0x73e7f7 tree_check ../../gcc/gcc/tree.h:2709 0x73e7f7 is_valid_constexpr_fn ../../gcc/gcc/cp/semantics.c:7434 0x742fd0 explain_invalid_constexpr_fn(tree_node*) ../../gcc/gcc/cp/semantics.c:8019 0x73f4f2 ensure_literal_type_for_constexpr_object(tree_node*) ../../gcc/gcc/cp/semantics.c:7374 0x5dcddf cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int) ../../gcc/gcc/cp/decl.c:6206 0x6ce58d cp_parser_init_declarator ../../gcc/gcc/cp/parser.c:16819 0x6cfd49 cp_parser_simple_declaration ../../gcc/gcc/cp/parser.c:11205 0x6b3003 cp_parser_block_declaration ../../gcc/gcc/cp/parser.c:11086 0x6da2d2 cp_parser_declaration ../../gcc/gcc/cp/parser.c:10983 0x6d8fc8 cp_parser_declaration_seq_opt ../../gcc/gcc/cp/parser.c:10869 0x6da87a cp_parser_translation_unit ../../gcc/gcc/cp/parser.c:4014 0x6da87a c_parse_file() ../../gcc/gcc/cp/parser.c:31590 0x7fa103 c_common_parse_file() ../../gcc/gcc/c-family/c-opts.c:1060 Please submit a full bug report, [etc.]