From 68fb8051d086e1cf824d62c9c1093bed5e1ed9aa Mon Sep 17 00:00:00 2001 From: Louis Dionne Date: Fri, 1 May 2020 13:14:04 -0400 Subject: [PATCH] [libc++] Turn on warnings in the test suite in C++03 for Clang-based compilers --- libcxx/test/libcxx/selftest/newformat/pass.cpp/werror.pass.cpp | 3 --- libcxx/test/libcxx/selftest/newformat/sh.cpp/werror.sh.cpp | 3 --- .../associative/map/PR28469_undefined_behavior_segfault.sh.cpp | 2 ++ libcxx/utils/libcxx/test/config.py | 6 ++---- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/libcxx/test/libcxx/selftest/newformat/pass.cpp/werror.pass.cpp b/libcxx/test/libcxx/selftest/newformat/pass.cpp/werror.pass.cpp index ee82c61..31b7453 100644 --- a/libcxx/test/libcxx/selftest/newformat/pass.cpp/werror.pass.cpp +++ b/libcxx/test/libcxx/selftest/newformat/pass.cpp/werror.pass.cpp @@ -17,9 +17,6 @@ // TODO: We don't enable -Werror on GCC right now, because too many tests fail. // UNSUPPORTED: gcc -// TODO(ldionne): We don't enable -Werror in C++03 right now -// UNSUPPORTED: c++98, c++03 - int main() { int foo; } diff --git a/libcxx/test/libcxx/selftest/newformat/sh.cpp/werror.sh.cpp b/libcxx/test/libcxx/selftest/newformat/sh.cpp/werror.sh.cpp index eb115ed..5b84275 100644 --- a/libcxx/test/libcxx/selftest/newformat/sh.cpp/werror.sh.cpp +++ b/libcxx/test/libcxx/selftest/newformat/sh.cpp/werror.sh.cpp @@ -14,9 +14,6 @@ // TODO: We don't enable -Werror on GCC right now, because too many tests fail. // UNSUPPORTED: gcc -// TODO(ldionne): We don't enable -Werror in C++03 right now -// UNSUPPORTED: c++98, c++03 - // FILE_DEPENDENCIES: %t.exe // RUN: %{build} -Wunused-variable // RUN: %{run} diff --git a/libcxx/test/std/containers/associative/map/PR28469_undefined_behavior_segfault.sh.cpp b/libcxx/test/std/containers/associative/map/PR28469_undefined_behavior_segfault.sh.cpp index 83aa36d..b63fdf4 100644 --- a/libcxx/test/std/containers/associative/map/PR28469_undefined_behavior_segfault.sh.cpp +++ b/libcxx/test/std/containers/associative/map/PR28469_undefined_behavior_segfault.sh.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // FILE_DEPENDENCIES: %t.exe // RUN: %{build} -O2 // RUN: %{run} diff --git a/libcxx/utils/libcxx/test/config.py b/libcxx/utils/libcxx/test/config.py index 3f718ed..93e9f8d 100644 --- a/libcxx/utils/libcxx/test/config.py +++ b/libcxx/utils/libcxx/test/config.py @@ -812,10 +812,8 @@ class Configuration(object): self.cxx.compile_flags += ['-D_LIBCPP_DEBUG=%s' % debug_level] def configure_warnings(self): - # Turn on warnings by default for Clang based compilers when C++ >= 11 - default_enable_warnings = self.cxx.type in ['clang', 'apple-clang'] \ - and len(self.config.available_features.intersection( - ['c++11', 'c++14', 'c++17', 'c++2a'])) != 0 + # Turn on warnings by default for Clang based compilers + default_enable_warnings = self.cxx.type in ['clang', 'apple-clang'] enable_warnings = self.get_lit_bool('enable_warnings', default_enable_warnings) self.cxx.useWarnings(enable_warnings) -- 2.7.4