PR c++/70501
[official-gcc.git] / gcc / cp / ChangeLog
blobee830a2e7e492fe415afdfd59919e5d63dfc2b97
1 2016-04-12  Nathan Sidwell  <nathan@acm.org>
3         PR c++/70501
4         * constexpr.c (cxx_eval_bare_aggregate): Handle VECTOR_TYPE
5         similarly to PMF.
7 2016-04-11  Jason Merrill  <jason@redhat.com>
9         * mangle.c (decl_is_template_id): The template itself counts as a
10         template-id.
12 2016-04-08  Patrick Palka  <ppalka@gcc.gnu.org>
14         PR c++/70590
15         PR c++/70452
16         * constexpr.c (cxx_eval_outermost_expression): Call unshare_expr
17         on the result if it's not a CONSTRUCTOR.
19 2016-04-07  Patrick Palka  <ppalka@gcc.gnu.org>
21         PR c++/70452
22         * constexpr.c (find_constructor): New function.
23         (unshare_constructor): New function.
24         (cxx_eval_call_expression): Use unshare_constructor instead of
25         unshare_expr.
26         (find_array_ctor_elt): Likewise.
27         (cxx_eval_vec_init_1): Likewise.
28         (cxx_eval_store_expression): Likewise.
29         (cxx_eval_constant_expression): Likewise.
31 2016-04-06  Patrick Palka  <ppalka@gcc.gnu.org>
33         PR c/70436
34         * cp-tree.h (FOR_EACH_CLONE): Restructure macro to avoid
35         potentially generating a future -Wparentheses warning in its
36         callers.
38 2016-04-06  Jason Merrill  <jason@redhat.com>
40         * class.c (check_abi_tags): Fix function template handling.
42 2016-04-05  Nathan Sidwell  <nathan@acm.org>
44         PR c++/70512
45         * class.c (fixup_may_alias): New.
46         (fixup_attribute_variants): Call it.
48 2016-04-05  Patrick Palka  <ppalka@gcc.gnu.org>
50         PR c++/70452
51         * constexpr.c (struct fundef_copy): New struct.
52         (struct fundef_copies_table_t): New struct.
53         (fundef_copies_table): New static variable.
54         (maybe_initialize_fundef_copies_table): New static function.
55         (get_fundef_copy): New static function.
56         (save_fundef_copy): New static function.
57         (cxx_eval_call_expression): Use get_fundef_copy, and
58         save_fundef_copy.
59         (constexpr_call_table): Add "deletable" GTY marker.
61 2016-04-05  Patrick Palka  <ppalka@gcc.gnu.org>
63         PR c++/70452
64         * cp-tree.h (class cache_map): Remove.
65         * constexpr.c (cv_cache): Change type to
66         GTY((deletable)) hash_map<tree, tree> *.
67         (maybe_constant_value): Adjust following the change to cv_cache.
68         (clear_cv_cache): New static function.
69         (clear_cv_and_fold_caches): Use it.
70         * cp-gimplify.c (fold_cache): Change type to
71         GTY((deletable)) hash_map<tree, tree> *.
72         (clear_fold_cache): Adjust following the change to fold_cache.
73         (cp_fold): Likewise.
75 2016-04-02  Martin Sebor  <msebor@redhat.com>
77         PR c++/67376
78         PR c++/70170
79         PR c++/70172
80         PR c++/70228
81         * constexpr.c (diag_array_subscript): New function.
82         (cxx_eval_array_reference): Detect out of bounds array indices.
84 2016-04-01  Jason Merrill  <jason@redhat.com>
86         PR c++/70449
87         PR c++/70344
88         * pt.c (instantiate_decl): A function isn't fully defined if
89         DECL_INITIAL is error_mark_node.
90         * constexpr.c (cxx_eval_call_expression): Likewise.
92 2016-04-01  Jakub Jelinek  <jakub@redhat.com>
93             Marek Polacek  <polacek@redhat.com>
95         PR c++/70488
96         * init.c (warn_placement_new_too_small): Test whether
97         DECL_SIZE_UNIT or TYPE_SIZE_UNIT are integers that fit into uhwi.
99 2016-04-01  Nathan Sidwell  <nathan@acm.org>
101         PR c++/68475
102         * decl.c (check_redeclaration_exception_specification): Check
103         regardless of -fno-exceptions.
104         * typeck2.c (merge_exception_specifiers): Relax assert by checking
105         flag_exceptions too.
107 2016-03-31  Nathan Sidwell  <nathan@acm.org>
109         * decl.c (start_preparsed_function): Remove unnecessary bracing.
110         (finish_destructor_body): Don't emit operator delete here.
112 2016-03-31  Nathan Sidwell  <nathan@acm.org>
114         PR c++/70393
115         * constexpr.c (cxx_eval_store_expression): Keep CONSTRUCTOR
116         elements in field order.
118 2016-03-31  Marek Polacek  <polacek@redhat.com>
120         PR c/70297
121         * decl.c (duplicate_decls): Also set TYPE_ALIGN and TYPE_USER_ALIGN.
123 2016-03-31  Richard Biener  <rguenther@suse.de>
125         PR c++/70430
126         * typeck.c (cp_build_binary_op): Fix operand order of vector
127         conditional in truth op handling.
129 2016-03-29  Jason Merrill  <jason@redhat.com>
131         PR c++/70353
132         * decl.c (make_rtl_for_nonlocal_decl): Don't defer local statics
133         in constexpr functions.
135 2016-03-28  Jason Merrill  <jason@redhat.com>
137         PR c++/70422
138         PR c++/64266
139         PR c++/70353
140         * decl.c, pt.c, constexpr.c: Revert last patch.
142 2016-03-25  Jason Merrill  <jason@redhat.com>
143             Martin Liška  <mliska@suse.cz>
145         PR c++/64266
146         PR c++/70353
147         Core issue 1962
148         * decl.c (cp_fname_init): Decay the initializer to pointer.
149         (cp_make_fname_decl): Set DECL_DECLARED_CONSTEXPR_P,
150         DECL_VALUE_EXPR, DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
151         Don't call cp_finish_decl.
152         * pt.c (tsubst_expr) [DECL_EXPR]: Set DECL_VALUE_EXPR,
153         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.  Don't call cp_finish_decl.
154         * constexpr.c (cxx_eval_constant_expression) [VAR_DECL]:
155         Handle DECL_VALUE_EXPR.
157 2016-03-24  Jason Merrill  <jason@redhat.com>
159         PR c++/70386
160         * constexpr.c (cxx_eval_bare_aggregate): Handle PMFs.
162         PR c++/70323
163         * constexpr.c (cxx_eval_call_expression): Don't cache result if
164         *overflow_p.
166 2016-03-24  Patrick Palka  <ppalka@gcc.gnu.org>
168         PR c++/62212
169         * tree.c (build_cplus_array_type): Determine type-dependentess
170         with uses_template_parms instead of with dependent_type_p.
172 2016-03-23  Patrick Palka  <ppalka@gcc.gnu.org>
174         PR c++/70347
175         * typeck.c (process_init_constructor_union): If the initializer
176         is empty, use the union's NSDMI if it has one.
178 2016-03-23  Patrick Palka  <ppalka@gcc.gnu.org>
180         PR c++/70332
181         * pt.c (tsubst_copy) [PARM_DECL]: Handle the use of 'this' in an
182         NSDMI that's part of an aggregrate initialization.
184 2016-03-23  Jakub Jelinek  <jakub@redhat.com>
186         PR c++/70001
187         * constexpr.c (cxx_eval_vec_init_1): Reuse CONSTRUCTOR initializers
188         for 1..max even for multi-dimensional arrays.  Call unshare_expr
189         on it.
191         PR c++/70323
192         * constexpr.c (cxx_eval_constant_expression): Diagnose overflow
193         on TREE_OVERFLOW constants.
195         PR c++/70376
196         * cp-gimplify.c (genericize_omp_for_stmt): Don't walk OMP_FOR_CLAUSES
197         for OMP_TASKLOOP here.
198         (cp_genericize_r): Handle OMP_TASKLOOP like OMP_TASK, except do call
199         genericize_omp_for_stmt instead of cp_walk_tree on OMP_BODY.
201 2016-03-23  Alexandre Oliva  <aoliva@redhat.com>
202             Jason Merrill  <jason@redhat.com>
203             Jakub Jelinek  <jakub@redhat.com>
205         PR c++/69315
206         * cp-tree.h (defer_mark_used_calls, deferred_mark_used_calls): Remove.
207         * decl.c (defer_mark_used_calls, deferred_mark_used_calls): Remove.
208         (finish_function): Don't set or test them.
209         * decl2.c (mark_used): Don't handle defer_mark_used_calls.
211 2016-03-23  Jason Merrill  <jason@redhat.com>
213         PR c++/70344
214         * constexpr.c (cxx_eval_call_expression): Catch invalid recursion.
216 2016-03-23  Marek Polacek  <polacek@redhat.com>
218         PR c++/69884
219         * pt.c (canonicalize_type_argument): Use OPT_Wignored_attributes.
221 2016-03-22  Ilya Enkovich  <enkovich.gnu@gmail.com>
223         * call.c (build_conditional_expr_1): Always use original
224         condition type for vector type checks and build.
226 2016-03-22  Patrick Palka  <ppalka@gcc.gnu.org>
228         PR c++/70096
229         * pt.c (tsubst_decl): Clear the DECL_MODE of the new decl.
231 2016-03-22  Patrick Palka  <ppalka@gcc.gnu.org>
233         PR c++/70204
234         * constexpr.c (non_const_var_error): Check
235         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
237 2016-03-21  Richard Henderson  <rth@redhat.com>
239         PR c++/70273
240         * decl.c (notice_forced_label_r): New.
241         (cp_finish_decl): Use it.
243 2016-03-21  Jason Merrill  <jason@redhat.com>
245         PR c++/70285
246         * cp-gimplify.c (cp_fold) [COND_EXPR]: Handle bit-fields.
248 2016-03-18  Jason Merrill  <jason@redhat.com>
250         PR c++/70139
251         * constexpr.c (cxx_eval_call_expression): Fix trivial copy.
253         PR c++/70147
254         * class.c (vptr_via_virtual_p): New.
255         (most_primary_binfo): Factor out of build_rtti_vtbl_entries.
256         * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs): Don't clear
257         a vptr from any virtual base in a not-in-charge 'structor.
259         * decl.c (build_clobber_this): Factor out of
260         start_preparsed_function and begin_destructor_body.  Handle
261         virtual bases better.
263         * class.c (build_if_in_charge): Split out from build_base_path.
264         * init.c (expand_virtual_init, expand_default_init): Use it.
265         * call.c (build_special_member_call): Use it.
267 2016-03-18  Jakub Jelinek  <jakub@redhat.com>
269         PR c++/70267
270         * init.c (build_new_1): Complain and return error_mark_node
271         if alloc_fn is not _Jv_AllocObject function returning pointer.
273 2016-03-18  Patrick Palka  <ppalka@gcc.gnu.org>
275         PR c++/70205
276         * search.c (adjust_result_of_qualified_name_lookup): Don't
277         update the BASELINK_BINFO of DECL if the second call
278         to lookup_base fails.
280 2016-03-18  Patrick Palka  <ppalka@gcc.gnu.org>
282         PR c++/70218
283         * parser.c (cp_parser_lambda_expression): Move call to
284         pop_deferring_access_checks ahead of the call to
285         cp_parser_end_tentative_firewall.
287 2016-03-17  Jakub Jelinek  <jakub@redhat.com>
289         PR c++/70144
290         * cp-tree.h (magic_varargs_p): Return int instead of bool.
291         * call.c (magic_varargs_p): Return int instead of bool, return 2 for
292         Cilk+ reductions, otherwise 1 for magic varargs and 0 for normal
293         varargs.
294         (build_over_call): If magic_varargs_p == 2, call reject_gcc_builtin,
295         if magic_varargs_p == 1, call decay_conversion
296         instead of mark_type_use.  Don't store error_mark_node arguments to
297         argarray, instead return error_mark_node.
299         PR c++/70272
300         * decl.c (begin_destructor_body): Don't insert clobber if
301         is_empty_class (current_class_type).
303 2016-03-17  Marek Polacek  <polacek@redhat.com>
305         PR c++/70194
306         * typeck.c (warn_for_null_address): New function.
307         (cp_build_binary_op): Call it.
309 2016-03-16  Jason Merrill  <jason@redhat.com>
311         PR c++/70259
312         * decl.c (start_preparsed_function): Don't clobber an empty base.
314 2016-03-16  Jakub Jelinek  <jakub@redhat.com>
316         PR c++/70147
317         * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs): Conditionalize
318         BINFO_VIRTUAL_P vtable clearing on current_in_charge_parm.
320         PR c++/70147
321         * cp-ubsan.c (cp_ubsan_maybe_initialize_vtbl_ptrs): Temporarily
322         set in_base_initializer.
324 2016-03-15  Marek Polacek  <polacek@redhat.com>
326         PR c++/70209
327         * tree.c (strip_typedefs): Call strip_typedefs again on the
328         DECL_ORIGINAL_TYPE result.
330 2016-03-15  Jason Merrill  <jason@redhat.com>
332         PR c++/70095
333         * pt.c (instantiate_decl): Fix call to variable_template_p.
335         PR c++/70141
336         * pt.c (for_each_template_parm_r): Always walk into TYPENAME_TYPE.
338 2016-03-14  Casey Carter  <casey@carter.net>
339             Jason Merrill  <jason@redhat.com>
341         P0184R0: Generalizing the Range-Based For Loop
342         * parser.c (cp_convert_range_for): Set the type of __end separately.
343         (cp_parser_perform_range_for_lookup): Allow different begin/end
344         types if they are comparable.
346 2016-03-12  Patrick Palka  <ppalka@gcc.gnu.org>
348         PR c++/70106
349         * semantics.c (force_paren_expr): Just build a PAREN_EXPR when
350         processing_template_decl and EXPR is a SCOPE_REF.
352 2016-03-10  Patrick Palka  <ppalka@gcc.gnu.org>
353             Jakub Jelinek  <jakub@redhat.com>
355         PR c++/70001
356         * constexpr.c (cxx_eval_vec_init_1): For pre_init case, reuse
357         return value from cxx_eval_constant_expression from earlier
358         elements if it is valid constant initializer requiring no
359         relocations.
361 2016-03-10  Marek Polacek  <polacek@redhat.com>
363         PR c++/70153
364         * cp-gimplify.c (cp_fold): Handle UNARY_PLUS_EXPR.
366 2016-03-09  Cesar Philippidis  <cesar@codesourcery.com>
368         * parser.c (cp_parser_oacc_loop): Update cclauses and clauses
369         when calling c_finish_omp_clauses.
371 2016-03-08  Jason Merrill  <jason@redhat.com>
373         * parser.c (cp_parser_diagnose_invalid_type_name): Give helpful
374         diagnostic for use of "concept".
375         (cp_parser_requires_clause_opt): And "requires".
376         (cp_parser_type_parameter, cp_parser_late_return_type_opt)
377         (cp_parser_explicit_template_declaration): Adjust.
378         * Make-lang.in (check-c++-all): Add "concepts" to std list.
380         P0036R0: Unary Folds and Empty Parameter Packs
381         * pt.c (expand_empty_fold): Remove special cases for *,+,&,|.
383 2016-03-08  Jakub Jelinek  <jakub@redhat.com>
385         PR c++/70135
386         * constexpr.c (cxx_eval_loop_expr): Forget saved values of SAVE_EXPRs
387         even after the last iteration of the loop.
389         * decl.c (duplicate_decls): Fix spelling - becuase -> because.
391 2016-03-07  Patrick Palka  <ppalka@gcc.gnu.org>
393         PR c++/66786
394         * pt.c (get_template_info): Handle PARM_DECL.
395         (template_class_depth): Check DECL_P instead of
396         VAR_OR_FUNCTION_DECL_P.
398 2016-03-05  Jason Merrill  <jason@redhat.com>
400         PR c++/67364
401         * constexpr.c (cxx_eval_store_expression): Replace
402         CONSTRUCTOR_ELTS in nested CONSTRUCTORs, too.
404 2016-03-05  Patrick Palka  <ppalka@gcc.gnu.org>
406         PR c++/66786
407         * pt.c (template_class_depth): Given a lambda type, iterate
408         into its LAMBDA_TYPE_EXTRA_SCOPE field instead of its
409         TYPE_CONTEXT.  Given a VAR_DECL, iterate into its
410         CP_DECL_CONTEXT.
412 2016-03-04  Jason Merrill  <jason@redhat.com>
414         PR c++/69203
415         * cp-tree.h (COND_EXPR_IS_VEC_DELETE): New.
416         * init.c (build_vec_delete_1): Set it.
417         * constexpr.c (potential_constant_expression_1) [COND_EXPR]: Check it.
419 2016-03-04  Jakub Jelinek  <jakub@redhat.com>
421         * decl.c (start_preparsed_function): Don't emit start clobber at the
422         start of constructor clones.
424         PR c++/70035
425         * cp-tree.h (cp_ubsan_maybe_initialize_vtbl_ptrs): New prototype.
426         * decl.c (start_preparsed_function): Call
427         cp_ubsan_maybe_initialize_vtbl_ptrs if needed.
428         * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs,
429         cp_ubsan_maybe_initialize_vtbl_ptrs): New functions.
431 2016-03-04  Jason Merrill  <jason@redhat.com>
433         PR c++/67364
434         * constexpr.c (cxx_eval_component_reference): Further tweak.
436         * constexpr.c (struct constexpr_ctx): Add save_exprs field.
437         (cxx_eval_loop_expr): Discard SAVE_EXPR values before looping.
438         (cxx_eval_constant_expression) [SAVE_EXPR]: Add it to the set.
439         (cxx_eval_outermost_constant_expr, is_sub_constant_expr): Initialize.
441         PR c++/70067
442         * tree.c (strip_typedefs): Handle TYPENAME_TYPE lookup finding the
443         same type.
445 2016-03-03  Jason Merrill  <jason@redhat.com>
447         * method.c (synthesized_method_walk): operator= can also be constexpr.
449         * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Get
450         LAMBDA_EXPR_RETURN_TYPE from the instantiated closure.
452         PR c++/67164
453         * pt.c (copy_template_args): New.
454         (tsubst_pack_expansion): Use it.
456         * call.c (build_aggr_conv): Use get_nsdmi.
458         PR c++/51406
459         * typeck.c (build_static_cast_1): Avoid folding back to lvalue.
461         PR c++/67364
462         * constexpr.c (cxx_eval_component_reference): Just return an empty
463         CONSTRUCTOR for an empty class.
465 2016-03-01  Jason Merrill  <jason@redhat.com>
467         PR c++/70036
468         * parser.c (cp_parser_requires_clause): Call
469         check_for_bare_parameter_packs.
471         PR c++/51489
472         * constexpr.c (cxx_eval_binary_expression): Don't VERIFY_CONSTANT
473         the operands.
475         PR c++/69995
476         * constexpr.c (cxx_eval_call_expression): Unshare arg.
477         (cxx_eval_constant_expression) [DECL_EXPR]: Unshare init.
478         [TARGET_EXPR]: Unshare init.
480 2016-03-01  Patrick Palka  <ppalka@gcc.gnu.org>
482         PR c++/68948
483         PR c++/69961
484         * pt.c (tsubst_baselink): Reinstate the check for an invalid
485         constructor call.
487 2016-02-28  Jason Merrill  <jason@redhat.com>
489         PR c++/69995
490         * constexpr.c (cxx_eval_store_expression): Unshare init.
492 2016-02-26  Jason Merrill  <jason@redhat.com>
494         PR c++/69958
495         * pt.c (make_argument_pack): New.
496         (tsubst_copy) [SIZEOF_EXPR]: Handle partial expansion.
497         (tsubst_copy_and_build): Likewise.
499 2016-02-25  Jason Merrill  <jason@redhat.com>
501         PR c++/69889
502         * cp-tree.h (AGGR_INIT_FROM_THUNK_P): New.
503         * tree.c (build_aggr_init_expr): Set it.
504         * semantics.c (simplify_aggr_init_expr): Check it.
505         * cp-gimplify.c (cp_genericize_r): Don't walk into
506         a call/aggr_init from a thunk.
508         PR c++/69842
509         * method.c (forward_parm): Handle parameter packs.
510         * lambda.c (maybe_add_lambda_conv_op): Use it for them.
512         PR c++/67364
513         * constexpr.c (cxx_eval_component_reference): Don't complain about
514         unevaluated empty classes.
516         PR c++/68049
517         * tree.c (strip_typedefs): Use DECL_ORIGINAL_TYPE.
519 2016-02-25  Patrick Palka  <ppalka@gcc.gnu.org>
521         PR c++/69736
522         * cp-tree.h (REF_PARENTHESIZED_P): Adjust documentation.
523         (maybe_undo_parenthesized_ref): Declare.
524         * semantics.c (maybe_undo_parenthesized_ref): Split out from
525         check_return_expr.
526         (finish_call_expr): Use it.
527         * typeck.c (check_return_expr): Use it.
528         * pt.c (tsubst_copy_and_build) [INDIRECT_REF]: Retain the
529         REF_PARENTHESIZED_P flag.
531 2016-02-24  Jakub Jelinek  <jakub@redhat.com>
533         PR c++/69922
534         * class.c (build_base_path): Set TREE_NO_WARNING on the null_test.
535         Avoid folding it.
536         * init.c (build_vec_delete_1, build_delete): Don't fold the non-NULL
537         tests.
538         * cp-gimplify.c (cp_fold): For TREE_NO_WARNING comparisons with NULL,
539         unless they are folded into INTEGER_CST, error_mark_node or some
540         comparison with NULL, avoid folding them and use either the original
541         comparison or non-folded comparison of folded arguments.
542         * cp-ubsan.c (cp_ubsan_instrument_vptr): Set TREE_NO_WARNING on the
543         comparison, don't fold the comparison right away.
545 2016-02-24  Jason Merrill  <jason@redhat.com>
547         PR c++/69323
548         * friend.c (make_friend_class): Likewise.
549         * decl.c (lookup_and_check_tag): Diagnose invalid dependent friend.
551 2016-02-24  Jason Merrill  <jason@redhat.com>
553         PR c++/69323
554         * pt.c (instantiate_class_template_1): Set
555         processing_template_decl before substituting friend_type.
557 016-02-24  Martin Sebor  <msebor@redhat.com>
559         PR c++/69912
560         * tree.c (build_ctor_subob_ref): Compare types' main variants
561         instead of the types as they are.
563 2016-02-24  Jason Merrill  <jason@redhat.com>
565         * decl.c (start_preparsed_function): Condition ctor clobber on
566         flag_lifetime_dse > 1.
568         * cp-gimplify.c (cp_fold): Don't fold constexpr calls if -fno-inline.
570 2016-02-19  Jason Merrill  <jason@redhat.com>
572         PR c++/69743
573         * call.c (remaining_arguments): No longer static.
574         * cp-tree.h: Declare it.
575         * pt.c (more_specialized_fn): Use it.
577 2016-02-19  Jakub Jelinek  <jakub@redhat.com>
578             Bernd Edlinger  <bernd.edlinger@hotmail.de>
580         * Make-lang.in: Invoke gperf with -L C++.
581         * cfns.gperf: Remove prototypes for hash and libc_name_p
582         inlines.
583         * cfns.h: Regenerated.
584         * except.c (nothrow_libfn_p): Adjust.
586 2016-02-19  Jakub Jelinek  <jakub@redhat.com>
588         PR c++/69850
589         * rtti.c (ifnonnull): Set TREE_NO_WARNING on the condition, use
590         NE_EXPR instead of EQ_EXPR and swap last two arguments on COND_EXPR.
592 2016-02-19  Patrick Palka  <ppalka@gcc.gnu.org>
594         PR c++/68948
595         * pt.c (tsubst_baselink): Don't diagnose an invalid constructor
596         call here.
597         * semantics.c (finish_call_expr): Don't assume a constructor
598         call is dependent if only the "this" pointer is dependent.  When
599         building a constructor call, always use a dummy object.
601 2016-02-19  Jakub Jelinek  <jakub@redhat.com>
603         PR c++/69850
604         * init.c (build_vec_delete_1): Set TREE_NO_WARNING on the NE_EXPR
605         condition.
606         * cp-gimplify.c (cp_fold): Propagate TREE_NO_WARNING from binary
607         operators if folding preserved the binop, just with different
608         arguments.
610         PR c++/67767
611         * parser.c (cp_parser_std_attribute_spec_seq): Don't assume
612         attr_spec is always single element chain, chain all the attributes
613         properly together in the right order.
615 2016-02-18  Jason Merrill  <jason@redhat.com>
617         * mangle.c (maybe_check_abi_tags): Add for_decl parm.  Call
618         mangle_decl.
619         (mangle_decl): Call maybe_check_abi_tags for function scope.
620         (mangle_guard_variable): Call maybe_check_abi_tags here.
621         (write_guarded_var_name): Not here.
623 2016-02-17  Jason Merrill  <jason@redhat.com>
625         PR c++/65985
626         * constexpr.c (build_constexpr_constructor_member_initializers):
627         Handle an additional STATEMENT_LIST.
629         PR c++/68585
630         * constexpr.c (cxx_eval_bare_aggregate): Fix 'changed' detection.
632         PR c++/68679
633         * decl2.c (reset_type_linkage_2): Look through member templates.
635 2016-02-17  Jakub Jelinek  <jakub@redhat.com>
637         PR c++/69850
638         * init.c (build_delete): Set TREE_NO_WARNING on ifexp.
640 2016-02-17  Jason Merrill  <jason@redhat.com>
642         PR c++/69842
643         * method.c (forward_parm): Split out from...
644         (add_one_base_init): ...here.
645         * lambda.c (maybe_add_lambda_conv_op): Use it.
647 2016-02-16  Jason Merrill  <jason@redhat.com>
649         PR c++/10200
650         PR c++/69753
651         * call.c, cp-tree.h, name-lookup.c, pt.c, search.c, semantics.c,
652         tree.c, typeck2.c: Revert earlier changes.
653         * parser.c (cp_parser_lookup_name): Ignore namespace-scope
654         non-type templates after -> or .
656 2016-02-16  Jakub Jelinek  <jakub@redhat.com>
658         PR c/69835
659         * typeck.c (cp_build_binary_op): Revert 2015-09-09 change.
661 2016-02-16  Jason Merrill  <jason@redhat.com>
663         PR c++/69657
664         * name-lookup.c (lookup_qualified_name): Add find_hidden parm.
665         (set_decl_namespace): Pass it.  Complain about finding a hidden friend.
666         * name-lookup.h: Adjust.
668 2016-02-16  James Norris  <jnorris@codesourcery.com>
670         * parser.c (cp_parser_oacc_data_clause_deviceptr): Remove checking.
671         * semantics.c (finish_omp_clauses): Add deviceptr checking.
673 2016-02-15  Jakub Jelinek  <jakub@redhat.com>
675         PR c++/69658
676         * init.c (expand_default_init): Only call reshape_init
677         in the direct-initialization from an initializer list case.
679 2016-02-15  Jason Merrill  <jason@redhat.com>
681         PR c++/69753
682         * semantics.c (finish_call_expr): Implicit 'this' does not make
683         the call dependent.
684         * search.c (any_dependent_bases_p): Split out...
685         * name-lookup.c (do_class_using_decl): ...from here.
686         * call.c (build_new_method_call_1): Don't complain about missing object
687         if there are dependent bases.  Tweak error.
688         * tree.c (non_static_member_function_p): Remove.
689         * pt.c (type_dependent_expression_p): A member template of a
690         dependent type is dependent.
691         * cp-tree.h: Adjust.
693         PR c++/68890
694         * constexpr.c (verify_ctor_sanity): Remove CONSTRUCTOR_NELTS check.
696 2016-02-12  Patrick Palka  <ppalka@gcc.gnu.org>
698         PR c++/69098
699         * pt.c (lookup_and_finish_template_variable): New function,
700         extracted from ...
701         (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: ... here.  Use it.
702         (tsubst_qualified_id): Consider that EXPR might be a variable
703         template.
704         * typeck.c (check_template_keyword): Don't emit an error
705         if DECL is a variable template.
707 2016-02-12  Jakub Jelinek  <jakub@redhat.com>
709         * error.c: Spelling fixes - behaviour -> behavior and
710         neighbour -> neighbor.
711         * decl.c: Likewise.
712         * typeck.c (cp_build_binary_op): Fix up behavior spelling in
713         diagnostics.
714         * init.c (build_delete): Likewise.
716 2016-02-11  Jakub Jelinek  <jakub@redhat.com>
718         PR c/69768
719         * typeck.c (cp_build_binary_op): cp_fully_fold integer_zerop
720         arguments for -Waddress warning.  Fix up formatting.
722 2016-02-11  Paolo Carlini  <paolo.carlini@oracle.com>
724         PR c++/68726
725         * pt.c (lookup_template_class_1): Check tsubst return value for
726         error_mark_node.
728 2016-02-10  Jason Merrill  <jason@redhat.com>
730         PR c++/68926
731         * pt.c (resolve_nondeduced_context): Add complain parm.
732         (do_auto_deduction): Pass it.
733         * cvt.c (convert_to_void): Likewise.
734         * decl.c (cp_finish_decl): Likewise.
735         * init.c (build_new): Likewise.
736         * rtti.c (get_tinfo_decl_dynamic): Likewise.
737         * semantics.c (finish_decltype_type): Likewise.
738         * typeck.c (decay_conversion): Likewise.
739         * cp-tree.h: Adjust declaration.
740         * call.c (standard_conversion): Add complain parm, pass it along.
741         (implicit_conversion): Pass it.
743         PR c++/69657
744         * name-lookup.c (ambiguous_decl): Call remove_hidden_names.
745         (lookup_name_real_1): Likewise.
746         (remove_hidden_names): Handle non-functions too.
748         PR c++/10200
749         * parser.c (cp_parser_lookup_name): When looking for a template
750         after . or ->, only consider class templates.
751         (cp_parser_postfix_dot_deref_expression): Handle the current
752         instantiation.  Remember a dependent object expression.
753         * typeck2.c (build_x_arrow): Handle the current instantiation.
755         * ptree.c (debug_tree): Implement for cp_expr.
757 2016-02-08  Patrick Palka  <ppalka@gcc.gnu.org>
759         PR c++/69139
760         * parser.c (cp_parser_simple_type_specifier): Make the check
761         for disambiguating between an 'auto' placeholder and an implicit
762         template parameter more robust.
764 2016-02-08  Patrick Palka  <ppalka@gcc.gnu.org>
766         PR c++/69283
767         PR c++/67835
768         * decl2.c (mark_used): When given a TEMPLATE_DECL, return after
769         setting its TREE_USED flag.
771 2016-02-08  Jason Merrill  <jason@redhat.com>
773         PR c++/69657
774         * name-lookup.c (do_nonmember_using_decl): Leave anticipated
775         built-ins alone.
777 2016-02-08  Jakub Jelinek  <jakub@redhat.com>
779         PR c++/59627
780         * parser.c (cp_parser_omp_declare_reduction): Set assembler name
781         of the DECL_OMP_DECLARE_REDUCTION_P decls.
783 2016-02-08  Marek Polacek  <polacek@redhat.com>
785         PR c++/69688
786         * constexpr.c (clear_cv_and_fold_caches): Renamed from clear_cv_cache.
787         Call clear_fold_cache.
788         * cp-tree.h: Adjust declaration.
789         * decl.c (finish_enum_value_list): Call clear_cv_and_fold_caches
790         rather than clear_cv_cache and clear_fold_cache.
791         * typeck2.c (store_init_value): Call clear_cv_and_fold_caches.
793 2016-02-08  Jason Merrill  <jason@redhat.com>
795         * cp-tree.h (CONV_FOLD, CONV_BACKEND_CONVERT): New.
796         * cvt.c (convert): Pass CONV_BACKEND_CONVERT.
797         (ocp_convert): Use *_maybe_fold.
798         (cp_convert_to_pointer): Add dofold parameter.
799         * cp-gimplify.c (cp_fold) [CONVERT_EXPR]: Call convert.
801 2016-02-05  Martin Sebor  <msebor@redhat.com>
803         PR c++/69662
804         * init.c (find_field_init): New function.
805         (warn_placement_new_too_small): Call it.  Handle one-element arrays
806         at ends of structures special.
808 2016-02-05  Jason Merrill  <jason@redhat.com>
810         PR c++/68948
811         * semantics.c (finish_expr_stmt): If expr is error_mark_node,
812         make sure we've seen_error().
814 2016-02-05  Patrick Palka  <ppalka@gcc.gnu.org>
816         PR c++/68948
817         * pt.c (tsubst_baselink): Diagnose an invalid constructor call
818         if lookup_fnfields returns NULL_TREE and the name being looked
819         up has the form A::A.
821 2016-02-04  Patrick Palka  <ppalka@gcc.gnu.org>
823         * constexpr.c (cxx_eval_binary_expression): Fold equality
824         comparisons involving PTRMEM_CSTs.
826 2016-02-04  Jakub Jelinek  <jakub@redhat.com>
828         * class.c (find_flexarrays): Don't declare dom variable.
829         (diagnose_flexarray): Likewise.
831 2016-02-02  Martain Sebor  <msebor@redhat.com>
833         PR c++/69251
834         PR c++/69253
835         PR c++/69290
836         PR c++/69277
837         PR c++/69349
838         * class.c (walk_subobject_offsets): Avoid testing the upper bound
839         of a flexible array member for equality to null.
840         (find_flexarrays): Remove spurious whitespace introduced in r231665.
841         (diagnose_flexarrays): Avoid checking the upper bound of arrays.
842         (check_flexarrays): Same.
843         * decl.c (compute_array_index_type): Avoid special case for flexible
844         array members.
845         (grokdeclarator): Avoid calling compute_array_index_type for flexible
846         array members.
847         * error.c (dump_type_suffix): Revert changes introduced in r231665
848         and rendered unnecessary by the changes above.
849         * pt.c (tsubst):  Same.
850         * tree.c (build_ctor_subob_ref): Handle flexible array members.
851         * typeck2.c (digest_init_r): Revert changes introduced in r231665.
852         (process_init_constructor_array): Same.
853         (process_init_constructor_record): Same.
855 2016-02-03  Patrick Palka  <ppalka@gcc.gnu.org>
857         PR c++/69056
858         * pt.c (try_one_overload): Handle comparing argument packs so
859         that there is no conflict if we deduced more arguments of an
860         argument pack than were explicitly specified.
862 2016-01-31  Jakub Jelinek  <jakub@redhat.com>
863             Jason Merrill  <jason@redhat.com>
865         PR c++/68763
866         * tree.c (strip_typedefs) [FUNCTION_TYPE]: Avoid building a new
867         function type if nothing is changing.
869 2016-01-31  Jason Merrill  <jason@redhat.com>
871         PR c++/69009
872         * pt.c (partial_specialization_p, impartial_args): New.
873         (instantiate_decl): Call impartial_args.
875         * mangle.c (maybe_check_abi_tags): New.
876         (write_guarded_var_name): Call it.
877         (mangle_ref_init_variable): Call check_abi_tags.
879         * pt.c (lookup_template_class_1): Don't share TYPE_ATTRIBUTES
880         between template and instantiation.
882 2016-01-29  Jakub Jelinek  <jakub@redhat.com>
884         PR debug/66869
885         * decl.c (wrapup_globals_for_namespace): Warn about unused static
886         function declarations.
888 2016-01-29  Marek Polacek  <polacek@redhat.com>
890         PR c++/69509
891         PR c++/69516
892         * constexpr.c (cxx_eval_array_reference): Give the "array subscript
893         out of bound" error earlier.
894         * init.c (build_vec_init): Change NE_EXPR into GT_EXPR.  Update the
895         commentary.
897 2016-01-29  Patrick Palka  <ppalka@gcc.gnu.org>
899         * name-lookup.c (begin_scope): After reusing a cp_binding_level
900         structure, update free_binding_level before the structure's
901         level_chain field gets cleared, not after.
903 2016-01-28  Jason Merrill  <jason@redhat.com>
905         PR c++/67407
906         * search.c (dfs_walk_once, dfs_walk_once_r)
907         (dfs_walk_once_accessible_r, dfs_walk_once_accessible): Use
908         hash_set instead of BINFO_MARKED.
909         (dfs_unmark_r): Remove.
911 2016-01-28  Patrick Palka  <ppalka@gcc.gnu.org>
913         PR c++/24208
914         * parser.c (LEXER_DEBUGGING_ENABLED_P): New macro.
915         (cp_lexer_debugging_p): Use it.
916         (cp_lexer_start_debugging): Likewise.
917         (cp_lexer_stop_debugging): Likewise.
919 2016-01-27  Marek Polacek  <polacek@redhat.com>
921         PR c/68062
922         * typeck.c (cp_build_binary_op): Promote operand to unsigned, if
923         needed.  Add -Wsign-compare warning.
925 2016-01-27  Ryan Burn  <contact@rnburn.com>
927         PR cilkplus/69267
928         * cp-gimplify.c (cilk_cp_gimplify_call_params_in_spawned_fn): Removed
929         superfluous post_p argument in call to
930         cilk_gimplify_call_params_in_spawned_fn.
932 2016-01-27  Marek Polacek  <polacek@redhat.com>
934         PR c++/69379
935         * constexpr.c (cxx_eval_constant_expression): Handle PTRMEM_CSTs
936         wrapped in NOP_EXPRs.
938 2016-01-27  Martin Sebor  <msebor@redhat.com>
940         PR c++/69317
941         * mangle.c (mangle_decl): Reference the correct (saved) version
942         of the ABI in -Wabi diagnostics.
944 2016-01-27  Marek Polacek  <polacek@redhat.com>
946         PR c++/69496
947         * constexpr.c (cxx_eval_array_reference): Evaluate the number of
948         elements of the array.
950 2016-01-26  Jason Merrill  <jason@redhat.com>
952         PR c++/68949
953         * constexpr.c (register_constexpr_fundef): Keep the un-massaged body.
954         (cxx_eval_call_expression): Don't look through clones.
955         * optimize.c (maybe_clone_body): Clear DECL_SAVED_TREE of the alias.
956         * semantics.c (expand_or_defer_fn_1): Keep DECL_SAVED_TREE of
957         maybe-in-charge *tor.
959 2016-01-26  Jason Merrill  <jason@redhat.com>
961         PR c++/68782
962         * constexpr.c (cxx_eval_bare_aggregate): Update TREE_CONSTANT
963         and TREE_SIDE_EFFECTS.
964         (cxx_eval_constant_expression) [CONSTRUCTOR]: Call
965         verify_constructor_flags.
967 2016-01-26  Jakub Jelinek  <jakub@redhat.com>
969         PR c++/68357
970         * cp-gimplify.c (cp_fold): If some operand folds to error_mark_node,
971         return error_mark_node instead of building trees with error_mark_node
972         operands.
974 2016-01-26  David Malcolm  <dmalcolm@redhat.com>
976         PR other/69006
977         * error.c (print_instantiation_partial_context_line): Add missing
978         newlines from output for the t == NULL case.
979         (print_instantiation_partial_context): Remove call to pp_newline.
981 2016-01-24  Patrick Palka  <ppalka@gcc.gnu.org>
983         Revert:
984         2016-01-18  Patrick Palka  <ppalka@gcc.gnu.org>
986         PR c++/11858
987         PR c++/24663
988         PR c++/24664
989         * decl.c (grokdeclarator): Don't decay array parameter type to
990         a pointer type if it's dependent.
991         (grokparms): Invoke strip_top_quals instead of directly invoking
992         cp_build_qualified_type.
993         * pt.c (decay_dependent_array_parm_type): New static function.
994         (type_unification_real): Call decay_dependent_array_parm_type
995         to decay a dependent array parameter type to its corresponding
996         pointer type before unification.
997         (more_specialized_fn): Likewise.
998         (get_bindings): Likewise.
999         * tree.c (cp_build_qualified_type): Trivial typofix in
1000         documentation.
1002 2016-01-23  Martin Sebor  <msebor@redhat.com>
1004         PR c++/58109
1005         PR c++/69022
1006         * decl2.c (is_late_template_attribute): Handle dependent argument
1007         to attribute align and attribute vector_size.
1009 2016-01-21  Jason Merrill  <jason@redhat.com>
1011         PR c++/69392
1012         * lambda.c (lambda_capture_field_type): Handle 'this' specially
1013         for init-capture, too.
1015         PR c++/65687
1016         * decl.c (type_is_deprecated): Don't look into a typedef.
1018         PR c++/40751
1019         PR c++/64987
1020         * decl.c (copy_type_enum): Respect TYPE_USER_ALIGN.
1022         PR c++/43407
1023         * decl.c (start_enum): Add attributes parameter.
1024         * parser.c (cp_parser_enum_specifier): Pass it.
1025         * pt.c (lookup_template_class_1): Pass it.
1026         * cp-tree.h: Adjust.
1028 2016-01-19  Jason Merrill  <jason@redhat.com>
1030         PR c++/59759
1031         * pt.c (convert_template_argument): Handle VAR_DECL properly.
1033 2016-01-19  Marek Polacek  <polacek@redhat.com>
1035         PR c++/68586
1036         * constexpr.c (clear_cv_cache): New.
1037         * cp-gimplify.c (clear_fold_cache): New.
1038         * cp-tree.h (clear_cv_cache, clear_fold_cache): Declare.
1039         * decl.c (finish_enum_value_list): Call them.
1041         PR c++/68965
1042         * pt.c (tsubst_copy): Mark elements in expanded vector as used.
1044 2016-01-18  Patrick Palka  <ppalka@gcc.gnu.org>
1046         PR c++/11858
1047         PR c++/24663
1048         PR c++/24664
1049         * decl.c (grokdeclarator): Don't decay array parameter type to
1050         a pointer type if it's dependent.
1051         (grokparms): Invoke strip_top_quals instead of directly invoking
1052         cp_build_qualified_type.
1053         * pt.c (decay_dependent_array_parm_type): New static function.
1054         (type_unification_real): Call decay_dependent_array_parm_type
1055         to decay a dependent array parameter type to its corresponding
1056         pointer type before unification.
1057         (more_specialized_fn): Likewise.
1058         (get_bindings): Likewise.
1059         * tree.c (cp_build_qualified_type): Trivial typofix in
1060         documentation.
1062 2016-01-18  Jason Merrill  <jason@redhat.com>
1064         * cp-gimplify.c (cp_fold) [CONSTRUCTOR]: Don't clobber the input.
1066         * cp-gimplify.c (cp_fold): Remove unnecessary special cases.
1068         PR c++/68767
1069         * cp-gimplify.c (cp_fold) [COND_EXPR]: Simplify.  Do fold COND_EXPR.
1070         (contains_label_1, contains_label_p): Remove.
1072 2016-01-16  Patrick Palka  <ppalka@gcc.gnu.org>
1074         PR c++/69091
1075         * pt.c (type_dependent_expression_p): For a function template
1076         specialization, a type is dependent iff any of its template
1077         arguments are.
1079 2016-01-16  Patrick Palka  <ppalka@gcc.gnu.org>
1081         * cp-array-notation.c (cp_expand_cond_array_notations): Return
1082         error_mark_node only if find_rank failed, not if it was
1083         successful.
1085 2016-01-16  Patrick Palka  <ppalka@gcc.gnu.org>
1087         PR c++/68936
1088         * tree.c (build_min_non_dep_call_vec): Don't retain the
1089         KOENIG_LOOKUP_P flag of the non-dependent expression that's
1090         been built.
1091         (build_min_non_dep_op_overload): Instead, do it here.
1093 2016-01-15  Jakub Jelinek  <jakub@redhat.com>
1095         PR bootstrap/68271
1096         * parser.h (cp_token): Remove pragma_kind field.  Add comment
1097         with number of unused bits.
1098         * parser.c (eof_token): Remove pragma_kind field initializer.
1099         (cp_lexer_get_preprocessor_token): Don't set pragma_kind
1100         field, don't clear CPP_PRAGMA u.value.
1101         (cp_parser_pragma_kind): New function.
1102         (cp_parser_omp_sections_scope, cp_parser_oacc_kernels_parallel,
1103         cp_parser_omp_construct, cp_parser_initial_pragma,
1104         cp_parser_pragma): Use cp_parser_pragma_kind instead of accessing
1105         pragma_kind field.
1107 2016-01-15  Jason Merrill  <jason@redhat.com>
1109         PR c++/68847
1110         * call.c (build_cxx_call): Use fold_non_dependent_expr.
1112         * typeck2.c (cxx_incomplete_type_diagnostic): Use the location of
1113         value.
1115         PR c++/69257
1116         * typeck.c (decay_conversion): Don't call mark_rvalue_use for
1117         array/function-to-pointer conversion.  Call
1118         complete_type_or_maybe_complain for lvalue-to-rvalue conversion.
1119         * call.c (convert_like_real): Print call context if
1120         decay_conversion errors.
1122 2016-01-14  Tom de Vries  <tom@codesourcery.com>
1124         PR tree-optimization/68773
1125         * parser.c (cp_parser_oacc_declare, cp_parser_omp_declare_target): Don't
1126         set force_output.
1128 2016-01-14  Jason Merrill  <jason@redhat.com>
1130         PR c++/69261
1131         * constexpr.c (find_array_ctor_elt): Handle splitting RANGE_EXPR.
1133 2016-01-12  Marek Polacek  <polacek@redhat.com>
1135         PR c++/68979
1136         * constexpr.c (cxx_eval_check_shift_p): Use permerror rather than
1137         error_at and adjust the return value.
1139 2016-01-12  Jakub Jelinek  <jakub@redhat.com>
1141         PR objc++/68511
1142         PR c++/69213
1143         * cp-gimplify.c (cp_gimplify_expr) <case INIT_EXPR>: Don't return
1144         GS_ERROR whenever seen_error (), only if *expr_p contains
1145         cilk spawn stmt, but cilk_detect_spawn_and_unwrap failed.
1147         PR c++/66808
1148         PR c++/69000
1149         * pt.c (tsubst_decl): If not local_p, clear DECL_TEMPLATE_INFO.
1151 2016-01-11  Jason Merrill  <jason@redhat.com>
1153         PR c++/69131
1154         * method.c (walk_field_subobs): Add dtor_from_ctor parm.
1155         (process_subob_fn): Likewise.  Don't consider triviality if true.
1156         (synthesize_method_walk): Pass it.
1158 2016-01-11  David Malcolm  <dmalcolm@redhat.com>
1160         PR c++/68795
1161         * parser.c (cp_parser_postfix_expression): Initialize
1162         close_paren_loc to UNKNOWN_LOCATION; only use it if
1163         it has been written to by
1164         cp_parser_parenthesized_expression_list.
1165         (cp_parser_parenthesized_expression_list): Document the behavior
1166         with respect to the CLOSE_PAREN_LOC param.
1168 2016-01-11  Jakub Jelinek  <jakub@redhat.com>
1170         PR c++/69211
1171         * cp-gimplify.c (cp_fold): If COMPOUND_EXPR or MODIFY_EXPR
1172         folded operands have side-effects, but folding changed any of them,
1173         build a new tree with the folded operands instead of returning the
1174         unfolded tree.
1176 2016-01-09  Marek Polacek  <polacek@redhat.com>
1178         PR c++/69113
1179         * decl2.c (comdat_linkage): Only set DECL_COMDAT if TREE_PUBLIC is set.
1181 2016-01-09  Jakub Jelinek  <jakub@redhat.com>
1183         PR c++/69164
1184         * class.c (layout_class_type): Use copy_node to copy FIELD_DECLs.
1186 2016-01-08  Jason Merrill  <jason@redhat.com>
1188         PR c++/69158
1189         * constexpr.c (cxx_fold_indirect_ref): Handle array type differing
1190         in completion.
1192 2016-01-08  Marek Polacek  <polacek@redhat.com>
1194         PR c++/68449
1195         * constexpr.c (cxx_eval_constant_expression): Handle NULL initializer.
1197 2016-01-08  Jason Merrill  <jason@redhat.com>
1199         * constexpr.c (cxx_eval_call_expression): Remove convert_to_void
1200         workaround.
1202         PR c++/68983
1203         PR c++/67557
1204         * cvt.c (convert_to_void): Don't strip a TARGET_EXPR of
1205         TREE_ADDRESSABLE type.
1207         PR c++/68983
1208         PR c++/67557
1209         * call.c (unsafe_copy_elision_p): Look through COMPOUND_EXPR.
1211 2016-01-05  Nathan Sidwell  <nathan@acm.org>
1213         PR c++/58583
1214         * pt.c (build_non_dependent_expr): Don't try a checking fold when
1215         parsing an nsdmi.
1217 2016-01-04  Jakub Jelinek  <jakub@redhat.com>
1219         Update copyright years.
1221 Copyright (C) 2016 Free Software Foundation, Inc.
1223 Copying and distribution of this file, with or without modification,
1224 are permitted in any medium without royalty provided the copyright
1225 notice and this notice are preserved.