diff options
| author | Ted Kremenek <kremenek@apple.com> | 2011-02-23 01:52:04 +0000 |
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2011-02-23 01:52:04 +0000 |
| commit | 3427fac7c883efbb1097ac9ba13198b95c9fbccb (patch) | |
| tree | 90b45ab6b5b03a98eef401300c9b0d989f6252b8 /clang/test/Sema/i-c-e.c | |
| parent | 80861ca9b53545dd1579a9853807e780952a55da (diff) | |
| download | bcm5719-llvm-3427fac7c883efbb1097ac9ba13198b95c9fbccb.tar.gz bcm5719-llvm-3427fac7c883efbb1097ac9ba13198b95c9fbccb.zip | |
Enhance Sema::DiagRuntimeBehavior() to delay some diagnostics to see if the related code is reachable. This suppresses some
diagnostics that occur in unreachable code (e.g., -Warray-bound).
We only pay the cost of doing the reachability analysis when we issue one of these diagnostics.
llvm-svn: 126290
Diffstat (limited to 'clang/test/Sema/i-c-e.c')
| -rw-r--r-- | clang/test/Sema/i-c-e.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/test/Sema/i-c-e.c b/clang/test/Sema/i-c-e.c index 4c2962d4b21..d0a6c529c16 100644 --- a/clang/test/Sema/i-c-e.c +++ b/clang/test/Sema/i-c-e.c @@ -60,7 +60,9 @@ int comma3[(1,2)]; // expected-warning {{size of static array must be an integer // Pointer + __builtin_constant_p char pbcp[__builtin_constant_p(4) ? (intptr_t)&expr : 0]; // expected-error {{variable length array declaration not allowed at file scope}} -int illegaldiv1[1 || 1/0]; // expected-warning {{division by zero is undefined}} +int illegaldiv1a[1 || 1/0]; // expected-warning {{division by zero is undefined}} +int illegaldiv1b[1 && 1/0]; // expected-warning {{division by zero is undefined}} expected-error{{variable length array declaration not allowed at file scope}} + int illegaldiv2[1/0]; // expected-error {{variable length array declaration not allowed at file scope}} \ // expected-warning {{division by zero is undefined}} int illegaldiv3[INT_MIN / -1]; // expected-error {{variable length array declaration not allowed at file scope}} |

