[llvm] 08c8280 - Undo one llvm::Optional => std::optional

Paul Robinson via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 16 09:41:28 PST 2022


Author: Paul Robinson
Date: 2022-12-16T09:41:20-08:00
New Revision: 08c8280d5d8af7fb995aec8fc00b8cfbca4e9505

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

LOG: Undo one llvm::Optional => std::optional

Using std::optional in Support/TypeTraitsTest.cpp causes gcc 7.5 to
complain. No public bots run a gcc that old, but we have internal bots
that do.

/home/probinson/projects/llvm-org/llvm-project/llvm/unittests/Support/TypeTraitsTest.cpp: In instantiation of ‘void {anonymous}::triviality::TrivialityTester() [with T = std::optional<int>; bool IsTriviallyCopyConstructible = true; bool IsTriviallyMoveConstructible = true]’:
/home/probinson/projects/llvm-org/llvm-project/llvm/unittests/Support/TypeTraitsTest.cpp:121:52:   required from here
/home/probinson/projects/llvm-org/llvm-project/llvm/unittests/Support/TypeTraitsTest.cpp:29:3: error: static assertion failed: Mismatch in expected trivial copy construction!
   static_assert(llvm::is_trivially_copy_constructible<T>::value ==
   ^~~~~~~~~~~~~
/home/probinson/projects/llvm-org/llvm-project/llvm/unittests/Support/TypeTraitsTest.cpp:32:3: error: static assertion failed: Mismatch in expected trivial move construction!
   static_assert(llvm::is_trivially_move_constructible<T>::value ==
   ^~~~~~~~~~~~~

Added: 
    

Modified: 
    llvm/unittests/Support/TypeTraitsTest.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/unittests/Support/TypeTraitsTest.cpp b/llvm/unittests/Support/TypeTraitsTest.cpp
index 71383ac63359f..734e50afa2db3 100644
--- a/llvm/unittests/Support/TypeTraitsTest.cpp
+++ b/llvm/unittests/Support/TypeTraitsTest.cpp
@@ -118,7 +118,7 @@ TEST(Triviality, ADT) {
   TrivialityTester<llvm::StringRef, true, true>();
   TrivialityTester<llvm::ArrayRef<int>, true, true>();
   TrivialityTester<llvm::PointerIntPair<int *, 2>, true, true>();
-  TrivialityTester<std::optional<int>, true, true>();
+  TrivialityTester<llvm::Optional<int>, true, true>();
 }
 
 } // namespace triviality


        


More information about the llvm-commits mailing list