xref: /llvm-project/clang/test/Sema/constexpr-void-cast.c (revision c0b65a2491be44f0b162d55563c305c514c01d90)
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-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-pedantic -fexperimental-new-constant-interpreter
10 
11 // c-no-diagnostics
12 // cxx-no-diagnostics
13 
14 void f(void);
15 struct S {char c;} s;
16 _Static_assert(&s != (void *)&f, ""); // c-pedantic-warning {{not an integer constant expression}} \
17                                       // c-pedantic-note {{this conversion is not allowed in a constant expression}} \
18                                       // cxx-pedantic-warning {{'_Static_assert' is a C11 extension}}
19