Implement P0258R2 - helper for C++17
commitadeca879a3ab948fef2c1aa3741ae49cceadae17
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 6 Oct 2016 21:17:44 +0000 (6 21:17 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 6 Oct 2016 21:17:44 +0000 (6 21:17 +0000)
tree929fde67393ba802b4a3a959513ec79e9a076407
parentfefb1a11c80e6292fa0a83eb3bd7b4e039baf0ef
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@240843 138bc75d-0d04-0410-961f-82ee72b054a4
12 files changed:
gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/c-family/c-common.h
gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/cxx-pretty-print.c
gcc/cp/parser.c
gcc/cp/semantics.c
gcc/cp/tree.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp1z/has-unique-obj-representations1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp1z/has-unique-obj-representations2.C [new file with mode: 0644]