diff --git a/clang/include/clang/Basic/DiagnosticGroups.td b/clang/include/clang/Basic/DiagnosticGroups.td index e2060888bfa5..7a74a9830490 100644 --- a/clang/include/clang/Basic/DiagnosticGroups.td +++ b/clang/include/clang/Basic/DiagnosticGroups.td @@ -118,9 +118,9 @@ def FormatExtraArgs : DiagGroup<"format-extra-args">; def FormatZeroLength : DiagGroup<"format-zero-length">; // Warnings for C++1y code which is not compatible with prior C++ standards. -def CXXPre1yCompat : DiagGroup<"c++98-c++11-compat">; -def CXXPre1yCompatPedantic : DiagGroup<"c++98-c++11-compat-pedantic", - [CXXPre1yCompat]>; +def CXXPre14Compat : DiagGroup<"c++98-c++11-compat">; +def CXXPre14CompatPedantic : DiagGroup<"c++98-c++11-compat-pedantic", + [CXXPre14Compat]>; def CXXPre1zCompat : DiagGroup<"c++98-c++11-c++14-compat">; def CXXPre1zCompatPedantic : DiagGroup<"c++98-c++11-c++14-compat-pedantic", [CXXPre1zCompat]>; @@ -136,12 +136,12 @@ def CXX98Compat : DiagGroup<"c++98-compat", [CXX98CompatBindToTemporaryCopy, CXX98CompatLocalTypeTemplateArgs, CXX98CompatUnnamedTypeTemplateArgs, - CXXPre1yCompat, + CXXPre14Compat, CXXPre1zCompat]>; // Warnings for C++11 features which are Extensions in C++98 mode. def CXX98CompatPedantic : DiagGroup<"c++98-compat-pedantic", [CXX98Compat, - CXXPre1yCompatPedantic, + CXXPre14CompatPedantic, CXXPre1zCompatPedantic]>; def CXX11Narrowing : DiagGroup<"c++11-narrowing">; @@ -162,11 +162,11 @@ def CXX11Compat : DiagGroup<"c++11-compat", [CXX11Narrowing, CXX11CompatReservedUserDefinedLiteral, CXX11CompatDeprecatedWritableStr, - CXXPre1yCompat, + CXXPre14Compat, CXXPre1zCompat]>; def : DiagGroup<"c++0x-compat", [CXX11Compat]>; def CXX11CompatPedantic : DiagGroup<"c++11-compat-pedantic", - [CXXPre1yCompatPedantic, + [CXXPre14CompatPedantic, CXXPre1zCompatPedantic]>; def CXX14Compat : DiagGroup<"c++14-compat", [CXXPre1zCompat]>; @@ -631,15 +631,17 @@ def NonGCC : DiagGroup<"non-gcc", // earlier C++ versions. def CXX11 : DiagGroup<"c++11-extensions", [CXX11ExtraSemi, CXX11LongLong]>; -// A warning group for warnings about using C++1y features as extensions in +// A warning group for warnings about using C++14 features as extensions in // earlier C++ versions. -def CXX1y : DiagGroup<"c++1y-extensions">; +def CXX14 : DiagGroup<"c++14-extensions">; // A warning group for warnings about using C++1z features as extensions in // earlier C++ versions. def CXX1z : DiagGroup<"c++1z-extensions">; def : DiagGroup<"c++0x-extensions", [CXX11]>; +def : DiagGroup<"c++1y-extensions", [CXX14]>; + def DelegatingCtorCycles : DiagGroup<"delegating-ctor-cycles">; diff --git a/clang/include/clang/Basic/DiagnosticLexKinds.td b/clang/include/clang/Basic/DiagnosticLexKinds.td index 86def878834f..9e5541a1b7a5 100644 --- a/clang/include/clang/Basic/DiagnosticLexKinds.td +++ b/clang/include/clang/Basic/DiagnosticLexKinds.td @@ -161,8 +161,8 @@ def err_invalid_suffix_integer_constant : Error< def err_invalid_suffix_float_constant : Error< "invalid suffix '%0' on floating constant">; def warn_cxx11_compat_digit_separator : Warning< - "digit separators are incompatible with C++ standards before C++1y">, - InGroup, DefaultIgnore; + "digit separators are incompatible with C++ standards before C++14">, + InGroup, DefaultIgnore; def err_digit_separator_not_between_digits : Error< "digit separator cannot appear at %select{start|end}0 of digit sequence">; def warn_extraneous_char_constant : Warning< @@ -182,11 +182,11 @@ def ext_hexconstant_invalid : Extension< "hexadecimal floating constants are a C99 feature">, InGroup; def ext_binary_literal : Extension< "binary integer literals are a GNU extension">, InGroup; -def ext_binary_literal_cxx1y : Extension< - "binary integer literals are a C++1y extension">, InGroup; +def ext_binary_literal_cxx14 : Extension< + "binary integer literals are a C++14 extension">, InGroup; def warn_cxx11_compat_binary_literal : Warning< - "binary integer literals are incompatible with C++ standards before C++1y">, - InGroup, DefaultIgnore; + "binary integer literals are incompatible with C++ standards before C++14">, + InGroup, DefaultIgnore; def err_pascal_string_too_long : Error<"Pascal string is too long">; def err_octal_escape_too_large : Error<"octal escape sequence out of range">; def err_hex_escape_too_large : Error<"hex escape sequence out of range">; diff --git a/clang/include/clang/Basic/DiagnosticParseKinds.td b/clang/include/clang/Basic/DiagnosticParseKinds.td index 80cdb3d26aaf..0dcfb5642ba9 100644 --- a/clang/include/clang/Basic/DiagnosticParseKinds.td +++ b/clang/include/clang/Basic/DiagnosticParseKinds.td @@ -271,10 +271,10 @@ def ext_auto_storage_class : ExtWarn< "'auto' storage class specifier is not permitted in C++11, and will not " "be supported in future releases">, InGroup>; def ext_decltype_auto_type_specifier : ExtWarn< - "'decltype(auto)' type specifier is a C++1y extension">, InGroup; + "'decltype(auto)' type specifier is a C++14 extension">, InGroup; def warn_cxx11_compat_decltype_auto_type_specifier : Warning< "'decltype(auto)' type specifier is incompatible with C++ standards before " - "C++1y">, InGroup, DefaultIgnore; + "C++14">, InGroup, DefaultIgnore; def ext_for_range : ExtWarn< "range-based for loop is a C++11 extension">, InGroup; def warn_cxx98_compat_for_range : Warning< @@ -283,7 +283,7 @@ def warn_cxx98_compat_for_range : Warning< def ext_for_range_identifier : ExtWarn< "range-based for loop with implicit deduced type is a C++1z extension">, InGroup; -def warn_cxx1y_compat_for_range_identifier : Warning< +def warn_cxx14_compat_for_range_identifier : Warning< "range-based for loop with implicit deduced type is incompatible with " "C++ standards before C++1z">, InGroup, DefaultIgnore; @@ -592,7 +592,7 @@ def err_class_on_template_template_param : Error< def ext_template_template_param_typename : ExtWarn< "template template parameter using 'typename' is a C++1z extension">, InGroup; -def warn_cxx1y_compat_template_template_param_typename : Warning< +def warn_cxx14_compat_template_template_param_typename : Warning< "template template parameter using 'typename' is " "incompatible with C++ standards before C++1z">, InGroup, DefaultIgnore; diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td index 2385f375de66..532e4d5bb84e 100644 --- a/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -936,7 +936,7 @@ def err_static_assert_expression_is_not_constant : Error< def err_static_assert_failed : Error<"static_assert failed%select{ %1|}0">; def ext_static_assert_no_message : ExtWarn< "static_assert with no message is a C++1z extension">, InGroup; -def warn_cxx1y_compat_static_assert_no_message : Warning< +def warn_cxx14_compat_static_assert_no_message : Warning< "static_assert with no message is incompatible with C++ standards before C++1z">, DefaultIgnore, InGroup; @@ -1603,9 +1603,9 @@ def err_auto_new_ctor_multiple_expressions : Error< "new expression for type %0 contains multiple constructor arguments">; def err_auto_missing_trailing_return : Error< "'auto' return without trailing return type; deduced return types are a " - "C++1y extension">; + "C++14 extension">; def err_deduced_return_type : Error< - "deduced return types are a C++1y extension">; + "deduced return types are a C++14 extension">; def err_trailing_return_without_auto : Error< "function with trailing return type must specify return type 'auto', not %0">; def err_trailing_return_in_parens : Error< @@ -1754,10 +1754,10 @@ def note_for_range_begin_end : Note< def warn_cxx98_compat_constexpr : Warning< "'constexpr' specifier is incompatible with C++98">, InGroup, DefaultIgnore; -// FIXME: Maybe this should also go in -Wc++1y-compat? -def warn_cxx1y_compat_constexpr_not_const : Warning< +// FIXME: Maybe this should also go in -Wc++14-compat? +def warn_cxx14_compat_constexpr_not_const : Warning< "'constexpr' non-static member function will not be implicitly 'const' " - "in C++1y; add 'const' to avoid a change in behavior">, + "in C++14; add 'const' to avoid a change in behavior">, InGroup>; def err_invalid_constexpr : Error< "%select{function parameter|typedef|non-static data member}0 " @@ -1799,28 +1799,28 @@ def err_constexpr_body_invalid_stmt : Error< "statement not allowed in constexpr %select{function|constructor}0">; def ext_constexpr_body_invalid_stmt : ExtWarn< "use of this statement in a constexpr %select{function|constructor}0 " - "is a C++1y extension">, InGroup; + "is a C++14 extension">, InGroup; def warn_cxx11_compat_constexpr_body_invalid_stmt : Warning< "use of this statement in a constexpr %select{function|constructor}0 " - "is incompatible with C++ standards before C++1y">, - InGroup, DefaultIgnore; + "is incompatible with C++ standards before C++14">, + InGroup, DefaultIgnore; def ext_constexpr_type_definition : ExtWarn< "type definition in a constexpr %select{function|constructor}0 " - "is a C++1y extension">, InGroup; + "is a C++14 extension">, InGroup; def warn_cxx11_compat_constexpr_type_definition : Warning< "type definition in a constexpr %select{function|constructor}0 " - "is incompatible with C++ standards before C++1y">, - InGroup, DefaultIgnore; + "is incompatible with C++ standards before C++14">, + InGroup, DefaultIgnore; def err_constexpr_vla : Error< "variably-modified type %0 cannot be used in a constexpr " "%select{function|constructor}1">; def ext_constexpr_local_var : ExtWarn< "variable declaration in a constexpr %select{function|constructor}0 " - "is a C++1y extension">, InGroup; + "is a C++14 extension">, InGroup; def warn_cxx11_compat_constexpr_local_var : Warning< "variable declaration in a constexpr %select{function|constructor}0 " - "is incompatible with C++ standards before C++1y">, - InGroup, DefaultIgnore; + "is incompatible with C++ standards before C++14">, + InGroup, DefaultIgnore; def err_constexpr_local_var_static : Error< "%select{static|thread_local}1 variable not permitted in a constexpr " "%select{function|constructor}0">; @@ -1839,14 +1839,14 @@ def err_constexpr_body_no_return : Error< "no return statement in constexpr function">; def warn_cxx11_compat_constexpr_body_no_return : Warning< "constexpr function with no return statements is incompatible with C++ " - "standards before C++1y">, InGroup, DefaultIgnore; + "standards before C++14">, InGroup, DefaultIgnore; def ext_constexpr_body_multiple_return : ExtWarn< - "multiple return statements in constexpr function is a C++1y extension">, - InGroup; + "multiple return statements in constexpr function is a C++14 extension">, + InGroup; def warn_cxx11_compat_constexpr_body_multiple_return : Warning< "multiple return statements in constexpr function " - "is incompatible with C++ standards before C++1y">, - InGroup, DefaultIgnore; + "is incompatible with C++ standards before C++14">, + InGroup, DefaultIgnore; def note_constexpr_body_previous_return : Note< "previous return statement is here">; def err_constexpr_function_try_block : Error< @@ -3127,11 +3127,11 @@ def err_template_parameter_default_friend_template : Error< def err_template_template_parm_no_parms : Error< "template template parameter must have its own template parameters">; -def ext_variable_template : ExtWarn<"variable templates are a C++1y extension">, - InGroup; +def ext_variable_template : ExtWarn<"variable templates are a C++14 extension">, + InGroup; def warn_cxx11_compat_variable_template : Warning< - "variable templates are incompatible with C++ standards before C++1y">, - InGroup, DefaultIgnore; + "variable templates are incompatible with C++ standards before C++14">, + InGroup, DefaultIgnore; def err_template_variable_noparams : Error< "extraneous 'template<>' in declaration of variable %0">; def err_template_member : Error<"member %0 declared as a template">; @@ -5387,12 +5387,12 @@ let CategoryName = "Lambda Issue" in { "implicit capture of lambda object due to conversion to block pointer " "here">; - // C++1y lambda init-captures. + // C++14 lambda init-captures. def warn_cxx11_compat_init_capture : Warning< "initialized lambda captures are incompatible with C++ standards " - "before C++1y">, InGroup, DefaultIgnore; + "before C++14">, InGroup, DefaultIgnore; def ext_init_capture : ExtWarn< - "initialized lambda captures are a C++1y extension">, InGroup; + "initialized lambda captures are a C++14 extension">, InGroup; def err_init_capture_no_expression : Error< "initializer missing for lambda capture %0">; def err_init_capture_multiple_expressions : Error< diff --git a/clang/include/clang/Basic/LangOptions.def b/clang/include/clang/Basic/LangOptions.def index c29686a7a930..fe3a46f30d2b 100644 --- a/clang/include/clang/Basic/LangOptions.def +++ b/clang/include/clang/Basic/LangOptions.def @@ -49,7 +49,7 @@ LANGOPT(AsmBlocks , 1, 0, "Microsoft inline asm blocks") LANGOPT(Borland , 1, 0, "Borland extensions") LANGOPT(CPlusPlus , 1, 0, "C++") LANGOPT(CPlusPlus11 , 1, 0, "C++11") -LANGOPT(CPlusPlus1y , 1, 0, "C++1y") +LANGOPT(CPlusPlus14 , 1, 0, "C++14") LANGOPT(CPlusPlus1z , 1, 0, "C++1z") LANGOPT(ObjC1 , 1, 0, "Objective-C 1") LANGOPT(ObjC2 , 1, 0, "Objective-C 2") diff --git a/clang/include/clang/Driver/CC1Options.td b/clang/include/clang/Driver/CC1Options.td index 6e0c7b2595e3..a87d7aae5533 100644 --- a/clang/include/clang/Driver/CC1Options.td +++ b/clang/include/clang/Driver/CC1Options.td @@ -502,7 +502,7 @@ def fdeprecated_macro : Flag<["-"], "fdeprecated-macro">, def fno_deprecated_macro : Flag<["-"], "fno-deprecated-macro">, HelpText<"Undefines the __DEPRECATED macro">; def fsized_deallocation : Flag<["-"], "fsized-deallocation">, - HelpText<"Enable C++1y sized global deallocation functions">; + HelpText<"Enable C++14 sized global deallocation functions">; def fobjc_subscripting_legacy_runtime : Flag<["-"], "fobjc-subscripting-legacy-runtime">, HelpText<"Allow Objective-C array and dictionary subscripting in legacy runtime">; def vtordisp_mode_EQ : Joined<["-"], "vtordisp-mode=">, diff --git a/clang/include/clang/Frontend/LangStandard.h b/clang/include/clang/Frontend/LangStandard.h index 9680e1f2e04c..8021d08942e5 100644 --- a/clang/include/clang/Frontend/LangStandard.h +++ b/clang/include/clang/Frontend/LangStandard.h @@ -24,7 +24,7 @@ enum LangFeatures { C11 = (1 << 3), CPlusPlus = (1 << 4), CPlusPlus11 = (1 << 5), - CPlusPlus1y = (1 << 6), + CPlusPlus14 = (1 << 6), CPlusPlus1z = (1 << 7), Digraphs = (1 << 8), GNUMode = (1 << 9), @@ -73,8 +73,8 @@ public: /// isCPlusPlus11 - Language is a C++11 variant (or later). bool isCPlusPlus11() const { return Flags & frontend::CPlusPlus11; } - /// isCPlusPlus1y - Language is a C++14 variant (or later). - bool isCPlusPlus1y() const { return Flags & frontend::CPlusPlus1y; } + /// isCPlusPlus14 - Language is a C++14 variant (or later). + bool isCPlusPlus14() const { return Flags & frontend::CPlusPlus14; } /// isCPlusPlus1z - Language is a C++17 variant (or later). bool isCPlusPlus1z() const { return Flags & frontend::CPlusPlus1z; } diff --git a/clang/include/clang/Frontend/LangStandards.def b/clang/include/clang/Frontend/LangStandards.def index da9a11849967..5bcabaad12a4 100644 --- a/clang/include/clang/Frontend/LangStandards.def +++ b/clang/include/clang/Frontend/LangStandards.def @@ -108,20 +108,27 @@ LANGSTANDARD(gnucxx11, "gnu++11", LineComment | CPlusPlus | CPlusPlus11 | Digraphs | GNUMode) LANGSTANDARD(cxx1y, "c++1y", - "Working draft for ISO C++ 2014", - LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus1y | Digraphs) + "ISO C++ 2014 with amendments", + LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | Digraphs) +LANGSTANDARD(cxx14, "c++14", + "ISO C++ 2014 with amendments", + LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | Digraphs) LANGSTANDARD(gnucxx1y, "gnu++1y", - "Working draft for ISO C++ 2014 with GNU extensions", - LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus1y | Digraphs | + "ISO C++ 2014 with amendments and GNU extensions", + LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | Digraphs | + GNUMode) +LANGSTANDARD(gnucxx14, "gnu++14", + "ISO C++ 2014 with amendments and GNU extensions", + LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | Digraphs | GNUMode) LANGSTANDARD(cxx1z, "c++1z", "Working draft for ISO C++ 2017", - LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus1y | CPlusPlus1z | + LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus1z | Digraphs) LANGSTANDARD(gnucxx1z, "gnu++1z", "Working draft for ISO C++ 2017 with GNU extensions", - LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus1y | CPlusPlus1z | + LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus1z | Digraphs | GNUMode) // OpenCL diff --git a/clang/lib/AST/DeclCXX.cpp b/clang/lib/AST/DeclCXX.cpp index ed26c5262a7b..0de15a538c2c 100644 --- a/clang/lib/AST/DeclCXX.cpp +++ b/clang/lib/AST/DeclCXX.cpp @@ -720,7 +720,7 @@ void CXXRecordDecl::addedMember(Decl *D) { // brace-or-equal-initializers for non-static data members. // // This rule was removed in C++1y. - if (!getASTContext().getLangOpts().CPlusPlus1y) + if (!getASTContext().getLangOpts().CPlusPlus14) data().Aggregate = false; // C++11 [class]p10: diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp index 538fc57672f2..61e396e38866 100644 --- a/clang/lib/AST/ExprConstant.cpp +++ b/clang/lib/AST/ExprConstant.cpp @@ -1329,7 +1329,7 @@ static bool CheckLiteralType(EvalInfo &Info, const Expr *E, // C++1y: A constant initializer for an object o [...] may also invoke // constexpr constructors for o and its subobjects even if those objects // are of non-literal class types. - if (Info.getLangOpts().CPlusPlus1y && This && + if (Info.getLangOpts().CPlusPlus14 && This && Info.EvaluatingDecl == This->getLValueBase()) return true; @@ -2491,7 +2491,7 @@ CompleteObject findCompleteObject(EvalInfo &Info, const Expr *E, AccessKinds AK, // Unless we're looking at a local variable or argument in a constexpr call, // the variable we're reading must be const. if (!Frame) { - if (Info.getLangOpts().CPlusPlus1y && + if (Info.getLangOpts().CPlusPlus14 && VD == Info.EvaluatingDecl.dyn_cast()) { // OK, we can read and modify an object if we're in the process of // evaluating its initializer, because its lifetime began in this @@ -2607,7 +2607,7 @@ CompleteObject findCompleteObject(EvalInfo &Info, const Expr *E, AccessKinds AK, // // FIXME: Not all local state is mutable. Allow local constant subobjects // to be read here (but take care with 'mutable' fields). - if (Frame && Info.getLangOpts().CPlusPlus1y && + if (Frame && Info.getLangOpts().CPlusPlus14 && (Info.EvalStatus.HasSideEffects || Info.keepEvaluatingAfterFailure())) return CompleteObject(); @@ -2669,7 +2669,7 @@ static bool handleAssignment(EvalInfo &Info, const Expr *E, const LValue &LVal, if (LVal.Designator.Invalid) return false; - if (!Info.getLangOpts().CPlusPlus1y) { + if (!Info.getLangOpts().CPlusPlus14) { Info.Diag(E); return false; } @@ -2790,7 +2790,7 @@ static bool handleCompoundAssignment( if (LVal.Designator.Invalid) return false; - if (!Info.getLangOpts().CPlusPlus1y) { + if (!Info.getLangOpts().CPlusPlus14) { Info.Diag(E); return false; } @@ -2939,7 +2939,7 @@ static bool handleIncDec(EvalInfo &Info, const Expr *E, const LValue &LVal, if (LVal.Designator.Invalid) return false; - if (!Info.getLangOpts().CPlusPlus1y) { + if (!Info.getLangOpts().CPlusPlus14) { Info.Diag(E); return false; } @@ -4149,7 +4149,7 @@ public: return VisitUnaryPostIncDec(UO); } bool VisitUnaryPostIncDec(const UnaryOperator *UO) { - if (!Info.getLangOpts().CPlusPlus1y && !Info.keepEvaluatingAfterFailure()) + if (!Info.getLangOpts().CPlusPlus14 && !Info.keepEvaluatingAfterFailure()) return Error(UO); LValue LVal; @@ -4574,7 +4574,7 @@ bool LValueExprEvaluator::VisitUnaryImag(const UnaryOperator *E) { } bool LValueExprEvaluator::VisitUnaryPreIncDec(const UnaryOperator *UO) { - if (!Info.getLangOpts().CPlusPlus1y && !Info.keepEvaluatingAfterFailure()) + if (!Info.getLangOpts().CPlusPlus14 && !Info.keepEvaluatingAfterFailure()) return Error(UO); if (!this->Visit(UO->getSubExpr())) @@ -4587,7 +4587,7 @@ bool LValueExprEvaluator::VisitUnaryPreIncDec(const UnaryOperator *UO) { bool LValueExprEvaluator::VisitCompoundAssignOperator( const CompoundAssignOperator *CAO) { - if (!Info.getLangOpts().CPlusPlus1y && !Info.keepEvaluatingAfterFailure()) + if (!Info.getLangOpts().CPlusPlus14 && !Info.keepEvaluatingAfterFailure()) return Error(CAO); APValue RHS; @@ -4609,7 +4609,7 @@ bool LValueExprEvaluator::VisitCompoundAssignOperator( } bool LValueExprEvaluator::VisitBinAssign(const BinaryOperator *E) { - if (!Info.getLangOpts().CPlusPlus1y && !Info.keepEvaluatingAfterFailure()) + if (!Info.getLangOpts().CPlusPlus14 && !Info.keepEvaluatingAfterFailure()) return Error(E); APValue NewVal; diff --git a/clang/lib/AST/Type.cpp b/clang/lib/AST/Type.cpp index 1d05c1024ce7..35676da641da 100644 --- a/clang/lib/AST/Type.cpp +++ b/clang/lib/AST/Type.cpp @@ -1147,7 +1147,7 @@ bool Type::isLiteralType(const ASTContext &Ctx) const { // C++1y [basic.types]p10: // A type is a literal type if it is: // -- cv void; or - if (Ctx.getLangOpts().CPlusPlus1y && isVoidType()) + if (Ctx.getLangOpts().CPlusPlus14 && isVoidType()) return true; // C++11 [basic.types]p10: diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp index 4c18d54ec02e..65ee5f4a528a 100644 --- a/clang/lib/Format/Format.cpp +++ b/clang/lib/Format/Format.cpp @@ -2012,7 +2012,7 @@ LangOptions getFormattingLangOpts(FormatStyle::LanguageStandard Standard) { LangOptions LangOpts; LangOpts.CPlusPlus = 1; LangOpts.CPlusPlus11 = Standard == FormatStyle::LS_Cpp03 ? 0 : 1; - LangOpts.CPlusPlus1y = Standard == FormatStyle::LS_Cpp03 ? 0 : 1; + LangOpts.CPlusPlus14 = Standard == FormatStyle::LS_Cpp03 ? 0 : 1; LangOpts.LineComment = 1; LangOpts.CXXOperatorNames = 1; LangOpts.Bool = 1; diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index fbfad94ec3c0..9696c4902e19 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -1139,7 +1139,7 @@ void CompilerInvocation::setLangDefaults(LangOptions &Opts, InputKind IK, Opts.C11 = Std.isC11(); Opts.CPlusPlus = Std.isCPlusPlus(); Opts.CPlusPlus11 = Std.isCPlusPlus11(); - Opts.CPlusPlus1y = Std.isCPlusPlus1y(); + Opts.CPlusPlus14 = Std.isCPlusPlus14(); Opts.CPlusPlus1z = Std.isCPlusPlus1z(); Opts.Digraphs = Std.hasDigraphs(); Opts.GNUMode = Std.isGNUMode(); @@ -1186,8 +1186,8 @@ void CompilerInvocation::setLangDefaults(LangOptions &Opts, InputKind IK, Opts.DollarIdents = !Opts.AsmPreprocessor; - // C++1y onwards has sized global deallocation functions. - Opts.SizedDeallocation = Opts.CPlusPlus1y; + // C++14 onwards has sized global deallocation functions. + Opts.SizedDeallocation = Opts.CPlusPlus14; } /// Attempt to parse a visibility value out of the given argument. diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp index 118cae1e4430..d691d19730b6 100644 --- a/clang/lib/Frontend/InitPreprocessor.cpp +++ b/clang/lib/Frontend/InitPreprocessor.cpp @@ -375,7 +375,7 @@ static void InitializeStandardPredefinedMacros(const TargetInfo &TI, // C++1y [cpp.predefined]p1: // The name __cplusplus is defined to the value 201402L when compiling a // C++ translation unit. - else if (LangOpts.CPlusPlus1y) + else if (LangOpts.CPlusPlus14) Builder.defineMacro("__cplusplus", "201402L"); // C++11 [cpp.predefined]p1: // The name __cplusplus is defined to the value 201103L when compiling a @@ -417,7 +417,7 @@ static void InitializeCPlusPlusFeatureTestMacros(const LangOptions &LangOpts, Builder.defineMacro("__cpp_user_defined_literals", "200809"); Builder.defineMacro("__cpp_lambdas", "200907"); Builder.defineMacro("__cpp_constexpr", - LangOpts.CPlusPlus1y ? "201304" : "200704"); + LangOpts.CPlusPlus14 ? "201304" : "200704"); Builder.defineMacro("__cpp_static_assert", "200410"); Builder.defineMacro("__cpp_decltype", "200707"); Builder.defineMacro("__cpp_attributes", "200809"); @@ -426,7 +426,7 @@ static void InitializeCPlusPlusFeatureTestMacros(const LangOptions &LangOpts, } // C++14 features. - if (LangOpts.CPlusPlus1y) { + if (LangOpts.CPlusPlus14) { Builder.defineMacro("__cpp_binary_literals", "201304"); Builder.defineMacro("__cpp_init_captures", "201304"); Builder.defineMacro("__cpp_generic_lambdas", "201304"); diff --git a/clang/lib/Lex/Lexer.cpp b/clang/lib/Lex/Lexer.cpp index ced65f689d72..e7b48917c638 100644 --- a/clang/lib/Lex/Lexer.cpp +++ b/clang/lib/Lex/Lexer.cpp @@ -1597,7 +1597,7 @@ bool Lexer::LexNumericConstant(Token &Result, const char *CurPtr) { } // If we have a digit separator, continue. - if (C == '\'' && getLangOpts().CPlusPlus1y) { + if (C == '\'' && getLangOpts().CPlusPlus14) { unsigned NextSize; char Next = getCharAndSizeNoWarn(CurPtr + Size, NextSize, getLangOpts()); if (isIdentifierBody(Next)) { @@ -1660,7 +1660,7 @@ const char *Lexer::LexUDSuffix(Token &Result, const char *CurPtr, bool IsUDSuffix = false; if (C == '_') IsUDSuffix = true; - else if (IsStringLiteral && getLangOpts().CPlusPlus1y) { + else if (IsStringLiteral && getLangOpts().CPlusPlus14) { // In C++1y, we need to look ahead a few characters to see if this is a // valid suffix for a string literal or a numeric literal (this could be // the 'operator""if' defining a numeric literal operator). diff --git a/clang/lib/Lex/LiteralSupport.cpp b/clang/lib/Lex/LiteralSupport.cpp index 6417d0f0f5f2..096805c3cf56 100644 --- a/clang/lib/Lex/LiteralSupport.cpp +++ b/clang/lib/Lex/LiteralSupport.cpp @@ -656,7 +656,7 @@ NumericLiteralParser::NumericLiteralParser(StringRef TokSpelling, } } // "i", "if", and "il" are user-defined suffixes in C++1y. - if (PP.getLangOpts().CPlusPlus1y && *s == 'i') + if (PP.getLangOpts().CPlusPlus14 && *s == 'i') break; // fall through. case 'j': @@ -716,7 +716,7 @@ bool NumericLiteralParser::isValidUDSuffix(const LangOptions &LangOpts, return true; // In C++11, there are no library suffixes. - if (!LangOpts.CPlusPlus1y) + if (!LangOpts.CPlusPlus14) return false; // In C++1y, "s", "h", "min", "ms", "us", and "ns" are used in the library. @@ -813,10 +813,10 @@ void NumericLiteralParser::ParseNumberStartingWithZero(SourceLocation TokLoc) { if ((c1 == 'b' || c1 == 'B') && (c2 == '0' || c2 == '1')) { // 0b101010 is a C++1y / GCC extension. PP.Diag(TokLoc, - PP.getLangOpts().CPlusPlus1y + PP.getLangOpts().CPlusPlus14 ? diag::warn_cxx11_compat_binary_literal : PP.getLangOpts().CPlusPlus - ? diag::ext_binary_literal_cxx1y + ? diag::ext_binary_literal_cxx14 : diag::ext_binary_literal); ++s; radix = 2; diff --git a/clang/lib/Lex/PPMacroExpansion.cpp b/clang/lib/Lex/PPMacroExpansion.cpp index 2d7c6d4b5227..62d2da56ba97 100644 --- a/clang/lib/Lex/PPMacroExpansion.cpp +++ b/clang/lib/Lex/PPMacroExpansion.cpp @@ -950,15 +950,15 @@ static bool HasFeature(const Preprocessor &PP, const IdentifierInfo *II) { .Case("cxx_user_literals", LangOpts.CPlusPlus11) .Case("cxx_variadic_templates", LangOpts.CPlusPlus11) // C++1y features - .Case("cxx_aggregate_nsdmi", LangOpts.CPlusPlus1y) - .Case("cxx_binary_literals", LangOpts.CPlusPlus1y) - .Case("cxx_contextual_conversions", LangOpts.CPlusPlus1y) - .Case("cxx_decltype_auto", LangOpts.CPlusPlus1y) - .Case("cxx_generic_lambdas", LangOpts.CPlusPlus1y) - .Case("cxx_init_captures", LangOpts.CPlusPlus1y) - .Case("cxx_relaxed_constexpr", LangOpts.CPlusPlus1y) - .Case("cxx_return_type_deduction", LangOpts.CPlusPlus1y) - .Case("cxx_variable_templates", LangOpts.CPlusPlus1y) + .Case("cxx_aggregate_nsdmi", LangOpts.CPlusPlus14) + .Case("cxx_binary_literals", LangOpts.CPlusPlus14) + .Case("cxx_contextual_conversions", LangOpts.CPlusPlus14) + .Case("cxx_decltype_auto", LangOpts.CPlusPlus14) + .Case("cxx_generic_lambdas", LangOpts.CPlusPlus14) + .Case("cxx_init_captures", LangOpts.CPlusPlus14) + .Case("cxx_relaxed_constexpr", LangOpts.CPlusPlus14) + .Case("cxx_return_type_deduction", LangOpts.CPlusPlus14) + .Case("cxx_variable_templates", LangOpts.CPlusPlus14) // C++ TSes //.Case("cxx_runtime_arrays", LangOpts.CPlusPlusTSArrays) //.Case("cxx_concepts", LangOpts.CPlusPlusTSConcepts) diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index 75bae65fc05c..7132b4aab195 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -5201,7 +5201,7 @@ void Parser::ParseFunctionDeclarator(Declarator &D, dyn_cast(Actions.CurContext), DS.getTypeQualifiers() | (D.getDeclSpec().isConstexprSpecified() && - !getLangOpts().CPlusPlus1y + !getLangOpts().CPlusPlus14 ? Qualifiers::Const : 0), IsCXX11MemberFunction); diff --git a/clang/lib/Parse/ParseDeclCXX.cpp b/clang/lib/Parse/ParseDeclCXX.cpp index 99cb853b7dcb..497f7e06ddc4 100644 --- a/clang/lib/Parse/ParseDeclCXX.cpp +++ b/clang/lib/Parse/ParseDeclCXX.cpp @@ -692,7 +692,7 @@ Decl *Parser::ParseStaticAssertDeclaration(SourceLocation &DeclEnd){ ExprResult AssertMessage; if (Tok.is(tok::r_paren)) { Diag(Tok, getLangOpts().CPlusPlus1z - ? diag::warn_cxx1y_compat_static_assert_no_message + ? diag::warn_cxx14_compat_static_assert_no_message : diag::ext_static_assert_no_message) << (getLangOpts().CPlusPlus1z ? FixItHint() @@ -769,7 +769,7 @@ SourceLocation Parser::ParseDecltypeSpecifier(DeclSpec &DS) { // because the typename-specifier in a function-style cast operation can't // be 'auto'. Diag(Tok.getLocation(), - getLangOpts().CPlusPlus1y + getLangOpts().CPlusPlus14 ? diag::warn_cxx11_compat_decltype_auto_type_specifier : diag::ext_decltype_auto_type_specifier); ConsumeToken(); diff --git a/clang/lib/Parse/ParseStmt.cpp b/clang/lib/Parse/ParseStmt.cpp index a431270d2b10..1f7cfe9f60c7 100644 --- a/clang/lib/Parse/ParseStmt.cpp +++ b/clang/lib/Parse/ParseStmt.cpp @@ -1517,7 +1517,7 @@ StmtResult Parser::ParseForStatement(SourceLocation *TrailingElseLoc) { ForRangeInit.RangeExpr = ParseExpression(); Diag(Loc, getLangOpts().CPlusPlus1z - ? diag::warn_cxx1y_compat_for_range_identifier + ? diag::warn_cxx14_compat_for_range_identifier : diag::ext_for_range_identifier) << ((getLangOpts().CPlusPlus11 && !getLangOpts().CPlusPlus1z) ? FixItHint::CreateInsertion(Loc, "auto &&") diff --git a/clang/lib/Parse/ParseTemplate.cpp b/clang/lib/Parse/ParseTemplate.cpp index bd31445e10ed..2f1c189c1a78 100644 --- a/clang/lib/Parse/ParseTemplate.cpp +++ b/clang/lib/Parse/ParseTemplate.cpp @@ -561,7 +561,7 @@ Parser::ParseTemplateTemplateParameter(unsigned Depth, unsigned Position) { if (Tok.is(tok::kw_typename)) { Diag(Tok.getLocation(), getLangOpts().CPlusPlus1z - ? diag::warn_cxx1y_compat_template_template_param_typename + ? diag::warn_cxx14_compat_template_template_param_typename : diag::ext_template_template_param_typename) << (!getLangOpts().CPlusPlus1z ? FixItHint::CreateReplacement(Tok.getLocation(), "class") diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index dda40755251c..b3e92d765fd3 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -5471,7 +5471,7 @@ Sema::ActOnVariableDeclarator(Scope *S, Declarator &D, DeclContext *DC, // Only C++1y supports variable templates (N3651). Diag(D.getIdentifierLoc(), - getLangOpts().CPlusPlus1y + getLangOpts().CPlusPlus14 ? diag::warn_cxx11_compat_variable_template : diag::ext_variable_template); } @@ -7027,12 +7027,12 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, DeclContext *DC, NewFD->setVirtualAsWritten(true); } - if (getLangOpts().CPlusPlus1y && + if (getLangOpts().CPlusPlus14 && NewFD->getReturnType()->isUndeducedType()) Diag(D.getDeclSpec().getVirtualSpecLoc(), diag::err_auto_fn_virtual); } - if (getLangOpts().CPlusPlus1y && + if (getLangOpts().CPlusPlus14 && (NewFD->isDependentContext() || (isFriend && CurContext->isDependentContext())) && NewFD->getReturnType()->isUndeducedType()) { @@ -7784,7 +7784,7 @@ bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD, // This rule is not present in C++1y, so we produce a backwards // compatibility warning whenever it happens in C++11. CXXMethodDecl *MD = dyn_cast(NewFD); - if (!getLangOpts().CPlusPlus1y && MD && MD->isConstexpr() && + if (!getLangOpts().CPlusPlus14 && MD && MD->isConstexpr() && !MD->isStatic() && !isa(MD) && (MD->getTypeQualifiers() & Qualifiers::Const) == 0) { CXXMethodDecl *OldMD = nullptr; @@ -7806,7 +7806,7 @@ bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD, .IgnoreParens().getAs()) AddConstLoc = getLocForEndOfToken(FTL.getRParenLoc()); - Diag(MD->getLocation(), diag::warn_cxx1y_compat_constexpr_not_const) + Diag(MD->getLocation(), diag::warn_cxx14_compat_constexpr_not_const) << FixItHint::CreateInsertion(AddConstLoc, " const"); } } @@ -10163,7 +10163,7 @@ Decl *Sema::ActOnFinishFunctionBody(Decl *dcl, Stmt *Body, if (FD) { FD->setBody(Body); - if (getLangOpts().CPlusPlus1y && !FD->isInvalidDecl() && Body && + if (getLangOpts().CPlusPlus14 && !FD->isInvalidDecl() && Body && !FD->isDependentContext() && FD->getReturnType()->isUndeducedType()) { // If the function has a deduced result type but contains no 'return' // statements, the result type as written must be exactly 'auto', and diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index 18fda0314e90..49a5068ffac6 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -855,7 +855,7 @@ static bool CheckConstexprDeclStmt(Sema &SemaRef, const FunctionDecl *Dcl, // C++1y allows types to be defined, not just declared. if (cast(DclIt)->isThisDeclarationADefinition()) SemaRef.Diag(DS->getLocStart(), - SemaRef.getLangOpts().CPlusPlus1y + SemaRef.getLangOpts().CPlusPlus14 ? diag::warn_cxx11_compat_constexpr_type_definition : diag::ext_constexpr_type_definition) << isa(Dcl); @@ -896,7 +896,7 @@ static bool CheckConstexprDeclStmt(Sema &SemaRef, const FunctionDecl *Dcl, } } SemaRef.Diag(VD->getLocation(), - SemaRef.getLangOpts().CPlusPlus1y + SemaRef.getLangOpts().CPlusPlus14 ? diag::warn_cxx11_compat_constexpr_local_var : diag::ext_constexpr_local_var) << isa(Dcl); @@ -1041,7 +1041,7 @@ CheckConstexprFunctionStmt(Sema &SemaRef, const FunctionDecl *Dcl, Stmt *S, case Stmt::ContinueStmtClass: // C++1y allows all of these. We don't allow them as extensions in C++11, // because they don't make sense without variable mutation. - if (!SemaRef.getLangOpts().CPlusPlus1y) + if (!SemaRef.getLangOpts().CPlusPlus14) break; if (!Cxx1yLoc.isValid()) Cxx1yLoc = S->getLocStart(); @@ -1115,7 +1115,7 @@ bool Sema::CheckConstexprFunctionBody(const FunctionDecl *Dcl, Stmt *Body) { if (Cxx1yLoc.isValid()) Diag(Cxx1yLoc, - getLangOpts().CPlusPlus1y + getLangOpts().CPlusPlus14 ? diag::warn_cxx11_compat_constexpr_body_invalid_stmt : diag::ext_constexpr_body_invalid_stmt) << isa(Dcl); @@ -1180,7 +1180,7 @@ bool Sema::CheckConstexprFunctionBody(const FunctionDecl *Dcl, Stmt *Body) { // statement. We still do, unless the return type might be void, because // otherwise if there's no return statement, the function cannot // be used in a core constant expression. - bool OK = getLangOpts().CPlusPlus1y && + bool OK = getLangOpts().CPlusPlus14 && (Dcl->getReturnType()->isVoidType() || Dcl->getReturnType()->isDependentType()); Diag(Dcl->getLocation(), @@ -1190,7 +1190,7 @@ bool Sema::CheckConstexprFunctionBody(const FunctionDecl *Dcl, Stmt *Body) { } if (ReturnStmts.size() > 1) { Diag(ReturnStmts.back(), - getLangOpts().CPlusPlus1y + getLangOpts().CPlusPlus14 ? diag::warn_cxx11_compat_constexpr_body_multiple_return : diag::ext_constexpr_body_multiple_return); for (unsigned I = 0; I < ReturnStmts.size() - 1; ++I) @@ -4729,7 +4729,7 @@ static bool defaultedSpecialMemberIsConstexpr(Sema &S, CXXRecordDecl *ClassDecl, case Sema::CXXCopyAssignment: case Sema::CXXMoveAssignment: - if (!S.getLangOpts().CPlusPlus1y) + if (!S.getLangOpts().CPlusPlus14) return false; // In C++1y, we need to perform overload resolution. Ctor = false; @@ -4913,7 +4913,7 @@ void Sema::CheckExplicitlyDefaultedSpecialMember(CXXMethodDecl *MD) { // A defaulted special member cannot have cv-qualifiers. if (Type->getTypeQuals()) { Diag(MD->getLocation(), diag::err_defaulted_special_member_quals) - << (CSM == CXXMoveAssignment) << getLangOpts().CPlusPlus1y; + << (CSM == CXXMoveAssignment) << getLangOpts().CPlusPlus14; HadError = true; } } @@ -4962,7 +4962,7 @@ void Sema::CheckExplicitlyDefaultedSpecialMember(CXXMethodDecl *MD) { // destructors in C++1y), this is checked elsewhere. bool Constexpr = defaultedSpecialMemberIsConstexpr(*this, RD, CSM, HasConstParam); - if ((getLangOpts().CPlusPlus1y ? !isa(MD) + if ((getLangOpts().CPlusPlus14 ? !isa(MD) : isa(MD)) && MD->isConstexpr() && !Constexpr && MD->getTemplatedKind() == FunctionDecl::TK_NonTemplate) { diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 2041132f4bf5..b74429ab557f 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -59,7 +59,7 @@ bool Sema::CanUseDecl(NamedDecl *D) { // If the function has a deduced return type, and we can't deduce it, // then we can't use it either. - if (getLangOpts().CPlusPlus1y && FD->getReturnType()->isUndeducedType() && + if (getLangOpts().CPlusPlus14 && FD->getReturnType()->isUndeducedType() && DeduceReturnType(FD, SourceLocation(), /*Diagnose*/ false)) return false; } @@ -302,7 +302,7 @@ bool Sema::DiagnoseUseOfDecl(NamedDecl *D, SourceLocation Loc, // If the function has a deduced return type, and we can't deduce it, // then we can't use it either. - if (getLangOpts().CPlusPlus1y && FD->getReturnType()->isUndeducedType() && + if (getLangOpts().CPlusPlus14 && FD->getReturnType()->isUndeducedType() && DeduceReturnType(FD, Loc)) return true; } diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp index 49d1fdfb3f22..336740183b4b 100644 --- a/clang/lib/Sema/SemaExprCXX.cpp +++ b/clang/lib/Sema/SemaExprCXX.cpp @@ -1083,7 +1083,7 @@ Sema::ActOnCXXNew(SourceLocation StartLoc, bool UseGlobal, DeclaratorChunk::ArrayTypeInfo &Array = D.getTypeObject(I).Arr; if (Expr *NumElts = (Expr *)Array.NumElts) { if (!NumElts->isTypeDependent() && !NumElts->isValueDependent()) { - if (getLangOpts().CPlusPlus1y) { + if (getLangOpts().CPlusPlus14) { // C++1y [expr.new]p6: Every constant-expression in a noptr-new-declarator // shall be a converted constant expression (5.19) of type std::size_t // and shall evaluate to a strictly positive value. @@ -1257,7 +1257,7 @@ Sema::BuildCXXNew(SourceRange Range, bool UseGlobal, // std::size_t. if (ArraySize && !ArraySize->isTypeDependent()) { ExprResult ConvertedSize; - if (getLangOpts().CPlusPlus1y) { + if (getLangOpts().CPlusPlus14) { assert(Context.getTargetInfo().getIntWidth() && "Builtin type of size 0?"); ConvertedSize = PerformImplicitConversion(ArraySize, Context.getSizeType(), diff --git a/clang/lib/Sema/SemaLambda.cpp b/clang/lib/Sema/SemaLambda.cpp index 0cf4ed7c6081..6793bef75761 100644 --- a/clang/lib/Sema/SemaLambda.cpp +++ b/clang/lib/Sema/SemaLambda.cpp @@ -873,7 +873,7 @@ void Sema::ActOnStartOfLambdaDefinition(LambdaIntroducer &Intro, // We don't do this before C++1y, because we don't support deduced return // types there. QualType DefaultTypeForNoTrailingReturn = - getLangOpts().CPlusPlus1y ? Context.getAutoDeductType() + getLangOpts().CPlusPlus14 ? Context.getAutoDeductType() : Context.DependentTy; QualType MethodTy = Context.getFunctionType(DefaultTypeForNoTrailingReturn, None, EPI); @@ -999,7 +999,7 @@ void Sema::ActOnStartOfLambdaDefinition(LambdaIntroducer &Intro, VarDecl *Var = nullptr; if (C->Init.isUsable()) { - Diag(C->Loc, getLangOpts().CPlusPlus1y + Diag(C->Loc, getLangOpts().CPlusPlus14 ? diag::warn_cxx11_compat_init_capture : diag::ext_init_capture); @@ -1451,7 +1451,7 @@ ExprResult Sema::ActOnLambdaExpr(SourceLocation StartLoc, Stmt *Body, // different machinery. // FIXME: Refactor and Merge the return type deduction machinery. // FIXME: Assumes current resolution to core issue 975. - if (LSI->HasImplicitReturnType && !getLangOpts().CPlusPlus1y) { + if (LSI->HasImplicitReturnType && !getLangOpts().CPlusPlus14) { deduceClosureReturnType(*LSI); // - if there are no return statements in the diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp index 09469cea772e..448a77ecb2cc 100644 --- a/clang/lib/Sema/SemaOverload.cpp +++ b/clang/lib/Sema/SemaOverload.cpp @@ -1067,7 +1067,7 @@ bool Sema::IsOverload(FunctionDecl *New, FunctionDecl *Old, // is a redeclaration of OldMethod. unsigned OldQuals = OldMethod->getTypeQualifiers(); unsigned NewQuals = NewMethod->getTypeQualifiers(); - if (!getLangOpts().CPlusPlus1y && NewMethod->isConstexpr() && + if (!getLangOpts().CPlusPlus14 && NewMethod->isConstexpr() && !isa(NewMethod)) NewQuals |= Qualifiers::Const; @@ -5365,14 +5365,14 @@ ExprResult Sema::PerformContextualImplicitConversion( CXXConversionDecl *Conversion; FunctionTemplateDecl *ConvTemplate = dyn_cast(D); if (ConvTemplate) { - if (getLangOpts().CPlusPlus1y) + if (getLangOpts().CPlusPlus14) Conversion = cast(ConvTemplate->getTemplatedDecl()); else continue; // C++11 does not consider conversion operator templates(?). } else Conversion = cast(D); - assert((!ConvTemplate || getLangOpts().CPlusPlus1y) && + assert((!ConvTemplate || getLangOpts().CPlusPlus14) && "Conversion operator templates are considered potentially " "viable in C++1y"); @@ -5385,7 +5385,7 @@ ExprResult Sema::PerformContextualImplicitConversion( if (!ConvTemplate) ExplicitConversions.addDecl(I.getDecl(), I.getAccess()); } else { - if (!ConvTemplate && getLangOpts().CPlusPlus1y) { + if (!ConvTemplate && getLangOpts().CPlusPlus14) { if (ToType.isNull()) ToType = CurToType.getUnqualifiedType(); else if (HasUniqueTargetType && @@ -5397,7 +5397,7 @@ ExprResult Sema::PerformContextualImplicitConversion( } } - if (getLangOpts().CPlusPlus1y) { + if (getLangOpts().CPlusPlus14) { // C++1y [conv]p6: // ... An expression e of class type E appearing in such a context // is said to be contextually implicitly converted to a specified @@ -6165,7 +6165,7 @@ Sema::AddConversionCandidate(CXXConversionDecl *Conversion, // If the conversion function has an undeduced return type, trigger its // deduction now. - if (getLangOpts().CPlusPlus1y && ConvType->isUndeducedType()) { + if (getLangOpts().CPlusPlus14 && ConvType->isUndeducedType()) { if (DeduceReturnType(Conversion, From->getExprLoc())) return; ConvType = Conversion->getConversionType().getNonReferenceType(); @@ -9865,7 +9865,7 @@ private: // If any candidate has a placeholder return type, trigger its deduction // now. - if (S.getLangOpts().CPlusPlus1y && + if (S.getLangOpts().CPlusPlus14 && FunDecl->getReturnType()->isUndeducedType() && S.DeduceReturnType(FunDecl, SourceExpr->getLocStart(), Complain)) return false; @@ -10170,7 +10170,7 @@ Sema::ResolveSingleFunctionTemplateSpecialization(OverloadExpr *ovl, if (FoundResult) *FoundResult = I.getPair(); } - if (Matched && getLangOpts().CPlusPlus1y && + if (Matched && getLangOpts().CPlusPlus14 && Matched->getReturnType()->isUndeducedType() && DeduceReturnType(Matched, ovl->getExprLoc(), Complain)) return nullptr; diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp index 78c3c5663486..ab0bfcd9f904 100644 --- a/clang/lib/Sema/SemaStmt.cpp +++ b/clang/lib/Sema/SemaStmt.cpp @@ -2855,7 +2855,7 @@ StmtResult Sema::BuildReturnStmt(SourceLocation ReturnLoc, Expr *RetValExp) { // FIXME: Add a flag to the ScopeInfo to indicate whether we're performing // deduction. - if (getLangOpts().CPlusPlus1y) { + if (getLangOpts().CPlusPlus14) { if (AutoType *AT = FnRetType->getContainedAutoType()) { FunctionDecl *FD = cast(CurContext); if (DeduceFunctionTypeFromReturnExpr(FD, ReturnLoc, RetValExp, AT)) { diff --git a/clang/lib/Sema/SemaTemplateDeduction.cpp b/clang/lib/Sema/SemaTemplateDeduction.cpp index 5d543e9e7588..0bfc7693feaf 100644 --- a/clang/lib/Sema/SemaTemplateDeduction.cpp +++ b/clang/lib/Sema/SemaTemplateDeduction.cpp @@ -3003,7 +3003,7 @@ Sema::FinishTemplateArgumentDeduction(FunctionTemplateDecl *FunctionTemplate, static QualType GetTypeOfFunction(Sema &S, const OverloadExpr::FindResult &R, FunctionDecl *Fn) { // We may need to deduce the return type of the function now. - if (S.getLangOpts().CPlusPlus1y && Fn->getReturnType()->isUndeducedType() && + if (S.getLangOpts().CPlusPlus14 && Fn->getReturnType()->isUndeducedType() && S.DeduceReturnType(Fn, R.Expression->getExprLoc(), /*Diagnose*/ false)) return QualType(); @@ -3582,7 +3582,7 @@ Sema::DeduceTemplateArguments(FunctionTemplateDecl *FunctionTemplate, // If the function has a deduced return type, substitute it for a dependent // type so that we treat it as a non-deduced context in what follows. bool HasDeducedReturnType = false; - if (getLangOpts().CPlusPlus1y && InOverloadResolution && + if (getLangOpts().CPlusPlus14 && InOverloadResolution && Function->getReturnType()->getContainedAutoType()) { FunctionType = SubstAutoType(FunctionType, Context.DependentTy); HasDeducedReturnType = true; diff --git a/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp index 029d2c2806cf..c7915d3291a9 100644 --- a/clang/lib/Sema/SemaType.cpp +++ b/clang/lib/Sema/SemaType.cpp @@ -763,7 +763,7 @@ static QualType ConvertDeclSpecToType(TypeProcessingState &state) { // is inferred from the return statements inside the block. // The declspec is always missing in a lambda expr context; it is either // specified with a trailing return type or inferred. - if (S.getLangOpts().CPlusPlus1y && + if (S.getLangOpts().CPlusPlus14 && declarator.getContext() == Declarator::LambdaExprContext) { // In C++1y, a lambda's implicit return type is 'auto'. Result = Context.getAutoDeductType(); @@ -2175,7 +2175,7 @@ static QualType GetDeclSpecTypeForDeclarator(TypeProcessingState &state, Error = 0; break; case Declarator::LambdaExprParameterContext: - if (!(SemaRef.getLangOpts().CPlusPlus1y + if (!(SemaRef.getLangOpts().CPlusPlus14 && D.getDeclSpec().getTypeSpecType() == DeclSpec::TST_auto)) Error = 14; break; @@ -2208,11 +2208,11 @@ static QualType GetDeclSpecTypeForDeclarator(TypeProcessingState &state, Error = 10; // Type alias break; case Declarator::TrailingReturnContext: - if (!SemaRef.getLangOpts().CPlusPlus1y) + if (!SemaRef.getLangOpts().CPlusPlus14) Error = 11; // Function return type break; case Declarator::ConversionIdContext: - if (!SemaRef.getLangOpts().CPlusPlus1y) + if (!SemaRef.getLangOpts().CPlusPlus14) Error = 12; // conversion-type-id break; case Declarator::TypeNameContext: @@ -2697,7 +2697,7 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state, // and not, for instance, a pointer to a function. if (D.getDeclSpec().containsPlaceholderType() && !FTI.hasTrailingReturnType() && chunkIndex == 0 && - !S.getLangOpts().CPlusPlus1y) { + !S.getLangOpts().CPlusPlus14) { S.Diag(D.getDeclSpec().getTypeSpecTypeLoc(), D.getDeclSpec().getTypeSpecType() == DeclSpec::TST_auto ? diag::err_auto_missing_trailing_return diff --git a/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p1.cpp b/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p1.cpp index 08fefdc91fb5..35dbec93e5bb 100644 --- a/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p1.cpp +++ b/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p1.cpp @@ -71,7 +71,7 @@ struct ConstexprDtor { template constexpr T ft(T t) { return t; } template T gt(T t) { return t; } struct S { - template constexpr T f(); // expected-warning {{C++1y}} + template constexpr T f(); // expected-warning {{C++14}} template T g() const; // expected-note-re {{candidate template ignored: could not match 'T (){{( __attribute__\(\(thiscall\)\))?}} const' against 'char (){{( __attribute__\(\(thiscall\)\))?}}'}} }; @@ -82,7 +82,7 @@ template <> char ft(char c) { return c; } // expected-note {{previous}} template <> constexpr char ft(char nl); // expected-error {{constexpr declaration of 'ft' follows non-constexpr declaration}} template <> constexpr int gt(int nl) { return nl; } template <> notlit S::f() const { return notlit(); } -template <> constexpr int S::g() { return 0; } // expected-note {{previous}} expected-warning {{C++1y}} +template <> constexpr int S::g() { return 0; } // expected-note {{previous}} expected-warning {{C++14}} template <> int S::g() const; // expected-error {{non-constexpr declaration of 'g' follows constexpr declaration}} // specializations can drop the 'constexpr' but not the implied 'const'. template <> char S::g() { return 0; } // expected-error {{no function template matches}} diff --git a/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p3.cpp b/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p3.cpp index 780a420959d6..448351be0c61 100644 --- a/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p3.cpp +++ b/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p3.cpp @@ -21,7 +21,7 @@ struct Literal { struct S { virtual int ImplicitlyVirtual() const = 0; // expected-note {{overridden virtual function}} }; -struct SS : S { +struct SS : S { int ImplicitlyVirtual() const; }; @@ -62,7 +62,7 @@ struct T : SS, NonLiteral { // expected-note {{base class 'NonLiteral' of non-li constexpr T &operator=(const T&) = default; #ifndef CXX1Y // expected-error@-2 {{an explicitly-defaulted copy assignment operator may not have 'const', 'constexpr' or 'volatile' qualifiers}} - // expected-warning@-3 {{C++1y}} + // expected-warning@-3 {{C++14}} #else // expected-error@-5 {{defaulted definition of copy assignment operator is not constexpr}} #endif @@ -161,21 +161,21 @@ constexpr int ForStmt() { constexpr int VarDecl() { int a = 0; #ifndef CXX1Y - // expected-error@-2 {{variable declaration in a constexpr function is a C++1y extension}} + // expected-error@-2 {{variable declaration in a constexpr function is a C++14 extension}} #endif return 0; } constexpr int ConstexprVarDecl() { constexpr int a = 0; #ifndef CXX1Y - // expected-error@-2 {{variable declaration in a constexpr function is a C++1y extension}} + // expected-error@-2 {{variable declaration in a constexpr function is a C++14 extension}} #endif return 0; } constexpr int VarWithCtorDecl() { Literal a; #ifndef CXX1Y - // expected-error@-2 {{variable declaration in a constexpr function is a C++1y extension}} + // expected-error@-2 {{variable declaration in a constexpr function is a C++14 extension}} #endif return 0; } @@ -183,7 +183,7 @@ NonLiteral nl; constexpr NonLiteral &ExternNonLiteralVarDecl() { extern NonLiteral nl; #ifndef CXX1Y - // expected-error@-2 {{variable declaration in a constexpr function is a C++1y extension}} + // expected-error@-2 {{variable declaration in a constexpr function is a C++14 extension}} #endif return nl; } @@ -191,28 +191,28 @@ static_assert(&ExternNonLiteralVarDecl() == &nl, ""); constexpr int FuncDecl() { constexpr int ForwardDecl(int); #ifndef CXX1Y - // expected-error@-2 {{use of this statement in a constexpr function is a C++1y extension}} + // expected-error@-2 {{use of this statement in a constexpr function is a C++14 extension}} #endif return ForwardDecl(42); } constexpr int ClassDecl1() { typedef struct { } S1; #ifndef CXX1Y - // expected-error@-2 {{type definition in a constexpr function is a C++1y extension}} + // expected-error@-2 {{type definition in a constexpr function is a C++14 extension}} #endif return 0; } constexpr int ClassDecl2() { using S2 = struct { }; #ifndef CXX1Y - // expected-error@-2 {{type definition in a constexpr function is a C++1y extension}} + // expected-error@-2 {{type definition in a constexpr function is a C++14 extension}} #endif return 0; } constexpr int ClassDecl3() { struct S3 { }; #ifndef CXX1Y - // expected-error@-2 {{type definition in a constexpr function is a C++1y extension}} + // expected-error@-2 {{type definition in a constexpr function is a C++14 extension}} #endif return 0; } @@ -245,11 +245,11 @@ namespace DR1364 { namespace rdar13584715 { typedef __PTRDIFF_TYPE__ ptrdiff_t; - + template struct X { static T value() {}; }; - + void foo(ptrdiff_t id) { switch (id) { case reinterpret_cast(&X::value): // expected-error{{case value is not a constant expression}} \ @@ -269,7 +269,7 @@ namespace std_example { constexpr int abs(int x) { if (x < 0) #ifndef CXX1Y - // expected-error@-2 {{C++1y}} + // expected-error@-2 {{C++14}} #endif x = -x; return x; @@ -295,7 +295,7 @@ namespace std_example { return r; } #ifndef CXX1Y - // expected-error@-5 {{C++1y}} + // expected-error@-5 {{C++14}} // expected-error@-5 {{statement not allowed}} #endif } diff --git a/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p4.cpp b/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p4.cpp index 708c259d5b61..9c1cab54b617 100644 --- a/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p4.cpp +++ b/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p4.cpp @@ -92,37 +92,37 @@ struct V { constexpr V(int(&)[2]) { constexpr int a = 0; #ifndef CXX1Y - // expected-error@-2 {{variable declaration in a constexpr constructor is a C++1y extension}} + // expected-error@-2 {{variable declaration in a constexpr constructor is a C++14 extension}} #endif } constexpr V(int(&)[3]) { constexpr int ForwardDecl(int); #ifndef CXX1Y - // expected-error@-2 {{use of this statement in a constexpr constructor is a C++1y extension}} + // expected-error@-2 {{use of this statement in a constexpr constructor is a C++14 extension}} #endif } constexpr V(int(&)[4]) { typedef struct { } S1; #ifndef CXX1Y - // expected-error@-2 {{type definition in a constexpr constructor is a C++1y extension}} + // expected-error@-2 {{type definition in a constexpr constructor is a C++14 extension}} #endif } constexpr V(int(&)[5]) { using S2 = struct { }; #ifndef CXX1Y - // expected-error@-2 {{type definition in a constexpr constructor is a C++1y extension}} + // expected-error@-2 {{type definition in a constexpr constructor is a C++14 extension}} #endif } constexpr V(int(&)[6]) { struct S3 { }; #ifndef CXX1Y - // expected-error@-2 {{type definition in a constexpr constructor is a C++1y extension}} + // expected-error@-2 {{type definition in a constexpr constructor is a C++14 extension}} #endif } constexpr V(int(&)[7]) { return; #ifndef CXX1Y - // expected-error@-2 {{use of this statement in a constexpr constructor is a C++1y extension}} + // expected-error@-2 {{use of this statement in a constexpr constructor is a C++14 extension}} #endif } }; diff --git a/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p5.cpp b/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p5.cpp index 5e40f69d77ba..48973237ea0b 100644 --- a/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p5.cpp +++ b/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p5.cpp @@ -102,7 +102,7 @@ X x = cmin(X(), X()); // ok, not constexpr template struct Y { constexpr Y() {} - constexpr int get() { return T(); } // expected-warning {{C++1y}} + constexpr int get() { return T(); } // expected-warning {{C++14}} }; struct Z { operator int(); }; diff --git a/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p8.cpp b/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p8.cpp index 40aa600ba1f7..21e4a23731b7 100644 --- a/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p8.cpp +++ b/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p8.cpp @@ -3,13 +3,13 @@ using size_t = decltype(sizeof(int)); struct S { - constexpr int f(); // expected-warning {{C++1y}} + constexpr int f(); // expected-warning {{C++14}} constexpr int g() const; - constexpr int h(); // expected-warning {{C++1y}} + constexpr int h(); // expected-warning {{C++14}} int h(); static constexpr int Sf(); /*static*/ constexpr void *operator new(size_t) noexcept; - template constexpr T tm(); // expected-warning {{C++1y}} + template constexpr T tm(); // expected-warning {{C++14}} template static constexpr T ts(); }; @@ -26,12 +26,12 @@ void f(const S &s) { } constexpr int S::f() const { return 0; } -constexpr int S::g() { return 1; } // expected-warning {{C++1y}} -constexpr int S::h() { return 0; } // expected-warning {{C++1y}} +constexpr int S::g() { return 1; } // expected-warning {{C++14}} +constexpr int S::h() { return 0; } // expected-warning {{C++14}} int S::h() { return 0; } constexpr int S::Sf() { return 2; } constexpr void *S::operator new(size_t) noexcept { return 0; } -template constexpr T S::tm() { return T(); } // expected-warning {{C++1y}} +template constexpr T S::tm() { return T(); } // expected-warning {{C++14}} template constexpr T S::ts() { return T(); } namespace std_example { diff --git a/clang/test/CXX/temp/temp.decls/temp.class/temp.static/p1.cpp b/clang/test/CXX/temp/temp.decls/temp.class/temp.static/p1.cpp index 8a3168e5f806..b0305dd756a6 100644 --- a/clang/test/CXX/temp/temp.decls/temp.class/temp.static/p1.cpp +++ b/clang/test/CXX/temp/temp.decls/temp.class/temp.static/p1.cpp @@ -8,7 +8,7 @@ struct X0 { template T X0::value = 0; // expected-error{{no viable conversion}} -struct X1 { +struct X1 { X1(int); }; @@ -19,8 +19,8 @@ X1& get_X1() { return X0::value; } double*& get_double_ptr() { return X0::value; } // expected-error{{non-const lvalue reference to type 'double *' cannot bind to a value of unrelated type 'int *'}} -X2& get_X2() { +X2& get_X2() { return X0::value; // expected-note{{instantiation}} } - -template T x; // expected-warning{{variable templates are a C++1y extension}} + +template T x; // expected-warning{{variable templates are a C++14 extension}} diff --git a/clang/test/CXX/temp/temp.spec/temp.explicit/p1-0x.cpp b/clang/test/CXX/temp/temp.spec/temp.explicit/p1-0x.cpp index f804d4db1299..580ef3151e5d 100644 --- a/clang/test/CXX/temp/temp.spec/temp.explicit/p1-0x.cpp +++ b/clang/test/CXX/temp/temp.spec/temp.explicit/p1-0x.cpp @@ -9,7 +9,7 @@ template inline void X::f(); // expected-error{{explicit instantiation cann template struct Y { - constexpr int f() { return 0; } // expected-warning{{C++1y}} + constexpr int f() { return 0; } // expected-warning{{C++14}} }; template constexpr int Y::f() const; // expected-error{{explicit instantiation cannot be 'constexpr'}} diff --git a/clang/test/FixIt/fixit-cxx1y-compat.cpp b/clang/test/FixIt/fixit-cxx1y-compat.cpp index 9fd5ff26e558..819e3984c352 100644 --- a/clang/test/FixIt/fixit-cxx1y-compat.cpp +++ b/clang/test/FixIt/fixit-cxx1y-compat.cpp @@ -7,6 +7,6 @@ // This is a test of the code modification hints for C++1y-compatibility problems. struct S { - constexpr int &f(); // expected-warning {{'constexpr' non-static member function will not be implicitly 'const' in C++1y; add 'const' to avoid a change in behavior}} + constexpr int &f(); // expected-warning {{'constexpr' non-static member function will not be implicitly 'const' in C++14; add 'const' to avoid a change in behavior}} int &f(); }; diff --git a/clang/test/SemaCXX/constant-expression-cxx11.cpp b/clang/test/SemaCXX/constant-expression-cxx11.cpp index 86c2c110f437..57ca725d910e 100644 --- a/clang/test/SemaCXX/constant-expression-cxx11.cpp +++ b/clang/test/SemaCXX/constant-expression-cxx11.cpp @@ -1443,7 +1443,7 @@ namespace InvalidClasses { namespace NamespaceAlias { constexpr int f() { - namespace NS = NamespaceAlias; // expected-warning {{use of this statement in a constexpr function is a C++1y extension}} + namespace NS = NamespaceAlias; // expected-warning {{use of this statement in a constexpr function is a C++14 extension}} return &NS::f != nullptr; } } @@ -1700,7 +1700,7 @@ namespace VirtualFromBase { template struct X : T { constexpr X() {} double d = 0.0; - constexpr int f() { return sizeof(T); } // expected-warning {{will not be implicitly 'const' in C++1y}} + constexpr int f() { return sizeof(T); } // expected-warning {{will not be implicitly 'const' in C++14}} }; // Virtual f(), not OK. @@ -1715,17 +1715,17 @@ namespace VirtualFromBase { } namespace ConstexprConstructorRecovery { - class X { - public: - enum E : short { - headers = 0x1, - middlefile = 0x2, - choices = 0x4 - }; - constexpr X() noexcept {}; - protected: + class X { + public: + enum E : short { + headers = 0x1, + middlefile = 0x2, + choices = 0x4 + }; + constexpr X() noexcept {}; + protected: E val{0}; // expected-error {{cannot initialize a member subobject of type 'ConstexprConstructorRecovery::X::E' with an rvalue of type 'int'}} - }; + }; constexpr X x{}; } diff --git a/clang/test/SemaCXX/cxx0x-compat.cpp b/clang/test/SemaCXX/cxx0x-compat.cpp index a58a7f875cdb..ded51ab704b9 100644 --- a/clang/test/SemaCXX/cxx0x-compat.cpp +++ b/clang/test/SemaCXX/cxx0x-compat.cpp @@ -43,7 +43,7 @@ char c = 'x'_x; // expected-warning {{will be treated as a user-defined literal #else -auto init_capture = [a(0)] {}; // expected-warning {{initialized lambda captures are incompatible with C++ standards before C++1y}} +auto init_capture = [a(0)] {}; // expected-warning {{initialized lambda captures are incompatible with C++ standards before C++14}} static_assert(true); // expected-warning {{incompatible with C++ standards before C++1z}} #endif diff --git a/clang/test/SemaCXX/cxx1y-constexpr-not-const.cpp b/clang/test/SemaCXX/cxx1y-constexpr-not-const.cpp index 3f100b8b691e..071b39c7fb39 100644 --- a/clang/test/SemaCXX/cxx1y-constexpr-not-const.cpp +++ b/clang/test/SemaCXX/cxx1y-constexpr-not-const.cpp @@ -14,5 +14,5 @@ struct X { // expected-error@6 {{non-constexpr declaration of 'f' follows constexpr declaration}} // expected-note@5 {{previous}} #else -// expected-warning@5 {{'constexpr' non-static member function will not be implicitly 'const' in C++1y; add 'const' to avoid a change in behavior}} +// expected-warning@5 {{'constexpr' non-static member function will not be implicitly 'const' in C++14; add 'const' to avoid a change in behavior}} #endif diff --git a/clang/test/SemaCXX/cxx98-compat-pedantic.cpp b/clang/test/SemaCXX/cxx98-compat-pedantic.cpp index b74dcb4238ae..9eb0da33f3f6 100644 --- a/clang/test/SemaCXX/cxx98-compat-pedantic.cpp +++ b/clang/test/SemaCXX/cxx98-compat-pedantic.cpp @@ -49,5 +49,5 @@ unsigned long long ull1 = // expected-warning {{'long long' is incompatible with int k = 0b1001; #ifdef CXX1Y -// expected-warning@-2 {{binary integer literals are incompatible with C++ standards before C++1y}} +// expected-warning@-2 {{binary integer literals are incompatible with C++ standards before C++14}} #endif diff --git a/clang/test/SemaCXX/cxx98-compat.cpp b/clang/test/SemaCXX/cxx98-compat.cpp index 96af95425aec..4fad458f8ff2 100644 --- a/clang/test/SemaCXX/cxx98-compat.cpp +++ b/clang/test/SemaCXX/cxx98-compat.cpp @@ -1,5 +1,5 @@ // RUN: %clang_cc1 -fsyntax-only -std=c++11 -Wc++98-compat -verify %s -// RUN: %clang_cc1 -fsyntax-only -std=c++1y -Wc++98-compat -verify %s -DCXX1YCOMPAT +// RUN: %clang_cc1 -fsyntax-only -std=c++1y -Wc++98-compat -verify %s -DCXX14COMPAT namespace std { struct type_info; @@ -373,10 +373,10 @@ namespace rdar11736429 { } template T var = T(10); -#ifdef CXX1YCOMPAT -// expected-warning@-2 {{variable templates are incompatible with C++ standards before C++1y}} +#ifdef CXX14COMPAT +// expected-warning@-2 {{variable templates are incompatible with C++ standards before C++14}} #else -// expected-warning@-4 {{variable templates are a C++1y extension}} +// expected-warning@-4 {{variable templates are a C++14 extension}} #endif // No diagnostic for specializations of variable templates; we will have @@ -388,27 +388,27 @@ float fvar = var; class A { template static T var = T(10); -#ifdef CXX1YCOMPAT -// expected-warning@-2 {{variable templates are incompatible with C++ standards before C++1y}} +#ifdef CXX14COMPAT +// expected-warning@-2 {{variable templates are incompatible with C++ standards before C++14}} #else -// expected-warning@-4 {{variable templates are a C++1y extension}} +// expected-warning@-4 {{variable templates are a C++14 extension}} #endif - template static T* var = new T(); + template static T* var = new T(); }; struct B { template static T v; }; -#ifdef CXX1YCOMPAT -// expected-warning@-2 {{variable templates are incompatible with C++ standards before C++1y}} +#ifdef CXX14COMPAT +// expected-warning@-2 {{variable templates are incompatible with C++ standards before C++14}} #else -// expected-warning@-4 {{variable templates are a C++1y extension}} +// expected-warning@-4 {{variable templates are a C++14 extension}} #endif template T B::v = T(); -#ifdef CXX1YCOMPAT -// expected-warning@-2 {{variable templates are incompatible with C++ standards before C++1y}} +#ifdef CXX14COMPAT +// expected-warning@-2 {{variable templates are incompatible with C++ standards before C++14}} #else -// expected-warning@-4 {{variable templates are a C++1y extension}} +// expected-warning@-4 {{variable templates are a C++14 extension}} #endif template T* B::v = new T(); @@ -416,6 +416,6 @@ template<> int B::v = 10; template int B::v; float fsvar = B::v; -#ifdef CXX1YCOMPAT -int digit_seps = 123'456; // expected-warning {{digit separators are incompatible with C++ standards before C++1y}} +#ifdef CXX14COMPAT +int digit_seps = 123'456; // expected-warning {{digit separators are incompatible with C++ standards before C++14}} #endif diff --git a/clang/test/SemaCXX/trailing-return-0x.cpp b/clang/test/SemaCXX/trailing-return-0x.cpp index cf5e659660eb..c6b22c54be0c 100644 --- a/clang/test/SemaCXX/trailing-return-0x.cpp +++ b/clang/test/SemaCXX/trailing-return-0x.cpp @@ -17,8 +17,8 @@ auto f() -> int return 0; } -auto g(); // expected-error{{return without trailing return type; deduced return types are a C++1y extension}} -decltype(auto) g2(); // expected-warning{{extension}} expected-error-re{{{{^}}deduced return types are a C++1y extension}} +auto g(); // expected-error{{return without trailing return type; deduced return types are a C++14 extension}} +decltype(auto) g2(); // expected-warning{{extension}} expected-error-re{{{{^}}deduced return types are a C++14 extension}} auto badness = g2(); int h() -> int; // expected-error{{trailing return type must specify return type 'auto', not 'int'}} @@ -75,14 +75,14 @@ only p4 = xx.get_nested().h(0L, 1.0, 3.14f); namespace PR12053 { template auto f1(T t) -> decltype(f1(t)) {} // expected-note{{candidate template ignored}} - + void test_f1() { f1(0); // expected-error{{no matching function for call to 'f1'}} } - + template auto f2(T t) -> decltype(f2(&t)) {} // expected-note{{candidate template ignored}} - + void test_f2() { f2(0); // expected-error{{no matching function for call to 'f2'}} } diff --git a/clang/test/SemaCXX/unknown-type-name.cpp b/clang/test/SemaCXX/unknown-type-name.cpp index f2c84df242ff..9d28c310ed97 100644 --- a/clang/test/SemaCXX/unknown-type-name.cpp +++ b/clang/test/SemaCXX/unknown-type-name.cpp @@ -27,7 +27,7 @@ int var(zepelin); // expected-error{{did you mean 'zeppelin'?}} template struct A { typedef T type; - + type f(); type g(); @@ -93,14 +93,14 @@ template int A::h(T::type x, char) {} // expected-error{{missing template int h(T::type, int); // expected-error{{missing 'typename'}} template int h(T::type x, char); // expected-error{{missing 'typename'}} -template int junk1(T::junk); // expected-warning{{variable templates are a C++1y extension}} +template int junk1(T::junk); // expected-warning{{variable templates are a C++14 extension}} template int junk2(T::junk) throw(); // expected-error{{missing 'typename'}} template int junk3(T::junk) = delete; // expected-error{{missing 'typename'}} expected-warning{{C++11}} template int junk4(T::junk j); // expected-error{{missing 'typename'}} // FIXME: We can tell this was intended to be a function because it does not // have a dependent nested name specifier. -template int i(T::type, int()); // expected-warning{{variable templates are a C++1y extension}} +template int i(T::type, int()); // expected-warning{{variable templates are a C++14 extension}} // FIXME: We know which type specifier should have been specified here. Provide // a fix-it to add 'typename A::type' diff --git a/clang/test/SemaTemplate/class-template-decl.cpp b/clang/test/SemaTemplate/class-template-decl.cpp index b721aab35464..c67361bfeafb 100644 --- a/clang/test/SemaTemplate/class-template-decl.cpp +++ b/clang/test/SemaTemplate/class-template-decl.cpp @@ -57,7 +57,7 @@ void f() { template class X; // expected-error{{expression}} } -template class X1 var; // expected-warning{{variable templates are a C++1y extension}} \ +template class X1 var; // expected-warning{{variable templates are a C++14 extension}} \ // expected-error {{variable has incomplete type 'class X1'}} \ // expected-note {{forward declaration of 'X1'}}