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

Timm Baeder via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 6 06:13:21 PST 2024


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

The AST we trip up on is
```
BinaryOperator 0x52100006ed08 'struct S' '='
|-DeclRefExpr 0x52100006eba0 'struct S' lvalue Var 0x52100006e998 'tmp' 'struct S'
`-CStyleCastExpr 0x52100006ecd8 'struct S' <NoOp>
  `-CallExpr 0x52100006ec88 'struct S'
    `-ImplicitCastExpr 0x52100006ec68 'const struct S (*)(void)' <FunctionToPointerDecay>
      `-DeclRefExpr 0x52100006ebc8 'const struct S (void)' Function 0x52100006e870 'foo' 'const struct S (void)'
```

IIUC this should be rejected since the assignment doesn't work, but we're asserting that we found `CmpInfo`. We could of course also add more assertions that we're even in C++ mode when looking for the spaceship operator stuff.

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


More information about the cfe-commits mailing list