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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-05-19
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to J.M. from comment #0)
> In every use of __glibcxx_assert the function __failed_assertion is
> redeclared and btw. never defined,

By design.

> which might break other projects as well,

How?

> and then is used as an assertion in constant evaluated contexts, as it is a
> non constexpr function.

Right, it's only ever used when we want compilation to fail. So it's never
odr-used, so no call to it is ever emitted in the generated assembly, so no
definition is needed.

> I wasn't able to come up with an entirely better approach so far,

Which is why this "awful" construct is used.

> but I
> guess most of the issues, that I could think of so far, would be solved by
> moving the void __failed_assertion(); declaration out of the macro.

The idea was to not pollute the namespace with a declaration of a function that
will never exist.

Reply via email to