diff options
| author | Eric Fiselier <eric@efcs.ca> | 2015-08-30 22:04:20 +0000 |
|---|---|---|
| committer | Eric Fiselier <eric@efcs.ca> | 2015-08-30 22:04:20 +0000 |
| commit | d49455ef9357e9c2cb638746559d0dcc68192e0c (patch) | |
| tree | 73f254d90673e1700864a077b3f83dde2a99e8a4 /libcxx | |
| parent | 96425c2574d00997b99fff72afe3137956111502 (diff) | |
| download | bcm5719-llvm-d49455ef9357e9c2cb638746559d0dcc68192e0c.tar.gz bcm5719-llvm-d49455ef9357e9c2cb638746559d0dcc68192e0c.zip | |
Suppress clang warnings in some tests
llvm-svn: 246399
Diffstat (limited to 'libcxx')
9 files changed, 55 insertions, 28 deletions
diff --git a/libcxx/test/libcxx/double_include.sh.cpp b/libcxx/test/libcxx/double_include.sh.cpp index 5620e5b35c2..99767cf1bbc 100644 --- a/libcxx/test/libcxx/double_include.sh.cpp +++ b/libcxx/test/libcxx/double_include.sh.cpp @@ -15,6 +15,12 @@ // RUN: %cxx -o %t.exe %t.first.o %t.second.o %flags %link_flags // RUN: %run + +// Prevent <ext/hash_map> from generating deprecated warnings for this test. +#if defined(__DEPRECATED) +#undef __DEPRECATED +#endif + #include <algorithm> #include <array> #include <bitset> @@ -50,6 +56,7 @@ #include <deque> #include <exception> #include <experimental/algorithm> +#include <experimental/any> #include <experimental/chrono> #include <experimental/dynarray> #include <experimental/optional> diff --git a/libcxx/test/libcxx/test/config.py b/libcxx/test/libcxx/test/config.py index 5171f25ae04..f66b831fc53 100644 --- a/libcxx/test/libcxx/test/config.py +++ b/libcxx/test/libcxx/test/config.py @@ -578,6 +578,10 @@ class Configuration(object): self.cxx.addWarningFlagIfSupported('-Wno-pessimizing-move') self.cxx.addWarningFlagIfSupported('-Wno-c++11-extensions') self.cxx.addWarningFlagIfSupported('-Wno-user-defined-literals') + # TODO(EricWF) Remove the unused warnings once the test suite + # compiles clean with them. + self.cxx.addWarningFlagIfSupported('-Wno-unused-local-typedef') + self.cxx.addWarningFlagIfSupported('-Wno-unused-variable') std = self.get_lit_conf('std', None) if std in ['c++98', 'c++03']: # The '#define static_assert' provided by libc++ in C++03 mode diff --git a/libcxx/test/std/experimental/optional/optional.object/optional.object.ctor/const_T.pass.cpp b/libcxx/test/std/experimental/optional/optional.object/optional.object.ctor/const_T.pass.cpp index 071f5943b97..c782d10a9b4 100644 --- a/libcxx/test/std/experimental/optional/optional.object/optional.object.ctor/const_T.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.object/optional.object.ctor/const_T.pass.cpp @@ -6,6 +6,8 @@ // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// +// +// UNSUPPORTED: c++98, c++03, c++11 // <optional> @@ -15,8 +17,6 @@ #include <type_traits> #include <cassert> -#if _LIBCPP_STD_VER > 11 - using std::experimental::optional; class X @@ -39,18 +39,14 @@ public: class Z { - int i_; public: - Z(int i) : i_(i) {} + Z(int) {} Z(const Z&) {throw 6;} }; -#endif // _LIBCPP_STD_VER > 11 - int main() { -#if _LIBCPP_STD_VER > 11 { typedef int T; constexpr T t(5); @@ -113,5 +109,4 @@ int main() assert(i == 6); } } -#endif // _LIBCPP_STD_VER > 11 } diff --git a/libcxx/test/std/experimental/optional/optional.object/optional.object.ctor/in_place_t.pass.cpp b/libcxx/test/std/experimental/optional/optional.object/optional.object.ctor/in_place_t.pass.cpp index 412c993ffbd..ae53211035a 100644 --- a/libcxx/test/std/experimental/optional/optional.object/optional.object.ctor/in_place_t.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.object/optional.object.ctor/in_place_t.pass.cpp @@ -6,6 +6,8 @@ // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// +// +// UNSUPPORTED: c++98, c++03, c++11 // <optional> @@ -16,7 +18,6 @@ #include <type_traits> #include <cassert> -#if _LIBCPP_STD_VER > 11 using std::experimental::optional; using std::experimental::in_place_t; @@ -52,17 +53,13 @@ public: class Z { - int i_; public: - Z(int i) : i_(i) {throw 6;} + Z(int i) {throw 6;} }; -#endif // _LIBCPP_STD_VER > 11 - int main() { -#if _LIBCPP_STD_VER > 11 { constexpr optional<int> opt(in_place, 5); static_assert(static_cast<bool>(opt) == true, ""); @@ -141,5 +138,4 @@ int main() assert(i == 6); } } -#endif // _LIBCPP_STD_VER > 11 } diff --git a/libcxx/test/std/experimental/optional/optional.object/optional.object.ctor/rvalue_T.pass.cpp b/libcxx/test/std/experimental/optional/optional.object/optional.object.ctor/rvalue_T.pass.cpp index ac52a42d595..71bf3535082 100644 --- a/libcxx/test/std/experimental/optional/optional.object/optional.object.ctor/rvalue_T.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.object/optional.object.ctor/rvalue_T.pass.cpp @@ -6,6 +6,8 @@ // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// +// +// UNSUPPORTED: c++98, c++03, c++11 // <optional> @@ -15,8 +17,6 @@ #include <type_traits> #include <cassert> -#if _LIBCPP_STD_VER > 11 - using std::experimental::optional; class X @@ -41,17 +41,14 @@ public: class Z { - int i_; public: - Z(int i) : i_(i) {} + Z(int) {} Z(Z&&) {throw 6;} }; -#endif // _LIBCPP_STD_VER > 11 int main() { -#if _LIBCPP_STD_VER > 11 { typedef int T; constexpr optional<T> opt(T(5)); @@ -106,5 +103,4 @@ int main() assert(i == 6); } } -#endif // _LIBCPP_STD_VER > 11 } diff --git a/libcxx/test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.ops/assign_t.pass.cpp b/libcxx/test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.ops/assign_t.pass.cpp index 02ef571a06f..932ef25b784 100644 --- a/libcxx/test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.ops/assign_t.pass.cpp +++ b/libcxx/test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.ops/assign_t.pass.cpp @@ -17,6 +17,10 @@ #include <sstream> #include <cassert> +#if defined(__clang__) +#pragma clang diagnostic ignored "-Wliteral-conversion" +#endif + int main() { { diff --git a/libcxx/test/std/language.support/support.types/nullptr_t.pass.cpp b/libcxx/test/std/language.support/support.types/nullptr_t.pass.cpp index 4d7c8b0bc0a..99bbd3e9154 100644 --- a/libcxx/test/std/language.support/support.types/nullptr_t.pass.cpp +++ b/libcxx/test/std/language.support/support.types/nullptr_t.pass.cpp @@ -52,6 +52,24 @@ void test_comparisons() assert(!(nullptr > p)); } +#if defined(__clang__) +#pragma clang diagnostic push +#pragma diagnostic ignored "-Wnull-conversion" +#endif +void test_nullptr_conversions() { + { + bool b = nullptr; + assert(!b); + } + { + bool b(nullptr); + assert(!b); + } +} +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + int main() { @@ -72,8 +90,5 @@ int main() test_comparisons<A*>(); test_comparisons<void(*)()>(); } - { - bool b = nullptr; - assert(!b); - } + test_nullptr_conversions(); } diff --git a/libcxx/test/std/utilities/memory/default.allocator/allocator.members/construct.pass.cpp b/libcxx/test/std/utilities/memory/default.allocator/allocator.members/construct.pass.cpp index 40c44d94906..28dadd83151 100644 --- a/libcxx/test/std/utilities/memory/default.allocator/allocator.members/construct.pass.cpp +++ b/libcxx/test/std/utilities/memory/default.allocator/allocator.members/construct.pass.cpp @@ -38,8 +38,6 @@ int move_only_constructed = 0; #if TEST_STD_VER >= 11 class move_only { - int data; - move_only(const move_only&) = delete; move_only& operator=(const move_only&)= delete; @@ -49,6 +47,10 @@ public: move_only() {++move_only_constructed;} ~move_only() {--move_only_constructed;} + +public: + int data; // unused other than to make sizeof(move_only) == sizeof(int). + // but public to suppress "-Wunused-private-field" }; #endif // TEST_STD_VER >= 11 diff --git a/libcxx/test/std/utilities/meta/meta.rel/is_convertible_fallback.pass.cpp b/libcxx/test/std/utilities/meta/meta.rel/is_convertible_fallback.pass.cpp index bd35ef63d08..5a607f3b12a 100644 --- a/libcxx/test/std/utilities/meta/meta.rel/is_convertible_fallback.pass.cpp +++ b/libcxx/test/std/utilities/meta/meta.rel/is_convertible_fallback.pass.cpp @@ -13,6 +13,14 @@ // Test the fallback implementation. +// libc++ provides a fallback implementation of the compiler trait +// `__is_convertible` with the same name when clang doesn't. +// Because this test forces the use of the fallback even when clang provides +// it causing a keyword incompatibility. +#if defined(__clang__) +#pragma clang diagnostic ignored "-Wkeyword-compat" +#endif + #define _LIBCPP_USE_IS_CONVERTIBLE_FALLBACK #include "is_convertible.pass.cpp" |

