| // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fcxx-exceptions -fexceptions -O0 -verify %s |
| // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fcxx-exceptions -fexceptions -pedantic-errors -DPE -O0 -verify %s |
| // expected-no-diagnostics |
| extern "C" int printf(const char*, ...); |
| S() __attribute__ ((nothrow)) { printf("%d: S()\n", ++N); } |
| ~S() __attribute__ ((nothrow)) { printf("%d: ~S()\n", N--); } |
| void print(int n, int a, int b, int c, int d) { |
| printf("n=%d\n,sizeof(S)=%d\nsizeof(array_t[0][0])=%d\nsizeof(array_t[0])=%d\nsizeof(array_t)=%d\n", |
| // expected-error@-2 {{variable length arrays are a C99 feature}} expected-note@-2 {{parameter}} expected-note@-3 {{here}} |
| // expected-error@-3 {{variable length arrays are a C99 feature}} expected-note@-3 {{parameter}} expected-note@-4 {{here}} |
| int sizeof_S = sizeof(S); |
| int sizeof_array_t_0_0 = sizeof(array_t[0][0]); |
| int sizeof_array_t_0 = sizeof(array_t[0]); |
| int sizeof_array_t = sizeof(array_t); |
| print(n, sizeof_S, sizeof_array_t_0_0, sizeof_array_t_0, sizeof_array_t); |
| printf("exception %d\n", e); |
| printf("exception %d", e); |