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