[clang] [clang] reject initializing constexpr objects with compound literals that contain non-null pointers (PR #230477)

Abdulmalek Almkainzi via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 9 08:08:54 PDT 2026


aalmkainzi wrote:

Found another case where there is an inconsistency:
```C
struct C
{
    int *p;
};

const typeof(nullptr) np;

constexpr struct C c = {np}; // ok
constexpr struct C c = (struct C){np}; // error

```

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


More information about the cfe-commits mailing list