Fix PR c++/70241 (inconsistent access with in-class enumeration)
[official-gcc.git] / gcc / cp / ChangeLog
blobb2185df76aef03d6c3348f1a2aaba30fb8289db5
1 2016-04-26  Patrick Palka  <ppalka@gcc.gnu.org>
3         PR c++/70241
4         * decl.c (build_enumerator): Set current_access_specifier when
5         declaring an enumerator belonging to an in-class enumeration.
6         * parser.c (cp_parser_check_access_in_redecleration): Also
7         consider in-class enumerations.
9 2016-04-26  Marek Polacek  <polacek@redhat.com>
11         PR c++/70744
12         * call.c (build_conditional_expr_1): Call cp_stabilize_reference
13         instead of stabilize_reference.
14         (build_over_call): Likewise.
15         * cp-tree.h (cp_stabilize_reference): Declare.
16         * tree.c (cp_stabilize_reference): New function.
17         * typeck.c (cp_build_unary_op): Call cp_stabilize_reference instead of
18         stabilize_reference.
19         (unary_complex_lvalue): Likewise.
20         (cp_build_modify_expr): Likewise.
22 2016-04-26  Jakub Jelinek  <jakub@redhat.com>
24         PR bootstrap/70704
25         * pt.c (build_non_dependent_expr): Use flag_checking > 1 instead of
26         just flag_checking.
28 2016-04-25  Jason Merrill  <jason@redhat.com>
30         * tree.c (std_attribute_table): New.
31         (init_tree): Register it.
33 2016-04-22  Jason Merrill  <jason@redhat.com>
35         * parser.c (cp_parser_perform_range_for_lookup): Decay the array.
37 2016-04-21  Patrick Palka  <ppalka@gcc.gnu.org>
39         * name-lookup.c (free_saved_scope): New free list of saved_scope
40         structures.
41         (push_to_top_level): Attempt to reuse a saved_scope struct
42         from free_saved_scope instead of allocating a new one each time.
43         (pop_from_top_level_1): Chain the now-unused saved_scope structure
44         onto free_saved_scope.
46 2016-04-21  Paolo Carlini  <paolo.carlini@oracle.com>
48         PR c++/70540
49         * semantics.c (process_outer_var_ref): Unconditionally return
50         error_mark_node when mark_used returns false.
52 2016-04-21  Marek Polacek  <polacek@redhat.com>
54         PR c++/70513
55         * parser.c (cp_parser_enum_specifier): Check and possibly error for
56         extra qualification.
58 2016-04-20  Nathan Sidwell  <nathan@acm.org>
60         PR c++/55635
61         * init.c (build_vec_delete_1): Protect operator delete call in try
62         finally.
63         (build_delete): Likewise.
64         * optimize.c (build_delete_destructor_body): Likewise.
66 2016-04-20  Ilya Verbin  <ilya.verbin@intel.com>
68         PR c++/69363
69         * cp-tree.h (finish_omp_clauses): Add new default argument.
70         * parser.c (cp_parser_cilk_simd_all_clauses): Use finish_omp_clauses
71         instead of c_finish_cilk_clauses.
72         * semantics.c (finish_omp_clauses): Add new argument.  Allow
73         floating-point variables in the linear clause for Cilk Plus.
75 2016-04-20  Nathan Sidwell  <nathan@acm.org>
77         * semantics.c (finish_compound_lteral): Don't wrap VECTOR_TYPEs in a
78         TARGET_EXPR.
80 2016-04-19  Jason Merrill  <jason@redhat.com>
82         PR c++/66543
83         * expr.c (mark_exp_read): Handle NON_DEPENDENT_EXPR.
84         * pt.c (make_pack_expansion): Call mark_exp_read.
85         * semantics.c (finish_id_expression): Call mark_type_use in
86         unevaluated context.
88         DR 2137
89         * call.c (implicit_conversion): If we choose a copy constructor
90         for list-initialization from the same type, the conversion is an
91         exact match.
93         * constexpr.c (breaks): Handle EXIT_EXPR.
94         (cxx_eval_loop_expr): Handle COMPOUND_EXPR body.
95         (cxx_eval_constant_expression): Handle EXIT_EXPR, improve handling
96         of COMPOUND_EXPR.
98         PR c++/68206
99         PR c++/68530
100         * constexpr.c (potential_constant_expression_1): Handle LOOP_EXPR
101         and GOTO_EXPR.
103         * pt.c (tsubst_expr): Remove shadowing declaration.
104         (tsubst_pack_expansion): Add assert.
106         * semantics.c (add_decl_expr): Use DECL_SOURCE_LOCATION.
108         PR c++/70522
109         * name-lookup.c (qualified_lookup_using_namespace): Look through
110         hidden names.
112 2016-04-18  Michael Matz  <matz@suse.de>
114         * class.c (build_vtable): Use SET_DECL_ALIGN and SET_TYPE_ALIGN.
115         (layout_class_type): Ditto.
116         (build_base_field): Use SET_DECL_ALIGN.
117         (fixup_attribute_variants): Use SET_TYPE_ALIGN.
118         * decl.c (duplicate_decls): Use SET_DECL_ALIGN.
119         (record_unknown_type): Use SET_TYPE_ALIGN.
120         (cxx_init_decl_processing): Ditto.
121         (copy_type_enum): Ditto.
122         (grokfndecl): Use SET_DECL_ALIGN.
123         (copy_type_enum): Use SET_TYPE_ALIGN.
124         * pt.c (instantiate_class_template_1): Use SET_TYPE_ALIGN.
125         (tsubst): Ditto.
126         * tree.c (cp_build_qualified_type_real): Use SET_TYPE_ALIGN.
127         * lambda.c (maybe_add_lambda_conv_op): Use SET_DECL_ALIGN.
128         * method.c (implicitly_declare_fn): Use SET_DECL_ALIGN.
129         * rtti.c (emit_tinfo_decl): Ditto.
131 2016-04-18  Jason Merrill  <jason@redhat.com>
133         PR c++/70690
134         PR c++/70528
135         * class.c (type_maybe_constexpr_default_constructor): New.
136         (type_has_constexpr_default_constructor): Revert.
138 2016-04-16  Sandra Loosemore  <sandra@codesourcery.com>
140         PR target/1078
142         * tree.c (cxx_attribute_table): Remove "com_interface" entry.
143         (handle_com_interface_attribute): Delete.
145 2016-04-15  Jason Merrill  <jason@redhat.com>
147         PR c++/70685
148         * constexpr.c (get_fundef_copy): Handle null *slot.
150         PR c++/70505
151         * pt.c (tsubst_baselink): Give the new TEMPLATE_ID_EXPR
152         unknown_type_node, too.
154 2016-04-15  Jason Merrill  <jason@redhat.com>
155             Nathan Sidwell  <nathan@acm.org>
157         PR c++/70594
158         * constexpr.c (constexpr_call_table): Preserve in GC.
159         (struct fundef_copy, struct fundef_copies_table_t):     Delete.
160         (fundef_copies_table): Preserve in GC. Change to pointer to
161         tree->tree hash.
162         (maybe_initialize_fundef_copies_table): Adjust.
163         (get_fundef_copy): Return a TREE_LIST.  Use non-inserting search.
164         (save_fundef_copy): Adjust for a TREE_LIST.
165         (cxx_eval_call_expression): Adjust for a fundef_copy TREE_LIST.
166         (fini_constexpr): New.
167         * cp-tree.h (fini_constexpr): Declare.
168         * decl2.c (c_parse_final_cleanups): Call fini_constexpr.
170 2016-04-15  Jakub Jelinek  <jakub@redhat.com>
172         PR c/70436
173         * parser.c (cp_parser_pragma): Add IF_P argument, pass it down
174         where needed.
175         (cp_parser_declaration_seq_opt, cp_parser_member_specification_opt,
176         cp_parser_objc_interstitial_code, cp_parser_omp_declare_simd,
177         cp_parser_oacc_routine): Adjust cp_parser_pragma callers.
178         (cp_parser_statement): Likewise.  Adjust cp_parser_cilk_for caller.
179         (cp_parser_omp_structured_block): Add IF_P argument, pass it down to
180         cp_parser_statement.
181         (cp_parser_oacc_data, cp_parser_oacc_host_data, cp_parser_oacc_loop,
182         cp_parser_oacc_kernels_parallel, cp_parser_omp_critical,
183         cp_parser_omp_simd, cp_parser_omp_for, cp_parser_omp_master,
184         cp_parser_omp_ordered, cp_parser_omp_parallel, cp_parser_omp_single,
185         cp_parser_omp_task, cp_parser_omp_taskgroup, cp_parser_omp_distribute,
186         cp_parser_omp_teams, cp_parser_omp_target_data, cp_parser_omp_target,
187         cp_parser_omp_taskloop, cp_parser_omp_construct,
188         cp_parser_cilk_grainsize, cp_parser_cilk_simd, cp_parser_cilk_for):
189         Add IF_P argument, pass it down where needed.
190         (cp_parser_omp_for_loop): Likewise.  Clear IF_P if nbraces.
191         (cp_parser_omp_sections_scope): Adjust cp_parser_omp_structured_block
192         calls.
194 2016-04-14  Jason Merrill  <jason@redhat.com>
196         PR c++/70494
197         * decl.c (cxx_maybe_build_cleanup): Handle non-decls.
198         * typeck2.c (split_nonconstant_init_1): Use it.
200         PR c++/70528
201         * class.c (type_has_constexpr_default_constructor): Return true
202         for an implicitly declared constructor.
204         PR c++/70622
205         * parser.c (cp_parser_init_declarator): Add auto_result parm.
206         (cp_parser_simple_declaration): Pass it.
207         (strip_declarator_types): New.
209         PR c++/70543
210         * pt.c (value_dependent_expression_p) [VAR_DECL]: A type-dependent
211         initializer also makes the variable value-dependent.
213         PR c++/70648
214         * constexpr.c (cxx_eval_store_expression): Also copy
215         CONSTRUCTOR_NO_IMPLICIT_ZERO.
217 2016-04-14  Martin Sebor  <msebor@redhat.com>
219         PR c++/69517
220         PR c++/70019
221         PR c++/70588
222         * cp-tree.h, decl.c, init.c, typeck2.c: Revert.
224 2016-04-14  Jason Merrill  <jason@redhat.com>
226         * call.c, decl.c, error.c, cp-tree.h, decl.c: Revert empty
227         parameter ABI change.
229 2016-04-13  Martin Sebor  <msebor@redhat.com>
231         PR c++/69517
232         PR c++/70019
233         PR c++/70588
234         * cp-tree.h (throw_bad_array_length, build_vla_check): Declare new
235         functions.
236         * decl.c (check_initializer, cp_finish_decl): Call them.
237         (reshape_init_r): Reject incompletely braced intializer-lists
238         for VLAs.
239         * init.c (throw_bad_array_length, build_vla_check)
240         (build_vla_size_check, build_vla_init_check): Define new functions.
241         * typeck2.c (split_nonconstant_init_1): Use variably_modified_type_p()
242         to detect a VLA.
243         (store_init_value): Same.
245 2016-04-13  Jason Merrill  <jason@redhat.com>
247         Warn about empty parameter ABI with -Wabi=9.
248         * call.c (empty_class_msg, mark_for_abi_warning)
249         (warn_empty_class_abi): New.
250         (build_call_a): Use them.
251         * decl.c (store_parm_decls): Use mark_for_abi_warning.
252         * error.c (pp_format_to_string): New.
254         Pass empty class parameters like C.
255         * call.c (pass_as_empty_struct, empty_class_arg): New.
256         (type_passed_as, build_x_va_arg): Use pass_as_empty_struct.
257         (build_call_a): Use empty_class_arg.
258         * cp-tree.h (CPTI_EMPTY_STRUCT, empty_struct_type): New.
259         * decl.c (cxx_init_decl_processing): Create empty_struct_type.
261 2016-04-13  Jason Merrill  <jason@redhat.com>
263         PR c++/70627
264         * decl.c (start_enum): Don't change an existing ENUM_UNDERLYING_TYPE.
266 2016-04-13  Paolo Carlini  <paolo.carlini@oracle.com>
268         PR c++/70635
269         * pt.c (resolve_typename_type): Fix typos in infinite recursion
270         avoidance mechanism.
272 2016-04-13  Jason Merrill  <jason@redhat.com>
274         PR c++/70634
275         * pt.c (instantiation_dependent_uneval_expression_p): Split out
276         from instantiation_dependent_expression_p.
277         (value_dependent_expression_p): Use it for unevaluated operands.
278         (instantiation_dependent_r): Don't check value-dependence.
279         (instantiation_dependent_expression_p): Check
280         value-dependence of the expression as a whole.
281         * cp-tree.h: Declare instantiation_dependent_uneval_expression_p.
282         * semantics.c (finish_decltype_type): Use it.
284         * constexpr.c (potential_nondependent_constant_expression): New.
285         (potential_nondependent_static_init_expression): New.
286         (maybe_constant_value_1, fold_non_dependent_expr)
287         (maybe_constant_init): Use them.
288         * pt.c (instantiate_non_dependent_expr_sfinae)
289         (instantiate_non_dependent_or_null, convert_nontype_argument): Use
290         them.
291         * cp-tree.h: Declare them.
293 2016-04-13  Jakub Jelinek  <jakub@redhat.com>
295         PR c++/70594
296         * decl.c (pop_labels_1): Removed.
297         (note_label, sort_labels): New functions.
298         (pop_labels): During named_labels traversal, just push the slot
299         pointers into a vector, then qsort it by DECL_UID and only then
300         call pop_label and chain it into BLOCK_VARS.
302 2016-04-13  Jason Merrill  <jason@redhat.com>
304         PR c++/70615
305         * cp-gimplify.c (cp_genericize_r): Expand PTRMEM_CST here.
306         (cp_gimplify_expr): Not here.
308 2016-04-12  Patrick Palka  <ppalka@gcc.gnu.org>
310         PR c++/70610
311         * tree.c (lvalue_kind) [NON_DEPENDENT_EXPR]: Unconditionally
312         recurse into it.
313         * typeck.c (build_x_conditional_expr): Unconditionally remember
314         that the result is an lvalue or xvalue.
316 2016-04-12  Jason Merrill  <jason@redhat.com>
318         * class.c (is_really_empty_class): A zero-length array is empty.
319         An unnamed bit-field doesn't make a class non-empty.
321 2016-04-12  Paolo Carlini  <paolo.carlini@oracle.com>
323         PR c++/68722
324         * parser.c (cp_parser_cache_defarg): When file ends in default
325         argument simply return error_mark_node.
327 2016-04-12  Nathan Sidwell  <nathan@acm.org>
329         PR c++/70501
330         * constexpr.c (cxx_eval_bare_aggregate): Handle VECTOR_TYPE
331         similarly to PMF.
333 2016-04-11  Jason Merrill  <jason@redhat.com>
335         * mangle.c (decl_is_template_id): The template itself counts as a
336         template-id.
338 2016-04-08  Patrick Palka  <ppalka@gcc.gnu.org>
340         PR c++/70590
341         PR c++/70452
342         * constexpr.c (cxx_eval_outermost_expression): Call unshare_expr
343         on the result if it's not a CONSTRUCTOR.
345 2016-04-07  Patrick Palka  <ppalka@gcc.gnu.org>
347         PR c++/70452
348         * constexpr.c (find_constructor): New function.
349         (unshare_constructor): New function.
350         (cxx_eval_call_expression): Use unshare_constructor instead of
351         unshare_expr.
352         (find_array_ctor_elt): Likewise.
353         (cxx_eval_vec_init_1): Likewise.
354         (cxx_eval_store_expression): Likewise.
355         (cxx_eval_constant_expression): Likewise.
357 2016-04-06  Patrick Palka  <ppalka@gcc.gnu.org>
359         PR c/70436
360         * cp-tree.h (FOR_EACH_CLONE): Restructure macro to avoid
361         potentially generating a future -Wparentheses warning in its
362         callers.
364 2016-04-06  Jason Merrill  <jason@redhat.com>
366         * class.c (check_abi_tags): Fix function template handling.
368 2016-04-05  Nathan Sidwell  <nathan@acm.org>
370         PR c++/70512
371         * class.c (fixup_may_alias): New.
372         (fixup_attribute_variants): Call it.
374 2016-04-05  Patrick Palka  <ppalka@gcc.gnu.org>
376         PR c++/70452
377         * constexpr.c (struct fundef_copy): New struct.
378         (struct fundef_copies_table_t): New struct.
379         (fundef_copies_table): New static variable.
380         (maybe_initialize_fundef_copies_table): New static function.
381         (get_fundef_copy): New static function.
382         (save_fundef_copy): New static function.
383         (cxx_eval_call_expression): Use get_fundef_copy, and
384         save_fundef_copy.
385         (constexpr_call_table): Add "deletable" GTY marker.
387 2016-04-05  Patrick Palka  <ppalka@gcc.gnu.org>
389         PR c++/70452
390         * cp-tree.h (class cache_map): Remove.
391         * constexpr.c (cv_cache): Change type to
392         GTY((deletable)) hash_map<tree, tree> *.
393         (maybe_constant_value): Adjust following the change to cv_cache.
394         (clear_cv_cache): New static function.
395         (clear_cv_and_fold_caches): Use it.
396         * cp-gimplify.c (fold_cache): Change type to
397         GTY((deletable)) hash_map<tree, tree> *.
398         (clear_fold_cache): Adjust following the change to fold_cache.
399         (cp_fold): Likewise.
401 2016-04-02  Martin Sebor  <msebor@redhat.com>
403         PR c++/67376
404         PR c++/70170
405         PR c++/70172
406         PR c++/70228
407         * constexpr.c (diag_array_subscript): New function.
408         (cxx_eval_array_reference): Detect out of bounds array indices.
410 2016-04-01  Jason Merrill  <jason@redhat.com>
412         PR c++/70449
413         PR c++/70344
414         * pt.c (instantiate_decl): A function isn't fully defined if
415         DECL_INITIAL is error_mark_node.
416         * constexpr.c (cxx_eval_call_expression): Likewise.
418 2016-04-01  Jakub Jelinek  <jakub@redhat.com>
419             Marek Polacek  <polacek@redhat.com>
421         PR c++/70488
422         * init.c (warn_placement_new_too_small): Test whether
423         DECL_SIZE_UNIT or TYPE_SIZE_UNIT are integers that fit into uhwi.
425 2016-04-01  Nathan Sidwell  <nathan@acm.org>
427         PR c++/68475
428         * decl.c (check_redeclaration_exception_specification): Check
429         regardless of -fno-exceptions.
430         * typeck2.c (merge_exception_specifiers): Relax assert by checking
431         flag_exceptions too.
433 2016-03-31  Nathan Sidwell  <nathan@acm.org>
435         * decl.c (start_preparsed_function): Remove unnecessary bracing.
436         (finish_destructor_body): Don't emit operator delete here.
438 2016-03-31  Nathan Sidwell  <nathan@acm.org>
440         PR c++/70393
441         * constexpr.c (cxx_eval_store_expression): Keep CONSTRUCTOR
442         elements in field order.
444 2016-03-31  Marek Polacek  <polacek@redhat.com>
446         PR c/70297
447         * decl.c (duplicate_decls): Also set TYPE_ALIGN and TYPE_USER_ALIGN.
449 2016-03-31  Richard Biener  <rguenther@suse.de>
451         PR c++/70430
452         * typeck.c (cp_build_binary_op): Fix operand order of vector
453         conditional in truth op handling.
455 2016-03-29  Jason Merrill  <jason@redhat.com>
457         PR c++/70353
458         * decl.c (make_rtl_for_nonlocal_decl): Don't defer local statics
459         in constexpr functions.
461 2016-03-28  Jason Merrill  <jason@redhat.com>
463         PR c++/70422
464         PR c++/64266
465         PR c++/70353
466         * decl.c, pt.c, constexpr.c: Revert last patch.
468 2016-03-25  Jason Merrill  <jason@redhat.com>
469             Martin LiÅ¡ka  <mliska@suse.cz>
471         PR c++/64266
472         PR c++/70353
473         Core issue 1962
474         * decl.c (cp_fname_init): Decay the initializer to pointer.
475         (cp_make_fname_decl): Set DECL_DECLARED_CONSTEXPR_P,
476         DECL_VALUE_EXPR, DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
477         Don't call cp_finish_decl.
478         * pt.c (tsubst_expr) [DECL_EXPR]: Set DECL_VALUE_EXPR,
479         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.  Don't call cp_finish_decl.
480         * constexpr.c (cxx_eval_constant_expression) [VAR_DECL]:
481         Handle DECL_VALUE_EXPR.
483 2016-03-24  Jason Merrill  <jason@redhat.com>
485         PR c++/70386
486         * constexpr.c (cxx_eval_bare_aggregate): Handle PMFs.
488         PR c++/70323
489         * constexpr.c (cxx_eval_call_expression): Don't cache result if
490         *overflow_p.
492 2016-03-24  Patrick Palka  <ppalka@gcc.gnu.org>
494         PR c++/62212
495         * tree.c (build_cplus_array_type): Determine type-dependentess
496         with uses_template_parms instead of with dependent_type_p.
498 2016-03-23  Patrick Palka  <ppalka@gcc.gnu.org>
500         PR c++/70347
501         * typeck.c (process_init_constructor_union): If the initializer
502         is empty, use the union's NSDMI if it has one.
504 2016-03-23  Patrick Palka  <ppalka@gcc.gnu.org>
506         PR c++/70332
507         * pt.c (tsubst_copy) [PARM_DECL]: Handle the use of 'this' in an
508         NSDMI that's part of an aggregrate initialization.
510 2016-03-23  Jakub Jelinek  <jakub@redhat.com>
512         PR c++/70001
513         * constexpr.c (cxx_eval_vec_init_1): Reuse CONSTRUCTOR initializers
514         for 1..max even for multi-dimensional arrays.  Call unshare_expr
515         on it.
517         PR c++/70323
518         * constexpr.c (cxx_eval_constant_expression): Diagnose overflow
519         on TREE_OVERFLOW constants.
521         PR c++/70376
522         * cp-gimplify.c (genericize_omp_for_stmt): Don't walk OMP_FOR_CLAUSES
523         for OMP_TASKLOOP here.
524         (cp_genericize_r): Handle OMP_TASKLOOP like OMP_TASK, except do call
525         genericize_omp_for_stmt instead of cp_walk_tree on OMP_BODY.
527 2016-03-23  Alexandre Oliva  <aoliva@redhat.com>
528             Jason Merrill  <jason@redhat.com>
529             Jakub Jelinek  <jakub@redhat.com>
531         PR c++/69315
532         * cp-tree.h (defer_mark_used_calls, deferred_mark_used_calls): Remove.
533         * decl.c (defer_mark_used_calls, deferred_mark_used_calls): Remove.
534         (finish_function): Don't set or test them.
535         * decl2.c (mark_used): Don't handle defer_mark_used_calls.
537 2016-03-23  Jason Merrill  <jason@redhat.com>
539         PR c++/70344
540         * constexpr.c (cxx_eval_call_expression): Catch invalid recursion.
542 2016-03-23  Marek Polacek  <polacek@redhat.com>
544         PR c++/69884
545         * pt.c (canonicalize_type_argument): Use OPT_Wignored_attributes.
547 2016-03-22  Ilya Enkovich  <enkovich.gnu@gmail.com>
549         * call.c (build_conditional_expr_1): Always use original
550         condition type for vector type checks and build.
552 2016-03-22  Patrick Palka  <ppalka@gcc.gnu.org>
554         PR c++/70096
555         * pt.c (tsubst_decl): Clear the DECL_MODE of the new decl.
557 2016-03-22  Patrick Palka  <ppalka@gcc.gnu.org>
559         PR c++/70204
560         * constexpr.c (non_const_var_error): Check
561         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
563 2016-03-21  Richard Henderson  <rth@redhat.com>
565         PR c++/70273
566         * decl.c (notice_forced_label_r): New.
567         (cp_finish_decl): Use it.
569 2016-03-21  Jason Merrill  <jason@redhat.com>
571         PR c++/70285
572         * cp-gimplify.c (cp_fold) [COND_EXPR]: Handle bit-fields.
574 2016-03-18  Jason Merrill  <jason@redhat.com>
576         PR c++/70139
577         * constexpr.c (cxx_eval_call_expression): Fix trivial copy.
579         PR c++/70147
580         * class.c (vptr_via_virtual_p): New.
581         (most_primary_binfo): Factor out of build_rtti_vtbl_entries.
582         * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs): Don't clear
583         a vptr from any virtual base in a not-in-charge 'structor.
585         * decl.c (build_clobber_this): Factor out of
586         start_preparsed_function and begin_destructor_body.  Handle
587         virtual bases better.
589         * class.c (build_if_in_charge): Split out from build_base_path.
590         * init.c (expand_virtual_init, expand_default_init): Use it.
591         * call.c (build_special_member_call): Use it.
593 2016-03-18  Jakub Jelinek  <jakub@redhat.com>
595         PR c++/70267
596         * init.c (build_new_1): Complain and return error_mark_node
597         if alloc_fn is not _Jv_AllocObject function returning pointer.
599 2016-03-18  Patrick Palka  <ppalka@gcc.gnu.org>
601         PR c++/70205
602         * search.c (adjust_result_of_qualified_name_lookup): Don't
603         update the BASELINK_BINFO of DECL if the second call
604         to lookup_base fails.
606 2016-03-18  Patrick Palka  <ppalka@gcc.gnu.org>
608         PR c++/70218
609         * parser.c (cp_parser_lambda_expression): Move call to
610         pop_deferring_access_checks ahead of the call to
611         cp_parser_end_tentative_firewall.
613 2016-03-17  Jakub Jelinek  <jakub@redhat.com>
615         PR c++/70144
616         * cp-tree.h (magic_varargs_p): Return int instead of bool.
617         * call.c (magic_varargs_p): Return int instead of bool, return 2 for
618         Cilk+ reductions, otherwise 1 for magic varargs and 0 for normal
619         varargs.
620         (build_over_call): If magic_varargs_p == 2, call reject_gcc_builtin,
621         if magic_varargs_p == 1, call decay_conversion
622         instead of mark_type_use.  Don't store error_mark_node arguments to
623         argarray, instead return error_mark_node.
625         PR c++/70272
626         * decl.c (begin_destructor_body): Don't insert clobber if
627         is_empty_class (current_class_type).
629 2016-03-17  Marek Polacek  <polacek@redhat.com>
631         PR c++/70194
632         * typeck.c (warn_for_null_address): New function.
633         (cp_build_binary_op): Call it.
635 2016-03-16  Jason Merrill  <jason@redhat.com>
637         PR c++/70259
638         * decl.c (start_preparsed_function): Don't clobber an empty base.
640 2016-03-16  Jakub Jelinek  <jakub@redhat.com>
642         PR c++/70147
643         * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs): Conditionalize
644         BINFO_VIRTUAL_P vtable clearing on current_in_charge_parm.
646         PR c++/70147
647         * cp-ubsan.c (cp_ubsan_maybe_initialize_vtbl_ptrs): Temporarily
648         set in_base_initializer.
650 2016-03-15  Marek Polacek  <polacek@redhat.com>
652         PR c++/70209
653         * tree.c (strip_typedefs): Call strip_typedefs again on the
654         DECL_ORIGINAL_TYPE result.
656 2016-03-15  Jason Merrill  <jason@redhat.com>
658         PR c++/70095
659         * pt.c (instantiate_decl): Fix call to variable_template_p.
661         PR c++/70141
662         * pt.c (for_each_template_parm_r): Always walk into TYPENAME_TYPE.
664 2016-03-14  Casey Carter  <casey@carter.net>
665             Jason Merrill  <jason@redhat.com>
667         P0184R0: Generalizing the Range-Based For Loop
668         * parser.c (cp_convert_range_for): Set the type of __end separately.
669         (cp_parser_perform_range_for_lookup): Allow different begin/end
670         types if they are comparable.
672 2016-03-12  Patrick Palka  <ppalka@gcc.gnu.org>
674         PR c++/70106
675         * semantics.c (force_paren_expr): Just build a PAREN_EXPR when
676         processing_template_decl and EXPR is a SCOPE_REF.
678 2016-03-10  Patrick Palka  <ppalka@gcc.gnu.org>
679             Jakub Jelinek  <jakub@redhat.com>
681         PR c++/70001
682         * constexpr.c (cxx_eval_vec_init_1): For pre_init case, reuse
683         return value from cxx_eval_constant_expression from earlier
684         elements if it is valid constant initializer requiring no
685         relocations.
687 2016-03-10  Marek Polacek  <polacek@redhat.com>
689         PR c++/70153
690         * cp-gimplify.c (cp_fold): Handle UNARY_PLUS_EXPR.
692 2016-03-09  Cesar Philippidis  <cesar@codesourcery.com>
694         * parser.c (cp_parser_oacc_loop): Update cclauses and clauses
695         when calling c_finish_omp_clauses.
697 2016-03-08  Jason Merrill  <jason@redhat.com>
699         * parser.c (cp_parser_diagnose_invalid_type_name): Give helpful
700         diagnostic for use of "concept".
701         (cp_parser_requires_clause_opt): And "requires".
702         (cp_parser_type_parameter, cp_parser_late_return_type_opt)
703         (cp_parser_explicit_template_declaration): Adjust.
704         * Make-lang.in (check-c++-all): Add "concepts" to std list.
706         P0036R0: Unary Folds and Empty Parameter Packs
707         * pt.c (expand_empty_fold): Remove special cases for *,+,&,|.
709 2016-03-08  Jakub Jelinek  <jakub@redhat.com>
711         PR c++/70135
712         * constexpr.c (cxx_eval_loop_expr): Forget saved values of SAVE_EXPRs
713         even after the last iteration of the loop.
715         * decl.c (duplicate_decls): Fix spelling - becuase -> because.
717 2016-03-07  Patrick Palka  <ppalka@gcc.gnu.org>
719         PR c++/66786
720         * pt.c (get_template_info): Handle PARM_DECL.
721         (template_class_depth): Check DECL_P instead of
722         VAR_OR_FUNCTION_DECL_P.
724 2016-03-05  Jason Merrill  <jason@redhat.com>
726         PR c++/67364
727         * constexpr.c (cxx_eval_store_expression): Replace
728         CONSTRUCTOR_ELTS in nested CONSTRUCTORs, too.
730 2016-03-05  Patrick Palka  <ppalka@gcc.gnu.org>
732         PR c++/66786
733         * pt.c (template_class_depth): Given a lambda type, iterate
734         into its LAMBDA_TYPE_EXTRA_SCOPE field instead of its
735         TYPE_CONTEXT.  Given a VAR_DECL, iterate into its
736         CP_DECL_CONTEXT.
738 2016-03-04  Jason Merrill  <jason@redhat.com>
740         PR c++/69203
741         * cp-tree.h (COND_EXPR_IS_VEC_DELETE): New.
742         * init.c (build_vec_delete_1): Set it.
743         * constexpr.c (potential_constant_expression_1) [COND_EXPR]: Check it.
745 2016-03-04  Jakub Jelinek  <jakub@redhat.com>
747         * decl.c (start_preparsed_function): Don't emit start clobber at the
748         start of constructor clones.
750         PR c++/70035
751         * cp-tree.h (cp_ubsan_maybe_initialize_vtbl_ptrs): New prototype.
752         * decl.c (start_preparsed_function): Call
753         cp_ubsan_maybe_initialize_vtbl_ptrs if needed.
754         * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs,
755         cp_ubsan_maybe_initialize_vtbl_ptrs): New functions.
757 2016-03-04  Jason Merrill  <jason@redhat.com>
759         PR c++/67364
760         * constexpr.c (cxx_eval_component_reference): Further tweak.
762         * constexpr.c (struct constexpr_ctx): Add save_exprs field.
763         (cxx_eval_loop_expr): Discard SAVE_EXPR values before looping.
764         (cxx_eval_constant_expression) [SAVE_EXPR]: Add it to the set.
765         (cxx_eval_outermost_constant_expr, is_sub_constant_expr): Initialize.
767         PR c++/70067
768         * tree.c (strip_typedefs): Handle TYPENAME_TYPE lookup finding the
769         same type.
771 2016-03-03  Jason Merrill  <jason@redhat.com>
773         * method.c (synthesized_method_walk): operator= can also be constexpr.
775         * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Get
776         LAMBDA_EXPR_RETURN_TYPE from the instantiated closure.
778         PR c++/67164
779         * pt.c (copy_template_args): New.
780         (tsubst_pack_expansion): Use it.
782         * call.c (build_aggr_conv): Use get_nsdmi.
784         PR c++/51406
785         * typeck.c (build_static_cast_1): Avoid folding back to lvalue.
787         PR c++/67364
788         * constexpr.c (cxx_eval_component_reference): Just return an empty
789         CONSTRUCTOR for an empty class.
791 2016-03-01  Jason Merrill  <jason@redhat.com>
793         PR c++/70036
794         * parser.c (cp_parser_requires_clause): Call
795         check_for_bare_parameter_packs.
797         PR c++/51489
798         * constexpr.c (cxx_eval_binary_expression): Don't VERIFY_CONSTANT
799         the operands.
801         PR c++/69995
802         * constexpr.c (cxx_eval_call_expression): Unshare arg.
803         (cxx_eval_constant_expression) [DECL_EXPR]: Unshare init.
804         [TARGET_EXPR]: Unshare init.
806 2016-03-01  Patrick Palka  <ppalka@gcc.gnu.org>
808         PR c++/68948
809         PR c++/69961
810         * pt.c (tsubst_baselink): Reinstate the check for an invalid
811         constructor call.
813 2016-02-28  Jason Merrill  <jason@redhat.com>
815         PR c++/69995
816         * constexpr.c (cxx_eval_store_expression): Unshare init.
818 2016-02-26  Jason Merrill  <jason@redhat.com>
820         PR c++/69958
821         * pt.c (make_argument_pack): New.
822         (tsubst_copy) [SIZEOF_EXPR]: Handle partial expansion.
823         (tsubst_copy_and_build): Likewise.
825 2016-02-25  Jason Merrill  <jason@redhat.com>
827         PR c++/69889
828         * cp-tree.h (AGGR_INIT_FROM_THUNK_P): New.
829         * tree.c (build_aggr_init_expr): Set it.
830         * semantics.c (simplify_aggr_init_expr): Check it.
831         * cp-gimplify.c (cp_genericize_r): Don't walk into
832         a call/aggr_init from a thunk.
834         PR c++/69842
835         * method.c (forward_parm): Handle parameter packs.
836         * lambda.c (maybe_add_lambda_conv_op): Use it for them.
838         PR c++/67364
839         * constexpr.c (cxx_eval_component_reference): Don't complain about
840         unevaluated empty classes.
842         PR c++/68049
843         * tree.c (strip_typedefs): Use DECL_ORIGINAL_TYPE.
845 2016-02-25  Patrick Palka  <ppalka@gcc.gnu.org>
847         PR c++/69736
848         * cp-tree.h (REF_PARENTHESIZED_P): Adjust documentation.
849         (maybe_undo_parenthesized_ref): Declare.
850         * semantics.c (maybe_undo_parenthesized_ref): Split out from
851         check_return_expr.
852         (finish_call_expr): Use it.
853         * typeck.c (check_return_expr): Use it.
854         * pt.c (tsubst_copy_and_build) [INDIRECT_REF]: Retain the
855         REF_PARENTHESIZED_P flag.
857 2016-02-24  Jakub Jelinek  <jakub@redhat.com>
859         PR c++/69922
860         * class.c (build_base_path): Set TREE_NO_WARNING on the null_test.
861         Avoid folding it.
862         * init.c (build_vec_delete_1, build_delete): Don't fold the non-NULL
863         tests.
864         * cp-gimplify.c (cp_fold): For TREE_NO_WARNING comparisons with NULL,
865         unless they are folded into INTEGER_CST, error_mark_node or some
866         comparison with NULL, avoid folding them and use either the original
867         comparison or non-folded comparison of folded arguments.
868         * cp-ubsan.c (cp_ubsan_instrument_vptr): Set TREE_NO_WARNING on the
869         comparison, don't fold the comparison right away.
871 2016-02-24  Jason Merrill  <jason@redhat.com>
873         PR c++/69323
874         * friend.c (make_friend_class): Likewise.
875         * decl.c (lookup_and_check_tag): Diagnose invalid dependent friend.
877 2016-02-24  Jason Merrill  <jason@redhat.com>
879         PR c++/69323
880         * pt.c (instantiate_class_template_1): Set
881         processing_template_decl before substituting friend_type.
883 016-02-24  Martin Sebor  <msebor@redhat.com>
885         PR c++/69912
886         * tree.c (build_ctor_subob_ref): Compare types' main variants
887         instead of the types as they are.
889 2016-02-24  Jason Merrill  <jason@redhat.com>
891         * decl.c (start_preparsed_function): Condition ctor clobber on
892         flag_lifetime_dse > 1.
894         * cp-gimplify.c (cp_fold): Don't fold constexpr calls if -fno-inline.
896 2016-02-19  Jason Merrill  <jason@redhat.com>
898         PR c++/69743
899         * call.c (remaining_arguments): No longer static.
900         * cp-tree.h: Declare it.
901         * pt.c (more_specialized_fn): Use it.
903 2016-02-19  Jakub Jelinek  <jakub@redhat.com>
904             Bernd Edlinger  <bernd.edlinger@hotmail.de>
906         * Make-lang.in: Invoke gperf with -L C++.
907         * cfns.gperf: Remove prototypes for hash and libc_name_p
908         inlines.
909         * cfns.h: Regenerated.
910         * except.c (nothrow_libfn_p): Adjust.
912 2016-02-19  Jakub Jelinek  <jakub@redhat.com>
914         PR c++/69850
915         * rtti.c (ifnonnull): Set TREE_NO_WARNING on the condition, use
916         NE_EXPR instead of EQ_EXPR and swap last two arguments on COND_EXPR.
918 2016-02-19  Patrick Palka  <ppalka@gcc.gnu.org>
920         PR c++/68948
921         * pt.c (tsubst_baselink): Don't diagnose an invalid constructor
922         call here.
923         * semantics.c (finish_call_expr): Don't assume a constructor
924         call is dependent if only the "this" pointer is dependent.  When
925         building a constructor call, always use a dummy object.
927 2016-02-19  Jakub Jelinek  <jakub@redhat.com>
929         PR c++/69850
930         * init.c (build_vec_delete_1): Set TREE_NO_WARNING on the NE_EXPR
931         condition.
932         * cp-gimplify.c (cp_fold): Propagate TREE_NO_WARNING from binary
933         operators if folding preserved the binop, just with different
934         arguments.
936         PR c++/67767
937         * parser.c (cp_parser_std_attribute_spec_seq): Don't assume
938         attr_spec is always single element chain, chain all the attributes
939         properly together in the right order.
941 2016-02-18  Jason Merrill  <jason@redhat.com>
943         * mangle.c (maybe_check_abi_tags): Add for_decl parm.  Call
944         mangle_decl.
945         (mangle_decl): Call maybe_check_abi_tags for function scope.
946         (mangle_guard_variable): Call maybe_check_abi_tags here.
947         (write_guarded_var_name): Not here.
949 2016-02-17  Jason Merrill  <jason@redhat.com>
951         PR c++/65985
952         * constexpr.c (build_constexpr_constructor_member_initializers):
953         Handle an additional STATEMENT_LIST.
955         PR c++/68585
956         * constexpr.c (cxx_eval_bare_aggregate): Fix 'changed' detection.
958         PR c++/68679
959         * decl2.c (reset_type_linkage_2): Look through member templates.
961 2016-02-17  Jakub Jelinek  <jakub@redhat.com>
963         PR c++/69850
964         * init.c (build_delete): Set TREE_NO_WARNING on ifexp.
966 2016-02-17  Jason Merrill  <jason@redhat.com>
968         PR c++/69842
969         * method.c (forward_parm): Split out from...
970         (add_one_base_init): ...here.
971         * lambda.c (maybe_add_lambda_conv_op): Use it.
973 2016-02-16  Jason Merrill  <jason@redhat.com>
975         PR c++/10200
976         PR c++/69753
977         * call.c, cp-tree.h, name-lookup.c, pt.c, search.c, semantics.c,
978         tree.c, typeck2.c: Revert earlier changes.
979         * parser.c (cp_parser_lookup_name): Ignore namespace-scope
980         non-type templates after -> or .
982 2016-02-16  Jakub Jelinek  <jakub@redhat.com>
984         PR c/69835
985         * typeck.c (cp_build_binary_op): Revert 2015-09-09 change.
987 2016-02-16  Jason Merrill  <jason@redhat.com>
989         PR c++/69657
990         * name-lookup.c (lookup_qualified_name): Add find_hidden parm.
991         (set_decl_namespace): Pass it.  Complain about finding a hidden friend.
992         * name-lookup.h: Adjust.
994 2016-02-16  James Norris  <jnorris@codesourcery.com>
996         * parser.c (cp_parser_oacc_data_clause_deviceptr): Remove checking.
997         * semantics.c (finish_omp_clauses): Add deviceptr checking.
999 2016-02-15  Jakub Jelinek  <jakub@redhat.com>
1001         PR c++/69658
1002         * init.c (expand_default_init): Only call reshape_init
1003         in the direct-initialization from an initializer list case.
1005 2016-02-15  Jason Merrill  <jason@redhat.com>
1007         PR c++/69753
1008         * semantics.c (finish_call_expr): Implicit 'this' does not make
1009         the call dependent.
1010         * search.c (any_dependent_bases_p): Split out...
1011         * name-lookup.c (do_class_using_decl): ...from here.
1012         * call.c (build_new_method_call_1): Don't complain about missing object
1013         if there are dependent bases.  Tweak error.
1014         * tree.c (non_static_member_function_p): Remove.
1015         * pt.c (type_dependent_expression_p): A member template of a
1016         dependent type is dependent.
1017         * cp-tree.h: Adjust.
1019         PR c++/68890
1020         * constexpr.c (verify_ctor_sanity): Remove CONSTRUCTOR_NELTS check.
1022 2016-02-12  Patrick Palka  <ppalka@gcc.gnu.org>
1024         PR c++/69098
1025         * pt.c (lookup_and_finish_template_variable): New function,
1026         extracted from ...
1027         (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: ... here.  Use it.
1028         (tsubst_qualified_id): Consider that EXPR might be a variable
1029         template.
1030         * typeck.c (check_template_keyword): Don't emit an error
1031         if DECL is a variable template.
1033 2016-02-12  Jakub Jelinek  <jakub@redhat.com>
1035         * error.c: Spelling fixes - behaviour -> behavior and
1036         neighbour -> neighbor.
1037         * decl.c: Likewise.
1038         * typeck.c (cp_build_binary_op): Fix up behavior spelling in
1039         diagnostics.
1040         * init.c (build_delete): Likewise.
1042 2016-02-11  Jakub Jelinek  <jakub@redhat.com>
1044         PR c/69768
1045         * typeck.c (cp_build_binary_op): cp_fully_fold integer_zerop
1046         arguments for -Waddress warning.  Fix up formatting.
1048 2016-02-11  Paolo Carlini  <paolo.carlini@oracle.com>
1050         PR c++/68726
1051         * pt.c (lookup_template_class_1): Check tsubst return value for
1052         error_mark_node.
1054 2016-02-10  Jason Merrill  <jason@redhat.com>
1056         PR c++/68926
1057         * pt.c (resolve_nondeduced_context): Add complain parm.
1058         (do_auto_deduction): Pass it.
1059         * cvt.c (convert_to_void): Likewise.
1060         * decl.c (cp_finish_decl): Likewise.
1061         * init.c (build_new): Likewise.
1062         * rtti.c (get_tinfo_decl_dynamic): Likewise.
1063         * semantics.c (finish_decltype_type): Likewise.
1064         * typeck.c (decay_conversion): Likewise.
1065         * cp-tree.h: Adjust declaration.
1066         * call.c (standard_conversion): Add complain parm, pass it along.
1067         (implicit_conversion): Pass it.
1069         PR c++/69657
1070         * name-lookup.c (ambiguous_decl): Call remove_hidden_names.
1071         (lookup_name_real_1): Likewise.
1072         (remove_hidden_names): Handle non-functions too.
1074         PR c++/10200
1075         * parser.c (cp_parser_lookup_name): When looking for a template
1076         after . or ->, only consider class templates.
1077         (cp_parser_postfix_dot_deref_expression): Handle the current
1078         instantiation.  Remember a dependent object expression.
1079         * typeck2.c (build_x_arrow): Handle the current instantiation.
1081         * ptree.c (debug_tree): Implement for cp_expr.
1083 2016-02-08  Patrick Palka  <ppalka@gcc.gnu.org>
1085         PR c++/69139
1086         * parser.c (cp_parser_simple_type_specifier): Make the check
1087         for disambiguating between an 'auto' placeholder and an implicit
1088         template parameter more robust.
1090 2016-02-08  Patrick Palka  <ppalka@gcc.gnu.org>
1092         PR c++/69283
1093         PR c++/67835
1094         * decl2.c (mark_used): When given a TEMPLATE_DECL, return after
1095         setting its TREE_USED flag.
1097 2016-02-08  Jason Merrill  <jason@redhat.com>
1099         PR c++/69657
1100         * name-lookup.c (do_nonmember_using_decl): Leave anticipated
1101         built-ins alone.
1103 2016-02-08  Jakub Jelinek  <jakub@redhat.com>
1105         PR c++/59627
1106         * parser.c (cp_parser_omp_declare_reduction): Set assembler name
1107         of the DECL_OMP_DECLARE_REDUCTION_P decls.
1109 2016-02-08  Marek Polacek  <polacek@redhat.com>
1111         PR c++/69688
1112         * constexpr.c (clear_cv_and_fold_caches): Renamed from clear_cv_cache.
1113         Call clear_fold_cache.
1114         * cp-tree.h: Adjust declaration.
1115         * decl.c (finish_enum_value_list): Call clear_cv_and_fold_caches
1116         rather than clear_cv_cache and clear_fold_cache.
1117         * typeck2.c (store_init_value): Call clear_cv_and_fold_caches.
1119 2016-02-08  Jason Merrill  <jason@redhat.com>
1121         * cp-tree.h (CONV_FOLD, CONV_BACKEND_CONVERT): New.
1122         * cvt.c (convert): Pass CONV_BACKEND_CONVERT.
1123         (ocp_convert): Use *_maybe_fold.
1124         (cp_convert_to_pointer): Add dofold parameter.
1125         * cp-gimplify.c (cp_fold) [CONVERT_EXPR]: Call convert.
1127 2016-02-05  Martin Sebor  <msebor@redhat.com>
1129         PR c++/69662
1130         * init.c (find_field_init): New function.
1131         (warn_placement_new_too_small): Call it.  Handle one-element arrays
1132         at ends of structures special.
1134 2016-02-05  Jason Merrill  <jason@redhat.com>
1136         PR c++/68948
1137         * semantics.c (finish_expr_stmt): If expr is error_mark_node,
1138         make sure we've seen_error().
1140 2016-02-05  Patrick Palka  <ppalka@gcc.gnu.org>
1142         PR c++/68948
1143         * pt.c (tsubst_baselink): Diagnose an invalid constructor call
1144         if lookup_fnfields returns NULL_TREE and the name being looked
1145         up has the form A::A.
1147 2016-02-04  Patrick Palka  <ppalka@gcc.gnu.org>
1149         * constexpr.c (cxx_eval_binary_expression): Fold equality
1150         comparisons involving PTRMEM_CSTs.
1152 2016-02-04  Jakub Jelinek  <jakub@redhat.com>
1154         * class.c (find_flexarrays): Don't declare dom variable.
1155         (diagnose_flexarray): Likewise.
1157 2016-02-02  Martain Sebor  <msebor@redhat.com>
1159         PR c++/69251
1160         PR c++/69253
1161         PR c++/69290
1162         PR c++/69277
1163         PR c++/69349
1164         * class.c (walk_subobject_offsets): Avoid testing the upper bound
1165         of a flexible array member for equality to null.
1166         (find_flexarrays): Remove spurious whitespace introduced in r231665.
1167         (diagnose_flexarrays): Avoid checking the upper bound of arrays.
1168         (check_flexarrays): Same.
1169         * decl.c (compute_array_index_type): Avoid special case for flexible
1170         array members.
1171         (grokdeclarator): Avoid calling compute_array_index_type for flexible
1172         array members.
1173         * error.c (dump_type_suffix): Revert changes introduced in r231665
1174         and rendered unnecessary by the changes above.
1175         * pt.c (tsubst):  Same.
1176         * tree.c (build_ctor_subob_ref): Handle flexible array members.
1177         * typeck2.c (digest_init_r): Revert changes introduced in r231665.
1178         (process_init_constructor_array): Same.
1179         (process_init_constructor_record): Same.
1181 2016-02-03  Patrick Palka  <ppalka@gcc.gnu.org>
1183         PR c++/69056
1184         * pt.c (try_one_overload): Handle comparing argument packs so
1185         that there is no conflict if we deduced more arguments of an
1186         argument pack than were explicitly specified.
1188 2016-01-31  Jakub Jelinek  <jakub@redhat.com>
1189             Jason Merrill  <jason@redhat.com>
1191         PR c++/68763
1192         * tree.c (strip_typedefs) [FUNCTION_TYPE]: Avoid building a new
1193         function type if nothing is changing.
1195 2016-01-31  Jason Merrill  <jason@redhat.com>
1197         PR c++/69009
1198         * pt.c (partial_specialization_p, impartial_args): New.
1199         (instantiate_decl): Call impartial_args.
1201         * mangle.c (maybe_check_abi_tags): New.
1202         (write_guarded_var_name): Call it.
1203         (mangle_ref_init_variable): Call check_abi_tags.
1205         * pt.c (lookup_template_class_1): Don't share TYPE_ATTRIBUTES
1206         between template and instantiation.
1208 2016-01-29  Jakub Jelinek  <jakub@redhat.com>
1210         PR debug/66869
1211         * decl.c (wrapup_globals_for_namespace): Warn about unused static
1212         function declarations.
1214 2016-01-29  Marek Polacek  <polacek@redhat.com>
1216         PR c++/69509
1217         PR c++/69516
1218         * constexpr.c (cxx_eval_array_reference): Give the "array subscript
1219         out of bound" error earlier.
1220         * init.c (build_vec_init): Change NE_EXPR into GT_EXPR.  Update the
1221         commentary.
1223 2016-01-29  Patrick Palka  <ppalka@gcc.gnu.org>
1225         * name-lookup.c (begin_scope): After reusing a cp_binding_level
1226         structure, update free_binding_level before the structure's
1227         level_chain field gets cleared, not after.
1229 2016-01-28  Jason Merrill  <jason@redhat.com>
1231         PR c++/67407
1232         * search.c (dfs_walk_once, dfs_walk_once_r)
1233         (dfs_walk_once_accessible_r, dfs_walk_once_accessible): Use
1234         hash_set instead of BINFO_MARKED.
1235         (dfs_unmark_r): Remove.
1237 2016-01-28  Patrick Palka  <ppalka@gcc.gnu.org>
1239         PR c++/24208
1240         * parser.c (LEXER_DEBUGGING_ENABLED_P): New macro.
1241         (cp_lexer_debugging_p): Use it.
1242         (cp_lexer_start_debugging): Likewise.
1243         (cp_lexer_stop_debugging): Likewise.
1245 2016-01-27  Marek Polacek  <polacek@redhat.com>
1247         PR c/68062
1248         * typeck.c (cp_build_binary_op): Promote operand to unsigned, if
1249         needed.  Add -Wsign-compare warning.
1251 2016-01-27  Ryan Burn  <contact@rnburn.com>
1253         PR cilkplus/69267
1254         * cp-gimplify.c (cilk_cp_gimplify_call_params_in_spawned_fn): Removed
1255         superfluous post_p argument in call to
1256         cilk_gimplify_call_params_in_spawned_fn.
1258 2016-01-27  Marek Polacek  <polacek@redhat.com>
1260         PR c++/69379
1261         * constexpr.c (cxx_eval_constant_expression): Handle PTRMEM_CSTs
1262         wrapped in NOP_EXPRs.
1264 2016-01-27  Martin Sebor  <msebor@redhat.com>
1266         PR c++/69317
1267         * mangle.c (mangle_decl): Reference the correct (saved) version
1268         of the ABI in -Wabi diagnostics.
1270 2016-01-27  Marek Polacek  <polacek@redhat.com>
1272         PR c++/69496
1273         * constexpr.c (cxx_eval_array_reference): Evaluate the number of
1274         elements of the array.
1276 2016-01-26  Jason Merrill  <jason@redhat.com>
1278         PR c++/68949
1279         * constexpr.c (register_constexpr_fundef): Keep the un-massaged body.
1280         (cxx_eval_call_expression): Don't look through clones.
1281         * optimize.c (maybe_clone_body): Clear DECL_SAVED_TREE of the alias.
1282         * semantics.c (expand_or_defer_fn_1): Keep DECL_SAVED_TREE of
1283         maybe-in-charge *tor.
1285 2016-01-26  Jason Merrill  <jason@redhat.com>
1287         PR c++/68782
1288         * constexpr.c (cxx_eval_bare_aggregate): Update TREE_CONSTANT
1289         and TREE_SIDE_EFFECTS.
1290         (cxx_eval_constant_expression) [CONSTRUCTOR]: Call
1291         verify_constructor_flags.
1293 2016-01-26  Jakub Jelinek  <jakub@redhat.com>
1295         PR c++/68357
1296         * cp-gimplify.c (cp_fold): If some operand folds to error_mark_node,
1297         return error_mark_node instead of building trees with error_mark_node
1298         operands.
1300 2016-01-26  David Malcolm  <dmalcolm@redhat.com>
1302         PR other/69006
1303         * error.c (print_instantiation_partial_context_line): Add missing
1304         newlines from output for the t == NULL case.
1305         (print_instantiation_partial_context): Remove call to pp_newline.
1307 2016-01-24  Patrick Palka  <ppalka@gcc.gnu.org>
1309         Revert:
1310         2016-01-18  Patrick Palka  <ppalka@gcc.gnu.org>
1312         PR c++/11858
1313         PR c++/24663
1314         PR c++/24664
1315         * decl.c (grokdeclarator): Don't decay array parameter type to
1316         a pointer type if it's dependent.
1317         (grokparms): Invoke strip_top_quals instead of directly invoking
1318         cp_build_qualified_type.
1319         * pt.c (decay_dependent_array_parm_type): New static function.
1320         (type_unification_real): Call decay_dependent_array_parm_type
1321         to decay a dependent array parameter type to its corresponding
1322         pointer type before unification.
1323         (more_specialized_fn): Likewise.
1324         (get_bindings): Likewise.
1325         * tree.c (cp_build_qualified_type): Trivial typofix in
1326         documentation.
1328 2016-01-23  Martin Sebor  <msebor@redhat.com>
1330         PR c++/58109
1331         PR c++/69022
1332         * decl2.c (is_late_template_attribute): Handle dependent argument
1333         to attribute align and attribute vector_size.
1335 2016-01-21  Jason Merrill  <jason@redhat.com>
1337         PR c++/69392
1338         * lambda.c (lambda_capture_field_type): Handle 'this' specially
1339         for init-capture, too.
1341         PR c++/65687
1342         * decl.c (type_is_deprecated): Don't look into a typedef.
1344         PR c++/40751
1345         PR c++/64987
1346         * decl.c (copy_type_enum): Respect TYPE_USER_ALIGN.
1348         PR c++/43407
1349         * decl.c (start_enum): Add attributes parameter.
1350         * parser.c (cp_parser_enum_specifier): Pass it.
1351         * pt.c (lookup_template_class_1): Pass it.
1352         * cp-tree.h: Adjust.
1354 2016-01-19  Jason Merrill  <jason@redhat.com>
1356         PR c++/59759
1357         * pt.c (convert_template_argument): Handle VAR_DECL properly.
1359 2016-01-19  Marek Polacek  <polacek@redhat.com>
1361         PR c++/68586
1362         * constexpr.c (clear_cv_cache): New.
1363         * cp-gimplify.c (clear_fold_cache): New.
1364         * cp-tree.h (clear_cv_cache, clear_fold_cache): Declare.
1365         * decl.c (finish_enum_value_list): Call them.
1367         PR c++/68965
1368         * pt.c (tsubst_copy): Mark elements in expanded vector as used.
1370 2016-01-18  Patrick Palka  <ppalka@gcc.gnu.org>
1372         PR c++/11858
1373         PR c++/24663
1374         PR c++/24664
1375         * decl.c (grokdeclarator): Don't decay array parameter type to
1376         a pointer type if it's dependent.
1377         (grokparms): Invoke strip_top_quals instead of directly invoking
1378         cp_build_qualified_type.
1379         * pt.c (decay_dependent_array_parm_type): New static function.
1380         (type_unification_real): Call decay_dependent_array_parm_type
1381         to decay a dependent array parameter type to its corresponding
1382         pointer type before unification.
1383         (more_specialized_fn): Likewise.
1384         (get_bindings): Likewise.
1385         * tree.c (cp_build_qualified_type): Trivial typofix in
1386         documentation.
1388 2016-01-18  Jason Merrill  <jason@redhat.com>
1390         * cp-gimplify.c (cp_fold) [CONSTRUCTOR]: Don't clobber the input.
1392         * cp-gimplify.c (cp_fold): Remove unnecessary special cases.
1394         PR c++/68767
1395         * cp-gimplify.c (cp_fold) [COND_EXPR]: Simplify.  Do fold COND_EXPR.
1396         (contains_label_1, contains_label_p): Remove.
1398 2016-01-16  Patrick Palka  <ppalka@gcc.gnu.org>
1400         PR c++/69091
1401         * pt.c (type_dependent_expression_p): For a function template
1402         specialization, a type is dependent iff any of its template
1403         arguments are.
1405 2016-01-16  Patrick Palka  <ppalka@gcc.gnu.org>
1407         * cp-array-notation.c (cp_expand_cond_array_notations): Return
1408         error_mark_node only if find_rank failed, not if it was
1409         successful.
1411 2016-01-16  Patrick Palka  <ppalka@gcc.gnu.org>
1413         PR c++/68936
1414         * tree.c (build_min_non_dep_call_vec): Don't retain the
1415         KOENIG_LOOKUP_P flag of the non-dependent expression that's
1416         been built.
1417         (build_min_non_dep_op_overload): Instead, do it here.
1419 2016-01-15  Jakub Jelinek  <jakub@redhat.com>
1421         PR bootstrap/68271
1422         * parser.h (cp_token): Remove pragma_kind field.  Add comment
1423         with number of unused bits.
1424         * parser.c (eof_token): Remove pragma_kind field initializer.
1425         (cp_lexer_get_preprocessor_token): Don't set pragma_kind
1426         field, don't clear CPP_PRAGMA u.value.
1427         (cp_parser_pragma_kind): New function.
1428         (cp_parser_omp_sections_scope, cp_parser_oacc_kernels_parallel,
1429         cp_parser_omp_construct, cp_parser_initial_pragma,
1430         cp_parser_pragma): Use cp_parser_pragma_kind instead of accessing
1431         pragma_kind field.
1433 2016-01-15  Jason Merrill  <jason@redhat.com>
1435         PR c++/68847
1436         * call.c (build_cxx_call): Use fold_non_dependent_expr.
1438         * typeck2.c (cxx_incomplete_type_diagnostic): Use the location of
1439         value.
1441         PR c++/69257
1442         * typeck.c (decay_conversion): Don't call mark_rvalue_use for
1443         array/function-to-pointer conversion.  Call
1444         complete_type_or_maybe_complain for lvalue-to-rvalue conversion.
1445         * call.c (convert_like_real): Print call context if
1446         decay_conversion errors.
1448 2016-01-14  Tom de Vries  <tom@codesourcery.com>
1450         PR tree-optimization/68773
1451         * parser.c (cp_parser_oacc_declare, cp_parser_omp_declare_target): Don't
1452         set force_output.
1454 2016-01-14  Jason Merrill  <jason@redhat.com>
1456         PR c++/69261
1457         * constexpr.c (find_array_ctor_elt): Handle splitting RANGE_EXPR.
1459 2016-01-12  Marek Polacek  <polacek@redhat.com>
1461         PR c++/68979
1462         * constexpr.c (cxx_eval_check_shift_p): Use permerror rather than
1463         error_at and adjust the return value.
1465 2016-01-12  Jakub Jelinek  <jakub@redhat.com>
1467         PR objc++/68511
1468         PR c++/69213
1469         * cp-gimplify.c (cp_gimplify_expr) <case INIT_EXPR>: Don't return
1470         GS_ERROR whenever seen_error (), only if *expr_p contains
1471         cilk spawn stmt, but cilk_detect_spawn_and_unwrap failed.
1473         PR c++/66808
1474         PR c++/69000
1475         * pt.c (tsubst_decl): If not local_p, clear DECL_TEMPLATE_INFO.
1477 2016-01-11  Jason Merrill  <jason@redhat.com>
1479         PR c++/69131
1480         * method.c (walk_field_subobs): Add dtor_from_ctor parm.
1481         (process_subob_fn): Likewise.  Don't consider triviality if true.
1482         (synthesize_method_walk): Pass it.
1484 2016-01-11  David Malcolm  <dmalcolm@redhat.com>
1486         PR c++/68795
1487         * parser.c (cp_parser_postfix_expression): Initialize
1488         close_paren_loc to UNKNOWN_LOCATION; only use it if
1489         it has been written to by
1490         cp_parser_parenthesized_expression_list.
1491         (cp_parser_parenthesized_expression_list): Document the behavior
1492         with respect to the CLOSE_PAREN_LOC param.
1494 2016-01-11  Jakub Jelinek  <jakub@redhat.com>
1496         PR c++/69211
1497         * cp-gimplify.c (cp_fold): If COMPOUND_EXPR or MODIFY_EXPR
1498         folded operands have side-effects, but folding changed any of them,
1499         build a new tree with the folded operands instead of returning the
1500         unfolded tree.
1502 2016-01-09  Marek Polacek  <polacek@redhat.com>
1504         PR c++/69113
1505         * decl2.c (comdat_linkage): Only set DECL_COMDAT if TREE_PUBLIC is set.
1507 2016-01-09  Jakub Jelinek  <jakub@redhat.com>
1509         PR c++/69164
1510         * class.c (layout_class_type): Use copy_node to copy FIELD_DECLs.
1512 2016-01-08  Jason Merrill  <jason@redhat.com>
1514         PR c++/69158
1515         * constexpr.c (cxx_fold_indirect_ref): Handle array type differing
1516         in completion.
1518 2016-01-08  Marek Polacek  <polacek@redhat.com>
1520         PR c++/68449
1521         * constexpr.c (cxx_eval_constant_expression): Handle NULL initializer.
1523 2016-01-08  Jason Merrill  <jason@redhat.com>
1525         * constexpr.c (cxx_eval_call_expression): Remove convert_to_void
1526         workaround.
1528         PR c++/68983
1529         PR c++/67557
1530         * cvt.c (convert_to_void): Don't strip a TARGET_EXPR of
1531         TREE_ADDRESSABLE type.
1533         PR c++/68983
1534         PR c++/67557
1535         * call.c (unsafe_copy_elision_p): Look through COMPOUND_EXPR.
1537 2016-01-05  Nathan Sidwell  <nathan@acm.org>
1539         PR c++/58583
1540         * pt.c (build_non_dependent_expr): Don't try a checking fold when
1541         parsing an nsdmi.
1543 2016-01-04  Jakub Jelinek  <jakub@redhat.com>
1545         Update copyright years.
1547 Copyright (C) 2016 Free Software Foundation, Inc.
1549 Copying and distribution of this file, with or without modification,
1550 are permitted in any medium without royalty provided the copyright
1551 notice and this notice are preserved.