Issue 76620
Summary [libc++] Feature guards test too late
Labels libc++
Assignees mordante
Reporter mordante
    In this example:
```
In file included from weird.cc:1:
In file included from /home/luca/wasm-compilers/build/sysroot/include/c++/v1/thread:93:
In file included from /home/luca/wasm-compilers/build/sysroot/include/c++/v1/__thread/jthread.h:18:
/home/luca/wasm-compilers/build/sysroot/include/c++/v1/__thread/thread.h:55:34: error: unknown type name 'condition_variable'
   55 |   void notify_all_at_thread_exit(condition_variable*, mutex*);
      | ^
```

The header `thread` validates the `_LIBCPP_HAS_NO_THREADS` macro _after_ including its granularized headers. We should validate the top-level header before starting to include unguarded headers. This should be done for all feature macros.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to