[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:46:33 PST 2017


arphaman added a comment.

In https://reviews.llvm.org/D28514#651675, @ahatanak wrote:

> This is not invalid:
>
>   namespace Foo {
>       class C { };
>   }
>   namespace Bar { class C { }; }
>  
>   void foo1() {
>   using Foo::C;
>   {
>   using Bar::C;
>   }
>   }
>


I see, that could happen if the previous UsingShadow is in an outer scope. Yes, I guess then Foo::C using decl should hide Bar::C using shadow decl. I'll post the patch which checks that the two decls have the same decl context (should be faster than checking if a using shadow decl is contained in a using decl).


Repository:
  rL LLVM

https://reviews.llvm.org/D28514





More information about the cfe-commits mailing list