| Issue |
183476
|
| Summary |
[Clang] accepts ambiguous inline namespace redeclaration
|
| Labels |
clang
|
| Assignees |
|
| Reporter |
YuchangSu
|
The code creates an inline namespace `::X0` containing another inline namespace `::X0::X0`. Because inline namespaces inject members into the enclosing namespace for lookup, `::X0::X0` also becomes visible as `::X0` at global scope, making the later `inline namespace X0 {}` ambiguous. GCC rejects it; Clang accepts it.
Code:
```
inline namespace X0 { inline namespace X0 { } } inline namespace X0 { }
```
See Compiler Explorer: [https://godbolt.org/z/crcEhreqP](https://godbolt.org/z/crcEhreqP)
The test case was generated by a fuzzer.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs