aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/ChangeLog
blob: 90e8ff18203284ec04f94cf0843a86944b0a591b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
2018-01-29  Jason Merrill  <jason@redhat.com>

	PR c++/83942 - wrong unused warning with static_cast.
	* cvt.c (ocp_convert): Call mark_rvalue_use.

2018-01-26  Jason Merrill  <jason@redhat.com>

	PR c++/83956 - wrong dtor error with anonymous union
	* method.c (walk_field_subobs): Variant members only affect
	deletedness.
	(maybe_explain_implicit_delete): Pass &deleted_p for diagnostic.

	PR c++/84036 - ICE with variadic capture.
	PR c++/82249
	* pt.c (tsubst_pack_expansion): When optimizing a simple
	substitution, pull a single pack expansion out of its pack.

	PR c++/82514 - ICE with local class in generic lambda.
	* pt.c (regenerated_lambda_fn_p): Remove.
	(enclosing_instantiation_of): Don't use it.
	(tsubst_function_decl): Call enclosing_instantiation_of.

	* pt.c (lookup_template_class_1): Add sanity check.
	* name-lookup.c (do_pushtag): Don't add closures to local_classes.

2018-01-25  Jakub Jelinek  <jakub@redhat.com>

	PR c++/84031
	* decl.c (find_decomp_class_base): Ignore unnamed bitfields.  Ignore
	recursive calls that return ret.
	(cp_finish_decomp): Ignore unnamed bitfields.

2018-01-23  Jason Merrill  <jason@redhat.com>

	PR c++/82249 - wrong mismatched pack length error.
	* pt.c (extract_fnparm_pack, tsubst_pack_expansion): Handle
	unsubstituted function parameter pack.

2018-01-23  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/83921
	* decl.c (check_for_uninitialized_const_var): Not static; add
	bool and tsubst_flags_t parameters; adjust to be used both in
	constexpr context and not.
	* constexpr.c (potential_constant_expression_1): Use the above.
	* cp-tree.h (check_for_uninitialized_const_var): Declare.

2018-01-23  Jason Merrill  <jason@redhat.com>

	PR c++/83947 - ICE with auto declarations.
	* pt.c (do_auto_deduction): Don't deduce from an auto decl.
	* decl.c (undeduced_auto_decl): Limit to vars and fns.

2018-01-23  David Malcolm  <dmalcolm@redhat.com>

	PR c++/83974
	* pt.c (tsubst_copy_and_build) <CONSTRUCTOR>: Remove early bailout
	for pointer to member function types.

2018-01-23  Jakub Jelinek  <jakub@redhat.com>

	PR sanitizer/83987
	* tree.c (cp_free_lang_data): Change DECL_VALUE_EXPR of
	DECL_OMP_PRIVATIZED_MEMBER vars to error_mark_node.

2018-01-23  Nathan Sidwell  <nathan@acm.org>

	PR c++/83988
	* pt.c (tsubst_baselink): Remove optype assert.
	* ptree.c (cxx_print_xnode): <case BASELINK> Print BASELINK_OPTYPE.

2018-01-23  Jakub Jelinek  <jakub@redhat.com>

	PR c++/83958
	* decl.c (cp_finish_decomp): Diagnose if reference structure binding
	refers to incomplete type.

2018-01-23  Nathan Sidwell  <nathan@acm.org>

	Deprecate ARM-era for scope handling
	* decl.c (poplevel): Flag_new_for_scope is a boolean-like.
	(cxx_init_decl_processing): Deprecate flag_new_for_scope being
	cleared.
	* name-lookup.c (check_for_out_of_scope_variable): Deprecate and
	cleanup handling.
	* semantics.c (begin_for_scope): Flag_new_for_scope is
	boolean-like.
	(finish_for_stmt, begin_range_for_stmt): Likewise.

2018-01-22  Jason Merrill  <jason@redhat.com>

	PR c++/83720
	* decl2.c (determine_visibility): Fix template_decl handling
	instead of blocking it.

	PR c++/83720 - ICE with lambda and LTO.
	* decl2.c (determine_visibility): Clear template_decl for
	function-scope decls.  Propagate anonymous linkage from containing
	function.

2018-01-22  Marek Polacek  <polacek@redhat.com>

	PR c++/81933
	* typeck2.c (split_nonconstant_init_1): Return false if we didn't
	split out anything.

2018-01-22  Ville Voutilainen  <ville.voutilainen@gmail.com>

	PR c++/83895
	* decl.c (grokdeclarator): Don't diagnose extra parens
	on typedefs.

