[clang] b2e6516 - [clang][Interp][NFC] Return std::nullopt explicitly from classify()

Timm Bäder via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 26 00:34:40 PDT 2023


Author: Timm Bäder
Date: 2023-07-26T09:34:26+02:00
New Revision: b2e6516fd1abdd9416c6085102523d577c8a2238

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

LOG: [clang][Interp][NFC] Return std::nullopt explicitly from classify()

Added: 
    

Modified: 
    clang/lib/AST/Interp/Context.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/Interp/Context.cpp b/clang/lib/AST/Interp/Context.cpp
index d025586d91b7d3..4c4808324c3a14 100644
--- a/clang/lib/AST/Interp/Context.cpp
+++ b/clang/lib/AST/Interp/Context.cpp
@@ -102,7 +102,7 @@ std::optional<PrimType> Context::classify(QualType T) const {
     case 8:
       return PT_Sint8;
     default:
-      return {};
+      return std::nullopt;
     }
   }
 
@@ -117,7 +117,7 @@ std::optional<PrimType> Context::classify(QualType T) const {
     case 8:
       return PT_Uint8;
     default:
-      return {};
+      return std::nullopt;
     }
   }
 
@@ -143,7 +143,7 @@ std::optional<PrimType> Context::classify(QualType T) const {
   if (const auto *DT = dyn_cast<MemberPointerType>(T))
     return classify(DT->getPointeeType());
 
-  return {};
+  return std::nullopt;
 }
 
 unsigned Context::getCharBit() const {


        


More information about the cfe-commits mailing list