This is the mail archive of the
gcc-cvs@gcc.gnu.org
mailing list for the GCC project.
r193029 - in /trunk/gcc: cp/ChangeLog cp/parser...
- From: dodji at gcc dot gnu dot org
- To: gcc-cvs at gcc dot gnu dot org
- Date: Wed, 31 Oct 2012 08:55:44 -0000
- Subject: r193029 - in /trunk/gcc: cp/ChangeLog cp/parser...
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