diff --git a/clang/include/clang/Basic/DirectoryEntry.h b/clang/include/clang/Basic/DirectoryEntry.h --- a/clang/include/clang/Basic/DirectoryEntry.h +++ b/clang/include/clang/Basic/DirectoryEntry.h @@ -22,6 +22,8 @@ #include "llvm/ADT/STLExtras.h" #include "llvm/Support/ErrorOr.h" +#include + namespace clang { namespace FileMgr { @@ -125,7 +127,7 @@ MapEntryOptionalStorage() : MaybeRef(optional_none_tag()) {} template - explicit MapEntryOptionalStorage(llvm::in_place_t, ArgTypes &&...Args) + explicit MapEntryOptionalStorage(std::in_place_t, ArgTypes &&...Args) : MaybeRef(std::forward(Args)...) {} void reset() { MaybeRef = optional_none_tag(); } @@ -189,8 +191,8 @@ OptionalStorage() = default; template - explicit OptionalStorage(in_place_t, ArgTypes &&...Args) - : StorageImpl(in_place_t{}, std::forward(Args)...) {} + explicit OptionalStorage(std::in_place_t, ArgTypes &&...Args) + : StorageImpl(std::in_place_t{}, std::forward(Args)...) {} OptionalStorage &operator=(clang::DirectoryEntryRef Ref) { StorageImpl::operator=(Ref); diff --git a/clang/include/clang/Basic/FileEntry.h b/clang/include/clang/Basic/FileEntry.h --- a/clang/include/clang/Basic/FileEntry.h +++ b/clang/include/clang/Basic/FileEntry.h @@ -24,6 +24,8 @@ #include "llvm/Support/ErrorOr.h" #include "llvm/Support/FileSystem/UniqueID.h" +#include + namespace llvm { class MemoryBuffer; @@ -222,8 +224,8 @@ OptionalStorage() = default; template - explicit OptionalStorage(in_place_t, ArgTypes &&...Args) - : StorageImpl(in_place_t{}, std::forward(Args)...) {} + explicit OptionalStorage(std::in_place_t, ArgTypes &&...Args) + : StorageImpl(std::in_place_t{}, std::forward(Args)...) {} OptionalStorage &operator=(clang::FileEntryRef Ref) { StorageImpl::operator=(Ref); diff --git a/llvm/include/llvm/ADT/Any.h b/llvm/include/llvm/ADT/Any.h --- a/llvm/include/llvm/ADT/Any.h +++ b/llvm/include/llvm/ADT/Any.h @@ -68,8 +68,8 @@ // instead. template , Any>>, + std::conjunction< + std::negation, Any>>, // We also disable this overload when an `Any` object can be // converted to the parameter type because in that case, // this constructor may combine with that conversion during @@ -80,7 +80,7 @@ // DR in `std::any` as well, but we're going ahead and // adopting it to work-around usage of `Any` with types that // need to be implicitly convertible from an `Any`. - llvm::negation>>, + std::negation>>, std::is_copy_constructible>>::value, int> = 0> Any(T &&Value) { diff --git a/llvm/include/llvm/ADT/FunctionExtras.h b/llvm/include/llvm/ADT/FunctionExtras.h --- a/llvm/include/llvm/ADT/FunctionExtras.h +++ b/llvm/include/llvm/ADT/FunctionExtras.h @@ -65,7 +65,7 @@ using EnableUnlessSameType = std::enable_if_t, ThisT>::value>; template -using EnableIfCallable = std::enable_if_t, std::is_same()(std::declval()...)), Ret>, diff --git a/llvm/include/llvm/ADT/Optional.h b/llvm/include/llvm/ADT/Optional.h --- a/llvm/include/llvm/ADT/Optional.h +++ b/llvm/include/llvm/ADT/Optional.h @@ -81,7 +81,7 @@ } template - constexpr explicit OptionalStorage(in_place_t, Args &&...args) + constexpr explicit OptionalStorage(std::in_place_t, Args &&...args) : val(std::forward(args)...), hasVal(true) {} void reset() noexcept { @@ -196,7 +196,7 @@ OptionalStorage &operator=(OptionalStorage &&other) = default; template - constexpr explicit OptionalStorage(in_place_t, Args &&...args) + constexpr explicit OptionalStorage(std::in_place_t, Args &&...args) : val(std::forward(args)...), hasVal(true) {} void reset() noexcept { @@ -275,15 +275,15 @@ constexpr Optional() = default; constexpr Optional(NoneType) {} - constexpr Optional(const T &y) : Storage(in_place, y) {} + constexpr Optional(const T &y) : Storage(std::in_place, y) {} constexpr Optional(const Optional &O) = default; - constexpr Optional(T &&y) : Storage(in_place, std::move(y)) {} + constexpr Optional(T &&y) : Storage(std::in_place, std::move(y)) {} constexpr Optional(Optional &&O) = default; template - constexpr Optional(in_place_t, ArgTypes &&...Args) - : Storage(in_place, std::forward(Args)...) {} + constexpr Optional(std::in_place_t, ArgTypes &&...Args) + : Storage(std::in_place, std::forward(Args)...) {} Optional &operator=(T &&y) { Storage = std::move(y); diff --git a/llvm/include/llvm/ADT/STLExtras.h b/llvm/include/llvm/ADT/STLExtras.h --- a/llvm/include/llvm/ADT/STLExtras.h +++ b/llvm/include/llvm/ADT/STLExtras.h @@ -155,12 +155,12 @@ /// traits class for checking whether type T is one of any of the given /// types in the variadic list. template -using is_one_of = disjunction...>; +using is_one_of = std::disjunction...>; /// traits class for checking whether type T is a base class for all /// the given types in the variadic list. template -using are_base_of = conjunction...>; +using are_base_of = std::conjunction...>; namespace detail { template struct TypesAreDistinct; @@ -1386,12 +1386,12 @@ /// traits class for checking whether type T is one of any of the given /// types in the variadic list. template -using is_one_of = disjunction...>; +using is_one_of = std::disjunction...>; /// traits class for checking whether type T is a base class for all /// the given types in the variadic list. template -using are_base_of = conjunction...>; +using are_base_of = std::conjunction...>; namespace detail { template struct Visitor; @@ -1550,7 +1550,7 @@ template // We can use qsort if the iterator type is a pointer and the underlying value // is trivially copyable. -using sort_trivially_copyable = conjunction< +using sort_trivially_copyable = std::conjunction< std::is_pointer, std::is_trivially_copyable::value_type>>; } // namespace detail diff --git a/llvm/include/llvm/Support/HashBuilder.h b/llvm/include/llvm/Support/HashBuilder.h --- a/llvm/include/llvm/Support/HashBuilder.h +++ b/llvm/include/llvm/Support/HashBuilder.h @@ -76,7 +76,7 @@ template explicit HashBuilderBase(ArgTypes &&...Args) - : OptionalHasher(in_place, std::forward(Args)...), + : OptionalHasher(std::in_place, std::forward(Args)...), Hasher(*OptionalHasher) {} private: diff --git a/llvm/unittests/ADT/OptionalTest.cpp b/llvm/unittests/ADT/OptionalTest.cpp --- a/llvm/unittests/ADT/OptionalTest.cpp +++ b/llvm/unittests/ADT/OptionalTest.cpp @@ -14,7 +14,7 @@ #include "gtest/gtest.h" #include - +#include using namespace llvm; @@ -201,7 +201,7 @@ TEST(OptionalTest, InPlaceConstructionNonDefaultConstructibleTest) { NonDefaultConstructible::ResetCounts(); - { Optional A{in_place, 1}; } + { Optional A{std::in_place, 1}; } EXPECT_EQ(0u, NonDefaultConstructible::CopyConstructions); EXPECT_EQ(0u, NonDefaultConstructible::CopyAssignments); EXPECT_EQ(1u, NonDefaultConstructible::Destructions); @@ -247,7 +247,7 @@ TEST(OptionalTest, Emplace) { MultiArgConstructor::ResetCounts(); Optional A; - + A.emplace(1, 2); EXPECT_TRUE(A.has_value()); EXPECT_TRUE(A.has_value()); @@ -266,12 +266,12 @@ TEST(OptionalTest, InPlaceConstructionMultiArgConstructorTest) { MultiArgConstructor::ResetCounts(); { - Optional A{in_place, 1, 2}; + Optional A{std::in_place, 1, 2}; EXPECT_TRUE(A.has_value()); EXPECT_TRUE(A.has_value()); EXPECT_EQ(1, A->x); EXPECT_EQ(2, A->y); - Optional B{in_place, 5, false}; + Optional B{std::in_place, 5, false}; EXPECT_TRUE(B.has_value()); EXPECT_TRUE(B.has_value()); EXPECT_EQ(5, B->x); @@ -284,7 +284,7 @@ TEST(OptionalTest, InPlaceConstructionAndEmplaceEquivalentTest) { MultiArgConstructor::ResetCounts(); { - Optional A{in_place, 1, 2}; + Optional A{std::in_place, 1, 2}; Optional B; B.emplace(1, 2); EXPECT_EQ(0u, MultiArgConstructor::Destructions); @@ -442,7 +442,7 @@ TEST(OptionalTest, ImmovableInPlaceConstruction) { Immovable::ResetCounts(); - Optional A{in_place, 4}; + Optional A{std::in_place, 4}; EXPECT_TRUE((bool)A); EXPECT_EQ(4, A->val); EXPECT_EQ(1u, Immovable::Constructions);