Fix bug in using shadow decl checking: a using shadow decl should not conflict
authorRichard Smith <richard-llvm@metafoo.co.uk>
Sat, 27 Feb 2016 02:36:43 +0000 (02:36 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Sat, 27 Feb 2016 02:36:43 +0000 (02:36 +0000)
commite5a91464bc56d201f4f5c6db8b7900e89235d5a8
treeeba4e7ba2377e0010a540a61fd8d604504b28706
parent0d202ffa7cd27b966e30d3bb704693c01b443aa5
Fix bug in using shadow decl checking: a using shadow decl should not conflict
with a prior UsingDecl -- those should not even really be found by the lookup
here, except that we use the same lookup results for two different checks, and
the other check needs them.

This happens to work in *almost all* cases, because either the lookup results
list the UsingDecl first (and the NonTag result gets replaced by something
else) or because the problematic declaration is a function (which causes us to
use different logic to detect conflicts). This can also be triggered from a
state only reachable through modules (where the name lookup results can contain
multiple UsingDecls in the same scope).

llvm-svn: 262105
clang/lib/Sema/SemaDeclCXX.cpp
clang/test/SemaCXX/using-decl-1.cpp