Fix 58500.
authorabutcher <abutcher@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 23 Sep 2013 22:43:44 +0000 (22:43 +0000)
committerabutcher <abutcher@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 23 Sep 2013 22:43:44 +0000 (22:43 +0000)
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202851 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 380fae9..ec40ed5 100644 (file)
@@ -1,5 +1,11 @@
 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
        finish_fully_implicit_template for forward declarations until after
        other decl processing is complete.  Cleanup for clarity: Extract 'else'
index 3e82ca4..2febce7 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 8a19710..4101cc2 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::*)());