2018-01-19  Jakub Jelinek  <jakub@redhat.com>

	PR c++/81167
	* call.c (joust): Use TREE_TYPE (source) if source is
	a POINTER_TYPE_P rather than if ! DECL_CONSTRUCTOR_P (w->fn).

	PR c++/83919
	* typeck.c (convert_for_assignment): Suppress warn_ignored_qualifiers
	for direct enum init.
	* decl.c (reshape_init): Likewise.

2018-01-19  Marek Polacek  <polacek@redhat.com>

	* constexpr.c (fold_simple): Simplify.

2018-01-18  Jason Merrill  <jason@redhat.com>

	PR c++/83714
	* search.c (any_dependent_bases_p): Handle null TREE_BINFO.
	* pt.c (instantiation_dependent_scope_ref_p): True if
	any_dependent_bases_p.

2018-01-18  Paolo Carlini  <paolo.carlini@oracle.com>

	* cp-tree.h: Fix comment typo (DECL_NON_TRIVIALLY_INITIALIZED_P
	vs DECL_NONTRIVIALLY_INITIALIZED_P).

2018-01-18  Jason Merrill  <jason@redhat.com>

	PR c++/82461 - constexpr list-initialized member
	* constexpr.c (potential_constant_expression_1): Check
	TARGET_EXPR_DIRECT_INIT_P.

2018-01-18  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/81013
	* decl.c (xref_basetypes): Early return upon error about derived
	union.

2018-01-18  Nathan Sidwell  <nathan@acm.org>

	PR c++/83160
	* cp-tree.h (mark_use): Declare.
	* expr.c (mark_use): Make extern.
	* call.c (direct_reference_binding): Set inner conv's
	rvaluedness_matches_p, if it is an identity.
	(convert_like_real): Mark lvalue or rvalue use for identity as
	rvaledness_matches_p demands.

2018-01-18  Jakub Jelinek  <jakub@redhat.com>

	PR c++/83824
	* parser.c (attr_chainon): New function.
	(cp_parser_label_for_labeled_statement, cp_parser_decl_specifier_seq,
	cp_parser_namespace_definition, cp_parser_init_declarator,
	cp_parser_type_specifier_seq, cp_parser_parameter_declaration,
	cp_parser_gnu_attributes_opt): Use it.
	(cp_parser_member_declaration, cp_parser_objc_class_ivars,
	cp_parser_objc_struct_declaration): Likewise.  Don't reset
	prefix_attributes if attributes is error_mark_node.

2018-01-17  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/78344
	* decl.c (grokdeclarator): Do not append the error_mark_node
	due to an erroneous optional attribute-specifier-seq.

2018-01-17  Jakub Jelinek  <jakub@redhat.com>

	PR c++/83897
	* cp-gimplify.c (cp_maybe_instrument_return): Handle
	CLEANUP_POINT_EXPR.

2018-01-17  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/81054
	* constexpr.c (ensure_literal_type_for_constexpr_object): Return
	error_mark_node when we give an error.
	* decl.c (cp_finish_decl): Use the latter.

2018-01-17  Nathan Sidwell  <nathan@acm.org>

	PR c++/83287
	* init.c (build_raw_new_expr): Scan list for lookups to keep.

2018-01-17  David Malcolm  <dmalcolm@redhat.com>

	PR c++/83814
	* expr.c (fold_for_warn): Move from c-common.c, reducing to just
	the C++ part.  If processing a template, call
	fold_non_dependent_expr rather than fully folding.

2018-01-17  Jason Merrill  <jason@redhat.com>

	PR c++/81067 - redundant NULL warning.
	* call.c (convert_like_real): Restore null_node handling.

2018-01-17  Jason Merrill  <jason@redhat.com>

	PR c++/81843 - ICE with variadic member template.
	PR c++/72801
	* pt.c (unify_pack_expansion): Don't try to deduce enclosing
	template args.

2018-01-17  David Malcolm  <dmalcolm@redhat.com>

	PR c++/83799
	* pt.c (type_dependent_expression_p): Strip any location wrapper
	before testing tree codes.
	(selftest::test_type_dependent_expression_p): New function.
	(selftest::cp_pt_c_tests): Call it.

2018-01-17  Nathan Sidwell  <nathan@acm.org>

	PR c++/83739
	* pt.c (tsubst_expr) <case RANGE_FOR_STMT>: Rebuild a range_for if
	this not a final instantiation.

