[llvm-branch-commits] [libcxx] [llvm] [libc++][C++03] Use `__cxx03/` headers in C++03 mode (PR #109002)

Louis Dionne via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Dec 9 07:55:17 PST 2024


================
@@ -152,11 +152,6 @@ _LIBCPP_HARDENING_MODE_DEBUG
 #  define _LIBCPP_TOSTRING2(x) #x
 #  define _LIBCPP_TOSTRING(x) _LIBCPP_TOSTRING2(x)
 
-// NOLINTNEXTLINE(libcpp-cpp-version-check)
-#  if __cplusplus < 201103L
-#    define _LIBCPP_CXX03_LANG
-#  endif
----------------
ldionne wrote:

In the current state of this patch, the "intersection" between the 03 headers and the normal headers is basically the definition of `_LIBCPP_CXX03_LANG`, but we're including all of `__configuration/language.h` for that. I think that we should strive to make that intersection empty, because anything in that intersection can cause incompatibilities and confusion.

Since `_LIBCPP_CXX03_LANG` is so simple, I would instead just check the value of `__cplusplus` directly at the top-level, and not share anything between the 03 headers and the normal headers.

Note that `__config_site` is also something that technically falls inside that intersection and that's tricky to handle, we can discuss that separately.

https://github.com/llvm/llvm-project/pull/109002


More information about the llvm-branch-commits mailing list