* g++.old-deja/g++.other/loop2.C: New test.
authorJakub Jelinek <jakub@redhat.com>
Mon, 21 Aug 2000 13:04:38 +0000 (15:04 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 21 Aug 2000 13:04:38 +0000 (15:04 +0200)
From-SVN: r35839

gcc/testsuite/ChangeLog
gcc/testsuite/g++.old-deja/g++.other/loop2.C [new file with mode: 0644]

index d0c10da4456a5237396282dafb9ee5309e8b2716..0297b60fdd46af9c5af9b365512deef66d9d50ed 100644 (file)
@@ -1,5 +1,7 @@
 2000-08-21  Jakub Jelinek  <jakub@redhat.com>
 
+       * g++.old-deja/g++.other/loop2.C: New test.
+
        * gcc.c-torture/compile/20000606-1.c: New test.
        * gcc.c-torture/compile/20000728-1.c: New test.
        * gcc.c-torture/execute/20000801-1.c: New test.
diff --git a/gcc/testsuite/g++.old-deja/g++.other/loop2.C b/gcc/testsuite/g++.old-deja/g++.other/loop2.C
new file mode 100644 (file)
index 0000000..7fd90c7
--- /dev/null
@@ -0,0 +1,31 @@
+// Build don't link:
+// Special g++ Options: -O
+
+class foo {
+public:
+  operator const char*() const { return a; }
+  char *a;
+};
+
+class bar {
+public:
+  ~bar();
+  void operator++(int);
+  bool b() const;
+protected:
+  void* c() const;
+};
+
+class baz : public bar {
+public:
+  foo const &d() const { return *(foo *)bar::c(); }
+};
+
+extern int tst (const char *, const char *) throw();
+
+void die(const foo& x)
+{
+  for (baz hi; hi.b(); hi++)
+    if (tst (hi.d(), x) == 0)
+      return;
+}