summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/iterators
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2019-08-03 23:54:29 +0000
committerEric Fiselier <eric@efcs.ca>2019-08-03 23:54:29 +0000
commitfcd549a7d8284a8e7c763fee3da2206acd8cdc4f (patch)
tree59861c49742757d9a123ef9322e56c5890852149 /libcxx/test/std/iterators
parent44b16bd4a5b20ce8b4e9ef56836123a2038f3670 (diff)
downloadbcm5719-llvm-fcd549a7d8284a8e7c763fee3da2206acd8cdc4f.tar.gz
bcm5719-llvm-fcd549a7d8284a8e7c763fee3da2206acd8cdc4f.zip
Suppress -Wctad-maybe-unsupported on types w/o deduction guides.
There are a handful of standard library types that are intended to support CTAD but don't need any explicit deduction guides to do so. This patch adds a dummy deduction guide to those types to suppress -Wctad-maybe-unsupported (which gets emitted in user code). llvm-svn: 367770
Diffstat (limited to 'libcxx/test/std/iterators')
-rw-r--r--libcxx/test/std/iterators/predef.iterators/insert.iterators/back.insert.iterator/implicit_ctad.pass.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/libcxx/test/std/iterators/predef.iterators/insert.iterators/back.insert.iterator/implicit_ctad.pass.cpp b/libcxx/test/std/iterators/predef.iterators/insert.iterators/back.insert.iterator/implicit_ctad.pass.cpp
new file mode 100644
index 00000000000..7c4ba6a6c29
--- /dev/null
+++ b/libcxx/test/std/iterators/predef.iterators/insert.iterators/back.insert.iterator/implicit_ctad.pass.cpp
@@ -0,0 +1,41 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <iterator>
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// UNSUPPORTED: libcpp-no-deduction-guides
+
+// class back_insert_iterator.
+
+#include <string>
+#include <iterator>
+#include <vector>
+#include <cassert>
+#include <cstddef>
+#include <functional>
+
+#include "test_macros.h"
+
+int main(int, char**)
+{
+ {
+ std::string s;
+ std::back_insert_iterator bs(s);
+ ASSERT_SAME_TYPE(decltype(bs), std::back_insert_iterator<std::string>);
+ }
+ {
+ std::vector<int> v;
+ std::back_insert_iterator bv(v);
+ std::back_insert_iterator cp(bv);
+ ASSERT_SAME_TYPE(decltype(bv), std::back_insert_iterator<std::vector<int>>);
+ ASSERT_SAME_TYPE(decltype(cp), std::back_insert_iterator<std::vector<int>>);
+ }
+
+ return 0;
+}
OpenPOWER on IntegriCloud