[llvm-bugs] [Bug 24550] New: Assertion `oldBlock->capturesCXXThis() == blockScope->isCXXThisCaptured()

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Aug 24 04:18:11 PDT 2015


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

            Bug ID: 24550
           Summary: Assertion `oldBlock->capturesCXXThis() ==
                    blockScope->isCXXThisCaptured()
           Product: new-bugs
           Version: 3.7
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: benjamin at tudos.org
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 14765
  --> https://llvm.org/bugs/attachment.cgi?id=14765&action=edit
run script

Compiling the code below with -fblocks causes clang to trigger it's own
assertion. The run script is attached as requested, the preprocessed source
code looks identical to the code below.

[ --- code --- ]

typedef void (^Block)();

void invoke_block (Block block);

// --- a class

class A
{
public:
    int f () { return 0; }
};

// --- template base class ---

template<class T>
class Base
{
public:
    T * t;

    virtual void virtual_function () {}
};

// --- derive from template base class

template<class T>
class Derv : public Base<T>
{
    virtual void virtual_function ();
};

template<class T>
void Derv<T>::virtual_function ()
{
    invoke_block (^() {
        int i = Base<T>::t->f ();
    });
}

int main(int argc, char **argv)
{
    Derv<A> d;

    return 0;
}

[ --- end of code --- ]

-- 
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/20150824/3d110a53/attachment.html>


More information about the llvm-bugs mailing list