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

             Bug #: 13566
           Summary: Reference to non-static member function must be called
           Product: clang
           Version: 3.1
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Keywords: compile-fail
          Severity: enhancement
          Priority: P
         Component: C++
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified


Clang version:
Apple clang version 4.0 (tags/Apple/clang-421.0.60) (based on LLVM 3.1svn)

The following code (full source here
https://github.com/OpenEmu/OpenEmu/blob/master/Nestopia/core/NstMemory.hpp):
Source( pageData[i*3+0] ).SwapBank<MEM_PAGE_SIZE>( i * MEM_PAGE_SIZE,
pageData[i*3+1] | uint(pageData[i*3+2]) << 8 );

Fails with the error:
core/NstMemory.hpp:766:7: error: reference to non-static member function must
be called
                                                Source( pageData[i*3+0]
).SwapBank<MEM_PAGE_SIZE>( i * MEM_PAGE_SIZE, pageData[i*3+1] |
uint(pageData[i*3+2]) << 8 );
                                               
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The solution:
zygoloid from #llvm irc recognized the problem and gave the following fix:

<zygoloid> i would guess that Source is a dependent type within the
Nes::Core::Memory type. the fix is to add 'template' before 'SwapBank'.
<zygoloid> so Source( pageData[i*3+0] ).template SwapBank<MEM_PAGE_SIZE>( i *
MEM_PAGE_SIZE, pageData[i*3+1] | uint(pageData[i*3+2]) << 8 );
<zygoloid> instead of Source( pageData[i*3+0] ).SwapBank<MEM_PAGE_SIZE>( i *
MEM_PAGE_SIZE, pageData[i*3+1] | uint(pageData[i*3+2]) << 8 );

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to