diff options
author | Jakub Jelinek <jakub@redhat.com> | 2016-10-06 23:17:44 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2016-10-06 23:17:44 +0200 |
commit | 342cfb3e736afcc7397b4199a4c96fb602f5d68b (patch) | |
tree | 929fde67393ba802b4a3a959513ec79e9a076407 /gcc/cp/cxx-pretty-print.c | |
parent | 480570898d36d1d8e29d2adb35bc7eb46b876092 (diff) | |
download | gcc-342cfb3e736afcc7397b4199a4c96fb602f5d68b.zip gcc-342cfb3e736afcc7397b4199a4c96fb602f5d68b.tar.gz gcc-342cfb3e736afcc7397b4199a4c96fb602f5d68b.tar.bz2 |
Implement P0258R2 - helper for C++17 std::has_unique_object_representations trait c-family/
Implement P0258R2 - helper for C++17
std::has_unique_object_representations trait
c-family/
* c-common.h (enum rid): Add RID_HAS_UNIQUE_OBJ_REPRESENTATIONS.
* c-common.c (c_common_reswords): Add
__has_unique_object_representations.
cp/
* cp-tree.h (enum cp_trait_kind): Add
CPTK_HAS_UNIQUE_OBJ_REPRESENTATIONS.
(struct lang_type_class): Add unique_obj_representations
and unique_obj_representations_set bitfields.
(CLASSTYPE_UNIQUE_OBJ_REPRESENTATIONS,
CLASSTYPE_UNIQUE_OBJ_REPRESENTATIONS_SET): Define.
(type_has_unique_obj_representations): Declare.
* parser.c (cp_parser_primary_expression): Handle
RID_HAS_UNIQUE_OBJ_REPRESENTATIONS.
(cp_parser_trait_expr): Likewise. Formatting fix.
* semantics.c (trait_expr_value, finish_trait_expr): Handle
CPTK_HAS_UNIQUE_OBJ_REPRESENTATIONS.
* tree.c (type_has_unique_obj_representations): New function.
(record_has_unique_obj_representations): New function.
* cxx-pretty-print.c (pp_cxx_trait_expression): Handle
CPTK_HAS_UNIQUE_OBJ_REPRESENTATIONS.
testsuite/
* g++.dg/cpp1z/has-unique-obj-representations1.C: New test.
* g++.dg/cpp1z/has-unique-obj-representations2.C: New test.
From-SVN: r240843
Diffstat (limited to 'gcc/cp/cxx-pretty-print.c')
-rw-r--r-- | gcc/cp/cxx-pretty-print.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/cp/cxx-pretty-print.c b/gcc/cp/cxx-pretty-print.c index a290c87..68dcf58 100644 --- a/gcc/cp/cxx-pretty-print.c +++ b/gcc/cp/cxx-pretty-print.c @@ -2561,6 +2561,9 @@ pp_cxx_trait_expression (cxx_pretty_printer *pp, tree t) case CPTK_HAS_TRIVIAL_DESTRUCTOR: pp_cxx_ws_string (pp, "__has_trivial_destructor"); break; + case CPTK_HAS_UNIQUE_OBJ_REPRESENTATIONS: + pp_cxx_ws_string (pp, "__has_unique_object_representations"); + break; case CPTK_HAS_VIRTUAL_DESTRUCTOR: pp_cxx_ws_string (pp, "__has_virtual_destructor"); break; |