Debian Codegraph @

clang/test/SemaCXX/cxx23-assume-disabled.cpp

raw
1 // RUN: %clang_cc1 -std=c++23 -x c++ %s -fno-assumptions -verify
2 // RUN: %clang_cc1 -std=c++23 -x c++ %s -fms-compatibility -verify
3 // RUN: %clang_cc1 -std=c++23 -x c++ %s -fno-assumptions -fexperimental-new-constant-interpreter -verify
4 // RUN: %clang_cc1 -std=c++23 -x c++ %s -fms-compatibility -fexperimental-new-constant-interpreter -verify
5
6 // expected-no-diagnostics
7
8 // We don't check assumptions at compile time if '-fno-assumptions' is passed,
9 // or if we're in MSVCCompat mode
10
11 constexpr bool f(bool x) {
12 [[assume(x)]];
13 return true;
14 }
15
16 static_assert(f(false));
17