2018-01-16  Jason Merrill  <jason@redhat.com>

	PR c++/83714 - ICE checking return in template.
	* typeck.c (check_return_expr): Call build_non_dependent_expr.

2018-01-16  Jakub Jelinek  <jakub@redhat.com>

	PR c++/83817
	* pt.c (tsubst_copy_and_build) <case CALL_EXPR>: If function
	is AGGR_INIT_EXPR rather than CALL_EXPR, set AGGR_INIT_FROM_THUNK_P
	instead of CALL_FROM_THUNK_P.

	PR c++/83825
	* name-lookup.c (member_vec_dedup): Return early if len is 0.
	(resort_type_member_vec, set_class_bindings,
	insert_late_enum_def_bindings): Use vec qsort method instead of
	calling qsort directly.

2018-01-15  Martin Sebor  <msebor@redhat.com>

	PR c++/83588
	* class.c (find_flexarrays): Make a record of multiple flexible array
	members.

2018-01-12  Jason Merrill  <jason@redhat.com>

	PR c++/83186 - ICE with static_cast of list-initialized temporary.
	* typeck.c (build_static_cast): Use build_non_dependent_expr.

2018-01-12  Nathan Sidwell  <nathan@acm.org>

	* cp-tree.h (mark_rvalue_use): Add parm name.
	* expr.c (mark_lvalue_use, mark_lvalue_use_nonread): Move next to
	mark_rvalue_use.
	* call.c (convert_like_real): Fix formatting.

2018-01-11  Jason Merrill  <jason@redhat.com>

	PR c++/82728 - wrong -Wunused-but-set-variable
	PR c++/82799
	PR c++/83690
	* call.c (perform_implicit_conversion_flags): Call mark_rvalue_use.
	* decl.c (case_conversion): Likewise.
	* semantics.c (finish_static_assert): Call
	perform_implicit_conversion_flags.

2018-01-11  Nathan Sidwell  <nathan@acm.org>

	* method.c (enum mangling_flags): Delete long-dead enum.

2018-01-10  Paolo Carlini  <paolo.carlini@oracle.com>

	* parser.c (cp_parser_std_attribute_spec): When
        token_pair::require_open / require_close return false simply
	return error_mark_node, avoid duplicate cp_parser_error about
	expected '(' / ')', respectively.

2018-01-10  David Malcolm  <dmalcolm@redhat.com>

	PR c++/43486
	* call.c (null_ptr_cst_p): Strip location wrappers when
	converting from '0' to a pointer type in C++11 onwards.
	(conversion_null_warnings): Replace comparison with null_node with
	call to null_node_p.
	(build_over_call): Likewise.
	* cp-gimplify.c (cp_fold): Remove the early bailout when
	processing_template_decl.
	* cp-lang.c (selftest::run_cp_tests): Call
	selftest::cp_pt_c_tests and selftest::cp_tree_c_tests.
	* cp-tree.h (cp_expr::maybe_add_location_wrapper): New method.
	(selftest::run_cp_tests): Move decl to bottom of file.
	(null_node_p): New inline function.
	(selftest::cp_pt_c_tests): New decl.
	(selftest::cp_tree_c_tests): New decl.
	* cvt.c (build_expr_type_conversion): Replace comparison with
	null_node with call to null_node_p.
	* error.c (args_to_string): Likewise.
	* except.c (build_throw): Likewise.
	* mangle.c (write_expression): Skip location wrapper nodes.
	* parser.c (literal_integer_zerop): New function.
	(cp_parser_postfix_expression): Call maybe_add_location_wrapper on
	the result for RID_TYPEID. Pass true for new "wrap_locations_p"
	param of cp_parser_parenthesized_expression_list.  When calling
	warn_for_memset, replace integer_zerop calls with
	literal_integer_zerop, eliminating the double logical negation
	cast to bool.  Eliminate the special-casing for CONST_DECL in
	favor of the fold_for_warn within warn_for_memset.
	(cp_parser_parenthesized_expression_list): Add "wrap_locations_p"
	param, defaulting to false.  Convert "expr" to a cp_expr, and call
	maybe_add_location_wrapper on it when wrap_locations_p is true.
	(cp_parser_unary_expression): Call maybe_add_location_wrapper on
	the result for RID_ALIGNOF and RID_SIZEOF.
	(cp_parser_builtin_offsetof): Likewise.
	* pt.c: Include "selftest.h".
	(tsubst_copy): Handle location wrappers.
	(tsubst_copy_and_build): Likewise.
	(build_non_dependent_expr): Likewise.
	(selftest::test_build_non_dependent_expr): New function.
	(selftest::cp_pt_c_tests): New function.
	* tree.c: Include "selftest.h".
	(lvalue_kind): Handle VIEW_CONVERT_EXPR location wrapper nodes.
	(selftest::test_lvalue_kind): New function.
	(selftest::cp_tree_c_tests): New function.
	* typeck.c (string_conv_p): Strip any location wrapper from "exp".
	(cp_build_binary_op): Replace comparison with null_node with call
	to null_node_p.
	(build_address): Use location of operand when building address
	expression.

