diff options
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r-- | clang/lib/Sema/Sema.cpp | 6 | ||||
-rw-r--r-- | clang/lib/Sema/SemaChecking.cpp | 4 | ||||
-rw-r--r-- | clang/lib/Sema/SemaCodeComplete.cpp | 16 | ||||
-rw-r--r-- | clang/lib/Sema/SemaCoroutine.cpp | 22 | ||||
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 8 | ||||
-rw-r--r-- | clang/lib/Sema/SemaDeclCXX.cpp | 32 | ||||
-rw-r--r-- | clang/lib/Sema/SemaDeclObjC.cpp | 5 | ||||
-rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 24 | ||||
-rw-r--r-- | clang/lib/Sema/SemaExprObjC.cpp | 12 | ||||
-rw-r--r-- | clang/lib/Sema/SemaInit.cpp | 21 | ||||
-rw-r--r-- | clang/lib/Sema/SemaLambda.cpp | 10 | ||||
-rw-r--r-- | clang/lib/Sema/SemaLookup.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Sema/SemaObjCProperty.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Sema/SemaOpenACC.cpp | 3 | ||||
-rw-r--r-- | clang/lib/Sema/SemaOpenMP.cpp | 8 | ||||
-rw-r--r-- | clang/lib/Sema/SemaOverload.cpp | 24 | ||||
-rw-r--r-- | clang/lib/Sema/SemaPseudoObject.cpp | 8 | ||||
-rw-r--r-- | clang/lib/Sema/SemaStmt.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Sema/SemaTemplate.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Sema/SemaTemplateDeductionGuide.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Sema/SemaTemplateInstantiate.cpp | 8 | ||||
-rw-r--r-- | clang/lib/Sema/SemaType.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Sema/TreeTransform.h | 19 |
23 files changed, 113 insertions, 129 deletions
diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp index 5e9886a..2b51765 100644 --- a/clang/lib/Sema/Sema.cpp +++ b/clang/lib/Sema/Sema.cpp @@ -2536,8 +2536,8 @@ bool Sema::tryExprAsCall(Expr &E, QualType &ZeroArgCallReturnTy, // with default arguments, etc. if (IsMemExpr && !E.isTypeDependent()) { Sema::TentativeAnalysisScope Trap(*this); - ExprResult R = BuildCallToMemberFunction(nullptr, &E, SourceLocation(), - std::nullopt, SourceLocation()); + ExprResult R = BuildCallToMemberFunction(nullptr, &E, SourceLocation(), {}, + SourceLocation()); if (R.isUsable()) { ZeroArgCallReturnTy = R.get()->getType(); return true; @@ -2689,7 +2689,7 @@ bool Sema::tryToRecoverWithCall(ExprResult &E, const PartialDiagnostic &PD, // FIXME: Try this before emitting the fixit, and suppress diagnostics // while doing so. - E = BuildCallExpr(nullptr, E.get(), Range.getEnd(), std::nullopt, + E = BuildCallExpr(nullptr, E.get(), Range.getEnd(), {}, Range.getEnd().getLocWithOffset(1)); return true; } diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp index 2bcb930..27b274d 100644 --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/lib/Sema/SemaChecking.cpp @@ -6300,7 +6300,7 @@ public: EmitFormatDiagnostic(Sema &S, bool inFunctionCall, const Expr *ArgumentExpr, const PartialDiagnostic &PDiag, SourceLocation StringLoc, bool IsStringLocation, Range StringRange, - ArrayRef<FixItHint> Fixit = std::nullopt); + ArrayRef<FixItHint> Fixit = {}); protected: bool HandleInvalidConversionSpecifier(unsigned argIndex, SourceLocation Loc, @@ -6327,7 +6327,7 @@ protected: template <typename Range> void EmitFormatDiagnostic(PartialDiagnostic PDiag, SourceLocation StringLoc, bool IsStringLocation, Range StringRange, - ArrayRef<FixItHint> Fixit = std::nullopt); + ArrayRef<FixItHint> Fixit = {}); }; } // namespace diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp index 3e31f3d..16a76ff 100644 --- a/clang/lib/Sema/SemaCodeComplete.cpp +++ b/clang/lib/Sema/SemaCodeComplete.cpp @@ -4567,8 +4567,7 @@ void SemaCodeCompletion::CodeCompleteDeclSpec(Scope *S, DeclSpec &DS, 0) { ParsedType T = DS.getRepAsType(); if (!T.get().isNull() && T.get()->isObjCObjectOrInterfaceType()) - AddClassMessageCompletions(SemaRef, S, T, std::nullopt, false, false, - Results); + AddClassMessageCompletions(SemaRef, S, T, {}, false, false, Results); } // Note that we intentionally suppress macro results here, since we do not @@ -4931,7 +4930,7 @@ void SemaCodeCompletion::CodeCompletePostfixExpression(Scope *S, ExprResult E, if (E.isInvalid()) CodeCompleteExpression(S, PreferredType); else if (getLangOpts().ObjC) - CodeCompleteObjCInstanceMessage(S, E.get(), std::nullopt, false); + CodeCompleteObjCInstanceMessage(S, E.get(), {}, false); } /// The set of properties that have already been added, referenced by @@ -7747,8 +7746,8 @@ void SemaCodeCompletion::CodeCompleteObjCPropertyGetter(Scope *S) { Results.EnterNewScope(); VisitedSelectorSet Selectors; - AddObjCMethods(Class, true, MK_ZeroArgSelector, std::nullopt, - SemaRef.CurContext, Selectors, + AddObjCMethods(Class, true, MK_ZeroArgSelector, {}, SemaRef.CurContext, + Selectors, /*AllowSameLength=*/true, Results); Results.ExitScope(); HandleCodeCompleteResults(&SemaRef, CodeCompleter, @@ -7776,8 +7775,8 @@ void SemaCodeCompletion::CodeCompleteObjCPropertySetter(Scope *S) { Results.EnterNewScope(); VisitedSelectorSet Selectors; - AddObjCMethods(Class, true, MK_OneArgSelector, std::nullopt, - SemaRef.CurContext, Selectors, + AddObjCMethods(Class, true, MK_OneArgSelector, {}, SemaRef.CurContext, + Selectors, /*AllowSameLength=*/true, Results); Results.ExitScope(); @@ -8075,8 +8074,7 @@ void SemaCodeCompletion::CodeCompleteObjCMessageReceiver(Scope *S) { if (Iface->getSuperClass()) { Results.AddResult(Result("super")); - AddSuperSendCompletion(SemaRef, /*NeedSuperKeyword=*/true, std::nullopt, - Results); + AddSuperSendCompletion(SemaRef, /*NeedSuperKeyword=*/true, {}, Results); } if (getLangOpts().CPlusPlus11) diff --git a/clang/lib/Sema/SemaCoroutine.cpp b/clang/lib/Sema/SemaCoroutine.cpp index 89a0bea..3724aaf 100644 --- a/clang/lib/Sema/SemaCoroutine.cpp +++ b/clang/lib/Sema/SemaCoroutine.cpp @@ -341,7 +341,7 @@ static Expr *maybeTailCall(Sema &S, QualType RetType, Expr *E, // EvaluateBinaryTypeTrait(BTT_IsConvertible, ...) which is at the moment // a private function in SemaExprCXX.cpp - ExprResult AddressExpr = buildMemberCall(S, E, Loc, "address", std::nullopt); + ExprResult AddressExpr = buildMemberCall(S, E, Loc, "address", {}); if (AddressExpr.isInvalid()) return nullptr; @@ -392,8 +392,8 @@ static ReadySuspendResumeResult buildCoawaitCalls(Sema &S, VarDecl *CoroPromise, return Result.get(); }; - CallExpr *AwaitReady = cast_or_null<CallExpr>( - BuildSubExpr(ACT::ACT_Ready, "await_ready", std::nullopt)); + CallExpr *AwaitReady = + cast_or_null<CallExpr>(BuildSubExpr(ACT::ACT_Ready, "await_ready", {})); if (!AwaitReady) return Calls; if (!AwaitReady->getType()->isDependentType()) { @@ -454,7 +454,7 @@ static ReadySuspendResumeResult buildCoawaitCalls(Sema &S, VarDecl *CoroPromise, } } - BuildSubExpr(ACT::ACT_Resume, "await_resume", std::nullopt); + BuildSubExpr(ACT::ACT_Resume, "await_resume", {}); // Make sure the awaiter object gets a chance to be cleaned up. S.Cleanup.setExprNeedsCleanups(true); @@ -722,8 +722,8 @@ bool Sema::ActOnCoroutineBodyStart(Scope *SC, SourceLocation KWLoc, SourceLocation Loc = Fn->getLocation(); // Build the initial suspend point auto buildSuspends = [&](StringRef Name) mutable -> StmtResult { - ExprResult Operand = buildPromiseCall(*this, ScopeInfo->CoroutinePromise, - Loc, Name, std::nullopt); + ExprResult Operand = + buildPromiseCall(*this, ScopeInfo->CoroutinePromise, Loc, Name, {}); if (Operand.isInvalid()) return StmtError(); ExprResult Suspend = @@ -1049,7 +1049,7 @@ StmtResult Sema::BuildCoreturnStmt(SourceLocation Loc, Expr *E, PC = buildPromiseCall(*this, Promise, Loc, "return_value", E); } else { E = MakeFullDiscardedValueExpr(E).get(); - PC = buildPromiseCall(*this, Promise, Loc, "return_void", std::nullopt); + PC = buildPromiseCall(*this, Promise, Loc, "return_void", {}); } if (PC.isInvalid()) return StmtError(); @@ -1735,8 +1735,8 @@ bool CoroutineStmtBuilder::makeOnException() { if (!S.getLangOpts().CXXExceptions) return true; - ExprResult UnhandledException = buildPromiseCall( - S, Fn.CoroutinePromise, Loc, "unhandled_exception", std::nullopt); + ExprResult UnhandledException = + buildPromiseCall(S, Fn.CoroutinePromise, Loc, "unhandled_exception", {}); UnhandledException = S.ActOnFinishFullExpr(UnhandledException.get(), Loc, /*DiscardedValue*/ false); if (UnhandledException.isInvalid()) @@ -1759,8 +1759,8 @@ bool CoroutineStmtBuilder::makeReturnObject() { // [dcl.fct.def.coroutine]p7 // The expression promise.get_return_object() is used to initialize the // returned reference or prvalue result object of a call to a coroutine. - ExprResult ReturnObject = buildPromiseCall(S, Fn.CoroutinePromise, Loc, - "get_return_object", std::nullopt); + ExprResult ReturnObject = + buildPromiseCall(S, Fn.CoroutinePromise, Loc, "get_return_object", {}); if (ReturnObject.isInvalid()) return false; diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 229c908..25061f0 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -14135,8 +14135,8 @@ void Sema::ActOnUninitializedDecl(Decl *RealDecl) { InitializationKind Kind = InitializationKind::CreateDefault(Var->getLocation()); - InitializationSequence InitSeq(*this, Entity, Kind, std::nullopt); - ExprResult Init = InitSeq.Perform(*this, Entity, Kind, std::nullopt); + InitializationSequence InitSeq(*this, Entity, Kind, {}); + ExprResult Init = InitSeq.Perform(*this, Entity, Kind, {}); if (Init.get()) { Var->setInit(MaybeCreateExprWithCleanups(Init.get())); @@ -16428,8 +16428,8 @@ NamedDecl *Sema::ImplicitlyDefineFunction(SourceLocation Loc, /*NumExceptions=*/0, /*NoexceptExpr=*/nullptr, /*ExceptionSpecTokens=*/nullptr, - /*DeclsInPrototype=*/std::nullopt, - Loc, Loc, D), + /*DeclsInPrototype=*/{}, Loc, Loc, + D), std::move(DS.getAttributes()), SourceLocation()); D.SetIdentifier(&II, Loc); diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index 43ec25b..1a691c0 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -1281,7 +1281,7 @@ static bool checkTupleLikeDecomposition(Sema &S, if (E.isInvalid()) return true; - E = S.BuildCallExpr(nullptr, E.get(), Loc, std::nullopt, Loc); + E = S.BuildCallExpr(nullptr, E.get(), Loc, {}, Loc); } else { // Otherwise, the initializer is get<i-1>(e), where get is looked up // in the associated namespaces. @@ -4797,8 +4797,8 @@ BuildImplicitBaseInitializer(Sema &SemaRef, CXXConstructorDecl *Constructor, case IIK_Default: { InitializationKind InitKind = InitializationKind::CreateDefault(Constructor->getLocation()); - InitializationSequence InitSeq(SemaRef, InitEntity, InitKind, std::nullopt); - BaseInit = InitSeq.Perform(SemaRef, InitEntity, InitKind, std::nullopt); + InitializationSequence InitSeq(SemaRef, InitEntity, InitKind, {}); + BaseInit = InitSeq.Perform(SemaRef, InitEntity, InitKind, {}); break; } @@ -4962,9 +4962,8 @@ BuildImplicitMemberInitializer(Sema &SemaRef, CXXConstructorDecl *Constructor, InitializationKind InitKind = InitializationKind::CreateDefault(Loc); - InitializationSequence InitSeq(SemaRef, InitEntity, InitKind, std::nullopt); - ExprResult MemberInit = - InitSeq.Perform(SemaRef, InitEntity, InitKind, std::nullopt); + InitializationSequence InitSeq(SemaRef, InitEntity, InitKind, {}); + ExprResult MemberInit = InitSeq.Perform(SemaRef, InitEntity, InitKind, {}); MemberInit = SemaRef.MaybeCreateExprWithCleanups(MemberInit); if (MemberInit.isInvalid()) @@ -10992,7 +10991,7 @@ QualType Sema::CheckDestructorDeclarator(Declarator &D, QualType R, EPI.Variadic = false; EPI.TypeQuals = Qualifiers(); EPI.RefQualifier = RQ_None; - return Context.getFunctionType(Context.VoidTy, std::nullopt, EPI); + return Context.getFunctionType(Context.VoidTy, {}, EPI); } static void extendLeft(SourceRange &R, SourceRange Before) { @@ -11172,8 +11171,7 @@ void Sema::CheckConversionDeclarator(Declarator &D, QualType &R, // of the errors above fired) and with the conversion type as the // return type. if (D.isInvalidType()) - R = Context.getFunctionType(ConvType, std::nullopt, - Proto->getExtProtoInfo()); + R = Context.getFunctionType(ConvType, {}, Proto->getExtProtoInfo()); // C++0x explicit conversion operators. if (DS.hasExplicitSpecifier() && !getLangOpts().CPlusPlus20) @@ -13867,7 +13865,7 @@ CXXConstructorDecl *Sema::DeclareImplicitDefaultConstructor( DefaultCon->setAccess(AS_public); DefaultCon->setDefaulted(); - setupImplicitSpecialMemberType(DefaultCon, Context.VoidTy, std::nullopt); + setupImplicitSpecialMemberType(DefaultCon, Context.VoidTy, {}); if (getLangOpts().CUDA) CUDA().inferTargetForImplicitSpecialMember( @@ -14153,7 +14151,7 @@ CXXDestructorDecl *Sema::DeclareImplicitDestructor(CXXRecordDecl *ClassDecl) { Destructor->setAccess(AS_public); Destructor->setDefaulted(); - setupImplicitSpecialMemberType(Destructor, Context.VoidTy, std::nullopt); + setupImplicitSpecialMemberType(Destructor, Context.VoidTy, {}); if (getLangOpts().CUDA) CUDA().inferTargetForImplicitSpecialMember( @@ -14312,8 +14310,7 @@ void Sema::AdjustDestructorExceptionSpec(CXXDestructorDecl *Destructor) { FunctionProtoType::ExtProtoInfo EPI = DtorType->getExtProtoInfo(); EPI.ExceptionSpec.Type = EST_Unevaluated; EPI.ExceptionSpec.SourceDecl = Destructor; - Destructor->setType( - Context.getFunctionType(Context.VoidTy, std::nullopt, EPI)); + Destructor->setType(Context.getFunctionType(Context.VoidTy, {}, EPI)); // FIXME: If the destructor has a body that could throw, and the newly created // spec doesn't allow exceptions, we should emit a warning, because this @@ -15639,8 +15636,7 @@ void Sema::DefineImplicitCopyConstructor(SourceLocation CurrentLocation, : CopyConstructor->getLocation(); Sema::CompoundScopeRAII CompoundScope(*this); CopyConstructor->setBody( - ActOnCompoundStmt(Loc, Loc, std::nullopt, /*isStmtExpr=*/false) - .getAs<Stmt>()); + ActOnCompoundStmt(Loc, Loc, {}, /*isStmtExpr=*/false).getAs<Stmt>()); CopyConstructor->markUsed(Context); } @@ -15771,8 +15767,7 @@ void Sema::DefineImplicitMoveConstructor(SourceLocation CurrentLocation, : MoveConstructor->getLocation(); Sema::CompoundScopeRAII CompoundScope(*this); MoveConstructor->setBody( - ActOnCompoundStmt(Loc, Loc, std::nullopt, /*isStmtExpr=*/false) - .getAs<Stmt>()); + ActOnCompoundStmt(Loc, Loc, {}, /*isStmtExpr=*/false).getAs<Stmt>()); MoveConstructor->markUsed(Context); } @@ -17228,8 +17223,7 @@ bool Sema::EvaluateStaticAssertMessageAsString(Expr *Message, CXXScopeSpec(), SourceLocation(), nullptr, LR, nullptr, nullptr); if (Res.isInvalid()) return ExprError(); - Res = BuildCallExpr(nullptr, Res.get(), Loc, std::nullopt, Loc, nullptr, - false, true); + Res = BuildCallExpr(nullptr, Res.get(), Loc, {}, Loc, nullptr, false, true); if (Res.isInvalid()) return ExprError(); if (Res.get()->isTypeDependent() || Res.get()->isValueDependent()) diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp index d8cd09b..78acfed 100644 --- a/clang/lib/Sema/SemaDeclObjC.cpp +++ b/clang/lib/Sema/SemaDeclObjC.cpp @@ -5511,10 +5511,9 @@ void SemaObjC::SetIvarInitializers(ObjCImplementationDecl *ObjCImplementation) { InitializationKind InitKind = InitializationKind::CreateDefault(ObjCImplementation->getLocation()); - InitializationSequence InitSeq(SemaRef, InitEntity, InitKind, - std::nullopt); + InitializationSequence InitSeq(SemaRef, InitEntity, InitKind, {}); ExprResult MemberInit = - InitSeq.Perform(SemaRef, InitEntity, InitKind, std::nullopt); + InitSeq.Perform(SemaRef, InitEntity, InitKind, {}); MemberInit = SemaRef.MaybeCreateExprWithCleanups(MemberInit); // Note, MemberInit could actually come back empty if no initialization // is required (e.g., because it would call a trivial default constructor) diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 6807f44..ff66169 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -1079,8 +1079,8 @@ ExprResult Sema::DefaultVariadicArgumentPromotion(Expr *E, VariadicCallType CT, if (TrapFn.isInvalid()) return ExprError(); - ExprResult Call = BuildCallExpr(TUScope, TrapFn.get(), E->getBeginLoc(), - std::nullopt, E->getEndLoc()); + ExprResult Call = BuildCallExpr(TUScope, TrapFn.get(), E->getBeginLoc(), {}, + E->getEndLoc()); if (Call.isInvalid()) return ExprError(); @@ -2164,8 +2164,8 @@ Sema::ActOnStringLiteral(ArrayRef<Token> StringToks, Scope *UDLScope) { TemplateArgument Arg(Lit); TemplateArgumentLocInfo ArgInfo(Lit); ExplicitArgs.addArgument(TemplateArgumentLoc(Arg, ArgInfo)); - return BuildLiteralOperatorCall(R, OpNameInfo, std::nullopt, - StringTokLocs.back(), &ExplicitArgs); + return BuildLiteralOperatorCall(R, OpNameInfo, {}, StringTokLocs.back(), + &ExplicitArgs); } case LOLR_StringTemplatePack: { @@ -2185,8 +2185,8 @@ Sema::ActOnStringLiteral(ArrayRef<Token> StringToks, Scope *UDLScope) { TemplateArgumentLocInfo ArgInfo; ExplicitArgs.addArgument(TemplateArgumentLoc(Arg, ArgInfo)); } - return BuildLiteralOperatorCall(R, OpNameInfo, std::nullopt, - StringTokLocs.back(), &ExplicitArgs); + return BuildLiteralOperatorCall(R, OpNameInfo, {}, StringTokLocs.back(), + &ExplicitArgs); } case LOLR_Raw: case LOLR_ErrorNoDiagnostic: @@ -2801,7 +2801,7 @@ Sema::ActOnIdExpression(Scope *S, CXXScopeSpec &SS, // a template name, but we happen to have always already looked up the name // before we get here if it must be a template name. if (DiagnoseEmptyLookup(S, SS, R, CCC ? *CCC : DefaultValidator, nullptr, - std::nullopt, nullptr, &TE)) { + {}, nullptr, &TE)) { if (TE && KeywordReplacement) { auto &State = getTypoExprState(TE); auto BestTC = State.Consumer->getNextCorrection(); @@ -3787,8 +3787,7 @@ ExprResult Sema::ActOnNumericConstant(const Token &Tok, Scope *UDLScope) { TemplateArgumentLocInfo ArgInfo; ExplicitArgs.addArgument(TemplateArgumentLoc(Arg, ArgInfo)); } - return BuildLiteralOperatorCall(R, OpNameInfo, std::nullopt, TokLoc, - &ExplicitArgs); + return BuildLiteralOperatorCall(R, OpNameInfo, {}, TokLoc, &ExplicitArgs); } case LOLR_StringTemplatePack: llvm_unreachable("unexpected literal operator lookup result"); @@ -16245,7 +16244,7 @@ ExprResult Sema::ActOnBlockStmtExpr(SourceLocation CaretLoc, if (isa<FunctionNoProtoType>(FTy)) { FunctionProtoType::ExtProtoInfo EPI; EPI.ExtInfo = Ext; - BlockTy = Context.getFunctionType(RetTy, std::nullopt, EPI); + BlockTy = Context.getFunctionType(RetTy, {}, EPI); // Otherwise, if we don't need to change anything about the function type, // preserve its sugar structure. @@ -16266,7 +16265,7 @@ ExprResult Sema::ActOnBlockStmtExpr(SourceLocation CaretLoc, } else { FunctionProtoType::ExtProtoInfo EPI; EPI.ExtInfo = FunctionType::ExtInfo().withNoReturn(NoReturn); - BlockTy = Context.getFunctionType(RetTy, std::nullopt, EPI); + BlockTy = Context.getFunctionType(RetTy, {}, EPI); } DiagnoseUnusedParameters(BD->parameters()); @@ -20144,7 +20143,8 @@ bool Sema::DiagRuntimeBehavior(SourceLocation Loc, ArrayRef<const Stmt*> Stmts, bool Sema::DiagRuntimeBehavior(SourceLocation Loc, const Stmt *Statement, const PartialDiagnostic &PD) { return DiagRuntimeBehavior( - Loc, Statement ? llvm::ArrayRef(Statement) : std::nullopt, PD); + Loc, Statement ? llvm::ArrayRef(Statement) : llvm::ArrayRef<Stmt *>(), + PD); } bool Sema::CheckCallReturnType(QualType ReturnType, SourceLocation Loc, diff --git a/clang/lib/Sema/SemaExprObjC.cpp b/clang/lib/Sema/SemaExprObjC.cpp index 2f914ddc..35fbc4e 100644 --- a/clang/lib/Sema/SemaExprObjC.cpp +++ b/clang/lib/Sema/SemaExprObjC.cpp @@ -305,7 +305,7 @@ static ObjCMethodDecl *getNSNumberFactoryMethod(SemaObjC &S, SourceLocation Loc, ParmVarDecl::Create(S.SemaRef.Context, Method, SourceLocation(), SourceLocation(), &CX.Idents.get("value"), NumberType, /*TInfo=*/nullptr, SC_None, nullptr); - Method->setMethodParams(S.SemaRef.Context, value, std::nullopt); + Method->setMethodParams(S.SemaRef.Context, value, {}); } if (!validateBoxingMethod(S.SemaRef, Loc, S.NSNumberDecl, Sel, Method)) @@ -588,7 +588,7 @@ ExprResult SemaObjC::BuildObjCBoxedExpr(SourceRange SR, Expr *ValueExpr) { Context.getPointerType(ConstCharType), /*TInfo=*/nullptr, SC_None, nullptr); - M->setMethodParams(Context, value, std::nullopt); + M->setMethodParams(Context, value, {}); BoxingMethod = M; } @@ -713,7 +713,7 @@ ExprResult SemaObjC::BuildObjCBoxedExpr(SourceRange SR, Expr *ValueExpr) { SC_None, nullptr); Params.push_back(type); - M->setMethodParams(Context, Params, std::nullopt); + M->setMethodParams(Context, Params, {}); BoxingMethod = M; } @@ -843,7 +843,7 @@ ExprResult SemaObjC::BuildObjCArrayLiteral(SourceRange SR, /*TInfo=*/nullptr, SC_None, nullptr); Params.push_back(cnt); - Method->setMethodParams(Context, Params, std::nullopt); + Method->setMethodParams(Context, Params, {}); } if (!validateBoxingMethod(SemaRef, Loc, NSArrayDecl, Sel, Method)) @@ -1012,7 +1012,7 @@ ExprResult SemaObjC::BuildObjCDictionaryLiteral( /*TInfo=*/nullptr, SC_None, nullptr); Params.push_back(cnt); - Method->setMethodParams(Context, Params, std::nullopt); + Method->setMethodParams(Context, Params, {}); } if (!validateBoxingMethod(SemaRef, SR.getBegin(), NSDictionaryDecl, Sel, @@ -4388,7 +4388,7 @@ bool SemaObjC::CheckObjCBridgeRelatedConversions(SourceLocation Loc, ExprResult msg = BuildInstanceMessageImplicit( SrcExpr, SrcType, InstanceMethod->getLocation(), - InstanceMethod->getSelector(), InstanceMethod, std::nullopt); + InstanceMethod->getSelector(), InstanceMethod, {}); SrcExpr = msg.get(); } return true; diff --git a/clang/lib/Sema/SemaInit.cpp b/clang/lib/Sema/SemaInit.cpp index f560865..573e90a 100644 --- a/clang/lib/Sema/SemaInit.cpp +++ b/clang/lib/Sema/SemaInit.cpp @@ -569,7 +569,7 @@ ExprResult InitListChecker::PerformEmptyInit(SourceLocation Loc, true); MultiExprArg SubInit; Expr *InitExpr; - InitListExpr DummyInitList(SemaRef.Context, Loc, std::nullopt, Loc); + InitListExpr DummyInitList(SemaRef.Context, Loc, {}, Loc); // C++ [dcl.init.aggr]p7: // If there are fewer initializer-clauses in the list than there are @@ -588,10 +588,9 @@ ExprResult InitListChecker::PerformEmptyInit(SourceLocation Loc, // // Only do this if we're initializing a class type, to avoid filling in // the initializer list where possible. - InitExpr = VerifyOnly - ? &DummyInitList - : new (SemaRef.Context) - InitListExpr(SemaRef.Context, Loc, std::nullopt, Loc); + InitExpr = VerifyOnly ? &DummyInitList + : new (SemaRef.Context) + InitListExpr(SemaRef.Context, Loc, {}, Loc); InitExpr->setType(SemaRef.Context.VoidTy); SubInit = InitExpr; Kind = InitializationKind::CreateCopy(Loc, Loc); @@ -3403,7 +3402,7 @@ InitListChecker::createInitListExpr(QualType CurrentObjectType, SourceRange InitRange, unsigned ExpectedNumInits) { InitListExpr *Result = new (SemaRef.Context) InitListExpr( - SemaRef.Context, InitRange.getBegin(), std::nullopt, InitRange.getEnd()); + SemaRef.Context, InitRange.getBegin(), {}, InitRange.getEnd()); QualType ResultType = CurrentObjectType; if (!ResultType->isArrayType()) @@ -5650,7 +5649,7 @@ static void TryDefaultInitialization(Sema &S, // constructor for T is called (and the initialization is ill-formed if // T has no accessible default constructor); if (DestType->isRecordType() && S.getLangOpts().CPlusPlus) { - TryConstructorInitialization(S, Entity, Kind, std::nullopt, DestType, + TryConstructorInitialization(S, Entity, Kind, {}, DestType, Entity.getType(), Sequence); return; } @@ -5687,11 +5686,13 @@ static void TryOrBuildParenListInitialization( const InitializationKind &SubKind, Expr *Arg, Expr **InitExpr = nullptr) { InitializationSequence IS = InitializationSequence( - S, SubEntity, SubKind, Arg ? MultiExprArg(Arg) : std::nullopt); + S, SubEntity, SubKind, + Arg ? MultiExprArg(Arg) : MutableArrayRef<Expr *>()); if (IS.Failed()) { if (!VerifyOnly) { - IS.Diagnose(S, SubEntity, SubKind, Arg ? ArrayRef(Arg) : std::nullopt); + IS.Diagnose(S, SubEntity, SubKind, + Arg ? ArrayRef(Arg) : ArrayRef<Expr *>()); } else { Sequence.SetFailed( InitializationSequence::FK_ParenthesizedListInitFailed); @@ -5702,7 +5703,7 @@ static void TryOrBuildParenListInitialization( if (!VerifyOnly) { ExprResult ER; ER = IS.Perform(S, SubEntity, SubKind, - Arg ? MultiExprArg(Arg) : std::nullopt); + Arg ? MultiExprArg(Arg) : MutableArrayRef<Expr *>()); if (ER.isInvalid()) return false; diff --git a/clang/lib/Sema/SemaLambda.cpp b/clang/lib/Sema/SemaLambda.cpp index 7b9d5f4..e7afa0f 100644 --- a/clang/lib/Sema/SemaLambda.cpp +++ b/clang/lib/Sema/SemaLambda.cpp @@ -909,8 +909,8 @@ getDummyLambdaType(Sema &S, SourceLocation Loc = SourceLocation()) { QualType DefaultTypeForNoTrailingReturn = S.getLangOpts().CPlusPlus14 ? S.Context.getAutoDeductType() : S.Context.DependentTy; - QualType MethodTy = S.Context.getFunctionType(DefaultTypeForNoTrailingReturn, - std::nullopt, EPI); + QualType MethodTy = + S.Context.getFunctionType(DefaultTypeForNoTrailingReturn, {}, EPI); return S.Context.getTrivialTypeSourceInfo(MethodTy, Loc); } @@ -1681,8 +1681,7 @@ static void addFunctionPointerConversion(Sema &S, SourceRange IntroducerRange, ConvExtInfo.TypeQuals = Qualifiers(); ConvExtInfo.TypeQuals.addConst(); ConvExtInfo.ExceptionSpec.Type = EST_BasicNoexcept; - QualType ConvTy = - S.Context.getFunctionType(PtrToFunctionTy, std::nullopt, ConvExtInfo); + QualType ConvTy = S.Context.getFunctionType(PtrToFunctionTy, {}, ConvExtInfo); SourceLocation Loc = IntroducerRange.getBegin(); DeclarationName ConversionName @@ -1864,8 +1863,7 @@ static void addBlockPointerConversion(Sema &S, /*IsVariadic=*/false, /*IsCXXMethod=*/true)); ConversionEPI.TypeQuals = Qualifiers(); ConversionEPI.TypeQuals.addConst(); - QualType ConvTy = - S.Context.getFunctionType(BlockPtrTy, std::nullopt, ConversionEPI); + QualType ConvTy = S.Context.getFunctionType(BlockPtrTy, {}, ConversionEPI); SourceLocation Loc = IntroducerRange.getBegin(); DeclarationName Name diff --git a/clang/lib/Sema/SemaLookup.cpp b/clang/lib/Sema/SemaLookup.cpp index e5db113..8468e9a 100644 --- a/clang/lib/Sema/SemaLookup.cpp +++ b/clang/lib/Sema/SemaLookup.cpp @@ -1200,7 +1200,7 @@ static bool LookupDirect(Sema &S, LookupResult &R, const DeclContext *DC) { EPI.ExtInfo = EPI.ExtInfo.withCallingConv(CC_C); EPI.ExceptionSpec = EST_None; QualType ExpectedType = R.getSema().Context.getFunctionType( - R.getLookupName().getCXXNameType(), std::nullopt, EPI); + R.getLookupName().getCXXNameType(), {}, EPI); // Perform template argument deduction against the type that we would // expect the function to have. diff --git a/clang/lib/Sema/SemaObjCProperty.cpp b/clang/lib/Sema/SemaObjCProperty.cpp index 031f2a6..5c4dc93 100644 --- a/clang/lib/Sema/SemaObjCProperty.cpp +++ b/clang/lib/Sema/SemaObjCProperty.cpp @@ -2552,7 +2552,7 @@ void SemaObjC::ProcessPropertyDecl(ObjCPropertyDecl *property) { /*TInfo=*/nullptr, SC_None, nullptr); - SetterMethod->setMethodParams(Context, Argument, std::nullopt); + SetterMethod->setMethodParams(Context, Argument, {}); AddPropertyAttrs(SemaRef, SetterMethod, property); diff --git a/clang/lib/Sema/SemaOpenACC.cpp b/clang/lib/Sema/SemaOpenACC.cpp index d33b0d0..aadcd71 100644 --- a/clang/lib/Sema/SemaOpenACC.cpp +++ b/clang/lib/Sema/SemaOpenACC.cpp @@ -1986,8 +1986,7 @@ ExprResult SemaOpenACC::ActOnArraySectionExpr(Expr *Base, SourceLocation LBLoc, // Fill in a dummy 'length' so that when we instantiate this we don't // double-diagnose here. ExprResult Recovery = SemaRef.CreateRecoveryExpr( - ColonLoc, SourceLocation(), ArrayRef<Expr *>{std::nullopt}, - Context.IntTy); + ColonLoc, SourceLocation(), ArrayRef<Expr *>(), Context.IntTy); Length = Recovery.isUsable() ? Recovery.get() : nullptr; } diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp index fa81fc4..79e1536 100644 --- a/clang/lib/Sema/SemaOpenMP.cpp +++ b/clang/lib/Sema/SemaOpenMP.cpp @@ -15901,9 +15901,9 @@ OMPClause *SemaOpenMP::ActOnOpenMPSimpleClause( return Res; } -static std::string -getListOfPossibleValues(OpenMPClauseKind K, unsigned First, unsigned Last, - ArrayRef<unsigned> Exclude = std::nullopt) { +static std::string getListOfPossibleValues(OpenMPClauseKind K, unsigned First, + unsigned Last, + ArrayRef<unsigned> Exclude = {}) { SmallString<256> Buffer; llvm::raw_svector_ostream Out(Buffer); unsigned Skipped = Exclude.size(); @@ -21296,7 +21296,7 @@ static void checkMappableExpressionList( CXXScopeSpec &MapperIdScopeSpec, DeclarationNameInfo MapperId, ArrayRef<Expr *> UnresolvedMappers, OpenMPMapClauseKind MapType = OMPC_MAP_unknown, - ArrayRef<OpenMPMapModifierKind> Modifiers = std::nullopt, + ArrayRef<OpenMPMapModifierKind> Modifiers = {}, bool IsMapTypeImplicit = false, bool NoDiagnose = false) { // We only expect mappable expressions in 'to', 'from', and 'map' clauses. assert((CKind == OMPC_map || CKind == OMPC_to || CKind == OMPC_from) && diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp index 7b86299..4aeceba 100644 --- a/clang/lib/Sema/SemaOverload.cpp +++ b/clang/lib/Sema/SemaOverload.cpp @@ -5502,7 +5502,7 @@ TryListConversion(Sema &S, InitListExpr *From, QualType ToType, } if (CT->getSize().ugt(e)) { // Need an init from empty {}, is there one? - InitListExpr EmptyList(S.Context, From->getEndLoc(), std::nullopt, + InitListExpr EmptyList(S.Context, From->getEndLoc(), {}, From->getEndLoc()); EmptyList.setType(S.Context.VoidTy); DfltElt = TryListConversion( @@ -7479,7 +7479,7 @@ void Sema::AddMethodCandidate(DeclAccessPair FoundDecl, QualType ObjectType, } else { AddMethodCandidate(cast<CXXMethodDecl>(Decl), FoundDecl, ActingContext, ObjectType, ObjectClassification, Args, CandidateSet, - SuppressUserConversions, false, std::nullopt, PO); + SuppressUserConversions, false, {}, PO); } } @@ -8125,7 +8125,7 @@ void Sema::AddConversionCandidate( } if (EnableIfAttr *FailedAttr = - CheckEnableIf(Conversion, CandidateSet.getLocation(), std::nullopt)) { + CheckEnableIf(Conversion, CandidateSet.getLocation(), {})) { Candidate.Viable = false; Candidate.FailureKind = ovl_fail_enable_if; Candidate.DeductionFailure.Data = FailedAttr; @@ -8306,7 +8306,7 @@ void Sema::AddSurrogateCandidate(CXXConversionDecl *Conversion, } if (EnableIfAttr *FailedAttr = - CheckEnableIf(Conversion, CandidateSet.getLocation(), std::nullopt)) { + CheckEnableIf(Conversion, CandidateSet.getLocation(), {})) { Candidate.Viable = false; Candidate.FailureKind = ovl_fail_enable_if; Candidate.DeductionFailure.Data = FailedAttr; @@ -8346,10 +8346,10 @@ void Sema::AddNonMemberOperatorCandidates( continue; AddOverloadCandidate(FD, F.getPair(), FunctionArgs, CandidateSet); if (CandidateSet.getRewriteInfo().shouldAddReversed(*this, Args, FD)) - AddOverloadCandidate( - FD, F.getPair(), {FunctionArgs[1], FunctionArgs[0]}, CandidateSet, - false, false, true, false, ADLCallKind::NotADL, std::nullopt, - OverloadCandidateParamOrder::Reversed); + AddOverloadCandidate(FD, F.getPair(), + {FunctionArgs[1], FunctionArgs[0]}, CandidateSet, + false, false, true, false, ADLCallKind::NotADL, {}, + OverloadCandidateParamOrder::Reversed); } } } @@ -10102,8 +10102,7 @@ Sema::AddArgumentDependentLookupCandidates(DeclarationName Name, FD, FoundDecl, {Args[1], Args[0]}, CandidateSet, /*SuppressUserConversions=*/false, PartialOverloading, /*AllowExplicit=*/true, /*AllowExplicitConversion=*/false, - ADLCallKind::UsesADL, std::nullopt, - OverloadCandidateParamOrder::Reversed); + ADLCallKind::UsesADL, {}, OverloadCandidateParamOrder::Reversed); } } else { auto *FTD = cast<FunctionTemplateDecl>(*I); @@ -15954,7 +15953,7 @@ Sema::BuildOverloadedArrowExpr(Scope *S, Expr *Base, SourceLocation OpLoc, for (LookupResult::iterator Oper = R.begin(), OperEnd = R.end(); Oper != OperEnd; ++Oper) { AddMethodCandidate(Oper.getPair(), Base->getType(), Base->Classify(Context), - std::nullopt, CandidateSet, + {}, CandidateSet, /*SuppressUserConversion=*/false); } @@ -16149,8 +16148,7 @@ Sema::BuildForRangeBeginEndCall(SourceLocation Loc, *CallExpr = ExprError(); return FRS_DiagnosticIssued; } - *CallExpr = - BuildCallExpr(S, MemberRef.get(), Loc, std::nullopt, Loc, nullptr); + *CallExpr = BuildCallExpr(S, MemberRef.get(), Loc, {}, Loc, nullptr); if (CallExpr->isInvalid()) { *CallExpr = ExprError(); return FRS_DiagnosticIssued; diff --git a/clang/lib/Sema/SemaPseudoObject.cpp b/clang/lib/Sema/SemaPseudoObject.cpp index 30ed47e..c9379d2 100644 --- a/clang/lib/Sema/SemaPseudoObject.cpp +++ b/clang/lib/Sema/SemaPseudoObject.cpp @@ -746,11 +746,11 @@ ExprResult ObjCPropertyOpBuilder::buildGet() { assert(InstanceReceiver || RefExpr->isSuperReceiver()); msg = S.ObjC().BuildInstanceMessageImplicit( InstanceReceiver, receiverType, GenericLoc, Getter->getSelector(), - Getter, std::nullopt); + Getter, {}); } else { msg = S.ObjC().BuildClassMessageImplicit( receiverType, RefExpr->isSuperReceiver(), GenericLoc, - Getter->getSelector(), Getter, std::nullopt); + Getter->getSelector(), Getter, {}); } return msg; } @@ -1131,7 +1131,7 @@ bool ObjCSubscriptOpBuilder::findAtIndexGetter() { /*TInfo=*/nullptr, SC_None, nullptr); - AtIndexGetter->setMethodParams(S.Context, Argument, std::nullopt); + AtIndexGetter->setMethodParams(S.Context, Argument, {}); } if (!AtIndexGetter) { @@ -1243,7 +1243,7 @@ bool ObjCSubscriptOpBuilder::findAtIndexSetter() { SC_None, nullptr); Params.push_back(key); - AtIndexSetter->setMethodParams(S.Context, Params, std::nullopt); + AtIndexSetter->setMethodParams(S.Context, Params, {}); } if (!AtIndexSetter) { diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp index 9e235a4..38ae6d8 100644 --- a/clang/lib/Sema/SemaStmt.cpp +++ b/clang/lib/Sema/SemaStmt.cpp @@ -390,7 +390,7 @@ void Sema::DiagnoseUnusedExprResult(const Stmt *S, unsigned DiagID) { // type of the left operand could be used for SFINAE, so technically it is // *used*. if (DiagID != diag::warn_unused_comma_left_operand || !isSFINAEContext()) - DiagIfReachable(Loc, S ? llvm::ArrayRef(S) : std::nullopt, + DiagIfReachable(Loc, S ? llvm::ArrayRef(S) : llvm::ArrayRef<Stmt *>(), PDiag(DiagID) << R1 << R2); } diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp index 62f1361..fcf0579 100644 --- a/clang/lib/Sema/SemaTemplate.cpp +++ b/clang/lib/Sema/SemaTemplate.cpp @@ -2991,7 +2991,7 @@ TemplateParameterList *Sema::MatchTemplateParametersToScopeSpecifier( // Fabricate an empty template parameter list for the invented header. return TemplateParameterList::Create(Context, SourceLocation(), - SourceLocation(), std::nullopt, + SourceLocation(), {}, SourceLocation(), nullptr); } diff --git a/clang/lib/Sema/SemaTemplateDeductionGuide.cpp b/clang/lib/Sema/SemaTemplateDeductionGuide.cpp index 3a87128..698e076 100644 --- a/clang/lib/Sema/SemaTemplateDeductionGuide.cpp +++ b/clang/lib/Sema/SemaTemplateDeductionGuide.cpp @@ -1388,7 +1388,7 @@ void Sema::DeclareImplicitDeductionGuides(TemplateDecl *Template, // additional function template derived as above from a hypothetical // constructor C(). if (!AddedAny) - Transform.buildSimpleDeductionGuide(std::nullopt); + Transform.buildSimpleDeductionGuide({}); // -- An additional function template derived as above from a hypothetical // constructor C(C), called the copy deduction candidate. diff --git a/clang/lib/Sema/SemaTemplateInstantiate.cpp b/clang/lib/Sema/SemaTemplateInstantiate.cpp index 198442d..6a55861 100644 --- a/clang/lib/Sema/SemaTemplateInstantiate.cpp +++ b/clang/lib/Sema/SemaTemplateInstantiate.cpp @@ -732,8 +732,7 @@ Sema::InstantiatingTemplate::InstantiatingTemplate( : InstantiatingTemplate( SemaRef, CodeSynthesisContext::RequirementInstantiation, PointOfInstantiation, InstantiationRange, /*Entity=*/nullptr, - /*Template=*/nullptr, /*TemplateArgs=*/std::nullopt, &DeductionInfo) { -} + /*Template=*/nullptr, /*TemplateArgs=*/{}, &DeductionInfo) {} Sema::InstantiatingTemplate::InstantiatingTemplate( Sema &SemaRef, SourceLocation PointOfInstantiation, @@ -742,7 +741,7 @@ Sema::InstantiatingTemplate::InstantiatingTemplate( : InstantiatingTemplate( SemaRef, CodeSynthesisContext::NestedRequirementConstraintsCheck, PointOfInstantiation, InstantiationRange, /*Entity=*/nullptr, - /*Template=*/nullptr, /*TemplateArgs=*/std::nullopt) {} + /*Template=*/nullptr, /*TemplateArgs=*/{}) {} Sema::InstantiatingTemplate::InstantiatingTemplate( Sema &SemaRef, SourceLocation PointOfInstantiation, const RequiresExpr *RE, @@ -750,8 +749,7 @@ Sema::InstantiatingTemplate::InstantiatingTemplate( : InstantiatingTemplate( SemaRef, CodeSynthesisContext::RequirementParameterInstantiation, PointOfInstantiation, InstantiationRange, /*Entity=*/nullptr, - /*Template=*/nullptr, /*TemplateArgs=*/std::nullopt, &DeductionInfo) { -} + /*Template=*/nullptr, /*TemplateArgs=*/{}, &DeductionInfo) {} Sema::InstantiatingTemplate::InstantiatingTemplate( Sema &SemaRef, SourceLocation PointOfInstantiation, diff --git a/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp index 6387fe9..5d043e6 100644 --- a/clang/lib/Sema/SemaType.cpp +++ b/clang/lib/Sema/SemaType.cpp @@ -803,7 +803,7 @@ static void maybeSynthesizeBlockSignature(TypeProcessingState &state, /*NumExceptions=*/0, /*NoexceptExpr=*/nullptr, /*ExceptionSpecTokens=*/nullptr, - /*DeclsInPrototype=*/std::nullopt, loc, loc, declarator)); + /*DeclsInPrototype=*/{}, loc, loc, declarator)); // For consistency, make sure the state still has us as processing // the decl spec. diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h index bd474cc..d24d8d5 100644 --- a/clang/lib/Sema/TreeTransform.h +++ b/clang/lib/Sema/TreeTransform.h @@ -3423,8 +3423,7 @@ public: ExprResult RebuildCXXScalarValueInitExpr(TypeSourceInfo *TSInfo, SourceLocation LParenLoc, SourceLocation RParenLoc) { - return getSema().BuildCXXTypeConstructExpr(TSInfo, LParenLoc, std::nullopt, - RParenLoc, + return getSema().BuildCXXTypeConstructExpr(TSInfo, LParenLoc, {}, RParenLoc, /*ListInitialization=*/false); } @@ -4243,13 +4242,13 @@ ExprResult TreeTransform<Derived>::TransformInitializer(Expr *Init, // Revert value-initialization back to empty parens. if (CXXScalarValueInitExpr *VIE = dyn_cast<CXXScalarValueInitExpr>(Init)) { SourceRange Parens = VIE->getSourceRange(); - return getDerived().RebuildParenListExpr(Parens.getBegin(), std::nullopt, + return getDerived().RebuildParenListExpr(Parens.getBegin(), {}, Parens.getEnd()); } // FIXME: We shouldn't build ImplicitValueInitExprs for direct-initialization. if (isa<ImplicitValueInitExpr>(Init)) - return getDerived().RebuildParenListExpr(SourceLocation(), std::nullopt, + return getDerived().RebuildParenListExpr(SourceLocation(), {}, SourceLocation()); // Revert initialization by constructor back to a parenthesized or braced list @@ -15444,7 +15443,7 @@ TreeTransform<Derived>::TransformSizeOfPackExpr(SizeOfPackExpr *E) { return ExprError(); return getDerived().RebuildSizeOfPackExpr( E->getOperatorLoc(), Pack, E->getPackLoc(), E->getRParenLoc(), - std::nullopt, std::nullopt); + std::nullopt, {}); } // Try to compute the result without performing a partial substitution. @@ -15488,9 +15487,9 @@ TreeTransform<Derived>::TransformSizeOfPackExpr(SizeOfPackExpr *E) { // Common case: we could determine the number of expansions without // substituting. if (Result) - return getDerived().RebuildSizeOfPackExpr( - E->getOperatorLoc(), E->getPack(), E->getPackLoc(), E->getRParenLoc(), - *Result, std::nullopt); + return getDerived().RebuildSizeOfPackExpr(E->getOperatorLoc(), E->getPack(), + E->getPackLoc(), + E->getRParenLoc(), *Result, {}); TemplateArgumentListInfo TransformedPackArgs(E->getPackLoc(), E->getPackLoc()); @@ -15521,7 +15520,7 @@ TreeTransform<Derived>::TransformSizeOfPackExpr(SizeOfPackExpr *E) { return getDerived().RebuildSizeOfPackExpr(E->getOperatorLoc(), E->getPack(), E->getPackLoc(), E->getRParenLoc(), - Args.size(), std::nullopt); + Args.size(), {}); } template <typename Derived> @@ -15565,7 +15564,7 @@ TreeTransform<Derived>::TransformPackIndexingExpr(PackIndexingExpr *E) { return ExprError(); return getDerived().RebuildPackIndexingExpr( E->getEllipsisLoc(), E->getRSquareLoc(), Pack.get(), IndexExpr.get(), - std::nullopt); + {}); } for (unsigned I = 0; I != *NumExpansions; ++I) { Sema::ArgumentPackSubstitutionIndexRAII SubstIndex(getSema(), I); |