Commit c6cc83d0 by Jason Merrill Committed by Jason Merrill

re PR c++/43509 ([C++0x] ICE in constructor_name_p, at cp/name-lookup.c:1809)

	PR c++/43509
	* parser.c (cp_parser_qualifying_entity): Do accept enum names in
	c++0x mode, but not other type-names.

From-SVN: r157765
parent 2155f963
2010-03-26 Jason Merrill <jason@redhat.com>
PR c++/43509
* parser.c (cp_parser_qualifying_entity): Do accept enum names in
c++0x mode, but not other type-names.
2010-03-26 Dodji Seketeli <dodji@redhat.com>
PR c++/43327
......
......@@ -4441,6 +4441,16 @@ cp_parser_qualifying_entity (cp_parser *parser,
/* Parse a typedef-name or enum-name. */
scope = cp_parser_nonclass_name (parser);
/* "If the name found does not designate a namespace or a class,
enumeration, or dependent type, the program is ill-formed."
We cover classes and dependent types above and namespaces below,
so this code is only looking for enums. */
if (!scope || TREE_CODE (scope) != TYPE_DECL
|| TREE_CODE (TREE_TYPE (scope)) != ENUMERAL_TYPE)
cp_parser_simulate_error (parser);
successful_parse_p = cp_parser_parse_definitely (parser);
}
/* If that didn't work, try for a namespace-name. */
......
2010-03-26 Jason Merrill <jason@redhat.com>
PR c++/43509
* g++.dg/cpp0x/parse1.C: New.
2010-03-26 Uros Bizjak <ubizjak@gmail.com>
PR target/43524
......
// PR c++/43509
// { dg-options "-std=c++0x" }
typedef int B; // { dg-error "" }
B::B() {} // { dg-error "" }
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