[clang] [Clang] Ignore assumptions with side effects at compile time (PR #85534)

Timm Baeder via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 17 06:41:42 PDT 2024


tbaederr wrote:

Is it expected that a failed assumption with side effects does not result in an error?

```c++
constexpr bool f(int &a) {

    a = 10;
    return false;
}

constexpr int c() {
    int a = 0;
    [[assume(f(a))]];

    return a;
}
static_assert(c() == 0);
```

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


More information about the cfe-commits mailing list