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