]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR c++/51027 - accepts alias-declaration without ';'
authorDodji Seketeli <dodji@redhat.com>
Wed, 9 Nov 2011 08:00:58 +0000 (08:00 +0000)
committerDodji Seketeli <dodji@gcc.gnu.org>
Wed, 9 Nov 2011 08:00:58 +0000 (09:00 +0100)
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 ';'.

From-SVN: r181195

gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/alias-decl-12.C [new file with mode: 0644]
gcc/testsuite/g++.dg/ext/alias-decl-attr4.C
libstdc++-v3/ChangeLog
libstdc++-v3/include/ext/pointer.h

index 6445befedd33d0a2c1f8393052f135ea918f7537..f7f91d2cd45892d9414cd87f9904b0f4f914f2b7 100644 (file)
@@ -1,3 +1,9 @@
+2011-11-09  Dodji Seketeli  <dodji@redhat.com>
+
+       PR c++/51027
+       * parser.c (cp_parser_alias_declaration): Require ';' at the end
+       of the declaration.
+
 2011-11-09  Dodji Seketeli  <dodji@redhat.com>
 
        PR debug/51032
index fde4c6d838f8daad62eb963a74a716deaa2f1e68..1376a3af0bdc56ca1f3cc93cfc3112a3a5927d1c 100644 (file)
@@ -14942,6 +14942,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
index 4abcf0784a4feff4b710e3dd4e9f7b9c87a2e90c..7b59aeba35939e887777f5795171916cf826af6b 100644 (file)
@@ -1,3 +1,9 @@
+2011-11-09  Dodji Seketeli  <dodji@redhat.com>
+
+       PR c++/51027
+       * g++.dg/cpp0x/alias-decl-12.C: New test.
+       * g++.dg/ext/alias-decl-attr4.C: Append missing ';'.
+
 2011-11-09  Dodji Seketeli  <dodji@redhat.com>
 
        PR debug/51032
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 (file)
index 0000000..11c2686
--- /dev/null
@@ -0,0 +1,4 @@
+// Origin: PR c++/51027
+// { dg-options "-std=c++0x" }
+
+using INT = int // { dg-error "expected|;|at end of input" }
index c4dd048778964cee4732e5b5b490f3cb0109c073..3e1c1c405db03eb198824ab841b0f4fcf34797c5 100644 (file)
@@ -11,7 +11,7 @@ template <class T> struct A
 template < typename Val > struct S
 {
     using vector_type __attribute__((vector_size(16))) =
-        typename A<Val>::type
+        typename A<Val>::type;
         typedef Val vector_type2 __attribute__((vector_size(16)));
     int pr_size() { return sizeof(vector_type); }
     int pr_size2() { return sizeof(vector_type2); }
index b8b6e358dce7aaffe187578d6729b7cc0a0d2e22..4d4608e3625174852a029ae36d2fdb7d848f7d2c 100644 (file)
@@ -1,3 +1,8 @@
+2011-11-09  Dodji Seketeli  <dodji@redhat.com>
+
+       PR c++/51027
+       * include/ext/pointer.h (rebind): Append missing ';'.
+
 2011-11-09  Jonathan Wakely  <jwakely.gcc@gmail.com>
 
        * include/bits/stl_vector.h (vector::_Alloc_traits): Make private.
index 45fed19993ed2354a8566ac94e0b3322c807e977..8b33740f25b957e59a7f9978e50ce0605e10ee4f 100644 (file)
@@ -579,7 +579,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
       template<typename _Up>
         using rebind = typename __gnu_cxx::_Pointer_adapter<
-          typename pointer_traits<_Storage_policy>::rebind<_Up>>
+       typename pointer_traits<_Storage_policy>::rebind<_Up>>;
 
       static pointer pointer_to(typename pointer::reference __r) noexcept
       { return pointer(std::addressof(__r)); }