From patchwork Thu Oct 18 17:03:26 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [C++,testcase] PR 29633 Date: Thu, 18 Oct 2012 07:03:26 -0000 From: Paolo Carlini X-Patchwork-Id: 192388 Message-Id: <5080365E.6020600@oracle.com> To: "gcc-patches@gcc.gnu.org" Hi, testcase added, PR closed as fixed in mainline. Thanks, Paolo. ///////////////////// 2012-10-18 Paolo Carlini PR c++/29633 * g++.dg/template/pr29633.C: New. Index: g++.dg/template/pr29633.C =================================================================== --- g++.dg/template/pr29633.C (revision 0) +++ g++.dg/template/pr29633.C (working copy) @@ -0,0 +1,29 @@ +// PR c++/29633 + +template +struct Class1 +{ + void testfn1(void); +}; + +template +class Class2 +{ +public: + void testfn2(void) + { + Class1 * tc_a; + do + { + int x = 0; + } + while (tc_a && tc_a->testfn1); // { dg-error "invalid use of member" } + } +}; + +int main(void) +{ + Class2 tc2; + tc2.testfn2(); + return 0; +}