[CodeComplete] Fix the crash in code completion on access checking
Started crashing in r337453. See the added test case for the crash repro.
The fix reverts part of r337453 that causes the crash and does
not actually break anything when reverted.
llvm-svn: 338255
diff --git a/clang/test/Index/complete-access-checks-crash.cpp b/clang/test/Index/complete-access-checks-crash.cpp
new file mode 100644
index 0000000..c7ac4d6
--- /dev/null
+++ b/clang/test/Index/complete-access-checks-crash.cpp
@@ -0,0 +1,13 @@
+struct Base {
+protected:
+ bool bar();
+};
+struct Derived : Base {
+};
+
+struct X {
+ int foo() {
+ Derived(). // RUN: c-index-test -code-completion-at=%s:10:15 %s | FileCheck %s
+ // CHECK: bar{{.*}}(inaccessible)
+ }
+};