[clang] typeid() can only be used with <typeinfo>
Open
clang:modules
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
When compiling a translation unit that calls the `typeid()` operator, the compiler will compile the file only if `` is `#include`d. It will not compile when using `import std;` (or any module that re-exports `std::type_info`), for example, without any `#include `.
I imagine this is not intended, as [cppreference](https://en.cppreference.com/w/cpp/language/typeid.html) states that a program is ill-informed if it calls `typeid()` without `std::type_info` being visible, if a translation imports a module that re-exports `std::type_info`, it should in theory still work, yet it does not.
Contributor guide
Assessment
This issue has not been assessed yet.