This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/69066] New: SFINAE compilation error on lambda with trailing return type
- From: "vittorio.romeo at outlook dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 28 Dec 2015 00:06:56 +0000
- Subject: [Bug c++/69066] New: SFINAE compilation error on lambda with trailing return type
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69066
Bug ID: 69066
Summary: SFINAE compilation error on lambda with trailing
return type
Product: gcc
Version: 5.3.0
Status: UNCONFIRMED
Severity: major
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: vittorio.romeo at outlook dot com
Target Milestone: ---
auto bound_f = [=](auto... xs) -> decltype(f(x, xs...))
{
return f(x, xs...);
};
return curry_impl<decltype(bound_f),
is_zero_callable<decltype(bound_f)>{}>::exec(bound_f);
---
`is_zero_callable` is a type-trait like struct making use of `void_t` detection
techniques.
clang++ compiles the code correctly and triggers SFINAE thanks to `bound_f`'s
explicit trailing return type.
g++ fails to compile the code (see godbolt example).
---
Example on gcc.godbolt.org: https://goo.gl/2hWTTN
Additional information: http://stackoverflow.com/a/34484150/598696