[llvm-bugs] [Bug 28563] New: Incorrect error on operator() being an member in template

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jul 14 22:36:56 PDT 2016


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

            Bug ID: 28563
           Summary: Incorrect error on operator() being an member in
                    template
           Product: clang
           Version: 3.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: tomaszkam at gmail.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org
    Classification: Unclassified

Following class correctly compiles without any error in Clang 3.0:
struct NonTemplate
{
    typedef void type();

    type operator(); //Actually declares an member function.
};

However in case of the class template:
template<typename T>
struct Template
{
    typedef T type;

    T operator();
};
Followinge error is generated:
error: declaration of 'operator()' as non-function
     T operator();
Despite the fact that Template<void()> is identical to NonTemplate.

-- 
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/20160715/7835a945/attachment.html>


More information about the llvm-bugs mailing list