1 2017-06-27 Nathan Sidwell <nathan@acm.org>
3 * pt.c (tsubst_decl <FUNCTION_DECL>): Move var decls to
4 initialization point. Don't unnecessarily check for ctor name.
6 * cp-tree.h (CLASSTYPE_DESTRUCTORS): Rename to ...
7 (CLASSTYPE_DESTRUCTOR): ... this.
8 * class.c (accessible_nvdtor_p,
9 maybe_warn_about_overly_private_class,
10 add_implicitly_declared_members,
11 clone_constructors_and_destructors, type_has_virtual_destructor):
12 Adjust for CLASSTYPE_DESTRUCTOR.
13 (deduce_noexcept_on_destructors): Absorb into ...
14 (check_bases_and_members): ... here.
15 * except.c (dtor_nothrow): Adjust for CLASSTYPE_DESTRUCTOR.
16 * init.c (build_delete): Likewise.
17 * parser.c (cp_parser_lookup_name): Likewise.
18 * pt.c (check_explicit_specialization): Likewise.
19 * rtti.c (emit_support_tinfos): Likewise.
20 * search.c (lookup_fnfields_idx_nolazy): Likewise.
22 Kill IDENTIFIER_TEMPLATE.
23 * cp-tree.h (lang_identifier): Remove class_template_info field.
24 (IDENTIFIER_TEMPLATE): Delete.
25 * name-lookup.c (constructor_name_full): Subsume into ...
26 (constructor_name): ... here. Don't check IDENTIFIER_TEMPLATE.
27 (constructor_name_p): Likewise.
28 * mangle.c (write_source_name): Likewise.
29 * ptree.c (cxx_print_identifier): Likewise.
31 2017-06-27 Marek Polacek <polacek@redhat.com>
34 * parser.c (cp_parser_already_scoped_statement): Initialize
37 2017-06-26 Jason Merrill <jason@redhat.com>
39 PR c++/81215 - deduction failure with variadic TTP.
40 * pt.c (unify_bound_ttp_args): Restore old logic for C++14 and down.
42 2017-06-26 Martin Sebor <msebor@redhat.com>
45 * call.c (maybe_warn_class_memaccess): Preserve explicit conversions
46 to detect casting away cv-qualifiers.
48 2017-06-26 Nathan Sidwell <nathan@acm.org>
50 * cp-tree.h (lang_decl_fn): Remove assignment_operator_p field.
51 (DECL_COMPLETE_CONSTRUCTOR_P): Directly compare
53 (DECL_BASE_CONSTRUCTOR_P, DECL_COMPLETE_DESTRUCTOR_P,
54 DECL_BASE_DESTRUCTOR_P, DECL_DELETING_DESTRUCTOR_P): Likewise.
55 (DECL_ASSIGNMENT_OPERATOR_P): Use IDENTIFIER_ASSIGN_OP_P.
56 * decl.c (grok_op_properties): Adjust identifier checking.
57 * init.c (expand_default_init): Adjust identifier descision.
58 * method.c (implicitly_declare_fn): Don't use
59 DECL_ASSIGNMENT_OPERATOR_P.
60 * search.c (lookup_fnfields_1): Use IDENTIFIER_CTOR_P,
62 * call.c (in_charge_arg_for_name): Reimplement.
63 (build_special_member_call): Use IDENTIFIER_CDTOR_P,
66 2017-06-26 Marek Polacek <polacek@redhat.com>
69 * parser.c (cp_parser_statement): Add a default argument. Save the
70 location of the expression-statement after labels have been parsed.
71 (cp_parser_implicitly_scoped_statement): Set the location of the
72 body of the conditional after parsing all the labels. Call
73 warn_for_multistatement_macros.
74 (cp_parser_already_scoped_statement): Likewise.
76 2017-06-24 Paolo Carlini <paolo.carlini@oracle.com>
79 * parser.c (cp_parser_diagnose_invalid_type_name): Don't print
80 'typename' in error messages about missing 'typename'.
82 2017-06-23 Jason Merrill <jason@redhat.com>
84 PR c++/79056 - C++17 ICE with invalid template syntax.
85 * parser.c (cp_parser_simple_type_specifier): Don't assume that type
87 (cp_parser_check_for_invalid_template_id): Handle TYPE_DECL.
88 * pt.c (template_placeholder_p): New.
89 * cp-tree.h: Declare it.
91 2017-06-23 Marc Glisse <marc.glisse@inria.fr>
93 * decl.c (duplicate_decls): Use builtin_structptr_types.
95 2017-06-22 Nathan Sidwell <nathan@acm.org>
97 Reorder IDENTIFIER flags
99 * cp-tree.h (enum cp_identifier_kind): New.
100 (IDENTIFIER_KIND_BIT_0, IDENTIFIER_KIND_BIT_1,
101 IDENTIFIER_KIND_BIT_2): New.
102 (IDENTIFIER_MARKED): Move to TREE_LANG_FLAG_4.
103 (IDENTIFIER_VIRTUAL_P, IDENTIFIER_REPO_CHOSEN): Add IDENTIFIER_CHECK.
104 (C_IS_RESERVED_WORD): Replace with ...
105 (IDENTIFIER_KEYWORD_P): ... this.
106 (IDENTIFIER_CTOR_OR_DTOR_P): Replace with ...
107 (IDENTIFIER_CDTOR_P): ... this.
108 (IDENTIFIER_CTOR_P, IDENTIFIER_DTOR_P): New.
109 (IDENTIFIER_OPNAME_P): Replace with ...
110 (IDENTIFIER_ANY_OP_P): ... this.
111 (IDENTIFIER_ASSIGN_OP_P): New.
112 (IDENTIFIER_TYPENAME_P): Replace with ...
113 (IDENTIFIER_CONV_OP_P): ... this.
114 (NEW_DELETE_OPNAME_P): Replace with ...
115 (IDENTIFIER_NEWDEL_OP_P): ... this.
116 (DECL_CONV_FN_P, DECL_OVERLOADED_OPERATOR_P): Adjust.
117 (get_identifier_kind_name, set_identifier_kind): Declare.
118 * lex.c (get_identifier_kind_name, set_identifier_kind): New.
119 (init_operators): Adjust to avoid keywords, use
120 set_identifier_kind. Copy TYPE_EXPR slot.
121 (init_reswords): Call set_identifier_kind.
122 (unqualified_name_lookup_error): Adjust.
123 * operators.def (TYPE_EXPR): Remove.
124 * decl.c (struct predefined_identifier): Move into ...
125 (initialize_predefined_identifiers): ... here. Call
127 (grokfndecl, check_var_type, grokdeclarator): Adjust.
128 (grok_op_properties): Use IDENTIFIER_ANY_ASSIGN_OP to halve search
130 * call.c (name_as_c_string): Adjust.
131 (build_new_method_call_1): Likewise.
132 * cp-cilkplus.c (is_conversion_operator_function_decl_p): Likewise.
133 * cxx-pretty-print.c (pp_cxx_unqualified_id): Adjust.
134 * dump.c (cp_dump_tree): Adjust.
135 * error.c (dump_decl_name): Adjust.
136 * mangle.c (write_unqualified_id, write_member_name,
137 write_expression): Adjust.
138 (mangle_conv_op_name_for_type): Use set_identifier_kind.
139 * name-lookup.c (do_class_using_decl): Adjust.
140 (lookup_name_fuzzy, lookup_name_real_1): Likewise.
141 * parser.c (cp_lexer_get_preprocessor_token,
142 cp_parser_direct_declarator): Likewise.
143 * pt.c (push_template_decl_real, tsubst_decl, tsubst_baselink,
144 tsubst_copy, tsubst_copy_and_build): Adjust.
145 * ptree.c (cxx_print_identifier): Print identifier kind.
146 * search.c (lookup_field_r, lookup_member,
147 lookup_fnfields_idx_nolazy): Adjust.
148 * semantics.c (finish_id_expression): Adjust..
149 * typeck.c (cp_build_addr_expr_1): Adjust.
151 2017-06-21 Jakub Jelinek <jakub@redhat.com>
154 * semantics.c (handle_omp_array_sections_1, finish_omp_clauses):
155 Complain about t not being a variable if t is OVERLOAD even
156 when processing_template_decl.
158 2017-06-21 David Malcolm <dmalcolm@redhat.com>
160 * parser.c (get_cast_suggestion): New function.
161 (maybe_add_cast_fixit): New function.
162 (cp_parser_cast_expression): Capture the location of the closing
163 parenthesis. Call maybe_add_cast_fixit when emitting warnings
164 about old-style casts.
166 2017-06-20 Jason Merrill <jason@redhat.com>
168 PR c++/80972 - C++17 ICE with attribute packed.
169 * call.c (build_over_call): Allow a TARGET_EXPR from reference
172 2017-06-20 Nathan Sidwell <nathan@acm.org>
174 * cp-tree.h (CPTI_NELTS_IDENTIFIER): Delete.
175 (nelts_identifier): Delete.
176 * decl.c (initialize_predefined_identifiers): Remove nelts.
178 PR c++/67074 - namespace aliases
179 * decl.c (duplicate_decls): Don't error here on mismatched
181 * name-lookup.c (name_lookup::add_value): Matching namespaces are
183 (diagnose_name_conflict): Namespaces are never redeclarations.
184 (update_binding): An alias can match a real namespace.
186 2017-06-19 Jason Merrill <jason@redhat.com>
188 PR c++/80562 - ICE with constexpr if.
189 * semantics.c (finish_if_stmt_cond): Call
190 instantiate_non_dependent_expr.
192 PR c++/80829 - ICE with constexpr copy of base subobject.
193 * constexpr.c (clear_no_implicit_zero): New.
194 (cxx_eval_call_expression): Call it.
196 2017-06-19 Nathan Sidwell <nathan@acm.org>
200 * name-lookup.c (set_decl_namespace): Don't follow using
201 directives and ignore using decls. Only check overly-explicit
202 scope after discovering decl.
204 2017-06-19 Jason Merrill <jason@redhat.com>
206 PR c++/81073 - constexpr and static var in statement-expression.
207 * typeck2.c (store_init_value): Always call
208 require_potential_constant_expression.
209 * pt.c (convert_nontype_argument): Likewise.
210 * constexpr.c (potential_constant_expression_1): Adjust message.
211 Use decl_maybe_constant_var_p instead of decl_constant_var_p.
212 * decl2.c (decl_maybe_constant_var_p): Consider initializer.
214 2017-06-19 Nathan Sidwell <nathan@acm.org>
216 * pt.c (coerce_template_parms): Fix indentation.
217 (tsubst_decl): Remove repeated SET_DECL_RTL. Move VAR_P handling
221 * name-lookup.c (update_binding): Only warn about constructors
224 2017-06-17 Jason Merrill <jason@redhat.com>
226 PR c++/60063 - -Wunused-local-typedefs and templates.
227 * decl2.c (is_late_template_attribute): Return false for "used".
229 PR c++/70844 - -Wuseless-cast and inheriting constructor.
230 * method.c (forward_parm): Suppress warn_useless_cast.
232 2017-06-16 Jason Merrill <jason@redhat.com>
234 PR c++/81045 - Wrong type-dependence with auto return type.
235 * pt.c (type_dependent_expression_p): An undeduced auto outside the
236 template isn't dependent.
237 * call.c (build_over_call): Instantiate undeduced auto even in a
240 PR c++/80465 - ICE with generic lambda with noexcept-specifier.
241 * lambda.c (maybe_add_lambda_conv_op): Keep processing_template_decl
242 set longer for a generic lambda.
244 PR c++/80614 - Wrong mangling for C++17 noexcept type
245 * mangle.c (write_type): Put the eh spec back on the function type.
247 PR c++/81102 - Wrong error with partial specialization.
248 * pt.c (unify) [TEMPLATE_PARM_INDEX]: Strip reference when comparing
249 types. Do type deduction later.
251 PR c++/81074 - ICE with partial specialization of member template.
253 * pt.c (get_partial_spec_bindings): Only coerce innermost args.
255 PR c++/80831 - ICE with -fsyntax-only.
256 * decl2.c (c_parse_final_cleanups): Use cgraph_node::get_create.
258 PR c++/80639 - ICE with invalid PMF initialization.
259 PR c++/80043 - ICE with -fpermissive
260 * typeck.c (convert_for_assignment): Recurse when instantiate_type
261 returns without an error.
263 2017-06-16 Nathan Sidwell <nathan@acm.org>
265 * pt.c (tsubst_baselink): Fix & clarify formatting.
267 * cp-tree.h (build_this_parm, cp_build_parm_decl,
268 build_artificial_parm): Add FN parm.
269 * decl.c (start_cleanup_fn): Adjust.
270 (build_this_parm): Add FN parm, pass it through.
271 (grokfndecl): Adjust parm building.
272 * decl2.c (cp_build_parm_decl): Add FN parm, set context.
273 (build_artificial_parm): Add FN parm, pass through.
274 (maybe_retrofit_in_chrg): Adjust parm building.
275 (start_static_storage_duration_function): Likwise.
276 * lambda.c (maybe_aadd_lambda_conv_op): Likewise.
277 * method.c (implicitly_declare_fn): Likewise.
278 * parser.c (inject_this_parameter): Likewise.
280 Symbol tables are insert only.
281 * cp-tree.h (default_hash_traits <lang_identifier *>): Don't
282 derive from pointer_hash. Make undeletable.
284 * class.c (resort_type_method_vec): Avoid potential unsigned
287 Don't defer noexcept_deferred_spec.
288 * cp-tree.h (unevaluated_noexcept_spec): Don't declare.
289 * decl.c (cxx_init_decl_processing): Initialize
290 noexcept_deferred_spec.
291 * except.c (unevaluated_noexcept_spec): Delete.
292 * class.c (deduce_noexcept_on_destructor): Use
293 noexcept_deferred_spec directly.
294 * method.c (implicitly_declare_fn): Likewise.
296 Make keyed_classes a vector.
297 * cp-tree.h (CPTI_KEYED_CLASSES, keyed_classes): Delete.
298 (keyed_classes): Declare as vector.
299 * decl.c (keyed_classes): Define.
300 (cxx_init_decl_processing): Allocate it.
301 (record_key_method_defined): Use vec_safe_push.
302 * class.c (finish_struct_1): Likewise.
303 * pt.c (instantiate_class_template_1): Likewise.
304 * decl2.c (c_parse_final_cleanups): Reverse iterate keyed_classes.
307 * rtti.c (enum tinfo_kind): Add TK_DERIVED_TYPES,
308 TK_VMI_CLASS_TYPES, TK_MAX. Delete TK_FIXED.
310 (typeid_ok_p): Add quotes to error messages. Use get_tinfo_desc.
311 (get_tinfo_decl): Use get_tinfo_desc.
312 (get_pseudo_ti_init): Likewise. Adjust VMI construction.
313 (create_pseudo_type_info): Delete.
314 (get_pseudo_ti_index): Just determine the index.
315 (get_tinfo_desc): New. Create all types lazily.
316 (create_tinfo_types): Just allocate the descriptor array.
317 (emit_support_tinfos): Use non-inserting type lookup. Set builtin
320 2017-06-15 Martin Sebor <msebor@redhat.com>
323 * call.c (first_non_public_field, maybe_warn_class_memaccess): New
325 (has_trivial_copy_assign_p, has_trivial_copy_p): Ditto.
326 (build_cxx_call): Call maybe_warn_class_memaccess.
328 2017-06-14 Jakub Jelinek <jakub@redhat.com>
330 * cp-gimplify.c (cp_genericize_r): Turn most of the function
331 into a switch (TREE_CODE (stmt)) statement from long else if
334 2017-06-13 Jakub Jelinek <jakub@redhat.com>
337 * cp-gimplify.c (cp_genericize_r): Don't instrument MEM_REF second
338 argument even if it has REFERENCE_TYPE.
341 * cp-gimplify.c (cp_genericize): Only look for VAR_DECLs in
342 BLOCK_VARS (outer) chain.
343 (cxx_omp_const_qual_no_mutable): Likewise.
345 2017-06-13 Martin Liska <mliska@suse.cz>
348 * class.c (build_base_path): Use sanitize_flags_p.
349 * cp-gimplify.c (cp_genericize_r): Likewise.
350 (cp_genericize_tree): Likewise.
351 (cp_genericize): Likewise.
352 * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
353 * decl.c (compute_array_index_type): Likewise.
354 (start_preparsed_function): Likewise.
355 * decl2.c (one_static_initialization_or_destruction): Likewise.
356 * init.c (finish_length_check): Likewise.
357 * lambda.c (maybe_add_lambda_conv_op): Likewise.
358 * typeck.c (cp_build_binary_op): Likewise.
359 (build_static_cast_1): Likewise.
361 2017-06-11 Jason Merrill <jason@redhat.com>
363 * error.c (dump_expr): Use is_this_parameter.
365 * cp-tree.h, decl2.c, mangle.c, parser.c, pt.c, semantics.c: Use
368 2017-06-09 Jason Merrill <jason@redhat.com>
370 Missing bits from N4268, constant evaluation for all non-type args.
371 * call.c (build_converted_constant_expr): Rename from
372 build_integral_nontype_arg_conv, handle all types.
373 * pt.c (convert_nontype_argument): In C++17 call it for all types.
374 Move NOP stripping inside pointer case, don't strip ADDR_EXPR.
375 * cvt.c (strip_fnptr_conv): Also strip conversions to the same type.
377 Overhaul pointer-to-member conversion and template argument handling.
378 * call.c (standard_conversion): Avoid creating ck_pmem when the
379 class type is the same.
380 * cvt.c (can_convert_qual): Split from
381 perform_qualification_conversions.
382 * constexpr.c (cxx_eval_constant_expression): Check it.
383 * typeck.c (convert_ptrmem): Only cplus_expand_constant if
384 adjustment is necessary.
385 * pt.c (check_valid_ptrmem_cst_expr): Compare class types.
386 (convert_nontype_argument): Avoid redundant error.
388 * call.c (convert_like_real): Remove "inner" parameter.
389 Don't replace a constant with its value.
390 * cp-gimplify.c (cp_fully_fold): Use cp_fold_rvalue.
392 * pt.c (convert_nontype_argument): Check NULLPTR_TYPE_P rather than
395 * parser.c (cp_parser_constant_expression): Check
396 potential_rvalue_constant_expression after decay_conversion.
397 * pt.c (convert_nontype_argument): Don't require linkage in C++17.
399 PR c++/80384 - ICE with dependent noexcept-specifier
400 * pt.c (dependent_type_p_r) [FUNCTION_TYPE]: Check for dependent
403 * constexpr.c (potential_constant_expression_1): Allow 'this' capture.
405 2017-06-09 Jan Hubicka <hubicka@ucw.cz>
407 * class.c (build_vtbl_initializer): Mark dvirt_fn as cold.
408 * decl.c (cxx_init_decl_processing, push_throw_library_fn): Likewise.
409 (excpet.c): Mark terminate as cold.
411 2017-06-08 Jakub Jelinek <jakub@redhat.com>
414 * semantics.c (handle_omp_array_sections_1): Convert TYPE_MAX_VALUE
415 to sizetype before size_binop.
418 * cp-gimplify.c (cxx_omp_finish_clause): When changing clause
419 to OMP_CLAUSE_SHARED, also clear OMP_CLAUSE_SHARED_FIRSTPRIVATE
420 and OMP_CLAUSE_SHARED_READONLY flags.
422 2017-06-08 Jan Hubicka <hubicka@ucw.cz>
424 * cp-tree.h (lang_check_failed): Annotate by ATTRIBUTE_COLD.
426 2017-06-07 Nathan Sidwell <nathan@acm.org>
428 * class.c (layout_class_type): Restructure overlong-bitfield tpe
431 2017-06-07 Jonathan Wakely <jwakely@redhat.com>
434 * pt.c (do_class_deduction): Build qualified type.
436 2017-06-06 Nathan Sidwell <nathan@acm.org>
438 * name-lookup.c (suggest_alternatives_for): Use qualified lookup
439 sans using directives. Don't walk into inline namespaces.
442 * name-lookup.c (adl_class_only): Don't add visible friends.
444 2017-06-05 Volker Reichelt <v.reichelt@netcologne.de>
446 * parser.c (cp_parser_base_specifier): Fix typos in error messages.
448 2017-06-02 Nathan Sidwell <nathan@acm.org>
450 Remove lang_type_ptrmem.
451 * cp-tree.h (lang_type_header): Remove is_lang_type_class. Move
453 (lang_type_class): ... this. Reorder bitfields. Rename to ...
454 (lang_type): ... this. Delete old definition.
455 (lang_type_ptrmem): Delete.
456 (LANG_TYPE_CLASS_CHECK): Simply get TYPE_LANG_SPECIFIC. Adjust uses.
457 (LANG_TYPE_PTRMEM_CHECK): Delete.
458 (TYPE_GET_PTRMEMFUNC_TYPE, TYPE_SET_PTRMEMFUNC_TYPE): Delete.
459 (TYPE_PTRMEMFUNC_TYPE): New. Use TYPE_LANG_SLOT_1.
460 * decl.c (build_ptrmemfunc_type): Adjust.
461 * lex.c (copy_lang_type): Remove lang_type_ptrmem handling.
462 (maybe_add_lang_type_raw): Don't set u.c.h.is_lang_type_class.
464 * class.c (check_bases_and_members): Adjust vec_new_uses_cookie
467 Remove cp_binding_level::namespaces
468 * name-lookup.h (cp_binding_level): Lose namespaces field.
469 * name-lookup.c (add_decl_to_level): Chain namespaces on the names
471 (suggest_alternatives_for): Adjust for namespace list. Do
472 breadth-first search.
473 * decl2.c (collect_source_refs): Namespaces are on the regulr
475 (collect_ada_namespace): Likewise.
477 2017-06-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
479 * typeck.c (cp_build_binary_op): Implement the -Wsizeof_pointer_div
482 2017-06-01 Ville Voutilainen <ville.voutilainen@gmail.com>
485 * method.c (constructible_expr): Strip array types before calling
488 2017-06-01 Paolo Carlini <paolo.carlini@oracle.com>
491 * cvt.c (convert_to_void): Possibly call maybe_warn_nodiscard
492 for case INDIRECT_REF too in the main switch.
494 2017-05-31 Jason Merrill <jason@redhat.com>
496 PR c++/80840 - ICE with constexpr and reference
497 * pt.c (convert_nontype_argument): Don't test whether a decl is
498 value-dependent when binding to a reference.
500 2017-05-31 Nathan Sidwell <nathan@acm.org>
502 * cp-tree.h (lang_decl_slector): New enum.
503 (lang_decl_base): Make selector an enum. Drop decomposition_p
505 (lang_decl): Use enum for discrimination.
506 (LANG_DECL_FN_CHECK, LANG_DECL_NS_CHECK, LANG_DECL_PARM_CHECK,
507 LANG_DECL_DEOMP_CHECK): Use enum.
508 (DECL_DECOMPOSITION_P): Use selector value.
509 (SET_DECL_DECOMPOSITION_P): Delete.
510 (retrofit_lang_decl): Lose SEL parm.
511 (fit_decomposition_lang_decl): Declare.
512 * decl.c (cp_finish_decomp, grokdeclarator): Use
513 fit_decomposition_lang_decl.
514 * lex.c (maybe_add_lang_decl_raw): New. Broken out of
516 (set_decl_linkage): New. Broken out of retrofit_lang_decl. Use enum.
517 (fit_decomposition_lang_decl): Likewise.
518 (retrofit_lang_decl): Use worker functions.
519 (cxx_dup_lang_specific_decl): Use selector enum.
520 (maybe_add_lang_type_raw): New. Broken out of ...
521 (cxx_make_type_name): ... here. Call it.
523 2017-05-30 Jason Merrill <jason@redhat.com>
525 PR c++/80856 - ICE with local extern in template
526 * semantics.c (finish_call_expr): Replace a local extern overload
527 set in a template with the IDENTIFIER_NODE.
529 2017-05-30 David Malcolm <dmalcolm@redhat.com>
531 * call.c (perform_implicit_conversion_flags): Convert
532 "from %qT to %qT" to "from %qH to %qI" in diagnostic.
533 (print_conversion_rejection): Replace pairs of %qT with
534 %qH and %qI in various places.
535 (build_user_type_conversion_1): Likewise.
536 (build_integral_nontype_arg_conv): Likewise.
537 (build_conditional_expr_1): Likewise.
538 (convert_like_real): Likewise.
539 (convert_arg_to_ellipsis): Likewise.
541 (initialize_reference): Likewise.
542 * cvt.c (cp_convert_to_pointer): Likewise.
543 (cp_convert_to_pointer): Likewise.
544 (convert_to_reference): Likewise.
545 (ocp_convert): Likewise.
546 * error.c (cp_printer): Gain bool and const char ** parameters.
547 (struct deferred_printed_type): New struct.
548 (class cxx_format_postprocessor): New class.
549 (cxx_initialize_diagnostics): Wire up a cxx_format_postprocessor
550 to pp->m_format_postprocessor.
551 (comparable_template_types_p): New function.
552 (newline_and_indent): New function.
553 (arg_to_string): New function.
554 (print_nonequal_arg): New function.
555 (print_template_differences): New function.
556 (type_to_string_with_compare): New function.
557 (print_template_tree_comparison): New function.
558 (append_formatted_chunk): New function.
559 (add_quotes): New function.
560 (cxx_format_postprocessor::handle): New function.
561 (defer_phase_2_of_type_diff): New function.
562 (cp_printer): Add "quoted" and "buffer_ptr" params. Implement
564 * typeck.c (cp_build_binary_op): Replace pairs of %qT with
565 %qH and %qI in various places.
566 (convert_member_func_to_ptr): Likewise.
567 (build_reinterpret_cast_1): Likewise.
568 (convert_for_assignment): Likewise.
569 * typeck2.c (check_narrowing): Likewise.
571 2017-05-30 Nathan Sidwell <nathan@acm.org>
573 Kill IDENTIFIER_NAMESPACE_BINDINGS
574 * cp-tree.h (lang_identifier): Delete namespace_bindings.
575 (IDENTIFIER_NAMESPACE_BINDINGS): Delete.
576 (lang_decl_ns): Add bindings.
577 (DECL_NAMESPACE_BINDINGS): New.
578 * lex.c (retrofit_lang_decl): Create namespace hash table.
579 * name-lookup.c (find_namespace_slot): Change to use hash-map.
580 * ptree.c (cxx_print_binding): Delete.
581 (cxx_print_identifier): Remove NAMESPACE_BINDING printing.
583 * cp-tree.def (OVERLOAD): Fix comment.
584 * cp-tree.h: Fix comments and whitespace.
585 * error.c (dump_decl): Use pp_cxx_colon_colon, ovl_scope.
586 * name-lookup.c (add_decl_to_level): Assert not class.
587 (check_local_shadow): Use OVL_P.
588 (pushdecl_with_scope_1): Rename to ...
589 (do_pushdecl_with_Scope): ... here.
590 (do_nonmember_using_decl): Use qualified_namespace_lookup return
592 (push_class_level_binding_1): Use OVL_P.
593 (pushdecl_namespace_level): Use do_pushdecl_with_scope.
594 (pushtag_1): Rename to ...
595 (do_pushtag): ... here. Adjust do_pushdecl_with_scope call.
597 (store_class_bindings): Do not time here.
598 * name-lookup.h (pushdecl_outermost_localscope): Reorder.
599 * pt.c (listify): Declare argvec at point of initialization.
602 * name-lookup.c (add_decl_to_level): Assert not making a circular
604 (update_binding): Don't prematurely slide artificial decl.
606 2017-05-29 Alexandre Oliva <aoliva@redhat.com>
608 * cp-tree.h (lang_identifier): Drop oracle_looked_up, unused.
610 2017-05-29 Nathan Sidwell <nathan@acm.org>
613 * cp-tree.h (lookup_maybe_add): Add DEDUPING argument.
614 * name-lookup.c (name_lookup): Add deduping field.
615 (name_lookup::preserve_state, name_lookup::restore_state): Deal
617 (name_lookup::add_overload): New.
618 (name_lookup::add_value, name_lookup::add_fns): Call add_overload.
619 (name_lookup::search_adl): Set deduping. Don't unmark here.
620 * pt.c (most_specialized_instantiation): Revert previous change,
621 Assert not given duplicates.
622 * tree.c (lookup_mark): Just mark the underlying decls.
623 (lookup_maybe_add): Dedup using marked decls.
626 * ptree.c (cxx_print_xnode): Show internal OVERLOAD structure.
627 * tree.c (ovl_insert, ovl_iterator_remove_node): Fix copying assert.
629 Stat hack representation
630 * name-lookup.c (STAT_HACK_P, STAT_TYPE, STAT_DECL,
631 MAYBE_STAT_DECL, MAYBE_STAT_TYPE): New.
633 (find_namespace_binding): Replace with ...
634 (find_namespace_slot): ... this.
635 (find_namespace_value): New.
636 (name_lookup::search_namespace_only,
637 name_lookup::adl_namespace_only): Adjust.
638 (update_binding): Add SLOT parameter, adjust.
639 (check_local_shadow): Use find_namespace_value.
640 (set_local_extern_decl_linkage): Likewise.
641 (do_pushdecl): Adjust for namespace slot.
642 (push_local_binding): Assert not a namespace binding.
643 (check_for_out_of_scope_variable): Use find_namespace_value.
644 (set_identifier_type_value_with_scope): Likewise.
645 (get_namespace_binding): Likewise.
646 (set_namespace_binding): Delete.
647 (set_global_binding): Directly update the binding.
648 (finish_namespace_using_decl): Likewise.
649 (lookup_type_scope_1): Use find_namespace_slot and update.
650 (do_push_nested_namespace): Use find_namespace_value.
653 * pt.c (most_specialized_instantiation): Cope with duplicate
657 * cp-tree.h (build_min_nt_call_vec): Declare.
658 * decl.c (build_offset_ref_call_from_tree): Call it.
659 * parser.c (cp_parser_postfix_expression): Likewise.
660 * pt.c (tsubst_copy_and_build): Likewise.
661 * semantics.c (finish_call_expr): Likewise.
662 * tree.c (build_min_nt_loc): Keep unresolved lookups.
663 (build_min): Likewise.
664 (build_min_non_dep): Likewise.
665 (build_min_non_dep_call_vec): Likewise.
666 (build_min_nt_call_vec): New.
669 * tree.c (ovl_copy): Adjust assert, copy OVL_LOOKUP.
671 (lookup_keep): Call it.
673 2017-05-26 Nathan Sidwell <nathan@acm.org>
676 * name-lookup.c (push_inline_namespaces): New.
677 (push_namespace): Look inside inline namespaces.
679 Inline and using namespace representation change.
680 * cp-tree.h (struct lang_decl_ns): Delete ns_using. Add usings,
682 (DECL_NAMESPACE_USING): Adjust.
683 (DECL_NAMESPACE_INLINEES): New.
684 * name-lookup.h (struct cp_binding_level): Change usings
686 * name-lookup.c (name_lookup::do_queue_usings,
687 name_lookup::queue_usings): Adjust.
688 (name_lookup::search_namespace, name_lookup::search_usings,
689 name_lookup::queue_namespace): Adjust.
690 (name_lookup::adl_namespace_only): Adjust.
691 (add_using_namespace, push_namespace): Push onto vector.
692 (pop_namespace): Add timing logic.
694 * call.c (build_operator_new_call): Do namelookup and ADL here.
695 (build_new_op_1): Likewise.
696 * name-lookup.h (lookup_function_nonclass): Delete declaration.
697 (do_using_directive): Likewise.
698 * name-lookup.c (set_namespace_binding, push_local_binding): Don't
700 (struct scope_binding): Delete.
701 (EMPTY_SCOPE_BINDING): Delete.
702 (set_decl_namespace): Use OVL_P.
703 (finish_local_using_decl): Lose unnecesary checks.
704 (lookup_function_nonclass): Delete.
705 (cp_emit_debug_info_for_using): Use MAYBE_BASELINK_P.
707 * cp-tree.h (OVL_CHAIN): Check looking at OVERLOAD.
708 (ovl_iterator): Add allow_inner field. Adjust ctor. Make
710 (ovl_iterator::maybe_push, ovl_iterator::pop): New.
711 (lkp_iterator): Add outer field. Adjust ctor.
712 (lkp_iterator::operator++): New.
713 (lookup_mark, lookup_maybe_add): Declare.
714 * name-lookup.c (name_lookup): Delete fn_set member.
715 (name_lookup::preserve_state, name_lookup::restore_state): Unmark
717 (name_lookup::add_value): Use lookup_add directly.
718 (name_lookup::add_fns: Use lookup_maybe_add.
719 (name_lookup::search_adl): Mark and unmark fns.
721 * pt.c (check_explicit_specialization): Use lookup_add directly.
722 * ptree.c (cxx_print_xnode): Show complete overload structure.
723 * tree.c (lookup_mark, lookup_maybe_add): New.
725 * name-lookup.c (name_lookup::search_adl): ADL OMP UDR type args.
727 2017-05-26 Jakub Jelinek <jakub@redhat.com>
729 * cp-tree.h (struct lang_decl_decomp): New type.
730 (struct lang_decl): Add u.decomp.
731 (LANG_DECL_DECOMP_CHECK): Define.
732 (DECL_DECOMPOSITION_P): Note it is set also on the vars
733 for user identifiers.
734 (DECL_DECOMP_BASE): Define.
735 (retrofit_lang_decl): Add extra int = 0 argument.
736 * lex.c (retrofit_lang_decl): Add SEL argument, if non-zero
737 use it to influence the selector choices and for selector
738 0 to non-zero transition copy old content.
739 (cxx_dup_lang_specific_decl): Handle DECL_DECOMPOSITION_P.
740 * decl.c (poplevel): For DECL_DECOMPOSITION_P, check
741 !DECL_DECOMP_BASE instead of !DECL_VALUE_EXPR. Adjust warning
742 wording if decl is a structured binding.
743 (cp_finish_decomp): Pass 4 as the new argument to retrofit_lang_decl.
744 Set DECL_DECOMP_BASE. Ignore DECL_READ_P sets from initialization
745 of individual variables for tuple structured bindings.
746 (grokdeclarator): Pass 4 as the new argument to retrofit_lang_decl.
747 Clear DECL_DECOMP_BASE.
748 * decl2.c (mark_used): Mark DECL_DECOMP_BASE TREE_USED as well.
749 * pt.c (tsubst_decomp_names): Assert DECL_DECOMP_BASE matches what
751 * expr.c (mark_exp_read): Recurse on DECL_DECOMP_BASE instead of
754 2017-05-25 Jason Merrill <jason@redhat.com>
756 PR c++/80605 - __is_standard_layout and zero-length array
757 * class.c (check_bases): Use DECL_FIELD_IS_BASE.
759 2017-05-25 Nathan Sidwell <nathan@acm.org>
761 Kill OVL_CURRENT, OVL_NEXT.
762 * cp-tree.h (OVL_CURRENT, OVL_NEXT): Delete.
763 * name-lookup.c (set_decl_namespace): Use ovl_iterator.
764 (consider_binding_level): Use OVL_FIRST.
765 (cp_emit_debug_info_for_using): Use lkp_iterator.
766 * pt.c (check_explicit_specialization): Use ovl_iterator.
768 Kill DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS.
769 * cp-tree.h (lang_decl_ns): Remove ns_users field.
770 (DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS): Delete.
771 (TREE_INDIRECT_USING): Delete.
772 * name-lookup.h (is_associated_namespace): Delete.
773 * name-lookup.c (name_lookup::search_usings,
774 name_lookup::do_queue_usings): Usings are always direct.
775 (is_associated_namespace): Delete.
776 (handle_namespace_attrs): Use DECL_NAMESPACE_INLINE_P.
777 (namespace_ancestor_1, namespace_ancestor): Delete.
778 (push_using_directive_1, push_using_directive): Delete.
779 (add_using_namespace_1): Delete.
780 (add_using_namespace): Reimplement.
781 (emit_debug_info_using_namespace): New.
782 (finish_namespace_using_directive, finish_local_using_directive,
783 push_namespace): Adjust.
784 * tree.c (cp_free_lang_data): Remove DECL_NAMESPACE_USERS handling.
786 2017-05-25 Volker Reichelt <v.reichelt@netcologne.de>
788 * semantics.c (finish_handler_parms): Warn about non-reference type
791 2017-05-25 Nathan Sidwell <nathan@acm.org>
793 Reimplement unqualified namespace lookup.
794 * name-lookup.c (name_lookup::using_pair,
795 name_lookup::using_queue): New typedefs.
796 (name_lookup::queue_namespace, name_lookup::do_queue_usings,
797 name_lookup::queue_usings): New.
798 (name_lookup::search_unqualified): New.
799 (merge_functions, same_entity_p, ambiguous_decl,
800 unqualified_namespace_lookup_1, unqualified_namespace_lookup,
801 lookup_using_namespace): Delete.
802 (lookup_name_real_1): Adjust.
804 Reimplement qualified namespace lookup.
805 * name-lookup.c (name_lookup::flags): New member. Adjust ctor.
806 (name_lookup::ambiguous, name_lookup::add_value,
807 name_lookup::add_type, name_lookup::process_binding): New.
808 (name_lookup::search_namespace_only,
809 name_lookup::search_namespace, name_lookup::search_usings): New.
810 (name_lookup::search_qualified): New.
811 (do_nonmember_using_decl, suggest_alternatives_for,
812 lookup_qualified_name): Adjust.
813 (tree_vec_contains): Delete.
814 (qualified_lookup_using_namespace): Rename to ...
815 (qualified_namespace_lookup): ... here. Reimplement.
818 * cp-tree.h (LOOKUP_SEEN_P, LOOKUP_FOUND_P): New.
819 * name-lookup.h (lookup_arg_dependent): Return plain tree.
820 * name-lookup.c (arg_lookup, arg_assoc, arg_assoc_args,
821 arg_assoc_args_vec, arg_assoc_type, add_function,
822 arg_assoc_namespace, arg_assoc_class_only, arg_assoc_bases,
823 arg_assoc_class, arg_assoc_template_arg, arg_assoc,
824 lookup_arg_dependent_1): Delete.
825 (name_lookup): New lookup object.
826 (name_lookup::preserve_state, name_lookup::restore_state,
827 name_lookup::mark_seen, name_lookup::find_and_mark,
828 name_lookup::add_fns, name_lookup::adl_namespace_only,
829 name_lookup::adl_namespace, name_lookup::adl_class_only,
830 name_lookup::adl_bases, name_lookup::adl_class,
831 name_lookup::adl_expr, name_lookup::adl_type,
832 name_lookup::adl_template_arg, name_lookup::search_adl): New.
833 (lookup_arg_dependent): Return a plain tree. Adjust.
834 (is_associated_namespace): Move later.
836 2017-05-24 Nathan Sidwell <nathan@acm.org>
838 * friend.c (do_friend): Remove check for existing decl.
839 * name-lookup.h (lookup_name_innermost_nonclass_level): Delete.
840 * name-lookup.c (push_local_binding): Directly look for binding.
841 (lookup_name_innermost_nonclass_level_1): Delete.
842 (lookup_name_innermost_nonclass_level): Delete.
844 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Alphabetize.
846 * cp-tree.h (cp_free_lang_data): Add extern.
847 (ovl_skip_hidden, is_overloaded_fn, really_overloaded_fn): Add
849 (type_unknown_p): Return bool, make inline, lose TREE_LIST check.
850 * typeck.c (type_unknown_p): Delete.
851 * tree.c (is_overloaded_fn): Use MAYBE_BASELINE_FUNCTIONS, adjust
853 (dependent_name): Likewise.
854 (decl_anon_ns_mem_p): Simplify.
856 2017-05-24 Jonathan Wakely <jwakely@redhat.com>
859 * tree.c (reshape_init): Use unqualified type for direct enum init.
860 * typeck.c (maybe_warn_about_cast_ignoring_quals): New.
861 (build_static_cast_1, build_reinterpret_cast_1): Strip cv-quals from
862 non-class destination types.
863 (build_const_cast_1): Strip cv-quals from destination types.
864 (build_static_cast, build_reinterpret_cast, build_const_cast)
865 (cp_build_c_cast): Add calls to maybe_warn_about_cast_ignoring_quals.
867 2017-05-24 Martin Sebor <msebor@redhat.com>
870 * call.c (fully_fold_internal): Adjust.
872 2017-05-24 Nathan Sidwell <nathan@acm.org>
874 * cp-tree.h (ovl_skip_hidden): Declare.
875 * tree.c (ovl_skip_hidden): New.
876 * name-lookup.c (arg_assoc_namespace): Call ovl_skip_hidden.
877 (lookup_arg_dependent_1): Likewise.
878 (ambiguous_decl): Use DECL_HIDDEN_P, ovl_skip_hidden.
879 (hidden_name_p, remove_hidden_names): Delete.
880 (lookup_name_real_1): Do not strip hidden names.
881 * name-lookup.h (hidden_name_p, remove_hidden_names): Delete.
883 * cp-tree.h (OVL_HIDDEN_P): New.
884 (ovl_iterator::hidden_p, ovl_iterator::reveal_node): New.
885 (ovl_iterator::reveal_node): Declare.
886 * tree.c (ovl_copy): Copy OVL_HIDDEN_P.
887 (ovl_insert): Order on hiddenness.
888 (ovl_iterator::reveal_node): New.
889 * name-lookup.c (anticipated_builtin_p): New.
890 (supplement_binding_1): Use it.
891 (set_local_extern_decl_linkage): Use hidden_p.
892 (do_pushdecl): Deal with unhiding a hidden decl, use
893 anticipated_builtin_p.
894 (do_nonmember_using_decl): Use anticipated_decl_p.
895 (lookup_name_real_1): Use DECL_HIDDEN_P.
897 2017-05-23 Jason Merrill <jason@redhat.com>
899 -Wunused and C++17 structured bindings
900 * decl.c (poplevel): Don't warn about unused structured bindings,
902 * error.c (dump_simple_decl): Handle structured bindings.
903 * expr.c (mark_exp_read): Look through DECL_VALUE_EXPR.
905 2017-05-23 Nathan Sidwell <nathan@acm.org>
907 * cp-tree.h (PUSH_GLOBAL, PUSH_LOCAL, PUSH_USING): Delete.
908 * name-lookup.c (create_local_binding): New.
909 (update_binding): New.
910 (pushdecl_maybe_friend_1): Rename to ...
911 (do_pushdecl): ... this. Reimplement.
913 (push_overloaded_decl_1, push_overloaded_decl): Delete.
915 2017-05-23 Jason Merrill <jason@redhat.com>
917 PR c++/80396 - built-in for make_integer_sequence.
918 * pt.c (builtin_pack_fn_p, builtin_pack_call_p)
919 (expand_integer_pack, expand_builtin_pack_call): New.
920 (find_parameter_packs_r): Check builtin_pack_call_p.
921 (check_for_bare_parameter_packs): Handle it.
922 (tsubst_pack_expansion): Call expand_builtin_pack_call.
923 (declare_integer_pack): New.
924 (init_template_processing): Call it.
925 * decl2.c (mark_used): Check builtin_pack_fn_p.
927 2017-05-23 Nathan Sidwell <nathan@acm.org>
929 * name-lookup.c (find_namespace_binding): New.
930 (pushdecl_maybe_friend_1): Use CP_DECL_CONTEXT.
931 (set_identifier_type_value_with_scope): Use find_namespace_binding.
932 (find_binding, cp_binding_level_find_binding_for_name,
933 binding_for_name, namespace_binding_1): Delete.
934 (push_overloaded_decl_1): Use CP_DECL_CONTEXT.
935 (get_namespace_binding, set_namespace_binding,
936 finish_namespace_using_decl, unqualified_namespace_lookup_1,
937 qualified_lookup_using_namespace, lookup_type_scope_1,
938 lookup_name_innermost_nonclass_level_1): Use find_namespace_binding.
941 * parser.c (cp_parser_template_id): Keep the lookup when stashing
944 * cp-tree.h (DECL_HIDDEN_P): New.
945 * name-lookup.c (set_decl_context,
946 set_local_extern_decl_linkage): New, broken out of ...
947 (pushdecl_maybe_friend_1): ... here. Call them.
949 2017-05-23 Thomas Schwinge <thomas@codesourcery.com>
951 * parser.c (OACC_KERNELS_CLAUSE_MASK): Add
952 "PRAGMA_OACC_CLAUSE_NUM_GANGS", "PRAGMA_OACC_CLAUSE_NUM_WORKERS",
955 2017-05-23 Nathan Sidwell <nathan@acm.org>
957 * cp-tree.h (OVL_P): New.
958 * name-lookup.h (push_local_binding): Delete.
959 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
960 (finish_namespace_using_decl, finish_local_using_decl): ... here
961 * name-lookup.c (add_decl_to_level): Swap args.
962 (pop_bindings_and_leave_scope): Look inside TREE_LIST.
963 (diagnose_name_conflict): Check contexts are same for redecl.
964 (update_local_overload): New.
965 (compparms_for_decl_and_using): Rename to ...
966 (matching_fn_p): ... here.
967 (pushdecl_maybe_friend_1): Adjust add_decl_to_level,
968 push_local_bindings call.
969 (push_local_binding): Make static, replace FLAGS arg with
971 (validate_nonmember_using_decl): Use OVL_FIRST.
972 (do_nonmember_using_decl): Use in/out parameters. Use
973 lkp_iterator and simplify.
974 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
975 (finish_namespace_using_decl, finish_local_using_decl): ... here.
977 (lookup_type_current_level): Delete.
978 * parser.c (cp_parser_using_declaration): Adjust.
979 * pt.c (tsubst_expr): Adjust.
981 2017-05-22 Nathan Sidwell <nathan@acm.org>
983 * name-lookup.h (parse_using_directive): Replace with ...
984 (finish_namespace_using_directive): ... this and ...
985 (finish_local_using_directive): ... this.
986 * name-lookup.c (add_using_namespace_1): Move later.
987 (add_using_namespace): Move later, add namespace_p arg, remove
989 (push_using_directive_1): Directly recurse.
990 (do_using_directive, parse_using_directive): Delete, split into ...
991 (finish_namespace_using_directive): ... this and ...
992 (finish_local_using_directive): ... this.
993 (push_namespace): Use add_using_namespace.
994 * parser.c (cp_parser_using_directive): Call
995 finish_namespace_using_directive or finish_local_using_directive.
996 * pt.c (tsubst_expr): Call finish_local_using_directive.
998 * cp-objcp-common.c (cp_register_dumps): Register raw dumper.
999 * cp-tree.h (raw_dump_id): Declare.
1000 * decl2.c (raw_dump_id): Define.
1001 (dump_tu): Use raw_dump_id.
1003 * config-lang.in (gtfiles): Sort list, break lines.
1005 * cp-tree.h (CPTI_TERMINATE, CPTI_CALL_UNEXPECTED): Rename to ...
1006 (CPTI_TERMINATE_FN, CPTI_CALL_UNEXPECTED_FN): ... here.
1007 ( CPTI_GET_EXCEPTION_PTR_FN, CPTI_BEGIN_CATCH_FN, CPTI_END_CATCH_FN,
1008 CPTI_ALLOCATE_EXCEPTION_FN, CPTI_FREE_EXCEPTION_FN, CPTI_THROW_FN,
1009 CPTI_RETHROW_FN): New.
1010 (noexcept_deferred_spec): New.
1011 (terminate_node, call_unexpected_node): Rename to ...
1012 (terminate_fn, call_unexpected_fn): ... here.
1013 (get_exception_ptr_fn, begin_catch_fn, end_catch_fn,
1014 allocate_exception_fn, free_exception_fn, throw_fn, rethrow_fn): New.
1015 * except.c (fn1..fn5, throw_fn, rethrow_rn, spec): Delete.
1016 (init_exception_processing): Adjust.
1017 (declare_library_fn): Create and push the fns here.
1018 (do_get_exception_ptr, do_begin_catch, do_end_catch,
1019 do_allocate_exception_ptr, do_free_exception_ptr): Adjust
1020 declare_library_fn use.
1021 (unevaluated_noexcept_spec): Adjust.
1022 * cp-gimplify.c (genericize_eh_spec_block,
1023 gimplify_most_not_throw_expr): Adjust.
1025 * name-lookup.c (pushdecl_top_level,
1026 pushdecl_top_level_and_finish): Move after namespace pushing and
1028 (push_to_top_level): Rename to ...
1029 (do_push_to_top_level): ... here. Remove timing code.
1030 (pop_from_top_level_1): Rename to ...
1031 (do_pop_from_top_level): ... here.
1032 (do_push_nested_namespace, do_pop_nested_namespace)
1033 (push_to_top_level): New wrapper for do_push_to_top_level.
1034 (pop_from_top_level): Adjust.
1035 (push_nested_namepace, pop_nested_namespace): Wrappers for workers.
1037 2017-05-19 Bernd Edlinger <bernd.edlinger@hotmail.de>
1039 * config-lang.in (gtfiles): Add c-family/c-format.c,
1040 except.c, init.c, lambda.c and friend.c.
1041 * class.c (dvirt_fn): Move out of function scope,
1043 * except.c (fn1-5, throw_fn, rethrow_fn, spec): Likewise.
1044 * init.c (fn): Likewise.
1045 * lambda.c (ptr_id, max_id): Likewise.
1046 * friend.c (global_friend): Add GTY attribute.
1048 2017-05-19 Nathan Sidwell <nathan@acm.org>
1050 * call.c (add_list_candidates): Use OVL_FIRST.
1051 (build_new_method_call_1): Likewise.
1052 * cp-tree.h (OVL_SINGLE_P): New.
1053 (TYPE_HIDDEN_P): New.
1054 * decl.c (xref_tag_1): Use TYPE_HIDDEN_P.
1055 * dump.c (cp_tump_tree): Adjust overload dumping.
1056 * error.c (dump_decl): Use OVL_SINGLE_P, simplify context
1058 * method.c (lazily_declare_fn): Assert we added it.
1059 * parser.c (cp_parser_nested_name_specifier): Use OVL_SINGLE_P,
1061 (cp_parser_template_name): Use lkp_iterator.
1062 * pt.c (begin_template_parm_list): Fixup comment.
1063 (instantiate_class_template_1): Use TYPE_HIDDEN_P.
1064 * tree.c (ovl_iterator::remove_node): Cope with inherited ctors.
1065 (ovl_scope): Use lkp_iterator.
1067 2017-05-19 Thomas Schwinge <thomas@codesourcery.com>
1069 * parser.c (cp_parser_omp_clause_default): Handle
1070 "OMP_CLAUSE_DEFAULT_PRESENT".
1072 * parser.c (cp_parser_omp_clause_default): Avoid printing more
1073 than one syntax error message.
1075 2017-05-19 Nathan Sidwell <nathan@acm.org>
1077 * class.c (class_dump_id): Define.
1078 (dump_class_hierarchy, dump_vtable, dump_vtt): Use it.
1079 * cp-objcp-common.c (cp_register_dumps): New.
1080 * cp-objcp-common.h (cp_register_dumps): Declare.
1081 (LANG_HOOKS_REGISTER_DUMPS): Override.
1082 * cp-tree.h (class_dump_id): Declare.
1084 2017-05-18 Nathan Sidwell <nathan@acm.org>
1086 * cp-tree.h (OVL_ARG_DEPENDENT): Delete.
1088 (lookup_keep): Declare.
1089 * name-lookup.c (add_function): Don't set OVL_ARG_DEPENDENT.
1090 * pt.c (tsubst_copy): Assert lookup is persistent.
1091 * semantics.c (finish_call_expr): Use lkp_iterator, call
1093 * tree.c (ovl_copy): New.
1094 (ovl_insert, ovl_iterator::remove_node): Copy immutable nodes.
1097 * cp-tree.h (OVL_USED): Replace with ...
1098 (OVL_USING_P): ... this.
1099 (ovl_iterator::using_p): Adjust.
1100 * name-lookup.c (push_overloaded_decl_1,
1101 do_nonmember_using_decl): Adjust.
1102 * search.c (lookup_field_r): Adjust.
1103 * tree.c (ovl_insert, ovl_scope): Adjust.
1105 * cp-tree.h (lookup_add): Swap args.
1106 (ovl_cons, build_overload): Delete.
1107 * name-lookup.c (add_function, push_overloaded_decl_1,
1108 do_nonmember_using_decl, merge_functions, remove_hidden_names):
1109 Use lookup_add, ovl_insert.
1110 * pt.c (check_explicit_specialization): Use lookup_add.
1111 (do_class_deduction): Likewise. Refactor if.
1112 * tree.c (lookup_add): Swap args.
1113 (ovl_cons, build_overload): Delete.
1115 * name-lookup.c (find_local_binding): New, broken out of ...
1116 (lookup_name_innermost_nonclass_level_1): ... here. Call it.
1117 (set_namespace_binding): Swap scope & name args.
1118 (namespace_binding_1): Likewise.
1119 (pushdecl_maybe_friend_1): Adjust set_namespace_binding call.
1120 (push_overloaded_decl_1): Likewise.
1121 (set_global_binding): Likewise.
1122 (get_namespace_binding): Adjust namespace_binding_1 call.
1124 2017-05-17 Nathan Sidwell <nathan@acm.org>
1126 * cp-tree.h (default_hash_traits <lang_identifier *>): New
1128 * name-lookup.c (lookup_extern_c_fun_in_all_ns): Delete.
1129 (extern_c_fns): New hash table.
1130 (check_extern_c_conflict): New, broken out of ...
1131 (pushdecl_maybe_friend_1): ... here. Call it.
1132 (c_linkage_bindings): Just look in hash table.
1134 2017-05-17 Ville Voutilainen <ville.voutilainen@gmail.com>
1138 Implement new C++ intrinsics __is_assignable and __is_constructible.
1139 * cp-tree.h (CPTK_IS_ASSIGNABLE, CPTK_IS_CONSTRUCTIBLE): New.
1141 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
1142 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
1143 * method.c (constructible_expr): Set cp_unevaluated.
1144 (is_xible_helper): New.
1145 (is_trivially_xible): Adjust.
1147 * parser.c (cp_parser_primary_expression): Handle
1148 RID_IS_ASSIGNABLE and RID_IS_CONSTRUCTIBLE.
1149 (cp_parser_trait_expr): Likewise.
1150 * semantics.c (trait_expr_value): Handle
1151 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
1153 2017-05-17 Nathan Sidwell <nathan@acm.org>
1155 * cp-tree.h (ovl_iterator::using_p): New predicate.
1156 (ovl_iterator::remove_node): New worker.
1157 (ovl_insert): Declare.
1158 * tree.c (ovl_insert): New.
1159 (ovl_iterator::remove_node): New.
1160 * class.c (add_method): Use ovl_iterator, ovl_insert.
1161 (clone_function_decl): Fix description.
1162 (clone_constructors_and_destructors): Use ovl_iterator.
1164 * class.c (handle_using_decl): Use OVL_FIRST, ovl_iterator.
1165 (maybe_warn_about_overly_private_class): Use ovl_iterator.
1166 (method_name_cmp, resort_method_name_cmp): Use OVL_NAME.
1167 (resort_type_method_vec, finish_struct_methods): Use OVL_FIRST.
1168 (get_base_fndecls): Use ovl_iterator.
1169 (warn_hidden): Use OVL_NAME, ovl_iterator.
1170 (add_implicitly_declared_members): Use ovl_iterator.
1171 * constraint.cc (normalize_template_id_expression): Use OVL_FIRST,
1173 (finish_shorthand_constraint): Simplify, use ovl_make.
1174 * pt.c (make_constrained_auto): Simplify. Use ovl_make.
1175 * search.c (shared_member_p): Use ovl_iterator.
1176 (lookup_field_fuzzy_info::fuzzy_lookup_fn): Use OVL_NAME.
1177 (lookup_conversion_operator): Use OVL_FIRST.
1178 (lookup_fnfiels_idx_nolazy): Use OVL_FIRST, OVL_NAME.
1179 (look_for_overrides_here): Use ovl_iterator.
1180 (lookup_conversions_r): Use OVL_FIRST, OVL_NAME, ovl_iterator.
1181 * typeck.c (build_x_unary_op): Use ovl_make.
1183 2017-05-17 Martin Liska <mliska@suse.cz>
1185 * class.c (dump_class_hierarchy): Introduce dump_flags_t type and
1186 use it instead of int type.
1187 (dump_vtable): Likewise.
1188 (dump_vtt): Likewise.
1189 * decl2.c (dump_tu): Likewise.
1191 2017-05-16 David Malcolm <dmalcolm@redhat.com>
1193 * call.c (enforce_access): Add access_failure_info * param and use
1194 it to record access failures.
1195 * cp-tree.h (class access_failure_info): New class.
1196 (enforce_access): Add access_failure_info * param, defaulting to
1198 (lookup_member): Likewise.
1199 (locate_field_accessor): New function decl.
1200 (perform_or_defer_access_check): Add access_failure_info * param,
1202 * search.c (lookup_member): Add access_failure_info * param and
1203 pass it on to call to perform_or_defer_access_check.
1204 (matches_code_and_type_p): New function.
1205 (field_access_p): New function.
1206 (direct_accessor_p): New function.
1207 (reference_accessor_p): New function.
1208 (field_accessor_p): New function.
1209 (struct locate_field_data): New struct.
1210 (dfs_locate_field_accessor_pre): New function.
1211 (locate_field_accessor): New function.
1212 * semantics.c (perform_or_defer_access_check): Add
1213 access_failure_info * param, and pass it on to call to
1215 * typeck.c (access_failure_info::record_access_failure): New method.
1216 (access_failure_info::maybe_suggest_accessor): New method.
1217 (finish_class_member_access_expr): Pass an access_failure_info
1218 instance to the lookup_member call, and call its
1219 maybe_suggest_accessor method afterwards.
1221 2017-05-16 Marek Polacek <polacek@redhat.com>
1225 * cp-gimplify.c (cp_fold): Handle SAVE_EXPR.
1227 2017-05-16 Nathan Sidwell <nathan@acm.org>
1229 * name-lookup.c (check_local_shadow): New, broke out of ...
1230 (pushdecl_maybe_friend_1): ... here. Call it.
1232 * cp-tree.h (OVL_NESTED_P, OVL_LOOKUP_P): New.
1233 (ovl_first): Move inline definition to end of file.
1234 (ovl_make, lookup_add): Declare.
1235 (get_fns, get_first_fn): Make pure.
1236 * tree.c (ovl_cache): New.
1237 (ovl_make, lookup_add): New.
1238 * pt.c (do_class_deduction): Don't add candidates that will be
1241 * call.c (build_user_type_conversion_1): Use OVL_FIRST.
1242 (print_error_for_call_failure): Use OVL_NAME.
1243 (build_op_call_1): Use ovl_iterator.
1244 (add_candidates): Use OVL_FIRST & lkp_iterator.
1245 (build_op_delete_call): Use MAYBE_BASELINK_FUNCTIONS &
1247 * class.c (deduce_noexcept_on_destructors): Use ovl_iterator.
1248 (type_has_user_nondefault_constructor,
1249 in_class_defaulted_default_constructor,
1250 type_has_user_provided_constructor,
1251 type_has_user_provided_or_explicit_constructor,
1252 type_has_non_user_provided_default_constructor,
1253 vbase_has_user_provided_move_assign,
1254 type_has_move_constructor, type_has_move_assign,
1255 type_has_user_declared_move_constructor,
1256 type_has_user_declared_move_assign,
1257 type_build_ctor_call, type_build_dtor_call,
1258 type_requires_array_cookie, explain_non_literal_class): Likewise.
1259 (finish_struct): Use lkp_iterator.
1260 (resolve_address_of_overloaded_function): Use OVL_NAME, lkp_iterator.
1261 (note_name_declared_in_class): Use OVL_NAME.
1262 * cxx-pretty-print.c (pp_cxx_unqualified_id): Use OVL_FIRST.
1263 (pp_cxx_qualified_id, cxx_pretty_printer::id_expression,
1264 cxx_pretty_printer::expression): Likewise.
1265 * decl2.c (check_classfn): Use ovl_iterator.
1266 * pt.c (retrieve_specialization): Use ovl_iterator.
1267 * tree.c (cp_tree_equal): Use lkp_iterator.
1268 (type_has_nontrivial_copy_init): Use ovl_iterator.
1270 * typeck2.c (cxx_incomplete_type_diagnostic): Revert change and
1271 check is_overloaded_fn.
1273 2017-05-16 Martin Liska <mliska@suse.cz>
1275 * parser.c (cp_lexer_print_token): Add default value for flags
1276 argument of print_gimple_stmt, print_gimple_expr,
1277 print_generic_stmt and print_generic_expr.
1279 2017-05-16 Nathan Sidwell <nathan@acm.org>
1281 * cp-tree.h (class ovl_iterator, class lkp_iterator): New OVERLOAD
1283 (MAYBE_BASELINK_FUNCTIONS): New.
1284 * constraint.cc (resolve_constraint_check): Use lkp_iterator.
1285 * decl2.c (maybe_warn_sized_delete): Use ovl_iterator.
1286 * lambda.c (maybe_generic_this_capture): Use lkp_iterator.
1287 * method.c (inherited_ctor_binfo): Use ovl_iterator.
1288 (binfo_inherited_from): Likewise.
1289 * parser.c (lookup_literal_operator): Use lkp_iterator.
1290 * pt.c (iterative_hash_template_arg): Use lkp_iterator.
1291 (print_candidates_1): Likewise.
1292 (determine_specialization): Likewise.
1293 (resolve_overloaded_unification): Likewise.
1294 (resolve_nondeduced_context): Likewise.
1295 (type_dependent_expression_p): Likewise.
1296 (dependent_template_p): Likewise.
1297 * ptree.c (cxx_print_xnode): Likewise.
1298 * semantics.c (omp_reduction_lookup): Use lkp_iterator.
1299 (classtype_has_nothrow_assign_or_copy_p): Use ovl_iterator.
1300 * typeck.c (check_template_keyword): Use lkp_iterator.
1302 * cp-tree.h (OVL_FIRST, OVL_NAME): New.
1304 * constexpr.c (function_concept_check): Use OVL_FIRST.
1305 * cvt.c (build_expr_type_conversion): Likewise.
1306 * decl.c (poplevel, grokdeclarator): Use OVL_NAME.
1307 * decl2.c (mark_used): Use OVL_FIRST.
1308 * error.c (dump_decl): Use OVL_FIRST, OVL_NAME.
1309 (dump_expr, location_of): Use OVL_FIRST.
1310 * friend.c (do_friend): Use OVL_NAME.
1311 * init.c (build_offset_ref): Use OVL_FIRST.
1312 * mangle.c (write_member_name): Likewise.
1313 (write_expression): Use OVL_NAME.
1314 * method.c (strip_inheriting_ctors): Use OVL_FIRST.
1315 * name-lookup.c (pushdecl_class_level): Use OVL_NAME.
1316 * pt.c (check_explicit_specialization): Use OVL_FIRST.
1317 (check_template_shadow): Likewise.
1318 (tsubst_template_args): Use OVL_NAME.
1319 (tsubst_baselink): Use OVL_FIRST.
1320 * semantics.c (perform_koenig_lookup): Use OVL_NAME.
1321 * tree.c (get_first_fn): Use OVL_FIRST.
1322 * typeck.c (finish_class_member_access_expr): Use OVL_NAME.
1323 (cp_build_addr_expr_1): Use OVL_FIRST.
1325 * pt.c (tsubst_copy_and_build): Remove unnecessary COMPONENT_REF
1327 * semantics.c (finish_id_expression): Directly init local var.
1328 (finish_omp_reduction_clause): Use really_overloaded_fn.
1329 * tree.c (get_fns): Document. Assert we got an overload.
1330 (get_first_fn) Document.
1331 * typeck.c (cp_build_addr_expr_1): Pass arg directly to
1332 really_overloaded_fn.
1333 * typeck2.c (cxx_incomplete_type_diagnostic): Use get_first_fn directly.
1335 * cp-tree.h (SCOPE_DEPTH): New.
1336 * name-lookup.h (is_nested_namespace): Declare.
1337 * name-lookup.c (is_nested_namespace): New.
1338 (is_ancestor): Use it.
1339 (set_decl_namespace): Likewise.
1340 (push_namespace): Set SCOPE_DEPTH.
1341 * pt.c (check_specialization_namespace): Use is_nested_namespace.
1342 (check_unqualigied_spec_or_inst): Likewise.
1344 2017-05-15 Nathan Sidwell <nathan@acm.org>
1347 * cp-tree.h (DECL_NAMESPACE_INLINE_P): New.
1348 * name-lookup.h (push_namespace): Return int, add make_inline arg.
1349 * name-lookup.c (push_namespace): Deal with inline directly.
1350 Return pushed count.
1351 * parser.c (cp_parser_namespace_definition): Adjust for
1352 push_namespace change.
1354 2017-05-11 Nathan Sidwell <nathan@acm.org>
1356 * cp-lang.c (get_global_decls, cxx_pushdecl, LANG_HOOK_GETDECLS,
1357 LANG_HOOKS_PUSHDECL): Move to ...
1358 * cp-objcp-common.c (cp_get_global_decls, cp_pushdec,
1359 LANG_HOOK_DECLS, LANG_HOOKS_PUSHDECL): ... here.
1360 * cp-objcp-common.h (cp_get_global_decls, cp_pushdecl): Declare.
1362 * name-lookup.h (pushdecl): Add default friend parm.
1363 (pushdecl_maybe_friend): Delete.
1364 (pushdecl_top_level): Add default friend parm.
1365 (pushdecl_top_level_maybe_friend): Delete.
1366 * name-lookup.c (pushdecl_maybe_friend): Delete.
1367 (pushdecl): Add is_friend parm.
1368 (pushdecl_top_level): Add is friend_parm.
1369 (pushdecl_top_level_maybe_friend, pushdecl_top_level_1): Delete.
1370 (pushdecl_top_level_and_finish): Do pushing and finishing directly.
1371 * friend.c (do_friend): Adjust.
1372 * pt.c (tsubst_friend_class): Adjust.
1374 Revert pushdecl_top_level_and_finish name change.
1375 * name-lookup.h (pushdecl_top_level_and_finish): Resurrect old name.
1376 * name-lookup.c (pushdecl_top_level_and_finish): Likewise.
1377 * decl.c (cp_make_fname_decl): Adjust.
1378 * decl2.c (get_guard, handle_tls_init): Adjust.
1379 * rtti.c (get_tinfo_decl, tinfo_base_init): Adjust.
1381 * name-lookup.c (pushdecl_outermost_localscope): Always
1382 conditionally stop timer.
1384 * decl.c (xref_tag_1): Don't frob ts_lambda scope here.
1385 * name-lookup.c (pushtag_1): Deal with ts_lambda scope.
1387 * cp-tree.h (pushdecl, pushdecl_maybe_friend, pushtag,
1388 pushtag_top_level_maybe_friend,
1389 pushdecl_top_level_and_finish): Move declarations to ...
1390 * name-lookup.h: ... here. Group pushdecl variants.
1391 (pushdecl_top_level_and_finish): Rename to ...
1392 (pushdecl_top_level_with_init): ... here.
1393 * decl.c (cp_make_fname_decl): Use pushdecl_top_level_with_init.
1394 * decl2.c (get_guard, handle_tls_init): Likewise.
1395 * rtti.c (get_tinfo_decl, tinfo_base_init): Likewise.
1396 * lambda.c (maybe_add_lambda_conv_op): Use namespace_bindings_p.
1397 * method.c (implicitly_declare_fn): Likewise.
1398 * searchc (node_debug_info_needed): Likewise.
1399 * name-lookup.c (pushdecl_top_level_and_finish): Rename to ...
1400 (pushdecl_top_level_with_init): ... here.
1401 (pop_everything): Use namespace_bindings_p.
1403 * name-lookup.h (pop_binding): Rename to pop_local_binding.
1404 (getdecls): Rename to get_local_decls.
1405 * name-lookup.c (pop_binding): Rename to ...
1406 (pop_local_binding): ... here.
1407 (pop_bindings_and_leave_scope): Adjust.
1408 (getdecls): Rename to ...
1409 (get_local_decls): ... here. Assert local scope.
1410 * decl.c (poplevel): Assert not namespace. Adjust and simplify
1412 (store_parm_decls): Adjust get_local_decls call.
1413 (parser.c (synthesize_implicit_template_parm): Likewise.
1415 2017-05-11 Ville Voutilainen <ville.voutilainen@gmail.com>
1418 * method.c (is_trivially_xible): Reject void types.
1420 2017-05-10 Nathan Sidwell <nathan@acm.org>
1422 * class.c (handle_using_decl): Always use OVL_CURRENT.
1423 (resolve_address_of_overloaded_function): Move iterator decl into
1424 for scope. Don't strip anticipated decls here.
1426 * pt.c (print_candidates_1): Separate TREE_LIST and OVERLOAD
1428 (print_candidates): Adjust.
1430 * cp-tree.h (build_new_function_call): Lose koenig_p arg. Fix
1432 * call.c (build_new_function_call): Lose koenig_p arg. Remove
1433 koenig_p handling here.
1434 * pt.c (push_template_decl_real): Unconditionally retrofit_lang_decl.
1435 (tsubst_omp_clauses): Likewise.
1436 (do_class_deduction): Adjust buld_new_function_call calls.
1437 * semantics.c (finish_call_expr): Likewise.
1439 2017-05-10 Jason Merrill <jason@redhat.com>
1441 * pt.c (unify_parameter_deduction_failure, unify_cv_qual_mismatch)
1442 (unify_type_mismatch, unify_parameter_pack_mismatch)
1443 (unify_ptrmem_cst_mismatch, unify_expression_unequal)
1444 (unify_parameter_pack_inconsistent, unify_inconsistency)
1445 (unify_vla_arg, unify_method_type_error, unify_arity)
1446 (unify_arg_conversion, unify_no_common_base)
1447 (unify_inconsistent_template_template_parameters)
1448 (unify_template_deduction_failure)
1449 (unify_template_argument_mismatch)
1450 (unify_overload_resolution_failure): Call unify_invalid.
1452 CWG 1847 - Clarifying compatibility during partial ordering
1453 * pt.c (more_specialized_fn): No order between two non-deducible
1456 * pt.c (dependent_type_p): Make sure we aren't called with
1459 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
1460 * pt.c (convert_template_argument): Just return an argument pack.
1461 (coerce_template_parameter_pack, template_parm_to_arg)
1462 (extract_fnparm_pack, make_argument_pack, tsubst_template_args)
1463 (tsubst_decl, tsubst, type_unification_real, unify_pack_expansion):
1464 Don't set the type of a NONTYPE_ARGUMENT_PACK.
1465 * parser.c (make_char_string_pack, make_string_pack): Likewise.
1467 2017-05-10 Nathan Sidwell <nathan@acm.org>
1469 * cp-tree.h (add_method, clone_function_decl): Change last arg to
1471 * class.c (add_method): Change third arg to bool. Adjust.
1472 (one_inheriting_sig, one_inherited_ctor): Adjust.
1473 (clone_function_decl): Change 2nd arg to bool. Adjust.
1474 (clone_constructors_and_destructors): Adjust.
1475 * lambda.c (maybe_add_lambda_conv_op): Adjust.
1476 * method.c (lazily_declare_fn): Adjust.
1477 * pt.c (tsubst_decl, instantiate_template_1): Adjust.
1478 * semantics.c (finish_member_declaration): Adjust.
1480 2017-05-10 Paolo Carlini <paolo.carlini@oracle.com>
1483 * decl.c (finish_function): To improve error recovery, change the
1484 logic for calling apply_deduced_return_type.
1486 2017-05-09 Jason Merrill <jason@redhat.com>
1488 PR c++/80605 - __is_standard_layout and empty base
1489 * class.c (check_bases): Ignore empty bases.
1491 PR c++/70979 - literal class and closure types
1492 * class.c (finalize_literal_type_property): Handle closures
1494 (explain_non_literal_class): Likewise.
1496 PR c++/66297, DR 1684 - literal class and constexpr member fns
1497 * constexpr.c (is_valid_constexpr_fn): Only complain about
1498 non-literal enclosing class in C++11.
1499 * class.c (finalize_literal_type_property): Likewise.
1501 2017-05-09 Paolo Carlini <paolo.carlini@oracle.com>
1504 * pt.c (tsubst_decl): Early return error_mark_node if
1505 grok_ctor_properties returns false.
1507 2017-05-09 Jason Merrill <jason@redhat.com>
1509 PR c++/70167 - array prvalue treated as lvalue
1510 * cp-tree.h (CONSTRUCTOR_C99_COMPOUND_LITERAL): New.
1512 * semantics.c (finish_compound_literal): Add fcl_context parameter.
1513 Only make a static variable for C99 syntax.
1514 * parser.c (cp_parser_postfix_expression): Pass it.
1515 * pt.c (tsubst_copy_and_build): Likewise.
1516 * call.c (extend_ref_init_temps): Set
1517 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
1519 2017-05-09 Nathan Sidwell <nathan@acm.org>
1521 * cp-lang.c (get_global_decls, cxx_pushdecl): New.
1522 (LANG_HOOKS_GETDECLS, LANG_HOOKS_PUSHDECL): Override.
1523 * name-lookup.h (pushdecl_top_level): Declare.
1525 2017-05-08 Jason Merrill <jason@redhat.com>
1527 PR c++/80178 - parameter passing for uncopyable classes
1528 * tree.c (type_has_nontrivial_copy_init): True for classes with only
1529 deleted copy/move ctors.
1530 (remember_deleted_copy, maybe_warn_parm_abi): New.
1531 * decl.c (require_complete_types_for_parms, check_function_type):
1532 Call maybe_warn_parm_abi.
1533 * call.c (convert_for_arg_passing, build_cxx_call): Likewise.
1535 2017-05-08 Nathan Sidwell <nathan@acm.org>
1537 * decl.c (builtin_function_1): Set DECL_ANTICIPATED before pushing.
1538 (start_preparsed_function): Do decl pushing before setting
1539 current_funciton_decl and announcing it.
1541 * name-lookup.h (pushdecl_with_scope): Replace with ...
1542 (pushdecl_outermost_localscope): ... this.
1543 * name-lookup.c (pushdecl_with_scope): Replace with ...
1544 (pushdecl_outermost_localscope): ... this.
1545 (pushdecl_namespace_level): Adjust.
1546 * decl.c (cp_make_fname_decl): Use pushdecl_outermost_localscope.
1547 * lambda.c (insert_capture_proxy): Likewise.
1549 * class.c (build_vtbl_initializer): Don't shadow outer variable
1552 Revert _binding -> _value change.
1553 * name-lookup.h (get_namespace_value, set_global_value): Rename to ...
1554 (get_namespace_binding, set_global_binding): ... these.
1555 * name-lookup.c (get_namespace_value, set_global_value): Rename to ...
1556 (get_namespace_binding, set_global_binding): ... these.
1557 (arg_assoc_namespace, pushdecl_maybe_friend_1,
1558 check_for_out_of_scope_variable, push_overloaded_decl_1,
1559 lookup_name_innermost_nonclass_level, push_namespace): Adjust.
1560 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
1561 SET_IDENTIFIER_GLOBAL_VALUE): Adjust.
1562 * decl.c (poplevel): Adjust.
1563 * pt.c (make_constrained_auto): Likewise.
1565 2017-05-07 Volker Reichelt <v.reichelt@netcologne.de>
1567 PR translation/80280
1568 * call.c (print_z_candidate): Fix quoting.
1570 2017-05-05 David Malcolm <dmalcolm@redhat.com>
1572 * error.c (pedwarn_cxx98): Replace report_diagnostic
1573 with diagnostic_report_diagnostic.
1575 2017-05-05 Nathan Sidwell <nathan@acm.org>
1577 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value.
1578 (SET_IDENTIFIER_GLOBAL_VALUE): Use set_global_value.
1579 (IDENTIFIER_NAMESPACE_VALUE): Delete.
1580 * name-lookup.h (namespace_binding, set_namespace_binding): Replace
1582 (get_namespace_value, set_global_value): ... these.
1583 (get_global_value_if_present, is_typename_at_global_scope): Delete.
1584 * decl.c (poplevel): Use get_namespace_value.
1585 (grokdeclarator): Use IDENTIFIER_GLOBAL_VALUE.
1586 * class.c (build_vtbl_initializer): Stash library decl in
1587 static var. Use IDENTIFIER_GLOBAL_VALUE.
1588 * except.c (do_get_exception_ptr, do_begin_catch, do_end_catch,
1589 do_allocate_exception, do_free_exception, build_throw): Likewise.
1590 * init.c (throw_bad_array_new_length): Likewise.
1591 * rtti.c (throw_bad_cast, throw_bad_typeid): Likewise.
1592 * name-lookup.c (arg_assoc_namespace, pushdecl_maybe_friend_1,
1593 check_for_our_of_scope_variable, push_overloaded_decl_1): Use
1594 get_namespace_value.
1595 (set_namespace_binding_1): Rename to
1596 (set_namespace_binding): ... here.
1597 (set_global_value): New.
1598 (lookup_name_innermost_nonclass_level_1, push_namespace): Use
1599 get_namespace_value.
1600 * pt.c (listify): Use get_namespace_value.
1602 * call.c (make_temporary_var_for_ref_to_temp): Push decl into
1604 * lex.c (unqualified_name_lookup_error): Likewise.
1606 * class.c (alter_class): Use retrofit_lang_decl directly.
1607 * decl.c (push_local_name, dupliate_decls): Likewise.
1608 * semantics.c (omp_privatize_field): Likewise.
1610 Kill walk_namespaces.
1611 * cp-tree.h (walk_namespaces_fn, walk_namespaces): Delete.
1612 * decl.c (walk_namespaces_r, walk_namespaces): Delete.
1614 Kill per-namespace static_decls.
1615 * cp-tree.h (static_decls): Declare.
1616 (wrapup_globals_for_namespace,
1617 diagnose_inline_vars_for_namespace): Replace with ...
1618 (wrapup_namespace_globals): ... this.
1619 * decl.c (static_decls): Define.
1620 (wrapup_globals_for_namespace,
1621 diagnose_inline_vars_for_namespace): Replace with ...
1622 (wrapup_namespace_globals): ... this.
1623 (cxx_init_decl_processing): Initialize static_decls.
1624 * decl2.c (c_parse_final_cleanups): Adjust.
1625 * name-lookup.h (cp_binding_level): Remove static_decls member.
1626 * name-lookup.c (add_decl_to_level): Adjust.
1627 (begin_scope): Adjust.
1629 2017-05-05 Paolo Carlini <paolo.carlini@oracle.com>
1632 * decl.c (reshape_init): Unconditionally return error_mark_node
1633 upon error about too many initializers.
1635 2017-05-04 Nathan Sidwell <nathan@acm.org>
1637 * constraint.cc (diagnose_check_constraint): Fix %E thinko.
1639 2017-05-04 Martin Sebor <msebor@redhat.com>
1641 PR translation/80280
1642 * call.c (print_z_candidate): Add missing quoting to %D and other
1644 (build_op_call_1): Same.
1645 * constraint.cc (diagnose_check_constraint): Same.
1646 * mangle.c (mangle_decl): Same.
1647 * name-lookup.c (cp_binding_level_debug): Same.
1648 (set_decl_namespace): Same.
1649 * parser.c (cp_parser_tx_qualifier_opt): Same.
1650 * pt.c (print_candidates_1): Same.
1651 (check_template_variable): Same.
1652 (tsubst_default_argument): Same.
1653 (most_specialized_partial_spec): Same.
1654 * semantics.c (omp_reduction_lookup): Same.
1655 * tree.c (check_abi_tag_redeclaration): Same.
1656 * typeck.c (comptypes): Same.
1657 * typeck2.c (abstract_virtuals_error_sfinae): Same.
1659 2017-05-04 Nathan Sidwell <nathan@acm.org>
1662 * cp-tree.h (enum cp_tree_index): Add CPTI_GLOBAL,
1663 CPTI_GLOBAL_TYPE, CPTI_GLOBAL_IDENTIFIER, CPTI_ANON_IDENTIFIER,
1664 CPTI_INIT_LIST_IDENTIFIER.
1665 (global_namespace, global_type_node, global_identifier,
1666 anon_identifier, init_list_identifier): New.
1667 * decl.c (global_type_node, global_scope_name): Delete.
1668 (initialize_predefined_identifiers): Add new identifiers.
1669 (cxx_init_decl_processing): Adjust.
1670 * name-lookup.h (global_namespace, global_type_node): Delete.
1671 * name-lookup.c (global_namespace, anonymous_namespace_name,
1672 get_anonymous_namespace_name): Delete.
1673 (namespace_scope_ht_size, begin_scope, pushtag_1,
1674 push_namespace): Adjust,
1675 * call.c (type_has_extended_temps): Use init_list_identifier.
1676 * pt.c (listify): Likewise.
1678 * name-lookup.c: Reorder functions to make merging from modules
1681 2017-05-03 Jason Merrill <jason@redhat.com>
1683 * constexpr.c (cxx_eval_outermost_constant_expr): Use TV_CONSTEXPR.
1685 2017-05-03 Nathan Sidwell <nathan@acm.org>
1687 * cp-tree.h (enum cp_tree_index, cp_global_trees): Move earlier,
1688 along with #defines, to before name-lookup include.
1690 2017-05-02 Paolo Carlini <paolo.carlini@oracle.com>
1692 * pt.c (is_auto_or_concept): Remove.
1693 (type_uses_auto_or_concept): Remove, unused.
1694 (find_parameter_packs_r, extract_autos_r, is_auto_r): Adjust.
1695 * parser.c (tree_type_is_auto_or_concept): Remove, unused.
1696 * cp-tree.h (is_auto_or_concept): Remove.
1698 2017-05-01 Xi Ruoyao <ryxi@stu.xidian.edu.cn>
1701 * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Don't
1702 add pedigree operation and detach call here.
1703 * cp-gimplify.c (cp_gimplify_expr): Remove the calls to
1704 cilk_cp_gimplify_call_params_in_spawned_fn.
1705 (cilk_cp_gimplify_call_params_in_spawned_fn): Remove function.
1706 * semantics.c (simplify_aggr_init_expr): Copy EXPR_CILK_SPAWN.
1708 2017-04-29 Volker Reichelt <v.reichelt@netcologne.de>
1710 * parser.c (cp_parser_member_declaration): Add fix-it hints for
1711 stray comma and missing semicolon at end of member declaration.
1713 2017-04-27 Volker Reichelt <v.reichelt@netcologne.de>
1715 * parser.c (cp_parser_cast_expression): Add target type of cast to
1717 * error.c (type_to_string): Add '{enum}' suffix to enumeration types.
1719 2017-04-26 Paolo Carlini <paolo.carlini@oracle.com>
1721 * decl.c (grok_ctor_properties, ambi_op_p, unary_op_p): Change
1722 return type to bool.
1723 * cp-tree.h (grok_ctor_properties): Update.
1725 2017-04-26 Volker Reichelt <v.reichelt@netcologne.de>
1727 * parser.c (cp_parser_nested_name_specifier_opt): Add fix-it
1728 information to diagnostic of invalid colon in nested-name-specifier.
1730 2017-04-25 Volker Reichelt <v.reichelt@netcologne.de>
1732 * parser.c (cp_parser_elaborated_type_specifier): Add fix-it to
1733 diagnostic of invalid class/struct keyword after enum.
1735 2017-04-25 David Malcolm <dmalcolm@redhat.com>
1737 * parser.c (cp_parser_member_declaration): Add fix-it hint
1738 for removing stray semicolons.
1740 2017-04-25 David Malcolm <dmalcolm@redhat.com>
1742 * name-lookup.c (get_std_name_hint): New function.
1743 (maybe_suggest_missing_header): New function.
1744 (suggest_alternative_in_explicit_scope): Call
1745 maybe_suggest_missing_header.
1747 2017-04-25 David Malcolm <dmalcolm@redhat.com>
1750 * name-lookup.c (suggest_alternative_in_explicit_scope): Convert
1751 candidate type of bm from tree to const char *.
1752 (consider_binding_level): Likewise.
1753 (lookup_name_fuzzy): Likewise, using this to merge the best
1754 result from the preprocessor into bm, rather than immediately
1755 returning, so that better matches from reserved words can "win".
1756 Guard the rejection of keywords that don't start decl-specifiers
1757 so it only happens for FUZZY_LOOKUP_TYPENAME.
1759 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
1761 * decl.c (grokdeclarator): Use %qT instead of %<%T%> in diagnostics.
1762 (start_enum): Likewise.
1763 (build_enumerator): Likewise. Use %qE instead of plain %E.
1764 * parser.c (cp_parser_mem_initializer_list): Use %qD instead of
1765 %<%D%> in diagnostics.
1766 (cp_parser_elaborated_type_specifier): Likewise.
1767 * pt.c (make_pack_expansion): Use %qT and %qE instead of
1768 %<%T%> and %<%E%> in diagnostics.
1769 (tsubst_pack_expansion): Likewise.
1771 2017-04-24 David Malcolm <dmalcolm@redhat.com>
1774 * parser.c (cp_parser_unary_expression): Generate a location
1775 range for alignof and sizeof expressions.
1777 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
1779 * parser.c (cp_parser_cv_qualifier_seq_opt): Add fix-it info to
1781 (cp_parser_virt_specifier_seq_opt): Likewise.
1782 (set_and_check_decl_spec_loc): Likewise twice.
1784 2017-04-21 Jason Merrill <jason@redhat.com>
1786 PR c++/80179 - ICE with initialized flexible array member.
1787 * constexpr.c (verify_ctor_sanity): Handle flexible array members.
1789 2017-04-21 Richard Biener <rguenther@suse.de>
1791 * cp-tree.h (copy_decl): Annotate with CXX_MEM_STAT_INFO.
1792 (copy_type): Likewise.
1793 * lex.c (copy_decl): Pass down mem-stat info.
1794 (copy_type): Likewise.
1796 2017-04-20 Jonathan Wakely <jwakely@redhat.com>
1799 * init.c (build_new_1): Suppress notes about over-aligned new when
1800 the warning is suppressed.
1802 2017-04-20 Volker Reichelt <v.reichelt@netcologne.de>
1804 * parser.c (cp_parser_member_declaration): Add warning with fixit
1805 information for extra semicolon after in-class function definition.
1807 2017-04-20 Jakub Jelinek <jakub@redhat.com>
1810 * tree.c (build_cplus_array_type): Call build_array_type
1811 with the intended TYPE_TYPELESS_STORAGE flag value, instead
1812 of calling build_array_type and modifying later TYPE_TYPELESS_STORAGE
1815 2017-04-18 Marek Polacek <polacek@redhat.com>
1817 PR c++/80244 - ICE with attribute in template alias.
1818 * tree.c (strip_typedefs): Handle UNDERLYING_TYPE.
1820 PR c++/80241 - ICE with alignas pack expansion.
1821 * error.c (dump_expr): Handle TREE_LIST.
1822 * parser.c (cp_parser_std_attribute_list): Return error_mark if
1823 make_pack_expansion returns an error.
1825 2017-04-17 Bernd Edlinger <bernd.edlinger@hotmail.de>
1828 * class.c (fixup_may_alias): Fix all type variants.
1830 2017-04-17 Jason Merrill <jason@redhat.com>
1832 PR c++/80415 - wrong error with default arg and array reference.
1833 * tree.c (lvalue_kind): Return clk_class for an array prvalue.
1835 * pt.c (tsubst_init): Set TARGET_EXPR_DIRECT_INIT_P.
1837 2017-04-15 Alexandre Oliva <aoliva@redhat.com>
1839 * decl.c (name_unnamed_type): Split out of...
1840 (grokdeclarator): ... this.
1841 * decl.h (name_unnamed_type): Declare.
1843 2017-04-12 Richard Biener <rguenther@suse.de>
1844 Bernd Edlinger <bernd.edlinger@hotmail.de>
1847 * tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
1848 for arrays of character or std::byte type.
1850 2017-04-11 Jason Merrill <jason@redhat.com>
1852 PR c++/80294 - ICE with constexpr and inheritance.
1853 * constexpr.c (reduced_constant_expression_p):
1854 A null constructor element is non-constant.
1855 (cxx_eval_indirect_ref): Don't VERIFY_CONSTANT before
1856 returning an empty base.
1858 2017-04-11 Jakub Jelinek <jakub@redhat.com>
1861 * decl.c (cp_finish_decomp): If processing_template_decl on
1862 non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't
1863 change their DECL_VALUE_EXPR nor cp_finish_decl them. Instead make
1864 sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst
1866 * pt.c (value_dependent_expression_p) <case VAR_DECL>: For variables
1867 with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
1870 2017-04-11 Jakub Jelinek <jakub@redhat.com>
1873 * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.
1875 2017-04-10 Jakub Jelinek <jakub@redhat.com>
1878 * tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
1879 operand, if it is a static member function, recurse on the
1882 2017-04-10 Marek Polacek <polacek@redhat.com>
1885 * typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL. Set
1886 ORIG_TYPE earlier and not only when shortening.
1888 2017-04-07 Jason Merrill <jason@redhat.com>
1890 PR c++/80356 - ICE with reference to function template argument.
1892 * pt.c (convert_nontype_argument_function): Adjust type even with a
1893 value-dependent argument.
1895 PR c++/80267 - ICE with nested capture of reference
1897 * pt.c (tsubst_copy): Handle lookup finding a capture proxy.
1899 2017-04-07 Marek Polacek <polacek@redhat.com>
1902 * typeck.c (cp_build_binary_op): Convert COP[01] to ORIG_TYPE.
1905 * call.c (build_over_call): Don't check cxx_dialect.
1906 * cp-gimplify.c (cp_gimplify_init_expr): Don't check cxx_dialect nor
1907 whether SUB is a CONSTRUCTOR.
1908 * init.c (build_new_1): Don't check cxx_dialect.
1909 * tree.c (replace_placeholders): Add a function comment. Return if
1910 not in C++14, or if the object isn't a (member of a) class.
1911 * typeck2.c (store_init_value): Don't check cxx_dialect nor whether
1912 TYPE is CLASS_TYPE_P.
1914 2017-04-05 Jakub Jelinek <jakub@redhat.com>
1917 * pt.c (canonical_type_parameter): Use vec_safe_grow_cleared instead
1918 of a loop doing vec_safe_push of NULL. Formatting fixes.
1919 (rewrite_template_parm): Copy TEMPLATE_PARM_PARAMETER_PACK from oldidx
1920 to newidx before calling canonical_type_parameter on newtype.
1922 2017-04-04 Volker Reichelt <v.reichelt@netcologne.de>
1925 * cxx-pretty-print.c (cxx_pretty_printer::expression): Add
1926 UNARY_PLUS_EXPR case.
1928 2017-04-03 Jason Merrill <jason@redhat.com>
1930 * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
1932 2017-04-03 Jonathan Wakely <jwakely@redhat.com>
1934 * class.c (update_vtable_entry_for_fn): Fix typo in comment.
1935 * decl2.c (one_static_initialization_or_destruction): Likewise.
1936 * name-lookup.c (store_bindings): Likewise.
1937 * parser.c (make_call_declarator): Likewise.
1938 * pt.c (check_explicit_specialization): Likewise.
1940 2017-04-03 Jason Merrill <jason@redhat.com>
1942 PR sanitizer/79993 - ICE with VLA initialization from string
1943 PR c++/69487 - wrong VLA initialization from string
1944 * init.c (finish_length_check): Split out from build_vec_init.
1945 (build_vec_init): Handle STRING_CST.
1946 * typeck2.c (split_nonconstant_init): Handle STRING_CST.
1947 (digest_init_r): Don't give a STRING_CST VLA type.
1949 2017-03-31 Jakub Jelinek <jakub@redhat.com>
1952 * cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
1953 REFERENCE_TYPE. Adjust ubsan_maybe_instrument_reference caller
1954 for NOP_EXPR to REFERENCE_TYPE.
1957 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
1958 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
1960 * semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
1961 Remove extraneous parens.
1962 (finish_trait_expr): Handle CPTK_IS_AGGREGATE.
1963 * parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
1964 (cp_parser_trait_expr): Likewise.
1966 2017-03-27 Jakub Jelinek <jakub@redhat.com>
1969 * cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
1970 * typeck.c (cxx_mark_addressable): Likewise. Look through
1971 VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
1973 (cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
1975 2017-03-24 Jason Merrill <jason@redhat.com>
1977 PR c++/77339 - ICE with invalid use of alias template.
1978 * pt.c (lookup_template_class_1): Don't try to enter the scope of an
1981 2017-03-24 Marek Polacek <polacek@redhat.com>
1984 * cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
1985 doesn't have side effects.
1987 2017-03-23 Jason Merrill <jason@redhat.com>
1989 PR c++/80150 - ICE with overloaded variadic deduction.
1990 * pt.c (try_one_overload): Remove asserts.
1992 PR c++/77563 - missing ambiguous conversion error.
1993 * call.c (convert_like_real): Use LOOKUP_IMPLICIT.
1995 2017-03-23 Marek Polacek <polacek@redhat.com>
1997 * cp-tree.h: Remove a C_RID_YYCODE reference.
1999 2017-03-22 Jakub Jelinek <jakub@redhat.com>
2002 * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
2003 case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
2004 processing_template_decl.
2006 2017-03-21 Paolo Carlini <paolo.carlini@oracle.com>
2009 * name-lookup.c (pushtag_1): Add check for bogus, non template,
2010 std::initializer_list.
2012 2017-03-21 Jakub Jelinek <jakub@redhat.com>
2015 * init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.
2017 2017-03-21 Ville Voutilainen <ville.voutilainen@gmail.com>
2020 * init.c (std_placement_new_fn_p): New.
2021 (build_new_1): Call it.
2023 2017-03-20 Jason Merrill <jason@redhat.com>
2025 PR c++/80096 - ICE with C++17 non-type auto.
2026 * pt.c (tsubst): Delay tsubst of type of template non-type
2029 PR c++/79519 - ICE with deleted template friend.
2030 * decl.c (grokdeclarator): Complain about misplaced function
2031 definition using =, as well.
2033 PR c++/79640 - infinite recursion with generic lambda.
2034 * pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
2035 before substituting its initializer.
2037 2017-03-20 Marek Polacek <polacek@redhat.com>
2038 Paolo Carlini <paolo.carlini@oracle.com>
2040 PR c++/80059 - ICE with noexcept and __transaction_atomic
2041 * except.c (build_must_not_throw_expr): Call
2042 instantiate_non_dependent_expr.
2044 2017-03-19 Jason Merrill <jason@redhat.com>
2046 PR c++/80084 - wrong C++17 decomposition by reference of parameter.
2047 * decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
2048 reference decomposition.
2050 PR c++/80077 - error with constexpr and -fno-elide-constructors.
2051 * constexpr.c (cxx_eval_call_expression): Set ctx->call while
2052 expanding trivial constructor.
2054 2017-03-17 Jason Merrill <jason@redhat.com>
2056 PR c++/78345 - ICE initializing array from lambda.
2057 * init.c (build_aggr_init): Check array initializer.
2058 (build_vec_init): Check the type of a CONSTRUCTOR.
2060 PR c++/80073 - C++17 ICE with virtual base.
2061 * decl.c (xref_basetypes): Also check for indirect vbases.
2063 2017-03-16 Jason Merrill <jason@redhat.com>
2065 * decl.c (start_enum): std::byte aliases anything.
2068 * constexpr.c (lookup_placeholder): Tweak.
2070 2017-03-15 Jason Merrill <jason@redhat.com>
2072 PR c++/80043 - ICE with -fpermissive
2073 * typeck.c (convert_for_assignment): Handle instantiate_type
2074 not giving an error.
2076 2017-03-14 Nathan Sidwell <nathan@acm.org>
2078 PR c++/79393 DR 1658 workaround
2079 * method.c (synthesized_method_base_walk): Inihibit abstract class
2080 virtual base access check here.
2081 (synthesized_method_walk): Not here.
2083 2017-03-13 Nathan Sidwell <nathan@acm.org>
2085 PR c++/79393 DR 1658 workaround
2086 * method.c (synthesized_method_walk): Check vbases of abstract
2087 classes for dtor walk.
2089 2017-03-10 David Malcolm <dmalcolm@redhat.com>
2091 PR translation/79848
2092 * decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
2094 2017-03-10 Jason Merrill <jason@redhat.com>
2096 PR c++/79960 - alias templates and partial ordering
2097 * pt.c (comp_template_args): Add partial_order parm.
2098 (template_args_equal): Likewise.
2099 (comp_template_args_porder): New.
2100 (get_partial_spec_bindings): Use it.
2102 2017-03-10 Marek Polacek <polacek@redhat.com>
2105 * decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
2107 2017-03-10 Jakub Jelinek <jakub@redhat.com>
2110 * optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
2111 Use XALLOCAVEC macro.
2114 * decl.c (finish_enum_value_list): If value is error_mark_node,
2115 don't copy it and change its type.
2116 * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
2117 of CONST_DECL is error_mark_node.
2119 2017-03-09 Marek Polacek <polacek@redhat.com>
2121 PR c++/79900 - ICE in strip_typedefs
2122 * tree.c (strip_typedefs): Skip the attribute handling if T is
2123 a variant type which hasn't been updated yet.
2125 PR c++/79687 - wrong code with pointer-to-member
2126 * init.c (constant_value_1): Break if the variable has a dynamic
2129 2017-03-08 Jason Merrill <jason@redhat.com>
2131 PR c++/79797 - ICE with self-reference in array DMI.
2132 * constexpr.c (lookup_placeholder): Split out...
2133 (cxx_eval_constant_expression): ...from here.
2135 2017-03-07 Jakub Jelinek <jakub@redhat.com>
2138 * parser.c (cp_parser_omp_cancellation_point,
2139 cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
2140 cp_parser_omp_target_update): Change "may only be used in compound
2141 statements" diagnostics, such that the same translatable string is
2142 used for all pragmas.
2143 (cp_parser_pragma): Likewise. Use error_at instead of
2144 cp_parser_error for that diagnostics.
2146 2017-03-06 Marek Polacek <polacek@redhat.com>
2148 PR c++/79796 - ICE with NSDMI and this pointer
2149 * call.c (build_over_call): Handle NSDMI with a 'this' by calling
2150 replace_placeholders.
2152 2017-03-06 Jakub Jelinek <jakub@redhat.com>
2155 * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
2158 2017-03-06 Jason Merrill <jason@redhat.com>
2160 Revert "Allow deduction guides to look into primary template."
2161 * cp-tree.h, parser.c, pt.c, search.c: Revert.
2163 2017-03-05 Paolo Carlini <paolo.carlini@oracle.com>
2166 * except.c (build_must_not_throw_expr): Perform the implicit
2167 conversions on the condition.
2169 2017-03-03 Jason Merrill <jason@redhat.com>
2171 * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
2174 Core issues 2273 and 2277
2175 * call.c (joust): Adjust using-declaration tiebreaker to handle
2176 the intermediate base case.
2177 * method.c (strip_inheriting_ctors): Just return the argument if
2178 !flag_new_inheriting_ctors.
2180 2017-03-03 Richard Biener <rguenther@suse.de>
2183 * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
2185 2017-03-03 Marek Polacek <polacek@redhat.com>
2188 * typeck.c (string_conv_p): In C++11, always call pedwarn with
2191 2017-03-02 Jason Merrill <jason@redhat.com>
2193 Update overload resolution with deduction guides.
2194 * pt.c (do_class_deduction): Always build the copy guide.
2195 (copy_guide_p, template_guide_p): New.
2196 (build_deduction_guide): Remember the original constructor.
2197 * call.c (joust): Prefer the copy guide and non-template guides.
2199 Allow deduction guides to look into primary template.
2200 * cp-tree.h (struct saved_scope): Add deduction_guide_type.
2201 (struct cp_decl_specifier_seq): Add constructor_p.
2202 * parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
2203 (cp_parser_init_declarator): Check it. Set ctor_dtor_or_conv_p.
2204 Clear deduction_guide_type. Don't handle deduction guide names.
2205 (cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
2206 (cp_parser_direct_declarator): Likewise. Handle deduction guides.
2207 (cp_parser_member_declaration, cp_parser_cache_defarg)
2208 (cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
2209 * pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
2210 (build_deduction_guide): Set deduction_guide_type.
2211 (dependent_scope_p): Check deduction_guide_type.
2212 * search.c (lookup_member): Likewise.
2214 2017-03-02 Jakub Jelinek <jakub@redhat.com>
2217 * init.c (mark_exp_read_r): New function.
2218 (emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
2219 whole arguments instead of plain mark_exp_read on TREE_LIST values.
2221 2017-03-01 Jason Merrill <jason@redhat.com>
2223 Class template argument deduction in new-expression
2224 * init.c (build_new): Handle deduction from no initializer.
2225 * parser.c (cp_parser_new_expression): Don't require a single
2226 expression for class template deduction.
2227 * typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
2228 class template placeholder.
2229 * pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
2230 (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
2231 (redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
2233 2017-03-01 Jakub Jelinek <jakub@redhat.com>
2236 * init.c (emit_mem_initializers): When not constructing vbases of
2237 abstract classes, mark arguments as read for
2238 -Wunused-but-set-parameter.
2240 2017-02-28 Jason Merrill <jason@redhat.com>
2242 Class template argument deduction refinements
2243 * call.c (joust): Move deduction guide tiebreaker down.
2244 * decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
2245 deduction with no initializer.
2246 * pt.c (build_deduction_guide): Handle implicit default/copy ctor.
2247 (do_class_deduction): Use that rather than special case.
2248 (do_auto_deduction): Handle null initializer.
2250 2017-02-28 Jakub Jelinek <jakub@redhat.com>
2252 * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
2253 instead of just cond ? "..." : "...".
2254 (grokdeclarator): Likewise.
2255 (build_enumerator): Likewise.
2256 * init.c (build_new_1): Likewise.
2257 * call.c (build_new_method_call_1): Likewise.
2258 * parser.c: Include intl.h.
2259 (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
2260 "enter"/"exit" keyword.
2261 (cp_finalize_oacc_routine): Don't use %s to supply portions of the
2264 2017-02-27 Jason Merrill <jason@redhat.com>
2266 PR c++/71568 - SFINAE forming pointer to member function
2267 * init.c (build_offset_ref): Check the return value of
2268 perform_or_defer_access_check.
2270 2017-02-27 Marek Polacek <polacek@redhat.com>
2272 * decl.c (expand_static_init): Add missing } in a comment.
2274 2017-02-27 Volker Reichelt <v.reichelt@netcologne.de>
2276 * init.c: Include intl.h.
2277 (build_new_1): Move message strings into pedwarn to make them
2278 -Wformat-security friendly. Mark string for translation.
2279 * pt.c (tsubst_copy_and_build): Mark string for translation.
2280 Make the pointer const.
2281 * semantics.c (finish_id_expression): Mark strings for translation.
2283 2017-02-25 Jakub Jelinek <jakub@redhat.com>
2285 * call.c (build_op_delete_call): Make msg1 and msg2 const.
2287 2017-02-24 Jakub Jelinek <jakub@redhat.com>
2290 * call.c (build_over_call): Call check_function_arguments even for
2291 -Wrestrict, adjust check_function_arguments caller.
2292 * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
2294 * typeck.c (cp_build_function_call_vec): Adjust
2295 check_function_arguments caller.
2297 2017-02-24 Marek Polacek <polacek@redhat.com>
2299 PR translation/79705
2300 * decl.c (check_redeclaration_exception_specification): Mark a string
2301 for translation. Make the pointer const.
2303 2017-02-23 Paolo Carlini <paolo.carlini@oracle.com>
2306 * pt.c (register_specialization): Check duplicate_decls return value
2307 for error_mark_node and pass it back.
2309 2017-02-22 Jason Merrill <jason@redhat.com>
2311 PR c++/79679 - missing destructor for argument
2312 * call.c (build_over_call): Don't pass tf_no_cleanup to argument
2315 * pt.c (do_class_deduction): Handle 0 argument case.
2317 2017-02-22 Jakub Jelinek <jakub@redhat.com>
2320 * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
2321 SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
2322 * constexpr.c (potential_constant_expression_1): Handle
2323 OMP_*, OACC_* and CILK_* trees. Use error_at with
2324 EXPR_LOC_OR_LOC (t, input_location) computed early
2325 instead of error, or error_at with location_of (t).
2327 2017-02-22 Marek Polacek <polacek@redhat.com>
2330 * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
2331 if the alignas expression is erroneous.
2332 * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
2336 * semantics.c (finish_underlying_type): Bail out for incomplete enums.
2338 2017-02-21 Jason Merrill <jason@redhat.com>
2340 PR c++/50308 - wrong deprecated warning with ADL
2341 PR c++/17729 - duplicate deprecated warning
2342 * semantics.c (finish_id_expression): Only call mark_used on a
2343 function if we aren't building a call.
2345 PR c++/41727 - ICE with partial spec of partial instantiation
2346 * pt.c (process_partial_specialization): For now, don't check more
2347 specialized if there is more than one level of args.
2349 2017-02-21 Marek Polacek <polacek@redhat.com>
2352 * cp-tree.h (maybe_reject_flexarray_init): Declare.
2353 * init.c (maybe_reject_flexarray_init): No longer static.
2354 Add check for current_function_decl.
2355 * parser.c (cp_parser_late_parse_one_default_arg): Reject
2356 a default mem-initializer for a flexible array.
2358 2017-02-21 Jakub Jelinek <jakub@redhat.com>
2359 Paolo Carlini <paolo.carlini@oracle.com>
2362 * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
2364 * pt.c (tsubst_decomp_names): Return error_mark_node if the first
2365 decl after the decomposition artificial decl has error_mark_node.
2366 * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
2367 instead of just == error_mark_node comparison.
2369 2017-02-21 Jakub Jelinek <jakub@redhat.com>
2372 * decl.c: Include gimplify.h.
2373 (cp_finish_decomp): Make sure there is no sharing of trees
2374 in between DECL_VALUE_EXPR of decomposition decls.
2377 * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
2380 * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
2381 call cplus_expand_constant on it first.
2383 2017-02-19 Jason Merrill <jason@redhat.com>
2385 PR c++/78139 - destructor needed by new-expression
2386 * call.c (build_special_member_call): Use tf_no_cleanup.
2388 PR c++/78282 - auto template and pack expansion
2389 * pt.c (find_parameter_packs_r): Don't walk into the type of
2390 templates other than template template-parameters.
2392 PR c++/79606 - ICE with this->base_member in NSDMI
2393 * class.c (build_base_path): Check processing_template_decl.
2395 PR c++/79607 - ICE with T{} initializer
2396 * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
2398 PR c++/79566 - elaborated-type-specifier in range for
2399 * parser.c (cp_parser_simple_declaration): Fix check for type
2402 PR c++/79400 - confusing suggestion of 'noexcept'
2403 * parser.c (cp_parser_exception_specification_opt): Remove
2404 suggestion for deprecated dynamic exception-specification.
2406 PR c++/79470 - partial ordering with reference parameters
2407 * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
2409 PR c++/79500 - ICE with non-template deduction guide
2410 * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
2411 DECL_TEMPLATE_RESULT.
2413 PR c++/79580 - ICE with compound literal
2414 * parser.c (cp_parser_class_head): If we're in the middle of an
2415 expression, use ts_within_enclosing_non_class.
2417 PR c++/79503 - inherited ctor taking base class
2418 * call.c (add_function_candidate): Also check that
2419 DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
2421 2017-02-19 Paolo Carlini <paolo.carlini@oracle.com>
2424 * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
2427 2017-02-19 Eric Fiselier <eric@efcs.ca>
2428 Jonathan Wakely <jwakely@redhat.com>
2431 * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
2432 control warning about literal suffix identifiers without a leading
2435 2017-02-17 Jason Merrill <jason@redhat.com>
2437 PR c++/79508 - lookup error with member template
2438 * parser.c (cp_parser_template_name): Clear
2439 parser->context->object_type if we aren't doing lookup.
2441 PR c++/78690 - ICE with using and global type with same name
2442 * pt.c (type_dependent_object_expression_p): True for
2445 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
2446 * pt.c (convert_template_argument): Just return an auto arg pack.
2447 (tsubst_template_args): Don't tsubst an auto pack type.
2449 PR c++/79556 - C++17 ICE with non-type auto
2450 * pt.c (do_auto_deduction): Don't try to deduce from null type.
2452 PR c++/79533 - C++17 ICE with temporary cast to reference
2453 * call.c (build_over_call): Conversion to a reference prevents copy
2456 2017-02-16 Jakub Jelinek <jakub@redhat.com>
2457 Jason Merrill <jason@redhat.com>
2459 PR c++/79502 - lost nodiscard attribute
2460 * pt.c (apply_late_template_attributes): Do apply non-dependent
2461 attributes to types.
2463 2017-02-16 Jason Merrill <jason@redhat.com>
2465 PR c++/78572 - ICE with self-modifying array initializer
2466 * constexpr.c (cxx_eval_store_expression): The object we're
2467 initializing is outside the constant-expression.
2468 (cxx_eval_call_expression): Set ctx->call.
2470 PR c++/79050 - ICE with undeduced auto and LTO
2471 * decl.c (poplevel): Remove undeduced auto decls.
2473 2017-02-16 Jakub Jelinek <jakub@redhat.com>
2476 * parser.c (cp_parser_omp_target): For -fopenmp-simd
2477 ignore #pragma omp target even when not followed by identifier.
2479 2017-02-15 Jason Merrill <jason@redhat.com>
2480 Jakub Jelinek <jakub@redhat.com>
2482 PR c++/79464 - ICE in IPA with omitted constructor parms
2483 * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
2484 (adjust_clone_args): Adjust.
2485 (add_method): Remember omitted parms.
2486 * call.c (add_function_candidate): Likewise.
2487 * mangle.c (write_method_parms): Likewise.
2488 * method.c (ctor_omit_inherited_parms): Return false if there are no
2491 2017-02-15 Martin Sebor <msebor@redhat.com>
2494 * init.c (maybe_reject_flexarray_init): New function.
2495 (perform_member_init): Call it.
2497 2017-02-15 Jakub Jelinek <jakub@redhat.com>
2500 * parser.c (cp_parser_std_attribute): Don't pedwarn about
2501 [[deprecated]] with -std=c++11 and [[fallthrough]] with
2502 -std=c++11 and -std=c++14.
2505 * decl.c (grokdeclarator): For static data members, handle thread_p
2506 only after handling inline.
2508 2017-02-14 Marek Polacek <polacek@redhat.com>
2512 * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
2513 clobbering if the postfix expression isn't an EXPR_P.
2515 2017-02-13 Jason Merrill <jason@redhat.com>
2517 PR c++/79461 - ICE with lambda in constexpr constructor
2518 * constexpr.c (build_data_member_initialization): Ignore
2519 initialization of a local variable.
2521 2017-02-13 Jakub Jelinek <jakub@redhat.com>
2523 * init.c (warn_placement_new_too_small): Add missing space in
2525 * parser.c (cp_parser_oacc_declare): Likewise.
2526 * mangle.c (maybe_check_abi_tags): Likewise.
2529 * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
2530 on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
2531 in the rightmost operand.
2533 2017-02-13 Nathan Sidwell <nathan@acm.org>
2535 PR c++/79296 - ICE mangling localized template instantiation
2536 * decl2.c (determine_visibility): Use template fn context for
2537 local class instantiations.
2539 2017-02-11 Jason Merrill <jason@redhat.com>
2541 PR c++/77659 - ICE with new and C++14 aggregate NSDMI
2542 * init.c (build_new): Make backups of any CONSTRUCTORs in init.
2543 (build_new_1): Use replace_placeholders.
2544 * tree.c (replace_placeholders_t): Also track whether we've seen a
2546 (replace_placeholders, replace_placeholders_r): Adjust.
2547 * cp-tree.h: Adjust.
2549 PR c++/77790 - ICE with auto function in C++11 mode
2550 * decl.c (undeduced_auto_decl): Remove C++14 limitation.
2551 (require_deduced_type): Add complain parm, return bool.
2552 * cp-tree.h: Adjust.
2553 * decl2.c (mark_used): Use require_deduced_type.
2555 2017-02-10 Jason Merrill <jason@redhat.com>
2557 PR c++/78908 - template ops and bitfields
2558 * tree.c (build_min_non_dep): Use unlowered_expr_type.
2560 PR c++/78897 - constexpr union
2561 * constexpr.c (cxx_eval_store_expression): A store to a union member
2562 erases a previous store to another member.
2564 PR c++/71285 - member of fold-expression
2565 * semantics.c (finish_unary_fold_expr)
2566 (finish_binary_fold_expr): Use null type for fold-expressions.
2568 PR c++/79401 - protected inherited constructor
2569 * call.c (enforce_access): For inheriting constructor, find a base
2570 binfo in the path we already have.
2572 2017-02-10 Marek Polacek <polacek@redhat.com>
2575 * pt.c (type_dependent_expression_p): Check if the expression type
2579 * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
2580 if warnings shouldn't be given.
2582 2017-02-10 Paolo Carlini <paolo.carlini@oracle.com>
2585 * pt.c (tsubst_decl): Don't try to preserve a typedef that names
2586 an error_mark_node as type.
2588 2017-02-09 Jakub Jelinek <jakub@redhat.com>
2589 Jason Merrill <jason@redhat.com>
2592 * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
2593 from pattern to type.
2595 2017-02-09 Jason Merrill <jason@redhat.com>
2597 PR c++/79316 - default argument in deduction guide
2598 PR c++/79350 - explicit deduction guide
2599 * parser.c (cp_parser_constructor_declarator_p)
2600 (cp_parser_direct_declarator): Parse deduction guides more like
2602 * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
2603 * tree.c (special_function_p): Return it.
2604 * decl.c (check_special_function_return_type): Handle it.
2605 (grokdeclarator, grokfndecl): Adjust.
2606 (cp_finish_decl): Pass flags to do_auto_deduction.
2607 * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
2608 * pt.c (dguide_name_p): Take a const_tree.
2609 (do_class_deduction): Handle explicit.
2610 (do_auto_deduction): Pass flags through.
2611 (build_deduction_guide): Copy explicit flag.
2613 2017-02-09 Jakub Jelinek <jakub@redhat.com>
2616 * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
2617 non-pragma_compound context here.
2618 (cp_parser_omp_target): Likewise.
2619 (cp_parser_pragma): Don't call push_omp_privatization_clauses and
2620 parsing for ordered and target omp pragmas in non-pragma_stmt
2621 non-pragma_compound contexts.
2624 * parser.c (cp_parser_oacc_declare): Formatting fix.
2625 (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
2626 automatic variables.
2628 2016-02-09 Nathan Sidwell <nathan@codesourcery.com>
2629 Chung-Lin Tang <cltang@codesourcery.com>
2631 * parser.c (cp_parser_oacc_clause_tile): Disallow collapse. Fix
2632 parsing. Parse constant expression. Remove semantic checking.
2633 (cp_parser_omp_clause_collapse): Disallow tile.
2634 (cp_parser_omp_for_loop): Deal with tile clause. Don't emit a parse
2635 error about missing for after already emitting one. Use more
2636 conventional for idiom for unbounded loop.
2637 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
2638 * semantics.c (finish_omp_clauses): Correct TILE semantic check.
2639 (finish_omp_for): Deal with tile clause.
2641 2017-02-07 Nathan Sidwell <nathan@acm.org>
2643 * method.c (synthesized_method_base_walk): New. Broken out of ...
2644 (synthesized_method_walk): ... here. Call it. Cleanup
2647 2017-02-07 Patrick Palka <ppalka@gcc.gnu.org>
2650 * typeck2.c (process_init_constructor_union): Consider only
2651 FIELD_DECLs when looking for an NSDMI.
2653 2017-02-06 Jason Merrill <jason@redhat.com>
2655 PR c++/71193 - incomplete types in templates
2656 * parser.c (cp_parser_postfix_dot_deref_expression): In a template
2657 handle incomplete type by pedwarning and then treating as dependent.
2659 2017-02-06 Jakub Jelinek <jakub@redhat.com>
2662 * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
2663 (potential_constant_expression_1): Likewise.
2666 * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
2667 allow one fewer than expected arguments if flag_permissive.
2670 * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
2671 * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
2672 with error_mark_node type.
2674 2017-02-03 Jason Merrill <jason@redhat.com>
2676 PR c++/78689 - ICE on constructor with label
2677 * optimize.c (maybe_clone_body): Replace omitted parameters with
2679 * class.c (build_clone): Fix logic for omitting inherited parms.
2681 PR c++/12245 - excessive memory use
2682 * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
2683 back in. Don't cache constants.
2684 (maybe_constant_init): Don't cache constants.
2686 PR c++/79294 - ICE with invalid template argument
2687 * pt.c (convert_nontype_argument_function): Check value-dependence.
2688 (convert_nontype_argument): Don't check it here for function ptrs.
2690 2017-02-02 Richard Biener <rguenther@suse.de>
2693 * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
2694 it lazily on the first changed element only and copy it
2695 fully upfront, only storing changed elements.
2697 2017-02-02 Paolo Carlini <paolo.carlini@oracle.com>
2700 * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
2703 2017-01-31 Jakub Jelinek <jakub@redhat.com>
2706 * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
2709 2017-01-31 David Malcolm <dmalcolm@redhat.com>
2712 * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
2713 any namespace aliases.
2715 2017-01-31 Nathan Sidwell <nathan@acm.org>
2718 * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
2722 * pt.c: (instantiate_decl): Push to top level when current
2723 function scope doesn't match. Only push lmabda scope stack when
2726 * cp-tree.h (instantiate_decl): Make defer_ok bool.
2727 * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
2728 (instantiate_decl): Simplify and reorder state saving and restoration.
2731 * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
2732 * semantics.c (finish_member_declaration): Assert class is being
2735 2017-01-30 Alexandre Oliva <aoliva@redhat.com>
2737 Introduce C++ support in libcc1.
2738 * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
2739 (ansi_opname): Rename to...
2740 (cp_operator_id): ... this. Adjust all callers.
2741 (ansi_assopname): Rename to...
2742 (cp_assignment_operator_id): ... this. Adjust all callers.
2743 (cp_literal_operator_id): Declare.
2744 (set_global_friend): Declare.
2745 (is_global_friend): Declare.
2746 (enum cp_oracle_request): New type.
2747 (cp_binding_oracle_function): New type.
2748 (cp_binding_oracle): Declare.
2749 (cp_finish_injected_record_type): Declare.
2750 * friend.c (global_friend): New var.
2751 (set_global_friend): New fn.
2752 (is_global_friend): New fn.
2753 (is_friend): Call is_global_friend.
2754 * name-lookup.c (cp_binding_oracle): New var.
2755 (query_oracle): New fn.
2756 (qualified_lookup_using_namespace): Call query_oracle.
2757 (lookup_name_real_1): Likewise.
2758 * parser.c (cp_literal_operator_id): Drop static.
2759 * search.c (friend_accessible_p): Call is_global_friend.
2760 * semantics.c (is_this_parameter): Accept a variable if the
2761 binding oracle is enabled.
2763 2017-01-27 Jason Merrill <jason@redhat.com>
2765 PR c++/78771 - ICE with inherited constructor.
2766 * call.c (build_over_call): Call deduce_inheriting_ctor here.
2767 * pt.c (tsubst_decl): Not here.
2768 * class.c (add_method): Or here.
2769 * method.c (deduce_inheriting_ctor): Handle clones.
2770 (implicitly_declare_fn): Don't deduce inheriting ctors yet.
2772 2017-01-27 Adam Butcher <adam@jessamine.co.uk>
2775 * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
2777 * cp/cp-tree.h: Declare it.
2778 * cp/semantics.c (finish_id_expression): Resolve names within a default
2779 capturing generic lambda defined within a template prior to
2780 instantiation to allow for captures to be added to the closure type.
2782 2017-01-26 Jakub Jelinek <jakub@redhat.com>
2785 * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
2786 * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
2787 * parser.c (cp_parser_builtin_offsetof): Pass result of
2788 build_static_cast of null_pointer_node to finish_offsetof.
2789 * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
2790 it for -Winvalid-offsetof pedwarn instead of trying to guess
2791 original offsetof type from EXPR. Save OBJECT_PTR as a new
2792 second operand to OFFSETOF_EXPR.
2793 * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
2794 finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
2797 2017-01-26 Jason Merrill <jason@redhat.com>
2799 * name-lookup.c (parse_using_directive): Deprecate strong using.
2801 PR c++/79176 - lambda ICE with -flto -Os
2802 * decl2.c (vague_linkage_p): Handle decloned 'tors.
2803 * tree.c (decl_linkage): Likewise.
2805 2017-01-25 Martin Sebor <msebor@redhat.com>
2807 * decl.c (grokdeclarator): Fix a typo in a comment.
2809 2017-01-25 Jakub Jelinek <jakub@redhat.com>
2812 * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
2816 * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
2817 OPT_Wpedantic on lambda templates for -std=c++14 and higher.
2819 2017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
2822 * decl.c (cxx_init_decl_processing): Pass main_input_filename
2823 to build_translation_unit_decl.
2825 2017-01-24 Jakub Jelinek <jakub@redhat.com>
2828 * cp-gimplify.c (cp_genericize_r): Add result of
2829 convert_from_reference on invisiref parm to p_set.
2831 2017-01-24 Nathan Sidwell <nathan@acm.org>
2833 PR c++/78469 - defaulted ctor and inaccessible dtor
2834 * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
2835 * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
2836 * tree.c (build_target_expr): Check tf_no_cleanup.
2838 PR c++/79118 - anon-members and constexpr
2839 * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
2840 ctor decl. Recursively check anonymous members.
2841 (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
2843 (explain_invalid_constexpr_fn): Likewise.
2845 2017-01-23 Nathan Sidwell <nathan@acm.org>
2847 PR c++/71710 - template using directive of field
2848 * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
2851 PR c++/71406 - ICE with scope-ref'd template id exprs
2853 * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
2854 before breaking up TEMPLATE_ID_EXPR.
2856 2017-01-20 Nathan Sidwell <nathan@acm.org>
2858 PR c++/78495 - wrong code inherited ctor and invisi-ref parm
2859 * cp-gimplify.c (cp_generize_r): Don't skip thunks.
2861 2017-01-20 David Malcolm <dmalcolm@redhat.com>
2865 * cp-tree.h (suggest_alternatives_for): Add bool param.
2866 (suggest_alternative_in_explicit_scope): New decl.
2867 * error.c (qualified_name_lookup_error): When SCOPE is a namespace
2868 that isn't the global one, call new function
2869 suggest_alternative_in_explicit_scope, only calling
2870 suggest_alternatives_for if it fails, and disabling near match
2871 searches fort that case. When SCOPE is the global namespace,
2872 pass true for new param to suggest_alternatives_for to allow for
2874 * lex.c (unqualified_name_lookup_error): Pass true for new param
2875 to suggest_alternatives_for.
2876 * name-lookup.c (consider_binding_level): Add forward decl.
2877 (suggest_alternatives_for): Add "suggest_misspellings" param,
2878 using it to conditionalize the fuzzy name-lookup code.
2879 (suggest_alternative_in_explicit_scope): New function.
2880 * parser.c (cp_parser_primary_expression): When calling
2881 finish_id_expression, pass location of id_expression rather
2882 than that of id_expr_token.
2883 (cp_parser_id_expression): Convert local "unqualified_id" from
2884 tree to cp_expr to avoid implicitly dropping location information.
2886 2017-01-20 Marek Polacek <polacek@redhat.com>
2889 * call.c (build_conditional_expr_1): Warn about duplicated branches.
2890 * semantics.c (finish_expr_stmt): Build statement using the proper
2893 2017-01-19 Jason Merrill <jason@redhat.com>
2895 US 20 - forwarding references and class template argument deduction
2896 * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
2897 * pt.c (push_template_decl_real): Set it.
2898 (maybe_adjust_types_for_deduction): Check it.
2899 (rewrite_template_parm): Copy it.
2901 US 19 - deduction guides and constructors
2902 * call.c (joust): Prefer deduction guides to constructors.
2903 * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
2904 (deduction_guide_p): Check DECL_P.
2906 * decl.c (check_initializer): Always use build_aggr_init for array
2909 PR c++/79130 - decomposition and direct-initialization
2910 * init.c (build_aggr_init): Communicate direct-initialization to
2912 (build_vec_init): Check for array copy sooner.
2913 * parser.c (cp_parser_decomposition_declaration): Remove call to
2914 build_x_compound_expr_from_list.
2916 2017-01-18 Jason Merrill <jason@redhat.com>
2918 PR c++/68666 - member variable template-id
2919 * typeck.c (finish_class_member_access_expr): Handle variable
2921 * pt.c (lookup_and_finish_template_variable): No longer static.
2922 * cp-tree.h: Declare it.
2924 2017-01-18 Nathan Sidwell <nathan@acm.org>
2927 * call.c (build_over_call): When checking ellipsis conversions for
2928 an inherited ctor, make sure there is at least one conversion.
2930 2017-01-18 Jason Merrill <jason@redhat.com>
2932 PR c++/78894 - ICE with class deduction and default arg
2933 * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
2935 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
2938 * mangle.c (write_discriminator): Reorganize abi warning check.
2940 2017-01-18 Nathan Sidwell <nathan@acm.org>
2942 * cp-tree.h: Clarify exception spec node comment.
2943 * except.c (nothrow_spec_p): Simplify by checking node-equality.
2946 * mangle.c (write_exception_spec): Check nothrow explicitly.
2947 (write_encoding): Don't increment processing_template_decl around
2950 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
2953 * mangle.c (write_template_args): Add "on" for operator names.
2955 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
2958 * mangle.c (write_discriminator): Handle discriminator >= 10.
2960 2017-01-17 Nathan Sidwell <nathan@acm.org>
2963 * cp-tree.h (maybe_generic_this_capture): Declare.
2964 * lambda.c (resolvable_dummy_lambda): New, broken out of ...
2965 (maybe_resolve_dummy): ... here. Call it.
2966 (maybe_generic_this_capture): New.
2967 * parser.c (cp_parser_postfix_expression): Speculatively capture
2968 this in generic lambda in unresolved member function call.
2969 * pt.c (tsubst_copy_and_build): Force hard error from failed
2970 member function lookup in generic lambda.
2972 2017-01-17 Aldy Hernandez <aldyh@redhat.com>
2975 * cp-array-notation.c (expand_array_notation_exprs): Handle
2978 2017-01-11 Jason Merrill <jason@redhat.com>
2980 PR c++/78337 - ICE on invalid with generic lambda
2981 * semantics.c (process_outer_var_ref): Check if containing_function
2982 is null. Move inform call under complain test.
2984 2017-01-11 Nathan Sidwell <nathan@acm.org>
2987 * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
2990 2017-01-11 Nathan Sidwell <nathan@acm.org>
2992 * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
2994 2017-01-11 Jakub Jelinek <jakub@redhat.com>
2997 * parser.c (cp_parser_std_attribute_spec): Remove over-eager
2998 assertion. Formatting fix.
3001 * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
3004 2017-01-10 David Malcolm <dmalcolm@redhat.com>
3007 * parser.c (cp_parser_class_specifier_1): Only suggest inserting
3008 a missing semicolon if we have a valid insertion location for
3011 2017-01-10 Jason Merrill <jason@redhat.com>
3013 FI 20, decomposition declaration with parenthesized initializer.
3014 * parser.c (cp_parser_decomposition_declaration): Use
3015 cp_parser_initializer.
3017 2017-01-09 Jason Merrill <jason@redhat.com>
3019 Implement P0195R2, C++17 variadic using.
3020 * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
3021 * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
3022 * error.c (dump_decl): Likewise.
3024 2017-01-09 Jakub Jelinek <jakub@redhat.com>
3026 PR translation/79019
3027 PR translation/79020
3028 * semantics.c (finish_omp_clauses): Add missing whitespace to
3029 translatable strings.
3030 * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
3032 2017-01-07 Jason Merrill <jason@redhat.com>
3034 PR c++/78948 - instantiation from discarded statement
3035 * parser.h (struct cp_parser): Remove in_discarded_stmt field.
3036 * cp-tree.h (in_discarded_stmt): Declare it.
3037 (struct saved_scope): Add discarded_stmt bitfield.
3038 (in_discarded_stmt): New macro.
3039 * decl2.c (mark_used): Check it.
3040 * parser.c (cp_parser_selection_statement): Adjust.
3041 (cp_parser_jump_statement): Adjust.
3043 2017-01-05 Jakub Jelinek <jakub@redhat.com>
3046 * decl.c (cp_finish_decomp): Remove probe variable, if tt is
3047 REFERENCE_REF_P, set tt to its operand.
3050 * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
3051 unions even for C++11 and later.
3053 2017-01-05 Nathan Sidwell <nathan@acm.org>
3056 * pt.c (convert_nontype_argument): Don't try and see if integral
3057 or enum expressions are constants prematurely.
3059 2017-01-04 Marek Polacek <polacek@redhat.com>
3062 * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
3063 a zero character literal.
3065 2017-01-04 Jakub Jelinek <jakub@redhat.com>
3068 * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
3072 * parser.c (cp_parser_simple_declaration): Only complain about
3073 inconsistent auto deduction if auto_result doesn't use auto.
3075 * parser.c (cp_parser_simple_declaration): Diagnose function
3076 declaration among more than one init-declarators with auto
3080 * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
3081 assertion, as lexer->buffer may be NULL.
3083 2017-01-04 Marek Polacek <polacek@redhat.com>
3087 * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
3089 2017-01-04 Nathan Sidwell <nathan@acm.org>
3092 * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
3093 (lambda_capture_field_type): Update prototype.
3094 * lambda.c (lambda_capture_field_type): Add is_reference parm.
3095 Add referenceness here.
3096 (add_capture): Adjust lambda_capture_field_type call, refactor
3098 * pt.c (tsubst): Adjust lambda_capture_field_type call.
3100 2017-01-01 Jakub Jelinek <jakub@redhat.com>
3102 Update copyright years.
3104 Copyright (C) 2017 Free Software Foundation, Inc.
3106 Copying and distribution of this file, with or without modification,
3107 are permitted in any medium without royalty provided the copyright
3108 notice and this notice are preserved.