[libcxx-commits] [PATCH] D155554: [libcxx] [test] Fix running tests with Clang-cl in Debug mode

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jul 18 11:46:09 PDT 2023


mstorsjo added inline comments.


================
Comment at: libcxx/test/support/set_windows_crt_report_mode.h:13
 
+#if defined(__cplusplus) && __cplusplus > 199711L
 #ifndef _DEBUG
----------------
Mordante wrote:
> Why do we need to test for C+98? If needed can you use our normal `TEST_STD_VER` macro?
One testcase in `libcxx/selftest/dsl/dsl.sh.py` tests compiling in C++03 mode. And for some reason, some of the MSVC headers that get included from `<crtdbg.h>` break if compiled in C++03 mode.

I can look into changing this to include `test_macros.h` and checking `TEST_STD_VER >= 11` instead. But since this header is force-included in every test compilation, we should ideally keep it as minimal as possible, so including `test_macros.h` might not be ideal (even if most tests themselves do include it). And I presume `test_macros.h` fail if included in C mode, so we possibly need to check against `defined(__cplusplus)` anyway?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155554/new/

https://reviews.llvm.org/D155554



More information about the libcxx-commits mailing list