This is an archive of the discontinued LLVM Phabricator instance.

[clang][index] report references from unreslovedLookupExpr.
ClosedPublic

Authored by hokein on Feb 8 2021, 6:24 AM.

Diff Detail

Event Timeline

hokein created this revision.Feb 8 2021, 6:24 AM
hokein requested review of this revision.Feb 8 2021, 6:24 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 8 2021, 6:24 AM
usaxena95 accepted this revision.Feb 9 2021, 7:52 AM

Thanks. LG.
Couple of comments about adding tests to clangd as well.

clang/test/Index/Core/index-dependent-source.cpp
233

Maybe add more tests to clangd/XrefsTests like the ones specifically mentioned in https://github.com/clangd/clangd/issues/399

  • Ref in uninstantiated bar is reported.
template <typename T> void $decl[[foo]](T t); 
template <typename T> void bar(T t) { [[foo]](t); }
void baz(int x) { [[f^oo]](x); }

What do you think about the behaviour ?
Should we report the ref in bar in the following example ?

  • ADL: May be add a negative test documenting the behaviour.
namespace ns {
struct S{};
void $decl[[foo]](S s);
}
template <typename T> void foo(T t); 
template <typename T> void bar(T t) { foo(t); } // FIXME: Maybe report this foo as a ref to ns::foo when bar<ns::S> is instantiated?
void baz(int x) { 
  ns::S s;
  bar<ns::S>(s);
  [[f^oo]](s); 
}
This revision is now accepted and ready to land.Feb 9 2021, 7:52 AM
hokein updated this revision to Diff 322927.Feb 11 2021, 2:07 AM

address comment, add more tests.

This revision was landed with ongoing or failed builds.Feb 11 2021, 2:08 AM
This revision was automatically updated to reflect the committed changes.
hokein marked an inline comment as done.