Skip to content
Snippets Groups Projects
Commit adf2edec authored by Douglas Gregor's avatar Douglas Gregor Committed by Doug Gregor
Browse files

c-common.c (do_switch_warnings): Look through the CONST_DECLs in the...

c-common.c (do_switch_warnings): Look through the CONST_DECLs in the enumerators of an ENUMERAL_TYPE.

2008-08-26  Douglas Gregor  <doug.gregor@gmail.com>

	* c-common.c (do_switch_warnings): Look through the CONST_DECLs in
	the enumerators of an ENUMERAL_TYPE.
	* dbxout.c (dbxout_type): Ditto.

2008-08-26  Douglas Gregor  <doug.gregor@gmail.com>

	* typeck.c (type_after_usual_arithmetic_conversions): Don't do the
	usual arithmetic conversions on scoped enumeration types.
	(common_type): Ditto.
	(default_conversion): Don't perform integral promotions on scoped
	enumeration types. 
	(build_array_ref): Scoped enumeration types can't be used as
	subscripts.
	* decl.c (start_enum): If building a C++0x scoped enumeration,
	enter its scope. If provided with an underlying type, check that
	underlying type and set up the enumeration type accordingly.
	(finish_enum): Only compute an underlying type if the underlying
	type isn't already fixed, and only convert the enumerator values
	now if we've just computed the underlying type. Finish the scope
	of C++0x scoped enumerations.
	(build_enumerator): For enumerations with a fixed underlying type,
	check the enumerator values when the enumerator is defined.
	(lookup_enumerator): New.
	* call.c (standard_conversion): Don't allow assignment from
	integers to scoped enumeration types, even with -fpermissive.
	Don't convert from scoped enumerations to bool or any arithmetic
	types.
	(build_conditional_expr): Don't per the usual arithmetic
	conversions for scoped enumeration types.
	(convert_like_real): Check complain to see if we should
	produce warnings.
	* error.c (class_key_or_enum_as_string): Print scoped enums.
	* cp-tree.h (MAYBE_CLASS_TYPE_P): Check CLASS_TYPE_P, not
	TYPE_LANG_FLAG_5.
	(INTEGRAL_OR_UNSCOPED_ENUMERATION_TYPE_P): New.
	(SCOPED_ENUM_P): New.
	(UNSCOPED_ENUM_P): New.
	(SET_SCOPED_ENUM_P): New.
	(ENUM_UNDERLYING_TYPE): New.
	* pt.c (lookup_template_class): Update the instantiation of enum
	types to deal with C++0x scoped enumerations and underlying
	types.
	* name-lookup.c (begin_scope): Deal with scoped enumeration
	scopes.
	(lookup_qualified_name): Deal with lookup into enumeration types.
	* name-lookup.h (enum scope_kind): Add sk_scoped_enum.
	* parser.c (cp_parser_class_or_namespace_name): Rename to...
	(cp_parser_qualifying_entity): ... this. Also, in C++0x mode,
	parse a type-name that can be an enumeration type.
	(cp_parser_nested_name_specifier_opt): Update with C++0x grammar.
	(cp_parser_elaborated_type_specifier): Parse the
	optional `struct' or `class' following enum (in C++0x).
	(cp_parser_enum_specifier): Parse C++0x scoped enumerations and
	enum-base clauses.

2008-08-26  Douglas Gregor  <doug.gregor@gmail.com>

	* g++.dg/cpp0x/scoped_enum_examples.C: New.
	* g++.dg/cpp0x/scoped_enum.C: New.
	* g++.dg/cpp0x/scoped_enum_98.C: New.
	* g++.dg/cpp0x/enum_base_warn.C: New.
	* g++.dg/cpp0x/enum_base.C: New.

From-SVN: r139611
parent 54e22276
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment