On 4/11/19 4:16 PM, Marek Polacek wrote:
[except.spec] says that "In a noexcept-specifier, the constant-expression,
if supplied, shall be a contextually converted constant expression of type
bool". We now have a dedicated function for creating such an expression,
so build_noexcept_spec should make use of it.
As a consequence, we now reject pr86397-2.C but that's correct: converting
a pointer to bool is a "boolean conversion", which is not allowed under the
rules for a converted constant expression ([expr.const]p7).
Bootstrapped/regtested on x86_64-linux, ok for trunk?
2019-04-11 Marek Polacek <pola...@redhat.com>
* except.c (build_noexcept_spec): Use build_converted_constant_bool_expr
instead of perform_implicit_conversion_flags.
OK.
Jason