[LLVMbugs] [Bug 22011] New: Redundant compilation "error : reference to non-static member function must be called"

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Dec 23 02:52:21 PST 2014


http://llvm.org/bugs/show_bug.cgi?id=22011

            Bug ID: 22011
           Summary: Redundant compilation "error : reference to non-static
                    member function must be called"
           Product: clang
           Version: 3.5
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: vvsed at hotmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

This program causes a redundant annoyng compilation "error : reference to
non-static member function must be called".
Other major C++ compilers (GC, IC, VC) don't consider this as an error.

#include <stdlib.h>
#include <stdio.h>

struct zzz
{
    int        m;

    template<int i>
    int func(const zzz &a)
    {
        return m = a.m + i;
    }
};

template<int i, typename type>
int func(const type &a)
{
    return type()./*template */func<i>(a);    //error : reference to non-static
member function must be called
}

int main()
{
    zzz    a;

    a.m = 0;
    printf("%d", func<1>(a));
    return 0;
}

-- 
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/20141223/ca6bdf41/attachment.html>


More information about the llvm-bugs mailing list