public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/51027] New: [C++11] GCC accepts alias-declaration without ';'
@ 2011-11-08  9:11 flast at flast dot jp
  2011-11-08 11:35 ` [Bug c++/51027] [C++0x] " paolo.carlini at oracle dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: flast at flast dot jp @ 2011-11-08  9:11 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 51027
           Summary: [C++11] GCC accepts alias-declaration without ';'
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: flast@flast.jp


GCC now implements alias-declaration. But accepts it without trailing ';' .

e.g.
----
using INT = int
----

And warn with ';' via -pedantic.
e.g.
----
using INT = int;
----

output
----
$ g++ -pedantic -c -std=gnu++11 test.C
test.C:1:16: warning: extra ';' [-pedantic]
----


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

* [Bug c++/51027] [C++0x] GCC accepts alias-declaration without ';'
  2011-11-08  9:11 [Bug c++/51027] New: [C++11] GCC accepts alias-declaration without ';' flast at flast dot jp
@ 2011-11-08 11:35 ` paolo.carlini at oracle dot com
  2011-11-08 15:49 ` dodji at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-11-08 11:35 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011-11-08
                 CC|                            |dodji at gcc dot gnu.org
     Ever Confirmed|0                           |1

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-11-08 11:29:57 UTC ---
I guess this one is rather urgent: thanks to Jon, the library already uses the
new feature a lot and -pedantic warnings are not suppressed in system-headers
(whether this is *really* ok, I'm not sure, but it's another issue)


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

* [Bug c++/51027] [C++0x] GCC accepts alias-declaration without ';'
  2011-11-08  9:11 [Bug c++/51027] New: [C++11] GCC accepts alias-declaration without ';' flast at flast dot jp
  2011-11-08 11:35 ` [Bug c++/51027] [C++0x] " paolo.carlini at oracle dot com
@ 2011-11-08 15:49 ` dodji at gcc dot gnu.org
  2011-11-08 16:42 ` dodji at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: dodji at gcc dot gnu.org @ 2011-11-08 15:49 UTC (permalink / raw)
  To: gcc-bugs

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

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

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


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

* [Bug c++/51027] [C++0x] GCC accepts alias-declaration without ';'
  2011-11-08  9:11 [Bug c++/51027] New: [C++11] GCC accepts alias-declaration without ';' flast at flast dot jp
  2011-11-08 11:35 ` [Bug c++/51027] [C++0x] " paolo.carlini at oracle dot com
  2011-11-08 15:49 ` dodji at gcc dot gnu.org
@ 2011-11-08 16:42 ` dodji at gcc dot gnu.org
  2011-11-08 21:42 ` dodji at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: dodji at gcc dot gnu.org @ 2011-11-08 16:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Dodji Seketeli <dodji at gcc dot gnu.org> 2011-11-08 16:38:36 UTC ---
I am currently testing the patchlet below.  Sorry for the embarrassing
bug.

From: Dodji Seketeli <dodji@redhat.com>
Date: Tue, 8 Nov 2011 17:21:52 +0100
Subject: [PATCH] PR c++/51027 - accepts alias-declaration without ';'

gcc/cp/

    * parser.c (cp_parser_alias_declaration): Require ';' at the end
    of declaration.

gcc/testsuite

    * g++.dg/cpp0x/alias-decl-12.C: New test.
---
 gcc/cp/parser.c                            |    1 +
 gcc/testsuite/g++.dg/cpp0x/alias-decl-12.C |    3 +++
 2 files changed, 4 insertions(+), 0 deletions(-)
 create mode 100644 gcc/testsuite/g++.dg/cpp0x/alias-decl-12.C

diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 3d35877..0f2b14b 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -14904,6 +14904,7 @@ cp_parser_alias_declaration (cp_parser* parser)
   cp_parser_require (parser, CPP_EQ, RT_EQ);

   type = cp_parser_type_id (parser);
