[PATCH] D60956: [Sema] Fix the lookup for a declaration conflicting with an enumerator (bogus use of LookupResult::getAsSingle)
Bruno Ricci via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Apr 21 14:42:46 PDT 2019
riccibruno created this revision.
riccibruno added reviewers: aaron.ballman, rnk, rsmith.
riccibruno added a project: clang.
Herald added a subscriber: cfe-commits.
Currently the lookup for a declaration conflicting with an enumerator is pretty broken, because of the use of `LookupResult::getAsSingle<NameDecl>()` (see the tests for examples).
This patch fixes this by removing the bogus use of `getAsSingle<NameDecl>()`. While we are at it, also do the check for a conflicting declaration before calling `CheckShadow` (which implements `Wshadow`). This avoids redundant `Wshadow` warnings where we already have an error.
This is not the only place where `getAsSingle` is mistakenly used, but this is better addressed in a later patch.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 11554 bytes
Desc: not available
More information about the cfe-commits