1 2016-09-20 Jakub Jelinek <jakub@redhat.com>
4 * parser.c (cp_parser_template_declaration_after_parameter): For 2
5 argument operator"" template set ok to false for
6 parm == error_mark_node.
9 * parser.c (cp_parser_std_attribute_list): Reject ... without
12 2016-09-19 Bernd Edlinger <bernd.edlinger@hotmail.de>
15 * cvt.c (cp_convert_and_check): Suppress Wint-in-bool-context here.
17 2016-09-16 Patrick Palka <ppalka@gcc.gnu.org>
20 * parser.c (cp_parser_class_head): When
21 processing_template_parmlist, don't assume that the
22 class-head may start an explicit specialization.
24 2016-09-16 Jakub Jelinek <jakub@redhat.com>
27 * error.c (dump_simple_decl): Only check DECL_DECLARED_CONCEPT_P
28 if DECL_LANG_SPECIFIC is non-NULL. Fix up formatting.
31 * constexpr.c (cxx_eval_constant_expression) <case PARM_DECL>: Only
32 call is_really_empty_class on complete types.
35 * class.c (check_bases): Set CLASSTYPE_HAS_MUTABLE if any
36 TYPE_HAS_MUTABLE_P for any bases.
38 2016-09-16 Jason Merrill <jason@redhat.com>
40 * class.c (check_bases, set_one_vmethod_tm_attributes): Use
42 * decl.c (cxx_init_decl_processing): Use pow2p_hwi.
43 * parser.c (cp_parser_cilk_simd_vectorlength): Use pow2p_hwi.
45 2016-09-14 Jakub Jelinek <jakub@redhat.com>
48 * name-lookup.c (consider_binding_level): Look through TREE_LIST
51 2016-09-14 Marek Polacek <polacek@redhat.com>
53 * typeck.c (cp_build_unary_op): Diagnose incrementing boolean
54 expressions. Tweak an error message.
56 2016-09-14 Marek Polacek <polacek@redhat.com>
58 * cp-tree.h (cp_build_unary_op): Change nonconvert parameter type to
60 * decl2.c (one_static_initialization_or_destruction): Use true instead
62 * init.c (build_vec_init): Use false instead of 0.
63 * pt.c (tsubst_copy_and_build): Likewise.
64 * semantics.c (simplify_loop_decl_cond): Likewise.
65 * typeck.c (rationalize_conditional_expr): Likewise.
66 (cp_build_binary_op): Use true instead of 1.
67 (cp_build_unary_op): Change nonconvert parameter type to bool. Use true
69 (build_unary_op): Change nonconvert parameter type to bool.
70 (unary_complex_lvalue): Use false instead of 0.
72 2016-09-13 Jakub Jelinek <jakub@redhat.com>
74 Implement P0028R4, C++17 using attribute namespaces without repetition
75 * parser.c (cp_parser_std_attribute): Add ATTR_NS argument. Diagnose
76 non-NULL ATTR_NS with scoped attribute token. Handle non-NULL
77 ATTR_NS with non-scoped attribute tokens. Allow named ops in
79 (cp_parser_std_attribute_list): Add ATTR_NS argument, pass it down
80 to cp_parser_std_attribute calls.
81 (cp_parser_std_attribute_spec): Parse optional C++17
82 attribute-using-prefix, adjust grammar in function comment.
85 * constexpr.c (cxx_fold_pointer_plus_expression): New function.
86 (cxx_eval_binary_expression): Use it for POINTER_PLUS_EXPR.
87 (cxx_eval_pointer_plus_expression): Remove.
88 (cxx_eval_constant_expression) <case POINTER_PLUS_EXPR>: Don't
89 call cxx_eval_pointer_plus_expression.
91 2016-09-13 David Malcolm <dmalcolm@redhat.com>
93 * parser.c (cp_parser_class_specifier_1): Update for renaming of
94 add_fixit_insert to add_fixit_insert_before.
95 (cp_parser_class_head): Likewise.
97 2016-09-12 Bernd Edlinger <bernd.edlinger@hotmail.de>
100 * call.c (build_conditional_expr_1): Call warn_for_omitted_condop.
101 * class.c (instantiate_type): Look through the SAVE_EXPR.
103 2016-09-09 Jason Merrill <jason@redhat.com>
105 Implement P0035R4, C++17 new of over-aligned types.
106 * cp-tree.h (enum cp_tree_index): Add CPTI_ALIGN_TYPE.
107 (align_type_node): New macro.
108 * call.c (build_operator_new_call): Handle C++17 aligned new.
109 (second_parm_is_size_t, build_op_delete_call): Likewise.
110 (non_placement_deallocation_fn_p): Likewise. Rename to
111 usual_deallocation_fn_p.
112 (aligned_allocation_fn_p, aligned_deallocation_fn_p): New.
113 * decl.c (cxx_init_decl_processing): Add aligned new support.
114 * init.c (type_has_new_extended_alignment): New.
115 (build_new_1): Handle aligned new.
116 * tree.c (vec_copy_and_insert): New.
118 2016-09-02 Jakub Jelinek <jakub@redhat.com>
121 * decl2.c (do_static_initialization_or_destruction): Only
122 call asan_dynamic_init_call if INITP is true.
124 2016-09-01 Martin Sebor <msebor@redhat.com>
126 * mangle.c: Increase buffer size to guarantee it fits the output
127 of the formatted function regardless of its arguments.
129 2016-09-01 Marek Polacek <polacek@redhat.com>
132 * error.c (dump_type): Fix falls through comment.
133 (dump_decl): Likewise.
134 (dump_expr): Likewise.
136 2016-08-30 David Malcolm <dmalcolm@redhat.com>
138 * parser.c (cp_parser_enclosed_template_argument_list): Add fix-it
139 hint to ">>" within nested template argument list error.
141 2016-08-30 David Malcolm <dmalcolm@redhat.com>
143 * name-lookup.c (suggest_alternatives_for): Use add_fixit_replace
144 rather than add_fixit_misspelled_id.
145 * parser.c (cp_parser_diagnose_invalid_type_name): Likewise.
147 2016-08-29 Jason Merrill <jason@redhat.com>
150 * mangle.c (maybe_check_abi_tags): Add version parm, handle thunks.
151 (mangle_thunk): Add thunk parameter.
152 * method.c (finish_thunk): Pass it.
153 * cp-tree.h: Declare it.
155 2016-08-15 Jason Merrill <jason@redhat.com>
157 Avoid calling a trivial default constructor.
158 * class.c (default_ctor_p): New.
159 (in_class_defaulted_default_constructor): Use it.
160 (type_has_non_user_provided_default_constructor): Use it.
161 * call.c (build_over_call): Handle trivial default constructor.
162 * cp-tree.h: Declare default_ctor_p.
165 * pt.c (do_type_instantiation): Don't mess with non-user-provided
168 2016-08-25 Marek Polacek <polacek@redhat.com>
170 * parser.c (cp_parser_binary_expression): Pass LHS to
171 warn_logical_not_parentheses.
173 2016-08-18 Marek Polacek <polacek@redhat.com>
176 * call.c (add_builtin_candidate): Add gcc_fallthrough.
177 * cxx-pretty-print.c (pp_cxx_unqualified_id): Likewise.
178 * parser.c (cp_parser_skip_to_end_of_statement): Likewise.
179 (cp_parser_cache_defarg): Likewise.
181 2016-08-12 Marek Polacek <polacek@redhat.com>
184 * call.c (add_builtin_candidate): Add FALLTHRU.
185 (build_integral_nontype_arg_conv): Adjust fall through comment.
186 (build_new_op_1): Add FALLTHRU.
187 (convert_like_real): Adjust fall through comment.
188 * class.c (fixed_type_or_null): Likewise.
189 * constexpr.c (cxx_eval_constant_expression): Likewise.
190 (potential_constant_expression_1): Likewise. Add FALLTHRU.
191 * cp-gimplify.c (cp_gimplify_expr): Adjust fall through comment.
192 (cp_fold): Add FALLTHRU.
193 * cvt.c (build_expr_type_conversion): Adjust fall through comment.
194 * cxx-pretty-print.c (pp_cxx_unqualified_id): Add FALLTHRU.
195 (pp_cxx_qualified_id): Likewise.
196 (cxx_pretty_printer::constant): Adjust fall through comment.
197 (cxx_pretty_printer::primary_expression): Add FALLTHRU.
198 (pp_cxx_pm_expression): Adjust fall through comment.
199 (cxx_pretty_printer::expression): Add FALLTHRU.
200 (cxx_pretty_printer::declaration_specifiers): Reformat code.
201 (pp_cxx_type_specifier_seq): Adjust fall through comment.
202 (pp_cxx_ptr_operator): Likewise. Add FALLTHRU.
203 * error.c (dump_type): Adjust fall through comment.
204 (dump_decl): Likewise.
205 * mangle.c (write_type): Likewise.
206 * method.c (synthesized_method_walk): Add FALLTHRU.
207 * name-lookup.c (arg_assoc_type): Likewise.
208 * parser.c (cp_lexer_print_token): Adjust fall through comment.
209 (cp_parser_primary_expression): Add FALLTHRU.
210 (cp_parser_operator): Likewise.
211 * pt.c (find_parameter_packs_r): Likewise.
212 (tsubst_aggr_type): Adjust fall through comment.
213 * semantics.c (finish_omp_clauses): Add FALLTHRU.
214 * tree.c (lvalue_kind): Likewise.
216 2016-08-12 Alexandre Oliva <aoliva@redhat.com>
219 * cp-objcp-common.c (cp_function_decl_defaulted): New.
220 (cp_function_decl_explicit_p): Const_tree-ify.
221 (cp_function_decl_deleted_p): Likewise.
222 * cp-objcp-common.h (cp_function_decl_defaulted): Declare.
223 (cp_function_decl_explicit_p): Const_tree-ify.
224 (cp_function_decl_deleted_p): Likewise.
225 (LANG_HOOKS_FUNCTION_DECL_DEFAULTED): Redefine.
227 2016-08-11 Jakub Jelinek <jakub@redhat.com>
230 * constexpr.c (label_matches): Handle case range expressions.
232 2016-08-11 Jason Merrill <jason@redhat.com>
235 * logic.cc (non_atomic_constraint_p): Handle EXPR_PACK_EXPANSION.
237 2016-08-10 Jason Merrill <jason@redhat.com>
239 Implement C++17 constexpr if.
240 * cp-tree.h (IF_STMT_CONSTEXPR_P): New.
241 * name-lookup.c (push_to_top_level, pop_from_top_level_1): Handle it.
242 * parser.h (struct cp_parser): Add in_discarded_stmt field.
243 * parser.c (cp_parser_selection_statement): Handle 'if constexpr'.
244 (cp_parser_jump_statement): Avoid deducing from a discarded return.
245 * pt.c (tsubst_expr): Only instantiate taken branch of constexpr if.
246 * semantics.c (begin_if_stmt): Set the binding level this_entity.
247 (finish_if_stmt_cond): Require the condition of a
248 constexpr if to be constant.
249 * decl.c (level_for_constexpr_if): New.
250 (named_label_entry): Add in_constexpr_if field.
251 (poplevel_named_label_1): Set it.
252 (check_goto): Check it.
253 (check_previous_goto_1): Check level_for_constexpr_if.
255 2016-08-09 Jason Merrill <jason@redhat.com>
258 * decl2.c (any_dependent_type_attributes_p): New.
259 * pt.c (dependent_type_p_r, type_dependent_expression_p): Check it.
260 * semantics.c (finish_id_expression): Check it.
261 * typeck.c (finish_class_member_access_expr): Check it.
264 * class.c (check_abi_tags): Don't duplicate tags for conversion ops.
266 Adjust mangling of ABI tags on class template member functions.
267 * class.c (missing_abi_tags): New.
268 (check_abi_tags): Don't check template. Add just_checking mode.
269 * mangle.c (abi_flag_at_least, any_abi_below, equal_abi_tags): New.
270 (sorted_abi_tags): Split out from write_abi_tags.
271 (struct releasing_vec): New.
272 (write_unqualified_name): Only look for the primary
273 template for types. Implement backward compatibility.
276 * constexpr.c (cxx_eval_constant_expression): Check
277 COMPLETE_TYPE_P before calling is_really_empty_class.
278 * class.c (is_really_empty_class): Don't call complete_type.
281 * typeck.c (cp_build_addr_expr_1): Remove special *this handling.
283 2016-08-09 Jakub Jelinek <jakub@redhat.com>
286 * rtti.c (get_pseudo_ti_index): Return TK_CLASS_TYPE for
287 builtin aggregate types without TYPE_BINFO.
289 2016-08-08 Jason Merrill <jason@redhat.com>
291 Implement C++17 constexpr lambda.
292 * class.c (finalize_literal_type_property): Handle lambdas.
293 * constexpr.c (is_valid_constexpr_fn): Likewise. No longer static.
294 (explain_invalid_constexpr_fn, cxx_eval_call_expression): Handle
296 (cxx_eval_constant_expression): Handle capture proxy.
297 (var_in_constexpr_fn): Don't check for C++14.
298 (var_in_maybe_constexpr_fn): New.
299 (potential_constant_expression_1): Use it. Check DECL_EXPR for
300 declarations not allowed in constexpr function. Handle
301 STATIC_ASSERT, RANGE_FOR_STMT.
302 * decl.c (make_rtl_for_nonlocal_decl): Use var_in_maybe_constexpr_fn.
303 (finish_function): Set DECL_DECLARED_CONSTEXPR_P on lambda members.
304 * lambda.c (begin_lambda_type): Set CLASSTYPE_LITERAL_P.
305 (maybe_add_lambda_conv_op): Clear thunk CALL_EXPR location.
306 (lambda_static_thunk_p): New.
307 * parser.c (cp_keyword_starts_decl_specifier_p): Add RID_CONSTEXPR.
308 (CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR): New enumerator.
309 (cp_parser_decl_specifier_seq): Handle it.
310 (cp_parser_lambda_declarator_opt): Use cp_parser_decl_specifier_seq.
311 * pt.c (instantiate_class_template_1): Set CLASSTYPE_LITERAL_P.
312 (tsubst_copy_and_build) [CALL_EXPR]: Propagate CALL_FROM_THUNK_P.
313 * error.c (dump_function_decl): Check TFF_NO_TEMPLATE_BINDINGS.
314 (dump_expr) [FUNCTION_DECL]: Pass it.
316 2016-08-08 Jason Merrill <jason@redhat.com>
319 * class.c (is_really_empty_class): Call complete_type.
320 * constexpr.c (cxx_eval_constant_expression): Check
321 is_really_empty_class.
322 (potential_constant_expression_1): Likewise. Check for error type.
324 2016-08-08 Jakub Jelinek <jakub@redhat.com>
327 * parser.c: Include tree-iterator.h.
328 (cp_parser_omp_for_loop_init): Move lambda DECL_EXPRs from init
330 (cp_parser_omp_for_loop): Handle non-STATEMENT_LIST FOR_BLOCK
333 2016-08-06 Jonathan Wakely <jwakely@redhat.com>
335 * call.c (convert_like_real): Harmonize diagnostics for invalid
338 2016-08-05 Martin Sebor <msebor@redhat.com>
340 * constexpr.c (cxx_eval_store_expression): Remove hyphen from
341 the spelling of "constant-expression" in diagnostic messages
343 (cxx_eval_constant_expression): Same.
344 (cxx_eval_outermost_constant_expr): Same.
345 (potential_constant_expression_1): Same.
347 2016-08-05 Nathan Sidwell <nathan@acm.org>
350 * pt.c (unify): TRAIT_EXPR is an expr.
352 2016-08-04 Paolo Carlini <paolo.carlini@oracle.com>
355 * lambda.c (add_capture): Check lambda_capture_field_type return
356 value for error_mark_node.
358 2016-08-04 Patrick Palka <ppalka@gcc.gnu.org>
361 * pt.c (tsubst_qualified_id): Return error_mark_node if
362 template_args is error_mark_node.
364 2016-08-04 Jason Merrill <jason@redhat.com>
367 * pt.c (tsubst_pack_expansion): Pull a single pack expansion out
370 * cp-tree.h (TYPE_UNNAMED_P): Rename from TYPE_ANONYMOUS_P.
371 (TYPE_WAS_UNNAMED): Rename from TYPE_WAS_ANONYMOUS.
372 * class.c, decl.c, decl2.c, error.c, lambda.c, mangle.c,
373 name-lookup.c, parser.c, pt.c, semantics.c, tree.c: Adjust.
376 * typeck.c (finish_class_member_access_expr): Avoid stripping
377 SCOPE_REF to dependent base.
379 2016-08-04 Thomas Schwinge <thomas@codesourcery.com>
381 * parser.c (cp_ensure_no_oacc_routine): Improve diagnostics.
382 (cp_parser_late_parsing_cilk_simd_fn_info): Fix diagnostics.
383 (cp_parser_late_parsing_oacc_routine, cp_finalize_oacc_routine):
384 Simplify code, and improve diagnostics.
385 (cp_parser_oacc_routine): Likewise. Move pragma context
387 (cp_parser_pragma): ... here.
389 * parser.h (struct cp_omp_declare_simd_data): New.
390 (struct cp_parser): Use it for oacc_routine member.
391 * parser.c (cp_ensure_no_oacc_routine, cp_parser_oacc_routine)
392 (cp_parser_late_parsing_oacc_routine, cp_finalize_oacc_routine):
393 Use it. Simplify code.
394 (cp_parser_new): Initialize all members pointing to special
395 parsing data structures.
396 (cp_parser_cilk_simd_fn_vector_attrs): Initialize
397 parser->cilk_simd_fn_info->clauses.
398 (cp_parser_omp_declare_simd): Initialize
399 parser->omp_declare_simd->clauses.
400 (cp_parser_late_parsing_omp_declare_simd): Simplify code.
402 2016-08-04 Marek Polacek <polacek@redhat.com>
405 * constexpr.c (check_constexpr_ctor_body_1): Allow typedef
408 2016-08-01 Jason Merrill <jason@redhat.com>
410 * mangle.c (mangle_decl): Warn about mangled name change even if
413 * mangle.c (get_abi_tags): New.
414 (find_substitution, write_unqualified_name, write_abi_tags)
415 (maybe_check_abi_tags): Use it.
417 * mangle.c (mangle_decl): Fix mangled name change warning.
420 * constexpr.c (cxx_eval_pointer_plus_expression): Check constancy
422 * cp-gimplify.c (cp_fully_fold): Only maybe_constant_value in
425 2016-07-30 Martin Sebor <msebor@redhat.com>
429 * constexpr.c (cxx_eval_binary_expression): Reject invalid expressions
430 involving null pointers.
431 (cxx_eval_component_reference): Reject null pointer dereferences.
432 (cxx_eval_indirect_ref): Reject indirecting through null pointers.
433 (cxx_eval_constant_expression): Reject invalid expressions involving
436 2016-07-29 Marek Polacek <polacek@redhat.com>
439 * semantics.c (maybe_convert_cond): Use the location of COND for the
442 2016-07-29 Jason Merrill <jason@redhat.com>
444 * decl.c (build_enumerator): Tweak diagnostic.
447 * init.c (expand_aggr_init_1): Only handle value-init of bases.
448 * constexpr.c (build_data_member_initialization): Handle multiple
449 initializers for the same field.
451 2016-07-28 Paolo Carlini <paolo.carlini@oracle.com>
454 * decl.c (build_enumerator): Check the type of the enumerator before
455 calling cxx_constant_value.
457 2016-07-27 Jason Merrill <jason@redhat.com>
460 * pt.c (get_partial_spec_bindings): Replace tparms and spec_args
461 parameters with spec_tmpl. Call push_tinst_level.
462 (most_specialized_partial_spec): Adjust.
463 (more_specialized_partial_spec): Adjust.
465 2016-07-25 Jason Merrill <jason@redhat.com>
468 * cp-gimplify.c (genericize_cp_loop): Revert location change.
471 * lambda.c (add_capture): Leave a pack expansion in a TREE_LIST.
472 (build_lambda_object): Call build_x_compound_expr_from_list.
473 * pt.c (tsubst) [DECLTYPE_TYPE]: Likewise.
477 * pt.c (coerce_template_parameter_pack): Fix logic for
481 * constexpr.c (cxx_eval_loop_expr): Count iterations.
482 * cp-gimplify.c (genericize_cp_loop): Use start_locus even for
486 * constexpr.c (cxx_eval_array_reference): Handle looking for the
487 value of an element we're currently modifying.
489 2016-07-24 Jason Merrill <jason@redhat.com>
492 * pt.c (resolve_typename_type): Try to avoid calling
493 currently_open_class.
495 2016-07-23 Jason Merrill <jason@redhat.com>
498 * call.c (add_list_candidates): Handle VTT parm.
499 (build_new_method_call_1): Likewise.
503 * init.c (expand_aggr_init_1): Handle list-initialization from {}.
506 * class.c (walk_subobject_offsets): Handle 0-length array.
509 * pt.c (tsubst): Also substitute into the template of a
510 BOUND_TEMPLATE_TEMPLATE_PARM.
513 * pt.c (lookup_template_class_1): Handle getting template from tsubst.
516 * decl.c (reshape_init_r): Check complain for missing braces warning.
518 2016-07-22 Jason Merrill <jason@redhat.com>
521 * call.c (convert_like_real): Use lvalue_kind.
525 * pt.c (tsubst_baselink): Call
526 adjust_result_of_qualified_name_lookup for unqualified
529 2016-07-21 Jason Merrill <jason@redhat.com>
532 * semantics.c (apply_deduced_return_type): Call
533 complete_type_or_else before building the new RESULT_DECL.
536 * decl2.c (maybe_instantiate_decl): Split out from mark_used.
537 (decl_constant_var_p): Use it instead.
540 * pt.c (instantiate_decl): Fix pattern_defined for namespace scope
544 * call.c (unsafe_copy_elision_p): It's OK to elide when
545 initializing an unknown object.
547 * call.c (build_over_call): Check unsafe_copy_elision_p even for
548 trivial constructors.
549 * method.c (do_build_copy_constructor): Don't copy tail padding
550 even in a trivial constructor.
552 2016-07-21 Jakub Jelinek <jakub@redhat.com>
555 * constexpr.c (potential_constant_expression_1) <case GOTO_EXPR>:
556 Replace assert with test, return false if the goto isn't break
557 or continue. Formatting fix.
559 2016-07-21 Richard Biener <rguenther@suse.de>
561 * vtable-class-hierarchy.c (vtv_generate_init_routine): Set
564 2016-07-21 Jakub Jelinek <jakub@redhat.com>
567 * cp-gimplify.c (cp_genericize): For nested cp_genericize calls
568 save/restore bc_label array.
570 2016-07-21 Jason Merrill <jason@redhat.com>
573 * parser.c (cp_parser_lambda_expression): Unset OK if there was an
574 error parsing the lambda-declarator.
577 * constexpr.c (cxx_eval_binary_expression): Handle comparison
578 between lowered and unlowered PTRMEM_CST.
581 * typeck.c (cp_truthvalue_conversion): Compare pointers to nullptr.
582 Don't set c_inhibit_evaluation_warnings.
585 * cp-gimplify.c (cp_fully_fold): First call maybe_constant_value.
587 2016-07-21 Andrew Sutton <andrew.n.sutton@gmail.com>
588 Jason Merrill <jason@redhat.com>
590 Improving concepts performance and diagnostics.
594 * cp-tree.def (CHECK_CONSTR): New.
595 * cp-tree.h (CHECK_CONSTR_CONCEPT): New.
596 (CHECK_CONSTR_ARGS): New.
597 * constraint.cc (make_predicate_constraint): Remove in favor of
598 normalize_expression.
599 (resolve_constraint_check): Actually return error_mark_node when
601 (resolve_variable_concept_check): Perform coercion as if processing
602 a template. Also return errors on resolution failure.
603 (lift_*): Remove all of these functions. Don't unnecessarily inline
605 (learn_*): Add facilities to memoize implications for subsumption
606 during normalization.
607 (expanding_concept): New.
608 (expand_concept): New. Return the inlined and normalized definition
609 of a concept when needed.
610 (transform_*, xform_*): Rename to normalize_* to better reflect the
611 responsibility of those functions.
612 (normalize_template_id_expression): Check for non-boolean operands
613 when possible. Generate check constraints instead of normal variable
615 (normalize_call_expression): Report errors when resolution fails.
616 (check_for_logical_overloads): Rewrite this check to more accurately
618 (normalize_atom): Check for overloaded calls and invalid types before
619 determining if the expression refers to a concept.
620 (build_constraints): Don't cache normalized constraints or decomposed
622 (finish_shorthand_constraint): Return a normalized expression instead
623 of a predicate constraint.
624 (finish_template_introduction): Same.
625 (placeholder_extract_concept_and_args): Rewrite this since we only
626 ever get check constraints here.
627 (equivalent_placeholder_constraints): Rewrite in terms of check
628 constraints, and handle error_mark_nodes correctly.
629 (tsubst_check_constraint, tsubst_expr_constr, tsubst_type_constr)
630 (tsubst_implicit_conversion_constr)
631 (tsubst_argument_deduction_constr, tsubst_exception_constr)
632 (tsubst_parameterized_constraint, tsubst_constraint): New.
633 (tsbust_conjunection): Replace with tsubst_logical_operator and
634 actually generate the right kind of constraint.
635 (tsubst_requirement_body): Reverse the order of substituted arguments
636 so that they appear in the order written (helps diagnostics).
637 (satisfy_check_constraint): New.
638 (satisfy_conjunction): Simplify.
639 (satisfy_disjunction): Same.
640 (satisfy_constraint_1): Handle check constraints.
641 (eval_constr): New (private) global state.
642 (evaluating_constraints_sentinel): New. Manages eval_constr.
643 (satisfy_constraint): Add timing variables.
644 (satisfy_associated_constraints): Add hooks for memoization.
645 (evaluate_function_concept): Build a check constraint instead of
646 normalizing its definition.
647 (evaluate_variable_concept): Same.
648 (evaluate_constraint_expression): Normalize, but in the current
649 declaration processing context.
650 (evaluating_constraints_p): New.
651 (elide_constraint_failure_p): Actually emit constraint_thresh errors.
652 (diagnose_*): Remove artificial indentation. Add a new parameter to
653 each that tracks the current (complete) constraint prior to any
655 (diagnose_expression): Removed.
656 (diagnose_call_expression): Same.
657 (diagnose_template_id): Same.
658 (diagnose_template_id): New.
659 (diagnose_logical_constraint): New.
660 (diagnose_expression_constraint): Show the original expression.
661 (diagnose_type_constraint): Show the original type.
662 (diagnose_implicit_conversion_constraint): Be specific about
663 failures, don't re-diagnose a known-to-be-failed substitutions,
664 and manage elisions properly.
665 (diagnose_argument_deduction_constraint): Same.
666 (diagnose_exception_constraint): Same.
667 (diagnose_parameterized_constraint): Same.
668 (constraint_p): Allow EXPR_PACK_EXPANSION.
669 * logic.cc (next_by_distance): Removed. No longer used.
670 (any_p): Renamed from any_of.
671 (term_entry, term_hasher): New.
672 (term_list): Rewrite to include a hash table for quick lookup.
673 Also, make less stateful.
674 (proof_state): Extend to allow goals to be discharged once
676 (non_atomic_constraint_p): New.
677 (any_non_atomic_constraints_p): New.
678 (...rest...): Previous implementation completely replaced with an
679 iterative algorithm that opportunistically prunes the search space
680 before committing to using more memory.
681 * parser.c: (cp_parser_type_parameter): Normalize constraints.
682 (cp_parser_explicit_template_declaration): Same.
683 * pt.c: (finish_template_variable): Be less redundant with this error
685 (template_args_equal): No longer static.
686 (tsubst_decl): Don't try to find specializations of variables that
687 have already been instantiated.
688 (build_non_dependent_expr): Avoid infinite recursion during concept
690 (make_constrained_auto): Normalize constraints.
691 (do_auto_deduction): When doing auto deduction from a
692 partial-concept-id, be sure to include the explicit args checking
694 (constraint_sat_*): New. Memoize satisfied constraints.
695 (concept_spec_*): New. Memoize expressions associated with a concept
697 (constraint_memos, concept_memos): New.
698 (lookup_constraint_satisfaction, memoize_constraint_satisfaction): New.
699 (lookup_concept_satisfaction, memoize_concept_satisfaction): New.
700 (get_concept_expansion, save_concept_expansion): New.
701 (hash_subsumption_args): New.
702 (comp_subsumption_args): New.
703 (subsumption_*): New. Memoize parts of the subsumption relation.
704 (lookup_subsumption_result, save_subsumption_result): New.
705 (init_constraint_processing): Initialize memo tables.
706 (get_constraints): Shortcut if !flag_concepts.
707 * decl.c (grokfndecl): Normalize constraints.
708 * error.c (dump_simple_decl): Print "concept" when appropriate.
709 (dump_function_decl): Same.
710 (dump_template_decl): Don't write requirements when we're not
712 (dump_expr): Handle fold expressions.
713 * cxx-pretty-print.c (cxx_pretty_printer::expression): Handle
715 (get_fold_operator): New.
716 (pp_cxx_unary_left_fold_expression): New.
717 (pp_cxx_unary_right_fold_expression): New.
718 (pp_cxx_binary_fold_expression): New.
719 (pp_cxx_check_constraint): New.
720 (pp_cxx_*_constraint): Rewrite the grammar of internal constraints
721 to make them easier to read when debugging.
722 * search.c (accessible_p): Don't shortcut when evaluating constraints.
723 * tree.c (cp_tree_equal): Handle CHECK_CONSTR.
725 2016-07-20 David Malcolm <dmalcolm@redhat.com>
729 * name-lookup.c: Include gcc-rich-location.h, spellcheck-tree.h,
731 (suggest_alternatives_for): If no candidates are found, try
732 lookup_name_fuzzy and report if if finds a suggestion.
733 (consider_binding_level): New function.
734 (lookup_name_fuzzy) New function.
735 * parser.c: Include gcc-rich-location.h.
736 (cp_lexer_next_token_is_decl_specifier_keyword): Move most of
738 (cp_keyword_starts_decl_specifier_p): ...this new function.
739 (cp_parser_diagnose_invalid_type_name): When issuing
740 "does not name a type" errors, attempt to make a suggestion using
742 * parser.h (cp_keyword_starts_decl_specifier_p): New prototype.
743 * search.c (lookup_field_fuzzy_info::fuzzy_lookup_field): Reject
744 types that are not CLASS_TYPE_P, rather than rejecting individual
747 2016-07-20 Jakub Jelinek <jakub@redhat.com>
750 * parser.c (cp_parser_save_member_function_body): Consume
751 __transaction_relaxed or __transaction_atomic with optional
752 attribute. Only skip catch with block if try keyword is seen.
755 * constexpr.c (cxx_eval_builtin_function_call): Pass false as lval
756 when evaluating call arguments. Use fold_builtin_call_array instead
757 of fold_build_call_array_loc, return t if it returns NULL. Otherwise
758 check the result with potential_constant_expression and call
759 cxx_eval_constant_expression on it.
761 2016-07-19 Jason Merrill <jason@redhat.com>
764 * pt.c (iterative_hash_template_arg, template_args_equal): Don't
765 handle ARGUMENT_PACK_SELECT.
767 2016-07-18 Jakub Jelinek <jakub@redhat.com>
771 * cp-gimplify.c (cp_genericize_r): Revert the 2016-07-07 change.
772 * tree.c (cp_walk_subtrees): For DECL_EXPR on DECL_ARTIFICIAL
773 non-static VAR_DECL, walk the decl's DECL_INITIAL, DECL_SIZE and
777 * call.c (build_op_call_1): Use convert_like_with_context only
778 if cand->fn is a decl.
781 * constexpr.c (cxx_eval_constant_expression) <case REALPART_EXPR>:
782 For lval don't use cxx_eval_unary_expression and instead recurse
783 and if needed rebuild the reference.
786 * pt.c (tsubst_baselink): Only set BASELINK_OPTYPE for BASELINK_P.
789 * cp-gimplify.c (cp_gimplify_expr) <case VEC_INIT_EXPR>: Recursively
790 fold *expr_p before genericizing it.
793 * typeck.c (build_x_conditional_expr): Revert the 2012-10-25 change.
795 2016-07-15 Jason Merrill <jason@redhat.com>
798 * call.c (convert_like_real): Mask complain.
799 * semantics.c (perform_koenig_lookup): Likewise.
802 * constexpr.c (cxx_eval_call_expression): Fail quietly when cgraph
803 threw away DECL_SAVED_TREE.
807 * call.c (add_template_conv_candidate): Disable if there are
811 * typeck2.c (cxx_incomplete_type_diagnostic): Handle DECLTYPE_TYPE.
814 * pt.c (tsubst_attributes): Fix loop logic.
818 * parser.c (cp_parser_range_for): Modify IDENTIFIER_BINDING directly.
819 (cp_parser_simple_declaration): Diagnose type definition in
820 for-range-declaration.
823 * operators.def: Add *_FOLD_EXPR.
824 * cp-tree.h (FOLD_EXPR_P): Parenthesize.
825 * mangle.c (write_expression): Handle fold-expressions.
826 * pt.c (tsubst_unary_left_fold, tsubst_binary_left_fold)
827 (tsubst_unary_right_fold, tsubst_binary_right_fold): Handle
828 partial instantiation.
831 * mangle.c (write_expression): Handle sizeof... an argument pack.
834 * pt.c (push_tinst_level_loc): Set at_eof before fatal_error.
837 * init.c (constant_value_1): Don't instantiated DECL_INITIAL of
838 artificial variables.
840 2016-07-15 Cesar Philippidis <cesar@codesourcery.com>
842 * parser.c (cp_parser_oacc_declare): Don't scan for
844 * semantics.c (handle_omp_array_sections): Mark data clauses with
845 GOMP_MAP_FORCE_{PRESENT,TO,FROM,TOFROM} as potentially having
846 zero-length subarrays.
848 2016-07-11 Jason Merrill <jason@redhat.com>
850 * decl.c (store_parm_decls): Remove check for void parm.
852 2016-07-08 Jason Merrill <jason@redhat.com>
854 * cp-tree.h: Unpoison lvalue_p.
855 * call.c, class.c, constexpr.c, cvt.c, init.c, lambda.c, pt.c,
856 tree.c, typeck.c, typeck2.c: Use lvalue_p instead of
859 * tree.c (obvalue_p): Rename from lvalue_p.
860 (lvalue_p): Define for c-common.
861 * call.c, cp-tree.h, cvt.c, init.c: Adjust.
863 (cp_build_addr_expr_1): Remove obsolete code.
865 * tree.c (glvalue_p): Rename from lvalue_or_rvalue_with_address_p.
866 * call.c, cp-tree.h, typeck.c: Adjust.
868 * lambda.c (maybe_add_lambda_conv_op): Fix null object argument.
870 P0145R2: Refining Expression Order for C++.
871 * cp-gimplify.c (lvalue_has_side_effects): New.
872 (cp_gimplify_expr): Implement assignment ordering.
873 * call.c (op_is_ordered, build_over_call): Adjust for
874 -fargs-in-order renaming to -fstrong-eval-order.
875 * cp-gimplify.c (cp_gimplify_expr): Likewise.
877 2016-07-07 Jakub Jelinek <jakub@redhat.com>
878 Kai Tietz <ktietz70@googlemail.com>
882 * cp-gimplify.c (cp_genericize_r): For DECL_EXPR for non-static
883 artificial vars, genericize their initializers.
885 2016-07-05 David Malcolm <dmalcolm@redhat.com>
888 * parser.c (cp_parser_class_specifier_1): When reporting
889 missing semicolons, use a fixit-hint to suggest insertion
890 of a semicolon immediately after the closing brace,
891 offsetting the reported column accordingly.
893 2016-07-04 Jan Beulich <jbeulich@suse.com>
895 * lang-specs.h ("@c++-header"): Conditionalize "-o".
897 2016-06-29 Thomas Schwinge <thomas@codesourcery.com>
899 * parser.c (cp_parser_pragma) <PRAGMA_OMP_CANCELLATION_POINT>:
900 Move pragma context checking into...
901 (cp_parser_omp_cancellation_point): ... here, and improve
903 * semantics.c (finish_omp_cancel, finish_omp_cancellation_point):
904 Improve diagnostic messages.
906 2016-06-28 Jakub Jelinek <jakub@redhat.com>
908 * Make-lang.in: Don't cat ../stage_current if it does not exist.
910 2016-06-24 Jason Merrill <jason@redhat.com>
912 P0145R2: Refining Expression Order for C++.
913 * typeck.c (cp_build_modify_expr): Leave COMPOUND_EXPR on LHS.
915 * tree.c (get_target_expr_sfinae): Handle bit-fields.
916 (build_target_expr): Call mark_rvalue_use.
918 2016-06-24 Jakub Jelinek <jakub@redhat.com>
920 * call.c (magic_varargs_p): Return 3 for __builtin_*_overflow_p.
921 (build_over_call): For magic == 3, do no conversion only on 3rd
924 2016-06-23 Andi Kleen <ak@linux.intel.com>
926 * Make-lang.in: Add support for autofdo.
928 2016-06-21 Jason Merrill <jason@redhat.com>
930 * constraint.cc (constraints_satisfied_p): Keep as many levels of
931 args as our template has levels of parms.
933 * pt.c (template_parm_outer_level, uses_outer_template_parms): New.
934 (type_dependent_expression_p): Use uses_outer_template_parms.
936 2016-06-20 David Malcolm <dmalcolm@redhat.com>
938 * parser.c (cp_parser_string_literal): Convert non-standard
939 concatenation error to directly use a rich_location, and
940 use that to add the location of the first literal to the
943 2016-06-17 Paolo Carlini <paolo.carlini@oracle.com>
945 * decl.c (validate_constexpr_redeclaration): Change pair of errors
947 * error.c (dump_function_decl): Save the constexpr specifier too.
949 2016-06-17 Jakub Jelinek <jakub@redhat.com>
951 * tree.c (builtin_valid_in_constant_expr_p): Test for
952 DECL_BUILT_IN_CLASS equal to BUILT_IN_NORMAL instead of just
954 (bot_manip): Likewise.
955 * call.c (magic_varargs_p): Likewise.
957 2016-06-17 Paolo Carlini <paolo.carlini@oracle.com>
959 * decl.c (grokfndecl): Change pair of errors to error + inform.
961 2016-06-17 Jason Merrill <jason@redhat.com>
964 * typeck.c (finish_class_member_access_expr): Avoid "not a base"
965 warning when there are dependent bases.
967 2016-06-17 Jakub Jelinek <jakub@redhat.com>
969 * semantics.c (handle_omp_array_sections_1): Don't ICE when
970 processing_template_decl when checking for bitfields and unions.
971 Look through REFERENCE_REF_P as base of COMPONENT_REF.
972 (finish_omp_clauses): Look through REFERENCE_REF_P even for
973 array sections with COMPONENT_REF bases.
975 2016-06-16 Jakub Jelinek <jakub@redhat.com>
977 * parser.c (cp_parser_omp_var_list_no_open): Call
978 convert_from_reference before cp_parser_postfix_dot_deref_expression.
979 * semantics.c (finish_omp_clauses): Don't ICE when
980 processing_template_decl when checking for bitfields and unions.
981 Look through REFERENCE_REF_P as base of COMPONENT_REF.
983 2016-06-15 Paolo Carlini <paolo.carlini@oracle.com>
985 * decl.c (wrapup_globals_for_namespace): Use DECL_SOURCE_LOCATION and
986 "%qF" in warning_at instead of "%q+F" in warning.
987 (check_redeclaration_exception_specification): Likewise in pedwarn
988 (and error, inform, for consistency).
989 * call.c (joust): Likewise.
991 2016-06-15 Paolo Carlini <paolo.carlini@oracle.com>
994 * decl.c (xref_basetypes): Revert r117839 changes; add fix-up
995 code at the end of the for loop; also revert r159637 changes,
996 add back the gcc_assert.
997 * cp-tree.h (xref_basetypes): Adjust declaration.
998 * parser.c (cp_parser_class_head): Adjust xref_basetypes call.
1000 2016-06-14 David Malcolm <dmalcolm@redhat.com>
1002 * search.c: Include spellcheck-tree.h rather than spellcheck.h.
1004 2016-06-14 David Malcolm <dmalcolm@redhat.com>
1006 * typeck.c: Include "gcc-rich-location.h".
1007 (finish_class_member_access_expr): Simplify fixit code by
1008 using gcc_rich_location::add_fixit_misspelled_id.
1010 2016-06-14 Jason Merrill <jason@redhat.com>
1012 P0145R2: Refining Expression Order for C++.
1013 * cp-tree.h (CALL_EXPR_OPERATOR_SYNTAX, CALL_EXPR_ORDERED_ARGS)
1014 (CALL_EXPR_REVERSE_ARGS): New.
1015 * call.c (build_new_op_1): Set them.
1016 (extract_call_expr, op_is_ordered): New.
1017 (build_over_call): Set CALL_EXPR_ORDERED_ARGS.
1018 * cp-gimplify.c (cp_gimplify_expr) [CALL_EXPR]: Handle new flags.
1019 * pt.c (tsubst_copy_and_build): Copy new flags.
1020 * semantics.c (simplify_aggr_init_expr): Likewise.
1021 * tree.c (build_aggr_init_expr): Likewise.
1022 (build_min_non_dep_op_overload): Likewise.
1024 2016-06-14 Jakub Jelinek <jakub@redhat.com>
1027 * decl.c (duplicate_decls): For DECL_INITIALIZED_P non-external
1028 olddecl vars, preserve their TREE_READONLY bit.
1031 * decl.c (complete_vars): Handle gracefully type == error_mark_node.
1033 2016-06-14 Paolo Carlini <paolo.carlini@oracle.com>
1035 * typeck2.c (digest_init_r): Use EXPR_LOC_OR_LOC on init.
1037 2016-06-13 Paolo Carlini <paolo.carlini@oracle.com>
1039 * decl.c (grokdeclarator): Fix typo in pedwarn text.
1041 2016-06-10 Thomas Schwinge <thomas@codesourcery.com>
1044 * parser.c (cp_parser_omp_var_list_no_open) <OMP_CLAUSE__CACHE_>:
1047 2016-06-09 Paolo Carlini <paolo.carlini@oracle.com>
1051 2016-06-04 Paolo Carlini <paolo.carlini@oracle.com>
1054 * parser.c (cp_parser_class_head): When xref_basetypes fails and
1055 emits an error do not zero the type.
1057 2016-06-08 Paolo Carlini <paolo.carlini@oracle.com>
1059 * decl.c (maybe_deduce_size_from_array_init): Use
1060 DECL_SOURCE_LOCATION in error_at.
1061 (layout_var_decl): Likewise.
1062 (check_array_initializer): Likewise.
1063 (check_initializer): Likewise.
1064 (duplicate_decls, check_elaborated_type_specifier): Tidy.
1066 2016-06-08 Martin Sebor <msebor@redhat.com>
1067 Jakub Jelinek <jakub@redhat.com>
1071 * constexpr.c: Include gimple-fold.h.
1072 (cxx_eval_internal_function): New function.
1073 (cxx_eval_call_expression): Call it.
1074 (potential_constant_expression_1): Handle integer arithmetic
1076 * tree.c (builtin_valid_in_constant_expr_p): Handle
1077 BUILT_IN_{ADD,SUB,MUL}_OVERFLOW_P.
1079 2016-06-08 Paolo Carlini <paolo.carlini@oracle.com>
1081 * pt.c (tsubst, case TYPENAME_TYPE): Don't delay checking the
1082 return value of tsubst_aggr_type for error_mark_node.
1084 2016-06-08 Jakub Jelinek <jakub@redhat.com>
1087 * pt.c (tsubst_copy): Only set TREE_USED on DECLs.
1089 2016-06-06 Jakub Jelinek <jakub@redhat.com>
1090 Patrick Palka <ppalka@gcc.gnu.org>
1095 * cp-gimplify.c (cp_fold_r): Set *walk_subtrees = 0 and return NULL
1096 right after cp_fold call if cp_fold has returned the same stmt
1097 already in some earlier cp_fold_r call.
1098 (cp_fold_function): Add pset automatic variable, pass its address
1101 2016-06-04 Paolo Carlini <paolo.carlini@oracle.com>
1104 * parser.c (cp_parser_class_head): When xref_basetypes fails and
1105 emits an error do not zero the type.
1107 2016-06-03 Patrick Palka <ppalka@gcc.gnu.org>
1110 * decl.c (duplicate_decls): Properly copy the
1111 DECL_PENDING_INLINE_P, DECL_PENDING_INLINE_INFO and
1112 DECL_SAVED_FUNCTION_DATA fields from OLDDECL to NEWDECL.
1114 2016-06-03 Chung-Lin Tang <cltang@codesourcery.com>
1116 * semantics.c (finish_omp_clauses): Mark OpenACC reduction
1117 arguments as addressable when async clause exists.
1119 2016-06-02 Jan Hubicka <jh@suse.cz>
1121 * cp-gimplify.c (genericize_continue_stmt): Force addition of
1124 2016-06-02 Paolo Carlini <paolo.carlini@oracle.com>
1126 * decl.c (xref_tag_1): Change pairs of errors to error + inform.
1127 (start_enum): Likewise.
1128 * parser.c (cp_parser_class_head): Likewise.
1130 2016-06-02 Jakub Jelinek <jakub@redhat.com>
1133 * cp-gimplify.c (cp_fold): For INDIRECT_REF, if the folded expression
1134 is INDIRECT_REF or MEM_REF, copy over TREE_READONLY, TREE_SIDE_EFFECTS
1135 and TREE_THIS_VOLATILE flags. For ARRAY_REF and ARRAY_RANGE_REF, copy
1136 over TREE_READONLY, TREE_SIDE_EFFECTS and TREE_THIS_VOLATILE flags
1137 to the newly built tree.
1139 2016-05-31 Jason Merrill <jason@redhat.com>
1141 * pt.c (instantiate_decl): Avoid recalculation.
1146 * pt.c (instantiate_template_1): Don't put the partial
1147 specialization in DECL_TI_TEMPLATE.
1148 (partial_specialization_p, impartial_args): Remove.
1149 (regenerate_decl_from_template): Add args parm.
1150 (instantiate_decl): Look up the partial specialization again.
1153 * pt.c (check_explicit_specialization): Give better diagnostic about
1154 specializing a hidden friend.
1156 2016-05-31 Paolo Carlini <paolo.carlini@oracle.com>
1159 * decl.c (check_static_variable_definition): Use DECL_SOURCE_LOCATION
1160 to obtain correct locations; avoid redundant diagnostics on
1161 out-of-class definitions.
1163 2016-05-30 Martin Sebor <msebor@redhat.com>
1166 * init.c (warn_placement_new_too_small): Handle placement new arguments
1167 that are elements of arrays more carefully. Remove a pointless loop.
1169 2016-05-30 Jakub Jelinek <jakub@redhat.com>
1172 * parser.c (cp_parser_omp_for): Don't disallow nowait clause
1173 when combined with target construct.
1174 (cp_parser_omp_parallel): Pass cclauses == NULL as last argument
1175 to cp_parser_omp_all_clauses.
1177 2016-05-30 Paolo Carlini <paolo.carlini@oracle.com>
1180 * lex.c (unqualified_name_lookup_error): Take a location too.
1181 (unqualified_fn_lookup_error): Take a cp_expr.
1182 * cp-tree.h (unqualified_name_lookup_error,
1183 unqualified_fn_lookup_error): Adjust declarations.
1184 * semantics.c (perform_koenig_lookup): Adjust
1185 unqualified_fn_lookup_error call, pass the location of
1186 the identifier too as part of a cp_expr.
1188 2016-05-30 Paolo Carlini <paolo.carlini@oracle.com>
1191 * parser.c (cp_parser_function_specifier_opt): Use current_class_type
1192 to improve the diagnostic about wrong uses of 'virtual'.
1194 2016-05-29 Paolo Carlini <paolo.carlini@oracle.com>
1197 * lambda.c (maybe_add_lambda_conv_op): Early return also when
1198 LAMBDA_EXPR_DEFAULT_CAPTURE_MODE != CPLD_NONE.
1200 2016-05-28 Ville Voutilainen <ville.voutilainen@gmail.com>
1204 * name-lookup.c (pushdecl_maybe_friend_1): Push local function
1205 decls into the global scope after stripping template bits
1206 and setting DECL_ANTICIPATED.
1208 2016-05-27 Paolo Carlini <paolo.carlini@oracle.com>
1211 * name-lookup.c (push_namespace): Return bool, false when pushdecl
1213 * name-lookup.h (push_namespace): Adjust declaration.
1214 * parser.c (cp_parser_namespace_definition): Check push_namespace
1217 2016-05-27 Ville Voutilainen <ville.voutilainen@gmail.com>
1220 * name-lookup.c (pushdecl_maybe_friend_1): Push local function
1221 decls into the global scope after stripping template bits
1222 and setting DECL_ANTICIPATED.
1224 2016-05-26 Jakub Jelinek <jakub@redhat.com>
1226 * semantics.c (finish_omp_clauses) <case OMP_CLAUSE_SCHEDULE>: Warn
1227 if OMP_CLAUSE_SCHEDULE_CHUNK_EXPR is known not to be positive.
1229 2016-05-26 Patrick Palka <ppalka@gcc.gnu.org>
1233 * cp-tree.h (REF_PARENTHESIZED_P): Make this flag apply to
1235 * pt.c (tsubst_qualified_id): If REF_PARENTHESIZED_P is set
1236 on the qualified_id then propagate it to the resulting
1238 (do_auto_deduction): Check REF_PARENTHESIZED_P on SCOPE_REFs
1240 * semantics.c (force_paren_expr): If given a SCOPE_REF, just set
1241 its REF_PARENTHESIZED_P flag.
1243 2016-05-25 Jason Merrill <jason@redhat.com>
1247 * cp-tree.h (enum tag_types): Add scope_type.
1248 * parser.c (cp_parser_class_name): Use scope_type.
1249 (prefer_type_arg): Handle scope_type.
1250 (cp_parser_lookup_name): Use prefer_type_arg.
1251 * name-lookup.c (lookup_qualified_name): Change bool is_type_p to
1252 int prefer_type, use lookup_flags.
1253 * name-lookup.h: Adjust.
1255 2016-05-24 Cesar Philippidis <cesar@codesourcery.com>
1257 * parser.c (cp_parser_oacc_declare): Add support for
1258 GOMP_MAP_FIRSTPRIVATE_POINTER.
1259 * semantics.c (handle_omp_array_sections_1): Replace bool is_omp
1260 argument with enum c_omp_region_type ort. Don't privatize OpenACC
1262 (handle_omp_array_sections): Replace bool is_omp argument with enum
1263 c_omp_region_type ort. Update call to handle_omp_array_sections_1.
1264 (finish_omp_clauses): Add specific errors and warning messages for
1265 OpenACC. Use firsrtprivate pointers for OpenACC subarrays. Update
1266 call to handle_omp_array_sections.
1268 2016-05-24 Jason Merrill <jason@redhat.com>
1271 * cp-gimplify.c (cp_fold_maybe_rvalue): Loop in case cp_fold
1273 (cp_fold) [INDIRECT_REF]: Don't fold to an rvalue.
1275 2016-05-24 Martin Sebor <msebor@redhat.com>
1278 * decl.c (layout_var_decl, grokdeclarator): Use complete_or_array_type_p.
1279 * pt.c (instantiate_class_template_1): Try to complete the element
1280 type of a flexible array member.
1281 (can_complete_type_without_circularity): Handle arrays of unknown bound.
1282 * typeck.c (complete_type): Also complete the type of the elements of
1283 arrays with an unspecified bound.
1285 2016-05-24 Paolo Carlini <paolo.carlini@oracle.com>
1288 * typeck2.c (check_narrowing): Check pedwarn return value.
1290 2016-05-24 Jakub Jelinek <jakub@redhat.com>
1293 * semantics.c (finish_omp_clauses) <case OMP_CLAUSE_LINEAR>:
1294 For OMP_CLAUSE_LINEAR_REF don't require type to be
1295 integral or pointer.
1297 2016-05-24 Richard Biener <rguenther@suse.de>
1301 * expr.c (mark_exp_read): Handle VIEW_CONVERT_EXPR.
1302 * constexpr.c (cxx_eval_array_reference): Handle indexed
1304 * typeck.c (cp_build_array_ref): Adjust.
1306 2016-05-23 Jason Merrill <jason@redhat.com>
1309 * constexpr.c (cxx_eval_call_expression): Check for
1310 fun == current_function_decl again.
1313 * cp-gimplify.c (cp_fold) [INDIRECT_REF]: Call
1314 maybe_undo_parenthesized_ref.
1317 * pt.c (tsubst_copy): Just return a local variable from
1318 non-template context. Don't call rest_of_decl_compilation for
1319 duplicated static locals.
1320 (tsubst_decl): Set DECL_CONTEXT of local static from another
1323 2016-05-23 Paolo Carlini <paolo.carlini@oracle.com>
1326 * method.c (forward_parm): Use cp_build_reference_type.
1328 2016-05-23 Paolo Carlini <paolo.carlini@oracle.com>
1331 * parser.c (cp_parser_initializer): Use check_for_bare_parameter_packs.
1333 2016-05-23 Paolo Carlini <paolo.carlini@oracle.com>
1335 * pt.c (check_for_bare_parameter_packs): Improve error message
1336 location for expressions.
1338 2016-05-20 Nathan Sidwell <nathan@acm.org>
1340 * constexpr.c (cxx_bind_parameters_in_call): Avoid gratuitous if
1342 (cxx_eval_call_expression): Fix comment grammar.
1344 2016-05-20 Paolo Carlini <paolo.carlini@oracle.com>
1347 * decl.c (cp_finish_decl): Check do_auto_deduction return value
1348 and return immediately in case of erroneous code.
1350 2016-05-19 Marek Polacek <polacek@redhat.com>
1353 * pt.c (unify_template_argument_mismatch): Use %qE instead of %qD.
1355 2016-05-19 Jason Merrill <jason@redhat.com>
1358 * pt.c (fn_type_unification): Add outer template args if needed.
1359 (type_unification_real): Handle getting full args.
1361 2016-05-19 David Malcolm <dmalcolm@redhat.com>
1364 * parser.c (cp_parser_operator): For array new/delete, check that
1365 cp_parser_require returned a non-NULL token before dereferencing
1368 2016-05-19 Bernd Edlinger <bernd.edlinger@hotmail.de>
1370 * decl.c (finish_enum_value_list): Use the specified mode.
1372 2016-05-18 Jason Merrill <jason@redhat.com>
1374 * pt.c (value_dependent_expression_p): Tweak new cases to better
1375 match the wording in the standard.
1377 2016-05-18 Paolo Carlini <paolo.carlini@oracle.com>
1380 * parser.c (cp_parser_template_id): Don't call cp_lexer_peek_nth_token
1381 when the previous cp_lexer_peek_token returns CPP_EOF.
1383 2016-05-18 Paolo Carlini <paolo.carlini@oracle.com>
1386 * call.c (convert_like_real): Check that we are actually converting
1389 2016-05-16 Matthew Wahab <matthew.wahab@arm.com>
1391 * decl.c (grokdeclarator): Remove errmsg and use of
1392 targetm.invalid_return_type.
1393 (grokparms): Remove errmsg and use of
1394 targetm.invalid_parameter_type.
1396 2016-05-13 Jason Merrill <jason@redhat.com>
1400 * pt.c (tsubst_decl): Use uses_template_parms.
1401 (instantiate_template_1): Handle non-dependent calls in templates.
1402 (value_dependent_expression_p): Handle BASELINK, FUNCTION_DECL.
1403 (type_dependent_expression_p): Only consider innermost template args.
1404 (dependent_template_arg_p): Check enclosing class of a template here.
1405 (dependent_template_p): Not here.
1406 (type_dependent_object_expression_p): New.
1407 * typeck.c (finish_class_member_access_expr): Use it.
1408 * parser.c (cp_parser_postfix_expression): Use it.
1409 (cp_parser_postfix_dot_deref_expression): Use it. Use comptypes
1410 to detect the current instantiation.
1411 (cp_parser_lookup_name): Really implement DR 141.
1412 * search.c (lookup_field_r): Prefer a dependent using-declaration.
1413 (any_dependent_bases_p): Split out from...
1414 * name-lookup.c (do_class_using_decl): ...here.
1415 * call.c (build_new_method_call_1): Use it.
1416 * semantics.c (finish_call_expr): 'this' doesn't make a call dependent.
1417 * tree.c (non_static_member_function_p): Remove.
1418 * typeck2.c (build_x_arrow): Use dependent_scope_p.
1420 * parser.c (cp_parser_postfix_dot_deref_expression): Use
1421 complete_type_or_else for unknown_type_node, too.
1423 2016-05-12 Marek Polacek <polacek@redhat.com>
1426 * call.c (build_new_op_1): Pass LOC to cp_build_modify_expr.
1427 * cp-tree.h (cp_build_modify_expr): Update declaration.
1428 (cxx_incomplete_type_error, cxx_incomplete_type_diagnostic): New inline
1430 * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs): Pass INPUT_LOCATION to
1431 cp_build_modify_expr.
1432 * decl2.c (set_guard): Likewise.
1433 (handle_tls_init): Likewise.
1434 * init.c (perform_member_init): Likewise.
1435 (expand_virtual_init): Likewise.
1436 (build_new_1): Likewise.
1437 (build_vec_delete_1): Likewise.
1438 (get_temp_regvar): Likewise.
1439 (build_vec_init): Likewise.
1440 * method.c (do_build_copy_assign): Likewise.
1441 (assignable_expr): Likewise.
1442 * semantics.c (finish_omp_for): Likewise.
1443 * typeck.c (cp_build_binary_op): Pass LOCATION to pointer_diff and
1445 (cp_pointer_int_sum): Add location parameter. Pass it down to
1447 (pointer_diff): Add location parameter. Use it.
1448 (build_modify_expr): Pass location down to cp_build_modify_expr.
1449 (cp_build_modify_expr): Add location parameter. Use it.
1450 (build_x_modify_expr): Pass location down to cp_build_modify_expr.
1451 * typeck2.c (cxx_incomplete_type_diagnostic,
1452 cxx_incomplete_type_error): Add location parameter.
1454 2016-05-11 Marek Polacek <polacek@redhat.com>
1457 * decl.c (duplicate_decls): Call diagnose_mismatched_decls.
1459 2016-05-05 Jakub Jelinek <jakub@redhat.com>
1461 * parser.c (cp_parser_selection_statement): For RID_SWITCH,
1462 pass if_p instead of NULL to cp_parser_implicitly_scoped_statement.
1464 2016-05-04 Marek Polacek <polacek@redhat.com>
1466 * parser.c (cp_parser_selection_statement): Replace OPT_Wparentheses
1467 with OPT_Wdangling_else.
1469 2016-05-03 Martin Sebor <msebor@redhat.com>
1472 * tree.c (builtin_valid_in_constant_expr_p): Treat BUILT_IN_FILE,
1473 BUILT_IN_FUNCTION, and BUILT_IN_LINE as constant expressions.
1475 2016-05-03 Marek Polacek <polacek@redhat.com>
1478 * call.c (build_cxx_call): Pass location and vNULL down to
1479 check_builtin_function_arguments.
1481 2016-05-03 Richard Biener <rguenther@suse.de>
1483 * Make-lang.in (cc1plus-checksum.c): For stage-final re-use
1484 the checksum from the previous stage.
1486 2016-05-02 David Malcolm <dmalcolm@redhat.com>
1489 * typeck.c (finish_class_member_access_expr): When
1490 giving a hint about a possibly-misspelled member name,
1491 add a fix-it replacement hint.
1493 2016-05-02 Cesar Philippidis <cesar@codesourcery.com>
1495 * cp-tree.h (finish_omp_clauses): Update prototype.
1496 * parser.c (cp_parser_oacc_all_clauses): Update call to
1498 (cp_parser_omp_all_clauses): Likewise.
1499 (cp_parser_omp_for_loop): Likewise.
1500 (cp_omp_split_clauses): Likewise.
1501 (cp_parser_oacc_cache): Likewise.
1502 (cp_parser_oacc_loop): Likewise.
1503 (cp_parser_omp_declare_target):
1504 (cp_parser_cilk_simd_all_clauses): Likewise.
1505 (cp_parser_cilk_for): Likewise.
1506 * pt.c (tsubst_omp_clauses): Replace allow_fields and declare_simd
1507 arguments with enum c_omp_region_type ort.
1508 (tsubst_omp_clauses): Update calls to finish_omp_clauses.
1509 (tsubst_omp_attribute): Update calls to tsubst_omp_clauses.
1510 (tsubst_omp_for_iterator): Update calls to finish_omp_clauses.
1511 (tsubst_expr): Update calls to tsubst_omp_clauses.
1512 * semantics.c (finish_omp_clauses): Replace bool arguments
1513 allow_fields, declare_simd, and is_cilk with bitmask ort.
1514 (finish_omp_for): Update call to finish_omp_clauses.
1516 2016-05-02 David Malcolm <dmalcolm@redhat.com>
1519 * parser.c (cp_parser_class_head): Capture the start location;
1520 use it to emit a fix-it insertion hint when complaining
1521 about missing "template <> " in explicit specializations.
1523 2016-05-02 Richard Sandiford <richard.sandiford@arm.com>
1525 * init.c (build_new_1): Use shift operators instead of wi:: shifts.
1527 2016-05-02 Richard Biener <rguenther@suse.de>
1529 * decl.c (grokdeclarator): Properly insert a DECL_EXPR for
1532 2016-04-29 Paolo Carlini <paolo.carlini@oracle.com>
1535 * class.c (check_field_decl): Remove final int* parameter, change
1536 the return type to bool; fix logic in order not to reject multiple
1537 initialized fields in anonymous struct.
1538 (check_field_decls): Adjust call.
1540 2016-04-29 Cesar Philippidis <cesar@codesourcery.com>
1543 * parser.c (cp_parser_oacc_loop): Don't augment mask with
1544 OACC_LOOP_CLAUSE_MASK.
1545 (cp_parser_oacc_kernels_parallel): Update call to
1546 c_oacc_split_loop_clauses.
1548 2016-04-28 Jason Merrill <jason@redhat.com>
1550 Implement C++17 [[nodiscard]] attribute.
1553 * parser.c (cp_parser_std_attribute): Handle [[nodiscard]].
1554 * tree.c (handle_nodiscard_attribute): New.
1555 (cxx_attribute_table): Add [[nodiscard]].
1556 * cvt.c (cp_get_fndecl_from_callee, cp_get_callee_fndecl): New.
1557 (maybe_warn_nodiscard): New.
1558 (convert_to_void): Call it.
1560 * cvt.c (cp_get_callee): New.
1561 * constexpr.c (get_function_named_in_call): Use it.
1562 * cxx-pretty-print.c (postfix_expression): Use it.
1563 * except.c (check_noexcept_r): Use it.
1564 * method.c (check_nontriv): Use it.
1565 * tree.c (build_aggr_init_expr): Use it.
1566 * cp-tree.h: Declare it.
1568 2015-04-27 Ryan Burn <contact@rnburn.com>
1569 Jeff Law <law@redhat.com>
1573 * cp-gimplify.c (cp_gimplify_expr): Call cilk_cp_detect_spawn_and_unwrap
1574 instead of cilk_detect_spawn_and_unwrap.
1575 * cp-cilkplus.c (is_conversion_operator_function_decl_p): New.
1577 (cilk_cp_detect_spawn_and_unwrap): New.
1578 * lambda.c: Include cp-cilkplus.h.
1579 * parser.c: Include cp-cilkplus.h.
1580 * cp-tree.h (cpp_validate_cilk_plus_loop): Move prototype into...
1581 * cp-cilkpus.h: New file.
1583 2016-04-27 Nathan Sidwell <nathan@acm.org>
1585 * constexpr.c (get_fundef_copy): Use the original function for
1586 non-recursive evaluations.
1587 (save_fundef_copy): Always expect a slot to be available.
1589 2016-04-27 Bernd Schmidt <bschmidt@redhat.com>
1591 * parser.c (cp_parser_postfix_expression): Call
1592 warn_for_memset instead of warning directly here.
1594 2016-04-26 Patrick Palka <ppalka@gcc.gnu.org>
1597 * decl.c (build_enumerator): Set current_access_specifier when
1598 declaring an enumerator belonging to an in-class enumeration.
1599 * parser.c (cp_parser_check_access_in_redecleration): Also
1600 consider in-class enumerations.
1602 2016-04-26 Marek Polacek <polacek@redhat.com>
1605 * call.c (build_conditional_expr_1): Call cp_stabilize_reference
1606 instead of stabilize_reference.
1607 (build_over_call): Likewise.
1608 * cp-tree.h (cp_stabilize_reference): Declare.
1609 * tree.c (cp_stabilize_reference): New function.
1610 * typeck.c (cp_build_unary_op): Call cp_stabilize_reference instead of
1611 stabilize_reference.
1612 (unary_complex_lvalue): Likewise.
1613 (cp_build_modify_expr): Likewise.
1615 2016-04-26 Jakub Jelinek <jakub@redhat.com>
1618 * pt.c (build_non_dependent_expr): Use flag_checking > 1 instead of
1621 2016-04-25 Jason Merrill <jason@redhat.com>
1623 * tree.c (std_attribute_table): New.
1624 (init_tree): Register it.
1626 2016-04-22 Jason Merrill <jason@redhat.com>
1628 * parser.c (cp_parser_perform_range_for_lookup): Decay the array.
1630 2016-04-21 Patrick Palka <ppalka@gcc.gnu.org>
1632 * name-lookup.c (free_saved_scope): New free list of saved_scope
1634 (push_to_top_level): Attempt to reuse a saved_scope struct
1635 from free_saved_scope instead of allocating a new one each time.
1636 (pop_from_top_level_1): Chain the now-unused saved_scope structure
1637 onto free_saved_scope.
1639 2016-04-21 Paolo Carlini <paolo.carlini@oracle.com>
1642 * semantics.c (process_outer_var_ref): Unconditionally return
1643 error_mark_node when mark_used returns false.
1645 2016-04-21 Marek Polacek <polacek@redhat.com>
1648 * parser.c (cp_parser_enum_specifier): Check and possibly error for
1649 extra qualification.
1651 2016-04-20 Nathan Sidwell <nathan@acm.org>
1654 * init.c (build_vec_delete_1): Protect operator delete call in try
1656 (build_delete): Likewise.
1657 * optimize.c (build_delete_destructor_body): Likewise.
1659 2016-04-20 Ilya Verbin <ilya.verbin@intel.com>
1662 * cp-tree.h (finish_omp_clauses): Add new default argument.
1663 * parser.c (cp_parser_cilk_simd_all_clauses): Use finish_omp_clauses
1664 instead of c_finish_cilk_clauses.
1665 * semantics.c (finish_omp_clauses): Add new argument. Allow
1666 floating-point variables in the linear clause for Cilk Plus.
1668 2016-04-20 Nathan Sidwell <nathan@acm.org>
1670 * semantics.c (finish_compound_lteral): Don't wrap VECTOR_TYPEs in a
1673 2016-04-19 Jason Merrill <jason@redhat.com>
1676 * expr.c (mark_exp_read): Handle NON_DEPENDENT_EXPR.
1677 * pt.c (make_pack_expansion): Call mark_exp_read.
1678 * semantics.c (finish_id_expression): Call mark_type_use in
1679 unevaluated context.
1682 * call.c (implicit_conversion): If we choose a copy constructor
1683 for list-initialization from the same type, the conversion is an
1686 * constexpr.c (breaks): Handle EXIT_EXPR.
1687 (cxx_eval_loop_expr): Handle COMPOUND_EXPR body.
1688 (cxx_eval_constant_expression): Handle EXIT_EXPR, improve handling
1693 * constexpr.c (potential_constant_expression_1): Handle LOOP_EXPR
1696 * pt.c (tsubst_expr): Remove shadowing declaration.
1697 (tsubst_pack_expansion): Add assert.
1699 * semantics.c (add_decl_expr): Use DECL_SOURCE_LOCATION.
1702 * name-lookup.c (qualified_lookup_using_namespace): Look through
1705 2016-04-18 Michael Matz <matz@suse.de>
1707 * class.c (build_vtable): Use SET_DECL_ALIGN and SET_TYPE_ALIGN.
1708 (layout_class_type): Ditto.
1709 (build_base_field): Use SET_DECL_ALIGN.
1710 (fixup_attribute_variants): Use SET_TYPE_ALIGN.
1711 * decl.c (duplicate_decls): Use SET_DECL_ALIGN.
1712 (record_unknown_type): Use SET_TYPE_ALIGN.
1713 (cxx_init_decl_processing): Ditto.
1714 (copy_type_enum): Ditto.
1715 (grokfndecl): Use SET_DECL_ALIGN.
1716 (copy_type_enum): Use SET_TYPE_ALIGN.
1717 * pt.c (instantiate_class_template_1): Use SET_TYPE_ALIGN.
1719 * tree.c (cp_build_qualified_type_real): Use SET_TYPE_ALIGN.
1720 * lambda.c (maybe_add_lambda_conv_op): Use SET_DECL_ALIGN.
1721 * method.c (implicitly_declare_fn): Use SET_DECL_ALIGN.
1722 * rtti.c (emit_tinfo_decl): Ditto.
1724 2016-04-18 Jason Merrill <jason@redhat.com>
1728 * class.c (type_maybe_constexpr_default_constructor): New.
1729 (type_has_constexpr_default_constructor): Revert.
1731 2016-04-16 Sandra Loosemore <sandra@codesourcery.com>
1735 * tree.c (cxx_attribute_table): Remove "com_interface" entry.
1736 (handle_com_interface_attribute): Delete.
1738 2016-04-15 Jason Merrill <jason@redhat.com>
1741 * constexpr.c (get_fundef_copy): Handle null *slot.
1744 * pt.c (tsubst_baselink): Give the new TEMPLATE_ID_EXPR
1745 unknown_type_node, too.
1747 2016-04-15 Jason Merrill <jason@redhat.com>
1748 Nathan Sidwell <nathan@acm.org>
1751 * constexpr.c (constexpr_call_table): Preserve in GC.
1752 (struct fundef_copy, struct fundef_copies_table_t): Delete.
1753 (fundef_copies_table): Preserve in GC. Change to pointer to
1755 (maybe_initialize_fundef_copies_table): Adjust.
1756 (get_fundef_copy): Return a TREE_LIST. Use non-inserting search.
1757 (save_fundef_copy): Adjust for a TREE_LIST.
1758 (cxx_eval_call_expression): Adjust for a fundef_copy TREE_LIST.
1759 (fini_constexpr): New.
1760 * cp-tree.h (fini_constexpr): Declare.
1761 * decl2.c (c_parse_final_cleanups): Call fini_constexpr.
1763 2016-04-15 Jakub Jelinek <jakub@redhat.com>
1766 * parser.c (cp_parser_pragma): Add IF_P argument, pass it down
1768 (cp_parser_declaration_seq_opt, cp_parser_member_specification_opt,
1769 cp_parser_objc_interstitial_code, cp_parser_omp_declare_simd,
1770 cp_parser_oacc_routine): Adjust cp_parser_pragma callers.
1771 (cp_parser_statement): Likewise. Adjust cp_parser_cilk_for caller.
1772 (cp_parser_omp_structured_block): Add IF_P argument, pass it down to
1773 cp_parser_statement.
1774 (cp_parser_oacc_data, cp_parser_oacc_host_data, cp_parser_oacc_loop,
1775 cp_parser_oacc_kernels_parallel, cp_parser_omp_critical,
1776 cp_parser_omp_simd, cp_parser_omp_for, cp_parser_omp_master,
1777 cp_parser_omp_ordered, cp_parser_omp_parallel, cp_parser_omp_single,
1778 cp_parser_omp_task, cp_parser_omp_taskgroup, cp_parser_omp_distribute,
1779 cp_parser_omp_teams, cp_parser_omp_target_data, cp_parser_omp_target,
1780 cp_parser_omp_taskloop, cp_parser_omp_construct,
1781 cp_parser_cilk_grainsize, cp_parser_cilk_simd, cp_parser_cilk_for):
1782 Add IF_P argument, pass it down where needed.
1783 (cp_parser_omp_for_loop): Likewise. Clear IF_P if nbraces.
1784 (cp_parser_omp_sections_scope): Adjust cp_parser_omp_structured_block
1787 2016-04-14 Jason Merrill <jason@redhat.com>
1790 * decl.c (cxx_maybe_build_cleanup): Handle non-decls.
1791 * typeck2.c (split_nonconstant_init_1): Use it.
1794 * class.c (type_has_constexpr_default_constructor): Return true
1795 for an implicitly declared constructor.
1798 * parser.c (cp_parser_init_declarator): Add auto_result parm.
1799 (cp_parser_simple_declaration): Pass it.
1800 (strip_declarator_types): New.
1803 * pt.c (value_dependent_expression_p) [VAR_DECL]: A type-dependent
1804 initializer also makes the variable value-dependent.
1807 * constexpr.c (cxx_eval_store_expression): Also copy
1808 CONSTRUCTOR_NO_IMPLICIT_ZERO.
1810 2016-04-14 Martin Sebor <msebor@redhat.com>
1815 * cp-tree.h, decl.c, init.c, typeck2.c: Revert.
1817 2016-04-14 Jason Merrill <jason@redhat.com>
1819 * call.c, decl.c, error.c, cp-tree.h, decl.c: Revert empty
1820 parameter ABI change.
1822 2016-04-13 Martin Sebor <msebor@redhat.com>
1827 * cp-tree.h (throw_bad_array_length, build_vla_check): Declare new
1829 * decl.c (check_initializer, cp_finish_decl): Call them.
1830 (reshape_init_r): Reject incompletely braced intializer-lists
1832 * init.c (throw_bad_array_length, build_vla_check)
1833 (build_vla_size_check, build_vla_init_check): Define new functions.
1834 * typeck2.c (split_nonconstant_init_1): Use variably_modified_type_p()
1836 (store_init_value): Same.
1838 2016-04-13 Jason Merrill <jason@redhat.com>
1840 Warn about empty parameter ABI with -Wabi=9.
1841 * call.c (empty_class_msg, mark_for_abi_warning)
1842 (warn_empty_class_abi): New.
1843 (build_call_a): Use them.
1844 * decl.c (store_parm_decls): Use mark_for_abi_warning.
1845 * error.c (pp_format_to_string): New.
1847 Pass empty class parameters like C.
1848 * call.c (pass_as_empty_struct, empty_class_arg): New.
1849 (type_passed_as, build_x_va_arg): Use pass_as_empty_struct.
1850 (build_call_a): Use empty_class_arg.
1851 * cp-tree.h (CPTI_EMPTY_STRUCT, empty_struct_type): New.
1852 * decl.c (cxx_init_decl_processing): Create empty_struct_type.
1854 2016-04-13 Jason Merrill <jason@redhat.com>
1857 * decl.c (start_enum): Don't change an existing ENUM_UNDERLYING_TYPE.
1859 2016-04-13 Paolo Carlini <paolo.carlini@oracle.com>
1862 * pt.c (resolve_typename_type): Fix typos in infinite recursion
1863 avoidance mechanism.
1865 2016-04-13 Jason Merrill <jason@redhat.com>
1868 * pt.c (instantiation_dependent_uneval_expression_p): Split out
1869 from instantiation_dependent_expression_p.
1870 (value_dependent_expression_p): Use it for unevaluated operands.
1871 (instantiation_dependent_r): Don't check value-dependence.
1872 (instantiation_dependent_expression_p): Check
1873 value-dependence of the expression as a whole.
1874 * cp-tree.h: Declare instantiation_dependent_uneval_expression_p.
1875 * semantics.c (finish_decltype_type): Use it.
1877 * constexpr.c (potential_nondependent_constant_expression): New.
1878 (potential_nondependent_static_init_expression): New.
1879 (maybe_constant_value_1, fold_non_dependent_expr)
1880 (maybe_constant_init): Use them.
1881 * pt.c (instantiate_non_dependent_expr_sfinae)
1882 (instantiate_non_dependent_or_null, convert_nontype_argument): Use
1884 * cp-tree.h: Declare them.
1886 2016-04-13 Jakub Jelinek <jakub@redhat.com>
1889 * decl.c (pop_labels_1): Removed.
1890 (note_label, sort_labels): New functions.
1891 (pop_labels): During named_labels traversal, just push the slot
1892 pointers into a vector, then qsort it by DECL_UID and only then
1893 call pop_label and chain it into BLOCK_VARS.
1895 2016-04-13 Jason Merrill <jason@redhat.com>
1898 * cp-gimplify.c (cp_genericize_r): Expand PTRMEM_CST here.
1899 (cp_gimplify_expr): Not here.
1901 2016-04-12 Patrick Palka <ppalka@gcc.gnu.org>
1904 * tree.c (lvalue_kind) [NON_DEPENDENT_EXPR]: Unconditionally
1906 * typeck.c (build_x_conditional_expr): Unconditionally remember
1907 that the result is an lvalue or xvalue.
1909 2016-04-12 Jason Merrill <jason@redhat.com>
1911 * class.c (is_really_empty_class): A zero-length array is empty.
1912 An unnamed bit-field doesn't make a class non-empty.
1914 2016-04-12 Paolo Carlini <paolo.carlini@oracle.com>
1917 * parser.c (cp_parser_cache_defarg): When file ends in default
1918 argument simply return error_mark_node.
1920 2016-04-12 Nathan Sidwell <nathan@acm.org>
1923 * constexpr.c (cxx_eval_bare_aggregate): Handle VECTOR_TYPE
1926 2016-04-11 Jason Merrill <jason@redhat.com>
1928 * mangle.c (decl_is_template_id): The template itself counts as a
1931 2016-04-08 Patrick Palka <ppalka@gcc.gnu.org>
1935 * constexpr.c (cxx_eval_outermost_expression): Call unshare_expr
1936 on the result if it's not a CONSTRUCTOR.
1938 2016-04-07 Patrick Palka <ppalka@gcc.gnu.org>
1941 * constexpr.c (find_constructor): New function.
1942 (unshare_constructor): New function.
1943 (cxx_eval_call_expression): Use unshare_constructor instead of
1945 (find_array_ctor_elt): Likewise.
1946 (cxx_eval_vec_init_1): Likewise.
1947 (cxx_eval_store_expression): Likewise.
1948 (cxx_eval_constant_expression): Likewise.
1950 2016-04-06 Patrick Palka <ppalka@gcc.gnu.org>
1953 * cp-tree.h (FOR_EACH_CLONE): Restructure macro to avoid
1954 potentially generating a future -Wparentheses warning in its
1957 2016-04-06 Jason Merrill <jason@redhat.com>
1959 * class.c (check_abi_tags): Fix function template handling.
1961 2016-04-05 Nathan Sidwell <nathan@acm.org>
1964 * class.c (fixup_may_alias): New.
1965 (fixup_attribute_variants): Call it.
1967 2016-04-05 Patrick Palka <ppalka@gcc.gnu.org>
1970 * constexpr.c (struct fundef_copy): New struct.
1971 (struct fundef_copies_table_t): New struct.
1972 (fundef_copies_table): New static variable.
1973 (maybe_initialize_fundef_copies_table): New static function.
1974 (get_fundef_copy): New static function.
1975 (save_fundef_copy): New static function.
1976 (cxx_eval_call_expression): Use get_fundef_copy, and
1978 (constexpr_call_table): Add "deletable" GTY marker.
1980 2016-04-05 Patrick Palka <ppalka@gcc.gnu.org>
1983 * cp-tree.h (class cache_map): Remove.
1984 * constexpr.c (cv_cache): Change type to
1985 GTY((deletable)) hash_map<tree, tree> *.
1986 (maybe_constant_value): Adjust following the change to cv_cache.
1987 (clear_cv_cache): New static function.
1988 (clear_cv_and_fold_caches): Use it.
1989 * cp-gimplify.c (fold_cache): Change type to
1990 GTY((deletable)) hash_map<tree, tree> *.
1991 (clear_fold_cache): Adjust following the change to fold_cache.
1992 (cp_fold): Likewise.
1994 2016-04-02 Martin Sebor <msebor@redhat.com>
2000 * constexpr.c (diag_array_subscript): New function.
2001 (cxx_eval_array_reference): Detect out of bounds array indices.
2003 2016-04-01 Jason Merrill <jason@redhat.com>
2007 * pt.c (instantiate_decl): A function isn't fully defined if
2008 DECL_INITIAL is error_mark_node.
2009 * constexpr.c (cxx_eval_call_expression): Likewise.
2011 2016-04-01 Jakub Jelinek <jakub@redhat.com>
2012 Marek Polacek <polacek@redhat.com>
2015 * init.c (warn_placement_new_too_small): Test whether
2016 DECL_SIZE_UNIT or TYPE_SIZE_UNIT are integers that fit into uhwi.
2018 2016-04-01 Nathan Sidwell <nathan@acm.org>
2021 * decl.c (check_redeclaration_exception_specification): Check
2022 regardless of -fno-exceptions.
2023 * typeck2.c (merge_exception_specifiers): Relax assert by checking
2024 flag_exceptions too.
2026 2016-03-31 Nathan Sidwell <nathan@acm.org>
2028 * decl.c (start_preparsed_function): Remove unnecessary bracing.
2029 (finish_destructor_body): Don't emit operator delete here.
2031 2016-03-31 Nathan Sidwell <nathan@acm.org>
2034 * constexpr.c (cxx_eval_store_expression): Keep CONSTRUCTOR
2035 elements in field order.
2037 2016-03-31 Marek Polacek <polacek@redhat.com>
2040 * decl.c (duplicate_decls): Also set TYPE_ALIGN and TYPE_USER_ALIGN.
2042 2016-03-31 Richard Biener <rguenther@suse.de>
2045 * typeck.c (cp_build_binary_op): Fix operand order of vector
2046 conditional in truth op handling.
2048 2016-03-29 Jason Merrill <jason@redhat.com>
2051 * decl.c (make_rtl_for_nonlocal_decl): Don't defer local statics
2052 in constexpr functions.
2054 2016-03-28 Jason Merrill <jason@redhat.com>
2059 * decl.c, pt.c, constexpr.c: Revert last patch.
2061 2016-03-25 Jason Merrill <jason@redhat.com>
2062 Martin Liška <mliska@suse.cz>
2067 * decl.c (cp_fname_init): Decay the initializer to pointer.
2068 (cp_make_fname_decl): Set DECL_DECLARED_CONSTEXPR_P,
2069 DECL_VALUE_EXPR, DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
2070 Don't call cp_finish_decl.
2071 * pt.c (tsubst_expr) [DECL_EXPR]: Set DECL_VALUE_EXPR,
2072 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P. Don't call cp_finish_decl.
2073 * constexpr.c (cxx_eval_constant_expression) [VAR_DECL]:
2074 Handle DECL_VALUE_EXPR.
2076 2016-03-24 Jason Merrill <jason@redhat.com>
2079 * constexpr.c (cxx_eval_bare_aggregate): Handle PMFs.
2082 * constexpr.c (cxx_eval_call_expression): Don't cache result if
2085 2016-03-24 Patrick Palka <ppalka@gcc.gnu.org>
2088 * tree.c (build_cplus_array_type): Determine type-dependentess
2089 with uses_template_parms instead of with dependent_type_p.
2091 2016-03-23 Patrick Palka <ppalka@gcc.gnu.org>
2094 * typeck.c (process_init_constructor_union): If the initializer
2095 is empty, use the union's NSDMI if it has one.
2097 2016-03-23 Patrick Palka <ppalka@gcc.gnu.org>
2100 * pt.c (tsubst_copy) [PARM_DECL]: Handle the use of 'this' in an
2101 NSDMI that's part of an aggregrate initialization.
2103 2016-03-23 Jakub Jelinek <jakub@redhat.com>
2106 * constexpr.c (cxx_eval_vec_init_1): Reuse CONSTRUCTOR initializers
2107 for 1..max even for multi-dimensional arrays. Call unshare_expr
2111 * constexpr.c (cxx_eval_constant_expression): Diagnose overflow
2112 on TREE_OVERFLOW constants.
2115 * cp-gimplify.c (genericize_omp_for_stmt): Don't walk OMP_FOR_CLAUSES
2116 for OMP_TASKLOOP here.
2117 (cp_genericize_r): Handle OMP_TASKLOOP like OMP_TASK, except do call
2118 genericize_omp_for_stmt instead of cp_walk_tree on OMP_BODY.
2120 2016-03-23 Alexandre Oliva <aoliva@redhat.com>
2121 Jason Merrill <jason@redhat.com>
2122 Jakub Jelinek <jakub@redhat.com>
2125 * cp-tree.h (defer_mark_used_calls, deferred_mark_used_calls): Remove.
2126 * decl.c (defer_mark_used_calls, deferred_mark_used_calls): Remove.
2127 (finish_function): Don't set or test them.
2128 * decl2.c (mark_used): Don't handle defer_mark_used_calls.
2130 2016-03-23 Jason Merrill <jason@redhat.com>
2133 * constexpr.c (cxx_eval_call_expression): Catch invalid recursion.
2135 2016-03-23 Marek Polacek <polacek@redhat.com>
2138 * pt.c (canonicalize_type_argument): Use OPT_Wignored_attributes.
2140 2016-03-22 Ilya Enkovich <enkovich.gnu@gmail.com>
2142 * call.c (build_conditional_expr_1): Always use original
2143 condition type for vector type checks and build.
2145 2016-03-22 Patrick Palka <ppalka@gcc.gnu.org>
2148 * pt.c (tsubst_decl): Clear the DECL_MODE of the new decl.
2150 2016-03-22 Patrick Palka <ppalka@gcc.gnu.org>
2153 * constexpr.c (non_const_var_error): Check
2154 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
2156 2016-03-21 Richard Henderson <rth@redhat.com>
2159 * decl.c (notice_forced_label_r): New.
2160 (cp_finish_decl): Use it.
2162 2016-03-21 Jason Merrill <jason@redhat.com>
2165 * cp-gimplify.c (cp_fold) [COND_EXPR]: Handle bit-fields.
2167 2016-03-18 Jason Merrill <jason@redhat.com>
2170 * constexpr.c (cxx_eval_call_expression): Fix trivial copy.
2173 * class.c (vptr_via_virtual_p): New.
2174 (most_primary_binfo): Factor out of build_rtti_vtbl_entries.
2175 * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs): Don't clear
2176 a vptr from any virtual base in a not-in-charge 'structor.
2178 * decl.c (build_clobber_this): Factor out of
2179 start_preparsed_function and begin_destructor_body. Handle
2180 virtual bases better.
2182 * class.c (build_if_in_charge): Split out from build_base_path.
2183 * init.c (expand_virtual_init, expand_default_init): Use it.
2184 * call.c (build_special_member_call): Use it.
2186 2016-03-18 Jakub Jelinek <jakub@redhat.com>
2189 * init.c (build_new_1): Complain and return error_mark_node
2190 if alloc_fn is not _Jv_AllocObject function returning pointer.
2192 2016-03-18 Patrick Palka <ppalka@gcc.gnu.org>
2195 * search.c (adjust_result_of_qualified_name_lookup): Don't
2196 update the BASELINK_BINFO of DECL if the second call
2197 to lookup_base fails.
2199 2016-03-18 Patrick Palka <ppalka@gcc.gnu.org>
2202 * parser.c (cp_parser_lambda_expression): Move call to
2203 pop_deferring_access_checks ahead of the call to
2204 cp_parser_end_tentative_firewall.
2206 2016-03-17 Jakub Jelinek <jakub@redhat.com>
2209 * cp-tree.h (magic_varargs_p): Return int instead of bool.
2210 * call.c (magic_varargs_p): Return int instead of bool, return 2 for
2211 Cilk+ reductions, otherwise 1 for magic varargs and 0 for normal
2213 (build_over_call): If magic_varargs_p == 2, call reject_gcc_builtin,
2214 if magic_varargs_p == 1, call decay_conversion
2215 instead of mark_type_use. Don't store error_mark_node arguments to
2216 argarray, instead return error_mark_node.
2219 * decl.c (begin_destructor_body): Don't insert clobber if
2220 is_empty_class (current_class_type).
2222 2016-03-17 Marek Polacek <polacek@redhat.com>
2225 * typeck.c (warn_for_null_address): New function.
2226 (cp_build_binary_op): Call it.
2228 2016-03-16 Jason Merrill <jason@redhat.com>
2231 * decl.c (start_preparsed_function): Don't clobber an empty base.
2233 2016-03-16 Jakub Jelinek <jakub@redhat.com>
2236 * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs): Conditionalize
2237 BINFO_VIRTUAL_P vtable clearing on current_in_charge_parm.
2240 * cp-ubsan.c (cp_ubsan_maybe_initialize_vtbl_ptrs): Temporarily
2241 set in_base_initializer.
2243 2016-03-15 Marek Polacek <polacek@redhat.com>
2246 * tree.c (strip_typedefs): Call strip_typedefs again on the
2247 DECL_ORIGINAL_TYPE result.
2249 2016-03-15 Jason Merrill <jason@redhat.com>
2252 * pt.c (instantiate_decl): Fix call to variable_template_p.
2255 * pt.c (for_each_template_parm_r): Always walk into TYPENAME_TYPE.
2257 2016-03-14 Casey Carter <casey@carter.net>
2258 Jason Merrill <jason@redhat.com>
2260 P0184R0: Generalizing the Range-Based For Loop
2261 * parser.c (cp_convert_range_for): Set the type of __end separately.
2262 (cp_parser_perform_range_for_lookup): Allow different begin/end
2263 types if they are comparable.
2265 2016-03-12 Patrick Palka <ppalka@gcc.gnu.org>
2268 * semantics.c (force_paren_expr): Just build a PAREN_EXPR when
2269 processing_template_decl and EXPR is a SCOPE_REF.
2271 2016-03-10 Patrick Palka <ppalka@gcc.gnu.org>
2272 Jakub Jelinek <jakub@redhat.com>
2275 * constexpr.c (cxx_eval_vec_init_1): For pre_init case, reuse
2276 return value from cxx_eval_constant_expression from earlier
2277 elements if it is valid constant initializer requiring no
2280 2016-03-10 Marek Polacek <polacek@redhat.com>
2283 * cp-gimplify.c (cp_fold): Handle UNARY_PLUS_EXPR.
2285 2016-03-09 Cesar Philippidis <cesar@codesourcery.com>
2287 * parser.c (cp_parser_oacc_loop): Update cclauses and clauses
2288 when calling c_finish_omp_clauses.
2290 2016-03-08 Jason Merrill <jason@redhat.com>
2292 * parser.c (cp_parser_diagnose_invalid_type_name): Give helpful
2293 diagnostic for use of "concept".
2294 (cp_parser_requires_clause_opt): And "requires".
2295 (cp_parser_type_parameter, cp_parser_late_return_type_opt)
2296 (cp_parser_explicit_template_declaration): Adjust.
2297 * Make-lang.in (check-c++-all): Add "concepts" to std list.
2299 P0036R0: Unary Folds and Empty Parameter Packs
2300 * pt.c (expand_empty_fold): Remove special cases for *,+,&,|.
2302 2016-03-08 Jakub Jelinek <jakub@redhat.com>
2305 * constexpr.c (cxx_eval_loop_expr): Forget saved values of SAVE_EXPRs
2306 even after the last iteration of the loop.
2308 * decl.c (duplicate_decls): Fix spelling - becuase -> because.
2310 2016-03-07 Patrick Palka <ppalka@gcc.gnu.org>
2313 * pt.c (get_template_info): Handle PARM_DECL.
2314 (template_class_depth): Check DECL_P instead of
2315 VAR_OR_FUNCTION_DECL_P.
2317 2016-03-05 Jason Merrill <jason@redhat.com>
2320 * constexpr.c (cxx_eval_store_expression): Replace
2321 CONSTRUCTOR_ELTS in nested CONSTRUCTORs, too.
2323 2016-03-05 Patrick Palka <ppalka@gcc.gnu.org>
2326 * pt.c (template_class_depth): Given a lambda type, iterate
2327 into its LAMBDA_TYPE_EXTRA_SCOPE field instead of its
2328 TYPE_CONTEXT. Given a VAR_DECL, iterate into its
2331 2016-03-04 Jason Merrill <jason@redhat.com>
2334 * cp-tree.h (COND_EXPR_IS_VEC_DELETE): New.
2335 * init.c (build_vec_delete_1): Set it.
2336 * constexpr.c (potential_constant_expression_1) [COND_EXPR]: Check it.
2338 2016-03-04 Jakub Jelinek <jakub@redhat.com>
2340 * decl.c (start_preparsed_function): Don't emit start clobber at the
2341 start of constructor clones.
2344 * cp-tree.h (cp_ubsan_maybe_initialize_vtbl_ptrs): New prototype.
2345 * decl.c (start_preparsed_function): Call
2346 cp_ubsan_maybe_initialize_vtbl_ptrs if needed.
2347 * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs,
2348 cp_ubsan_maybe_initialize_vtbl_ptrs): New functions.
2350 2016-03-04 Jason Merrill <jason@redhat.com>
2353 * constexpr.c (cxx_eval_component_reference): Further tweak.
2355 * constexpr.c (struct constexpr_ctx): Add save_exprs field.
2356 (cxx_eval_loop_expr): Discard SAVE_EXPR values before looping.
2357 (cxx_eval_constant_expression) [SAVE_EXPR]: Add it to the set.
2358 (cxx_eval_outermost_constant_expr, is_sub_constant_expr): Initialize.
2361 * tree.c (strip_typedefs): Handle TYPENAME_TYPE lookup finding the
2364 2016-03-03 Jason Merrill <jason@redhat.com>
2366 * method.c (synthesized_method_walk): operator= can also be constexpr.
2368 * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Get
2369 LAMBDA_EXPR_RETURN_TYPE from the instantiated closure.
2372 * pt.c (copy_template_args): New.
2373 (tsubst_pack_expansion): Use it.
2375 * call.c (build_aggr_conv): Use get_nsdmi.
2378 * typeck.c (build_static_cast_1): Avoid folding back to lvalue.
2381 * constexpr.c (cxx_eval_component_reference): Just return an empty
2382 CONSTRUCTOR for an empty class.
2384 2016-03-01 Jason Merrill <jason@redhat.com>
2387 * parser.c (cp_parser_requires_clause): Call
2388 check_for_bare_parameter_packs.
2391 * constexpr.c (cxx_eval_binary_expression): Don't VERIFY_CONSTANT
2395 * constexpr.c (cxx_eval_call_expression): Unshare arg.
2396 (cxx_eval_constant_expression) [DECL_EXPR]: Unshare init.
2397 [TARGET_EXPR]: Unshare init.
2399 2016-03-01 Patrick Palka <ppalka@gcc.gnu.org>
2403 * pt.c (tsubst_baselink): Reinstate the check for an invalid
2406 2016-02-28 Jason Merrill <jason@redhat.com>
2409 * constexpr.c (cxx_eval_store_expression): Unshare init.
2411 2016-02-26 Jason Merrill <jason@redhat.com>
2414 * pt.c (make_argument_pack): New.
2415 (tsubst_copy) [SIZEOF_EXPR]: Handle partial expansion.
2416 (tsubst_copy_and_build): Likewise.
2418 2016-02-25 Jason Merrill <jason@redhat.com>
2421 * cp-tree.h (AGGR_INIT_FROM_THUNK_P): New.
2422 * tree.c (build_aggr_init_expr): Set it.
2423 * semantics.c (simplify_aggr_init_expr): Check it.
2424 * cp-gimplify.c (cp_genericize_r): Don't walk into
2425 a call/aggr_init from a thunk.
2428 * method.c (forward_parm): Handle parameter packs.
2429 * lambda.c (maybe_add_lambda_conv_op): Use it for them.
2432 * constexpr.c (cxx_eval_component_reference): Don't complain about
2433 unevaluated empty classes.
2436 * tree.c (strip_typedefs): Use DECL_ORIGINAL_TYPE.
2438 2016-02-25 Patrick Palka <ppalka@gcc.gnu.org>
2441 * cp-tree.h (REF_PARENTHESIZED_P): Adjust documentation.
2442 (maybe_undo_parenthesized_ref): Declare.
2443 * semantics.c (maybe_undo_parenthesized_ref): Split out from
2445 (finish_call_expr): Use it.
2446 * typeck.c (check_return_expr): Use it.
2447 * pt.c (tsubst_copy_and_build) [INDIRECT_REF]: Retain the
2448 REF_PARENTHESIZED_P flag.
2450 2016-02-24 Jakub Jelinek <jakub@redhat.com>
2453 * class.c (build_base_path): Set TREE_NO_WARNING on the null_test.
2455 * init.c (build_vec_delete_1, build_delete): Don't fold the non-NULL
2457 * cp-gimplify.c (cp_fold): For TREE_NO_WARNING comparisons with NULL,
2458 unless they are folded into INTEGER_CST, error_mark_node or some
2459 comparison with NULL, avoid folding them and use either the original
2460 comparison or non-folded comparison of folded arguments.
2461 * cp-ubsan.c (cp_ubsan_instrument_vptr): Set TREE_NO_WARNING on the
2462 comparison, don't fold the comparison right away.
2464 2016-02-24 Jason Merrill <jason@redhat.com>
2467 * friend.c (make_friend_class): Likewise.
2468 * decl.c (lookup_and_check_tag): Diagnose invalid dependent friend.
2470 2016-02-24 Jason Merrill <jason@redhat.com>
2473 * pt.c (instantiate_class_template_1): Set
2474 processing_template_decl before substituting friend_type.
2476 016-02-24 Martin Sebor <msebor@redhat.com>
2479 * tree.c (build_ctor_subob_ref): Compare types' main variants
2480 instead of the types as they are.
2482 2016-02-24 Jason Merrill <jason@redhat.com>
2484 * decl.c (start_preparsed_function): Condition ctor clobber on
2485 flag_lifetime_dse > 1.
2487 * cp-gimplify.c (cp_fold): Don't fold constexpr calls if -fno-inline.
2489 2016-02-19 Jason Merrill <jason@redhat.com>
2492 * call.c (remaining_arguments): No longer static.
2493 * cp-tree.h: Declare it.
2494 * pt.c (more_specialized_fn): Use it.
2496 2016-02-19 Jakub Jelinek <jakub@redhat.com>
2497 Bernd Edlinger <bernd.edlinger@hotmail.de>
2499 * Make-lang.in: Invoke gperf with -L C++.
2500 * cfns.gperf: Remove prototypes for hash and libc_name_p
2502 * cfns.h: Regenerated.
2503 * except.c (nothrow_libfn_p): Adjust.
2505 2016-02-19 Jakub Jelinek <jakub@redhat.com>
2508 * rtti.c (ifnonnull): Set TREE_NO_WARNING on the condition, use
2509 NE_EXPR instead of EQ_EXPR and swap last two arguments on COND_EXPR.
2511 2016-02-19 Patrick Palka <ppalka@gcc.gnu.org>
2514 * pt.c (tsubst_baselink): Don't diagnose an invalid constructor
2516 * semantics.c (finish_call_expr): Don't assume a constructor
2517 call is dependent if only the "this" pointer is dependent. When
2518 building a constructor call, always use a dummy object.
2520 2016-02-19 Jakub Jelinek <jakub@redhat.com>
2523 * init.c (build_vec_delete_1): Set TREE_NO_WARNING on the NE_EXPR
2525 * cp-gimplify.c (cp_fold): Propagate TREE_NO_WARNING from binary
2526 operators if folding preserved the binop, just with different
2530 * parser.c (cp_parser_std_attribute_spec_seq): Don't assume
2531 attr_spec is always single element chain, chain all the attributes
2532 properly together in the right order.
2534 2016-02-18 Jason Merrill <jason@redhat.com>
2536 * mangle.c (maybe_check_abi_tags): Add for_decl parm. Call
2538 (mangle_decl): Call maybe_check_abi_tags for function scope.
2539 (mangle_guard_variable): Call maybe_check_abi_tags here.
2540 (write_guarded_var_name): Not here.
2542 2016-02-17 Jason Merrill <jason@redhat.com>
2545 * constexpr.c (build_constexpr_constructor_member_initializers):
2546 Handle an additional STATEMENT_LIST.
2549 * constexpr.c (cxx_eval_bare_aggregate): Fix 'changed' detection.
2552 * decl2.c (reset_type_linkage_2): Look through member templates.
2554 2016-02-17 Jakub Jelinek <jakub@redhat.com>
2557 * init.c (build_delete): Set TREE_NO_WARNING on ifexp.
2559 2016-02-17 Jason Merrill <jason@redhat.com>
2562 * method.c (forward_parm): Split out from...
2563 (add_one_base_init): ...here.
2564 * lambda.c (maybe_add_lambda_conv_op): Use it.
2566 2016-02-16 Jason Merrill <jason@redhat.com>
2570 * call.c, cp-tree.h, name-lookup.c, pt.c, search.c, semantics.c,
2571 tree.c, typeck2.c: Revert earlier changes.
2572 * parser.c (cp_parser_lookup_name): Ignore namespace-scope
2573 non-type templates after -> or .
2575 2016-02-16 Jakub Jelinek <jakub@redhat.com>
2578 * typeck.c (cp_build_binary_op): Revert 2015-09-09 change.
2580 2016-02-16 Jason Merrill <jason@redhat.com>
2583 * name-lookup.c (lookup_qualified_name): Add find_hidden parm.
2584 (set_decl_namespace): Pass it. Complain about finding a hidden friend.
2585 * name-lookup.h: Adjust.
2587 2016-02-16 James Norris <jnorris@codesourcery.com>
2589 * parser.c (cp_parser_oacc_data_clause_deviceptr): Remove checking.
2590 * semantics.c (finish_omp_clauses): Add deviceptr checking.
2592 2016-02-15 Jakub Jelinek <jakub@redhat.com>
2595 * init.c (expand_default_init): Only call reshape_init
2596 in the direct-initialization from an initializer list case.
2598 2016-02-15 Jason Merrill <jason@redhat.com>
2601 * semantics.c (finish_call_expr): Implicit 'this' does not make
2603 * search.c (any_dependent_bases_p): Split out...
2604 * name-lookup.c (do_class_using_decl): ...from here.
2605 * call.c (build_new_method_call_1): Don't complain about missing object
2606 if there are dependent bases. Tweak error.
2607 * tree.c (non_static_member_function_p): Remove.
2608 * pt.c (type_dependent_expression_p): A member template of a
2609 dependent type is dependent.
2610 * cp-tree.h: Adjust.
2613 * constexpr.c (verify_ctor_sanity): Remove CONSTRUCTOR_NELTS check.
2615 2016-02-12 Patrick Palka <ppalka@gcc.gnu.org>
2618 * pt.c (lookup_and_finish_template_variable): New function,
2620 (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: ... here. Use it.
2621 (tsubst_qualified_id): Consider that EXPR might be a variable
2623 * typeck.c (check_template_keyword): Don't emit an error
2624 if DECL is a variable template.
2626 2016-02-12 Jakub Jelinek <jakub@redhat.com>
2628 * error.c: Spelling fixes - behaviour -> behavior and
2629 neighbour -> neighbor.
2631 * typeck.c (cp_build_binary_op): Fix up behavior spelling in
2633 * init.c (build_delete): Likewise.
2635 2016-02-11 Jakub Jelinek <jakub@redhat.com>
2638 * typeck.c (cp_build_binary_op): cp_fully_fold integer_zerop
2639 arguments for -Waddress warning. Fix up formatting.
2641 2016-02-11 Paolo Carlini <paolo.carlini@oracle.com>
2644 * pt.c (lookup_template_class_1): Check tsubst return value for
2647 2016-02-10 Jason Merrill <jason@redhat.com>
2650 * pt.c (resolve_nondeduced_context): Add complain parm.
2651 (do_auto_deduction): Pass it.
2652 * cvt.c (convert_to_void): Likewise.
2653 * decl.c (cp_finish_decl): Likewise.
2654 * init.c (build_new): Likewise.
2655 * rtti.c (get_tinfo_decl_dynamic): Likewise.
2656 * semantics.c (finish_decltype_type): Likewise.
2657 * typeck.c (decay_conversion): Likewise.
2658 * cp-tree.h: Adjust declaration.
2659 * call.c (standard_conversion): Add complain parm, pass it along.
2660 (implicit_conversion): Pass it.
2663 * name-lookup.c (ambiguous_decl): Call remove_hidden_names.
2664 (lookup_name_real_1): Likewise.
2665 (remove_hidden_names): Handle non-functions too.
2668 * parser.c (cp_parser_lookup_name): When looking for a template
2669 after . or ->, only consider class templates.
2670 (cp_parser_postfix_dot_deref_expression): Handle the current
2671 instantiation. Remember a dependent object expression.
2672 * typeck2.c (build_x_arrow): Handle the current instantiation.
2674 * ptree.c (debug_tree): Implement for cp_expr.
2676 2016-02-08 Patrick Palka <ppalka@gcc.gnu.org>
2679 * parser.c (cp_parser_simple_type_specifier): Make the check
2680 for disambiguating between an 'auto' placeholder and an implicit
2681 template parameter more robust.
2683 2016-02-08 Patrick Palka <ppalka@gcc.gnu.org>
2687 * decl2.c (mark_used): When given a TEMPLATE_DECL, return after
2688 setting its TREE_USED flag.
2690 2016-02-08 Jason Merrill <jason@redhat.com>
2693 * name-lookup.c (do_nonmember_using_decl): Leave anticipated
2696 2016-02-08 Jakub Jelinek <jakub@redhat.com>
2699 * parser.c (cp_parser_omp_declare_reduction): Set assembler name
2700 of the DECL_OMP_DECLARE_REDUCTION_P decls.
2702 2016-02-08 Marek Polacek <polacek@redhat.com>
2705 * constexpr.c (clear_cv_and_fold_caches): Renamed from clear_cv_cache.
2706 Call clear_fold_cache.
2707 * cp-tree.h: Adjust declaration.
2708 * decl.c (finish_enum_value_list): Call clear_cv_and_fold_caches
2709 rather than clear_cv_cache and clear_fold_cache.
2710 * typeck2.c (store_init_value): Call clear_cv_and_fold_caches.
2712 2016-02-08 Jason Merrill <jason@redhat.com>
2714 * cp-tree.h (CONV_FOLD, CONV_BACKEND_CONVERT): New.
2715 * cvt.c (convert): Pass CONV_BACKEND_CONVERT.
2716 (ocp_convert): Use *_maybe_fold.
2717 (cp_convert_to_pointer): Add dofold parameter.
2718 * cp-gimplify.c (cp_fold) [CONVERT_EXPR]: Call convert.
2720 2016-02-05 Martin Sebor <msebor@redhat.com>
2723 * init.c (find_field_init): New function.
2724 (warn_placement_new_too_small): Call it. Handle one-element arrays
2725 at ends of structures special.
2727 2016-02-05 Jason Merrill <jason@redhat.com>
2730 * semantics.c (finish_expr_stmt): If expr is error_mark_node,
2731 make sure we've seen_error().
2733 2016-02-05 Patrick Palka <ppalka@gcc.gnu.org>
2736 * pt.c (tsubst_baselink): Diagnose an invalid constructor call
2737 if lookup_fnfields returns NULL_TREE and the name being looked
2738 up has the form A::A.
2740 2016-02-04 Patrick Palka <ppalka@gcc.gnu.org>
2742 * constexpr.c (cxx_eval_binary_expression): Fold equality
2743 comparisons involving PTRMEM_CSTs.
2745 2016-02-04 Jakub Jelinek <jakub@redhat.com>
2747 * class.c (find_flexarrays): Don't declare dom variable.
2748 (diagnose_flexarray): Likewise.
2750 2016-02-02 Martain Sebor <msebor@redhat.com>
2757 * class.c (walk_subobject_offsets): Avoid testing the upper bound
2758 of a flexible array member for equality to null.
2759 (find_flexarrays): Remove spurious whitespace introduced in r231665.
2760 (diagnose_flexarrays): Avoid checking the upper bound of arrays.
2761 (check_flexarrays): Same.
2762 * decl.c (compute_array_index_type): Avoid special case for flexible
2764 (grokdeclarator): Avoid calling compute_array_index_type for flexible
2766 * error.c (dump_type_suffix): Revert changes introduced in r231665
2767 and rendered unnecessary by the changes above.
2768 * pt.c (tsubst): Same.
2769 * tree.c (build_ctor_subob_ref): Handle flexible array members.
2770 * typeck2.c (digest_init_r): Revert changes introduced in r231665.
2771 (process_init_constructor_array): Same.
2772 (process_init_constructor_record): Same.
2774 2016-02-03 Patrick Palka <ppalka@gcc.gnu.org>
2777 * pt.c (try_one_overload): Handle comparing argument packs so
2778 that there is no conflict if we deduced more arguments of an
2779 argument pack than were explicitly specified.
2781 2016-01-31 Jakub Jelinek <jakub@redhat.com>
2782 Jason Merrill <jason@redhat.com>
2785 * tree.c (strip_typedefs) [FUNCTION_TYPE]: Avoid building a new
2786 function type if nothing is changing.
2788 2016-01-31 Jason Merrill <jason@redhat.com>
2791 * pt.c (partial_specialization_p, impartial_args): New.
2792 (instantiate_decl): Call impartial_args.
2794 * mangle.c (maybe_check_abi_tags): New.
2795 (write_guarded_var_name): Call it.
2796 (mangle_ref_init_variable): Call check_abi_tags.
2798 * pt.c (lookup_template_class_1): Don't share TYPE_ATTRIBUTES
2799 between template and instantiation.
2801 2016-01-29 Jakub Jelinek <jakub@redhat.com>
2804 * decl.c (wrapup_globals_for_namespace): Warn about unused static
2805 function declarations.
2807 2016-01-29 Marek Polacek <polacek@redhat.com>
2811 * constexpr.c (cxx_eval_array_reference): Give the "array subscript
2812 out of bound" error earlier.
2813 * init.c (build_vec_init): Change NE_EXPR into GT_EXPR. Update the
2816 2016-01-29 Patrick Palka <ppalka@gcc.gnu.org>
2818 * name-lookup.c (begin_scope): After reusing a cp_binding_level
2819 structure, update free_binding_level before the structure's
2820 level_chain field gets cleared, not after.
2822 2016-01-28 Jason Merrill <jason@redhat.com>
2825 * search.c (dfs_walk_once, dfs_walk_once_r)
2826 (dfs_walk_once_accessible_r, dfs_walk_once_accessible): Use
2827 hash_set instead of BINFO_MARKED.
2828 (dfs_unmark_r): Remove.
2830 2016-01-28 Patrick Palka <ppalka@gcc.gnu.org>
2833 * parser.c (LEXER_DEBUGGING_ENABLED_P): New macro.
2834 (cp_lexer_debugging_p): Use it.
2835 (cp_lexer_start_debugging): Likewise.
2836 (cp_lexer_stop_debugging): Likewise.
2838 2016-01-27 Marek Polacek <polacek@redhat.com>
2841 * typeck.c (cp_build_binary_op): Promote operand to unsigned, if
2842 needed. Add -Wsign-compare warning.
2844 2016-01-27 Ryan Burn <contact@rnburn.com>
2847 * cp-gimplify.c (cilk_cp_gimplify_call_params_in_spawned_fn): Removed
2848 superfluous post_p argument in call to
2849 cilk_gimplify_call_params_in_spawned_fn.
2851 2016-01-27 Marek Polacek <polacek@redhat.com>
2854 * constexpr.c (cxx_eval_constant_expression): Handle PTRMEM_CSTs
2855 wrapped in NOP_EXPRs.
2857 2016-01-27 Martin Sebor <msebor@redhat.com>
2860 * mangle.c (mangle_decl): Reference the correct (saved) version
2861 of the ABI in -Wabi diagnostics.
2863 2016-01-27 Marek Polacek <polacek@redhat.com>
2866 * constexpr.c (cxx_eval_array_reference): Evaluate the number of
2867 elements of the array.
2869 2016-01-26 Jason Merrill <jason@redhat.com>
2872 * constexpr.c (register_constexpr_fundef): Keep the un-massaged body.
2873 (cxx_eval_call_expression): Don't look through clones.
2874 * optimize.c (maybe_clone_body): Clear DECL_SAVED_TREE of the alias.
2875 * semantics.c (expand_or_defer_fn_1): Keep DECL_SAVED_TREE of
2876 maybe-in-charge *tor.
2878 2016-01-26 Jason Merrill <jason@redhat.com>
2881 * constexpr.c (cxx_eval_bare_aggregate): Update TREE_CONSTANT
2882 and TREE_SIDE_EFFECTS.
2883 (cxx_eval_constant_expression) [CONSTRUCTOR]: Call
2884 verify_constructor_flags.
2886 2016-01-26 Jakub Jelinek <jakub@redhat.com>
2889 * cp-gimplify.c (cp_fold): If some operand folds to error_mark_node,
2890 return error_mark_node instead of building trees with error_mark_node
2893 2016-01-26 David Malcolm <dmalcolm@redhat.com>
2896 * error.c (print_instantiation_partial_context_line): Add missing
2897 newlines from output for the t == NULL case.
2898 (print_instantiation_partial_context): Remove call to pp_newline.
2900 2016-01-24 Patrick Palka <ppalka@gcc.gnu.org>
2903 2016-01-18 Patrick Palka <ppalka@gcc.gnu.org>
2908 * decl.c (grokdeclarator): Don't decay array parameter type to
2909 a pointer type if it's dependent.
2910 (grokparms): Invoke strip_top_quals instead of directly invoking
2911 cp_build_qualified_type.
2912 * pt.c (decay_dependent_array_parm_type): New static function.
2913 (type_unification_real): Call decay_dependent_array_parm_type
2914 to decay a dependent array parameter type to its corresponding
2915 pointer type before unification.
2916 (more_specialized_fn): Likewise.
2917 (get_bindings): Likewise.
2918 * tree.c (cp_build_qualified_type): Trivial typofix in
2921 2016-01-23 Martin Sebor <msebor@redhat.com>
2925 * decl2.c (is_late_template_attribute): Handle dependent argument
2926 to attribute align and attribute vector_size.
2928 2016-01-21 Jason Merrill <jason@redhat.com>
2931 * lambda.c (lambda_capture_field_type): Handle 'this' specially
2932 for init-capture, too.
2935 * decl.c (type_is_deprecated): Don't look into a typedef.
2939 * decl.c (copy_type_enum): Respect TYPE_USER_ALIGN.
2942 * decl.c (start_enum): Add attributes parameter.
2943 * parser.c (cp_parser_enum_specifier): Pass it.
2944 * pt.c (lookup_template_class_1): Pass it.
2945 * cp-tree.h: Adjust.
2947 2016-01-19 Jason Merrill <jason@redhat.com>
2950 * pt.c (convert_template_argument): Handle VAR_DECL properly.
2952 2016-01-19 Marek Polacek <polacek@redhat.com>
2955 * constexpr.c (clear_cv_cache): New.
2956 * cp-gimplify.c (clear_fold_cache): New.
2957 * cp-tree.h (clear_cv_cache, clear_fold_cache): Declare.
2958 * decl.c (finish_enum_value_list): Call them.
2961 * pt.c (tsubst_copy): Mark elements in expanded vector as used.
2963 2016-01-18 Patrick Palka <ppalka@gcc.gnu.org>
2968 * decl.c (grokdeclarator): Don't decay array parameter type to
2969 a pointer type if it's dependent.
2970 (grokparms): Invoke strip_top_quals instead of directly invoking
2971 cp_build_qualified_type.
2972 * pt.c (decay_dependent_array_parm_type): New static function.
2973 (type_unification_real): Call decay_dependent_array_parm_type
2974 to decay a dependent array parameter type to its corresponding
2975 pointer type before unification.
2976 (more_specialized_fn): Likewise.
2977 (get_bindings): Likewise.
2978 * tree.c (cp_build_qualified_type): Trivial typofix in
2981 2016-01-18 Jason Merrill <jason@redhat.com>
2983 * cp-gimplify.c (cp_fold) [CONSTRUCTOR]: Don't clobber the input.
2985 * cp-gimplify.c (cp_fold): Remove unnecessary special cases.
2988 * cp-gimplify.c (cp_fold) [COND_EXPR]: Simplify. Do fold COND_EXPR.
2989 (contains_label_1, contains_label_p): Remove.
2991 2016-01-16 Patrick Palka <ppalka@gcc.gnu.org>
2994 * pt.c (type_dependent_expression_p): For a function template
2995 specialization, a type is dependent iff any of its template
2998 2016-01-16 Patrick Palka <ppalka@gcc.gnu.org>
3000 * cp-array-notation.c (cp_expand_cond_array_notations): Return
3001 error_mark_node only if find_rank failed, not if it was
3004 2016-01-16 Patrick Palka <ppalka@gcc.gnu.org>
3007 * tree.c (build_min_non_dep_call_vec): Don't retain the
3008 KOENIG_LOOKUP_P flag of the non-dependent expression that's
3010 (build_min_non_dep_op_overload): Instead, do it here.
3012 2016-01-15 Jakub Jelinek <jakub@redhat.com>
3015 * parser.h (cp_token): Remove pragma_kind field. Add comment
3016 with number of unused bits.
3017 * parser.c (eof_token): Remove pragma_kind field initializer.
3018 (cp_lexer_get_preprocessor_token): Don't set pragma_kind
3019 field, don't clear CPP_PRAGMA u.value.
3020 (cp_parser_pragma_kind): New function.
3021 (cp_parser_omp_sections_scope, cp_parser_oacc_kernels_parallel,
3022 cp_parser_omp_construct, cp_parser_initial_pragma,
3023 cp_parser_pragma): Use cp_parser_pragma_kind instead of accessing
3026 2016-01-15 Jason Merrill <jason@redhat.com>
3029 * call.c (build_cxx_call): Use fold_non_dependent_expr.
3031 * typeck2.c (cxx_incomplete_type_diagnostic): Use the location of
3035 * typeck.c (decay_conversion): Don't call mark_rvalue_use for
3036 array/function-to-pointer conversion. Call
3037 complete_type_or_maybe_complain for lvalue-to-rvalue conversion.
3038 * call.c (convert_like_real): Print call context if
3039 decay_conversion errors.
3041 2016-01-14 Tom de Vries <tom@codesourcery.com>
3043 PR tree-optimization/68773
3044 * parser.c (cp_parser_oacc_declare, cp_parser_omp_declare_target): Don't
3047 2016-01-14 Jason Merrill <jason@redhat.com>
3050 * constexpr.c (find_array_ctor_elt): Handle splitting RANGE_EXPR.
3052 2016-01-12 Marek Polacek <polacek@redhat.com>
3055 * constexpr.c (cxx_eval_check_shift_p): Use permerror rather than
3056 error_at and adjust the return value.
3058 2016-01-12 Jakub Jelinek <jakub@redhat.com>
3062 * cp-gimplify.c (cp_gimplify_expr) <case INIT_EXPR>: Don't return
3063 GS_ERROR whenever seen_error (), only if *expr_p contains
3064 cilk spawn stmt, but cilk_detect_spawn_and_unwrap failed.
3068 * pt.c (tsubst_decl): If not local_p, clear DECL_TEMPLATE_INFO.
3070 2016-01-11 Jason Merrill <jason@redhat.com>
3073 * method.c (walk_field_subobs): Add dtor_from_ctor parm.
3074 (process_subob_fn): Likewise. Don't consider triviality if true.
3075 (synthesize_method_walk): Pass it.
3077 2016-01-11 David Malcolm <dmalcolm@redhat.com>
3080 * parser.c (cp_parser_postfix_expression): Initialize
3081 close_paren_loc to UNKNOWN_LOCATION; only use it if
3082 it has been written to by
3083 cp_parser_parenthesized_expression_list.
3084 (cp_parser_parenthesized_expression_list): Document the behavior
3085 with respect to the CLOSE_PAREN_LOC param.
3087 2016-01-11 Jakub Jelinek <jakub@redhat.com>
3090 * cp-gimplify.c (cp_fold): If COMPOUND_EXPR or MODIFY_EXPR
3091 folded operands have side-effects, but folding changed any of them,
3092 build a new tree with the folded operands instead of returning the
3095 2016-01-09 Marek Polacek <polacek@redhat.com>
3098 * decl2.c (comdat_linkage): Only set DECL_COMDAT if TREE_PUBLIC is set.
3100 2016-01-09 Jakub Jelinek <jakub@redhat.com>
3103 * class.c (layout_class_type): Use copy_node to copy FIELD_DECLs.
3105 2016-01-08 Jason Merrill <jason@redhat.com>
3108 * constexpr.c (cxx_fold_indirect_ref): Handle array type differing
3111 2016-01-08 Marek Polacek <polacek@redhat.com>
3114 * constexpr.c (cxx_eval_constant_expression): Handle NULL initializer.
3116 2016-01-08 Jason Merrill <jason@redhat.com>
3118 * constexpr.c (cxx_eval_call_expression): Remove convert_to_void
3123 * cvt.c (convert_to_void): Don't strip a TARGET_EXPR of
3124 TREE_ADDRESSABLE type.
3128 * call.c (unsafe_copy_elision_p): Look through COMPOUND_EXPR.
3130 2016-01-05 Nathan Sidwell <nathan@acm.org>
3133 * pt.c (build_non_dependent_expr): Don't try a checking fold when
3136 2016-01-04 Jakub Jelinek <jakub@redhat.com>
3138 Update copyright years.
3140 Copyright (C) 2016 Free Software Foundation, Inc.
3142 Copying and distribution of this file, with or without modification,
3143 are permitted in any medium without royalty provided the copyright
3144 notice and this notice are preserved.