summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/lookup/anon7.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/lookup/anon7.C')
-rw-r--r--gcc/testsuite/g++.dg/lookup/anon7.C26
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/lookup/anon7.C b/gcc/testsuite/g++.dg/lookup/anon7.C
new file mode 100644
index 000000000..79cad0acb
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lookup/anon7.C
@@ -0,0 +1,26 @@
+// PR c++/39560
+// { dg-options -Wunused }
+
+struct X { };
+
+class Z {
+public:
+ X* cc(int c);
+};
+
+class F {
+public:
+ typedef X* (Z::*MethO)(int);
+ typedef X* (F::*MethF)(int);
+ template<MethO m>
+ X* xwrapper(int i) {
+ union {
+ Z *z;
+ F *f;
+ }; // { dg-bogus "unused" }
+ f = this;
+ return ((z->*m)(i));
+ }
+};
+
+F::MethF meth = &F::xwrapper<&Z::cc>;