This is an archive of the discontinued LLVM Phabricator instance.

[CodeComplete] Cleanup access checking in code completion
ClosedPublic

Authored by ilya-biryukov on Nov 30 2018, 7:18 AM.

Diff Detail

Event Timeline

ilya-biryukov created this revision.Nov 30 2018, 7:18 AM
  • Add missed field init
  • Also fix access checks for member access with qualifiers
  • Fix a comment
kadircet accepted this revision.Dec 3 2018, 1:38 AM
kadircet added inline comments.
lib/Parse/ParseExprCXX.cpp
248

What about first checking for whether we are on code completion point and then assigning nullptr to objecttype?

Also it is not in the scope of this patch but I was wondering why we only trigger completion if we've seen a scope specifier, do you have any idea?

This revision is now accepted and ready to land.Dec 3 2018, 1:38 AM
ilya-biryukov marked 2 inline comments as done.
  • Do not introduce a new local var, reuse existing
ilya-biryukov added inline comments.Dec 3 2018, 2:18 AM
lib/Parse/ParseExprCXX.cpp
248

Done. This got me thinking that we probably won't pass the object type on more than 1 qualifiers, e.g. X().Foo::Bar::baz(). I'll test and address this in a separate patch, though.

Also it is not in the scope of this patch but I was wondering why we only trigger completion if we've seen a scope specifier, do you have any idea?

I haven't looked closely into the code, but I suspect other cases are handled elsewhere, e.g. the case with no qualifiers is handled when parsing member expressions, etc.

This revision was automatically updated to reflect the committed changes.