]> granicus.if.org Git - clang/commit
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)
commitfceda7d31062da61f20ac369843d390d9ff4fc20
treefe180d8ebb1f8f327b10053031e0b0a13f99d0ca
parentc86e6b724305c66502117b7b5e2ad8b358f619fd
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).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262105 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaDeclCXX.cpp
test/SemaCXX/using-decl-1.cpp