Undo one llvm::Optional => std::optional
authorPaul Robinson <paul.robinson@sony.com>
Fri, 16 Dec 2022 17:40:51 +0000 (09:40 -0800)
committerPaul Robinson <paul.robinson@sony.com>
Fri, 16 Dec 2022 17:41:20 +0000 (09:41 -0800)
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 ==
   ^~~~~~~~~~~~~

llvm/unittests/Support/TypeTraitsTest.cpp

index 71383ac..734e50a 100644 (file)
@@ -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