Fix 58500.
authorAdam Butcher <adam@jessamine.co.uk>
Mon, 23 Sep 2013 22:43:44 +0000 (23:43 +0100)
committerAdam Butcher <abutcher@gcc.gnu.org>
Mon, 23 Sep 2013 22:43:44 +0000 (23:43 +0100)
gcc/cp/
PR c++/58500
* type-utils.h (find_type_usage): Only traverse one type level into
member function pointers.

gcc/testsuite/
PR c++/58500
* g++.dg/cpp1y/pr58500.C: New testcase.

From-SVN: r202851

gcc/cp/ChangeLog
gcc/cp/type-utils.h
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp1y/pr58500.C [new file with mode: 0644]

index 380fae9db428ac43fdf3384210f7c0e42c9a45c6..ec40ed5c06136cae87c3df2983d6acb422e648ce 100644 (file)
@@ -1,3 +1,9 @@
+2013-09-23  Adam Butcher  <adam@jessamine.co.uk>
+
+       PR c++/58500
+       * type-utils.h (find_type_usage): Only traverse one type level into
+       member function pointers.
+
 2013-09-23  Adam Butcher  <adam@jessamine.co.uk>
 
        * parser.c (cp_parser_init_declarator): Defer calling
index 3e82ca4f9576b7d25d76f71eb888689d432e01b6..2febce76075dd7d7ee5c73f4ccccf1bf12034767 100644 (file)
@@ -47,7 +47,7 @@ find_type_usage (tree t, bool (*pred) (const_tree))
 
   if (TYPE_PTRMEMFUNC_P (t))
     return find_type_usage
-      (TREE_TYPE (TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE (t))), pred);
+      (TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE (t)), pred);
 
   return NULL_TREE;
 }
index 8a197107f86016c49e5aec0941e5e026e618e45e..4101cc285f0e0568200b06f245c4c03edfc4bb46 100644 (file)
@@ -1,3 +1,8 @@
+2013-09-23  Adam Butcher  <adam@jessamine.co.uk>
+
+       PR c++/58500
+       * g++.dg/cpp1y/pr58500.C: New testcase.
+
 2013-09-23  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gnat.dg/opt28.ad[sb]: New test.
diff --git a/gcc/testsuite/g++.dg/cpp1y/pr58500.C b/gcc/testsuite/g++.dg/cpp1y/pr58500.C
new file mode 100644 (file)
index 0000000..b9d4a26
--- /dev/null
@@ -0,0 +1,8 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++1y" }
+
+// PR c++/58500
+
+struct A {};
+
+void foo(auto (A::*)());