Commit 3c0d13bf by Paolo Carlini

c-common.c (c_common_reswords): Reorder.

/c-family
2011-05-15  Paolo Carlini  <paolo.carlini@oracle.com>

	* c-common.c (c_common_reswords): Reorder.
	* c-common.h (rid): Likewise.

/cp
2011-05-15  Paolo Carlini  <paolo.carlini@oracle.com>

	* cxx-pretty-print.c: Update comment.
	* semantics.c (trait_expr_value, finish_trait_expr):
	Reorder the cases.
	* parser.c (cp_parser_primary_expression): Likewise.

From-SVN: r173780
parent 5bef11c8
...@@ -2587,8 +2587,6 @@ ...@@ -2587,8 +2587,6 @@
2011-04-25 Paolo Carlini <paolo.carlini@oracle.com> 2011-04-25 Paolo Carlini <paolo.carlini@oracle.com>
* c-family/c-common.c (struct c_common_resword): Add __underlying_type.
* c-family/c-common.h (enum rid): Add RID_UNDERLYING_TYPE.
* doc/extend.texi: Document __underlying_type. * doc/extend.texi: Document __underlying_type.
2011-04-25 Segher Boessenkool <segher@kernel.crashing.org> 2011-04-25 Segher Boessenkool <segher@kernel.crashing.org>
......
2011-05-15 Paolo Carlini <paolo.carlini@oracle.com>
* c-common.c (c_common_reswords): Reorder.
* c-common.h (rid): Likewise.
2011-05-10 Nathan Froyd <froydnj@codesourcery.com> 2011-05-10 Nathan Froyd <froydnj@codesourcery.com>
* c-common.c (def_fn_type): Don't call build_function_type, call * c-common.c (def_fn_type): Don't call build_function_type, call
...@@ -48,6 +53,11 @@ ...@@ -48,6 +53,11 @@
* c-ppoutput.c (maybe_print_line): Always optimize newlines * c-ppoutput.c (maybe_print_line): Always optimize newlines
for output size with -P. for output size with -P.
2011-04-25 Paolo Carlini <paolo.carlini@oracle.com>
* c-common.c (struct c_common_resword): Add __underlying_type.
* c-common.h (enum rid): Add RID_UNDERLYING_TYPE.
2011-04-20 Jim Meyering <meyering@redhat.com> 2011-04-20 Jim Meyering <meyering@redhat.com>
* c-format.c (init_dollar_format_checking): Remove useless * c-format.c (init_dollar_format_checking): Remove useless
...@@ -56,15 +66,15 @@ ...@@ -56,15 +66,15 @@
2011-04-15 Nicola Pero <nicola.pero@meta-innovation.com> 2011-04-15 Nicola Pero <nicola.pero@meta-innovation.com>
* c-objc.h (objc_get_interface_ivars): Removed. * c-objc.h (objc_get_interface_ivars): Removed.
(objc_detect_field_duplicates): New. (objc_detect_field_duplicates): New.
* stub-objc.c: Likewise. * stub-objc.c: Likewise.
2011-04-14 Nicola Pero <nicola.pero@meta-innovation.com> 2011-04-14 Nicola Pero <nicola.pero@meta-innovation.com>
* stub-objc.c (objc_declare_protocols): Renamed to * stub-objc.c (objc_declare_protocols): Renamed to
objc_declare_protocol. objc_declare_protocol.
* c-objc.h: Likewise. * c-objc.h: Likewise.
2011-04-14 Nicola Pero <nicola.pero@meta-innovation.com> 2011-04-14 Nicola Pero <nicola.pero@meta-innovation.com>
* stub-objc.c (objc_declare_class): Updated argument name. * stub-objc.c (objc_declare_class): Updated argument name.
......
...@@ -437,6 +437,10 @@ const struct c_common_resword c_common_reswords[] = ...@@ -437,6 +437,10 @@ const struct c_common_resword c_common_reswords[] =
{ "__has_trivial_copy", RID_HAS_TRIVIAL_COPY, D_CXXONLY }, { "__has_trivial_copy", RID_HAS_TRIVIAL_COPY, D_CXXONLY },
{ "__has_trivial_destructor", RID_HAS_TRIVIAL_DESTRUCTOR, D_CXXONLY }, { "__has_trivial_destructor", RID_HAS_TRIVIAL_DESTRUCTOR, D_CXXONLY },
{ "__has_virtual_destructor", RID_HAS_VIRTUAL_DESTRUCTOR, D_CXXONLY }, { "__has_virtual_destructor", RID_HAS_VIRTUAL_DESTRUCTOR, D_CXXONLY },
{ "__imag", RID_IMAGPART, 0 },
{ "__imag__", RID_IMAGPART, 0 },
{ "__inline", RID_INLINE, 0 },
{ "__inline__", RID_INLINE, 0 },
{ "__int128", RID_INT128, 0 }, { "__int128", RID_INT128, 0 },
{ "__is_abstract", RID_IS_ABSTRACT, D_CXXONLY }, { "__is_abstract", RID_IS_ABSTRACT, D_CXXONLY },
{ "__is_base_of", RID_IS_BASE_OF, D_CXXONLY }, { "__is_base_of", RID_IS_BASE_OF, D_CXXONLY },
...@@ -444,17 +448,12 @@ const struct c_common_resword c_common_reswords[] = ...@@ -444,17 +448,12 @@ const struct c_common_resword c_common_reswords[] =
{ "__is_convertible_to", RID_IS_CONVERTIBLE_TO, D_CXXONLY }, { "__is_convertible_to", RID_IS_CONVERTIBLE_TO, D_CXXONLY },
{ "__is_empty", RID_IS_EMPTY, D_CXXONLY }, { "__is_empty", RID_IS_EMPTY, D_CXXONLY },
{ "__is_enum", RID_IS_ENUM, D_CXXONLY }, { "__is_enum", RID_IS_ENUM, D_CXXONLY },
{ "__is_literal_type", RID_IS_LITERAL_TYPE, D_CXXONLY },
{ "__is_pod", RID_IS_POD, D_CXXONLY }, { "__is_pod", RID_IS_POD, D_CXXONLY },
{ "__is_polymorphic", RID_IS_POLYMORPHIC, D_CXXONLY }, { "__is_polymorphic", RID_IS_POLYMORPHIC, D_CXXONLY },
{ "__is_standard_layout", RID_IS_STD_LAYOUT, D_CXXONLY }, { "__is_standard_layout", RID_IS_STD_LAYOUT, D_CXXONLY },
{ "__is_trivial", RID_IS_TRIVIAL, D_CXXONLY }, { "__is_trivial", RID_IS_TRIVIAL, D_CXXONLY },
{ "__is_union", RID_IS_UNION, D_CXXONLY }, { "__is_union", RID_IS_UNION, D_CXXONLY },
{ "__is_literal_type", RID_IS_LITERAL_TYPE, D_CXXONLY },
{ "__underlying_type", RID_UNDERLYING_TYPE, D_CXXONLY },
{ "__imag", RID_IMAGPART, 0 },
{ "__imag__", RID_IMAGPART, 0 },
{ "__inline", RID_INLINE, 0 },
{ "__inline__", RID_INLINE, 0 },
{ "__label__", RID_LABEL, 0 }, { "__label__", RID_LABEL, 0 },
{ "__null", RID_NULL, 0 }, { "__null", RID_NULL, 0 },
{ "__real", RID_REALPART, 0 }, { "__real", RID_REALPART, 0 },
...@@ -466,6 +465,7 @@ const struct c_common_resword c_common_reswords[] = ...@@ -466,6 +465,7 @@ const struct c_common_resword c_common_reswords[] =
{ "__thread", RID_THREAD, 0 }, { "__thread", RID_THREAD, 0 },
{ "__typeof", RID_TYPEOF, 0 }, { "__typeof", RID_TYPEOF, 0 },
{ "__typeof__", RID_TYPEOF, 0 }, { "__typeof__", RID_TYPEOF, 0 },
{ "__underlying_type", RID_UNDERLYING_TYPE, D_CXXONLY },
{ "__volatile", RID_VOLATILE, 0 }, { "__volatile", RID_VOLATILE, 0 },
{ "__volatile__", RID_VOLATILE, 0 }, { "__volatile__", RID_VOLATILE, 0 },
{ "alignof", RID_ALIGNOF, D_CXXONLY | D_CXX0X | D_CXXWARN }, { "alignof", RID_ALIGNOF, D_CXXONLY | D_CXX0X | D_CXXWARN },
......
...@@ -135,9 +135,9 @@ enum rid ...@@ -135,9 +135,9 @@ enum rid
RID_IS_ABSTRACT, RID_IS_BASE_OF, RID_IS_ABSTRACT, RID_IS_BASE_OF,
RID_IS_CONVERTIBLE_TO, RID_IS_CLASS, RID_IS_CONVERTIBLE_TO, RID_IS_CLASS,
RID_IS_EMPTY, RID_IS_ENUM, RID_IS_EMPTY, RID_IS_ENUM,
RID_IS_POD, RID_IS_POLYMORPHIC, RID_IS_LITERAL_TYPE, RID_IS_POD,
RID_IS_STD_LAYOUT, RID_IS_TRIVIAL, RID_IS_POLYMORPHIC, RID_IS_STD_LAYOUT,
RID_IS_UNION, RID_IS_LITERAL_TYPE, RID_IS_TRIVIAL, RID_IS_UNION,
RID_UNDERLYING_TYPE, RID_UNDERLYING_TYPE,
/* C++0x */ /* C++0x */
......
2011-05-15 Paolo Carlini <paolo.carlini@oracle.com>
* cxx-pretty-print.c: Update comment.
* semantics.c (trait_expr_value, finish_trait_expr):
Reorder the cases.
* parser.c (cp_parser_primary_expression): Likewise.
2011-05-15 Jonathan Wakely <jwakely.gcc@gmail.com> 2011-05-15 Jonathan Wakely <jwakely.gcc@gmail.com>
PR c++/48994 PR c++/48994
......
...@@ -394,8 +394,11 @@ pp_cxx_id_expression (cxx_pretty_printer *pp, tree t) ...@@ -394,8 +394,11 @@ pp_cxx_id_expression (cxx_pretty_printer *pp, tree t)
__is_convertible_to ( type-id , type-id ) __is_convertible_to ( type-id , type-id )
__is_empty ( type-id ) __is_empty ( type-id )
__is_enum ( type-id ) __is_enum ( type-id )
__is_literal_type ( type-id )
__is_pod ( type-id ) __is_pod ( type-id )
__is_polymorphic ( type-id ) __is_polymorphic ( type-id )
__is_std_layout ( type-id )
__is_trivial ( type-id )
__is_union ( type-id ) */ __is_union ( type-id ) */
static void static void
......
...@@ -3274,8 +3274,11 @@ cp_parser_translation_unit (cp_parser* parser) ...@@ -3274,8 +3274,11 @@ cp_parser_translation_unit (cp_parser* parser)
__is_convertible_to ( type-id , type-id ) __is_convertible_to ( type-id , type-id )
__is_empty ( type-id ) __is_empty ( type-id )
__is_enum ( type-id ) __is_enum ( type-id )
__is_literal_type ( type-id )
__is_pod ( type-id ) __is_pod ( type-id )
__is_polymorphic ( type-id ) __is_polymorphic ( type-id )
__is_std_layout ( type-id )
__is_trivial ( type-id )
__is_union ( type-id ) __is_union ( type-id )
Objective-C++ Extension: Objective-C++ Extension:
...@@ -3601,12 +3604,12 @@ cp_parser_primary_expression (cp_parser *parser, ...@@ -3601,12 +3604,12 @@ cp_parser_primary_expression (cp_parser *parser,
case RID_IS_CONVERTIBLE_TO: case RID_IS_CONVERTIBLE_TO:
case RID_IS_EMPTY: case RID_IS_EMPTY:
case RID_IS_ENUM: case RID_IS_ENUM:
case RID_IS_LITERAL_TYPE:
case RID_IS_POD: case RID_IS_POD:
case RID_IS_POLYMORPHIC: case RID_IS_POLYMORPHIC:
case RID_IS_STD_LAYOUT: case RID_IS_STD_LAYOUT:
case RID_IS_TRIVIAL: case RID_IS_TRIVIAL:
case RID_IS_UNION: case RID_IS_UNION:
case RID_IS_LITERAL_TYPE:
return cp_parser_trait_expr (parser, token->keyword); return cp_parser_trait_expr (parser, token->keyword);
/* Objective-C++ expressions. */ /* Objective-C++ expressions. */
......
...@@ -5165,6 +5165,9 @@ trait_expr_value (cp_trait_kind kind, tree type1, tree type2) ...@@ -5165,6 +5165,9 @@ trait_expr_value (cp_trait_kind kind, tree type1, tree type2)
case CPTK_IS_ENUM: case CPTK_IS_ENUM:
return (type_code1 == ENUMERAL_TYPE); return (type_code1 == ENUMERAL_TYPE);
case CPTK_IS_LITERAL_TYPE:
return (literal_type_p (type1));
case CPTK_IS_POD: case CPTK_IS_POD:
return (pod_type_p (type1)); return (pod_type_p (type1));
...@@ -5180,9 +5183,6 @@ trait_expr_value (cp_trait_kind kind, tree type1, tree type2) ...@@ -5180,9 +5183,6 @@ trait_expr_value (cp_trait_kind kind, tree type1, tree type2)
case CPTK_IS_UNION: case CPTK_IS_UNION:
return (type_code1 == UNION_TYPE); return (type_code1 == UNION_TYPE);
case CPTK_IS_LITERAL_TYPE:
return (literal_type_p (type1));
default: default:
gcc_unreachable (); gcc_unreachable ();
return false; return false;
...@@ -5227,11 +5227,11 @@ finish_trait_expr (cp_trait_kind kind, tree type1, tree type2) ...@@ -5227,11 +5227,11 @@ finish_trait_expr (cp_trait_kind kind, tree type1, tree type2)
|| kind == CPTK_IS_CONVERTIBLE_TO || kind == CPTK_IS_CONVERTIBLE_TO
|| kind == CPTK_IS_EMPTY || kind == CPTK_IS_EMPTY
|| kind == CPTK_IS_ENUM || kind == CPTK_IS_ENUM
|| kind == CPTK_IS_LITERAL_TYPE
|| kind == CPTK_IS_POD || kind == CPTK_IS_POD
|| kind == CPTK_IS_POLYMORPHIC || kind == CPTK_IS_POLYMORPHIC
|| kind == CPTK_IS_STD_LAYOUT || kind == CPTK_IS_STD_LAYOUT
|| kind == CPTK_IS_TRIVIAL || kind == CPTK_IS_TRIVIAL
|| kind == CPTK_IS_LITERAL_TYPE
|| kind == CPTK_IS_UNION); || kind == CPTK_IS_UNION);
if (kind == CPTK_IS_CONVERTIBLE_TO) if (kind == CPTK_IS_CONVERTIBLE_TO)
...@@ -5271,11 +5271,11 @@ finish_trait_expr (cp_trait_kind kind, tree type1, tree type2) ...@@ -5271,11 +5271,11 @@ finish_trait_expr (cp_trait_kind kind, tree type1, tree type2)
case CPTK_HAS_VIRTUAL_DESTRUCTOR: case CPTK_HAS_VIRTUAL_DESTRUCTOR:
case CPTK_IS_ABSTRACT: case CPTK_IS_ABSTRACT:
case CPTK_IS_EMPTY: case CPTK_IS_EMPTY:
case CPTK_IS_LITERAL_TYPE:
case CPTK_IS_POD: case CPTK_IS_POD:
case CPTK_IS_POLYMORPHIC: case CPTK_IS_POLYMORPHIC:
case CPTK_IS_STD_LAYOUT: case CPTK_IS_STD_LAYOUT:
case CPTK_IS_TRIVIAL: case CPTK_IS_TRIVIAL:
case CPTK_IS_LITERAL_TYPE:
if (!check_trait_type (type1)) if (!check_trait_type (type1))
{ {
error ("incomplete type %qT not allowed", type1); error ("incomplete type %qT not allowed", type1);
......
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