This revision was automatically updated to reflect the committed changes.
Closed by commit rL292805: [Sema] UsingShadowDecl shouldn't be hidden by the
UsingDecl that owns it (authored by arphaman).
Changed prior to commit:
https://reviews.llvm.org/D28514?vs=85398=85414#toc
Repository:
rL
ahatanak accepted this revision.
ahatanak added a comment.
This revision is now accepted and ready to land.
Thanks LGTM.
Repository:
rL LLVM
https://reviews.llvm.org/D28514
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
arphaman added a comment.
In https://reviews.llvm.org/D28514#651724, @ahatanak wrote:
> If they are equal, the loop can continue because a UsingDecl doesn't hide a
> UsingShadowDecl that is tied to it.
You're right, that would be better, I didn't notice that method before.
Repository:
rL
arphaman updated this revision to Diff 85398.
arphaman added a comment.
Verify that the using shadow decl can be hidden by its owning using decl.
Repository:
rL LLVM
https://reviews.llvm.org/D28514
Files:
lib/Sema/SemaLookup.cpp
test/Index/complete-cached-globals.cpp
Index:
ahatanak added a comment.
If they are equal, the loop can continue because a UsingDecl doesn't hide a
UsingShadowDecl that is tied to it.
Repository:
rL LLVM
https://reviews.llvm.org/D28514
___
cfe-commits mailing list
ahatanak added a comment.
In the example I showed, wouldn't the DeclContext for all the UsingDecls and
UsingShadowDecls be the FunctionDecl for foo1? Maybe you can check whether
UsingShadowDecl::getUsingDecl() (which returns the UsingDecl which is tied to
the UsingShadowDecl) is equal to the
arphaman updated this revision to Diff 85151.
arphaman added a comment.
Ensure that the UsingShadowDecl and UsingDecl are in the same DeclContext.
Repository:
rL LLVM
https://reviews.llvm.org/D28514
Files:
lib/Sema/SemaLookup.cpp
test/Index/complete-cached-globals.cpp
Index:
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
ahatanak added a comment.
This is not invalid:
namespace Foo {
class C { };
}
namespace Bar { class C { }; }
void foo1() {
using Foo::C;
{
using Bar::C;
}
}
Repository:
rL LLVM
https://reviews.llvm.org/D28514
___
ahatanak added a comment.
I had something like the following code in mind (which is not invalid). Does
usingdecl Bar::C hide Foo::C ?
namespace Foo {
class C { };
}
namespace Bar { class C { }; }
using Foo::C;
{
using Bar::C;
}
Repository:
rL LLVM
arphaman added inline comments.
Comment at: lib/Sema/SemaLookup.cpp:3433
+ // is not hidden by the using declaration.
+ if (isa(ND) && isa(D))
+continue;
ahatanak wrote:
> Do we have to check that ND's UsingDecl is equal to D? Or we don't have
ahatanak added a comment.
Looks good to me, but one more comment/question.
Comment at: lib/Sema/SemaLookup.cpp:3433
+ // is not hidden by the using declaration.
+ if (isa(ND) && isa(D))
+continue;
Do we have to check that ND's UsingDecl is
arphaman added inline comments.
Comment at: lib/Sema/SemaCodeComplete.cpp:961
+// then incorrectly applied to the target declaration. This can be avoided
+// by resetting the declaration that's being hidden.
+if (Hiding && isa(Hiding))
ahatanak
arphaman updated this revision to Diff 84842.
arphaman marked an inline comment as done.
arphaman added a comment.
Avoid the hidden declaration in `VisibleDeclsRecord::checkHidden` instead of
the decl consumer in code-completion
Repository:
rL LLVM
https://reviews.llvm.org/D28514
Files:
ahatanak added inline comments.
Comment at: lib/Sema/SemaCodeComplete.cpp:961
+// then incorrectly applied to the target declaration. This can be avoided
+// by resetting the declaration that's being hidden.
+if (Hiding && isa(Hiding))
I'm not sure
arphaman created this revision.
arphaman added reviewers: manmanren, ahatanak, akyrtzi.
arphaman added a subscriber: cfe-commits.
arphaman set the repository for this revision to rL LLVM.
This patch fixes an issue where cached global code completion results for a
`using` declaration included the
16 matches
Mail list logo