[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
Tue Apr 23 09:02:42 PDT 2019
riccibruno updated this revision to Diff 196264.
riccibruno added a comment.
- Added a test (see `N_shadow)` for the behavior of `Wshadow`. This test showed that I forgot to change `CheckShadow(New, PrevDecl, R);` to `CheckShadow(New, PrevDecl->getUnderlyingDecl(), R);` to match change in the condition of the if statement.
- Added a test which exposes a new problem that this patch incidentally solves (see `N_conflicting_namespace_alias`). Because of the using directive `using namespace M;`, the namespace alias `i` for the namespace `Q` if found in the redeclaration lookup. Before this patch, since `getAsSingle` used internally `getUnderlyingDecl()`, `PrevDecl` was for the `NamespaceDecl` for `Q`, and not for the `VarDecl` for `Q::i`. Then the declaration for the enumerator `i` was mistakenly rejected since `Q` is in the same scope.
- Clarified some comments.
CHANGES SINCE LAST ACTION
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 12020 bytes
Desc: not available
More information about the cfe-commits