public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/54955] New: alignas example in gcc 4.8 changes.html won't compile
@ 2012-10-17 16:15 mib.bugzilla at gmail dot com
  2012-10-17 16:22 ` [Bug c++/54955] " mib.bugzilla at gmail dot com
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: mib.bugzilla at gmail dot com @ 2012-10-17 16:15 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54955

             Bug #: 54955
           Summary: alignas example in gcc 4.8 changes.html won't compile
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: mib.bugzilla@gmail.com


gcc 4.8 changes.html file gives this example:
alignas(double) int i;

But the snapshot from Oct 14 2012 gives this message:
g++ -c -std=c++11 alignas.cpp
alignas.cpp:1:1: error: expected unqualified-id before 'alignas'
 alignas(double) int f;
 ^

If alignas is moved to the end of the declaration it compiles okay:
int f alignas(double);

doc error?

Could you also confirm whether c++11 keyword alignas is the same as c1x
_Alignas?

Thanks and regards


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug c++/54955] alignas example in gcc 4.8 changes.html won't compile
  2012-10-17 16:15 [Bug c++/54955] New: alignas example in gcc 4.8 changes.html won't compile mib.bugzilla at gmail dot com
@ 2012-10-17 16:22 ` mib.bugzilla at gmail dot com
  2012-10-17 17:22 ` [Bug web/54955] " redi at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: mib.bugzilla at gmail dot com @ 2012-10-17 16:22 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54955

--- Comment #1 from mib.bugzilla at gmail dot com 2012-10-17 16:21:56 UTC ---
p.s.
This example is given here: http://en.cppreference.com/w/cpp/language/alignas

char alignas(128) cacheline[128];

but g++ complains similarly to the root report


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug web/54955] alignas example in gcc 4.8 changes.html won't compile
  2012-10-17 16:15 [Bug c++/54955] New: alignas example in gcc 4.8 changes.html won't compile mib.bugzilla at gmail dot com
  2012-10-17 16:22 ` [Bug c++/54955] " mib.bugzilla at gmail dot com
@ 2012-10-17 17:22 ` redi at gcc dot gnu.org
  2012-10-17 19:55 ` [Bug c++/54955] " daniel.kruegler at googlemail dot com
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: redi at gcc dot gnu.org @ 2012-10-17 17:22 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54955

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-10-17 17:21:58 UTC ---
I *think* the example is valid, so it's a compiler bug ... but I'm not sure.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug c++/54955] alignas example in gcc 4.8 changes.html won't compile
  2012-10-17 16:15 [Bug c++/54955] New: alignas example in gcc 4.8 changes.html won't compile mib.bugzilla at gmail dot com
  2012-10-17 16:22 ` [Bug c++/54955] " mib.bugzilla at gmail dot com
  2012-10-17 17:22 ` [Bug web/54955] " redi at gcc dot gnu.org
@ 2012-10-17 19:55 ` daniel.kruegler at googlemail dot com
  2012-10-17 20:53 ` paolo.carlini at oracle dot com
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2012-10-17 19:55 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54955

Daniel Krügler <daniel.kruegler at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel.kruegler at
                   |                            |googlemail dot com

--- Comment #3 from Daniel Krügler <daniel.kruegler at googlemail dot com> 2012-10-17 19:55:34 UTC ---
I agree that this should be accepted (The grammar of a /simple-declaration/ in
Clause 7 says so).


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug c++/54955] alignas example in gcc 4.8 changes.html won't compile
  2012-10-17 16:15 [Bug c++/54955] New: alignas example in gcc 4.8 changes.html won't compile mib.bugzilla at gmail dot com
                   ` (2 preceding siblings ...)
  2012-10-17 19:55 ` [Bug c++/54955] " daniel.kruegler at googlemail dot com
@ 2012-10-17 20:53 ` paolo.carlini at oracle dot com
  2012-10-26 13:28 ` dodji at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-10-17 20:53 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54955

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-10-17
     Ever Confirmed|0                           |1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug c++/54955] alignas example in gcc 4.8 changes.html won't compile
  2012-10-17 16:15 [Bug c++/54955] New: alignas example in gcc 4.8 changes.html won't compile mib.bugzilla at gmail dot com
                   ` (3 preceding siblings ...)
  2012-10-17 20:53 ` paolo.carlini at oracle dot com
