diff gcc/testsuite/g++.dg/vect/pr60836.cc @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children 84e7813d76e9
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gcc/testsuite/g++.dg/vect/pr60836.cc	Fri Oct 27 22:46:09 2017 +0900
@@ -0,0 +1,38 @@
+// { dg-do compile }
+
+int a, b;
+typedef double (*NormFunc) (const int &);
+int &
+max (int &p1, int &p2)
+{
+  if (p1 < p2)
+    return p2;
+  return p1;
+}
+
+struct A
+{
+  int operator      () (int p1, int p2)
+    {
+      return max (p1, p2);
+    }
+};
+template < class, class > double
+norm_ (const int &)
+{
+  char c, d;
+  A e;
+  for (; a; a++)
+    {
+      b = e (b, d);
+      b = e (b, c);
+    }
+}
+
+void
+norm ()
+{
+  static NormFunc f = norm_ < int, A >;
+  f = 0;
+}
+