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

Joshua Berne <berne at notadragon dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |berne at notadragon dot com

--- Comment #2 from Joshua Berne <berne at notadragon dot com> ---
The primary bug is definitely an issue.

The second comment is, I believe, just a weirdness that results from having
const or non-const on the same parameter in different declarations.  You could
get similar weirdness (and possible odr violations) in noexcept specifiers or
trailing return types (and get ambiguities from identical expressions, or valid
code by producing the same code from different starting types).   Because
decltype(a) in the postcondition isn't an odr use the standard doesn't mandate
that a be const, so const can vary on that parameter from one declaration to
the next.

A very similar case where you actually try to call g on redeclarations of f
would need to be diagnosed as mismatched postcondition predicates (not a
missing const because this is not an odr use of the parameter):

```
void f2(T a)       post(g<decltype(a)>());
void f2(const T a) post(g<decltype(a)>());  // invalid redeclaration of
postcondition
```

Reply via email to