g++.dg/ipa/pr64612.C: New test.
authorMarkus Trippelsdorf <markus@trippelsdorf.de>
Fri, 16 Jan 2015 11:12:52 +0000 (11:12 +0000)
committerMarkus Trippelsdorf <trippels@gcc.gnu.org>
Fri, 16 Jan 2015 11:12:52 +0000 (11:12 +0000)
2015-01-16  Markus Trippelsdorf  <markus@trippelsdorf.de>

PR ipa/64163
PR ipa/64612
* g++.dg/ipa/pr64612.C: New test.

From-SVN: r219721

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

index 83fe97b..4e657a4 100644 (file)
@@ -1,3 +1,9 @@
+2015-01-16  Markus Trippelsdorf  <markus@trippelsdorf.de>
+
+       PR ipa/64163
+       PR ipa/64612
+       * g++.dg/ipa/pr64612.C: New test.
+
 2015-01-16  Renlin Li  <renlin.li@arm.com>
 
        * g++.dg/builtin-apply2.c: Remove aarch64 target from skip list.
diff --git a/gcc/testsuite/g++.dg/ipa/pr64612.C b/gcc/testsuite/g++.dg/ipa/pr64612.C
new file mode 100644 (file)
index 0000000..f1cd96a
--- /dev/null
@@ -0,0 +1,66 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -std=c++11" } */
+/* { dg-final { scan-assembler "_ZN5QListI7QStringED1Ev" } } */
+
+class A
+{
+public:
+  bool deref ();
+};
+class QString;
+struct B
+{
+  A ref;
+};
+template <typename> class QList
+{
+  B d;
+public:
+  ~QList ();
+  class const_iterator
+  {
+  };
+  const_iterator constBegin ();
+  void clear ();
+  void dealloc ();
+};
+template <typename T> QList<T>::~QList ()
+{
+  if (d.ref.deref ())
+    dealloc ();
+}
+template <typename T>
+void
+QList<T>::clear ()
+{
+  QList ();
+}
+class A1 : public QList<QString>
+{
+};
+class B1
+{
+public:
+  B1 (A1);
+};
+struct F
+{
+  void addMatch (const QString &&);
+  A1 m_matchingMimeTypes;
+};
+class G
+{
+  A1 matchingGlobs (const QString &) const;
+};
+void
+F::addMatch (const QString &&)
+{
+  m_matchingMimeTypes.clear ();
+}
+A1
+G::matchingGlobs (const QString &) const
+{
+  A1 a;
+  for (B1 b (a);;)
+    ;
+}