[libcxx-commits] [PATCH] D103400: [libcxx] [test] Fix the include_as_c.sh.cpp test in MSVC configurations

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon May 31 04:23:05 PDT 2021

mstorsjo created this revision.
mstorsjo requested review of this revision.
Herald added a project: libc++.
Herald added a reviewer: libc++.

Avoid including a header that is known not to work with clang in MSVC
mode when compiling as C.

(Alternatively, this could be something like "XFAIL: clang && msvc",
but I think it's more useful to actually check the rest of the test
instead of expecting the whole test to fail.)

  rG LLVM Github Monorepo



Index: libcxx/test/libcxx/include_as_c.sh.cpp
--- libcxx/test/libcxx/include_as_c.sh.cpp
+++ libcxx/test/libcxx/include_as_c.sh.cpp
@@ -14,8 +14,6 @@
 // file as C, but we're passing C++ flags on the command-line.
 // Test that the C wrapper headers can be included when compiling them as C.
 // NOTE: It's not common or recommended to have libc++ in the header search
@@ -43,7 +41,11 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <tgmath.h>
+// The clang-shipped tgmath.h header doesn't work with MSVC/UCRT's complex
+// headers in C mode, see PR46207.
+#ifndef _MSC_VER
+#    include <tgmath.h>
 #include <wchar.h>
 #include <wctype.h>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103400.348770.patch
Type: text/x-patch
Size: 804 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210531/828de20d/attachment.bin>

More information about the libcxx-commits mailing list