================ @@ -0,0 +1,36 @@ +// RUN: %clang_cc1 -std=c++23 -fsyntax-only %s -verify +// RUN: %clang_cc1 -std=c++23 -fsyntax-only %s -verify -fexperimental-new-constant-interpreter + +namespace GH139818{ + struct A { + constexpr ~A() { ref = false; } + constexpr operator bool() { + return b; + } + bool b; + bool& ref; + }; + + constexpr bool f1() { + bool ret = true; + for (bool b = false; A x{b, ret}; b = true) {} + return ret; + } + + static_assert(!f1()); + + struct Y { + constexpr ~Y() noexcept(false) { throw "oops"; } // expected-error {{cannot use 'throw' with exceptions disabled}} ---------------- Sirraide wrote:
Can you add `-fcxx-exceptions` (I think that was the flag at least) to the `RUN` lines so we don’t get this error. https://github.com/llvm/llvm-project/pull/140278 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits