summaryrefslogtreecommitdiff
path: root/test/std/containers
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-06-16 21:04:04 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-06-16 21:04:04 +0000
commit8462a49537476f8c62bcabfe490226af0d7c1cae (patch)
treeadbbe01182274045b7a8a9085c8f160360b9bea9 /test/std/containers
parent74c4bc8d0eddcb4786594f1c6b598094fac43859 (diff)
Notes
Diffstat (limited to 'test/std/containers')
-rw-r--r--test/std/containers/associative/map/map.ops/count0.pass.cpp7
-rw-r--r--test/std/containers/associative/map/map.ops/equal_range0.pass.cpp7
-rw-r--r--test/std/containers/associative/map/map.ops/find0.pass.cpp7
-rw-r--r--test/std/containers/associative/map/map.ops/lower_bound0.pass.cpp7
-rw-r--r--test/std/containers/associative/map/map.ops/upper_bound0.pass.cpp7
-rw-r--r--test/std/containers/associative/multimap/multimap.ops/count0.pass.cpp7
-rw-r--r--test/std/containers/associative/multimap/multimap.ops/equal_range0.pass.cpp7
-rw-r--r--test/std/containers/associative/multimap/multimap.ops/find0.pass.cpp7
-rw-r--r--test/std/containers/associative/multimap/multimap.ops/lower_bound0.pass.cpp7
-rw-r--r--test/std/containers/associative/multimap/multimap.ops/upper_bound0.pass.cpp7
-rw-r--r--test/std/containers/sequences/array/array.tuple/tuple_element.fail.cpp35
11 files changed, 95 insertions, 10 deletions
diff --git a/test/std/containers/associative/map/map.ops/count0.pass.cpp b/test/std/containers/associative/map/map.ops/count0.pass.cpp
index 0278343006a8..1fa8c4a70bd9 100644
--- a/test/std/containers/associative/map/map.ops/count0.pass.cpp
+++ b/test/std/containers/associative/map/map.ops/count0.pass.cpp
@@ -28,7 +28,12 @@
int main()
{
+ {
typedef std::map<int, double, transparent_less> M;
-
M().count(C2Int{5});
+ }
+ {
+ typedef std::map<int, double, transparent_less_not_referenceable> M;
+ M().count(C2Int{5});
+ }
}
diff --git a/test/std/containers/associative/map/map.ops/equal_range0.pass.cpp b/test/std/containers/associative/map/map.ops/equal_range0.pass.cpp
index 3b98426868e4..c254fb6a7db7 100644
--- a/test/std/containers/associative/map/map.ops/equal_range0.pass.cpp
+++ b/test/std/containers/associative/map/map.ops/equal_range0.pass.cpp
@@ -28,7 +28,12 @@
int main()
{
+ {
typedef std::map<int, double, transparent_less> M;
-
M().equal_range(C2Int{5});
+ }
+ {
+ typedef std::map<int, double, transparent_less_not_referenceable> M;
+ M().equal_range(C2Int{5});
+ }
}
diff --git a/test/std/containers/associative/map/map.ops/find0.pass.cpp b/test/std/containers/associative/map/map.ops/find0.pass.cpp
index d7de579d8b44..76fe9242a476 100644
--- a/test/std/containers/associative/map/map.ops/find0.pass.cpp
+++ b/test/std/containers/associative/map/map.ops/find0.pass.cpp
@@ -28,7 +28,12 @@
int main()
{
+ {
typedef std::map<int, double, transparent_less> M;
-
M().find(C2Int{5});
+ }
+ {
+ typedef std::map<int, double, transparent_less_not_referenceable> M;
+ M().find(C2Int{5});
+ }
}
diff --git a/test/std/containers/associative/map/map.ops/lower_bound0.pass.cpp b/test/std/containers/associative/map/map.ops/lower_bound0.pass.cpp
index ea121df73002..de7a545b6497 100644
--- a/test/std/containers/associative/map/map.ops/lower_bound0.pass.cpp
+++ b/test/std/containers/associative/map/map.ops/lower_bound0.pass.cpp
@@ -28,7 +28,12 @@
int main()
{
+ {
typedef std::map<int, double, transparent_less> M;
-
M().lower_bound(C2Int{5});
+ }
+ {
+ typedef std::map<int, double, transparent_less_not_referenceable> M;
+ M().lower_bound(C2Int{5});
+ }
}
diff --git a/test/std/containers/associative/map/map.ops/upper_bound0.pass.cpp b/test/std/containers/associative/map/map.ops/upper_bound0.pass.cpp
index 2e597b85cf0c..94508d284fd2 100644
--- a/test/std/containers/associative/map/map.ops/upper_bound0.pass.cpp
+++ b/test/std/containers/associative/map/map.ops/upper_bound0.pass.cpp
@@ -28,7 +28,12 @@
int main()
{
+ {
typedef std::map<int, double, transparent_less> M;
-
M().upper_bound(C2Int{5});
+ }
+ {
+ typedef std::map<int, double, transparent_less_not_referenceable> M;
+ M().upper_bound(C2Int{5});
+ }
}
diff --git a/test/std/containers/associative/multimap/multimap.ops/count0.pass.cpp b/test/std/containers/associative/multimap/multimap.ops/count0.pass.cpp
index b993f4f89087..289d405739ac 100644
--- a/test/std/containers/associative/multimap/multimap.ops/count0.pass.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/count0.pass.cpp
@@ -28,7 +28,12 @@
int main()
{
+ {
typedef std::multimap<int, double, transparent_less> M;
-
M().count(C2Int{5});
+ }
+ {
+ typedef std::multimap<int, double, transparent_less_not_referenceable> M;
+ M().count(C2Int{5});
+ }
}
diff --git a/test/std/containers/associative/multimap/multimap.ops/equal_range0.pass.cpp b/test/std/containers/associative/multimap/multimap.ops/equal_range0.pass.cpp
index a3a51e6ccbf9..8cdd3c03372f 100644
--- a/test/std/containers/associative/multimap/multimap.ops/equal_range0.pass.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/equal_range0.pass.cpp
@@ -28,7 +28,12 @@
int main()
{
+ {
typedef std::multimap<int, double, transparent_less> M;
-
M().equal_range(C2Int{5});
+ }
+ {
+ typedef std::multimap<int, double, transparent_less_not_referenceable> M;
+ M().equal_range(C2Int{5});
+ }
}
diff --git a/test/std/containers/associative/multimap/multimap.ops/find0.pass.cpp b/test/std/containers/associative/multimap/multimap.ops/find0.pass.cpp
index 03a6e1883051..a06ec4d702d5 100644
--- a/test/std/containers/associative/multimap/multimap.ops/find0.pass.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/find0.pass.cpp
@@ -28,7 +28,12 @@
int main()
{
+ {
typedef std::multimap<int, double, transparent_less> M;
-
M().find(C2Int{5});
+ }
+ {
+ typedef std::multimap<int, double, transparent_less_not_referenceable> M;
+ M().find(C2Int{5});
+ }
}
diff --git a/test/std/containers/associative/multimap/multimap.ops/lower_bound0.pass.cpp b/test/std/containers/associative/multimap/multimap.ops/lower_bound0.pass.cpp
index 77927bb5abed..1000aa772b31 100644
--- a/test/std/containers/associative/multimap/multimap.ops/lower_bound0.pass.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/lower_bound0.pass.cpp
@@ -28,7 +28,12 @@
int main()
{
+ {
typedef std::multimap<int, double, transparent_less> M;
-
M().lower_bound(C2Int{5});
+ }
+ {
+ typedef std::multimap<int, double, transparent_less_not_referenceable> M;
+ M().lower_bound(C2Int{5});
+ }
}
diff --git a/test/std/containers/associative/multimap/multimap.ops/upper_bound0.pass.cpp b/test/std/containers/associative/multimap/multimap.ops/upper_bound0.pass.cpp
index 3f6852d085c3..1a572e9c5070 100644
--- a/test/std/containers/associative/multimap/multimap.ops/upper_bound0.pass.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/upper_bound0.pass.cpp
@@ -28,7 +28,12 @@
int main()
{
+ {
typedef std::multimap<int, double, transparent_less> M;
-
M().upper_bound(C2Int{5});
+ }
+ {
+ typedef std::multimap<int, double, transparent_less_not_referenceable> M;
+ M().upper_bound(C2Int{5});
+ }
}
diff --git a/test/std/containers/sequences/array/array.tuple/tuple_element.fail.cpp b/test/std/containers/sequences/array/array.tuple/tuple_element.fail.cpp
new file mode 100644
index 000000000000..c9fe695f9cbd
--- /dev/null
+++ b/test/std/containers/sequences/array/array.tuple/tuple_element.fail.cpp
@@ -0,0 +1,35 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <array>
+
+// tuple_element<I, array<T, N> >::type
+
+// Prevent -Warray-bounds from issuing a diagnostic when testing with clang verify.
+#if defined(__clang__)
+#pragma clang diagnostic ignored "-Warray-bounds"
+#endif
+
+#include <array>
+#include <cassert>
+
+
+// std::array is explicitly allowed to be initialized with A a = { init-list };.
+// Disable the missing braces warning for this reason.
+#include "disable_missing_braces_warning.h"
+
+int main()
+{
+ {
+ typedef double T;
+ typedef std::array<T, 3> C;
+ std::tuple_element<3, C> foo; // expected-note {{requested here}}
+ // expected-error@array:* {{static_assert failed "Index out of bounds in std::tuple_element<> (std::array)"}}
+ }
+}