OSDN Git Service

gcc/
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 30 Mar 2007 19:45:57 +0000 (19:45 +0000)
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 30 Mar 2007 19:45:57 +0000 (19:45 +0000)
commit481451ebcb64d06deb93b3acad2867932a776443
tree63250c95176e6d94178beae6b2735b398dfbfec1
parente1caca42389dcda67573909d11298755fbab833c
gcc/
2007-03-30  Paolo Carlini  <pcarlini@suse.de>

PR c++/26099
* c-common.h (enum rid): Add RID_HAS_NOTHROW_ASSIGN,
RID_HAS_NOTHROW_CONSTRUCTOR, RID_HAS_NOTHROW_COPY,
RID_HAS_TRIVIAL_ASSIGN, 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_CONVERTIBLE_TO, RID_IS_CLASS, RID_IS_EMPTY, RID_IS_ENUM,
RID_IS_POD, RID_IS_POLYMORPHIC, RID_IS_UNION, as
C++ extensions.
* doc/extend.texi (Extensions to the C++ Language): Add Type Traits.

gcc/cp/
2007-03-30  Paolo Carlini  <pcarlini@suse.de>

PR c++/26099
* cp-tree.h (enum cp_trait_kind, struct tree_trait_expr,
TRAIT_EXPR_TYPE1, TRAIT_EXPR_TYPE2, TRAIT_EXPR_KIND): Add.
(enum cp_tree_node_structure_enum, union lang_tree_node): Update.
(CLASS_TYPE_NON_UNION_P): Add.
(struct lang_type_class): Add has_complex_dflt.
(TYPE_HAS_COMPLEX_DFLT, TYPE_HAS_TRIVIAL_DFLT): Add.
(locate_copy, locate_ctor, locate_dtor, finish_trait_expr): Declare.
* cp-tree.def: Add TRAIT_EXPR.
* cp-objcp-common.c (cp_tree_size): Add TRAIT_EXPR case.
* lex.c (struct resword): Add __has_nothrow_assign,
__has_nothrow_constructor, __has_nothrow_copy, __has_trivial_assign,
__has_trivial_constructor, __has_trivial_copy,
__has_trivial_destructor, __has_virtual_destructor, __is_abstract,
__is_base_of, __is_class, __is_convertible_to, __is_empty, __is_enum,
__is_pod, __is_polymorphic, __is_union.
* parser.c (cp_parser_primary_expression): Deal with the new RIDs.
(cp_parser_trait_expr): New.
* semantics.c (finish_trait_expr, trait_expr_value
classtype_has_nothrow_copy_or_assign_p): New.
* method.c (locate_copy, locate_ctor, locate_dtor): Do not define
as static.
* decl.c (cp_tree_node_structure): Add TRAIT_EXPR.
* class.c (check_bases, check_field_decl, check_bases_and_members):
Deal with TYPE_HAS_COMPLEX_DFLT (t) too.
* pt.c (uses_template_parms, tsubst_copy_and_build,
value_dependent_expression_p, type_dependent_expression_p): Deal with
TRAIT_EXPR.
* tree.c (cp_walk_subtrees): Deal with TRAIT_EXPR.

gcc/testsuite/
2007-03-30  Paolo Carlini  <pcarlini@suse.de>

PR c++/26099
* g++.dg/ext/is_base_of.C: New.
* g++.dg/ext/has_virtual_destructor.C: New.
* g++.dg/ext/is_polymorphic.C: New.
* g++.dg/ext/is_base_of_diagnostic.C: New.
* g++.dg/ext/is_enum.C: New.
* g++.dg/ext/has_nothrow_assign.C: New.
* g++.dg/ext/has_nothrow_constructor.C: New.
* g++.dg/ext/is_empty.C: New.
* g++.dg/ext/has_trivial_copy.C: New.
* g++.dg/ext/has_trivial_assign.C: New.
* g++.dg/ext/is_abstract.C: New.
* g++.dg/ext/is_pod.C: New.
* g++.dg/ext/has_nothrow_copy.C: New.
* g++.dg/ext/is_class.C: New.
* g++.dg/ext/has_trivial_constructor.C: New.
* g++.dg/ext/is_union.C: New.
* g++.dg/ext/has_trivial_destructor.C: New.
* g++.dg/tree-ssa/pr22444.C: Adjust, avoid __is_pod.
* g++.dg/template/crash43.C: Likewise.

libstdc++-v3/
2007-03-30  Paolo Carlini  <pcarlini@suse.de>

PR c++/26099
* include/bits/cpp_type_traits.h (struct __is_pod, struct __is_empty):
Remove.
* include/bits/valarray_array.h: Adjust.
* include/bits/allocator.h: Likewise.
* include/bits/stl_tree.h: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@123366 138bc75d-0d04-0410-961f-82ee72b054a4
40 files changed:
gcc/ChangeLog
gcc/c-common.h
gcc/cp/ChangeLog
gcc/cp/class.c
gcc/cp/cp-objcp-common.c
gcc/cp/cp-tree.def
gcc/cp/cp-tree.h
gcc/cp/decl.c
gcc/cp/lex.c
gcc/cp/method.c
gcc/cp/parser.c
gcc/cp/pt.c
gcc/cp/semantics.c
gcc/cp/tree.c
gcc/doc/extend.texi
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ext/has_nothrow_assign.C [new file with mode: 0644]
gcc/testsuite/g++.dg/ext/has_nothrow_constructor.C [new file with mode: 0644]
gcc/testsuite/g++.dg/ext/has_nothrow_copy.C [new file with mode: 0644]
gcc/testsuite/g++.dg/ext/has_trivial_assign.C [new file with mode: 0644]
gcc/testsuite/g++.dg/ext/has_trivial_constructor.C [new file with mode: 0644]
gcc/testsuite/g++.dg/ext/has_trivial_copy.C [new file with mode: 0644]
gcc/testsuite/g++.dg/ext/has_trivial_destructor.C [new file with mode: 0644]
gcc/testsuite/g++.dg/ext/has_virtual_destructor.C [new file with mode: 0644]
gcc/testsuite/g++.dg/ext/is_abstract.C [new file with mode: 0644]
gcc/testsuite/g++.dg/ext/is_base_of.C [new file with mode: 0644]
gcc/testsuite/g++.dg/ext/is_base_of_diagnostic.C [new file with mode: 0644]
gcc/testsuite/g++.dg/ext/is_class.C [new file with mode: 0644]
gcc/testsuite/g++.dg/ext/is_empty.C [new file with mode: 0644]
gcc/testsuite/g++.dg/ext/is_enum.C [new file with mode: 0644]
gcc/testsuite/g++.dg/ext/is_pod.C [new file with mode: 0644]
gcc/testsuite/g++.dg/ext/is_polymorphic.C [new file with mode: 0644]
gcc/testsuite/g++.dg/ext/is_union.C [new file with mode: 0644]
gcc/testsuite/g++.dg/template/crash43.C
gcc/testsuite/g++.dg/tree-ssa/pr22444.C
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/allocator.h
libstdc++-v3/include/bits/cpp_type_traits.h
libstdc++-v3/include/bits/stl_tree.h
libstdc++-v3/include/bits/valarray_array.h