Message ID | 5080365E.6020600@oracle.com |
---|---|
State | New |
Headers | show |
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 <typename T> +struct Class1 +{ + void testfn1(void); +}; + +template <typename T> +class Class2 +{ +public: + void testfn2(void) + { + Class1<T> * tc_a; + do + { + int x = 0; + } + while (tc_a && tc_a->testfn1); // { dg-error "invalid use of member" } + } +}; + +int main(void) +{ + Class2<int> tc2; + tc2.testfn2(); + return 0; +}