[Bug c++/96877] Erroneous warning when default initializing function pointer types defined using std::declval
insertinterestingnamehere at gmail dot com
gcc-bugzilla@gcc.gnu.org
Tue Sep 1 15:29:40 GMT 2020
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.
More information about the Gcc-bugs
mailing list