]> granicus.if.org Git - clang/commit
DR407: Rationalize how we handle tags being hidden by typedefs. Even with
authorRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 12 Nov 2015 22:04:34 +0000 (22:04 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 12 Nov 2015 22:04:34 +0000 (22:04 +0000)
commit1f75bce87164ddc6dd1c7c44ba05c44fff30732a
treed0b062cc03d21956ab04fa93c7c42c21be1fe205
parent42dd19ccb232086c93e13f8914b373a80310ba7e
DR407: Rationalize how we handle tags being hidden by typedefs. Even with
DR407, the C++ standard doesn't really say how this should work. Here's what we
do (which is consistent with DR407 as far as I can tell):

 * When performing name lookup for an elaborated-type-specifier, a tag
   declaration hides a typedef declaration that names the same type.
 * When performing any other kind of lookup, a typedef declaration hides
   a tag declaration that names the same type.

In any other case where lookup finds both a typedef and a tag (that is, when
they name different types), the lookup will be ambiguous. If lookup finds a
tag and a typedef that name the same type, and finds anything else, the lookup
will always be ambiguous (even if the other entity would hide the tag, it does
not also hide the typedef).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@252959 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaLookup.cpp
test/CXX/drs/dr4xx.cpp
www/cxx_dr_status.html