[llvm] Remove dependence on <ciso646> (PR #73273)

via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 23 18:10:05 PST 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-support

Author: Michael Kenzel (michael-kenzel)

<details>
<summary>Changes</summary>

C++23 removed `<ciso646>` from the standard library. The header is used in two places: once in order to pull in implementation-specific and feature test macros. Since this file also includes `<optional>`, that use of `<ciso646>` is technically redundant, but should probably be left in in case a future change ever removes the include of `<optional>`. A second use of `<ciso646>` seems to have been introduced in da650094b187ee3c8017d74f63c885663faca1d8, but seems unnecessary (the file doesn't seem to use anything from that header, and it seems to build just fine on MSVC here without it). This change replaces uses of `<ciso646>` with the new `<version>` header, which should be supported by all supported implementations.

---
Full diff: https://github.com/llvm/llvm-project/pull/73273.diff


2 Files Affected:

- (modified) llvm/include/llvm/Support/Threading.h (+1-1) 
- (modified) llvm/lib/DebugInfo/GSYM/LookupResult.cpp (-1) 


``````````diff
diff --git a/llvm/include/llvm/Support/Threading.h b/llvm/include/llvm/Support/Threading.h
index ba6c531ab4db214..e83cb67ac1cab47 100644
--- a/llvm/include/llvm/Support/Threading.h
+++ b/llvm/include/llvm/Support/Threading.h
@@ -18,7 +18,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Config/llvm-config.h" // for LLVM_ON_UNIX
 #include "llvm/Support/Compiler.h"
-#include <ciso646> // So we can check the C++ standard lib macros.
+#include <version>
 #include <optional>
 
 #if defined(_MSC_VER)
diff --git a/llvm/lib/DebugInfo/GSYM/LookupResult.cpp b/llvm/lib/DebugInfo/GSYM/LookupResult.cpp
index 00a5b1bbfaa5fba..0a09feefbd7503f 100644
--- a/llvm/lib/DebugInfo/GSYM/LookupResult.cpp
+++ b/llvm/lib/DebugInfo/GSYM/LookupResult.cpp
@@ -12,7 +12,6 @@
 #include "llvm/Support/Format.h"
 #include "llvm/Support/Path.h"
 #include "llvm/Support/raw_ostream.h"
-#include <ciso646>
 
 using namespace llvm;
 using namespace gsym;

``````````

</details>


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


More information about the llvm-commits mailing list