From patchwork Sun Oct 14 18:26:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [C++,testcase] PR 53581 Date: Sun, 14 Oct 2012 08:26:03 -0000 From: Paolo Carlini X-Patchwork-Id: 191376 Message-Id: <507B03BB.5080303@oracle.com> To: "gcc-patches@gcc.gnu.org" Hi, testcase added, issue closed as fixed. Tested x86_64-linux. Thanks, Paolo. ///////////////////// 2012-10-14 Paolo Carlini PR c++/53581 * g++.dg/template/crash113.C: New. Index: g++.dg/template/crash113.C =================================================================== --- g++.dg/template/crash113.C (revision 0) +++ g++.dg/template/crash113.C (working copy) @@ -0,0 +1,50 @@ +// PR c++/53581 + +template +class Child; + +template +class Base +{ +public: + Child operator-(const Base &m) const + { + Child diff; + return diff; + } + + A test() const + { + return 0; + } + +private: + A values[M * N]; +}; + +template +class Ops +{ +public: + virtual ~Ops() {} + + bool bar() const + { + Child mat; + return (*static_cast*>(this) - mat).test(); + } +}; + + +template +class Child : public Base, public Ops {}; + +class ImageWarp +{ + bool bar() const + { + return foo.bar(); + } + + Child foo; +};