[clang-tools-extra] 53daa17 - [clang, clang-tools-extra] Use has_value instead of hasValue (NFC)

Kazu Hirata via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 12 22:47:49 PDT 2022


Author: Kazu Hirata
Date: 2022-07-12T22:47:41-07:00
New Revision: 53daa177f86b3abbc21222d8093fc2ac0aa62035

URL: https://github.com/llvm/llvm-project/commit/53daa177f86b3abbc21222d8093fc2ac0aa62035
DIFF: https://github.com/llvm/llvm-project/commit/53daa177f86b3abbc21222d8093fc2ac0aa62035.diff

LOG: [clang, clang-tools-extra] Use has_value instead of hasValue (NFC)

Added: 
    

Modified: 
    clang-tools-extra/clangd/AST.cpp
    clang-tools-extra/clangd/CodeComplete.cpp
    clang-tools-extra/clangd/ConfigCompile.cpp
    clang-tools-extra/clangd/index/YAMLSerialization.cpp
    clang-tools-extra/clangd/unittests/ConfigYAMLTests.cpp
    clang-tools-extra/clangd/unittests/FSTests.cpp
    clang-tools-extra/clangd/unittests/GlobalCompilationDatabaseTests.cpp
    clang-tools-extra/clangd/unittests/HeaderSourceSwitchTests.cpp
    clang-tools-extra/clangd/unittests/LSPBinderTests.cpp
    clang-tools-extra/clangd/unittests/TidyProviderTests.cpp
    clang-tools-extra/pseudo/lib/GLR.cpp
    clang-tools-extra/unittests/clang-doc/ClangDocTest.cpp
    clang-tools-extra/unittests/clang-tidy/ClangTidyOptionsTest.cpp
    clang-tools-extra/unittests/clang-tidy/OptionsProviderTest.cpp
    clang/include/clang/APINotes/Types.h
    clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h
    clang/include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h
    clang/include/clang/Tooling/DependencyScanning/DependencyScanningFilesystem.h
    clang/lib/Sema/SemaCodeComplete.cpp
    clang/lib/Sema/SemaOpenMP.cpp
    clang/lib/Serialization/ASTWriter.cpp
    clang/lib/StaticAnalyzer/Core/BugReporter.cpp
    clang/unittests/ASTMatchers/Dynamic/ParserTest.cpp
    clang/unittests/Analysis/FlowSensitive/TypeErasedDataflowAnalysisTest.cpp
    clang/unittests/Analysis/MacroExpansionContextTest.cpp
    clang/unittests/Basic/DarwinSDKInfoTest.cpp
    clang/unittests/DirectoryWatcher/DirectoryWatcherTest.cpp
    clang/unittests/Lex/HeaderSearchTest.cpp
    clang/unittests/StaticAnalyzer/SValTest.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clangd/AST.cpp b/clang-tools-extra/clangd/AST.cpp
index 1bf876102f991..6ceff56115721 100644
--- a/clang-tools-extra/clangd/AST.cpp
+++ b/clang-tools-extra/clangd/AST.cpp
@@ -745,7 +745,7 @@ class ForwardingCallVisitor
     if (Callee) {
       handleCall(Callee, E->arguments());
     }
-    return !Info.hasValue();
+    return !Info.has_value();
   }
 
   bool VisitCXXConstructExpr(CXXConstructExpr *E) {
@@ -753,7 +753,7 @@ class ForwardingCallVisitor
     if (Callee) {
       handleCall(Callee, E->arguments());
     }
-    return !Info.hasValue();
+    return !Info.has_value();
   }
 
   // The expanded parameter pack to be resolved

diff  --git a/clang-tools-extra/clangd/CodeComplete.cpp b/clang-tools-extra/clangd/CodeComplete.cpp
index 2da83c05e9702..4e2156bb85bee 100644
--- a/clang-tools-extra/clangd/CodeComplete.cpp
+++ b/clang-tools-extra/clangd/CodeComplete.cpp
@@ -394,7 +394,7 @@ struct CodeCompletionBuilder {
     std::stable_partition(Completion.Includes.begin(),
                           Completion.Includes.end(),
                           [](const CodeCompletion::IncludeCandidate &I) {
-                            return !I.Insertion.hasValue();
+                            return !I.Insertion.has_value();
                           });
   }
 

diff  --git a/clang-tools-extra/clangd/ConfigCompile.cpp b/clang-tools-extra/clangd/ConfigCompile.cpp
index 2de8816f9f084..8f207aba29bf4 100644
--- a/clang-tools-extra/clangd/ConfigCompile.cpp
+++ b/clang-tools-extra/clangd/ConfigCompile.cpp
@@ -358,8 +358,8 @@ struct FragmentCompiler {
     }
 #endif
     // Make sure exactly one of the Sources is set.
