OSDN Git Service

PR libstdc++/37907
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 16 Jul 2009 20:36:10 +0000 (20:36 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 16 Jul 2009 20:36:10 +0000 (20:36 +0000)
commitc1c67b4f5041c4367842002c81ffe912ff97f2d8
tree100c59a1743caa8ea59faa87406fd5f529be94f4
parentf32697329ff3669ae2a16d90bfa4d0ebe53906a4
PR libstdc++/37907
Support std::is_standard_layout and std::is_trivial traits,
change POD to C++0x version (except for layout).
* gcc/c-common.c (c_common_reswords): Add __is_standard_layout
and __is_trivial.
* gcc/c-common.h (enum rid): Add RID_IS_STD_LAYOUT and RID_IS_TRIVIAL.
* gcc/cp/cp-tree.h (enum cp_trait_kind): Add CPTK_IS_STD_LAYOUT,
CPTK_IS_TRIVIAL.
(struct lang_type_class): Add non_std_layout.
(CLASSTYPE_NON_STD_LAYOUT): New.
* gcc/cp/class.c (check_bases): Set it.
(check_field_decls): Likewise.
(check_bases_and_members): Likewise.
* gcc/cp/parser.c (cp_parser_primary_expression): Handle RID_IS_STD_LAYOUT,
RID_IS_TRIVIAL.
(cp_parser_trait_expr): Likewise.
* gcc/cp/semantics.c (trait_expr_value): Handle CPTK_IS_STD_LAYOUT,
CPTK_IS_TRIVIAL.
(finish_trait_expr): Likewise.
* gcc/cp/tree.c (scalarish_type_p, trivial_type_p, std_layout_type_p): New.
(pod_type_p): Use them.
* gcc/cp/typeck.c (build_class_member_access_expr): Check
CLASSTYPE_NON_STD_LAYOUT rather than CLASSTYPE_NON_POD_P.
* libstdc++-v3/include/std/type_traits: Add is_standard_layout, is_trivial.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149721 138bc75d-0d04-0410-961f-82ee72b054a4
37 files changed:
gcc/ChangeLog
gcc/Makefile.in
gcc/c-common.c
gcc/c-common.h
gcc/cp/ChangeLog
gcc/cp/call.c
gcc/cp/class.c
gcc/cp/cp-tree.h
gcc/cp/cxx-pretty-print.c
gcc/cp/decl.c
gcc/cp/init.c
gcc/cp/parser.c
gcc/cp/semantics.c
gcc/cp/tree.c
gcc/cp/typeck.c
gcc/doc/gcc.texi
gcc/doc/implement-cxx.texi [new file with mode: 0644]
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/std-layout1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/trivial1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/ext/has_nothrow_assign.C
gcc/testsuite/g++.dg/ext/has_nothrow_copy-1.C
gcc/testsuite/g++.dg/ext/has_trivial_assign.C
gcc/testsuite/g++.dg/ext/has_trivial_copy.C
gcc/testsuite/g++.dg/ext/is_pod.C
gcc/testsuite/g++.dg/other/offsetof3.C
gcc/testsuite/g++.dg/overload/ellipsis1.C
gcc/testsuite/g++.dg/warn/var-args1.C
gcc/testsuite/g++.old-deja/g++.brendan/crash63.C
gcc/testsuite/g++.old-deja/g++.brendan/crash64.C
gcc/testsuite/g++.old-deja/g++.brendan/overload8.C
gcc/testsuite/g++.old-deja/g++.other/vaarg3.C
gcc/testsuite/g++.old-deja/g++.pt/vaarg3.C
libstdc++-v3/ChangeLog
libstdc++-v3/include/std/type_traits
libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc
libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc