Commit bb0a32e8 by Jason Merrill Committed by Jason Merrill

re PR c++/49921 ([C++0x] Segfault during compilation, decltype and operator->*)

	PR c++/49921
	* semantics.c (finish_decltype_type): Call invalid_nonstatic_memfn_p.

From-SVN: r177498
parent dd56ca9f
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.
......
......@@ -4948,6 +4948,9 @@ finish_decltype_type (tree expr, bool id_expression_or_member_access_p,
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.
......
// 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" }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment