Comments
Patch
@@ -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
new file mode 100644
@@ -0,0 +1,4 @@
+// Origin: PR c++/51027
+// { dg-options "-std=c++0x" }
+
+using INT = int // { dg-error "expected|;|at end of input" }
@@ -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); }
@@ -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)); }
Err, this is the proper patch, sorry. 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 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 ';'. --- gcc/cp/parser.c | 1 + gcc/testsuite/g++.dg/cpp0x/alias-decl-12.C | 4 ++++ gcc/testsuite/g++.dg/ext/alias-decl-attr4.C | 2 +- libstdc++-v3/include/ext/pointer.h | 2 +- 4 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/g++.dg/cpp0x/alias-decl-12.C