[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:16:31 PDT 2019
riccibruno added a comment.
> 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` is 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.
I meant in the above "[...] `PrevDecl` was the `NamespaceDecl` for `Q`, and not the `NamespaceAliasDecl` for `M::i`"
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D60956/new/
https://reviews.llvm.org/D60956
More information about the cfe-commits
mailing list