diff options
| author | Erik Verbruggen <erikjv@me.com> | 2017-03-28 07:22:21 +0000 |
|---|---|---|
| committer | Erik Verbruggen <erikjv@me.com> | 2017-03-28 07:22:21 +0000 |
| commit | f1898cfa42a05a2d3e4cc127d8a49c72dabcd009 (patch) | |
| tree | 9f783258c6f6e5d6ed6d41fcfa446ea25ad3ab7b /clang/test/CodeCompletion | |
| parent | 9f3eca96eb0674020a2540883498ec4d2f940c11 (diff) | |
| download | bcm5719-llvm-f1898cfa42a05a2d3e4cc127d8a49c72dabcd009.tar.gz bcm5719-llvm-f1898cfa42a05a2d3e4cc127d8a49c72dabcd009.zip | |
[libclang] Fix crash in member access code completion with implicit base
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.
Fixes PR31093.
llvm-svn: 298903
Diffstat (limited to 'clang/test/CodeCompletion')
| -rw-r--r-- | clang/test/CodeCompletion/member-access.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/test/CodeCompletion/member-access.cpp b/clang/test/CodeCompletion/member-access.cpp index 8195f764fbb..66872272ee6 100644 --- a/clang/test/CodeCompletion/member-access.cpp +++ b/clang/test/CodeCompletion/member-access.cpp @@ -37,6 +37,17 @@ struct Test1 { } }; +struct Foo { + void foo() const; + static void foo(bool); +}; + +struct Bar { + void foo(bool param) { + Foo::foo( );// unresolved member expression with an implicit base + } +}; + // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:29:6 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s // CHECK-CC1: Base1 : Base1:: // CHECK-CC1: member1 : [#int#][#Base1::#]member1 @@ -52,3 +63,6 @@ struct Test1 { // Make sure this doesn't crash // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:36:7 %s -verify + +// Make sure this also doesn't crash +// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:47:14 %s |

