xref: /llvm-project/clang/test/Sema/const-init.c (revision 2cf2bc472da87bb4bf971b1448e05b9e3bd983dc)
1 // RUN: %clang_cc1 -fsyntax-only -verify -std=c23 %s
2 
3 // Division by 0 here is an error iff the variable is 'constexpr'.
4 const _Bool inf1 =  (1.0/0.0 == __builtin_inf());
5 constexpr _Bool inf2 = (1.0/0.0 == __builtin_inf()); // expected-error {{must be initialized by a constant expression}} expected-note {{division by zero}}
6 constexpr _Bool inf3 = __builtin_inf() == __builtin_inf();
7