diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2017-01-15 06:11:04 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2017-01-15 06:11:04 +0000 |
commit | 16ba0232fbfb3a278c56d37531196ef2967950be (patch) | |
tree | bcd31db489a98b18bee3138b8b695910fd17a5ff /test/CodeCompletion | |
parent | 67796b300f1ebec97fe5d0cf160be3ad2697ea03 (diff) |
[code-completion] Fix crash when trying to do postfix completion of instance member inside a static function.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@292052 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeCompletion')
-rw-r--r-- | test/CodeCompletion/member-access.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/test/CodeCompletion/member-access.cpp b/test/CodeCompletion/member-access.cpp index 8f772c0652..8195f764fb 100644 --- a/test/CodeCompletion/member-access.cpp +++ b/test/CodeCompletion/member-access.cpp @@ -27,6 +27,16 @@ public: void test(const Proxy &p) { p-> +} + +struct Test1 { + Base1 b; + + static void sfunc() { + b. // expected-error {{invalid use of member 'b' in static member function}} + } +}; + // 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 @@ -39,4 +49,6 @@ void test(const Proxy &p) { // CHECK-CC1: memfun1 (Hidden) : [#void#]Base2::memfun1(<#int#>) // CHECK-CC1: memfun2 : [#void#][#Base3::#]memfun2(<#int#>) // CHECK-CC1: memfun3 : [#int#]memfun3(<#int#>) - + +// Make sure this doesn't crash +// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:36:7 %s -verify |