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
This commit is contained in:
parent
dd56ca9f1c
commit
bb0a32e80d
4 changed files with 22 additions and 0 deletions
|
@ -1,5 +1,8 @@
|
|||
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
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
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.
|
||||
|
||||
|
|
13
gcc/testsuite/g++.dg/cpp0x/decltype31.C
Normal file
13
gcc/testsuite/g++.dg/cpp0x/decltype31.C
Normal file
|
@ -0,0 +1,13 @@
|
|||
// 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" }
|
Loading…
Add table
Reference in a new issue