From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29234 invoked by alias); 30 Sep 2013 20:27:10 -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 29185 invoked by uid 48); 30 Sep 2013 20:27:06 -0000 From: "reichelt at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/58584] New: [c++11] ICE with invalid argument for alignas Date: Mon, 30 Sep 2013 20:27: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-09/txt/msg02087.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58584 Bug ID: 58584 Summary: [c++11] ICE with invalid argument for alignas 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++0x") triggers an ICE since GCC 4.8.0 (when alignas was introduced): ======================== struct A { int i alignas(this); }; ======================== bug.cc:3:17: error: invalid use of 'this' at top level int i alignas(this); ^ bug.cc:3:17: internal compiler error: tree check: expected tree_list, have error_mark in cp_check_const_attributes, at cp/decl2.c:1325 0xcd8a0a tree_check_failed(tree_node const*, char const*, int, char const*, ...) ../../gcc/gcc/tree.c:9176 0x6110cb tree_check ../../gcc/gcc/tree.h:2609 0x6110cb cp_check_const_attributes ../../gcc/gcc/cp/decl2.c:1325 0x6110cb cplus_decl_attributes(tree_node**, tree_node*, int) ../../gcc/gcc/cp/decl2.c:1351 0x6161b7 grokfield(cp_declarator const*, cp_decl_specifier_seq*, tree_node*, bool, tree_node*, tree_node*) ../../gcc/gcc/cp/decl2.c:989 0x636a92 cp_parser_member_declaration ../../gcc/gcc/cp/parser.c:20084 0x6376ce cp_parser_member_specification_opt ../../gcc/gcc/cp/parser.c:19630 0x6376ce cp_parser_class_specifier_1 ../../gcc/gcc/cp/parser.c:18885 0x63a070 cp_parser_class_specifier ../../gcc/gcc/cp/parser.c:19101 0x63a070 cp_parser_type_specifier ../../gcc/gcc/cp/parser.c:14080 0x64f549 cp_parser_decl_specifier_seq ../../gcc/gcc/cp/parser.c:11328 0x6535d9 cp_parser_simple_declaration ../../gcc/gcc/cp/parser.c:10918 0x6555e0 cp_parser_block_declaration ../../gcc/gcc/cp/parser.c:10867 0x65e5ee cp_parser_declaration ../../gcc/gcc/cp/parser.c:10764 0x65d35a cp_parser_declaration_seq_opt ../../gcc/gcc/cp/parser.c:10650 0x65ec36 cp_parser_translation_unit ../../gcc/gcc/cp/parser.c:3939 0x65ec36 c_parse_file() ../../gcc/gcc/cp/parser.c:28898 0x772143 c_common_parse_file() ../../gcc/gcc/c-family/c-opts.c:1046 Please submit a full bug report, [etc.] A template version of the code crashes in a different place: ======================== template struct A { int i alignas(this); }; ======================== neu50B.cc:3:17: error: invalid use of 'this' at top level int i alignas(this); ^ neu50B.cc:3:17: internal compiler error: tree check: expected tree_list, have error_mark in get_attribute_name, at attribs.c:659 0xcd8a0a tree_check_failed(tree_node const*, char const*, int, char const*, ...) ../../gcc/gcc/tree.c:9176 0x72a595 tree_check ../../gcc/gcc/tree.h:2819 0x72a595 get_attribute_name(tree_node const*) ../../gcc/gcc/attribs.c:659 0x610d23 is_late_template_attribute ../../gcc/gcc/cp/decl2.c:1120 0x610d23 splice_template_attributes ../../gcc/gcc/cp/decl2.c:1200 0x610d23 save_template_attributes ../../gcc/gcc/cp/decl2.c:1221 0x610d23 cplus_decl_attributes(tree_node**, tree_node*, int) ../../gcc/gcc/cp/decl2.c:1348 0x6161b7 grokfield(cp_declarator const*, cp_decl_specifier_seq*, tree_node*, bool, tree_node*, tree_node*) ../../gcc/gcc/cp/decl2.c:989 0x636a92 cp_parser_member_declaration ../../gcc/gcc/cp/parser.c:20084 0x6376ce cp_parser_member_specification_opt ../../gcc/gcc/cp/parser.c:19630 0x6376ce cp_parser_class_specifier_1 ../../gcc/gcc/cp/parser.c:18885 0x63a070 cp_parser_class_specifier ../../gcc/gcc/cp/parser.c:19101 0x63a070 cp_parser_type_specifier ../../gcc/gcc/cp/parser.c:14080 0x64f549 cp_parser_decl_specifier_seq ../../gcc/gcc/cp/parser.c:11328 0x653bb3 cp_parser_single_declaration ../../gcc/gcc/cp/parser.c:22578 0x656990 cp_parser_template_declaration_after_export ../../gcc/gcc/cp/parser.c:22454 0x65e789 cp_parser_declaration ../../gcc/gcc/cp/parser.c:10728 0x65d35a cp_parser_declaration_seq_opt ../../gcc/gcc/cp/parser.c:10650 0x65ec36 cp_parser_translation_unit ../../gcc/gcc/cp/parser.c:3939 0x65ec36 c_parse_file() ../../gcc/gcc/cp/parser.c:28898 Please submit a full bug report, [etc.]