[libcxx-commits] [libcxx] 8227349 - [libc++] Add missing includes to optional

Krasimir Georgiev via libcxx-commits libcxx-commits at lists.llvm.org
Thu Mar 9 05:08:01 PST 2023


Author: Krasimir Georgiev
Date: 2023-03-09T14:07:33+01:00
New Revision: 8227349f7e4f1a6ceb4cceb464c8f4420ff1dd0a

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

LOG: [libc++] Add missing includes to optional

After commit 0a4aa8a122aa097499c498b639a75b5e9a73e9f0 we see failures
like:
optional:722:7: error: missing '#include <__type_traits/conjunction.h>';
'_And' must be declared before it is used
and:
optional:683:46: error: missing '#include
<__type_traits/disjunction.h>'; '_Or' must be declared before it is used
      using __check_constructible_from_opt = _Or<

Adding these here fixes that.
I'm not familiar with the libcxx codebase, will ask the author to take a
look too.

Added: 
    

Modified: 
    libcxx/include/optional

Removed: 
    


################################################################################
diff  --git a/libcxx/include/optional b/libcxx/include/optional
index abfd9eb9fc98..eeb7ba73d998 100644
--- a/libcxx/include/optional
+++ b/libcxx/include/optional
@@ -172,6 +172,8 @@ template<class T>
 #include <__type_traits/is_trivially_destructible.h>
 #include <__type_traits/is_trivially_move_assignable.h>
 #include <__type_traits/is_trivially_move_constructible.h>
+#include <__type_traits/conjunction.h>
+#include <__type_traits/disjunction.h>
 #include <__type_traits/negation.h>
 #include <__utility/declval.h>
 #include <__utility/forward.h>


        


More information about the libcxx-commits mailing list