| 1 |
// RUN: %clang_cc1 -x c -fsyntax-only %s -verify=c -std=c11 |
| 2 |
// RUN: %clang_cc1 -x c -fsyntax-only %s -pedantic -verify=c-pedantic -std=c11 |
| 3 |
// RUN: %clang_cc1 -x c -fsyntax-only %s -verify=c -std=c11 -fexperimental-new-constant-interpreter |
| 4 |
// RUN: %clang_cc1 -x c -fsyntax-only %s -pedantic -verify=c-pedantic -std=c11 -fexperimental-new-constant-interpreter |
| 5 |
// |
| 6 |
// RUN: %clang_cc1 -x c++ -fsyntax-only %s -verify=cxx |
| 7 |
// RUN: %clang_cc1 -x c++ -fsyntax-only %s -pedantic -verify=cxx,cxx-pedantic |
| 8 |
// RUN: %clang_cc1 -x c++ -fsyntax-only %s -verify=cxx -fexperimental-new-constant-interpreter |
| 9 |
// RUN: %clang_cc1 -x c++ -fsyntax-only %s -pedantic -verify=cxx,cxx-pedantic -fexperimental-new-constant-interpreter |
| 10 |
|
| 11 |
// c-no-diagnostics |
| 12 |
|
| 13 |
void f(void); |
| 14 |
struct S {char c;} s; |
| 15 |
_Static_assert(&s != (void *)&f, ""); // c-pedantic-warning {{not an integer constant expression}} \ |
| 16 |
// c-pedantic-note {{this conversion is not allowed in a constant expression}} \ |
| 17 |
// cxx-error {{static assertion expression is not an integral constant expression}} \ |
| 18 |
// cxx-note {{cast that performs the conversions of a reinterpret_cast is not allowed in a constant expression}} \ |
| 19 |
// cxx-pedantic-warning {{'_Static_assert' is a C11 extension}} |