Change (void) casts to TEST_IGNORE_NODISCARD, as requested by Eric. Reviewed as https://reviews.llvm.org/D40065
llvm-svn: 318804
diff --git a/libcxx/test/std/algorithms/alg.nonmodifying/alg.search/search_n_pred.pass.cpp b/libcxx/test/std/algorithms/alg.nonmodifying/alg.search/search_n_pred.pass.cpp
index 6e8913e..ff459b3 100644
--- a/libcxx/test/std/algorithms/alg.nonmodifying/alg.search/search_n_pred.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.nonmodifying/alg.search/search_n_pred.pass.cpp
@@ -142,7 +142,7 @@
count_equal::count = 0;
// Check that we properly convert the size argument to an integral.
- (void)std::search_n(Iter(ic), Iter(ic+sc), UserDefinedIntegral<unsigned>(4), 0, count_equal());
+ TEST_IGNORE_NODISCARD std::search_n(Iter(ic), Iter(ic+sc), UserDefinedIntegral<unsigned>(4), 0, count_equal());
count_equal::count = 0;
}
diff --git a/libcxx/test/std/containers/associative/map/map.access/at.pass.cpp b/libcxx/test/std/containers/associative/map/map.access/at.pass.cpp
index 89ba194..5822706 100644
--- a/libcxx/test/std/containers/associative/map/map.access/at.pass.cpp
+++ b/libcxx/test/std/containers/associative/map/map.access/at.pass.cpp
@@ -46,7 +46,7 @@
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
- (void)m.at(6);
+ TEST_IGNORE_NODISCARD m.at(6);
assert(false);
}
catch (std::out_of_range&)
@@ -79,7 +79,7 @@
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
- (void)m.at(6);
+ TEST_IGNORE_NODISCARD m.at(6);
assert(false);
}
catch (std::out_of_range&)
@@ -115,7 +115,7 @@
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
- (void)m.at(6);
+ TEST_IGNORE_NODISCARD m.at(6);
assert(false);
}
catch (std::out_of_range&)
@@ -148,7 +148,7 @@
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
- (void)m.at(6);
+ TEST_IGNORE_NODISCARD m.at(6);
assert(false);
}
catch (std::out_of_range&)
diff --git a/libcxx/test/std/containers/associative/map/map.ops/count1.fail.cpp b/libcxx/test/std/containers/associative/map/map.ops/count1.fail.cpp
index 5ad1761..9fa9f87 100644
--- a/libcxx/test/std/containers/associative/map/map.ops/count1.fail.cpp
+++ b/libcxx/test/std/containers/associative/map/map.ops/count1.fail.cpp
@@ -34,7 +34,7 @@
{
typedef std::map<int, double, transparent_less_no_type> M;
- (void)M().count(C2Int{5});
+ TEST_IGNORE_NODISCARD M().count(C2Int{5});
}
}
#endif
diff --git a/libcxx/test/std/containers/associative/map/map.ops/count2.fail.cpp b/libcxx/test/std/containers/associative/map/map.ops/count2.fail.cpp
index bb1c32e..c638063 100644
--- a/libcxx/test/std/containers/associative/map/map.ops/count2.fail.cpp
+++ b/libcxx/test/std/containers/associative/map/map.ops/count2.fail.cpp
@@ -34,7 +34,7 @@
{
typedef std::map<int, double, transparent_less_private> M;
- (void)M().count(C2Int{5});
+ TEST_IGNORE_NODISCARD M().count(C2Int{5});
}
}
#endif
diff --git a/libcxx/test/std/containers/associative/map/map.ops/count3.fail.cpp b/libcxx/test/std/containers/associative/map/map.ops/count3.fail.cpp
index 8964384..0fddf61 100644
--- a/libcxx/test/std/containers/associative/map/map.ops/count3.fail.cpp
+++ b/libcxx/test/std/containers/associative/map/map.ops/count3.fail.cpp
@@ -34,7 +34,7 @@
{
typedef std::map<int, double, transparent_less_not_a_type> M;
- (void)M().count(C2Int{5});
+ TEST_IGNORE_NODISCARD M().count(C2Int{5});
}
}
#endif
diff --git a/libcxx/test/std/containers/associative/map/map.ops/equal_range1.fail.cpp b/libcxx/test/std/containers/associative/map/map.ops/equal_range1.fail.cpp
index 381c275..b8c8607 100644
--- a/libcxx/test/std/containers/associative/map/map.ops/equal_range1.fail.cpp
+++ b/libcxx/test/std/containers/associative/map/map.ops/equal_range1.fail.cpp
@@ -34,7 +34,7 @@
{
typedef std::map<int, double, transparent_less_no_type> M;
- (void)M().equal_range(C2Int{5});
+ TEST_IGNORE_NODISCARD M().equal_range(C2Int{5});
}
}
#endif
diff --git a/libcxx/test/std/containers/associative/map/map.ops/equal_range2.fail.cpp b/libcxx/test/std/containers/associative/map/map.ops/equal_range2.fail.cpp
index adf4a47..2fb1b2d 100644
--- a/libcxx/test/std/containers/associative/map/map.ops/equal_range2.fail.cpp
+++ b/libcxx/test/std/containers/associative/map/map.ops/equal_range2.fail.cpp
@@ -34,7 +34,7 @@
{
typedef std::map<int, double, transparent_less_private> M;
- (void)M().equal_range(C2Int{5});
+ TEST_IGNORE_NODISCARD M().equal_range(C2Int{5});
}
}
#endif
diff --git a/libcxx/test/std/containers/associative/map/map.ops/equal_range3.fail.cpp b/libcxx/test/std/containers/associative/map/map.ops/equal_range3.fail.cpp
index 88b62a0..ad499e1 100644
--- a/libcxx/test/std/containers/associative/map/map.ops/equal_range3.fail.cpp
+++ b/libcxx/test/std/containers/associative/map/map.ops/equal_range3.fail.cpp
@@ -34,7 +34,7 @@
{
typedef std::map<int, double, transparent_less_not_a_type> M;
- (void)M().equal_range(C2Int{5});
+ TEST_IGNORE_NODISCARD M().equal_range(C2Int{5});
}
}
#endif
diff --git a/libcxx/test/std/containers/associative/map/map.ops/find1.fail.cpp b/libcxx/test/std/containers/associative/map/map.ops/find1.fail.cpp
index ca4ec43..6c0f237 100644
--- a/libcxx/test/std/containers/associative/map/map.ops/find1.fail.cpp
+++ b/libcxx/test/std/containers/associative/map/map.ops/find1.fail.cpp
@@ -34,7 +34,7 @@
{
typedef std::map<int, double, transparent_less_no_type> M;
- (void)M().find(C2Int{5});
+ TEST_IGNORE_NODISCARD M().find(C2Int{5});
}
}
#endif
diff --git a/libcxx/test/std/containers/associative/map/map.ops/find2.fail.cpp b/libcxx/test/std/containers/associative/map/map.ops/find2.fail.cpp
index cf8db60..b915b43 100644
--- a/libcxx/test/std/containers/associative/map/map.ops/find2.fail.cpp
+++ b/libcxx/test/std/containers/associative/map/map.ops/find2.fail.cpp
@@ -34,7 +34,7 @@
{
typedef std::map<int, double, transparent_less_private> M;
- (void)M().find(C2Int{5});
+ TEST_IGNORE_NODISCARD M().find(C2Int{5});
}
}
#endif
diff --git a/libcxx/test/std/containers/associative/map/map.ops/find3.fail.cpp b/libcxx/test/std/containers/associative/map/map.ops/find3.fail.cpp
index 79a4ae0..9303a7f 100644
--- a/libcxx/test/std/containers/associative/map/map.ops/find3.fail.cpp
+++ b/libcxx/test/std/containers/associative/map/map.ops/find3.fail.cpp
@@ -34,7 +34,7 @@
{
typedef std::map<int, double, transparent_less_not_a_type> M;
- (void)M().find(C2Int{5});
+ TEST_IGNORE_NODISCARD M().find(C2Int{5});
}
}
#endif
diff --git a/libcxx/test/std/containers/associative/map/map.ops/lower_bound1.fail.cpp b/libcxx/test/std/containers/associative/map/map.ops/lower_bound1.fail.cpp
index 0646847..beb901c 100644
--- a/libcxx/test/std/containers/associative/map/map.ops/lower_bound1.fail.cpp
+++ b/libcxx/test/std/containers/associative/map/map.ops/lower_bound1.fail.cpp
@@ -34,7 +34,7 @@
{
typedef std::map<int, double, transparent_less_no_type> M;
- (void)M().lower_bound(C2Int{5});
+ TEST_IGNORE_NODISCARD M().lower_bound(C2Int{5});
}
}
#endif
diff --git a/libcxx/test/std/containers/associative/map/map.ops/lower_bound2.fail.cpp b/libcxx/test/std/containers/associative/map/map.ops/lower_bound2.fail.cpp
index f603007..2a2258e 100644
--- a/libcxx/test/std/containers/associative/map/map.ops/lower_bound2.fail.cpp
+++ b/libcxx/test/std/containers/associative/map/map.ops/lower_bound2.fail.cpp
@@ -34,7 +34,7 @@
{
typedef std::map<int, double, transparent_less_private> M;
- (void)M().lower_bound(C2Int{5});
+ TEST_IGNORE_NODISCARD M().lower_bound(C2Int{5});
}
}
#endif
diff --git a/libcxx/test/std/containers/associative/map/map.ops/lower_bound3.fail.cpp b/libcxx/test/std/containers/associative/map/map.ops/lower_bound3.fail.cpp
index 40fb5ff..40dc708 100644
--- a/libcxx/test/std/containers/associative/map/map.ops/lower_bound3.fail.cpp
+++ b/libcxx/test/std/containers/associative/map/map.ops/lower_bound3.fail.cpp
@@ -34,7 +34,7 @@
{
typedef std::map<int, double, transparent_less_not_a_type> M;
- (void)M().lower_bound(C2Int{5});
+ TEST_IGNORE_NODISCARD M().lower_bound(C2Int{5});
}
}
#endif
diff --git a/libcxx/test/std/containers/associative/map/map.ops/upper_bound1.fail.cpp b/libcxx/test/std/containers/associative/map/map.ops/upper_bound1.fail.cpp
index 2badd99..be40cec 100644
--- a/libcxx/test/std/containers/associative/map/map.ops/upper_bound1.fail.cpp
+++ b/libcxx/test/std/containers/associative/map/map.ops/upper_bound1.fail.cpp
@@ -34,7 +34,7 @@
{
typedef std::map<int, double, transparent_less_no_type> M;
- (void)M().upper_bound(C2Int{5});
+ TEST_IGNORE_NODISCARD M().upper_bound(C2Int{5});
}
}
#endif
diff --git a/libcxx/test/std/containers/associative/map/map.ops/upper_bound2.fail.cpp b/libcxx/test/std/containers/associative/map/map.ops/upper_bound2.fail.cpp
index 9a6e2be..c03c249 100644
--- a/libcxx/test/std/containers/associative/map/map.ops/upper_bound2.fail.cpp
+++ b/libcxx/test/std/containers/associative/map/map.ops/upper_bound2.fail.cpp
@@ -34,7 +34,7 @@
{
typedef std::map<int, double, transparent_less_private> M;
- (void)M().upper_bound(C2Int{5});
+ TEST_IGNORE_NODISCARD M().upper_bound(C2Int{5});
}
}
#endif
diff --git a/libcxx/test/std/containers/associative/map/map.ops/upper_bound3.fail.cpp b/libcxx/test/std/containers/associative/map/map.ops/upper_bound3.fail.cpp
index f7a7dcd..5848339 100644
--- a/libcxx/test/std/containers/associative/map/map.ops/upper_bound3.fail.cpp
+++ b/libcxx/test/std/containers/associative/map/map.ops/upper_bound3.fail.cpp
@@ -34,7 +34,7 @@
{
typedef std::map<int, double, transparent_less_not_a_type> M;
- (void)M().upper_bound(C2Int{5});
+ TEST_IGNORE_NODISCARD M().upper_bound(C2Int{5});
}
}
#endif
diff --git a/libcxx/test/std/containers/associative/multimap/multimap.ops/count1.fail.cpp b/libcxx/test/std/containers/associative/multimap/multimap.ops/count1.fail.cpp
index bb15f67..393dd29 100644
--- a/libcxx/test/std/containers/associative/multimap/multimap.ops/count1.fail.cpp
+++ b/libcxx/test/std/containers/associative/multimap/multimap.ops/count1.fail.cpp
@@ -33,6 +33,6 @@
{
typedef std::multimap<int, double, transparent_less_no_type> M;
- (void)M().count(C2Int{5});
+ TEST_IGNORE_NODISCARD M().count(C2Int{5});
}
#endif
diff --git a/libcxx/test/std/containers/associative/multimap/multimap.ops/count2.fail.cpp b/libcxx/test/std/containers/associative/multimap/multimap.ops/count2.fail.cpp
index 779af38..3fda007 100644
--- a/libcxx/test/std/containers/associative/multimap/multimap.ops/count2.fail.cpp
+++ b/libcxx/test/std/containers/associative/multimap/multimap.ops/count2.fail.cpp
@@ -33,6 +33,6 @@
{
typedef std::multimap<int, double, transparent_less_private> M;
- (void)M().count(C2Int{5});
+ TEST_IGNORE_NODISCARD M().count(C2Int{5});
}
#endif
diff --git a/libcxx/test/std/containers/associative/multimap/multimap.ops/count3.fail.cpp b/libcxx/test/std/containers/associative/multimap/multimap.ops/count3.fail.cpp
index 6fb1f4d..94453c8 100644
--- a/libcxx/test/std/containers/associative/multimap/multimap.ops/count3.fail.cpp
+++ b/libcxx/test/std/containers/associative/multimap/multimap.ops/count3.fail.cpp
@@ -33,6 +33,6 @@
{
typedef std::multimap<int, double, transparent_less_not_a_type> M;
- (void)M().count(C2Int{5});
+ TEST_IGNORE_NODISCARD M().count(C2Int{5});
}
#endif
diff --git a/libcxx/test/std/containers/associative/multimap/multimap.ops/equal_range1.fail.cpp b/libcxx/test/std/containers/associative/multimap/multimap.ops/equal_range1.fail.cpp
index 20c30fe..396b49e 100644
--- a/libcxx/test/std/containers/associative/multimap/multimap.ops/equal_range1.fail.cpp
+++ b/libcxx/test/std/containers/associative/multimap/multimap.ops/equal_range1.fail.cpp
@@ -33,6 +33,6 @@
{
typedef std::multimap<int, double, transparent_less_no_type> M;
- (void)M().equal_range(C2Int{5});
+ TEST_IGNORE_NODISCARD M().equal_range(C2Int{5});
}
#endif
diff --git a/libcxx/test/std/containers/associative/multimap/multimap.ops/equal_range2.fail.cpp b/libcxx/test/std/containers/associative/multimap/multimap.ops/equal_range2.fail.cpp
index a36fc1f..1741ee2 100644
--- a/libcxx/test/std/containers/associative/multimap/multimap.ops/equal_range2.fail.cpp
+++ b/libcxx/test/std/containers/associative/multimap/multimap.ops/equal_range2.fail.cpp
@@ -34,7 +34,7 @@
{
typedef std::multimap<int, double, transparent_less_private> M;
- (void)M().equal_range(C2Int{5});
+ TEST_IGNORE_NODISCARD M().equal_range(C2Int{5});
}
}
#endif
diff --git a/libcxx/test/std/containers/associative/multimap/multimap.ops/equal_range3.fail.cpp b/libcxx/test/std/containers/associative/multimap/multimap.ops/equal_range3.fail.cpp
index a249776..f555a31 100644
--- a/libcxx/test/std/containers/associative/multimap/multimap.ops/equal_range3.fail.cpp
+++ b/libcxx/test/std/containers/associative/multimap/multimap.ops/equal_range3.fail.cpp
@@ -34,7 +34,7 @@
{
typedef std::multimap<int, double, transparent_less_not_a_type> M;
- (void)M().equal_range(C2Int{5});
+ TEST_IGNORE_NODISCARD M().equal_range(C2Int{5});
}
}
#endif
diff --git a/libcxx/test/std/containers/associative/multimap/multimap.ops/find1.fail.cpp b/libcxx/test/std/containers/associative/multimap/multimap.ops/find1.fail.cpp
index 3df8267..acea156 100644
--- a/libcxx/test/std/containers/associative/multimap/multimap.ops/find1.fail.cpp
+++ b/libcxx/test/std/containers/associative/multimap/multimap.ops/find1.fail.cpp
@@ -34,7 +34,7 @@
{
typedef std::multimap<int, double, transparent_less_no_type> M;
- (void)M().find(C2Int{5});
+ TEST_IGNORE_NODISCARD M().find(C2Int{5});
}
}
#endif
diff --git a/libcxx/test/std/containers/associative/multimap/multimap.ops/find2.fail.cpp b/libcxx/test/std/containers/associative/multimap/multimap.ops/find2.fail.cpp
index 32435f9..38b7768 100644
--- a/libcxx/test/std/containers/associative/multimap/multimap.ops/find2.fail.cpp
+++ b/libcxx/test/std/containers/associative/multimap/multimap.ops/find2.fail.cpp
@@ -34,7 +34,7 @@
{
typedef std::multimap<int, double, transparent_less_private> M;
- (void)M().find(C2Int{5});
+ TEST_IGNORE_NODISCARD M().find(C2Int{5});
}
}
#endif
diff --git a/libcxx/test/std/containers/associative/multimap/multimap.ops/find3.fail.cpp b/libcxx/test/std/containers/associative/multimap/multimap.ops/find3.fail.cpp
index 011c61c..feb6009 100644
--- a/libcxx/test/std/containers/associative/multimap/multimap.ops/find3.fail.cpp
+++ b/libcxx/test/std/containers/associative/multimap/multimap.ops/find3.fail.cpp
@@ -34,7 +34,7 @@
{
typedef std::multimap<int, double, transparent_less_not_a_type> M;
- (void)M().find(C2Int{5});
+ TEST_IGNORE_NODISCARD M().find(C2Int{5});
}
}
#endif
diff --git a/libcxx/test/std/containers/associative/multimap/multimap.ops/lower_bound1.fail.cpp b/libcxx/test/std/containers/associative/multimap/multimap.ops/lower_bound1.fail.cpp
index df8cb38..aec942f 100644
--- a/libcxx/test/std/containers/associative/multimap/multimap.ops/lower_bound1.fail.cpp
+++ b/libcxx/test/std/containers/associative/multimap/multimap.ops/lower_bound1.fail.cpp
@@ -34,7 +34,7 @@
{
typedef std::multimap<int, double, transparent_less_no_type> M;
- (void)M().lower_bound(C2Int{5});
+ TEST_IGNORE_NODISCARD M().lower_bound(C2Int{5});
}
}
#endif
diff --git a/libcxx/test/std/containers/associative/multimap/multimap.ops/lower_bound2.fail.cpp b/libcxx/test/std/containers/associative/multimap/multimap.ops/lower_bound2.fail.cpp
index 9c7fdcd..1a856ad 100644
--- a/libcxx/test/std/containers/associative/multimap/multimap.ops/lower_bound2.fail.cpp
+++ b/libcxx/test/std/containers/associative/multimap/multimap.ops/lower_bound2.fail.cpp
@@ -34,7 +34,7 @@
{
typedef std::multimap<int, double, transparent_less_private> M;
- (void)M().lower_bound(C2Int{5});
+ TEST_IGNORE_NODISCARD M().lower_bound(C2Int{5});
}
}
#endif
diff --git a/libcxx/test/std/containers/associative/multimap/multimap.ops/lower_bound3.fail.cpp b/libcxx/test/std/containers/associative/multimap/multimap.ops/lower_bound3.fail.cpp
index 34eeddc..4b02c97 100644
--- a/libcxx/test/std/containers/associative/multimap/multimap.ops/lower_bound3.fail.cpp
+++ b/libcxx/test/std/containers/associative/multimap/multimap.ops/lower_bound3.fail.cpp
@@ -34,7 +34,7 @@
{
typedef std::multimap<int, double, transparent_less_not_a_type> M;
- (void)M().lower_bound(C2Int{5});
+ TEST_IGNORE_NODISCARD M().lower_bound(C2Int{5});
}
}
#endif
diff --git a/libcxx/test/std/containers/associative/multimap/multimap.ops/upper_bound1.fail.cpp b/libcxx/test/std/containers/associative/multimap/multimap.ops/upper_bound1.fail.cpp
index 67a26a2..613194a 100644
--- a/libcxx/test/std/containers/associative/multimap/multimap.ops/upper_bound1.fail.cpp
+++ b/libcxx/test/std/containers/associative/multimap/multimap.ops/upper_bound1.fail.cpp
@@ -34,7 +34,7 @@
{
typedef std::multimap<int, double, transparent_less_no_type> M;
- (void)M().upper_bound(C2Int{5});
+ TEST_IGNORE_NODISCARD M().upper_bound(C2Int{5});
}
}
#endif
diff --git a/libcxx/test/std/containers/associative/multimap/multimap.ops/upper_bound2.fail.cpp b/libcxx/test/std/containers/associative/multimap/multimap.ops/upper_bound2.fail.cpp
index 35e79da..100a45e 100644
--- a/libcxx/test/std/containers/associative/multimap/multimap.ops/upper_bound2.fail.cpp
+++ b/libcxx/test/std/containers/associative/multimap/multimap.ops/upper_bound2.fail.cpp
@@ -34,7 +34,7 @@
{
typedef std::multimap<int, double, transparent_less_private> M;
- (void)M().upper_bound(C2Int{5});
+ TEST_IGNORE_NODISCARD M().upper_bound(C2Int{5});
}
}
#endif
diff --git a/libcxx/test/std/containers/associative/multimap/multimap.ops/upper_bound3.fail.cpp b/libcxx/test/std/containers/associative/multimap/multimap.ops/upper_bound3.fail.cpp
index eb3edb6..b90cd0a 100644
--- a/libcxx/test/std/containers/associative/multimap/multimap.ops/upper_bound3.fail.cpp
+++ b/libcxx/test/std/containers/associative/multimap/multimap.ops/upper_bound3.fail.cpp
@@ -34,7 +34,7 @@
{
typedef std::multimap<int, double, transparent_less_not_a_type> M;
- (void)M().upper_bound(C2Int{5});
+ TEST_IGNORE_NODISCARD M().upper_bound(C2Int{5});
}
}
#endif
diff --git a/libcxx/test/std/containers/sequences/array/at.pass.cpp b/libcxx/test/std/containers/sequences/array/at.pass.cpp
index 712a4da..27b326f 100644
--- a/libcxx/test/std/containers/sequences/array/at.pass.cpp
+++ b/libcxx/test/std/containers/sequences/array/at.pass.cpp
@@ -50,7 +50,7 @@
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
- (void) c.at(3);
+ TEST_IGNORE_NODISCARD c.at(3);
assert(false);
}
catch (const std::out_of_range &) {}
@@ -69,7 +69,7 @@
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
- (void) c.at(3);
+ TEST_IGNORE_NODISCARD c.at(3);
assert(false);
}
catch (const std::out_of_range &) {}
diff --git a/libcxx/test/std/containers/unord/unord.map/unord.map.elem/at.pass.cpp b/libcxx/test/std/containers/unord/unord.map/unord.map.elem/at.pass.cpp
index 27c95f1..e526b65 100644
--- a/libcxx/test/std/containers/unord/unord.map/unord.map.elem/at.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.map/unord.map.elem/at.pass.cpp
@@ -72,7 +72,7 @@
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
- (void)c.at(11);
+ TEST_IGNORE_NODISCARD c.at(11);
assert(false);
}
catch (std::out_of_range&)
@@ -130,7 +130,7 @@
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
- (void)c.at(11);
+ TEST_IGNORE_NODISCARD c.at(11);
assert(false);
}
catch (std::out_of_range&)
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.overview/types.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.overview/types.pass.cpp
index a2515a4..6c76a25 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.overview/types.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.overview/types.pass.cpp
@@ -13,11 +13,12 @@
// Make sure that the error_code bits of <system_error> are self-contained.
#include <system_error>
+#include "test_macros.h"
int main()
{
std::error_code x;
- (void) x.category(); // returns a std::error_category &
- (void) x.default_error_condition(); // std::error_condition
- (void) x.message(); // returns a std::string
+ TEST_IGNORE_NODISCARD x.category(); // returns a std::error_category &
+ TEST_IGNORE_NODISCARD x.default_error_condition(); // std::error_condition
+ TEST_IGNORE_NODISCARD x.message(); // returns a std::string
}
diff --git a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.overview/types.pass.cpp b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.overview/types.pass.cpp
index 5bbca29..62539ab 100644
--- a/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.overview/types.pass.cpp
+++ b/libcxx/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.overview/types.pass.cpp
@@ -13,10 +13,11 @@
// Make sure that the error_condition bits of <system_error> are self-contained.
#include <system_error>
+#include "test_macros.h"
int main()
{
std::error_condition x = std::errc(0);
- (void) x.category(); // returns a std::error_condition &
- (void) x.message(); // returns a std::string
+ TEST_IGNORE_NODISCARD x.category(); // returns a std::error_condition &
+ TEST_IGNORE_NODISCARD x.message(); // returns a std::string
}
diff --git a/libcxx/test/std/iterators/iterator.range/begin-end.fail.cpp b/libcxx/test/std/iterators/iterator.range/begin-end.fail.cpp
index 335d835..18c5943 100644
--- a/libcxx/test/std/iterators/iterator.range/begin-end.fail.cpp
+++ b/libcxx/test/std/iterators/iterator.range/begin-end.fail.cpp
@@ -43,9 +43,9 @@
int main(){
// Bug #28927 - shouldn't find these via ADL
- (void) std::cbegin (Foo::FakeContainer());
- (void) std::cend (Foo::FakeContainer());
- (void) std::crbegin(Foo::FakeContainer());
- (void) std::crend (Foo::FakeContainer());
+ TEST_IGNORE_NODISCARD std::cbegin (Foo::FakeContainer());
+ TEST_IGNORE_NODISCARD std::cend (Foo::FakeContainer());
+ TEST_IGNORE_NODISCARD std::crbegin(Foo::FakeContainer());
+ TEST_IGNORE_NODISCARD std::crend (Foo::FakeContainer());
}
#endif
diff --git a/libcxx/test/std/iterators/iterators.general/gcc_workaround.pass.cpp b/libcxx/test/std/iterators/iterators.general/gcc_workaround.pass.cpp
index 28a5e95..7578e71 100644
--- a/libcxx/test/std/iterators/iterators.general/gcc_workaround.pass.cpp
+++ b/libcxx/test/std/iterators/iterators.general/gcc_workaround.pass.cpp
@@ -10,11 +10,12 @@
// Tests workaround for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64816.
#include <string>
+#include "test_macros.h"
-void f(const std::string &s) { (void)s.begin(); }
+void f(const std::string &s) { TEST_IGNORE_NODISCARD s.begin(); }
#include <vector>
-void AppendTo(const std::vector<char> &v) { (void)v.begin(); }
+void AppendTo(const std::vector<char> &v) { TEST_IGNORE_NODISCARD v.begin(); }
int main() {}
diff --git a/libcxx/test/std/iterators/predef.iterators/insert.iterators/insert.iterator/types.pass.cpp b/libcxx/test/std/iterators/predef.iterators/insert.iterators/insert.iterator/types.pass.cpp
index 5b61a38..e379b30 100644
--- a/libcxx/test/std/iterators/predef.iterators/insert.iterators/insert.iterator/types.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/insert.iterators/insert.iterator/types.pass.cpp
@@ -29,6 +29,7 @@
#include <iterator>
#include <type_traits>
#include <vector>
+#include "test_macros.h"
template <class C>
struct find_members
@@ -38,7 +39,7 @@
void test()
{
this->container = 0;
- (void)(this->iter == this->iter);
+ TEST_IGNORE_NODISCARD (this->iter == this->iter);
}
};
diff --git a/libcxx/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.nonmember/make_move_iterator.pass.cpp b/libcxx/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.nonmember/make_move_iterator.pass.cpp
index 71b0eac..99ff964 100644
--- a/libcxx/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.nonmember/make_move_iterator.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.nonmember/make_move_iterator.pass.cpp
@@ -43,8 +43,8 @@
}
{
int a[] = {1,2,3,4};
- (void)std::make_move_iterator(a+4);
- (void)std::make_move_iterator(a); // test for LWG issue 2061
+ TEST_IGNORE_NODISCARD std::make_move_iterator(a+4);
+ TEST_IGNORE_NODISCARD std::make_move_iterator(a); // test for LWG issue 2061
}
#if TEST_STD_VER > 14
diff --git a/libcxx/test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.pass.cpp b/libcxx/test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.pass.cpp
index 1ca4543..d96ca32 100644
--- a/libcxx/test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.pass.cpp
+++ b/libcxx/test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.pass.cpp
@@ -19,6 +19,7 @@
#include <cstdint>
#include <cstdlib>
#include <type_traits>
+#include "test_macros.h"
constexpr struct {
int x;
@@ -137,7 +138,7 @@
// LWG#2837
{
auto res1 = std::lcm(static_cast<std::int64_t>(1234), INT32_MIN);
- (void)std::lcm(INT_MIN, 2UL); // this used to trigger UBSAN
+ TEST_IGNORE_NODISCARD std::lcm(INT_MIN, 2UL); // this used to trigger UBSAN
static_assert(std::is_same_v<decltype(res1), std::int64_t>, "");
assert(res1 == 1324997410816LL);
}
diff --git a/libcxx/test/std/re/re.alg/re.alg.search/grep.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.search/grep.pass.cpp
index 13a352c..0040f7b 100644
--- a/libcxx/test/std/re/re.alg/re.alg.search/grep.pass.cpp
+++ b/libcxx/test/std/re/re.alg/re.alg.search/grep.pass.cpp
@@ -33,7 +33,7 @@
std::regex::flag_type flag = std::regex_constants::grep;
std::string s((const char *)data, size);
std::regex re(s, flag);
- (void)std::regex_match(s, re);
+ TEST_IGNORE_NODISCARD std::regex_match(s, re);
}
catch (std::regex_error &) {}
}
diff --git a/libcxx/test/std/re/re.grammar/excessive_brace_count.pass.cpp b/libcxx/test/std/re/re.grammar/excessive_brace_count.pass.cpp
index 7fe5f04..cc74a89 100644
--- a/libcxx/test/std/re/re.grammar/excessive_brace_count.pass.cpp
+++ b/libcxx/test/std/re/re.grammar/excessive_brace_count.pass.cpp
@@ -20,7 +20,7 @@
for (std::regex_constants::syntax_option_type op :
{std::regex::basic, std::regex::grep}) {
try {
- (void)std::regex("a\\{100000000000000000\\}", op);
+ TEST_IGNORE_NODISCARD std::regex("a\\{100000000000000000\\}", op);
assert(false);
} catch (const std::regex_error &e) {
assert(e.code() == std::regex_constants::error_badbrace);
@@ -30,7 +30,7 @@
{std::regex::ECMAScript, std::regex::extended, std::regex::egrep,
std::regex::awk}) {
try {
- (void)std::regex("a{100000000000000000}", op);
+ TEST_IGNORE_NODISCARD std::regex("a{100000000000000000}", op);
assert(false);
} catch (const std::regex_error &e) {
assert(e.code() == std::regex_constants::error_badbrace);
diff --git a/libcxx/test/std/strings/basic.string/string.access/at.pass.cpp b/libcxx/test/std/strings/basic.string/string.access/at.pass.cpp
index 8bfb829..16121cb 100644
--- a/libcxx/test/std/strings/basic.string/string.access/at.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.access/at.pass.cpp
@@ -35,7 +35,7 @@
{
try
{
- (void)s.at(pos);
+ TEST_IGNORE_NODISCARD s.at(pos);
assert(false);
}
catch (std::out_of_range&)
@@ -44,7 +44,7 @@
}
try
{
- (void)cs.at(pos);
+ TEST_IGNORE_NODISCARD cs.at(pos);
assert(false);
}
catch (std::out_of_range&)
diff --git a/libcxx/test/std/strings/basic.string/string.ops/string_compare/size_size_T_size_size.pass.cpp b/libcxx/test/std/strings/basic.string/string.ops/string_compare/size_size_T_size_size.pass.cpp
index 6ca473f..94f7890 100644
--- a/libcxx/test/std/strings/basic.string/string.ops/string_compare/size_size_T_size_size.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.ops/string_compare/size_size_T_size_size.pass.cpp
@@ -45,7 +45,7 @@
{
try
{
- (void)s.compare(pos1, n1, sv, pos2, n2);
+ TEST_IGNORE_NODISCARD s.compare(pos1, n1, sv, pos2, n2);
assert(false);
}
catch (const std::out_of_range&)
@@ -69,7 +69,7 @@
{
try
{
- (void)s.compare(pos1, n1, sv, pos2);
+ TEST_IGNORE_NODISCARD s.compare(pos1, n1, sv, pos2);
assert(false);
}
catch (const std::out_of_range&)
diff --git a/libcxx/test/std/strings/basic.string/string.ops/string_compare/size_size_pointer.pass.cpp b/libcxx/test/std/strings/basic.string/string.ops/string_compare/size_size_pointer.pass.cpp
index 0f58fdc..55af081 100644
--- a/libcxx/test/std/strings/basic.string/string.ops/string_compare/size_size_pointer.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.ops/string_compare/size_size_pointer.pass.cpp
@@ -40,7 +40,7 @@
{
try
{
- (void)s.compare(pos1, n1, str);
+ TEST_IGNORE_NODISCARD s.compare(pos1, n1, str);
assert(false);
}
catch (std::out_of_range&)
diff --git a/libcxx/test/std/strings/basic.string/string.ops/string_compare/size_size_pointer_size.pass.cpp b/libcxx/test/std/strings/basic.string/string.ops/string_compare/size_size_pointer_size.pass.cpp
index 5761b75..2fcecc7 100644
--- a/libcxx/test/std/strings/basic.string/string.ops/string_compare/size_size_pointer_size.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.ops/string_compare/size_size_pointer_size.pass.cpp
@@ -40,7 +40,7 @@
{
try
{
- (void)s.compare(pos, n1, str, n2);
+ TEST_IGNORE_NODISCARD s.compare(pos, n1, str, n2);
assert(false);
}
catch (std::out_of_range&)
diff --git a/libcxx/test/std/strings/basic.string/string.ops/string_compare/size_size_string.pass.cpp b/libcxx/test/std/strings/basic.string/string.ops/string_compare/size_size_string.pass.cpp
index c543e73..0ddbf2e 100644
--- a/libcxx/test/std/strings/basic.string/string.ops/string_compare/size_size_string.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.ops/string_compare/size_size_string.pass.cpp
@@ -40,7 +40,7 @@
{
try
{
- (void)s.compare(pos1, n1, str);
+ TEST_IGNORE_NODISCARD s.compare(pos1, n1, str);
assert(false);
}
catch (std::out_of_range&)
diff --git a/libcxx/test/std/strings/basic.string/string.ops/string_compare/size_size_string_size_size.pass.cpp b/libcxx/test/std/strings/basic.string/string.ops/string_compare/size_size_string_size_size.pass.cpp
index 6e63813..590a151 100644
--- a/libcxx/test/std/strings/basic.string/string.ops/string_compare/size_size_string_size_size.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.ops/string_compare/size_size_string_size_size.pass.cpp
@@ -42,7 +42,7 @@
{
try
{
- (void)s.compare(pos1, n1, str, pos2, n2);
+ TEST_IGNORE_NODISCARD s.compare(pos1, n1, str, pos2, n2);
assert(false);
}
catch (const std::out_of_range&)
@@ -65,7 +65,7 @@
{
try
{
- (void)s.compare(pos1, n1, str, pos2);
+ TEST_IGNORE_NODISCARD s.compare(pos1, n1, str, pos2);
assert(false);
}
catch (const std::out_of_range&)
diff --git a/libcxx/test/std/strings/basic.string/string.ops/string_compare/size_size_string_view.pass.cpp b/libcxx/test/std/strings/basic.string/string.ops/string_compare/size_size_string_view.pass.cpp
index 1e025c7..53114f3 100644
--- a/libcxx/test/std/strings/basic.string/string.ops/string_compare/size_size_string_view.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.ops/string_compare/size_size_string_view.pass.cpp
@@ -40,7 +40,7 @@
{
try
{
- (void)s.compare(pos1, n1, sv);
+ TEST_IGNORE_NODISCARD s.compare(pos1, n1, sv);
assert(false);
}
catch (std::out_of_range&)
diff --git a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock.pass.cpp b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock.pass.cpp
index 8eeb8af..06dc117 100644
--- a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock.pass.cpp
+++ b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock.pass.cpp
@@ -44,7 +44,7 @@
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
- (void)lk.try_lock();
+ TEST_IGNORE_NODISCARD lk.try_lock();
assert(false);
}
catch (std::system_error& e)
@@ -60,7 +60,7 @@
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
- (void)lk.try_lock();
+ TEST_IGNORE_NODISCARD lk.try_lock();
assert(false);
}
catch (std::system_error& e)
diff --git a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_for.pass.cpp b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_for.pass.cpp
index a4a0bb2..7feb713 100644
--- a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_for.pass.cpp
+++ b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_for.pass.cpp
@@ -49,7 +49,7 @@
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
- (void)lk.try_lock_for(ms(5));
+ TEST_IGNORE_NODISCARD lk.try_lock_for(ms(5));
assert(false);
}
catch (std::system_error& e)
@@ -65,7 +65,7 @@
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
- (void)lk.try_lock_for(ms(5));
+ TEST_IGNORE_NODISCARD lk.try_lock_for(ms(5));
assert(false);
}
catch (std::system_error& e)
diff --git a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_until.pass.cpp b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_until.pass.cpp
index 6fb9aaa..836a9ae 100644
--- a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_until.pass.cpp
+++ b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_until.pass.cpp
@@ -49,7 +49,7 @@
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
- (void)lk.try_lock_until(Clock::now());
+ TEST_IGNORE_NODISCARD lk.try_lock_until(Clock::now());
assert(false);
}
catch (std::system_error& e)
@@ -65,7 +65,7 @@
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
- (void)lk.try_lock_until(Clock::now());
+ TEST_IGNORE_NODISCARD lk.try_lock_until(Clock::now());
assert(false);
}
catch (std::system_error& e)
diff --git a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock.pass.cpp b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock.pass.cpp
index c7b255c..3f7bd25 100644
--- a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock.pass.cpp
+++ b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock.pass.cpp
@@ -43,7 +43,7 @@
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
- (void)lk.try_lock();
+ TEST_IGNORE_NODISCARD lk.try_lock();
assert(false);
}
catch (std::system_error& e)
@@ -59,7 +59,7 @@
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
- (void)lk.try_lock();
+ TEST_IGNORE_NODISCARD lk.try_lock();
assert(false);
}
catch (std::system_error& e)
diff --git a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_for.pass.cpp b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_for.pass.cpp
index 6a1dd0b..b735904 100644
--- a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_for.pass.cpp
+++ b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_for.pass.cpp
@@ -48,7 +48,7 @@
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
- (void)lk.try_lock_for(ms(5));
+ TEST_IGNORE_NODISCARD lk.try_lock_for(ms(5));
assert(false);
}
catch (std::system_error& e)
@@ -64,7 +64,7 @@
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
- (void)lk.try_lock_for(ms(5));
+ TEST_IGNORE_NODISCARD lk.try_lock_for(ms(5));
assert(false);
}
catch (std::system_error& e)
diff --git a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_until.pass.cpp b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_until.pass.cpp
index e0ffa10..c8d0aad 100644
--- a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_until.pass.cpp
+++ b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_until.pass.cpp
@@ -48,7 +48,7 @@
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
- (void)lk.try_lock_until(Clock::now());
+ TEST_IGNORE_NODISCARD lk.try_lock_until(Clock::now());
assert(false);
}
catch (std::system_error& e)
@@ -64,7 +64,7 @@
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
- (void)lk.try_lock_until(Clock::now());
+ TEST_IGNORE_NODISCARD lk.try_lock_until(Clock::now());
assert(false);
}
catch (std::system_error& e)
diff --git a/libcxx/test/std/utilities/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp b/libcxx/test/std/utilities/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp
index 5e0a116..419fd1a 100644
--- a/libcxx/test/std/utilities/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp
+++ b/libcxx/test/std/utilities/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp
@@ -80,7 +80,7 @@
{
#if !defined(TEST_HAS_NO_EXCEPTIONS)
try {
- (void)any_cast<Type>(a);
+ TEST_IGNORE_NODISCARD any_cast<Type>(a);
assert(false);
} catch (bad_any_cast const &) {
// do nothing
@@ -89,7 +89,7 @@
}
try {
- (void)any_cast<ConstT>(static_cast<any const&>(a));
+ TEST_IGNORE_NODISCARD any_cast<ConstT>(static_cast<any const&>(a));
assert(false);
} catch (bad_any_cast const &) {
// do nothing
@@ -103,7 +103,7 @@
typename std::remove_reference<Type>::type&&,
Type
>::type;
- (void)any_cast<RefType>(static_cast<any&&>(a));
+ TEST_IGNORE_NODISCARD any_cast<RefType>(static_cast<any&&>(a));
assert(false);
} catch (bad_any_cast const &) {
// do nothing
@@ -111,13 +111,13 @@
assert(false);
}
#else
- ((void)a);
+ (TEST_IGNORE_NODISCARD a);
#endif
}
void test_cast_empty() {
// None of these operations should allocate.
- DisableAllocationGuard g; ((void)g);
+ DisableAllocationGuard g; (TEST_IGNORE_NODISCARD g);
any a;
checkThrows<int>(a);
}
diff --git a/libcxx/test/std/utilities/any/any.nonmembers/make_any.pass.cpp b/libcxx/test/std/utilities/any/any.nonmembers/make_any.pass.cpp
index d98b8d68..9850851 100644
--- a/libcxx/test/std/utilities/any/any.nonmembers/make_any.pass.cpp
+++ b/libcxx/test/std/utilities/any/any.nonmembers/make_any.pass.cpp
@@ -115,14 +115,14 @@
{
{
try {
- (void)std::make_any<Type>(101);
+ TEST_IGNORE_NODISCARD std::make_any<Type>(101);
assert(false);
} catch (int const&) {
}
}
{
try {
- (void)std::make_any<Type>({1, 2, 3}, 101);
+ TEST_IGNORE_NODISCARD std::make_any<Type>({1, 2, 3}, 101);
assert(false);
} catch (int const&) {
}
diff --git a/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.size.pass.cpp b/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.size.pass.cpp
index e77e7d8..34cbb8d 100644
--- a/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.size.pass.cpp
+++ b/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.size.pass.cpp
@@ -23,7 +23,7 @@
{
std::allocator<T> a;
try {
- (void)a.allocate(count);
+ TEST_IGNORE_NODISCARD a.allocate(count);
assert(false);
} catch (const std::exception &) {
}
diff --git a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp
index d678bde..8bd8993 100644
--- a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp
+++ b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp
@@ -134,7 +134,7 @@
#ifndef TEST_HAS_NO_EXCEPTIONS
try {
- (void)ptr->shared_from_this();
+ TEST_IGNORE_NODISCARD ptr->shared_from_this();
assert(false);
} catch (std::bad_weak_ptr const&) {
} catch (...) { assert(false); }
diff --git a/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/dereference.runtime.fail.cpp b/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/dereference.runtime.fail.cpp
index b05fb71..50058a6 100644
--- a/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/dereference.runtime.fail.cpp
+++ b/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/dereference.runtime.fail.cpp
@@ -19,6 +19,6 @@
int main() {
std::unique_ptr<int[]> p(new int(3));
const std::unique_ptr<int[]>& cp = p;
- (void)(*p); // expected-error {{indirection requires pointer operand ('std::unique_ptr<int []>' invalid)}}
- (void)(*cp); // expected-error {{indirection requires pointer operand ('const std::unique_ptr<int []>' invalid)}}
+ TEST_IGNORE_NODISCARD (*p); // expected-error {{indirection requires pointer operand ('std::unique_ptr<int []>' invalid)}}
+ TEST_IGNORE_NODISCARD (*cp); // expected-error {{indirection requires pointer operand ('const std::unique_ptr<int []>' invalid)}}
}
diff --git a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.elem/tuple.by.type.fail.cpp b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.elem/tuple.by.type.fail.cpp
index 74e6efd..2f7ee44 100644
--- a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.elem/tuple.by.type.fail.cpp
+++ b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.elem/tuple.by.type.fail.cpp
@@ -16,12 +16,12 @@
void test_bad_index() {
std::tuple<long, long, char, std::string, char, UserType, char> t1;
- (void)std::get<int>(t1); // expected-error@tuple:* {{type not found}}
- (void)std::get<long>(t1); // expected-note {{requested here}}
- (void)std::get<char>(t1); // expected-note {{requested here}}
+ TEST_IGNORE_NODISCARD std::get<int>(t1); // expected-error@tuple:* {{type not found}}
+ TEST_IGNORE_NODISCARD std::get<long>(t1); // expected-note {{requested here}}
+ TEST_IGNORE_NODISCARD std::get<char>(t1); // expected-note {{requested here}}
// expected-error@tuple:* 2 {{type occurs more than once}}
std::tuple<> t0;
- (void)std::get<char*>(t0); // expected-node {{requested here}}
+ TEST_IGNORE_NODISCARD std::get<char*>(t0); // expected-node {{requested here}}
// expected-error@tuple:* 1 {{type not in empty type list}}
}
diff --git a/libcxx/test/std/utilities/variant/variant.get/get_index.pass.cpp b/libcxx/test/std/utilities/variant/variant.get/get_index.pass.cpp
index 0ec6530..f52dc55 100644
--- a/libcxx/test/std/utilities/variant/variant.get/get_index.pass.cpp
+++ b/libcxx/test/std/utilities/variant/variant.get/get_index.pass.cpp
@@ -259,7 +259,7 @@
auto test = [](auto idx, auto &&v) {
using Idx = decltype(idx);
try {
- (void)std::get<Idx::value>(std::forward<decltype(v)>(v));
+ TEST_IGNORE_NODISCARD std::get<Idx::value>(std::forward<decltype(v)>(v));
} catch (const std::bad_variant_access &) {
return true;
} catch (...) { /* ... */
diff --git a/libcxx/test/std/utilities/variant/variant.get/get_type.pass.cpp b/libcxx/test/std/utilities/variant/variant.get/get_type.pass.cpp
index 5d9213ed..0a2222c 100644
--- a/libcxx/test/std/utilities/variant/variant.get/get_type.pass.cpp
+++ b/libcxx/test/std/utilities/variant/variant.get/get_type.pass.cpp
@@ -259,7 +259,7 @@
auto test = [](auto idx, auto &&v) {
using Idx = decltype(idx);
try {
- (void)std::get<typename Idx::type>(std::forward<decltype(v)>(v));
+ TEST_IGNORE_NODISCARD std::get<typename Idx::type>(std::forward<decltype(v)>(v));
} catch (const std::bad_variant_access &) {
return true;
} catch (...) { /* ... */