@ 2012-10-26 13:28 ` dodji at gcc dot gnu.org
  2012-10-26 13:31 ` paolo.carlini at oracle dot com
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: dodji at gcc dot gnu.org @ 2012-10-26 13:28 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54955

Dodji Seketeli <dodji at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug c++/54955] alignas example in gcc 4.8 changes.html won't compile
  2012-10-17 16:15 [Bug c++/54955] New: alignas example in gcc 4.8 changes.html won't compile mib.bugzilla at gmail dot com
                   ` (4 preceding siblings ...)
  2012-10-26 13:28 ` dodji at gcc dot gnu.org
@ 2012-10-26 13:31 ` paolo.carlini at oracle dot com
  2012-10-26 17:42 ` dodji at seketeli dot org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-10-26 13:31 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54955

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|dodji at gcc dot gnu.org    |

--- Comment #4 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-10-26 13:31:33 UTC ---
Thanks Dodji!


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug c++/54955] alignas example in gcc 4.8 changes.html won't compile
  2012-10-17 16:15 [Bug c++/54955] New: alignas example in gcc 4.8 changes.html won't compile mib.bugzilla at gmail dot com
                   ` (5 preceding siblings ...)
  2012-10-26 13:31 ` paolo.carlini at oracle dot com
@ 2012-10-26 17:42 ` dodji at seketeli dot org
  2012-10-31  8:56 ` dodji at gcc dot gnu.org
  2012-10-31  9:02 ` dodji at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: dodji at seketeli dot org @ 2012-10-26 17:42 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54955

--- Comment #5 from dodji at seketeli dot org <dodji at seketeli dot org> 2012-10-26 17:42:44 UTC ---
> --- Comment #4 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-10-26 13:31:33 UTC ---
>
> Thanks Dodji!

You are welcome.  :)

A candidate patch was proposed at
http://gcc.gnu.org/ml/gcc-patches/2012-10/msg02439.html


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug c++/54955] alignas example in gcc 4.8 changes.html won't compile
  2012-10-17 16:15 [Bug c++/54955] New: alignas example in gcc 4.8 changes.html won't compile mib.bugzilla at gmail dot com
                   ` (6 preceding siblings ...)
  2012-10-26 17:42 ` dodji at seketeli dot org
@ 2012-10-31  8:56 ` dodji at gcc dot gnu.org
  2012-10-31  9:02 ` dodji at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: dodji at gcc dot gnu.org @ 2012-10-31  8:56 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54955

--- Comment #6 from Dodji Seketeli <dodji at gcc dot gnu.org> 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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug c++/54955] alignas example in gcc 4.8 changes.html won't compile
  2012-10-17 16:15 [Bug c++/54955] New: alignas example in gcc 4.8 changes.html won't compile mib.bugzilla at gmail dot com
                   ` (7 preceding siblings ...)
  2012-10-31  8:56 ` dodji at gcc dot gnu.org
@ 2012-10-31  9:02 ` dodji at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: dodji at gcc dot gnu.org @ 2012-10-31  9:02 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54955

Dodji Seketeli <dodji at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #7 from Dodji Seketeli <dodji at gcc dot gnu.org> 2012-10-31 09:01:49 UTC ---
This should be fixed in trunk (4.8)


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-10-31  9:02 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-17 16:15 [Bug c++/54955] New: alignas example in gcc 4.8 changes.html won't compile mib.bugzilla at gmail dot com
2012-10-17 16:22 ` [Bug c++/54955] " mib.bugzilla at gmail dot com
2012-10-17 17:22 ` [Bug web/54955] " redi at gcc dot gnu.org
2012-10-17 19:55 ` [Bug c++/54955] " daniel.kruegler at googlemail dot com
2012-10-17 20:53 ` paolo.carlini at oracle dot com
2012-10-26 13:28 ` dodji at gcc dot gnu.org
2012-10-26 13:31 ` paolo.carlini at oracle dot com
2012-10-26 17:42 ` dodji at seketeli dot org
2012-10-31  8:56 ` dodji at gcc dot gnu.org
2012-10-31  9:02 ` dodji at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).