[libcxx-commits] [libcxx] [libc++][modules] Guard missing header validation on Windows. (PR #80478)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Feb 6 11:39:08 PST 2024


================
@@ -57,18 +57,31 @@ def write_file(module):
             else:
                 module_cpp_in.write(f"#include <{header}>\n")
 
-        module_cpp_in.write("\n// *** Headers not yet available ***\n")
+        module_cpp_in.write(
+            """
+// *** Headers not yet available ***
+//
+// This validation is mainly to aid libc++ developers to add modules for new
+// headers. On Windows the Windows SDK can be in the include path. This SDK
+// contains the MSVC STL headers. This may give false positives when MSVC STL
+// provides a header libc++ has not implemented yet. Therefore this validation
+// is not done on Windows.
----------------
ldionne wrote:

```suggestion
// *** Headers not yet available ***
//
// This validation is mainly to catch when a new header is added but adding the 
// corresponding .inc file is forgotten. However, the check based on __has_include
// alone doesn't work on Windows because the Windows SDK is on the include path,
// and that means the MSVC STL headers can be found as well, tricking __has_include
// into thinking that libc++ provides the header.
```

Rewording suggestion -- I had a bit of trouble understanding the original formulation.

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


More information about the libcxx-commits mailing list