Commit c9e71b36 by Jason Merrill Committed by Jason Merrill

re PR c++/47482 ([C++0x] ICE: unexpected expression ‘sizeof ("A")’ of kind sizeof_expr)

	PR c++/47482
	* parser.c (cp_parser_enumerator_definition): Call
	fold_non_dependent_expr.

From-SVN: r170156
parent b09c3081
2011-02-14 Jason Merrill <jason@redhat.com>
PR c++/47482
* parser.c (cp_parser_enumerator_definition): Call
fold_non_dependent_expr.
2011-02-09 Jason Merrill <jason@redhat.com> 2011-02-09 Jason Merrill <jason@redhat.com>
* decl.c (cp_make_fname_decl): Set DECL_THIS_STATIC at toplevel. * decl.c (cp_make_fname_decl): Set DECL_THIS_STATIC at toplevel.
......
...@@ -13763,6 +13763,10 @@ cp_parser_enumerator_definition (cp_parser* parser, tree type) ...@@ -13763,6 +13763,10 @@ cp_parser_enumerator_definition (cp_parser* parser, tree type)
if (check_for_bare_parameter_packs (value)) if (check_for_bare_parameter_packs (value))
value = error_mark_node; value = error_mark_node;
/* integral_constant_value will pull out this expression, so make sure
it's folded as appropriate. */
value = fold_non_dependent_expr (value);
/* Create the enumerator. */ /* Create the enumerator. */
build_enumerator (identifier, value, type, loc); build_enumerator (identifier, value, type, loc);
} }
......
2011-02-14 Jason Merrill <jason@redhat.com>
* g++.dg/cpp0x/regress/enum1.C: New.
2011-02-14 Eric Botcazou <ebotcazou@adacore.com> 2011-02-14 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/include.adb: New test. * gnat.dg/include.adb: New test.
......
// PR c++/47482
// { dg-options -std=c++0x }
template<class>
struct K
{
enum { A = sizeof"A", B = +A };
};
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