summaryrefslogtreecommitdiff
path: root/absl/memory/memory_test.cc
diff options
context:
space:
mode:
authorGravatar Gennadiy Civil <gennadiycivil@users.noreply.github.com>2017-10-30 10:56:35 -0400
committerGravatar GitHub <noreply@github.com>2017-10-30 10:56:35 -0400
commit200b5a7cb0fb256ab47c933b3150aed91d9d3470 (patch)
tree300713d880c593eb36cc6cea4bc8d1073bb03112 /absl/memory/memory_test.cc
parentd5134a7f11e32d11caa67e75ae2ae2e506fb54ba (diff)
parent0fece732a21c5ae8fef5fa8b3f0b8487bca68d83 (diff)
Merge branch 'master' into master
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.