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