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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mpolacek at gcc dot gnu.org

--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #2)
> This boils down to
> struct S {};
> 
> void
> foo (S s)
> {
>   constexpr S x = s;
> }
> which GCC 7 as well as clang accepted, but GCC 8+ rejects.

I think it should be accepted, since S is empty, there's no actual
lvalue-to-rvalue conversion involved.

It works with
using S = decltype(nullptr);

and this works too since GCC 7:

struct A { } a;
constexpr int f (A a) { return 42; }
constexpr int i = f(a);

Reply via email to