re PR c++/49298 ([C++0x] sorry, unimplemented: unexpected ast of kind field_decl)

PR c++/49298
	* semantics.c (potential_constant_expression_1): Handle FIELD_DECL.

From-SVN: r174721
This commit is contained in:
Jason Merrill 2011-06-06 15:42:38 -04:00 committed by Jason Merrill
parent 4de4b0f267
commit a651bcbe5e
4 changed files with 18 additions and 0 deletions

View File

@ -1,5 +1,8 @@
2011-06-06 Jason Merrill <jason@redhat.com>
PR c++/49298
* semantics.c (potential_constant_expression_1): Handle FIELD_DECL.
PR objc++/49221
* decl.c (cp_finish_decl): Check DECL_FUNCTION_SCOPE_P rather than
at_function_scope_p.

View File

@ -7489,6 +7489,8 @@ potential_constant_expression_1 (tree t, bool want_rval, tsubst_flags_t flags)
case TEMPLATE_PARM_INDEX:
case TRAIT_EXPR:
case IDENTIFIER_NODE:
/* We can see a FIELD_DECL in a pointer-to-member expression. */
case FIELD_DECL:
return true;
case PARM_DECL:

View File

@ -1,3 +1,7 @@
2011-06-06 Jason Merrill <jason@redhat.com>
* g++.dg/cpp0x/regress/ptrmem1.C: New.
2011-06-06 Richard Sandiford <rdsandiford@googlemail.com>
PR rtl-optimization/49145

View File

@ -0,0 +1,9 @@
// PR c++/49298
// { dg-options -std=c++0x }
template <class T, int T::*> struct B { };
template <class T> struct A
{
int i;
B<A,&A::i> b;
};