C++ Logo


Advanced search

Re: Does [expr.call]/1 correctly authorize the snippet below to compile?

From: Jason Cobb <jason.e.cobb_at_[hidden]>
Date: Thu, 10 Oct 2019 10:49:39 -0400
On 10/10/19 10:25 AM, Krystian Stasiowski via Std-Discussion wrote:
> Here is how I parse it:
> For a call to a non-member function or to a static member
> function, the postfix expression shall either be:
> - an
> lvalue that refers to a function (in which case the
> function-to-pointer standard conversion is suppressed on the
> postfix expression), or
> - [a prvalue and] have function pointer type.
> <http://eel.is/c++draft/expr.call#1.sentence-3>

I read it as just needing function pointer type. All of the big 4
compilers agree that it need not be a prvalue; for instance, it could be
an xvalue: https://godbolt.org/z/Il8sH3 .

Jason Cobb

Received on 2019-10-10 09:51:54