From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11335 invoked by alias); 2 Oct 2013 21:00: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 11258 invoked by uid 48); 2 Oct 2013 21:00:17 -0000 From: "reichelt at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/58600] New: [c++0x] ICE on wrong usage of alignas Date: Wed, 02 Oct 2013 21:00: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/msg00132.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58600 Bug ID: 58600 Summary: [c++0x] ICE on wrong usage of 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++11") triggers an ICE since GCC 4.8.0 (when alignas was introduced): ================================ namespace N {} using namespace N alignas(int); ================================ bug.cc:2:30: internal compiler error: tree check: expected identifier_node, have tree_list in private_is_attribute_p, at tree.c:5540 using namespace N alignas(int); ^ 0xcd87ea tree_check_failed(tree_node const*, char const*, int, char const*, ...) ../../gcc/gcc/tree.c:9176 0xcd8b64 tree_check ../../gcc/gcc/tree.h:2819 0xcd8b64 private_is_attribute_p(char const*, unsigned long, tree_node const*) ../../gcc/gcc/tree.c:5540 0x6ff9ff is_attribute_p ../../gcc/gcc/tree.h:3678 0x6ff9ff parse_using_directive(tree_node*, tree_node*) ../../gcc/gcc/cp/name-lookup.c:3995 0x6545c2 cp_parser_using_directive ../../gcc/gcc/cp/parser.c:15951 0x6545c2 cp_parser_block_declaration ../../gcc/gcc/cp/parser.c:10837 0x65cf1e cp_parser_declaration ../../gcc/gcc/cp/parser.c:10764 0x65bc8a cp_parser_declaration_seq_opt ../../gcc/gcc/cp/parser.c:10650 0x65d556 cp_parser_translation_unit ../../gcc/gcc/cp/parser.c:3939 0x65d556 c_parse_file() ../../gcc/gcc/cp/parser.c:28899 0x7709e3 c_common_parse_file() ../../gcc/gcc/c-family/c-opts.c:1046 Please submit a full bug report, [etc.] A slightly modified example crashes in a different location: ================================ namespace N {} using namespace N alignas(X); ================================ bug.cc:2:27: error: 'X' was not declared in this scope using namespace N alignas(X); ^ bug.cc:2:27: internal compiler error: tree check: expected tree_list, have error_mark in parse_using_directive, at cp/name-lookup.c:3994 0xcd87ea tree_check_failed(tree_node const*, char const*, int, char const*, ...) ../../gcc/gcc/tree.c:9176 0x6ffabe tree_check ../../gcc/gcc/tree.h:2609 0x6ffabe parse_using_directive(tree_node*, tree_node*) ../../gcc/gcc/cp/name-lookup.c:3994 0x6545c2 cp_parser_using_directive ../../gcc/gcc/cp/parser.c:15951 0x6545c2 cp_parser_block_declaration ../../gcc/gcc/cp/parser.c:10837 0x65cf1e cp_parser_declaration ../../gcc/gcc/cp/parser.c:10764 0x65bc8a cp_parser_declaration_seq_opt ../../gcc/gcc/cp/parser.c:10650 0x65d556 cp_parser_translation_unit ../../gcc/gcc/cp/parser.c:3939 0x65d556 c_parse_file() ../../gcc/gcc/cp/parser.c:28899 0x7709e3 c_common_parse_file() ../../gcc/gcc/c-family/c-opts.c:1046 Please submit a full bug report, [etc.]