summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBilly Robert O'Neal III <bion@microsoft.com>2017-11-21 21:37:26 +0000
committerBilly Robert O'Neal III <bion@microsoft.com>2017-11-21 21:37:26 +0000
commit7e250fcdc138fb6fc3580d6bf5eba5bd2d73980f (patch)
tree91356f694465b8fbd8f733f79efda9773c120f7e /test
parent10bebe205344aae19156d77a9d80f61b1ab2f7f1 (diff)
Change (void) casts to TEST_IGNORE_NODISCARD, as requested by Eric. Reviewed as https://reviews.llvm.org/D40065
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318804 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.search/search_n_pred.pass.cpp2
-rw-r--r--test/std/containers/associative/map/map.access/at.pass.cpp8
-rw-r--r--test/std/containers/associative/map/map.ops/count1.fail.cpp2
-rw-r--r--test/std/containers/associative/map/map.ops/count2.fail.cpp2
-rw-r--r--test/std/containers/associative/map/map.ops/count3.fail.cpp2
-rw-r--r--test/std/containers/associative/map/map.ops/equal_range1.fail.cpp2
-rw-r--r--test/std/containers/associative/map/map.ops/equal_range2.fail.cpp2
-rw-r--r--test/std/containers/associative/map/map.ops/equal_range3.fail.cpp2
-rw-r--r--test/std/containers/associative/map/map.ops/find1.fail.cpp2
-rw-r--r--test/std/containers/associative/map/map.ops/find2.fail.cpp2
-rw-r--r--test/std/containers/associative/map/map.ops/find3.fail.cpp2
-rw-r--r--test/std/containers/associative/map/map.ops/lower_bound1.fail.cpp2
-rw-r--r--test/std/containers/associative/map/map.ops/lower_bound2.fail.cpp2
-rw-r--r--test/std/containers/associative/map/map.ops/lower_bound3.fail.cpp2
-rw-r--r--test/std/containers/associative/map/map.ops/upper_bound1.fail.cpp2
-rw-r--r--test/std/containers/associative/map/map.ops/upper_bound2.fail.cpp2
-rw-r--r--test/std/containers/associative/map/map.ops/upper_bound3.fail.cpp2
-rw-r--r--test/std/containers/associative/multimap/multimap.ops/count1.fail.cpp2
-rw-r--r--test/std/containers/associative/multimap/multimap.ops/count2.fail.cpp2
-rw-r--r--test/std/containers/associative/multimap/multimap.ops/count3.fail.cpp2
-rw-r--r--test/std/containers/associative/multimap/multimap.ops/equal_range1.fail.cpp2
-rw-r--r--test/std/containers/associative/multimap/multimap.ops/equal_range2.fail.cpp2
-rw-r--r--test/std/containers/associative/multimap/multimap.ops/equal_range3.fail.cpp2
-rw-r--r--test/std/containers/associative/multimap/multimap.ops/find1.fail.cpp2
-rw-r--r--test/std/containers/associative/multimap/multimap.ops/find2.fail.cpp2
-rw-r--r--test/std/containers/associative/multimap/multimap.ops/find3.fail.cpp2
-rw-r--r--test/std/containers/associative/multimap/multimap.ops/lower_bound1.fail.cpp2
-rw-r--r--test/std/containers/associative/multimap/multimap.ops/lower_bound2.fail.cpp2
-rw-r--r--test/std/containers/associative/multimap/multimap.ops/lower_bound3.fail.cpp2
-rw-r--r--test/std/containers/associative/multimap/multimap.ops/upper_bound1.fail.cpp2
-rw-r--r--test/std/containers/associative/multimap/multimap.ops/upper_bound2.fail.cpp2
-rw-r--r--test/std/containers/associative/multimap/multimap.ops/upper_bound3.fail.cpp2
-rw-r--r--test/std/containers/sequences/array/at.pass.cpp4
-rw-r--r--test/std/containers/unord/unord.map/unord.map.elem/at.pass.cpp4
-rw-r--r--test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.overview/types.pass.cpp7
-rw-r--r--test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.overview/types.pass.cpp5
-rw-r--r--test/std/iterators/iterator.range/begin-end.fail.cpp8
-rw-r--r--test/std/iterators/iterators.general/gcc_workaround.pass.cpp5
-rw-r--r--test/std/iterators/predef.iterators/insert.iterators/insert.iterator/types.pass.cpp3
-rw-r--r--test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.nonmember/make_move_iterator.pass.cpp4
-rw-r--r--test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.pass.cpp3
-rw-r--r--test/std/re/re.alg/re.alg.search/grep.pass.cpp2
-rw-r--r--test/std/re/re.grammar/excessive_brace_count.pass.cpp4
-rw-r--r--test/std/strings/basic.string/string.access/at.pass.cpp4
-rw-r--r--test/std/strings/basic.string/string.ops/string_compare/size_size_T_size_size.pass.cpp4
-rw-r--r--test/std/strings/basic.string/string.ops/string_compare/size_size_pointer.pass.cpp2
-rw-r--r--test/std/strings/basic.string/string.ops/string_compare/size_size_pointer_size.pass.cpp2
-rw-r--r--test/std/strings/basic.string/string.ops/string_compare/size_size_string.pass.cpp2
-rw-r--r--test/std/strings/basic.string/string.ops/string_compare/size_size_string_size_size.pass.cpp4
-rw-r--r--test/std/strings/basic.string/string.ops/string_compare/size_size_string_view.pass.cpp2
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock.pass.cpp4
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_for.pass.cpp4
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_until.pass.cpp4
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock.pass.cpp4
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_for.pass.cpp4
-rw-r--r--test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_until.pass.cpp4
-rw-r--r--test/std/utilities/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp10
-rw-r--r--test/std/utilities/any/any.nonmembers/make_any.pass.cpp4
-rw-r--r--test/std/utilities/memory/default.allocator/allocator.members/allocate.size.pass.cpp2
-rw-r--r--test/std/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp2
-rw-r--r--test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/dereference.runtime.fail.cpp4
-rw-r--r--test/std/utilities/tuple/tuple.tuple/tuple.elem/tuple.by.type.fail.cpp8
-rw-r--r--test/std/utilities/variant/variant.get/get_index.pass.cpp2
-rw-r--r--test/std/utilities/variant/variant.get/get_type.pass.cpp2
-rw-r--r--test/support/test_macros.h2
65 files changed, 103 insertions, 96 deletions
diff --git a/test/std/algorithms/alg.nonmodifying/alg.search/search_n_pred.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.search/search_n_pred.pass.cpp
index 6e8913ea4..ff459b348 100644
--- a/test/std/algorithms/alg.nonmodifying/alg.search/search_n_pred.pass.cpp
+++ b/test/std/algorithms/alg.nonmodifying/alg.search/search_n_pred.pass.cpp
@@ -142,7 +142,7 @@ test()
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/test/std/containers/associative/map/map.access/at.pass.cpp b/test/std/containers/associative/map/map.access/at.pass.cpp
index 89ba1943d..5822706fb 100644
--- a/test/std/containers/associative/map/map.access/at.pass.cpp
+++ b/test/std/containers/associative/map/map.access/at.pass.cpp
@@ -46,7 +46,7 @@ int main()
#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 @@ int main()
#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 @@ int main()
#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 @@ int main()
#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/test/std/containers/associative/map/map.ops/count1.fail.cpp b/test/std/containers/associative/map/map.ops/count1.fail.cpp
index 5ad176142..9fa9f87b8 100644
--- a/test/std/containers/associative/map/map.ops/count1.fail.cpp
+++ b/test/std/containers/associative/map/map.ops/count1.fail.cpp
@@ -34,7 +34,7 @@ int main()
{
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/test/std/containers/associative/map/map.ops/count2.fail.cpp b/test/std/containers/associative/map/map.ops/count2.fail.cpp
index bb1c32e0e..c6380635a 100644
--- a/test/std/containers/associative/map/map.ops/count2.fail.cpp
+++ b/test/std/containers/associative/map/map.ops/count2.fail.cpp
@@ -34,7 +34,7 @@ int main()
{
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/test/std/containers/associative/map/map.ops/count3.fail.cpp b/test/std/containers/associative/map/map.ops/count3.fail.cpp
index 8964384de..0fddf61b8 100644
--- a/test/std/containers/associative/map/map.ops/count3.fail.cpp
+++ b/test/std/containers/associative/map/map.ops/count3.fail.cpp
@@ -34,7 +34,7 @@ int main()
{
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/test/std/containers/associative/map/map.ops/equal_range1.fail.cpp b/test/std/containers/associative/map/map.ops/equal_range1.fail.cpp
index 381c2755a..b8c8607ee 100644
--- a/test/std/containers/associative/map/map.ops/equal_range1.fail.cpp
+++ b/test/std/containers/associative/map/map.ops/equal_range1.fail.cpp
@@ -34,7 +34,7 @@ int main()
{
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/test/std/containers/associative/map/map.ops/equal_range2.fail.cpp b/test/std/containers/associative/map/map.ops/equal_range2.fail.cpp
index adf4a4727..2fb1b2d2e 100644
--- a/test/std/containers/associative/map/map.ops/equal_range2.fail.cpp
+++ b/test/std/containers/associative/map/map.ops/equal_range2.fail.cpp
@@ -34,7 +34,7 @@ int main()
{
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/test/std/containers/associative/map/map.ops/equal_range3.fail.cpp b/test/std/containers/associative/map/map.ops/equal_range3.fail.cpp
index 88b62a0b1..ad499e1c6 100644
--- a/test/std/containers/associative/map/map.ops/equal_range3.fail.cpp
+++ b/test/std/containers/associative/map/map.ops/equal_range3.fail.cpp
@@ -34,7 +34,7 @@ int main()
{
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/test/std/containers/associative/map/map.ops/find1.fail.cpp b/test/std/containers/associative/map/map.ops/find1.fail.cpp
index ca4ec4336..6c0f237a2 100644
--- a/test/std/containers/associative/map/map.ops/find1.fail.cpp
+++ b/test/std/containers/associative/map/map.ops/find1.fail.cpp
@@ -34,7 +34,7 @@ int main()
{
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/test/std/containers/associative/map/map.ops/find2.fail.cpp b/test/std/containers/associative/map/map.ops/find2.fail.cpp
index cf8db60e8..b915b4396 100644
--- a/test/std/containers/associative/map/map.ops/find2.fail.cpp
+++ b/test/std/containers/associative/map/map.ops/find2.fail.cpp
@@ -34,7 +34,7 @@ int main()
{
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/test/std/containers/associative/map/map.ops/find3.fail.cpp b/test/std/containers/associative/map/map.ops/find3.fail.cpp
index 79a4ae0d9..9303a7f07 100644
--- a/test/std/containers/associative/map/map.ops/find3.fail.cpp
+++ b/test/std/containers/associative/map/map.ops/find3.fail.cpp
@@ -34,7 +34,7 @@ int main()
{
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/test/std/containers/associative/map/map.ops/lower_bound1.fail.cpp b/test/std/containers/associative/map/map.ops/lower_bound1.fail.cpp
index 06468474f..beb901cf0 100644
--- a/test/std/containers/associative/map/map.ops/lower_bound1.fail.cpp
+++ b/test/std/containers/associative/map/map.ops/lower_bound1.fail.cpp
@@ -34,7 +34,7 @@ int main()
{
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/test/std/containers/associative/map/map.ops/lower_bound2.fail.cpp b/test/std/containers/associative/map/map.ops/lower_bound2.fail.cpp
index f60300712..2a2258e8f 100644
--- a/test/std/containers/associative/map/map.ops/lower_bound2.fail.cpp
+++ b/test/std/containers/associative/map/map.ops/lower_bound2.fail.cpp
@@ -34,7 +34,7 @@ int main()
{
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/test/std/containers/associative/map/map.ops/lower_bound3.fail.cpp b/test/std/containers/associative/map/map.ops/lower_bound3.fail.cpp
index 40fb5ff5a..40dc708ad 100644
--- a/test/std/containers/associative/map/map.ops/lower_bound3.fail.cpp
+++ b/test/std/containers/associative/map/map.ops/lower_bound3.fail.cpp
@@ -34,7 +34,7 @@ int main()
{
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/test/std/containers/associative/map/map.ops/upper_bound1.fail.cpp b/test/std/containers/associative/map/map.ops/upper_bound1.fail.cpp
index 2badd9957..be40cec76 100644
--- a/test/std/containers/associative/map/map.ops/upper_bound1.fail.cpp
+++ b/test/std/containers/associative/map/map.ops/upper_bound1.fail.cpp
@@ -34,7 +34,7 @@ int main()
{
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/test/std/containers/associative/map/map.ops/upper_bound2.fail.cpp b/test/std/containers/associative/map/map.ops/upper_bound2.fail.cpp
index 9a6e2be85..c03c249b7 100644
--- a/test/std/containers/associative/map/map.ops/upper_bound2.fail.cpp
+++ b/test/std/containers/associative/map/map.ops/upper_bound2.fail.cpp
@@ -34,7 +34,7 @@ int main()
{
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/test/std/containers/associative/map/map.ops/upper_bound3.fail.cpp b/test/std/containers/associative/map/map.ops/upper_bound3.fail.cpp
index f7a7dcd54..584833921 100644
--- a/test/std/containers/associative/map/map.ops/upper_bound3.fail.cpp
+++ b/test/std/containers/associative/map/map.ops/upper_bound3.fail.cpp
@@ -34,7 +34,7 @@ int main()
{
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/test/std/containers/associative/multimap/multimap.ops/count1.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/count1.fail.cpp
index bb15f67f9..393dd2988 100644
--- a/test/std/containers/associative/multimap/multimap.ops/count1.fail.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/count1.fail.cpp
@@ -33,6 +33,6 @@ int main()
{
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/test/std/containers/associative/multimap/multimap.ops/count2.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/count2.fail.cpp
index 779af3818..3fda00765 100644
--- a/test/std/containers/associative/multimap/multimap.ops/count2.fail.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/count2.fail.cpp
@@ -33,6 +33,6 @@ int main()
{
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/test/std/containers/associative/multimap/multimap.ops/count3.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/count3.fail.cpp
index 6fb1f4dfb..94453c8f3 100644
--- a/test/std/containers/associative/multimap/multimap.ops/count3.fail.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/count3.fail.cpp
@@ -33,6 +33,6 @@ int main()
{
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/test/std/containers/associative/multimap/multimap.ops/equal_range1.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/equal_range1.fail.cpp
index 20c30fe40..396b49ebc 100644
--- a/test/std/containers/associative/multimap/multimap.ops/equal_range1.fail.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/equal_range1.fail.cpp
@@ -33,6 +33,6 @@ int main()
{
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/test/std/containers/associative/multimap/multimap.ops/equal_range2.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/equal_range2.fail.cpp
index a36fc1f54..1741ee24c 100644
--- a/test/std/containers/associative/multimap/multimap.ops/equal_range2.fail.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/equal_range2.fail.cpp
@@ -34,7 +34,7 @@ int main()
{
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/test/std/containers/associative/multimap/multimap.ops/equal_range3.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/equal_range3.fail.cpp
index a2497761f..f555a31f9 100644
--- a/test/std/containers/associative/multimap/multimap.ops/equal_range3.fail.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/equal_range3.fail.cpp
@@ -34,7 +34,7 @@ int main()
{
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/test/std/containers/associative/multimap/multimap.ops/find1.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/find1.fail.cpp
index 3df826797..acea15604 100644
--- a/test/std/containers/associative/multimap/multimap.ops/find1.fail.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/find1.fail.cpp
@@ -34,7 +34,7 @@ int main()
{
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/test/std/containers/associative/multimap/multimap.ops/find2.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/find2.fail.cpp
index 32435f98c..38b77684c 100644
--- a/test/std/containers/associative/multimap/multimap.ops/find2.fail.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/find2.fail.cpp
@@ -34,7 +34,7 @@ int main()
{
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/test/std/containers/associative/multimap/multimap.ops/find3.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/find3.fail.cpp
index 011c61c54..feb6009ed 100644
--- a/test/std/containers/associative/multimap/multimap.ops/find3.fail.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/find3.fail.cpp
@@ -34,7 +34,7 @@ int main()
{
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/test/std/containers/associative/multimap/multimap.ops/lower_bound1.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/lower_bound1.fail.cpp
index df8cb3844..aec942fa0 100644
--- a/test/std/containers/associative/multimap/multimap.ops/lower_bound1.fail.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/lower_bound1.fail.cpp
@@ -34,7 +34,7 @@ int main()
{
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/test/std/containers/associative/multimap/multimap.ops/lower_bound2.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/lower_bound2.fail.cpp
index 9c7fdcdcb..1a856ad84 100644
--- a/test/std/containers/associative/multimap/multimap.ops/lower_bound2.fail.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/lower_bound2.fail.cpp
@@ -34,7 +34,7 @@ int main()
{
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/test/std/containers/associative/multimap/multimap.ops/lower_bound3.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/lower_bound3.fail.cpp
index 34eeddc01..4b02c97f8 100644
--- a/test/std/containers/associative/multimap/multimap.ops/lower_bound3.fail.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/lower_bound3.fail.cpp
@@ -34,7 +34,7 @@ int main()
{
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/test/std/containers/associative/multimap/multimap.ops/upper_bound1.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/upper_bound1.fail.cpp
index 67a26a213..613194abb 100644
--- a/test/std/containers/associative/multimap/multimap.ops/upper_bound1.fail.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/upper_bound1.fail.cpp
@@ -34,7 +34,7 @@ int main()
{
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/test/std/containers/associative/multimap/multimap.ops/upper_bound2.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/upper_bound2.fail.cpp
index 35e79da51..100a45e5e 100644
--- a/test/std/containers/associative/multimap/multimap.ops/upper_bound2.fail.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/upper_bound2.fail.cpp
@@ -34,7 +34,7 @@ int main()
{
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/test/std/containers/associative/multimap/multimap.ops/upper_bound3.fail.cpp b/test/std/containers/associative/multimap/multimap.ops/upper_bound3.fail.cpp
index eb3edb6a6..b90cd0ac6 100644
--- a/test/std/containers/associative/multimap/multimap.ops/upper_bound3.fail.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/upper_bound3.fail.cpp
@@ -34,7 +34,7 @@ int main()
{
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/test/std/containers/sequences/array/at.pass.cpp b/test/std/containers/sequences/array/at.pass.cpp
index 712a4da51..27b326fa7 100644
--- a/test/std/containers/sequences/array/at.pass.cpp
+++ b/test/std/containers/sequences/array/at.pass.cpp
@@ -50,7 +50,7 @@ int main()
#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 @@ int main()
#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/test/std/containers/unord/unord.map/unord.map.elem/at.pass.cpp b/test/std/containers/unord/unord.map/unord.map.elem/at.pass.cpp
index 27c95f180..e526b654a 100644
--- a/test/std/containers/unord/unord.map/unord.map.elem/at.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.elem/at.pass.cpp
@@ -72,7 +72,7 @@ int main()
#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 @@ int main()
#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/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.overview/types.pass.cpp b/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.overview/types.pass.cpp
index a2515a4c8..6c76a2552 100644
--- a/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.overview/types.pass.cpp
+++ b/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/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.overview/types.pass.cpp b/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.overview/types.pass.cpp
index 5bbca295f..62539ab3e 100644
--- a/test/std/diagnostics/syserr/syserr.errcondition/syserr.errcondition.overview/types.pass.cpp
+++ b/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/test/std/iterators/iterator.range/begin-end.fail.cpp b/test/std/iterators/iterator.range/begin-end.fail.cpp
index 335d8358a..18c5943a4 100644
--- a/test/std/iterators/iterator.range/begin-end.fail.cpp
+++ b/test/std/iterators/iterator.range/begin-end.fail.cpp
@@ -43,9 +43,9 @@ namespace Foo {
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/test/std/iterators/iterators.general/gcc_workaround.pass.cpp b/test/std/iterators/iterators.general/gcc_workaround.pass.cpp
index 28a5e95f3..7578e7182 100644
--- a/test/std/iterators/iterators.general/gcc_workaround.pass.cpp
+++ b/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/test/std/iterators/predef.iterators/insert.iterators/insert.iterator/types.pass.cpp b/test/std/iterators/predef.iterators/insert.iterators/insert.iterator/types.pass.cpp
index 5b61a3895..e379b3057 100644
--- a/test/std/iterators/predef.iterators/insert.iterators/insert.iterator/types.pass.cpp
+++ b/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 @@ struct find_members
void test()
{
this->container = 0;
- (void)(this->iter == this->iter);
+ TEST_IGNORE_NODISCARD (this->iter == this->iter);
}
};
diff --git a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.nonmember/make_move_iterator.pass.cpp b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.nonmember/make_move_iterator.pass.cpp
index 71b0eaca7..99ff9641a 100644
--- a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.nonmember/make_move_iterator.pass.cpp
+++ b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.nonmember/make_move_iterator.pass.cpp
@@ -43,8 +43,8 @@ int main()
}
{
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/test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.pass.cpp b/test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.pass.cpp
index 1ca454330..d96ca3225 100644
--- a/test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.pass.cpp
+++ b/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 @@ int main()
// 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/test/std/re/re.alg/re.alg.search/grep.pass.cpp b/test/std/re/re.alg/re.alg.search/grep.pass.cpp
index 13a352c3e..0040f7bfa 100644
--- a/test/std/re/re.alg/re.alg.search/grep.pass.cpp
+++ b/test/std/re/re.alg/re.alg.search/grep.pass.cpp
@@ -33,7 +33,7 @@ extern "C" void LLVMFuzzerTestOneInput(const char *data)
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/test/std/re/re.grammar/excessive_brace_count.pass.cpp b/test/std/re/re.grammar/excessive_brace_count.pass.cpp
index 7fe5f04f8..cc74a89f3 100644
--- a/test/std/re/re.grammar/excessive_brace_count.pass.cpp
+++ b/test/std/re/re.grammar/excessive_brace_count.pass.cpp
@@ -20,7 +20,7 @@ int main() {
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 @@ int main() {
{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/test/std/strings/basic.string/string.access/at.pass.cpp b/test/std/strings/basic.string/string.access/at.pass.cpp
index 8bfb829b0..16121cbf6 100644
--- a/test/std/strings/basic.string/string.access/at.pass.cpp
+++ b/test/std/strings/basic.string/string.access/at.pass.cpp
@@ -35,7 +35,7 @@ test(S s, typename S::size_type pos)
{
try
{
- (void)s.at(pos);
+ TEST_IGNORE_NODISCARD s.at(pos);
assert(false);
}
catch (std::out_of_range&)
@@ -44,7 +44,7 @@ test(S s, typename S::size_type pos)
}
try
{
- (void)cs.at(pos);
+ TEST_IGNORE_NODISCARD cs.at(pos);
assert(false);
}
catch (std::out_of_range&)
diff --git a/test/std/strings/basic.string/string.ops/string_compare/size_size_T_size_size.pass.cpp b/test/std/strings/basic.string/string.ops/string_compare/size_size_T_size_size.pass.cpp
index 6ca473f56..94f7890dd 100644
--- a/test/std/strings/basic.string/string.ops/string_compare/size_size_T_size_size.pass.cpp
+++ b/test/std/strings/basic.string/string.ops/string_compare/size_size_T_size_size.pass.cpp
@@ -45,7 +45,7 @@ test(const S& s, typename S::size_type pos1, typename S::size_type n1,
{
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 @@ test_npos(const S& s, typename S::size_type pos1, typename S::size_type n1,
{
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/test/std/strings/basic.string/string.ops/string_compare/size_size_pointer.pass.cpp b/test/std/strings/basic.string/string.ops/string_compare/size_size_pointer.pass.cpp
index 0f58fdcac..55af081a7 100644
--- a/test/std/strings/basic.string/string.ops/string_compare/size_size_pointer.pass.cpp
+++ b/test/std/strings/basic.string/string.ops/string_compare/size_size_pointer.pass.cpp
@@ -40,7 +40,7 @@ test(const S& s, typename S::size_type pos1, typename S::size_type n1,
{
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/test/std/strings/basic.string/string.ops/string_compare/size_size_pointer_size.pass.cpp b/test/std/strings/basic.string/string.ops/string_compare/size_size_pointer_size.pass.cpp
index 5761b7513..2fcecc755 100644
--- a/test/std/strings/basic.string/string.ops/string_compare/size_size_pointer_size.pass.cpp
+++ b/test/std/strings/basic.string/string.ops/string_compare/size_size_pointer_size.pass.cpp
@@ -40,7 +40,7 @@ test(const S& s, typename S::size_type pos, typename S::size_type n1,
{
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/test/std/strings/basic.string/string.ops/string_compare/size_size_string.pass.cpp b/test/std/strings/basic.string/string.ops/string_compare/size_size_string.pass.cpp
index c543e7337..0ddbf2e2f 100644
--- a/test/std/strings/basic.string/string.ops/string_compare/size_size_string.pass.cpp
+++ b/test/std/strings/basic.string/string.ops/string_compare/size_size_string.pass.cpp
@@ -40,7 +40,7 @@ test(const S& s, typename S::size_type pos1, typename S::size_type n1,
{
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/test/std/strings/basic.string/string.ops/string_compare/size_size_string_size_size.pass.cpp b/test/std/strings/basic.string/string.ops/string_compare/size_size_string_size_size.pass.cpp
index 6e6381348..590a15188 100644
--- a/test/std/strings/basic.string/string.ops/string_compare/size_size_string_size_size.pass.cpp
+++ b/test/std/strings/basic.string/string.ops/string_compare/size_size_string_size_size.pass.cpp
@@ -42,7 +42,7 @@ test(const S& s, typename S::size_type pos1, typename S::size_type n1,
{
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 @@ test_npos(const S& s, typename S::size_type pos1, typename S::size_type n1,
{
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/test/std/strings/basic.string/string.ops/string_compare/size_size_string_view.pass.cpp b/test/std/strings/basic.string/string.ops/string_compare/size_size_string_view.pass.cpp
index 1e025c70e..53114f37c 100644
--- a/test/std/strings/basic.string/string.ops/string_compare/size_size_string_view.pass.cpp
+++ b/test/std/strings/basic.string/string.ops/string_compare/size_size_string_view.pass.cpp
@@ -40,7 +40,7 @@ test(const S& s, typename S::size_type pos1, typename S::size_type n1,
{
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/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock.pass.cpp
index 8eeb8af2e..06dc11742 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock.pass.cpp
@@ -44,7 +44,7 @@ int main()
#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 @@ int main()
#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/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_for.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_for.pass.cpp
index a4a0bb2ff..7feb71390 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_for.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_for.pass.cpp
@@ -49,7 +49,7 @@ int main()
#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 @@ int main()
#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/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_until.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_until.pass.cpp
index 6fb9aaafd..836a9ae50 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_until.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_until.pass.cpp
@@ -49,7 +49,7 @@ int main()
#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 @@ int main()
#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/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock.pass.cpp
index c7b255ca1..3f7bd25a5 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock.pass.cpp
@@ -43,7 +43,7 @@ int main()
#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 @@ int main()
#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/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_for.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_for.pass.cpp
index 6a1dd0bc0..b73590441 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_for.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_for.pass.cpp
@@ -48,7 +48,7 @@ int main()
#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 @@ int main()
#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/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_until.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_until.pass.cpp
index e0ffa102d..c8d0aad6f 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_until.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_until.pass.cpp
@@ -48,7 +48,7 @@ int main()
#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 @@ int main()
#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/test/std/utilities/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp b/test/std/utilities/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp
index 5e0a116a5..419fd1a40 100644
--- a/test/std/utilities/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp
+++ b/test/std/utilities/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp
@@ -80,7 +80,7 @@ void checkThrows(any& a)
{
#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 @@ void checkThrows(any& a)
}
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 @@ void checkThrows(any& a)
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 @@ void checkThrows(any& a)
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/test/std/utilities/any/any.nonmembers/make_any.pass.cpp b/test/std/utilities/any/any.nonmembers/make_any.pass.cpp
index d98b8d68b..9850851fc 100644
--- a/test/std/utilities/any/any.nonmembers/make_any.pass.cpp
+++ b/test/std/utilities/any/any.nonmembers/make_any.pass.cpp
@@ -115,14 +115,14 @@ void test_make_any_throws()
{
{
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/test/std/utilities/memory/default.allocator/allocator.members/allocate.size.pass.cpp b/test/std/utilities/memory/default.allocator/allocator.members/allocate.size.pass.cpp
index e77e7d82a..34cbb8dc5 100644
--- a/test/std/utilities/memory/default.allocator/allocator.members/allocate.size.pass.cpp
+++ b/test/std/utilities/memory/default.allocator/allocator.members/allocate.size.pass.cpp
@@ -23,7 +23,7 @@ void test_max(size_t count)
{
std::allocator<T> a;
try {
- (void)a.allocate(count);
+ TEST_IGNORE_NODISCARD a.allocate(count);
assert(false);
} catch (const std::exception &) {
}
diff --git a/test/std/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp b/test/std/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp
index d678bdede..8bd8993e5 100644
--- a/test/std/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp
+++ b/test/std/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp
@@ -134,7 +134,7 @@ int main()
#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/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/dereference.runtime.fail.cpp b/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/dereference.runtime.fail.cpp
index b05fb71cd..50058a620 100644
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/dereference.runtime.fail.cpp
+++ b/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/test/std/utilities/tuple/tuple.tuple/tuple.elem/tuple.by.type.fail.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.elem/tuple.by.type.fail.cpp
index 74e6efd98..2f7ee4442 100644
--- a/test/std/utilities/tuple/tuple.tuple/tuple.elem/tuple.by.type.fail.cpp
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.elem/tuple.by.type.fail.cpp
@@ -16,12 +16,12 @@ struct UserType {};
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/test/std/utilities/variant/variant.get/get_index.pass.cpp b/test/std/utilities/variant/variant.get/get_index.pass.cpp
index 0ec65309d..f52dc5556 100644
--- a/test/std/utilities/variant/variant.get/get_index.pass.cpp
+++ b/test/std/utilities/variant/variant.get/get_index.pass.cpp
@@ -259,7 +259,7 @@ void test_throws_for_all_value_categories() {
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/test/std/utilities/variant/variant.get/get_type.pass.cpp b/test/std/utilities/variant/variant.get/get_type.pass.cpp
index 5d9213ed0..0a2222cbf 100644
--- a/test/std/utilities/variant/variant.get/get_type.pass.cpp
+++ b/test/std/utilities/variant/variant.get/get_type.pass.cpp
@@ -259,7 +259,7 @@ void test_throws_for_all_value_categories() {
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 (...) { /* ... */
diff --git a/test/support/test_macros.h b/test/support/test_macros.h
index 95270e437..257875a35 100644
--- a/test/support/test_macros.h
+++ b/test/support/test_macros.h
@@ -189,6 +189,8 @@
#define LIBCPP_ONLY(...) ((void)0)
#endif
+#define TEST_IGNORE_NODISCARD (void)
+
namespace test_macros_detail {
template <class T, class U>
struct is_same { enum { value = 0};} ;