On 14 Jan 2026, at 16:32, Ville Voutilainen via Std-Proposals <std-proposals@lists.isocpp.org> wrote:On Wed, 14 Jan 2026 at 17:30, Thiago Macieira via Std-Proposals
<std-proposals@lists.isocpp.org> wrote:
On Wednesday, 14 January 2026 06:57:00 Pacific Standard Time Frederick
Virchanza Gotham via Std-Proposals wrote:extern int &&CalleeFunction(void);
int &&EnclosingFunction(void)
{
decltype(auto) x = CalleeFunction();
if ( x ) return x;
}
Compiles with GCC and Clang, albeit with a warning that it reaches the end of
a non-void function without a return. The old ICC (with the EDG front-end) and
MSVC don't like it:
https://gcc.godbolt.org/z/WcoEb8ehM
At any rate, that has nothing to do with value categories and how
decltype(auto) works, and changes exactly
nothing in how the "return if" is just an unnecessary dead duck that
doesn't even simplify anything.
--
Std-Proposals mailing list
Std-Proposals@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals