From 8dc0c976661ff048c346d6c68666bd7056ed84a5 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 19 Jan 2015 19:43:04 +0100 Subject: [PATCH 1/2] WCDH: Fix the C_STANDARD property in the tests. The CXX_STANDARD property validates the values allowed for it, and '90' is not a valid value for it. However, the validation is only done for languages enabled for the target, and as C_undefined has no CXX files, that language is not enabled for it. This amends commit v3.1.0-rc3~23^2 (WCDH: Make the header -Wundef safe for the C language., 2014-11-24). --- Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt index b5e46c00b..78c4a6aaa 100644 --- a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt +++ b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt @@ -71,7 +71,7 @@ if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang" OR CMAKE_C_COMPILER_ID STREQUAL "AppleClang") add_executable(C_undefined c_undefined.c) - set_property(TARGET C_undefined PROPERTY CXX_STANDARD 90) + set_property(TARGET C_undefined PROPERTY C_STANDARD 90) target_compile_options(C_undefined PRIVATE -Werror=undef) endif() From 3c0996c135198fbcaf8951cffc98e3a1570e756d Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 19 Jan 2015 19:52:22 +0100 Subject: [PATCH 2/2] WCDH: Test that no C compiler features are defined for CXX compiler. This amends commit 54156d72 (WCDH: Generate per-language files in multi-file mode., 2015-01-17). --- Tests/Module/WriteCompilerDetectionHeader/main.cpp | 4 ++++ Tests/Module/WriteCompilerDetectionHeader/multi_files.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/Tests/Module/WriteCompilerDetectionHeader/main.cpp b/Tests/Module/WriteCompilerDetectionHeader/main.cpp index 82b219163..192094c1b 100644 --- a/Tests/Module/WriteCompilerDetectionHeader/main.cpp +++ b/Tests/Module/WriteCompilerDetectionHeader/main.cpp @@ -4,6 +4,10 @@ #define PREFIX TEST #include "compile_tests.h" +#ifdef TEST_COMPILER_C_STATIC_ASSERT +#error Expect no C features defined +#endif + int main() { return 0; diff --git a/Tests/Module/WriteCompilerDetectionHeader/multi_files.cpp b/Tests/Module/WriteCompilerDetectionHeader/multi_files.cpp index ca298231d..1635091cb 100644 --- a/Tests/Module/WriteCompilerDetectionHeader/multi_files.cpp +++ b/Tests/Module/WriteCompilerDetectionHeader/multi_files.cpp @@ -4,6 +4,10 @@ #define PREFIX MULTI #include "compile_tests.h" +#ifdef MULTI_COMPILER_C_STATIC_ASSERT +#error Expect no C features defined +#endif + int main() { return 0;