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