diff --git a/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp b/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp index 811fd036e307a5..e36716fe2aac00 100644 --- a/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp +++ b/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp @@ -205,8 +205,8 @@ static bool hasVisibleUpdate(const ExplodedNode *LeftNode, SVal LeftVal, RLCV->getStore() == RightNode->getState()->getStore(); } -static Optional getSValForVar(const Expr *CondVarExpr, - const ExplodedNode *N) { +static std::optional getSValForVar(const Expr *CondVarExpr, + const ExplodedNode *N) { ProgramStateRef State = N->getState(); const LocationContext *LCtx = N->getLocationContext(); @@ -229,10 +229,10 @@ static Optional getSValForVar(const Expr *CondVarExpr, return std::nullopt; } -static Optional +static std::optional getConcreteIntegerValue(const Expr *CondVarExpr, const ExplodedNode *N) { - if (Optional V = getSValForVar(CondVarExpr, N)) + if (std::optional V = getSValForVar(CondVarExpr, N)) if (auto CI = V->getAs()) return &CI->getValue(); return std::nullopt; @@ -247,7 +247,7 @@ static bool isVarAnInterestingCondition(const Expr *CondVarExpr, if (!B->getErrorNode()->getStackFrame()->isParentOf(N->getStackFrame())) return false; - if (Optional V = getSValForVar(CondVarExpr, N)) + if (std::optional V = getSValForVar(CondVarExpr, N)) if (Optional K = B->getInterestingnessKind(*V)) return *K == bugreporter::TrackingKind::Condition; @@ -256,7 +256,7 @@ static bool isVarAnInterestingCondition(const Expr *CondVarExpr, static bool isInterestingExpr(const Expr *E, const ExplodedNode *N, const PathSensitiveBugReport *B) { - if (Optional V = getSValForVar(E, N)) + if (std::optional V = getSValForVar(E, N)) return B->getInterestingnessKind(*V).has_value(); return false; } @@ -3244,7 +3244,7 @@ bool ConditionBRVisitor::printValue(const Expr *CondVarExpr, raw_ostream &Out, if (!Ty->isIntegralOrEnumerationType()) return false; - Optional IntValue; + std::optional IntValue; if (!IsAssuming) IntValue = getConcreteIntegerValue(CondVarExpr, N);