]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/cp/semantics.c
call.c (null_ptr_cst_p): Use maybe_constant_value.
authorJason Merrill <jason@gcc.gnu.org>
Tue, 2 Nov 2010 01:31:18 +0000 (21:31 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 2 Nov 2010 01:31:18 +0000 (21:31 -0400)
commitfa2200cbb1ef5a6a7bdb9a5ba708c7400eb6b404
tree6c2db2fc090bec484b5ef60fbe416d72e1c7b6a4
parentc41095db2f17d8e8695bfab2a582b8f99639633f
call.c (null_ptr_cst_p): Use maybe_constant_value.

* call.c (null_ptr_cst_p): Use maybe_constant_value.
(set_up_extended_ref_temp): Support constant initialization.
(initialize_reference): Adjust.
* class.c (check_bitfield_decl): Use cxx_constant_value.
* cvt.c (ocp_convert): Don't use integral_constant_value when
converting to class type.
* decl.c (finish_case_label): Use maybe_constant_value.
(build_init_list_var_init): Support constant initialization.
(check_initializer): Likewise.  Reorganize.
(cp_finish_decl): Likewise.
(expand_static_init): Likewise.
(compute_array_index_type): Use maybe_constant_value.
Add complain parm.
(create_array_type_for_decl, grokdeclarator): Pass it.
(build_enumerator): Use cxx_constant_value.
* decl2.c (grokfield): Use maybe_constant_init.
* except.c (check_noexcept_r): Handle constexpr.
(build_noexcept_spec): Use maybe_constant_value.
* init.c (expand_default_init): Support constant initialization.
(build_vec_init): Likewise.
(constant_value_1): Adjust.
(build_new_1): Adjust.
* parser.c (cp_parser_constant_expression): Allow non-integral
in C++0x mode.
(cp_parser_direct_declarator): Don't fold yet in C++0x mode.
(cp_parser_initializer_clause): Toss folded result if non-constant.
* pt.c (fold_decl_constant_value): Remove.
(convert_nontype_argument): Use maybe_constant_value.  Give clearer
error about overflow.
(tsubst): Move array bounds handling into compute_array_index_type.
(value_dependent_expression_p): Handle constant CALL_EXPR.
* semantics.c (finish_static_assert): Use maybe_constant_value.
(ensure_literal_type_for_constexpr_object): Make sure type is complete.
(potential_constant_expression): Use maybe_constant_value.
* tree.c (cast_valid_in_integral_constant_expression_p): Any cast
is potentially valid in C++0x.
* typeck2.c (store_init_value): Handle constant init.
(check_narrowing): Use maybe_constant_value.
(build_functional_cast): Set TREE_CONSTANT on literal T().
* cp-tree.h (DECL_INTEGRAL_CONSTANT_VAR_P): Remove.
(LOOKUP_ALREADY_DIGESTED): New.
(compute_array_index_type): Adjust prototype.

From-SVN: r166167
94 files changed:
gcc/cp/ChangeLog
gcc/cp/call.c
gcc/cp/class.c
gcc/cp/cp-tree.h
gcc/cp/cvt.c
gcc/cp/decl.c
gcc/cp/decl2.c
gcc/cp/except.c
gcc/cp/init.c
gcc/cp/parser.c
gcc/cp/pt.c
gcc/cp/rtti.c
gcc/cp/semantics.c
gcc/cp/tree.c
gcc/cp/typeck.c
gcc/cp/typeck2.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/constexpr-array-ptr.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-array-ptr2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-array-ptr3.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-array-ptr4.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-array-ptr5.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-array-ptr6.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-array.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-base.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-complex.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-data1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-data2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-deref.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-diag1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-eh-spec.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-ellipsis.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-ellipsis2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-empty.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-empty2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-empty3.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-empty4.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-empty5.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-ex1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-ex2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-ex3.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-ex4.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-explicit-inst.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-fnptr.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-function1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-function2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-function3.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-ice.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-initlist.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-neg1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-noexcept.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-noexcept2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-noexcept3.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-noexcept4.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-non-const-arg.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-nonlit.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-nonlit2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-nullptr.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-object1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-object2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-overflow.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-pedantic.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-pos1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-potential1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-ptrmem.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-pure.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-static.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-static2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-static3.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-static4.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-static5.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-static6.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-string.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-switch.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-targ.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-throw.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-typeid.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-union.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-value.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-value2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-variadic.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/initlist5.C
gcc/testsuite/g++.dg/cpp0x/static_assert3.C
gcc/testsuite/g++.dg/other/fold1.C
gcc/testsuite/g++.dg/parse/constant4.C
gcc/testsuite/g++.dg/parse/crash36.C
gcc/testsuite/g++.dg/template/arg5.C
gcc/testsuite/g++.dg/template/non-dependent10.C
gcc/testsuite/g++.dg/template/qualified-id3.C
gcc/testsuite/g++.dg/warn/overflow-warn-1.C
gcc/testsuite/g++.dg/warn/overflow-warn-3.C
gcc/testsuite/g++.dg/warn/overflow-warn-4.C
gcc/testsuite/g++.old-deja/g++.pt/crash10.C
libstdc++-v3/testsuite/20_util/ratio/cons/cons_overflow_neg.cc