Handle void * conversions in FreeBSD/x86 native code to fix C++ build.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.cp / temargs.cc
index a97486f1619dc3f1b63c4fab15e398f10616a97d..7a11ddbaf72de8699b1f1ea76819039b988d6d86 100644 (file)
@@ -1,6 +1,6 @@
 /* Template argument tests.
 
-   Copyright 2010, 2011 Free Software Foundation, Inc.
+   Copyright 2010-2016 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -23,6 +23,7 @@ int a_global;
 struct S
 {
   int f;
+  void somefunc() { }
 };
 
 template<typename T, int I, int *P, int S::*MP>
@@ -55,17 +56,46 @@ void func ()
   // Breakpoint 3.
 }
 
+template<void (S::*F) ()>
+struct K2
+{
+  void k2_m ()
+  {
+    // Breakpoint 5.
+  }
+};
+
+// GCC PR debug/49546
+struct S3
+{
+  static void m (int x) {}
+};
+template <void (*F) (int)>
+// or: template <void (F) (int)>
+struct K3
+{
+  void k3_m ()
+  {
+    F (0);     // Breakpoint 6.
+  }
+};
+
 int main ()
 {
   Base<double, 23, &a_global, &S::f> base;
   // Note that instantiating with P==0 does not work with g++.
   // That would be worth testing, once g++ is fixed.
   Base<long, 47, &a_global, &S::f>::Inner<float> inner;
+  K2<&S::somefunc> k2;
+  K3<&S3::m> k3;
+// or: K3<S3::m> k3;
 
   base.base_m ();
   inner.inner_m ();
   func<unsigned char, 91, &a_global, &S::f> ();
   base.templ_m<short> ();
+  k2.k2_m ();
+  k3.k3_m ();
 
   return 0;
 }
This page took 0.024441 seconds and 4 git commands to generate.