diff options
61 files changed, 327 insertions, 327 deletions
diff --git a/include/clang/Basic/LangOptions.def b/include/clang/Basic/LangOptions.def index f180e31fc8..8ef766ff63 100644 --- a/include/clang/Basic/LangOptions.def +++ b/include/clang/Basic/LangOptions.def @@ -48,7 +48,7 @@ LANGOPT(MicrosoftMode , 1, 0, "Microsoft compatibility mode") LANGOPT(AsmBlocks , 1, 0, "Microsoft inline asm blocks") LANGOPT(Borland , 1, 0, "Borland extensions") LANGOPT(CPlusPlus , 1, 0, "C++") -LANGOPT(CPlusPlus0x , 1, 0, "C++0x") +LANGOPT(CPlusPlus11 , 1, 0, "C++0x") LANGOPT(CPlusPlus1y , 1, 0, "C++1y") LANGOPT(ObjC1 , 1, 0, "Objective-C 1") LANGOPT(ObjC2 , 1, 0, "Objective-C 2") diff --git a/include/clang/Basic/OperatorPrecedence.h b/include/clang/Basic/OperatorPrecedence.h index 7dda68365b..b68d577c80 100644 --- a/include/clang/Basic/OperatorPrecedence.h +++ b/include/clang/Basic/OperatorPrecedence.h @@ -45,7 +45,7 @@ namespace prec { /// \brief Return the precedence of the specified binary operator token. prec::Level getBinOpPrecedence(tok::TokenKind Kind, bool GreaterThanIsOperator, - bool CPlusPlus0x); + bool CPlusPlus11); } // end namespace clang diff --git a/include/clang/Frontend/LangStandard.h b/include/clang/Frontend/LangStandard.h index f07cb0234b..1124d53eaf 100644 --- a/include/clang/Frontend/LangStandard.h +++ b/include/clang/Frontend/LangStandard.h @@ -23,7 +23,7 @@ enum LangFeatures { C99 = (1 << 2), C11 = (1 << 3), CPlusPlus = (1 << 4), - CPlusPlus0x = (1 << 5), + CPlusPlus11 = (1 << 5), CPlusPlus1y = (1 << 6), Digraphs = (1 << 7), GNUMode = (1 << 8), @@ -69,8 +69,8 @@ public: /// isCPlusPlus - Language is a C++ variant. bool isCPlusPlus() const { return Flags & frontend::CPlusPlus; } - /// isCPlusPlus0x - Language is a C++0x variant. - bool isCPlusPlus0x() const { return Flags & frontend::CPlusPlus0x; } + /// isCPlusPlus11 - Language is a C++0x variant. + bool isCPlusPlus11() const { return Flags & frontend::CPlusPlus11; } /// isCPlusPlus1y - Language is a C++1y variant. bool isCPlusPlus1y() const { return Flags & frontend::CPlusPlus1y; } diff --git a/include/clang/Frontend/LangStandards.def b/include/clang/Frontend/LangStandards.def index 10807b7804..7b2516b0e3 100644 --- a/include/clang/Frontend/LangStandards.def +++ b/include/clang/Frontend/LangStandards.def @@ -96,23 +96,23 @@ LANGSTANDARD(gnucxx98, "gnu++98", LANGSTANDARD(cxx0x, "c++0x", "ISO C++ 2011 with amendments", - LineComment | CPlusPlus | CPlusPlus0x | Digraphs) + LineComment | CPlusPlus | CPlusPlus11 | Digraphs) LANGSTANDARD(cxx11, "c++11", "ISO C++ 2011 with amendments", - LineComment | CPlusPlus | CPlusPlus0x | Digraphs) + LineComment | CPlusPlus | CPlusPlus11 | Digraphs) LANGSTANDARD(gnucxx0x, "gnu++0x", "ISO C++ 2011 with amendments and GNU extensions", - LineComment | CPlusPlus | CPlusPlus0x | Digraphs | GNUMode) + LineComment | CPlusPlus | CPlusPlus11 | Digraphs | GNUMode) LANGSTANDARD(gnucxx11, "gnu++11", "ISO C++ 2011 with amendments and GNU extensions", - LineComment | CPlusPlus | CPlusPlus0x | Digraphs | GNUMode) + LineComment | CPlusPlus | CPlusPlus11 | Digraphs | GNUMode) LANGSTANDARD(cxx1y, "c++1y", "Working draft for ISO C++ 2014", - LineComment | CPlusPlus | CPlusPlus0x | CPlusPlus1y | Digraphs) + LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus1y | Digraphs) LANGSTANDARD(gnucxx1y, "gnu++1y", "Working draft for ISO C++ 2014 with GNU extensions", - LineComment | CPlusPlus | CPlusPlus0x | CPlusPlus1y | Digraphs | + LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus1y | Digraphs | GNUMode) // OpenCL diff --git a/include/clang/Parse/Parser.h b/include/clang/Parse/Parser.h index bb8a85452d..08964dc8ee 100644 --- a/include/clang/Parse/Parser.h +++ b/include/clang/Parse/Parser.h @@ -1812,7 +1812,7 @@ private: // an attribute is not allowed. bool CheckProhibitedCXX11Attribute() { assert(Tok.is(tok::l_square)); - if (!getLangOpts().CPlusPlus0x || NextToken().isNot(tok::l_square)) + if (!getLangOpts().CPlusPlus11 || NextToken().isNot(tok::l_square)) return false; return DiagnoseProhibitedCXX11Attribute(); } @@ -1857,7 +1857,7 @@ private: AttributeList::Syntax Syntax); void MaybeParseCXX0XAttributes(Declarator &D) { - if (getLangOpts().CPlusPlus0x && isCXX11AttributeSpecifier()) { + if (getLangOpts().CPlusPlus11 && isCXX11AttributeSpecifier()) { ParsedAttributesWithRange attrs(AttrFactory); SourceLocation endLoc; ParseCXX11Attributes(attrs, &endLoc); @@ -1866,7 +1866,7 @@ private: } void MaybeParseCXX0XAttributes(ParsedAttributes &attrs, SourceLocation *endLoc = 0) { - if (getLangOpts().CPlusPlus0x && isCXX11AttributeSpecifier()) { + if (getLangOpts().CPlusPlus11 && isCXX11AttributeSpecifier()) { ParsedAttributesWithRange attrsWithRange(AttrFactory); ParseCXX11Attributes(attrsWithRange, endLoc); attrs.takeAllFrom(attrsWithRange); @@ -1875,7 +1875,7 @@ private: void MaybeParseCXX0XAttributes(ParsedAttributesWithRange &attrs, SourceLocation *endLoc = 0, bool OuterMightBeMessageSend = false) { - if (getLangOpts().CPlusPlus0x && + if (getLangOpts().CPlusPlus11 && isCXX11AttributeSpecifier(false, OuterMightBeMessageSend)) ParseCXX11Attributes(attrs, endLoc); } diff --git a/include/clang/Sema/Sema.h b/include/clang/Sema/Sema.h index ffb6548041..6961538295 100644 --- a/include/clang/Sema/Sema.h +++ b/include/clang/Sema/Sema.h @@ -3433,7 +3433,7 @@ public: public: explicit ImplicitExceptionSpecification(Sema &Self) : Self(&Self), ComputedEST(EST_BasicNoexcept) { - if (!Self.getLangOpts().CPlusPlus0x) + if (!Self.getLangOpts().CPlusPlus11) ComputedEST = EST_DynamicNone; } diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index 2d34e4c335..9171174907 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -1385,7 +1385,7 @@ bool VarDecl::isUsableInConstantExpressions(ASTContext &C) const { // In C++11, any variable of reference type can be used in a constant // expression if it is initialized by a constant expression. - if (Lang.CPlusPlus0x && getType()->isReferenceType()) + if (Lang.CPlusPlus11 && getType()->isReferenceType()) return true; // Only const objects can be used in constant expressions in C++. C++98 does @@ -1401,7 +1401,7 @@ bool VarDecl::isUsableInConstantExpressions(ASTContext &C) const { // Additionally, in C++11, non-volatile constexpr variables can be used in // constant expressions. - return Lang.CPlusPlus0x && isConstexpr(); + return Lang.CPlusPlus11 && isConstexpr(); } /// Convert the initializer for this declaration to the elaborated EvaluatedStmt @@ -1457,7 +1457,7 @@ APValue *VarDecl::evaluateValue( // In C++11, we have determined whether the initializer was a constant // expression as a side-effect. - if (getASTContext().getLangOpts().CPlusPlus0x && !Eval->CheckedICE) { + if (getASTContext().getLangOpts().CPlusPlus11 && !Eval->CheckedICE) { Eval->CheckedICE = true; Eval->IsICE = Result && Notes.empty(); } @@ -1481,7 +1481,7 @@ bool VarDecl::checkInitIsICE() const { // In C++11, evaluate the initializer to check whether it's a constant // expression. - if (getASTContext().getLangOpts().CPlusPlus0x) { + if (getASTContext().getLangOpts().CPlusPlus11) { llvm::SmallVector<PartialDiagnosticAt, 8> Notes; evaluateValue(Notes); return Eval->IsICE; diff --git a/lib/AST/DeclCXX.cpp b/lib/AST/DeclCXX.cpp index fcd38ac721..87574d39e9 100644 --- a/lib/AST/DeclCXX.cpp +++ b/lib/AST/DeclCXX.cpp @@ -500,7 +500,7 @@ void CXXRecordDecl::addedMember(Decl *D) { // C++0x [dcl.init.aggr]p1: // An aggregate is an array or a class with no user-provided // constructors [...]. - if (getASTContext().getLangOpts().CPlusPlus0x + if (getASTContext().getLangOpts().CPlusPlus11 ? UserProvided : !Constructor->isImplicit()) data().Aggregate = false; } diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index 5fd38bbfe5..3835e8ece8 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -278,7 +278,7 @@ static void computeDeclRefDependence(ASTContext &Ctx, NamedDecl *D, QualType T, // - an entity with reference type and is initialized with an // expression that is value-dependent [C++11] if (VarDecl *Var = dyn_cast<VarDecl>(D)) { - if ((Ctx.getLangOpts().CPlusPlus0x ? + if ((Ctx.getLangOpts().CPlusPlus11 ? Var->getType()->isLiteralType() : Var->getType()->isIntegralOrEnumerationType()) && (Var->getType().isConstQualified() || @@ -3030,7 +3030,7 @@ Expr::isNullPointerConstant(ASTContext &Ctx, // test for the value 0. Don't use the C++11 constant expression semantics // for this, for now; once the dust settles on core issue 903, we might only // allow a literal 0 here in C++11 mode. - if (Ctx.getLangOpts().CPlusPlus0x) { + if (Ctx.getLangOpts().CPlusPlus11) { if (!isCXX98IntegralConstantExpr(Ctx)) return NPCK_NotNull; } else { diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp index e9f1f482d1..a472951ab6 100644 --- a/lib/AST/ExprConstant.cpp +++ b/lib/AST/ExprConstant.cpp @@ -738,7 +738,7 @@ namespace { bool checkSubobject(EvalInfo &Info, const Expr *E, CheckSubobjectKind CSK) { // Outside C++11, do not build a designator referring to a subobject of // any object: we won't use such a designator for anything. - if (!Info.getLangOpts().CPlusPlus0x) + if (!Info.getLangOpts().CPlusPlus11) Designator.setInvalid(); return checkNullPointer(Info, E, CSK) && Designator.checkSubobject(Info, E, CSK); @@ -972,7 +972,7 @@ static bool CheckLValueConstantExpression(EvalInfo &Info, SourceLocation Loc, // manufacture when checking potential constant expressions is conservatively // assumed to be global here. if (!IsGlobalLValue(Base)) { - if (Info.getLangOpts().CPlusPlus0x) { + if (Info.getLangOpts().CPlusPlus11) { const ValueDecl *VD = Base.dyn_cast<const ValueDecl*>(); Info.Diag(Loc, diag::note_constexpr_non_global, 1) << IsReferenceType << !Designator.Entries.empty() @@ -1026,7 +1026,7 @@ static bool CheckLiteralType(EvalInfo &Info, const Expr *E) { return true; // Prvalue constant expressions must be of literal types. - if (Info.getLangOpts().CPlusPlus0x) + if (Info.getLangOpts().CPlusPlus11) Info.Diag(E, diag::note_constexpr_nonliteral) << E->getType(); else @@ -1527,7 +1527,7 @@ static bool ExtractSubobject(EvalInfo &Info, const Expr *E, // A diagnostic will have already been produced. return false; if (Sub.isOnePastTheEnd()) { - Info.Diag(E, Info.getLangOpts().CPlusPlus0x ? + Info.Diag(E, Info.getLangOpts().CPlusPlus11 ? (unsigned)diag::note_constexpr_read_past_end : (unsigned)diag::note_invalid_subexpr_in_const_expr); return false; @@ -1549,7 +1549,7 @@ static bool ExtractSubobject(EvalInfo &Info, const Expr *E, if (CAT->getSize().ule(Index)) { // Note, it should not be possible to form a pointer with a valid // designator which points more than one past the end of the array. - Info.Diag(E, Info.getLangOpts().CPlusPlus0x ? + Info.Diag(E, Info.getLangOpts().CPlusPlus11 ? (unsigned)diag::note_constexpr_read_past_end : (unsigned)diag::note_invalid_subexpr_in_const_expr); return false; @@ -1571,7 +1571,7 @@ static bool ExtractSubobject(EvalInfo &Info, const Expr *E, // Next subobject is a complex number. uint64_t Index = Sub.Entries[I].ArrayIndex; if (Index > 1) { - Info.Diag(E, Info.getLangOpts().CPlusPlus0x ? + Info.Diag(E, Info.getLangOpts().CPlusPlus11 ? (unsigned)diag::note_constexpr_read_past_end : (unsigned)diag::note_invalid_subexpr_in_const_expr); return false; @@ -1796,7 +1796,7 @@ static bool HandleLValueToRValueConversion(EvalInfo &Info, const Expr *Conv, // We support folding of const floating-point types, in order to make // static const data members of such types (supported as an extension) // more useful. - if (Info.getLangOpts().CPlusPlus0x) { + if (Info.getLangOpts().CPlusPlus11) { Info.CCEDiag(Conv, diag::note_constexpr_ltor_non_constexpr, 1) << VD; Info.Note(VD->getLocation(), diag::note_declared_at); } else { @@ -1804,7 +1804,7 @@ static bool HandleLValueToRValueConversion(EvalInfo &Info, const Expr *Conv, } } else { // FIXME: Allow folding of values of any literal type in all languages. - if (Info.getLangOpts().CPlusPlus0x) { + if (Info.getLangOpts().CPlusPlus11) { Info.Diag(Conv, diag::note_constexpr_ltor_non_constexpr, 1) << VD; Info.Note(VD->getLocation(), diag::note_declared_at); } else { @@ -2081,7 +2081,7 @@ static bool CheckTrivialDefaultConstructor(EvalInfo &Info, SourceLocation Loc, // call is a core constant expression whether or not the constructor is // constexpr. if (!CD->isConstexpr() && !IsValueInitialization) { - if (Info.getLangOpts().CPlusPlus0x) { + if (Info.getLangOpts().CPlusPlus11) { // FIXME: If DiagDecl is an implicitly-declared special member function, // we should be much more explicit about why it's not constexpr. Info.CCEDiag(Loc, diag::note_constexpr_invalid_function, 1) @@ -2109,7 +2109,7 @@ static bool CheckConstexprFunction(EvalInfo &Info, SourceLocation CallLoc, if (Definition && Definition->isConstexpr() && !Definition->isInvalidDecl()) return true; - if (Info.getLangOpts().CPlusPlus0x) { + if (Info.getLangOpts().CPlusPlus11) { const FunctionDecl *DiagDecl = Definition ? Definition : Declaration; // FIXME: If DiagDecl is an implicitly-declared special member function, we // should be much more explicit about why it's not constexpr. @@ -4318,7 +4318,7 @@ bool IntExprEvaluator::VisitCallExpr(const CallExpr *E) { case Builtin::BIstrlen: // A call to strlen is not a constant expression. - if (Info.getLangOpts().CPlusPlus0x) + if (Info.getLangOpts().CPlusPlus11) Info.CCEDiag(E, diag::note_constexpr_invalid_function) << /*isConstexpr*/0 << /*isConstructor*/0 << "'strlen'"; else @@ -6192,12 +6192,12 @@ static bool Evaluate(APValue &Result, EvalInfo &Info, const Expr *E) { return false; Result = Info.CurrentCall->Temporaries[E]; } else if (E->getType()->isVoidType()) { - if (!Info.getLangOpts().CPlusPlus0x) + if (!Info.getLangOpts().CPlusPlus11) Info.CCEDiag(E, diag::note_constexpr_nonliteral) << E->getType(); if (!EvaluateVoid(E, Info)) return false; - } else if (Info.getLangOpts().CPlusPlus0x) { + } else if (Info.getLangOpts().CPlusPlus11) { Info.Diag(E, diag::note_constexpr_nonliteral) << E->getType(); return false; } else { @@ -6267,7 +6267,7 @@ bool Expr::EvaluateAsRValue(EvalResult &Result, const ASTContext &Ctx) const { // FIXME: Evaluating values of large array and record types can cause // performance problems. Only do so in C++11 for now. if (isRValue() && (getType()->isArrayType() || getType()->isRecordType()) && - !Ctx.getLangOpts().CPlusPlus0x) + !Ctx.getLangOpts().CPlusPlus11) return false; EvalInfo Info(Ctx, Result); @@ -6314,7 +6314,7 @@ bool Expr::EvaluateAsInitializer(APValue &Value, const ASTContext &Ctx, // FIXME: Evaluating initializers for large array and record types can cause // performance problems. Only do so in C++11 for now. if (isRValue() && (getType()->isArrayType() || getType()->isRecordType()) && - !Ctx.getLangOpts().CPlusPlus0x) + !Ctx.getLangOpts().CPlusPlus11) return false; Expr::EvalStatus EStatus; @@ -6796,7 +6796,7 @@ static bool EvaluateCPlusPlus11IntegralConstantExpr(ASTContext &Ctx, } bool Expr::isIntegerConstantExpr(ASTContext &Ctx, SourceLocation *Loc) const { - if (Ctx.getLangOpts().CPlusPlus0x) + if (Ctx.getLangOpts().CPlusPlus11) return EvaluateCPlusPlus11IntegralConstantExpr(Ctx, this, 0, Loc); ICEDiag D = CheckICE(this, Ctx); @@ -6809,7 +6809,7 @@ bool Expr::isIntegerConstantExpr(ASTContext &Ctx, SourceLocation *Loc) const { bool Expr::isIntegerConstantExpr(llvm::APSInt &Value, ASTContext &Ctx, SourceLocation *Loc, bool isEvaluated) const { - if (Ctx.getLangOpts().CPlusPlus0x) + if (Ctx.getLangOpts().CPlusPlus11) return EvaluateCPlusPlus11IntegralConstantExpr(Ctx, this, &Value, Loc); if (!isIntegerConstantExpr(Ctx, Loc)) diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp index 2f91cd8551..378339242a 100644 --- a/lib/AST/Type.cpp +++ b/lib/AST/Type.cpp @@ -940,7 +940,7 @@ bool Type::isIncompleteType(NamedDecl **Def) const { bool QualType::isPODType(ASTContext &Context) const { // C++11 has a more relaxed definition of POD. - if (Context.getLangOpts().CPlusPlus0x) + if (Context.getLangOpts().CPlusPlus11) return isCXX11PODType(Context); return isCXX98PODType(Context); diff --git a/lib/Analysis/FormatString.cpp b/lib/Analysis/FormatString.cpp index 73063b5132..4b18d8ea91 100644 --- a/lib/Analysis/FormatString.cpp +++ b/lib/Analysis/FormatString.cpp @@ -204,7 +204,7 @@ clang::analyze_format_string::ParseLengthModifier(FormatSpecifier &FS, case 'L': lmKind = LengthModifier::AsLongDouble; ++I; break; case 'q': lmKind = LengthModifier::AsQuad; ++I; break; case 'a': - if (IsScanf && !LO.C99 && !LO.CPlusPlus0x) { + if (IsScanf && !LO.C99 && !LO.CPlusPlus11) { // For scanf in C90, look at the next character to see if this should // be parsed as the GNU extension 'a' length modifier. If not, this // will be parsed as a conversion specifier. diff --git a/lib/Analysis/PrintfFormatString.cpp b/lib/Analysis/PrintfFormatString.cpp index 176aaedeaa..b52433a0a4 100644 --- a/lib/Analysis/PrintfFormatString.cpp +++ b/lib/Analysis/PrintfFormatString.cpp @@ -496,7 +496,7 @@ bool PrintfSpecifier::fixType(QualType QT, const LangOptions &LangOpt, } // Handle size_t, ptrdiff_t, etc. that have dedicated length modifiers in C99. - if (isa<TypedefType>(QT) && (LangOpt.C99 || LangOpt.CPlusPlus0x)) + if (isa<TypedefType>(QT) && (LangOpt.C99 || LangOpt.CPlusPlus11)) namedTypeToLengthModifier(QT, LM); // If fixing the length modifier was enough, we are done. diff --git a/lib/Analysis/ScanfFormatString.cpp b/lib/Analysis/ScanfFormatString.cpp index 269a5f90c6..2dbc9e4948 100644 --- a/lib/Analysis/ScanfFormatString.cpp +++ b/lib/Analysis/ScanfFormatString.cpp @@ -445,7 +445,7 @@ bool ScanfSpecifier::fixType(QualType QT, const LangOptions &LangOpt, } // Handle size_t, ptrdiff_t, etc. that have dedicated length modifiers in C99. - if (isa<TypedefType>(PT) && (LangOpt.C99 || LangOpt.CPlusPlus0x)) + if (isa<TypedefType>(PT) && (LangOpt.C99 || LangOpt.CPlusPlus11)) namedTypeToLengthModifier(PT, LM); // If fixing the length modifier was enough, we are done. diff --git a/lib/Basic/IdentifierTable.cpp b/lib/Basic/IdentifierTable.cpp index 49cd0ac615..44769e440e 100644 --- a/lib/Basic/IdentifierTable.cpp +++ b/lib/Basic/IdentifierTable.cpp @@ -124,7 +124,7 @@ static void AddKeyword(StringRef Keyword, unsigned AddResult = 0; if (Flags == KEYALL) AddResult = 2; else if (LangOpts.CPlusPlus && (Flags & KEYCXX)) AddResult = 2; - else if (LangOpts.CPlusPlus0x && (Flags & KEYCXX0X)) AddResult = 2; + else if (LangOpts.CPlusPlus11 && (Flags & KEYCXX0X)) AddResult = 2; else if (LangOpts.C99 && (Flags & KEYC99)) AddResult = 2; else if (LangOpts.GNUKeywords && (Flags & KEYGNU)) AddResult = 1; else if (LangOpts.MicrosoftExt && (Flags & KEYMS)) AddResult = 1; diff --git a/lib/Basic/Module.cpp b/lib/Basic/Module.cpp index 605a736626..454dd9c02b 100644 --- a/lib/Basic/Module.cpp +++ b/ |