PR c++/49921
* semantics.c (finish_decltype_type): Call invalid_nonstatic_memfn_p.
From-SVN: r177498
2011-08-05 Jason Merrill <jason@redhat.com>
+ PR c++/49921
+ * semantics.c (finish_decltype_type): Call invalid_nonstatic_memfn_p.
+
PR c++/49669
* init.c (perform_member_init): Handle invalid array initializer.
return error_mark_node;
}
+ if (invalid_nonstatic_memfn_p (expr, complain))
+ return error_mark_node;
+
/* To get the size of a static data member declared as an array of
unknown bound, we need to instantiate it. */
if (TREE_CODE (expr) == VAR_DECL
2011-08-05 Jason Merrill <jason@redhat.com>
+ PR c++/49921
+ * g++.dg/cpp0x/decltype31.C: New.
+
PR c++/49669
* g++.dg/init/array28.C: New.
--- /dev/null
+// PR c++/49921
+// { dg-options -std=c++0x }
+
+struct Local
+{
+ void f();
+};
+
+Local *l;
+void (Local::*ptr)();
+decltype((l->*ptr)) i; // { dg-error "member function" }
+
+// { dg-prune-output "invalid type in declaration" }