C++ PATCH for c++/90490 - fix decltype issues in noexcept-specifier

Jason Merrill jason@redhat.com
Fri Jun 21 20:06:00 GMT 2019

On 6/20/19 10:46 AM, Marek Polacek wrote:
> The first test is rejected because build_noexcept_spec first converts
> a TARGET_EXPR using a user-defined conversion, creating
>    R::operator bool (&TARGET_EXPR <D.2323, {}>)
> which then fails when instantiating ("taking address of rvalue").
> The second test ICEs in verify_ctor_sanity because there was no ctx.ctor
> when evaluating the TARGET_EXPR.  That is expected, because we create
> constructors for class and vector types (and PMFs I guess) only, not for
> scalars.  We need finish_compound_literal to turn
>    TARGET_EXPR <D.2306, {}>
> into
>    TARGET_EXPR <D.2307, 0>
> Fixed both by handling the noexcept expr like we handle the explicit expr in
> build_explicit_specifier.
> Bootstrapped/regtested on x86_64-linux, ok for trunk and 9?

OK, though this pattern still seems fragile.  I'll try to poke at it soon.


More information about the Gcc-patches mailing list