https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96877
Ian Henriksen <insertinterestingnamehere at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #1 from Ian Henriksen <insertinterestingnamehere at gmail dot com> --- Actually this is my mistake. std::declval returns by reference, so this is actually a reference type and the compiler is right to warn about the bad initialization. In this case the correct thing to do is to remove the reference after getting the type from decltype.