[PATCH] D28514: [CodeCompletion] Reset the hidden declaration obtained after lookup when caching UsingShadowDecls

Alex Lorenz via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 20 09:22:22 PST 2017


arphaman added inline comments.


================
Comment at: lib/Sema/SemaLookup.cpp:3433
+      // is not hidden by the using declaration.
+      if (isa<UsingShadowDecl>(ND) && isa<UsingDecl>(D))
+        continue;
----------------
ahatanak wrote:
> Do we have to check that ND's UsingDecl is equal to D? Or we don't have to worry about it?
I don't think a check like that would be necessary from what I've observed so far. I believe a `UsingShadowDecl` could have been hidden previously by a different `UsingDecl`, but that can happen only in invalid code, like in the example below:

```
namespace Foo {
    class C { };
}
namespace Bar { class C { }; }
using Foo::C;
using Bar::C;
```

I don't think it would make sense for Bar::C using decl to hide Foo::C using shadow decl.


Repository:
  rL LLVM

https://reviews.llvm.org/D28514





More information about the cfe-commits mailing list