18 lines · cpp
1// RUN: %clang_cc1 -std=c++23 -x c++ %s -fno-assumptions -verify2// RUN: %clang_cc1 -std=c++23 -x c++ %s -fms-compatibility -verify3// RUN: %clang_cc1 -std=c++23 -x c++ %s -fno-assumptions -fexperimental-new-constant-interpreter -verify4// RUN: %clang_cc1 -std=c++23 -x c++ %s -fms-compatibility -fexperimental-new-constant-interpreter -verify5 6// expected-no-diagnostics7 8// We don't check assumptions at compile time if '-fno-assumptions' is passed,9// or if we're in MSVCCompat mode10 11constexpr bool f(bool x) {12 [[assume(x)]];13 return true;14}15 16static_assert(f(false));17 18