IdentifierInfo *Ident_vector;
IdentifierInfo *Ident_pixel;
+ /// C++0x contextual keywords.
+ IdentifierInfo *Ident_final;
+ IdentifierInfo *Ident_override;
+
llvm::OwningPtr<PragmaHandler> AlignHandler;
llvm::OwningPtr<PragmaHandler> GCCVisibilityHandler;
llvm::OwningPtr<PragmaHandler> OptionsHandler;
ExprResult ParseCXX0XAlignArgument(SourceLocation Start);
+ bool isCXX0XVirtSpecifier() const;
+ void ParseOptionalCXX0XVirtSpecifierSeq();
+
/// DeclaratorScopeObj - RAII object used in Parser::ParseDirectDeclarator to
/// enter a new C++ declarator scope and exit it when the function is
/// finished.
}
}
+/// isCXX0XVirtSpecifier - Determine whether the next token is a C++0x
+/// virt-specifier.
+///
+/// virt-specifier:
+/// override
+/// final
+/// new
+bool Parser::isCXX0XVirtSpecifier() const {
+ if (Tok.is(tok::kw_new))
+ return true;
+
+ if (Tok.isNot(tok::identifier))
+ return false;
+
+ const IdentifierInfo *II = Tok.getIdentifierInfo();
+ return II == Ident_override || II == Ident_final;
+}
+
+/// ParseOptionalCXX0XVirtSpecifierSeq - Parse a virt-specifier-seq.
+///
+/// virt-specifier-seq:
+/// virt-specifier
+/// virt-specifier-seq virt-specifier
+void Parser::ParseOptionalCXX0XVirtSpecifierSeq() {
+ if (!getLang().CPlusPlus0x)
+ return;
+
+ while (isCXX0XVirtSpecifier()) {
+ // FIXME: Actually do something with the specifier.
+ ConsumeToken();
+ }
+}
+
/// ParseCXXClassMemberDeclaration - Parse a C++ class member declaration.
///
/// member-declaration:
/// member-declarator-list ',' member-declarator
///
/// member-declarator:
-/// declarator pure-specifier[opt]
+/// declarator virt-specifier-seq[opt] pure-specifier[opt]
/// declarator constant-initializer[opt]
/// identifier[opt] ':' constant-expression
///
+/// virt-specifier-seq:
+/// virt-specifier
+/// virt-specifier-seq virt-specifier
+///
+/// virt-specifier:
+/// override
+/// final
+/// new
+///
/// pure-specifier:
/// '= 0'
///
SkipUntil(tok::comma, true, true);
}
+ ParseOptionalCXX0XVirtSpecifierSeq();
+
// pure-specifier:
// '= 0'
//
ObjCTypeQuals[objc_byref] = &PP.getIdentifierTable().get("byref");
}
+ // Initialize C++0x contextual keywords.
+ if (getLang().CPlusPlus0x) {
+ Ident_final = &PP.getIdentifierTable().get("final");
+ Ident_override = &PP.getIdentifierTable().get("override");
+ }
+
Ident_super = &PP.getIdentifierTable().get("super");
if (getLang().AltiVec) {