Open Quuxplusone opened 6 years ago
Bugzilla Link | PR37797 |
Status | NEW |
Importance | P normal |
Reported by | David Pickens (pickensd@synopsys.com) |
Reported on | 2018-06-13 17:45:34 -0700 |
Last modified on | 2018-06-14 11:29:40 -0700 |
Version | trunk |
Hardware | PC Linux |
CC | dblaikie@gmail.com, dgregor@apple.com, llvm-bugs@lists.llvm.org, pickensd@synopsys.com, richard-llvm@metafoo.co.uk |
Fixed by commit(s) | |
Attachments | |
Blocks | |
Blocked by | |
See also |
Clang 3.8 and before generate a bogus diagnostic on the second using-
declaration in C ("target of using declaration conflicts with declaration in
scope"). The two using-declarations in C are valid: the variable declaration
hides the type declaration, per [basic.scope.declarative]p4.
That said, this should be ill-formed, because the variable does *not* hide the
type when they're both found in the global namespace via the using-directives
(hiding only happens between declarations that introduce names into the same
declarative region).
Reversing the order of the using-directives produces the desired error, as does
removing the (hidden) using A::x; from namespace C. I expect we're throwing out
the D::x lookup result because it matches the C::x lookup result, without
noticing that C::x would be hidden and D::x would not.