]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/cp/ChangeLog
submodule_14.f08: Add cleanup-submodules.
[thirdparty/gcc.git] / gcc / cp / ChangeLog
CommitLineData
5c712250
PP
12016-04-21 Patrick Palka <ppalka@gcc.gnu.org>
2
3 * name-lookup.c (free_saved_scope): New free list of saved_scope
4 structures.
5 (push_to_top_level): Attempt to reuse a saved_scope struct
6 from free_saved_scope instead of allocating a new one each time.
7 (pop_from_top_level_1): Chain the now-unused saved_scope structure
8 onto free_saved_scope.
9
20700098
PC
102016-04-21 Paolo Carlini <paolo.carlini@oracle.com>
11
12 PR c++/70540
13 * semantics.c (process_outer_var_ref): Unconditionally return
14 error_mark_node when mark_used returns false.
15
aedf4e12
MP
162016-04-21 Marek Polacek <polacek@redhat.com>
17
18 PR c++/70513
19 * parser.c (cp_parser_enum_specifier): Check and possibly error for
20 extra qualification.
21
ee392fc2
NS
222016-04-20 Nathan Sidwell <nathan@acm.org>
23
24 PR c++/55635
25 * init.c (build_vec_delete_1): Protect operator delete call in try
26 finally.
27 (build_delete): Likewise.
28 * optimize.c (build_delete_destructor_body): Likewise.
29
477d4906
IV
302016-04-20 Ilya Verbin <ilya.verbin@intel.com>
31
32 PR c++/69363
33 * cp-tree.h (finish_omp_clauses): Add new default argument.
34 * parser.c (cp_parser_cilk_simd_all_clauses): Use finish_omp_clauses
35 instead of c_finish_cilk_clauses.
36 * semantics.c (finish_omp_clauses): Add new argument. Allow
37 floating-point variables in the linear clause for Cilk Plus.
38
323af7cf
NS
392016-04-20 Nathan Sidwell <nathan@acm.org>
40
41 * semantics.c (finish_compound_lteral): Don't wrap VECTOR_TYPEs in a
42 TARGET_EXPR.
43
3ba065e8
JM
442016-04-19 Jason Merrill <jason@redhat.com>
45
76f39440
JM
46 PR c++/66543
47 * expr.c (mark_exp_read): Handle NON_DEPENDENT_EXPR.
48 * pt.c (make_pack_expansion): Call mark_exp_read.
49 * semantics.c (finish_id_expression): Call mark_type_use in
50 unevaluated context.
51
218e9dde
JM
52 DR 2137
53 * call.c (implicit_conversion): If we choose a copy constructor
54 for list-initialization from the same type, the conversion is an
55 exact match.
56
06ec22b7
JM
57 * constexpr.c (breaks): Handle EXIT_EXPR.
58 (cxx_eval_loop_expr): Handle COMPOUND_EXPR body.
59 (cxx_eval_constant_expression): Handle EXIT_EXPR, improve handling
60 of COMPOUND_EXPR.
61
f937929e
JM
62 PR c++/68206
63 PR c++/68530
64 * constexpr.c (potential_constant_expression_1): Handle LOOP_EXPR
65 and GOTO_EXPR.
66
b1e47084
JM
67 * pt.c (tsubst_expr): Remove shadowing declaration.
68 (tsubst_pack_expansion): Add assert.
69
70 * semantics.c (add_decl_expr): Use DECL_SOURCE_LOCATION.
71
3ba065e8
JM
72 PR c++/70522
73 * name-lookup.c (qualified_lookup_using_namespace): Look through
74 hidden names.
75
fe37c7af
MM
762016-04-18 Michael Matz <matz@suse.de>
77
78 * class.c (build_vtable): Use SET_DECL_ALIGN and SET_TYPE_ALIGN.
79 (layout_class_type): Ditto.
80 (build_base_field): Use SET_DECL_ALIGN.
81 (fixup_attribute_variants): Use SET_TYPE_ALIGN.
82 * decl.c (duplicate_decls): Use SET_DECL_ALIGN.
83 (record_unknown_type): Use SET_TYPE_ALIGN.
84 (cxx_init_decl_processing): Ditto.
85 (copy_type_enum): Ditto.
86 (grokfndecl): Use SET_DECL_ALIGN.
87 (copy_type_enum): Use SET_TYPE_ALIGN.
88 * pt.c (instantiate_class_template_1): Use SET_TYPE_ALIGN.
89 (tsubst): Ditto.
90 * tree.c (cp_build_qualified_type_real): Use SET_TYPE_ALIGN.
91 * lambda.c (maybe_add_lambda_conv_op): Use SET_DECL_ALIGN.
92 * method.c (implicitly_declare_fn): Use SET_DECL_ALIGN.
93 * rtti.c (emit_tinfo_decl): Ditto.
94
81c160c6
JM
952016-04-18 Jason Merrill <jason@redhat.com>
96
97 PR c++/70690
98 PR c++/70528
99 * class.c (type_maybe_constexpr_default_constructor): New.
100 (type_has_constexpr_default_constructor): Revert.
101
a4186552
SL
1022016-04-16 Sandra Loosemore <sandra@codesourcery.com>
103
104 PR target/1078
105
106 * tree.c (cxx_attribute_table): Remove "com_interface" entry.
107 (handle_com_interface_attribute): Delete.
108
a7b12f1f
JM
1092016-04-15 Jason Merrill <jason@redhat.com>
110
3d8dfcb4
JM
111 PR c++/70685
112 * constexpr.c (get_fundef_copy): Handle null *slot.
113
a7b12f1f
JM
114 PR c++/70505
115 * pt.c (tsubst_baselink): Give the new TEMPLATE_ID_EXPR
116 unknown_type_node, too.
117
70f4fdeb
JJ
1182016-04-15 Jason Merrill <jason@redhat.com>
119 Nathan Sidwell <nathan@acm.org>
120
121 PR c++/70594
122 * constexpr.c (constexpr_call_table): Preserve in GC.
123 (struct fundef_copy, struct fundef_copies_table_t): Delete.
124 (fundef_copies_table): Preserve in GC. Change to pointer to
125 tree->tree hash.
126 (maybe_initialize_fundef_copies_table): Adjust.
127 (get_fundef_copy): Return a TREE_LIST. Use non-inserting search.
128 (save_fundef_copy): Adjust for a TREE_LIST.
129 (cxx_eval_call_expression): Adjust for a fundef_copy TREE_LIST.
130 (fini_constexpr): New.
131 * cp-tree.h (fini_constexpr): Declare.
132 * decl2.c (c_parse_final_cleanups): Call fini_constexpr.
133
dda1bf61
JJ
1342016-04-15 Jakub Jelinek <jakub@redhat.com>
135
136 PR c/70436
137 * parser.c (cp_parser_pragma): Add IF_P argument, pass it down
138 where needed.
139 (cp_parser_declaration_seq_opt, cp_parser_member_specification_opt,
140 cp_parser_objc_interstitial_code, cp_parser_omp_declare_simd,
141 cp_parser_oacc_routine): Adjust cp_parser_pragma callers.
142 (cp_parser_statement): Likewise. Adjust cp_parser_cilk_for caller.
143 (cp_parser_omp_structured_block): Add IF_P argument, pass it down to
144 cp_parser_statement.
145 (cp_parser_oacc_data, cp_parser_oacc_host_data, cp_parser_oacc_loop,
146 cp_parser_oacc_kernels_parallel, cp_parser_omp_critical,
147 cp_parser_omp_simd, cp_parser_omp_for, cp_parser_omp_master,
148 cp_parser_omp_ordered, cp_parser_omp_parallel, cp_parser_omp_single,
149 cp_parser_omp_task, cp_parser_omp_taskgroup, cp_parser_omp_distribute,
150 cp_parser_omp_teams, cp_parser_omp_target_data, cp_parser_omp_target,
151 cp_parser_omp_taskloop, cp_parser_omp_construct,
152 cp_parser_cilk_grainsize, cp_parser_cilk_simd, cp_parser_cilk_for):
153 Add IF_P argument, pass it down where needed.
154 (cp_parser_omp_for_loop): Likewise. Clear IF_P if nbraces.
155 (cp_parser_omp_sections_scope): Adjust cp_parser_omp_structured_block
156 calls.
157
3ae9a8b7
JM
1582016-04-14 Jason Merrill <jason@redhat.com>
159
8e718ecb
JM
160 PR c++/70494
161 * decl.c (cxx_maybe_build_cleanup): Handle non-decls.
162 * typeck2.c (split_nonconstant_init_1): Use it.
163
26144dde
JM
164 PR c++/70528
165 * class.c (type_has_constexpr_default_constructor): Return true
166 for an implicitly declared constructor.
167
65bddf28
JM
168 PR c++/70622
169 * parser.c (cp_parser_init_declarator): Add auto_result parm.
170 (cp_parser_simple_declaration): Pass it.
171 (strip_declarator_types): New.
172
d25a101f
JM
173 PR c++/70543
174 * pt.c (value_dependent_expression_p) [VAR_DECL]: A type-dependent
175 initializer also makes the variable value-dependent.
176
3ae9a8b7
JM
177 PR c++/70648
178 * constexpr.c (cxx_eval_store_expression): Also copy
179 CONSTRUCTOR_NO_IMPLICIT_ZERO.
180
d8747845
MS
1812016-04-14 Martin Sebor <msebor@redhat.com>
182
183 PR c++/69517
184 PR c++/70019
185 PR c++/70588
186 * cp-tree.h, decl.c, init.c, typeck2.c: Revert.
187
9f285ccb
JM
1882016-04-14 Jason Merrill <jason@redhat.com>
189
190 * call.c, decl.c, error.c, cp-tree.h, decl.c: Revert empty
191 parameter ABI change.
192
342fac95
MS
1932016-04-13 Martin Sebor <msebor@redhat.com>
194
195 PR c++/69517
196 PR c++/70019
197 PR c++/70588
198 * cp-tree.h (throw_bad_array_length, build_vla_check): Declare new
199 functions.
200 * decl.c (check_initializer, cp_finish_decl): Call them.
201 (reshape_init_r): Reject incompletely braced intializer-lists
202 for VLAs.
203 * init.c (throw_bad_array_length, build_vla_check)
204 (build_vla_size_check, build_vla_init_check): Define new functions.
205 * typeck2.c (split_nonconstant_init_1): Use variably_modified_type_p()
206 to detect a VLA.
207 (store_init_value): Same.
208
5655267c
JM
2092016-04-13 Jason Merrill <jason@redhat.com>
210
2ee35bea
JM
211 Warn about empty parameter ABI with -Wabi=9.
212 * call.c (empty_class_msg, mark_for_abi_warning)
213 (warn_empty_class_abi): New.
214 (build_call_a): Use them.
215 * decl.c (store_parm_decls): Use mark_for_abi_warning.
216 * error.c (pp_format_to_string): New.
217
5655267c
JM
218 Pass empty class parameters like C.
219 * call.c (pass_as_empty_struct, empty_class_arg): New.
220 (type_passed_as, build_x_va_arg): Use pass_as_empty_struct.
221 (build_call_a): Use empty_class_arg.
222 * cp-tree.h (CPTI_EMPTY_STRUCT, empty_struct_type): New.
223 * decl.c (cxx_init_decl_processing): Create empty_struct_type.
224
0d9cdbdd
JM
2252016-04-13 Jason Merrill <jason@redhat.com>
226
227 PR c++/70627
228 * decl.c (start_enum): Don't change an existing ENUM_UNDERLYING_TYPE.
229
545a4139
PC
2302016-04-13 Paolo Carlini <paolo.carlini@oracle.com>
231
232 PR c++/70635
233 * pt.c (resolve_typename_type): Fix typos in infinite recursion
234 avoidance mechanism.
235
eb07f187
JM
2362016-04-13 Jason Merrill <jason@redhat.com>
237
463d91c6
JM
238 PR c++/70634
239 * pt.c (instantiation_dependent_uneval_expression_p): Split out
240 from instantiation_dependent_expression_p.
241 (value_dependent_expression_p): Use it for unevaluated operands.
242 (instantiation_dependent_r): Don't check value-dependence.
243 (instantiation_dependent_expression_p): Check
244 value-dependence of the expression as a whole.
245 * cp-tree.h: Declare instantiation_dependent_uneval_expression_p.
246 * semantics.c (finish_decltype_type): Use it.
247
eb07f187
JM
248 * constexpr.c (potential_nondependent_constant_expression): New.
249 (potential_nondependent_static_init_expression): New.
250 (maybe_constant_value_1, fold_non_dependent_expr)
251 (maybe_constant_init): Use them.
252 * pt.c (instantiate_non_dependent_expr_sfinae)
253 (instantiate_non_dependent_or_null, convert_nontype_argument): Use
254 them.
255 * cp-tree.h: Declare them.
256
3eddc1c9
JJ
2572016-04-13 Jakub Jelinek <jakub@redhat.com>
258
259 PR c++/70594
260 * decl.c (pop_labels_1): Removed.
261 (note_label, sort_labels): New functions.
262 (pop_labels): During named_labels traversal, just push the slot
263 pointers into a vector, then qsort it by DECL_UID and only then
264 call pop_label and chain it into BLOCK_VARS.
265
9d409934
JM
2662016-04-13 Jason Merrill <jason@redhat.com>
267
268 PR c++/70615
269 * cp-gimplify.c (cp_genericize_r): Expand PTRMEM_CST here.
270 (cp_gimplify_expr): Not here.
271
92886d3e
PP
2722016-04-12 Patrick Palka <ppalka@gcc.gnu.org>
273
274 PR c++/70610
275 * tree.c (lvalue_kind) [NON_DEPENDENT_EXPR]: Unconditionally
276 recurse into it.
277 * typeck.c (build_x_conditional_expr): Unconditionally remember
278 that the result is an lvalue or xvalue.
279
08d6d8bb
JM
2802016-04-12 Jason Merrill <jason@redhat.com>
281
282 * class.c (is_really_empty_class): A zero-length array is empty.
283 An unnamed bit-field doesn't make a class non-empty.
284
2b2f52bc
PC
2852016-04-12 Paolo Carlini <paolo.carlini@oracle.com>
286
287 PR c++/68722
288 * parser.c (cp_parser_cache_defarg): When file ends in default
289 argument simply return error_mark_node.
290
d4619dc1
NS
2912016-04-12 Nathan Sidwell <nathan@acm.org>
292
293 PR c++/70501
294 * constexpr.c (cxx_eval_bare_aggregate): Handle VECTOR_TYPE
295 similarly to PMF.
296
a9c2f3d9
JM
2972016-04-11 Jason Merrill <jason@redhat.com>
298
299 * mangle.c (decl_is_template_id): The template itself counts as a
300 template-id.
301
56cfb596
PP
3022016-04-08 Patrick Palka <ppalka@gcc.gnu.org>
303
304 PR c++/70590
305 PR c++/70452
306 * constexpr.c (cxx_eval_outermost_expression): Call unshare_expr
307 on the result if it's not a CONSTRUCTOR.
308
0146e25f
PP
3092016-04-07 Patrick Palka <ppalka@gcc.gnu.org>
310
311 PR c++/70452
312 * constexpr.c (find_constructor): New function.
313 (unshare_constructor): New function.
314 (cxx_eval_call_expression): Use unshare_constructor instead of
315 unshare_expr.
316 (find_array_ctor_elt): Likewise.
317 (cxx_eval_vec_init_1): Likewise.
318 (cxx_eval_store_expression): Likewise.
319 (cxx_eval_constant_expression): Likewise.
320
6b37bdaf
PP
3212016-04-06 Patrick Palka <ppalka@gcc.gnu.org>
322
323 PR c/70436
324 * cp-tree.h (FOR_EACH_CLONE): Restructure macro to avoid
325 potentially generating a future -Wparentheses warning in its
326 callers.
327
469abfd2
JM
3282016-04-06 Jason Merrill <jason@redhat.com>
329
330 * class.c (check_abi_tags): Fix function template handling.
331
c08d28ac
NS
3322016-04-05 Nathan Sidwell <nathan@acm.org>
333
334 PR c++/70512
335 * class.c (fixup_may_alias): New.
336 (fixup_attribute_variants): Call it.
337
c0daf32d
PP
3382016-04-05 Patrick Palka <ppalka@gcc.gnu.org>
339
340 PR c++/70452
341 * constexpr.c (struct fundef_copy): New struct.
342 (struct fundef_copies_table_t): New struct.
343 (fundef_copies_table): New static variable.
344 (maybe_initialize_fundef_copies_table): New static function.
345 (get_fundef_copy): New static function.
346 (save_fundef_copy): New static function.
347 (cxx_eval_call_expression): Use get_fundef_copy, and
348 save_fundef_copy.
349 (constexpr_call_table): Add "deletable" GTY marker.
350
7a7ac32a
PP
3512016-04-05 Patrick Palka <ppalka@gcc.gnu.org>
352
353 PR c++/70452
354 * cp-tree.h (class cache_map): Remove.
355 * constexpr.c (cv_cache): Change type to
356 GTY((deletable)) hash_map<tree, tree> *.
357 (maybe_constant_value): Adjust following the change to cv_cache.
358 (clear_cv_cache): New static function.
359 (clear_cv_and_fold_caches): Use it.
360 * cp-gimplify.c (fold_cache): Change type to
361 GTY((deletable)) hash_map<tree, tree> *.
362 (clear_fold_cache): Adjust following the change to fold_cache.
363 (cp_fold): Likewise.
364
abdc16c8
MS
3652016-04-02 Martin Sebor <msebor@redhat.com>
366
367 PR c++/67376
368 PR c++/70170
369 PR c++/70172
370 PR c++/70228
371 * constexpr.c (diag_array_subscript): New function.
372 (cxx_eval_array_reference): Detect out of bounds array indices.
373
ddd6d421
JM
3742016-04-01 Jason Merrill <jason@redhat.com>
375
376 PR c++/70449
377 PR c++/70344
378 * pt.c (instantiate_decl): A function isn't fully defined if
379 DECL_INITIAL is error_mark_node.
380 * constexpr.c (cxx_eval_call_expression): Likewise.
381
0f875435
JJ
3822016-04-01 Jakub Jelinek <jakub@redhat.com>
383 Marek Polacek <polacek@redhat.com>
384
385 PR c++/70488
386 * init.c (warn_placement_new_too_small): Test whether
387 DECL_SIZE_UNIT or TYPE_SIZE_UNIT are integers that fit into uhwi.
388
f9bf89bb
NS
3892016-04-01 Nathan Sidwell <nathan@acm.org>
390
391 PR c++/68475
392 * decl.c (check_redeclaration_exception_specification): Check
393 regardless of -fno-exceptions.
394 * typeck2.c (merge_exception_specifiers): Relax assert by checking
395 flag_exceptions too.
396
8f80cbdb
NS
3972016-03-31 Nathan Sidwell <nathan@acm.org>
398
399 * decl.c (start_preparsed_function): Remove unnecessary bracing.
400 (finish_destructor_body): Don't emit operator delete here.
401
88504f34
NS
4022016-03-31 Nathan Sidwell <nathan@acm.org>
403
404 PR c++/70393
405 * constexpr.c (cxx_eval_store_expression): Keep CONSTRUCTOR
406 elements in field order.
407
5fde6a45
MP
4082016-03-31 Marek Polacek <polacek@redhat.com>
409
410 PR c/70297
411 * decl.c (duplicate_decls): Also set TYPE_ALIGN and TYPE_USER_ALIGN.
412
efc3536f
RB
4132016-03-31 Richard Biener <rguenther@suse.de>
414
415 PR c++/70430
416 * typeck.c (cp_build_binary_op): Fix operand order of vector
417 conditional in truth op handling.
418
e0bffbbb
JM
4192016-03-29 Jason Merrill <jason@redhat.com>
420
421 PR c++/70353
422 * decl.c (make_rtl_for_nonlocal_decl): Don't defer local statics
423 in constexpr functions.
424
bfec0b4d
JM
4252016-03-28 Jason Merrill <jason@redhat.com>
426
427 PR c++/70422
428 PR c++/64266
429 PR c++/70353
430 * decl.c, pt.c, constexpr.c: Revert last patch.
431
d7796e23
JM
4322016-03-25 Jason Merrill <jason@redhat.com>
433 Martin Liška <mliska@suse.cz>
434
435 PR c++/64266
436 PR c++/70353
437 Core issue 1962
438 * decl.c (cp_fname_init): Decay the initializer to pointer.
439 (cp_make_fname_decl): Set DECL_DECLARED_CONSTEXPR_P,
440 DECL_VALUE_EXPR, DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
441 Don't call cp_finish_decl.
442 * pt.c (tsubst_expr) [DECL_EXPR]: Set DECL_VALUE_EXPR,
443 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P. Don't call cp_finish_decl.
444 * constexpr.c (cxx_eval_constant_expression) [VAR_DECL]:
445 Handle DECL_VALUE_EXPR.
446
52228180
JM
4472016-03-24 Jason Merrill <jason@redhat.com>
448
8a29084d
JM
449 PR c++/70386
450 * constexpr.c (cxx_eval_bare_aggregate): Handle PMFs.
451
52228180
JM
452 PR c++/70323
453 * constexpr.c (cxx_eval_call_expression): Don't cache result if
454 *overflow_p.
455
887ab4e5
PP
4562016-03-24 Patrick Palka <ppalka@gcc.gnu.org>
457
458 PR c++/62212
459 * tree.c (build_cplus_array_type): Determine type-dependentess
460 with uses_template_parms instead of with dependent_type_p.
461
426b9428
PP
4622016-03-23 Patrick Palka <ppalka@gcc.gnu.org>
463
464 PR c++/70347
465 * typeck.c (process_init_constructor_union): If the initializer
466 is empty, use the union's NSDMI if it has one.
467
cd1588c4
PP
4682016-03-23 Patrick Palka <ppalka@gcc.gnu.org>
469
470 PR c++/70332
471 * pt.c (tsubst_copy) [PARM_DECL]: Handle the use of 'this' in an
472 NSDMI that's part of an aggregrate initialization.
473
04833609
JJ
4742016-03-23 Jakub Jelinek <jakub@redhat.com>
475
928af3bf
JJ
476 PR c++/70001
477 * constexpr.c (cxx_eval_vec_init_1): Reuse CONSTRUCTOR initializers
478 for 1..max even for multi-dimensional arrays. Call unshare_expr
479 on it.
480
61637db3
JJ
481 PR c++/70323
482 * constexpr.c (cxx_eval_constant_expression): Diagnose overflow
483 on TREE_OVERFLOW constants.
484
04833609
JJ
485 PR c++/70376
486 * cp-gimplify.c (genericize_omp_for_stmt): Don't walk OMP_FOR_CLAUSES
487 for OMP_TASKLOOP here.
488 (cp_genericize_r): Handle OMP_TASKLOOP like OMP_TASK, except do call
489 genericize_omp_for_stmt instead of cp_walk_tree on OMP_BODY.
490
05aca4e7
AO
4912016-03-23 Alexandre Oliva <aoliva@redhat.com>
492 Jason Merrill <jason@redhat.com>
493 Jakub Jelinek <jakub@redhat.com>
494
495 PR c++/69315
496 * cp-tree.h (defer_mark_used_calls, deferred_mark_used_calls): Remove.
497 * decl.c (defer_mark_used_calls, deferred_mark_used_calls): Remove.
498 (finish_function): Don't set or test them.
499 * decl2.c (mark_used): Don't handle defer_mark_used_calls.
500
96a4ef9d
JM
5012016-03-23 Jason Merrill <jason@redhat.com>
502
503 PR c++/70344
504 * constexpr.c (cxx_eval_call_expression): Catch invalid recursion.
505
fbdb6baf
MP
5062016-03-23 Marek Polacek <polacek@redhat.com>
507
508 PR c++/69884
509 * pt.c (canonicalize_type_argument): Use OPT_Wignored_attributes.
510
6cedf922
IE
5112016-03-22 Ilya Enkovich <enkovich.gnu@gmail.com>
512
513 * call.c (build_conditional_expr_1): Always use original
514 condition type for vector type checks and build.
515
16f6d7dc
PP
5162016-03-22 Patrick Palka <ppalka@gcc.gnu.org>
517
518 PR c++/70096
519 * pt.c (tsubst_decl): Clear the DECL_MODE of the new decl.
520
a3e2b438
PP
5212016-03-22 Patrick Palka <ppalka@gcc.gnu.org>
522
523 PR c++/70204
524 * constexpr.c (non_const_var_error): Check
525 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
526
ad779205
RH
5272016-03-21 Richard Henderson <rth@redhat.com>
528
529 PR c++/70273
530 * decl.c (notice_forced_label_r): New.
531 (cp_finish_decl): Use it.
532
683b8101
JM
5332016-03-21 Jason Merrill <jason@redhat.com>
534
535 PR c++/70285
536 * cp-gimplify.c (cp_fold) [COND_EXPR]: Handle bit-fields.
537
eb0dbdc7
JM
5382016-03-18 Jason Merrill <jason@redhat.com>
539
86461cad
JM
540 PR c++/70139
541 * constexpr.c (cxx_eval_call_expression): Fix trivial copy.
542
b5a28d80
JM
543 PR c++/70147
544 * class.c (vptr_via_virtual_p): New.
545 (most_primary_binfo): Factor out of build_rtti_vtbl_entries.
546 * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs): Don't clear
547 a vptr from any virtual base in a not-in-charge 'structor.
548
bf08acda
JM
549 * decl.c (build_clobber_this): Factor out of
550 start_preparsed_function and begin_destructor_body. Handle
551 virtual bases better.
552
eb0dbdc7
JM
553 * class.c (build_if_in_charge): Split out from build_base_path.
554 * init.c (expand_virtual_init, expand_default_init): Use it.
555 * call.c (build_special_member_call): Use it.
556
dd125026
JJ
5572016-03-18 Jakub Jelinek <jakub@redhat.com>
558
559 PR c++/70267
560 * init.c (build_new_1): Complain and return error_mark_node
561 if alloc_fn is not _Jv_AllocObject function returning pointer.
562
91914f0a
PP
5632016-03-18 Patrick Palka <ppalka@gcc.gnu.org>
564
565 PR c++/70205
566 * search.c (adjust_result_of_qualified_name_lookup): Don't
567 update the BASELINK_BINFO of DECL if the second call
568 to lookup_base fails.
569
753a8910
PP
5702016-03-18 Patrick Palka <ppalka@gcc.gnu.org>
571
572 PR c++/70218
573 * parser.c (cp_parser_lambda_expression): Move call to
574 pop_deferring_access_checks ahead of the call to
575 cp_parser_end_tentative_firewall.
576
a3aad0e6
JJ
5772016-03-17 Jakub Jelinek <jakub@redhat.com>
578
17366700
JJ
579 PR c++/70144
580 * cp-tree.h (magic_varargs_p): Return int instead of bool.
581 * call.c (magic_varargs_p): Return int instead of bool, return 2 for
582 Cilk+ reductions, otherwise 1 for magic varargs and 0 for normal
583 varargs.
584 (build_over_call): If magic_varargs_p == 2, call reject_gcc_builtin,
585 if magic_varargs_p == 1, call decay_conversion
586 instead of mark_type_use. Don't store error_mark_node arguments to
587 argarray, instead return error_mark_node.
588
a3aad0e6
JJ
589 PR c++/70272
590 * decl.c (begin_destructor_body): Don't insert clobber if
591 is_empty_class (current_class_type).
592
b1970801
MP
5932016-03-17 Marek Polacek <polacek@redhat.com>
594
595 PR c++/70194
596 * typeck.c (warn_for_null_address): New function.
597 (cp_build_binary_op): Call it.
598
c5e003cf
JM
5992016-03-16 Jason Merrill <jason@redhat.com>
600
601 PR c++/70259
602 * decl.c (start_preparsed_function): Don't clobber an empty base.
603
1935f250
JJ
6042016-03-16 Jakub Jelinek <jakub@redhat.com>
605
6651c93e
JJ
606 PR c++/70147
607 * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs): Conditionalize
608 BINFO_VIRTUAL_P vtable clearing on current_in_charge_parm.
609
1935f250
JJ
610 PR c++/70147
611 * cp-ubsan.c (cp_ubsan_maybe_initialize_vtbl_ptrs): Temporarily
612 set in_base_initializer.
613
42c729c5
MP
6142016-03-15 Marek Polacek <polacek@redhat.com>
615
616 PR c++/70209
617 * tree.c (strip_typedefs): Call strip_typedefs again on the
618 DECL_ORIGINAL_TYPE result.
619
3f91db69
JM
6202016-03-15 Jason Merrill <jason@redhat.com>
621
d1ccf407
JM
622 PR c++/70095
623 * pt.c (instantiate_decl): Fix call to variable_template_p.
624
3f91db69
JM
625 PR c++/70141
626 * pt.c (for_each_template_parm_r): Always walk into TYPENAME_TYPE.
627
598a208c
CC
6282016-03-14 Casey Carter <casey@carter.net>
629 Jason Merrill <jason@redhat.com>
630
08a1cadc 631 P0184R0: Generalizing the Range-Based For Loop
598a208c
CC
632 * parser.c (cp_convert_range_for): Set the type of __end separately.
633 (cp_parser_perform_range_for_lookup): Allow different begin/end
634 types if they are comparable.
635
3f1e5d3a
PP
6362016-03-12 Patrick Palka <ppalka@gcc.gnu.org>
637
638 PR c++/70106
639 * semantics.c (force_paren_expr): Just build a PAREN_EXPR when
640 processing_template_decl and EXPR is a SCOPE_REF.
641
b87a8d7d
PP
6422016-03-10 Patrick Palka <ppalka@gcc.gnu.org>
643 Jakub Jelinek <jakub@redhat.com>
644
645 PR c++/70001
646 * constexpr.c (cxx_eval_vec_init_1): For pre_init case, reuse
647 return value from cxx_eval_constant_expression from earlier
648 elements if it is valid constant initializer requiring no
649 relocations.
650
d49b0aa0
MP
6512016-03-10 Marek Polacek <polacek@redhat.com>
652
653 PR c++/70153
654 * cp-gimplify.c (cp_fold): Handle UNARY_PLUS_EXPR.
655
96b3c82d
CP
6562016-03-09 Cesar Philippidis <cesar@codesourcery.com>
657
658 * parser.c (cp_parser_oacc_loop): Update cclauses and clauses
659 when calling c_finish_omp_clauses.
660
1e546b68
JM
6612016-03-08 Jason Merrill <jason@redhat.com>
662
80aac5c8
JM
663 * parser.c (cp_parser_diagnose_invalid_type_name): Give helpful
664 diagnostic for use of "concept".
665 (cp_parser_requires_clause_opt): And "requires".
666 (cp_parser_type_parameter, cp_parser_late_return_type_opt)
667 (cp_parser_explicit_template_declaration): Adjust.
668 * Make-lang.in (check-c++-all): Add "concepts" to std list.
669
1e546b68
JM
670 P0036R0: Unary Folds and Empty Parameter Packs
671 * pt.c (expand_empty_fold): Remove special cases for *,+,&,|.
672
56aae4b7
JJ
6732016-03-08 Jakub Jelinek <jakub@redhat.com>
674
d259b234
JJ
675 PR c++/70135
676 * constexpr.c (cxx_eval_loop_expr): Forget saved values of SAVE_EXPRs
677 even after the last iteration of the loop.
678
56aae4b7
JJ
679 * decl.c (duplicate_decls): Fix spelling - becuase -> because.
680
dbb23418
PP
6812016-03-07 Patrick Palka <ppalka@gcc.gnu.org>
682
683 PR c++/66786
684 * pt.c (get_template_info): Handle PARM_DECL.
685 (template_class_depth): Check DECL_P instead of
686 VAR_OR_FUNCTION_DECL_P.
687
d96e8407
JM
6882016-03-05 Jason Merrill <jason@redhat.com>
689
690 PR c++/67364
691 * constexpr.c (cxx_eval_store_expression): Replace
692 CONSTRUCTOR_ELTS in nested CONSTRUCTORs, too.
693
7a3a3fad
PP
6942016-03-05 Patrick Palka <ppalka@gcc.gnu.org>
695
696 PR c++/66786
697 * pt.c (template_class_depth): Given a lambda type, iterate
698 into its LAMBDA_TYPE_EXTRA_SCOPE field instead of its
699 TYPE_CONTEXT. Given a VAR_DECL, iterate into its
700 CP_DECL_CONTEXT.
701
d5bcd6d4
JM
7022016-03-04 Jason Merrill <jason@redhat.com>
703
704 PR c++/69203
705 * cp-tree.h (COND_EXPR_IS_VEC_DELETE): New.
706 * init.c (build_vec_delete_1): Set it.
707 * constexpr.c (potential_constant_expression_1) [COND_EXPR]: Check it.
708
0c8825de
JJ
7092016-03-04 Jakub Jelinek <jakub@redhat.com>
710
411d61c4
JJ
711 * decl.c (start_preparsed_function): Don't emit start clobber at the
712 start of constructor clones.
713
0c8825de
JJ
714 PR c++/70035
715 * cp-tree.h (cp_ubsan_maybe_initialize_vtbl_ptrs): New prototype.
716 * decl.c (start_preparsed_function): Call
717 cp_ubsan_maybe_initialize_vtbl_ptrs if needed.
718 * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs,
719 cp_ubsan_maybe_initialize_vtbl_ptrs): New functions.
720
b54eff8b
JM
7212016-03-04 Jason Merrill <jason@redhat.com>
722
188e53bd
JM
723 PR c++/67364
724 * constexpr.c (cxx_eval_component_reference): Further tweak.
725
39dce2b7
JM
726 * constexpr.c (struct constexpr_ctx): Add save_exprs field.
727 (cxx_eval_loop_expr): Discard SAVE_EXPR values before looping.
728 (cxx_eval_constant_expression) [SAVE_EXPR]: Add it to the set.
729 (cxx_eval_outermost_constant_expr, is_sub_constant_expr): Initialize.
730
b54eff8b
JM
731 PR c++/70067
732 * tree.c (strip_typedefs): Handle TYPENAME_TYPE lookup finding the
733 same type.
734
639475f0
JM
7352016-03-03 Jason Merrill <jason@redhat.com>
736
b47d1d90
JM
737 * method.c (synthesized_method_walk): operator= can also be constexpr.
738
a0a6a8c9
JM
739 * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Get
740 LAMBDA_EXPR_RETURN_TYPE from the instantiated closure.
741
264fd142
JM
742 PR c++/67164
743 * pt.c (copy_template_args): New.
744 (tsubst_pack_expansion): Use it.
745
45c3e69b
JM
746 * call.c (build_aggr_conv): Use get_nsdmi.
747
16dc6b17
JM
748 PR c++/51406
749 * typeck.c (build_static_cast_1): Avoid folding back to lvalue.
750
639475f0
JM
751 PR c++/67364
752 * constexpr.c (cxx_eval_component_reference): Just return an empty
753 CONSTRUCTOR for an empty class.
754
7f0e23e9
JM
7552016-03-01 Jason Merrill <jason@redhat.com>
756
5c969cb8
JM
757 PR c++/70036
758 * parser.c (cp_parser_requires_clause): Call
759 check_for_bare_parameter_packs.
760
c8a66fc9
JM
761 PR c++/51489
762 * constexpr.c (cxx_eval_binary_expression): Don't VERIFY_CONSTANT
763 the operands.
764
7f0e23e9
JM
765 PR c++/69995
766 * constexpr.c (cxx_eval_call_expression): Unshare arg.
767 (cxx_eval_constant_expression) [DECL_EXPR]: Unshare init.
768 [TARGET_EXPR]: Unshare init.
769
76d881bf
PP
7702016-03-01 Patrick Palka <ppalka@gcc.gnu.org>
771
772 PR c++/68948
773 PR c++/69961
774 * pt.c (tsubst_baselink): Reinstate the check for an invalid
775 constructor call.
776
7574c916
JM
7772016-02-28 Jason Merrill <jason@redhat.com>
778
779 PR c++/69995
780 * constexpr.c (cxx_eval_store_expression): Unshare init.
781
56cde077
JM
7822016-02-26 Jason Merrill <jason@redhat.com>
783
784 PR c++/69958
785 * pt.c (make_argument_pack): New.
786 (tsubst_copy) [SIZEOF_EXPR]: Handle partial expansion.
787 (tsubst_copy_and_build): Likewise.
788
6284a979
JM
7892016-02-25 Jason Merrill <jason@redhat.com>
790
8ba8c375
JM
791 PR c++/69889
792 * cp-tree.h (AGGR_INIT_FROM_THUNK_P): New.
793 * tree.c (build_aggr_init_expr): Set it.
794 * semantics.c (simplify_aggr_init_expr): Check it.
795 * cp-gimplify.c (cp_genericize_r): Don't walk into
796 a call/aggr_init from a thunk.
797
bd28a34f
JM
798 PR c++/69842
799 * method.c (forward_parm): Handle parameter packs.
800 * lambda.c (maybe_add_lambda_conv_op): Use it for them.
801
6a0cc1cd
JM
802 PR c++/67364
803 * constexpr.c (cxx_eval_component_reference): Don't complain about
804 unevaluated empty classes.
805
6284a979
JM
806 PR c++/68049
807 * tree.c (strip_typedefs): Use DECL_ORIGINAL_TYPE.
808
1137001c
PP
8092016-02-25 Patrick Palka <ppalka@gcc.gnu.org>
810
811 PR c++/69736
812 * cp-tree.h (REF_PARENTHESIZED_P): Adjust documentation.
813 (maybe_undo_parenthesized_ref): Declare.
814 * semantics.c (maybe_undo_parenthesized_ref): Split out from
815 check_return_expr.
816 (finish_call_expr): Use it.
817 * typeck.c (check_return_expr): Use it.
818 * pt.c (tsubst_copy_and_build) [INDIRECT_REF]: Retain the
819 REF_PARENTHESIZED_P flag.
820
03ca8fb3
JJ
8212016-02-24 Jakub Jelinek <jakub@redhat.com>
822
823 PR c++/69922
824 * class.c (build_base_path): Set TREE_NO_WARNING on the null_test.
825 Avoid folding it.
826 * init.c (build_vec_delete_1, build_delete): Don't fold the non-NULL
827 tests.
828 * cp-gimplify.c (cp_fold): For TREE_NO_WARNING comparisons with NULL,
829 unless they are folded into INTEGER_CST, error_mark_node or some
830 comparison with NULL, avoid folding them and use either the original
831 comparison or non-folded comparison of folded arguments.
832 * cp-ubsan.c (cp_ubsan_instrument_vptr): Set TREE_NO_WARNING on the
833 comparison, don't fold the comparison right away.
834
944e9f5f
JM
8352016-02-24 Jason Merrill <jason@redhat.com>
836
837 PR c++/69323
838 * friend.c (make_friend_class): Likewise.
839 * decl.c (lookup_and_check_tag): Diagnose invalid dependent friend.
840
b8599b68
JM
8412016-02-24 Jason Merrill <jason@redhat.com>
842
843 PR c++/69323
844 * pt.c (instantiate_class_template_1): Set
845 processing_template_decl before substituting friend_type.
846
3b96b93a
MS
847016-02-24 Martin Sebor <msebor@redhat.com>
848
849 PR c++/69912
850 * tree.c (build_ctor_subob_ref): Compare types' main variants
851 instead of the types as they are.
852
28577b86
JM
8532016-02-24 Jason Merrill <jason@redhat.com>
854
a021961c
JM
855 * decl.c (start_preparsed_function): Condition ctor clobber on
856 flag_lifetime_dse > 1.
857
28577b86
JM
858 * cp-gimplify.c (cp_fold): Don't fold constexpr calls if -fno-inline.
859
2207c599
JM
8602016-02-19 Jason Merrill <jason@redhat.com>
861
862 PR c++/69743
863 * call.c (remaining_arguments): No longer static.
864 * cp-tree.h: Declare it.
865 * pt.c (more_specialized_fn): Use it.
866
3a27b4db
JJ
8672016-02-19 Jakub Jelinek <jakub@redhat.com>
868 Bernd Edlinger <bernd.edlinger@hotmail.de>
869
870 * Make-lang.in: Invoke gperf with -L C++.
871 * cfns.gperf: Remove prototypes for hash and libc_name_p
872 inlines.
873 * cfns.h: Regenerated.
874 * except.c (nothrow_libfn_p): Adjust.
875
7a965d51
JJ
8762016-02-19 Jakub Jelinek <jakub@redhat.com>
877
878 PR c++/69850
879 * rtti.c (ifnonnull): Set TREE_NO_WARNING on the condition, use
880 NE_EXPR instead of EQ_EXPR and swap last two arguments on COND_EXPR.
881
200e869c
PP
8822016-02-19 Patrick Palka <ppalka@gcc.gnu.org>
883
884 PR c++/68948
885 * pt.c (tsubst_baselink): Don't diagnose an invalid constructor
886 call here.
887 * semantics.c (finish_call_expr): Don't assume a constructor
888 call is dependent if only the "this" pointer is dependent. When
889 building a constructor call, always use a dummy object.
890
19e21586
JJ
8912016-02-19 Jakub Jelinek <jakub@redhat.com>
892
03a616ac
JJ
893 PR c++/69850
894 * init.c (build_vec_delete_1): Set TREE_NO_WARNING on the NE_EXPR
895 condition.
896 * cp-gimplify.c (cp_fold): Propagate TREE_NO_WARNING from binary
897 operators if folding preserved the binop, just with different
898 arguments.
899
19e21586
JJ
900 PR c++/67767
901 * parser.c (cp_parser_std_attribute_spec_seq): Don't assume
902 attr_spec is always single element chain, chain all the attributes
903 properly together in the right order.
904
747b61fc
JM
9052016-02-18 Jason Merrill <jason@redhat.com>
906
907 * mangle.c (maybe_check_abi_tags): Add for_decl parm. Call
908 mangle_decl.
909 (mangle_decl): Call maybe_check_abi_tags for function scope.
910 (mangle_guard_variable): Call maybe_check_abi_tags here.
911 (write_guarded_var_name): Not here.
912
50ccdf5b
JM
9132016-02-17 Jason Merrill <jason@redhat.com>
914
fa837fb6
JM
915 PR c++/65985
916 * constexpr.c (build_constexpr_constructor_member_initializers):
917 Handle an additional STATEMENT_LIST.
918
bcb5f3c9
JM
919 PR c++/68585
920 * constexpr.c (cxx_eval_bare_aggregate): Fix 'changed' detection.
921
50ccdf5b
JM
922 PR c++/68679
923 * decl2.c (reset_type_linkage_2): Look through member templates.
924
932c0da4
JJ
9252016-02-17 Jakub Jelinek <jakub@redhat.com>
926
927 PR c++/69850
928 * init.c (build_delete): Set TREE_NO_WARNING on ifexp.
929
0f02dd56
JM
9302016-02-17 Jason Merrill <jason@redhat.com>
931
932 PR c++/69842
933 * method.c (forward_parm): Split out from...
934 (add_one_base_init): ...here.
935 * lambda.c (maybe_add_lambda_conv_op): Use it.
936
6bab4c63
JM
9372016-02-16 Jason Merrill <jason@redhat.com>
938
939 PR c++/10200
940 PR c++/69753
941 * call.c, cp-tree.h, name-lookup.c, pt.c, search.c, semantics.c,
942 tree.c, typeck2.c: Revert earlier changes.
943 * parser.c (cp_parser_lookup_name): Ignore namespace-scope
944 non-type templates after -> or .
945
bf14eba2
JJ
9462016-02-16 Jakub Jelinek <jakub@redhat.com>
947
948 PR c/69835
949 * typeck.c (cp_build_binary_op): Revert 2015-09-09 change.
950
7128d6ab
JM
9512016-02-16 Jason Merrill <jason@redhat.com>
952
953 PR c++/69657
954 * name-lookup.c (lookup_qualified_name): Add find_hidden parm.
955 (set_decl_namespace): Pass it. Complain about finding a hidden friend.
956 * name-lookup.h: Adjust.
957
ba539195
JN
9582016-02-16 James Norris <jnorris@codesourcery.com>
959
960 * parser.c (cp_parser_oacc_data_clause_deviceptr): Remove checking.
961 * semantics.c (finish_omp_clauses): Add deviceptr checking.
962
f0516ca4
JJ
9632016-02-15 Jakub Jelinek <jakub@redhat.com>
964
965 PR c++/69658
966 * init.c (expand_default_init): Only call reshape_init
967 in the direct-initialization from an initializer list case.
968
fe69277d
JM
9692016-02-15 Jason Merrill <jason@redhat.com>
970
2bd0a2d6
JM
971 PR c++/69753
972 * semantics.c (finish_call_expr): Implicit 'this' does not make
973 the call dependent.
974 * search.c (any_dependent_bases_p): Split out...
975 * name-lookup.c (do_class_using_decl): ...from here.
976 * call.c (build_new_method_call_1): Don't complain about missing object
977 if there are dependent bases. Tweak error.
978 * tree.c (non_static_member_function_p): Remove.
979 * pt.c (type_dependent_expression_p): A member template of a
980 dependent type is dependent.
981 * cp-tree.h: Adjust.
982
fe69277d
JM
983 PR c++/68890
984 * constexpr.c (verify_ctor_sanity): Remove CONSTRUCTOR_NELTS check.
985
38d795d2
PP
9862016-02-12 Patrick Palka <ppalka@gcc.gnu.org>
987
988 PR c++/69098
989 * pt.c (lookup_and_finish_template_variable): New function,
990 extracted from ...
991 (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: ... here. Use it.
992 (tsubst_qualified_id): Consider that EXPR might be a variable
993 template.
994 * typeck.c (check_template_keyword): Don't emit an error
995 if DECL is a variable template.
996
9c582551
JJ
9972016-02-12 Jakub Jelinek <jakub@redhat.com>
998
999 * error.c: Spelling fixes - behaviour -> behavior and
1000 neighbour -> neighbor.
1001 * decl.c: Likewise.
1002 * typeck.c (cp_build_binary_op): Fix up behavior spelling in
1003 diagnostics.
1004 * init.c (build_delete): Likewise.
1005
66756373
JJ
10062016-02-11 Jakub Jelinek <jakub@redhat.com>
1007
1008 PR c/69768
1009 * typeck.c (cp_build_binary_op): cp_fully_fold integer_zerop
1010 arguments for -Waddress warning. Fix up formatting.
1011
0d7d9458
PC
10122016-02-11 Paolo Carlini <paolo.carlini@oracle.com>
1013
1014 PR c++/68726
1015 * pt.c (lookup_template_class_1): Check tsubst return value for
1016 error_mark_node.
1017
3a4219ca
JM
10182016-02-10 Jason Merrill <jason@redhat.com>
1019
46f0d909
JM
1020 PR c++/68926
1021 * pt.c (resolve_nondeduced_context): Add complain parm.
1022 (do_auto_deduction): Pass it.
1023 * cvt.c (convert_to_void): Likewise.
1024 * decl.c (cp_finish_decl): Likewise.
1025 * init.c (build_new): Likewise.
1026 * rtti.c (get_tinfo_decl_dynamic): Likewise.
1027 * semantics.c (finish_decltype_type): Likewise.
1028 * typeck.c (decay_conversion): Likewise.
1029 * cp-tree.h: Adjust declaration.
1030 * call.c (standard_conversion): Add complain parm, pass it along.
1031 (implicit_conversion): Pass it.
1032
89908c8f
JM
1033 PR c++/69657
1034 * name-lookup.c (ambiguous_decl): Call remove_hidden_names.
1035 (lookup_name_real_1): Likewise.
1036 (remove_hidden_names): Handle non-functions too.
1037
ff2faafc
JM
1038 PR c++/10200
1039 * parser.c (cp_parser_lookup_name): When looking for a template
1040 after . or ->, only consider class templates.
1041 (cp_parser_postfix_dot_deref_expression): Handle the current
1042 instantiation. Remember a dependent object expression.
1043 * typeck2.c (build_x_arrow): Handle the current instantiation.
1044
3a4219ca
JM
1045 * ptree.c (debug_tree): Implement for cp_expr.
1046
efb45a9f
PP
10472016-02-08 Patrick Palka <ppalka@gcc.gnu.org>
1048
1049 PR c++/69139
1050 * parser.c (cp_parser_simple_type_specifier): Make the check
1051 for disambiguating between an 'auto' placeholder and an implicit
1052 template parameter more robust.
1053
20a0c6f9
PP
10542016-02-08 Patrick Palka <ppalka@gcc.gnu.org>
1055
1056 PR c++/69283
1057 PR c++/67835
1058 * decl2.c (mark_used): When given a TEMPLATE_DECL, return after
1059 setting its TREE_USED flag.
1060
1374a761
JM
10612016-02-08 Jason Merrill <jason@redhat.com>
1062
1063 PR c++/69657
1064 * name-lookup.c (do_nonmember_using_decl): Leave anticipated
1065 built-ins alone.
1066
f68bc23f
JJ
10672016-02-08 Jakub Jelinek <jakub@redhat.com>
1068
1069 PR c++/59627
1070 * parser.c (cp_parser_omp_declare_reduction): Set assembler name
1071 of the DECL_OMP_DECLARE_REDUCTION_P decls.
1072
eba9e839
MP
10732016-02-08 Marek Polacek <polacek@redhat.com>
1074
1075 PR c++/69688
1076 * constexpr.c (clear_cv_and_fold_caches): Renamed from clear_cv_cache.
1077 Call clear_fold_cache.
1078 * cp-tree.h: Adjust declaration.
1079 * decl.c (finish_enum_value_list): Call clear_cv_and_fold_caches
1080 rather than clear_cv_cache and clear_fold_cache.
1081 * typeck2.c (store_init_value): Call clear_cv_and_fold_caches.
1082
415594bb
JM
10832016-02-08 Jason Merrill <jason@redhat.com>
1084
1085 * cp-tree.h (CONV_FOLD, CONV_BACKEND_CONVERT): New.
1086 * cvt.c (convert): Pass CONV_BACKEND_CONVERT.
1087 (ocp_convert): Use *_maybe_fold.
1088 (cp_convert_to_pointer): Add dofold parameter.
1089 * cp-gimplify.c (cp_fold) [CONVERT_EXPR]: Call convert.
1090
46cb9332
MS
10912016-02-05 Martin Sebor <msebor@redhat.com>
1092
1093 PR c++/69662
1094 * init.c (find_field_init): New function.
1095 (warn_placement_new_too_small): Call it. Handle one-element arrays
1096 at ends of structures special.
1097
0fd9d492
JM
10982016-02-05 Jason Merrill <jason@redhat.com>
1099
1100 PR c++/68948
1101 * semantics.c (finish_expr_stmt): If expr is error_mark_node,
1102 make sure we've seen_error().
1103
76c85fbb
PP
11042016-02-05 Patrick Palka <ppalka@gcc.gnu.org>
1105
1106 PR c++/68948
1107 * pt.c (tsubst_baselink): Diagnose an invalid constructor call
1108 if lookup_fnfields returns NULL_TREE and the name being looked
1109 up has the form A::A.
1110
618d6c1c
PP
11112016-02-04 Patrick Palka <ppalka@gcc.gnu.org>
1112
1113 * constexpr.c (cxx_eval_binary_expression): Fold equality
1114 comparisons involving PTRMEM_CSTs.
1115
d1243d27
JJ
11162016-02-04 Jakub Jelinek <jakub@redhat.com>
1117
1118 * class.c (find_flexarrays): Don't declare dom variable.
1119 (diagnose_flexarray): Likewise.
1120
05dd97db
MS
11212016-02-02 Martain Sebor <msebor@redhat.com>
1122
1123 PR c++/69251
1124 PR c++/69253
1125 PR c++/69290
1126 PR c++/69277
1127 PR c++/69349
1128 * class.c (walk_subobject_offsets): Avoid testing the upper bound
1129 of a flexible array member for equality to null.
1130 (find_flexarrays): Remove spurious whitespace introduced in r231665.
1131 (diagnose_flexarrays): Avoid checking the upper bound of arrays.
1132 (check_flexarrays): Same.
1133 * decl.c (compute_array_index_type): Avoid special case for flexible
1134 array members.
1135 (grokdeclarator): Avoid calling compute_array_index_type for flexible
1136 array members.
1137 * error.c (dump_type_suffix): Revert changes introduced in r231665
1138 and rendered unnecessary by the changes above.
1139 * pt.c (tsubst): Same.
1140 * tree.c (build_ctor_subob_ref): Handle flexible array members.
1141 * typeck2.c (digest_init_r): Revert changes introduced in r231665.
1142 (process_init_constructor_array): Same.
1143 (process_init_constructor_record): Same.
1144
ab4bae0c
PP
11452016-02-03 Patrick Palka <ppalka@gcc.gnu.org>
1146
1147 PR c++/69056
1148 * pt.c (try_one_overload): Handle comparing argument packs so
1149 that there is no conflict if we deduced more arguments of an
1150 argument pack than were explicitly specified.
1151
75a27d35
JJ
11522016-01-31 Jakub Jelinek <jakub@redhat.com>
1153 Jason Merrill <jason@redhat.com>
1154
1155 PR c++/68763
1156 * tree.c (strip_typedefs) [FUNCTION_TYPE]: Avoid building a new
1157 function type if nothing is changing.
1158
b676a079
JM
11592016-01-31 Jason Merrill <jason@redhat.com>
1160
6978c505
JM
1161 PR c++/69009
1162 * pt.c (partial_specialization_p, impartial_args): New.
1163 (instantiate_decl): Call impartial_args.
1164
b1568582
JM
1165 * mangle.c (maybe_check_abi_tags): New.
1166 (write_guarded_var_name): Call it.
1167 (mangle_ref_init_variable): Call check_abi_tags.
1168
b676a079
JM
1169 * pt.c (lookup_template_class_1): Don't share TYPE_ATTRIBUTES
1170 between template and instantiation.
1171
16b77b32
JJ
11722016-01-29 Jakub Jelinek <jakub@redhat.com>
1173
1174 PR debug/66869
1175 * decl.c (wrapup_globals_for_namespace): Warn about unused static
1176 function declarations.
1177
5453bfed
MP
11782016-01-29 Marek Polacek <polacek@redhat.com>
1179
1180 PR c++/69509
1181 PR c++/69516
1182 * constexpr.c (cxx_eval_array_reference): Give the "array subscript
1183 out of bound" error earlier.
1184 * init.c (build_vec_init): Change NE_EXPR into GT_EXPR. Update the
1185 commentary.
1186
e9f69069
PP
11872016-01-29 Patrick Palka <ppalka@gcc.gnu.org>
1188
1189 * name-lookup.c (begin_scope): After reusing a cp_binding_level
1190 structure, update free_binding_level before the structure's
1191 level_chain field gets cleared, not after.
1192
e448880c
JM
11932016-01-28 Jason Merrill <jason@redhat.com>
1194
1195 PR c++/67407
1196 * search.c (dfs_walk_once, dfs_walk_once_r)
1197 (dfs_walk_once_accessible_r, dfs_walk_once_accessible): Use
1198 hash_set instead of BINFO_MARKED.
1199 (dfs_unmark_r): Remove.
1200
2b4f7b94
PP
12012016-01-28 Patrick Palka <ppalka@gcc.gnu.org>
1202
1203 PR c++/24208
1204 * parser.c (LEXER_DEBUGGING_ENABLED_P): New macro.
1205 (cp_lexer_debugging_p): Use it.
1206 (cp_lexer_start_debugging): Likewise.
1207 (cp_lexer_stop_debugging): Likewise.
1208
fa74a4bc
MP
12092016-01-27 Marek Polacek <polacek@redhat.com>
1210
1211 PR c/68062
1212 * typeck.c (cp_build_binary_op): Promote operand to unsigned, if
1213 needed. Add -Wsign-compare warning.
1214
5d70666e
RB
12152016-01-27 Ryan Burn <contact@rnburn.com>
1216
1217 PR cilkplus/69267
1218 * cp-gimplify.c (cilk_cp_gimplify_call_params_in_spawned_fn): Removed
1219 superfluous post_p argument in call to
1220 cilk_gimplify_call_params_in_spawned_fn.
1221
05bf54c3
MP
12222016-01-27 Marek Polacek <polacek@redhat.com>
1223
1224 PR c++/69379
1225 * constexpr.c (cxx_eval_constant_expression): Handle PTRMEM_CSTs
1226 wrapped in NOP_EXPRs.
1227
60214d0d
MS
12282016-01-27 Martin Sebor <msebor@redhat.com>
1229
1230 PR c++/69317
1231 * mangle.c (mangle_decl): Reference the correct (saved) version
1232 of the ABI in -Wabi diagnostics.
1233
95e3030c
MP
12342016-01-27 Marek Polacek <polacek@redhat.com>
1235
1236 PR c++/69496
1237 * constexpr.c (cxx_eval_array_reference): Evaluate the number of
1238 elements of the array.
1239
ca30abcd
JM
12402016-01-26 Jason Merrill <jason@redhat.com>
1241
1242 PR c++/68949
1243 * constexpr.c (register_constexpr_fundef): Keep the un-massaged body.
1244 (cxx_eval_call_expression): Don't look through clones.
1245 * optimize.c (maybe_clone_body): Clear DECL_SAVED_TREE of the alias.
1246 * semantics.c (expand_or_defer_fn_1): Keep DECL_SAVED_TREE of
1247 maybe-in-charge *tor.
1248
2d63bc39
JM
12492016-01-26 Jason Merrill <jason@redhat.com>
1250
1251 PR c++/68782
1252 * constexpr.c (cxx_eval_bare_aggregate): Update TREE_CONSTANT
1253 and TREE_SIDE_EFFECTS.
1254 (cxx_eval_constant_expression) [CONSTRUCTOR]: Call
1255 verify_constructor_flags.
1256
476805ae
JJ
12572016-01-26 Jakub Jelinek <jakub@redhat.com>
1258
1259 PR c++/68357
1260 * cp-gimplify.c (cp_fold): If some operand folds to error_mark_node,
1261 return error_mark_node instead of building trees with error_mark_node
1262 operands.
1263
01e1dea3
DM
12642016-01-26 David Malcolm <dmalcolm@redhat.com>
1265
1266 PR other/69006
1267 * error.c (print_instantiation_partial_context_line): Add missing
1268 newlines from output for the t == NULL case.
1269 (print_instantiation_partial_context): Remove call to pp_newline.
1270
a59b92b0
PP
12712016-01-24 Patrick Palka <ppalka@gcc.gnu.org>
1272
1273 Revert:
1274 2016-01-18 Patrick Palka <ppalka@gcc.gnu.org>
1275
1276 PR c++/11858
1277 PR c++/24663
1278 PR c++/24664
1279 * decl.c (grokdeclarator): Don't decay array parameter type to
1280 a pointer type if it's dependent.
1281 (grokparms): Invoke strip_top_quals instead of directly invoking
1282 cp_build_qualified_type.
1283 * pt.c (decay_dependent_array_parm_type): New static function.
1284 (type_unification_real): Call decay_dependent_array_parm_type
1285 to decay a dependent array parameter type to its corresponding
1286 pointer type before unification.
1287 (more_specialized_fn): Likewise.
1288 (get_bindings): Likewise.
1289 * tree.c (cp_build_qualified_type): Trivial typofix in
1290 documentation.
1291
69da7802
MS
12922016-01-23 Martin Sebor <msebor@redhat.com>
1293
1294 PR c++/58109
1295 PR c++/69022
1296 * decl2.c (is_late_template_attribute): Handle dependent argument
1297 to attribute align and attribute vector_size.
1298
97ca3d0d
JM
12992016-01-21 Jason Merrill <jason@redhat.com>
1300
130ee9a9
JM
1301 PR c++/69392
1302 * lambda.c (lambda_capture_field_type): Handle 'this' specially
1303 for init-capture, too.
1304
020491e6
JM
1305 PR c++/65687
1306 * decl.c (type_is_deprecated): Don't look into a typedef.
1307
2f3932b9
JM
1308 PR c++/40751
1309 PR c++/64987
1310 * decl.c (copy_type_enum): Respect TYPE_USER_ALIGN.
1311
97ca3d0d
JM
1312 PR c++/43407
1313 * decl.c (start_enum): Add attributes parameter.
1314 * parser.c (cp_parser_enum_specifier): Pass it.
1315 * pt.c (lookup_template_class_1): Pass it.
1316 * cp-tree.h: Adjust.
1317
33f48842
JM
13182016-01-19 Jason Merrill <jason@redhat.com>
1319
1320 PR c++/59759
1321 * pt.c (convert_template_argument): Handle VAR_DECL properly.
1322
1e297006
MP
13232016-01-19 Marek Polacek <polacek@redhat.com>
1324
1325 PR c++/68586
1326 * constexpr.c (clear_cv_cache): New.
1327 * cp-gimplify.c (clear_fold_cache): New.
1328 * cp-tree.h (clear_cv_cache, clear_fold_cache): Declare.
1329 * decl.c (finish_enum_value_list): Call them.
1330
38a979f2
MP
1331 PR c++/68965
1332 * pt.c (tsubst_copy): Mark elements in expanded vector as used.
1333
17c15cb9
PP
13342016-01-18 Patrick Palka <ppalka@gcc.gnu.org>
1335
1336 PR c++/11858
1337 PR c++/24663
1338 PR c++/24664
1339 * decl.c (grokdeclarator): Don't decay array parameter type to
1340 a pointer type if it's dependent.
1341 (grokparms): Invoke strip_top_quals instead of directly invoking
1342 cp_build_qualified_type.
1343 * pt.c (decay_dependent_array_parm_type): New static function.
1344 (type_unification_real): Call decay_dependent_array_parm_type
1345 to decay a dependent array parameter type to its corresponding
1346 pointer type before unification.
1347 (more_specialized_fn): Likewise.
1348 (get_bindings): Likewise.
1349 * tree.c (cp_build_qualified_type): Trivial typofix in
1350 documentation.
1351
7f26f7df
JM
13522016-01-18 Jason Merrill <jason@redhat.com>
1353
4b0b30ef
JM
1354 * cp-gimplify.c (cp_fold) [CONSTRUCTOR]: Don't clobber the input.
1355
8d8f3235
JM
1356 * cp-gimplify.c (cp_fold): Remove unnecessary special cases.
1357
7f26f7df
JM
1358 PR c++/68767
1359 * cp-gimplify.c (cp_fold) [COND_EXPR]: Simplify. Do fold COND_EXPR.
1360 (contains_label_1, contains_label_p): Remove.
1361
ec7886c1
PP
13622016-01-16 Patrick Palka <ppalka@gcc.gnu.org>
1363
1364 PR c++/69091
1365 * pt.c (type_dependent_expression_p): For a function template
1366 specialization, a type is dependent iff any of its template
1367 arguments are.
1368
203484bb
PP
13692016-01-16 Patrick Palka <ppalka@gcc.gnu.org>
1370
1371 * cp-array-notation.c (cp_expand_cond_array_notations): Return
1372 error_mark_node only if find_rank failed, not if it was
1373 successful.
1374
aa2500e9
PP
13752016-01-16 Patrick Palka <ppalka@gcc.gnu.org>
1376
1377 PR c++/68936
1378 * tree.c (build_min_non_dep_call_vec): Don't retain the
1379 KOENIG_LOOKUP_P flag of the non-dependent expression that's
1380 been built.
1381 (build_min_non_dep_op_overload): Instead, do it here.
1382
e0a575ff
JJ
13832016-01-15 Jakub Jelinek <jakub@redhat.com>
1384
1385 PR bootstrap/68271
1386 * parser.h (cp_token): Remove pragma_kind field. Add comment
1387 with number of unused bits.
1388 * parser.c (eof_token): Remove pragma_kind field initializer.
1389 (cp_lexer_get_preprocessor_token): Don't set pragma_kind
1390 field, don't clear CPP_PRAGMA u.value.
1391 (cp_parser_pragma_kind): New function.
1392 (cp_parser_omp_sections_scope, cp_parser_oacc_kernels_parallel,
1393 cp_parser_omp_construct, cp_parser_initial_pragma,
1394 cp_parser_pragma): Use cp_parser_pragma_kind instead of accessing
1395 pragma_kind field.
1396
56233bd6
JM
13972016-01-15 Jason Merrill <jason@redhat.com>
1398
c5e3b6fc
JM
1399 PR c++/68847
1400 * call.c (build_cxx_call): Use fold_non_dependent_expr.
1401
f3255019
JM
1402 * typeck2.c (cxx_incomplete_type_diagnostic): Use the location of
1403 value.
1404
56233bd6
JM
1405 PR c++/69257
1406 * typeck.c (decay_conversion): Don't call mark_rvalue_use for
1407 array/function-to-pointer conversion. Call
1408 complete_type_or_maybe_complain for lvalue-to-rvalue conversion.
1409 * call.c (convert_like_real): Print call context if
1410 decay_conversion errors.
1411
e6d6ec9e
TV
14122016-01-14 Tom de Vries <tom@codesourcery.com>
1413
1414 PR tree-optimization/68773
1415 * parser.c (cp_parser_oacc_declare, cp_parser_omp_declare_target): Don't
1416 set force_output.
1417
a7ccb9e7
JM
14182016-01-14 Jason Merrill <jason@redhat.com>
1419
1420 PR c++/69261
1421 * constexpr.c (find_array_ctor_elt): Handle splitting RANGE_EXPR.
1422
5342156c
MP
14232016-01-12 Marek Polacek <polacek@redhat.com>
1424
1425 PR c++/68979
1426 * constexpr.c (cxx_eval_check_shift_p): Use permerror rather than
1427 error_at and adjust the return value.
1428
723033a6
JJ
14292016-01-12 Jakub Jelinek <jakub@redhat.com>
1430
65364cc5
JJ
1431 PR objc++/68511
1432 PR c++/69213
1433 * cp-gimplify.c (cp_gimplify_expr) <case INIT_EXPR>: Don't return
1434 GS_ERROR whenever seen_error (), only if *expr_p contains
1435 cilk spawn stmt, but cilk_detect_spawn_and_unwrap failed.
1436
723033a6
JJ
1437 PR c++/66808
1438 PR c++/69000
1439 * pt.c (tsubst_decl): If not local_p, clear DECL_TEMPLATE_INFO.
1440
9fc21977
JM
14412016-01-11 Jason Merrill <jason@redhat.com>
1442
1443 PR c++/69131
1444 * method.c (walk_field_subobs): Add dtor_from_ctor parm.
1445 (process_subob_fn): Likewise. Don't consider triviality if true.
1446 (synthesize_method_walk): Pass it.
1447
655441d6
DM
14482016-01-11 David Malcolm <dmalcolm@redhat.com>
1449
1450 PR c++/68795
1451 * parser.c (cp_parser_postfix_expression): Initialize
1452 close_paren_loc to UNKNOWN_LOCATION; only use it if
1453 it has been written to by
1454 cp_parser_parenthesized_expression_list.
1455 (cp_parser_parenthesized_expression_list): Document the behavior
1456 with respect to the CLOSE_PAREN_LOC param.
1457
9cb6bd74
JJ
14582016-01-11 Jakub Jelinek <jakub@redhat.com>
1459
1460 PR c++/69211
1461 * cp-gimplify.c (cp_fold): If COMPOUND_EXPR or MODIFY_EXPR
1462 folded operands have side-effects, but folding changed any of them,
1463 build a new tree with the folded operands instead of returning the
1464 unfolded tree.
1465
73f0dae2
MP
14662016-01-09 Marek Polacek <polacek@redhat.com>
1467
1468 PR c++/69113
1469 * decl2.c (comdat_linkage): Only set DECL_COMDAT if TREE_PUBLIC is set.
1470
c50e614b
JJ
14712016-01-09 Jakub Jelinek <jakub@redhat.com>
1472
1473 PR c++/69164
1474 * class.c (layout_class_type): Use copy_node to copy FIELD_DECLs.
1475
fe71aa4e
JM
14762016-01-08 Jason Merrill <jason@redhat.com>
1477
1478 PR c++/69158
1479 * constexpr.c (cxx_fold_indirect_ref): Handle array type differing
1480 in completion.
1481
bd8f5bb2
MP
14822016-01-08 Marek Polacek <polacek@redhat.com>
1483
1484 PR c++/68449
1485 * constexpr.c (cxx_eval_constant_expression): Handle NULL initializer.
1486
0795b6f2
JM
14872016-01-08 Jason Merrill <jason@redhat.com>
1488
550c5f8a
JM
1489 * constexpr.c (cxx_eval_call_expression): Remove convert_to_void
1490 workaround.
1491
45177337
JM
1492 PR c++/68983
1493 PR c++/67557
1494 * cvt.c (convert_to_void): Don't strip a TARGET_EXPR of
1495 TREE_ADDRESSABLE type.
1496
0795b6f2
JM
1497 PR c++/68983
1498 PR c++/67557
1499 * call.c (unsafe_copy_elision_p): Look through COMPOUND_EXPR.
1500
ce3e43d7
NS
15012016-01-05 Nathan Sidwell <nathan@acm.org>
1502
1503 PR c++/58583
1504 * pt.c (build_non_dependent_expr): Don't try a checking fold when
1505 parsing an nsdmi.
1506
818ab71a 15072016-01-04 Jakub Jelinek <jakub@redhat.com>
5624e564
JJ
1508
1509 Update copyright years.
ad41bd84 1510\f
818ab71a 1511Copyright (C) 2016 Free Software Foundation, Inc.
ad41bd84
JM
1512
1513Copying and distribution of this file, with or without modification,
1514are permitted in any medium without royalty provided the copyright
1515notice and this notice are preserved.