[clang] [clang][Interp] Bail out on missing ComparisonCategoryInfo (PR #80131)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 6 06:30:44 PST 2024


================
@@ -1,4 +1,5 @@
 // RUN: %clang_cc1 -fsyntax-only %s -verify
+// RUN: %clang_cc1 -fsyntax-only %s -fexperimental-new-constant-interpreter -verify
----------------
AaronBallman wrote:

Why should this assignment not work? (The code looks valid to me). Oh, wait, you mean this assignment shouldn't be a constant expression? (If so, I agree.)

That said, I see now why we're hitting the assertion on an assignment operator in C; the call to `lookupInfoForType()` will return `nullptr` in that case and we need to handle that.

I don't think we want to look for the spaceship operator stuff outside of C++ mode, but that can be done in a follow-up as this is fixing a failing assertion.

https://github.com/llvm/llvm-project/pull/80131


More information about the cfe-commits mailing list