re PR c++/29633 (syntax error in do/while condition with templates reports incorrect...
authorPaolo Carlini <paolo.carlini@oracle.com>
Thu, 18 Oct 2012 17:02:10 +0000 (17:02 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Thu, 18 Oct 2012 17:02:10 +0000 (17:02 +0000)
2012-10-18  Paolo Carlini  <paolo.carlini@oracle.com>

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

From-SVN: r192570

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/template/pr29633.C [new file with mode: 0644]

index 7ed81b9f5e7a2279fb2bdae8c5b94335f2cf49b0..98c4815eeda69a24b69dae7e4a6fb12000b82fe7 100644 (file)
@@ -1,3 +1,8 @@
+2012-10-18  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/29633
+       * g++.dg/template/pr29633.C: New.
+
 2012-10-18  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gnat.dg/loop_optimization13.ad[sb]: New test.
diff --git a/gcc/testsuite/g++.dg/template/pr29633.C b/gcc/testsuite/g++.dg/template/pr29633.C
new file mode 100644 (file)
index 0000000..3e0254a
--- /dev/null
@@ -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;
+}