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