[clang] [clang][Interp] Fall back to dummy pointers if createGlobal() fails (PR #102464)

Mital Ashok via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 8 06:36:52 PDT 2024


MitalAshok wrote:

```c++
struct Foo;
struct Bar {
  static const Foo x;
  static const Foo y;
};
static_assert(&Bar::x != nullptr, ""); // both-warning {{always true}}
static_assert(&Bar::x != &Bar::y, "");
constexpr const Foo* xp = &Bar::x;
struct Foo {};
static_assert(xp == &Bar::x);  // This fails with -fexperimental-new-constant-interpreter
```

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


More information about the cfe-commits mailing list