-    unsigned SourceCount = External.File.hasValue() +
-                           External.Server.hasValue() + *External.IsNone;
+    unsigned SourceCount = External.File.has_value() +
+                           External.Server.has_value() + *External.IsNone;
     if (SourceCount != 1) {
       diag(Error, "Exactly one of File, Server or None must be set.",
            BlockRange);

diff  --git a/clang-tools-extra/clangd/index/YAMLSerialization.cpp b/clang-tools-extra/clangd/index/YAMLSerialization.cpp
index 79c9e1dfd9918..1ac74338298a8 100644
--- a/clang-tools-extra/clangd/index/YAMLSerialization.cpp
+++ b/clang-tools-extra/clangd/index/YAMLSerialization.cpp
@@ -354,23 +354,23 @@ template <> struct MappingTraits<CompileCommandYAML> {
 
 template <> struct MappingTraits<VariantEntry> {
   static void mapping(IO &IO, VariantEntry &Variant) {
-    if (IO.mapTag("!Symbol", Variant.Symbol.hasValue())) {
+    if (IO.mapTag("!Symbol", Variant.Symbol.has_value())) {
       if (!IO.outputting())
         Variant.Symbol.emplace();
       MappingTraits<Symbol>::mapping(IO, *Variant.Symbol);
-    } else if (IO.mapTag("!Refs", Variant.Refs.hasValue())) {
+    } else if (IO.mapTag("!Refs", Variant.Refs.has_value())) {
       if (!IO.outputting())
         Variant.Refs.emplace();
       MappingTraits<RefBundle>::mapping(IO, *Variant.Refs);
-    } else if (IO.mapTag("!Relations", Variant.Relation.hasValue())) {
+    } else if (IO.mapTag("!Relations", Variant.Relation.has_value())) {
       if (!IO.outputting())
         Variant.Relation.emplace();
       MappingTraits<Relation>::mapping(IO, *Variant.Relation);
-    } else if (IO.mapTag("!Source", Variant.Source.hasValue())) {
+    } else if (IO.mapTag("!Source", Variant.Source.has_value())) {
       if (!IO.outputting())
         Variant.Source.emplace();
       MappingTraits<IncludeGraphNode>::mapping(IO, *Variant.Source);
-    } else if (IO.mapTag("!Cmd", Variant.Cmd.hasValue())) {
+    } else if (IO.mapTag("!Cmd", Variant.Cmd.has_value())) {
       if (!IO.outputting())
         Variant.Cmd.emplace();
       MappingTraits<CompileCommandYAML>::mapping(

diff  --git a/clang-tools-extra/clangd/unittests/ConfigYAMLTests.cpp b/clang-tools-extra/clangd/unittests/ConfigYAMLTests.cpp
index ddf6f4f5fb1f6..35c6fd4c89a0c 100644
--- a/clang-tools-extra/clangd/unittests/ConfigYAMLTests.cpp
+++ b/clang-tools-extra/clangd/unittests/ConfigYAMLTests.cpp
@@ -163,9 +163,9 @@ TEST(ParseYAML, ExternalBlockNone) {
   ASSERT_THAT(Diags.Diagnostics, IsEmpty());
   ASSERT_EQ(Results.size(), 1u);
   ASSERT_TRUE(Results[0].Index.External);
-  EXPECT_FALSE(Results[0].Index.External.getValue()->File.hasValue());
-  EXPECT_FALSE(Results[0].Index.External.getValue()->MountPoint.hasValue());
-  EXPECT_FALSE(Results[0].Index.External.getValue()->Server.hasValue());
+  EXPECT_FALSE(Results[0].Index.External.getValue()->File.has_value());
+  EXPECT_FALSE(Results[0].Index.External.getValue()->MountPoint.has_value());
+  EXPECT_FALSE(Results[0].Index.External.getValue()->Server.has_value());
   EXPECT_THAT(*Results[0].Index.External.getValue()->IsNone, testing::Eq(true));
 }
 

diff  --git a/clang-tools-extra/clangd/unittests/FSTests.cpp b/clang-tools-extra/clangd/unittests/FSTests.cpp
index 575111e841dc5..81129fec98c2d 100644
--- a/clang-tools-extra/clangd/unittests/FSTests.cpp
+++ b/clang-tools-extra/clangd/unittests/FSTests.cpp
@@ -28,10 +28,10 @@ TEST(FSTests, PreambleStatusCache) {
   EXPECT_TRUE(ProduceFS->status("y"));
   EXPECT_TRUE(ProduceFS->status("main"));
 
-  EXPECT_TRUE(StatCache.lookup(testPath("x")).hasValue());
-  EXPECT_TRUE(StatCache.lookup(testPath("y")).hasValue());
+  EXPECT_TRUE(StatCache.lookup(testPath("x")).has_value());
+  EXPECT_TRUE(StatCache.lookup(testPath("y")).has_value());
   // Main file is not cached.
-  EXPECT_FALSE(StatCache.lookup(testPath("main")).hasValue());
+  EXPECT_FALSE(StatCache.lookup(testPath("main")).has_value());
 
   llvm::vfs::Status S("fake", llvm::sys::fs::UniqueID(123, 456),
                       std::chrono::system_clock::now(), 0, 0, 1024,

diff  --git a/clang-tools-extra/clangd/unittests/GlobalCompilationDatabaseTests.cpp b/clang-tools-extra/clangd/unittests/GlobalCompilationDatabaseTests.cpp
index f7a3f2ae16ad3..e335c78a7364c 100644
--- a/clang-tools-extra/clangd/unittests/GlobalCompilationDatabaseTests.cpp
+++ b/clang-tools-extra/clangd/unittests/GlobalCompilationDatabaseTests.cpp
@@ -331,7 +331,7 @@ TEST(GlobalCompilationDatabaseTest, CompileFlagsDirectory) {
   FS.Files[testPath("x/compile_flags.txt")] = "-DFOO";
   DirectoryBasedGlobalCompilationDatabase CDB(FS);
   auto Commands = CDB.getCompileCommand(testPath("x/y.cpp"));
-  ASSERT_TRUE(Commands.hasValue());
+  ASSERT_TRUE(Commands.has_value());
   EXPECT_THAT(Commands.getValue().CommandLine, Contains("-DFOO"));
   // Make sure we pick the right working directory.
   EXPECT_EQ(testPath("x"), Commands.getValue().Directory);

diff  --git a/clang-tools-extra/clangd/unittests/HeaderSourceSwitchTests.cpp b/clang-tools-extra/clangd/unittests/HeaderSourceSwitchTests.cpp
index b2d7a7ee77240..97c10544a8a2b 100644
--- a/clang-tools-extra/clangd/unittests/HeaderSourceSwitchTests.cpp
+++ b/clang-tools-extra/clangd/unittests/HeaderSourceSwitchTests.cpp
@@ -33,11 +33,11 @@ TEST(HeaderSourceSwitchTest, FileHeuristic) {
   FS.Files[Invalid];
   Optional<Path> PathResult =
       getCorrespondingHeaderOrSource(FooCpp, FS.view(llvm::None));
-  EXPECT_TRUE(PathResult.hasValue());
+  EXPECT_TRUE(PathResult.has_value());
   ASSERT_EQ(PathResult.getValue(), FooH);
 
   PathResult = getCorrespondingHeaderOrSource(FooH, FS.view(llvm::None));
-  EXPECT_TRUE(PathResult.hasValue());
+  EXPECT_TRUE(PathResult.has_value());
   ASSERT_EQ(PathResult.getValue(), FooCpp);
 
   // Test with header file in capital letters and 
diff erent extension, source
@@ -48,7 +48,7 @@ TEST(HeaderSourceSwitchTest, FileHeuristic) {
   FS.Files[FooC];
   FS.Files[FooHH];
   PathResult = getCorrespondingHeaderOrSource(FooC, FS.view(llvm::None));
-  EXPECT_TRUE(PathResult.hasValue());
+  EXPECT_TRUE(PathResult.has_value());
   ASSERT_EQ(PathResult.getValue(), FooHH);
 
   // Test with both capital letters
@@ -57,7 +57,7 @@ TEST(HeaderSourceSwitchTest, FileHeuristic) {
   FS.Files[Foo2C];
   FS.Files[Foo2HH];
   PathResult = getCorrespondingHeaderOrSource(Foo2C, FS.view(llvm::None));
-  EXPECT_TRUE(PathResult.hasValue());
+  EXPECT_TRUE(PathResult.has_value());
   ASSERT_EQ(PathResult.getValue(), Foo2HH);
 
   // Test with source file as capital letter and .hxx header file
@@ -67,13 +67,13 @@ TEST(HeaderSourceSwitchTest, FileHeuristic) {
   FS.Files[Foo3C];
   FS.Files[Foo3HXX];
   PathResult = getCorrespondingHeaderOrSource(Foo3C, FS.view(llvm::None));
-  EXPECT_TRUE(PathResult.hasValue());
+  EXPECT_TRUE(PathResult.has_value());
   ASSERT_EQ(PathResult.getValue(), Foo3HXX);
 
   // Test if asking for a corresponding file that doesn't exist returns an empty
   // string.
   PathResult = getCorrespondingHeaderOrSource(Invalid, FS.view(llvm::None));
-  EXPECT_FALSE(PathResult.hasValue());
+  EXPECT_FALSE(PathResult.has_value());
 }
 
 MATCHER_P(declNamed, Name, "") {

diff  --git a/clang-tools-extra/clangd/unittests/LSPBinderTests.cpp b/clang-tools-extra/clangd/unittests/LSPBinderTests.cpp
index 8b9363ba08655..97067b5382590 100644
--- a/clang-tools-extra/clangd/unittests/LSPBinderTests.cpp
+++ b/clang-tools-extra/clangd/unittests/LSPBinderTests.cpp
@@ -93,10 +93,10 @@ TEST(LSPBinderTest, IncomingCalls) {
 
   auto &RawPlusOne = RawHandlers.MethodHandlers["plusOne"];
   RawPlusOne(1, capture(Reply));
-  ASSERT_TRUE(Reply.hasValue());
+  ASSERT_TRUE(Reply.has_value());
   EXPECT_THAT_EXPECTED(Reply.getValue(), llvm::HasValue(2));
   RawPlusOne("foo", capture(Reply));
-  ASSERT_TRUE(Reply.hasValue());
+  ASSERT_TRUE(Reply.has_value());
   EXPECT_THAT_EXPECTED(
       Reply.getValue(),
       llvm::FailedWithMessage(
@@ -104,7 +104,7 @@ TEST(LSPBinderTest, IncomingCalls) {
 
   auto &RawFail = RawHandlers.MethodHandlers["fail"];
   RawFail(2, capture(Reply));
-  ASSERT_TRUE(Reply.hasValue());
+  ASSERT_TRUE(Reply.has_value());
   EXPECT_THAT_EXPECTED(Reply.getValue(), llvm::FailedWithMessage("X=2"));
 
   auto &RawNotify = RawHandlers.NotificationHandlers["notify"];
@@ -117,7 +117,7 @@ TEST(LSPBinderTest, IncomingCalls) {
 
   auto &RawCmdPlusOne = RawHandlers.CommandHandlers["cmdPlusOne"];
   RawCmdPlusOne(1, capture(Reply));
-  ASSERT_TRUE(Reply.hasValue());
+  ASSERT_TRUE(Reply.has_value());
   EXPECT_THAT_EXPECTED(Reply.getValue(), llvm::HasValue(2));
 
   // None of this generated any outgoing traffic.
@@ -139,7 +139,7 @@ TEST(LSPBinderTest, OutgoingCalls) {
   llvm::Optional<llvm::Expected<Foo>> Reply;
   Echo(Foo{2}, capture(Reply));
   EXPECT_THAT(RawOutgoing.take("echo"), ElementsAre(llvm::json::Value(2)));
-  ASSERT_TRUE(Reply.hasValue());
+  ASSERT_TRUE(Reply.has_value());
   EXPECT_THAT_EXPECTED(Reply.getValue(), llvm::HasValue(Foo{2}));
 
   // JSON response is integer, can't be parsed as string.
@@ -147,14 +147,14 @@ TEST(LSPBinderTest, OutgoingCalls) {
   WrongSignature(Foo{2}, capture(WrongTypeReply));
   EXPECT_THAT(RawOutgoing.take("wrongSignature"),
               ElementsAre(llvm::json::Value(2)));
-  ASSERT_TRUE(Reply.hasValue());
+  ASSERT_TRUE(Reply.has_value());
   EXPECT_THAT_EXPECTED(WrongTypeReply.getValue(),
                        llvm::FailedWithMessage(
                            HasSubstr("failed to decode wrongSignature reply")));
 
   Fail(Foo{2}, capture(Reply));
   EXPECT_THAT(RawOutgoing.take("fail"), ElementsAre(llvm::json::Value(2)));
-  ASSERT_TRUE(Reply.hasValue());
+  ASSERT_TRUE(Reply.has_value());
   EXPECT_THAT_EXPECTED(Reply.getValue(), llvm::FailedWithMessage("Params=2"));
 }
 

diff  --git a/clang-tools-extra/clangd/unittests/TidyProviderTests.cpp b/clang-tools-extra/clangd/unittests/TidyProviderTests.cpp
index df3dcac0aa51a..ece7f52d04d45 100644
--- a/clang-tools-extra/clangd/unittests/TidyProviderTests.cpp
+++ b/clang-tools-extra/clangd/unittests/TidyProviderTests.cpp
@@ -37,18 +37,18 @@ TEST(TidyProvider, NestedDirectories) {
   TidyProvider Provider = provideClangTidyFiles(FS);
 
   auto BaseOptions = getTidyOptionsForFile(Provider, testPath("File.cpp"));
-  ASSERT_TRUE(BaseOptions.Checks.hasValue());
+  ASSERT_TRUE(BaseOptions.Checks.has_value());
   EXPECT_EQ(*BaseOptions.Checks, "llvm-*");
   EXPECT_EQ(BaseOptions.CheckOptions.lookup("TestKey").Value, "1");
 
   auto Sub1Options = getTidyOptionsForFile(Provider, testPath("sub1/File.cpp"));
-  ASSERT_TRUE(Sub1Options.Checks.hasValue());
+  ASSERT_TRUE(Sub1Options.Checks.has_value());
   EXPECT_EQ(*Sub1Options.Checks, "misc-*");
   EXPECT_EQ(Sub1Options.CheckOptions.lookup("TestKey").Value, "2");
 
   auto Sub2Options =
       getTidyOptionsForFile(Provider, testPath("sub1/sub2/File.cpp"));
-  ASSERT_TRUE(Sub2Options.Checks.hasValue());
+  ASSERT_TRUE(Sub2Options.Checks.has_value());
   EXPECT_EQ(*Sub2Options.Checks, "misc-*,bugprone-*");
   EXPECT_EQ(Sub2Options.CheckOptions.lookup("TestKey").Value, "3");
 }

diff  --git a/clang-tools-extra/pseudo/lib/GLR.cpp b/clang-tools-extra/pseudo/lib/GLR.cpp
index 831271f1b1d4a..1664089725197 100644
--- a/clang-tools-extra/pseudo/lib/GLR.cpp
+++ b/clang-tools-extra/pseudo/lib/GLR.cpp
@@ -499,7 +499,7 @@ class GLRReduce {
       FamilySequences.emplace_back(Sequences.top().first.Rule, *Push.Seq);
       for (const GSS::Node *Base : Push.LastPop->parents()) {
         auto NextState = Lang.Table.getGoToState(Base->State, F.Symbol);
-        assert(NextState.hasValue() && "goto must succeed after reduce!");
+        assert(NextState.has_value() && "goto must succeed after reduce!");
         FamilyBases.emplace_back(*NextState, Base);
       }
 
@@ -555,7 +555,7 @@ class GLRReduce {
     const GSS::Node *Head = Heads->back();
     llvm::Optional<RuleID> RID;
     for (RuleID R : Lang.Table.getReduceRules(Head->State)) {
-      if (RID.hasValue())
+      if (RID.has_value())
         return false;
       RID = R;
     }
@@ -577,7 +577,7 @@ class GLRReduce {
     const ForestNode *Parsed =
         &Params.Forest.createSequence(Rule.Target, *RID, TempSequence);
     auto NextState = Lang.Table.getGoToState(Base->State, Rule.Target);
-    assert(NextState.hasValue() && "goto must succeed after reduce!");
+    assert(NextState.has_value() && "goto must succeed after reduce!");
     Heads->push_back(Params.GSStack.addNode(*NextState, Parsed, {Base}));
     return true;
   }
@@ -642,7 +642,7 @@ const ForestNode &glrParse(const ParseParams &Params, SymbolID StartSymbol,
 
   // The parse was successful if we're in state `_ := start-symbol .`
   auto AcceptState = Lang.Table.getGoToState(StartState, StartSymbol);
-  assert(AcceptState.hasValue() && "goto must succeed after start symbol!");
+  assert(AcceptState.has_value() && "goto must succeed after start symbol!");
   auto SearchForAccept = [&](llvm::ArrayRef<const GSS::Node *> Heads) {
     const ForestNode *Result = nullptr;
     for (const auto *Head : Heads) {

diff  --git a/clang-tools-extra/unittests/clang-doc/ClangDocTest.cpp b/clang-tools-extra/unittests/clang-doc/ClangDocTest.cpp
index b8f50bf34bed4..f3b885f8b406b 100644
--- a/clang-tools-extra/unittests/clang-doc/ClangDocTest.cpp
+++ b/clang-tools-extra/unittests/clang-doc/ClangDocTest.cpp
@@ -95,8 +95,8 @@ void CheckBaseInfo(Info *Expected, Info *Actual) {
 
 void CheckSymbolInfo(SymbolInfo *Expected, SymbolInfo *Actual) {
   CheckBaseInfo(Expected, Actual);
-  EXPECT_EQ(Expected->DefLoc.hasValue(), Actual->DefLoc.hasValue());
-  if (Expected->DefLoc && Actual->DefLoc.hasValue()) {
+  EXPECT_EQ(Expected->DefLoc.has_value(), Actual->DefLoc.has_value());
+  if (Expected->DefLoc && Actual->DefLoc.has_value()) {
     EXPECT_EQ(Expected->DefLoc->LineNumber, Actual->DefLoc->LineNumber);
     EXPECT_EQ(Expected->DefLoc->Filename, Actual->DefLoc->Filename);
   }

diff  --git a/clang-tools-extra/unittests/clang-tidy/ClangTidyOptionsTest.cpp b/clang-tools-extra/unittests/clang-tidy/ClangTidyOptionsTest.cpp
index 3558b5f346a23..5dcec035c476a 100644
--- a/clang-tools-extra/unittests/clang-tidy/ClangTidyOptionsTest.cpp
+++ b/clang-tools-extra/unittests/clang-tidy/ClangTidyOptionsTest.cpp
@@ -129,14 +129,14 @@ TEST(ParseConfiguration, MergeConfigurations) {
   EXPECT_EQ("check1,check2,check3,check4", *Options.Checks);
   EXPECT_EQ("filter2", *Options.HeaderFilterRegex);
   EXPECT_EQ("user2", *Options.User);
-  ASSERT_TRUE(Options.ExtraArgs.hasValue());
+  ASSERT_TRUE(Options.ExtraArgs.has_value());
   EXPECT_EQ("arg1,arg2,arg3,arg4", llvm::join(Options.ExtraArgs->begin(),
                                               Options.ExtraArgs->end(), ","));
-  ASSERT_TRUE(Options.ExtraArgsBefore.hasValue());
+  ASSERT_TRUE(Options.ExtraArgsBefore.has_value());
   EXPECT_EQ("arg-before1,arg-before2,arg-before3,arg-before4",
             llvm::join(Options.ExtraArgsBefore->begin(),
                        Options.ExtraArgsBefore->end(), ","));
-  ASSERT_TRUE(Options.UseColor.hasValue());
+  ASSERT_TRUE(Options.UseColor.has_value());
   EXPECT_TRUE(*Options.UseColor);
 }
 
@@ -325,9 +325,9 @@ TEST(CheckOptionsValidation, ValidIntOptions) {
 
   CHECK_VAL(TestCheck.getIntLocal("IntExpected"), 1);
   CHECK_VAL(TestCheck.getIntGlobal("GlobalIntExpected"), 1);
-  EXPECT_FALSE(TestCheck.getIntLocal("IntInvalid1").hasValue());
-  EXPECT_FALSE(TestCheck.getIntLocal("IntInvalid2").hasValue());
-  EXPECT_FALSE(TestCheck.getIntGlobal("GlobalIntInvalid").hasValue());
+  EXPECT_FALSE(TestCheck.getIntLocal("IntInvalid1").has_value());
+  EXPECT_FALSE(TestCheck.getIntLocal("IntInvalid2").has_value());
+  EXPECT_FALSE(TestCheck.getIntGlobal("GlobalIntInvalid").has_value());
   ASSERT_EQ(TestCheck.getIntLocal("DefaultedIntInvalid", 1), 1);
 
   CHECK_VAL(TestCheck.getIntLocal<bool>("BoolITrueValue"), true);
@@ -395,14 +395,14 @@ TEST(ValidConfiguration, ValidEnumOptions) {
                                             /*IgnoreCase*/ true),
             Colours::Violet);
 
-  EXPECT_FALSE(TestCheck.getIntLocal<Colours>("ValidWrongCase").hasValue());
-  EXPECT_FALSE(TestCheck.getIntLocal<Colours>("NearMiss").hasValue());
-  EXPECT_FALSE(TestCheck.getIntGlobal<Colours>("GlobalInvalid").hasValue());
+  EXPECT_FALSE(TestCheck.getIntLocal<Colours>("ValidWrongCase").has_value());
+  EXPECT_FALSE(TestCheck.getIntLocal<Colours>("NearMiss").has_value());
+  EXPECT_FALSE(TestCheck.getIntGlobal<Colours>("GlobalInvalid").has_value());
   EXPECT_FALSE(
-      TestCheck.getIntGlobal<Colours>("GlobalValidWrongCase").hasValue());
-  EXPECT_FALSE(TestCheck.getIntGlobal<Colours>("GlobalNearMiss").hasValue());
+      TestCheck.getIntGlobal<Colours>("GlobalValidWrongCase").has_value());
+  EXPECT_FALSE(TestCheck.getIntGlobal<Colours>("GlobalNearMiss").has_value());
 
-  EXPECT_FALSE(TestCheck.getIntLocal<Colours>("Invalid").hasValue());
+  EXPECT_FALSE(TestCheck.getIntLocal<Colours>("Invalid").has_value());
   EXPECT_THAT(
       DiagConsumer.take(),
       UnorderedElementsAre(

diff  --git a/clang-tools-extra/unittests/clang-tidy/OptionsProviderTest.cpp b/clang-tools-extra/unittests/clang-tidy/OptionsProviderTest.cpp
index b99d0781e3f7d..5aa3730ac5ccf 100644
--- a/clang-tools-extra/unittests/clang-tidy/OptionsProviderTest.cpp
+++ b/clang-tools-extra/unittests/clang-tidy/OptionsProviderTest.cpp
@@ -53,9 +53,9 @@ TEST(ClangTidyOptionsProvider, InMemoryFileSystems) {
   ClangTidyOptions File3Options =
       FileOpt.getOptions("ProjectRoot/SubDir1/SubDir2/SubDir3/File.cpp");
 
-  ASSERT_TRUE(File1Options.Checks.hasValue());
+  ASSERT_TRUE(File1Options.Checks.has_value());
   EXPECT_EQ(*File1Options.Checks, "-*,clang-diagnostic-*,readability-*");
-  ASSERT_TRUE(File2Options.Checks.hasValue());
+  ASSERT_TRUE(File2Options.Checks.has_value());
   EXPECT_EQ(*File2Options.Checks, "bugprone-*,misc-*,clang-diagnostic-*");
 
   // 2 and 3 should use the same config so these should also be the same.

diff  --git a/clang/include/clang/APINotes/Types.h b/clang/include/clang/APINotes/Types.h
index d795869319950..0e5b43080e4bb 100644
--- a/clang/include/clang/APINotes/Types.h
+++ b/clang/include/clang/APINotes/Types.h
@@ -76,7 +76,7 @@ class CommonEntityInfo {
   }
 
   void setSwiftPrivate(llvm::Optional<bool> Private) {
-    SwiftPrivateSpecified = Private.hasValue();
+    SwiftPrivateSpecified = Private.has_value();
     SwiftPrivate = Private ? *Private : 0;
   }
 

diff  --git a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h
index a01b32669ce3f..15295e4f6e4ac 100644
--- a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h
+++ b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h
@@ -414,7 +414,8 @@ class CallEvent {
   bool isArgumentConstructedDirectly(unsigned Index) const {
     // This assumes that the object was not yet removed from the state.
     return ExprEngine::getObjectUnderConstruction(
-        getState(), {getOriginExpr(), Index}, getLocationContext()).hasValue();
+               getState(), {getOriginExpr(), Index}, getLocationContext())
+        .has_value();
   }
 
   /// Some calls have parameter numbering mismatched from argument numbering.

diff  --git a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h
index 4b6cbd516628a..f1f5169f63c0b 100644
--- a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h
+++ b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h
@@ -59,15 +59,11 @@ class ConditionTruthVal {
   bool isConstrainedFalse() const { return Val && !Val.getValue(); }
 
   /// Return true if the constrained is perfectly constrained.
-  bool isConstrained() const {
-    return Val.hasValue();
-  }
+  bool isConstrained() const { return Val.has_value(); }
 
   /// Return true if the constrained is underconstrained and we do not know
   /// if the constraint is true of value.
-  bool isUnderconstrained() const {
-    return !Val.hasValue();
-  }
+  bool isUnderconstrained() const { return !Val.has_value(); }
 };
 
 class ConstraintManager {

diff  --git a/clang/include/clang/Tooling/DependencyScanning/DependencyScanningFilesystem.h b/clang/include/clang/Tooling/DependencyScanning/DependencyScanningFilesystem.h
index e0d16df92e1a4..219c68933a363 100644
--- a/clang/include/clang/Tooling/DependencyScanning/DependencyScanningFilesystem.h
+++ b/clang/include/clang/Tooling/DependencyScanning/DependencyScanningFilesystem.h
@@ -94,7 +94,7 @@ class CachedFileSystemEntry {
     assert(!isDirectory() && "not a file");
     assert(Contents && "contents not initialized");
     if (auto *Directives = Contents->DepDirectives.load()) {
-      if (Directives->hasValue())
+      if (Directives->has_value())
         return ArrayRef<dependency_directives_scan::Directive>(
             Directives->getValue());
     }

diff  --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp
index e782fdd2ca23a..803164c9c7ace 100644
--- a/clang/lib/Sema/SemaCodeComplete.cpp
+++ b/clang/lib/Sema/SemaCodeComplete.cpp
@@ -5362,8 +5362,8 @@ class ConceptInfo {
       // Overwrite existing if the new member has more info.
       // The preference of . vs :: vs -> is fairly arbitrary.
       if (/*Inserted*/ R.second ||
-          std::make_tuple(M.ArgTypes.hasValue(), M.ResultType != nullptr,
-                          M.Operator) > std::make_tuple(O.ArgTypes.hasValue(),
+          std::make_tuple(M.ArgTypes.has_value(), M.ResultType != nullptr,
+                          M.Operator) > std::make_tuple(O.ArgTypes.has_value(),
                                                         O.ResultType != nullptr,
                                                         O.Operator))
         O = std::move(M);

diff  --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp
index d5125d2ff445d..767ee097c0d7e 100644
--- a/clang/lib/Sema/SemaOpenMP.cpp
+++ b/clang/lib/Sema/SemaOpenMP.cpp
@@ -840,7 +840,7 @@ class DSAStackTy {
   /// false - otherwise.
   bool isOrderedRegion() const {
     if (const SharingMapTy *Top = getTopOfStackOrNull())
-      return Top->OrderedRegion.hasValue();
+      return Top->OrderedRegion.has_value();
     return false;
   }
   /// Returns optional parameter for the ordered region.
@@ -854,7 +854,7 @@ class DSAStackTy {
   /// 'ordered' clause), false - otherwise.
   bool isParentOrderedRegion() const {
     if (const SharingMapTy *Parent = getSecondOnStackOrNull())
-      return Parent->OrderedRegion.hasValue();
+      return Parent->OrderedRegion.has_value();
     return false;
   }
   /// Returns optional parameter for the ordered region.
@@ -7831,9 +7831,9 @@ class OpenMPIterationSpaceChecker {
   /// Return true if any expression is dependent.
   bool dependent() const;
   /// Returns true if the initializer forms non-rectangular loop.
-  bool doesInitDependOnLC() const { return InitDependOnLC.hasValue(); }
+  bool doesInitDependOnLC() const { return InitDependOnLC.has_value(); }
   /// Returns true if the condition forms non-rectangular loop.
-  bool doesCondDependOnLC() const { return CondDependOnLC.hasValue(); }
+  bool doesCondDependOnLC() const { return CondDependOnLC.has_value(); }
   /// Returns index of the loop we depend on (starting from 1), or 0 otherwise.
   unsigned getLoopDependentIdx() const {
     return InitDependOnLC.value_or(CondDependOnLC.value_or(0));
@@ -8774,10 +8774,10 @@ std::pair<Expr *, Expr *> OpenMPIterationSpaceChecker::buildMinMaxValues(
   Expr *MaxExpr = nullptr;
   Expr *LBExpr = TestIsLessOp.getValue() ? LB : UB;
   Expr *UBExpr = TestIsLessOp.getValue() ? UB : LB;
-  bool LBNonRect = TestIsLessOp.getValue() ? InitDependOnLC.hasValue()
-                                           : CondDependOnLC.hasValue();
-  bool UBNonRect = TestIsLessOp.getValue() ? CondDependOnLC.hasValue()
-                                           : InitDependOnLC.hasValue();
+  bool LBNonRect = TestIsLessOp.getValue() ? InitDependOnLC.has_value()
+                                           : CondDependOnLC.has_value();
+  bool UBNonRect = TestIsLessOp.getValue() ? CondDependOnLC.has_value()
+                                           : InitDependOnLC.has_value();
   Expr *Lower =
       LBNonRect ? LBExpr : tryBuildCapture(SemaRef, LBExpr, Captures).get();
   Expr *Upper =

diff  --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp
index 290557386e63d..678105360431e 100644
--- a/clang/lib/Serialization/ASTWriter.cpp
+++ b/clang/lib/Serialization/ASTWriter.cpp
@@ -1888,8 +1888,8 @@ void ASTWriter::WriteHeaderSearch(const HeaderSearch &HS) {
         // without this file existing on disk.
         if (!U.Size || (!U.ModTime && IncludeTimestamps)) {
           PP->Diag(U.FileNameLoc, diag::err_module_no_size_mtime_for_header)
-            << WritingModule->getFullModuleName() << U.Size.hasValue()
-            << U.FileName;
+              << WritingModule->getFullModuleName() << U.Size.has_value()
+              << U.FileName;
           continue;
         }
 

diff  --git a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp
index a2efe14f10453..4d6b82e63f6a4 100644
--- a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp
+++ b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp
@@ -2363,15 +2363,15 @@ PathSensitiveBugReport::getInterestingnessKind(const MemRegion *R) const {
 }
 
 bool PathSensitiveBugReport::isInteresting(SVal V) const {
-  return getInterestingnessKind(V).hasValue();
+  return getInterestingnessKind(V).has_value();
 }
 
 bool PathSensitiveBugReport::isInteresting(SymbolRef sym) const {
-  return getInterestingnessKind(sym).hasValue();
+  return getInterestingnessKind(sym).has_value();
 }
 
 bool PathSensitiveBugReport::isInteresting(const MemRegion *R) const {
-  return getInterestingnessKind(R).hasValue();
+  return getInterestingnessKind(R).has_value();
 }
 
 bool PathSensitiveBugReport::isInteresting(const LocationContext *LC)  const {

diff  --git a/clang/unittests/ASTMatchers/Dynamic/ParserTest.cpp b/clang/unittests/ASTMatchers/Dynamic/ParserTest.cpp
index eaba6b762c026..312456625c4bc 100644
--- a/clang/unittests/ASTMatchers/Dynamic/ParserTest.cpp
+++ b/clang/unittests/ASTMatchers/Dynamic/ParserTest.cpp
@@ -449,27 +449,27 @@ TEST(ParserTest, ParseMultiline) {
   )
 )matcher";
     Diagnostics Error;
-    EXPECT_TRUE(Parser::parseMatcherExpression(Code, &Error).hasValue());
+    EXPECT_TRUE(Parser::parseMatcherExpression(Code, &Error).has_value());
   }
 
   {
     Code = R"matcher(decl(decl()
 , decl()))matcher";
     Diagnostics Error;
-    EXPECT_TRUE(Parser::parseMatcherExpression(Code, &Error).hasValue());
+    EXPECT_TRUE(Parser::parseMatcherExpression(Code, &Error).has_value());
   }
 
   {
     Code = R"matcher(decl(decl(),
 decl()))matcher";
     Diagnostics Error;
-    EXPECT_TRUE(Parser::parseMatcherExpression(Code, &Error).hasValue());
+    EXPECT_TRUE(Parser::parseMatcherExpression(Code, &Error).has_value());
   }
 
   {
     Code = "namedDecl(hasName(\"n\"\n))";
     Diagnostics Error;
-    EXPECT_TRUE(Parser::parseMatcherExpression(Code, &Error).hasValue());
+    EXPECT_TRUE(Parser::parseMatcherExpression(Code, &Error).has_value());
   }
 
   {

diff  --git a/clang/unittests/Analysis/FlowSensitive/TypeErasedDataflowAnalysisTest.cpp b/clang/unittests/Analysis/FlowSensitive/TypeErasedDataflowAnalysisTest.cpp
index 594764b4e71bd..27b767101692e 100644
--- a/clang/unittests/Analysis/FlowSensitive/TypeErasedDataflowAnalysisTest.cpp
+++ b/clang/unittests/Analysis/FlowSensitive/TypeErasedDataflowAnalysisTest.cpp
@@ -82,8 +82,8 @@ TEST(DataflowAnalysisTest, NoopAnalysis) {
         return NoopAnalysis(C, false);
       }));
   EXPECT_EQ(BlockStates.size(), 2u);
-  EXPECT_TRUE(BlockStates[0].hasValue());
-  EXPECT_TRUE(BlockStates[1].hasValue());
+  EXPECT_TRUE(BlockStates[0].has_value());
+  EXPECT_TRUE(BlockStates[1].has_value());
 }
 
 struct NonConvergingLattice {

diff  --git a/clang/unittests/Analysis/MacroExpansionContextTest.cpp b/clang/unittests/Analysis/MacroExpansionContextTest.cpp
index 7cee64c1b9b0c..2f28c596930f6 100644
--- a/clang/unittests/Analysis/MacroExpansionContextTest.cpp
+++ b/clang/unittests/Analysis/MacroExpansionContextTest.cpp
@@ -121,14 +121,14 @@ TEST_F(MacroExpansionContextTest, IgnoresPragmas) {
   EXPECT_EQ("\n=============== ExpansionRanges ===============\n",
             dumpExpansionRanges(*Ctx));
 
-  EXPECT_FALSE(Ctx->getExpandedText(at(2, 1)).hasValue());
-  EXPECT_FALSE(Ctx->getOriginalText(at(2, 1)).hasValue());
+  EXPECT_FALSE(Ctx->getExpandedText(at(2, 1)).has_value());
+  EXPECT_FALSE(Ctx->getOriginalText(at(2, 1)).has_value());
 
-  EXPECT_FALSE(Ctx->getExpandedText(at(2, 3)).hasValue());
-  EXPECT_FALSE(Ctx->getOriginalText(at(2, 3)).hasValue());
+  EXPECT_FALSE(Ctx->getExpandedText(at(2, 3)).has_value());
+  EXPECT_FALSE(Ctx->getOriginalText(at(2, 3)).has_value());
 
-  EXPECT_FALSE(Ctx->getExpandedText(at(3, 3)).hasValue());
-  EXPECT_FALSE(Ctx->getOriginalText(at(3, 3)).hasValue());
+  EXPECT_FALSE(Ctx->getExpandedText(at(3, 3)).has_value());
+  EXPECT_FALSE(Ctx->getOriginalText(at(3, 3)).has_value());
 }
 
 TEST_F(MacroExpansionContextTest, NoneForNonExpansionLocations) {
@@ -142,33 +142,33 @@ EMPTY zz
   //      zz
 
   // That's the beginning of the definition of EMPTY.
-  EXPECT_FALSE(Ctx->getExpandedText(at(2, 11)).hasValue());
-  EXPECT_FALSE(Ctx->getOriginalText(at(2, 11)).hasValue());
+  EXPECT_FALSE(Ctx->getExpandedText(at(2, 11)).has_value());
+  EXPECT_FALSE(Ctx->getOriginalText(at(2, 11)).has_value());
 
   // The space before the first expansion of EMPTY.
-  EXPECT_FALSE(Ctx->getExpandedText(at(3, 9)).hasValue());
-  EXPECT_FALSE(Ctx->getOriginalText(at(3, 9)).hasValue());
+  EXPECT_FALSE(Ctx->getExpandedText(at(3, 9)).has_value());
+  EXPECT_FALSE(Ctx->getOriginalText(at(3, 9)).has_value());
 
   // The beginning of the first expansion of EMPTY.
-  EXPECT_TRUE(Ctx->getExpandedText(at(3, 10)).hasValue());
-  EXPECT_TRUE(Ctx->getOriginalText(at(3, 10)).hasValue());
+  EXPECT_TRUE(Ctx->getExpandedText(at(3, 10)).has_value());
+  EXPECT_TRUE(Ctx->getOriginalText(at(3, 10)).has_value());
 
   // Pointing inside of the token EMPTY, but not at the beginning.
   // FIXME: We only deal with begin locations.
-  EXPECT_FALSE(Ctx->getExpandedText(at(3, 11)).hasValue());
-  EXPECT_FALSE(Ctx->getOriginalText(at(3, 11)).hasValue());
+  EXPECT_FALSE(Ctx->getExpandedText(at(3, 11)).has_value());
+  EXPECT_FALSE(Ctx->getOriginalText(at(3, 11)).has_value());
 
   // Same here.
-  EXPECT_FALSE(Ctx->getExpandedText(at(3, 12)).hasValue());
-  EXPECT_FALSE(Ctx->getOriginalText(at(3, 12)).hasValue());
+  EXPECT_FALSE(Ctx->getExpandedText(at(3, 12)).has_value());
+  EXPECT_FALSE(Ctx->getOriginalText(at(3, 12)).has_value());
 
   // The beginning of the last expansion of EMPTY.
-  EXPECT_TRUE(Ctx->getExpandedText(at(4, 1)).hasValue());
-  EXPECT_TRUE(Ctx->getOriginalText(at(4, 1)).hasValue());
+  EXPECT_TRUE(Ctx->getExpandedText(at(4, 1)).has_value());
+  EXPECT_TRUE(Ctx->getOriginalText(at(4, 1)).has_value());
 
   // Same as for the 3:11 case.
-  EXPECT_FALSE(Ctx->getExpandedText(at(4, 2)).hasValue());
-  EXPECT_FALSE(Ctx->getOriginalText(at(4, 2)).hasValue());
+  EXPECT_FALSE(Ctx->getExpandedText(at(4, 2)).has_value());
+  EXPECT_FALSE(Ctx->getOriginalText(at(4, 2)).has_value());
 }
 
 TEST_F(MacroExpansionContextTest, EmptyExpansions) {
@@ -388,8 +388,8 @@ TEST_F(MacroExpansionContextTest, RedefUndef) {
   EXPECT_EQ("Hi", Ctx->getOriginalText(at(5, 3)).getValue());
 
   // There was no macro expansion at 7:3, we should expect None.
-  EXPECT_FALSE(Ctx->getExpandedText(at(7, 3)).hasValue());
-  EXPECT_FALSE(Ctx->getOriginalText(at(7, 3)).hasValue());
+  EXPECT_FALSE(Ctx->getExpandedText(at(7, 3)).has_value());
+  EXPECT_FALSE(Ctx->getOriginalText(at(7, 3)).has_value());
 }
 
 TEST_F(MacroExpansionContextTest, UnbalacedParenthesis) {

diff  --git a/clang/unittests/Basic/DarwinSDKInfoTest.cpp b/clang/unittests/Basic/DarwinSDKInfoTest.cpp
index 8d720c2e0a6f0..d56e13d839162 100644
--- a/clang/unittests/Basic/DarwinSDKInfoTest.cpp
+++ b/clang/unittests/Basic/DarwinSDKInfoTest.cpp
@@ -64,14 +64,14 @@ TEST(DarwinSDKInfo, VersionMappingParseEmpty) {
   llvm::json::Object Obj({});
   EXPECT_FALSE(
       DarwinSDKInfo::RelatedTargetVersionMapping::parseJSON(Obj, VersionTuple())
-          .hasValue());
+          .has_value());
 }
 
 TEST(DarwinSDKInfo, VersionMappingParseError) {
   llvm::json::Object Obj({{"test", "1.2"}});
   EXPECT_FALSE(
       DarwinSDKInfo::RelatedTargetVersionMapping::parseJSON(Obj, VersionTuple())
-          .hasValue());
+          .has_value());
 }
 
 TEST(DarwinSDKInfoTest, ParseAndTestMappingMacCatalyst) {

diff  --git a/clang/unittests/DirectoryWatcher/DirectoryWatcherTest.cpp b/clang/unittests/DirectoryWatcher/DirectoryWatcherTest.cpp
index 73bfbe54ace63..13c9ed90d8dd3 100644
--- a/clang/unittests/DirectoryWatcher/DirectoryWatcherTest.cpp
+++ b/clang/unittests/DirectoryWatcher/DirectoryWatcherTest.cpp
@@ -258,7 +258,7 @@ void checkEventualResultWithTimeout(VerifyingConsumer &TestConsumer) {
               std::future_status::ready)
       << "The expected result state wasn't reached before the time-out.";
   std::unique_lock<std::mutex> L(TestConsumer.Mtx);
-  EXPECT_TRUE(TestConsumer.result().hasValue());
+  EXPECT_TRUE(TestConsumer.result().has_value());
   if (TestConsumer.result()) {
     EXPECT_TRUE(*TestConsumer.result());
   }

diff  --git a/clang/unittests/Lex/HeaderSearchTest.cpp b/clang/unittests/Lex/HeaderSearchTest.cpp
index 87d1c01650987..93b4512809ab1 100644
--- a/clang/unittests/Lex/HeaderSearchTest.cpp
+++ b/clang/unittests/Lex/HeaderSearchTest.cpp
@@ -200,7 +200,7 @@ TEST_F(HeaderSearchTest, HeaderFrameworkLookup) {
       /*RelativePath=*/nullptr, /*RequestingModule=*/nullptr,
       /*SuggestedModule=*/nullptr, /*IsMapped=*/nullptr, &IsFrameworkFound);
 
-  EXPECT_TRUE(FoundFile.hasValue());
+  EXPECT_TRUE(FoundFile.has_value());
   EXPECT_TRUE(IsFrameworkFound);
   auto &FE = FoundFile.getValue();
   auto FI = Search.getExistingFileInfo(FE);
@@ -269,7 +269,7 @@ TEST_F(HeaderSearchTest, HeaderMapFrameworkLookup) {
       /*SuggestedModule=*/nullptr, &IsMapped,
       /*IsFrameworkFound=*/nullptr);
 
-  EXPECT_TRUE(FoundFile.hasValue());
+  EXPECT_TRUE(FoundFile.has_value());
   EXPECT_TRUE(IsMapped);
   auto &FE = FoundFile.getValue();
   auto FI = Search.getExistingFileInfo(FE);

diff  --git a/clang/unittests/StaticAnalyzer/SValTest.cpp b/clang/unittests/StaticAnalyzer/SValTest.cpp
index 2e2970a0a289b..bb6c9743ae70e 100644
--- a/clang/unittests/StaticAnalyzer/SValTest.cpp
+++ b/clang/unittests/StaticAnalyzer/SValTest.cpp
@@ -305,13 +305,13 @@ void foo(int x) {
   EXPECT_EQ("TestUnion", CRecordType->getDecl()->getName());
 
   auto D = getByName("d").getAs<nonloc::CompoundVal>();
-  ASSERT_TRUE(D.hasValue());
+  ASSERT_TRUE(D.has_value());
   auto Begin = D->begin();
   ASSERT_NE(D->end(), Begin);
   ++Begin;
   ASSERT_EQ(D->end(), Begin);
   auto LD = D->begin()->getAs<nonloc::LazyCompoundVal>();
-  ASSERT_TRUE(LD.hasValue());
+  ASSERT_TRUE(LD.has_value());
   auto LDT = LD->getType(Context);
   ASSERT_FALSE(LDT.isNull());
   const auto *DElaboratedType = dyn_cast<ElaboratedType>(LDT);


        


More information about the cfe-commits mailing list