Files
clang-p2996/clang/test/Sema/constexpr-void-cast.c
Timm Bäder e2e3624fae [clang][test] Try to fix constexpr-void-cast test
The test currenlty fails:
https://lab.llvm.org/buildbot/#/builders/139/builds/61628

because it emits a C11 warning when compiling as C. Try to fix that
be defining the C standard to use.
2024-03-18 15:35:39 +01:00

15 lines
673 B
C

// RUN: %clang_cc1 -x c -fsyntax-only %s -verify=c -std=c11
// RUN: %clang_cc1 -x c -fsyntax-only %s -pedantic -verify=c-pedantic -std=c11
//
// RUN: %clang_cc1 -x c++ -fsyntax-only %s -verify=cxx
// RUN: %clang_cc1 -x c++ -fsyntax-only %s -pedantic -verify=cxx-pedantic
// c-no-diagnostics
// cxx-no-diagnostics
void f(void);
struct S {char c;} s;
_Static_assert(&s != (void *)&f, ""); // c-pedantic-warning {{not an integer constant expression}} \
// c-pedantic-note {{this conversion is not allowed in a constant expression}} \
// cxx-pedantic-warning {{'_Static_assert' is a C11 extension}}