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

            Bug ID: 76995
           Summary: syntax error
           Product: gcc
           Version: 6.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vanyacpp at gmail dot com
  Target Milestone: ---

GCC shows syntax error on this code. Looks like it disambiguates the expression
"(mytype())(args...)" as cstyle-cast although "(args...)" is not a valid
cast-expression.

struct mytype
{
    template <typename... T>
    void operator()(T&& ...) const
    {}
};

template <typename... T>
void f(T&& ...args)
{
    (mytype())(args...); // error: expected binary operator before ')' token
}

int main()
{
    f(1, 2, 3);
}

Reply via email to