1 2017-06-26 Jason Merrill <jason@redhat.com>
3 PR c++/81215 - deduction failure with variadic TTP.
4 * pt.c (unify_bound_ttp_args): Restore old logic for C++14 and down.
6 2017-06-26 Martin Sebor <msebor@redhat.com>
9 * call.c (maybe_warn_class_memaccess): Preserve explicit conversions
10 to detect casting away cv-qualifiers.
12 2017-06-26 Nathan Sidwell <nathan@acm.org>
14 * cp-tree.h (lang_decl_fn): Remove assignment_operator_p field.
15 (DECL_COMPLETE_CONSTRUCTOR_P): Directly compare
17 (DECL_BASE_CONSTRUCTOR_P, DECL_COMPLETE_DESTRUCTOR_P,
18 DECL_BASE_DESTRUCTOR_P, DECL_DELETING_DESTRUCTOR_P): Likewise.
19 (DECL_ASSIGNMENT_OPERATOR_P): Use IDENTIFIER_ASSIGN_OP_P.
20 * decl.c (grok_op_properties): Adjust identifier checking.
21 * init.c (expand_default_init): Adjust identifier descision.
22 * method.c (implicitly_declare_fn): Don't use
23 DECL_ASSIGNMENT_OPERATOR_P.
24 * search.c (lookup_fnfields_1): Use IDENTIFIER_CTOR_P,
26 * call.c (in_charge_arg_for_name): Reimplement.
27 (build_special_member_call): Use IDENTIFIER_CDTOR_P,
30 2017-06-26 Marek Polacek <polacek@redhat.com>
33 * parser.c (cp_parser_statement): Add a default argument. Save the
34 location of the expression-statement after labels have been parsed.
35 (cp_parser_implicitly_scoped_statement): Set the location of the
36 body of the conditional after parsing all the labels. Call
37 warn_for_multistatement_macros.
38 (cp_parser_already_scoped_statement): Likewise.
40 2017-06-24 Paolo Carlini <paolo.carlini@oracle.com>
43 * parser.c (cp_parser_diagnose_invalid_type_name): Don't print
44 'typename' in error messages about missing 'typename'.
46 2017-06-23 Jason Merrill <jason@redhat.com>
48 PR c++/79056 - C++17 ICE with invalid template syntax.
49 * parser.c (cp_parser_simple_type_specifier): Don't assume that type
51 (cp_parser_check_for_invalid_template_id): Handle TYPE_DECL.
52 * pt.c (template_placeholder_p): New.
53 * cp-tree.h: Declare it.
55 2017-06-23 Marc Glisse <marc.glisse@inria.fr>
57 * decl.c (duplicate_decls): Use builtin_structptr_types.
59 2017-06-22 Nathan Sidwell <nathan@acm.org>
61 Reorder IDENTIFIER flags
63 * cp-tree.h (enum cp_identifier_kind): New.
64 (IDENTIFIER_KIND_BIT_0, IDENTIFIER_KIND_BIT_1,
65 IDENTIFIER_KIND_BIT_2): New.
66 (IDENTIFIER_MARKED): Move to TREE_LANG_FLAG_4.
67 (IDENTIFIER_VIRTUAL_P, IDENTIFIER_REPO_CHOSEN): Add IDENTIFIER_CHECK.
68 (C_IS_RESERVED_WORD): Replace with ...
69 (IDENTIFIER_KEYWORD_P): ... this.
70 (IDENTIFIER_CTOR_OR_DTOR_P): Replace with ...
71 (IDENTIFIER_CDTOR_P): ... this.
72 (IDENTIFIER_CTOR_P, IDENTIFIER_DTOR_P): New.
73 (IDENTIFIER_OPNAME_P): Replace with ...
74 (IDENTIFIER_ANY_OP_P): ... this.
75 (IDENTIFIER_ASSIGN_OP_P): New.
76 (IDENTIFIER_TYPENAME_P): Replace with ...
77 (IDENTIFIER_CONV_OP_P): ... this.
78 (NEW_DELETE_OPNAME_P): Replace with ...
79 (IDENTIFIER_NEWDEL_OP_P): ... this.
80 (DECL_CONV_FN_P, DECL_OVERLOADED_OPERATOR_P): Adjust.
81 (get_identifier_kind_name, set_identifier_kind): Declare.
82 * lex.c (get_identifier_kind_name, set_identifier_kind): New.
83 (init_operators): Adjust to avoid keywords, use
84 set_identifier_kind. Copy TYPE_EXPR slot.
85 (init_reswords): Call set_identifier_kind.
86 (unqualified_name_lookup_error): Adjust.
87 * operators.def (TYPE_EXPR): Remove.
88 * decl.c (struct predefined_identifier): Move into ...
89 (initialize_predefined_identifiers): ... here. Call
91 (grokfndecl, check_var_type, grokdeclarator): Adjust.
92 (grok_op_properties): Use IDENTIFIER_ANY_ASSIGN_OP to halve search
94 * call.c (name_as_c_string): Adjust.
95 (build_new_method_call_1): Likewise.
96 * cp-cilkplus.c (is_conversion_operator_function_decl_p): Likewise.
97 * cxx-pretty-print.c (pp_cxx_unqualified_id): Adjust.
98 * dump.c (cp_dump_tree): Adjust.
99 * error.c (dump_decl_name): Adjust.
100 * mangle.c (write_unqualified_id, write_member_name,
101 write_expression): Adjust.
102 (mangle_conv_op_name_for_type): Use set_identifier_kind.
103 * name-lookup.c (do_class_using_decl): Adjust.
104 (lookup_name_fuzzy, lookup_name_real_1): Likewise.
105 * parser.c (cp_lexer_get_preprocessor_token,
106 cp_parser_direct_declarator): Likewise.
107 * pt.c (push_template_decl_real, tsubst_decl, tsubst_baselink,
108 tsubst_copy, tsubst_copy_and_build): Adjust.
109 * ptree.c (cxx_print_identifier): Print identifier kind.
110 * search.c (lookup_field_r, lookup_member,
111 lookup_fnfields_idx_nolazy): Adjust.
112 * semantics.c (finish_id_expression): Adjust..
113 * typeck.c (cp_build_addr_expr_1): Adjust.
115 2017-06-21 Jakub Jelinek <jakub@redhat.com>
118 * semantics.c (handle_omp_array_sections_1, finish_omp_clauses):
119 Complain about t not being a variable if t is OVERLOAD even
120 when processing_template_decl.
122 2017-06-21 David Malcolm <dmalcolm@redhat.com>
124 * parser.c (get_cast_suggestion): New function.
125 (maybe_add_cast_fixit): New function.
126 (cp_parser_cast_expression): Capture the location of the closing
127 parenthesis. Call maybe_add_cast_fixit when emitting warnings
128 about old-style casts.
130 2017-06-20 Jason Merrill <jason@redhat.com>
132 PR c++/80972 - C++17 ICE with attribute packed.
133 * call.c (build_over_call): Allow a TARGET_EXPR from reference
136 2017-06-20 Nathan Sidwell <nathan@acm.org>
138 * cp-tree.h (CPTI_NELTS_IDENTIFIER): Delete.
139 (nelts_identifier): Delete.
140 * decl.c (initialize_predefined_identifiers): Remove nelts.
142 PR c++/67074 - namespace aliases
143 * decl.c (duplicate_decls): Don't error here on mismatched
145 * name-lookup.c (name_lookup::add_value): Matching namespaces are
147 (diagnose_name_conflict): Namespaces are never redeclarations.
148 (update_binding): An alias can match a real namespace.
150 2017-06-19 Jason Merrill <jason@redhat.com>
152 PR c++/80562 - ICE with constexpr if.
153 * semantics.c (finish_if_stmt_cond): Call
154 instantiate_non_dependent_expr.
156 PR c++/80829 - ICE with constexpr copy of base subobject.
157 * constexpr.c (clear_no_implicit_zero): New.
158 (cxx_eval_call_expression): Call it.
160 2017-06-19 Nathan Sidwell <nathan@acm.org>
164 * name-lookup.c (set_decl_namespace): Don't follow using
165 directives and ignore using decls. Only check overly-explicit
166 scope after discovering decl.
168 2017-06-19 Jason Merrill <jason@redhat.com>
170 PR c++/81073 - constexpr and static var in statement-expression.
171 * typeck2.c (store_init_value): Always call
172 require_potential_constant_expression.
173 * pt.c (convert_nontype_argument): Likewise.
174 * constexpr.c (potential_constant_expression_1): Adjust message.
175 Use decl_maybe_constant_var_p instead of decl_constant_var_p.
176 * decl2.c (decl_maybe_constant_var_p): Consider initializer.
178 2017-06-19 Nathan Sidwell <nathan@acm.org>
180 * pt.c (coerce_template_parms): Fix indentation.
181 (tsubst_decl): Remove repeated SET_DECL_RTL. Move VAR_P handling
185 * name-lookup.c (update_binding): Only warn about constructors
188 2017-06-17 Jason Merrill <jason@redhat.com>
190 PR c++/60063 - -Wunused-local-typedefs and templates.
191 * decl2.c (is_late_template_attribute): Return false for "used".
193 PR c++/70844 - -Wuseless-cast and inheriting constructor.
194 * method.c (forward_parm): Suppress warn_useless_cast.
196 2017-06-16 Jason Merrill <jason@redhat.com>
198 PR c++/81045 - Wrong type-dependence with auto return type.
199 * pt.c (type_dependent_expression_p): An undeduced auto outside the
200 template isn't dependent.
201 * call.c (build_over_call): Instantiate undeduced auto even in a
204 PR c++/80465 - ICE with generic lambda with noexcept-specifier.
205 * lambda.c (maybe_add_lambda_conv_op): Keep processing_template_decl
206 set longer for a generic lambda.
208 PR c++/80614 - Wrong mangling for C++17 noexcept type
209 * mangle.c (write_type): Put the eh spec back on the function type.
211 PR c++/81102 - Wrong error with partial specialization.
212 * pt.c (unify) [TEMPLATE_PARM_INDEX]: Strip reference when comparing
213 types. Do type deduction later.
215 PR c++/81074 - ICE with partial specialization of member template.
217 * pt.c (get_partial_spec_bindings): Only coerce innermost args.
219 PR c++/80831 - ICE with -fsyntax-only.
220 * decl2.c (c_parse_final_cleanups): Use cgraph_node::get_create.
222 PR c++/80639 - ICE with invalid PMF initialization.
223 PR c++/80043 - ICE with -fpermissive
224 * typeck.c (convert_for_assignment): Recurse when instantiate_type
225 returns without an error.
227 2017-06-16 Nathan Sidwell <nathan@acm.org>
229 * pt.c (tsubst_baselink): Fix & clarify formatting.
231 * cp-tree.h (build_this_parm, cp_build_parm_decl,
232 build_artificial_parm): Add FN parm.
233 * decl.c (start_cleanup_fn): Adjust.
234 (build_this_parm): Add FN parm, pass it through.
235 (grokfndecl): Adjust parm building.
236 * decl2.c (cp_build_parm_decl): Add FN parm, set context.
237 (build_artificial_parm): Add FN parm, pass through.
238 (maybe_retrofit_in_chrg): Adjust parm building.
239 (start_static_storage_duration_function): Likwise.
240 * lambda.c (maybe_aadd_lambda_conv_op): Likewise.
241 * method.c (implicitly_declare_fn): Likewise.
242 * parser.c (inject_this_parameter): Likewise.
244 Symbol tables are insert only.
245 * cp-tree.h (default_hash_traits <lang_identifier *>): Don't
246 derive from pointer_hash. Make undeletable.
248 * class.c (resort_type_method_vec): Avoid potential unsigned
251 Don't defer noexcept_deferred_spec.
252 * cp-tree.h (unevaluated_noexcept_spec): Don't declare.
253 * decl.c (cxx_init_decl_processing): Initialize
254 noexcept_deferred_spec.
255 * except.c (unevaluated_noexcept_spec): Delete.
256 * class.c (deduce_noexcept_on_destructor): Use
257 noexcept_deferred_spec directly.
258 * method.c (implicitly_declare_fn): Likewise.
260 Make keyed_classes a vector.
261 * cp-tree.h (CPTI_KEYED_CLASSES, keyed_classes): Delete.
262 (keyed_classes): Declare as vector.
263 * decl.c (keyed_classes): Define.
264 (cxx_init_decl_processing): Allocate it.
265 (record_key_method_defined): Use vec_safe_push.
266 * class.c (finish_struct_1): Likewise.
267 * pt.c (instantiate_class_template_1): Likewise.
268 * decl2.c (c_parse_final_cleanups): Reverse iterate keyed_classes.
271 * rtti.c (enum tinfo_kind): Add TK_DERIVED_TYPES,
272 TK_VMI_CLASS_TYPES, TK_MAX. Delete TK_FIXED.
274 (typeid_ok_p): Add quotes to error messages. Use get_tinfo_desc.
275 (get_tinfo_decl): Use get_tinfo_desc.
276 (get_pseudo_ti_init): Likewise. Adjust VMI construction.
277 (create_pseudo_type_info): Delete.
278 (get_pseudo_ti_index): Just determine the index.
279 (get_tinfo_desc): New. Create all types lazily.
280 (create_tinfo_types): Just allocate the descriptor array.
281 (emit_support_tinfos): Use non-inserting type lookup. Set builtin
284 2017-06-15 Martin Sebor <msebor@redhat.com>
287 * call.c (first_non_public_field, maybe_warn_class_memaccess): New
289 (has_trivial_copy_assign_p, has_trivial_copy_p): Ditto.
290 (build_cxx_call): Call maybe_warn_class_memaccess.
292 2017-06-14 Jakub Jelinek <jakub@redhat.com>
294 * cp-gimplify.c (cp_genericize_r): Turn most of the function
295 into a switch (TREE_CODE (stmt)) statement from long else if
298 2017-06-13 Jakub Jelinek <jakub@redhat.com>
301 * cp-gimplify.c (cp_genericize_r): Don't instrument MEM_REF second
302 argument even if it has REFERENCE_TYPE.
305 * cp-gimplify.c (cp_genericize): Only look for VAR_DECLs in
306 BLOCK_VARS (outer) chain.
307 (cxx_omp_const_qual_no_mutable): Likewise.
309 2017-06-13 Martin Liska <mliska@suse.cz>
312 * class.c (build_base_path): Use sanitize_flags_p.
313 * cp-gimplify.c (cp_genericize_r): Likewise.
314 (cp_genericize_tree): Likewise.
315 (cp_genericize): Likewise.
316 * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
317 * decl.c (compute_array_index_type): Likewise.
318 (start_preparsed_function): Likewise.
319 * decl2.c (one_static_initialization_or_destruction): Likewise.
320 * init.c (finish_length_check): Likewise.
321 * lambda.c (maybe_add_lambda_conv_op): Likewise.
322 * typeck.c (cp_build_binary_op): Likewise.
323 (build_static_cast_1): Likewise.
325 2017-06-11 Jason Merrill <jason@redhat.com>
327 * error.c (dump_expr): Use is_this_parameter.
329 * cp-tree.h, decl2.c, mangle.c, parser.c, pt.c, semantics.c: Use
332 2017-06-09 Jason Merrill <jason@redhat.com>
334 Missing bits from N4268, constant evaluation for all non-type args.
335 * call.c (build_converted_constant_expr): Rename from
336 build_integral_nontype_arg_conv, handle all types.
337 * pt.c (convert_nontype_argument): In C++17 call it for all types.
338 Move NOP stripping inside pointer case, don't strip ADDR_EXPR.
339 * cvt.c (strip_fnptr_conv): Also strip conversions to the same type.
341 Overhaul pointer-to-member conversion and template argument handling.
342 * call.c (standard_conversion): Avoid creating ck_pmem when the
343 class type is the same.
344 * cvt.c (can_convert_qual): Split from
345 perform_qualification_conversions.
346 * constexpr.c (cxx_eval_constant_expression): Check it.
347 * typeck.c (convert_ptrmem): Only cplus_expand_constant if
348 adjustment is necessary.
349 * pt.c (check_valid_ptrmem_cst_expr): Compare class types.
350 (convert_nontype_argument): Avoid redundant error.
352 * call.c (convert_like_real): Remove "inner" parameter.
353 Don't replace a constant with its value.
354 * cp-gimplify.c (cp_fully_fold): Use cp_fold_rvalue.
356 * pt.c (convert_nontype_argument): Check NULLPTR_TYPE_P rather than
359 * parser.c (cp_parser_constant_expression): Check
360 potential_rvalue_constant_expression after decay_conversion.
361 * pt.c (convert_nontype_argument): Don't require linkage in C++17.
363 PR c++/80384 - ICE with dependent noexcept-specifier
364 * pt.c (dependent_type_p_r) [FUNCTION_TYPE]: Check for dependent
367 * constexpr.c (potential_constant_expression_1): Allow 'this' capture.
369 2017-06-09 Jan Hubicka <hubicka@ucw.cz>
371 * class.c (build_vtbl_initializer): Mark dvirt_fn as cold.
372 * decl.c (cxx_init_decl_processing, push_throw_library_fn): Likewise.
373 (excpet.c): Mark terminate as cold.
375 2017-06-08 Jakub Jelinek <jakub@redhat.com>
378 * semantics.c (handle_omp_array_sections_1): Convert TYPE_MAX_VALUE
379 to sizetype before size_binop.
382 * cp-gimplify.c (cxx_omp_finish_clause): When changing clause
383 to OMP_CLAUSE_SHARED, also clear OMP_CLAUSE_SHARED_FIRSTPRIVATE
384 and OMP_CLAUSE_SHARED_READONLY flags.
386 2017-06-08 Jan Hubicka <hubicka@ucw.cz>
388 * cp-tree.h (lang_check_failed): Annotate by ATTRIBUTE_COLD.
390 2017-06-07 Nathan Sidwell <nathan@acm.org>
392 * class.c (layout_class_type): Restructure overlong-bitfield tpe
395 2017-06-07 Jonathan Wakely <jwakely@redhat.com>
398 * pt.c (do_class_deduction): Build qualified type.
400 2017-06-06 Nathan Sidwell <nathan@acm.org>
402 * name-lookup.c (suggest_alternatives_for): Use qualified lookup
403 sans using directives. Don't walk into inline namespaces.
406 * name-lookup.c (adl_class_only): Don't add visible friends.
408 2017-06-05 Volker Reichelt <v.reichelt@netcologne.de>
410 * parser.c (cp_parser_base_specifier): Fix typos in error messages.
412 2017-06-02 Nathan Sidwell <nathan@acm.org>
414 Remove lang_type_ptrmem.
415 * cp-tree.h (lang_type_header): Remove is_lang_type_class. Move
417 (lang_type_class): ... this. Reorder bitfields. Rename to ...
418 (lang_type): ... this. Delete old definition.
419 (lang_type_ptrmem): Delete.
420 (LANG_TYPE_CLASS_CHECK): Simply get TYPE_LANG_SPECIFIC. Adjust uses.
421 (LANG_TYPE_PTRMEM_CHECK): Delete.
422 (TYPE_GET_PTRMEMFUNC_TYPE, TYPE_SET_PTRMEMFUNC_TYPE): Delete.
423 (TYPE_PTRMEMFUNC_TYPE): New. Use TYPE_LANG_SLOT_1.
424 * decl.c (build_ptrmemfunc_type): Adjust.
425 * lex.c (copy_lang_type): Remove lang_type_ptrmem handling.
426 (maybe_add_lang_type_raw): Don't set u.c.h.is_lang_type_class.
428 * class.c (check_bases_and_members): Adjust vec_new_uses_cookie
431 Remove cp_binding_level::namespaces
432 * name-lookup.h (cp_binding_level): Lose namespaces field.
433 * name-lookup.c (add_decl_to_level): Chain namespaces on the names
435 (suggest_alternatives_for): Adjust for namespace list. Do
436 breadth-first search.
437 * decl2.c (collect_source_refs): Namespaces are on the regulr
439 (collect_ada_namespace): Likewise.
441 2017-06-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
443 * typeck.c (cp_build_binary_op): Implement the -Wsizeof_pointer_div
446 2017-06-01 Ville Voutilainen <ville.voutilainen@gmail.com>
449 * method.c (constructible_expr): Strip array types before calling
452 2017-06-01 Paolo Carlini <paolo.carlini@oracle.com>
455 * cvt.c (convert_to_void): Possibly call maybe_warn_nodiscard
456 for case INDIRECT_REF too in the main switch.
458 2017-05-31 Jason Merrill <jason@redhat.com>
460 PR c++/80840 - ICE with constexpr and reference
461 * pt.c (convert_nontype_argument): Don't test whether a decl is
462 value-dependent when binding to a reference.
464 2017-05-31 Nathan Sidwell <nathan@acm.org>
466 * cp-tree.h (lang_decl_slector): New enum.
467 (lang_decl_base): Make selector an enum. Drop decomposition_p
469 (lang_decl): Use enum for discrimination.
470 (LANG_DECL_FN_CHECK, LANG_DECL_NS_CHECK, LANG_DECL_PARM_CHECK,
471 LANG_DECL_DEOMP_CHECK): Use enum.
472 (DECL_DECOMPOSITION_P): Use selector value.
473 (SET_DECL_DECOMPOSITION_P): Delete.
474 (retrofit_lang_decl): Lose SEL parm.
475 (fit_decomposition_lang_decl): Declare.
476 * decl.c (cp_finish_decomp, grokdeclarator): Use
477 fit_decomposition_lang_decl.
478 * lex.c (maybe_add_lang_decl_raw): New. Broken out of
480 (set_decl_linkage): New. Broken out of retrofit_lang_decl. Use enum.
481 (fit_decomposition_lang_decl): Likewise.
482 (retrofit_lang_decl): Use worker functions.
483 (cxx_dup_lang_specific_decl): Use selector enum.
484 (maybe_add_lang_type_raw): New. Broken out of ...
485 (cxx_make_type_name): ... here. Call it.
487 2017-05-30 Jason Merrill <jason@redhat.com>
489 PR c++/80856 - ICE with local extern in template
490 * semantics.c (finish_call_expr): Replace a local extern overload
491 set in a template with the IDENTIFIER_NODE.
493 2017-05-30 David Malcolm <dmalcolm@redhat.com>
495 * call.c (perform_implicit_conversion_flags): Convert
496 "from %qT to %qT" to "from %qH to %qI" in diagnostic.
497 (print_conversion_rejection): Replace pairs of %qT with
498 %qH and %qI in various places.
499 (build_user_type_conversion_1): Likewise.
500 (build_integral_nontype_arg_conv): Likewise.
501 (build_conditional_expr_1): Likewise.
502 (convert_like_real): Likewise.
503 (convert_arg_to_ellipsis): Likewise.
505 (initialize_reference): Likewise.
506 * cvt.c (cp_convert_to_pointer): Likewise.
507 (cp_convert_to_pointer): Likewise.
508 (convert_to_reference): Likewise.
509 (ocp_convert): Likewise.
510 * error.c (cp_printer): Gain bool and const char ** parameters.
511 (struct deferred_printed_type): New struct.
512 (class cxx_format_postprocessor): New class.
513 (cxx_initialize_diagnostics): Wire up a cxx_format_postprocessor
514 to pp->m_format_postprocessor.
515 (comparable_template_types_p): New function.
516 (newline_and_indent): New function.
517 (arg_to_string): New function.
518 (print_nonequal_arg): New function.
519 (print_template_differences): New function.
520 (type_to_string_with_compare): New function.
521 (print_template_tree_comparison): New function.
522 (append_formatted_chunk): New function.
523 (add_quotes): New function.
524 (cxx_format_postprocessor::handle): New function.
525 (defer_phase_2_of_type_diff): New function.
526 (cp_printer): Add "quoted" and "buffer_ptr" params. Implement
528 * typeck.c (cp_build_binary_op): Replace pairs of %qT with
529 %qH and %qI in various places.
530 (convert_member_func_to_ptr): Likewise.
531 (build_reinterpret_cast_1): Likewise.
532 (convert_for_assignment): Likewise.
533 * typeck2.c (check_narrowing): Likewise.
535 2017-05-30 Nathan Sidwell <nathan@acm.org>
537 Kill IDENTIFIER_NAMESPACE_BINDINGS
538 * cp-tree.h (lang_identifier): Delete namespace_bindings.
539 (IDENTIFIER_NAMESPACE_BINDINGS): Delete.
540 (lang_decl_ns): Add bindings.
541 (DECL_NAMESPACE_BINDINGS): New.
542 * lex.c (retrofit_lang_decl): Create namespace hash table.
543 * name-lookup.c (find_namespace_slot): Change to use hash-map.
544 * ptree.c (cxx_print_binding): Delete.
545 (cxx_print_identifier): Remove NAMESPACE_BINDING printing.
547 * cp-tree.def (OVERLOAD): Fix comment.
548 * cp-tree.h: Fix comments and whitespace.
549 * error.c (dump_decl): Use pp_cxx_colon_colon, ovl_scope.
550 * name-lookup.c (add_decl_to_level): Assert not class.
551 (check_local_shadow): Use OVL_P.
552 (pushdecl_with_scope_1): Rename to ...
553 (do_pushdecl_with_Scope): ... here.
554 (do_nonmember_using_decl): Use qualified_namespace_lookup return
556 (push_class_level_binding_1): Use OVL_P.
557 (pushdecl_namespace_level): Use do_pushdecl_with_scope.
558 (pushtag_1): Rename to ...
559 (do_pushtag): ... here. Adjust do_pushdecl_with_scope call.
561 (store_class_bindings): Do not time here.
562 * name-lookup.h (pushdecl_outermost_localscope): Reorder.
563 * pt.c (listify): Declare argvec at point of initialization.
566 * name-lookup.c (add_decl_to_level): Assert not making a circular
568 (update_binding): Don't prematurely slide artificial decl.
570 2017-05-29 Alexandre Oliva <aoliva@redhat.com>
572 * cp-tree.h (lang_identifier): Drop oracle_looked_up, unused.
574 2017-05-29 Nathan Sidwell <nathan@acm.org>
577 * cp-tree.h (lookup_maybe_add): Add DEDUPING argument.
578 * name-lookup.c (name_lookup): Add deduping field.
579 (name_lookup::preserve_state, name_lookup::restore_state): Deal
581 (name_lookup::add_overload): New.
582 (name_lookup::add_value, name_lookup::add_fns): Call add_overload.
583 (name_lookup::search_adl): Set deduping. Don't unmark here.
584 * pt.c (most_specialized_instantiation): Revert previous change,
585 Assert not given duplicates.
586 * tree.c (lookup_mark): Just mark the underlying decls.
587 (lookup_maybe_add): Dedup using marked decls.
590 * ptree.c (cxx_print_xnode): Show internal OVERLOAD structure.
591 * tree.c (ovl_insert, ovl_iterator_remove_node): Fix copying assert.
593 Stat hack representation
594 * name-lookup.c (STAT_HACK_P, STAT_TYPE, STAT_DECL,
595 MAYBE_STAT_DECL, MAYBE_STAT_TYPE): New.
597 (find_namespace_binding): Replace with ...
598 (find_namespace_slot): ... this.
599 (find_namespace_value): New.
600 (name_lookup::search_namespace_only,
601 name_lookup::adl_namespace_only): Adjust.
602 (update_binding): Add SLOT parameter, adjust.
603 (check_local_shadow): Use find_namespace_value.
604 (set_local_extern_decl_linkage): Likewise.
605 (do_pushdecl): Adjust for namespace slot.
606 (push_local_binding): Assert not a namespace binding.
607 (check_for_out_of_scope_variable): Use find_namespace_value.
608 (set_identifier_type_value_with_scope): Likewise.
609 (get_namespace_binding): Likewise.
610 (set_namespace_binding): Delete.
611 (set_global_binding): Directly update the binding.
612 (finish_namespace_using_decl): Likewise.
613 (lookup_type_scope_1): Use find_namespace_slot and update.
614 (do_push_nested_namespace): Use find_namespace_value.
617 * pt.c (most_specialized_instantiation): Cope with duplicate
621 * cp-tree.h (build_min_nt_call_vec): Declare.
622 * decl.c (build_offset_ref_call_from_tree): Call it.
623 * parser.c (cp_parser_postfix_expression): Likewise.
624 * pt.c (tsubst_copy_and_build): Likewise.
625 * semantics.c (finish_call_expr): Likewise.
626 * tree.c (build_min_nt_loc): Keep unresolved lookups.
627 (build_min): Likewise.
628 (build_min_non_dep): Likewise.
629 (build_min_non_dep_call_vec): Likewise.
630 (build_min_nt_call_vec): New.
633 * tree.c (ovl_copy): Adjust assert, copy OVL_LOOKUP.
635 (lookup_keep): Call it.
637 2017-05-26 Nathan Sidwell <nathan@acm.org>
640 * name-lookup.c (push_inline_namespaces): New.
641 (push_namespace): Look inside inline namespaces.
643 Inline and using namespace representation change.
644 * cp-tree.h (struct lang_decl_ns): Delete ns_using. Add usings,
646 (DECL_NAMESPACE_USING): Adjust.
647 (DECL_NAMESPACE_INLINEES): New.
648 * name-lookup.h (struct cp_binding_level): Change usings
650 * name-lookup.c (name_lookup::do_queue_usings,
651 name_lookup::queue_usings): Adjust.
652 (name_lookup::search_namespace, name_lookup::search_usings,
653 name_lookup::queue_namespace): Adjust.
654 (name_lookup::adl_namespace_only): Adjust.
655 (add_using_namespace, push_namespace): Push onto vector.
656 (pop_namespace): Add timing logic.
658 * call.c (build_operator_new_call): Do namelookup and ADL here.
659 (build_new_op_1): Likewise.
660 * name-lookup.h (lookup_function_nonclass): Delete declaration.
661 (do_using_directive): Likewise.
662 * name-lookup.c (set_namespace_binding, push_local_binding): Don't
664 (struct scope_binding): Delete.
665 (EMPTY_SCOPE_BINDING): Delete.
666 (set_decl_namespace): Use OVL_P.
667 (finish_local_using_decl): Lose unnecesary checks.
668 (lookup_function_nonclass): Delete.
669 (cp_emit_debug_info_for_using): Use MAYBE_BASELINK_P.
671 * cp-tree.h (OVL_CHAIN): Check looking at OVERLOAD.
672 (ovl_iterator): Add allow_inner field. Adjust ctor. Make
674 (ovl_iterator::maybe_push, ovl_iterator::pop): New.
675 (lkp_iterator): Add outer field. Adjust ctor.
676 (lkp_iterator::operator++): New.
677 (lookup_mark, lookup_maybe_add): Declare.
678 * name-lookup.c (name_lookup): Delete fn_set member.
679 (name_lookup::preserve_state, name_lookup::restore_state): Unmark
681 (name_lookup::add_value): Use lookup_add directly.
682 (name_lookup::add_fns: Use lookup_maybe_add.
683 (name_lookup::search_adl): Mark and unmark fns.
685 * pt.c (check_explicit_specialization): Use lookup_add directly.
686 * ptree.c (cxx_print_xnode): Show complete overload structure.
687 * tree.c (lookup_mark, lookup_maybe_add): New.
689 * name-lookup.c (name_lookup::search_adl): ADL OMP UDR type args.
691 2017-05-26 Jakub Jelinek <jakub@redhat.com>
693 * cp-tree.h (struct lang_decl_decomp): New type.
694 (struct lang_decl): Add u.decomp.
695 (LANG_DECL_DECOMP_CHECK): Define.
696 (DECL_DECOMPOSITION_P): Note it is set also on the vars
697 for user identifiers.
698 (DECL_DECOMP_BASE): Define.
699 (retrofit_lang_decl): Add extra int = 0 argument.
700 * lex.c (retrofit_lang_decl): Add SEL argument, if non-zero
701 use it to influence the selector choices and for selector
702 0 to non-zero transition copy old content.
703 (cxx_dup_lang_specific_decl): Handle DECL_DECOMPOSITION_P.
704 * decl.c (poplevel): For DECL_DECOMPOSITION_P, check
705 !DECL_DECOMP_BASE instead of !DECL_VALUE_EXPR. Adjust warning
706 wording if decl is a structured binding.
707 (cp_finish_decomp): Pass 4 as the new argument to retrofit_lang_decl.
708 Set DECL_DECOMP_BASE. Ignore DECL_READ_P sets from initialization
709 of individual variables for tuple structured bindings.
710 (grokdeclarator): Pass 4 as the new argument to retrofit_lang_decl.
711 Clear DECL_DECOMP_BASE.
712 * decl2.c (mark_used): Mark DECL_DECOMP_BASE TREE_USED as well.
713 * pt.c (tsubst_decomp_names): Assert DECL_DECOMP_BASE matches what
715 * expr.c (mark_exp_read): Recurse on DECL_DECOMP_BASE instead of
718 2017-05-25 Jason Merrill <jason@redhat.com>
720 PR c++/80605 - __is_standard_layout and zero-length array
721 * class.c (check_bases): Use DECL_FIELD_IS_BASE.
723 2017-05-25 Nathan Sidwell <nathan@acm.org>
725 Kill OVL_CURRENT, OVL_NEXT.
726 * cp-tree.h (OVL_CURRENT, OVL_NEXT): Delete.
727 * name-lookup.c (set_decl_namespace): Use ovl_iterator.
728 (consider_binding_level): Use OVL_FIRST.
729 (cp_emit_debug_info_for_using): Use lkp_iterator.
730 * pt.c (check_explicit_specialization): Use ovl_iterator.
732 Kill DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS.
733 * cp-tree.h (lang_decl_ns): Remove ns_users field.
734 (DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS): Delete.
735 (TREE_INDIRECT_USING): Delete.
736 * name-lookup.h (is_associated_namespace): Delete.
737 * name-lookup.c (name_lookup::search_usings,
738 name_lookup::do_queue_usings): Usings are always direct.
739 (is_associated_namespace): Delete.
740 (handle_namespace_attrs): Use DECL_NAMESPACE_INLINE_P.
741 (namespace_ancestor_1, namespace_ancestor): Delete.
742 (push_using_directive_1, push_using_directive): Delete.
743 (add_using_namespace_1): Delete.
744 (add_using_namespace): Reimplement.
745 (emit_debug_info_using_namespace): New.
746 (finish_namespace_using_directive, finish_local_using_directive,
747 push_namespace): Adjust.
748 * tree.c (cp_free_lang_data): Remove DECL_NAMESPACE_USERS handling.
750 2017-05-25 Volker Reichelt <v.reichelt@netcologne.de>
752 * semantics.c (finish_handler_parms): Warn about non-reference type
755 2017-05-25 Nathan Sidwell <nathan@acm.org>
757 Reimplement unqualified namespace lookup.
758 * name-lookup.c (name_lookup::using_pair,
759 name_lookup::using_queue): New typedefs.
760 (name_lookup::queue_namespace, name_lookup::do_queue_usings,
761 name_lookup::queue_usings): New.
762 (name_lookup::search_unqualified): New.
763 (merge_functions, same_entity_p, ambiguous_decl,
764 unqualified_namespace_lookup_1, unqualified_namespace_lookup,
765 lookup_using_namespace): Delete.
766 (lookup_name_real_1): Adjust.
768 Reimplement qualified namespace lookup.
769 * name-lookup.c (name_lookup::flags): New member. Adjust ctor.
770 (name_lookup::ambiguous, name_lookup::add_value,
771 name_lookup::add_type, name_lookup::process_binding): New.
772 (name_lookup::search_namespace_only,
773 name_lookup::search_namespace, name_lookup::search_usings): New.
774 (name_lookup::search_qualified): New.
775 (do_nonmember_using_decl, suggest_alternatives_for,
776 lookup_qualified_name): Adjust.
777 (tree_vec_contains): Delete.
778 (qualified_lookup_using_namespace): Rename to ...
779 (qualified_namespace_lookup): ... here. Reimplement.
782 * cp-tree.h (LOOKUP_SEEN_P, LOOKUP_FOUND_P): New.
783 * name-lookup.h (lookup_arg_dependent): Return plain tree.
784 * name-lookup.c (arg_lookup, arg_assoc, arg_assoc_args,
785 arg_assoc_args_vec, arg_assoc_type, add_function,
786 arg_assoc_namespace, arg_assoc_class_only, arg_assoc_bases,
787 arg_assoc_class, arg_assoc_template_arg, arg_assoc,
788 lookup_arg_dependent_1): Delete.
789 (name_lookup): New lookup object.
790 (name_lookup::preserve_state, name_lookup::restore_state,
791 name_lookup::mark_seen, name_lookup::find_and_mark,
792 name_lookup::add_fns, name_lookup::adl_namespace_only,
793 name_lookup::adl_namespace, name_lookup::adl_class_only,
794 name_lookup::adl_bases, name_lookup::adl_class,
795 name_lookup::adl_expr, name_lookup::adl_type,
796 name_lookup::adl_template_arg, name_lookup::search_adl): New.
797 (lookup_arg_dependent): Return a plain tree. Adjust.
798 (is_associated_namespace): Move later.
800 2017-05-24 Nathan Sidwell <nathan@acm.org>
802 * friend.c (do_friend): Remove check for existing decl.
803 * name-lookup.h (lookup_name_innermost_nonclass_level): Delete.
804 * name-lookup.c (push_local_binding): Directly look for binding.
805 (lookup_name_innermost_nonclass_level_1): Delete.
806 (lookup_name_innermost_nonclass_level): Delete.
808 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Alphabetize.
810 * cp-tree.h (cp_free_lang_data): Add extern.
811 (ovl_skip_hidden, is_overloaded_fn, really_overloaded_fn): Add
813 (type_unknown_p): Return bool, make inline, lose TREE_LIST check.
814 * typeck.c (type_unknown_p): Delete.
815 * tree.c (is_overloaded_fn): Use MAYBE_BASELINE_FUNCTIONS, adjust
817 (dependent_name): Likewise.
818 (decl_anon_ns_mem_p): Simplify.
820 2017-05-24 Jonathan Wakely <jwakely@redhat.com>
823 * tree.c (reshape_init): Use unqualified type for direct enum init.
824 * typeck.c (maybe_warn_about_cast_ignoring_quals): New.
825 (build_static_cast_1, build_reinterpret_cast_1): Strip cv-quals from
826 non-class destination types.
827 (build_const_cast_1): Strip cv-quals from destination types.
828 (build_static_cast, build_reinterpret_cast, build_const_cast)
829 (cp_build_c_cast): Add calls to maybe_warn_about_cast_ignoring_quals.
831 2017-05-24 Martin Sebor <msebor@redhat.com>
834 * call.c (fully_fold_internal): Adjust.
836 2017-05-24 Nathan Sidwell <nathan@acm.org>
838 * cp-tree.h (ovl_skip_hidden): Declare.
839 * tree.c (ovl_skip_hidden): New.
840 * name-lookup.c (arg_assoc_namespace): Call ovl_skip_hidden.
841 (lookup_arg_dependent_1): Likewise.
842 (ambiguous_decl): Use DECL_HIDDEN_P, ovl_skip_hidden.
843 (hidden_name_p, remove_hidden_names): Delete.
844 (lookup_name_real_1): Do not strip hidden names.
845 * name-lookup.h (hidden_name_p, remove_hidden_names): Delete.
847 * cp-tree.h (OVL_HIDDEN_P): New.
848 (ovl_iterator::hidden_p, ovl_iterator::reveal_node): New.
849 (ovl_iterator::reveal_node): Declare.
850 * tree.c (ovl_copy): Copy OVL_HIDDEN_P.
851 (ovl_insert): Order on hiddenness.
852 (ovl_iterator::reveal_node): New.
853 * name-lookup.c (anticipated_builtin_p): New.
854 (supplement_binding_1): Use it.
855 (set_local_extern_decl_linkage): Use hidden_p.
856 (do_pushdecl): Deal with unhiding a hidden decl, use
857 anticipated_builtin_p.
858 (do_nonmember_using_decl): Use anticipated_decl_p.
859 (lookup_name_real_1): Use DECL_HIDDEN_P.
861 2017-05-23 Jason Merrill <jason@redhat.com>
863 -Wunused and C++17 structured bindings
864 * decl.c (poplevel): Don't warn about unused structured bindings,
866 * error.c (dump_simple_decl): Handle structured bindings.
867 * expr.c (mark_exp_read): Look through DECL_VALUE_EXPR.
869 2017-05-23 Nathan Sidwell <nathan@acm.org>
871 * cp-tree.h (PUSH_GLOBAL, PUSH_LOCAL, PUSH_USING): Delete.
872 * name-lookup.c (create_local_binding): New.
873 (update_binding): New.
874 (pushdecl_maybe_friend_1): Rename to ...
875 (do_pushdecl): ... this. Reimplement.
877 (push_overloaded_decl_1, push_overloaded_decl): Delete.
879 2017-05-23 Jason Merrill <jason@redhat.com>
881 PR c++/80396 - built-in for make_integer_sequence.
882 * pt.c (builtin_pack_fn_p, builtin_pack_call_p)
883 (expand_integer_pack, expand_builtin_pack_call): New.
884 (find_parameter_packs_r): Check builtin_pack_call_p.
885 (check_for_bare_parameter_packs): Handle it.
886 (tsubst_pack_expansion): Call expand_builtin_pack_call.
887 (declare_integer_pack): New.
888 (init_template_processing): Call it.
889 * decl2.c (mark_used): Check builtin_pack_fn_p.
891 2017-05-23 Nathan Sidwell <nathan@acm.org>
893 * name-lookup.c (find_namespace_binding): New.
894 (pushdecl_maybe_friend_1): Use CP_DECL_CONTEXT.
895 (set_identifier_type_value_with_scope): Use find_namespace_binding.
896 (find_binding, cp_binding_level_find_binding_for_name,
897 binding_for_name, namespace_binding_1): Delete.
898 (push_overloaded_decl_1): Use CP_DECL_CONTEXT.
899 (get_namespace_binding, set_namespace_binding,
900 finish_namespace_using_decl, unqualified_namespace_lookup_1,
901 qualified_lookup_using_namespace, lookup_type_scope_1,
902 lookup_name_innermost_nonclass_level_1): Use find_namespace_binding.
905 * parser.c (cp_parser_template_id): Keep the lookup when stashing
908 * cp-tree.h (DECL_HIDDEN_P): New.
909 * name-lookup.c (set_decl_context,
910 set_local_extern_decl_linkage): New, broken out of ...
911 (pushdecl_maybe_friend_1): ... here. Call them.
913 2017-05-23 Thomas Schwinge <thomas@codesourcery.com>
915 * parser.c (OACC_KERNELS_CLAUSE_MASK): Add
916 "PRAGMA_OACC_CLAUSE_NUM_GANGS", "PRAGMA_OACC_CLAUSE_NUM_WORKERS",
919 2017-05-23 Nathan Sidwell <nathan@acm.org>
921 * cp-tree.h (OVL_P): New.
922 * name-lookup.h (push_local_binding): Delete.
923 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
924 (finish_namespace_using_decl, finish_local_using_decl): ... here
925 * name-lookup.c (add_decl_to_level): Swap args.
926 (pop_bindings_and_leave_scope): Look inside TREE_LIST.
927 (diagnose_name_conflict): Check contexts are same for redecl.
928 (update_local_overload): New.
929 (compparms_for_decl_and_using): Rename to ...
930 (matching_fn_p): ... here.
931 (pushdecl_maybe_friend_1): Adjust add_decl_to_level,
932 push_local_bindings call.
933 (push_local_binding): Make static, replace FLAGS arg with
935 (validate_nonmember_using_decl): Use OVL_FIRST.
936 (do_nonmember_using_decl): Use in/out parameters. Use
937 lkp_iterator and simplify.
938 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
939 (finish_namespace_using_decl, finish_local_using_decl): ... here.
941 (lookup_type_current_level): Delete.
942 * parser.c (cp_parser_using_declaration): Adjust.
943 * pt.c (tsubst_expr): Adjust.
945 2017-05-22 Nathan Sidwell <nathan@acm.org>
947 * name-lookup.h (parse_using_directive): Replace with ...
948 (finish_namespace_using_directive): ... this and ...
949 (finish_local_using_directive): ... this.
950 * name-lookup.c (add_using_namespace_1): Move later.
951 (add_using_namespace): Move later, add namespace_p arg, remove
953 (push_using_directive_1): Directly recurse.
954 (do_using_directive, parse_using_directive): Delete, split into ...
955 (finish_namespace_using_directive): ... this and ...
956 (finish_local_using_directive): ... this.
957 (push_namespace): Use add_using_namespace.
958 * parser.c (cp_parser_using_directive): Call
959 finish_namespace_using_directive or finish_local_using_directive.
960 * pt.c (tsubst_expr): Call finish_local_using_directive.
962 * cp-objcp-common.c (cp_register_dumps): Register raw dumper.
963 * cp-tree.h (raw_dump_id): Declare.
964 * decl2.c (raw_dump_id): Define.
965 (dump_tu): Use raw_dump_id.
967 * config-lang.in (gtfiles): Sort list, break lines.
969 * cp-tree.h (CPTI_TERMINATE, CPTI_CALL_UNEXPECTED): Rename to ...
970 (CPTI_TERMINATE_FN, CPTI_CALL_UNEXPECTED_FN): ... here.
971 ( CPTI_GET_EXCEPTION_PTR_FN, CPTI_BEGIN_CATCH_FN, CPTI_END_CATCH_FN,
972 CPTI_ALLOCATE_EXCEPTION_FN, CPTI_FREE_EXCEPTION_FN, CPTI_THROW_FN,
973 CPTI_RETHROW_FN): New.
974 (noexcept_deferred_spec): New.
975 (terminate_node, call_unexpected_node): Rename to ...
976 (terminate_fn, call_unexpected_fn): ... here.
977 (get_exception_ptr_fn, begin_catch_fn, end_catch_fn,
978 allocate_exception_fn, free_exception_fn, throw_fn, rethrow_fn): New.
979 * except.c (fn1..fn5, throw_fn, rethrow_rn, spec): Delete.
980 (init_exception_processing): Adjust.
981 (declare_library_fn): Create and push the fns here.
982 (do_get_exception_ptr, do_begin_catch, do_end_catch,
983 do_allocate_exception_ptr, do_free_exception_ptr): Adjust
984 declare_library_fn use.
985 (unevaluated_noexcept_spec): Adjust.
986 * cp-gimplify.c (genericize_eh_spec_block,
987 gimplify_most_not_throw_expr): Adjust.
989 * name-lookup.c (pushdecl_top_level,
990 pushdecl_top_level_and_finish): Move after namespace pushing and
992 (push_to_top_level): Rename to ...
993 (do_push_to_top_level): ... here. Remove timing code.
994 (pop_from_top_level_1): Rename to ...
995 (do_pop_from_top_level): ... here.
996 (do_push_nested_namespace, do_pop_nested_namespace)
997 (push_to_top_level): New wrapper for do_push_to_top_level.
998 (pop_from_top_level): Adjust.
999 (push_nested_namepace, pop_nested_namespace): Wrappers for workers.
1001 2017-05-19 Bernd Edlinger <bernd.edlinger@hotmail.de>
1003 * config-lang.in (gtfiles): Add c-family/c-format.c,
1004 except.c, init.c, lambda.c and friend.c.
1005 * class.c (dvirt_fn): Move out of function scope,
1007 * except.c (fn1-5, throw_fn, rethrow_fn, spec): Likewise.
1008 * init.c (fn): Likewise.
1009 * lambda.c (ptr_id, max_id): Likewise.
1010 * friend.c (global_friend): Add GTY attribute.
1012 2017-05-19 Nathan Sidwell <nathan@acm.org>
1014 * call.c (add_list_candidates): Use OVL_FIRST.
1015 (build_new_method_call_1): Likewise.
1016 * cp-tree.h (OVL_SINGLE_P): New.
1017 (TYPE_HIDDEN_P): New.
1018 * decl.c (xref_tag_1): Use TYPE_HIDDEN_P.
1019 * dump.c (cp_tump_tree): Adjust overload dumping.
1020 * error.c (dump_decl): Use OVL_SINGLE_P, simplify context
1022 * method.c (lazily_declare_fn): Assert we added it.
1023 * parser.c (cp_parser_nested_name_specifier): Use OVL_SINGLE_P,
1025 (cp_parser_template_name): Use lkp_iterator.
1026 * pt.c (begin_template_parm_list): Fixup comment.
1027 (instantiate_class_template_1): Use TYPE_HIDDEN_P.
1028 * tree.c (ovl_iterator::remove_node): Cope with inherited ctors.
1029 (ovl_scope): Use lkp_iterator.
1031 2017-05-19 Thomas Schwinge <thomas@codesourcery.com>
1033 * parser.c (cp_parser_omp_clause_default): Handle
1034 "OMP_CLAUSE_DEFAULT_PRESENT".
1036 * parser.c (cp_parser_omp_clause_default): Avoid printing more
1037 than one syntax error message.
1039 2017-05-19 Nathan Sidwell <nathan@acm.org>
1041 * class.c (class_dump_id): Define.
1042 (dump_class_hierarchy, dump_vtable, dump_vtt): Use it.
1043 * cp-objcp-common.c (cp_register_dumps): New.
1044 * cp-objcp-common.h (cp_register_dumps): Declare.
1045 (LANG_HOOKS_REGISTER_DUMPS): Override.
1046 * cp-tree.h (class_dump_id): Declare.
1048 2017-05-18 Nathan Sidwell <nathan@acm.org>
1050 * cp-tree.h (OVL_ARG_DEPENDENT): Delete.
1052 (lookup_keep): Declare.
1053 * name-lookup.c (add_function): Don't set OVL_ARG_DEPENDENT.
1054 * pt.c (tsubst_copy): Assert lookup is persistent.
1055 * semantics.c (finish_call_expr): Use lkp_iterator, call
1057 * tree.c (ovl_copy): New.
1058 (ovl_insert, ovl_iterator::remove_node): Copy immutable nodes.
1061 * cp-tree.h (OVL_USED): Replace with ...
1062 (OVL_USING_P): ... this.
1063 (ovl_iterator::using_p): Adjust.
1064 * name-lookup.c (push_overloaded_decl_1,
1065 do_nonmember_using_decl): Adjust.
1066 * search.c (lookup_field_r): Adjust.
1067 * tree.c (ovl_insert, ovl_scope): Adjust.
1069 * cp-tree.h (lookup_add): Swap args.
1070 (ovl_cons, build_overload): Delete.
1071 * name-lookup.c (add_function, push_overloaded_decl_1,
1072 do_nonmember_using_decl, merge_functions, remove_hidden_names):
1073 Use lookup_add, ovl_insert.
1074 * pt.c (check_explicit_specialization): Use lookup_add.
1075 (do_class_deduction): Likewise. Refactor if.
1076 * tree.c (lookup_add): Swap args.
1077 (ovl_cons, build_overload): Delete.
1079 * name-lookup.c (find_local_binding): New, broken out of ...
1080 (lookup_name_innermost_nonclass_level_1): ... here. Call it.
1081 (set_namespace_binding): Swap scope & name args.
1082 (namespace_binding_1): Likewise.
1083 (pushdecl_maybe_friend_1): Adjust set_namespace_binding call.
1084 (push_overloaded_decl_1): Likewise.
1085 (set_global_binding): Likewise.
1086 (get_namespace_binding): Adjust namespace_binding_1 call.
1088 2017-05-17 Nathan Sidwell <nathan@acm.org>
1090 * cp-tree.h (default_hash_traits <lang_identifier *>): New
1092 * name-lookup.c (lookup_extern_c_fun_in_all_ns): Delete.
1093 (extern_c_fns): New hash table.
1094 (check_extern_c_conflict): New, broken out of ...
1095 (pushdecl_maybe_friend_1): ... here. Call it.
1096 (c_linkage_bindings): Just look in hash table.
1098 2017-05-17 Ville Voutilainen <ville.voutilainen@gmail.com>
1102 Implement new C++ intrinsics __is_assignable and __is_constructible.
1103 * cp-tree.h (CPTK_IS_ASSIGNABLE, CPTK_IS_CONSTRUCTIBLE): New.
1105 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
1106 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
1107 * method.c (constructible_expr): Set cp_unevaluated.
1108 (is_xible_helper): New.
1109 (is_trivially_xible): Adjust.
1111 * parser.c (cp_parser_primary_expression): Handle
1112 RID_IS_ASSIGNABLE and RID_IS_CONSTRUCTIBLE.
1113 (cp_parser_trait_expr): Likewise.
1114 * semantics.c (trait_expr_value): Handle
1115 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
1117 2017-05-17 Nathan Sidwell <nathan@acm.org>
1119 * cp-tree.h (ovl_iterator::using_p): New predicate.
1120 (ovl_iterator::remove_node): New worker.
1121 (ovl_insert): Declare.
1122 * tree.c (ovl_insert): New.
1123 (ovl_iterator::remove_node): New.
1124 * class.c (add_method): Use ovl_iterator, ovl_insert.
1125 (clone_function_decl): Fix description.
1126 (clone_constructors_and_destructors): Use ovl_iterator.
1128 * class.c (handle_using_decl): Use OVL_FIRST, ovl_iterator.
1129 (maybe_warn_about_overly_private_class): Use ovl_iterator.
1130 (method_name_cmp, resort_method_name_cmp): Use OVL_NAME.
1131 (resort_type_method_vec, finish_struct_methods): Use OVL_FIRST.
1132 (get_base_fndecls): Use ovl_iterator.
1133 (warn_hidden): Use OVL_NAME, ovl_iterator.
1134 (add_implicitly_declared_members): Use ovl_iterator.
1135 * constraint.cc (normalize_template_id_expression): Use OVL_FIRST,
1137 (finish_shorthand_constraint): Simplify, use ovl_make.
1138 * pt.c (make_constrained_auto): Simplify. Use ovl_make.
1139 * search.c (shared_member_p): Use ovl_iterator.
1140 (lookup_field_fuzzy_info::fuzzy_lookup_fn): Use OVL_NAME.
1141 (lookup_conversion_operator): Use OVL_FIRST.
1142 (lookup_fnfiels_idx_nolazy): Use OVL_FIRST, OVL_NAME.
1143 (look_for_overrides_here): Use ovl_iterator.
1144 (lookup_conversions_r): Use OVL_FIRST, OVL_NAME, ovl_iterator.
1145 * typeck.c (build_x_unary_op): Use ovl_make.
1147 2017-05-17 Martin Liska <mliska@suse.cz>
1149 * class.c (dump_class_hierarchy): Introduce dump_flags_t type and
1150 use it instead of int type.
1151 (dump_vtable): Likewise.
1152 (dump_vtt): Likewise.
1153 * decl2.c (dump_tu): Likewise.
1155 2017-05-16 David Malcolm <dmalcolm@redhat.com>
1157 * call.c (enforce_access): Add access_failure_info * param and use
1158 it to record access failures.
1159 * cp-tree.h (class access_failure_info): New class.
1160 (enforce_access): Add access_failure_info * param, defaulting to
1162 (lookup_member): Likewise.
1163 (locate_field_accessor): New function decl.
1164 (perform_or_defer_access_check): Add access_failure_info * param,
1166 * search.c (lookup_member): Add access_failure_info * param and
1167 pass it on to call to perform_or_defer_access_check.
1168 (matches_code_and_type_p): New function.
1169 (field_access_p): New function.
1170 (direct_accessor_p): New function.
1171 (reference_accessor_p): New function.
1172 (field_accessor_p): New function.
1173 (struct locate_field_data): New struct.
1174 (dfs_locate_field_accessor_pre): New function.
1175 (locate_field_accessor): New function.
1176 * semantics.c (perform_or_defer_access_check): Add
1177 access_failure_info * param, and pass it on to call to
1179 * typeck.c (access_failure_info::record_access_failure): New method.
1180 (access_failure_info::maybe_suggest_accessor): New method.
1181 (finish_class_member_access_expr): Pass an access_failure_info
1182 instance to the lookup_member call, and call its
1183 maybe_suggest_accessor method afterwards.
1185 2017-05-16 Marek Polacek <polacek@redhat.com>
1189 * cp-gimplify.c (cp_fold): Handle SAVE_EXPR.
1191 2017-05-16 Nathan Sidwell <nathan@acm.org>
1193 * name-lookup.c (check_local_shadow): New, broke out of ...
1194 (pushdecl_maybe_friend_1): ... here. Call it.
1196 * cp-tree.h (OVL_NESTED_P, OVL_LOOKUP_P): New.
1197 (ovl_first): Move inline definition to end of file.
1198 (ovl_make, lookup_add): Declare.
1199 (get_fns, get_first_fn): Make pure.
1200 * tree.c (ovl_cache): New.
1201 (ovl_make, lookup_add): New.
1202 * pt.c (do_class_deduction): Don't add candidates that will be
1205 * call.c (build_user_type_conversion_1): Use OVL_FIRST.
1206 (print_error_for_call_failure): Use OVL_NAME.
1207 (build_op_call_1): Use ovl_iterator.
1208 (add_candidates): Use OVL_FIRST & lkp_iterator.
1209 (build_op_delete_call): Use MAYBE_BASELINK_FUNCTIONS &
1211 * class.c (deduce_noexcept_on_destructors): Use ovl_iterator.
1212 (type_has_user_nondefault_constructor,
1213 in_class_defaulted_default_constructor,
1214 type_has_user_provided_constructor,
1215 type_has_user_provided_or_explicit_constructor,
1216 type_has_non_user_provided_default_constructor,
1217 vbase_has_user_provided_move_assign,
1218 type_has_move_constructor, type_has_move_assign,
1219 type_has_user_declared_move_constructor,
1220 type_has_user_declared_move_assign,
1221 type_build_ctor_call, type_build_dtor_call,
1222 type_requires_array_cookie, explain_non_literal_class): Likewise.
1223 (finish_struct): Use lkp_iterator.
1224 (resolve_address_of_overloaded_function): Use OVL_NAME, lkp_iterator.
1225 (note_name_declared_in_class): Use OVL_NAME.
1226 * cxx-pretty-print.c (pp_cxx_unqualified_id): Use OVL_FIRST.
1227 (pp_cxx_qualified_id, cxx_pretty_printer::id_expression,
1228 cxx_pretty_printer::expression): Likewise.
1229 * decl2.c (check_classfn): Use ovl_iterator.
1230 * pt.c (retrieve_specialization): Use ovl_iterator.
1231 * tree.c (cp_tree_equal): Use lkp_iterator.
1232 (type_has_nontrivial_copy_init): Use ovl_iterator.
1234 * typeck2.c (cxx_incomplete_type_diagnostic): Revert change and
1235 check is_overloaded_fn.
1237 2017-05-16 Martin Liska <mliska@suse.cz>
1239 * parser.c (cp_lexer_print_token): Add default value for flags
1240 argument of print_gimple_stmt, print_gimple_expr,
1241 print_generic_stmt and print_generic_expr.
1243 2017-05-16 Nathan Sidwell <nathan@acm.org>
1245 * cp-tree.h (class ovl_iterator, class lkp_iterator): New OVERLOAD
1247 (MAYBE_BASELINK_FUNCTIONS): New.
1248 * constraint.cc (resolve_constraint_check): Use lkp_iterator.
1249 * decl2.c (maybe_warn_sized_delete): Use ovl_iterator.
1250 * lambda.c (maybe_generic_this_capture): Use lkp_iterator.
1251 * method.c (inherited_ctor_binfo): Use ovl_iterator.
1252 (binfo_inherited_from): Likewise.
1253 * parser.c (lookup_literal_operator): Use lkp_iterator.
1254 * pt.c (iterative_hash_template_arg): Use lkp_iterator.
1255 (print_candidates_1): Likewise.
1256 (determine_specialization): Likewise.
1257 (resolve_overloaded_unification): Likewise.
1258 (resolve_nondeduced_context): Likewise.
1259 (type_dependent_expression_p): Likewise.
1260 (dependent_template_p): Likewise.
1261 * ptree.c (cxx_print_xnode): Likewise.
1262 * semantics.c (omp_reduction_lookup): Use lkp_iterator.
1263 (classtype_has_nothrow_assign_or_copy_p): Use ovl_iterator.
1264 * typeck.c (check_template_keyword): Use lkp_iterator.
1266 * cp-tree.h (OVL_FIRST, OVL_NAME): New.
1268 * constexpr.c (function_concept_check): Use OVL_FIRST.
1269 * cvt.c (build_expr_type_conversion): Likewise.
1270 * decl.c (poplevel, grokdeclarator): Use OVL_NAME.
1271 * decl2.c (mark_used): Use OVL_FIRST.
1272 * error.c (dump_decl): Use OVL_FIRST, OVL_NAME.
1273 (dump_expr, location_of): Use OVL_FIRST.
1274 * friend.c (do_friend): Use OVL_NAME.
1275 * init.c (build_offset_ref): Use OVL_FIRST.
1276 * mangle.c (write_member_name): Likewise.
1277 (write_expression): Use OVL_NAME.
1278 * method.c (strip_inheriting_ctors): Use OVL_FIRST.
1279 * name-lookup.c (pushdecl_class_level): Use OVL_NAME.
1280 * pt.c (check_explicit_specialization): Use OVL_FIRST.
1281 (check_template_shadow): Likewise.
1282 (tsubst_template_args): Use OVL_NAME.
1283 (tsubst_baselink): Use OVL_FIRST.
1284 * semantics.c (perform_koenig_lookup): Use OVL_NAME.
1285 * tree.c (get_first_fn): Use OVL_FIRST.
1286 * typeck.c (finish_class_member_access_expr): Use OVL_NAME.
1287 (cp_build_addr_expr_1): Use OVL_FIRST.
1289 * pt.c (tsubst_copy_and_build): Remove unnecessary COMPONENT_REF
1291 * semantics.c (finish_id_expression): Directly init local var.
1292 (finish_omp_reduction_clause): Use really_overloaded_fn.
1293 * tree.c (get_fns): Document. Assert we got an overload.
1294 (get_first_fn) Document.
1295 * typeck.c (cp_build_addr_expr_1): Pass arg directly to
1296 really_overloaded_fn.
1297 * typeck2.c (cxx_incomplete_type_diagnostic): Use get_first_fn directly.
1299 * cp-tree.h (SCOPE_DEPTH): New.
1300 * name-lookup.h (is_nested_namespace): Declare.
1301 * name-lookup.c (is_nested_namespace): New.
1302 (is_ancestor): Use it.
1303 (set_decl_namespace): Likewise.
1304 (push_namespace): Set SCOPE_DEPTH.
1305 * pt.c (check_specialization_namespace): Use is_nested_namespace.
1306 (check_unqualigied_spec_or_inst): Likewise.
1308 2017-05-15 Nathan Sidwell <nathan@acm.org>
1311 * cp-tree.h (DECL_NAMESPACE_INLINE_P): New.
1312 * name-lookup.h (push_namespace): Return int, add make_inline arg.
1313 * name-lookup.c (push_namespace): Deal with inline directly.
1314 Return pushed count.
1315 * parser.c (cp_parser_namespace_definition): Adjust for
1316 push_namespace change.
1318 2017-05-11 Nathan Sidwell <nathan@acm.org>
1320 * cp-lang.c (get_global_decls, cxx_pushdecl, LANG_HOOK_GETDECLS,
1321 LANG_HOOKS_PUSHDECL): Move to ...
1322 * cp-objcp-common.c (cp_get_global_decls, cp_pushdec,
1323 LANG_HOOK_DECLS, LANG_HOOKS_PUSHDECL): ... here.
1324 * cp-objcp-common.h (cp_get_global_decls, cp_pushdecl): Declare.
1326 * name-lookup.h (pushdecl): Add default friend parm.
1327 (pushdecl_maybe_friend): Delete.
1328 (pushdecl_top_level): Add default friend parm.
1329 (pushdecl_top_level_maybe_friend): Delete.
1330 * name-lookup.c (pushdecl_maybe_friend): Delete.
1331 (pushdecl): Add is_friend parm.
1332 (pushdecl_top_level): Add is friend_parm.
1333 (pushdecl_top_level_maybe_friend, pushdecl_top_level_1): Delete.
1334 (pushdecl_top_level_and_finish): Do pushing and finishing directly.
1335 * friend.c (do_friend): Adjust.
1336 * pt.c (tsubst_friend_class): Adjust.
1338 Revert pushdecl_top_level_and_finish name change.
1339 * name-lookup.h (pushdecl_top_level_and_finish): Resurrect old name.
1340 * name-lookup.c (pushdecl_top_level_and_finish): Likewise.
1341 * decl.c (cp_make_fname_decl): Adjust.
1342 * decl2.c (get_guard, handle_tls_init): Adjust.
1343 * rtti.c (get_tinfo_decl, tinfo_base_init): Adjust.
1345 * name-lookup.c (pushdecl_outermost_localscope): Always
1346 conditionally stop timer.
1348 * decl.c (xref_tag_1): Don't frob ts_lambda scope here.
1349 * name-lookup.c (pushtag_1): Deal with ts_lambda scope.
1351 * cp-tree.h (pushdecl, pushdecl_maybe_friend, pushtag,
1352 pushtag_top_level_maybe_friend,
1353 pushdecl_top_level_and_finish): Move declarations to ...
1354 * name-lookup.h: ... here. Group pushdecl variants.
1355 (pushdecl_top_level_and_finish): Rename to ...
1356 (pushdecl_top_level_with_init): ... here.
1357 * decl.c (cp_make_fname_decl): Use pushdecl_top_level_with_init.
1358 * decl2.c (get_guard, handle_tls_init): Likewise.
1359 * rtti.c (get_tinfo_decl, tinfo_base_init): Likewise.
1360 * lambda.c (maybe_add_lambda_conv_op): Use namespace_bindings_p.
1361 * method.c (implicitly_declare_fn): Likewise.
1362 * searchc (node_debug_info_needed): Likewise.
1363 * name-lookup.c (pushdecl_top_level_and_finish): Rename to ...
1364 (pushdecl_top_level_with_init): ... here.
1365 (pop_everything): Use namespace_bindings_p.
1367 * name-lookup.h (pop_binding): Rename to pop_local_binding.
1368 (getdecls): Rename to get_local_decls.
1369 * name-lookup.c (pop_binding): Rename to ...
1370 (pop_local_binding): ... here.
1371 (pop_bindings_and_leave_scope): Adjust.
1372 (getdecls): Rename to ...
1373 (get_local_decls): ... here. Assert local scope.
1374 * decl.c (poplevel): Assert not namespace. Adjust and simplify
1376 (store_parm_decls): Adjust get_local_decls call.
1377 (parser.c (synthesize_implicit_template_parm): Likewise.
1379 2017-05-11 Ville Voutilainen <ville.voutilainen@gmail.com>
1382 * method.c (is_trivially_xible): Reject void types.
1384 2017-05-10 Nathan Sidwell <nathan@acm.org>
1386 * class.c (handle_using_decl): Always use OVL_CURRENT.
1387 (resolve_address_of_overloaded_function): Move iterator decl into
1388 for scope. Don't strip anticipated decls here.
1390 * pt.c (print_candidates_1): Separate TREE_LIST and OVERLOAD
1392 (print_candidates): Adjust.
1394 * cp-tree.h (build_new_function_call): Lose koenig_p arg. Fix
1396 * call.c (build_new_function_call): Lose koenig_p arg. Remove
1397 koenig_p handling here.
1398 * pt.c (push_template_decl_real): Unconditionally retrofit_lang_decl.
1399 (tsubst_omp_clauses): Likewise.
1400 (do_class_deduction): Adjust buld_new_function_call calls.
1401 * semantics.c (finish_call_expr): Likewise.
1403 2017-05-10 Jason Merrill <jason@redhat.com>
1405 * pt.c (unify_parameter_deduction_failure, unify_cv_qual_mismatch)
1406 (unify_type_mismatch, unify_parameter_pack_mismatch)
1407 (unify_ptrmem_cst_mismatch, unify_expression_unequal)
1408 (unify_parameter_pack_inconsistent, unify_inconsistency)
1409 (unify_vla_arg, unify_method_type_error, unify_arity)
1410 (unify_arg_conversion, unify_no_common_base)
1411 (unify_inconsistent_template_template_parameters)
1412 (unify_template_deduction_failure)
1413 (unify_template_argument_mismatch)
1414 (unify_overload_resolution_failure): Call unify_invalid.
1416 CWG 1847 - Clarifying compatibility during partial ordering
1417 * pt.c (more_specialized_fn): No order between two non-deducible
1420 * pt.c (dependent_type_p): Make sure we aren't called with
1423 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
1424 * pt.c (convert_template_argument): Just return an argument pack.
1425 (coerce_template_parameter_pack, template_parm_to_arg)
1426 (extract_fnparm_pack, make_argument_pack, tsubst_template_args)
1427 (tsubst_decl, tsubst, type_unification_real, unify_pack_expansion):
1428 Don't set the type of a NONTYPE_ARGUMENT_PACK.
1429 * parser.c (make_char_string_pack, make_string_pack): Likewise.
1431 2017-05-10 Nathan Sidwell <nathan@acm.org>
1433 * cp-tree.h (add_method, clone_function_decl): Change last arg to
1435 * class.c (add_method): Change third arg to bool. Adjust.
1436 (one_inheriting_sig, one_inherited_ctor): Adjust.
1437 (clone_function_decl): Change 2nd arg to bool. Adjust.
1438 (clone_constructors_and_destructors): Adjust.
1439 * lambda.c (maybe_add_lambda_conv_op): Adjust.
1440 * method.c (lazily_declare_fn): Adjust.
1441 * pt.c (tsubst_decl, instantiate_template_1): Adjust.
1442 * semantics.c (finish_member_declaration): Adjust.
1444 2017-05-10 Paolo Carlini <paolo.carlini@oracle.com>
1447 * decl.c (finish_function): To improve error recovery, change the
1448 logic for calling apply_deduced_return_type.
1450 2017-05-09 Jason Merrill <jason@redhat.com>
1452 PR c++/80605 - __is_standard_layout and empty base
1453 * class.c (check_bases): Ignore empty bases.
1455 PR c++/70979 - literal class and closure types
1456 * class.c (finalize_literal_type_property): Handle closures
1458 (explain_non_literal_class): Likewise.
1460 PR c++/66297, DR 1684 - literal class and constexpr member fns
1461 * constexpr.c (is_valid_constexpr_fn): Only complain about
1462 non-literal enclosing class in C++11.
1463 * class.c (finalize_literal_type_property): Likewise.
1465 2017-05-09 Paolo Carlini <paolo.carlini@oracle.com>
1468 * pt.c (tsubst_decl): Early return error_mark_node if
1469 grok_ctor_properties returns false.
1471 2017-05-09 Jason Merrill <jason@redhat.com>
1473 PR c++/70167 - array prvalue treated as lvalue
1474 * cp-tree.h (CONSTRUCTOR_C99_COMPOUND_LITERAL): New.
1476 * semantics.c (finish_compound_literal): Add fcl_context parameter.
1477 Only make a static variable for C99 syntax.
1478 * parser.c (cp_parser_postfix_expression): Pass it.
1479 * pt.c (tsubst_copy_and_build): Likewise.
1480 * call.c (extend_ref_init_temps): Set
1481 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
1483 2017-05-09 Nathan Sidwell <nathan@acm.org>
1485 * cp-lang.c (get_global_decls, cxx_pushdecl): New.
1486 (LANG_HOOKS_GETDECLS, LANG_HOOKS_PUSHDECL): Override.
1487 * name-lookup.h (pushdecl_top_level): Declare.
1489 2017-05-08 Jason Merrill <jason@redhat.com>
1491 PR c++/80178 - parameter passing for uncopyable classes
1492 * tree.c (type_has_nontrivial_copy_init): True for classes with only
1493 deleted copy/move ctors.
1494 (remember_deleted_copy, maybe_warn_parm_abi): New.
1495 * decl.c (require_complete_types_for_parms, check_function_type):
1496 Call maybe_warn_parm_abi.
1497 * call.c (convert_for_arg_passing, build_cxx_call): Likewise.
1499 2017-05-08 Nathan Sidwell <nathan@acm.org>
1501 * decl.c (builtin_function_1): Set DECL_ANTICIPATED before pushing.
1502 (start_preparsed_function): Do decl pushing before setting
1503 current_funciton_decl and announcing it.
1505 * name-lookup.h (pushdecl_with_scope): Replace with ...
1506 (pushdecl_outermost_localscope): ... this.
1507 * name-lookup.c (pushdecl_with_scope): Replace with ...
1508 (pushdecl_outermost_localscope): ... this.
1509 (pushdecl_namespace_level): Adjust.
1510 * decl.c (cp_make_fname_decl): Use pushdecl_outermost_localscope.
1511 * lambda.c (insert_capture_proxy): Likewise.
1513 * class.c (build_vtbl_initializer): Don't shadow outer variable
1516 Revert _binding -> _value change.
1517 * name-lookup.h (get_namespace_value, set_global_value): Rename to ...
1518 (get_namespace_binding, set_global_binding): ... these.
1519 * name-lookup.c (get_namespace_value, set_global_value): Rename to ...
1520 (get_namespace_binding, set_global_binding): ... these.
1521 (arg_assoc_namespace, pushdecl_maybe_friend_1,
1522 check_for_out_of_scope_variable, push_overloaded_decl_1,
1523 lookup_name_innermost_nonclass_level, push_namespace): Adjust.
1524 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
1525 SET_IDENTIFIER_GLOBAL_VALUE): Adjust.
1526 * decl.c (poplevel): Adjust.
1527 * pt.c (make_constrained_auto): Likewise.
1529 2017-05-07 Volker Reichelt <v.reichelt@netcologne.de>
1531 PR translation/80280
1532 * call.c (print_z_candidate): Fix quoting.
1534 2017-05-05 David Malcolm <dmalcolm@redhat.com>
1536 * error.c (pedwarn_cxx98): Replace report_diagnostic
1537 with diagnostic_report_diagnostic.
1539 2017-05-05 Nathan Sidwell <nathan@acm.org>
1541 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value.
1542 (SET_IDENTIFIER_GLOBAL_VALUE): Use set_global_value.
1543 (IDENTIFIER_NAMESPACE_VALUE): Delete.
1544 * name-lookup.h (namespace_binding, set_namespace_binding): Replace
1546 (get_namespace_value, set_global_value): ... these.
1547 (get_global_value_if_present, is_typename_at_global_scope): Delete.
1548 * decl.c (poplevel): Use get_namespace_value.
1549 (grokdeclarator): Use IDENTIFIER_GLOBAL_VALUE.
1550 * class.c (build_vtbl_initializer): Stash library decl in
1551 static var. Use IDENTIFIER_GLOBAL_VALUE.
1552 * except.c (do_get_exception_ptr, do_begin_catch, do_end_catch,
1553 do_allocate_exception, do_free_exception, build_throw): Likewise.
1554 * init.c (throw_bad_array_new_length): Likewise.
1555 * rtti.c (throw_bad_cast, throw_bad_typeid): Likewise.
1556 * name-lookup.c (arg_assoc_namespace, pushdecl_maybe_friend_1,
1557 check_for_our_of_scope_variable, push_overloaded_decl_1): Use
1558 get_namespace_value.
1559 (set_namespace_binding_1): Rename to
1560 (set_namespace_binding): ... here.
1561 (set_global_value): New.
1562 (lookup_name_innermost_nonclass_level_1, push_namespace): Use
1563 get_namespace_value.
1564 * pt.c (listify): Use get_namespace_value.
1566 * call.c (make_temporary_var_for_ref_to_temp): Push decl into
1568 * lex.c (unqualified_name_lookup_error): Likewise.
1570 * class.c (alter_class): Use retrofit_lang_decl directly.
1571 * decl.c (push_local_name, dupliate_decls): Likewise.
1572 * semantics.c (omp_privatize_field): Likewise.
1574 Kill walk_namespaces.
1575 * cp-tree.h (walk_namespaces_fn, walk_namespaces): Delete.
1576 * decl.c (walk_namespaces_r, walk_namespaces): Delete.
1578 Kill per-namespace static_decls.
1579 * cp-tree.h (static_decls): Declare.
1580 (wrapup_globals_for_namespace,
1581 diagnose_inline_vars_for_namespace): Replace with ...
1582 (wrapup_namespace_globals): ... this.
1583 * decl.c (static_decls): Define.
1584 (wrapup_globals_for_namespace,
1585 diagnose_inline_vars_for_namespace): Replace with ...
1586 (wrapup_namespace_globals): ... this.
1587 (cxx_init_decl_processing): Initialize static_decls.
1588 * decl2.c (c_parse_final_cleanups): Adjust.
1589 * name-lookup.h (cp_binding_level): Remove static_decls member.
1590 * name-lookup.c (add_decl_to_level): Adjust.
1591 (begin_scope): Adjust.
1593 2017-05-05 Paolo Carlini <paolo.carlini@oracle.com>
1596 * decl.c (reshape_init): Unconditionally return error_mark_node
1597 upon error about too many initializers.
1599 2017-05-04 Nathan Sidwell <nathan@acm.org>
1601 * constraint.cc (diagnose_check_constraint): Fix %E thinko.
1603 2017-05-04 Martin Sebor <msebor@redhat.com>
1605 PR translation/80280
1606 * call.c (print_z_candidate): Add missing quoting to %D and other
1608 (build_op_call_1): Same.
1609 * constraint.cc (diagnose_check_constraint): Same.
1610 * mangle.c (mangle_decl): Same.
1611 * name-lookup.c (cp_binding_level_debug): Same.
1612 (set_decl_namespace): Same.
1613 * parser.c (cp_parser_tx_qualifier_opt): Same.
1614 * pt.c (print_candidates_1): Same.
1615 (check_template_variable): Same.
1616 (tsubst_default_argument): Same.
1617 (most_specialized_partial_spec): Same.
1618 * semantics.c (omp_reduction_lookup): Same.
1619 * tree.c (check_abi_tag_redeclaration): Same.
1620 * typeck.c (comptypes): Same.
1621 * typeck2.c (abstract_virtuals_error_sfinae): Same.
1623 2017-05-04 Nathan Sidwell <nathan@acm.org>
1626 * cp-tree.h (enum cp_tree_index): Add CPTI_GLOBAL,
1627 CPTI_GLOBAL_TYPE, CPTI_GLOBAL_IDENTIFIER, CPTI_ANON_IDENTIFIER,
1628 CPTI_INIT_LIST_IDENTIFIER.
1629 (global_namespace, global_type_node, global_identifier,
1630 anon_identifier, init_list_identifier): New.
1631 * decl.c (global_type_node, global_scope_name): Delete.
1632 (initialize_predefined_identifiers): Add new identifiers.
1633 (cxx_init_decl_processing): Adjust.
1634 * name-lookup.h (global_namespace, global_type_node): Delete.
1635 * name-lookup.c (global_namespace, anonymous_namespace_name,
1636 get_anonymous_namespace_name): Delete.
1637 (namespace_scope_ht_size, begin_scope, pushtag_1,
1638 push_namespace): Adjust,
1639 * call.c (type_has_extended_temps): Use init_list_identifier.
1640 * pt.c (listify): Likewise.
1642 * name-lookup.c: Reorder functions to make merging from modules
1645 2017-05-03 Jason Merrill <jason@redhat.com>
1647 * constexpr.c (cxx_eval_outermost_constant_expr): Use TV_CONSTEXPR.
1649 2017-05-03 Nathan Sidwell <nathan@acm.org>
1651 * cp-tree.h (enum cp_tree_index, cp_global_trees): Move earlier,
1652 along with #defines, to before name-lookup include.
1654 2017-05-02 Paolo Carlini <paolo.carlini@oracle.com>
1656 * pt.c (is_auto_or_concept): Remove.
1657 (type_uses_auto_or_concept): Remove, unused.
1658 (find_parameter_packs_r, extract_autos_r, is_auto_r): Adjust.
1659 * parser.c (tree_type_is_auto_or_concept): Remove, unused.
1660 * cp-tree.h (is_auto_or_concept): Remove.
1662 2017-05-01 Xi Ruoyao <ryxi@stu.xidian.edu.cn>
1665 * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Don't
1666 add pedigree operation and detach call here.
1667 * cp-gimplify.c (cp_gimplify_expr): Remove the calls to
1668 cilk_cp_gimplify_call_params_in_spawned_fn.
1669 (cilk_cp_gimplify_call_params_in_spawned_fn): Remove function.
1670 * semantics.c (simplify_aggr_init_expr): Copy EXPR_CILK_SPAWN.
1672 2017-04-29 Volker Reichelt <v.reichelt@netcologne.de>
1674 * parser.c (cp_parser_member_declaration): Add fix-it hints for
1675 stray comma and missing semicolon at end of member declaration.
1677 2017-04-27 Volker Reichelt <v.reichelt@netcologne.de>
1679 * parser.c (cp_parser_cast_expression): Add target type of cast to
1681 * error.c (type_to_string): Add '{enum}' suffix to enumeration types.
1683 2017-04-26 Paolo Carlini <paolo.carlini@oracle.com>
1685 * decl.c (grok_ctor_properties, ambi_op_p, unary_op_p): Change
1686 return type to bool.
1687 * cp-tree.h (grok_ctor_properties): Update.
1689 2017-04-26 Volker Reichelt <v.reichelt@netcologne.de>
1691 * parser.c (cp_parser_nested_name_specifier_opt): Add fix-it
1692 information to diagnostic of invalid colon in nested-name-specifier.
1694 2017-04-25 Volker Reichelt <v.reichelt@netcologne.de>
1696 * parser.c (cp_parser_elaborated_type_specifier): Add fix-it to
1697 diagnostic of invalid class/struct keyword after enum.
1699 2017-04-25 David Malcolm <dmalcolm@redhat.com>
1701 * parser.c (cp_parser_member_declaration): Add fix-it hint
1702 for removing stray semicolons.
1704 2017-04-25 David Malcolm <dmalcolm@redhat.com>
1706 * name-lookup.c (get_std_name_hint): New function.
1707 (maybe_suggest_missing_header): New function.
1708 (suggest_alternative_in_explicit_scope): Call
1709 maybe_suggest_missing_header.
1711 2017-04-25 David Malcolm <dmalcolm@redhat.com>
1714 * name-lookup.c (suggest_alternative_in_explicit_scope): Convert
1715 candidate type of bm from tree to const char *.
1716 (consider_binding_level): Likewise.
1717 (lookup_name_fuzzy): Likewise, using this to merge the best
1718 result from the preprocessor into bm, rather than immediately
1719 returning, so that better matches from reserved words can "win".
1720 Guard the rejection of keywords that don't start decl-specifiers
1721 so it only happens for FUZZY_LOOKUP_TYPENAME.
1723 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
1725 * decl.c (grokdeclarator): Use %qT instead of %<%T%> in diagnostics.
1726 (start_enum): Likewise.
1727 (build_enumerator): Likewise. Use %qE instead of plain %E.
1728 * parser.c (cp_parser_mem_initializer_list): Use %qD instead of
1729 %<%D%> in diagnostics.
1730 (cp_parser_elaborated_type_specifier): Likewise.
1731 * pt.c (make_pack_expansion): Use %qT and %qE instead of
1732 %<%T%> and %<%E%> in diagnostics.
1733 (tsubst_pack_expansion): Likewise.
1735 2017-04-24 David Malcolm <dmalcolm@redhat.com>
1738 * parser.c (cp_parser_unary_expression): Generate a location
1739 range for alignof and sizeof expressions.
1741 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
1743 * parser.c (cp_parser_cv_qualifier_seq_opt): Add fix-it info to
1745 (cp_parser_virt_specifier_seq_opt): Likewise.
1746 (set_and_check_decl_spec_loc): Likewise twice.
1748 2017-04-21 Jason Merrill <jason@redhat.com>
1750 PR c++/80179 - ICE with initialized flexible array member.
1751 * constexpr.c (verify_ctor_sanity): Handle flexible array members.
1753 2017-04-21 Richard Biener <rguenther@suse.de>
1755 * cp-tree.h (copy_decl): Annotate with CXX_MEM_STAT_INFO.
1756 (copy_type): Likewise.
1757 * lex.c (copy_decl): Pass down mem-stat info.
1758 (copy_type): Likewise.
1760 2017-04-20 Jonathan Wakely <jwakely@redhat.com>
1763 * init.c (build_new_1): Suppress notes about over-aligned new when
1764 the warning is suppressed.
1766 2017-04-20 Volker Reichelt <v.reichelt@netcologne.de>
1768 * parser.c (cp_parser_member_declaration): Add warning with fixit
1769 information for extra semicolon after in-class function definition.
1771 2017-04-20 Jakub Jelinek <jakub@redhat.com>
1774 * tree.c (build_cplus_array_type): Call build_array_type
1775 with the intended TYPE_TYPELESS_STORAGE flag value, instead
1776 of calling build_array_type and modifying later TYPE_TYPELESS_STORAGE
1779 2017-04-18 Marek Polacek <polacek@redhat.com>
1781 PR c++/80244 - ICE with attribute in template alias.
1782 * tree.c (strip_typedefs): Handle UNDERLYING_TYPE.
1784 PR c++/80241 - ICE with alignas pack expansion.
1785 * error.c (dump_expr): Handle TREE_LIST.
1786 * parser.c (cp_parser_std_attribute_list): Return error_mark if
1787 make_pack_expansion returns an error.
1789 2017-04-17 Bernd Edlinger <bernd.edlinger@hotmail.de>
1792 * class.c (fixup_may_alias): Fix all type variants.
1794 2017-04-17 Jason Merrill <jason@redhat.com>
1796 PR c++/80415 - wrong error with default arg and array reference.
1797 * tree.c (lvalue_kind): Return clk_class for an array prvalue.
1799 * pt.c (tsubst_init): Set TARGET_EXPR_DIRECT_INIT_P.
1801 2017-04-15 Alexandre Oliva <aoliva@redhat.com>
1803 * decl.c (name_unnamed_type): Split out of...
1804 (grokdeclarator): ... this.
1805 * decl.h (name_unnamed_type): Declare.
1807 2017-04-12 Richard Biener <rguenther@suse.de>
1808 Bernd Edlinger <bernd.edlinger@hotmail.de>
1811 * tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
1812 for arrays of character or std::byte type.
1814 2017-04-11 Jason Merrill <jason@redhat.com>
1816 PR c++/80294 - ICE with constexpr and inheritance.
1817 * constexpr.c (reduced_constant_expression_p):
1818 A null constructor element is non-constant.
1819 (cxx_eval_indirect_ref): Don't VERIFY_CONSTANT before
1820 returning an empty base.
1822 2017-04-11 Jakub Jelinek <jakub@redhat.com>
1825 * decl.c (cp_finish_decomp): If processing_template_decl on
1826 non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't
1827 change their DECL_VALUE_EXPR nor cp_finish_decl them. Instead make
1828 sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst
1830 * pt.c (value_dependent_expression_p) <case VAR_DECL>: For variables
1831 with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
1834 2017-04-11 Jakub Jelinek <jakub@redhat.com>
1837 * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.
1839 2017-04-10 Jakub Jelinek <jakub@redhat.com>
1842 * tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
1843 operand, if it is a static member function, recurse on the
1846 2017-04-10 Marek Polacek <polacek@redhat.com>
1849 * typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL. Set
1850 ORIG_TYPE earlier and not only when shortening.
1852 2017-04-07 Jason Merrill <jason@redhat.com>
1854 PR c++/80356 - ICE with reference to function template argument.
1856 * pt.c (convert_nontype_argument_function): Adjust type even with a
1857 value-dependent argument.
1859 PR c++/80267 - ICE with nested capture of reference
1861 * pt.c (tsubst_copy): Handle lookup finding a capture proxy.
1863 2017-04-07 Marek Polacek <polacek@redhat.com>
1866 * typeck.c (cp_build_binary_op): Convert COP[01] to ORIG_TYPE.
1869 * call.c (build_over_call): Don't check cxx_dialect.
1870 * cp-gimplify.c (cp_gimplify_init_expr): Don't check cxx_dialect nor
1871 whether SUB is a CONSTRUCTOR.
1872 * init.c (build_new_1): Don't check cxx_dialect.
1873 * tree.c (replace_placeholders): Add a function comment. Return if
1874 not in C++14, or if the object isn't a (member of a) class.
1875 * typeck2.c (store_init_value): Don't check cxx_dialect nor whether
1876 TYPE is CLASS_TYPE_P.
1878 2017-04-05 Jakub Jelinek <jakub@redhat.com>
1881 * pt.c (canonical_type_parameter): Use vec_safe_grow_cleared instead
1882 of a loop doing vec_safe_push of NULL. Formatting fixes.
1883 (rewrite_template_parm): Copy TEMPLATE_PARM_PARAMETER_PACK from oldidx
1884 to newidx before calling canonical_type_parameter on newtype.
1886 2017-04-04 Volker Reichelt <v.reichelt@netcologne.de>
1889 * cxx-pretty-print.c (cxx_pretty_printer::expression): Add
1890 UNARY_PLUS_EXPR case.
1892 2017-04-03 Jason Merrill <jason@redhat.com>
1894 * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
1896 2017-04-03 Jonathan Wakely <jwakely@redhat.com>
1898 * class.c (update_vtable_entry_for_fn): Fix typo in comment.
1899 * decl2.c (one_static_initialization_or_destruction): Likewise.
1900 * name-lookup.c (store_bindings): Likewise.
1901 * parser.c (make_call_declarator): Likewise.
1902 * pt.c (check_explicit_specialization): Likewise.
1904 2017-04-03 Jason Merrill <jason@redhat.com>
1906 PR sanitizer/79993 - ICE with VLA initialization from string
1907 PR c++/69487 - wrong VLA initialization from string
1908 * init.c (finish_length_check): Split out from build_vec_init.
1909 (build_vec_init): Handle STRING_CST.
1910 * typeck2.c (split_nonconstant_init): Handle STRING_CST.
1911 (digest_init_r): Don't give a STRING_CST VLA type.
1913 2017-03-31 Jakub Jelinek <jakub@redhat.com>
1916 * cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
1917 REFERENCE_TYPE. Adjust ubsan_maybe_instrument_reference caller
1918 for NOP_EXPR to REFERENCE_TYPE.
1921 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
1922 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
1924 * semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
1925 Remove extraneous parens.
1926 (finish_trait_expr): Handle CPTK_IS_AGGREGATE.
1927 * parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
1928 (cp_parser_trait_expr): Likewise.
1930 2017-03-27 Jakub Jelinek <jakub@redhat.com>
1933 * cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
1934 * typeck.c (cxx_mark_addressable): Likewise. Look through
1935 VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
1937 (cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
1939 2017-03-24 Jason Merrill <jason@redhat.com>
1941 PR c++/77339 - ICE with invalid use of alias template.
1942 * pt.c (lookup_template_class_1): Don't try to enter the scope of an
1945 2017-03-24 Marek Polacek <polacek@redhat.com>
1948 * cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
1949 doesn't have side effects.
1951 2017-03-23 Jason Merrill <jason@redhat.com>
1953 PR c++/80150 - ICE with overloaded variadic deduction.
1954 * pt.c (try_one_overload): Remove asserts.
1956 PR c++/77563 - missing ambiguous conversion error.
1957 * call.c (convert_like_real): Use LOOKUP_IMPLICIT.
1959 2017-03-23 Marek Polacek <polacek@redhat.com>
1961 * cp-tree.h: Remove a C_RID_YYCODE reference.
1963 2017-03-22 Jakub Jelinek <jakub@redhat.com>
1966 * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
1967 case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
1968 processing_template_decl.
1970 2017-03-21 Paolo Carlini <paolo.carlini@oracle.com>
1973 * name-lookup.c (pushtag_1): Add check for bogus, non template,
1974 std::initializer_list.
1976 2017-03-21 Jakub Jelinek <jakub@redhat.com>
1979 * init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.
1981 2017-03-21 Ville Voutilainen <ville.voutilainen@gmail.com>
1984 * init.c (std_placement_new_fn_p): New.
1985 (build_new_1): Call it.
1987 2017-03-20 Jason Merrill <jason@redhat.com>
1989 PR c++/80096 - ICE with C++17 non-type auto.
1990 * pt.c (tsubst): Delay tsubst of type of template non-type
1993 PR c++/79519 - ICE with deleted template friend.
1994 * decl.c (grokdeclarator): Complain about misplaced function
1995 definition using =, as well.
1997 PR c++/79640 - infinite recursion with generic lambda.
1998 * pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
1999 before substituting its initializer.
2001 2017-03-20 Marek Polacek <polacek@redhat.com>
2002 Paolo Carlini <paolo.carlini@oracle.com>
2004 PR c++/80059 - ICE with noexcept and __transaction_atomic
2005 * except.c (build_must_not_throw_expr): Call
2006 instantiate_non_dependent_expr.
2008 2017-03-19 Jason Merrill <jason@redhat.com>
2010 PR c++/80084 - wrong C++17 decomposition by reference of parameter.
2011 * decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
2012 reference decomposition.
2014 PR c++/80077 - error with constexpr and -fno-elide-constructors.
2015 * constexpr.c (cxx_eval_call_expression): Set ctx->call while
2016 expanding trivial constructor.
2018 2017-03-17 Jason Merrill <jason@redhat.com>
2020 PR c++/78345 - ICE initializing array from lambda.
2021 * init.c (build_aggr_init): Check array initializer.
2022 (build_vec_init): Check the type of a CONSTRUCTOR.
2024 PR c++/80073 - C++17 ICE with virtual base.
2025 * decl.c (xref_basetypes): Also check for indirect vbases.
2027 2017-03-16 Jason Merrill <jason@redhat.com>
2029 * decl.c (start_enum): std::byte aliases anything.
2032 * constexpr.c (lookup_placeholder): Tweak.
2034 2017-03-15 Jason Merrill <jason@redhat.com>
2036 PR c++/80043 - ICE with -fpermissive
2037 * typeck.c (convert_for_assignment): Handle instantiate_type
2038 not giving an error.
2040 2017-03-14 Nathan Sidwell <nathan@acm.org>
2042 PR c++/79393 DR 1658 workaround
2043 * method.c (synthesized_method_base_walk): Inihibit abstract class
2044 virtual base access check here.
2045 (synthesized_method_walk): Not here.
2047 2017-03-13 Nathan Sidwell <nathan@acm.org>
2049 PR c++/79393 DR 1658 workaround
2050 * method.c (synthesized_method_walk): Check vbases of abstract
2051 classes for dtor walk.
2053 2017-03-10 David Malcolm <dmalcolm@redhat.com>
2055 PR translation/79848
2056 * decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
2058 2017-03-10 Jason Merrill <jason@redhat.com>
2060 PR c++/79960 - alias templates and partial ordering
2061 * pt.c (comp_template_args): Add partial_order parm.
2062 (template_args_equal): Likewise.
2063 (comp_template_args_porder): New.
2064 (get_partial_spec_bindings): Use it.
2066 2017-03-10 Marek Polacek <polacek@redhat.com>
2069 * decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
2071 2017-03-10 Jakub Jelinek <jakub@redhat.com>
2074 * optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
2075 Use XALLOCAVEC macro.
2078 * decl.c (finish_enum_value_list): If value is error_mark_node,
2079 don't copy it and change its type.
2080 * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
2081 of CONST_DECL is error_mark_node.
2083 2017-03-09 Marek Polacek <polacek@redhat.com>
2085 PR c++/79900 - ICE in strip_typedefs
2086 * tree.c (strip_typedefs): Skip the attribute handling if T is
2087 a variant type which hasn't been updated yet.
2089 PR c++/79687 - wrong code with pointer-to-member
2090 * init.c (constant_value_1): Break if the variable has a dynamic
2093 2017-03-08 Jason Merrill <jason@redhat.com>
2095 PR c++/79797 - ICE with self-reference in array DMI.
2096 * constexpr.c (lookup_placeholder): Split out...
2097 (cxx_eval_constant_expression): ...from here.
2099 2017-03-07 Jakub Jelinek <jakub@redhat.com>
2102 * parser.c (cp_parser_omp_cancellation_point,
2103 cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
2104 cp_parser_omp_target_update): Change "may only be used in compound
2105 statements" diagnostics, such that the same translatable string is
2106 used for all pragmas.
2107 (cp_parser_pragma): Likewise. Use error_at instead of
2108 cp_parser_error for that diagnostics.
2110 2017-03-06 Marek Polacek <polacek@redhat.com>
2112 PR c++/79796 - ICE with NSDMI and this pointer
2113 * call.c (build_over_call): Handle NSDMI with a 'this' by calling
2114 replace_placeholders.
2116 2017-03-06 Jakub Jelinek <jakub@redhat.com>
2119 * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
2122 2017-03-06 Jason Merrill <jason@redhat.com>
2124 Revert "Allow deduction guides to look into primary template."
2125 * cp-tree.h, parser.c, pt.c, search.c: Revert.
2127 2017-03-05 Paolo Carlini <paolo.carlini@oracle.com>
2130 * except.c (build_must_not_throw_expr): Perform the implicit
2131 conversions on the condition.
2133 2017-03-03 Jason Merrill <jason@redhat.com>
2135 * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
2138 Core issues 2273 and 2277
2139 * call.c (joust): Adjust using-declaration tiebreaker to handle
2140 the intermediate base case.
2141 * method.c (strip_inheriting_ctors): Just return the argument if
2142 !flag_new_inheriting_ctors.
2144 2017-03-03 Richard Biener <rguenther@suse.de>
2147 * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
2149 2017-03-03 Marek Polacek <polacek@redhat.com>
2152 * typeck.c (string_conv_p): In C++11, always call pedwarn with
2155 2017-03-02 Jason Merrill <jason@redhat.com>
2157 Update overload resolution with deduction guides.
2158 * pt.c (do_class_deduction): Always build the copy guide.
2159 (copy_guide_p, template_guide_p): New.
2160 (build_deduction_guide): Remember the original constructor.
2161 * call.c (joust): Prefer the copy guide and non-template guides.
2163 Allow deduction guides to look into primary template.
2164 * cp-tree.h (struct saved_scope): Add deduction_guide_type.
2165 (struct cp_decl_specifier_seq): Add constructor_p.
2166 * parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
2167 (cp_parser_init_declarator): Check it. Set ctor_dtor_or_conv_p.
2168 Clear deduction_guide_type. Don't handle deduction guide names.
2169 (cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
2170 (cp_parser_direct_declarator): Likewise. Handle deduction guides.
2171 (cp_parser_member_declaration, cp_parser_cache_defarg)
2172 (cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
2173 * pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
2174 (build_deduction_guide): Set deduction_guide_type.
2175 (dependent_scope_p): Check deduction_guide_type.
2176 * search.c (lookup_member): Likewise.
2178 2017-03-02 Jakub Jelinek <jakub@redhat.com>
2181 * init.c (mark_exp_read_r): New function.
2182 (emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
2183 whole arguments instead of plain mark_exp_read on TREE_LIST values.
2185 2017-03-01 Jason Merrill <jason@redhat.com>
2187 Class template argument deduction in new-expression
2188 * init.c (build_new): Handle deduction from no initializer.
2189 * parser.c (cp_parser_new_expression): Don't require a single
2190 expression for class template deduction.
2191 * typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
2192 class template placeholder.
2193 * pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
2194 (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
2195 (redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
2197 2017-03-01 Jakub Jelinek <jakub@redhat.com>
2200 * init.c (emit_mem_initializers): When not constructing vbases of
2201 abstract classes, mark arguments as read for
2202 -Wunused-but-set-parameter.
2204 2017-02-28 Jason Merrill <jason@redhat.com>
2206 Class template argument deduction refinements
2207 * call.c (joust): Move deduction guide tiebreaker down.
2208 * decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
2209 deduction with no initializer.
2210 * pt.c (build_deduction_guide): Handle implicit default/copy ctor.
2211 (do_class_deduction): Use that rather than special case.
2212 (do_auto_deduction): Handle null initializer.
2214 2017-02-28 Jakub Jelinek <jakub@redhat.com>
2216 * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
2217 instead of just cond ? "..." : "...".
2218 (grokdeclarator): Likewise.
2219 (build_enumerator): Likewise.
2220 * init.c (build_new_1): Likewise.
2221 * call.c (build_new_method_call_1): Likewise.
2222 * parser.c: Include intl.h.
2223 (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
2224 "enter"/"exit" keyword.
2225 (cp_finalize_oacc_routine): Don't use %s to supply portions of the
2228 2017-02-27 Jason Merrill <jason@redhat.com>
2230 PR c++/71568 - SFINAE forming pointer to member function
2231 * init.c (build_offset_ref): Check the return value of
2232 perform_or_defer_access_check.
2234 2017-02-27 Marek Polacek <polacek@redhat.com>
2236 * decl.c (expand_static_init): Add missing } in a comment.
2238 2017-02-27 Volker Reichelt <v.reichelt@netcologne.de>
2240 * init.c: Include intl.h.
2241 (build_new_1): Move message strings into pedwarn to make them
2242 -Wformat-security friendly. Mark string for translation.
2243 * pt.c (tsubst_copy_and_build): Mark string for translation.
2244 Make the pointer const.
2245 * semantics.c (finish_id_expression): Mark strings for translation.
2247 2017-02-25 Jakub Jelinek <jakub@redhat.com>
2249 * call.c (build_op_delete_call): Make msg1 and msg2 const.
2251 2017-02-24 Jakub Jelinek <jakub@redhat.com>
2254 * call.c (build_over_call): Call check_function_arguments even for
2255 -Wrestrict, adjust check_function_arguments caller.
2256 * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
2258 * typeck.c (cp_build_function_call_vec): Adjust
2259 check_function_arguments caller.
2261 2017-02-24 Marek Polacek <polacek@redhat.com>
2263 PR translation/79705
2264 * decl.c (check_redeclaration_exception_specification): Mark a string
2265 for translation. Make the pointer const.
2267 2017-02-23 Paolo Carlini <paolo.carlini@oracle.com>
2270 * pt.c (register_specialization): Check duplicate_decls return value
2271 for error_mark_node and pass it back.
2273 2017-02-22 Jason Merrill <jason@redhat.com>
2275 PR c++/79679 - missing destructor for argument
2276 * call.c (build_over_call): Don't pass tf_no_cleanup to argument
2279 * pt.c (do_class_deduction): Handle 0 argument case.
2281 2017-02-22 Jakub Jelinek <jakub@redhat.com>
2284 * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
2285 SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
2286 * constexpr.c (potential_constant_expression_1): Handle
2287 OMP_*, OACC_* and CILK_* trees. Use error_at with
2288 EXPR_LOC_OR_LOC (t, input_location) computed early
2289 instead of error, or error_at with location_of (t).
2291 2017-02-22 Marek Polacek <polacek@redhat.com>
2294 * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
2295 if the alignas expression is erroneous.
2296 * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
2300 * semantics.c (finish_underlying_type): Bail out for incomplete enums.
2302 2017-02-21 Jason Merrill <jason@redhat.com>
2304 PR c++/50308 - wrong deprecated warning with ADL
2305 PR c++/17729 - duplicate deprecated warning
2306 * semantics.c (finish_id_expression): Only call mark_used on a
2307 function if we aren't building a call.
2309 PR c++/41727 - ICE with partial spec of partial instantiation
2310 * pt.c (process_partial_specialization): For now, don't check more
2311 specialized if there is more than one level of args.
2313 2017-02-21 Marek Polacek <polacek@redhat.com>
2316 * cp-tree.h (maybe_reject_flexarray_init): Declare.
2317 * init.c (maybe_reject_flexarray_init): No longer static.
2318 Add check for current_function_decl.
2319 * parser.c (cp_parser_late_parse_one_default_arg): Reject
2320 a default mem-initializer for a flexible array.
2322 2017-02-21 Jakub Jelinek <jakub@redhat.com>
2323 Paolo Carlini <paolo.carlini@oracle.com>
2326 * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
2328 * pt.c (tsubst_decomp_names): Return error_mark_node if the first
2329 decl after the decomposition artificial decl has error_mark_node.
2330 * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
2331 instead of just == error_mark_node comparison.
2333 2017-02-21 Jakub Jelinek <jakub@redhat.com>
2336 * decl.c: Include gimplify.h.
2337 (cp_finish_decomp): Make sure there is no sharing of trees
2338 in between DECL_VALUE_EXPR of decomposition decls.
2341 * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
2344 * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
2345 call cplus_expand_constant on it first.
2347 2017-02-19 Jason Merrill <jason@redhat.com>
2349 PR c++/78139 - destructor needed by new-expression
2350 * call.c (build_special_member_call): Use tf_no_cleanup.
2352 PR c++/78282 - auto template and pack expansion
2353 * pt.c (find_parameter_packs_r): Don't walk into the type of
2354 templates other than template template-parameters.
2356 PR c++/79606 - ICE with this->base_member in NSDMI
2357 * class.c (build_base_path): Check processing_template_decl.
2359 PR c++/79607 - ICE with T{} initializer
2360 * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
2362 PR c++/79566 - elaborated-type-specifier in range for
2363 * parser.c (cp_parser_simple_declaration): Fix check for type
2366 PR c++/79400 - confusing suggestion of 'noexcept'
2367 * parser.c (cp_parser_exception_specification_opt): Remove
2368 suggestion for deprecated dynamic exception-specification.
2370 PR c++/79470 - partial ordering with reference parameters
2371 * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
2373 PR c++/79500 - ICE with non-template deduction guide
2374 * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
2375 DECL_TEMPLATE_RESULT.
2377 PR c++/79580 - ICE with compound literal
2378 * parser.c (cp_parser_class_head): If we're in the middle of an
2379 expression, use ts_within_enclosing_non_class.
2381 PR c++/79503 - inherited ctor taking base class
2382 * call.c (add_function_candidate): Also check that
2383 DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
2385 2017-02-19 Paolo Carlini <paolo.carlini@oracle.com>
2388 * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
2391 2017-02-19 Eric Fiselier <eric@efcs.ca>
2392 Jonathan Wakely <jwakely@redhat.com>
2395 * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
2396 control warning about literal suffix identifiers without a leading
2399 2017-02-17 Jason Merrill <jason@redhat.com>
2401 PR c++/79508 - lookup error with member template
2402 * parser.c (cp_parser_template_name): Clear
2403 parser->context->object_type if we aren't doing lookup.
2405 PR c++/78690 - ICE with using and global type with same name
2406 * pt.c (type_dependent_object_expression_p): True for
2409 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
2410 * pt.c (convert_template_argument): Just return an auto arg pack.
2411 (tsubst_template_args): Don't tsubst an auto pack type.
2413 PR c++/79556 - C++17 ICE with non-type auto
2414 * pt.c (do_auto_deduction): Don't try to deduce from null type.
2416 PR c++/79533 - C++17 ICE with temporary cast to reference
2417 * call.c (build_over_call): Conversion to a reference prevents copy
2420 2017-02-16 Jakub Jelinek <jakub@redhat.com>
2421 Jason Merrill <jason@redhat.com>
2423 PR c++/79502 - lost nodiscard attribute
2424 * pt.c (apply_late_template_attributes): Do apply non-dependent
2425 attributes to types.
2427 2017-02-16 Jason Merrill <jason@redhat.com>
2429 PR c++/78572 - ICE with self-modifying array initializer
2430 * constexpr.c (cxx_eval_store_expression): The object we're
2431 initializing is outside the constant-expression.
2432 (cxx_eval_call_expression): Set ctx->call.
2434 PR c++/79050 - ICE with undeduced auto and LTO
2435 * decl.c (poplevel): Remove undeduced auto decls.
2437 2017-02-16 Jakub Jelinek <jakub@redhat.com>
2440 * parser.c (cp_parser_omp_target): For -fopenmp-simd
2441 ignore #pragma omp target even when not followed by identifier.
2443 2017-02-15 Jason Merrill <jason@redhat.com>
2444 Jakub Jelinek <jakub@redhat.com>
2446 PR c++/79464 - ICE in IPA with omitted constructor parms
2447 * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
2448 (adjust_clone_args): Adjust.
2449 (add_method): Remember omitted parms.
2450 * call.c (add_function_candidate): Likewise.
2451 * mangle.c (write_method_parms): Likewise.
2452 * method.c (ctor_omit_inherited_parms): Return false if there are no
2455 2017-02-15 Martin Sebor <msebor@redhat.com>
2458 * init.c (maybe_reject_flexarray_init): New function.
2459 (perform_member_init): Call it.
2461 2017-02-15 Jakub Jelinek <jakub@redhat.com>
2464 * parser.c (cp_parser_std_attribute): Don't pedwarn about
2465 [[deprecated]] with -std=c++11 and [[fallthrough]] with
2466 -std=c++11 and -std=c++14.
2469 * decl.c (grokdeclarator): For static data members, handle thread_p
2470 only after handling inline.
2472 2017-02-14 Marek Polacek <polacek@redhat.com>
2476 * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
2477 clobbering if the postfix expression isn't an EXPR_P.
2479 2017-02-13 Jason Merrill <jason@redhat.com>
2481 PR c++/79461 - ICE with lambda in constexpr constructor
2482 * constexpr.c (build_data_member_initialization): Ignore
2483 initialization of a local variable.
2485 2017-02-13 Jakub Jelinek <jakub@redhat.com>
2487 * init.c (warn_placement_new_too_small): Add missing space in
2489 * parser.c (cp_parser_oacc_declare): Likewise.
2490 * mangle.c (maybe_check_abi_tags): Likewise.
2493 * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
2494 on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
2495 in the rightmost operand.
2497 2017-02-13 Nathan Sidwell <nathan@acm.org>
2499 PR c++/79296 - ICE mangling localized template instantiation
2500 * decl2.c (determine_visibility): Use template fn context for
2501 local class instantiations.
2503 2017-02-11 Jason Merrill <jason@redhat.com>
2505 PR c++/77659 - ICE with new and C++14 aggregate NSDMI
2506 * init.c (build_new): Make backups of any CONSTRUCTORs in init.
2507 (build_new_1): Use replace_placeholders.
2508 * tree.c (replace_placeholders_t): Also track whether we've seen a
2510 (replace_placeholders, replace_placeholders_r): Adjust.
2511 * cp-tree.h: Adjust.
2513 PR c++/77790 - ICE with auto function in C++11 mode
2514 * decl.c (undeduced_auto_decl): Remove C++14 limitation.
2515 (require_deduced_type): Add complain parm, return bool.
2516 * cp-tree.h: Adjust.
2517 * decl2.c (mark_used): Use require_deduced_type.
2519 2017-02-10 Jason Merrill <jason@redhat.com>
2521 PR c++/78908 - template ops and bitfields
2522 * tree.c (build_min_non_dep): Use unlowered_expr_type.
2524 PR c++/78897 - constexpr union
2525 * constexpr.c (cxx_eval_store_expression): A store to a union member
2526 erases a previous store to another member.
2528 PR c++/71285 - member of fold-expression
2529 * semantics.c (finish_unary_fold_expr)
2530 (finish_binary_fold_expr): Use null type for fold-expressions.
2532 PR c++/79401 - protected inherited constructor
2533 * call.c (enforce_access): For inheriting constructor, find a base
2534 binfo in the path we already have.
2536 2017-02-10 Marek Polacek <polacek@redhat.com>
2539 * pt.c (type_dependent_expression_p): Check if the expression type
2543 * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
2544 if warnings shouldn't be given.
2546 2017-02-10 Paolo Carlini <paolo.carlini@oracle.com>
2549 * pt.c (tsubst_decl): Don't try to preserve a typedef that names
2550 an error_mark_node as type.
2552 2017-02-09 Jakub Jelinek <jakub@redhat.com>
2553 Jason Merrill <jason@redhat.com>
2556 * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
2557 from pattern to type.
2559 2017-02-09 Jason Merrill <jason@redhat.com>
2561 PR c++/79316 - default argument in deduction guide
2562 PR c++/79350 - explicit deduction guide
2563 * parser.c (cp_parser_constructor_declarator_p)
2564 (cp_parser_direct_declarator): Parse deduction guides more like
2566 * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
2567 * tree.c (special_function_p): Return it.
2568 * decl.c (check_special_function_return_type): Handle it.
2569 (grokdeclarator, grokfndecl): Adjust.
2570 (cp_finish_decl): Pass flags to do_auto_deduction.
2571 * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
2572 * pt.c (dguide_name_p): Take a const_tree.
2573 (do_class_deduction): Handle explicit.
2574 (do_auto_deduction): Pass flags through.
2575 (build_deduction_guide): Copy explicit flag.
2577 2017-02-09 Jakub Jelinek <jakub@redhat.com>
2580 * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
2581 non-pragma_compound context here.
2582 (cp_parser_omp_target): Likewise.
2583 (cp_parser_pragma): Don't call push_omp_privatization_clauses and
2584 parsing for ordered and target omp pragmas in non-pragma_stmt
2585 non-pragma_compound contexts.
2588 * parser.c (cp_parser_oacc_declare): Formatting fix.
2589 (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
2590 automatic variables.
2592 2016-02-09 Nathan Sidwell <nathan@codesourcery.com>
2593 Chung-Lin Tang <cltang@codesourcery.com>
2595 * parser.c (cp_parser_oacc_clause_tile): Disallow collapse. Fix
2596 parsing. Parse constant expression. Remove semantic checking.
2597 (cp_parser_omp_clause_collapse): Disallow tile.
2598 (cp_parser_omp_for_loop): Deal with tile clause. Don't emit a parse
2599 error about missing for after already emitting one. Use more
2600 conventional for idiom for unbounded loop.
2601 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
2602 * semantics.c (finish_omp_clauses): Correct TILE semantic check.
2603 (finish_omp_for): Deal with tile clause.
2605 2017-02-07 Nathan Sidwell <nathan@acm.org>
2607 * method.c (synthesized_method_base_walk): New. Broken out of ...
2608 (synthesized_method_walk): ... here. Call it. Cleanup
2611 2017-02-07 Patrick Palka <ppalka@gcc.gnu.org>
2614 * typeck2.c (process_init_constructor_union): Consider only
2615 FIELD_DECLs when looking for an NSDMI.
2617 2017-02-06 Jason Merrill <jason@redhat.com>
2619 PR c++/71193 - incomplete types in templates
2620 * parser.c (cp_parser_postfix_dot_deref_expression): In a template
2621 handle incomplete type by pedwarning and then treating as dependent.
2623 2017-02-06 Jakub Jelinek <jakub@redhat.com>
2626 * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
2627 (potential_constant_expression_1): Likewise.
2630 * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
2631 allow one fewer than expected arguments if flag_permissive.
2634 * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
2635 * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
2636 with error_mark_node type.
2638 2017-02-03 Jason Merrill <jason@redhat.com>
2640 PR c++/78689 - ICE on constructor with label
2641 * optimize.c (maybe_clone_body): Replace omitted parameters with
2643 * class.c (build_clone): Fix logic for omitting inherited parms.
2645 PR c++/12245 - excessive memory use
2646 * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
2647 back in. Don't cache constants.
2648 (maybe_constant_init): Don't cache constants.
2650 PR c++/79294 - ICE with invalid template argument
2651 * pt.c (convert_nontype_argument_function): Check value-dependence.
2652 (convert_nontype_argument): Don't check it here for function ptrs.
2654 2017-02-02 Richard Biener <rguenther@suse.de>
2657 * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
2658 it lazily on the first changed element only and copy it
2659 fully upfront, only storing changed elements.
2661 2017-02-02 Paolo Carlini <paolo.carlini@oracle.com>
2664 * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
2667 2017-01-31 Jakub Jelinek <jakub@redhat.com>
2670 * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
2673 2017-01-31 David Malcolm <dmalcolm@redhat.com>
2676 * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
2677 any namespace aliases.
2679 2017-01-31 Nathan Sidwell <nathan@acm.org>
2682 * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
2686 * pt.c: (instantiate_decl): Push to top level when current
2687 function scope doesn't match. Only push lmabda scope stack when
2690 * cp-tree.h (instantiate_decl): Make defer_ok bool.
2691 * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
2692 (instantiate_decl): Simplify and reorder state saving and restoration.
2695 * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
2696 * semantics.c (finish_member_declaration): Assert class is being
2699 2017-01-30 Alexandre Oliva <aoliva@redhat.com>
2701 Introduce C++ support in libcc1.
2702 * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
2703 (ansi_opname): Rename to...
2704 (cp_operator_id): ... this. Adjust all callers.
2705 (ansi_assopname): Rename to...
2706 (cp_assignment_operator_id): ... this. Adjust all callers.
2707 (cp_literal_operator_id): Declare.
2708 (set_global_friend): Declare.
2709 (is_global_friend): Declare.
2710 (enum cp_oracle_request): New type.
2711 (cp_binding_oracle_function): New type.
2712 (cp_binding_oracle): Declare.
2713 (cp_finish_injected_record_type): Declare.
2714 * friend.c (global_friend): New var.
2715 (set_global_friend): New fn.
2716 (is_global_friend): New fn.
2717 (is_friend): Call is_global_friend.
2718 * name-lookup.c (cp_binding_oracle): New var.
2719 (query_oracle): New fn.
2720 (qualified_lookup_using_namespace): Call query_oracle.
2721 (lookup_name_real_1): Likewise.
2722 * parser.c (cp_literal_operator_id): Drop static.
2723 * search.c (friend_accessible_p): Call is_global_friend.
2724 * semantics.c (is_this_parameter): Accept a variable if the
2725 binding oracle is enabled.
2727 2017-01-27 Jason Merrill <jason@redhat.com>
2729 PR c++/78771 - ICE with inherited constructor.
2730 * call.c (build_over_call): Call deduce_inheriting_ctor here.
2731 * pt.c (tsubst_decl): Not here.
2732 * class.c (add_method): Or here.
2733 * method.c (deduce_inheriting_ctor): Handle clones.
2734 (implicitly_declare_fn): Don't deduce inheriting ctors yet.
2736 2017-01-27 Adam Butcher <adam@jessamine.co.uk>
2739 * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
2741 * cp/cp-tree.h: Declare it.
2742 * cp/semantics.c (finish_id_expression): Resolve names within a default
2743 capturing generic lambda defined within a template prior to
2744 instantiation to allow for captures to be added to the closure type.
2746 2017-01-26 Jakub Jelinek <jakub@redhat.com>
2749 * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
2750 * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
2751 * parser.c (cp_parser_builtin_offsetof): Pass result of
2752 build_static_cast of null_pointer_node to finish_offsetof.
2753 * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
2754 it for -Winvalid-offsetof pedwarn instead of trying to guess
2755 original offsetof type from EXPR. Save OBJECT_PTR as a new
2756 second operand to OFFSETOF_EXPR.
2757 * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
2758 finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
2761 2017-01-26 Jason Merrill <jason@redhat.com>
2763 * name-lookup.c (parse_using_directive): Deprecate strong using.
2765 PR c++/79176 - lambda ICE with -flto -Os
2766 * decl2.c (vague_linkage_p): Handle decloned 'tors.
2767 * tree.c (decl_linkage): Likewise.
2769 2017-01-25 Martin Sebor <msebor@redhat.com>
2771 * decl.c (grokdeclarator): Fix a typo in a comment.
2773 2017-01-25 Jakub Jelinek <jakub@redhat.com>
2776 * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
2780 * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
2781 OPT_Wpedantic on lambda templates for -std=c++14 and higher.
2783 2017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
2786 * decl.c (cxx_init_decl_processing): Pass main_input_filename
2787 to build_translation_unit_decl.
2789 2017-01-24 Jakub Jelinek <jakub@redhat.com>
2792 * cp-gimplify.c (cp_genericize_r): Add result of
2793 convert_from_reference on invisiref parm to p_set.
2795 2017-01-24 Nathan Sidwell <nathan@acm.org>
2797 PR c++/78469 - defaulted ctor and inaccessible dtor
2798 * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
2799 * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
2800 * tree.c (build_target_expr): Check tf_no_cleanup.
2802 PR c++/79118 - anon-members and constexpr
2803 * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
2804 ctor decl. Recursively check anonymous members.
2805 (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
2807 (explain_invalid_constexpr_fn): Likewise.
2809 2017-01-23 Nathan Sidwell <nathan@acm.org>
2811 PR c++/71710 - template using directive of field
2812 * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
2815 PR c++/71406 - ICE with scope-ref'd template id exprs
2817 * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
2818 before breaking up TEMPLATE_ID_EXPR.
2820 2017-01-20 Nathan Sidwell <nathan@acm.org>
2822 PR c++/78495 - wrong code inherited ctor and invisi-ref parm
2823 * cp-gimplify.c (cp_generize_r): Don't skip thunks.
2825 2017-01-20 David Malcolm <dmalcolm@redhat.com>
2829 * cp-tree.h (suggest_alternatives_for): Add bool param.
2830 (suggest_alternative_in_explicit_scope): New decl.
2831 * error.c (qualified_name_lookup_error): When SCOPE is a namespace
2832 that isn't the global one, call new function
2833 suggest_alternative_in_explicit_scope, only calling
2834 suggest_alternatives_for if it fails, and disabling near match
2835 searches fort that case. When SCOPE is the global namespace,
2836 pass true for new param to suggest_alternatives_for to allow for
2838 * lex.c (unqualified_name_lookup_error): Pass true for new param
2839 to suggest_alternatives_for.
2840 * name-lookup.c (consider_binding_level): Add forward decl.
2841 (suggest_alternatives_for): Add "suggest_misspellings" param,
2842 using it to conditionalize the fuzzy name-lookup code.
2843 (suggest_alternative_in_explicit_scope): New function.
2844 * parser.c (cp_parser_primary_expression): When calling
2845 finish_id_expression, pass location of id_expression rather
2846 than that of id_expr_token.
2847 (cp_parser_id_expression): Convert local "unqualified_id" from
2848 tree to cp_expr to avoid implicitly dropping location information.
2850 2017-01-20 Marek Polacek <polacek@redhat.com>
2853 * call.c (build_conditional_expr_1): Warn about duplicated branches.
2854 * semantics.c (finish_expr_stmt): Build statement using the proper
2857 2017-01-19 Jason Merrill <jason@redhat.com>
2859 US 20 - forwarding references and class template argument deduction
2860 * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
2861 * pt.c (push_template_decl_real): Set it.
2862 (maybe_adjust_types_for_deduction): Check it.
2863 (rewrite_template_parm): Copy it.
2865 US 19 - deduction guides and constructors
2866 * call.c (joust): Prefer deduction guides to constructors.
2867 * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
2868 (deduction_guide_p): Check DECL_P.
2870 * decl.c (check_initializer): Always use build_aggr_init for array
2873 PR c++/79130 - decomposition and direct-initialization
2874 * init.c (build_aggr_init): Communicate direct-initialization to
2876 (build_vec_init): Check for array copy sooner.
2877 * parser.c (cp_parser_decomposition_declaration): Remove call to
2878 build_x_compound_expr_from_list.
2880 2017-01-18 Jason Merrill <jason@redhat.com>
2882 PR c++/68666 - member variable template-id
2883 * typeck.c (finish_class_member_access_expr): Handle variable
2885 * pt.c (lookup_and_finish_template_variable): No longer static.
2886 * cp-tree.h: Declare it.
2888 2017-01-18 Nathan Sidwell <nathan@acm.org>
2891 * call.c (build_over_call): When checking ellipsis conversions for
2892 an inherited ctor, make sure there is at least one conversion.
2894 2017-01-18 Jason Merrill <jason@redhat.com>
2896 PR c++/78894 - ICE with class deduction and default arg
2897 * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
2899 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
2902 * mangle.c (write_discriminator): Reorganize abi warning check.
2904 2017-01-18 Nathan Sidwell <nathan@acm.org>
2906 * cp-tree.h: Clarify exception spec node comment.
2907 * except.c (nothrow_spec_p): Simplify by checking node-equality.
2910 * mangle.c (write_exception_spec): Check nothrow explicitly.
2911 (write_encoding): Don't increment processing_template_decl around
2914 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
2917 * mangle.c (write_template_args): Add "on" for operator names.
2919 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
2922 * mangle.c (write_discriminator): Handle discriminator >= 10.
2924 2017-01-17 Nathan Sidwell <nathan@acm.org>
2927 * cp-tree.h (maybe_generic_this_capture): Declare.
2928 * lambda.c (resolvable_dummy_lambda): New, broken out of ...
2929 (maybe_resolve_dummy): ... here. Call it.
2930 (maybe_generic_this_capture): New.
2931 * parser.c (cp_parser_postfix_expression): Speculatively capture
2932 this in generic lambda in unresolved member function call.
2933 * pt.c (tsubst_copy_and_build): Force hard error from failed
2934 member function lookup in generic lambda.
2936 2017-01-17 Aldy Hernandez <aldyh@redhat.com>
2939 * cp-array-notation.c (expand_array_notation_exprs): Handle
2942 2017-01-11 Jason Merrill <jason@redhat.com>
2944 PR c++/78337 - ICE on invalid with generic lambda
2945 * semantics.c (process_outer_var_ref): Check if containing_function
2946 is null. Move inform call under complain test.
2948 2017-01-11 Nathan Sidwell <nathan@acm.org>
2951 * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
2954 2017-01-11 Nathan Sidwell <nathan@acm.org>
2956 * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
2958 2017-01-11 Jakub Jelinek <jakub@redhat.com>
2961 * parser.c (cp_parser_std_attribute_spec): Remove over-eager
2962 assertion. Formatting fix.
2965 * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
2968 2017-01-10 David Malcolm <dmalcolm@redhat.com>
2971 * parser.c (cp_parser_class_specifier_1): Only suggest inserting
2972 a missing semicolon if we have a valid insertion location for
2975 2017-01-10 Jason Merrill <jason@redhat.com>
2977 FI 20, decomposition declaration with parenthesized initializer.
2978 * parser.c (cp_parser_decomposition_declaration): Use
2979 cp_parser_initializer.
2981 2017-01-09 Jason Merrill <jason@redhat.com>
2983 Implement P0195R2, C++17 variadic using.
2984 * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
2985 * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
2986 * error.c (dump_decl): Likewise.
2988 2017-01-09 Jakub Jelinek <jakub@redhat.com>
2990 PR translation/79019
2991 PR translation/79020
2992 * semantics.c (finish_omp_clauses): Add missing whitespace to
2993 translatable strings.
2994 * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
2996 2017-01-07 Jason Merrill <jason@redhat.com>
2998 PR c++/78948 - instantiation from discarded statement
2999 * parser.h (struct cp_parser): Remove in_discarded_stmt field.
3000 * cp-tree.h (in_discarded_stmt): Declare it.
3001 (struct saved_scope): Add discarded_stmt bitfield.
3002 (in_discarded_stmt): New macro.
3003 * decl2.c (mark_used): Check it.
3004 * parser.c (cp_parser_selection_statement): Adjust.
3005 (cp_parser_jump_statement): Adjust.
3007 2017-01-05 Jakub Jelinek <jakub@redhat.com>
3010 * decl.c (cp_finish_decomp): Remove probe variable, if tt is
3011 REFERENCE_REF_P, set tt to its operand.
3014 * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
3015 unions even for C++11 and later.
3017 2017-01-05 Nathan Sidwell <nathan@acm.org>
3020 * pt.c (convert_nontype_argument): Don't try and see if integral
3021 or enum expressions are constants prematurely.
3023 2017-01-04 Marek Polacek <polacek@redhat.com>
3026 * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
3027 a zero character literal.
3029 2017-01-04 Jakub Jelinek <jakub@redhat.com>
3032 * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
3036 * parser.c (cp_parser_simple_declaration): Only complain about
3037 inconsistent auto deduction if auto_result doesn't use auto.
3039 * parser.c (cp_parser_simple_declaration): Diagnose function
3040 declaration among more than one init-declarators with auto
3044 * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
3045 assertion, as lexer->buffer may be NULL.
3047 2017-01-04 Marek Polacek <polacek@redhat.com>
3051 * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
3053 2017-01-04 Nathan Sidwell <nathan@acm.org>
3056 * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
3057 (lambda_capture_field_type): Update prototype.
3058 * lambda.c (lambda_capture_field_type): Add is_reference parm.
3059 Add referenceness here.
3060 (add_capture): Adjust lambda_capture_field_type call, refactor
3062 * pt.c (tsubst): Adjust lambda_capture_field_type call.
3064 2017-01-01 Jakub Jelinek <jakub@redhat.com>
3066 Update copyright years.
3068 Copyright (C) 2017 Free Software Foundation, Inc.
3070 Copying and distribution of this file, with or without modification,
3071 are permitted in any medium without royalty provided the copyright
3072 notice and this notice are preserved.