1 2016-04-08 Patrick Palka <ppalka@gcc.gnu.org>
5 * constexpr.c (cxx_eval_outermost_expression): Call unshare_expr
6 on the result if it's not a CONSTRUCTOR.
8 2016-04-07 Patrick Palka <ppalka@gcc.gnu.org>
11 * constexpr.c (find_constructor): New function.
12 (unshare_constructor): New function.
13 (cxx_eval_call_expression): Use unshare_constructor instead of
15 (find_array_ctor_elt): Likewise.
16 (cxx_eval_vec_init_1): Likewise.
17 (cxx_eval_store_expression): Likewise.
18 (cxx_eval_constant_expression): Likewise.
20 2016-04-06 Patrick Palka <ppalka@gcc.gnu.org>
23 * cp-tree.h (FOR_EACH_CLONE): Restructure macro to avoid
24 potentially generating a future -Wparentheses warning in its
27 2016-04-06 Jason Merrill <jason@redhat.com>
29 * class.c (check_abi_tags): Fix function template handling.
31 2016-04-05 Nathan Sidwell <nathan@acm.org>
34 * class.c (fixup_may_alias): New.
35 (fixup_attribute_variants): Call it.
37 2016-04-05 Patrick Palka <ppalka@gcc.gnu.org>
40 * constexpr.c (struct fundef_copy): New struct.
41 (struct fundef_copies_table_t): New struct.
42 (fundef_copies_table): New static variable.
43 (maybe_initialize_fundef_copies_table): New static function.
44 (get_fundef_copy): New static function.
45 (save_fundef_copy): New static function.
46 (cxx_eval_call_expression): Use get_fundef_copy, and
48 (constexpr_call_table): Add "deletable" GTY marker.
50 2016-04-05 Patrick Palka <ppalka@gcc.gnu.org>
53 * cp-tree.h (class cache_map): Remove.
54 * constexpr.c (cv_cache): Change type to
55 GTY((deletable)) hash_map<tree, tree> *.
56 (maybe_constant_value): Adjust following the change to cv_cache.
57 (clear_cv_cache): New static function.
58 (clear_cv_and_fold_caches): Use it.
59 * cp-gimplify.c (fold_cache): Change type to
60 GTY((deletable)) hash_map<tree, tree> *.
61 (clear_fold_cache): Adjust following the change to fold_cache.
64 2016-04-02 Martin Sebor <msebor@redhat.com>
70 * constexpr.c (diag_array_subscript): New function.
71 (cxx_eval_array_reference): Detect out of bounds array indices.
73 2016-04-01 Jason Merrill <jason@redhat.com>
77 * pt.c (instantiate_decl): A function isn't fully defined if
78 DECL_INITIAL is error_mark_node.
79 * constexpr.c (cxx_eval_call_expression): Likewise.
81 2016-04-01 Jakub Jelinek <jakub@redhat.com>
82 Marek Polacek <polacek@redhat.com>
85 * init.c (warn_placement_new_too_small): Test whether
86 DECL_SIZE_UNIT or TYPE_SIZE_UNIT are integers that fit into uhwi.
88 2016-04-01 Nathan Sidwell <nathan@acm.org>
91 * decl.c (check_redeclaration_exception_specification): Check
92 regardless of -fno-exceptions.
93 * typeck2.c (merge_exception_specifiers): Relax assert by checking
96 2016-03-31 Nathan Sidwell <nathan@acm.org>
98 * decl.c (start_preparsed_function): Remove unnecessary bracing.
99 (finish_destructor_body): Don't emit operator delete here.
101 2016-03-31 Nathan Sidwell <nathan@acm.org>
104 * constexpr.c (cxx_eval_store_expression): Keep CONSTRUCTOR
105 elements in field order.
107 2016-03-31 Marek Polacek <polacek@redhat.com>
110 * decl.c (duplicate_decls): Also set TYPE_ALIGN and TYPE_USER_ALIGN.
112 2016-03-31 Richard Biener <rguenther@suse.de>
115 * typeck.c (cp_build_binary_op): Fix operand order of vector
116 conditional in truth op handling.
118 2016-03-29 Jason Merrill <jason@redhat.com>
121 * decl.c (make_rtl_for_nonlocal_decl): Don't defer local statics
122 in constexpr functions.
124 2016-03-28 Jason Merrill <jason@redhat.com>
129 * decl.c, pt.c, constexpr.c: Revert last patch.
131 2016-03-25 Jason Merrill <jason@redhat.com>
132 Martin Liška <mliska@suse.cz>
137 * decl.c (cp_fname_init): Decay the initializer to pointer.
138 (cp_make_fname_decl): Set DECL_DECLARED_CONSTEXPR_P,
139 DECL_VALUE_EXPR, DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
140 Don't call cp_finish_decl.
141 * pt.c (tsubst_expr) [DECL_EXPR]: Set DECL_VALUE_EXPR,
142 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P. Don't call cp_finish_decl.
143 * constexpr.c (cxx_eval_constant_expression) [VAR_DECL]:
144 Handle DECL_VALUE_EXPR.
146 2016-03-24 Jason Merrill <jason@redhat.com>
149 * constexpr.c (cxx_eval_bare_aggregate): Handle PMFs.
152 * constexpr.c (cxx_eval_call_expression): Don't cache result if
155 2016-03-24 Patrick Palka <ppalka@gcc.gnu.org>
158 * tree.c (build_cplus_array_type): Determine type-dependentess
159 with uses_template_parms instead of with dependent_type_p.
161 2016-03-23 Patrick Palka <ppalka@gcc.gnu.org>
164 * typeck.c (process_init_constructor_union): If the initializer
165 is empty, use the union's NSDMI if it has one.
167 2016-03-23 Patrick Palka <ppalka@gcc.gnu.org>
170 * pt.c (tsubst_copy) [PARM_DECL]: Handle the use of 'this' in an
171 NSDMI that's part of an aggregrate initialization.
173 2016-03-23 Jakub Jelinek <jakub@redhat.com>
176 * constexpr.c (cxx_eval_vec_init_1): Reuse CONSTRUCTOR initializers
177 for 1..max even for multi-dimensional arrays. Call unshare_expr
181 * constexpr.c (cxx_eval_constant_expression): Diagnose overflow
182 on TREE_OVERFLOW constants.
185 * cp-gimplify.c (genericize_omp_for_stmt): Don't walk OMP_FOR_CLAUSES
186 for OMP_TASKLOOP here.
187 (cp_genericize_r): Handle OMP_TASKLOOP like OMP_TASK, except do call
188 genericize_omp_for_stmt instead of cp_walk_tree on OMP_BODY.
190 2016-03-23 Alexandre Oliva <aoliva@redhat.com>
191 Jason Merrill <jason@redhat.com>
192 Jakub Jelinek <jakub@redhat.com>
195 * cp-tree.h (defer_mark_used_calls, deferred_mark_used_calls): Remove.
196 * decl.c (defer_mark_used_calls, deferred_mark_used_calls): Remove.
197 (finish_function): Don't set or test them.
198 * decl2.c (mark_used): Don't handle defer_mark_used_calls.
200 2016-03-23 Jason Merrill <jason@redhat.com>
203 * constexpr.c (cxx_eval_call_expression): Catch invalid recursion.
205 2016-03-23 Marek Polacek <polacek@redhat.com>
208 * pt.c (canonicalize_type_argument): Use OPT_Wignored_attributes.
210 2016-03-22 Ilya Enkovich <enkovich.gnu@gmail.com>
212 * call.c (build_conditional_expr_1): Always use original
213 condition type for vector type checks and build.
215 2016-03-22 Patrick Palka <ppalka@gcc.gnu.org>
218 * pt.c (tsubst_decl): Clear the DECL_MODE of the new decl.
220 2016-03-22 Patrick Palka <ppalka@gcc.gnu.org>
223 * constexpr.c (non_const_var_error): Check
224 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
226 2016-03-21 Richard Henderson <rth@redhat.com>
229 * decl.c (notice_forced_label_r): New.
230 (cp_finish_decl): Use it.
232 2016-03-21 Jason Merrill <jason@redhat.com>
235 * cp-gimplify.c (cp_fold) [COND_EXPR]: Handle bit-fields.
237 2016-03-18 Jason Merrill <jason@redhat.com>
240 * constexpr.c (cxx_eval_call_expression): Fix trivial copy.
243 * class.c (vptr_via_virtual_p): New.
244 (most_primary_binfo): Factor out of build_rtti_vtbl_entries.
245 * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs): Don't clear
246 a vptr from any virtual base in a not-in-charge 'structor.
248 * decl.c (build_clobber_this): Factor out of
249 start_preparsed_function and begin_destructor_body. Handle
250 virtual bases better.
252 * class.c (build_if_in_charge): Split out from build_base_path.
253 * init.c (expand_virtual_init, expand_default_init): Use it.
254 * call.c (build_special_member_call): Use it.
256 2016-03-18 Jakub Jelinek <jakub@redhat.com>
259 * init.c (build_new_1): Complain and return error_mark_node
260 if alloc_fn is not _Jv_AllocObject function returning pointer.
262 2016-03-18 Patrick Palka <ppalka@gcc.gnu.org>
265 * search.c (adjust_result_of_qualified_name_lookup): Don't
266 update the BASELINK_BINFO of DECL if the second call
267 to lookup_base fails.
269 2016-03-18 Patrick Palka <ppalka@gcc.gnu.org>
272 * parser.c (cp_parser_lambda_expression): Move call to
273 pop_deferring_access_checks ahead of the call to
274 cp_parser_end_tentative_firewall.
276 2016-03-17 Jakub Jelinek <jakub@redhat.com>
279 * cp-tree.h (magic_varargs_p): Return int instead of bool.
280 * call.c (magic_varargs_p): Return int instead of bool, return 2 for
281 Cilk+ reductions, otherwise 1 for magic varargs and 0 for normal
283 (build_over_call): If magic_varargs_p == 2, call reject_gcc_builtin,
284 if magic_varargs_p == 1, call decay_conversion
285 instead of mark_type_use. Don't store error_mark_node arguments to
286 argarray, instead return error_mark_node.
289 * decl.c (begin_destructor_body): Don't insert clobber if
290 is_empty_class (current_class_type).
292 2016-03-17 Marek Polacek <polacek@redhat.com>
295 * typeck.c (warn_for_null_address): New function.
296 (cp_build_binary_op): Call it.
298 2016-03-16 Jason Merrill <jason@redhat.com>
301 * decl.c (start_preparsed_function): Don't clobber an empty base.
303 2016-03-16 Jakub Jelinek <jakub@redhat.com>
306 * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs): Conditionalize
307 BINFO_VIRTUAL_P vtable clearing on current_in_charge_parm.
310 * cp-ubsan.c (cp_ubsan_maybe_initialize_vtbl_ptrs): Temporarily
311 set in_base_initializer.
313 2016-03-15 Marek Polacek <polacek@redhat.com>
316 * tree.c (strip_typedefs): Call strip_typedefs again on the
317 DECL_ORIGINAL_TYPE result.
319 2016-03-15 Jason Merrill <jason@redhat.com>
322 * pt.c (instantiate_decl): Fix call to variable_template_p.
325 * pt.c (for_each_template_parm_r): Always walk into TYPENAME_TYPE.
327 2016-03-14 Casey Carter <casey@carter.net>
328 Jason Merrill <jason@redhat.com>
330 P0184R0: Generalizing the Range-Based For Loop
331 * parser.c (cp_convert_range_for): Set the type of __end separately.
332 (cp_parser_perform_range_for_lookup): Allow different begin/end
333 types if they are comparable.
335 2016-03-12 Patrick Palka <ppalka@gcc.gnu.org>
338 * semantics.c (force_paren_expr): Just build a PAREN_EXPR when
339 processing_template_decl and EXPR is a SCOPE_REF.
341 2016-03-10 Patrick Palka <ppalka@gcc.gnu.org>
342 Jakub Jelinek <jakub@redhat.com>
345 * constexpr.c (cxx_eval_vec_init_1): For pre_init case, reuse
346 return value from cxx_eval_constant_expression from earlier
347 elements if it is valid constant initializer requiring no
350 2016-03-10 Marek Polacek <polacek@redhat.com>
353 * cp-gimplify.c (cp_fold): Handle UNARY_PLUS_EXPR.
355 2016-03-09 Cesar Philippidis <cesar@codesourcery.com>
357 * parser.c (cp_parser_oacc_loop): Update cclauses and clauses
358 when calling c_finish_omp_clauses.
360 2016-03-08 Jason Merrill <jason@redhat.com>
362 * parser.c (cp_parser_diagnose_invalid_type_name): Give helpful
363 diagnostic for use of "concept".
364 (cp_parser_requires_clause_opt): And "requires".
365 (cp_parser_type_parameter, cp_parser_late_return_type_opt)
366 (cp_parser_explicit_template_declaration): Adjust.
367 * Make-lang.in (check-c++-all): Add "concepts" to std list.
369 P0036R0: Unary Folds and Empty Parameter Packs
370 * pt.c (expand_empty_fold): Remove special cases for *,+,&,|.
372 2016-03-08 Jakub Jelinek <jakub@redhat.com>
375 * constexpr.c (cxx_eval_loop_expr): Forget saved values of SAVE_EXPRs
376 even after the last iteration of the loop.
378 * decl.c (duplicate_decls): Fix spelling - becuase -> because.
380 2016-03-07 Patrick Palka <ppalka@gcc.gnu.org>
383 * pt.c (get_template_info): Handle PARM_DECL.
384 (template_class_depth): Check DECL_P instead of
385 VAR_OR_FUNCTION_DECL_P.
387 2016-03-05 Jason Merrill <jason@redhat.com>
390 * constexpr.c (cxx_eval_store_expression): Replace
391 CONSTRUCTOR_ELTS in nested CONSTRUCTORs, too.
393 2016-03-05 Patrick Palka <ppalka@gcc.gnu.org>
396 * pt.c (template_class_depth): Given a lambda type, iterate
397 into its LAMBDA_TYPE_EXTRA_SCOPE field instead of its
398 TYPE_CONTEXT. Given a VAR_DECL, iterate into its
401 2016-03-04 Jason Merrill <jason@redhat.com>
404 * cp-tree.h (COND_EXPR_IS_VEC_DELETE): New.
405 * init.c (build_vec_delete_1): Set it.
406 * constexpr.c (potential_constant_expression_1) [COND_EXPR]: Check it.
408 2016-03-04 Jakub Jelinek <jakub@redhat.com>
410 * decl.c (start_preparsed_function): Don't emit start clobber at the
411 start of constructor clones.
414 * cp-tree.h (cp_ubsan_maybe_initialize_vtbl_ptrs): New prototype.
415 * decl.c (start_preparsed_function): Call
416 cp_ubsan_maybe_initialize_vtbl_ptrs if needed.
417 * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs,
418 cp_ubsan_maybe_initialize_vtbl_ptrs): New functions.
420 2016-03-04 Jason Merrill <jason@redhat.com>
423 * constexpr.c (cxx_eval_component_reference): Further tweak.
425 * constexpr.c (struct constexpr_ctx): Add save_exprs field.
426 (cxx_eval_loop_expr): Discard SAVE_EXPR values before looping.
427 (cxx_eval_constant_expression) [SAVE_EXPR]: Add it to the set.
428 (cxx_eval_outermost_constant_expr, is_sub_constant_expr): Initialize.
431 * tree.c (strip_typedefs): Handle TYPENAME_TYPE lookup finding the
434 2016-03-03 Jason Merrill <jason@redhat.com>
436 * method.c (synthesized_method_walk): operator= can also be constexpr.
438 * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Get
439 LAMBDA_EXPR_RETURN_TYPE from the instantiated closure.
442 * pt.c (copy_template_args): New.
443 (tsubst_pack_expansion): Use it.
445 * call.c (build_aggr_conv): Use get_nsdmi.
448 * typeck.c (build_static_cast_1): Avoid folding back to lvalue.
451 * constexpr.c (cxx_eval_component_reference): Just return an empty
452 CONSTRUCTOR for an empty class.
454 2016-03-01 Jason Merrill <jason@redhat.com>
457 * parser.c (cp_parser_requires_clause): Call
458 check_for_bare_parameter_packs.
461 * constexpr.c (cxx_eval_binary_expression): Don't VERIFY_CONSTANT
465 * constexpr.c (cxx_eval_call_expression): Unshare arg.
466 (cxx_eval_constant_expression) [DECL_EXPR]: Unshare init.
467 [TARGET_EXPR]: Unshare init.
469 2016-03-01 Patrick Palka <ppalka@gcc.gnu.org>
473 * pt.c (tsubst_baselink): Reinstate the check for an invalid
476 2016-02-28 Jason Merrill <jason@redhat.com>
479 * constexpr.c (cxx_eval_store_expression): Unshare init.
481 2016-02-26 Jason Merrill <jason@redhat.com>
484 * pt.c (make_argument_pack): New.
485 (tsubst_copy) [SIZEOF_EXPR]: Handle partial expansion.
486 (tsubst_copy_and_build): Likewise.
488 2016-02-25 Jason Merrill <jason@redhat.com>
491 * cp-tree.h (AGGR_INIT_FROM_THUNK_P): New.
492 * tree.c (build_aggr_init_expr): Set it.
493 * semantics.c (simplify_aggr_init_expr): Check it.
494 * cp-gimplify.c (cp_genericize_r): Don't walk into
495 a call/aggr_init from a thunk.
498 * method.c (forward_parm): Handle parameter packs.
499 * lambda.c (maybe_add_lambda_conv_op): Use it for them.
502 * constexpr.c (cxx_eval_component_reference): Don't complain about
503 unevaluated empty classes.
506 * tree.c (strip_typedefs): Use DECL_ORIGINAL_TYPE.
508 2016-02-25 Patrick Palka <ppalka@gcc.gnu.org>
511 * cp-tree.h (REF_PARENTHESIZED_P): Adjust documentation.
512 (maybe_undo_parenthesized_ref): Declare.
513 * semantics.c (maybe_undo_parenthesized_ref): Split out from
515 (finish_call_expr): Use it.
516 * typeck.c (check_return_expr): Use it.
517 * pt.c (tsubst_copy_and_build) [INDIRECT_REF]: Retain the
518 REF_PARENTHESIZED_P flag.
520 2016-02-24 Jakub Jelinek <jakub@redhat.com>
523 * class.c (build_base_path): Set TREE_NO_WARNING on the null_test.
525 * init.c (build_vec_delete_1, build_delete): Don't fold the non-NULL
527 * cp-gimplify.c (cp_fold): For TREE_NO_WARNING comparisons with NULL,
528 unless they are folded into INTEGER_CST, error_mark_node or some
529 comparison with NULL, avoid folding them and use either the original
530 comparison or non-folded comparison of folded arguments.
531 * cp-ubsan.c (cp_ubsan_instrument_vptr): Set TREE_NO_WARNING on the
532 comparison, don't fold the comparison right away.
534 2016-02-24 Jason Merrill <jason@redhat.com>
537 * friend.c (make_friend_class): Likewise.
538 * decl.c (lookup_and_check_tag): Diagnose invalid dependent friend.
540 2016-02-24 Jason Merrill <jason@redhat.com>
543 * pt.c (instantiate_class_template_1): Set
544 processing_template_decl before substituting friend_type.
546 016-02-24 Martin Sebor <msebor@redhat.com>
549 * tree.c (build_ctor_subob_ref): Compare types' main variants
550 instead of the types as they are.
552 2016-02-24 Jason Merrill <jason@redhat.com>
554 * decl.c (start_preparsed_function): Condition ctor clobber on
555 flag_lifetime_dse > 1.
557 * cp-gimplify.c (cp_fold): Don't fold constexpr calls if -fno-inline.
559 2016-02-19 Jason Merrill <jason@redhat.com>
562 * call.c (remaining_arguments): No longer static.
563 * cp-tree.h: Declare it.
564 * pt.c (more_specialized_fn): Use it.
566 2016-02-19 Jakub Jelinek <jakub@redhat.com>
567 Bernd Edlinger <bernd.edlinger@hotmail.de>
569 * Make-lang.in: Invoke gperf with -L C++.
570 * cfns.gperf: Remove prototypes for hash and libc_name_p
572 * cfns.h: Regenerated.
573 * except.c (nothrow_libfn_p): Adjust.
575 2016-02-19 Jakub Jelinek <jakub@redhat.com>
578 * rtti.c (ifnonnull): Set TREE_NO_WARNING on the condition, use
579 NE_EXPR instead of EQ_EXPR and swap last two arguments on COND_EXPR.
581 2016-02-19 Patrick Palka <ppalka@gcc.gnu.org>
584 * pt.c (tsubst_baselink): Don't diagnose an invalid constructor
586 * semantics.c (finish_call_expr): Don't assume a constructor
587 call is dependent if only the "this" pointer is dependent. When
588 building a constructor call, always use a dummy object.
590 2016-02-19 Jakub Jelinek <jakub@redhat.com>
593 * init.c (build_vec_delete_1): Set TREE_NO_WARNING on the NE_EXPR
595 * cp-gimplify.c (cp_fold): Propagate TREE_NO_WARNING from binary
596 operators if folding preserved the binop, just with different
600 * parser.c (cp_parser_std_attribute_spec_seq): Don't assume
601 attr_spec is always single element chain, chain all the attributes
602 properly together in the right order.
604 2016-02-18 Jason Merrill <jason@redhat.com>
606 * mangle.c (maybe_check_abi_tags): Add for_decl parm. Call
608 (mangle_decl): Call maybe_check_abi_tags for function scope.
609 (mangle_guard_variable): Call maybe_check_abi_tags here.
610 (write_guarded_var_name): Not here.
612 2016-02-17 Jason Merrill <jason@redhat.com>
615 * constexpr.c (build_constexpr_constructor_member_initializers):
616 Handle an additional STATEMENT_LIST.
619 * constexpr.c (cxx_eval_bare_aggregate): Fix 'changed' detection.
622 * decl2.c (reset_type_linkage_2): Look through member templates.
624 2016-02-17 Jakub Jelinek <jakub@redhat.com>
627 * init.c (build_delete): Set TREE_NO_WARNING on ifexp.
629 2016-02-17 Jason Merrill <jason@redhat.com>
632 * method.c (forward_parm): Split out from...
633 (add_one_base_init): ...here.
634 * lambda.c (maybe_add_lambda_conv_op): Use it.
636 2016-02-16 Jason Merrill <jason@redhat.com>
640 * call.c, cp-tree.h, name-lookup.c, pt.c, search.c, semantics.c,
641 tree.c, typeck2.c: Revert earlier changes.
642 * parser.c (cp_parser_lookup_name): Ignore namespace-scope
643 non-type templates after -> or .
645 2016-02-16 Jakub Jelinek <jakub@redhat.com>
648 * typeck.c (cp_build_binary_op): Revert 2015-09-09 change.
650 2016-02-16 Jason Merrill <jason@redhat.com>
653 * name-lookup.c (lookup_qualified_name): Add find_hidden parm.
654 (set_decl_namespace): Pass it. Complain about finding a hidden friend.
655 * name-lookup.h: Adjust.
657 2016-02-16 James Norris <jnorris@codesourcery.com>
659 * parser.c (cp_parser_oacc_data_clause_deviceptr): Remove checking.
660 * semantics.c (finish_omp_clauses): Add deviceptr checking.
662 2016-02-15 Jakub Jelinek <jakub@redhat.com>
665 * init.c (expand_default_init): Only call reshape_init
666 in the direct-initialization from an initializer list case.
668 2016-02-15 Jason Merrill <jason@redhat.com>
671 * semantics.c (finish_call_expr): Implicit 'this' does not make
673 * search.c (any_dependent_bases_p): Split out...
674 * name-lookup.c (do_class_using_decl): ...from here.
675 * call.c (build_new_method_call_1): Don't complain about missing object
676 if there are dependent bases. Tweak error.
677 * tree.c (non_static_member_function_p): Remove.
678 * pt.c (type_dependent_expression_p): A member template of a
679 dependent type is dependent.
683 * constexpr.c (verify_ctor_sanity): Remove CONSTRUCTOR_NELTS check.
685 2016-02-12 Patrick Palka <ppalka@gcc.gnu.org>
688 * pt.c (lookup_and_finish_template_variable): New function,
690 (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: ... here. Use it.
691 (tsubst_qualified_id): Consider that EXPR might be a variable
693 * typeck.c (check_template_keyword): Don't emit an error
694 if DECL is a variable template.
696 2016-02-12 Jakub Jelinek <jakub@redhat.com>
698 * error.c: Spelling fixes - behaviour -> behavior and
699 neighbour -> neighbor.
701 * typeck.c (cp_build_binary_op): Fix up behavior spelling in
703 * init.c (build_delete): Likewise.
705 2016-02-11 Jakub Jelinek <jakub@redhat.com>
708 * typeck.c (cp_build_binary_op): cp_fully_fold integer_zerop
709 arguments for -Waddress warning. Fix up formatting.
711 2016-02-11 Paolo Carlini <paolo.carlini@oracle.com>
714 * pt.c (lookup_template_class_1): Check tsubst return value for
717 2016-02-10 Jason Merrill <jason@redhat.com>
720 * pt.c (resolve_nondeduced_context): Add complain parm.
721 (do_auto_deduction): Pass it.
722 * cvt.c (convert_to_void): Likewise.
723 * decl.c (cp_finish_decl): Likewise.
724 * init.c (build_new): Likewise.
725 * rtti.c (get_tinfo_decl_dynamic): Likewise.
726 * semantics.c (finish_decltype_type): Likewise.
727 * typeck.c (decay_conversion): Likewise.
728 * cp-tree.h: Adjust declaration.
729 * call.c (standard_conversion): Add complain parm, pass it along.
730 (implicit_conversion): Pass it.
733 * name-lookup.c (ambiguous_decl): Call remove_hidden_names.
734 (lookup_name_real_1): Likewise.
735 (remove_hidden_names): Handle non-functions too.
738 * parser.c (cp_parser_lookup_name): When looking for a template
739 after . or ->, only consider class templates.
740 (cp_parser_postfix_dot_deref_expression): Handle the current
741 instantiation. Remember a dependent object expression.
742 * typeck2.c (build_x_arrow): Handle the current instantiation.
744 * ptree.c (debug_tree): Implement for cp_expr.
746 2016-02-08 Patrick Palka <ppalka@gcc.gnu.org>
749 * parser.c (cp_parser_simple_type_specifier): Make the check
750 for disambiguating between an 'auto' placeholder and an implicit
751 template parameter more robust.
753 2016-02-08 Patrick Palka <ppalka@gcc.gnu.org>
757 * decl2.c (mark_used): When given a TEMPLATE_DECL, return after
758 setting its TREE_USED flag.
760 2016-02-08 Jason Merrill <jason@redhat.com>
763 * name-lookup.c (do_nonmember_using_decl): Leave anticipated
766 2016-02-08 Jakub Jelinek <jakub@redhat.com>
769 * parser.c (cp_parser_omp_declare_reduction): Set assembler name
770 of the DECL_OMP_DECLARE_REDUCTION_P decls.
772 2016-02-08 Marek Polacek <polacek@redhat.com>
775 * constexpr.c (clear_cv_and_fold_caches): Renamed from clear_cv_cache.
776 Call clear_fold_cache.
777 * cp-tree.h: Adjust declaration.
778 * decl.c (finish_enum_value_list): Call clear_cv_and_fold_caches
779 rather than clear_cv_cache and clear_fold_cache.
780 * typeck2.c (store_init_value): Call clear_cv_and_fold_caches.
782 2016-02-08 Jason Merrill <jason@redhat.com>
784 * cp-tree.h (CONV_FOLD, CONV_BACKEND_CONVERT): New.
785 * cvt.c (convert): Pass CONV_BACKEND_CONVERT.
786 (ocp_convert): Use *_maybe_fold.
787 (cp_convert_to_pointer): Add dofold parameter.
788 * cp-gimplify.c (cp_fold) [CONVERT_EXPR]: Call convert.
790 2016-02-05 Martin Sebor <msebor@redhat.com>
793 * init.c (find_field_init): New function.
794 (warn_placement_new_too_small): Call it. Handle one-element arrays
795 at ends of structures special.
797 2016-02-05 Jason Merrill <jason@redhat.com>
800 * semantics.c (finish_expr_stmt): If expr is error_mark_node,
801 make sure we've seen_error().
803 2016-02-05 Patrick Palka <ppalka@gcc.gnu.org>
806 * pt.c (tsubst_baselink): Diagnose an invalid constructor call
807 if lookup_fnfields returns NULL_TREE and the name being looked
808 up has the form A::A.
810 2016-02-04 Patrick Palka <ppalka@gcc.gnu.org>
812 * constexpr.c (cxx_eval_binary_expression): Fold equality
813 comparisons involving PTRMEM_CSTs.
815 2016-02-04 Jakub Jelinek <jakub@redhat.com>
817 * class.c (find_flexarrays): Don't declare dom variable.
818 (diagnose_flexarray): Likewise.
820 2016-02-02 Martain Sebor <msebor@redhat.com>
827 * class.c (walk_subobject_offsets): Avoid testing the upper bound
828 of a flexible array member for equality to null.
829 (find_flexarrays): Remove spurious whitespace introduced in r231665.
830 (diagnose_flexarrays): Avoid checking the upper bound of arrays.
831 (check_flexarrays): Same.
832 * decl.c (compute_array_index_type): Avoid special case for flexible
834 (grokdeclarator): Avoid calling compute_array_index_type for flexible
836 * error.c (dump_type_suffix): Revert changes introduced in r231665
837 and rendered unnecessary by the changes above.
838 * pt.c (tsubst): Same.
839 * tree.c (build_ctor_subob_ref): Handle flexible array members.
840 * typeck2.c (digest_init_r): Revert changes introduced in r231665.
841 (process_init_constructor_array): Same.
842 (process_init_constructor_record): Same.
844 2016-02-03 Patrick Palka <ppalka@gcc.gnu.org>
847 * pt.c (try_one_overload): Handle comparing argument packs so
848 that there is no conflict if we deduced more arguments of an
849 argument pack than were explicitly specified.
851 2016-01-31 Jakub Jelinek <jakub@redhat.com>
852 Jason Merrill <jason@redhat.com>
855 * tree.c (strip_typedefs) [FUNCTION_TYPE]: Avoid building a new
856 function type if nothing is changing.
858 2016-01-31 Jason Merrill <jason@redhat.com>
861 * pt.c (partial_specialization_p, impartial_args): New.
862 (instantiate_decl): Call impartial_args.
864 * mangle.c (maybe_check_abi_tags): New.
865 (write_guarded_var_name): Call it.
866 (mangle_ref_init_variable): Call check_abi_tags.
868 * pt.c (lookup_template_class_1): Don't share TYPE_ATTRIBUTES
869 between template and instantiation.
871 2016-01-29 Jakub Jelinek <jakub@redhat.com>
874 * decl.c (wrapup_globals_for_namespace): Warn about unused static
875 function declarations.
877 2016-01-29 Marek Polacek <polacek@redhat.com>
881 * constexpr.c (cxx_eval_array_reference): Give the "array subscript
882 out of bound" error earlier.
883 * init.c (build_vec_init): Change NE_EXPR into GT_EXPR. Update the
886 2016-01-29 Patrick Palka <ppalka@gcc.gnu.org>
888 * name-lookup.c (begin_scope): After reusing a cp_binding_level
889 structure, update free_binding_level before the structure's
890 level_chain field gets cleared, not after.
892 2016-01-28 Jason Merrill <jason@redhat.com>
895 * search.c (dfs_walk_once, dfs_walk_once_r)
896 (dfs_walk_once_accessible_r, dfs_walk_once_accessible): Use
897 hash_set instead of BINFO_MARKED.
898 (dfs_unmark_r): Remove.
900 2016-01-28 Patrick Palka <ppalka@gcc.gnu.org>
903 * parser.c (LEXER_DEBUGGING_ENABLED_P): New macro.
904 (cp_lexer_debugging_p): Use it.
905 (cp_lexer_start_debugging): Likewise.
906 (cp_lexer_stop_debugging): Likewise.
908 2016-01-27 Marek Polacek <polacek@redhat.com>
911 * typeck.c (cp_build_binary_op): Promote operand to unsigned, if
912 needed. Add -Wsign-compare warning.
914 2016-01-27 Ryan Burn <contact@rnburn.com>
917 * cp-gimplify.c (cilk_cp_gimplify_call_params_in_spawned_fn): Removed
918 superfluous post_p argument in call to
919 cilk_gimplify_call_params_in_spawned_fn.
921 2016-01-27 Marek Polacek <polacek@redhat.com>
924 * constexpr.c (cxx_eval_constant_expression): Handle PTRMEM_CSTs
925 wrapped in NOP_EXPRs.
927 2016-01-27 Martin Sebor <msebor@redhat.com>
930 * mangle.c (mangle_decl): Reference the correct (saved) version
931 of the ABI in -Wabi diagnostics.
933 2016-01-27 Marek Polacek <polacek@redhat.com>
936 * constexpr.c (cxx_eval_array_reference): Evaluate the number of
937 elements of the array.
939 2016-01-26 Jason Merrill <jason@redhat.com>
942 * constexpr.c (register_constexpr_fundef): Keep the un-massaged body.
943 (cxx_eval_call_expression): Don't look through clones.
944 * optimize.c (maybe_clone_body): Clear DECL_SAVED_TREE of the alias.
945 * semantics.c (expand_or_defer_fn_1): Keep DECL_SAVED_TREE of
946 maybe-in-charge *tor.
948 2016-01-26 Jason Merrill <jason@redhat.com>
951 * constexpr.c (cxx_eval_bare_aggregate): Update TREE_CONSTANT
952 and TREE_SIDE_EFFECTS.
953 (cxx_eval_constant_expression) [CONSTRUCTOR]: Call
954 verify_constructor_flags.
956 2016-01-26 Jakub Jelinek <jakub@redhat.com>
959 * cp-gimplify.c (cp_fold): If some operand folds to error_mark_node,
960 return error_mark_node instead of building trees with error_mark_node
963 2016-01-26 David Malcolm <dmalcolm@redhat.com>
966 * error.c (print_instantiation_partial_context_line): Add missing
967 newlines from output for the t == NULL case.
968 (print_instantiation_partial_context): Remove call to pp_newline.
970 2016-01-24 Patrick Palka <ppalka@gcc.gnu.org>
973 2016-01-18 Patrick Palka <ppalka@gcc.gnu.org>
978 * decl.c (grokdeclarator): Don't decay array parameter type to
979 a pointer type if it's dependent.
980 (grokparms): Invoke strip_top_quals instead of directly invoking
981 cp_build_qualified_type.
982 * pt.c (decay_dependent_array_parm_type): New static function.
983 (type_unification_real): Call decay_dependent_array_parm_type
984 to decay a dependent array parameter type to its corresponding
985 pointer type before unification.
986 (more_specialized_fn): Likewise.
987 (get_bindings): Likewise.
988 * tree.c (cp_build_qualified_type): Trivial typofix in
991 2016-01-23 Martin Sebor <msebor@redhat.com>
995 * decl2.c (is_late_template_attribute): Handle dependent argument
996 to attribute align and attribute vector_size.
998 2016-01-21 Jason Merrill <jason@redhat.com>
1001 * lambda.c (lambda_capture_field_type): Handle 'this' specially
1002 for init-capture, too.
1005 * decl.c (type_is_deprecated): Don't look into a typedef.
1009 * decl.c (copy_type_enum): Respect TYPE_USER_ALIGN.
1012 * decl.c (start_enum): Add attributes parameter.
1013 * parser.c (cp_parser_enum_specifier): Pass it.
1014 * pt.c (lookup_template_class_1): Pass it.
1015 * cp-tree.h: Adjust.
1017 2016-01-19 Jason Merrill <jason@redhat.com>
1020 * pt.c (convert_template_argument): Handle VAR_DECL properly.
1022 2016-01-19 Marek Polacek <polacek@redhat.com>
1025 * constexpr.c (clear_cv_cache): New.
1026 * cp-gimplify.c (clear_fold_cache): New.
1027 * cp-tree.h (clear_cv_cache, clear_fold_cache): Declare.
1028 * decl.c (finish_enum_value_list): Call them.
1031 * pt.c (tsubst_copy): Mark elements in expanded vector as used.
1033 2016-01-18 Patrick Palka <ppalka@gcc.gnu.org>
1038 * decl.c (grokdeclarator): Don't decay array parameter type to
1039 a pointer type if it's dependent.
1040 (grokparms): Invoke strip_top_quals instead of directly invoking
1041 cp_build_qualified_type.
1042 * pt.c (decay_dependent_array_parm_type): New static function.
1043 (type_unification_real): Call decay_dependent_array_parm_type
1044 to decay a dependent array parameter type to its corresponding
1045 pointer type before unification.
1046 (more_specialized_fn): Likewise.
1047 (get_bindings): Likewise.
1048 * tree.c (cp_build_qualified_type): Trivial typofix in
1051 2016-01-18 Jason Merrill <jason@redhat.com>
1053 * cp-gimplify.c (cp_fold) [CONSTRUCTOR]: Don't clobber the input.
1055 * cp-gimplify.c (cp_fold): Remove unnecessary special cases.
1058 * cp-gimplify.c (cp_fold) [COND_EXPR]: Simplify. Do fold COND_EXPR.
1059 (contains_label_1, contains_label_p): Remove.
1061 2016-01-16 Patrick Palka <ppalka@gcc.gnu.org>
1064 * pt.c (type_dependent_expression_p): For a function template
1065 specialization, a type is dependent iff any of its template
1068 2016-01-16 Patrick Palka <ppalka@gcc.gnu.org>
1070 * cp-array-notation.c (cp_expand_cond_array_notations): Return
1071 error_mark_node only if find_rank failed, not if it was
1074 2016-01-16 Patrick Palka <ppalka@gcc.gnu.org>
1077 * tree.c (build_min_non_dep_call_vec): Don't retain the
1078 KOENIG_LOOKUP_P flag of the non-dependent expression that's
1080 (build_min_non_dep_op_overload): Instead, do it here.
1082 2016-01-15 Jakub Jelinek <jakub@redhat.com>
1085 * parser.h (cp_token): Remove pragma_kind field. Add comment
1086 with number of unused bits.
1087 * parser.c (eof_token): Remove pragma_kind field initializer.
1088 (cp_lexer_get_preprocessor_token): Don't set pragma_kind
1089 field, don't clear CPP_PRAGMA u.value.
1090 (cp_parser_pragma_kind): New function.
1091 (cp_parser_omp_sections_scope, cp_parser_oacc_kernels_parallel,
1092 cp_parser_omp_construct, cp_parser_initial_pragma,
1093 cp_parser_pragma): Use cp_parser_pragma_kind instead of accessing
1096 2016-01-15 Jason Merrill <jason@redhat.com>
1099 * call.c (build_cxx_call): Use fold_non_dependent_expr.
1101 * typeck2.c (cxx_incomplete_type_diagnostic): Use the location of
1105 * typeck.c (decay_conversion): Don't call mark_rvalue_use for
1106 array/function-to-pointer conversion. Call
1107 complete_type_or_maybe_complain for lvalue-to-rvalue conversion.
1108 * call.c (convert_like_real): Print call context if
1109 decay_conversion errors.
1111 2016-01-14 Tom de Vries <tom@codesourcery.com>
1113 PR tree-optimization/68773
1114 * parser.c (cp_parser_oacc_declare, cp_parser_omp_declare_target): Don't
1117 2016-01-14 Jason Merrill <jason@redhat.com>
1120 * constexpr.c (find_array_ctor_elt): Handle splitting RANGE_EXPR.
1122 2016-01-12 Marek Polacek <polacek@redhat.com>
1125 * constexpr.c (cxx_eval_check_shift_p): Use permerror rather than
1126 error_at and adjust the return value.
1128 2016-01-12 Jakub Jelinek <jakub@redhat.com>
1132 * cp-gimplify.c (cp_gimplify_expr) <case INIT_EXPR>: Don't return
1133 GS_ERROR whenever seen_error (), only if *expr_p contains
1134 cilk spawn stmt, but cilk_detect_spawn_and_unwrap failed.
1138 * pt.c (tsubst_decl): If not local_p, clear DECL_TEMPLATE_INFO.
1140 2016-01-11 Jason Merrill <jason@redhat.com>
1143 * method.c (walk_field_subobs): Add dtor_from_ctor parm.
1144 (process_subob_fn): Likewise. Don't consider triviality if true.
1145 (synthesize_method_walk): Pass it.
1147 2016-01-11 David Malcolm <dmalcolm@redhat.com>
1150 * parser.c (cp_parser_postfix_expression): Initialize
1151 close_paren_loc to UNKNOWN_LOCATION; only use it if
1152 it has been written to by
1153 cp_parser_parenthesized_expression_list.
1154 (cp_parser_parenthesized_expression_list): Document the behavior
1155 with respect to the CLOSE_PAREN_LOC param.
1157 2016-01-11 Jakub Jelinek <jakub@redhat.com>
1160 * cp-gimplify.c (cp_fold): If COMPOUND_EXPR or MODIFY_EXPR
1161 folded operands have side-effects, but folding changed any of them,
1162 build a new tree with the folded operands instead of returning the
1165 2016-01-09 Marek Polacek <polacek@redhat.com>
1168 * decl2.c (comdat_linkage): Only set DECL_COMDAT if TREE_PUBLIC is set.
1170 2016-01-09 Jakub Jelinek <jakub@redhat.com>
1173 * class.c (layout_class_type): Use copy_node to copy FIELD_DECLs.
1175 2016-01-08 Jason Merrill <jason@redhat.com>
1178 * constexpr.c (cxx_fold_indirect_ref): Handle array type differing
1181 2016-01-08 Marek Polacek <polacek@redhat.com>
1184 * constexpr.c (cxx_eval_constant_expression): Handle NULL initializer.
1186 2016-01-08 Jason Merrill <jason@redhat.com>
1188 * constexpr.c (cxx_eval_call_expression): Remove convert_to_void
1193 * cvt.c (convert_to_void): Don't strip a TARGET_EXPR of
1194 TREE_ADDRESSABLE type.
1198 * call.c (unsafe_copy_elision_p): Look through COMPOUND_EXPR.
1200 2016-01-05 Nathan Sidwell <nathan@acm.org>
1203 * pt.c (build_non_dependent_expr): Don't try a checking fold when
1206 2016-01-04 Jakub Jelinek <jakub@redhat.com>
1208 Update copyright years.
1210 Copyright (C) 2016 Free Software Foundation, Inc.
1212 Copying and distribution of this file, with or without modification,
1213 are permitted in any medium without royalty provided the copyright
1214 notice and this notice are preserved.