If there is an unresolved member access AST node, and the base is
implicit, do not access/use it for generating candidate overloads for
code completion results (because the base is a nullptr).
Fixes PR31093.
Paths
| Differential D30248
[libclang] Fix crash in member access code completion with implicit base ClosedPublic Authored by erikjv on Feb 22 2017, 2:45 AM.
Details
Diff Detail Event TimelineComment Actions It seems that unresolved member expressions have other lookup issues. For example, this will crash when code-completing as well: struct Foo {
void foo() const;
static void foo(bool);
};
struct Bar: Foo {
void foo(bool param) {
this->Foo::foo(/*CC CRASH*/ );// unresolved member expression with an explicit base
}
};Are we sure that a call to AddFunctionCandidates is the right way to gather the method overloads in this particular instance? This revision is now accepted and ready to land.Mar 27 2017, 1:35 AM
Revision Contents
Diff 89341 lib/Sema/SemaCodeComplete.cpp
lib/Sema/SemaOverload.cpp
test/CodeCompletion/member-access.cpp
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This could use a comment explaining that this can happen if there's an error in the code, e.g. in code completion context.