OSDN Git Service

cp/
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 5 Oct 2012 19:30:39 +0000 (19:30 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 5 Oct 2012 19:30:39 +0000 (19:30 +0000)
commit121296eee0b21d064dffa3c77bcc96caf5571701
treecdaa38c550b113c61c8a82ec24f6b0febfad9e1d
parent896972cc51c03770b6445399a44f9549c1a6bdea
cp/
* cp-tree.h (SIZEOF_EXPR_TYPE_P): Define.
* tree.c (cp_tree_equal): Handle SIZEOF_EXPR with
SIZEOF_EXPR_TYPE_P.
* mangle.c (write_expression): Likewise.
* cxx-pretty-print.c (pp_cxx_unary_expression): Likewise.
* error.c (dump_expr): Likewise.
* parser.c (cp_parser_unary_expression): For sizeof call
cxx_sizeof_or_alignof_{type,expr} just for diagnostics and
return SIZEOF_EXPR with the operand.
* pt.c (tsubst_copy, tsubst_copy_and_build): For SIZEOF_EXPR,
call cxx_sizeof_or_alignof_{type,expr} for diagnostics, but
return SIZEOF_EXPR with tsubsted operand.
(value_dependent_expression_p): Handle SIZEOF_EXPR with
SIZEOF_EXPR_TYPE_P.
(instantiation_dependent_r): Likewise.
* call.c (null_ptr_cst_p): Call maybe_constant_value for C++98.
* semantics.c (finish_call_expr): Call
sizeof_pointer_memaccess_warning if needed.
(cxx_eval_constant_expression): Handle SIZEOF_EXPR.
(potential_constant_expression_1): Remove early exit for
C++98.  Handle PROPERTY_REF.
* decl.c (duplicate_decls): When redeclaring a builtin function,
keep the merged decl builtin also if newdecl is a gnu_inline
inline definition.
(fold_sizeof_expr_r): New function.
(compute_array_index_type): Fold SIZEOF_EXPRs in itype.
* cp-gimplify.c (cp_genericize_r): Fold SIZEOF_EXPR.
* typeck.c (cp_build_binary_op): For warn_for_sign_compare
try harder using maybe_constant_value to get INTEGER_CSTs.

* decl.c (stabilize_vla_size): Call pointer_set_destroy
at the end.
testsuite/
* g++.dg/torture/Wsizeof-pointer-memaccess1.C: New test.
* g++.dg/torture/Wsizeof-pointer-memaccess2.C: New test.
* g++.dg/warn/Wsign-compare-5.C: New test.
* g++.dg/warn/Wsizeof-pointer-memaccess-1.C: New test.
* g++.dg/warn/Wnull-conversion-1.C: For c++11 add dg-error.
* g++.dg/ext/builtin30.C: New test.
* g++.dg/ext/vla12.C: New test.
* gcc.dg/builtins-85.c: New test.
libstdc++-v3/
* testsuite/20_util/shared_ptr/cons/43820_neg.cc: Adjust line
numbers.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@192141 138bc75d-0d04-0410-961f-82ee72b054a4
24 files changed:
gcc/cp/ChangeLog
gcc/cp/call.c
gcc/cp/cp-gimplify.c
gcc/cp/cp-tree.h
gcc/cp/cxx-pretty-print.c
gcc/cp/decl.c
gcc/cp/error.c
gcc/cp/mangle.c
gcc/cp/parser.c
gcc/cp/pt.c
gcc/cp/semantics.c
gcc/cp/tree.c
gcc/cp/typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ext/builtin30.C [new file with mode: 0644]
gcc/testsuite/g++.dg/ext/vla12.C [new file with mode: 0644]
gcc/testsuite/g++.dg/torture/Wsizeof-pointer-memaccess1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/torture/Wsizeof-pointer-memaccess2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/warn/Wnull-conversion-1.C
gcc/testsuite/g++.dg/warn/Wsign-compare-5.C [new file with mode: 0644]
gcc/testsuite/g++.dg/warn/Wsizeof-pointer-memaccess-1.C [new file with mode: 0644]
gcc/testsuite/gcc.dg/builtins-85.c [new file with mode: 0644]
libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/20_util/shared_ptr/cons/43820_neg.cc