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