20 lines · c
1// RUN: %clang_cc1 -x c -fsyntax-only %s -verify=c -std=c112// RUN: %clang_cc1 -x c -fsyntax-only %s -pedantic -verify=c-pedantic -std=c113// RUN: %clang_cc1 -x c -fsyntax-only %s -verify=c -std=c11 -fexperimental-new-constant-interpreter4// RUN: %clang_cc1 -x c -fsyntax-only %s -pedantic -verify=c-pedantic -std=c11 -fexperimental-new-constant-interpreter5//6// RUN: %clang_cc1 -x c++ -fsyntax-only %s -verify=cxx7// RUN: %clang_cc1 -x c++ -fsyntax-only %s -pedantic -verify=cxx,cxx-pedantic8// RUN: %clang_cc1 -x c++ -fsyntax-only %s -verify=cxx -fexperimental-new-constant-interpreter9// RUN: %clang_cc1 -x c++ -fsyntax-only %s -pedantic -verify=cxx,cxx-pedantic -fexperimental-new-constant-interpreter10 11// c-no-diagnostics12 13void f(void);14struct 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}}20