From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25847 invoked by alias); 3 Oct 2013 20:49:22 -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 25448 invoked by uid 48); 3 Oct 2013 20:49:18 -0000 From: "reichelt at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/58607] New: [4.9 Regression] ICE with undeclared variable in constexpr Date: Thu, 03 Oct 2013 20:49: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: 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 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: 2013-10/txt/msg00183.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58607 Bug ID: 58607 Summary: [4.9 Regression] ICE with undeclared variable in constexpr Product: gcc Version: 4.9.0 Status: UNCONFIRMED 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 on trunk (GCC 4.9.0 20130920): ========================= struct A { constexpr A() { i; } }; ========================= bug.cc: In constructor 'constexpr A::A()': bug.cc:3:19: error: 'i' was not declared in this scope constexpr A() { i; } ^ bug.cc:3:22: internal compiler error: in build_data_member_initialization, at cp/semantics.c:6032 constexpr A() { i; } ^ 0x6c177e build_data_member_initialization ../../gcc/gcc/cp/semantics.c:6032 0x6c1cc9 build_constexpr_constructor_member_initializers ../../gcc/gcc/cp/semantics.c:6209 0x6c1cc9 massage_constexpr_body ../../gcc/gcc/cp/semantics.c:6290 0x6c94f3 register_constexpr_fundef(tree_node*, tree_node*) ../../gcc/gcc/cp/semantics.c:6394 0x568058 maybe_save_function_definition ../../gcc/gcc/cp/decl.c:13771 0x568058 finish_function(int) ../../gcc/gcc/cp/decl.c:13892 0x65090d cp_parser_function_definition_after_declarator ../../gcc/gcc/cp/parser.c:22346 0x635fbc cp_parser_late_parsing_for_member ../../gcc/gcc/cp/parser.c:22995 0x635fbc cp_parser_class_specifier_1 ../../gcc/gcc/cp/parser.c:19078 0x638180 cp_parser_class_specifier ../../gcc/gcc/cp/parser.c:19102 0x638180 cp_parser_type_specifier ../../gcc/gcc/cp/parser.c:14081 0x64d679 cp_parser_decl_specifier_seq ../../gcc/gcc/cp/parser.c:11328 0x651719 cp_parser_simple_declaration ../../gcc/gcc/cp/parser.c:10918 0x653740 cp_parser_block_declaration ../../gcc/gcc/cp/parser.c:10867 0x65c76e cp_parser_declaration ../../gcc/gcc/cp/parser.c:10764 0x65b4da cp_parser_declaration_seq_opt ../../gcc/gcc/cp/parser.c:10650 0x65cda6 cp_parser_translation_unit ../../gcc/gcc/cp/parser.c:3939 0x65cda6 c_parse_file() ../../gcc/gcc/cp/parser.c:28900 0x7707e3 c_common_parse_file() ../../gcc/gcc/c-family/c-opts.c:1046 Please submit a full bug report, [etc.]