diff gcc/testsuite/g++.dg/overload/defarg4.C @ 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/overload/defarg4.C	Fri Oct 27 22:46:09 2017 +0900
@@ -0,0 +1,26 @@
+// Contributed by Dodji Seketeli <dodji@redhat.com>
+// Origin PR c++/39987
+// { dg-do compile }
+
+class foo
+{
+ template<typename U>
+ static bool func(const U& x)
+ {}
+public:
+ template<typename U>
+ unsigned int Find(const U& x, bool (*pFunc) (const U&) = func) const
+ {}
+};
+
+class bar {
+ bool Initialize();
+protected:
+ foo b;
+};
+
+bool bar::Initialize()
+{
+        b.Find(b);
+}
+