Message ID | 0dc1c55f8eb864d8b145b798a43ec3c7@imap.force9.net |
---|---|
State | New |
Headers | show |
On 09/23/2013 02:08 AM, Adam Butcher wrote: > Note that this doesn't mean that 'auto' parameters in a function ptr > will be treated the same; I think we need a special case for this in the > implicit template parameter introduction code (or refactor to generate > template parm types on the fly). It is seeming like generating the types on the fly will make various things simpler; otherwise we need to deal with rewriting arbitrarily complex types later on. The patch is OK. Jason
On 23.09.2013 19:02, Jason Merrill wrote: > On 09/23/2013 02:08 AM, Adam Butcher wrote: >> Note that this doesn't mean that 'auto' parameters in a function ptr >> will be treated the same; I think we need a special case for this in >> the >> implicit template parameter introduction code (or refactor to >> generate >> template parm types on the fly). > > It is seeming like generating the types on the fly will make various > things simpler; otherwise we need to deal with rewriting arbitrarily > complex types later on. > Agreed. We can arrange for the parm trees to be as if the user had explicitly specified the template and then subsequent logic will proceed 'naturally'. I'll look into it.
diff --git a/gcc/cp/type-utils.h b/gcc/cp/type-utils.h index 3e82ca4..2febce7 100644 --- a/gcc/cp/type-utils.h +++ b/gcc/cp/type-utils.h @@ -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; } diff --git a/gcc/testsuite/g++.dg/cpp1y/pr58500.C b/gcc/testsuite/g++.dg/cpp1y/pr58500.C new file mode 100644 index 0000000..b9d4a26 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/pr58500.C @@ -0,0 +1,8 @@ +// { dg-do compile } +// { dg-options "-std=gnu++1y" } + +// PR c++/58500 + +struct A {}; + +void foo(auto (A::*)());