[LLVMbugs] [Bug 7165] New: Can't call instance methods from within a block

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue May 18 10:35:52 PDT 2010


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

           Summary: Can't call instance methods from within a block
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: oliver at apple.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


Created an attachment (id=4901)
 --> (http://llvm.org/bugs/attachment.cgi?id=4901)
Testcase

clang++ does not correctly handle instance methods being called from within a
block -- it believes that they are being called without "this".  These two
variations produce:

Carrot:~ oliver$ llvm/Debug/bin/clang++ foo.cpp 
foo.cpp:12:10: error: call to non-static member function without an object
argument
    g(^{ wibble(); });
         ^~~~~~
1 error generated.

and

Carrot:~ oliver$ llvm/Debug/bin/clang++ foo.cpp 
foo.cpp:12:10: error: invalid use of 'this' outside of a nonstatic member
function
    g(^{ this->wibble(); });

-- 
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.



More information about the llvm-bugs mailing list