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
11 lines
203 B
C
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
|