[clang] [clang][bytecode] Fix crash on discarded complex comparison (PR #177731)
Timm Baeder via cfe-commits
cfe-commits at lists.llvm.org
Sun Jan 25 04:23:51 PST 2026
================
@@ -0,0 +1,16 @@
+// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify -fexperimental-new-constant-interpreter %s
+// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify %s
+
+// expected-no-diagnostics
+
+void test_no_crash() {
+ _Complex int x = 1i;
+ (void)(x == 1i);
+}
+
+constexpr int test_side_effect() {
+ int k = 0;
+ (void)(1i == (++k, 1i));
+ return k;
+}
+static_assert(test_side_effect() == 1);
----------------
tbaederr wrote:
Don't add a new file, you can just add this to an exisiting one.
https://github.com/llvm/llvm-project/pull/177731
More information about the cfe-commits
mailing list