https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101566
--- Comment #7 from Dale Weiler <weilercdale at gmail dot com> --- Yeah the code example is invalid, there is a reference to a temporary, decltype(auto) on *ptr produces reference type, somehow I thought it produced the value type, sorry for the confusion.