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