diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-01-02 11:42:31 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-01-02 11:42:31 +0000 |
| commit | 2bf7fdb723fc513e3d12bfdf96102c46230f74e3 (patch) | |
| tree | 05892ba7d5ed952e7e46355c6aa48604de92e735 /clang/lib/Sema | |
| parent | 9fb823bbd484eebe4f8756338b14ed3725261997 (diff) | |
| download | bcm5719-llvm-2bf7fdb723fc513e3d12bfdf96102c46230f74e3.tar.gz bcm5719-llvm-2bf7fdb723fc513e3d12bfdf96102c46230f74e3.zip | |
s/CPlusPlus0x/CPlusPlus11/g
llvm-svn: 171367
Diffstat (limited to 'clang/lib/Sema')
24 files changed, 156 insertions, 156 deletions
diff --git a/clang/lib/Sema/AnalysisBasedWarnings.cpp b/clang/lib/Sema/AnalysisBasedWarnings.cpp index 0eca503cd52..9717c0887a6 100644 --- a/clang/lib/Sema/AnalysisBasedWarnings.cpp +++ b/clang/lib/Sema/AnalysisBasedWarnings.cpp @@ -827,7 +827,7 @@ static void DiagnoseSwitchLabelsFallthrough(Sema &S, AnalysisDeclContext &AC, // // NOTE: This an intermediate solution. There are on-going discussions on // how to properly support this warning outside of C++11 with an annotation. - if (!AC.getASTContext().getLangOpts().CPlusPlus0x) + if (!AC.getASTContext().getLangOpts().CPlusPlus11) return; FallthroughMapper FM(S); @@ -864,7 +864,7 @@ static void DiagnoseSwitchLabelsFallthrough(Sema &S, AnalysisDeclContext &AC, SourceLocation L = Label->getLocStart(); if (L.isMacroID()) continue; - if (S.getLangOpts().CPlusPlus0x) { + if (S.getLangOpts().CPlusPlus11) { const Stmt *Term = B.getTerminator(); if (!(B.empty() && Term && isa<BreakStmt>(Term))) { Preprocessor &PP = S.getPreprocessor(); diff --git a/clang/lib/Sema/DeclSpec.cpp b/clang/lib/Sema/DeclSpec.cpp index 70d01203fcd..a81c0093bb7 100644 --- a/clang/lib/Sema/DeclSpec.cpp +++ b/clang/lib/Sema/DeclSpec.cpp @@ -928,9 +928,9 @@ void DeclSpec::Finish(DiagnosticsEngine &D, Preprocessor &PP) { } // Diagnose if we've recovered from an ill-formed 'auto' storage class // specifier in a pre-C++0x dialect of C++. - if (!PP.getLangOpts().CPlusPlus0x && TypeSpecType == TST_auto) + if (!PP.getLangOpts().CPlusPlus11 && TypeSpecType == TST_auto) Diag(D, TSTLoc, diag::ext_auto_type_specifier); - if (PP.getLangOpts().CPlusPlus && !PP.getLangOpts().CPlusPlus0x && + if (PP.getLangOpts().CPlusPlus && !PP.getLangOpts().CPlusPlus11 && StorageClassSpec == SCS_auto) Diag(D, StorageClassSpecLoc, diag::warn_auto_storage_class) << FixItHint::CreateRemoval(StorageClassSpecLoc); diff --git a/clang/lib/Sema/JumpDiagnostics.cpp b/clang/lib/Sema/JumpDiagnostics.cpp index 01a4afb9803..5f92cfffc6b 100644 --- a/clang/lib/Sema/JumpDiagnostics.cpp +++ b/clang/lib/Sema/JumpDiagnostics.cpp @@ -674,7 +674,7 @@ static bool IsMicrosoftJumpWarning(unsigned JumpDiag, unsigned InDiagNote) { /// Return true if a particular note should be downgraded to a compatibility /// warning in C++11 mode. static bool IsCXX98CompatWarning(Sema &S, unsigned InDiagNote) { - return S.getLangOpts().CPlusPlus0x && + return S.getLangOpts().CPlusPlus11 && InDiagNote == diag::note_protected_by_variable_non_pod; } diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp index a639d3bc464..66861ae663a 100644 --- a/clang/lib/Sema/Sema.cpp +++ b/clang/lib/Sema/Sema.cpp @@ -683,7 +683,7 @@ void Sema::ActOnEndOfTranslationUnit() { } - if (LangOpts.CPlusPlus0x && + if (LangOpts.CPlusPlus11 && Diags.getDiagnosticLevel(diag::warn_delegating_ctor_cycle, SourceLocation()) != DiagnosticsEngine::Ignored) @@ -848,7 +848,7 @@ void Sema::EmitCurrentDiagnostic(unsigned DiagID) { // Additionally, the AccessCheckingSFINAE flag can be used to temporarily // make access control a part of SFINAE for the purposes of checking // type traits. - if (!AccessCheckingSFINAE && !getLangOpts().CPlusPlus0x) + if (!AccessCheckingSFINAE && !getLangOpts().CPlusPlus11) break; SourceLocation Loc = Diags.getCurrentDiagLoc(); diff --git a/clang/lib/Sema/SemaCXXScopeSpec.cpp b/clang/lib/Sema/SemaCXXScopeSpec.cpp index efb150be04e..979c05ba0ac 100644 --- a/clang/lib/Sema/SemaCXXScopeSpec.cpp +++ b/clang/lib/Sema/SemaCXXScopeSpec.cpp @@ -281,11 +281,11 @@ bool Sema::isAcceptableNestedNameSpecifier(NamedDecl *SD) { return true; else if (TypedefNameDecl *TD = dyn_cast<TypedefNameDecl>(SD)) { if (TD->getUnderlyingType()->isRecordType() || - (Context.getLangOpts().CPlusPlus0x && + (Context.getLangOpts().CPlusPlus11 && TD->getUnderlyingType()->isEnumeralType())) return true; } else if (isa<RecordDecl>(SD) || - (Context.getLangOpts().CPlusPlus0x && isa<EnumDecl>(SD))) + (Context.getLangOpts().CPlusPlus11 && isa<EnumDecl>(SD))) return true; return false; @@ -534,7 +534,7 @@ bool Sema::BuildCXXNestedNameSpecifier(Scope *S, NamedDecl *SD = Found.getAsSingle<NamedDecl>(); if (isAcceptableNestedNameSpecifier(SD)) { if (!ObjectType.isNull() && !ObjectTypeSearchedInScope && - !getLangOpts().CPlusPlus0x) { + !getLangOpts().CPlusPlus11) { // C++03 [basic.lookup.classref]p4: // [...] If the name is found in both contexts, the // class-name-or-namespace-name shall refer to the same entity. diff --git a/clang/lib/Sema/SemaCast.cpp b/clang/lib/Sema/SemaCast.cpp index 28b58279a52..676db464b63 100644 --- a/clang/lib/Sema/SemaCast.cpp +++ b/clang/lib/Sema/SemaCast.cpp @@ -1775,7 +1775,7 @@ static TryCastResult TryReinterpretCast(Sema &Self, ExprResult &SrcExpr, // FIXME: Conditionally-supported behavior should be configurable in the // TargetInfo or similar. Self.Diag(OpRange.getBegin(), - Self.getLangOpts().CPlusPlus0x ? + Self.getLangOpts().CPlusPlus11 ? diag::warn_cxx98_compat_cast_fn_obj : diag::ext_cast_fn_obj) << OpRange; return TC_Success; @@ -1784,7 +1784,7 @@ static TryCastResult TryReinterpretCast(Sema &Self, ExprResult &SrcExpr, if (DestType->isFunctionPointerType()) { // See above. Self.Diag(OpRange.getBegin(), - Self.getLangOpts().CPlusPlus0x ? + Self.getLangOpts().CPlusPlus11 ? diag::warn_cxx98_compat_cast_fn_obj : diag::ext_cast_fn_obj) << OpRange; return TC_Success; diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp index f0de7becb20..fe514640d39 100644 --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/lib/Sema/SemaChecking.cpp @@ -2904,7 +2904,7 @@ CheckPrintfHandler::checkFormatExpr(const analyze_printf::PrintfSpecifier &FS, EmitFormatDiagnostic( S.PDiag(DiagKind) - << S.getLangOpts().CPlusPlus0x + << S.getLangOpts().CPlusPlus11 << ExprTy << CallType << AT.getRepresentativeTypeName(S.Context) diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp index ab8cac8944a..a23fdb140ac 100644 --- a/clang/lib/Sema/SemaCodeComplete.cpp +++ b/clang/lib/Sema/SemaCodeComplete.cpp @@ -1257,7 +1257,7 @@ static void AddTypeSpecifierResults(const LangOptions &LangOpts, Builder.AddPlaceholderChunk("name"); Results.AddResult(Result(Builder.TakeString())); - if (LangOpts.CPlusPlus0x) { + if (LangOpts.CPlusPlus11) { Results.AddResult(Result("auto", CCP_Type)); Results.AddResult(Result("char16_t", CCP_Type)); Results.AddResult(Result("char32_t", CCP_Type)); @@ -1907,7 +1907,7 @@ static void AddOrdinaryNameResults(Sema::ParserCompletionContext CCC, // FIXME: Rethrow? - if (SemaRef.getLangOpts().CPlusPlus0x) { + if (SemaRef.getLangOpts().CPlusPlus11) { // nullptr Builder.AddResultTypeChunk("std::nullptr_t"); Builder.AddTypedTextChunk("nullptr"); @@ -2931,7 +2931,7 @@ static void AddPrettyFunctionResults(const LangOptions &LangOpts, Results.AddResult(Result("__PRETTY_FUNCTION__", CCP_Constant)); Results.AddResult(Result("__FUNCTION__", CCP_Constant)); - if (LangOpts.C99 || LangOpts.CPlusPlus0x) + if (LangOpts.C99 || LangOpts.CPlusPlus11) Results.AddResult(Result("__func__", CCP_Constant)); Results.ExitScope(); } @@ -5164,7 +5164,7 @@ void Sema::CodeCompleteObjCMessageReceiver(Scope *S) { ResultBuilder Results(*this, CodeCompleter->getAllocator(), CodeCompleter->getCodeCompletionTUInfo(), CodeCompletionContext::CCC_ObjCMessageReceiver, - getLangOpts().CPlusPlus0x + getLangOpts().CPlusPlus11 ? &ResultBuilder::IsObjCMessageReceiverOrLambdaCapture : &ResultBuilder::IsObjCMessageReceiver); @@ -5183,7 +5183,7 @@ void Sema::CodeCompleteObjCMessageReceiver(Scope *S) { AddSuperSendCompletion(*this, /*NeedSuperKeyword=*/true, 0, 0, Results); } - if (getLangOpts().CPlusPlus0x) + if (getLangOpts().CPlusPlus11) addThisCompletion(*this, Results); Results.ExitScope(); diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 8d3abe73010..26aa5de009b 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -4338,7 +4338,7 @@ Sema::ActOnVariableDeclarator(Scope *S, Declarator &D, DeclContext *DC, // the program is ill-formed. C++11 drops this restriction. if (RD->isUnion()) Diag(D.getIdentifierLoc(), - getLangOpts().CPlusPlus0x + getLangOpts().CPlusPlus11 ? diag::warn_cxx98_compat_static_data_member_in_union : diag::ext_static_data_member_in_union) << Name; // We conservatively disallow static data members in anonymous structs. @@ -5199,7 +5199,7 @@ static FunctionDecl* CreateNewFunctionDecl(Sema &SemaRef, Declarator &D, // If the class is complete, then we now create the implicit exception // specification. If the class is incomplete or dependent, we can't do // it yet. - if (SemaRef.getLangOpts().CPlusPlus0x && !Record->isDependentType() && + if (SemaRef.getLangOpts().CPlusPlus11 && !Record->isDependentType() && Record->getDefinition() && !Record->isBeingDefined() && R->getAs<FunctionProtoType>()->getExceptionSpecType() == EST_None) { SemaRef.AdjustDestructorExceptionSpec(Record, NewDD); @@ -5618,7 +5618,7 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, DeclContext *DC, const FunctionProtoType *FPT = R->getAs<FunctionProtoType>(); if ((Name.getCXXOverloadedOperator() == OO_Delete || Name.getCXXOverloadedOperator() == OO_Array_Delete) && - getLangOpts().CPlusPlus0x && FPT && !FPT->hasExceptionSpec()) { + getLangOpts().CPlusPlus11 && FPT && !FPT->hasExceptionSpec()) { FunctionProtoType::ExtProtoInfo EPI = FPT->getExtProtoInfo(); EPI.ExceptionSpecType = EST_BasicNoexcept; NewFD->setType(Context.getFunctionType(FPT->getResultType(), @@ -6864,7 +6864,7 @@ void Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init, } else if (DclT->isIntegralOrEnumerationType()) { // Check whether the expression is a constant expression. SourceLocation Loc; - if (getLangOpts().CPlusPlus0x && DclT.isVolatileQualified()) + if (getLangOpts().CPlusPlus11 && DclT.isVolatileQualified()) // In C++11, a non-constexpr const static data member with an // in-class initializer cannot be volatile. Diag(VDecl->getLocation(), diag::err_in_class_initializer_volatile); @@ -6889,7 +6889,7 @@ void Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init, } else if (DclT->isFloatingType()) { // also permits complex, which is ok Diag(VDecl->getLocation(), diag::ext_in_class_initializer_float_type) << DclT << Init->getSourceRange(); - if (getLangOpts().CPlusPlus0x) + if (getLangOpts().CPlusPlus11) Diag(VDecl->getLocation(), diag::note_in_class_initializer_float_type_constexpr) << FixItHint::CreateInsertion(VDecl->getLocStart(), "constexpr "); @@ -6901,7 +6901,7 @@ void Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init, } // Suggest adding 'constexpr' in C++11 for literal types. - } else if (getLangOpts().CPlusPlus0x && DclT->isLiteralType()) { + } else if (getLangOpts().CPlusPlus11 && DclT->isLiteralType()) { Diag(VDecl->getLocation(), diag::err_in_class_initializer_literal_type) << DclT << Init->getSourceRange() << FixItHint::CreateInsertion(VDecl->getLocStart(), "constexpr "); @@ -9174,7 +9174,7 @@ CreateNewDecl: // If this is an undefined enum, warn. if (TUK != TUK_Definition && !Invalid) { TagDecl *Def; - if (getLangOpts().CPlusPlus0x && cast<EnumDecl>(New)->isFixed()) { + if (getLangOpts().CPlusPlus11 && cast<EnumDecl>(New)->isFixed()) { // C++0x: 7.2p2: opaque-enum-declaration. // Conflicts are diagnosed above. Do nothing. } @@ -9839,7 +9839,7 @@ bool Sema::CheckNontrivialField(FieldDecl *FD) { member = CXXDestructor; if (member != CXXInvalid) { - if (!getLangOpts().CPlusPlus0x && + if (!getLangOpts().CPlusPlus11 && getLangOpts().ObjCAutoRefCount && RDecl->hasObjectMember()) { // Objective-C++ ARC: it is an error to have a non-trivial field of // a union. However, system headers in Objective-C programs @@ -9855,12 +9855,12 @@ bool Sema::CheckNontrivialField(FieldDecl *FD) { } } - Diag(FD->getLocation(), getLangOpts().CPlusPlus0x ? + Diag(FD->getLocation(), getLangOpts().CPlusPlus11 ? diag::warn_cxx98_compat_nontrivial_union_or_anon_struct_member : diag::err_illegal_union_or_anon_struct_member) << (int)FD->getParent()->isUnion() << FD->getDeclName() << member; DiagnoseNontrivial(RDecl, member); - return !getLangOpts().CPlusPlus0x; + return !getLangOpts().CPlusPlus11; } } } @@ -10259,7 +10259,7 @@ void Sema::ActOnFields(Scope* S, if (!CXXRecord->isDependentType()) { // Adjust user-defined destructor exception spec. - if (getLangOpts().CPlusPlus0x && + if (getLangOpts().CPlusPlus11 && CXXRecord->hasUserDeclaredDestructor()) AdjustDestructorExceptionSpec(CXXRecord,CXXRecord->getDestructor()); @@ -10439,7 +10439,7 @@ EnumConstantDecl *Sema::CheckEnumConstant(EnumDecl *Enum, EltTy = Context.DependentTy; else { SourceLocation ExpLoc; - if (getLangOpts().CPlusPlus0x && Enum->isFixed() && + if (getLangOpts().CPlusPlus11 && Enum->isFixed() && !getLangOpts().MicrosoftMode) { // C++11 [dcl.enum]p5: If the underlying type is fixed, [...] the // constant-expression in the enumerator-definition shall be a converted diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index 7036cc71eac..74ce2609748 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -2400,7 +2400,7 @@ MemInitResult Sema::BuildDelegatingInitializer(TypeSourceInfo *TInfo, Expr *Init, CXXRecordDecl *ClassDecl) { SourceLocation NameLoc = TInfo->getTypeLoc().getLocalSourceRange().getBegin(); - if (!LangOpts.CPlusPlus0x) + if (!LangOpts.CPlusPlus11) return Diag(NameLoc, diag::err_delegating_ctor) << TInfo->getTypeLoc().getLocalSourceRange(); Diag(NameLoc, diag::warn_cxx98_compat_delegating_ctor); @@ -4008,7 +4008,7 @@ void Sema::CheckCompletedCXXClass(CXXRecordDecl *Record) { // // We delay this until we know whether an explicitly-defaulted (or deleted) // destructor for the class is trivial. - if (LangOpts.CPlusPlus0x && !Record->isDependentType() && + if (LangOpts.CPlusPlus11 && !Record->isDependentType() && !Record->isLiteral() && !Record->getNumVBases()) { for (CXXRecordDecl::method_iterator M = Record->method_begin(), MEnd = Record->method_end(); @@ -4066,7 +4066,7 @@ static bool specialMemberIsConstexpr(Sema &S, CXXRecordDecl *ClassDecl, static bool defaultedSpecialMemberIsConstexpr(Sema &S, CXXRecordDecl *ClassDecl, Sema::CXXSpecialMember CSM, bool ConstArg) { - if (!S.getLangOpts().CPlusPlus0x) + if (!S.getLangOpts().CPlusPlus11) return false; // C++11 [dcl.constexpr]p4: @@ -4706,7 +4706,7 @@ bool Sema::ShouldDeleteSpecialMember(CXXMethodDecl *MD, CXXSpecialMember CSM, return false; CXXRecordDecl *RD = MD->getParent(); assert(!RD->isDependentType() && "do deletion after instantiation"); - if (!LangOpts.CPlusPlus0x || RD->isInvalidDecl()) + if (!LangOpts.CPlusPlus11 || RD->isInvalidDecl()) return false; // C++11 [expr.lambda.prim]p19: @@ -5394,7 +5394,7 @@ void Sema::AddImplicitlyDeclaredMembersToClass(CXXRecordDecl *ClassDecl) { DeclareImplicitCopyConstructor(ClassDecl); } - if (getLangOpts().CPlusPlus0x && ClassDecl->needsImplicitMoveConstructor()) { + if (getLangOpts().CPlusPlus11 && ClassDecl->needsImplicitMoveConstructor()) { ++ASTContext::NumImplicitMoveConstructors; if (ClassDecl->needsOverloadResolutionForMoveConstructor()) @@ -5413,7 +5413,7 @@ void Sema::AddImplicitlyDeclaredMembersToClass(CXXRecordDecl *ClassDecl) { DeclareImplicitCopyAssignment(ClassDecl); } - if (getLangOpts().CPlusPlus0x && ClassDecl->needsImplicitMoveAssignment()) { + if (getLangOpts().CPlusPlus11 && ClassDecl->needsImplicitMoveAssignment()) { ++ASTContext::NumImplicitMoveAssignmentOperators; // Likewise for the move assignment operator. @@ -5880,7 +5880,7 @@ void Sema::CheckConversionDeclarator(Declarator &D, QualType &R, // C++0x explicit conversion operators. if (D.getDeclSpec().isExplicitSpecified()) Diag(D.getDeclSpec().getExplicitSpecLoc(), - getLangOpts().CPlusPlus0x ? + getLangOpts().CPlusPlus11 ? diag::warn_cxx98_compat_explicit_conversion_functions : diag::ext_explicit_conversion_functions) << SourceRange(D.getDeclSpec().getExplicitSpecLoc()); @@ -6482,14 +6482,14 @@ Decl *Sema::ActOnUsingDeclaration(Scope *S, case UnqualifiedId::IK_ConstructorTemplateId: // C++11 inheriting constructors. Diag(Name.getLocStart(), - getLangOpts().CPlusPlus0x ? + getLangOpts().CPlusPlus11 ? // FIXME: Produce warn_cxx98_compat_using_decl_constructor // instead once inheriting constructors work. diag::err_using_decl_constructor_unsupported : diag::err_using_decl_constructor) << SS.getRange(); - if (getLangOpts().CPlusPlus0x) break; + if (getLangOpts().CPlusPlus11) break; return 0; @@ -6579,7 +6579,7 @@ bool Sema::CheckUsingShadowDecl(UsingDecl *Using, NamedDecl *Orig, // specialization. The UsingShadowDecl in D<T> then points directly // to A::foo, which will look well-formed when we instantiate. // The right solution is to not collapse the shadow-decl chain. - if (!getLangOpts().CPlusPlus0x && CurContext->isRecord()) { + if (!getLangOpts().CPlusPlus11 && CurContext->isRecord()) { DeclContext *OrigDC = Orig->getDeclContext(); // Handle enums and anonymous structs. @@ -7068,7 +7068,7 @@ bool Sema::CheckUsingDeclQualifier(SourceLocation UsingLoc, RequireCompleteDeclContext(const_cast<CXXScopeSpec&>(SS), NamedContext)) return true; - if (getLangOpts().CPlusPlus0x) { + if (getLangOpts().CPlusPlus11) { // C++0x [namespace.udecl]p3: // In a using-declaration used as a member-declaration, the // nested-name-specifier shall name a base class of the class @@ -7889,7 +7889,7 @@ void Sema::ActOnFinishCXXMemberDecls() { void Sema::AdjustDestructorExceptionSpec(CXXRecordDecl *ClassDecl, CXXDestructorDecl *Destructor) { - assert(getLangOpts().CPlusPlus0x && + assert(getLangOpts().CPlusPlus11 && "adjusting dtor exception specs was introduced in c++11"); // C++11 [class.dtor]p3: @@ -8027,7 +8027,7 @@ buildSingleCopyAssignRecursively(Sema &S, SourceLocation Loc, QualType T, // Prior to C++11, filter out any result that isn't a copy/move-assignment // operator. - if (!S.getLangOpts().CPlusPlus0x) { + if (!S.getLangOpts().CPlusPlus11) { LookupResult::Filter F = OpLookup.makeFilter(); while (F.hasNext()) { NamedDecl *D = F.next(); @@ -10303,7 +10303,7 @@ FriendDecl *Sema::CheckFriendTypeDecl(SourceLocation LocStart, std::string InsertionText = std::string(" ") + RD->getKindName(); Diag(TypeRange.getBegin(), - getLangOpts().CPlusPlus0x ? + getLangOpts().CPlusPlus11 ? diag::warn_cxx98_compat_unelaborated_friend_type : diag::ext_unelaborated_friend_type) << (unsigned) RD->getTagKind() @@ -10312,7 +10312,7 @@ FriendDecl *Sema::CheckFriendTypeDecl(SourceLocation LocStart, InsertionText); } else { Diag(FriendLoc, - getLangOpts().CPlusPlus0x ? + getLangOpts().CPlusPlus11 ? diag::warn_cxx98_compat_nonclass_type_friend : diag::ext_nonclass_type_friend) << T @@ -10320,7 +10320,7 @@ FriendDecl *Sema::CheckFriendTypeDecl(SourceLocation LocStart, } } else if (T->getAs<EnumType>()) { Diag(FriendLoc, - getLangOpts().CPlusPlus0x ? + getLangOpts().CPlusPlus11 ? diag::warn_cxx98_compat_enum_friend : diag::ext_enum_friend) << T @@ -10333,7 +10333,7 @@ FriendDecl *Sema::CheckFriendTypeDecl(SourceLocation LocStart, // friend elaborated-type-specifier ; // friend simple-type-specifier ; // friend typename-specifier ; - if (getLangOpts().CPlusPlus0x && LocStart != FriendLoc) + if (getLangOpts().CPlusPlus11 && LocStart != FriendLoc) Diag(FriendLoc, diag::err_friend_not_first_in_declaration) << T; // If the type specifier in a friend declaration designates a (possibly @@ -10666,7 +10666,7 @@ Decl *Sema::ActOnFriendFunctionDecl(Scope *S, Declarator &D, // we do, too. if (!Previous.empty() && DC->Equals(CurContext)) Diag(DS.getFriendSpecLoc(), - getLangOpts().CPlusPlus0x ? + getLangOpts().CPlusPlus11 ? diag::warn_cxx98_compat_friend_is_member : diag::err_friend_is_member); @@ -10714,7 +10714,7 @@ Decl *Sema::ActOnFriendFunctionDecl(Scope *S, Declarator &D, // class that is not a member of the class . . . if (DC->Equals(CurContext)) Diag(DS.getFriendSpecLoc(), - getLangOpts().CPlusPlus0x ? + getLangOpts().CPlusPlus11 ? diag::warn_cxx98_compat_friend_is_member : diag::err_friend_is_member); diff --git a/clang/lib/Sema/SemaExceptionSpec.cpp b/clang/lib/Sema/SemaExceptionSpec.cpp index 01f49aa9c15..937b5771efa 100644 --- a/clang/lib/Sema/SemaExceptionSpec.cpp +++ b/clang/lib/Sema/SemaExceptionSpec.cpp @@ -171,7 +171,7 @@ bool Sema::CheckEquivalentExceptionSpec(FunctionDecl *Old, FunctionDecl *New) { // If a declaration of a function has an implicit // exception-specification, other declarations of the function shall // not specify an exception-specification. - if (getLangOpts().CPlusPlus0x && + if (getLangOpts().CPlusPlus11 && hasImplicitExceptionSpec(Old) != hasImplicitExceptionSpec(New)) { Diag(New->getLocation(), diag::ext_implicit_exception_spec_mismatch) << hasImplicitExceptionSpec(Old); @@ -454,7 +454,7 @@ bool Sema::CheckEquivalentExceptionSpec(const PartialDiagnostic &DiagID, // As a special compatibility feature, under C++0x we accept no spec and // throw(std::bad_alloc) as equivalent for operator new and operator new[]. // This is because the implicit declaration changed, but old code would break. - if (getLangOpts().CPlusPlus0x && IsOperatorNew) { + if (getLangOpts().CPlusPlus11 && IsOperatorNew) { const FunctionProtoType *WithExceptions = 0; if (OldEST == EST_None && NewEST == EST_Dynamic) WithExceptions = New; @@ -785,7 +785,7 @@ bool Sema::CheckExceptionSpecCompatibility(Expr *From, QualType ToType) bool Sema::CheckOverridingFunctionExceptionSpec(const CXXMethodDecl *New, const CXXMethodDecl *Old) { - if (getLangOpts().CPlusPlus0x && isa<CXXDestructorDecl>(New)) { + if (getLangOpts().CPlusPlus11 && isa<CXXDestructorDecl>(New)) { // Don't check uninstantiated template destructors at all. We can only // synthesize correct specs after the template is instantiated. if (New->getParent()->isDependentType()) diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index e573a15d6a0..c666e69b52b 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -639,7 +639,7 @@ Sema::VarArgKind Sema::isValidVarArgType(const QualType &Ty) { // having a non-trivial copy constructor, a non-trivial move constructor, // or a non-trivial destructor, with no corresponding parameter, // is conditionally-supported with implementation-defined semantics. - if (getLangOpts().CPlusPlus0x && !Ty->isDependentType()) + if (getLangOpts().CPlusPlus11 && !Ty->isDependentType()) if (CXXRecordDecl *Record = Ty->getAsCXXRecordDecl()) if (!Record->hasNonTrivialCopyConstructor() && !Record->hasNonTrivialMoveConstructor() && @@ -672,7 +672,7 @@ bool Sema::variadicArgumentPODCheck(const Expr *E, VariadicCallType CT) { return DiagRuntimeBehavior(E->getLocStart(), 0, PDiag(diag::warn_cannot_pass_non_pod_arg_to_vararg) - << getLangOpts().CPlusPlus0x << Ty << CT); + << getLangOpts().CPlusPlus11 << Ty << CT); } } // c++ rules are enforced elsewhere. @@ -2830,7 +2830,7 @@ ExprResult Sema::ActOnNumericConstant(const Token &Tok, Scope *UDLScope) { if (!getLangOpts().C99 && Literal.isLongLong) { if (getLangOpts().CPlusPlus) Diag(Tok.getLocation(), - getLangOpts().CPlusPlus0x ? + getLangOpts().CPlusPlus11 ? diag::warn_cxx98_compat_longlong : diag::ext_cxx11_longlong); else Diag(Tok.getLocation(), diag::ext_c99_longlong); @@ -8316,7 +8316,7 @@ static void DiagnoseSelfAssignment(Sema &S, Expr *LHSExpr, Expr *RHSExpr, ExprResult Sema::CreateBuiltinBinOp(SourceLocation OpLoc, BinaryOperatorKind Opc, Expr *LHSExpr, Expr *RHSExpr) { - if (getLangOpts().CPlusPlus0x && isa<InitListExpr>(RHSExpr)) { + if (getLangOpts().CPlusPlus11 && isa<InitListExpr>(RHSExpr)) { // The syntax only allows initializer lists on the RHS of assignment, // so we don't need to worry about accepting invalid code for // non-assignment operators. @@ -9206,9 +9206,9 @@ ExprResult Sema::BuildBuiltinOffsetOf(SourceLocation BuiltinLoc, // If type is not a standard-layout class (Clause 9), the results are // undefined. if (CXXRecordDecl *CRD = dyn_cast<CXXRecordDecl>(RD)) { - bool IsSafe = LangOpts.CPlusPlus0x? CRD->isStandardLayout() : CRD->isPOD(); + bool IsSafe = LangOpts.CPlusPlus11? CRD->isStandardLayout() : CRD->isPOD(); unsigned DiagID = - LangOpts.CPlusPlus0x? diag::warn_offsetof_non_standardlayout_type + LangOpts.CPlusPlus11? diag::warn_offsetof_non_standardlayout_type : diag::warn_offsetof_non_pod_type; if (!IsSafe && !DidWarnAboutNonPOD && @@ -9976,7 +9976,7 @@ Sema::VerifyIntegerConstantExpression(Expr *E, llvm::APSInt *Result, bool AllowFold) { SourceLocation DiagLoc = E->getLocStart(); - if (getLangOpts().CPlusPlus0x) { + if (getLangOpts().CPlusPlus11) { // C++11 [expr.const]p5: // If an expression of literal class type is used in a context where an // integral constant expression is required, then that class type shall @@ -10103,7 +10103,7 @@ Sema::VerifyIntegerConstantExpression(Expr *E, llvm::APSInt *Result, // Circumvent ICE checking in C++11 to avoid evaluating the expression twice // in the non-ICE case. - if (!getLangOpts().CPlusPlus0x && E->isIntegerConstantExpr(Context)) { + if (!getLangOpts().CPlusPlus11 && E->isIntegerConstantExpr(Context)) { if (Result) *Result = E->EvaluateKnownConstInt(Context); return Owned(E); @@ -10121,7 +10121,7 @@ Sema::VerifyIntegerConstantExpression(Expr *E, llvm::APSInt *Result, // In C++11, we can rely on diagnostics being produced for any expression // which is not a constant expression. If no diagnostics were produced, then // this is a constant expression. - if (Folded && getLangOpts().CPlusPlus0x && Notes.empty()) { + if (Folded && getLangOpts().CPlusPlus11 && Notes.empty()) { if (Result) *Result = EvalResult.Val.getInt(); return Owned(E); diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp index 65d72eca83c..5cd1c21604e 100644 --- a/clang/lib/Sema/SemaExprCXX.cpp +++ b/clang/lib/Sema/SemaExprCXX.cpp @@ -1140,7 +1140,7 @@ Sema::BuildCXXNew(SourceRange Range, bool UseGlobal, virtual DiagnosticBuilder diagnoseNotInt(Sema &S, SourceLocation Loc, QualType T) { return S.Diag(Loc, diag::err_array_size_not_integral) - << S.getLangOpts().CPlusPlus0x << T; + << S.getLangOpts().CPlusPlus11 << T; } virtual DiagnosticBuilder diagnoseIncomplete(Sema &S, SourceLocation Loc, @@ -1178,7 +1178,7 @@ Sema::BuildCXXNew(SourceRange Range, bool UseGlobal, QualType T, QualType ConvTy) { return S.Diag(Loc, - S.getLangOpts().CPlusPlus0x + S.getLangOpts().CPlusPlus11 ? diag::warn_cxx98_compat_array_size_conversion : diag::ext_array_size_conversion) << T << ConvTy->isEnumeralType() << ConvTy; @@ -1214,7 +1214,7 @@ Sema::BuildCXXNew(SourceRange Range, bool UseGlobal, if (Value < llvm::APSInt( llvm::APInt::getNullValue(Value.getBitWidth()), Value.isUnsigned())) { - if (getLangOpts().CPlusPlus0x) + if (getLangOpts().CPlusPlus11) Diag(ArraySize->getLocStart(), diag::warn_typecheck_negative_array_new_size) << ArraySize->getSourceRange(); @@ -1226,7 +1226,7 @@ Sema::BuildCXXNew(SourceRange Range, bool UseGlobal, unsigned ActiveSizeBits = ConstantArrayType::getNumAddressingBits(Context, AllocType, Value); if (ActiveSizeBits > ConstantArrayType::getMaxSizeBits(Context)) { - if (getLangOpts().CPlusPlus0x) + if (getLangOpts().CPlusPlus11) Diag(ArraySize->getLocStart(), diag::warn_array_new_too_large) << Value.toString(10) @@ -1637,7 +1637,7 @@ bool Sema::FindAllocationFunctions(SourceLocation StartLoc, SourceRange Range, // as a placement deallocation function, would have been // selected as a match for the allocation function, the program // is ill-formed. - if (NumPlaceArgs && getLangOpts().CPlusPlus0x && + if (NumPlaceArgs && getLangOpts().CPlusPlus11 && isNonPlacementDeallocationFunction(OperatorDelete)) { Diag(StartLoc, diag::err_placement_new_non_placement_delete) << SourceRange(PlaceArgs[0]->getLocStart(), @@ -1813,7 +1813,7 @@ void Sema::DeclareGlobalNewDelete() { // lookup. // Note that the C++0x versions of operator delete are deallocation functions, // and thus are implicitly noexcept. - if (!StdBadAlloc && !getLangOpts().CPlusPlus0x) { + if (!StdBadAlloc && !getLangOpts().CPlusPlus11) { // The "std::bad_alloc" class has not yet been declared, so build it // implicitly. StdBadAlloc = CXXRecordDecl::Create(Context, TTK_Class, @@ -1876,20 +1876,20 @@ void Sema::DeclareGlobalAllocationFunction(DeclarationName Name, bool HasBadAllocExceptionSpec = (Name.getCXXOverloadedOperator() == OO_New || Name.getCXXOverloadedOperator() == OO_Array_New); - if (HasBadAllocExceptionSpec && !getLangOpts().CPlusPlus0x) { + if (HasBadAllocExceptionSpec && !getLangOpts().CPlusPlus11) { assert(StdBadAlloc && "Must have std::bad_alloc declared"); BadAllocType = Context.getTypeDeclType(getStdBadAlloc()); } FunctionProtoType::ExtProtoInfo EPI; if (HasBadAllocExceptionSpec) { - if (!getLangOpts().CPlusPlus0x) { + if (!getLangOpts().CPlusPlus11) { EPI.ExceptionSpecType = EST_Dynamic; EPI.NumExceptions = 1; EPI.Exceptions = &BadAllocType; } } else { - EPI.ExceptionSpecType = getLangOpts().CPlusPlus0x ? + EPI.ExceptionSpecType = getLangOpts().CPlusPlus11 ? EST_BasicNoexcept : EST_DynamicNone; } @@ -5436,7 +5436,7 @@ ExprResult Sema::IgnoredValueConversions(Expr *E) { // normally, we don't need to do anything to handle it, but if it is a // volatile lvalue with a special form, we perform an lvalue-to-rvalue // conversion. - if (getLangOpts().CPlusPlus0x && E->isGLValue() && + if (getLangOpts().CPlusPlus11 && E->isGLValue() && E->getType().isVolatileQualified() && IsSpecialDiscardedValue(E)) { ExprResult Res = DefaultLvalueConversion(E); diff --git a/clang/lib/Sema/SemaExprMember.cpp b/clang/lib/Sema/SemaExprMember.cpp index 4982ee72325..f1f81040202 100644 --- a/clang/lib/Sema/SemaExprMember.cpp +++ b/clang/lib/Sema/SemaExprMember.cpp @@ -121,7 +121,7 @@ static IMAKind ClassifyImplicitMemberAccess(Sema &SemaRef, return IMA_Static; bool IsCXX11UnevaluatedField = false; - if (SemaRef.getLangOpts().CPlusPlus0x && isField) { + if (SemaRef.getLangOpts().CPlusPlus11 && isField) { // C++11 [expr.prim.general]p12: // An id-expression that denotes a non-static data member or non-static // member function of a class can only be used: diff --git a/clang/lib/Sema/SemaFixItUtils.cpp b/clang/lib/Sema/SemaFixItUtils.cpp index b61b9307dde..2a845ba9898 100644 --- a/clang/lib/Sema/SemaFixItUtils.cpp +++ b/clang/lib/Sema/SemaFixItUtils.cpp @@ -178,7 +178,7 @@ static std::string getScalarZeroExpressionForType(const Type& T, const Sema& S) if (T.isBooleanType() && S.LangOpts.CPlusPlus) return "false"; if (T.isPointerType() || T.isMemberPointerType()) { - if (S.LangOpts.CPlusPlus0x) + if (S.LangOpts.CPlusPlus11) return "nullptr"; if (isMacroDefined(S, "NULL")) return "NULL"; @@ -205,7 +205,7 @@ std::string Sema::getFixItZeroInitializerForType(QualType T) const { const CXXRecordDecl *RD = T->getAsCXXRecordDecl(); if (!RD || !RD->hasDefinition()) return std::string(); - if (LangOpts.CPlusPlus0x && !RD->hasUserProvidedDefaultConstructor()) + if (LangOpts.CPlusPlus11 && !RD->hasUserProvidedDefaultConstructor()) return "{}"; if (RD->isAggregate()) return " = {}"; diff --git a/clang/lib/Sema/SemaInit.cpp b/clang/lib/Sema/SemaInit.cpp index 2dbefdbc3b7..6796f9a5500 100644 --- a/clang/lib/Sema/SemaInit.cpp +++ b/clang/lib/Sema/SemaInit.cpp @@ -901,11 +901,11 @@ void InitListChecker::CheckScalarType(const InitializedEntity &Entity, if (Index >= IList->getNumInits()) { if (!VerifyOnly) SemaRef.Diag(IList->getLocStart(), - SemaRef.getLangOpts().CPlusPlus0x ? + SemaRef.getLangOpts().CPlusPlus11 ? diag::warn_cxx98_compat_empty_scalar_initializer : diag::err_empty_scalar_initializer) << IList->getSourceRange(); - hadError = !SemaRef.getLangOpts().CPlusPlus0x; + hadError = !SemaRef.getLangOpts().CPlusPlus11; ++Index; ++StructuredIndex; return; @@ -985,7 +985,7 @@ void InitListChecker::CheckReferenceType(const InitializedEntity &Entity, } Expr *expr = IList->getInit(Index); - if (isa<InitListExpr>(expr) && !SemaRef.getLangOpts().CPlusPlus0x) { + if (isa<InitListExpr>(expr) && !SemaRef.getLangOpts().CPlusPlus11) { if (!VerifyOnly) SemaRef.Diag(IList->getLocStart(), diag::err_init_non_aggr_init_list) << DeclType << IList->getSourceRange(); @@ -2984,7 +2984,7 @@ static void TryReferenceListInitialization(Sema &S, InitializationSequence &Sequence) { // First, catch C++03 where this isn't possible. - if (!S.getLangOpts().CPlusPlus0x) { + if (!S.getLangOpts().CPlusPlus11) { Sequence.SetFailed(InitializationSequence::FK_ReferenceBindingToInitList); return; } @@ -3068,7 +3068,7 @@ static void TryListInitialization(Sema &S, // C++11 [dcl.init.list]p3: // - If T is an aggregate, aggregate initialization is performed. if (!DestType->isAggregateType()) { - if (S.getLangOpts().CPlusPlus0x) { + if (S.getLangOpts().CPlusPlus11) { // - Otherwise, if the initializer list has no elements and T is a // class type with a default constructor, the object is // value-initialized. @@ -3099,7 +3099,7 @@ static void TryListInitialization(Sema &S, InitListChecker CheckInitList(S, Entity, InitList, DestType, /*VerifyOnly=*/true, Kind.getKind() != InitializationKind::IK_DirectList || - !S.getLangOpts().CPlusPlus0x); + !S.getLangOpts().CPlusPlus11); if (CheckInitList.HadError()) { Sequence.SetFailed(InitializationSequence::FK_ListInitializationFailed); return; @@ -3461,9 +3461,9 @@ static void TryReferenceInitializationCore(Sema &S, // // The constructor that would be used to make the copy shall // be callable whether or not the copy is actually done. - if (!S.getLangOpts().CPlusPlus0x && !S.getLangOpts().MicrosoftExt) + if (!S.getLangOpts().CPlusPlus11 && !S.getLangOpts().MicrosoftExt) Sequence.AddExtraneousCopyToTemporary(cv2T2); - else if (S.getLangOpts().CPlusPlus0x) + else if (S.getLangOpts().CPlusPlus11) CheckCXX98CompatAccessibleCopy(S, Entity, Initializer); } @@ -3594,7 +3594,7 @@ static void TryValueInitialization(Sema &S, if (const RecordType *RT = T->getAs<RecordType>()) { if (CXXRecordDecl *ClassDecl = dyn_cast<CXXRecordDecl>(RT->getDecl())) { bool NeedZeroInitialization = true; - if (!S.getLangOpts().CPlusPlus0x) { + if (!S.getLangOpts().CPlusPlus11) { // C++98: // -- if T is a class type (clause 9) with a user-declared constructor // (12.1), then the default constructor for T is called (and the @@ -3631,7 +3631,7 @@ static void TryValueInitialization(Sema &S, // C++11 doesn't need this handling, because value-initialization does not // occur recursively there, and the implicit default constructor is // defined as deleted in the problematic cases. - if (!S.getLangOpts().CPlusPlus0x && + if (!S.getLangOpts().CPlusPlus11 && ClassDecl->hasUninitializedReferenceMember()) { Sequence.SetFailed(InitializationSequence::FK_TooManyInitsForReference); return; @@ -4580,7 +4580,7 @@ static ExprResult CopyObject(Sema &S, static void CheckCXX98CompatAccessibleCopy(Sema &S, const InitializedEntity &Entity, Expr *CurInitExpr) { - assert(S.getLangOpts().CPlusPlus0x); + assert(S.getLangOpts().CPlusPlus11); const RecordType *Record = CurInitExpr->getType()->getAs<RecordType>(); if (!Record) @@ -4875,7 +4875,7 @@ InitializationSequence::Perform(Sema &S, if (Steps.empty()) return S.Owned((Expr *)0); - if (S.getLangOpts().CPlusPlus0x && Entity.getType()->isReferenceType() && + if (S.getLangOpts().CPlusPlus11 && Entity.getType()->isReferenceType() && Args.size() == 1 && isa<InitListExpr>(Args[0]) && Entity.getKind() != InitializedEntity::EK_Parameter) { // Produce a C++98 compatibility warning if we are initializing a reference @@ -5205,7 +5205,7 @@ InitializationSequence::Perform(Sema &S, InitListChecker PerformInitList(S, IsTemporary ? TempEntity : Entity, InitList, Ty, /*VerifyOnly=*/false, Kind.getKind() != InitializationKind::IK_DirectList || - !S.getLangOpts().CPlusPlus0x); + !S.getLangOpts().CPlusPlus11); if (PerformInitList.HadError()) return ExprError(); @@ -5833,7 +5833,7 @@ bool InitializationSequence::Diagnose(Sema &S, InitListChecker DiagnoseInitList(S, Entity, InitList, DestType, /*VerifyOnly=*/false, Kind.getKind() != InitializationKind::IK_DirectList || - !S.getLangOpts().CPlusPlus0x); + !S.getLangOpts().CPlusPlus11); assert(DiagnoseInitList.HadError() && "Inconsistent init list check result."); break; @@ -6191,7 +6191,7 @@ static void DiagnoseNarrowingInInitList(Sema &S, InitializationSequence &Seq, // narrowing conversion even if the value is a constant and can be // represented exactly as an integer. S.Diag(PostInit->getLocStart(), - S.getLangOpts().MicrosoftExt || !S.getLangOpts().CPlusPlus0x? + S.getLangOpts().MicrosoftExt || !S.getLangOpts().CPlusPlus11? diag::warn_init_list_type_narrowing : S.isSFINAEContext()? diag::err_init_list_type_narrowing_sfinae @@ -6204,7 +6204,7 @@ static void DiagnoseNarrowingInInitList(Sema &S, InitializationSequence &Seq, case NK_Constant_Narrowing: // A constant value was narrowed. S.Diag(PostInit->getLocStart(), - S.getLangOpts().MicrosoftExt || !S.getLangOpts().CPlusPlus0x? + S.getLangOpts().MicrosoftExt || !S.getLangOpts().CPlusPlus11? diag::warn_init_list_constant_narrowing : S.isSFINAEContext()? diag::err_init_list_constant_narrowing_sfinae @@ -6217,7 +6217,7 @@ static void DiagnoseNarrowingInInitList(Sema &S, InitializationSequence &Seq, case NK_Variable_Narrowing: // A variable's value may have been narrowed. S.Diag(PostInit->getLocStart(), - S.getLangOpts().MicrosoftExt || !S.getLangOpts().CPlusPlus0x? + S.getLangOpts().MicrosoftExt || !S.getLangOpts().CPlusPlus11? diag::warn_init_list_variable_narrowing : S.isSFINAEContext()? diag::err_init_list_variable_narrowing_sfinae diff --git a/clang/lib/Sema/SemaLookup.cpp b/clang/lib/Sema/SemaLookup.cpp index b17e0062f91..be021d7d183 100644 --- a/clang/lib/Sema/SemaLookup.cpp +++ b/clang/lib/Sema/SemaLookup.cpp @@ -553,7 +553,7 @@ void Sema::ForceDeclarationOfImplicitMembers(CXXRecordDecl *Class) { if (Class->needsImplicitCopyAssignment()) DeclareImplicitCopyAssignment(Class); - if (getLangOpts().CPlusPlus0x) { + if (getLangOpts().CPlusPlus11) { // If the move constructor has not yet been declared, do so now. if (Class->needsImplicitMoveConstructor()) DeclareImplicitMoveConstructor(Class); // might not actually do it @@ -603,7 +603,7 @@ static void DeclareImplicitMemberFunctionsWithName(Sema &S, S.DeclareImplicitDefaultConstructor(Class); if (Record->needsImplicitCopyConstructor()) S.DeclareImplicitCopyConstructor(Class); - if (S.getLangOpts().CPlusPlus0x && + if (S.getLangOpts().CPlusPlus11 && Record->needsImplicitMoveConstructor()) S.DeclareImplicitMoveConstructor(Class); } @@ -625,7 +625,7 @@ static void DeclareImplicitMemberFunctionsWithName(Sema &S, CXXRecordDecl *Class = const_cast<CXXRecordDecl *>(Record); if (Record->needsImplicitCopyAssignment()) S.DeclareImplicitCopyAssignment(Class); - if (S.getLangOpts().CPlusPlus0x && + if (S.getLangOpts().CPlusPlus11 && Record->needsImplicitMoveAssignment()) S.DeclareImplicitMoveAssignment(Class); } @@ -2289,13 +2289,13 @@ Sema::SpecialMemberOverloadResult *Sema::LookupSpecialMember(CXXRecordDecl *RD, Name = Context.DeclarationNames.getCXXConstructorName(CanTy); if (RD->needsImplicitCopyConstructor()) DeclareImplicitCopyConstructor(RD); - if (getLangOpts().CPlusPlus0x && RD->needsImplicitMoveConstructor()) + if (getLangOpts().CPlusPlus11 && RD->needsImplicitMoveConstructor()) DeclareImplicitMoveConstructor(RD); } else { Name = Context.DeclarationNames.getCXXOperatorName(OO_Equal); if (RD->needsImplicitCopyAssignment()) DeclareImplicitCopyAssignment(RD); - if (getLangOpts().CPlusPlus0x && RD->needsImplicitMoveAssignment()) + if (getLangOpts().CPlusPlus11 && RD->needsImplicitMoveAssignment()) DeclareImplicitMoveAssignment(RD); } @@ -2448,7 +2448,7 @@ DeclContext::lookup_result Sema::LookupConstructors(CXXRecordDecl *Class) { DeclareImplicitDefaultConstructor(Class); if (Class->needsImplicitCopyConstructor()) DeclareImplicitCopyConstructor(Class); - if (getLangOpts().CPlusPlus0x && Class->needsImplicitMoveConstructor()) + if (getLangOpts().CPlusPlus11 && Class->needsImplicitMoveConstructor()) DeclareImplicitMoveConstructor(Class); } @@ -3555,7 +3555,7 @@ static void AddKeywordsToConsumer(Sema &SemaRef, Consumer.addKeywordResult("typename"); Consumer.addKeywordResult("wchar_t"); - if (SemaRef.getLangOpts().CPlusPlus0x) { + if (SemaRef.getLangOpts().CPlusPlus11) { Consumer.addKeywordResult("char16_t"); Consumer.addKeywordResult("char32_t"); Consumer.addKeywordResult("constexpr"); @@ -3594,7 +3594,7 @@ static void AddKeywordsToConsumer(Sema &SemaRef, cast<CXXMethodDecl>(SemaRef.CurContext)->isInstance()) Consumer.addKeywordResult("this"); - if (SemaRef.getLangOpts().CPlusPlus0x) { + if (SemaRef.getLangOpts().CPlusPlus11) { Consumer.addKeywordResult("alignof"); Consumer.addKeywordResult("nullptr"); } @@ -3651,7 +3651,7 @@ static void AddKeywordsToConsumer(Sema &SemaRef, if (SemaRef.getLangOpts().CPlusPlus) { Consumer.addKeywordResult("using"); - if (SemaRef.getLangOpts().CPlusPlus0x) + if (SemaRef.getLangOpts().CPlusPlus11) Consumer.addKeywordResult("static_assert"); } } diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp index 02584525c97..bb38222a654 100644 --- a/clang/lib/Sema/SemaOverload.cpp +++ b/clang/lib/Sema/SemaOverload.cpp @@ -3208,7 +3208,7 @@ static ImplicitConversionSequence::CompareKind compareConversionFunctions(Sema &S, FunctionDecl *Function1, FunctionDecl *Function2) { - if (!S.getLangOpts().ObjC1 || !S.getLangOpts().CPlusPlus0x) + if (!S.getLangOpts().ObjC1 || !S.getLangOpts().CPlusPlus11) return ImplicitConversionSequence::Indistinguishable; // Objective-C++: @@ -4224,7 +4224,7 @@ TryReferenceInit(Sema &S, Expr *Init, QualType DeclType, // allow the use of rvalue references in C++98/03 for the benefit of // standard library implementors; therefore, we need the xvalue check here. ICS.Standard.DirectBinding = - S.getLangOpts().CPlusPlus0x || + S.getLangOpts().CPlusPlus11 || (InitCategory.isPRValue() && !T2->isRecordType()); ICS.Standard.IsLvalueReference = !isRValRef; ICS.Standard.BindsToFunctionLvalue = T2->isFunctionType(); @@ -4868,7 +4868,7 @@ static bool CheckConvertedConstantConversions(Sema &S, ExprResult Sema::CheckConvertedConstantExpression(Expr *From, QualType T, llvm::APSInt &Value, CCEKind CCE) { - assert(LangOpts.CPlusPlus0x && "converted constant expression outside C++11"); + assert(LangOpts.CPlusPlus11 && "converted constant expression outside C++11"); assert(T->isIntegralOrEnumerationType() && "unexpected converted const type"); if (checkPlaceholderForOverload(*this, From)) @@ -7462,7 +7462,7 @@ public: S.AddBuiltinCandidate(*MemPtr, ParamTypes, Args, 2, CandidateSet); } - if (S.getLangOpts().CPlusPlus0x) { + if (S.getLangOpts().CPlusPlus11) { for (BuiltinCandidateTypeSet::iterator Enum = CandidateTypes[ArgIdx].enumeration_begin(), EnumEnd = CandidateTypes[ArgIdx].enumeration_end(); diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp index 7a2519a9edd..08f78d06ca1 100644 --- a/clang/lib/Sema/SemaStmt.cpp +++ b/clang/lib/Sema/SemaStmt.cpp @@ -314,7 +314,7 @@ Sema::ActOnCaseStmt(SourceLocation CaseLoc, Expr *LHSVal, return StmtError(); } - if (!getLangOpts().CPlusPlus0x) { + if (!getLangOpts().CPlusPlus11) { // C99 6.8.4.2p3: The expression shall be an integer constant. // However, GCC allows any evaluatable integer expression. if (!LHSVal->isTypeDependent() && !LHSVal->isValueDependent()) { @@ -712,7 +712,7 @@ Sema::ActOnFinishSwitchStmt(SourceLocation SwitchLoc, Stmt *Switch, llvm::APSInt LoVal; - if (getLangOpts().CPlusPlus0x) { + if (getLangOpts().CPlusPlus11) { // C++11 [stmt.switch]p2: the constant-expression shall be a converted // constant expression of the promoted type of the switch condition. ExprResult ConvLo = @@ -832,7 +832,7 @@ Sema::ActOnFinishSwitchStmt(SourceLocation SwitchLoc, Stmt *Switch, Expr *Hi = CR->getRHS(); llvm::APSInt HiVal; - if (getLangOpts().CPlusPlus0x) { + if (getLangOpts().CPlusPlus11) { // C++11 [stmt.switch]p2: the constant-expression shall be a converted // constant expression of the promoted type of the switch condition. ExprResult ConvHi = diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp index b5b998f9012..87d3dc5eb86 100644 --- a/clang/lib/Sema/SemaTemplate.cpp +++ b/clang/lib/Sema/SemaTemplate.cpp @@ -356,7 +356,7 @@ void Sema::LookupTemplateName(LookupResult &Found, } if (S && !ObjectType.isNull() && !ObjectTypeSearchedInScope && - !(getLangOpts().CPlusPlus0x && !Found.empty())) { + !(getLangOpts().CPlusPlus11 && !Found.empty())) { // C++03 [basic.lookup.classref]p1: // [...] If the lookup in the class of the object expression finds a // template, the name is also looked up in the context of the entire @@ -1171,7 +1171,7 @@ static bool DiagnoseDefaultTemplateArgument(Sema &S, // template-argument, that declaration shall be a definition and shall be // the only declaration of the function template in the translation unit. // (C++98/03 doesn't have this wording; see DR226). - S.Diag(ParamLoc, S.getLangOpts().CPlusPlus0x ? + S.Diag(ParamLoc, S.getLangOpts().CPlusPlus11 ? diag::warn_cxx98_compat_template_parameter_default_in_function_template : diag::ext_template_parameter_default_in_function_template) << DefArgRange; @@ -2359,7 +2359,7 @@ TemplateNameKind Sema::ActOnDependentTemplateName(Scope *S, TemplateTy &Result) { if (TemplateKWLoc.isValid() && S && !S->getTemplateParamParent()) Diag(TemplateKWLoc, - getLangOpts().CPlusPlus0x ? + getLangOpts().CPlusPlus11 ? diag::warn_cxx98_compat_template_outside_of_template : diag::ext_template_outside_of_template) << FixItHint::CreateRemoval(TemplateKWLoc); @@ -2972,7 +2972,7 @@ bool Sema::CheckTemplateArgument(NamedDecl *Param, // We have a template template parameter but the template // argument does not refer to a template. Diag(Arg.getLocation(), diag::err_template_arg_must_be_template) - << getLangOpts().CPlusPlus0x; + << getLangOpts().CPlusPlus11; return true; case TemplateArgument::Declaration: @@ -3486,7 +3486,7 @@ bool UnnamedLocalNoLinkageFinder::VisitAtomicType(const AtomicType* T) { bool UnnamedLocalNoLinkageFinder::VisitTagDecl(const TagDecl *Tag) { if (Tag->getDeclContext()->isFunctionOrMethod()) { S.Diag(SR.getBegin(), - S.getLangOpts().CPlusPlus0x ? + S.getLangOpts().CPlusPlus11 ? diag::warn_cxx98_compat_template_arg_local_type : diag::ext_template_arg_local_type) << S.Context.getTypeDeclType(Tag) << SR; @@ -3495,7 +3495,7 @@ bool UnnamedLocalNoLinkageFinder::VisitTagDecl(const TagDecl *Tag) { if (!Tag->getDeclName() && !Tag->getTypedefNameForAnonDecl()) { S.Diag(SR.getBegin(), - S.getLangOpts().CPlusPlus0x ? + S.getLangOpts().CPlusPlus11 ? diag::warn_cxx98_compat_template_arg_unnamed_type : diag::ext_template_arg_unnamed_type) << SR; S.Diag(Tag->getLocation(), diag::note_template_unnamed_type_here); @@ -3549,7 +3549,7 @@ bool Sema::CheckTemplateArgument(TemplateTypeParmDecl *Param, // // C++11 allows these, and even in C++03 we allow them as an extension with // a warning. - if (LangOpts.CPlusPlus0x ? + if (LangOpts.CPlusPlus11 ? Diags.getDiagnosticLevel(diag::warn_cxx98_compat_template_arg_unnamed_type, SR.getBegin()) != DiagnosticsEngine::Ignored || Diags.getDiagnosticLevel(diag::warn_cxx98_compat_template_arg_local_type, @@ -3576,7 +3576,7 @@ isNullPointerValueTemplateArgument(Sema &S, NonTypeTemplateParmDecl *Param, if (Arg->isValueDependent() || Arg->isTypeDependent()) return NPV_NotNullPointer; - if (!S.getLangOpts().CPlusPlus0x) + if (!S.getLangOpts().CPlusPlus11) return NPV_NotNullPointer; // Determine whether we have a constant expression. @@ -3704,7 +3704,7 @@ CheckTemplateArgumentAddressOfObjectOrFunction(Sema &S, while (ParenExpr *Parens = dyn_cast<ParenExpr>(Arg)) { if (!Invalid && !ExtraParens) { S.Diag(Arg->getLocStart(), - S.getLangOpts().CPlusPlus0x ? + S.getLangOpts().CPlusPlus11 ? diag::warn_cxx98_compat_template_arg_extra_parens : diag::ext_template_arg_extra_parens) << Arg->getSourceRange(); @@ -3794,7 +3794,7 @@ CheckTemplateArgumentAddressOfObjectOrFunction(Sema &S, // Address / reference template args must have external linkage in C++98. if (Entity->getLinkage() == InternalLinkage) { - S.Diag(Arg->getLocStart(), S.getLangOpts().CPlusPlus0x ? + S.Diag(Arg->getLocStart(), S.getLangOpts().CPlusPlus11 ? diag::warn_cxx98_compat_template_arg_object_internal : diag::ext_template_arg_object_internal) << !Func << Entity << Arg->getSourceRange(); @@ -4010,7 +4010,7 @@ static bool CheckTemplateArgumentPointerToMember(Sema &S, while (ParenExpr *Parens = dyn_cast<ParenExpr>(Arg)) { if (!Invalid && !ExtraParens) { S.Diag(Arg->getLocStart(), - S.getLangOpts().CPlusPlus0x ? + S.getLangOpts().CPlusPlus11 ? diag::warn_cxx98_compat_template_arg_extra_parens : diag::ext_template_arg_extra_parens) << Arg->getSourceRange(); @@ -4139,7 +4139,7 @@ ExprResult Sema::CheckTemplateArgument(NonTypeTemplateParmDecl *Param, return ExprError(); } - if (getLangOpts().CPlusPlus0x) { + if (getLangOpts().CPlusPlus11) { // We can't check arbitrary value-dependent arguments. // FIXME: If there's no viable conversion to the template parameter type, // we should be able to diagnose that prior to instantiation. @@ -4960,11 +4960,11 @@ static bool CheckTemplateSpecializationScope(Sema &S, EntityKind = 4; else if (isa<RecordDecl>(Specialized)) EntityKind = 5; - else if (isa<EnumDecl>(Specialized) && S.getLangOpts().CPlusPlus0x) + else if (isa<EnumDecl>(Specialized) && S.getLangOpts().CPlusPlus11) EntityKind = 6; else { S.Diag(Loc, diag::err_template_spec_unknown_kind) - << S.getLangOpts().CPlusPlus0x; + << S.getLangOpts().CPlusPlus11; S.Diag(Specialized->getLocation(), diag::note_specialized_entity); return true; } @@ -5035,17 +5035,17 @@ static bool CheckTemplateSpecializationScope(Sema &S, // An explicit specialization shall be declared in a namespace enclosing // the specialized template. if (!DC->InEnclosingNamespaceSetOf(SpecializedContext)) { - bool IsCPlusPlus0xExtension = DC->Encloses(SpecializedContext); + bool IsCPlusPlus11Extension = DC->Encloses(SpecializedContext); if (isa<TranslationUnitDecl>(SpecializedContext)) { - assert(!IsCPlusPlus0xExtension && + assert(!IsCPlusPlus11Extension && "DC encloses TU but isn't in enclosing namespace set"); S.Diag(Loc, diag::err_template_spec_decl_out_of_scope_global) << EntityKind << Specialized; } else if (isa<NamespaceDecl>(SpecializedContext)) { int Diag; - if (!IsCPlusPlus0xExtension) + if (!IsCPlusPlus11Extension) Diag = diag::err_template_spec_decl_out_of_scope; - else if (!S.getLangOpts().CPlusPlus0x) + else if (!S.getLangOpts().CPlusPlus11) Diag = diag::ext_template_spec_decl_out_of_scope; else Diag = diag::warn_cxx98_compat_template_spec_decl_out_of_scope; @@ -5055,7 +5055,7 @@ static bool CheckTemplateSpecializationScope(Sema &S, S.Diag(Specialized->getLocation(), diag::note_specialized_entity); ComplainedAboutScope = - !(IsCPlusPlus0xExtension && S.getLangOpts().CPlusPlus0x); + !(IsCPlusPlus11Extension && S.getLangOpts().CPlusPlus11); } } @@ -5796,7 +5796,7 @@ Sema::CheckSpecializationInstantiationRedecl(SourceLocation NewLoc, // In C++98/03 mode, we only give an extension warning here, because it // is not harmful to try to explicitly instantiate something that // has been explicitly specialized. - Diag(NewLoc, getLangOpts().CPlusPlus0x ? + Diag(NewLoc, getLangOpts().CPlusPlus11 ? diag::warn_cxx98_compat_explicit_instantiation_after_specialization : diag::ext_explicit_instantiation_after_specialization) << PrevDecl; @@ -6250,19 +6250,19 @@ static bool CheckExplicitInstantiationScope(Sema &S, NamedDecl *D, if (NamespaceDecl *NS = dyn_cast<NamespaceDecl>(OrigContext)) { if (WasQualifiedName) S.Diag(InstLoc, - S.getLangOpts().CPlusPlus0x? + S.getLangOpts().CPlusPlus11? diag::err_explicit_instantiation_out_of_scope : diag::warn_explicit_instantiation_out_of_scope_0x) << D << NS; else S.Diag(InstLoc, - S.getLangOpts().CPlusPlus0x? + S.getLangOpts().CPlusPlus11? diag::err_explicit_instantiation_unqualified_wrong_namespace : diag::warn_explicit_instantiation_unqualified_wrong_namespace_0x) << D << NS; } else S.Diag(InstLoc, - S.getLangOpts().CPlusPlus0x? + S.getLangOpts().CPlusPlus11? diag::err_explicit_instantiation_must_be_global : diag::warn_explicit_instantiation_must_be_global_0x) << D; @@ -6656,7 +6656,7 @@ DeclResult Sema::ActOnExplicitInstantiation(Scope *S, // well. if (D.getDeclSpec().isInlineSpecified()) Diag(D.getDeclSpec().getInlineSpecLoc(), - getLangOpts().CPlusPlus0x ? + getLangOpts().CPlusPlus11 ? diag::err_explicit_instantiation_inline : diag::warn_explicit_instantiation_inline_0x) << FixItHint::CreateRemoval(D.getDeclSpec().getInlineSpecLoc()); @@ -6913,7 +6913,7 @@ Sema::ActOnTypenameType(Scope *S, SourceLocation TypenameLoc, if (TypenameLoc.isValid() && S && !S->getTemplateParamParent()) Diag(TypenameLoc, - getLangOpts().CPlusPlus0x ? + getLangOpts().CPlusPlus11 ? diag::warn_cxx98_compat_typename_outside_of_template : diag::ext_typename_outside_of_template) << FixItHint::CreateRemoval(TypenameLoc); @@ -6952,7 +6952,7 @@ Sema::ActOnTypenameType(Scope *S, SourceLocation RAngleLoc) { if (TypenameLoc.isValid() && S && !S->getTemplateParamParent()) Diag(TypenameLoc, - getLangOpts().CPlusPlus0x ? + getLangOpts().CPlusPlus11 ? diag::warn_cxx98_compat_typename_outside_of_template : diag::ext_typename_outside_of_template) << FixItHint::CreateRemoval(TypenameLoc); diff --git a/clang/lib/Sema/SemaTemplateDeduction.cpp b/clang/lib/Sema/SemaTemplateDeduction.cpp index 7c5a59671d7..67ea68928da 100644 --- a/clang/lib/Sema/SemaTemplateDeduction.cpp +++ b/clang/lib/Sema/SemaTemplateDeduction.cpp @@ -2391,7 +2391,7 @@ Sema::SubstituteExplicitTemplateArguments( } CXXThisScopeRAII ThisScope(*this, ThisContext, ThisTypeQuals, - getLangOpts().CPlusPlus0x); + getLangOpts().CPlusPlus11); ResultType = SubstType(Proto->getResultType(), MultiLevelTemplateArgumentList(*ExplicitArgumentList), @@ -3758,15 +3758,15 @@ static bool isAtLeastAsSpecializedAs(Sema &S, // first argument of the free function, which seems to match // existing practice. SmallVector<QualType, 4> Args1; - unsigned Skip1 = !S.getLangOpts().CPlusPlus0x && IsNonStatic2 && !Method1; - if (S.getLangOpts().CPlusPlus0x && IsNonStatic1 && !Method2) + unsigned Skip1 = !S.getLangOpts().CPlusPlus11 && IsNonStatic2 && !Method1; + if (S.getLangOpts().CPlusPlus11 && IsNonStatic1 && !Method2) AddImplicitObjectParameterType(S.Context, Method1, Args1); Args1.insert(Args1.end(), Proto1->arg_type_begin() + Skip1, Proto1->arg_type_end()); SmallVector<QualType, 4> Args2; - Skip2 = !S.getLangOpts().CPlusPlus0x && IsNonStatic1 && !Method2; - if (S.getLangOpts().CPlusPlus0x && IsNonStatic2 && !Method1) + Skip2 = !S.getLangOpts().CPlusPlus11 && IsNonStatic1 && !Method2; + if (S.getLangOpts().CPlusPlus11 && IsNonStatic2 && !Method1) AddImplicitObjectParameterType(S.Context, Method2, Args2); Args2.insert(Args2.end(), Proto2->arg_type_begin() + Skip2, Proto2->arg_type_end()); @@ -3835,7 +3835,7 @@ static bool isAtLeastAsSpecializedAs(Sema &S, unsigned NumParams = std::min(NumCallArguments, std::min(Proto1->getNumArgs(), Proto2->getNumArgs())); - if (S.getLangOpts().CPlusPlus0x && IsNonStatic2 && !IsNonStatic1) + if (S.getLangOpts().CPlusPlus11 && IsNonStatic2 && !IsNonStatic1) ::MarkUsedTemplateParameters(S.Context, Method2->getThisType(S.Context), false, TemplateParams->getDepth(), UsedParameters); diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp index abe047194d6..2c00be66f3f 100644 --- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -1287,7 +1287,7 @@ Decl *TemplateDeclInstantiator::VisitFunctionDecl(FunctionDecl *D, // // If -Wc++98-compat is enabled, we go through the motions of checking for a // redefinition, but don't instantiate the function. - if ((!SemaRef.getLangOpts().CPlusPlus0x || + if ((!SemaRef.getLangOpts().CPlusPlus11 || SemaRef.Diags.getDiagnosticLevel( diag::warn_cxx98_compat_friend_redefinition, Function->getLocation()) @@ -1298,11 +1298,11 @@ Decl *TemplateDeclInstantiator::VisitFunctionDecl(FunctionDecl *D, if (Function->isDefined(Definition) && Definition->getTemplateSpecializationKind() == TSK_Undeclared) { SemaRef.Diag(Function->getLocation(), - SemaRef.getLangOpts().CPlusPlus0x ? + SemaRef.getLangOpts().CPlusPlus11 ? diag::warn_cxx98_compat_friend_redefinition : diag::err_redefinition) << Function->getDeclName(); SemaRef.Diag(Definition->getLocation(), diag::note_previous_definition); - if (!SemaRef.getLangOpts().CPlusPlus0x) + if (!SemaRef.getLangOpts().CPlusPlus11) Function->setInvalidDecl(); } // Check for redefinitions due to other instantiations of this or @@ -1314,7 +1314,7 @@ Decl *TemplateDeclInstantiator::VisitFunctionDecl(FunctionDecl *D, continue; switch (R->getFriendObjectKind()) { case Decl::FOK_None: - if (!SemaRef.getLangOpts().CPlusPlus0x && + if (!SemaRef.getLangOpts().CPlusPlus11 && !queuedInstantiation && R->isUsed(false)) { if (MemberSpecializationInfo *MSInfo = Function->getMemberSpecializationInfo()) { @@ -1333,12 +1333,12 @@ Decl *TemplateDeclInstantiator::VisitFunctionDecl(FunctionDecl *D, = R->getTemplateInstantiationPattern()) if (RPattern->isDefined(RPattern)) { SemaRef.Diag(Function->getLocation(), - SemaRef.getLangOpts().CPlusPlus0x ? + SemaRef.getLangOpts().CPlusPlus11 ? diag::warn_cxx98_compat_friend_redefinition : diag::err_redefinition) << Function->getDeclName(); SemaRef.Diag(R->getLocation(), diag::note_previous_definition); - if (!SemaRef.getLangOpts().CPlusPlus0x) + if (!SemaRef.getLangOpts().CPlusPlus11) Function->setInvalidDecl(); break; } @@ -2427,7 +2427,7 @@ static void InstantiateExceptionSpec(Sema &SemaRef, FunctionDecl *New, ThisTypeQuals = Method->getTypeQualifiers(); } Sema::CXXThisScopeRAII ThisScope(SemaRef, ThisContext, ThisTypeQuals, - SemaRef.getLangOpts().CPlusPlus0x); + SemaRef.getLangOpts().CPlusPlus11); // The function has an exception specification or a "noreturn" // attribute. Substitute into each of the exception types. @@ -2615,7 +2615,7 @@ TemplateDeclInstantiator::InitFunctionInstantiation(FunctionDecl *New, // DR1330: In C++11, defer instantiation of a non-trivial // exception specification. - if (SemaRef.getLangOpts().CPlusPlus0x && + if (SemaRef.getLangOpts().CPlusPlus11 && EPI.ExceptionSpecType != EST_None && EPI.ExceptionSpecType != EST_DynamicNone && EPI.ExceptionSpecType != EST_BasicNoexcept) { diff --git a/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp index bbd8a7e9356..1bdd7c3b398 100644 --- a/clang/lib/Sema/SemaType.cpp +++ b/clang/lib/Sema/SemaType.cpp @@ -713,7 +713,7 @@ static QualType ConvertDeclSpecToType(TypeProcessingState &state) { if (!S.getLangOpts().C99) { if (S.getLangOpts().CPlusPlus) S.Diag(DS.getTypeSpecWidthLoc(), - S.getLangOpts().CPlusPlus0x ? + S.getLangOpts().CPlusPlus11 ? diag::warn_cxx98_compat_longlong : diag::ext_cxx11_longlong); else S.Diag(DS.getTypeSpecWidthLoc(), diag::ext_c99_longlong); @@ -732,7 +732,7 @@ static QualType ConvertDeclSpecToType(TypeProcessingState &state) { if (!S.getLangOpts().C99) { if (S.getLangOpts().CPlusPlus) S.Diag(DS.getTypeSpecWidthLoc(), - S.getLangOpts().CPlusPlus0x ? + S.getLangOpts().CPlusPlus11 ? diag::warn_cxx98_compat_longlong : diag::ext_cxx11_longlong); else S.Diag(DS.getTypeSpecWidthLoc(), diag::ext_c99_longlong); @@ -1365,7 +1365,7 @@ QualType Sema::BuildArrayType(QualType T, ArrayType::ArraySizeModifier ASM, // C99 6.7.5.2p1: The size expression shall have integer type. // C++11 allows contextual conversions to such types. - if (!getLangOpts().CPlusPlus0x && + if (!getLangOpts().CPlusPlus11 && ArraySize && !ArraySize->isTypeDependent() && !ArraySize->getType()->isIntegralOrUnscopedEnumerationType()) { Diag(ArraySize->getLocStart(), diag::err_array_size_non_int) @@ -1386,7 +1386,7 @@ QualType Sema::BuildArrayType(QualType T, ArrayType::ArraySizeModifier ASM, isArraySizeVLA(*this, ArraySize, ConstVal)) { // Even in C++11, don't allow contextual conversions in the array bound // of a VLA. - if (getLangOpts().CPlusPlus0x && + if (getLangOpts().CPlusPlus11 && !ArraySize->getType()->isIntegralOrUnscopedEnumerationType()) { Diag(ArraySize->getLocStart(), diag::err_array_size_non_int) << ArraySize->getType() << ArraySize->getSourceRange(); @@ -1878,7 +1878,7 @@ static QualType GetDeclSpecTypeForDeclarator(TypeProcessingState &state, // type (this is checked later) and we can skip this. In other languages // using auto, we need to check regardless. if (D.getDeclSpec().getTypeSpecType() == DeclSpec::TST_auto && - (!SemaRef.getLangOpts().CPlusPlus0x || !D.isFunctionDeclarator())) { + (!SemaRef.getLangOpts().CPlusPlus11 || !D.isFunctionDeclarator())) { int Error = -1; switch (D.getContext()) { @@ -1944,7 +1944,7 @@ static QualType GetDeclSpecTypeForDeclarator(TypeProcessingState &state, // contains a trailing return type. That is only legal at the outermost // level. Check all declarator chunks (outermost first) anyway, to give // better diagnostics. - if (SemaRef.getLangOpts().CPlusPlus0x && Error != -1) { + if (SemaRef.getLangOpts().CPlusPlus11 && Error != -1) { for (unsigned i = 0, e = D.getNumTypeObjects(); i != e; ++i) { unsigned chunkIndex = e - i - 1; state.setCurrentChunkIndex(chunkIndex); @@ -2177,7 +2177,7 @@ static void warnAboutAmbiguousFunction(Sema &S, Declarator &D, << FixItHint::CreateRemoval(ParenRange); else { std::string Init = S.getFixItZeroInitializerForType(RT); - if (Init.empty() && S.LangOpts.CPlusPlus0x) + if (Init.empty() && S.LangOpts.CPlusPlus11) Init = "{}"; if (!Init.empty()) S.Diag(DeclType.Loc, diag::note_empty_parens_zero_initialize) @@ -2826,7 +2826,7 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state, T = Context.getPackExpansionType(T, llvm::Optional<unsigned>()); else S.Diag(D.getEllipsisLoc(), - LangOpts.CPlusPlus0x + LangOpts.CPlusPlus11 ? diag::warn_cxx98_compat_variadic_templates : diag::ext_variadic_templates); break; diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h index baf2308a458..753b74efa31 100644 --- a/clang/lib/Sema/TreeTransform.h +++ b/clang/lib/Sema/TreeTransform.h @@ -2804,7 +2804,7 @@ TreeTransform<Derived>::TransformNestedNameSpecifierLoc( return NestedNameSpecifierLoc(); if (TL.getType()->isDependentType() || TL.getType()->isRecordType() || - (SemaRef.getLangOpts().CPlusPlus0x && + (SemaRef.getLangOpts().CPlusPlus11 && TL.getType()->isEnumeralType())) { assert(!TL.getType().hasLocalQualifiers() && "Can't get cv-qualifiers here"); |

