<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/60542>60542</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Header modules should do a bit more work when diagnosing unqualified names in their own namespace
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang:modules,
clang:diagnostics
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
cjdb
</td>
</tr>
</table>
<pre>
```cpp
namespace std {
void example()
{
return is_lvalue_reference_v<T>;
}
} // namespace std
```
`clang++ -fmodules above_snippet.cpp` will diagnose as follows:
```
```
error: use of undeclared identifier 'is_lvalue_reference_v'
```
However, if we qualify `is_lvalue_reference_v` with `std::`, this magically changes to
```
error: declaration of 'is_lvalue_reference_v' must be imported from module 'std.type_traits.detail.categories' before it is required
```
This discrepancy is a bit weird: the compiler should know that `is_lvalue_reference_v` implies `std::is_lvalue_reference_v` when in `namespace std`, and thus diagnose it in the same way for both cases.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8VN1u2zoMfhr5hljgyLXTXPgibU6wB9h9QEuUzU2WPEmOT97-QHZ6ugJdAcE_JEXy-_iDMXLviFpRv4j6XOCcBh9a9VN3Ref1vRVNuR01TaI8i_LkcKQ4oSKISYM4vGxigJtnDfQvjpMlIZ-FPL5p_jACCJTm4IDj1d7QznQNZCiQU3S9ier1h6j-EdWbvTicty9xOIOQFyEv8CGBh_Yty_9_lUXXC_ki5At8M6PXs6UI2PkbXaPjaaK0y5CaEha2FjRj73wkwAjGW-uXKKrT594_E1IIPojqBHMk8AZmp0lZDKSBNbnEhimAkIfPccvDF6G--4VuFIR8BTawEPye0bK5g2jKz92tqNKQDTJH1Smfpswe0sARRuxZobV3UAO6niIk_zWsDQ0m9i7D-wIIjHNM0BHwOPmQSIMJfoStBPliTHqX7hNdU0BOcacpIdudwkS9D0wxO-nI-EDACThCoN8zB_pLsdfnjwxLc1SBJnTqnq8hdJxgIQ6ZAkgDgfLjxJYCxMHPVsMv5xdIA6YvueRxskzxA51_J34gB-yy8cdO3fhHpyENc3zvuIzRrdlFHAkWvIPxATqfBlAYKe4K3Vb6WB2xoHbfHOpG1k1ZFUNr9obq5lkd6dlINE3d4UGZhqpno400VHArS1mVsqz3x6qS1a4p93p_wL0ssUKJT-KppDHTb-1t3PnQFxzjTG1T1k-ysNiRjetykHIbqer0GCYhpZCvf8gfgBKrVVefi9Bmr9-6uY_iqbQcU3yPkzhZar8TagrwNqCPsmj_KN6Ym2Dx4ddG6yMEux5mt00Bk942woNEDuAX974kijnYdkhpWud53SA9p2HudsqPQl5yPo_Xtyn4n6SSkJeVhCjkZeXhvwAAAP__pUel9g">