[llvm-bugs] [Bug 28986] New: type-id/expression in cstyle-cast are disambiguated incorrectly

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Aug 15 10:34:24 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=28986

            Bug ID: 28986
           Summary: type-id/expression in cstyle-cast are disambiguated
                    incorrectly
           Product: clang
           Version: 3.8
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: vanyacpp at gmail.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org
    Classification: Unclassified

clang 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);
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160815/48cc0f64/attachment-0001.html>


More information about the llvm-bugs mailing list