This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/76995] New: syntax error
- From: "vanyacpp at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 15 Aug 2016 17:39:06 +0000
- Subject: [Bug c++/76995] New: syntax error
- Authentication-results: sourceware.org; auth=none
- Auto-submitted: auto-generated
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);
}