Fix PR c++/69139 (deduction failure with trailing return type)
[official-gcc.git] / gcc / cp / ChangeLog
blob8ed7828c10f51f33b023185cd6bda93e60034037
1 2016-02-08  Patrick Palka  <ppalka@gcc.gnu.org>
3         PR c++/69139
4         * parser.c (cp_parser_simple_type_specifier): Make the check
5         for disambiguating between an 'auto' placeholder and an implicit
6         template parameter more robust.
8 2016-02-08  Patrick Palka  <ppalka@gcc.gnu.org>
10         PR c++/69283
11         PR c++/67835
12         * decl2.c (mark_used): When given a TEMPLATE_DECL, return after
13         setting its TREE_USED flag.
15 2016-02-08  Jason Merrill  <jason@redhat.com>
17         PR c++/69657
18         * name-lookup.c (do_nonmember_using_decl): Leave anticipated
19         built-ins alone.
21 2016-02-08  Jakub Jelinek  <jakub@redhat.com>
23         PR c++/59627
24         * parser.c (cp_parser_omp_declare_reduction): Set assembler name
25         of the DECL_OMP_DECLARE_REDUCTION_P decls.
27 2016-02-08  Marek Polacek  <polacek@redhat.com>
29         PR c++/69688
30         * constexpr.c (clear_cv_and_fold_caches): Renamed from clear_cv_cache.
31         Call clear_fold_cache.
32         * cp-tree.h: Adjust declaration.
33         * decl.c (finish_enum_value_list): Call clear_cv_and_fold_caches
34         rather than clear_cv_cache and clear_fold_cache.
35         * typeck2.c (store_init_value): Call clear_cv_and_fold_caches.
37 2016-02-08  Jason Merrill  <jason@redhat.com>
39         * cp-tree.h (CONV_FOLD, CONV_BACKEND_CONVERT): New.
40         * cvt.c (convert): Pass CONV_BACKEND_CONVERT.
41         (ocp_convert): Use *_maybe_fold.
42         (cp_convert_to_pointer): Add dofold parameter.
43         * cp-gimplify.c (cp_fold) [CONVERT_EXPR]: Call convert.
45 2016-02-05  Martin Sebor  <msebor@redhat.com>
47         PR c++/69662
48         * init.c (find_field_init): New function.
49         (warn_placement_new_too_small): Call it.  Handle one-element arrays
50         at ends of structures special.
52 2016-02-05  Jason Merrill  <jason@redhat.com>
54         PR c++/68948
55         * semantics.c (finish_expr_stmt): If expr is error_mark_node,
56         make sure we've seen_error().
58 2016-02-05  Patrick Palka  <ppalka@gcc.gnu.org>
60         PR c++/68948
61         * pt.c (tsubst_baselink): Diagnose an invalid constructor call
62         if lookup_fnfields returns NULL_TREE and the name being looked
63         up has the form A::A.
65 2016-02-04  Patrick Palka  <ppalka@gcc.gnu.org>
67         * constexpr.c (cxx_eval_binary_expression): Fold equality
68         comparisons involving PTRMEM_CSTs.
70 2016-02-04  Jakub Jelinek  <jakub@redhat.com>
72         * class.c (find_flexarrays): Don't declare dom variable.
73         (diagnose_flexarray): Likewise.
75 2016-02-02  Martain Sebor  <msebor@redhat.com>
77         PR c++/69251
78         PR c++/69253
79         PR c++/69290
80         PR c++/69277
81         PR c++/69349
82         * class.c (walk_subobject_offsets): Avoid testing the upper bound
83         of a flexible array member for equality to null.
84         (find_flexarrays): Remove spurious whitespace introduced in r231665.
85         (diagnose_flexarrays): Avoid checking the upper bound of arrays.
86         (check_flexarrays): Same.
87         * decl.c (compute_array_index_type): Avoid special case for flexible
88         array members.
89         (grokdeclarator): Avoid calling compute_array_index_type for flexible
90         array members.
91         * error.c (dump_type_suffix): Revert changes introduced in r231665
92         and rendered unnecessary by the changes above.
93         * pt.c (tsubst):  Same.
94         * tree.c (build_ctor_subob_ref): Handle flexible array members.
95         * typeck2.c (digest_init_r): Revert changes introduced in r231665.
96         (process_init_constructor_array): Same.
97         (process_init_constructor_record): Same.
99 2016-02-03  Patrick Palka  <ppalka@gcc.gnu.org>
101         PR c++/69056
102         * pt.c (try_one_overload): Handle comparing argument packs so
103         that there is no conflict if we deduced more arguments of an
104         argument pack than were explicitly specified.
106 2016-01-31  Jakub Jelinek  <jakub@redhat.com>
107             Jason Merrill  <jason@redhat.com>
109         PR c++/68763
110         * tree.c (strip_typedefs) [FUNCTION_TYPE]: Avoid building a new
111         function type if nothing is changing.
113 2016-01-31  Jason Merrill  <jason@redhat.com>
115         PR c++/69009
116         * pt.c (partial_specialization_p, impartial_args): New.
117         (instantiate_decl): Call impartial_args.
119         * mangle.c (maybe_check_abi_tags): New.
120         (write_guarded_var_name): Call it.
121         (mangle_ref_init_variable): Call check_abi_tags.
123         * pt.c (lookup_template_class_1): Don't share TYPE_ATTRIBUTES
124         between template and instantiation.
126 2016-01-29  Jakub Jelinek  <jakub@redhat.com>
128         PR debug/66869
129         * decl.c (wrapup_globals_for_namespace): Warn about unused static
130         function declarations.
132 2016-01-29  Marek Polacek  <polacek@redhat.com>
134         PR c++/69509
135         PR c++/69516
136         * constexpr.c (cxx_eval_array_reference): Give the "array subscript
137         out of bound" error earlier.
138         * init.c (build_vec_init): Change NE_EXPR into GT_EXPR.  Update the
139         commentary.
141 2016-01-29  Patrick Palka  <ppalka@gcc.gnu.org>
143         * name-lookup.c (begin_scope): After reusing a cp_binding_level
144         structure, update free_binding_level before the structure's
145         level_chain field gets cleared, not after.
147 2016-01-28  Jason Merrill  <jason@redhat.com>
149         PR c++/67407
150         * search.c (dfs_walk_once, dfs_walk_once_r)
151         (dfs_walk_once_accessible_r, dfs_walk_once_accessible): Use
152         hash_set instead of BINFO_MARKED.
153         (dfs_unmark_r): Remove.
155 2016-01-28  Patrick Palka  <ppalka@gcc.gnu.org>
157         PR c++/24208
158         * parser.c (LEXER_DEBUGGING_ENABLED_P): New macro.
159         (cp_lexer_debugging_p): Use it.
160         (cp_lexer_start_debugging): Likewise.
161         (cp_lexer_stop_debugging): Likewise.
163 2016-01-27  Marek Polacek  <polacek@redhat.com>
165         PR c/68062
166         * typeck.c (cp_build_binary_op): Promote operand to unsigned, if
167         needed.  Add -Wsign-compare warning.
169 2016-01-27  Ryan Burn  <contact@rnburn.com>
171         PR cilkplus/69267
172         * cp-gimplify.c (cilk_cp_gimplify_call_params_in_spawned_fn): Removed
173         superfluous post_p argument in call to
174         cilk_gimplify_call_params_in_spawned_fn.
176 2016-01-27  Marek Polacek  <polacek@redhat.com>
178         PR c++/69379
179         * constexpr.c (cxx_eval_constant_expression): Handle PTRMEM_CSTs
180         wrapped in NOP_EXPRs.
182 2016-01-27  Martin Sebor  <msebor@redhat.com>
184         PR c++/69317
185         * mangle.c (mangle_decl): Reference the correct (saved) version
186         of the ABI in -Wabi diagnostics.
188 2016-01-27  Marek Polacek  <polacek@redhat.com>
190         PR c++/69496
191         * constexpr.c (cxx_eval_array_reference): Evaluate the number of
192         elements of the array.
194 2016-01-26  Jason Merrill  <jason@redhat.com>
196         PR c++/68949
197         * constexpr.c (register_constexpr_fundef): Keep the un-massaged body.
198         (cxx_eval_call_expression): Don't look through clones.
199         * optimize.c (maybe_clone_body): Clear DECL_SAVED_TREE of the alias.
200         * semantics.c (expand_or_defer_fn_1): Keep DECL_SAVED_TREE of
201         maybe-in-charge *tor.
203 2016-01-26  Jason Merrill  <jason@redhat.com>
205         PR c++/68782
206         * constexpr.c (cxx_eval_bare_aggregate): Update TREE_CONSTANT
207         and TREE_SIDE_EFFECTS.
208         (cxx_eval_constant_expression) [CONSTRUCTOR]: Call
209         verify_constructor_flags.
211 2016-01-26  Jakub Jelinek  <jakub@redhat.com>
213         PR c++/68357
214         * cp-gimplify.c (cp_fold): If some operand folds to error_mark_node,
215         return error_mark_node instead of building trees with error_mark_node
216         operands.
218 2016-01-26  David Malcolm  <dmalcolm@redhat.com>
220         PR other/69006
221         * error.c (print_instantiation_partial_context_line): Add missing
222         newlines from output for the t == NULL case.
223         (print_instantiation_partial_context): Remove call to pp_newline.
225 2016-01-24  Patrick Palka  <ppalka@gcc.gnu.org>
227         Revert:
228         2016-01-18  Patrick Palka  <ppalka@gcc.gnu.org>
230         PR c++/11858
231         PR c++/24663
232         PR c++/24664
233         * decl.c (grokdeclarator): Don't decay array parameter type to
234         a pointer type if it's dependent.
235         (grokparms): Invoke strip_top_quals instead of directly invoking
236         cp_build_qualified_type.
237         * pt.c (decay_dependent_array_parm_type): New static function.
238         (type_unification_real): Call decay_dependent_array_parm_type
239         to decay a dependent array parameter type to its corresponding
240         pointer type before unification.
241         (more_specialized_fn): Likewise.
242         (get_bindings): Likewise.
243         * tree.c (cp_build_qualified_type): Trivial typofix in
244         documentation.
246 2016-01-23  Martin Sebor  <msebor@redhat.com>
248         PR c++/58109
249         PR c++/69022
250         * decl2.c (is_late_template_attribute): Handle dependent argument
251         to attribute align and attribute vector_size.
253 2016-01-21  Jason Merrill  <jason@redhat.com>
255         PR c++/69392
256         * lambda.c (lambda_capture_field_type): Handle 'this' specially
257         for init-capture, too.
259         PR c++/65687
260         * decl.c (type_is_deprecated): Don't look into a typedef.
262         PR c++/40751
263         PR c++/64987
264         * decl.c (copy_type_enum): Respect TYPE_USER_ALIGN.
266         PR c++/43407
267         * decl.c (start_enum): Add attributes parameter.
268         * parser.c (cp_parser_enum_specifier): Pass it.
269         * pt.c (lookup_template_class_1): Pass it.
270         * cp-tree.h: Adjust.
272 2016-01-19  Jason Merrill  <jason@redhat.com>
274         PR c++/59759
275         * pt.c (convert_template_argument): Handle VAR_DECL properly.
277 2016-01-19  Marek Polacek  <polacek@redhat.com>
279         PR c++/68586
280         * constexpr.c (clear_cv_cache): New.
281         * cp-gimplify.c (clear_fold_cache): New.
282         * cp-tree.h (clear_cv_cache, clear_fold_cache): Declare.
283         * decl.c (finish_enum_value_list): Call them.
285         PR c++/68965
286         * pt.c (tsubst_copy): Mark elements in expanded vector as used.
288 2016-01-18  Patrick Palka  <ppalka@gcc.gnu.org>
290         PR c++/11858
291         PR c++/24663
292         PR c++/24664
293         * decl.c (grokdeclarator): Don't decay array parameter type to
294         a pointer type if it's dependent.
295         (grokparms): Invoke strip_top_quals instead of directly invoking
296         cp_build_qualified_type.
297         * pt.c (decay_dependent_array_parm_type): New static function.
298         (type_unification_real): Call decay_dependent_array_parm_type
299         to decay a dependent array parameter type to its corresponding
300         pointer type before unification.
301         (more_specialized_fn): Likewise.
302         (get_bindings): Likewise.
303         * tree.c (cp_build_qualified_type): Trivial typofix in
304         documentation.
306 2016-01-18  Jason Merrill  <jason@redhat.com>
308         * cp-gimplify.c (cp_fold) [CONSTRUCTOR]: Don't clobber the input.
310         * cp-gimplify.c (cp_fold): Remove unnecessary special cases.
312         PR c++/68767
313         * cp-gimplify.c (cp_fold) [COND_EXPR]: Simplify.  Do fold COND_EXPR.
314         (contains_label_1, contains_label_p): Remove.
316 2016-01-16  Patrick Palka  <ppalka@gcc.gnu.org>
318         PR c++/69091
319         * pt.c (type_dependent_expression_p): For a function template
320         specialization, a type is dependent iff any of its template
321         arguments are.
323 2016-01-16  Patrick Palka  <ppalka@gcc.gnu.org>
325         * cp-array-notation.c (cp_expand_cond_array_notations): Return
326         error_mark_node only if find_rank failed, not if it was
327         successful.
329 2016-01-16  Patrick Palka  <ppalka@gcc.gnu.org>
331         PR c++/68936
332         * tree.c (build_min_non_dep_call_vec): Don't retain the
333         KOENIG_LOOKUP_P flag of the non-dependent expression that's
334         been built.
335         (build_min_non_dep_op_overload): Instead, do it here.
337 2016-01-15  Jakub Jelinek  <jakub@redhat.com>
339         PR bootstrap/68271
340         * parser.h (cp_token): Remove pragma_kind field.  Add comment
341         with number of unused bits.
342         * parser.c (eof_token): Remove pragma_kind field initializer.
343         (cp_lexer_get_preprocessor_token): Don't set pragma_kind
344         field, don't clear CPP_PRAGMA u.value.
345         (cp_parser_pragma_kind): New function.
346         (cp_parser_omp_sections_scope, cp_parser_oacc_kernels_parallel,
347         cp_parser_omp_construct, cp_parser_initial_pragma,
348         cp_parser_pragma): Use cp_parser_pragma_kind instead of accessing
349         pragma_kind field.
351 2016-01-15  Jason Merrill  <jason@redhat.com>
353         PR c++/68847
354         * call.c (build_cxx_call): Use fold_non_dependent_expr.
356         * typeck2.c (cxx_incomplete_type_diagnostic): Use the location of
357         value.
359         PR c++/69257
360         * typeck.c (decay_conversion): Don't call mark_rvalue_use for
361         array/function-to-pointer conversion.  Call
362         complete_type_or_maybe_complain for lvalue-to-rvalue conversion.
363         * call.c (convert_like_real): Print call context if
364         decay_conversion errors.
366 2016-01-14  Tom de Vries  <tom@codesourcery.com>
368         PR tree-optimization/68773
369         * parser.c (cp_parser_oacc_declare, cp_parser_omp_declare_target): Don't
370         set force_output.
372 2016-01-14  Jason Merrill  <jason@redhat.com>
374         PR c++/69261
375         * constexpr.c (find_array_ctor_elt): Handle splitting RANGE_EXPR.
377 2016-01-12  Marek Polacek  <polacek@redhat.com>
379         PR c++/68979
380         * constexpr.c (cxx_eval_check_shift_p): Use permerror rather than
381         error_at and adjust the return value.
383 2016-01-12  Jakub Jelinek  <jakub@redhat.com>
385         PR objc++/68511
386         PR c++/69213
387         * cp-gimplify.c (cp_gimplify_expr) <case INIT_EXPR>: Don't return
388         GS_ERROR whenever seen_error (), only if *expr_p contains
389         cilk spawn stmt, but cilk_detect_spawn_and_unwrap failed.
391         PR c++/66808
392         PR c++/69000
393         * pt.c (tsubst_decl): If not local_p, clear DECL_TEMPLATE_INFO.
395 2016-01-11  Jason Merrill  <jason@redhat.com>
397         PR c++/69131
398         * method.c (walk_field_subobs): Add dtor_from_ctor parm.
399         (process_subob_fn): Likewise.  Don't consider triviality if true.
400         (synthesize_method_walk): Pass it.
402 2016-01-11  David Malcolm  <dmalcolm@redhat.com>
404         PR c++/68795
405         * parser.c (cp_parser_postfix_expression): Initialize
406         close_paren_loc to UNKNOWN_LOCATION; only use it if
407         it has been written to by
408         cp_parser_parenthesized_expression_list.
409         (cp_parser_parenthesized_expression_list): Document the behavior
410         with respect to the CLOSE_PAREN_LOC param.
412 2016-01-11  Jakub Jelinek  <jakub@redhat.com>
414         PR c++/69211
415         * cp-gimplify.c (cp_fold): If COMPOUND_EXPR or MODIFY_EXPR
416         folded operands have side-effects, but folding changed any of them,
417         build a new tree with the folded operands instead of returning the
418         unfolded tree.
420 2016-01-09  Marek Polacek  <polacek@redhat.com>
422         PR c++/69113
423         * decl2.c (comdat_linkage): Only set DECL_COMDAT if TREE_PUBLIC is set.
425 2016-01-09  Jakub Jelinek  <jakub@redhat.com>
427         PR c++/69164
428         * class.c (layout_class_type): Use copy_node to copy FIELD_DECLs.
430 2016-01-08  Jason Merrill  <jason@redhat.com>
432         PR c++/69158
433         * constexpr.c (cxx_fold_indirect_ref): Handle array type differing
434         in completion.
436 2016-01-08  Marek Polacek  <polacek@redhat.com>
438         PR c++/68449
439         * constexpr.c (cxx_eval_constant_expression): Handle NULL initializer.
441 2016-01-08  Jason Merrill  <jason@redhat.com>
443         * constexpr.c (cxx_eval_call_expression): Remove convert_to_void
444         workaround.
446         PR c++/68983
447         PR c++/67557
448         * cvt.c (convert_to_void): Don't strip a TARGET_EXPR of
449         TREE_ADDRESSABLE type.
451         PR c++/68983
452         PR c++/67557
453         * call.c (unsafe_copy_elision_p): Look through COMPOUND_EXPR.
455 2016-01-05  Nathan Sidwell  <nathan@acm.org>
457         PR c++/58583
458         * pt.c (build_non_dependent_expr): Don't try a checking fold when
459         parsing an nsdmi.
461 2016-01-04  Jakub Jelinek  <jakub@redhat.com>
463         Update copyright years.
465 Copyright (C) 2016 Free Software Foundation, Inc.
467 Copying and distribution of this file, with or without modification,
468 are permitted in any medium without royalty provided the copyright
469 notice and this notice are preserved.