re PR c++/69884 (warning: ignoring attributes on template argument)
[platform/upstream/gcc.git] / gcc / cp / ChangeLog
1 2016-03-23  Marek Polacek  <polacek@redhat.com>
2
3         PR c++/69884
4         * pt.c (canonicalize_type_argument): Use OPT_Wignored_attributes.
5
6 2016-03-22  Ilya Enkovich  <enkovich.gnu@gmail.com>
7
8         * call.c (build_conditional_expr_1): Always use original
9         condition type for vector type checks and build.
10
11 2016-03-22  Patrick Palka  <ppalka@gcc.gnu.org>
12
13         PR c++/70096
14         * pt.c (tsubst_decl): Clear the DECL_MODE of the new decl.
15
16 2016-03-22  Patrick Palka  <ppalka@gcc.gnu.org>
17
18         PR c++/70204
19         * constexpr.c (non_const_var_error): Check
20         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
21
22 2016-03-21  Richard Henderson  <rth@redhat.com>
23
24         PR c++/70273
25         * decl.c (notice_forced_label_r): New.
26         (cp_finish_decl): Use it.
27
28 2016-03-21  Jason Merrill  <jason@redhat.com>
29
30         PR c++/70285
31         * cp-gimplify.c (cp_fold) [COND_EXPR]: Handle bit-fields.
32
33 2016-03-18  Jason Merrill  <jason@redhat.com>
34
35         PR c++/70139
36         * constexpr.c (cxx_eval_call_expression): Fix trivial copy.
37
38         PR c++/70147
39         * class.c (vptr_via_virtual_p): New.
40         (most_primary_binfo): Factor out of build_rtti_vtbl_entries.
41         * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs): Don't clear
42         a vptr from any virtual base in a not-in-charge 'structor.
43
44         * decl.c (build_clobber_this): Factor out of
45         start_preparsed_function and begin_destructor_body.  Handle
46         virtual bases better.
47
48         * class.c (build_if_in_charge): Split out from build_base_path.
49         * init.c (expand_virtual_init, expand_default_init): Use it.
50         * call.c (build_special_member_call): Use it.
51
52 2016-03-18  Jakub Jelinek  <jakub@redhat.com>
53
54         PR c++/70267
55         * init.c (build_new_1): Complain and return error_mark_node
56         if alloc_fn is not _Jv_AllocObject function returning pointer.
57
58 2016-03-18  Patrick Palka  <ppalka@gcc.gnu.org>
59
60         PR c++/70205
61         * search.c (adjust_result_of_qualified_name_lookup): Don't
62         update the BASELINK_BINFO of DECL if the second call
63         to lookup_base fails.
64
65 2016-03-18  Patrick Palka  <ppalka@gcc.gnu.org>
66
67         PR c++/70218
68         * parser.c (cp_parser_lambda_expression): Move call to
69         pop_deferring_access_checks ahead of the call to
70         cp_parser_end_tentative_firewall.
71
72 2016-03-17  Jakub Jelinek  <jakub@redhat.com>
73
74         PR c++/70144
75         * cp-tree.h (magic_varargs_p): Return int instead of bool.
76         * call.c (magic_varargs_p): Return int instead of bool, return 2 for
77         Cilk+ reductions, otherwise 1 for magic varargs and 0 for normal
78         varargs.
79         (build_over_call): If magic_varargs_p == 2, call reject_gcc_builtin,
80         if magic_varargs_p == 1, call decay_conversion
81         instead of mark_type_use.  Don't store error_mark_node arguments to
82         argarray, instead return error_mark_node.
83
84         PR c++/70272
85         * decl.c (begin_destructor_body): Don't insert clobber if
86         is_empty_class (current_class_type).
87
88 2016-03-17  Marek Polacek  <polacek@redhat.com>
89
90         PR c++/70194
91         * typeck.c (warn_for_null_address): New function.
92         (cp_build_binary_op): Call it.
93
94 2016-03-16  Jason Merrill  <jason@redhat.com>
95
96         PR c++/70259
97         * decl.c (start_preparsed_function): Don't clobber an empty base.
98
99 2016-03-16  Jakub Jelinek  <jakub@redhat.com>
100
101         PR c++/70147
102         * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs): Conditionalize
103         BINFO_VIRTUAL_P vtable clearing on current_in_charge_parm.
104
105         PR c++/70147
106         * cp-ubsan.c (cp_ubsan_maybe_initialize_vtbl_ptrs): Temporarily
107         set in_base_initializer.
108
109 2016-03-15  Marek Polacek  <polacek@redhat.com>
110
111         PR c++/70209
112         * tree.c (strip_typedefs): Call strip_typedefs again on the
113         DECL_ORIGINAL_TYPE result.
114
115 2016-03-15  Jason Merrill  <jason@redhat.com>
116
117         PR c++/70095
118         * pt.c (instantiate_decl): Fix call to variable_template_p.
119
120         PR c++/70141
121         * pt.c (for_each_template_parm_r): Always walk into TYPENAME_TYPE.
122
123 2016-03-14  Casey Carter  <casey@carter.net>
124             Jason Merrill  <jason@redhat.com>
125
126         P0184R0: Generalizing the Range-Based For Loop
127         * parser.c (cp_convert_range_for): Set the type of __end separately.
128         (cp_parser_perform_range_for_lookup): Allow different begin/end
129         types if they are comparable.
130
131 2016-03-12  Patrick Palka  <ppalka@gcc.gnu.org>
132
133         PR c++/70106
134         * semantics.c (force_paren_expr): Just build a PAREN_EXPR when
135         processing_template_decl and EXPR is a SCOPE_REF.
136
137 2016-03-10  Patrick Palka  <ppalka@gcc.gnu.org>
138             Jakub Jelinek  <jakub@redhat.com>
139
140         PR c++/70001
141         * constexpr.c (cxx_eval_vec_init_1): For pre_init case, reuse
142         return value from cxx_eval_constant_expression from earlier
143         elements if it is valid constant initializer requiring no
144         relocations.
145
146 2016-03-10  Marek Polacek  <polacek@redhat.com>
147
148         PR c++/70153
149         * cp-gimplify.c (cp_fold): Handle UNARY_PLUS_EXPR.
150
151 2016-03-09  Cesar Philippidis  <cesar@codesourcery.com>
152
153         * parser.c (cp_parser_oacc_loop): Update cclauses and clauses
154         when calling c_finish_omp_clauses.
155
156 2016-03-08  Jason Merrill  <jason@redhat.com>
157
158         * parser.c (cp_parser_diagnose_invalid_type_name): Give helpful
159         diagnostic for use of "concept".
160         (cp_parser_requires_clause_opt): And "requires".
161         (cp_parser_type_parameter, cp_parser_late_return_type_opt)
162         (cp_parser_explicit_template_declaration): Adjust.
163         * Make-lang.in (check-c++-all): Add "concepts" to std list.
164
165         P0036R0: Unary Folds and Empty Parameter Packs
166         * pt.c (expand_empty_fold): Remove special cases for *,+,&,|.
167
168 2016-03-08  Jakub Jelinek  <jakub@redhat.com>
169
170         PR c++/70135
171         * constexpr.c (cxx_eval_loop_expr): Forget saved values of SAVE_EXPRs
172         even after the last iteration of the loop.
173
174         * decl.c (duplicate_decls): Fix spelling - becuase -> because.
175
176 2016-03-07  Patrick Palka  <ppalka@gcc.gnu.org>
177
178         PR c++/66786
179         * pt.c (get_template_info): Handle PARM_DECL.
180         (template_class_depth): Check DECL_P instead of
181         VAR_OR_FUNCTION_DECL_P.
182
183 2016-03-05  Jason Merrill  <jason@redhat.com>
184
185         PR c++/67364
186         * constexpr.c (cxx_eval_store_expression): Replace
187         CONSTRUCTOR_ELTS in nested CONSTRUCTORs, too.
188
189 2016-03-05  Patrick Palka  <ppalka@gcc.gnu.org>
190
191         PR c++/66786
192         * pt.c (template_class_depth): Given a lambda type, iterate
193         into its LAMBDA_TYPE_EXTRA_SCOPE field instead of its
194         TYPE_CONTEXT.  Given a VAR_DECL, iterate into its
195         CP_DECL_CONTEXT.
196
197 2016-03-04  Jason Merrill  <jason@redhat.com>
198
199         PR c++/69203
200         * cp-tree.h (COND_EXPR_IS_VEC_DELETE): New.
201         * init.c (build_vec_delete_1): Set it.
202         * constexpr.c (potential_constant_expression_1) [COND_EXPR]: Check it.
203
204 2016-03-04  Jakub Jelinek  <jakub@redhat.com>
205
206         * decl.c (start_preparsed_function): Don't emit start clobber at the
207         start of constructor clones.
208
209         PR c++/70035
210         * cp-tree.h (cp_ubsan_maybe_initialize_vtbl_ptrs): New prototype.
211         * decl.c (start_preparsed_function): Call
212         cp_ubsan_maybe_initialize_vtbl_ptrs if needed.
213         * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs,
214         cp_ubsan_maybe_initialize_vtbl_ptrs): New functions.
215
216 2016-03-04  Jason Merrill  <jason@redhat.com>
217
218         PR c++/67364
219         * constexpr.c (cxx_eval_component_reference): Further tweak.
220
221         * constexpr.c (struct constexpr_ctx): Add save_exprs field.
222         (cxx_eval_loop_expr): Discard SAVE_EXPR values before looping.
223         (cxx_eval_constant_expression) [SAVE_EXPR]: Add it to the set.
224         (cxx_eval_outermost_constant_expr, is_sub_constant_expr): Initialize.
225
226         PR c++/70067
227         * tree.c (strip_typedefs): Handle TYPENAME_TYPE lookup finding the
228         same type.
229
230 2016-03-03  Jason Merrill  <jason@redhat.com>
231
232         * method.c (synthesized_method_walk): operator= can also be constexpr.
233
234         * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Get
235         LAMBDA_EXPR_RETURN_TYPE from the instantiated closure.
236
237         PR c++/67164
238         * pt.c (copy_template_args): New.
239         (tsubst_pack_expansion): Use it.
240
241         * call.c (build_aggr_conv): Use get_nsdmi.
242
243         PR c++/51406
244         * typeck.c (build_static_cast_1): Avoid folding back to lvalue.
245
246         PR c++/67364
247         * constexpr.c (cxx_eval_component_reference): Just return an empty
248         CONSTRUCTOR for an empty class.
249
250 2016-03-01  Jason Merrill  <jason@redhat.com>
251
252         PR c++/70036
253         * parser.c (cp_parser_requires_clause): Call
254         check_for_bare_parameter_packs.
255
256         PR c++/51489
257         * constexpr.c (cxx_eval_binary_expression): Don't VERIFY_CONSTANT
258         the operands.
259
260         PR c++/69995
261         * constexpr.c (cxx_eval_call_expression): Unshare arg.
262         (cxx_eval_constant_expression) [DECL_EXPR]: Unshare init.
263         [TARGET_EXPR]: Unshare init.
264
265 2016-03-01  Patrick Palka  <ppalka@gcc.gnu.org>
266
267         PR c++/68948
268         PR c++/69961
269         * pt.c (tsubst_baselink): Reinstate the check for an invalid
270         constructor call.
271
272 2016-02-28  Jason Merrill  <jason@redhat.com>
273
274         PR c++/69995
275         * constexpr.c (cxx_eval_store_expression): Unshare init.
276
277 2016-02-26  Jason Merrill  <jason@redhat.com>
278
279         PR c++/69958
280         * pt.c (make_argument_pack): New.
281         (tsubst_copy) [SIZEOF_EXPR]: Handle partial expansion.
282         (tsubst_copy_and_build): Likewise.
283
284 2016-02-25  Jason Merrill  <jason@redhat.com>
285
286         PR c++/69889
287         * cp-tree.h (AGGR_INIT_FROM_THUNK_P): New.
288         * tree.c (build_aggr_init_expr): Set it.
289         * semantics.c (simplify_aggr_init_expr): Check it.
290         * cp-gimplify.c (cp_genericize_r): Don't walk into
291         a call/aggr_init from a thunk.
292
293         PR c++/69842
294         * method.c (forward_parm): Handle parameter packs.
295         * lambda.c (maybe_add_lambda_conv_op): Use it for them.
296
297         PR c++/67364
298         * constexpr.c (cxx_eval_component_reference): Don't complain about
299         unevaluated empty classes.
300
301         PR c++/68049
302         * tree.c (strip_typedefs): Use DECL_ORIGINAL_TYPE.
303
304 2016-02-25  Patrick Palka  <ppalka@gcc.gnu.org>
305
306         PR c++/69736
307         * cp-tree.h (REF_PARENTHESIZED_P): Adjust documentation.
308         (maybe_undo_parenthesized_ref): Declare.
309         * semantics.c (maybe_undo_parenthesized_ref): Split out from
310         check_return_expr.
311         (finish_call_expr): Use it.
312         * typeck.c (check_return_expr): Use it.
313         * pt.c (tsubst_copy_and_build) [INDIRECT_REF]: Retain the
314         REF_PARENTHESIZED_P flag.
315
316 2016-02-24  Jakub Jelinek  <jakub@redhat.com>
317
318         PR c++/69922
319         * class.c (build_base_path): Set TREE_NO_WARNING on the null_test.
320         Avoid folding it.
321         * init.c (build_vec_delete_1, build_delete): Don't fold the non-NULL
322         tests.
323         * cp-gimplify.c (cp_fold): For TREE_NO_WARNING comparisons with NULL,
324         unless they are folded into INTEGER_CST, error_mark_node or some
325         comparison with NULL, avoid folding them and use either the original
326         comparison or non-folded comparison of folded arguments.
327         * cp-ubsan.c (cp_ubsan_instrument_vptr): Set TREE_NO_WARNING on the
328         comparison, don't fold the comparison right away.
329
330 2016-02-24  Jason Merrill  <jason@redhat.com>
331
332         PR c++/69323
333         * friend.c (make_friend_class): Likewise.
334         * decl.c (lookup_and_check_tag): Diagnose invalid dependent friend.
335
336 2016-02-24  Jason Merrill  <jason@redhat.com>
337
338         PR c++/69323
339         * pt.c (instantiate_class_template_1): Set
340         processing_template_decl before substituting friend_type.
341
342 016-02-24  Martin Sebor  <msebor@redhat.com>
343
344         PR c++/69912
345         * tree.c (build_ctor_subob_ref): Compare types' main variants
346         instead of the types as they are.
347
348 2016-02-24  Jason Merrill  <jason@redhat.com>
349
350         * decl.c (start_preparsed_function): Condition ctor clobber on
351         flag_lifetime_dse > 1.
352
353         * cp-gimplify.c (cp_fold): Don't fold constexpr calls if -fno-inline.
354
355 2016-02-19  Jason Merrill  <jason@redhat.com>
356
357         PR c++/69743
358         * call.c (remaining_arguments): No longer static.
359         * cp-tree.h: Declare it.
360         * pt.c (more_specialized_fn): Use it.
361
362 2016-02-19  Jakub Jelinek  <jakub@redhat.com>
363             Bernd Edlinger  <bernd.edlinger@hotmail.de>
364
365         * Make-lang.in: Invoke gperf with -L C++.
366         * cfns.gperf: Remove prototypes for hash and libc_name_p
367         inlines.
368         * cfns.h: Regenerated.
369         * except.c (nothrow_libfn_p): Adjust.
370
371 2016-02-19  Jakub Jelinek  <jakub@redhat.com>
372
373         PR c++/69850
374         * rtti.c (ifnonnull): Set TREE_NO_WARNING on the condition, use
375         NE_EXPR instead of EQ_EXPR and swap last two arguments on COND_EXPR.
376
377 2016-02-19  Patrick Palka  <ppalka@gcc.gnu.org>
378
379         PR c++/68948
380         * pt.c (tsubst_baselink): Don't diagnose an invalid constructor
381         call here.
382         * semantics.c (finish_call_expr): Don't assume a constructor
383         call is dependent if only the "this" pointer is dependent.  When
384         building a constructor call, always use a dummy object.
385
386 2016-02-19  Jakub Jelinek  <jakub@redhat.com>
387
388         PR c++/69850
389         * init.c (build_vec_delete_1): Set TREE_NO_WARNING on the NE_EXPR
390         condition.
391         * cp-gimplify.c (cp_fold): Propagate TREE_NO_WARNING from binary
392         operators if folding preserved the binop, just with different
393         arguments.
394
395         PR c++/67767
396         * parser.c (cp_parser_std_attribute_spec_seq): Don't assume
397         attr_spec is always single element chain, chain all the attributes
398         properly together in the right order.
399
400 2016-02-18  Jason Merrill  <jason@redhat.com>
401
402         * mangle.c (maybe_check_abi_tags): Add for_decl parm.  Call
403         mangle_decl.
404         (mangle_decl): Call maybe_check_abi_tags for function scope.
405         (mangle_guard_variable): Call maybe_check_abi_tags here.
406         (write_guarded_var_name): Not here.
407
408 2016-02-17  Jason Merrill  <jason@redhat.com>
409
410         PR c++/65985
411         * constexpr.c (build_constexpr_constructor_member_initializers):
412         Handle an additional STATEMENT_LIST.
413
414         PR c++/68585
415         * constexpr.c (cxx_eval_bare_aggregate): Fix 'changed' detection.
416
417         PR c++/68679
418         * decl2.c (reset_type_linkage_2): Look through member templates.
419
420 2016-02-17  Jakub Jelinek  <jakub@redhat.com>
421
422         PR c++/69850
423         * init.c (build_delete): Set TREE_NO_WARNING on ifexp.
424
425 2016-02-17  Jason Merrill  <jason@redhat.com>
426
427         PR c++/69842
428         * method.c (forward_parm): Split out from...
429         (add_one_base_init): ...here.
430         * lambda.c (maybe_add_lambda_conv_op): Use it.
431
432 2016-02-16  Jason Merrill  <jason@redhat.com>
433
434         PR c++/10200
435         PR c++/69753
436         * call.c, cp-tree.h, name-lookup.c, pt.c, search.c, semantics.c,
437         tree.c, typeck2.c: Revert earlier changes.
438         * parser.c (cp_parser_lookup_name): Ignore namespace-scope
439         non-type templates after -> or .
440
441 2016-02-16  Jakub Jelinek  <jakub@redhat.com>
442
443         PR c/69835
444         * typeck.c (cp_build_binary_op): Revert 2015-09-09 change.
445
446 2016-02-16  Jason Merrill  <jason@redhat.com>
447
448         PR c++/69657
449         * name-lookup.c (lookup_qualified_name): Add find_hidden parm.
450         (set_decl_namespace): Pass it.  Complain about finding a hidden friend.
451         * name-lookup.h: Adjust.
452
453 2016-02-16  James Norris  <jnorris@codesourcery.com>
454
455         * parser.c (cp_parser_oacc_data_clause_deviceptr): Remove checking.
456         * semantics.c (finish_omp_clauses): Add deviceptr checking.
457
458 2016-02-15  Jakub Jelinek  <jakub@redhat.com>
459
460         PR c++/69658
461         * init.c (expand_default_init): Only call reshape_init
462         in the direct-initialization from an initializer list case.
463
464 2016-02-15  Jason Merrill  <jason@redhat.com>
465
466         PR c++/69753
467         * semantics.c (finish_call_expr): Implicit 'this' does not make
468         the call dependent.
469         * search.c (any_dependent_bases_p): Split out...
470         * name-lookup.c (do_class_using_decl): ...from here.
471         * call.c (build_new_method_call_1): Don't complain about missing object
472         if there are dependent bases.  Tweak error.
473         * tree.c (non_static_member_function_p): Remove.
474         * pt.c (type_dependent_expression_p): A member template of a
475         dependent type is dependent.
476         * cp-tree.h: Adjust.
477
478         PR c++/68890
479         * constexpr.c (verify_ctor_sanity): Remove CONSTRUCTOR_NELTS check.
480
481 2016-02-12  Patrick Palka  <ppalka@gcc.gnu.org>
482
483         PR c++/69098
484         * pt.c (lookup_and_finish_template_variable): New function,
485         extracted from ...
486         (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: ... here.  Use it.
487         (tsubst_qualified_id): Consider that EXPR might be a variable
488         template.
489         * typeck.c (check_template_keyword): Don't emit an error
490         if DECL is a variable template.
491
492 2016-02-12  Jakub Jelinek  <jakub@redhat.com>
493
494         * error.c: Spelling fixes - behaviour -> behavior and
495         neighbour -> neighbor.
496         * decl.c: Likewise.
497         * typeck.c (cp_build_binary_op): Fix up behavior spelling in
498         diagnostics.
499         * init.c (build_delete): Likewise.
500
501 2016-02-11  Jakub Jelinek  <jakub@redhat.com>
502
503         PR c/69768
504         * typeck.c (cp_build_binary_op): cp_fully_fold integer_zerop
505         arguments for -Waddress warning.  Fix up formatting.
506
507 2016-02-11  Paolo Carlini  <paolo.carlini@oracle.com>
508
509         PR c++/68726
510         * pt.c (lookup_template_class_1): Check tsubst return value for
511         error_mark_node.
512
513 2016-02-10  Jason Merrill  <jason@redhat.com>
514
515         PR c++/68926
516         * pt.c (resolve_nondeduced_context): Add complain parm.
517         (do_auto_deduction): Pass it.
518         * cvt.c (convert_to_void): Likewise.
519         * decl.c (cp_finish_decl): Likewise.
520         * init.c (build_new): Likewise.
521         * rtti.c (get_tinfo_decl_dynamic): Likewise.
522         * semantics.c (finish_decltype_type): Likewise.
523         * typeck.c (decay_conversion): Likewise.
524         * cp-tree.h: Adjust declaration.
525         * call.c (standard_conversion): Add complain parm, pass it along.
526         (implicit_conversion): Pass it.
527
528         PR c++/69657
529         * name-lookup.c (ambiguous_decl): Call remove_hidden_names.
530         (lookup_name_real_1): Likewise.
531         (remove_hidden_names): Handle non-functions too.
532
533         PR c++/10200
534         * parser.c (cp_parser_lookup_name): When looking for a template
535         after . or ->, only consider class templates.
536         (cp_parser_postfix_dot_deref_expression): Handle the current
537         instantiation.  Remember a dependent object expression.
538         * typeck2.c (build_x_arrow): Handle the current instantiation.
539
540         * ptree.c (debug_tree): Implement for cp_expr.
541
542 2016-02-08  Patrick Palka  <ppalka@gcc.gnu.org>
543
544         PR c++/69139
545         * parser.c (cp_parser_simple_type_specifier): Make the check
546         for disambiguating between an 'auto' placeholder and an implicit
547         template parameter more robust.
548
549 2016-02-08  Patrick Palka  <ppalka@gcc.gnu.org>
550
551         PR c++/69283
552         PR c++/67835
553         * decl2.c (mark_used): When given a TEMPLATE_DECL, return after
554         setting its TREE_USED flag.
555
556 2016-02-08  Jason Merrill  <jason@redhat.com>
557
558         PR c++/69657
559         * name-lookup.c (do_nonmember_using_decl): Leave anticipated
560         built-ins alone.
561
562 2016-02-08  Jakub Jelinek  <jakub@redhat.com>
563
564         PR c++/59627
565         * parser.c (cp_parser_omp_declare_reduction): Set assembler name
566         of the DECL_OMP_DECLARE_REDUCTION_P decls.
567
568 2016-02-08  Marek Polacek  <polacek@redhat.com>
569
570         PR c++/69688
571         * constexpr.c (clear_cv_and_fold_caches): Renamed from clear_cv_cache.
572         Call clear_fold_cache.
573         * cp-tree.h: Adjust declaration.
574         * decl.c (finish_enum_value_list): Call clear_cv_and_fold_caches
575         rather than clear_cv_cache and clear_fold_cache.
576         * typeck2.c (store_init_value): Call clear_cv_and_fold_caches.
577
578 2016-02-08  Jason Merrill  <jason@redhat.com>
579
580         * cp-tree.h (CONV_FOLD, CONV_BACKEND_CONVERT): New.
581         * cvt.c (convert): Pass CONV_BACKEND_CONVERT.
582         (ocp_convert): Use *_maybe_fold.
583         (cp_convert_to_pointer): Add dofold parameter.
584         * cp-gimplify.c (cp_fold) [CONVERT_EXPR]: Call convert.
585
586 2016-02-05  Martin Sebor  <msebor@redhat.com>
587
588         PR c++/69662
589         * init.c (find_field_init): New function.
590         (warn_placement_new_too_small): Call it.  Handle one-element arrays
591         at ends of structures special.
592
593 2016-02-05  Jason Merrill  <jason@redhat.com>
594
595         PR c++/68948
596         * semantics.c (finish_expr_stmt): If expr is error_mark_node,
597         make sure we've seen_error().
598
599 2016-02-05  Patrick Palka  <ppalka@gcc.gnu.org>
600
601         PR c++/68948
602         * pt.c (tsubst_baselink): Diagnose an invalid constructor call
603         if lookup_fnfields returns NULL_TREE and the name being looked
604         up has the form A::A.
605
606 2016-02-04  Patrick Palka  <ppalka@gcc.gnu.org>
607
608         * constexpr.c (cxx_eval_binary_expression): Fold equality
609         comparisons involving PTRMEM_CSTs.
610
611 2016-02-04  Jakub Jelinek  <jakub@redhat.com>
612
613         * class.c (find_flexarrays): Don't declare dom variable.
614         (diagnose_flexarray): Likewise.
615
616 2016-02-02  Martain Sebor  <msebor@redhat.com>
617
618         PR c++/69251
619         PR c++/69253
620         PR c++/69290
621         PR c++/69277
622         PR c++/69349
623         * class.c (walk_subobject_offsets): Avoid testing the upper bound
624         of a flexible array member for equality to null.
625         (find_flexarrays): Remove spurious whitespace introduced in r231665.
626         (diagnose_flexarrays): Avoid checking the upper bound of arrays.
627         (check_flexarrays): Same.
628         * decl.c (compute_array_index_type): Avoid special case for flexible
629         array members.
630         (grokdeclarator): Avoid calling compute_array_index_type for flexible
631         array members.
632         * error.c (dump_type_suffix): Revert changes introduced in r231665
633         and rendered unnecessary by the changes above.
634         * pt.c (tsubst):  Same.
635         * tree.c (build_ctor_subob_ref): Handle flexible array members.
636         * typeck2.c (digest_init_r): Revert changes introduced in r231665.
637         (process_init_constructor_array): Same.
638         (process_init_constructor_record): Same.
639
640 2016-02-03  Patrick Palka  <ppalka@gcc.gnu.org>
641
642         PR c++/69056
643         * pt.c (try_one_overload): Handle comparing argument packs so
644         that there is no conflict if we deduced more arguments of an
645         argument pack than were explicitly specified.
646
647 2016-01-31  Jakub Jelinek  <jakub@redhat.com>
648             Jason Merrill  <jason@redhat.com>
649
650         PR c++/68763
651         * tree.c (strip_typedefs) [FUNCTION_TYPE]: Avoid building a new
652         function type if nothing is changing.
653
654 2016-01-31  Jason Merrill  <jason@redhat.com>
655
656         PR c++/69009
657         * pt.c (partial_specialization_p, impartial_args): New.
658         (instantiate_decl): Call impartial_args.
659
660         * mangle.c (maybe_check_abi_tags): New.
661         (write_guarded_var_name): Call it.
662         (mangle_ref_init_variable): Call check_abi_tags.
663
664         * pt.c (lookup_template_class_1): Don't share TYPE_ATTRIBUTES
665         between template and instantiation.
666
667 2016-01-29  Jakub Jelinek  <jakub@redhat.com>
668
669         PR debug/66869
670         * decl.c (wrapup_globals_for_namespace): Warn about unused static
671         function declarations.
672
673 2016-01-29  Marek Polacek  <polacek@redhat.com>
674
675         PR c++/69509
676         PR c++/69516
677         * constexpr.c (cxx_eval_array_reference): Give the "array subscript
678         out of bound" error earlier.
679         * init.c (build_vec_init): Change NE_EXPR into GT_EXPR.  Update the
680         commentary.
681
682 2016-01-29  Patrick Palka  <ppalka@gcc.gnu.org>
683
684         * name-lookup.c (begin_scope): After reusing a cp_binding_level
685         structure, update free_binding_level before the structure's
686         level_chain field gets cleared, not after.
687
688 2016-01-28  Jason Merrill  <jason@redhat.com>
689
690         PR c++/67407
691         * search.c (dfs_walk_once, dfs_walk_once_r)
692         (dfs_walk_once_accessible_r, dfs_walk_once_accessible): Use
693         hash_set instead of BINFO_MARKED.
694         (dfs_unmark_r): Remove.
695
696 2016-01-28  Patrick Palka  <ppalka@gcc.gnu.org>
697
698         PR c++/24208
699         * parser.c (LEXER_DEBUGGING_ENABLED_P): New macro.
700         (cp_lexer_debugging_p): Use it.
701         (cp_lexer_start_debugging): Likewise.
702         (cp_lexer_stop_debugging): Likewise.
703
704 2016-01-27  Marek Polacek  <polacek@redhat.com>
705
706         PR c/68062
707         * typeck.c (cp_build_binary_op): Promote operand to unsigned, if
708         needed.  Add -Wsign-compare warning.
709
710 2016-01-27  Ryan Burn  <contact@rnburn.com>
711
712         PR cilkplus/69267
713         * cp-gimplify.c (cilk_cp_gimplify_call_params_in_spawned_fn): Removed
714         superfluous post_p argument in call to
715         cilk_gimplify_call_params_in_spawned_fn.
716
717 2016-01-27  Marek Polacek  <polacek@redhat.com>
718
719         PR c++/69379
720         * constexpr.c (cxx_eval_constant_expression): Handle PTRMEM_CSTs
721         wrapped in NOP_EXPRs.
722
723 2016-01-27  Martin Sebor  <msebor@redhat.com>
724
725         PR c++/69317
726         * mangle.c (mangle_decl): Reference the correct (saved) version
727         of the ABI in -Wabi diagnostics.
728
729 2016-01-27  Marek Polacek  <polacek@redhat.com>
730
731         PR c++/69496
732         * constexpr.c (cxx_eval_array_reference): Evaluate the number of
733         elements of the array.
734
735 2016-01-26  Jason Merrill  <jason@redhat.com>
736
737         PR c++/68949
738         * constexpr.c (register_constexpr_fundef): Keep the un-massaged body.
739         (cxx_eval_call_expression): Don't look through clones.
740         * optimize.c (maybe_clone_body): Clear DECL_SAVED_TREE of the alias.
741         * semantics.c (expand_or_defer_fn_1): Keep DECL_SAVED_TREE of
742         maybe-in-charge *tor.
743
744 2016-01-26  Jason Merrill  <jason@redhat.com>
745
746         PR c++/68782
747         * constexpr.c (cxx_eval_bare_aggregate): Update TREE_CONSTANT
748         and TREE_SIDE_EFFECTS.
749         (cxx_eval_constant_expression) [CONSTRUCTOR]: Call
750         verify_constructor_flags.
751
752 2016-01-26  Jakub Jelinek  <jakub@redhat.com>
753
754         PR c++/68357
755         * cp-gimplify.c (cp_fold): If some operand folds to error_mark_node,
756         return error_mark_node instead of building trees with error_mark_node
757         operands.
758
759 2016-01-26  David Malcolm  <dmalcolm@redhat.com>
760
761         PR other/69006
762         * error.c (print_instantiation_partial_context_line): Add missing
763         newlines from output for the t == NULL case.
764         (print_instantiation_partial_context): Remove call to pp_newline.
765
766 2016-01-24  Patrick Palka  <ppalka@gcc.gnu.org>
767
768         Revert:
769         2016-01-18  Patrick Palka  <ppalka@gcc.gnu.org>
770
771         PR c++/11858
772         PR c++/24663
773         PR c++/24664
774         * decl.c (grokdeclarator): Don't decay array parameter type to
775         a pointer type if it's dependent.
776         (grokparms): Invoke strip_top_quals instead of directly invoking
777         cp_build_qualified_type.
778         * pt.c (decay_dependent_array_parm_type): New static function.
779         (type_unification_real): Call decay_dependent_array_parm_type
780         to decay a dependent array parameter type to its corresponding
781         pointer type before unification.
782         (more_specialized_fn): Likewise.
783         (get_bindings): Likewise.
784         * tree.c (cp_build_qualified_type): Trivial typofix in
785         documentation.
786
787 2016-01-23  Martin Sebor  <msebor@redhat.com>
788
789         PR c++/58109
790         PR c++/69022
791         * decl2.c (is_late_template_attribute): Handle dependent argument
792         to attribute align and attribute vector_size.
793
794 2016-01-21  Jason Merrill  <jason@redhat.com>
795
796         PR c++/69392
797         * lambda.c (lambda_capture_field_type): Handle 'this' specially
798         for init-capture, too.
799
800         PR c++/65687
801         * decl.c (type_is_deprecated): Don't look into a typedef.
802
803         PR c++/40751
804         PR c++/64987
805         * decl.c (copy_type_enum): Respect TYPE_USER_ALIGN.
806
807         PR c++/43407
808         * decl.c (start_enum): Add attributes parameter.
809         * parser.c (cp_parser_enum_specifier): Pass it.
810         * pt.c (lookup_template_class_1): Pass it.
811         * cp-tree.h: Adjust.
812
813 2016-01-19  Jason Merrill  <jason@redhat.com>
814
815         PR c++/59759
816         * pt.c (convert_template_argument): Handle VAR_DECL properly.
817
818 2016-01-19  Marek Polacek  <polacek@redhat.com>
819
820         PR c++/68586
821         * constexpr.c (clear_cv_cache): New.
822         * cp-gimplify.c (clear_fold_cache): New.
823         * cp-tree.h (clear_cv_cache, clear_fold_cache): Declare.
824         * decl.c (finish_enum_value_list): Call them.
825
826         PR c++/68965
827         * pt.c (tsubst_copy): Mark elements in expanded vector as used.
828
829 2016-01-18  Patrick Palka  <ppalka@gcc.gnu.org>
830
831         PR c++/11858
832         PR c++/24663
833         PR c++/24664
834         * decl.c (grokdeclarator): Don't decay array parameter type to
835         a pointer type if it's dependent.
836         (grokparms): Invoke strip_top_quals instead of directly invoking
837         cp_build_qualified_type.
838         * pt.c (decay_dependent_array_parm_type): New static function.
839         (type_unification_real): Call decay_dependent_array_parm_type
840         to decay a dependent array parameter type to its corresponding
841         pointer type before unification.
842         (more_specialized_fn): Likewise.
843         (get_bindings): Likewise.
844         * tree.c (cp_build_qualified_type): Trivial typofix in
845         documentation.
846
847 2016-01-18  Jason Merrill  <jason@redhat.com>
848
849         * cp-gimplify.c (cp_fold) [CONSTRUCTOR]: Don't clobber the input.
850
851         * cp-gimplify.c (cp_fold): Remove unnecessary special cases.
852
853         PR c++/68767
854         * cp-gimplify.c (cp_fold) [COND_EXPR]: Simplify.  Do fold COND_EXPR.
855         (contains_label_1, contains_label_p): Remove.
856
857 2016-01-16  Patrick Palka  <ppalka@gcc.gnu.org>
858
859         PR c++/69091
860         * pt.c (type_dependent_expression_p): For a function template
861         specialization, a type is dependent iff any of its template
862         arguments are.
863
864 2016-01-16  Patrick Palka  <ppalka@gcc.gnu.org>
865
866         * cp-array-notation.c (cp_expand_cond_array_notations): Return
867         error_mark_node only if find_rank failed, not if it was
868         successful.
869
870 2016-01-16  Patrick Palka  <ppalka@gcc.gnu.org>
871
872         PR c++/68936
873         * tree.c (build_min_non_dep_call_vec): Don't retain the
874         KOENIG_LOOKUP_P flag of the non-dependent expression that's
875         been built.
876         (build_min_non_dep_op_overload): Instead, do it here.
877
878 2016-01-15  Jakub Jelinek  <jakub@redhat.com>
879
880         PR bootstrap/68271
881         * parser.h (cp_token): Remove pragma_kind field.  Add comment
882         with number of unused bits.
883         * parser.c (eof_token): Remove pragma_kind field initializer.
884         (cp_lexer_get_preprocessor_token): Don't set pragma_kind
885         field, don't clear CPP_PRAGMA u.value.
886         (cp_parser_pragma_kind): New function.
887         (cp_parser_omp_sections_scope, cp_parser_oacc_kernels_parallel,
888         cp_parser_omp_construct, cp_parser_initial_pragma,
889         cp_parser_pragma): Use cp_parser_pragma_kind instead of accessing
890         pragma_kind field.
891
892 2016-01-15  Jason Merrill  <jason@redhat.com>
893
894         PR c++/68847
895         * call.c (build_cxx_call): Use fold_non_dependent_expr.
896
897         * typeck2.c (cxx_incomplete_type_diagnostic): Use the location of
898         value.
899
900         PR c++/69257
901         * typeck.c (decay_conversion): Don't call mark_rvalue_use for
902         array/function-to-pointer conversion.  Call
903         complete_type_or_maybe_complain for lvalue-to-rvalue conversion.
904         * call.c (convert_like_real): Print call context if
905         decay_conversion errors.
906
907 2016-01-14  Tom de Vries  <tom@codesourcery.com>
908
909         PR tree-optimization/68773
910         * parser.c (cp_parser_oacc_declare, cp_parser_omp_declare_target): Don't
911         set force_output.
912
913 2016-01-14  Jason Merrill  <jason@redhat.com>
914
915         PR c++/69261
916         * constexpr.c (find_array_ctor_elt): Handle splitting RANGE_EXPR.
917
918 2016-01-12  Marek Polacek  <polacek@redhat.com>
919
920         PR c++/68979
921         * constexpr.c (cxx_eval_check_shift_p): Use permerror rather than
922         error_at and adjust the return value.
923
924 2016-01-12  Jakub Jelinek  <jakub@redhat.com>
925
926         PR objc++/68511
927         PR c++/69213
928         * cp-gimplify.c (cp_gimplify_expr) <case INIT_EXPR>: Don't return
929         GS_ERROR whenever seen_error (), only if *expr_p contains
930         cilk spawn stmt, but cilk_detect_spawn_and_unwrap failed.
931
932         PR c++/66808
933         PR c++/69000
934         * pt.c (tsubst_decl): If not local_p, clear DECL_TEMPLATE_INFO.
935
936 2016-01-11  Jason Merrill  <jason@redhat.com>
937
938         PR c++/69131
939         * method.c (walk_field_subobs): Add dtor_from_ctor parm.
940         (process_subob_fn): Likewise.  Don't consider triviality if true.
941         (synthesize_method_walk): Pass it.
942
943 2016-01-11  David Malcolm  <dmalcolm@redhat.com>
944
945         PR c++/68795
946         * parser.c (cp_parser_postfix_expression): Initialize
947         close_paren_loc to UNKNOWN_LOCATION; only use it if
948         it has been written to by
949         cp_parser_parenthesized_expression_list.
950         (cp_parser_parenthesized_expression_list): Document the behavior
951         with respect to the CLOSE_PAREN_LOC param.
952
953 2016-01-11  Jakub Jelinek  <jakub@redhat.com>
954
955         PR c++/69211
956         * cp-gimplify.c (cp_fold): If COMPOUND_EXPR or MODIFY_EXPR
957         folded operands have side-effects, but folding changed any of them,
958         build a new tree with the folded operands instead of returning the
959         unfolded tree.
960
961 2016-01-09  Marek Polacek  <polacek@redhat.com>
962
963         PR c++/69113
964         * decl2.c (comdat_linkage): Only set DECL_COMDAT if TREE_PUBLIC is set.
965
966 2016-01-09  Jakub Jelinek  <jakub@redhat.com>
967
968         PR c++/69164
969         * class.c (layout_class_type): Use copy_node to copy FIELD_DECLs.
970
971 2016-01-08  Jason Merrill  <jason@redhat.com>
972
973         PR c++/69158
974         * constexpr.c (cxx_fold_indirect_ref): Handle array type differing
975         in completion.
976
977 2016-01-08  Marek Polacek  <polacek@redhat.com>
978
979         PR c++/68449
980         * constexpr.c (cxx_eval_constant_expression): Handle NULL initializer.
981
982 2016-01-08  Jason Merrill  <jason@redhat.com>
983
984         * constexpr.c (cxx_eval_call_expression): Remove convert_to_void
985         workaround.
986
987         PR c++/68983
988         PR c++/67557
989         * cvt.c (convert_to_void): Don't strip a TARGET_EXPR of
990         TREE_ADDRESSABLE type.
991
992         PR c++/68983
993         PR c++/67557
994         * call.c (unsafe_copy_elision_p): Look through COMPOUND_EXPR.
995
996 2016-01-05  Nathan Sidwell  <nathan@acm.org>
997
998         PR c++/58583
999         * pt.c (build_non_dependent_expr): Don't try a checking fold when
1000         parsing an nsdmi.
1001
1002 2016-01-04  Jakub Jelinek  <jakub@redhat.com>
1003
1004         Update copyright years.
1005 \f
1006 Copyright (C) 2016 Free Software Foundation, Inc.
1007
1008 Copying and distribution of this file, with or without modification,
1009 are permitted in any medium without royalty provided the copyright
1010 notice and this notice are preserved.