2014-09-30 Jason Merrill <jason@redhat.com>
+ * c-common.h (enum rid): Add RID_IS_TRIVIALLY_COPYABLE.
+ * c-common.c (c_common_reswords): Add __is_trivially_copyable.
+
* c-common.h (enum rid): Remove RID_IS_CONVERTIBLE_TO.
* c-common.c (c_common_reswords): Remove __is_convertible_to.
{ "__is_polymorphic", RID_IS_POLYMORPHIC, D_CXXONLY },
{ "__is_standard_layout", RID_IS_STD_LAYOUT, D_CXXONLY },
{ "__is_trivial", RID_IS_TRIVIAL, D_CXXONLY },
+ { "__is_trivially_copyable", RID_IS_TRIVIALLY_COPYABLE, D_CXXONLY },
{ "__is_union", RID_IS_UNION, D_CXXONLY },
{ "__label__", RID_LABEL, 0 },
{ "__null", RID_NULL, 0 },
RID_IS_FINAL, RID_IS_LITERAL_TYPE,
RID_IS_POD, RID_IS_POLYMORPHIC,
RID_IS_STD_LAYOUT, RID_IS_TRIVIAL,
+ RID_IS_TRIVIALLY_COPYABLE,
RID_IS_UNION, RID_UNDERLYING_TYPE,
/* C++11 */
2014-09-30 Jason Merrill <jason@redhat.com>
+ * cp-tree.h (cp_trait_kind): Add CPTK_IS_TRIVIALLY_COPYABLE.
+ * cxx-pretty-print.c (pp_cxx_trait_expression): Likewise.
+ * parser.c (cp_parser_primary_expression): Likewise.
+ (cp_parser_trait_expr): Likewise.
+ * semantics.c (trait_expr_value): Likewise.
+ (finish_trait_expr): Likewise.
+
* method.c (build_stub_object): Use CONVERT_EXPR.
* tree.c (build_dummy_object): Likewise.
(is_dummy_object): Adjust.
CPTK_IS_POLYMORPHIC,
CPTK_IS_STD_LAYOUT,
CPTK_IS_TRIVIAL,
+ CPTK_IS_TRIVIALLY_COPYABLE,
CPTK_IS_UNION,
CPTK_UNDERLYING_TYPE
} cp_trait_kind;
case CPTK_IS_TRIVIAL:
pp_cxx_ws_string (pp, "__is_trivial");
break;
+ case CPTK_IS_TRIVIALLY_COPYABLE:
+ pp_cxx_ws_string (pp, "__is_trivially_copyable");
+ break;
case CPTK_IS_UNION:
pp_cxx_ws_string (pp, "__is_union");
break;
case RID_IS_POLYMORPHIC:
case RID_IS_STD_LAYOUT:
case RID_IS_TRIVIAL:
+ case RID_IS_TRIVIALLY_COPYABLE:
case RID_IS_UNION:
return cp_parser_trait_expr (parser, token->keyword);
case RID_IS_TRIVIAL:
kind = CPTK_IS_TRIVIAL;
break;
+ case RID_IS_TRIVIALLY_COPYABLE:
+ kind = CPTK_IS_TRIVIALLY_COPYABLE;
+ break;
case RID_IS_UNION:
kind = CPTK_IS_UNION;
break;
case CPTK_IS_TRIVIAL:
return (trivial_type_p (type1));
+ case CPTK_IS_TRIVIALLY_COPYABLE:
+ return (trivially_copyable_p (type1));
+
case CPTK_IS_UNION:
return (type_code1 == UNION_TYPE);
case CPTK_IS_POLYMORPHIC:
case CPTK_IS_STD_LAYOUT:
case CPTK_IS_TRIVIAL:
+ case CPTK_IS_TRIVIALLY_COPYABLE:
if (!check_trait_type (type1))
return error_mark_node;
break;