https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127297

--- Comment #3 from Wang Jinghao <zheng.xianyuwang at gmail dot com> ---
(In reply to Joshua Berne from comment #2)
> I think that could work for this bug, but when working on fixing
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126897 i ended up moving the
> diagnosis of this issue entirely somewhere else, and that resulted in this
> particular bug going away.
> 
> Basically, odr-use is hard to identify when we complete an id-expression, so
> it seemed better to do the check by walking the completed tree once we are
> finished updating/substituting a postcondition assertion.

Iain has a branch that also indirectly fixes PR217297.
https://github.com/iains/gcc-git/tree/master-wip-contracts-deferred-parses

For PR126897, I have a rough fix, but correctly handling ODR-use in
discarded-value expressions makes the patch look rather scary ;(

```
void f (bool b)
  post ((+b, true))
{}
```

Reply via email to