diff options
Diffstat (limited to 'clang/lib/Parse/ParseDeclCXX.cpp')
-rw-r--r-- | clang/lib/Parse/ParseDeclCXX.cpp | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/clang/lib/Parse/ParseDeclCXX.cpp b/clang/lib/Parse/ParseDeclCXX.cpp index 7c4c83d032b..9ba44d07aba 100644 --- a/clang/lib/Parse/ParseDeclCXX.cpp +++ b/clang/lib/Parse/ParseDeclCXX.cpp @@ -61,7 +61,7 @@ Parser::DeclGroupPtrTy Parser::ParseNamespace(DeclaratorContext Context, assert(Tok.is(tok::kw_namespace) && "Not a namespace!"); SourceLocation NamespaceLoc = ConsumeToken(); // eat the 'namespace'. ObjCDeclContextSwitch ObjCDC(*this); - + if (Tok.is(tok::code_completion)) { Actions.CodeCompleteNamespaceDecl(getCurScope()); cutOffParsing(); @@ -130,8 +130,8 @@ Parser::DeclGroupPtrTy Parser::ParseNamespace(DeclaratorContext Context, return nullptr; } - if (getCurScope()->isClassScope() || getCurScope()->isTemplateParamScope() || - getCurScope()->isInObjcMethodScope() || getCurScope()->getBlockParent() || + if (getCurScope()->isClassScope() || getCurScope()->isTemplateParamScope() || + getCurScope()->isInObjcMethodScope() || getCurScope()->getBlockParent() || getCurScope()->getFnParent()) { Diag(T.getOpenLocation(), diag::err_namespace_nonnamespace_scope); SkipUntil(tok::r_brace); @@ -190,7 +190,7 @@ Parser::DeclGroupPtrTy Parser::ParseNamespace(DeclaratorContext Context, PrettyDeclStackTraceEntry CrashInfo(Actions.Context, NamespcDecl, NamespaceLoc, "parsing namespace"); - // Parse the contents of the namespace. This includes parsing recovery on + // Parse the contents of the namespace. This includes parsing recovery on // any improperly nested namespaces. ParseInnerNamespace(ExtraIdentLoc, ExtraIdent, ExtraNamespaceLoc, 0, InlineLoc, attrs, T); @@ -200,8 +200,8 @@ Parser::DeclGroupPtrTy Parser::ParseNamespace(DeclaratorContext Context, DeclEnd = T.getCloseLocation(); Actions.ActOnFinishNamespaceDef(NamespcDecl, DeclEnd); - - return Actions.ConvertDeclToDeclGroup(NamespcDecl, + + return Actions.ConvertDeclToDeclGroup(NamespcDecl, ImplicitUsingDirectiveDecl); } @@ -236,7 +236,7 @@ void Parser::ParseInnerNamespace(std::vector<SourceLocation> &IdentLoc, getCurScope(), SourceLocation(), NamespaceLoc[index], IdentLoc[index], Ident[index], Tracker.getOpenLocation(), attrs, ImplicitUsingDirectiveDecl); - assert(!ImplicitUsingDirectiveDecl && + assert(!ImplicitUsingDirectiveDecl && "nested namespace definition cannot define anonymous namespace"); ParseInnerNamespace(IdentLoc, Ident, NamespaceLoc, ++index, InlineLoc, @@ -438,7 +438,7 @@ Parser::ParseUsingDirectiveOrDeclaration(DeclaratorContext Context, ParsedAttributesWithRange &attrs) { assert(Tok.is(tok::kw_using) && "Not using token"); ObjCDeclContextSwitch ObjCDC(*this); - + // Eat 'using'. SourceLocation UsingLoc = ConsumeToken(); @@ -896,7 +896,7 @@ Decl *Parser::ParseStaticAssertDeclaration(SourceLocation &DeclEnd){ SourceLocation Parser::ParseDecltypeSpecifier(DeclSpec &DS) { assert(Tok.isOneOf(tok::kw_decltype, tok::annot_decltype) && "Not a decltype specifier"); - + ExprResult Result; SourceLocation StartLoc = Tok.getLocation(); SourceLocation EndLoc; @@ -999,7 +999,7 @@ SourceLocation Parser::ParseDecltypeSpecifier(DeclSpec &DS) { return EndLoc; } -void Parser::AnnotateExistingDecltypeSpecifier(const DeclSpec& DS, +void Parser::AnnotateExistingDecltypeSpecifier(const DeclSpec& DS, SourceLocation StartLoc, SourceLocation EndLoc) { // make sure we have a token we can turn into an annotation token @@ -1050,9 +1050,9 @@ void Parser::ParseUnderlyingTypeSpecifier(DeclSpec &DS) { } /// ParseBaseTypeSpecifier - Parse a C++ base-type-specifier which is either a -/// class name or decltype-specifier. Note that we only check that the result -/// names a type; semantic analysis will need to verify that the type names a -/// class. The result is either a type or null, depending on whether a type +/// class name or decltype-specifier. Note that we only check that the result +/// names a type; semantic analysis will need to verify that the type names a +/// class. The result is either a type or null, depending on whether a type /// name was found. /// /// base-type-specifier: [C++11 class.derived] @@ -1083,7 +1083,7 @@ TypeResult Parser::ParseBaseTypeSpecifier(SourceLocation &BaseLoc, BaseLoc = Tok.getLocation(); // Parse decltype-specifier - // tok == kw_decltype is just error recovery, it can only happen when SS + // tok == kw_decltype is just error recovery, it can only happen when SS // isn't empty if (Tok.isOneOf(tok::kw_decltype, tok::annot_decltype)) { if (SS.isNotEmpty()) @@ -1348,8 +1348,8 @@ bool Parser::isValidAfterTypeSpecifier(bool CouldBeBitfield) { void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind, SourceLocation StartLoc, DeclSpec &DS, const ParsedTemplateInfo &TemplateInfo, - AccessSpecifier AS, - bool EnteringContext, DeclSpecContext DSC, + AccessSpecifier AS, + bool EnteringContext, DeclSpecContext DSC, ParsedAttributesWithRange &Attributes) { DeclSpec::TST TagType; if (TagTokKind == tok::kw_struct) @@ -2061,7 +2061,7 @@ BaseResult Parser::ParseBaseSpecifier(Decl *ClassDecl) { if (BaseType.isInvalid()) return true; - // Parse the optional ellipsis (for a pack expansion). The ellipsis is + // Parse the optional ellipsis (for a pack expansion). The ellipsis is // actually part of the base-specifier-list grammar productions, but we // parse it here for convenience. SourceLocation EllipsisLoc; @@ -2229,7 +2229,7 @@ void Parser::ParseOptionalCXX11VirtSpecifierSeq(VirtSpecifiers &VS, bool Parser::isCXX11FinalKeyword() const { VirtSpecifiers::Specifier Specifier = isCXX11VirtSpecifier(); return Specifier == VirtSpecifiers::VS_Final || - Specifier == VirtSpecifiers::VS_GNU_Final || + Specifier == VirtSpecifiers::VS_GNU_Final || Specifier == VirtSpecifiers::VS_Sealed; } @@ -2397,7 +2397,7 @@ void Parser::MaybeParseAndDiagnoseDeclSpecAfterCXX11VirtSpecifierSeq( /// override /// final /// [MS] sealed -/// +/// /// pure-specifier: /// '= 0' /// @@ -2648,9 +2648,9 @@ Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS, } DeclaratorInfo.setFunctionDefinitionKind(DefinitionKind); - // C++11 [dcl.attr.grammar] p4: If an attribute-specifier-seq appertains + // C++11 [dcl.attr.grammar] p4: If an attribute-specifier-seq appertains // to a friend declaration, that declaration shall be a definition. - if (DeclaratorInfo.isFunctionDeclarator() && + if (DeclaratorInfo.isFunctionDeclarator() && DefinitionKind != FDK_Definition && DS.isFriendSpecified()) { // Diagnose attributes that appear before decl specifier: // [[]] friend int foo(); @@ -3142,7 +3142,7 @@ void Parser::ParseCXXMemberSpecification(SourceLocation RecordLoc, if (getLangOpts().CPlusPlus && Tok.is(tok::identifier)) { VirtSpecifiers::Specifier Specifier = isCXX11VirtSpecifier(Tok); assert((Specifier == VirtSpecifiers::VS_Final || - Specifier == VirtSpecifiers::VS_GNU_Final || + Specifier == VirtSpecifiers::VS_GNU_Final || Specifier == VirtSpecifiers::VS_Sealed) && "not a class definition"); FinalLoc = ConsumeToken(); @@ -3457,7 +3457,7 @@ MemInitResult Parser::ParseMemInitializer(Decl *ConstructorDecl) { TryConsumeToken(tok::ellipsis, EllipsisLoc); return Actions.ActOnMemInitializer(ConstructorDecl, getCurScope(), SS, II, - TemplateTypeTy, DS, IdLoc, + TemplateTypeTy, DS, IdLoc, InitList.get(), EllipsisLoc); } else if(Tok.is(tok::l_paren)) { BalancedDelimiterTracker T(*this, tok::l_paren); @@ -3506,7 +3506,7 @@ Parser::tryParseExceptionSpecification(bool Delayed, CachedTokens *&ExceptionSpecTokens) { ExceptionSpecificationType Result = EST_None; ExceptionSpecTokens = nullptr; - + // Handle delayed parsing of exception-specifications. if (Delayed) { if (Tok.isNot(tok::kw_throw) && Tok.isNot(tok::kw_noexcept)) @@ -3525,11 +3525,11 @@ Parser::tryParseExceptionSpecification(bool Delayed, NoexceptExpr = nullptr; return EST_BasicNoexcept; } - + Diag(Tok, diag::err_expected_lparen_after) << "throw"; return EST_DynamicNone; } - + // Cache the tokens for the exception-specification. ExceptionSpecTokens = new CachedTokens; ExceptionSpecTokens->push_back(StartTok); // 'throw' or 'noexcept' @@ -3543,7 +3543,7 @@ Parser::tryParseExceptionSpecification(bool Delayed, return EST_Unparsed; } - + // See if there's a dynamic specification. if (Tok.is(tok::kw_throw)) { Result = ParseDynamicExceptionSpecification(SpecificationRange, @@ -3660,7 +3660,7 @@ ExceptionSpecificationType Parser::ParseDynamicExceptionSpecification( if (Tok.is(tok::ellipsis)) { // C++0x [temp.variadic]p5: - // - In a dynamic-exception-specification (15.4); the pattern is a + // - In a dynamic-exception-specification (15.4); the pattern is a // type-id. SourceLocation Ellipsis = ConsumeToken(); Range.setEnd(Ellipsis); @@ -4207,7 +4207,7 @@ void Parser::ParseMicrosoftIfExistsClassDeclaration( IfExistsCondition Result; if (ParseMicrosoftIfExistsCondition(Result)) return; - + BalancedDelimiterTracker Braces(*this, tok::l_brace); if (Braces.consumeOpen()) { Diag(Tok, diag::err_expected) << tok::l_brace; @@ -4218,13 +4218,13 @@ void Parser::ParseMicrosoftIfExistsClassDeclaration( case IEB_Parse: // Parse the declarations below. break; - + case IEB_Dependent: Diag(Result.KeywordLoc, diag::warn_microsoft_dependent_exists) << Result.IsIfExists; // Fall through to skip. LLVM_FALLTHROUGH; - + case IEB_Skip: Braces.skipToEnd(); return; @@ -4262,6 +4262,6 @@ void Parser::ParseMicrosoftIfExistsClassDeclaration( // Parse all the comma separated declarators. ParseCXXClassMemberDeclaration(CurAS, AccessAttrs); } - + Braces.consumeClose(); } |