1 2017-06-30 Jason Merrill <jason@redhat.com>
3 PR c++/81257 - ICE with invalid ::template.
4 PR c++/54769 - wrong lookup of dependent template-name.
5 * parser.c (cp_parser_template_name): Revert part of last change.
7 2017-06-30 Nathan Sidwell <nathan@acm.org>
9 * config-lang.in (gtfiles): Add cp/lex.c.
10 * cp-tree.h (mangle_convop_name_for_type): Rename ...
11 (make_conv_op_name): ... here. Move to lex.
12 * lambda.c (maybe_add_lambda_conv_op): Update.
13 * parser.c (cp_parser_conversion_function_id): Update.
14 * pt.c (tsubst_decl, tsubst_baselink, tsubst_copy,
15 tsubst_copy_and_build): Update.
16 * semantics.c (apply_deduced_return_type): Update.
17 * mangle.c (conv_type_hasher, conv_type_names,
18 mangle_conv_op_name_for_type): Move to ...
19 * lex.c (conv_type_hasher, conv_type_names, make_convop_name):
22 2017-06-30 David Malcolm <dmalcolm@redhat.com>
25 * parser.c (cp_parser_postfix_expression): Construct a location
26 for typeid expressions.
28 2017-06-30 Nathan Sidwell <nathan@acm.org>
30 * cp-tree.h (lookup_fnfields_1, class_method_index_for_fn): Don't
32 (lookup_all_conversions): Declare.
33 * class.c (get_basefndecls): Use lookup_fnfields_slot.
34 * decl.c (register_dtor_fn): Use lookup_fnfields_slot.
35 * decl2.c (check_class_fn): Use lookup_fnfields_slot. Rework
37 * pt.c (retrieve_specialization): Use lookup_fnfields_slot.
38 (check_explicit_specialization): Use lookup_fnfields_slot_nolazy,
39 lookup_all_conversions.
40 * search.c (lookup_fnfields_1): Make static.
41 (lookup_all_conversions): New.
42 (class_method_index_for_fn): Delete.
43 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Use
46 * call.c (build_new_method_call_1): Use constructo_name to get
47 ctor name. Move argument processing earlier to merge cdtor
49 * decl.c (grokfndecl): Cdtors have special names.
50 * method.c (implicitly_declare_fn): Likewise. Simplify flag setting.
51 * pt.c (check_explicit_specialization): Cdtor name is already
53 * search.c (class_method_index_for_fn): Likewise.
56 * name-lookup.c (do_pushdecl): Reset IDENTIFIER_TYPE when finding
59 2017-06-29 Paolo Carlini <paolo.carlini@oracle.com>
61 * class.c (add_method): Change pair of errors to error + inform.
62 (handle_using_decl): Likewise.
64 2017-06-29 Jason Merrill <jason@redhat.com>
66 * constexpr.c, error.c, tree.c: Remove WITH_CLEANUP_EXPR handling.
68 PR c++/81180 - ICE with C++17 deduction of member class template.
69 * pt.c (build_deduction_guide): Correct member template handling.
71 PR c++/81188 - matching decltype of member function call.
72 * tree.c (cp_tree_equal): Remove COMPONENT_REF special case.
74 2017-06-29 Nathan Sidwell <nathan@acm.org>
77 * parser.c (cp_parser_namespace_definition): Immediately close the
78 namespace if there's no open-brace.
79 * name-lookup.c (do_pushdecl): Reset OLD when pushing into new
82 2017-06-29 Jason Merrill <jason@redhat.com>
84 PR c++/81164 - ICE with invalid inherited constructor.
85 * search.c (binfo_direct_p): New.
86 * name-lookup.c (do_class_using_decl): Use it.
88 2017-06-29 Nathan Sidwell <nathan@acm.org>
90 * cp-tree.h (THIS_NAME, IN_CHARGE_NAME, VTBL_PTR_TYPE,
91 VTABLE_DELTA_NAME, VTABLE_PFN_NAME): Delete.
92 * decl.c (initialize_predefined_identifiers): Name cdtor special
93 names consistently. Use literals for above deleted defines.
94 (cxx_init_decl_processing): Use literal for vtbl_ptr_type name,
96 * lex.c (maybe_add_lang_type_raw): Exit early, rather than use a
99 * call.c (check_dtor_name): Use constructor_name for enums too.
100 (build_new_method_call_1): Use constructor_name for cdtors and
102 * class.c (build_self_reference): Use TYPE_NAME to get name of
104 * name-lookup (constructor_name): Use DECL_NAME directly.
105 (constructor_name_p): Reimplement.
106 (push_class_level_binding_1): Use TYPE_NAME directly.
108 * class.c (finish_struct): Use OVL_P.
109 (get_vfield_name): Measure constructor_name length.
110 * cp-tree.h (SET_CLASS_TYPE_P): Add RECORD_OR_UNION_CHECK.
111 (NON_UNION_CLASS_TYPE_P): Check RECORD_TYPE up front.
112 * cxx-pretty-print.c (is_destructor_name): Delete.
113 (pp_cxx_unqualified_id): Remove bogus destructor name checking.
114 * decl.c (grokfndecl): Move cheap checks first when looking for
115 implicit extern cness.
117 * parser.c (cp_parser_direct_declarator): Reorder if to avoid
118 indentation. Remove unnecessary assignment of constructor name.
121 * call.c (name_as_c_string): Move CONST_CAST to return.
122 (build_new_method_call_1): Remove unneeded bracing.
123 * class.c (include_empty_classes): Unbreak line.
124 * constraint.cc (tsubst_check_constraint): Add space.
125 * cp-tree.h (lang_decl_ns): Add comment.
126 (PTRMEM_CST_MEMBER): Break line.
127 * decl.c (grokfndecl): Add blank lines. Unbreak some others.
128 (grokdeclarator): Remove lines, move declaration to first use.
129 * decl2.c (decl_needed_p): Fix indentation.
130 (c_parse_final_cleanups): Remove blank line.
131 * method.c (implicitly_declare_fn): Move declaration to first use.
132 * search.c (current_scope): Add blank lines.
134 2017-06-28 Jason Merrill <jason@redhat.com>
136 PR c++/72764 - ICE with invalid template typename.
137 * decl.c (build_typename_type): No longer static.
138 * tree.c (strip_typedefs): Use it instead of make_typename_type.
140 PR c++/69300 - ICE with self-referential noexcept
141 * pt.c (maybe_instantiate_noexcept): Check for recursion.
143 PR c++/61022 - error with variadic template template parm
144 * pt.c (convert_template_argument): Keep the TYPE_PACK_EXPANSION.
146 PR c++/72801 - ICE with variadic partial specialization
147 * pt.c (unify_pack_expansion): Use PACK_EXPANSION_EXTRA_ARGS.
149 PR c++/55639 - partial specialization with ::template
150 * parser.c (cp_parser_class_head): Handle ::template.
152 PR c++/45976 - error with ::template in declarator.
153 * pt.c (resolve_typename_type): Fix TEMPLATE_ID_EXPR handling.
155 PR c++/54769 - wrong lookup of dependent template-name.
156 * parser.c (cp_parser_template_name): Handle dependent object type.
157 (cp_parser_nested_name_specifier_opt): Make template_keyword_p a
159 (cp_parser_id_expression): Pass it.
160 (cp_parser_diagnose_invalid_type_name): Handle TEMPLATE_ID_EXPR.
162 * parser.c (cp_parser_template_id): Use the range location on the
165 PR c++/81204 - parse error with dependent template-name
166 * parser.c (cp_parser_lookup_name): Disqualify function templates
169 2017-06-27 Nathan Sidwell <nathan@acm.org>
171 * pt.c (tsubst_decl <FUNCTION_DECL>): Move var decls to
172 initialization point. Don't unnecessarily check for ctor name.
174 * cp-tree.h (CLASSTYPE_DESTRUCTORS): Rename to ...
175 (CLASSTYPE_DESTRUCTOR): ... this.
176 * class.c (accessible_nvdtor_p,
177 maybe_warn_about_overly_private_class,
178 add_implicitly_declared_members,
179 clone_constructors_and_destructors, type_has_virtual_destructor):
180 Adjust for CLASSTYPE_DESTRUCTOR.
181 (deduce_noexcept_on_destructors): Absorb into ...
182 (check_bases_and_members): ... here.
183 * except.c (dtor_nothrow): Adjust for CLASSTYPE_DESTRUCTOR.
184 * init.c (build_delete): Likewise.
185 * parser.c (cp_parser_lookup_name): Likewise.
186 * pt.c (check_explicit_specialization): Likewise.
187 * rtti.c (emit_support_tinfos): Likewise.
188 * search.c (lookup_fnfields_idx_nolazy): Likewise.
190 Kill IDENTIFIER_TEMPLATE.
191 * cp-tree.h (lang_identifier): Remove class_template_info field.
192 (IDENTIFIER_TEMPLATE): Delete.
193 * name-lookup.c (constructor_name_full): Subsume into ...
194 (constructor_name): ... here. Don't check IDENTIFIER_TEMPLATE.
195 (constructor_name_p): Likewise.
196 * mangle.c (write_source_name): Likewise.
197 * ptree.c (cxx_print_identifier): Likewise.
199 2017-06-27 Marek Polacek <polacek@redhat.com>
202 * parser.c (cp_parser_already_scoped_statement): Initialize
205 2017-06-26 Jason Merrill <jason@redhat.com>
207 PR c++/81215 - deduction failure with variadic TTP.
208 * pt.c (unify_bound_ttp_args): Restore old logic for C++14 and down.
210 2017-06-26 Martin Sebor <msebor@redhat.com>
213 * call.c (maybe_warn_class_memaccess): Preserve explicit conversions
214 to detect casting away cv-qualifiers.
216 2017-06-26 Nathan Sidwell <nathan@acm.org>
218 * cp-tree.h (lang_decl_fn): Remove assignment_operator_p field.
219 (DECL_COMPLETE_CONSTRUCTOR_P): Directly compare
221 (DECL_BASE_CONSTRUCTOR_P, DECL_COMPLETE_DESTRUCTOR_P,
222 DECL_BASE_DESTRUCTOR_P, DECL_DELETING_DESTRUCTOR_P): Likewise.
223 (DECL_ASSIGNMENT_OPERATOR_P): Use IDENTIFIER_ASSIGN_OP_P.
224 * decl.c (grok_op_properties): Adjust identifier checking.
225 * init.c (expand_default_init): Adjust identifier descision.
226 * method.c (implicitly_declare_fn): Don't use
227 DECL_ASSIGNMENT_OPERATOR_P.
228 * search.c (lookup_fnfields_1): Use IDENTIFIER_CTOR_P,
230 * call.c (in_charge_arg_for_name): Reimplement.
231 (build_special_member_call): Use IDENTIFIER_CDTOR_P,
234 2017-06-26 Marek Polacek <polacek@redhat.com>
237 * parser.c (cp_parser_statement): Add a default argument. Save the
238 location of the expression-statement after labels have been parsed.
239 (cp_parser_implicitly_scoped_statement): Set the location of the
240 body of the conditional after parsing all the labels. Call
241 warn_for_multistatement_macros.
242 (cp_parser_already_scoped_statement): Likewise.
244 2017-06-24 Paolo Carlini <paolo.carlini@oracle.com>
247 * parser.c (cp_parser_diagnose_invalid_type_name): Don't print
248 'typename' in error messages about missing 'typename'.
250 2017-06-23 Jason Merrill <jason@redhat.com>
252 PR c++/79056 - C++17 ICE with invalid template syntax.
253 * parser.c (cp_parser_simple_type_specifier): Don't assume that type
255 (cp_parser_check_for_invalid_template_id): Handle TYPE_DECL.
256 * pt.c (template_placeholder_p): New.
257 * cp-tree.h: Declare it.
259 2017-06-23 Marc Glisse <marc.glisse@inria.fr>
261 * decl.c (duplicate_decls): Use builtin_structptr_types.
263 2017-06-22 Nathan Sidwell <nathan@acm.org>
265 Reorder IDENTIFIER flags
267 * cp-tree.h (enum cp_identifier_kind): New.
268 (IDENTIFIER_KIND_BIT_0, IDENTIFIER_KIND_BIT_1,
269 IDENTIFIER_KIND_BIT_2): New.
270 (IDENTIFIER_MARKED): Move to TREE_LANG_FLAG_4.
271 (IDENTIFIER_VIRTUAL_P, IDENTIFIER_REPO_CHOSEN): Add IDENTIFIER_CHECK.
272 (C_IS_RESERVED_WORD): Replace with ...
273 (IDENTIFIER_KEYWORD_P): ... this.
274 (IDENTIFIER_CTOR_OR_DTOR_P): Replace with ...
275 (IDENTIFIER_CDTOR_P): ... this.
276 (IDENTIFIER_CTOR_P, IDENTIFIER_DTOR_P): New.
277 (IDENTIFIER_OPNAME_P): Replace with ...
278 (IDENTIFIER_ANY_OP_P): ... this.
279 (IDENTIFIER_ASSIGN_OP_P): New.
280 (IDENTIFIER_TYPENAME_P): Replace with ...
281 (IDENTIFIER_CONV_OP_P): ... this.
282 (NEW_DELETE_OPNAME_P): Replace with ...
283 (IDENTIFIER_NEWDEL_OP_P): ... this.
284 (DECL_CONV_FN_P, DECL_OVERLOADED_OPERATOR_P): Adjust.
285 (get_identifier_kind_name, set_identifier_kind): Declare.
286 * lex.c (get_identifier_kind_name, set_identifier_kind): New.
287 (init_operators): Adjust to avoid keywords, use
288 set_identifier_kind. Copy TYPE_EXPR slot.
289 (init_reswords): Call set_identifier_kind.
290 (unqualified_name_lookup_error): Adjust.
291 * operators.def (TYPE_EXPR): Remove.
292 * decl.c (struct predefined_identifier): Move into ...
293 (initialize_predefined_identifiers): ... here. Call
295 (grokfndecl, check_var_type, grokdeclarator): Adjust.
296 (grok_op_properties): Use IDENTIFIER_ANY_ASSIGN_OP to halve search
298 * call.c (name_as_c_string): Adjust.
299 (build_new_method_call_1): Likewise.
300 * cp-cilkplus.c (is_conversion_operator_function_decl_p): Likewise.
301 * cxx-pretty-print.c (pp_cxx_unqualified_id): Adjust.
302 * dump.c (cp_dump_tree): Adjust.
303 * error.c (dump_decl_name): Adjust.
304 * mangle.c (write_unqualified_id, write_member_name,
305 write_expression): Adjust.
306 (mangle_conv_op_name_for_type): Use set_identifier_kind.
307 * name-lookup.c (do_class_using_decl): Adjust.
308 (lookup_name_fuzzy, lookup_name_real_1): Likewise.
309 * parser.c (cp_lexer_get_preprocessor_token,
310 cp_parser_direct_declarator): Likewise.
311 * pt.c (push_template_decl_real, tsubst_decl, tsubst_baselink,
312 tsubst_copy, tsubst_copy_and_build): Adjust.
313 * ptree.c (cxx_print_identifier): Print identifier kind.
314 * search.c (lookup_field_r, lookup_member,
315 lookup_fnfields_idx_nolazy): Adjust.
316 * semantics.c (finish_id_expression): Adjust..
317 * typeck.c (cp_build_addr_expr_1): Adjust.
319 2017-06-21 Jakub Jelinek <jakub@redhat.com>
322 * semantics.c (handle_omp_array_sections_1, finish_omp_clauses):
323 Complain about t not being a variable if t is OVERLOAD even
324 when processing_template_decl.
326 2017-06-21 David Malcolm <dmalcolm@redhat.com>
328 * parser.c (get_cast_suggestion): New function.
329 (maybe_add_cast_fixit): New function.
330 (cp_parser_cast_expression): Capture the location of the closing
331 parenthesis. Call maybe_add_cast_fixit when emitting warnings
332 about old-style casts.
334 2017-06-20 Jason Merrill <jason@redhat.com>
336 PR c++/80972 - C++17 ICE with attribute packed.
337 * call.c (build_over_call): Allow a TARGET_EXPR from reference
340 2017-06-20 Nathan Sidwell <nathan@acm.org>
342 * cp-tree.h (CPTI_NELTS_IDENTIFIER): Delete.
343 (nelts_identifier): Delete.
344 * decl.c (initialize_predefined_identifiers): Remove nelts.
346 PR c++/67074 - namespace aliases
347 * decl.c (duplicate_decls): Don't error here on mismatched
349 * name-lookup.c (name_lookup::add_value): Matching namespaces are
351 (diagnose_name_conflict): Namespaces are never redeclarations.
352 (update_binding): An alias can match a real namespace.
354 2017-06-19 Jason Merrill <jason@redhat.com>
356 PR c++/80562 - ICE with constexpr if.
357 * semantics.c (finish_if_stmt_cond): Call
358 instantiate_non_dependent_expr.
360 PR c++/80829 - ICE with constexpr copy of base subobject.
361 * constexpr.c (clear_no_implicit_zero): New.
362 (cxx_eval_call_expression): Call it.
364 2017-06-19 Nathan Sidwell <nathan@acm.org>
368 * name-lookup.c (set_decl_namespace): Don't follow using
369 directives and ignore using decls. Only check overly-explicit
370 scope after discovering decl.
372 2017-06-19 Jason Merrill <jason@redhat.com>
374 PR c++/81073 - constexpr and static var in statement-expression.
375 * typeck2.c (store_init_value): Always call
376 require_potential_constant_expression.
377 * pt.c (convert_nontype_argument): Likewise.
378 * constexpr.c (potential_constant_expression_1): Adjust message.
379 Use decl_maybe_constant_var_p instead of decl_constant_var_p.
380 * decl2.c (decl_maybe_constant_var_p): Consider initializer.
382 2017-06-19 Nathan Sidwell <nathan@acm.org>
384 * pt.c (coerce_template_parms): Fix indentation.
385 (tsubst_decl): Remove repeated SET_DECL_RTL. Move VAR_P handling
389 * name-lookup.c (update_binding): Only warn about constructors
392 2017-06-17 Jason Merrill <jason@redhat.com>
394 PR c++/60063 - -Wunused-local-typedefs and templates.
395 * decl2.c (is_late_template_attribute): Return false for "used".
397 PR c++/70844 - -Wuseless-cast and inheriting constructor.
398 * method.c (forward_parm): Suppress warn_useless_cast.
400 2017-06-16 Jason Merrill <jason@redhat.com>
402 PR c++/81045 - Wrong type-dependence with auto return type.
403 * pt.c (type_dependent_expression_p): An undeduced auto outside the
404 template isn't dependent.
405 * call.c (build_over_call): Instantiate undeduced auto even in a
408 PR c++/80465 - ICE with generic lambda with noexcept-specifier.
409 * lambda.c (maybe_add_lambda_conv_op): Keep processing_template_decl
410 set longer for a generic lambda.
412 PR c++/80614 - Wrong mangling for C++17 noexcept type
413 * mangle.c (write_type): Put the eh spec back on the function type.
415 PR c++/81102 - Wrong error with partial specialization.
416 * pt.c (unify) [TEMPLATE_PARM_INDEX]: Strip reference when comparing
417 types. Do type deduction later.
419 PR c++/81074 - ICE with partial specialization of member template.
421 * pt.c (get_partial_spec_bindings): Only coerce innermost args.
423 PR c++/80831 - ICE with -fsyntax-only.
424 * decl2.c (c_parse_final_cleanups): Use cgraph_node::get_create.
426 PR c++/80639 - ICE with invalid PMF initialization.
427 PR c++/80043 - ICE with -fpermissive
428 * typeck.c (convert_for_assignment): Recurse when instantiate_type
429 returns without an error.
431 2017-06-16 Nathan Sidwell <nathan@acm.org>
433 * pt.c (tsubst_baselink): Fix & clarify formatting.
435 * cp-tree.h (build_this_parm, cp_build_parm_decl,
436 build_artificial_parm): Add FN parm.
437 * decl.c (start_cleanup_fn): Adjust.
438 (build_this_parm): Add FN parm, pass it through.
439 (grokfndecl): Adjust parm building.
440 * decl2.c (cp_build_parm_decl): Add FN parm, set context.
441 (build_artificial_parm): Add FN parm, pass through.
442 (maybe_retrofit_in_chrg): Adjust parm building.
443 (start_static_storage_duration_function): Likwise.
444 * lambda.c (maybe_aadd_lambda_conv_op): Likewise.
445 * method.c (implicitly_declare_fn): Likewise.
446 * parser.c (inject_this_parameter): Likewise.
448 Symbol tables are insert only.
449 * cp-tree.h (default_hash_traits <lang_identifier *>): Don't
450 derive from pointer_hash. Make undeletable.
452 * class.c (resort_type_method_vec): Avoid potential unsigned
455 Don't defer noexcept_deferred_spec.
456 * cp-tree.h (unevaluated_noexcept_spec): Don't declare.
457 * decl.c (cxx_init_decl_processing): Initialize
458 noexcept_deferred_spec.
459 * except.c (unevaluated_noexcept_spec): Delete.
460 * class.c (deduce_noexcept_on_destructor): Use
461 noexcept_deferred_spec directly.
462 * method.c (implicitly_declare_fn): Likewise.
464 Make keyed_classes a vector.
465 * cp-tree.h (CPTI_KEYED_CLASSES, keyed_classes): Delete.
466 (keyed_classes): Declare as vector.
467 * decl.c (keyed_classes): Define.
468 (cxx_init_decl_processing): Allocate it.
469 (record_key_method_defined): Use vec_safe_push.
470 * class.c (finish_struct_1): Likewise.
471 * pt.c (instantiate_class_template_1): Likewise.
472 * decl2.c (c_parse_final_cleanups): Reverse iterate keyed_classes.
475 * rtti.c (enum tinfo_kind): Add TK_DERIVED_TYPES,
476 TK_VMI_CLASS_TYPES, TK_MAX. Delete TK_FIXED.
478 (typeid_ok_p): Add quotes to error messages. Use get_tinfo_desc.
479 (get_tinfo_decl): Use get_tinfo_desc.
480 (get_pseudo_ti_init): Likewise. Adjust VMI construction.
481 (create_pseudo_type_info): Delete.
482 (get_pseudo_ti_index): Just determine the index.
483 (get_tinfo_desc): New. Create all types lazily.
484 (create_tinfo_types): Just allocate the descriptor array.
485 (emit_support_tinfos): Use non-inserting type lookup. Set builtin
488 2017-06-15 Martin Sebor <msebor@redhat.com>
491 * call.c (first_non_public_field, maybe_warn_class_memaccess): New
493 (has_trivial_copy_assign_p, has_trivial_copy_p): Ditto.
494 (build_cxx_call): Call maybe_warn_class_memaccess.
496 2017-06-14 Jakub Jelinek <jakub@redhat.com>
498 * cp-gimplify.c (cp_genericize_r): Turn most of the function
499 into a switch (TREE_CODE (stmt)) statement from long else if
502 2017-06-13 Jakub Jelinek <jakub@redhat.com>
505 * cp-gimplify.c (cp_genericize_r): Don't instrument MEM_REF second
506 argument even if it has REFERENCE_TYPE.
509 * cp-gimplify.c (cp_genericize): Only look for VAR_DECLs in
510 BLOCK_VARS (outer) chain.
511 (cxx_omp_const_qual_no_mutable): Likewise.
513 2017-06-13 Martin Liska <mliska@suse.cz>
516 * class.c (build_base_path): Use sanitize_flags_p.
517 * cp-gimplify.c (cp_genericize_r): Likewise.
518 (cp_genericize_tree): Likewise.
519 (cp_genericize): Likewise.
520 * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
521 * decl.c (compute_array_index_type): Likewise.
522 (start_preparsed_function): Likewise.
523 * decl2.c (one_static_initialization_or_destruction): Likewise.
524 * init.c (finish_length_check): Likewise.
525 * lambda.c (maybe_add_lambda_conv_op): Likewise.
526 * typeck.c (cp_build_binary_op): Likewise.
527 (build_static_cast_1): Likewise.
529 2017-06-11 Jason Merrill <jason@redhat.com>
531 * error.c (dump_expr): Use is_this_parameter.
533 * cp-tree.h, decl2.c, mangle.c, parser.c, pt.c, semantics.c: Use
536 2017-06-09 Jason Merrill <jason@redhat.com>
538 Missing bits from N4268, constant evaluation for all non-type args.
539 * call.c (build_converted_constant_expr): Rename from
540 build_integral_nontype_arg_conv, handle all types.
541 * pt.c (convert_nontype_argument): In C++17 call it for all types.
542 Move NOP stripping inside pointer case, don't strip ADDR_EXPR.
543 * cvt.c (strip_fnptr_conv): Also strip conversions to the same type.
545 Overhaul pointer-to-member conversion and template argument handling.
546 * call.c (standard_conversion): Avoid creating ck_pmem when the
547 class type is the same.
548 * cvt.c (can_convert_qual): Split from
549 perform_qualification_conversions.
550 * constexpr.c (cxx_eval_constant_expression): Check it.
551 * typeck.c (convert_ptrmem): Only cplus_expand_constant if
552 adjustment is necessary.
553 * pt.c (check_valid_ptrmem_cst_expr): Compare class types.
554 (convert_nontype_argument): Avoid redundant error.
556 * call.c (convert_like_real): Remove "inner" parameter.
557 Don't replace a constant with its value.
558 * cp-gimplify.c (cp_fully_fold): Use cp_fold_rvalue.
560 * pt.c (convert_nontype_argument): Check NULLPTR_TYPE_P rather than
563 * parser.c (cp_parser_constant_expression): Check
564 potential_rvalue_constant_expression after decay_conversion.
565 * pt.c (convert_nontype_argument): Don't require linkage in C++17.
567 PR c++/80384 - ICE with dependent noexcept-specifier
568 * pt.c (dependent_type_p_r) [FUNCTION_TYPE]: Check for dependent
571 * constexpr.c (potential_constant_expression_1): Allow 'this' capture.
573 2017-06-09 Jan Hubicka <hubicka@ucw.cz>
575 * class.c (build_vtbl_initializer): Mark dvirt_fn as cold.
576 * decl.c (cxx_init_decl_processing, push_throw_library_fn): Likewise.
577 (excpet.c): Mark terminate as cold.
579 2017-06-08 Jakub Jelinek <jakub@redhat.com>
582 * semantics.c (handle_omp_array_sections_1): Convert TYPE_MAX_VALUE
583 to sizetype before size_binop.
586 * cp-gimplify.c (cxx_omp_finish_clause): When changing clause
587 to OMP_CLAUSE_SHARED, also clear OMP_CLAUSE_SHARED_FIRSTPRIVATE
588 and OMP_CLAUSE_SHARED_READONLY flags.
590 2017-06-08 Jan Hubicka <hubicka@ucw.cz>
592 * cp-tree.h (lang_check_failed): Annotate by ATTRIBUTE_COLD.
594 2017-06-07 Nathan Sidwell <nathan@acm.org>
596 * class.c (layout_class_type): Restructure overlong-bitfield tpe
599 2017-06-07 Jonathan Wakely <jwakely@redhat.com>
602 * pt.c (do_class_deduction): Build qualified type.
604 2017-06-06 Nathan Sidwell <nathan@acm.org>
606 * name-lookup.c (suggest_alternatives_for): Use qualified lookup
607 sans using directives. Don't walk into inline namespaces.
610 * name-lookup.c (adl_class_only): Don't add visible friends.
612 2017-06-05 Volker Reichelt <v.reichelt@netcologne.de>
614 * parser.c (cp_parser_base_specifier): Fix typos in error messages.
616 2017-06-02 Nathan Sidwell <nathan@acm.org>
618 Remove lang_type_ptrmem.
619 * cp-tree.h (lang_type_header): Remove is_lang_type_class. Move
621 (lang_type_class): ... this. Reorder bitfields. Rename to ...
622 (lang_type): ... this. Delete old definition.
623 (lang_type_ptrmem): Delete.
624 (LANG_TYPE_CLASS_CHECK): Simply get TYPE_LANG_SPECIFIC. Adjust uses.
625 (LANG_TYPE_PTRMEM_CHECK): Delete.
626 (TYPE_GET_PTRMEMFUNC_TYPE, TYPE_SET_PTRMEMFUNC_TYPE): Delete.
627 (TYPE_PTRMEMFUNC_TYPE): New. Use TYPE_LANG_SLOT_1.
628 * decl.c (build_ptrmemfunc_type): Adjust.
629 * lex.c (copy_lang_type): Remove lang_type_ptrmem handling.
630 (maybe_add_lang_type_raw): Don't set u.c.h.is_lang_type_class.
632 * class.c (check_bases_and_members): Adjust vec_new_uses_cookie
635 Remove cp_binding_level::namespaces
636 * name-lookup.h (cp_binding_level): Lose namespaces field.
637 * name-lookup.c (add_decl_to_level): Chain namespaces on the names
639 (suggest_alternatives_for): Adjust for namespace list. Do
640 breadth-first search.
641 * decl2.c (collect_source_refs): Namespaces are on the regulr
643 (collect_ada_namespace): Likewise.
645 2017-06-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
647 * typeck.c (cp_build_binary_op): Implement the -Wsizeof_pointer_div
650 2017-06-01 Ville Voutilainen <ville.voutilainen@gmail.com>
653 * method.c (constructible_expr): Strip array types before calling
656 2017-06-01 Paolo Carlini <paolo.carlini@oracle.com>
659 * cvt.c (convert_to_void): Possibly call maybe_warn_nodiscard
660 for case INDIRECT_REF too in the main switch.
662 2017-05-31 Jason Merrill <jason@redhat.com>
664 PR c++/80840 - ICE with constexpr and reference
665 * pt.c (convert_nontype_argument): Don't test whether a decl is
666 value-dependent when binding to a reference.
668 2017-05-31 Nathan Sidwell <nathan@acm.org>
670 * cp-tree.h (lang_decl_slector): New enum.
671 (lang_decl_base): Make selector an enum. Drop decomposition_p
673 (lang_decl): Use enum for discrimination.
674 (LANG_DECL_FN_CHECK, LANG_DECL_NS_CHECK, LANG_DECL_PARM_CHECK,
675 LANG_DECL_DEOMP_CHECK): Use enum.
676 (DECL_DECOMPOSITION_P): Use selector value.
677 (SET_DECL_DECOMPOSITION_P): Delete.
678 (retrofit_lang_decl): Lose SEL parm.
679 (fit_decomposition_lang_decl): Declare.
680 * decl.c (cp_finish_decomp, grokdeclarator): Use
681 fit_decomposition_lang_decl.
682 * lex.c (maybe_add_lang_decl_raw): New. Broken out of
684 (set_decl_linkage): New. Broken out of retrofit_lang_decl. Use enum.
685 (fit_decomposition_lang_decl): Likewise.
686 (retrofit_lang_decl): Use worker functions.
687 (cxx_dup_lang_specific_decl): Use selector enum.
688 (maybe_add_lang_type_raw): New. Broken out of ...
689 (cxx_make_type_name): ... here. Call it.
691 2017-05-30 Jason Merrill <jason@redhat.com>
693 PR c++/80856 - ICE with local extern in template
694 * semantics.c (finish_call_expr): Replace a local extern overload
695 set in a template with the IDENTIFIER_NODE.
697 2017-05-30 David Malcolm <dmalcolm@redhat.com>
699 * call.c (perform_implicit_conversion_flags): Convert
700 "from %qT to %qT" to "from %qH to %qI" in diagnostic.
701 (print_conversion_rejection): Replace pairs of %qT with
702 %qH and %qI in various places.
703 (build_user_type_conversion_1): Likewise.
704 (build_integral_nontype_arg_conv): Likewise.
705 (build_conditional_expr_1): Likewise.
706 (convert_like_real): Likewise.
707 (convert_arg_to_ellipsis): Likewise.
709 (initialize_reference): Likewise.
710 * cvt.c (cp_convert_to_pointer): Likewise.
711 (cp_convert_to_pointer): Likewise.
712 (convert_to_reference): Likewise.
713 (ocp_convert): Likewise.
714 * error.c (cp_printer): Gain bool and const char ** parameters.
715 (struct deferred_printed_type): New struct.
716 (class cxx_format_postprocessor): New class.
717 (cxx_initialize_diagnostics): Wire up a cxx_format_postprocessor
718 to pp->m_format_postprocessor.
719 (comparable_template_types_p): New function.
720 (newline_and_indent): New function.
721 (arg_to_string): New function.
722 (print_nonequal_arg): New function.
723 (print_template_differences): New function.
724 (type_to_string_with_compare): New function.
725 (print_template_tree_comparison): New function.
726 (append_formatted_chunk): New function.
727 (add_quotes): New function.
728 (cxx_format_postprocessor::handle): New function.
729 (defer_phase_2_of_type_diff): New function.
730 (cp_printer): Add "quoted" and "buffer_ptr" params. Implement
732 * typeck.c (cp_build_binary_op): Replace pairs of %qT with
733 %qH and %qI in various places.
734 (convert_member_func_to_ptr): Likewise.
735 (build_reinterpret_cast_1): Likewise.
736 (convert_for_assignment): Likewise.
737 * typeck2.c (check_narrowing): Likewise.
739 2017-05-30 Nathan Sidwell <nathan@acm.org>
741 Kill IDENTIFIER_NAMESPACE_BINDINGS
742 * cp-tree.h (lang_identifier): Delete namespace_bindings.
743 (IDENTIFIER_NAMESPACE_BINDINGS): Delete.
744 (lang_decl_ns): Add bindings.
745 (DECL_NAMESPACE_BINDINGS): New.
746 * lex.c (retrofit_lang_decl): Create namespace hash table.
747 * name-lookup.c (find_namespace_slot): Change to use hash-map.
748 * ptree.c (cxx_print_binding): Delete.
749 (cxx_print_identifier): Remove NAMESPACE_BINDING printing.
751 * cp-tree.def (OVERLOAD): Fix comment.
752 * cp-tree.h: Fix comments and whitespace.
753 * error.c (dump_decl): Use pp_cxx_colon_colon, ovl_scope.
754 * name-lookup.c (add_decl_to_level): Assert not class.
755 (check_local_shadow): Use OVL_P.
756 (pushdecl_with_scope_1): Rename to ...
757 (do_pushdecl_with_Scope): ... here.
758 (do_nonmember_using_decl): Use qualified_namespace_lookup return
760 (push_class_level_binding_1): Use OVL_P.
761 (pushdecl_namespace_level): Use do_pushdecl_with_scope.
762 (pushtag_1): Rename to ...
763 (do_pushtag): ... here. Adjust do_pushdecl_with_scope call.
765 (store_class_bindings): Do not time here.
766 * name-lookup.h (pushdecl_outermost_localscope): Reorder.
767 * pt.c (listify): Declare argvec at point of initialization.
770 * name-lookup.c (add_decl_to_level): Assert not making a circular
772 (update_binding): Don't prematurely slide artificial decl.
774 2017-05-29 Alexandre Oliva <aoliva@redhat.com>
776 * cp-tree.h (lang_identifier): Drop oracle_looked_up, unused.
778 2017-05-29 Nathan Sidwell <nathan@acm.org>
781 * cp-tree.h (lookup_maybe_add): Add DEDUPING argument.
782 * name-lookup.c (name_lookup): Add deduping field.
783 (name_lookup::preserve_state, name_lookup::restore_state): Deal
785 (name_lookup::add_overload): New.
786 (name_lookup::add_value, name_lookup::add_fns): Call add_overload.
787 (name_lookup::search_adl): Set deduping. Don't unmark here.
788 * pt.c (most_specialized_instantiation): Revert previous change,
789 Assert not given duplicates.
790 * tree.c (lookup_mark): Just mark the underlying decls.
791 (lookup_maybe_add): Dedup using marked decls.
794 * ptree.c (cxx_print_xnode): Show internal OVERLOAD structure.
795 * tree.c (ovl_insert, ovl_iterator_remove_node): Fix copying assert.
797 Stat hack representation
798 * name-lookup.c (STAT_HACK_P, STAT_TYPE, STAT_DECL,
799 MAYBE_STAT_DECL, MAYBE_STAT_TYPE): New.
801 (find_namespace_binding): Replace with ...
802 (find_namespace_slot): ... this.
803 (find_namespace_value): New.
804 (name_lookup::search_namespace_only,
805 name_lookup::adl_namespace_only): Adjust.
806 (update_binding): Add SLOT parameter, adjust.
807 (check_local_shadow): Use find_namespace_value.
808 (set_local_extern_decl_linkage): Likewise.
809 (do_pushdecl): Adjust for namespace slot.
810 (push_local_binding): Assert not a namespace binding.
811 (check_for_out_of_scope_variable): Use find_namespace_value.
812 (set_identifier_type_value_with_scope): Likewise.
813 (get_namespace_binding): Likewise.
814 (set_namespace_binding): Delete.
815 (set_global_binding): Directly update the binding.
816 (finish_namespace_using_decl): Likewise.
817 (lookup_type_scope_1): Use find_namespace_slot and update.
818 (do_push_nested_namespace): Use find_namespace_value.
821 * pt.c (most_specialized_instantiation): Cope with duplicate
825 * cp-tree.h (build_min_nt_call_vec): Declare.
826 * decl.c (build_offset_ref_call_from_tree): Call it.
827 * parser.c (cp_parser_postfix_expression): Likewise.
828 * pt.c (tsubst_copy_and_build): Likewise.
829 * semantics.c (finish_call_expr): Likewise.
830 * tree.c (build_min_nt_loc): Keep unresolved lookups.
831 (build_min): Likewise.
832 (build_min_non_dep): Likewise.
833 (build_min_non_dep_call_vec): Likewise.
834 (build_min_nt_call_vec): New.
837 * tree.c (ovl_copy): Adjust assert, copy OVL_LOOKUP.
839 (lookup_keep): Call it.
841 2017-05-26 Nathan Sidwell <nathan@acm.org>
844 * name-lookup.c (push_inline_namespaces): New.
845 (push_namespace): Look inside inline namespaces.
847 Inline and using namespace representation change.
848 * cp-tree.h (struct lang_decl_ns): Delete ns_using. Add usings,
850 (DECL_NAMESPACE_USING): Adjust.
851 (DECL_NAMESPACE_INLINEES): New.
852 * name-lookup.h (struct cp_binding_level): Change usings
854 * name-lookup.c (name_lookup::do_queue_usings,
855 name_lookup::queue_usings): Adjust.
856 (name_lookup::search_namespace, name_lookup::search_usings,
857 name_lookup::queue_namespace): Adjust.
858 (name_lookup::adl_namespace_only): Adjust.
859 (add_using_namespace, push_namespace): Push onto vector.
860 (pop_namespace): Add timing logic.
862 * call.c (build_operator_new_call): Do namelookup and ADL here.
863 (build_new_op_1): Likewise.
864 * name-lookup.h (lookup_function_nonclass): Delete declaration.
865 (do_using_directive): Likewise.
866 * name-lookup.c (set_namespace_binding, push_local_binding): Don't
868 (struct scope_binding): Delete.
869 (EMPTY_SCOPE_BINDING): Delete.
870 (set_decl_namespace): Use OVL_P.
871 (finish_local_using_decl): Lose unnecesary checks.
872 (lookup_function_nonclass): Delete.
873 (cp_emit_debug_info_for_using): Use MAYBE_BASELINK_P.
875 * cp-tree.h (OVL_CHAIN): Check looking at OVERLOAD.
876 (ovl_iterator): Add allow_inner field. Adjust ctor. Make
878 (ovl_iterator::maybe_push, ovl_iterator::pop): New.
879 (lkp_iterator): Add outer field. Adjust ctor.
880 (lkp_iterator::operator++): New.
881 (lookup_mark, lookup_maybe_add): Declare.
882 * name-lookup.c (name_lookup): Delete fn_set member.
883 (name_lookup::preserve_state, name_lookup::restore_state): Unmark
885 (name_lookup::add_value): Use lookup_add directly.
886 (name_lookup::add_fns: Use lookup_maybe_add.
887 (name_lookup::search_adl): Mark and unmark fns.
889 * pt.c (check_explicit_specialization): Use lookup_add directly.
890 * ptree.c (cxx_print_xnode): Show complete overload structure.
891 * tree.c (lookup_mark, lookup_maybe_add): New.
893 * name-lookup.c (name_lookup::search_adl): ADL OMP UDR type args.
895 2017-05-26 Jakub Jelinek <jakub@redhat.com>
897 * cp-tree.h (struct lang_decl_decomp): New type.
898 (struct lang_decl): Add u.decomp.
899 (LANG_DECL_DECOMP_CHECK): Define.
900 (DECL_DECOMPOSITION_P): Note it is set also on the vars
901 for user identifiers.
902 (DECL_DECOMP_BASE): Define.
903 (retrofit_lang_decl): Add extra int = 0 argument.
904 * lex.c (retrofit_lang_decl): Add SEL argument, if non-zero
905 use it to influence the selector choices and for selector
906 0 to non-zero transition copy old content.
907 (cxx_dup_lang_specific_decl): Handle DECL_DECOMPOSITION_P.
908 * decl.c (poplevel): For DECL_DECOMPOSITION_P, check
909 !DECL_DECOMP_BASE instead of !DECL_VALUE_EXPR. Adjust warning
910 wording if decl is a structured binding.
911 (cp_finish_decomp): Pass 4 as the new argument to retrofit_lang_decl.
912 Set DECL_DECOMP_BASE. Ignore DECL_READ_P sets from initialization
913 of individual variables for tuple structured bindings.
914 (grokdeclarator): Pass 4 as the new argument to retrofit_lang_decl.
915 Clear DECL_DECOMP_BASE.
916 * decl2.c (mark_used): Mark DECL_DECOMP_BASE TREE_USED as well.
917 * pt.c (tsubst_decomp_names): Assert DECL_DECOMP_BASE matches what
919 * expr.c (mark_exp_read): Recurse on DECL_DECOMP_BASE instead of
922 2017-05-25 Jason Merrill <jason@redhat.com>
924 PR c++/80605 - __is_standard_layout and zero-length array
925 * class.c (check_bases): Use DECL_FIELD_IS_BASE.
927 2017-05-25 Nathan Sidwell <nathan@acm.org>
929 Kill OVL_CURRENT, OVL_NEXT.
930 * cp-tree.h (OVL_CURRENT, OVL_NEXT): Delete.
931 * name-lookup.c (set_decl_namespace): Use ovl_iterator.
932 (consider_binding_level): Use OVL_FIRST.
933 (cp_emit_debug_info_for_using): Use lkp_iterator.
934 * pt.c (check_explicit_specialization): Use ovl_iterator.
936 Kill DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS.
937 * cp-tree.h (lang_decl_ns): Remove ns_users field.
938 (DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS): Delete.
939 (TREE_INDIRECT_USING): Delete.
940 * name-lookup.h (is_associated_namespace): Delete.
941 * name-lookup.c (name_lookup::search_usings,
942 name_lookup::do_queue_usings): Usings are always direct.
943 (is_associated_namespace): Delete.
944 (handle_namespace_attrs): Use DECL_NAMESPACE_INLINE_P.
945 (namespace_ancestor_1, namespace_ancestor): Delete.
946 (push_using_directive_1, push_using_directive): Delete.
947 (add_using_namespace_1): Delete.
948 (add_using_namespace): Reimplement.
949 (emit_debug_info_using_namespace): New.
950 (finish_namespace_using_directive, finish_local_using_directive,
951 push_namespace): Adjust.
952 * tree.c (cp_free_lang_data): Remove DECL_NAMESPACE_USERS handling.
954 2017-05-25 Volker Reichelt <v.reichelt@netcologne.de>
956 * semantics.c (finish_handler_parms): Warn about non-reference type
959 2017-05-25 Nathan Sidwell <nathan@acm.org>
961 Reimplement unqualified namespace lookup.
962 * name-lookup.c (name_lookup::using_pair,
963 name_lookup::using_queue): New typedefs.
964 (name_lookup::queue_namespace, name_lookup::do_queue_usings,
965 name_lookup::queue_usings): New.
966 (name_lookup::search_unqualified): New.
967 (merge_functions, same_entity_p, ambiguous_decl,
968 unqualified_namespace_lookup_1, unqualified_namespace_lookup,
969 lookup_using_namespace): Delete.
970 (lookup_name_real_1): Adjust.
972 Reimplement qualified namespace lookup.
973 * name-lookup.c (name_lookup::flags): New member. Adjust ctor.
974 (name_lookup::ambiguous, name_lookup::add_value,
975 name_lookup::add_type, name_lookup::process_binding): New.
976 (name_lookup::search_namespace_only,
977 name_lookup::search_namespace, name_lookup::search_usings): New.
978 (name_lookup::search_qualified): New.
979 (do_nonmember_using_decl, suggest_alternatives_for,
980 lookup_qualified_name): Adjust.
981 (tree_vec_contains): Delete.
982 (qualified_lookup_using_namespace): Rename to ...
983 (qualified_namespace_lookup): ... here. Reimplement.
986 * cp-tree.h (LOOKUP_SEEN_P, LOOKUP_FOUND_P): New.
987 * name-lookup.h (lookup_arg_dependent): Return plain tree.
988 * name-lookup.c (arg_lookup, arg_assoc, arg_assoc_args,
989 arg_assoc_args_vec, arg_assoc_type, add_function,
990 arg_assoc_namespace, arg_assoc_class_only, arg_assoc_bases,
991 arg_assoc_class, arg_assoc_template_arg, arg_assoc,
992 lookup_arg_dependent_1): Delete.
993 (name_lookup): New lookup object.
994 (name_lookup::preserve_state, name_lookup::restore_state,
995 name_lookup::mark_seen, name_lookup::find_and_mark,
996 name_lookup::add_fns, name_lookup::adl_namespace_only,
997 name_lookup::adl_namespace, name_lookup::adl_class_only,
998 name_lookup::adl_bases, name_lookup::adl_class,
999 name_lookup::adl_expr, name_lookup::adl_type,
1000 name_lookup::adl_template_arg, name_lookup::search_adl): New.
1001 (lookup_arg_dependent): Return a plain tree. Adjust.
1002 (is_associated_namespace): Move later.
1004 2017-05-24 Nathan Sidwell <nathan@acm.org>
1006 * friend.c (do_friend): Remove check for existing decl.
1007 * name-lookup.h (lookup_name_innermost_nonclass_level): Delete.
1008 * name-lookup.c (push_local_binding): Directly look for binding.
1009 (lookup_name_innermost_nonclass_level_1): Delete.
1010 (lookup_name_innermost_nonclass_level): Delete.
1012 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Alphabetize.
1014 * cp-tree.h (cp_free_lang_data): Add extern.
1015 (ovl_skip_hidden, is_overloaded_fn, really_overloaded_fn): Add
1017 (type_unknown_p): Return bool, make inline, lose TREE_LIST check.
1018 * typeck.c (type_unknown_p): Delete.
1019 * tree.c (is_overloaded_fn): Use MAYBE_BASELINE_FUNCTIONS, adjust
1020 overload management.
1021 (dependent_name): Likewise.
1022 (decl_anon_ns_mem_p): Simplify.
1024 2017-05-24 Jonathan Wakely <jwakely@redhat.com>
1027 * tree.c (reshape_init): Use unqualified type for direct enum init.
1028 * typeck.c (maybe_warn_about_cast_ignoring_quals): New.
1029 (build_static_cast_1, build_reinterpret_cast_1): Strip cv-quals from
1030 non-class destination types.
1031 (build_const_cast_1): Strip cv-quals from destination types.
1032 (build_static_cast, build_reinterpret_cast, build_const_cast)
1033 (cp_build_c_cast): Add calls to maybe_warn_about_cast_ignoring_quals.
1035 2017-05-24 Martin Sebor <msebor@redhat.com>
1038 * call.c (fully_fold_internal): Adjust.
1040 2017-05-24 Nathan Sidwell <nathan@acm.org>
1042 * cp-tree.h (ovl_skip_hidden): Declare.
1043 * tree.c (ovl_skip_hidden): New.
1044 * name-lookup.c (arg_assoc_namespace): Call ovl_skip_hidden.
1045 (lookup_arg_dependent_1): Likewise.
1046 (ambiguous_decl): Use DECL_HIDDEN_P, ovl_skip_hidden.
1047 (hidden_name_p, remove_hidden_names): Delete.
1048 (lookup_name_real_1): Do not strip hidden names.
1049 * name-lookup.h (hidden_name_p, remove_hidden_names): Delete.
1051 * cp-tree.h (OVL_HIDDEN_P): New.
1052 (ovl_iterator::hidden_p, ovl_iterator::reveal_node): New.
1053 (ovl_iterator::reveal_node): Declare.
1054 * tree.c (ovl_copy): Copy OVL_HIDDEN_P.
1055 (ovl_insert): Order on hiddenness.
1056 (ovl_iterator::reveal_node): New.
1057 * name-lookup.c (anticipated_builtin_p): New.
1058 (supplement_binding_1): Use it.
1059 (set_local_extern_decl_linkage): Use hidden_p.
1060 (do_pushdecl): Deal with unhiding a hidden decl, use
1061 anticipated_builtin_p.
1062 (do_nonmember_using_decl): Use anticipated_decl_p.
1063 (lookup_name_real_1): Use DECL_HIDDEN_P.
1065 2017-05-23 Jason Merrill <jason@redhat.com>
1067 -Wunused and C++17 structured bindings
1068 * decl.c (poplevel): Don't warn about unused structured bindings,
1069 only real variables.
1070 * error.c (dump_simple_decl): Handle structured bindings.
1071 * expr.c (mark_exp_read): Look through DECL_VALUE_EXPR.
1073 2017-05-23 Nathan Sidwell <nathan@acm.org>
1075 * cp-tree.h (PUSH_GLOBAL, PUSH_LOCAL, PUSH_USING): Delete.
1076 * name-lookup.c (create_local_binding): New.
1077 (update_binding): New.
1078 (pushdecl_maybe_friend_1): Rename to ...
1079 (do_pushdecl): ... this. Reimplement.
1081 (push_overloaded_decl_1, push_overloaded_decl): Delete.
1083 2017-05-23 Jason Merrill <jason@redhat.com>
1085 PR c++/80396 - built-in for make_integer_sequence.
1086 * pt.c (builtin_pack_fn_p, builtin_pack_call_p)
1087 (expand_integer_pack, expand_builtin_pack_call): New.
1088 (find_parameter_packs_r): Check builtin_pack_call_p.
1089 (check_for_bare_parameter_packs): Handle it.
1090 (tsubst_pack_expansion): Call expand_builtin_pack_call.
1091 (declare_integer_pack): New.
1092 (init_template_processing): Call it.
1093 * decl2.c (mark_used): Check builtin_pack_fn_p.
1095 2017-05-23 Nathan Sidwell <nathan@acm.org>
1097 * name-lookup.c (find_namespace_binding): New.
1098 (pushdecl_maybe_friend_1): Use CP_DECL_CONTEXT.
1099 (set_identifier_type_value_with_scope): Use find_namespace_binding.
1100 (find_binding, cp_binding_level_find_binding_for_name,
1101 binding_for_name, namespace_binding_1): Delete.
1102 (push_overloaded_decl_1): Use CP_DECL_CONTEXT.
1103 (get_namespace_binding, set_namespace_binding,
1104 finish_namespace_using_decl, unqualified_namespace_lookup_1,
1105 qualified_lookup_using_namespace, lookup_type_scope_1,
1106 lookup_name_innermost_nonclass_level_1): Use find_namespace_binding.
1109 * parser.c (cp_parser_template_id): Keep the lookup when stashing
1112 * cp-tree.h (DECL_HIDDEN_P): New.
1113 * name-lookup.c (set_decl_context,
1114 set_local_extern_decl_linkage): New, broken out of ...
1115 (pushdecl_maybe_friend_1): ... here. Call them.
1117 2017-05-23 Thomas Schwinge <thomas@codesourcery.com>
1119 * parser.c (OACC_KERNELS_CLAUSE_MASK): Add
1120 "PRAGMA_OACC_CLAUSE_NUM_GANGS", "PRAGMA_OACC_CLAUSE_NUM_WORKERS",
1123 2017-05-23 Nathan Sidwell <nathan@acm.org>
1125 * cp-tree.h (OVL_P): New.
1126 * name-lookup.h (push_local_binding): Delete.
1127 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
1128 (finish_namespace_using_decl, finish_local_using_decl): ... here
1129 * name-lookup.c (add_decl_to_level): Swap args.
1130 (pop_bindings_and_leave_scope): Look inside TREE_LIST.
1131 (diagnose_name_conflict): Check contexts are same for redecl.
1132 (update_local_overload): New.
1133 (compparms_for_decl_and_using): Rename to ...
1134 (matching_fn_p): ... here.
1135 (pushdecl_maybe_friend_1): Adjust add_decl_to_level,
1136 push_local_bindings call.
1137 (push_local_binding): Make static, replace FLAGS arg with
1139 (validate_nonmember_using_decl): Use OVL_FIRST.
1140 (do_nonmember_using_decl): Use in/out parameters. Use
1141 lkp_iterator and simplify.
1142 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
1143 (finish_namespace_using_decl, finish_local_using_decl): ... here.
1145 (lookup_type_current_level): Delete.
1146 * parser.c (cp_parser_using_declaration): Adjust.
1147 * pt.c (tsubst_expr): Adjust.
1149 2017-05-22 Nathan Sidwell <nathan@acm.org>
1151 * name-lookup.h (parse_using_directive): Replace with ...
1152 (finish_namespace_using_directive): ... this and ...
1153 (finish_local_using_directive): ... this.
1154 * name-lookup.c (add_using_namespace_1): Move later.
1155 (add_using_namespace): Move later, add namespace_p arg, remove
1157 (push_using_directive_1): Directly recurse.
1158 (do_using_directive, parse_using_directive): Delete, split into ...
1159 (finish_namespace_using_directive): ... this and ...
1160 (finish_local_using_directive): ... this.
1161 (push_namespace): Use add_using_namespace.
1162 * parser.c (cp_parser_using_directive): Call
1163 finish_namespace_using_directive or finish_local_using_directive.
1164 * pt.c (tsubst_expr): Call finish_local_using_directive.
1166 * cp-objcp-common.c (cp_register_dumps): Register raw dumper.
1167 * cp-tree.h (raw_dump_id): Declare.
1168 * decl2.c (raw_dump_id): Define.
1169 (dump_tu): Use raw_dump_id.
1171 * config-lang.in (gtfiles): Sort list, break lines.
1173 * cp-tree.h (CPTI_TERMINATE, CPTI_CALL_UNEXPECTED): Rename to ...
1174 (CPTI_TERMINATE_FN, CPTI_CALL_UNEXPECTED_FN): ... here.
1175 ( CPTI_GET_EXCEPTION_PTR_FN, CPTI_BEGIN_CATCH_FN, CPTI_END_CATCH_FN,
1176 CPTI_ALLOCATE_EXCEPTION_FN, CPTI_FREE_EXCEPTION_FN, CPTI_THROW_FN,
1177 CPTI_RETHROW_FN): New.
1178 (noexcept_deferred_spec): New.
1179 (terminate_node, call_unexpected_node): Rename to ...
1180 (terminate_fn, call_unexpected_fn): ... here.
1181 (get_exception_ptr_fn, begin_catch_fn, end_catch_fn,
1182 allocate_exception_fn, free_exception_fn, throw_fn, rethrow_fn): New.
1183 * except.c (fn1..fn5, throw_fn, rethrow_rn, spec): Delete.
1184 (init_exception_processing): Adjust.
1185 (declare_library_fn): Create and push the fns here.
1186 (do_get_exception_ptr, do_begin_catch, do_end_catch,
1187 do_allocate_exception_ptr, do_free_exception_ptr): Adjust
1188 declare_library_fn use.
1189 (unevaluated_noexcept_spec): Adjust.
1190 * cp-gimplify.c (genericize_eh_spec_block,
1191 gimplify_most_not_throw_expr): Adjust.
1193 * name-lookup.c (pushdecl_top_level,
1194 pushdecl_top_level_and_finish): Move after namespace pushing and
1196 (push_to_top_level): Rename to ...
1197 (do_push_to_top_level): ... here. Remove timing code.
1198 (pop_from_top_level_1): Rename to ...
1199 (do_pop_from_top_level): ... here.
1200 (do_push_nested_namespace, do_pop_nested_namespace)
1201 (push_to_top_level): New wrapper for do_push_to_top_level.
1202 (pop_from_top_level): Adjust.
1203 (push_nested_namepace, pop_nested_namespace): Wrappers for workers.
1205 2017-05-19 Bernd Edlinger <bernd.edlinger@hotmail.de>
1207 * config-lang.in (gtfiles): Add c-family/c-format.c,
1208 except.c, init.c, lambda.c and friend.c.
1209 * class.c (dvirt_fn): Move out of function scope,
1211 * except.c (fn1-5, throw_fn, rethrow_fn, spec): Likewise.
1212 * init.c (fn): Likewise.
1213 * lambda.c (ptr_id, max_id): Likewise.
1214 * friend.c (global_friend): Add GTY attribute.
1216 2017-05-19 Nathan Sidwell <nathan@acm.org>
1218 * call.c (add_list_candidates): Use OVL_FIRST.
1219 (build_new_method_call_1): Likewise.
1220 * cp-tree.h (OVL_SINGLE_P): New.
1221 (TYPE_HIDDEN_P): New.
1222 * decl.c (xref_tag_1): Use TYPE_HIDDEN_P.
1223 * dump.c (cp_tump_tree): Adjust overload dumping.
1224 * error.c (dump_decl): Use OVL_SINGLE_P, simplify context
1226 * method.c (lazily_declare_fn): Assert we added it.
1227 * parser.c (cp_parser_nested_name_specifier): Use OVL_SINGLE_P,
1229 (cp_parser_template_name): Use lkp_iterator.
1230 * pt.c (begin_template_parm_list): Fixup comment.
1231 (instantiate_class_template_1): Use TYPE_HIDDEN_P.
1232 * tree.c (ovl_iterator::remove_node): Cope with inherited ctors.
1233 (ovl_scope): Use lkp_iterator.
1235 2017-05-19 Thomas Schwinge <thomas@codesourcery.com>
1237 * parser.c (cp_parser_omp_clause_default): Handle
1238 "OMP_CLAUSE_DEFAULT_PRESENT".
1240 * parser.c (cp_parser_omp_clause_default): Avoid printing more
1241 than one syntax error message.
1243 2017-05-19 Nathan Sidwell <nathan@acm.org>
1245 * class.c (class_dump_id): Define.
1246 (dump_class_hierarchy, dump_vtable, dump_vtt): Use it.
1247 * cp-objcp-common.c (cp_register_dumps): New.
1248 * cp-objcp-common.h (cp_register_dumps): Declare.
1249 (LANG_HOOKS_REGISTER_DUMPS): Override.
1250 * cp-tree.h (class_dump_id): Declare.
1252 2017-05-18 Nathan Sidwell <nathan@acm.org>
1254 * cp-tree.h (OVL_ARG_DEPENDENT): Delete.
1256 (lookup_keep): Declare.
1257 * name-lookup.c (add_function): Don't set OVL_ARG_DEPENDENT.
1258 * pt.c (tsubst_copy): Assert lookup is persistent.
1259 * semantics.c (finish_call_expr): Use lkp_iterator, call
1261 * tree.c (ovl_copy): New.
1262 (ovl_insert, ovl_iterator::remove_node): Copy immutable nodes.
1265 * cp-tree.h (OVL_USED): Replace with ...
1266 (OVL_USING_P): ... this.
1267 (ovl_iterator::using_p): Adjust.
1268 * name-lookup.c (push_overloaded_decl_1,
1269 do_nonmember_using_decl): Adjust.
1270 * search.c (lookup_field_r): Adjust.
1271 * tree.c (ovl_insert, ovl_scope): Adjust.
1273 * cp-tree.h (lookup_add): Swap args.
1274 (ovl_cons, build_overload): Delete.
1275 * name-lookup.c (add_function, push_overloaded_decl_1,
1276 do_nonmember_using_decl, merge_functions, remove_hidden_names):
1277 Use lookup_add, ovl_insert.
1278 * pt.c (check_explicit_specialization): Use lookup_add.
1279 (do_class_deduction): Likewise. Refactor if.
1280 * tree.c (lookup_add): Swap args.
1281 (ovl_cons, build_overload): Delete.
1283 * name-lookup.c (find_local_binding): New, broken out of ...
1284 (lookup_name_innermost_nonclass_level_1): ... here. Call it.
1285 (set_namespace_binding): Swap scope & name args.
1286 (namespace_binding_1): Likewise.
1287 (pushdecl_maybe_friend_1): Adjust set_namespace_binding call.
1288 (push_overloaded_decl_1): Likewise.
1289 (set_global_binding): Likewise.
1290 (get_namespace_binding): Adjust namespace_binding_1 call.
1292 2017-05-17 Nathan Sidwell <nathan@acm.org>
1294 * cp-tree.h (default_hash_traits <lang_identifier *>): New
1296 * name-lookup.c (lookup_extern_c_fun_in_all_ns): Delete.
1297 (extern_c_fns): New hash table.
1298 (check_extern_c_conflict): New, broken out of ...
1299 (pushdecl_maybe_friend_1): ... here. Call it.
1300 (c_linkage_bindings): Just look in hash table.
1302 2017-05-17 Ville Voutilainen <ville.voutilainen@gmail.com>
1306 Implement new C++ intrinsics __is_assignable and __is_constructible.
1307 * cp-tree.h (CPTK_IS_ASSIGNABLE, CPTK_IS_CONSTRUCTIBLE): New.
1309 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
1310 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
1311 * method.c (constructible_expr): Set cp_unevaluated.
1312 (is_xible_helper): New.
1313 (is_trivially_xible): Adjust.
1315 * parser.c (cp_parser_primary_expression): Handle
1316 RID_IS_ASSIGNABLE and RID_IS_CONSTRUCTIBLE.
1317 (cp_parser_trait_expr): Likewise.
1318 * semantics.c (trait_expr_value): Handle
1319 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
1321 2017-05-17 Nathan Sidwell <nathan@acm.org>
1323 * cp-tree.h (ovl_iterator::using_p): New predicate.
1324 (ovl_iterator::remove_node): New worker.
1325 (ovl_insert): Declare.
1326 * tree.c (ovl_insert): New.
1327 (ovl_iterator::remove_node): New.
1328 * class.c (add_method): Use ovl_iterator, ovl_insert.
1329 (clone_function_decl): Fix description.
1330 (clone_constructors_and_destructors): Use ovl_iterator.
1332 * class.c (handle_using_decl): Use OVL_FIRST, ovl_iterator.
1333 (maybe_warn_about_overly_private_class): Use ovl_iterator.
1334 (method_name_cmp, resort_method_name_cmp): Use OVL_NAME.
1335 (resort_type_method_vec, finish_struct_methods): Use OVL_FIRST.
1336 (get_base_fndecls): Use ovl_iterator.
1337 (warn_hidden): Use OVL_NAME, ovl_iterator.
1338 (add_implicitly_declared_members): Use ovl_iterator.
1339 * constraint.cc (normalize_template_id_expression): Use OVL_FIRST,
1341 (finish_shorthand_constraint): Simplify, use ovl_make.
1342 * pt.c (make_constrained_auto): Simplify. Use ovl_make.
1343 * search.c (shared_member_p): Use ovl_iterator.
1344 (lookup_field_fuzzy_info::fuzzy_lookup_fn): Use OVL_NAME.
1345 (lookup_conversion_operator): Use OVL_FIRST.
1346 (lookup_fnfiels_idx_nolazy): Use OVL_FIRST, OVL_NAME.
1347 (look_for_overrides_here): Use ovl_iterator.
1348 (lookup_conversions_r): Use OVL_FIRST, OVL_NAME, ovl_iterator.
1349 * typeck.c (build_x_unary_op): Use ovl_make.
1351 2017-05-17 Martin Liska <mliska@suse.cz>
1353 * class.c (dump_class_hierarchy): Introduce dump_flags_t type and
1354 use it instead of int type.
1355 (dump_vtable): Likewise.
1356 (dump_vtt): Likewise.
1357 * decl2.c (dump_tu): Likewise.
1359 2017-05-16 David Malcolm <dmalcolm@redhat.com>
1361 * call.c (enforce_access): Add access_failure_info * param and use
1362 it to record access failures.
1363 * cp-tree.h (class access_failure_info): New class.
1364 (enforce_access): Add access_failure_info * param, defaulting to
1366 (lookup_member): Likewise.
1367 (locate_field_accessor): New function decl.
1368 (perform_or_defer_access_check): Add access_failure_info * param,
1370 * search.c (lookup_member): Add access_failure_info * param and
1371 pass it on to call to perform_or_defer_access_check.
1372 (matches_code_and_type_p): New function.
1373 (field_access_p): New function.
1374 (direct_accessor_p): New function.
1375 (reference_accessor_p): New function.
1376 (field_accessor_p): New function.
1377 (struct locate_field_data): New struct.
1378 (dfs_locate_field_accessor_pre): New function.
1379 (locate_field_accessor): New function.
1380 * semantics.c (perform_or_defer_access_check): Add
1381 access_failure_info * param, and pass it on to call to
1383 * typeck.c (access_failure_info::record_access_failure): New method.
1384 (access_failure_info::maybe_suggest_accessor): New method.
1385 (finish_class_member_access_expr): Pass an access_failure_info
1386 instance to the lookup_member call, and call its
1387 maybe_suggest_accessor method afterwards.
1389 2017-05-16 Marek Polacek <polacek@redhat.com>
1393 * cp-gimplify.c (cp_fold): Handle SAVE_EXPR.
1395 2017-05-16 Nathan Sidwell <nathan@acm.org>
1397 * name-lookup.c (check_local_shadow): New, broke out of ...
1398 (pushdecl_maybe_friend_1): ... here. Call it.
1400 * cp-tree.h (OVL_NESTED_P, OVL_LOOKUP_P): New.
1401 (ovl_first): Move inline definition to end of file.
1402 (ovl_make, lookup_add): Declare.
1403 (get_fns, get_first_fn): Make pure.
1404 * tree.c (ovl_cache): New.
1405 (ovl_make, lookup_add): New.
1406 * pt.c (do_class_deduction): Don't add candidates that will be
1409 * call.c (build_user_type_conversion_1): Use OVL_FIRST.
1410 (print_error_for_call_failure): Use OVL_NAME.
1411 (build_op_call_1): Use ovl_iterator.
1412 (add_candidates): Use OVL_FIRST & lkp_iterator.
1413 (build_op_delete_call): Use MAYBE_BASELINK_FUNCTIONS &
1415 * class.c (deduce_noexcept_on_destructors): Use ovl_iterator.
1416 (type_has_user_nondefault_constructor,
1417 in_class_defaulted_default_constructor,
1418 type_has_user_provided_constructor,
1419 type_has_user_provided_or_explicit_constructor,
1420 type_has_non_user_provided_default_constructor,
1421 vbase_has_user_provided_move_assign,
1422 type_has_move_constructor, type_has_move_assign,
1423 type_has_user_declared_move_constructor,
1424 type_has_user_declared_move_assign,
1425 type_build_ctor_call, type_build_dtor_call,
1426 type_requires_array_cookie, explain_non_literal_class): Likewise.
1427 (finish_struct): Use lkp_iterator.
1428 (resolve_address_of_overloaded_function): Use OVL_NAME, lkp_iterator.
1429 (note_name_declared_in_class): Use OVL_NAME.
1430 * cxx-pretty-print.c (pp_cxx_unqualified_id): Use OVL_FIRST.
1431 (pp_cxx_qualified_id, cxx_pretty_printer::id_expression,
1432 cxx_pretty_printer::expression): Likewise.
1433 * decl2.c (check_classfn): Use ovl_iterator.
1434 * pt.c (retrieve_specialization): Use ovl_iterator.
1435 * tree.c (cp_tree_equal): Use lkp_iterator.
1436 (type_has_nontrivial_copy_init): Use ovl_iterator.
1438 * typeck2.c (cxx_incomplete_type_diagnostic): Revert change and
1439 check is_overloaded_fn.
1441 2017-05-16 Martin Liska <mliska@suse.cz>
1443 * parser.c (cp_lexer_print_token): Add default value for flags
1444 argument of print_gimple_stmt, print_gimple_expr,
1445 print_generic_stmt and print_generic_expr.
1447 2017-05-16 Nathan Sidwell <nathan@acm.org>
1449 * cp-tree.h (class ovl_iterator, class lkp_iterator): New OVERLOAD
1451 (MAYBE_BASELINK_FUNCTIONS): New.
1452 * constraint.cc (resolve_constraint_check): Use lkp_iterator.
1453 * decl2.c (maybe_warn_sized_delete): Use ovl_iterator.
1454 * lambda.c (maybe_generic_this_capture): Use lkp_iterator.
1455 * method.c (inherited_ctor_binfo): Use ovl_iterator.
1456 (binfo_inherited_from): Likewise.
1457 * parser.c (lookup_literal_operator): Use lkp_iterator.
1458 * pt.c (iterative_hash_template_arg): Use lkp_iterator.
1459 (print_candidates_1): Likewise.
1460 (determine_specialization): Likewise.
1461 (resolve_overloaded_unification): Likewise.
1462 (resolve_nondeduced_context): Likewise.
1463 (type_dependent_expression_p): Likewise.
1464 (dependent_template_p): Likewise.
1465 * ptree.c (cxx_print_xnode): Likewise.
1466 * semantics.c (omp_reduction_lookup): Use lkp_iterator.
1467 (classtype_has_nothrow_assign_or_copy_p): Use ovl_iterator.
1468 * typeck.c (check_template_keyword): Use lkp_iterator.
1470 * cp-tree.h (OVL_FIRST, OVL_NAME): New.
1472 * constexpr.c (function_concept_check): Use OVL_FIRST.
1473 * cvt.c (build_expr_type_conversion): Likewise.
1474 * decl.c (poplevel, grokdeclarator): Use OVL_NAME.
1475 * decl2.c (mark_used): Use OVL_FIRST.
1476 * error.c (dump_decl): Use OVL_FIRST, OVL_NAME.
1477 (dump_expr, location_of): Use OVL_FIRST.
1478 * friend.c (do_friend): Use OVL_NAME.
1479 * init.c (build_offset_ref): Use OVL_FIRST.
1480 * mangle.c (write_member_name): Likewise.
1481 (write_expression): Use OVL_NAME.
1482 * method.c (strip_inheriting_ctors): Use OVL_FIRST.
1483 * name-lookup.c (pushdecl_class_level): Use OVL_NAME.
1484 * pt.c (check_explicit_specialization): Use OVL_FIRST.
1485 (check_template_shadow): Likewise.
1486 (tsubst_template_args): Use OVL_NAME.
1487 (tsubst_baselink): Use OVL_FIRST.
1488 * semantics.c (perform_koenig_lookup): Use OVL_NAME.
1489 * tree.c (get_first_fn): Use OVL_FIRST.
1490 * typeck.c (finish_class_member_access_expr): Use OVL_NAME.
1491 (cp_build_addr_expr_1): Use OVL_FIRST.
1493 * pt.c (tsubst_copy_and_build): Remove unnecessary COMPONENT_REF
1495 * semantics.c (finish_id_expression): Directly init local var.
1496 (finish_omp_reduction_clause): Use really_overloaded_fn.
1497 * tree.c (get_fns): Document. Assert we got an overload.
1498 (get_first_fn) Document.
1499 * typeck.c (cp_build_addr_expr_1): Pass arg directly to
1500 really_overloaded_fn.
1501 * typeck2.c (cxx_incomplete_type_diagnostic): Use get_first_fn directly.
1503 * cp-tree.h (SCOPE_DEPTH): New.
1504 * name-lookup.h (is_nested_namespace): Declare.
1505 * name-lookup.c (is_nested_namespace): New.
1506 (is_ancestor): Use it.
1507 (set_decl_namespace): Likewise.
1508 (push_namespace): Set SCOPE_DEPTH.
1509 * pt.c (check_specialization_namespace): Use is_nested_namespace.
1510 (check_unqualigied_spec_or_inst): Likewise.
1512 2017-05-15 Nathan Sidwell <nathan@acm.org>
1515 * cp-tree.h (DECL_NAMESPACE_INLINE_P): New.
1516 * name-lookup.h (push_namespace): Return int, add make_inline arg.
1517 * name-lookup.c (push_namespace): Deal with inline directly.
1518 Return pushed count.
1519 * parser.c (cp_parser_namespace_definition): Adjust for
1520 push_namespace change.
1522 2017-05-11 Nathan Sidwell <nathan@acm.org>
1524 * cp-lang.c (get_global_decls, cxx_pushdecl, LANG_HOOK_GETDECLS,
1525 LANG_HOOKS_PUSHDECL): Move to ...
1526 * cp-objcp-common.c (cp_get_global_decls, cp_pushdec,
1527 LANG_HOOK_DECLS, LANG_HOOKS_PUSHDECL): ... here.
1528 * cp-objcp-common.h (cp_get_global_decls, cp_pushdecl): Declare.
1530 * name-lookup.h (pushdecl): Add default friend parm.
1531 (pushdecl_maybe_friend): Delete.
1532 (pushdecl_top_level): Add default friend parm.
1533 (pushdecl_top_level_maybe_friend): Delete.
1534 * name-lookup.c (pushdecl_maybe_friend): Delete.
1535 (pushdecl): Add is_friend parm.
1536 (pushdecl_top_level): Add is friend_parm.
1537 (pushdecl_top_level_maybe_friend, pushdecl_top_level_1): Delete.
1538 (pushdecl_top_level_and_finish): Do pushing and finishing directly.
1539 * friend.c (do_friend): Adjust.
1540 * pt.c (tsubst_friend_class): Adjust.
1542 Revert pushdecl_top_level_and_finish name change.
1543 * name-lookup.h (pushdecl_top_level_and_finish): Resurrect old name.
1544 * name-lookup.c (pushdecl_top_level_and_finish): Likewise.
1545 * decl.c (cp_make_fname_decl): Adjust.
1546 * decl2.c (get_guard, handle_tls_init): Adjust.
1547 * rtti.c (get_tinfo_decl, tinfo_base_init): Adjust.
1549 * name-lookup.c (pushdecl_outermost_localscope): Always
1550 conditionally stop timer.
1552 * decl.c (xref_tag_1): Don't frob ts_lambda scope here.
1553 * name-lookup.c (pushtag_1): Deal with ts_lambda scope.
1555 * cp-tree.h (pushdecl, pushdecl_maybe_friend, pushtag,
1556 pushtag_top_level_maybe_friend,
1557 pushdecl_top_level_and_finish): Move declarations to ...
1558 * name-lookup.h: ... here. Group pushdecl variants.
1559 (pushdecl_top_level_and_finish): Rename to ...
1560 (pushdecl_top_level_with_init): ... here.
1561 * decl.c (cp_make_fname_decl): Use pushdecl_top_level_with_init.
1562 * decl2.c (get_guard, handle_tls_init): Likewise.
1563 * rtti.c (get_tinfo_decl, tinfo_base_init): Likewise.
1564 * lambda.c (maybe_add_lambda_conv_op): Use namespace_bindings_p.
1565 * method.c (implicitly_declare_fn): Likewise.
1566 * searchc (node_debug_info_needed): Likewise.
1567 * name-lookup.c (pushdecl_top_level_and_finish): Rename to ...
1568 (pushdecl_top_level_with_init): ... here.
1569 (pop_everything): Use namespace_bindings_p.
1571 * name-lookup.h (pop_binding): Rename to pop_local_binding.
1572 (getdecls): Rename to get_local_decls.
1573 * name-lookup.c (pop_binding): Rename to ...
1574 (pop_local_binding): ... here.
1575 (pop_bindings_and_leave_scope): Adjust.
1576 (getdecls): Rename to ...
1577 (get_local_decls): ... here. Assert local scope.
1578 * decl.c (poplevel): Assert not namespace. Adjust and simplify
1580 (store_parm_decls): Adjust get_local_decls call.
1581 (parser.c (synthesize_implicit_template_parm): Likewise.
1583 2017-05-11 Ville Voutilainen <ville.voutilainen@gmail.com>
1586 * method.c (is_trivially_xible): Reject void types.
1588 2017-05-10 Nathan Sidwell <nathan@acm.org>
1590 * class.c (handle_using_decl): Always use OVL_CURRENT.
1591 (resolve_address_of_overloaded_function): Move iterator decl into
1592 for scope. Don't strip anticipated decls here.
1594 * pt.c (print_candidates_1): Separate TREE_LIST and OVERLOAD
1596 (print_candidates): Adjust.
1598 * cp-tree.h (build_new_function_call): Lose koenig_p arg. Fix
1600 * call.c (build_new_function_call): Lose koenig_p arg. Remove
1601 koenig_p handling here.
1602 * pt.c (push_template_decl_real): Unconditionally retrofit_lang_decl.
1603 (tsubst_omp_clauses): Likewise.
1604 (do_class_deduction): Adjust buld_new_function_call calls.
1605 * semantics.c (finish_call_expr): Likewise.
1607 2017-05-10 Jason Merrill <jason@redhat.com>
1609 * pt.c (unify_parameter_deduction_failure, unify_cv_qual_mismatch)
1610 (unify_type_mismatch, unify_parameter_pack_mismatch)
1611 (unify_ptrmem_cst_mismatch, unify_expression_unequal)
1612 (unify_parameter_pack_inconsistent, unify_inconsistency)
1613 (unify_vla_arg, unify_method_type_error, unify_arity)
1614 (unify_arg_conversion, unify_no_common_base)
1615 (unify_inconsistent_template_template_parameters)
1616 (unify_template_deduction_failure)
1617 (unify_template_argument_mismatch)
1618 (unify_overload_resolution_failure): Call unify_invalid.
1620 CWG 1847 - Clarifying compatibility during partial ordering
1621 * pt.c (more_specialized_fn): No order between two non-deducible
1624 * pt.c (dependent_type_p): Make sure we aren't called with
1627 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
1628 * pt.c (convert_template_argument): Just return an argument pack.
1629 (coerce_template_parameter_pack, template_parm_to_arg)
1630 (extract_fnparm_pack, make_argument_pack, tsubst_template_args)
1631 (tsubst_decl, tsubst, type_unification_real, unify_pack_expansion):
1632 Don't set the type of a NONTYPE_ARGUMENT_PACK.
1633 * parser.c (make_char_string_pack, make_string_pack): Likewise.
1635 2017-05-10 Nathan Sidwell <nathan@acm.org>
1637 * cp-tree.h (add_method, clone_function_decl): Change last arg to
1639 * class.c (add_method): Change third arg to bool. Adjust.
1640 (one_inheriting_sig, one_inherited_ctor): Adjust.
1641 (clone_function_decl): Change 2nd arg to bool. Adjust.
1642 (clone_constructors_and_destructors): Adjust.
1643 * lambda.c (maybe_add_lambda_conv_op): Adjust.
1644 * method.c (lazily_declare_fn): Adjust.
1645 * pt.c (tsubst_decl, instantiate_template_1): Adjust.
1646 * semantics.c (finish_member_declaration): Adjust.
1648 2017-05-10 Paolo Carlini <paolo.carlini@oracle.com>
1651 * decl.c (finish_function): To improve error recovery, change the
1652 logic for calling apply_deduced_return_type.
1654 2017-05-09 Jason Merrill <jason@redhat.com>
1656 PR c++/80605 - __is_standard_layout and empty base
1657 * class.c (check_bases): Ignore empty bases.
1659 PR c++/70979 - literal class and closure types
1660 * class.c (finalize_literal_type_property): Handle closures
1662 (explain_non_literal_class): Likewise.
1664 PR c++/66297, DR 1684 - literal class and constexpr member fns
1665 * constexpr.c (is_valid_constexpr_fn): Only complain about
1666 non-literal enclosing class in C++11.
1667 * class.c (finalize_literal_type_property): Likewise.
1669 2017-05-09 Paolo Carlini <paolo.carlini@oracle.com>
1672 * pt.c (tsubst_decl): Early return error_mark_node if
1673 grok_ctor_properties returns false.
1675 2017-05-09 Jason Merrill <jason@redhat.com>
1677 PR c++/70167 - array prvalue treated as lvalue
1678 * cp-tree.h (CONSTRUCTOR_C99_COMPOUND_LITERAL): New.
1680 * semantics.c (finish_compound_literal): Add fcl_context parameter.
1681 Only make a static variable for C99 syntax.
1682 * parser.c (cp_parser_postfix_expression): Pass it.
1683 * pt.c (tsubst_copy_and_build): Likewise.
1684 * call.c (extend_ref_init_temps): Set
1685 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
1687 2017-05-09 Nathan Sidwell <nathan@acm.org>
1689 * cp-lang.c (get_global_decls, cxx_pushdecl): New.
1690 (LANG_HOOKS_GETDECLS, LANG_HOOKS_PUSHDECL): Override.
1691 * name-lookup.h (pushdecl_top_level): Declare.
1693 2017-05-08 Jason Merrill <jason@redhat.com>
1695 PR c++/80178 - parameter passing for uncopyable classes
1696 * tree.c (type_has_nontrivial_copy_init): True for classes with only
1697 deleted copy/move ctors.
1698 (remember_deleted_copy, maybe_warn_parm_abi): New.
1699 * decl.c (require_complete_types_for_parms, check_function_type):
1700 Call maybe_warn_parm_abi.
1701 * call.c (convert_for_arg_passing, build_cxx_call): Likewise.
1703 2017-05-08 Nathan Sidwell <nathan@acm.org>
1705 * decl.c (builtin_function_1): Set DECL_ANTICIPATED before pushing.
1706 (start_preparsed_function): Do decl pushing before setting
1707 current_funciton_decl and announcing it.
1709 * name-lookup.h (pushdecl_with_scope): Replace with ...
1710 (pushdecl_outermost_localscope): ... this.
1711 * name-lookup.c (pushdecl_with_scope): Replace with ...
1712 (pushdecl_outermost_localscope): ... this.
1713 (pushdecl_namespace_level): Adjust.
1714 * decl.c (cp_make_fname_decl): Use pushdecl_outermost_localscope.
1715 * lambda.c (insert_capture_proxy): Likewise.
1717 * class.c (build_vtbl_initializer): Don't shadow outer variable
1720 Revert _binding -> _value change.
1721 * name-lookup.h (get_namespace_value, set_global_value): Rename to ...
1722 (get_namespace_binding, set_global_binding): ... these.
1723 * name-lookup.c (get_namespace_value, set_global_value): Rename to ...
1724 (get_namespace_binding, set_global_binding): ... these.
1725 (arg_assoc_namespace, pushdecl_maybe_friend_1,
1726 check_for_out_of_scope_variable, push_overloaded_decl_1,
1727 lookup_name_innermost_nonclass_level, push_namespace): Adjust.
1728 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
1729 SET_IDENTIFIER_GLOBAL_VALUE): Adjust.
1730 * decl.c (poplevel): Adjust.
1731 * pt.c (make_constrained_auto): Likewise.
1733 2017-05-07 Volker Reichelt <v.reichelt@netcologne.de>
1735 PR translation/80280
1736 * call.c (print_z_candidate): Fix quoting.
1738 2017-05-05 David Malcolm <dmalcolm@redhat.com>
1740 * error.c (pedwarn_cxx98): Replace report_diagnostic
1741 with diagnostic_report_diagnostic.
1743 2017-05-05 Nathan Sidwell <nathan@acm.org>
1745 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value.
1746 (SET_IDENTIFIER_GLOBAL_VALUE): Use set_global_value.
1747 (IDENTIFIER_NAMESPACE_VALUE): Delete.
1748 * name-lookup.h (namespace_binding, set_namespace_binding): Replace
1750 (get_namespace_value, set_global_value): ... these.
1751 (get_global_value_if_present, is_typename_at_global_scope): Delete.
1752 * decl.c (poplevel): Use get_namespace_value.
1753 (grokdeclarator): Use IDENTIFIER_GLOBAL_VALUE.
1754 * class.c (build_vtbl_initializer): Stash library decl in
1755 static var. Use IDENTIFIER_GLOBAL_VALUE.
1756 * except.c (do_get_exception_ptr, do_begin_catch, do_end_catch,
1757 do_allocate_exception, do_free_exception, build_throw): Likewise.
1758 * init.c (throw_bad_array_new_length): Likewise.
1759 * rtti.c (throw_bad_cast, throw_bad_typeid): Likewise.
1760 * name-lookup.c (arg_assoc_namespace, pushdecl_maybe_friend_1,
1761 check_for_our_of_scope_variable, push_overloaded_decl_1): Use
1762 get_namespace_value.
1763 (set_namespace_binding_1): Rename to
1764 (set_namespace_binding): ... here.
1765 (set_global_value): New.
1766 (lookup_name_innermost_nonclass_level_1, push_namespace): Use
1767 get_namespace_value.
1768 * pt.c (listify): Use get_namespace_value.
1770 * call.c (make_temporary_var_for_ref_to_temp): Push decl into
1772 * lex.c (unqualified_name_lookup_error): Likewise.
1774 * class.c (alter_class): Use retrofit_lang_decl directly.
1775 * decl.c (push_local_name, dupliate_decls): Likewise.
1776 * semantics.c (omp_privatize_field): Likewise.
1778 Kill walk_namespaces.
1779 * cp-tree.h (walk_namespaces_fn, walk_namespaces): Delete.
1780 * decl.c (walk_namespaces_r, walk_namespaces): Delete.
1782 Kill per-namespace static_decls.
1783 * cp-tree.h (static_decls): Declare.
1784 (wrapup_globals_for_namespace,
1785 diagnose_inline_vars_for_namespace): Replace with ...
1786 (wrapup_namespace_globals): ... this.
1787 * decl.c (static_decls): Define.
1788 (wrapup_globals_for_namespace,
1789 diagnose_inline_vars_for_namespace): Replace with ...
1790 (wrapup_namespace_globals): ... this.
1791 (cxx_init_decl_processing): Initialize static_decls.
1792 * decl2.c (c_parse_final_cleanups): Adjust.
1793 * name-lookup.h (cp_binding_level): Remove static_decls member.
1794 * name-lookup.c (add_decl_to_level): Adjust.
1795 (begin_scope): Adjust.
1797 2017-05-05 Paolo Carlini <paolo.carlini@oracle.com>
1800 * decl.c (reshape_init): Unconditionally return error_mark_node
1801 upon error about too many initializers.
1803 2017-05-04 Nathan Sidwell <nathan@acm.org>
1805 * constraint.cc (diagnose_check_constraint): Fix %E thinko.
1807 2017-05-04 Martin Sebor <msebor@redhat.com>
1809 PR translation/80280
1810 * call.c (print_z_candidate): Add missing quoting to %D and other
1812 (build_op_call_1): Same.
1813 * constraint.cc (diagnose_check_constraint): Same.
1814 * mangle.c (mangle_decl): Same.
1815 * name-lookup.c (cp_binding_level_debug): Same.
1816 (set_decl_namespace): Same.
1817 * parser.c (cp_parser_tx_qualifier_opt): Same.
1818 * pt.c (print_candidates_1): Same.
1819 (check_template_variable): Same.
1820 (tsubst_default_argument): Same.
1821 (most_specialized_partial_spec): Same.
1822 * semantics.c (omp_reduction_lookup): Same.
1823 * tree.c (check_abi_tag_redeclaration): Same.
1824 * typeck.c (comptypes): Same.
1825 * typeck2.c (abstract_virtuals_error_sfinae): Same.
1827 2017-05-04 Nathan Sidwell <nathan@acm.org>
1830 * cp-tree.h (enum cp_tree_index): Add CPTI_GLOBAL,
1831 CPTI_GLOBAL_TYPE, CPTI_GLOBAL_IDENTIFIER, CPTI_ANON_IDENTIFIER,
1832 CPTI_INIT_LIST_IDENTIFIER.
1833 (global_namespace, global_type_node, global_identifier,
1834 anon_identifier, init_list_identifier): New.
1835 * decl.c (global_type_node, global_scope_name): Delete.
1836 (initialize_predefined_identifiers): Add new identifiers.
1837 (cxx_init_decl_processing): Adjust.
1838 * name-lookup.h (global_namespace, global_type_node): Delete.
1839 * name-lookup.c (global_namespace, anonymous_namespace_name,
1840 get_anonymous_namespace_name): Delete.
1841 (namespace_scope_ht_size, begin_scope, pushtag_1,
1842 push_namespace): Adjust,
1843 * call.c (type_has_extended_temps): Use init_list_identifier.
1844 * pt.c (listify): Likewise.
1846 * name-lookup.c: Reorder functions to make merging from modules
1849 2017-05-03 Jason Merrill <jason@redhat.com>
1851 * constexpr.c (cxx_eval_outermost_constant_expr): Use TV_CONSTEXPR.
1853 2017-05-03 Nathan Sidwell <nathan@acm.org>
1855 * cp-tree.h (enum cp_tree_index, cp_global_trees): Move earlier,
1856 along with #defines, to before name-lookup include.
1858 2017-05-02 Paolo Carlini <paolo.carlini@oracle.com>
1860 * pt.c (is_auto_or_concept): Remove.
1861 (type_uses_auto_or_concept): Remove, unused.
1862 (find_parameter_packs_r, extract_autos_r, is_auto_r): Adjust.
1863 * parser.c (tree_type_is_auto_or_concept): Remove, unused.
1864 * cp-tree.h (is_auto_or_concept): Remove.
1866 2017-05-01 Xi Ruoyao <ryxi@stu.xidian.edu.cn>
1869 * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Don't
1870 add pedigree operation and detach call here.
1871 * cp-gimplify.c (cp_gimplify_expr): Remove the calls to
1872 cilk_cp_gimplify_call_params_in_spawned_fn.
1873 (cilk_cp_gimplify_call_params_in_spawned_fn): Remove function.
1874 * semantics.c (simplify_aggr_init_expr): Copy EXPR_CILK_SPAWN.
1876 2017-04-29 Volker Reichelt <v.reichelt@netcologne.de>
1878 * parser.c (cp_parser_member_declaration): Add fix-it hints for
1879 stray comma and missing semicolon at end of member declaration.
1881 2017-04-27 Volker Reichelt <v.reichelt@netcologne.de>
1883 * parser.c (cp_parser_cast_expression): Add target type of cast to
1885 * error.c (type_to_string): Add '{enum}' suffix to enumeration types.
1887 2017-04-26 Paolo Carlini <paolo.carlini@oracle.com>
1889 * decl.c (grok_ctor_properties, ambi_op_p, unary_op_p): Change
1890 return type to bool.
1891 * cp-tree.h (grok_ctor_properties): Update.
1893 2017-04-26 Volker Reichelt <v.reichelt@netcologne.de>
1895 * parser.c (cp_parser_nested_name_specifier_opt): Add fix-it
1896 information to diagnostic of invalid colon in nested-name-specifier.
1898 2017-04-25 Volker Reichelt <v.reichelt@netcologne.de>
1900 * parser.c (cp_parser_elaborated_type_specifier): Add fix-it to
1901 diagnostic of invalid class/struct keyword after enum.
1903 2017-04-25 David Malcolm <dmalcolm@redhat.com>
1905 * parser.c (cp_parser_member_declaration): Add fix-it hint
1906 for removing stray semicolons.
1908 2017-04-25 David Malcolm <dmalcolm@redhat.com>
1910 * name-lookup.c (get_std_name_hint): New function.
1911 (maybe_suggest_missing_header): New function.
1912 (suggest_alternative_in_explicit_scope): Call
1913 maybe_suggest_missing_header.
1915 2017-04-25 David Malcolm <dmalcolm@redhat.com>
1918 * name-lookup.c (suggest_alternative_in_explicit_scope): Convert
1919 candidate type of bm from tree to const char *.
1920 (consider_binding_level): Likewise.
1921 (lookup_name_fuzzy): Likewise, using this to merge the best
1922 result from the preprocessor into bm, rather than immediately
1923 returning, so that better matches from reserved words can "win".
1924 Guard the rejection of keywords that don't start decl-specifiers
1925 so it only happens for FUZZY_LOOKUP_TYPENAME.
1927 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
1929 * decl.c (grokdeclarator): Use %qT instead of %<%T%> in diagnostics.
1930 (start_enum): Likewise.
1931 (build_enumerator): Likewise. Use %qE instead of plain %E.
1932 * parser.c (cp_parser_mem_initializer_list): Use %qD instead of
1933 %<%D%> in diagnostics.
1934 (cp_parser_elaborated_type_specifier): Likewise.
1935 * pt.c (make_pack_expansion): Use %qT and %qE instead of
1936 %<%T%> and %<%E%> in diagnostics.
1937 (tsubst_pack_expansion): Likewise.
1939 2017-04-24 David Malcolm <dmalcolm@redhat.com>
1942 * parser.c (cp_parser_unary_expression): Generate a location
1943 range for alignof and sizeof expressions.
1945 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
1947 * parser.c (cp_parser_cv_qualifier_seq_opt): Add fix-it info to
1949 (cp_parser_virt_specifier_seq_opt): Likewise.
1950 (set_and_check_decl_spec_loc): Likewise twice.
1952 2017-04-21 Jason Merrill <jason@redhat.com>
1954 PR c++/80179 - ICE with initialized flexible array member.
1955 * constexpr.c (verify_ctor_sanity): Handle flexible array members.
1957 2017-04-21 Richard Biener <rguenther@suse.de>
1959 * cp-tree.h (copy_decl): Annotate with CXX_MEM_STAT_INFO.
1960 (copy_type): Likewise.
1961 * lex.c (copy_decl): Pass down mem-stat info.
1962 (copy_type): Likewise.
1964 2017-04-20 Jonathan Wakely <jwakely@redhat.com>
1967 * init.c (build_new_1): Suppress notes about over-aligned new when
1968 the warning is suppressed.
1970 2017-04-20 Volker Reichelt <v.reichelt@netcologne.de>
1972 * parser.c (cp_parser_member_declaration): Add warning with fixit
1973 information for extra semicolon after in-class function definition.
1975 2017-04-20 Jakub Jelinek <jakub@redhat.com>
1978 * tree.c (build_cplus_array_type): Call build_array_type
1979 with the intended TYPE_TYPELESS_STORAGE flag value, instead
1980 of calling build_array_type and modifying later TYPE_TYPELESS_STORAGE
1983 2017-04-18 Marek Polacek <polacek@redhat.com>
1985 PR c++/80244 - ICE with attribute in template alias.
1986 * tree.c (strip_typedefs): Handle UNDERLYING_TYPE.
1988 PR c++/80241 - ICE with alignas pack expansion.
1989 * error.c (dump_expr): Handle TREE_LIST.
1990 * parser.c (cp_parser_std_attribute_list): Return error_mark if
1991 make_pack_expansion returns an error.
1993 2017-04-17 Bernd Edlinger <bernd.edlinger@hotmail.de>
1996 * class.c (fixup_may_alias): Fix all type variants.
1998 2017-04-17 Jason Merrill <jason@redhat.com>
2000 PR c++/80415 - wrong error with default arg and array reference.
2001 * tree.c (lvalue_kind): Return clk_class for an array prvalue.
2003 * pt.c (tsubst_init): Set TARGET_EXPR_DIRECT_INIT_P.
2005 2017-04-15 Alexandre Oliva <aoliva@redhat.com>
2007 * decl.c (name_unnamed_type): Split out of...
2008 (grokdeclarator): ... this.
2009 * decl.h (name_unnamed_type): Declare.
2011 2017-04-12 Richard Biener <rguenther@suse.de>
2012 Bernd Edlinger <bernd.edlinger@hotmail.de>
2015 * tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
2016 for arrays of character or std::byte type.
2018 2017-04-11 Jason Merrill <jason@redhat.com>
2020 PR c++/80294 - ICE with constexpr and inheritance.
2021 * constexpr.c (reduced_constant_expression_p):
2022 A null constructor element is non-constant.
2023 (cxx_eval_indirect_ref): Don't VERIFY_CONSTANT before
2024 returning an empty base.
2026 2017-04-11 Jakub Jelinek <jakub@redhat.com>
2029 * decl.c (cp_finish_decomp): If processing_template_decl on
2030 non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't
2031 change their DECL_VALUE_EXPR nor cp_finish_decl them. Instead make
2032 sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst
2034 * pt.c (value_dependent_expression_p) <case VAR_DECL>: For variables
2035 with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
2038 2017-04-11 Jakub Jelinek <jakub@redhat.com>
2041 * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.
2043 2017-04-10 Jakub Jelinek <jakub@redhat.com>
2046 * tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
2047 operand, if it is a static member function, recurse on the
2050 2017-04-10 Marek Polacek <polacek@redhat.com>
2053 * typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL. Set
2054 ORIG_TYPE earlier and not only when shortening.
2056 2017-04-07 Jason Merrill <jason@redhat.com>
2058 PR c++/80356 - ICE with reference to function template argument.
2060 * pt.c (convert_nontype_argument_function): Adjust type even with a
2061 value-dependent argument.
2063 PR c++/80267 - ICE with nested capture of reference
2065 * pt.c (tsubst_copy): Handle lookup finding a capture proxy.
2067 2017-04-07 Marek Polacek <polacek@redhat.com>
2070 * typeck.c (cp_build_binary_op): Convert COP[01] to ORIG_TYPE.
2073 * call.c (build_over_call): Don't check cxx_dialect.
2074 * cp-gimplify.c (cp_gimplify_init_expr): Don't check cxx_dialect nor
2075 whether SUB is a CONSTRUCTOR.
2076 * init.c (build_new_1): Don't check cxx_dialect.
2077 * tree.c (replace_placeholders): Add a function comment. Return if
2078 not in C++14, or if the object isn't a (member of a) class.
2079 * typeck2.c (store_init_value): Don't check cxx_dialect nor whether
2080 TYPE is CLASS_TYPE_P.
2082 2017-04-05 Jakub Jelinek <jakub@redhat.com>
2085 * pt.c (canonical_type_parameter): Use vec_safe_grow_cleared instead
2086 of a loop doing vec_safe_push of NULL. Formatting fixes.
2087 (rewrite_template_parm): Copy TEMPLATE_PARM_PARAMETER_PACK from oldidx
2088 to newidx before calling canonical_type_parameter on newtype.
2090 2017-04-04 Volker Reichelt <v.reichelt@netcologne.de>
2093 * cxx-pretty-print.c (cxx_pretty_printer::expression): Add
2094 UNARY_PLUS_EXPR case.
2096 2017-04-03 Jason Merrill <jason@redhat.com>
2098 * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
2100 2017-04-03 Jonathan Wakely <jwakely@redhat.com>
2102 * class.c (update_vtable_entry_for_fn): Fix typo in comment.
2103 * decl2.c (one_static_initialization_or_destruction): Likewise.
2104 * name-lookup.c (store_bindings): Likewise.
2105 * parser.c (make_call_declarator): Likewise.
2106 * pt.c (check_explicit_specialization): Likewise.
2108 2017-04-03 Jason Merrill <jason@redhat.com>
2110 PR sanitizer/79993 - ICE with VLA initialization from string
2111 PR c++/69487 - wrong VLA initialization from string
2112 * init.c (finish_length_check): Split out from build_vec_init.
2113 (build_vec_init): Handle STRING_CST.
2114 * typeck2.c (split_nonconstant_init): Handle STRING_CST.
2115 (digest_init_r): Don't give a STRING_CST VLA type.
2117 2017-03-31 Jakub Jelinek <jakub@redhat.com>
2120 * cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
2121 REFERENCE_TYPE. Adjust ubsan_maybe_instrument_reference caller
2122 for NOP_EXPR to REFERENCE_TYPE.
2125 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
2126 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
2128 * semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
2129 Remove extraneous parens.
2130 (finish_trait_expr): Handle CPTK_IS_AGGREGATE.
2131 * parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
2132 (cp_parser_trait_expr): Likewise.
2134 2017-03-27 Jakub Jelinek <jakub@redhat.com>
2137 * cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
2138 * typeck.c (cxx_mark_addressable): Likewise. Look through
2139 VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
2141 (cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
2143 2017-03-24 Jason Merrill <jason@redhat.com>
2145 PR c++/77339 - ICE with invalid use of alias template.
2146 * pt.c (lookup_template_class_1): Don't try to enter the scope of an
2149 2017-03-24 Marek Polacek <polacek@redhat.com>
2152 * cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
2153 doesn't have side effects.
2155 2017-03-23 Jason Merrill <jason@redhat.com>
2157 PR c++/80150 - ICE with overloaded variadic deduction.
2158 * pt.c (try_one_overload): Remove asserts.
2160 PR c++/77563 - missing ambiguous conversion error.
2161 * call.c (convert_like_real): Use LOOKUP_IMPLICIT.
2163 2017-03-23 Marek Polacek <polacek@redhat.com>
2165 * cp-tree.h: Remove a C_RID_YYCODE reference.
2167 2017-03-22 Jakub Jelinek <jakub@redhat.com>
2170 * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
2171 case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
2172 processing_template_decl.
2174 2017-03-21 Paolo Carlini <paolo.carlini@oracle.com>
2177 * name-lookup.c (pushtag_1): Add check for bogus, non template,
2178 std::initializer_list.
2180 2017-03-21 Jakub Jelinek <jakub@redhat.com>
2183 * init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.
2185 2017-03-21 Ville Voutilainen <ville.voutilainen@gmail.com>
2188 * init.c (std_placement_new_fn_p): New.
2189 (build_new_1): Call it.
2191 2017-03-20 Jason Merrill <jason@redhat.com>
2193 PR c++/80096 - ICE with C++17 non-type auto.
2194 * pt.c (tsubst): Delay tsubst of type of template non-type
2197 PR c++/79519 - ICE with deleted template friend.
2198 * decl.c (grokdeclarator): Complain about misplaced function
2199 definition using =, as well.
2201 PR c++/79640 - infinite recursion with generic lambda.
2202 * pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
2203 before substituting its initializer.
2205 2017-03-20 Marek Polacek <polacek@redhat.com>
2206 Paolo Carlini <paolo.carlini@oracle.com>
2208 PR c++/80059 - ICE with noexcept and __transaction_atomic
2209 * except.c (build_must_not_throw_expr): Call
2210 instantiate_non_dependent_expr.
2212 2017-03-19 Jason Merrill <jason@redhat.com>
2214 PR c++/80084 - wrong C++17 decomposition by reference of parameter.
2215 * decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
2216 reference decomposition.
2218 PR c++/80077 - error with constexpr and -fno-elide-constructors.
2219 * constexpr.c (cxx_eval_call_expression): Set ctx->call while
2220 expanding trivial constructor.
2222 2017-03-17 Jason Merrill <jason@redhat.com>
2224 PR c++/78345 - ICE initializing array from lambda.
2225 * init.c (build_aggr_init): Check array initializer.
2226 (build_vec_init): Check the type of a CONSTRUCTOR.
2228 PR c++/80073 - C++17 ICE with virtual base.
2229 * decl.c (xref_basetypes): Also check for indirect vbases.
2231 2017-03-16 Jason Merrill <jason@redhat.com>
2233 * decl.c (start_enum): std::byte aliases anything.
2236 * constexpr.c (lookup_placeholder): Tweak.
2238 2017-03-15 Jason Merrill <jason@redhat.com>
2240 PR c++/80043 - ICE with -fpermissive
2241 * typeck.c (convert_for_assignment): Handle instantiate_type
2242 not giving an error.
2244 2017-03-14 Nathan Sidwell <nathan@acm.org>
2246 PR c++/79393 DR 1658 workaround
2247 * method.c (synthesized_method_base_walk): Inihibit abstract class
2248 virtual base access check here.
2249 (synthesized_method_walk): Not here.
2251 2017-03-13 Nathan Sidwell <nathan@acm.org>
2253 PR c++/79393 DR 1658 workaround
2254 * method.c (synthesized_method_walk): Check vbases of abstract
2255 classes for dtor walk.
2257 2017-03-10 David Malcolm <dmalcolm@redhat.com>
2259 PR translation/79848
2260 * decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
2262 2017-03-10 Jason Merrill <jason@redhat.com>
2264 PR c++/79960 - alias templates and partial ordering
2265 * pt.c (comp_template_args): Add partial_order parm.
2266 (template_args_equal): Likewise.
2267 (comp_template_args_porder): New.
2268 (get_partial_spec_bindings): Use it.
2270 2017-03-10 Marek Polacek <polacek@redhat.com>
2273 * decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
2275 2017-03-10 Jakub Jelinek <jakub@redhat.com>
2278 * optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
2279 Use XALLOCAVEC macro.
2282 * decl.c (finish_enum_value_list): If value is error_mark_node,
2283 don't copy it and change its type.
2284 * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
2285 of CONST_DECL is error_mark_node.
2287 2017-03-09 Marek Polacek <polacek@redhat.com>
2289 PR c++/79900 - ICE in strip_typedefs
2290 * tree.c (strip_typedefs): Skip the attribute handling if T is
2291 a variant type which hasn't been updated yet.
2293 PR c++/79687 - wrong code with pointer-to-member
2294 * init.c (constant_value_1): Break if the variable has a dynamic
2297 2017-03-08 Jason Merrill <jason@redhat.com>
2299 PR c++/79797 - ICE with self-reference in array DMI.
2300 * constexpr.c (lookup_placeholder): Split out...
2301 (cxx_eval_constant_expression): ...from here.
2303 2017-03-07 Jakub Jelinek <jakub@redhat.com>
2306 * parser.c (cp_parser_omp_cancellation_point,
2307 cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
2308 cp_parser_omp_target_update): Change "may only be used in compound
2309 statements" diagnostics, such that the same translatable string is
2310 used for all pragmas.
2311 (cp_parser_pragma): Likewise. Use error_at instead of
2312 cp_parser_error for that diagnostics.
2314 2017-03-06 Marek Polacek <polacek@redhat.com>
2316 PR c++/79796 - ICE with NSDMI and this pointer
2317 * call.c (build_over_call): Handle NSDMI with a 'this' by calling
2318 replace_placeholders.
2320 2017-03-06 Jakub Jelinek <jakub@redhat.com>
2323 * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
2326 2017-03-06 Jason Merrill <jason@redhat.com>
2328 Revert "Allow deduction guides to look into primary template."
2329 * cp-tree.h, parser.c, pt.c, search.c: Revert.
2331 2017-03-05 Paolo Carlini <paolo.carlini@oracle.com>
2334 * except.c (build_must_not_throw_expr): Perform the implicit
2335 conversions on the condition.
2337 2017-03-03 Jason Merrill <jason@redhat.com>
2339 * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
2342 Core issues 2273 and 2277
2343 * call.c (joust): Adjust using-declaration tiebreaker to handle
2344 the intermediate base case.
2345 * method.c (strip_inheriting_ctors): Just return the argument if
2346 !flag_new_inheriting_ctors.
2348 2017-03-03 Richard Biener <rguenther@suse.de>
2351 * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
2353 2017-03-03 Marek Polacek <polacek@redhat.com>
2356 * typeck.c (string_conv_p): In C++11, always call pedwarn with
2359 2017-03-02 Jason Merrill <jason@redhat.com>
2361 Update overload resolution with deduction guides.
2362 * pt.c (do_class_deduction): Always build the copy guide.
2363 (copy_guide_p, template_guide_p): New.
2364 (build_deduction_guide): Remember the original constructor.
2365 * call.c (joust): Prefer the copy guide and non-template guides.
2367 Allow deduction guides to look into primary template.
2368 * cp-tree.h (struct saved_scope): Add deduction_guide_type.
2369 (struct cp_decl_specifier_seq): Add constructor_p.
2370 * parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
2371 (cp_parser_init_declarator): Check it. Set ctor_dtor_or_conv_p.
2372 Clear deduction_guide_type. Don't handle deduction guide names.
2373 (cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
2374 (cp_parser_direct_declarator): Likewise. Handle deduction guides.
2375 (cp_parser_member_declaration, cp_parser_cache_defarg)
2376 (cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
2377 * pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
2378 (build_deduction_guide): Set deduction_guide_type.
2379 (dependent_scope_p): Check deduction_guide_type.
2380 * search.c (lookup_member): Likewise.
2382 2017-03-02 Jakub Jelinek <jakub@redhat.com>
2385 * init.c (mark_exp_read_r): New function.
2386 (emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
2387 whole arguments instead of plain mark_exp_read on TREE_LIST values.
2389 2017-03-01 Jason Merrill <jason@redhat.com>
2391 Class template argument deduction in new-expression
2392 * init.c (build_new): Handle deduction from no initializer.
2393 * parser.c (cp_parser_new_expression): Don't require a single
2394 expression for class template deduction.
2395 * typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
2396 class template placeholder.
2397 * pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
2398 (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
2399 (redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
2401 2017-03-01 Jakub Jelinek <jakub@redhat.com>
2404 * init.c (emit_mem_initializers): When not constructing vbases of
2405 abstract classes, mark arguments as read for
2406 -Wunused-but-set-parameter.
2408 2017-02-28 Jason Merrill <jason@redhat.com>
2410 Class template argument deduction refinements
2411 * call.c (joust): Move deduction guide tiebreaker down.
2412 * decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
2413 deduction with no initializer.
2414 * pt.c (build_deduction_guide): Handle implicit default/copy ctor.
2415 (do_class_deduction): Use that rather than special case.
2416 (do_auto_deduction): Handle null initializer.
2418 2017-02-28 Jakub Jelinek <jakub@redhat.com>
2420 * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
2421 instead of just cond ? "..." : "...".
2422 (grokdeclarator): Likewise.
2423 (build_enumerator): Likewise.
2424 * init.c (build_new_1): Likewise.
2425 * call.c (build_new_method_call_1): Likewise.
2426 * parser.c: Include intl.h.
2427 (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
2428 "enter"/"exit" keyword.
2429 (cp_finalize_oacc_routine): Don't use %s to supply portions of the
2432 2017-02-27 Jason Merrill <jason@redhat.com>
2434 PR c++/71568 - SFINAE forming pointer to member function
2435 * init.c (build_offset_ref): Check the return value of
2436 perform_or_defer_access_check.
2438 2017-02-27 Marek Polacek <polacek@redhat.com>
2440 * decl.c (expand_static_init): Add missing } in a comment.
2442 2017-02-27 Volker Reichelt <v.reichelt@netcologne.de>
2444 * init.c: Include intl.h.
2445 (build_new_1): Move message strings into pedwarn to make them
2446 -Wformat-security friendly. Mark string for translation.
2447 * pt.c (tsubst_copy_and_build): Mark string for translation.
2448 Make the pointer const.
2449 * semantics.c (finish_id_expression): Mark strings for translation.
2451 2017-02-25 Jakub Jelinek <jakub@redhat.com>
2453 * call.c (build_op_delete_call): Make msg1 and msg2 const.
2455 2017-02-24 Jakub Jelinek <jakub@redhat.com>
2458 * call.c (build_over_call): Call check_function_arguments even for
2459 -Wrestrict, adjust check_function_arguments caller.
2460 * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
2462 * typeck.c (cp_build_function_call_vec): Adjust
2463 check_function_arguments caller.
2465 2017-02-24 Marek Polacek <polacek@redhat.com>
2467 PR translation/79705
2468 * decl.c (check_redeclaration_exception_specification): Mark a string
2469 for translation. Make the pointer const.
2471 2017-02-23 Paolo Carlini <paolo.carlini@oracle.com>
2474 * pt.c (register_specialization): Check duplicate_decls return value
2475 for error_mark_node and pass it back.
2477 2017-02-22 Jason Merrill <jason@redhat.com>
2479 PR c++/79679 - missing destructor for argument
2480 * call.c (build_over_call): Don't pass tf_no_cleanup to argument
2483 * pt.c (do_class_deduction): Handle 0 argument case.
2485 2017-02-22 Jakub Jelinek <jakub@redhat.com>
2488 * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
2489 SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
2490 * constexpr.c (potential_constant_expression_1): Handle
2491 OMP_*, OACC_* and CILK_* trees. Use error_at with
2492 EXPR_LOC_OR_LOC (t, input_location) computed early
2493 instead of error, or error_at with location_of (t).
2495 2017-02-22 Marek Polacek <polacek@redhat.com>
2498 * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
2499 if the alignas expression is erroneous.
2500 * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
2504 * semantics.c (finish_underlying_type): Bail out for incomplete enums.
2506 2017-02-21 Jason Merrill <jason@redhat.com>
2508 PR c++/50308 - wrong deprecated warning with ADL
2509 PR c++/17729 - duplicate deprecated warning
2510 * semantics.c (finish_id_expression): Only call mark_used on a
2511 function if we aren't building a call.
2513 PR c++/41727 - ICE with partial spec of partial instantiation
2514 * pt.c (process_partial_specialization): For now, don't check more
2515 specialized if there is more than one level of args.
2517 2017-02-21 Marek Polacek <polacek@redhat.com>
2520 * cp-tree.h (maybe_reject_flexarray_init): Declare.
2521 * init.c (maybe_reject_flexarray_init): No longer static.
2522 Add check for current_function_decl.
2523 * parser.c (cp_parser_late_parse_one_default_arg): Reject
2524 a default mem-initializer for a flexible array.
2526 2017-02-21 Jakub Jelinek <jakub@redhat.com>
2527 Paolo Carlini <paolo.carlini@oracle.com>
2530 * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
2532 * pt.c (tsubst_decomp_names): Return error_mark_node if the first
2533 decl after the decomposition artificial decl has error_mark_node.
2534 * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
2535 instead of just == error_mark_node comparison.
2537 2017-02-21 Jakub Jelinek <jakub@redhat.com>
2540 * decl.c: Include gimplify.h.
2541 (cp_finish_decomp): Make sure there is no sharing of trees
2542 in between DECL_VALUE_EXPR of decomposition decls.
2545 * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
2548 * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
2549 call cplus_expand_constant on it first.
2551 2017-02-19 Jason Merrill <jason@redhat.com>
2553 PR c++/78139 - destructor needed by new-expression
2554 * call.c (build_special_member_call): Use tf_no_cleanup.
2556 PR c++/78282 - auto template and pack expansion
2557 * pt.c (find_parameter_packs_r): Don't walk into the type of
2558 templates other than template template-parameters.
2560 PR c++/79606 - ICE with this->base_member in NSDMI
2561 * class.c (build_base_path): Check processing_template_decl.
2563 PR c++/79607 - ICE with T{} initializer
2564 * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
2566 PR c++/79566 - elaborated-type-specifier in range for
2567 * parser.c (cp_parser_simple_declaration): Fix check for type
2570 PR c++/79400 - confusing suggestion of 'noexcept'
2571 * parser.c (cp_parser_exception_specification_opt): Remove
2572 suggestion for deprecated dynamic exception-specification.
2574 PR c++/79470 - partial ordering with reference parameters
2575 * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
2577 PR c++/79500 - ICE with non-template deduction guide
2578 * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
2579 DECL_TEMPLATE_RESULT.
2581 PR c++/79580 - ICE with compound literal
2582 * parser.c (cp_parser_class_head): If we're in the middle of an
2583 expression, use ts_within_enclosing_non_class.
2585 PR c++/79503 - inherited ctor taking base class
2586 * call.c (add_function_candidate): Also check that
2587 DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
2589 2017-02-19 Paolo Carlini <paolo.carlini@oracle.com>
2592 * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
2595 2017-02-19 Eric Fiselier <eric@efcs.ca>
2596 Jonathan Wakely <jwakely@redhat.com>
2599 * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
2600 control warning about literal suffix identifiers without a leading
2603 2017-02-17 Jason Merrill <jason@redhat.com>
2605 PR c++/79508 - lookup error with member template
2606 * parser.c (cp_parser_template_name): Clear
2607 parser->context->object_type if we aren't doing lookup.
2609 PR c++/78690 - ICE with using and global type with same name
2610 * pt.c (type_dependent_object_expression_p): True for
2613 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
2614 * pt.c (convert_template_argument): Just return an auto arg pack.
2615 (tsubst_template_args): Don't tsubst an auto pack type.
2617 PR c++/79556 - C++17 ICE with non-type auto
2618 * pt.c (do_auto_deduction): Don't try to deduce from null type.
2620 PR c++/79533 - C++17 ICE with temporary cast to reference
2621 * call.c (build_over_call): Conversion to a reference prevents copy
2624 2017-02-16 Jakub Jelinek <jakub@redhat.com>
2625 Jason Merrill <jason@redhat.com>
2627 PR c++/79502 - lost nodiscard attribute
2628 * pt.c (apply_late_template_attributes): Do apply non-dependent
2629 attributes to types.
2631 2017-02-16 Jason Merrill <jason@redhat.com>
2633 PR c++/78572 - ICE with self-modifying array initializer
2634 * constexpr.c (cxx_eval_store_expression): The object we're
2635 initializing is outside the constant-expression.
2636 (cxx_eval_call_expression): Set ctx->call.
2638 PR c++/79050 - ICE with undeduced auto and LTO
2639 * decl.c (poplevel): Remove undeduced auto decls.
2641 2017-02-16 Jakub Jelinek <jakub@redhat.com>
2644 * parser.c (cp_parser_omp_target): For -fopenmp-simd
2645 ignore #pragma omp target even when not followed by identifier.
2647 2017-02-15 Jason Merrill <jason@redhat.com>
2648 Jakub Jelinek <jakub@redhat.com>
2650 PR c++/79464 - ICE in IPA with omitted constructor parms
2651 * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
2652 (adjust_clone_args): Adjust.
2653 (add_method): Remember omitted parms.
2654 * call.c (add_function_candidate): Likewise.
2655 * mangle.c (write_method_parms): Likewise.
2656 * method.c (ctor_omit_inherited_parms): Return false if there are no
2659 2017-02-15 Martin Sebor <msebor@redhat.com>
2662 * init.c (maybe_reject_flexarray_init): New function.
2663 (perform_member_init): Call it.
2665 2017-02-15 Jakub Jelinek <jakub@redhat.com>
2668 * parser.c (cp_parser_std_attribute): Don't pedwarn about
2669 [[deprecated]] with -std=c++11 and [[fallthrough]] with
2670 -std=c++11 and -std=c++14.
2673 * decl.c (grokdeclarator): For static data members, handle thread_p
2674 only after handling inline.
2676 2017-02-14 Marek Polacek <polacek@redhat.com>
2680 * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
2681 clobbering if the postfix expression isn't an EXPR_P.
2683 2017-02-13 Jason Merrill <jason@redhat.com>
2685 PR c++/79461 - ICE with lambda in constexpr constructor
2686 * constexpr.c (build_data_member_initialization): Ignore
2687 initialization of a local variable.
2689 2017-02-13 Jakub Jelinek <jakub@redhat.com>
2691 * init.c (warn_placement_new_too_small): Add missing space in
2693 * parser.c (cp_parser_oacc_declare): Likewise.
2694 * mangle.c (maybe_check_abi_tags): Likewise.
2697 * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
2698 on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
2699 in the rightmost operand.
2701 2017-02-13 Nathan Sidwell <nathan@acm.org>
2703 PR c++/79296 - ICE mangling localized template instantiation
2704 * decl2.c (determine_visibility): Use template fn context for
2705 local class instantiations.
2707 2017-02-11 Jason Merrill <jason@redhat.com>
2709 PR c++/77659 - ICE with new and C++14 aggregate NSDMI
2710 * init.c (build_new): Make backups of any CONSTRUCTORs in init.
2711 (build_new_1): Use replace_placeholders.
2712 * tree.c (replace_placeholders_t): Also track whether we've seen a
2714 (replace_placeholders, replace_placeholders_r): Adjust.
2715 * cp-tree.h: Adjust.
2717 PR c++/77790 - ICE with auto function in C++11 mode
2718 * decl.c (undeduced_auto_decl): Remove C++14 limitation.
2719 (require_deduced_type): Add complain parm, return bool.
2720 * cp-tree.h: Adjust.
2721 * decl2.c (mark_used): Use require_deduced_type.
2723 2017-02-10 Jason Merrill <jason@redhat.com>
2725 PR c++/78908 - template ops and bitfields
2726 * tree.c (build_min_non_dep): Use unlowered_expr_type.
2728 PR c++/78897 - constexpr union
2729 * constexpr.c (cxx_eval_store_expression): A store to a union member
2730 erases a previous store to another member.
2732 PR c++/71285 - member of fold-expression
2733 * semantics.c (finish_unary_fold_expr)
2734 (finish_binary_fold_expr): Use null type for fold-expressions.
2736 PR c++/79401 - protected inherited constructor
2737 * call.c (enforce_access): For inheriting constructor, find a base
2738 binfo in the path we already have.
2740 2017-02-10 Marek Polacek <polacek@redhat.com>
2743 * pt.c (type_dependent_expression_p): Check if the expression type
2747 * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
2748 if warnings shouldn't be given.
2750 2017-02-10 Paolo Carlini <paolo.carlini@oracle.com>
2753 * pt.c (tsubst_decl): Don't try to preserve a typedef that names
2754 an error_mark_node as type.
2756 2017-02-09 Jakub Jelinek <jakub@redhat.com>
2757 Jason Merrill <jason@redhat.com>
2760 * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
2761 from pattern to type.
2763 2017-02-09 Jason Merrill <jason@redhat.com>
2765 PR c++/79316 - default argument in deduction guide
2766 PR c++/79350 - explicit deduction guide
2767 * parser.c (cp_parser_constructor_declarator_p)
2768 (cp_parser_direct_declarator): Parse deduction guides more like
2770 * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
2771 * tree.c (special_function_p): Return it.
2772 * decl.c (check_special_function_return_type): Handle it.
2773 (grokdeclarator, grokfndecl): Adjust.
2774 (cp_finish_decl): Pass flags to do_auto_deduction.
2775 * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
2776 * pt.c (dguide_name_p): Take a const_tree.
2777 (do_class_deduction): Handle explicit.
2778 (do_auto_deduction): Pass flags through.
2779 (build_deduction_guide): Copy explicit flag.
2781 2017-02-09 Jakub Jelinek <jakub@redhat.com>
2784 * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
2785 non-pragma_compound context here.
2786 (cp_parser_omp_target): Likewise.
2787 (cp_parser_pragma): Don't call push_omp_privatization_clauses and
2788 parsing for ordered and target omp pragmas in non-pragma_stmt
2789 non-pragma_compound contexts.
2792 * parser.c (cp_parser_oacc_declare): Formatting fix.
2793 (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
2794 automatic variables.
2796 2016-02-09 Nathan Sidwell <nathan@codesourcery.com>
2797 Chung-Lin Tang <cltang@codesourcery.com>
2799 * parser.c (cp_parser_oacc_clause_tile): Disallow collapse. Fix
2800 parsing. Parse constant expression. Remove semantic checking.
2801 (cp_parser_omp_clause_collapse): Disallow tile.
2802 (cp_parser_omp_for_loop): Deal with tile clause. Don't emit a parse
2803 error about missing for after already emitting one. Use more
2804 conventional for idiom for unbounded loop.
2805 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
2806 * semantics.c (finish_omp_clauses): Correct TILE semantic check.
2807 (finish_omp_for): Deal with tile clause.
2809 2017-02-07 Nathan Sidwell <nathan@acm.org>
2811 * method.c (synthesized_method_base_walk): New. Broken out of ...
2812 (synthesized_method_walk): ... here. Call it. Cleanup
2815 2017-02-07 Patrick Palka <ppalka@gcc.gnu.org>
2818 * typeck2.c (process_init_constructor_union): Consider only
2819 FIELD_DECLs when looking for an NSDMI.
2821 2017-02-06 Jason Merrill <jason@redhat.com>
2823 PR c++/71193 - incomplete types in templates
2824 * parser.c (cp_parser_postfix_dot_deref_expression): In a template
2825 handle incomplete type by pedwarning and then treating as dependent.
2827 2017-02-06 Jakub Jelinek <jakub@redhat.com>
2830 * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
2831 (potential_constant_expression_1): Likewise.
2834 * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
2835 allow one fewer than expected arguments if flag_permissive.
2838 * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
2839 * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
2840 with error_mark_node type.
2842 2017-02-03 Jason Merrill <jason@redhat.com>
2844 PR c++/78689 - ICE on constructor with label
2845 * optimize.c (maybe_clone_body): Replace omitted parameters with
2847 * class.c (build_clone): Fix logic for omitting inherited parms.
2849 PR c++/12245 - excessive memory use
2850 * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
2851 back in. Don't cache constants.
2852 (maybe_constant_init): Don't cache constants.
2854 PR c++/79294 - ICE with invalid template argument
2855 * pt.c (convert_nontype_argument_function): Check value-dependence.
2856 (convert_nontype_argument): Don't check it here for function ptrs.
2858 2017-02-02 Richard Biener <rguenther@suse.de>
2861 * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
2862 it lazily on the first changed element only and copy it
2863 fully upfront, only storing changed elements.
2865 2017-02-02 Paolo Carlini <paolo.carlini@oracle.com>
2868 * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
2871 2017-01-31 Jakub Jelinek <jakub@redhat.com>
2874 * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
2877 2017-01-31 David Malcolm <dmalcolm@redhat.com>
2880 * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
2881 any namespace aliases.
2883 2017-01-31 Nathan Sidwell <nathan@acm.org>
2886 * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
2890 * pt.c: (instantiate_decl): Push to top level when current
2891 function scope doesn't match. Only push lmabda scope stack when
2894 * cp-tree.h (instantiate_decl): Make defer_ok bool.
2895 * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
2896 (instantiate_decl): Simplify and reorder state saving and restoration.
2899 * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
2900 * semantics.c (finish_member_declaration): Assert class is being
2903 2017-01-30 Alexandre Oliva <aoliva@redhat.com>
2905 Introduce C++ support in libcc1.
2906 * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
2907 (ansi_opname): Rename to...
2908 (cp_operator_id): ... this. Adjust all callers.
2909 (ansi_assopname): Rename to...
2910 (cp_assignment_operator_id): ... this. Adjust all callers.
2911 (cp_literal_operator_id): Declare.
2912 (set_global_friend): Declare.
2913 (is_global_friend): Declare.
2914 (enum cp_oracle_request): New type.
2915 (cp_binding_oracle_function): New type.
2916 (cp_binding_oracle): Declare.
2917 (cp_finish_injected_record_type): Declare.
2918 * friend.c (global_friend): New var.
2919 (set_global_friend): New fn.
2920 (is_global_friend): New fn.
2921 (is_friend): Call is_global_friend.
2922 * name-lookup.c (cp_binding_oracle): New var.
2923 (query_oracle): New fn.
2924 (qualified_lookup_using_namespace): Call query_oracle.
2925 (lookup_name_real_1): Likewise.
2926 * parser.c (cp_literal_operator_id): Drop static.
2927 * search.c (friend_accessible_p): Call is_global_friend.
2928 * semantics.c (is_this_parameter): Accept a variable if the
2929 binding oracle is enabled.
2931 2017-01-27 Jason Merrill <jason@redhat.com>
2933 PR c++/78771 - ICE with inherited constructor.
2934 * call.c (build_over_call): Call deduce_inheriting_ctor here.
2935 * pt.c (tsubst_decl): Not here.
2936 * class.c (add_method): Or here.
2937 * method.c (deduce_inheriting_ctor): Handle clones.
2938 (implicitly_declare_fn): Don't deduce inheriting ctors yet.
2940 2017-01-27 Adam Butcher <adam@jessamine.co.uk>
2943 * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
2945 * cp/cp-tree.h: Declare it.
2946 * cp/semantics.c (finish_id_expression): Resolve names within a default
2947 capturing generic lambda defined within a template prior to
2948 instantiation to allow for captures to be added to the closure type.
2950 2017-01-26 Jakub Jelinek <jakub@redhat.com>
2953 * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
2954 * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
2955 * parser.c (cp_parser_builtin_offsetof): Pass result of
2956 build_static_cast of null_pointer_node to finish_offsetof.
2957 * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
2958 it for -Winvalid-offsetof pedwarn instead of trying to guess
2959 original offsetof type from EXPR. Save OBJECT_PTR as a new
2960 second operand to OFFSETOF_EXPR.
2961 * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
2962 finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
2965 2017-01-26 Jason Merrill <jason@redhat.com>
2967 * name-lookup.c (parse_using_directive): Deprecate strong using.
2969 PR c++/79176 - lambda ICE with -flto -Os
2970 * decl2.c (vague_linkage_p): Handle decloned 'tors.
2971 * tree.c (decl_linkage): Likewise.
2973 2017-01-25 Martin Sebor <msebor@redhat.com>
2975 * decl.c (grokdeclarator): Fix a typo in a comment.
2977 2017-01-25 Jakub Jelinek <jakub@redhat.com>
2980 * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
2984 * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
2985 OPT_Wpedantic on lambda templates for -std=c++14 and higher.
2987 2017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
2990 * decl.c (cxx_init_decl_processing): Pass main_input_filename
2991 to build_translation_unit_decl.
2993 2017-01-24 Jakub Jelinek <jakub@redhat.com>
2996 * cp-gimplify.c (cp_genericize_r): Add result of
2997 convert_from_reference on invisiref parm to p_set.
2999 2017-01-24 Nathan Sidwell <nathan@acm.org>
3001 PR c++/78469 - defaulted ctor and inaccessible dtor
3002 * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
3003 * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
3004 * tree.c (build_target_expr): Check tf_no_cleanup.
3006 PR c++/79118 - anon-members and constexpr
3007 * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
3008 ctor decl. Recursively check anonymous members.
3009 (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
3011 (explain_invalid_constexpr_fn): Likewise.
3013 2017-01-23 Nathan Sidwell <nathan@acm.org>
3015 PR c++/71710 - template using directive of field
3016 * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
3019 PR c++/71406 - ICE with scope-ref'd template id exprs
3021 * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
3022 before breaking up TEMPLATE_ID_EXPR.
3024 2017-01-20 Nathan Sidwell <nathan@acm.org>
3026 PR c++/78495 - wrong code inherited ctor and invisi-ref parm
3027 * cp-gimplify.c (cp_generize_r): Don't skip thunks.
3029 2017-01-20 David Malcolm <dmalcolm@redhat.com>
3033 * cp-tree.h (suggest_alternatives_for): Add bool param.
3034 (suggest_alternative_in_explicit_scope): New decl.
3035 * error.c (qualified_name_lookup_error): When SCOPE is a namespace
3036 that isn't the global one, call new function
3037 suggest_alternative_in_explicit_scope, only calling
3038 suggest_alternatives_for if it fails, and disabling near match
3039 searches fort that case. When SCOPE is the global namespace,
3040 pass true for new param to suggest_alternatives_for to allow for
3042 * lex.c (unqualified_name_lookup_error): Pass true for new param
3043 to suggest_alternatives_for.
3044 * name-lookup.c (consider_binding_level): Add forward decl.
3045 (suggest_alternatives_for): Add "suggest_misspellings" param,
3046 using it to conditionalize the fuzzy name-lookup code.
3047 (suggest_alternative_in_explicit_scope): New function.
3048 * parser.c (cp_parser_primary_expression): When calling
3049 finish_id_expression, pass location of id_expression rather
3050 than that of id_expr_token.
3051 (cp_parser_id_expression): Convert local "unqualified_id" from
3052 tree to cp_expr to avoid implicitly dropping location information.
3054 2017-01-20 Marek Polacek <polacek@redhat.com>
3057 * call.c (build_conditional_expr_1): Warn about duplicated branches.
3058 * semantics.c (finish_expr_stmt): Build statement using the proper
3061 2017-01-19 Jason Merrill <jason@redhat.com>
3063 US 20 - forwarding references and class template argument deduction
3064 * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
3065 * pt.c (push_template_decl_real): Set it.
3066 (maybe_adjust_types_for_deduction): Check it.
3067 (rewrite_template_parm): Copy it.
3069 US 19 - deduction guides and constructors
3070 * call.c (joust): Prefer deduction guides to constructors.
3071 * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
3072 (deduction_guide_p): Check DECL_P.
3074 * decl.c (check_initializer): Always use build_aggr_init for array
3077 PR c++/79130 - decomposition and direct-initialization
3078 * init.c (build_aggr_init): Communicate direct-initialization to
3080 (build_vec_init): Check for array copy sooner.
3081 * parser.c (cp_parser_decomposition_declaration): Remove call to
3082 build_x_compound_expr_from_list.
3084 2017-01-18 Jason Merrill <jason@redhat.com>
3086 PR c++/68666 - member variable template-id
3087 * typeck.c (finish_class_member_access_expr): Handle variable
3089 * pt.c (lookup_and_finish_template_variable): No longer static.
3090 * cp-tree.h: Declare it.
3092 2017-01-18 Nathan Sidwell <nathan@acm.org>
3095 * call.c (build_over_call): When checking ellipsis conversions for
3096 an inherited ctor, make sure there is at least one conversion.
3098 2017-01-18 Jason Merrill <jason@redhat.com>
3100 PR c++/78894 - ICE with class deduction and default arg
3101 * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
3103 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
3106 * mangle.c (write_discriminator): Reorganize abi warning check.
3108 2017-01-18 Nathan Sidwell <nathan@acm.org>
3110 * cp-tree.h: Clarify exception spec node comment.
3111 * except.c (nothrow_spec_p): Simplify by checking node-equality.
3114 * mangle.c (write_exception_spec): Check nothrow explicitly.
3115 (write_encoding): Don't increment processing_template_decl around
3118 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
3121 * mangle.c (write_template_args): Add "on" for operator names.
3123 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
3126 * mangle.c (write_discriminator): Handle discriminator >= 10.
3128 2017-01-17 Nathan Sidwell <nathan@acm.org>
3131 * cp-tree.h (maybe_generic_this_capture): Declare.
3132 * lambda.c (resolvable_dummy_lambda): New, broken out of ...
3133 (maybe_resolve_dummy): ... here. Call it.
3134 (maybe_generic_this_capture): New.
3135 * parser.c (cp_parser_postfix_expression): Speculatively capture
3136 this in generic lambda in unresolved member function call.
3137 * pt.c (tsubst_copy_and_build): Force hard error from failed
3138 member function lookup in generic lambda.
3140 2017-01-17 Aldy Hernandez <aldyh@redhat.com>
3143 * cp-array-notation.c (expand_array_notation_exprs): Handle
3146 2017-01-11 Jason Merrill <jason@redhat.com>
3148 PR c++/78337 - ICE on invalid with generic lambda
3149 * semantics.c (process_outer_var_ref): Check if containing_function
3150 is null. Move inform call under complain test.
3152 2017-01-11 Nathan Sidwell <nathan@acm.org>
3155 * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
3158 2017-01-11 Nathan Sidwell <nathan@acm.org>
3160 * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
3162 2017-01-11 Jakub Jelinek <jakub@redhat.com>
3165 * parser.c (cp_parser_std_attribute_spec): Remove over-eager
3166 assertion. Formatting fix.
3169 * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
3172 2017-01-10 David Malcolm <dmalcolm@redhat.com>
3175 * parser.c (cp_parser_class_specifier_1): Only suggest inserting
3176 a missing semicolon if we have a valid insertion location for
3179 2017-01-10 Jason Merrill <jason@redhat.com>
3181 FI 20, decomposition declaration with parenthesized initializer.
3182 * parser.c (cp_parser_decomposition_declaration): Use
3183 cp_parser_initializer.
3185 2017-01-09 Jason Merrill <jason@redhat.com>
3187 Implement P0195R2, C++17 variadic using.
3188 * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
3189 * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
3190 * error.c (dump_decl): Likewise.
3192 2017-01-09 Jakub Jelinek <jakub@redhat.com>
3194 PR translation/79019
3195 PR translation/79020
3196 * semantics.c (finish_omp_clauses): Add missing whitespace to
3197 translatable strings.
3198 * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
3200 2017-01-07 Jason Merrill <jason@redhat.com>
3202 PR c++/78948 - instantiation from discarded statement
3203 * parser.h (struct cp_parser): Remove in_discarded_stmt field.
3204 * cp-tree.h (in_discarded_stmt): Declare it.
3205 (struct saved_scope): Add discarded_stmt bitfield.
3206 (in_discarded_stmt): New macro.
3207 * decl2.c (mark_used): Check it.
3208 * parser.c (cp_parser_selection_statement): Adjust.
3209 (cp_parser_jump_statement): Adjust.
3211 2017-01-05 Jakub Jelinek <jakub@redhat.com>
3214 * decl.c (cp_finish_decomp): Remove probe variable, if tt is
3215 REFERENCE_REF_P, set tt to its operand.
3218 * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
3219 unions even for C++11 and later.
3221 2017-01-05 Nathan Sidwell <nathan@acm.org>
3224 * pt.c (convert_nontype_argument): Don't try and see if integral
3225 or enum expressions are constants prematurely.
3227 2017-01-04 Marek Polacek <polacek@redhat.com>
3230 * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
3231 a zero character literal.
3233 2017-01-04 Jakub Jelinek <jakub@redhat.com>
3236 * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
3240 * parser.c (cp_parser_simple_declaration): Only complain about
3241 inconsistent auto deduction if auto_result doesn't use auto.
3243 * parser.c (cp_parser_simple_declaration): Diagnose function
3244 declaration among more than one init-declarators with auto
3248 * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
3249 assertion, as lexer->buffer may be NULL.
3251 2017-01-04 Marek Polacek <polacek@redhat.com>
3255 * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
3257 2017-01-04 Nathan Sidwell <nathan@acm.org>
3260 * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
3261 (lambda_capture_field_type): Update prototype.
3262 * lambda.c (lambda_capture_field_type): Add is_reference parm.
3263 Add referenceness here.
3264 (add_capture): Adjust lambda_capture_field_type call, refactor
3266 * pt.c (tsubst): Adjust lambda_capture_field_type call.
3268 2017-01-01 Jakub Jelinek <jakub@redhat.com>
3270 Update copyright years.
3272 Copyright (C) 2017 Free Software Foundation, Inc.
3274 Copying and distribution of this file, with or without modification,
3275 are permitted in any medium without royalty provided the copyright
3276 notice and this notice are preserved.