Patchwork [C++,testcase] PR 29633

login
register
mail settings
Submitter Paolo Carlini
Date Oct. 18, 2012, 5:03 p.m.
Message ID <5080365E.6020600@oracle.com>
Download mbox | patch
Permalink /patch/192388/
State New
Headers show

Comments

Paolo Carlini - Oct. 18, 2012, 5:03 p.m.
Hi,

testcase added, PR closed as fixed in mainline.

Thanks,
Paolo.

/////////////////////
2012-10-18  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/29633
	* g++.dg/template/pr29633.C: New.

Patch

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;
+}