+2014-09-30 Jason Merrill <jason@redhat.com>
+
+ * c-common.h (enum rid): Remove RID_IS_CONVERTIBLE_TO.
+ * c-common.c (c_common_reswords): Remove __is_convertible_to.
+
2014-09-24 Marek Polacek <polacek@redhat.com>
PR c/61405
{ "__is_abstract", RID_IS_ABSTRACT, D_CXXONLY },
{ "__is_base_of", RID_IS_BASE_OF, D_CXXONLY },
{ "__is_class", RID_IS_CLASS, D_CXXONLY },
- { "__is_convertible_to", RID_IS_CONVERTIBLE_TO, D_CXXONLY },
{ "__is_empty", RID_IS_EMPTY, D_CXXONLY },
{ "__is_enum", RID_IS_ENUM, D_CXXONLY },
{ "__is_final", RID_IS_FINAL, D_CXXONLY },
RID_HAS_TRIVIAL_CONSTRUCTOR, RID_HAS_TRIVIAL_COPY,
RID_HAS_TRIVIAL_DESTRUCTOR, RID_HAS_VIRTUAL_DESTRUCTOR,
RID_IS_ABSTRACT, RID_IS_BASE_OF,
- RID_IS_CLASS, RID_IS_CONVERTIBLE_TO,
+ RID_IS_CLASS,
RID_IS_EMPTY, RID_IS_ENUM,
RID_IS_FINAL, RID_IS_LITERAL_TYPE,
RID_IS_POD, RID_IS_POLYMORPHIC,
+2014-09-30 Jason Merrill <jason@redhat.com>
+
+ * cp-tree.h (cp_trait_kind): Remove CPTK_IS_CONVERTIBLE_TO.
+ * cxx-pretty-print.c (pp_cxx_trait_expression): Likewise.
+ * semantics.c (trait_expr_value): Likewise.
+ (finish_trait_expr): Likewise.
+ * parser.c (cp_parser_primary_expression): Likewise.
+ (cp_parser_trait_expr): Likewise. Remove redundant grokdeclarator.
+
2014-09-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c++/16564
is applied. */
DEFTREECODE (UNARY_PLUS_EXPR, "unary_plus_expr", tcc_unary, 1)
-/** C++0x extensions. */
+/** C++11 extensions. */
-/* A static assertion. This is a C++0x extension.
+/* A static assertion. This is a C++11 extension.
STATIC_ASSERT_CONDITION contains the condition that is being
checked. STATIC_ASSERT_MESSAGE contains the message (a string
literal) to be displayed if the condition fails to hold. */
CPTK_IS_ABSTRACT,
CPTK_IS_BASE_OF,
CPTK_IS_CLASS,
- CPTK_IS_CONVERTIBLE_TO,
CPTK_IS_EMPTY,
CPTK_IS_ENUM,
CPTK_IS_FINAL,
__is_abstract ( type-id )
__is_base_of ( type-id , type-id )
__is_class ( type-id )
- __is_convertible_to ( type-id , type-id )
__is_empty ( type-id )
__is_enum ( type-id )
__is_literal_type ( type-id )
case CPTK_IS_CLASS:
pp_cxx_ws_string (pp, "__is_class");
break;
- case CPTK_IS_CONVERTIBLE_TO:
- pp_cxx_ws_string (pp, "__is_convertible_to");
- break;
case CPTK_IS_EMPTY:
pp_cxx_ws_string (pp, "__is_empty");
break;
pp_cxx_left_paren (pp);
pp->type_id (TRAIT_EXPR_TYPE1 (t));
- if (kind == CPTK_IS_BASE_OF || kind == CPTK_IS_CONVERTIBLE_TO)
+ if (kind == CPTK_IS_BASE_OF)
{
pp_cxx_separate_with (pp, ',');
pp->type_id (TRAIT_EXPR_TYPE2 (t));
__is_abstract ( type-id )
__is_base_of ( type-id , type-id )
__is_class ( type-id )
- __is_convertible_to ( type-id , type-id )
__is_empty ( type-id )
__is_enum ( type-id )
__is_final ( type-id )
case RID_IS_ABSTRACT:
case RID_IS_BASE_OF:
case RID_IS_CLASS:
- case RID_IS_CONVERTIBLE_TO:
case RID_IS_EMPTY:
case RID_IS_ENUM:
case RID_IS_FINAL:
cp_trait_kind kind;
tree type1, type2 = NULL_TREE;
bool binary = false;
- cp_decl_specifier_seq decl_specs;
switch (keyword)
{
case RID_IS_CLASS:
kind = CPTK_IS_CLASS;
break;
- case RID_IS_CONVERTIBLE_TO:
- kind = CPTK_IS_CONVERTIBLE_TO;
- binary = true;
- break;
case RID_IS_EMPTY:
kind = CPTK_IS_EMPTY;
break;
if (type1 == error_mark_node)
return error_mark_node;
- /* Build a trivial decl-specifier-seq. */
- clear_decl_specs (&decl_specs);
- decl_specs.type = type1;
-
- /* Call grokdeclarator to figure out what type this is. */
- type1 = grokdeclarator (NULL, &decl_specs, TYPENAME,
- /*initialized=*/0, /*attrlist=*/NULL);
-
if (binary)
{
cp_parser_require (parser, CPP_COMMA, RT_COMMA);
if (type2 == error_mark_node)
return error_mark_node;
-
- /* Build a trivial decl-specifier-seq. */
- clear_decl_specs (&decl_specs);
- decl_specs.type = type2;
-
- /* Call grokdeclarator to figure out what type this is. */
- type2 = grokdeclarator (NULL, &decl_specs, TYPENAME,
- /*initialized=*/0, /*attrlist=*/NULL);
}
cp_parser_require (parser, CPP_CLOSE_PAREN, RT_CLOSE_PAREN);
case CPTK_IS_CLASS:
return (NON_UNION_CLASS_TYPE_P (type1));
- case CPTK_IS_CONVERTIBLE_TO:
- /* TODO */
- return false;
-
case CPTK_IS_EMPTY:
return (NON_UNION_CLASS_TYPE_P (type1) && CLASSTYPE_EMPTY_P (type1));
tree
finish_trait_expr (cp_trait_kind kind, tree type1, tree type2)
{
- gcc_assert (kind == CPTK_HAS_NOTHROW_ASSIGN
- || kind == CPTK_HAS_NOTHROW_CONSTRUCTOR
- || kind == CPTK_HAS_NOTHROW_COPY
- || kind == CPTK_HAS_TRIVIAL_ASSIGN
- || kind == CPTK_HAS_TRIVIAL_CONSTRUCTOR
- || kind == CPTK_HAS_TRIVIAL_COPY
- || kind == CPTK_HAS_TRIVIAL_DESTRUCTOR
- || kind == CPTK_HAS_VIRTUAL_DESTRUCTOR
- || kind == CPTK_IS_ABSTRACT
- || kind == CPTK_IS_BASE_OF
- || kind == CPTK_IS_CLASS
- || kind == CPTK_IS_CONVERTIBLE_TO
- || kind == CPTK_IS_EMPTY
- || kind == CPTK_IS_ENUM
- || kind == CPTK_IS_FINAL
- || kind == CPTK_IS_LITERAL_TYPE
- || kind == CPTK_IS_POD
- || kind == CPTK_IS_POLYMORPHIC
- || kind == CPTK_IS_STD_LAYOUT
- || kind == CPTK_IS_TRIVIAL
- || kind == CPTK_IS_UNION);
-
- if (kind == CPTK_IS_CONVERTIBLE_TO)
- {
- sorry ("__is_convertible_to");
- return error_mark_node;
- }
-
if (type1 == error_mark_node
- || ((kind == CPTK_IS_BASE_OF || kind == CPTK_IS_CONVERTIBLE_TO)
+ || ((kind == CPTK_IS_BASE_OF)
&& type2 == error_mark_node))
return error_mark_node;
case CPTK_IS_UNION:
break;
- case CPTK_IS_CONVERTIBLE_TO:
default:
gcc_unreachable ();
}
__is_abstract(int)(); // { dg-error "'__is_abstract\\(int\\)' cannot be used" }
__is_base_of(int, float)(); // { dg-error "'__is_base_of\\(int, float\\)' cannot be used" }
__is_class(int)(); // { dg-error "'__is_class\\(int\\)' cannot be used" }
- __is_convertible_to(int, float)(); // { dg-message "unimplemented" }
__is_empty(int)(); // { dg-error "'__is_empty\\(int\\)' cannot be used" }
__is_enum(int)(); // { dg-error "'__is_enum\\(int\\)' cannot be used" }
__is_pod(int)(); // { dg-error "'__is_pod\\(int\\)' cannot be used" }