summaryrefslogtreecommitdiffstats
path: root/libcxx/test
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2019-12-12 20:48:11 -0500
committerEric Fiselier <eric@efcs.ca>2019-12-12 21:09:08 -0500
commitf97936fabd263e3b311e3b8e9ffca4920e4fcff0 (patch)
tree2c9de3065660c9a37f8e963b2380a19d3ca0d8b9 /libcxx/test
parenta8154e5e0c83d2f0f65f3b4fb1a0bc68785bd975 (diff)
downloadbcm5719-llvm-f97936fabd263e3b311e3b8e9ffca4920e4fcff0.tar.gz
bcm5719-llvm-f97936fabd263e3b311e3b8e9ffca4920e4fcff0.zip
[libc++] Cleanup and enable multiple warnings.
Too many warnings are being disabled too quickly. Warnings are important to keeping libc++ correct. This patch re-enables two warnings: -Wconstant-evaluated and -Wdeprecated-copy. In future, all warnings disabled for the test suite should require an attached bug. The bug should state the plan for re-enabling that warning, or a strong case why it should remain disabled.
Diffstat (limited to 'libcxx/test')
-rw-r--r--libcxx/test/libcxx/containers/sequences/vector/asan_throw.pass.cpp1
-rw-r--r--libcxx/test/std/utilities/meta/meta.const.eval/is_constant_evaluated.fail.cpp1
-rw-r--r--libcxx/test/std/utilities/meta/meta.const.eval/is_constant_evaluated.pass.cpp6
-rw-r--r--libcxx/test/std/utilities/optional/optional.object/optional.object.assign/copy.pass.cpp1
-rw-r--r--libcxx/test/support/test_macros.h6
5 files changed, 15 insertions, 0 deletions
diff --git a/libcxx/test/libcxx/containers/sequences/vector/asan_throw.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/asan_throw.pass.cpp
index 443a6f2e924..235a3ffae14 100644
--- a/libcxx/test/libcxx/containers/sequences/vector/asan_throw.pass.cpp
+++ b/libcxx/test/libcxx/containers/sequences/vector/asan_throw.pass.cpp
@@ -50,6 +50,7 @@ public:
throw 0;
}
}
+ ThrowOnCopy& operator=(ThrowOnCopy const&) = default;
bool should_throw;
};
diff --git a/libcxx/test/std/utilities/meta/meta.const.eval/is_constant_evaluated.fail.cpp b/libcxx/test/std/utilities/meta/meta.const.eval/is_constant_evaluated.fail.cpp
index c139233b8da..2d2e0715762 100644
--- a/libcxx/test/std/utilities/meta/meta.const.eval/is_constant_evaluated.fail.cpp
+++ b/libcxx/test/std/utilities/meta/meta.const.eval/is_constant_evaluated.fail.cpp
@@ -24,6 +24,7 @@ int main(int, char**)
#else
// expected-error@+1 {{static_assert failed}}
static_assert(!std::is_constant_evaluated(), "");
+ // expected-error@-1 0-1 {{'std::is_constant_evaluated' will always evaluate to 'true' in a manifestly constant-evaluated expression}}
#endif
return 0;
}
diff --git a/libcxx/test/std/utilities/meta/meta.const.eval/is_constant_evaluated.pass.cpp b/libcxx/test/std/utilities/meta/meta.const.eval/is_constant_evaluated.pass.cpp
index 0f9f98e9176..e4b8a7575b0 100644
--- a/libcxx/test/std/utilities/meta/meta.const.eval/is_constant_evaluated.pass.cpp
+++ b/libcxx/test/std/utilities/meta/meta.const.eval/is_constant_evaluated.pass.cpp
@@ -23,6 +23,12 @@
#endif
#endif
+// Disable the tautological constant evaluation warnings for this test,
+// because it's explicitly testing those cases.
+#if TEST_HAS_WARNING("-Wconstant-evaluated") && defined(__clang__)
+#pragma clang diagnostic ignored "-Wconstant-evaluated"
+#endif
+
template <bool> struct InTemplate {};
int main(int, char**)
diff --git a/libcxx/test/std/utilities/optional/optional.object/optional.object.assign/copy.pass.cpp b/libcxx/test/std/utilities/optional/optional.object/optional.object.assign/copy.pass.cpp
index a5ff10201c9..f14e20657d7 100644
--- a/libcxx/test/std/utilities/optional/optional.object/optional.object.assign/copy.pass.cpp
+++ b/libcxx/test/std/utilities/optional/optional.object/optional.object.assign/copy.pass.cpp
@@ -30,6 +30,7 @@ struct X
if (throw_now)
TEST_THROW(6);
}
+ X& operator=(X const&) = default;
};
bool X::throw_now = false;
diff --git a/libcxx/test/support/test_macros.h b/libcxx/test/support/test_macros.h
index f5fbedb5555..443165516b2 100644
--- a/libcxx/test/support/test_macros.h
+++ b/libcxx/test/support/test_macros.h
@@ -47,6 +47,12 @@
#define TEST_HAS_EXTENSION(X) 0
#endif
+#ifdef __has_warning
+#define TEST_HAS_WARNING(X) __has_warning(X)
+#else
+#define TEST_HAS_WARNING(X) 0
+#endif
+
#ifdef __has_builtin
#define TEST_HAS_BUILTIN(X) __has_builtin(X)
#else
OpenPOWER on IntegriCloud