This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/69066] New: SFINAE compilation error on lambda with trailing return type


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]