This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/55002] trailing return type is rejected in function signature
- From: "daniel.kruegler at googlemail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 20 Oct 2012 20:24:19 +0000
- Subject: [Bug c++/55002] trailing return type is rejected in function signature
- Auto-submitted: auto-generated
- References: <bug-55002-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55002
Daniel KrÃgler <daniel.kruegler at googlemail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |daniel.kruegler at
| |googlemail dot com
--- Comment #2 from Daniel KrÃgler <daniel.kruegler at googlemail dot com> 2012-10-20 20:24:19 UTC ---
Your issue looks invalid to me, because you are never providing a pointer to
function declarator.
Lets look first at your simplified example:
auto (*ff) -> int (int)
This would be an invalid function declarator, because there is (a) no parameter
list and (b) the return type is a function type int(int), which is never
possible. I can only assume you mean
int f(auto (*ff)(int) -> int) {
return ff(1);
}
and this is accepted.
A similar defect is in your original code, where the only valid form would be
template<class T, size_t N> size_t
apply (const T (&A)[N], auto (*f)(const T (&)[N]) -> size_t)
{ return f(A); }
which is also accepted.