mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-23 14:21:20 +08:00
c-common.h (enum rid): Remove RID_IS_CONVERTIBLE_TO.
c-family/ * c-common.h (enum rid): Remove RID_IS_CONVERTIBLE_TO. * c-common.c (c_common_reswords): Remove __is_convertible_to. cp/ * 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. From-SVN: r215735
This commit is contained in:
parent
00b365d580
commit
8d0cf15e1c
gcc
c-family
cp
testsuite/g++.dg/ext
@ -1,3 +1,8 @@
|
||||
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
|
||||
|
@ -472,7 +472,6 @@ const struct c_common_resword c_common_reswords[] =
|
||||
{ "__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 },
|
||||
|
@ -138,7 +138,7 @@ enum rid
|
||||
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,
|
||||
|
@ -1,3 +1,12 @@
|
||||
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
|
||||
|
@ -354,9 +354,9 @@ DEFTREECODE (STMT_EXPR, "stmt_expr", tcc_expression, 1)
|
||||
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. */
|
||||
|
@ -645,7 +645,6 @@ typedef enum cp_trait_kind
|
||||
CPTK_IS_ABSTRACT,
|
||||
CPTK_IS_BASE_OF,
|
||||
CPTK_IS_CLASS,
|
||||
CPTK_IS_CONVERTIBLE_TO,
|
||||
CPTK_IS_EMPTY,
|
||||
CPTK_IS_ENUM,
|
||||
CPTK_IS_FINAL,
|
||||
|
@ -388,7 +388,6 @@ pp_cxx_userdef_literal (cxx_pretty_printer *pp, tree 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_literal_type ( type-id )
|
||||
@ -2373,9 +2372,6 @@ pp_cxx_trait_expression (cxx_pretty_printer *pp, tree t)
|
||||
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;
|
||||
@ -2411,7 +2407,7 @@ pp_cxx_trait_expression (cxx_pretty_printer *pp, tree t)
|
||||
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));
|
||||
|
@ -4134,7 +4134,6 @@ complain_flags (bool decltype_p)
|
||||
__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 )
|
||||
@ -4483,7 +4482,6 @@ cp_parser_primary_expression (cp_parser *parser,
|
||||
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:
|
||||
@ -8665,7 +8663,6 @@ cp_parser_trait_expr (cp_parser* parser, enum rid keyword)
|
||||
cp_trait_kind kind;
|
||||
tree type1, type2 = NULL_TREE;
|
||||
bool binary = false;
|
||||
cp_decl_specifier_seq decl_specs;
|
||||
|
||||
switch (keyword)
|
||||
{
|
||||
@ -8703,10 +8700,6 @@ cp_parser_trait_expr (cp_parser* parser, enum rid 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;
|
||||
@ -8757,14 +8750,6 @@ cp_parser_trait_expr (cp_parser* parser, enum rid keyword)
|
||||
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);
|
||||
@ -8773,14 +8758,6 @@ cp_parser_trait_expr (cp_parser* parser, enum rid keyword)
|
||||
|
||||
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);
|
||||
|
@ -7355,10 +7355,6 @@ trait_expr_value (cp_trait_kind kind, tree type1, tree type2)
|
||||
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));
|
||||
|
||||
@ -7413,36 +7409,8 @@ check_trait_type (tree type)
|
||||
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;
|
||||
|
||||
@ -7491,7 +7459,6 @@ finish_trait_expr (cp_trait_kind kind, tree type1, tree type2)
|
||||
case CPTK_IS_UNION:
|
||||
break;
|
||||
|
||||
case CPTK_IS_CONVERTIBLE_TO:
|
||||
default:
|
||||
gcc_unreachable ();
|
||||
}
|
||||
|
@ -13,7 +13,6 @@ template<int> void foo()
|
||||
__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" }
|
||||
|
Loading…
x
Reference in New Issue
Block a user