2018-01-10  Marek Polacek  <polacek@redhat.com>

	PR c++/82541
	* call.c (build_conditional_expr_1): Check complain before warning.
	* pt.c (tsubst_copy_and_build) <case COND_EXPR>: Suppress
	-Wduplicated-branches.

2018-01-10  Jakub Jelinek  <jakub@redhat.com>

	PR c++/81327
	* call.c (maybe_warn_class_memaccess): Add forward declaration.
	Change last argument from tree * to const vec<tree, va_gc> *, adjust
	args uses and check number of operands too.  Don't strip away any
	nops.  Use maybe_constant_value when looking for INTEGER_CST args.
	Deal with src argument not having pointer type.  Check
	tree_fits_uhwi_p before calling tree_to_uhwi.  Remove useless
	test.
	(build_over_call): Call maybe_warn_class_memaccess here on the
	original arguments.
	(build_cxx_call): Rather than here on converted arguments.

2018-01-10  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/81055
	* init.c (build_vec_init): Avoid building an INIT_EXPR with
	error_mark_node as second argument.

2018-01-09  Jakub Jelinek  <jakub@redhat.com>

	PR c++/83734
	* constexpr.c (cxx_eval_statement_list): Ignore DEBUG_BEGIN_STMTs
	in STATEMENT_LIST.  Remove unneeded assert.

2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
	    Alan Hayward  <alan.hayward@arm.com>
	    David Sherwood  <david.sherwood@arm.com>

	* constexpr.c (cxx_eval_array_reference): Handle polynomial
	VECTOR_CST_NELTS.
	(cxx_fold_indirect_ref): Handle polynomial TYPE_VECTOR_SUBPARTS.
	* call.c (build_conditional_expr_1): Likewise.
	* decl.c (cp_finish_decomp): Likewise.
	* mangle.c (write_type): Likewise.
	* typeck.c (structural_comptypes): Likewise.
	(cp_build_binary_op): Likewise.
	* typeck2.c (process_init_constructor_array): Likewise.

2018-01-03  Jakub Jelinek  <jakub@redhat.com>

	PR c++/83555
	* typeck.c (build_static_cast_1): For static casts to reference types,
	call build_base_path with flag_delete_null_pointer_checks as nonnull
	instead of always false.  When -fsanitize=null, call
	ubsan_maybe_instrument_reference on the NULL reference INTEGER_CST.
	* cp-gimplify.c (cp_genericize_r): Don't walk subtrees of UBSAN_NULL
	call if the first argument is INTEGER_CST with REFERENCE_TYPE.

2018-01-03  Nathan Sidwell  <nathan@acm.org>

	PR c++/83667
	* method.c (make_alias_for): Copy DECL_CONTEXT.

2018-01-03  Marek Polacek  <polacek@redhat.com>

	PR c++/83592
	* decl.c (grokdeclarator): Don't warn about MVP in typename context.

2018-01-03  Jakub Jelinek  <jakub@redhat.com>

	PR preprocessor/83602
	* name-lookup.c (lookup_name_fuzzy): Don't use macro_use_before_def
	for builtin macros.

	PR c++/83634
	* cp-gimplify.c (cp_fold) <case NOP_EXPR>: If the operand folds to
	error_mark_node, return error_mark_node.

	Update copyright years.

2018-01-02  Jakub Jelinek  <jakub@redhat.com>

	PR c++/83556
	* tree.c (replace_placeholders_r): Pass NULL as last argument to
	cp_walk_tree instead of d->pset.  If non-TREE_CONSTANT and
	non-PLACEHOLDER_EXPR tree has been seen already, set *walk_subtrees
	to false and return.
	(replace_placeholders): Pass NULL instead of &pset as last argument
	to cp_walk_tree.

2018-01-02  Nathan Sidwell  <nathan@acm.org>

	* constexpr.c (cxx_bind_parameters_in_call): Remove unneeded local
	lval var.

Copyright (C) 2018 Free Software Foundation, Inc.

Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.