]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/cp/ChangeLog
i386.md (*anddi3_doubleword): Generate AND insn using ix86_expand_binary_operator...
[thirdparty/gcc.git] / gcc / cp / ChangeLog
CommitLineData
426b9428
PP
12016-03-23 Patrick Palka <ppalka@gcc.gnu.org>
2
3 PR c++/70347
4 * typeck.c (process_init_constructor_union): If the initializer
5 is empty, use the union's NSDMI if it has one.
6
cd1588c4
PP
72016-03-23 Patrick Palka <ppalka@gcc.gnu.org>
8
9 PR c++/70332
10 * pt.c (tsubst_copy) [PARM_DECL]: Handle the use of 'this' in an
11 NSDMI that's part of an aggregrate initialization.
12
04833609
JJ
132016-03-23 Jakub Jelinek <jakub@redhat.com>
14
928af3bf
JJ
15 PR c++/70001
16 * constexpr.c (cxx_eval_vec_init_1): Reuse CONSTRUCTOR initializers
17 for 1..max even for multi-dimensional arrays. Call unshare_expr
18 on it.
19
61637db3
JJ
20 PR c++/70323
21 * constexpr.c (cxx_eval_constant_expression): Diagnose overflow
22 on TREE_OVERFLOW constants.
23
04833609
JJ
24 PR c++/70376
25 * cp-gimplify.c (genericize_omp_for_stmt): Don't walk OMP_FOR_CLAUSES
26 for OMP_TASKLOOP here.
27 (cp_genericize_r): Handle OMP_TASKLOOP like OMP_TASK, except do call
28 genericize_omp_for_stmt instead of cp_walk_tree on OMP_BODY.
29
05aca4e7
AO
302016-03-23 Alexandre Oliva <aoliva@redhat.com>
31 Jason Merrill <jason@redhat.com>
32 Jakub Jelinek <jakub@redhat.com>
33
34 PR c++/69315
35 * cp-tree.h (defer_mark_used_calls, deferred_mark_used_calls): Remove.
36 * decl.c (defer_mark_used_calls, deferred_mark_used_calls): Remove.
37 (finish_function): Don't set or test them.
38 * decl2.c (mark_used): Don't handle defer_mark_used_calls.
39
96a4ef9d
JM
402016-03-23 Jason Merrill <jason@redhat.com>
41
42 PR c++/70344
43 * constexpr.c (cxx_eval_call_expression): Catch invalid recursion.
44
fbdb6baf
MP
452016-03-23 Marek Polacek <polacek@redhat.com>
46
47 PR c++/69884
48 * pt.c (canonicalize_type_argument): Use OPT_Wignored_attributes.
49
6cedf922
IE
502016-03-22 Ilya Enkovich <enkovich.gnu@gmail.com>
51
52 * call.c (build_conditional_expr_1): Always use original
53 condition type for vector type checks and build.
54
16f6d7dc
PP
552016-03-22 Patrick Palka <ppalka@gcc.gnu.org>
56
57 PR c++/70096
58 * pt.c (tsubst_decl): Clear the DECL_MODE of the new decl.
59
a3e2b438
PP
602016-03-22 Patrick Palka <ppalka@gcc.gnu.org>
61
62 PR c++/70204
63 * constexpr.c (non_const_var_error): Check
64 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
65
ad779205
RH
662016-03-21 Richard Henderson <rth@redhat.com>
67
68 PR c++/70273
69 * decl.c (notice_forced_label_r): New.
70 (cp_finish_decl): Use it.
71
683b8101
JM
722016-03-21 Jason Merrill <jason@redhat.com>
73
74 PR c++/70285
75 * cp-gimplify.c (cp_fold) [COND_EXPR]: Handle bit-fields.
76
eb0dbdc7
JM
772016-03-18 Jason Merrill <jason@redhat.com>
78
86461cad
JM
79 PR c++/70139
80 * constexpr.c (cxx_eval_call_expression): Fix trivial copy.
81
b5a28d80
JM
82 PR c++/70147
83 * class.c (vptr_via_virtual_p): New.
84 (most_primary_binfo): Factor out of build_rtti_vtbl_entries.
85 * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs): Don't clear
86 a vptr from any virtual base in a not-in-charge 'structor.
87
bf08acda
JM
88 * decl.c (build_clobber_this): Factor out of
89 start_preparsed_function and begin_destructor_body. Handle
90 virtual bases better.
91
eb0dbdc7
JM
92 * class.c (build_if_in_charge): Split out from build_base_path.
93 * init.c (expand_virtual_init, expand_default_init): Use it.
94 * call.c (build_special_member_call): Use it.
95
dd125026
JJ
962016-03-18 Jakub Jelinek <jakub@redhat.com>
97
98 PR c++/70267
99 * init.c (build_new_1): Complain and return error_mark_node
100 if alloc_fn is not _Jv_AllocObject function returning pointer.
101
91914f0a
PP
1022016-03-18 Patrick Palka <ppalka@gcc.gnu.org>
103
104 PR c++/70205
105 * search.c (adjust_result_of_qualified_name_lookup): Don't
106 update the BASELINK_BINFO of DECL if the second call
107 to lookup_base fails.
108
753a8910
PP
1092016-03-18 Patrick Palka <ppalka@gcc.gnu.org>
110
111 PR c++/70218
112 * parser.c (cp_parser_lambda_expression): Move call to
113 pop_deferring_access_checks ahead of the call to
114 cp_parser_end_tentative_firewall.
115
a3aad0e6
JJ
1162016-03-17 Jakub Jelinek <jakub@redhat.com>
117
17366700
JJ
118 PR c++/70144
119 * cp-tree.h (magic_varargs_p): Return int instead of bool.
120 * call.c (magic_varargs_p): Return int instead of bool, return 2 for
121 Cilk+ reductions, otherwise 1 for magic varargs and 0 for normal
122 varargs.
123 (build_over_call): If magic_varargs_p == 2, call reject_gcc_builtin,
124 if magic_varargs_p == 1, call decay_conversion
125 instead of mark_type_use. Don't store error_mark_node arguments to
126 argarray, instead return error_mark_node.
127
a3aad0e6
JJ
128 PR c++/70272
129 * decl.c (begin_destructor_body): Don't insert clobber if
130 is_empty_class (current_class_type).
131
b1970801
MP
1322016-03-17 Marek Polacek <polacek@redhat.com>
133
134 PR c++/70194
135 * typeck.c (warn_for_null_address): New function.
136 (cp_build_binary_op): Call it.
137
c5e003cf
JM
1382016-03-16 Jason Merrill <jason@redhat.com>
139
140 PR c++/70259
141 * decl.c (start_preparsed_function): Don't clobber an empty base.
142
1935f250
JJ
1432016-03-16 Jakub Jelinek <jakub@redhat.com>
144
6651c93e
JJ
145 PR c++/70147
146 * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs): Conditionalize
147 BINFO_VIRTUAL_P vtable clearing on current_in_charge_parm.
148
1935f250
JJ
149 PR c++/70147
150 * cp-ubsan.c (cp_ubsan_maybe_initialize_vtbl_ptrs): Temporarily
151 set in_base_initializer.
152
42c729c5
MP
1532016-03-15 Marek Polacek <polacek@redhat.com>
154
155 PR c++/70209
156 * tree.c (strip_typedefs): Call strip_typedefs again on the
157 DECL_ORIGINAL_TYPE result.
158
3f91db69
JM
1592016-03-15 Jason Merrill <jason@redhat.com>
160
d1ccf407
JM
161 PR c++/70095
162 * pt.c (instantiate_decl): Fix call to variable_template_p.
163
3f91db69
JM
164 PR c++/70141
165 * pt.c (for_each_template_parm_r): Always walk into TYPENAME_TYPE.
166
598a208c
CC
1672016-03-14 Casey Carter <casey@carter.net>
168 Jason Merrill <jason@redhat.com>
169
08a1cadc 170 P0184R0: Generalizing the Range-Based For Loop
598a208c
CC
171 * parser.c (cp_convert_range_for): Set the type of __end separately.
172 (cp_parser_perform_range_for_lookup): Allow different begin/end
173 types if they are comparable.
174
3f1e5d3a
PP
1752016-03-12 Patrick Palka <ppalka@gcc.gnu.org>
176
177 PR c++/70106
178 * semantics.c (force_paren_expr): Just build a PAREN_EXPR when
179 processing_template_decl and EXPR is a SCOPE_REF.
180
b87a8d7d
PP
1812016-03-10 Patrick Palka <ppalka@gcc.gnu.org>
182 Jakub Jelinek <jakub@redhat.com>
183
184 PR c++/70001
185 * constexpr.c (cxx_eval_vec_init_1): For pre_init case, reuse
186 return value from cxx_eval_constant_expression from earlier
187 elements if it is valid constant initializer requiring no
188 relocations.
189
d49b0aa0
MP
1902016-03-10 Marek Polacek <polacek@redhat.com>
191
192 PR c++/70153
193 * cp-gimplify.c (cp_fold): Handle UNARY_PLUS_EXPR.
194
96b3c82d
CP
1952016-03-09 Cesar Philippidis <cesar@codesourcery.com>
196
197 * parser.c (cp_parser_oacc_loop): Update cclauses and clauses
198 when calling c_finish_omp_clauses.
199
1e546b68
JM
2002016-03-08 Jason Merrill <jason@redhat.com>
201
80aac5c8
JM
202 * parser.c (cp_parser_diagnose_invalid_type_name): Give helpful
203 diagnostic for use of "concept".
204 (cp_parser_requires_clause_opt): And "requires".
205 (cp_parser_type_parameter, cp_parser_late_return_type_opt)
206 (cp_parser_explicit_template_declaration): Adjust.
207 * Make-lang.in (check-c++-all): Add "concepts" to std list.
208
1e546b68
JM
209 P0036R0: Unary Folds and Empty Parameter Packs
210 * pt.c (expand_empty_fold): Remove special cases for *,+,&,|.
211
56aae4b7
JJ
2122016-03-08 Jakub Jelinek <jakub@redhat.com>
213
d259b234
JJ
214 PR c++/70135
215 * constexpr.c (cxx_eval_loop_expr): Forget saved values of SAVE_EXPRs
216 even after the last iteration of the loop.
217
56aae4b7
JJ
218 * decl.c (duplicate_decls): Fix spelling - becuase -> because.
219
dbb23418
PP
2202016-03-07 Patrick Palka <ppalka@gcc.gnu.org>
221
222 PR c++/66786
223 * pt.c (get_template_info): Handle PARM_DECL.
224 (template_class_depth): Check DECL_P instead of
225 VAR_OR_FUNCTION_DECL_P.
226
d96e8407
JM
2272016-03-05 Jason Merrill <jason@redhat.com>
228
229 PR c++/67364
230 * constexpr.c (cxx_eval_store_expression): Replace
231 CONSTRUCTOR_ELTS in nested CONSTRUCTORs, too.
232
7a3a3fad
PP
2332016-03-05 Patrick Palka <ppalka@gcc.gnu.org>
234
235 PR c++/66786
236 * pt.c (template_class_depth): Given a lambda type, iterate
237 into its LAMBDA_TYPE_EXTRA_SCOPE field instead of its
238 TYPE_CONTEXT. Given a VAR_DECL, iterate into its
239 CP_DECL_CONTEXT.
240
d5bcd6d4
JM
2412016-03-04 Jason Merrill <jason@redhat.com>
242
243 PR c++/69203
244 * cp-tree.h (COND_EXPR_IS_VEC_DELETE): New.
245 * init.c (build_vec_delete_1): Set it.
246 * constexpr.c (potential_constant_expression_1) [COND_EXPR]: Check it.
247
0c8825de
JJ
2482016-03-04 Jakub Jelinek <jakub@redhat.com>
249
411d61c4
JJ
250 * decl.c (start_preparsed_function): Don't emit start clobber at the
251 start of constructor clones.
252
0c8825de
JJ
253 PR c++/70035
254 * cp-tree.h (cp_ubsan_maybe_initialize_vtbl_ptrs): New prototype.
255 * decl.c (start_preparsed_function): Call
256 cp_ubsan_maybe_initialize_vtbl_ptrs if needed.
257 * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs,
258 cp_ubsan_maybe_initialize_vtbl_ptrs): New functions.
259
b54eff8b
JM
2602016-03-04 Jason Merrill <jason@redhat.com>
261
188e53bd
JM
262 PR c++/67364
263 * constexpr.c (cxx_eval_component_reference): Further tweak.
264
39dce2b7
JM
265 * constexpr.c (struct constexpr_ctx): Add save_exprs field.
266 (cxx_eval_loop_expr): Discard SAVE_EXPR values before looping.
267 (cxx_eval_constant_expression) [SAVE_EXPR]: Add it to the set.
268 (cxx_eval_outermost_constant_expr, is_sub_constant_expr): Initialize.
269
b54eff8b
JM
270 PR c++/70067
271 * tree.c (strip_typedefs): Handle TYPENAME_TYPE lookup finding the
272 same type.
273
639475f0
JM
2742016-03-03 Jason Merrill <jason@redhat.com>
275
b47d1d90
JM
276 * method.c (synthesized_method_walk): operator= can also be constexpr.
277
a0a6a8c9
JM
278 * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Get
279 LAMBDA_EXPR_RETURN_TYPE from the instantiated closure.
280
264fd142
JM
281 PR c++/67164
282 * pt.c (copy_template_args): New.
283 (tsubst_pack_expansion): Use it.
284
45c3e69b
JM
285 * call.c (build_aggr_conv): Use get_nsdmi.
286
16dc6b17
JM
287 PR c++/51406
288 * typeck.c (build_static_cast_1): Avoid folding back to lvalue.
289
639475f0
JM
290 PR c++/67364
291 * constexpr.c (cxx_eval_component_reference): Just return an empty
292 CONSTRUCTOR for an empty class.
293
7f0e23e9
JM
2942016-03-01 Jason Merrill <jason@redhat.com>
295
5c969cb8
JM
296 PR c++/70036
297 * parser.c (cp_parser_requires_clause): Call
298 check_for_bare_parameter_packs.
299
c8a66fc9
JM
300 PR c++/51489
301 * constexpr.c (cxx_eval_binary_expression): Don't VERIFY_CONSTANT
302 the operands.
303
7f0e23e9
JM
304 PR c++/69995
305 * constexpr.c (cxx_eval_call_expression): Unshare arg.
306 (cxx_eval_constant_expression) [DECL_EXPR]: Unshare init.
307 [TARGET_EXPR]: Unshare init.
308
76d881bf
PP
3092016-03-01 Patrick Palka <ppalka@gcc.gnu.org>
310
311 PR c++/68948
312 PR c++/69961
313 * pt.c (tsubst_baselink): Reinstate the check for an invalid
314 constructor call.
315
7574c916
JM
3162016-02-28 Jason Merrill <jason@redhat.com>
317
318 PR c++/69995
319 * constexpr.c (cxx_eval_store_expression): Unshare init.
320
56cde077
JM
3212016-02-26 Jason Merrill <jason@redhat.com>
322
323 PR c++/69958
324 * pt.c (make_argument_pack): New.
325 (tsubst_copy) [SIZEOF_EXPR]: Handle partial expansion.
326 (tsubst_copy_and_build): Likewise.
327
6284a979
JM
3282016-02-25 Jason Merrill <jason@redhat.com>
329
8ba8c375
JM
330 PR c++/69889
331 * cp-tree.h (AGGR_INIT_FROM_THUNK_P): New.
332 * tree.c (build_aggr_init_expr): Set it.
333 * semantics.c (simplify_aggr_init_expr): Check it.
334 * cp-gimplify.c (cp_genericize_r): Don't walk into
335 a call/aggr_init from a thunk.
336
bd28a34f
JM
337 PR c++/69842
338 * method.c (forward_parm): Handle parameter packs.
339 * lambda.c (maybe_add_lambda_conv_op): Use it for them.
340
6a0cc1cd
JM
341 PR c++/67364
342 * constexpr.c (cxx_eval_component_reference): Don't complain about
343 unevaluated empty classes.
344
6284a979
JM
345 PR c++/68049
346 * tree.c (strip_typedefs): Use DECL_ORIGINAL_TYPE.
347
1137001c
PP
3482016-02-25 Patrick Palka <ppalka@gcc.gnu.org>
349
350 PR c++/69736
351 * cp-tree.h (REF_PARENTHESIZED_P): Adjust documentation.
352 (maybe_undo_parenthesized_ref): Declare.
353 * semantics.c (maybe_undo_parenthesized_ref): Split out from
354 check_return_expr.
355 (finish_call_expr): Use it.
356 * typeck.c (check_return_expr): Use it.
357 * pt.c (tsubst_copy_and_build) [INDIRECT_REF]: Retain the
358 REF_PARENTHESIZED_P flag.
359
03ca8fb3
JJ
3602016-02-24 Jakub Jelinek <jakub@redhat.com>
361
362 PR c++/69922
363 * class.c (build_base_path): Set TREE_NO_WARNING on the null_test.
364 Avoid folding it.
365 * init.c (build_vec_delete_1, build_delete): Don't fold the non-NULL
366 tests.
367 * cp-gimplify.c (cp_fold): For TREE_NO_WARNING comparisons with NULL,
368 unless they are folded into INTEGER_CST, error_mark_node or some
369 comparison with NULL, avoid folding them and use either the original
370 comparison or non-folded comparison of folded arguments.
371 * cp-ubsan.c (cp_ubsan_instrument_vptr): Set TREE_NO_WARNING on the
372 comparison, don't fold the comparison right away.
373
944e9f5f
JM
3742016-02-24 Jason Merrill <jason@redhat.com>
375
376 PR c++/69323
377 * friend.c (make_friend_class): Likewise.
378 * decl.c (lookup_and_check_tag): Diagnose invalid dependent friend.
379
b8599b68
JM
3802016-02-24 Jason Merrill <jason@redhat.com>
381
382 PR c++/69323
383 * pt.c (instantiate_class_template_1): Set
384 processing_template_decl before substituting friend_type.
385
3b96b93a
MS
386016-02-24 Martin Sebor <msebor@redhat.com>
387
388 PR c++/69912
389 * tree.c (build_ctor_subob_ref): Compare types' main variants
390 instead of the types as they are.
391
28577b86
JM
3922016-02-24 Jason Merrill <jason@redhat.com>
393
a021961c
JM
394 * decl.c (start_preparsed_function): Condition ctor clobber on
395 flag_lifetime_dse > 1.
396
28577b86
JM
397 * cp-gimplify.c (cp_fold): Don't fold constexpr calls if -fno-inline.
398
2207c599
JM
3992016-02-19 Jason Merrill <jason@redhat.com>
400
401 PR c++/69743
402 * call.c (remaining_arguments): No longer static.
403 * cp-tree.h: Declare it.
404 * pt.c (more_specialized_fn): Use it.
405
3a27b4db
JJ
4062016-02-19 Jakub Jelinek <jakub@redhat.com>
407 Bernd Edlinger <bernd.edlinger@hotmail.de>
408
409 * Make-lang.in: Invoke gperf with -L C++.
410 * cfns.gperf: Remove prototypes for hash and libc_name_p
411 inlines.
412 * cfns.h: Regenerated.
413 * except.c (nothrow_libfn_p): Adjust.
414
7a965d51
JJ
4152016-02-19 Jakub Jelinek <jakub@redhat.com>
416
417 PR c++/69850
418 * rtti.c (ifnonnull): Set TREE_NO_WARNING on the condition, use
419 NE_EXPR instead of EQ_EXPR and swap last two arguments on COND_EXPR.
420
200e869c
PP
4212016-02-19 Patrick Palka <ppalka@gcc.gnu.org>
422
423 PR c++/68948
424 * pt.c (tsubst_baselink): Don't diagnose an invalid constructor
425 call here.
426 * semantics.c (finish_call_expr): Don't assume a constructor
427 call is dependent if only the "this" pointer is dependent. When
428 building a constructor call, always use a dummy object.
429
19e21586
JJ
4302016-02-19 Jakub Jelinek <jakub@redhat.com>
431
03a616ac
JJ
432 PR c++/69850
433 * init.c (build_vec_delete_1): Set TREE_NO_WARNING on the NE_EXPR
434 condition.
435 * cp-gimplify.c (cp_fold): Propagate TREE_NO_WARNING from binary
436 operators if folding preserved the binop, just with different
437 arguments.
438
19e21586
JJ
439 PR c++/67767
440 * parser.c (cp_parser_std_attribute_spec_seq): Don't assume
441 attr_spec is always single element chain, chain all the attributes
442 properly together in the right order.
443
747b61fc
JM
4442016-02-18 Jason Merrill <jason@redhat.com>
445
446 * mangle.c (maybe_check_abi_tags): Add for_decl parm. Call
447 mangle_decl.
448 (mangle_decl): Call maybe_check_abi_tags for function scope.
449 (mangle_guard_variable): Call maybe_check_abi_tags here.
450 (write_guarded_var_name): Not here.
451
50ccdf5b
JM
4522016-02-17 Jason Merrill <jason@redhat.com>
453
fa837fb6
JM
454 PR c++/65985
455 * constexpr.c (build_constexpr_constructor_member_initializers):
456 Handle an additional STATEMENT_LIST.
457
bcb5f3c9
JM
458 PR c++/68585
459 * constexpr.c (cxx_eval_bare_aggregate): Fix 'changed' detection.
460
50ccdf5b
JM
461 PR c++/68679
462 * decl2.c (reset_type_linkage_2): Look through member templates.
463
932c0da4
JJ
4642016-02-17 Jakub Jelinek <jakub@redhat.com>
465
466 PR c++/69850
467 * init.c (build_delete): Set TREE_NO_WARNING on ifexp.
468
0f02dd56
JM
4692016-02-17 Jason Merrill <jason@redhat.com>
470
471 PR c++/69842
472 * method.c (forward_parm): Split out from...
473 (add_one_base_init): ...here.
474 * lambda.c (maybe_add_lambda_conv_op): Use it.
475
6bab4c63
JM
4762016-02-16 Jason Merrill <jason@redhat.com>
477
478 PR c++/10200
479 PR c++/69753
480 * call.c, cp-tree.h, name-lookup.c, pt.c, search.c, semantics.c,
481 tree.c, typeck2.c: Revert earlier changes.
482 * parser.c (cp_parser_lookup_name): Ignore namespace-scope
483 non-type templates after -> or .
484
bf14eba2
JJ
4852016-02-16 Jakub Jelinek <jakub@redhat.com>
486
487 PR c/69835
488 * typeck.c (cp_build_binary_op): Revert 2015-09-09 change.
489
7128d6ab
JM
4902016-02-16 Jason Merrill <jason@redhat.com>
491
492 PR c++/69657
493 * name-lookup.c (lookup_qualified_name): Add find_hidden parm.
494 (set_decl_namespace): Pass it. Complain about finding a hidden friend.
495 * name-lookup.h: Adjust.
496
ba539195
JN
4972016-02-16 James Norris <jnorris@codesourcery.com>
498
499 * parser.c (cp_parser_oacc_data_clause_deviceptr): Remove checking.
500 * semantics.c (finish_omp_clauses): Add deviceptr checking.
501
f0516ca4
JJ
5022016-02-15 Jakub Jelinek <jakub@redhat.com>
503
504 PR c++/69658
505 * init.c (expand_default_init): Only call reshape_init
506 in the direct-initialization from an initializer list case.
507
fe69277d
JM
5082016-02-15 Jason Merrill <jason@redhat.com>
509
2bd0a2d6
JM
510 PR c++/69753
511 * semantics.c (finish_call_expr): Implicit 'this' does not make
512 the call dependent.
513 * search.c (any_dependent_bases_p): Split out...
514 * name-lookup.c (do_class_using_decl): ...from here.
515 * call.c (build_new_method_call_1): Don't complain about missing object
516 if there are dependent bases. Tweak error.
517 * tree.c (non_static_member_function_p): Remove.
518 * pt.c (type_dependent_expression_p): A member template of a
519 dependent type is dependent.
520 * cp-tree.h: Adjust.
521
fe69277d
JM
522 PR c++/68890
523 * constexpr.c (verify_ctor_sanity): Remove CONSTRUCTOR_NELTS check.
524
38d795d2
PP
5252016-02-12 Patrick Palka <ppalka@gcc.gnu.org>
526
527 PR c++/69098
528 * pt.c (lookup_and_finish_template_variable): New function,
529 extracted from ...
530 (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: ... here. Use it.
531 (tsubst_qualified_id): Consider that EXPR might be a variable
532 template.
533 * typeck.c (check_template_keyword): Don't emit an error
534 if DECL is a variable template.
535
9c582551
JJ
5362016-02-12 Jakub Jelinek <jakub@redhat.com>
537
538 * error.c: Spelling fixes - behaviour -> behavior and
539 neighbour -> neighbor.
540 * decl.c: Likewise.
541 * typeck.c (cp_build_binary_op): Fix up behavior spelling in
542 diagnostics.
543 * init.c (build_delete): Likewise.
544
66756373
JJ
5452016-02-11 Jakub Jelinek <jakub@redhat.com>
546
547 PR c/69768
548 * typeck.c (cp_build_binary_op): cp_fully_fold integer_zerop
549 arguments for -Waddress warning. Fix up formatting.
550
0d7d9458
PC
5512016-02-11 Paolo Carlini <paolo.carlini@oracle.com>
552
553 PR c++/68726
554 * pt.c (lookup_template_class_1): Check tsubst return value for
555 error_mark_node.
556
3a4219ca
JM
5572016-02-10 Jason Merrill <jason@redhat.com>
558
46f0d909
JM
559 PR c++/68926
560 * pt.c (resolve_nondeduced_context): Add complain parm.
561 (do_auto_deduction): Pass it.
562 * cvt.c (convert_to_void): Likewise.
563 * decl.c (cp_finish_decl): Likewise.
564 * init.c (build_new): Likewise.
565 * rtti.c (get_tinfo_decl_dynamic): Likewise.
566 * semantics.c (finish_decltype_type): Likewise.
567 * typeck.c (decay_conversion): Likewise.
568 * cp-tree.h: Adjust declaration.
569 * call.c (standard_conversion): Add complain parm, pass it along.
570 (implicit_conversion): Pass it.
571
89908c8f
JM
572 PR c++/69657
573 * name-lookup.c (ambiguous_decl): Call remove_hidden_names.
574 (lookup_name_real_1): Likewise.
575 (remove_hidden_names): Handle non-functions too.
576
ff2faafc
JM
577 PR c++/10200
578 * parser.c (cp_parser_lookup_name): When looking for a template
579 after . or ->, only consider class templates.
580 (cp_parser_postfix_dot_deref_expression): Handle the current
581 instantiation. Remember a dependent object expression.
582 * typeck2.c (build_x_arrow): Handle the current instantiation.
583
3a4219ca
JM
584 * ptree.c (debug_tree): Implement for cp_expr.
585
efb45a9f
PP
5862016-02-08 Patrick Palka <ppalka@gcc.gnu.org>
587
588 PR c++/69139
589 * parser.c (cp_parser_simple_type_specifier): Make the check
590 for disambiguating between an 'auto' placeholder and an implicit
591 template parameter more robust.
592
20a0c6f9
PP
5932016-02-08 Patrick Palka <ppalka@gcc.gnu.org>
594
595 PR c++/69283
596 PR c++/67835
597 * decl2.c (mark_used): When given a TEMPLATE_DECL, return after
598 setting its TREE_USED flag.
599
1374a761
JM
6002016-02-08 Jason Merrill <jason@redhat.com>
601
602 PR c++/69657
603 * name-lookup.c (do_nonmember_using_decl): Leave anticipated
604 built-ins alone.
605
f68bc23f
JJ
6062016-02-08 Jakub Jelinek <jakub@redhat.com>
607
608 PR c++/59627
609 * parser.c (cp_parser_omp_declare_reduction): Set assembler name
610 of the DECL_OMP_DECLARE_REDUCTION_P decls.
611
eba9e839
MP
6122016-02-08 Marek Polacek <polacek@redhat.com>
613
614 PR c++/69688
615 * constexpr.c (clear_cv_and_fold_caches): Renamed from clear_cv_cache.
616 Call clear_fold_cache.
617 * cp-tree.h: Adjust declaration.
618 * decl.c (finish_enum_value_list): Call clear_cv_and_fold_caches
619 rather than clear_cv_cache and clear_fold_cache.
620 * typeck2.c (store_init_value): Call clear_cv_and_fold_caches.
621
415594bb
JM
6222016-02-08 Jason Merrill <jason@redhat.com>
623
624 * cp-tree.h (CONV_FOLD, CONV_BACKEND_CONVERT): New.
625 * cvt.c (convert): Pass CONV_BACKEND_CONVERT.
626 (ocp_convert): Use *_maybe_fold.
627 (cp_convert_to_pointer): Add dofold parameter.
628 * cp-gimplify.c (cp_fold) [CONVERT_EXPR]: Call convert.
629
46cb9332
MS
6302016-02-05 Martin Sebor <msebor@redhat.com>
631
632 PR c++/69662
633 * init.c (find_field_init): New function.
634 (warn_placement_new_too_small): Call it. Handle one-element arrays
635 at ends of structures special.
636
0fd9d492
JM
6372016-02-05 Jason Merrill <jason@redhat.com>
638
639 PR c++/68948
640 * semantics.c (finish_expr_stmt): If expr is error_mark_node,
641 make sure we've seen_error().
642
76c85fbb
PP
6432016-02-05 Patrick Palka <ppalka@gcc.gnu.org>
644
645 PR c++/68948
646 * pt.c (tsubst_baselink): Diagnose an invalid constructor call
647 if lookup_fnfields returns NULL_TREE and the name being looked
648 up has the form A::A.
649
618d6c1c
PP
6502016-02-04 Patrick Palka <ppalka@gcc.gnu.org>
651
652 * constexpr.c (cxx_eval_binary_expression): Fold equality
653 comparisons involving PTRMEM_CSTs.
654
d1243d27
JJ
6552016-02-04 Jakub Jelinek <jakub@redhat.com>
656
657 * class.c (find_flexarrays): Don't declare dom variable.
658 (diagnose_flexarray): Likewise.
659
05dd97db
MS
6602016-02-02 Martain Sebor <msebor@redhat.com>
661
662 PR c++/69251
663 PR c++/69253
664 PR c++/69290
665 PR c++/69277
666 PR c++/69349
667 * class.c (walk_subobject_offsets): Avoid testing the upper bound
668 of a flexible array member for equality to null.
669 (find_flexarrays): Remove spurious whitespace introduced in r231665.
670 (diagnose_flexarrays): Avoid checking the upper bound of arrays.
671 (check_flexarrays): Same.
672 * decl.c (compute_array_index_type): Avoid special case for flexible
673 array members.
674 (grokdeclarator): Avoid calling compute_array_index_type for flexible
675 array members.
676 * error.c (dump_type_suffix): Revert changes introduced in r231665
677 and rendered unnecessary by the changes above.
678 * pt.c (tsubst): Same.
679 * tree.c (build_ctor_subob_ref): Handle flexible array members.
680 * typeck2.c (digest_init_r): Revert changes introduced in r231665.
681 (process_init_constructor_array): Same.
682 (process_init_constructor_record): Same.
683
ab4bae0c
PP
6842016-02-03 Patrick Palka <ppalka@gcc.gnu.org>
685
686 PR c++/69056
687 * pt.c (try_one_overload): Handle comparing argument packs so
688 that there is no conflict if we deduced more arguments of an
689 argument pack than were explicitly specified.
690
75a27d35
JJ
6912016-01-31 Jakub Jelinek <jakub@redhat.com>
692 Jason Merrill <jason@redhat.com>
693
694 PR c++/68763
695 * tree.c (strip_typedefs) [FUNCTION_TYPE]: Avoid building a new
696 function type if nothing is changing.
697
b676a079
JM
6982016-01-31 Jason Merrill <jason@redhat.com>
699
6978c505
JM
700 PR c++/69009
701 * pt.c (partial_specialization_p, impartial_args): New.
702 (instantiate_decl): Call impartial_args.
703
b1568582
JM
704 * mangle.c (maybe_check_abi_tags): New.
705 (write_guarded_var_name): Call it.
706 (mangle_ref_init_variable): Call check_abi_tags.
707
b676a079
JM
708 * pt.c (lookup_template_class_1): Don't share TYPE_ATTRIBUTES
709 between template and instantiation.
710
16b77b32
JJ
7112016-01-29 Jakub Jelinek <jakub@redhat.com>
712
713 PR debug/66869
714 * decl.c (wrapup_globals_for_namespace): Warn about unused static
715 function declarations.
716
5453bfed
MP
7172016-01-29 Marek Polacek <polacek@redhat.com>
718
719 PR c++/69509
720 PR c++/69516
721 * constexpr.c (cxx_eval_array_reference): Give the "array subscript
722 out of bound" error earlier.
723 * init.c (build_vec_init): Change NE_EXPR into GT_EXPR. Update the
724 commentary.
725
e9f69069
PP
7262016-01-29 Patrick Palka <ppalka@gcc.gnu.org>
727
728 * name-lookup.c (begin_scope): After reusing a cp_binding_level
729 structure, update free_binding_level before the structure's
730 level_chain field gets cleared, not after.
731
e448880c
JM
7322016-01-28 Jason Merrill <jason@redhat.com>
733
734 PR c++/67407
735 * search.c (dfs_walk_once, dfs_walk_once_r)
736 (dfs_walk_once_accessible_r, dfs_walk_once_accessible): Use
737 hash_set instead of BINFO_MARKED.
738 (dfs_unmark_r): Remove.
739
2b4f7b94
PP
7402016-01-28 Patrick Palka <ppalka@gcc.gnu.org>
741
742 PR c++/24208
743 * parser.c (LEXER_DEBUGGING_ENABLED_P): New macro.
744 (cp_lexer_debugging_p): Use it.
745 (cp_lexer_start_debugging): Likewise.
746 (cp_lexer_stop_debugging): Likewise.
747
fa74a4bc
MP
7482016-01-27 Marek Polacek <polacek@redhat.com>
749
750 PR c/68062
751 * typeck.c (cp_build_binary_op): Promote operand to unsigned, if
752 needed. Add -Wsign-compare warning.
753
5d70666e
RB
7542016-01-27 Ryan Burn <contact@rnburn.com>
755
756 PR cilkplus/69267
757 * cp-gimplify.c (cilk_cp_gimplify_call_params_in_spawned_fn): Removed
758 superfluous post_p argument in call to
759 cilk_gimplify_call_params_in_spawned_fn.
760
05bf54c3
MP
7612016-01-27 Marek Polacek <polacek@redhat.com>
762
763 PR c++/69379
764 * constexpr.c (cxx_eval_constant_expression): Handle PTRMEM_CSTs
765 wrapped in NOP_EXPRs.
766
60214d0d
MS
7672016-01-27 Martin Sebor <msebor@redhat.com>
768
769 PR c++/69317
770 * mangle.c (mangle_decl): Reference the correct (saved) version
771 of the ABI in -Wabi diagnostics.
772
95e3030c
MP
7732016-01-27 Marek Polacek <polacek@redhat.com>
774
775 PR c++/69496
776 * constexpr.c (cxx_eval_array_reference): Evaluate the number of
777 elements of the array.
778
ca30abcd
JM
7792016-01-26 Jason Merrill <jason@redhat.com>
780
781 PR c++/68949
782 * constexpr.c (register_constexpr_fundef): Keep the un-massaged body.
783 (cxx_eval_call_expression): Don't look through clones.
784 * optimize.c (maybe_clone_body): Clear DECL_SAVED_TREE of the alias.
785 * semantics.c (expand_or_defer_fn_1): Keep DECL_SAVED_TREE of
786 maybe-in-charge *tor.
787
2d63bc39
JM
7882016-01-26 Jason Merrill <jason@redhat.com>
789
790 PR c++/68782
791 * constexpr.c (cxx_eval_bare_aggregate): Update TREE_CONSTANT
792 and TREE_SIDE_EFFECTS.
793 (cxx_eval_constant_expression) [CONSTRUCTOR]: Call
794 verify_constructor_flags.
795
476805ae
JJ
7962016-01-26 Jakub Jelinek <jakub@redhat.com>
797
798 PR c++/68357
799 * cp-gimplify.c (cp_fold): If some operand folds to error_mark_node,
800 return error_mark_node instead of building trees with error_mark_node
801 operands.
802
01e1dea3
DM
8032016-01-26 David Malcolm <dmalcolm@redhat.com>
804
805 PR other/69006
806 * error.c (print_instantiation_partial_context_line): Add missing
807 newlines from output for the t == NULL case.
808 (print_instantiation_partial_context): Remove call to pp_newline.
809
a59b92b0
PP
8102016-01-24 Patrick Palka <ppalka@gcc.gnu.org>
811
812 Revert:
813 2016-01-18 Patrick Palka <ppalka@gcc.gnu.org>
814
815 PR c++/11858
816 PR c++/24663
817 PR c++/24664
818 * decl.c (grokdeclarator): Don't decay array parameter type to
819 a pointer type if it's dependent.
820 (grokparms): Invoke strip_top_quals instead of directly invoking
821 cp_build_qualified_type.
822 * pt.c (decay_dependent_array_parm_type): New static function.
823 (type_unification_real): Call decay_dependent_array_parm_type
824 to decay a dependent array parameter type to its corresponding
825 pointer type before unification.
826 (more_specialized_fn): Likewise.
827 (get_bindings): Likewise.
828 * tree.c (cp_build_qualified_type): Trivial typofix in
829 documentation.
830
69da7802
MS
8312016-01-23 Martin Sebor <msebor@redhat.com>
832
833 PR c++/58109
834 PR c++/69022
835 * decl2.c (is_late_template_attribute): Handle dependent argument
836 to attribute align and attribute vector_size.
837
97ca3d0d
JM
8382016-01-21 Jason Merrill <jason@redhat.com>
839
130ee9a9
JM
840 PR c++/69392
841 * lambda.c (lambda_capture_field_type): Handle 'this' specially
842 for init-capture, too.
843
020491e6
JM
844 PR c++/65687
845 * decl.c (type_is_deprecated): Don't look into a typedef.
846
2f3932b9
JM
847 PR c++/40751
848 PR c++/64987
849 * decl.c (copy_type_enum): Respect TYPE_USER_ALIGN.
850
97ca3d0d
JM
851 PR c++/43407
852 * decl.c (start_enum): Add attributes parameter.
853 * parser.c (cp_parser_enum_specifier): Pass it.
854 * pt.c (lookup_template_class_1): Pass it.
855 * cp-tree.h: Adjust.
856
33f48842
JM
8572016-01-19 Jason Merrill <jason@redhat.com>
858
859 PR c++/59759
860 * pt.c (convert_template_argument): Handle VAR_DECL properly.
861
1e297006
MP
8622016-01-19 Marek Polacek <polacek@redhat.com>
863
864 PR c++/68586
865 * constexpr.c (clear_cv_cache): New.
866 * cp-gimplify.c (clear_fold_cache): New.
867 * cp-tree.h (clear_cv_cache, clear_fold_cache): Declare.
868 * decl.c (finish_enum_value_list): Call them.
869
38a979f2
MP
870 PR c++/68965
871 * pt.c (tsubst_copy): Mark elements in expanded vector as used.
872
17c15cb9
PP
8732016-01-18 Patrick Palka <ppalka@gcc.gnu.org>
874
875 PR c++/11858
876 PR c++/24663
877 PR c++/24664
878 * decl.c (grokdeclarator): Don't decay array parameter type to
879 a pointer type if it's dependent.
880 (grokparms): Invoke strip_top_quals instead of directly invoking
881 cp_build_qualified_type.
882 * pt.c (decay_dependent_array_parm_type): New static function.
883 (type_unification_real): Call decay_dependent_array_parm_type
884 to decay a dependent array parameter type to its corresponding
885 pointer type before unification.
886 (more_specialized_fn): Likewise.
887 (get_bindings): Likewise.
888 * tree.c (cp_build_qualified_type): Trivial typofix in
889 documentation.
890
7f26f7df
JM
8912016-01-18 Jason Merrill <jason@redhat.com>
892
4b0b30ef
JM
893 * cp-gimplify.c (cp_fold) [CONSTRUCTOR]: Don't clobber the input.
894
8d8f3235
JM
895 * cp-gimplify.c (cp_fold): Remove unnecessary special cases.
896
7f26f7df
JM
897 PR c++/68767
898 * cp-gimplify.c (cp_fold) [COND_EXPR]: Simplify. Do fold COND_EXPR.
899 (contains_label_1, contains_label_p): Remove.
900
ec7886c1
PP
9012016-01-16 Patrick Palka <ppalka@gcc.gnu.org>
902
903 PR c++/69091
904 * pt.c (type_dependent_expression_p): For a function template
905 specialization, a type is dependent iff any of its template
906 arguments are.
907
203484bb
PP
9082016-01-16 Patrick Palka <ppalka@gcc.gnu.org>
909
910 * cp-array-notation.c (cp_expand_cond_array_notations): Return
911 error_mark_node only if find_rank failed, not if it was
912 successful.
913
aa2500e9
PP
9142016-01-16 Patrick Palka <ppalka@gcc.gnu.org>
915
916 PR c++/68936
917 * tree.c (build_min_non_dep_call_vec): Don't retain the
918 KOENIG_LOOKUP_P flag of the non-dependent expression that's
919 been built.
920 (build_min_non_dep_op_overload): Instead, do it here.
921
e0a575ff
JJ
9222016-01-15 Jakub Jelinek <jakub@redhat.com>
923
924 PR bootstrap/68271
925 * parser.h (cp_token): Remove pragma_kind field. Add comment
926 with number of unused bits.
927 * parser.c (eof_token): Remove pragma_kind field initializer.
928 (cp_lexer_get_preprocessor_token): Don't set pragma_kind
929 field, don't clear CPP_PRAGMA u.value.
930 (cp_parser_pragma_kind): New function.
931 (cp_parser_omp_sections_scope, cp_parser_oacc_kernels_parallel,
932 cp_parser_omp_construct, cp_parser_initial_pragma,
933 cp_parser_pragma): Use cp_parser_pragma_kind instead of accessing
934 pragma_kind field.
935
56233bd6
JM
9362016-01-15 Jason Merrill <jason@redhat.com>
937
c5e3b6fc
JM
938 PR c++/68847
939 * call.c (build_cxx_call): Use fold_non_dependent_expr.
940
f3255019
JM
941 * typeck2.c (cxx_incomplete_type_diagnostic): Use the location of
942 value.
943
56233bd6
JM
944 PR c++/69257
945 * typeck.c (decay_conversion): Don't call mark_rvalue_use for
946 array/function-to-pointer conversion. Call
947 complete_type_or_maybe_complain for lvalue-to-rvalue conversion.
948 * call.c (convert_like_real): Print call context if
949 decay_conversion errors.
950
e6d6ec9e
TV
9512016-01-14 Tom de Vries <tom@codesourcery.com>
952
953 PR tree-optimization/68773
954 * parser.c (cp_parser_oacc_declare, cp_parser_omp_declare_target): Don't
955 set force_output.
956
a7ccb9e7
JM
9572016-01-14 Jason Merrill <jason@redhat.com>
958
959 PR c++/69261
960 * constexpr.c (find_array_ctor_elt): Handle splitting RANGE_EXPR.
961
5342156c
MP
9622016-01-12 Marek Polacek <polacek@redhat.com>
963
964 PR c++/68979
965 * constexpr.c (cxx_eval_check_shift_p): Use permerror rather than
966 error_at and adjust the return value.
967
723033a6
JJ
9682016-01-12 Jakub Jelinek <jakub@redhat.com>
969
65364cc5
JJ
970 PR objc++/68511
971 PR c++/69213
972 * cp-gimplify.c (cp_gimplify_expr) <case INIT_EXPR>: Don't return
973 GS_ERROR whenever seen_error (), only if *expr_p contains
974 cilk spawn stmt, but cilk_detect_spawn_and_unwrap failed.
975
723033a6
JJ
976 PR c++/66808
977 PR c++/69000
978 * pt.c (tsubst_decl): If not local_p, clear DECL_TEMPLATE_INFO.
979
9fc21977
JM
9802016-01-11 Jason Merrill <jason@redhat.com>
981
982 PR c++/69131
983 * method.c (walk_field_subobs): Add dtor_from_ctor parm.
984 (process_subob_fn): Likewise. Don't consider triviality if true.
985 (synthesize_method_walk): Pass it.
986
655441d6
DM
9872016-01-11 David Malcolm <dmalcolm@redhat.com>
988
989 PR c++/68795
990 * parser.c (cp_parser_postfix_expression): Initialize
991 close_paren_loc to UNKNOWN_LOCATION; only use it if
992 it has been written to by
993 cp_parser_parenthesized_expression_list.
994 (cp_parser_parenthesized_expression_list): Document the behavior
995 with respect to the CLOSE_PAREN_LOC param.
996
9cb6bd74
JJ
9972016-01-11 Jakub Jelinek <jakub@redhat.com>
998
999 PR c++/69211
1000 * cp-gimplify.c (cp_fold): If COMPOUND_EXPR or MODIFY_EXPR
1001 folded operands have side-effects, but folding changed any of them,
1002 build a new tree with the folded operands instead of returning the
1003 unfolded tree.
1004
73f0dae2
MP
10052016-01-09 Marek Polacek <polacek@redhat.com>
1006
1007 PR c++/69113
1008 * decl2.c (comdat_linkage): Only set DECL_COMDAT if TREE_PUBLIC is set.
1009
c50e614b
JJ
10102016-01-09 Jakub Jelinek <jakub@redhat.com>
1011
1012 PR c++/69164
1013 * class.c (layout_class_type): Use copy_node to copy FIELD_DECLs.
1014
fe71aa4e
JM
10152016-01-08 Jason Merrill <jason@redhat.com>
1016
1017 PR c++/69158
1018 * constexpr.c (cxx_fold_indirect_ref): Handle array type differing
1019 in completion.
1020
bd8f5bb2
MP
10212016-01-08 Marek Polacek <polacek@redhat.com>
1022
1023 PR c++/68449
1024 * constexpr.c (cxx_eval_constant_expression): Handle NULL initializer.
1025
0795b6f2
JM
10262016-01-08 Jason Merrill <jason@redhat.com>
1027
550c5f8a
JM
1028 * constexpr.c (cxx_eval_call_expression): Remove convert_to_void
1029 workaround.
1030
45177337
JM
1031 PR c++/68983
1032 PR c++/67557
1033 * cvt.c (convert_to_void): Don't strip a TARGET_EXPR of
1034 TREE_ADDRESSABLE type.
1035
0795b6f2
JM
1036 PR c++/68983
1037 PR c++/67557
1038 * call.c (unsafe_copy_elision_p): Look through COMPOUND_EXPR.
1039
ce3e43d7
NS
10402016-01-05 Nathan Sidwell <nathan@acm.org>
1041
1042 PR c++/58583
1043 * pt.c (build_non_dependent_expr): Don't try a checking fold when
1044 parsing an nsdmi.
1045
818ab71a 10462016-01-04 Jakub Jelinek <jakub@redhat.com>
5624e564
JJ
1047
1048 Update copyright years.
ad41bd84 1049\f
818ab71a 1050Copyright (C) 2016 Free Software Foundation, Inc.
ad41bd84
JM
1051
1052Copying and distribution of this file, with or without modification,
1053are permitted in any medium without royalty provided the copyright
1054notice and this notice are preserved.