commit 35f0fd76efae307b54f9fa11d39c988699eb4214
Author: Jason Merrill <jason@redhat.com>
Date: Tue Jan 28 16:24:28 2014 -0500
PR c++/59818
* pt.c (tsubst_function_type): Make sure we keep the same function
quals.
@@ -11189,6 +11189,8 @@ tsubst_function_type (tree t,
else
{
tree r = TREE_TYPE (TREE_VALUE (arg_types));
+ /* Don't pick up extra function qualifiers from the basetype. */
+ r = cp_build_qualified_type_real (r, type_memfn_quals (t), complain);
if (! MAYBE_CLASS_TYPE_P (r))
{
/* [temp.deduct]
new file mode 100644
@@ -0,0 +1,20 @@
+// PR c++/59818
+
+template <class T>
+struct Identity {
+ typedef T type;
+};
+
+struct Foo {
+ template <typename T>
+ Foo(T*, void (Identity<T>::type::*m)(void));
+};
+
+struct Bar {
+ void Method(void) const;
+};
+
+void Bar::Method(void) const
+{
+ Foo foo(this, &Bar::Method); // { dg-error "no match" }
+}