https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85568

            Bug ID: 85568
           Summary: is_invocable(F, decltype(objs)...)  fails with "not
                    supported by dump_expr#" unless via indirection
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gccbugbjorn at fahller dot se
  Target Milestone: ---

Created attachment 44037
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44037&action=edit
Source code exposing the bug

The following program compiles as C++17 with g++-7.3, but not with g++-8 built
from /branches/gcc-8-branch at revision 259748.

It does compile, however, if compilation flag -DVIA_TUPLE is added, which
expands std::is_invocable<> via an indirection.

Compilation error is:
tests.cpp: In instantiation of 'constexpr auto compose(F&&, Fs&& ...) [with F =
const equal(T&&) [with T = int]::<lambda(const auto:1&)>&; Fs =
{std::plus<void>}]':
tests.cpp:98:22:   required from here
tests.cpp:86:20: error: expansion pattern 'decltype (#'nontype_argument_pack'
not supported by dump_expr#<expression error>)' contains no argument packs
     constexpr auto unitail = typename std::is_invocable<tail_type,
decltype(objs)...>::type{};
                    ^~~~~~~
tests.cpp:98:23: error: non-constant condition for static assertion
 static_assert(compose(eq<3>,
               ~~~~~~~~~~~~~~
         std::plus<>{})(1,2),
         ~~~~~~~~~~~~~~^~~~~
tests.cpp:98:23: error: call to non-'constexpr' function 'compose(F&&, Fs&&
...) [with F = const equal(T&&) [with T = int]::<lambda(const auto:1&)>&; Fs =
{std::plus<void>}]::<lambda(auto:2&& ...)> [with auto:2 = {int, int}; decltype
(detail::compose(typename std::is_invocable<std::plus<void>, decltype
(objs)...>::type{}, f, compose(forward<std::plus<void> >(fs#0)),
(forward<decltype(compose::__lambda1::operator()::objs)>)(compose::__lambda1::operator()::objs)...))
= bool]'
tests.cpp:75:8: note: 'compose(F&&, Fs&& ...) [with F = const equal(T&&) [with
T = int]::<lambda(const auto:1&)>&; Fs = {std::plus<void>}]::<lambda(auto:2&&
...)> [with auto:2 = {int, int}; decltype (detail::compose(typename
std::is_invocable<std::plus<void>, decltype (objs)...>::type{}, f,
compose(forward<std::plus<void> >(fs#0)),
(forward<decltype(compose::__lambda1::operator()::objs)>)(compose::__lambda1::operator()::objs)...))
= bool]' is not usable as a 'constexpr' function because:
     -> decltype(detail::compose(typename
std::is_invocable<decltype(compose(std::forward<Fs>(fs)...)),
decltype(objs)...>::type{},
        ^~~~~~~~

Reply via email to