summaryrefslogtreecommitdiff
path: root/absl/memory/memory_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'absl/memory/memory_test.cc')
-rw-r--r--absl/memory/memory_test.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/absl/memory/memory_test.cc b/absl/memory/memory_test.cc
index 8a5f5522..7d047ca0 100644
--- a/absl/memory/memory_test.cc
+++ b/absl/memory/memory_test.cc
@@ -138,6 +138,16 @@ TEST(Make_UniqueTest, Array) {
EXPECT_THAT(ArrayWatch::allocs(), ElementsAre(5 * sizeof(ArrayWatch)));
}
+TEST(Make_UniqueTest, NotAmbiguousWithStdMakeUnique) {
+ // Ensure that absl::make_unique is not ambiguous with std::make_unique.
+ // In C++14 mode, the below call to make_unique has both types as candidates.
+ struct TakesStdType {
+ explicit TakesStdType(const std::vector<int> &vec) {}
+ };
+ using absl::make_unique;
+ make_unique<TakesStdType>(std::vector<int>());
+}
+
#if 0
// TODO(billydonahue): Make a proper NC test.
// These tests shouldn't compile.