From: Anders Carlsson Date: Fri, 25 Mar 2011 11:19:41 +0000 (+0000) Subject: Remove 'new' from virt-specifier since it's going to be removed in the next C++0x... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b1f39680a2e3bce508dba0600665860e5ba5fb70;p=clang Remove 'new' from virt-specifier since it's going to be removed in the next C++0x draft git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128271 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Sema/DeclSpec.h b/include/clang/Sema/DeclSpec.h index 23a054a43c..60f5ea1856 100644 --- a/include/clang/Sema/DeclSpec.h +++ b/include/clang/Sema/DeclSpec.h @@ -1704,8 +1704,7 @@ public: enum Specifier { VS_None = 0, VS_Override = 1, - VS_Final = 2, - VS_New = 4 + VS_Final = 2 }; VirtSpecifiers() : Specifiers(0) { } @@ -1719,9 +1718,6 @@ public: bool isFinalSpecified() const { return Specifiers & VS_Final; } SourceLocation getFinalLoc() const { return VS_finalLoc; } - bool isNewSpecified() const { return Specifiers & VS_New; } - SourceLocation getNewLoc() const { return VS_newLoc; } - void clear() { Specifiers = 0; } static const char *getSpecifierName(Specifier VS); @@ -1731,7 +1727,7 @@ public: private: unsigned Specifiers; - SourceLocation VS_overrideLoc, VS_finalLoc, VS_newLoc; + SourceLocation VS_overrideLoc, VS_finalLoc; SourceLocation LastLocation; }; diff --git a/lib/Parse/ParseCXXInlineMethods.cpp b/lib/Parse/ParseCXXInlineMethods.cpp index baa038ea98..47b3ff9ec5 100644 --- a/lib/Parse/ParseCXXInlineMethods.cpp +++ b/lib/Parse/ParseCXXInlineMethods.cpp @@ -41,8 +41,6 @@ Decl *Parser::ParseCXXInlineMethodDef(AccessSpecifier AS, ParsingDeclarator &D, Diag(VS.getOverrideLoc(), diag::ext_override_inline) << "override"; if (VS.isFinalSpecified()) Diag(VS.getFinalLoc(), diag::ext_override_inline) << "final"; - if (VS.isNewSpecified()) - Diag(VS.getNewLoc(), diag::ext_override_inline) << "new"; FnD = Actions.ActOnCXXMemberDeclarator(getCurScope(), AS, D, move(TemplateParams), 0, diff --git a/lib/Parse/ParseDeclCXX.cpp b/lib/Parse/ParseDeclCXX.cpp index 4d454313d8..c50ff4c9db 100644 --- a/lib/Parse/ParseDeclCXX.cpp +++ b/lib/Parse/ParseDeclCXX.cpp @@ -1269,14 +1269,10 @@ void Parser::HandleMemberFunctionDefaultArgs(Declarator& DeclaratorInfo, /// virt-specifier: /// override /// final -/// new VirtSpecifiers::Specifier Parser::isCXX0XVirtSpecifier() const { if (!getLang().CPlusPlus) return VirtSpecifiers::VS_None; - if (Tok.is(tok::kw_new)) - return VirtSpecifiers::VS_New; - if (Tok.is(tok::identifier)) { IdentifierInfo *II = Tok.getIdentifierInfo(); diff --git a/lib/Sema/DeclSpec.cpp b/lib/Sema/DeclSpec.cpp index 9bbeef7cb0..8f3f3a5820 100644 --- a/lib/Sema/DeclSpec.cpp +++ b/lib/Sema/DeclSpec.cpp @@ -829,7 +829,6 @@ bool VirtSpecifiers::SetSpecifier(Specifier VS, SourceLocation Loc, default: assert(0 && "Unknown specifier!"); case VS_Override: VS_overrideLoc = Loc; break; case VS_Final: VS_finalLoc = Loc; break; - case VS_New: VS_newLoc = Loc; break; } return false; @@ -840,7 +839,6 @@ const char *VirtSpecifiers::getSpecifierName(Specifier VS) { default: assert(0 && "Unknown specifier"); case VS_Override: return "override"; case VS_Final: return "final"; - case VS_New: return "new"; } } diff --git a/test/CXX/class/class.mem/p8-0x-pedantic.cpp b/test/CXX/class/class.mem/p8-0x-pedantic.cpp index a4b775c191..78153739ce 100644 --- a/test/CXX/class/class.mem/p8-0x-pedantic.cpp +++ b/test/CXX/class/class.mem/p8-0x-pedantic.cpp @@ -8,7 +8,6 @@ namespace inline_extension { struct B : Base1 { virtual void f() override {} // expected-warning {{'override' keyword only allowed in declarations, allowed as an extension}} virtual void g() final {} // expected-warning {{'final' keyword only allowed in declarations, allowed as an extension}} - virtual void h() new {} // expected-warning {{'new' keyword only allowed in declarations, allowed as an extension}} }; } diff --git a/test/CXX/class/class.mem/p8-0x.cpp b/test/CXX/class/class.mem/p8-0x.cpp index bf1b4c177b..836ebad48e 100644 --- a/test/CXX/class/class.mem/p8-0x.cpp +++ b/test/CXX/class/class.mem/p8-0x.cpp @@ -5,7 +5,6 @@ struct Base1 { }; struct A : Base1 { - virtual void f() new new; // expected-error {{class member already marked 'new'}} virtual void g() override override; // expected-error {{class member already marked 'override'}} virtual void h() final final; // expected-error {{class member already marked 'final'}} }; @@ -34,7 +33,6 @@ namespace inline_extension { }; struct A : Base1 { - virtual void f() new new {} // expected-error {{class member already marked 'new'}} virtual void g() override override {} // expected-error {{class member already marked 'override'}} virtual void h() final final {} // expected-error {{class member already marked 'final'}} }; diff --git a/test/Parser/cxx0x-override-control-keywords.cpp b/test/Parser/cxx0x-override-control-keywords.cpp index f959f7a995..91d5132feb 100644 --- a/test/Parser/cxx0x-override-control-keywords.cpp +++ b/test/Parser/cxx0x-override-control-keywords.cpp @@ -7,9 +7,6 @@ struct Base { struct S : Base { virtual void final() final; virtual void override() override; - virtual void n() new; - int i : 3 new; - int j new; }; struct T {