+  cp_parser_require (parser, CPP_SEMICOLON, RT_SEMICOLON);

   /* A typedef-name can also be introduced by an alias-declaration. The
      identifier following the using keyword becomes a typedef-name. It has
diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-12.C
b/gcc/testsuite/g++.dg/cpp0x/alias-decl-12.C
new file mode 100644
index 0000000..a8c7260
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/alias-decl-12.C
@@ -0,0 +1,3 @@
+// { dg-options "-std=c++0x" }
+
+using INT = int // { dg-error "expected|;|at end of input" }
-- 
1.7.6.4


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

* [Bug c++/51027] [C++0x] GCC accepts alias-declaration without ';'
  2011-11-08  9:11 [Bug c++/51027] New: [C++11] GCC accepts alias-declaration without ';' flast at flast dot jp
                   ` (2 preceding siblings ...)
  2011-11-08 16:42 ` dodji at gcc dot gnu.org
@ 2011-11-08 21:42 ` dodji at gcc dot gnu.org
  2011-11-09  8:02 ` dodji at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: dodji at gcc dot gnu.org @ 2011-11-08 21:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Dodji Seketeli <dodji at gcc dot gnu.org> 2011-11-08 21:39:04 UTC ---
A candidate fix was posted to
http://gcc.gnu.org/ml/gcc-patches/2011-11/msg01252.html


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

* [Bug c++/51027] [C++0x] GCC accepts alias-declaration without ';'
  2011-11-08  9:11 [Bug c++/51027] New: [C++11] GCC accepts alias-declaration without ';' flast at flast dot jp
                   ` (3 preceding siblings ...)
  2011-11-08 21:42 ` dodji at gcc dot gnu.org
@ 2011-11-09  8:02 ` dodji at gcc dot gnu.org
  2011-11-09  8:54 ` dodji at gcc dot gnu.org
  2011-11-14 14:07 ` redi at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: dodji at gcc dot gnu.org @ 2011-11-09  8:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Dodji Seketeli <dodji at gcc dot gnu.org> 2011-11-09 08:01:03 UTC ---
Author: dodji
Date: Wed Nov  9 08:00:58 2011
New Revision: 181195

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=181195
Log:
PR c++/51027 - accepts alias-declaration without ';'

gcc/cp/

    * parser.c (cp_parser_alias_declaration): Require ';' at the end
    of the declaration.

libstdc++-v3/

    * include/ext/pointer.h (rebind): Append missing ';'.

gcc/testsuite

    * g++.dg/cpp0x/alias-decl-12.C: New test.
    * g++.dg/ext/alias-decl-attr4.C: Append missing ';'.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/alias-decl-12.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/parser.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/ext/alias-decl-attr4.C
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/include/ext/pointer.h


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

* [Bug c++/51027] [C++0x] GCC accepts alias-declaration without ';'
  2011-11-08  9:11 [Bug c++/51027] New: [C++11] GCC accepts alias-declaration without ';' flast at flast dot jp
                   ` (4 preceding siblings ...)
  2011-11-09  8:02 ` dodji at gcc dot gnu.org
@ 2011-11-09  8:54 ` dodji at gcc dot gnu.org
  2011-11-14 14:07 ` redi at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: dodji at gcc dot gnu.org @ 2011-11-09  8:54 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #5 from Dodji Seketeli <dodji at gcc dot gnu.org> 2011-11-09 08:13:40 UTC ---
Should be fixed in trunk now.


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

* [Bug c++/51027] [C++0x] GCC accepts alias-declaration without ';'
  2011-11-08  9:11 [Bug c++/51027] New: [C++11] GCC accepts alias-declaration without ';' flast at flast dot jp
                   ` (5 preceding siblings ...)
  2011-11-09  8:54 ` dodji at gcc dot gnu.org
@ 2011-11-14 14:07 ` redi at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2011-11-14 14:07 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |trashyankes at wp dot pl

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-11-14 14:01:16 UTC ---
*** Bug 51120 has been marked as a duplicate of this bug. ***


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

end of thread, other threads:[~2011-11-14 14:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-08  9:11 [Bug c++/51027] New: [C++11] GCC accepts alias-declaration without ';' flast at flast dot jp
2011-11-08 11:35 ` [Bug c++/51027] [C++0x] " paolo.carlini at oracle dot com
2011-11-08 15:49 ` dodji at gcc dot gnu.org
2011-11-08 16:42 ` dodji at gcc dot gnu.org
2011-11-08 21:42 ` dodji at gcc dot gnu.org
2011-11-09  8:02 ` dodji at gcc dot gnu.org
2011-11-09  8:54 ` dodji at gcc dot gnu.org
2011-11-14 14:07 ` redi 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).