[Bug c++/89304] New: Compiler runs indefinitely

fiesh at zefix dot tv gcc-bugzilla@gcc.gnu.org
Tue Feb 12 11:11:00 GMT 2019


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

            Bug ID: 89304
           Summary: Compiler runs indefinitely
           Product: gcc
           Version: 8.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: fiesh at zefix dot tv
  Target Milestone: ---

The following code leads to g++ (and also clang++) running indefinitely.  It
needs to be compiled with -std=c++17.




#include <tuple>

template <typename T>
void p(T const & v)
{
}

template <typename... T>
void f(T &&... args);

template <typename... T>
void f(std::tuple<T...> const & args);

template <typename... T>
void f(T &&... args)
{
        auto t = std::make_tuple(args...);
        f(t);
}

template <typename... T>
void f(std::tuple<T...> const & args)
{
        std::apply([](auto const &... v) { (..., p(v)); }, args);
}

int main()
{
        f(1., 2, 4);
        return 0;
}


More information about the Gcc-bugs mailing list