Files
clang-p2996/clang/test/Index/complete-switch.c
Kadir Cetinkaya 6d57266a8c [clang] Fix a null pointer dereference.
Summary:
Sometimes expression inside switch statement can be invalid, for
example type might be incomplete. In those cases code were causing a null
pointer dereference. This patch fixes that.

Reviewers: sammccall, ioeric, hokein

Reviewed By: sammccall

Subscribers: arphaman, cfe-commits

Differential Revision: https://reviews.llvm.org/D53561

llvm-svn: 345029
2018-10-23 13:49:37 +00:00

11 lines
203 B
C

void f() {
auto foo = bar;
switch(foo) {
case x:
break;
}
}
// RUN: not %clang_cc1 -fsyntax-only -code-completion-at=%s:4:10 %s | FileCheck %s -allow-empty
// CHECK-NOT: COMPLETION: foo