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