[C++ PATCH] some reformatting
[official-gcc.git] / gcc / cp / ChangeLog
blobc1558040baa216febcdf1922363166d2959f64b8
1 2018-01-12  Nathan Sidwell  <nathan@acm.org>
3         * cp-tree.h (mark_rvalue_use): Add parm name.
4         * expr.c (mark_lvalue_use, mark_lvalue_use_nonread): Move next to
5         mark_rvalue_use.
6         * call.c (convert_like_real): Fix formatting.
8 2018-01-11  Jason Merrill  <jason@redhat.com>
10         PR c++/82728 - wrong -Wunused-but-set-variable
11         PR c++/82799
12         PR c++/83690
13         * call.c (perform_implicit_conversion_flags): Call mark_rvalue_use.
14         * decl.c (case_conversion): Likewise.
15         * semantics.c (finish_static_assert): Call
16         perform_implicit_conversion_flags.
18 2018-01-11  Nathan Sidwell  <nathan@acm.org>
20         * method.c (enum mangling_flags): Delete long-dead enum.
22 2018-01-10  Paolo Carlini  <paolo.carlini@oracle.com>
24         * parser.c (cp_parser_std_attribute_spec): When
25         token_pair::require_open / require_close return false simply
26         return error_mark_node, avoid duplicate cp_parser_error about
27         expected '(' / ')', respectively.
29 2018-01-10  David Malcolm  <dmalcolm@redhat.com>
31         PR c++/43486
32         * call.c (null_ptr_cst_p): Strip location wrappers when
33         converting from '0' to a pointer type in C++11 onwards.
34         (conversion_null_warnings): Replace comparison with null_node with
35         call to null_node_p.
36         (build_over_call): Likewise.
37         * cp-gimplify.c (cp_fold): Remove the early bailout when
38         processing_template_decl.
39         * cp-lang.c (selftest::run_cp_tests): Call
40         selftest::cp_pt_c_tests and selftest::cp_tree_c_tests.
41         * cp-tree.h (cp_expr::maybe_add_location_wrapper): New method.
42         (selftest::run_cp_tests): Move decl to bottom of file.
43         (null_node_p): New inline function.
44         (selftest::cp_pt_c_tests): New decl.
45         (selftest::cp_tree_c_tests): New decl.
46         * cvt.c (build_expr_type_conversion): Replace comparison with
47         null_node with call to null_node_p.
48         * error.c (args_to_string): Likewise.
49         * except.c (build_throw): Likewise.
50         * mangle.c (write_expression): Skip location wrapper nodes.
51         * parser.c (literal_integer_zerop): New function.
52         (cp_parser_postfix_expression): Call maybe_add_location_wrapper on
53         the result for RID_TYPEID. Pass true for new "wrap_locations_p"
54         param of cp_parser_parenthesized_expression_list.  When calling
55         warn_for_memset, replace integer_zerop calls with
56         literal_integer_zerop, eliminating the double logical negation
57         cast to bool.  Eliminate the special-casing for CONST_DECL in
58         favor of the fold_for_warn within warn_for_memset.
59         (cp_parser_parenthesized_expression_list): Add "wrap_locations_p"
60         param, defaulting to false.  Convert "expr" to a cp_expr, and call
61         maybe_add_location_wrapper on it when wrap_locations_p is true.
62         (cp_parser_unary_expression): Call maybe_add_location_wrapper on
63         the result for RID_ALIGNOF and RID_SIZEOF.
64         (cp_parser_builtin_offsetof): Likewise.
65         * pt.c: Include "selftest.h".
66         (tsubst_copy): Handle location wrappers.
67         (tsubst_copy_and_build): Likewise.
68         (build_non_dependent_expr): Likewise.
69         (selftest::test_build_non_dependent_expr): New function.
70         (selftest::cp_pt_c_tests): New function.
71         * tree.c: Include "selftest.h".
72         (lvalue_kind): Handle VIEW_CONVERT_EXPR location wrapper nodes.
73         (selftest::test_lvalue_kind): New function.
74         (selftest::cp_tree_c_tests): New function.
75         * typeck.c (string_conv_p): Strip any location wrapper from "exp".
76         (cp_build_binary_op): Replace comparison with null_node with call
77         to null_node_p.
78         (build_address): Use location of operand when building address
79         expression.
81 2018-01-10  Marek Polacek  <polacek@redhat.com>
83         PR c++/82541
84         * call.c (build_conditional_expr_1): Check complain before warning.
85         * pt.c (tsubst_copy_and_build) <case COND_EXPR>: Suppress
86         -Wduplicated-branches.
88 2018-01-10  Jakub Jelinek  <jakub@redhat.com>
90         PR c++/81327
91         * call.c (maybe_warn_class_memaccess): Add forward declaration.
92         Change last argument from tree * to const vec<tree, va_gc> *, adjust
93         args uses and check number of operands too.  Don't strip away any
94         nops.  Use maybe_constant_value when looking for INTEGER_CST args.
95         Deal with src argument not having pointer type.  Check
96         tree_fits_uhwi_p before calling tree_to_uhwi.  Remove useless
97         test.
98         (build_over_call): Call maybe_warn_class_memaccess here on the
99         original arguments.
100         (build_cxx_call): Rather than here on converted arguments.
102 2018-01-10  Paolo Carlini  <paolo.carlini@oracle.com>
104         PR c++/81055
105         * init.c (build_vec_init): Avoid building an INIT_EXPR with
106         error_mark_node as second argument.
108 2018-01-09  Jakub Jelinek  <jakub@redhat.com>
110         PR c++/83734
111         * constexpr.c (cxx_eval_statement_list): Ignore DEBUG_BEGIN_STMTs
112         in STATEMENT_LIST.  Remove unneeded assert.
114 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
115             Alan Hayward  <alan.hayward@arm.com>
116             David Sherwood  <david.sherwood@arm.com>
118         * constexpr.c (cxx_eval_array_reference): Handle polynomial
119         VECTOR_CST_NELTS.
120         (cxx_fold_indirect_ref): Handle polynomial TYPE_VECTOR_SUBPARTS.
121         * call.c (build_conditional_expr_1): Likewise.
122         * decl.c (cp_finish_decomp): Likewise.
123         * mangle.c (write_type): Likewise.
124         * typeck.c (structural_comptypes): Likewise.
125         (cp_build_binary_op): Likewise.
126         * typeck2.c (process_init_constructor_array): Likewise.
128 2018-01-03  Jakub Jelinek  <jakub@redhat.com>
130         PR c++/83555
131         * typeck.c (build_static_cast_1): For static casts to reference types,
132         call build_base_path with flag_delete_null_pointer_checks as nonnull
133         instead of always false.  When -fsanitize=null, call
134         ubsan_maybe_instrument_reference on the NULL reference INTEGER_CST.
135         * cp-gimplify.c (cp_genericize_r): Don't walk subtrees of UBSAN_NULL
136         call if the first argument is INTEGER_CST with REFERENCE_TYPE.
138 2018-01-03  Nathan Sidwell  <nathan@acm.org>
140         PR c++/83667
141         * method.c (make_alias_for): Copy DECL_CONTEXT.
143 2018-01-03  Marek Polacek  <polacek@redhat.com>
145         PR c++/83592
146         * decl.c (grokdeclarator): Don't warn about MVP in typename context.
148 2018-01-03  Jakub Jelinek  <jakub@redhat.com>
150         PR preprocessor/83602
151         * name-lookup.c (lookup_name_fuzzy): Don't use macro_use_before_def
152         for builtin macros.
154         PR c++/83634
155         * cp-gimplify.c (cp_fold) <case NOP_EXPR>: If the operand folds to
156         error_mark_node, return error_mark_node.
158         Update copyright years.
160 2018-01-02  Jakub Jelinek  <jakub@redhat.com>
162         PR c++/83556
163         * tree.c (replace_placeholders_r): Pass NULL as last argument to
164         cp_walk_tree instead of d->pset.  If non-TREE_CONSTANT and
165         non-PLACEHOLDER_EXPR tree has been seen already, set *walk_subtrees
166         to false and return.
167         (replace_placeholders): Pass NULL instead of &pset as last argument
168         to cp_walk_tree.
170 2018-01-02  Nathan Sidwell  <nathan@acm.org>
172         * constexpr.c (cxx_bind_parameters_in_call): Remove unneeded local
173         lval var.
175 Copyright (C) 2018 Free Software Foundation, Inc.
177 Copying and distribution of this file, with or without modification,
178 are permitted in any medium without royalty provided the copyright
179 notice and this notice are preserved.