From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26053 invoked by alias); 31 Oct 2012 08:56:29 -0000 Received: (qmail 25918 invoked by uid 55); 31 Oct 2012 08:55:52 -0000 From: "dodji at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/54955] alignas example in gcc 4.8 changes.html won't compile Date: Wed, 31 Oct 2012 08:56:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dodji at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: dodji at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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 X-SW-Source: 2012-10/txt/msg02937.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54955 --- Comment #6 from Dodji Seketeli 2012-10-31 08:55:51 UTC --- Author: dodji Date: Wed Oct 31 08:55:43 2012 New Revision: 193029 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=193029 Log: PR c++/54955 - Fail to parse alignas expr at the beginning of a declaration In this PR, g++ embarrassingly fails to parse the simple alignas expression below: alignas(double) int f; even though the simple-declaration production in Clause 7 suggests otherwise. Fixed thus and tested on x86_64-unknown-linux-gnu against trunk. gcc/cp PR c++/54955 * parser.c (cp_nth_tokens_can_be_std_attribute_p): Recognize the 'Alignas' keyword as the beginning of a c++11 attribute specifier. Update the comment of the function. (cp_next_tokens_can_be_gnu_attribute_p): Update the comment of the function. gcc/testsuite/ PR c++/54955 * g++.dg/cpp0x/gen-attrs-48-2.C: New test. Added: trunk/gcc/testsuite/g++.dg/cpp0x/gen-attrs-48-2.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/parser.c trunk/gcc/testsuite/ChangeLog