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