Bug 55538 - [C++11] ICE when calling a member function from lambda in templated class; in get_expr_operands, at tree-ssa-operands.c:1035
Summary: [C++11] ICE when calling a member function from lambda in templated class; in...
Status: RESOLVED DUPLICATE of bug 53137
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.7.2
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2012-11-29 22:08 UTC by etlverified
Modified: 2012-11-29 22:19 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description etlverified 2012-11-29 22:08:55 UTC
Input:
------
#include <functional>

struct IBar
{
    virtual void runLambda(const std::function<void ()>& func) const = 0;
};

template<bool x>
struct Foo
{
    void test(IBar* b)
    {
        b->runLambda([this]() { onTest(); });
    }

    void onTest() {}
};

int main(int argc, char** argv)
{
    Foo<true> f;
    f.test(nullptr);

    return 0;
}

Output:
-------
test.cpp: In lambda function:
test.cpp:25:1: internal compiler error: in get_expr_operands, at tree-ssa-operands.c:1035
Comment 1 Markus Trippelsdorf 2012-11-29 22:14:57 UTC
Jason fixed this a few minutes ago:
http://gcc.gnu.org/viewcvs?view=revision&revision=193957
Comment 2 Paolo Carlini 2012-11-29 22:19:50 UTC
Dup

*** This bug has been marked as a duplicate of bug 53137 ***