1 2017-06-21 David Malcolm <dmalcolm@redhat.com>
3 * parser.c (get_cast_suggestion): New function.
4 (maybe_add_cast_fixit): New function.
5 (cp_parser_cast_expression): Capture the location of the closing
6 parenthesis. Call maybe_add_cast_fixit when emitting warnings
9 2017-06-20 Jason Merrill <jason@redhat.com>
11 PR c++/80972 - C++17 ICE with attribute packed.
12 * call.c (build_over_call): Allow a TARGET_EXPR from reference
15 2017-06-20 Nathan Sidwell <nathan@acm.org>
17 * cp-tree.h (CPTI_NELTS_IDENTIFIER): Delete.
18 (nelts_identifier): Delete.
19 * decl.c (initialize_predefined_identifiers): Remove nelts.
21 PR c++/67074 - namespace aliases
22 * decl.c (duplicate_decls): Don't error here on mismatched
24 * name-lookup.c (name_lookup::add_value): Matching namespaces are
26 (diagnose_name_conflict): Namespaces are never redeclarations.
27 (update_binding): An alias can match a real namespace.
29 2017-06-19 Jason Merrill <jason@redhat.com>
31 PR c++/80562 - ICE with constexpr if.
32 * semantics.c (finish_if_stmt_cond): Call
33 instantiate_non_dependent_expr.
35 PR c++/80829 - ICE with constexpr copy of base subobject.
36 * constexpr.c (clear_no_implicit_zero): New.
37 (cxx_eval_call_expression): Call it.
39 2017-06-19 Nathan Sidwell <nathan@acm.org>
43 * name-lookup.c (set_decl_namespace): Don't follow using
44 directives and ignore using decls. Only check overly-explicit
45 scope after discovering decl.
47 2017-06-19 Jason Merrill <jason@redhat.com>
49 PR c++/81073 - constexpr and static var in statement-expression.
50 * typeck2.c (store_init_value): Always call
51 require_potential_constant_expression.
52 * pt.c (convert_nontype_argument): Likewise.
53 * constexpr.c (potential_constant_expression_1): Adjust message.
54 Use decl_maybe_constant_var_p instead of decl_constant_var_p.
55 * decl2.c (decl_maybe_constant_var_p): Consider initializer.
57 2017-06-19 Nathan Sidwell <nathan@acm.org>
59 * pt.c (coerce_template_parms): Fix indentation.
60 (tsubst_decl): Remove repeated SET_DECL_RTL. Move VAR_P handling
64 * name-lookup.c (update_binding): Only warn about constructors
67 2017-06-17 Jason Merrill <jason@redhat.com>
69 PR c++/60063 - -Wunused-local-typedefs and templates.
70 * decl2.c (is_late_template_attribute): Return false for "used".
72 PR c++/70844 - -Wuseless-cast and inheriting constructor.
73 * method.c (forward_parm): Suppress warn_useless_cast.
75 2017-06-16 Jason Merrill <jason@redhat.com>
77 PR c++/81045 - Wrong type-dependence with auto return type.
78 * pt.c (type_dependent_expression_p): An undeduced auto outside the
79 template isn't dependent.
80 * call.c (build_over_call): Instantiate undeduced auto even in a
83 PR c++/80465 - ICE with generic lambda with noexcept-specifier.
84 * lambda.c (maybe_add_lambda_conv_op): Keep processing_template_decl
85 set longer for a generic lambda.
87 PR c++/80614 - Wrong mangling for C++17 noexcept type
88 * mangle.c (write_type): Put the eh spec back on the function type.
90 PR c++/81102 - Wrong error with partial specialization.
91 * pt.c (unify) [TEMPLATE_PARM_INDEX]: Strip reference when comparing
92 types. Do type deduction later.
94 PR c++/81074 - ICE with partial specialization of member template.
96 * pt.c (get_partial_spec_bindings): Only coerce innermost args.
98 PR c++/80831 - ICE with -fsyntax-only.
99 * decl2.c (c_parse_final_cleanups): Use cgraph_node::get_create.
101 PR c++/80639 - ICE with invalid PMF initialization.
102 PR c++/80043 - ICE with -fpermissive
103 * typeck.c (convert_for_assignment): Recurse when instantiate_type
104 returns without an error.
106 2017-06-16 Nathan Sidwell <nathan@acm.org>
108 * pt.c (tsubst_baselink): Fix & clarify formatting.
110 * cp-tree.h (build_this_parm, cp_build_parm_decl,
111 build_artificial_parm): Add FN parm.
112 * decl.c (start_cleanup_fn): Adjust.
113 (build_this_parm): Add FN parm, pass it through.
114 (grokfndecl): Adjust parm building.
115 * decl2.c (cp_build_parm_decl): Add FN parm, set context.
116 (build_artificial_parm): Add FN parm, pass through.
117 (maybe_retrofit_in_chrg): Adjust parm building.
118 (start_static_storage_duration_function): Likwise.
119 * lambda.c (maybe_aadd_lambda_conv_op): Likewise.
120 * method.c (implicitly_declare_fn): Likewise.
121 * parser.c (inject_this_parameter): Likewise.
123 Symbol tables are insert only.
124 * cp-tree.h (default_hash_traits <lang_identifier *>): Don't
125 derive from pointer_hash. Make undeletable.
127 * class.c (resort_type_method_vec): Avoid potential unsigned
130 Don't defer noexcept_deferred_spec.
131 * cp-tree.h (unevaluated_noexcept_spec): Don't declare.
132 * decl.c (cxx_init_decl_processing): Initialize
133 noexcept_deferred_spec.
134 * except.c (unevaluated_noexcept_spec): Delete.
135 * class.c (deduce_noexcept_on_destructor): Use
136 noexcept_deferred_spec directly.
137 * method.c (implicitly_declare_fn): Likewise.
139 Make keyed_classes a vector.
140 * cp-tree.h (CPTI_KEYED_CLASSES, keyed_classes): Delete.
141 (keyed_classes): Declare as vector.
142 * decl.c (keyed_classes): Define.
143 (cxx_init_decl_processing): Allocate it.
144 (record_key_method_defined): Use vec_safe_push.
145 * class.c (finish_struct_1): Likewise.
146 * pt.c (instantiate_class_template_1): Likewise.
147 * decl2.c (c_parse_final_cleanups): Reverse iterate keyed_classes.
150 * rtti.c (enum tinfo_kind): Add TK_DERIVED_TYPES,
151 TK_VMI_CLASS_TYPES, TK_MAX. Delete TK_FIXED.
153 (typeid_ok_p): Add quotes to error messages. Use get_tinfo_desc.
154 (get_tinfo_decl): Use get_tinfo_desc.
155 (get_pseudo_ti_init): Likewise. Adjust VMI construction.
156 (create_pseudo_type_info): Delete.
157 (get_pseudo_ti_index): Just determine the index.
158 (get_tinfo_desc): New. Create all types lazily.
159 (create_tinfo_types): Just allocate the descriptor array.
160 (emit_support_tinfos): Use non-inserting type lookup. Set builtin
163 2017-06-15 Martin Sebor <msebor@redhat.com>
166 * call.c (first_non_public_field, maybe_warn_class_memaccess): New
168 (has_trivial_copy_assign_p, has_trivial_copy_p): Ditto.
169 (build_cxx_call): Call maybe_warn_class_memaccess.
171 2017-06-14 Jakub Jelinek <jakub@redhat.com>
173 * cp-gimplify.c (cp_genericize_r): Turn most of the function
174 into a switch (TREE_CODE (stmt)) statement from long else if
177 2017-06-13 Jakub Jelinek <jakub@redhat.com>
180 * cp-gimplify.c (cp_genericize_r): Don't instrument MEM_REF second
181 argument even if it has REFERENCE_TYPE.
184 * cp-gimplify.c (cp_genericize): Only look for VAR_DECLs in
185 BLOCK_VARS (outer) chain.
186 (cxx_omp_const_qual_no_mutable): Likewise.
188 2017-06-13 Martin Liska <mliska@suse.cz>
191 * class.c (build_base_path): Use sanitize_flags_p.
192 * cp-gimplify.c (cp_genericize_r): Likewise.
193 (cp_genericize_tree): Likewise.
194 (cp_genericize): Likewise.
195 * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
196 * decl.c (compute_array_index_type): Likewise.
197 (start_preparsed_function): Likewise.
198 * decl2.c (one_static_initialization_or_destruction): Likewise.
199 * init.c (finish_length_check): Likewise.
200 * lambda.c (maybe_add_lambda_conv_op): Likewise.
201 * typeck.c (cp_build_binary_op): Likewise.
202 (build_static_cast_1): Likewise.
204 2017-06-11 Jason Merrill <jason@redhat.com>
206 * error.c (dump_expr): Use is_this_parameter.
208 * cp-tree.h, decl2.c, mangle.c, parser.c, pt.c, semantics.c: Use
211 2017-06-09 Jason Merrill <jason@redhat.com>
213 Missing bits from N4268, constant evaluation for all non-type args.
214 * call.c (build_converted_constant_expr): Rename from
215 build_integral_nontype_arg_conv, handle all types.
216 * pt.c (convert_nontype_argument): In C++17 call it for all types.
217 Move NOP stripping inside pointer case, don't strip ADDR_EXPR.
218 * cvt.c (strip_fnptr_conv): Also strip conversions to the same type.
220 Overhaul pointer-to-member conversion and template argument handling.
221 * call.c (standard_conversion): Avoid creating ck_pmem when the
222 class type is the same.
223 * cvt.c (can_convert_qual): Split from
224 perform_qualification_conversions.
225 * constexpr.c (cxx_eval_constant_expression): Check it.
226 * typeck.c (convert_ptrmem): Only cplus_expand_constant if
227 adjustment is necessary.
228 * pt.c (check_valid_ptrmem_cst_expr): Compare class types.
229 (convert_nontype_argument): Avoid redundant error.
231 * call.c (convert_like_real): Remove "inner" parameter.
232 Don't replace a constant with its value.
233 * cp-gimplify.c (cp_fully_fold): Use cp_fold_rvalue.
235 * pt.c (convert_nontype_argument): Check NULLPTR_TYPE_P rather than
238 * parser.c (cp_parser_constant_expression): Check
239 potential_rvalue_constant_expression after decay_conversion.
240 * pt.c (convert_nontype_argument): Don't require linkage in C++17.
242 PR c++/80384 - ICE with dependent noexcept-specifier
243 * pt.c (dependent_type_p_r) [FUNCTION_TYPE]: Check for dependent
246 * constexpr.c (potential_constant_expression_1): Allow 'this' capture.
248 2017-06-09 Jan Hubicka <hubicka@ucw.cz>
250 * class.c (build_vtbl_initializer): Mark dvirt_fn as cold.
251 * decl.c (cxx_init_decl_processing, push_throw_library_fn): Likewise.
252 (excpet.c): Mark terminate as cold.
254 2017-06-08 Jakub Jelinek <jakub@redhat.com>
257 * semantics.c (handle_omp_array_sections_1): Convert TYPE_MAX_VALUE
258 to sizetype before size_binop.
261 * cp-gimplify.c (cxx_omp_finish_clause): When changing clause
262 to OMP_CLAUSE_SHARED, also clear OMP_CLAUSE_SHARED_FIRSTPRIVATE
263 and OMP_CLAUSE_SHARED_READONLY flags.
265 2017-06-08 Jan Hubicka <hubicka@ucw.cz>
267 * cp-tree.h (lang_check_failed): Annotate by ATTRIBUTE_COLD.
269 2017-06-07 Nathan Sidwell <nathan@acm.org>
271 * class.c (layout_class_type): Restructure overlong-bitfield tpe
274 2017-06-07 Jonathan Wakely <jwakely@redhat.com>
277 * pt.c (do_class_deduction): Build qualified type.
279 2017-06-06 Nathan Sidwell <nathan@acm.org>
281 * name-lookup.c (suggest_alternatives_for): Use qualified lookup
282 sans using directives. Don't walk into inline namespaces.
285 * name-lookup.c (adl_class_only): Don't add visible friends.
287 2017-06-05 Volker Reichelt <v.reichelt@netcologne.de>
289 * parser.c (cp_parser_base_specifier): Fix typos in error messages.
291 2017-06-02 Nathan Sidwell <nathan@acm.org>
293 Remove lang_type_ptrmem.
294 * cp-tree.h (lang_type_header): Remove is_lang_type_class. Move
296 (lang_type_class): ... this. Reorder bitfields. Rename to ...
297 (lang_type): ... this. Delete old definition.
298 (lang_type_ptrmem): Delete.
299 (LANG_TYPE_CLASS_CHECK): Simply get TYPE_LANG_SPECIFIC. Adjust uses.
300 (LANG_TYPE_PTRMEM_CHECK): Delete.
301 (TYPE_GET_PTRMEMFUNC_TYPE, TYPE_SET_PTRMEMFUNC_TYPE): Delete.
302 (TYPE_PTRMEMFUNC_TYPE): New. Use TYPE_LANG_SLOT_1.
303 * decl.c (build_ptrmemfunc_type): Adjust.
304 * lex.c (copy_lang_type): Remove lang_type_ptrmem handling.
305 (maybe_add_lang_type_raw): Don't set u.c.h.is_lang_type_class.
307 * class.c (check_bases_and_members): Adjust vec_new_uses_cookie
310 Remove cp_binding_level::namespaces
311 * name-lookup.h (cp_binding_level): Lose namespaces field.
312 * name-lookup.c (add_decl_to_level): Chain namespaces on the names
314 (suggest_alternatives_for): Adjust for namespace list. Do
315 breadth-first search.
316 * decl2.c (collect_source_refs): Namespaces are on the regulr
318 (collect_ada_namespace): Likewise.
320 2017-06-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
322 * typeck.c (cp_build_binary_op): Implement the -Wsizeof_pointer_div
325 2017-06-01 Ville Voutilainen <ville.voutilainen@gmail.com>
328 * method.c (constructible_expr): Strip array types before calling
331 2017-06-01 Paolo Carlini <paolo.carlini@oracle.com>
334 * cvt.c (convert_to_void): Possibly call maybe_warn_nodiscard
335 for case INDIRECT_REF too in the main switch.
337 2017-05-31 Jason Merrill <jason@redhat.com>
339 PR c++/80840 - ICE with constexpr and reference
340 * pt.c (convert_nontype_argument): Don't test whether a decl is
341 value-dependent when binding to a reference.
343 2017-05-31 Nathan Sidwell <nathan@acm.org>
345 * cp-tree.h (lang_decl_slector): New enum.
346 (lang_decl_base): Make selector an enum. Drop decomposition_p
348 (lang_decl): Use enum for discrimination.
349 (LANG_DECL_FN_CHECK, LANG_DECL_NS_CHECK, LANG_DECL_PARM_CHECK,
350 LANG_DECL_DEOMP_CHECK): Use enum.
351 (DECL_DECOMPOSITION_P): Use selector value.
352 (SET_DECL_DECOMPOSITION_P): Delete.
353 (retrofit_lang_decl): Lose SEL parm.
354 (fit_decomposition_lang_decl): Declare.
355 * decl.c (cp_finish_decomp, grokdeclarator): Use
356 fit_decomposition_lang_decl.
357 * lex.c (maybe_add_lang_decl_raw): New. Broken out of
359 (set_decl_linkage): New. Broken out of retrofit_lang_decl. Use enum.
360 (fit_decomposition_lang_decl): Likewise.
361 (retrofit_lang_decl): Use worker functions.
362 (cxx_dup_lang_specific_decl): Use selector enum.
363 (maybe_add_lang_type_raw): New. Broken out of ...
364 (cxx_make_type_name): ... here. Call it.
366 2017-05-30 Jason Merrill <jason@redhat.com>
368 PR c++/80856 - ICE with local extern in template
369 * semantics.c (finish_call_expr): Replace a local extern overload
370 set in a template with the IDENTIFIER_NODE.
372 2017-05-30 David Malcolm <dmalcolm@redhat.com>
374 * call.c (perform_implicit_conversion_flags): Convert
375 "from %qT to %qT" to "from %qH to %qI" in diagnostic.
376 (print_conversion_rejection): Replace pairs of %qT with
377 %qH and %qI in various places.
378 (build_user_type_conversion_1): Likewise.
379 (build_integral_nontype_arg_conv): Likewise.
380 (build_conditional_expr_1): Likewise.
381 (convert_like_real): Likewise.
382 (convert_arg_to_ellipsis): Likewise.
384 (initialize_reference): Likewise.
385 * cvt.c (cp_convert_to_pointer): Likewise.
386 (cp_convert_to_pointer): Likewise.
387 (convert_to_reference): Likewise.
388 (ocp_convert): Likewise.
389 * error.c (cp_printer): Gain bool and const char ** parameters.
390 (struct deferred_printed_type): New struct.
391 (class cxx_format_postprocessor): New class.
392 (cxx_initialize_diagnostics): Wire up a cxx_format_postprocessor
393 to pp->m_format_postprocessor.
394 (comparable_template_types_p): New function.
395 (newline_and_indent): New function.
396 (arg_to_string): New function.
397 (print_nonequal_arg): New function.
398 (print_template_differences): New function.
399 (type_to_string_with_compare): New function.
400 (print_template_tree_comparison): New function.
401 (append_formatted_chunk): New function.
402 (add_quotes): New function.
403 (cxx_format_postprocessor::handle): New function.
404 (defer_phase_2_of_type_diff): New function.
405 (cp_printer): Add "quoted" and "buffer_ptr" params. Implement
407 * typeck.c (cp_build_binary_op): Replace pairs of %qT with
408 %qH and %qI in various places.
409 (convert_member_func_to_ptr): Likewise.
410 (build_reinterpret_cast_1): Likewise.
411 (convert_for_assignment): Likewise.
412 * typeck2.c (check_narrowing): Likewise.
414 2017-05-30 Nathan Sidwell <nathan@acm.org>
416 Kill IDENTIFIER_NAMESPACE_BINDINGS
417 * cp-tree.h (lang_identifier): Delete namespace_bindings.
418 (IDENTIFIER_NAMESPACE_BINDINGS): Delete.
419 (lang_decl_ns): Add bindings.
420 (DECL_NAMESPACE_BINDINGS): New.
421 * lex.c (retrofit_lang_decl): Create namespace hash table.
422 * name-lookup.c (find_namespace_slot): Change to use hash-map.
423 * ptree.c (cxx_print_binding): Delete.
424 (cxx_print_identifier): Remove NAMESPACE_BINDING printing.
426 * cp-tree.def (OVERLOAD): Fix comment.
427 * cp-tree.h: Fix comments and whitespace.
428 * error.c (dump_decl): Use pp_cxx_colon_colon, ovl_scope.
429 * name-lookup.c (add_decl_to_level): Assert not class.
430 (check_local_shadow): Use OVL_P.
431 (pushdecl_with_scope_1): Rename to ...
432 (do_pushdecl_with_Scope): ... here.
433 (do_nonmember_using_decl): Use qualified_namespace_lookup return
435 (push_class_level_binding_1): Use OVL_P.
436 (pushdecl_namespace_level): Use do_pushdecl_with_scope.
437 (pushtag_1): Rename to ...
438 (do_pushtag): ... here. Adjust do_pushdecl_with_scope call.
440 (store_class_bindings): Do not time here.
441 * name-lookup.h (pushdecl_outermost_localscope): Reorder.
442 * pt.c (listify): Declare argvec at point of initialization.
445 * name-lookup.c (add_decl_to_level): Assert not making a circular
447 (update_binding): Don't prematurely slide artificial decl.
449 2017-05-29 Alexandre Oliva <aoliva@redhat.com>
451 * cp-tree.h (lang_identifier): Drop oracle_looked_up, unused.
453 2017-05-29 Nathan Sidwell <nathan@acm.org>
456 * cp-tree.h (lookup_maybe_add): Add DEDUPING argument.
457 * name-lookup.c (name_lookup): Add deduping field.
458 (name_lookup::preserve_state, name_lookup::restore_state): Deal
460 (name_lookup::add_overload): New.
461 (name_lookup::add_value, name_lookup::add_fns): Call add_overload.
462 (name_lookup::search_adl): Set deduping. Don't unmark here.
463 * pt.c (most_specialized_instantiation): Revert previous change,
464 Assert not given duplicates.
465 * tree.c (lookup_mark): Just mark the underlying decls.
466 (lookup_maybe_add): Dedup using marked decls.
469 * ptree.c (cxx_print_xnode): Show internal OVERLOAD structure.
470 * tree.c (ovl_insert, ovl_iterator_remove_node): Fix copying assert.
472 Stat hack representation
473 * name-lookup.c (STAT_HACK_P, STAT_TYPE, STAT_DECL,
474 MAYBE_STAT_DECL, MAYBE_STAT_TYPE): New.
476 (find_namespace_binding): Replace with ...
477 (find_namespace_slot): ... this.
478 (find_namespace_value): New.
479 (name_lookup::search_namespace_only,
480 name_lookup::adl_namespace_only): Adjust.
481 (update_binding): Add SLOT parameter, adjust.
482 (check_local_shadow): Use find_namespace_value.
483 (set_local_extern_decl_linkage): Likewise.
484 (do_pushdecl): Adjust for namespace slot.
485 (push_local_binding): Assert not a namespace binding.
486 (check_for_out_of_scope_variable): Use find_namespace_value.
487 (set_identifier_type_value_with_scope): Likewise.
488 (get_namespace_binding): Likewise.
489 (set_namespace_binding): Delete.
490 (set_global_binding): Directly update the binding.
491 (finish_namespace_using_decl): Likewise.
492 (lookup_type_scope_1): Use find_namespace_slot and update.
493 (do_push_nested_namespace): Use find_namespace_value.
496 * pt.c (most_specialized_instantiation): Cope with duplicate
500 * cp-tree.h (build_min_nt_call_vec): Declare.
501 * decl.c (build_offset_ref_call_from_tree): Call it.
502 * parser.c (cp_parser_postfix_expression): Likewise.
503 * pt.c (tsubst_copy_and_build): Likewise.
504 * semantics.c (finish_call_expr): Likewise.
505 * tree.c (build_min_nt_loc): Keep unresolved lookups.
506 (build_min): Likewise.
507 (build_min_non_dep): Likewise.
508 (build_min_non_dep_call_vec): Likewise.
509 (build_min_nt_call_vec): New.
512 * tree.c (ovl_copy): Adjust assert, copy OVL_LOOKUP.
514 (lookup_keep): Call it.
516 2017-05-26 Nathan Sidwell <nathan@acm.org>
519 * name-lookup.c (push_inline_namespaces): New.
520 (push_namespace): Look inside inline namespaces.
522 Inline and using namespace representation change.
523 * cp-tree.h (struct lang_decl_ns): Delete ns_using. Add usings,
525 (DECL_NAMESPACE_USING): Adjust.
526 (DECL_NAMESPACE_INLINEES): New.
527 * name-lookup.h (struct cp_binding_level): Change usings
529 * name-lookup.c (name_lookup::do_queue_usings,
530 name_lookup::queue_usings): Adjust.
531 (name_lookup::search_namespace, name_lookup::search_usings,
532 name_lookup::queue_namespace): Adjust.
533 (name_lookup::adl_namespace_only): Adjust.
534 (add_using_namespace, push_namespace): Push onto vector.
535 (pop_namespace): Add timing logic.
537 * call.c (build_operator_new_call): Do namelookup and ADL here.
538 (build_new_op_1): Likewise.
539 * name-lookup.h (lookup_function_nonclass): Delete declaration.
540 (do_using_directive): Likewise.
541 * name-lookup.c (set_namespace_binding, push_local_binding): Don't
543 (struct scope_binding): Delete.
544 (EMPTY_SCOPE_BINDING): Delete.
545 (set_decl_namespace): Use OVL_P.
546 (finish_local_using_decl): Lose unnecesary checks.
547 (lookup_function_nonclass): Delete.
548 (cp_emit_debug_info_for_using): Use MAYBE_BASELINK_P.
550 * cp-tree.h (OVL_CHAIN): Check looking at OVERLOAD.
551 (ovl_iterator): Add allow_inner field. Adjust ctor. Make
553 (ovl_iterator::maybe_push, ovl_iterator::pop): New.
554 (lkp_iterator): Add outer field. Adjust ctor.
555 (lkp_iterator::operator++): New.
556 (lookup_mark, lookup_maybe_add): Declare.
557 * name-lookup.c (name_lookup): Delete fn_set member.
558 (name_lookup::preserve_state, name_lookup::restore_state): Unmark
560 (name_lookup::add_value): Use lookup_add directly.
561 (name_lookup::add_fns: Use lookup_maybe_add.
562 (name_lookup::search_adl): Mark and unmark fns.
564 * pt.c (check_explicit_specialization): Use lookup_add directly.
565 * ptree.c (cxx_print_xnode): Show complete overload structure.
566 * tree.c (lookup_mark, lookup_maybe_add): New.
568 * name-lookup.c (name_lookup::search_adl): ADL OMP UDR type args.
570 2017-05-26 Jakub Jelinek <jakub@redhat.com>
572 * cp-tree.h (struct lang_decl_decomp): New type.
573 (struct lang_decl): Add u.decomp.
574 (LANG_DECL_DECOMP_CHECK): Define.
575 (DECL_DECOMPOSITION_P): Note it is set also on the vars
576 for user identifiers.
577 (DECL_DECOMP_BASE): Define.
578 (retrofit_lang_decl): Add extra int = 0 argument.
579 * lex.c (retrofit_lang_decl): Add SEL argument, if non-zero
580 use it to influence the selector choices and for selector
581 0 to non-zero transition copy old content.
582 (cxx_dup_lang_specific_decl): Handle DECL_DECOMPOSITION_P.
583 * decl.c (poplevel): For DECL_DECOMPOSITION_P, check
584 !DECL_DECOMP_BASE instead of !DECL_VALUE_EXPR. Adjust warning
585 wording if decl is a structured binding.
586 (cp_finish_decomp): Pass 4 as the new argument to retrofit_lang_decl.
587 Set DECL_DECOMP_BASE. Ignore DECL_READ_P sets from initialization
588 of individual variables for tuple structured bindings.
589 (grokdeclarator): Pass 4 as the new argument to retrofit_lang_decl.
590 Clear DECL_DECOMP_BASE.
591 * decl2.c (mark_used): Mark DECL_DECOMP_BASE TREE_USED as well.
592 * pt.c (tsubst_decomp_names): Assert DECL_DECOMP_BASE matches what
594 * expr.c (mark_exp_read): Recurse on DECL_DECOMP_BASE instead of
597 2017-05-25 Jason Merrill <jason@redhat.com>
599 PR c++/80605 - __is_standard_layout and zero-length array
600 * class.c (check_bases): Use DECL_FIELD_IS_BASE.
602 2017-05-25 Nathan Sidwell <nathan@acm.org>
604 Kill OVL_CURRENT, OVL_NEXT.
605 * cp-tree.h (OVL_CURRENT, OVL_NEXT): Delete.
606 * name-lookup.c (set_decl_namespace): Use ovl_iterator.
607 (consider_binding_level): Use OVL_FIRST.
608 (cp_emit_debug_info_for_using): Use lkp_iterator.
609 * pt.c (check_explicit_specialization): Use ovl_iterator.
611 Kill DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS.
612 * cp-tree.h (lang_decl_ns): Remove ns_users field.
613 (DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS): Delete.
614 (TREE_INDIRECT_USING): Delete.
615 * name-lookup.h (is_associated_namespace): Delete.
616 * name-lookup.c (name_lookup::search_usings,
617 name_lookup::do_queue_usings): Usings are always direct.
618 (is_associated_namespace): Delete.
619 (handle_namespace_attrs): Use DECL_NAMESPACE_INLINE_P.
620 (namespace_ancestor_1, namespace_ancestor): Delete.
621 (push_using_directive_1, push_using_directive): Delete.
622 (add_using_namespace_1): Delete.
623 (add_using_namespace): Reimplement.
624 (emit_debug_info_using_namespace): New.
625 (finish_namespace_using_directive, finish_local_using_directive,
626 push_namespace): Adjust.
627 * tree.c (cp_free_lang_data): Remove DECL_NAMESPACE_USERS handling.
629 2017-05-25 Volker Reichelt <v.reichelt@netcologne.de>
631 * semantics.c (finish_handler_parms): Warn about non-reference type
634 2017-05-25 Nathan Sidwell <nathan@acm.org>
636 Reimplement unqualified namespace lookup.
637 * name-lookup.c (name_lookup::using_pair,
638 name_lookup::using_queue): New typedefs.
639 (name_lookup::queue_namespace, name_lookup::do_queue_usings,
640 name_lookup::queue_usings): New.
641 (name_lookup::search_unqualified): New.
642 (merge_functions, same_entity_p, ambiguous_decl,
643 unqualified_namespace_lookup_1, unqualified_namespace_lookup,
644 lookup_using_namespace): Delete.
645 (lookup_name_real_1): Adjust.
647 Reimplement qualified namespace lookup.
648 * name-lookup.c (name_lookup::flags): New member. Adjust ctor.
649 (name_lookup::ambiguous, name_lookup::add_value,
650 name_lookup::add_type, name_lookup::process_binding): New.
651 (name_lookup::search_namespace_only,
652 name_lookup::search_namespace, name_lookup::search_usings): New.
653 (name_lookup::search_qualified): New.
654 (do_nonmember_using_decl, suggest_alternatives_for,
655 lookup_qualified_name): Adjust.
656 (tree_vec_contains): Delete.
657 (qualified_lookup_using_namespace): Rename to ...
658 (qualified_namespace_lookup): ... here. Reimplement.
661 * cp-tree.h (LOOKUP_SEEN_P, LOOKUP_FOUND_P): New.
662 * name-lookup.h (lookup_arg_dependent): Return plain tree.
663 * name-lookup.c (arg_lookup, arg_assoc, arg_assoc_args,
664 arg_assoc_args_vec, arg_assoc_type, add_function,
665 arg_assoc_namespace, arg_assoc_class_only, arg_assoc_bases,
666 arg_assoc_class, arg_assoc_template_arg, arg_assoc,
667 lookup_arg_dependent_1): Delete.
668 (name_lookup): New lookup object.
669 (name_lookup::preserve_state, name_lookup::restore_state,
670 name_lookup::mark_seen, name_lookup::find_and_mark,
671 name_lookup::add_fns, name_lookup::adl_namespace_only,
672 name_lookup::adl_namespace, name_lookup::adl_class_only,
673 name_lookup::adl_bases, name_lookup::adl_class,
674 name_lookup::adl_expr, name_lookup::adl_type,
675 name_lookup::adl_template_arg, name_lookup::search_adl): New.
676 (lookup_arg_dependent): Return a plain tree. Adjust.
677 (is_associated_namespace): Move later.
679 2017-05-24 Nathan Sidwell <nathan@acm.org>
681 * friend.c (do_friend): Remove check for existing decl.
682 * name-lookup.h (lookup_name_innermost_nonclass_level): Delete.
683 * name-lookup.c (push_local_binding): Directly look for binding.
684 (lookup_name_innermost_nonclass_level_1): Delete.
685 (lookup_name_innermost_nonclass_level): Delete.
687 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Alphabetize.
689 * cp-tree.h (cp_free_lang_data): Add extern.
690 (ovl_skip_hidden, is_overloaded_fn, really_overloaded_fn): Add
692 (type_unknown_p): Return bool, make inline, lose TREE_LIST check.
693 * typeck.c (type_unknown_p): Delete.
694 * tree.c (is_overloaded_fn): Use MAYBE_BASELINE_FUNCTIONS, adjust
696 (dependent_name): Likewise.
697 (decl_anon_ns_mem_p): Simplify.
699 2017-05-24 Jonathan Wakely <jwakely@redhat.com>
702 * tree.c (reshape_init): Use unqualified type for direct enum init.
703 * typeck.c (maybe_warn_about_cast_ignoring_quals): New.
704 (build_static_cast_1, build_reinterpret_cast_1): Strip cv-quals from
705 non-class destination types.
706 (build_const_cast_1): Strip cv-quals from destination types.
707 (build_static_cast, build_reinterpret_cast, build_const_cast)
708 (cp_build_c_cast): Add calls to maybe_warn_about_cast_ignoring_quals.
710 2017-05-24 Martin Sebor <msebor@redhat.com>
713 * call.c (fully_fold_internal): Adjust.
715 2017-05-24 Nathan Sidwell <nathan@acm.org>
717 * cp-tree.h (ovl_skip_hidden): Declare.
718 * tree.c (ovl_skip_hidden): New.
719 * name-lookup.c (arg_assoc_namespace): Call ovl_skip_hidden.
720 (lookup_arg_dependent_1): Likewise.
721 (ambiguous_decl): Use DECL_HIDDEN_P, ovl_skip_hidden.
722 (hidden_name_p, remove_hidden_names): Delete.
723 (lookup_name_real_1): Do not strip hidden names.
724 * name-lookup.h (hidden_name_p, remove_hidden_names): Delete.
726 * cp-tree.h (OVL_HIDDEN_P): New.
727 (ovl_iterator::hidden_p, ovl_iterator::reveal_node): New.
728 (ovl_iterator::reveal_node): Declare.
729 * tree.c (ovl_copy): Copy OVL_HIDDEN_P.
730 (ovl_insert): Order on hiddenness.
731 (ovl_iterator::reveal_node): New.
732 * name-lookup.c (anticipated_builtin_p): New.
733 (supplement_binding_1): Use it.
734 (set_local_extern_decl_linkage): Use hidden_p.
735 (do_pushdecl): Deal with unhiding a hidden decl, use
736 anticipated_builtin_p.
737 (do_nonmember_using_decl): Use anticipated_decl_p.
738 (lookup_name_real_1): Use DECL_HIDDEN_P.
740 2017-05-23 Jason Merrill <jason@redhat.com>
742 -Wunused and C++17 structured bindings
743 * decl.c (poplevel): Don't warn about unused structured bindings,
745 * error.c (dump_simple_decl): Handle structured bindings.
746 * expr.c (mark_exp_read): Look through DECL_VALUE_EXPR.
748 2017-05-23 Nathan Sidwell <nathan@acm.org>
750 * cp-tree.h (PUSH_GLOBAL, PUSH_LOCAL, PUSH_USING): Delete.
751 * name-lookup.c (create_local_binding): New.
752 (update_binding): New.
753 (pushdecl_maybe_friend_1): Rename to ...
754 (do_pushdecl): ... this. Reimplement.
756 (push_overloaded_decl_1, push_overloaded_decl): Delete.
758 2017-05-23 Jason Merrill <jason@redhat.com>
760 PR c++/80396 - built-in for make_integer_sequence.
761 * pt.c (builtin_pack_fn_p, builtin_pack_call_p)
762 (expand_integer_pack, expand_builtin_pack_call): New.
763 (find_parameter_packs_r): Check builtin_pack_call_p.
764 (check_for_bare_parameter_packs): Handle it.
765 (tsubst_pack_expansion): Call expand_builtin_pack_call.
766 (declare_integer_pack): New.
767 (init_template_processing): Call it.
768 * decl2.c (mark_used): Check builtin_pack_fn_p.
770 2017-05-23 Nathan Sidwell <nathan@acm.org>
772 * name-lookup.c (find_namespace_binding): New.
773 (pushdecl_maybe_friend_1): Use CP_DECL_CONTEXT.
774 (set_identifier_type_value_with_scope): Use find_namespace_binding.
775 (find_binding, cp_binding_level_find_binding_for_name,
776 binding_for_name, namespace_binding_1): Delete.
777 (push_overloaded_decl_1): Use CP_DECL_CONTEXT.
778 (get_namespace_binding, set_namespace_binding,
779 finish_namespace_using_decl, unqualified_namespace_lookup_1,
780 qualified_lookup_using_namespace, lookup_type_scope_1,
781 lookup_name_innermost_nonclass_level_1): Use find_namespace_binding.
784 * parser.c (cp_parser_template_id): Keep the lookup when stashing
787 * cp-tree.h (DECL_HIDDEN_P): New.
788 * name-lookup.c (set_decl_context,
789 set_local_extern_decl_linkage): New, broken out of ...
790 (pushdecl_maybe_friend_1): ... here. Call them.
792 2017-05-23 Thomas Schwinge <thomas@codesourcery.com>
794 * parser.c (OACC_KERNELS_CLAUSE_MASK): Add
795 "PRAGMA_OACC_CLAUSE_NUM_GANGS", "PRAGMA_OACC_CLAUSE_NUM_WORKERS",
798 2017-05-23 Nathan Sidwell <nathan@acm.org>
800 * cp-tree.h (OVL_P): New.
801 * name-lookup.h (push_local_binding): Delete.
802 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
803 (finish_namespace_using_decl, finish_local_using_decl): ... here
804 * name-lookup.c (add_decl_to_level): Swap args.
805 (pop_bindings_and_leave_scope): Look inside TREE_LIST.
806 (diagnose_name_conflict): Check contexts are same for redecl.
807 (update_local_overload): New.
808 (compparms_for_decl_and_using): Rename to ...
809 (matching_fn_p): ... here.
810 (pushdecl_maybe_friend_1): Adjust add_decl_to_level,
811 push_local_bindings call.
812 (push_local_binding): Make static, replace FLAGS arg with
814 (validate_nonmember_using_decl): Use OVL_FIRST.
815 (do_nonmember_using_decl): Use in/out parameters. Use
816 lkp_iterator and simplify.
817 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
818 (finish_namespace_using_decl, finish_local_using_decl): ... here.
820 (lookup_type_current_level): Delete.
821 * parser.c (cp_parser_using_declaration): Adjust.
822 * pt.c (tsubst_expr): Adjust.
824 2017-05-22 Nathan Sidwell <nathan@acm.org>
826 * name-lookup.h (parse_using_directive): Replace with ...
827 (finish_namespace_using_directive): ... this and ...
828 (finish_local_using_directive): ... this.
829 * name-lookup.c (add_using_namespace_1): Move later.
830 (add_using_namespace): Move later, add namespace_p arg, remove
832 (push_using_directive_1): Directly recurse.
833 (do_using_directive, parse_using_directive): Delete, split into ...
834 (finish_namespace_using_directive): ... this and ...
835 (finish_local_using_directive): ... this.
836 (push_namespace): Use add_using_namespace.
837 * parser.c (cp_parser_using_directive): Call
838 finish_namespace_using_directive or finish_local_using_directive.
839 * pt.c (tsubst_expr): Call finish_local_using_directive.
841 * cp-objcp-common.c (cp_register_dumps): Register raw dumper.
842 * cp-tree.h (raw_dump_id): Declare.
843 * decl2.c (raw_dump_id): Define.
844 (dump_tu): Use raw_dump_id.
846 * config-lang.in (gtfiles): Sort list, break lines.
848 * cp-tree.h (CPTI_TERMINATE, CPTI_CALL_UNEXPECTED): Rename to ...
849 (CPTI_TERMINATE_FN, CPTI_CALL_UNEXPECTED_FN): ... here.
850 ( CPTI_GET_EXCEPTION_PTR_FN, CPTI_BEGIN_CATCH_FN, CPTI_END_CATCH_FN,
851 CPTI_ALLOCATE_EXCEPTION_FN, CPTI_FREE_EXCEPTION_FN, CPTI_THROW_FN,
852 CPTI_RETHROW_FN): New.
853 (noexcept_deferred_spec): New.
854 (terminate_node, call_unexpected_node): Rename to ...
855 (terminate_fn, call_unexpected_fn): ... here.
856 (get_exception_ptr_fn, begin_catch_fn, end_catch_fn,
857 allocate_exception_fn, free_exception_fn, throw_fn, rethrow_fn): New.
858 * except.c (fn1..fn5, throw_fn, rethrow_rn, spec): Delete.
859 (init_exception_processing): Adjust.
860 (declare_library_fn): Create and push the fns here.
861 (do_get_exception_ptr, do_begin_catch, do_end_catch,
862 do_allocate_exception_ptr, do_free_exception_ptr): Adjust
863 declare_library_fn use.
864 (unevaluated_noexcept_spec): Adjust.
865 * cp-gimplify.c (genericize_eh_spec_block,
866 gimplify_most_not_throw_expr): Adjust.
868 * name-lookup.c (pushdecl_top_level,
869 pushdecl_top_level_and_finish): Move after namespace pushing and
871 (push_to_top_level): Rename to ...
872 (do_push_to_top_level): ... here. Remove timing code.
873 (pop_from_top_level_1): Rename to ...
874 (do_pop_from_top_level): ... here.
875 (do_push_nested_namespace, do_pop_nested_namespace)
876 (push_to_top_level): New wrapper for do_push_to_top_level.
877 (pop_from_top_level): Adjust.
878 (push_nested_namepace, pop_nested_namespace): Wrappers for workers.
880 2017-05-19 Bernd Edlinger <bernd.edlinger@hotmail.de>
882 * config-lang.in (gtfiles): Add c-family/c-format.c,
883 except.c, init.c, lambda.c and friend.c.
884 * class.c (dvirt_fn): Move out of function scope,
886 * except.c (fn1-5, throw_fn, rethrow_fn, spec): Likewise.
887 * init.c (fn): Likewise.
888 * lambda.c (ptr_id, max_id): Likewise.
889 * friend.c (global_friend): Add GTY attribute.
891 2017-05-19 Nathan Sidwell <nathan@acm.org>
893 * call.c (add_list_candidates): Use OVL_FIRST.
894 (build_new_method_call_1): Likewise.
895 * cp-tree.h (OVL_SINGLE_P): New.
896 (TYPE_HIDDEN_P): New.
897 * decl.c (xref_tag_1): Use TYPE_HIDDEN_P.
898 * dump.c (cp_tump_tree): Adjust overload dumping.
899 * error.c (dump_decl): Use OVL_SINGLE_P, simplify context
901 * method.c (lazily_declare_fn): Assert we added it.
902 * parser.c (cp_parser_nested_name_specifier): Use OVL_SINGLE_P,
904 (cp_parser_template_name): Use lkp_iterator.
905 * pt.c (begin_template_parm_list): Fixup comment.
906 (instantiate_class_template_1): Use TYPE_HIDDEN_P.
907 * tree.c (ovl_iterator::remove_node): Cope with inherited ctors.
908 (ovl_scope): Use lkp_iterator.
910 2017-05-19 Thomas Schwinge <thomas@codesourcery.com>
912 * parser.c (cp_parser_omp_clause_default): Handle
913 "OMP_CLAUSE_DEFAULT_PRESENT".
915 * parser.c (cp_parser_omp_clause_default): Avoid printing more
916 than one syntax error message.
918 2017-05-19 Nathan Sidwell <nathan@acm.org>
920 * class.c (class_dump_id): Define.
921 (dump_class_hierarchy, dump_vtable, dump_vtt): Use it.
922 * cp-objcp-common.c (cp_register_dumps): New.
923 * cp-objcp-common.h (cp_register_dumps): Declare.
924 (LANG_HOOKS_REGISTER_DUMPS): Override.
925 * cp-tree.h (class_dump_id): Declare.
927 2017-05-18 Nathan Sidwell <nathan@acm.org>
929 * cp-tree.h (OVL_ARG_DEPENDENT): Delete.
931 (lookup_keep): Declare.
932 * name-lookup.c (add_function): Don't set OVL_ARG_DEPENDENT.
933 * pt.c (tsubst_copy): Assert lookup is persistent.
934 * semantics.c (finish_call_expr): Use lkp_iterator, call
936 * tree.c (ovl_copy): New.
937 (ovl_insert, ovl_iterator::remove_node): Copy immutable nodes.
940 * cp-tree.h (OVL_USED): Replace with ...
941 (OVL_USING_P): ... this.
942 (ovl_iterator::using_p): Adjust.
943 * name-lookup.c (push_overloaded_decl_1,
944 do_nonmember_using_decl): Adjust.
945 * search.c (lookup_field_r): Adjust.
946 * tree.c (ovl_insert, ovl_scope): Adjust.
948 * cp-tree.h (lookup_add): Swap args.
949 (ovl_cons, build_overload): Delete.
950 * name-lookup.c (add_function, push_overloaded_decl_1,
951 do_nonmember_using_decl, merge_functions, remove_hidden_names):
952 Use lookup_add, ovl_insert.
953 * pt.c (check_explicit_specialization): Use lookup_add.
954 (do_class_deduction): Likewise. Refactor if.
955 * tree.c (lookup_add): Swap args.
956 (ovl_cons, build_overload): Delete.
958 * name-lookup.c (find_local_binding): New, broken out of ...
959 (lookup_name_innermost_nonclass_level_1): ... here. Call it.
960 (set_namespace_binding): Swap scope & name args.
961 (namespace_binding_1): Likewise.
962 (pushdecl_maybe_friend_1): Adjust set_namespace_binding call.
963 (push_overloaded_decl_1): Likewise.
964 (set_global_binding): Likewise.
965 (get_namespace_binding): Adjust namespace_binding_1 call.
967 2017-05-17 Nathan Sidwell <nathan@acm.org>
969 * cp-tree.h (default_hash_traits <lang_identifier *>): New
971 * name-lookup.c (lookup_extern_c_fun_in_all_ns): Delete.
972 (extern_c_fns): New hash table.
973 (check_extern_c_conflict): New, broken out of ...
974 (pushdecl_maybe_friend_1): ... here. Call it.
975 (c_linkage_bindings): Just look in hash table.
977 2017-05-17 Ville Voutilainen <ville.voutilainen@gmail.com>
981 Implement new C++ intrinsics __is_assignable and __is_constructible.
982 * cp-tree.h (CPTK_IS_ASSIGNABLE, CPTK_IS_CONSTRUCTIBLE): New.
984 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
985 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
986 * method.c (constructible_expr): Set cp_unevaluated.
987 (is_xible_helper): New.
988 (is_trivially_xible): Adjust.
990 * parser.c (cp_parser_primary_expression): Handle
991 RID_IS_ASSIGNABLE and RID_IS_CONSTRUCTIBLE.
992 (cp_parser_trait_expr): Likewise.
993 * semantics.c (trait_expr_value): Handle
994 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
996 2017-05-17 Nathan Sidwell <nathan@acm.org>
998 * cp-tree.h (ovl_iterator::using_p): New predicate.
999 (ovl_iterator::remove_node): New worker.
1000 (ovl_insert): Declare.
1001 * tree.c (ovl_insert): New.
1002 (ovl_iterator::remove_node): New.
1003 * class.c (add_method): Use ovl_iterator, ovl_insert.
1004 (clone_function_decl): Fix description.
1005 (clone_constructors_and_destructors): Use ovl_iterator.
1007 * class.c (handle_using_decl): Use OVL_FIRST, ovl_iterator.
1008 (maybe_warn_about_overly_private_class): Use ovl_iterator.
1009 (method_name_cmp, resort_method_name_cmp): Use OVL_NAME.
1010 (resort_type_method_vec, finish_struct_methods): Use OVL_FIRST.
1011 (get_base_fndecls): Use ovl_iterator.
1012 (warn_hidden): Use OVL_NAME, ovl_iterator.
1013 (add_implicitly_declared_members): Use ovl_iterator.
1014 * constraint.cc (normalize_template_id_expression): Use OVL_FIRST,
1016 (finish_shorthand_constraint): Simplify, use ovl_make.
1017 * pt.c (make_constrained_auto): Simplify. Use ovl_make.
1018 * search.c (shared_member_p): Use ovl_iterator.
1019 (lookup_field_fuzzy_info::fuzzy_lookup_fn): Use OVL_NAME.
1020 (lookup_conversion_operator): Use OVL_FIRST.
1021 (lookup_fnfiels_idx_nolazy): Use OVL_FIRST, OVL_NAME.
1022 (look_for_overrides_here): Use ovl_iterator.
1023 (lookup_conversions_r): Use OVL_FIRST, OVL_NAME, ovl_iterator.
1024 * typeck.c (build_x_unary_op): Use ovl_make.
1026 2017-05-17 Martin Liska <mliska@suse.cz>
1028 * class.c (dump_class_hierarchy): Introduce dump_flags_t type and
1029 use it instead of int type.
1030 (dump_vtable): Likewise.
1031 (dump_vtt): Likewise.
1032 * decl2.c (dump_tu): Likewise.
1034 2017-05-16 David Malcolm <dmalcolm@redhat.com>
1036 * call.c (enforce_access): Add access_failure_info * param and use
1037 it to record access failures.
1038 * cp-tree.h (class access_failure_info): New class.
1039 (enforce_access): Add access_failure_info * param, defaulting to
1041 (lookup_member): Likewise.
1042 (locate_field_accessor): New function decl.
1043 (perform_or_defer_access_check): Add access_failure_info * param,
1045 * search.c (lookup_member): Add access_failure_info * param and
1046 pass it on to call to perform_or_defer_access_check.
1047 (matches_code_and_type_p): New function.
1048 (field_access_p): New function.
1049 (direct_accessor_p): New function.
1050 (reference_accessor_p): New function.
1051 (field_accessor_p): New function.
1052 (struct locate_field_data): New struct.
1053 (dfs_locate_field_accessor_pre): New function.
1054 (locate_field_accessor): New function.
1055 * semantics.c (perform_or_defer_access_check): Add
1056 access_failure_info * param, and pass it on to call to
1058 * typeck.c (access_failure_info::record_access_failure): New method.
1059 (access_failure_info::maybe_suggest_accessor): New method.
1060 (finish_class_member_access_expr): Pass an access_failure_info
1061 instance to the lookup_member call, and call its
1062 maybe_suggest_accessor method afterwards.
1064 2017-05-16 Marek Polacek <polacek@redhat.com>
1068 * cp-gimplify.c (cp_fold): Handle SAVE_EXPR.
1070 2017-05-16 Nathan Sidwell <nathan@acm.org>
1072 * name-lookup.c (check_local_shadow): New, broke out of ...
1073 (pushdecl_maybe_friend_1): ... here. Call it.
1075 * cp-tree.h (OVL_NESTED_P, OVL_LOOKUP_P): New.
1076 (ovl_first): Move inline definition to end of file.
1077 (ovl_make, lookup_add): Declare.
1078 (get_fns, get_first_fn): Make pure.
1079 * tree.c (ovl_cache): New.
1080 (ovl_make, lookup_add): New.
1081 * pt.c (do_class_deduction): Don't add candidates that will be
1084 * call.c (build_user_type_conversion_1): Use OVL_FIRST.
1085 (print_error_for_call_failure): Use OVL_NAME.
1086 (build_op_call_1): Use ovl_iterator.
1087 (add_candidates): Use OVL_FIRST & lkp_iterator.
1088 (build_op_delete_call): Use MAYBE_BASELINK_FUNCTIONS &
1090 * class.c (deduce_noexcept_on_destructors): Use ovl_iterator.
1091 (type_has_user_nondefault_constructor,
1092 in_class_defaulted_default_constructor,
1093 type_has_user_provided_constructor,
1094 type_has_user_provided_or_explicit_constructor,
1095 type_has_non_user_provided_default_constructor,
1096 vbase_has_user_provided_move_assign,
1097 type_has_move_constructor, type_has_move_assign,
1098 type_has_user_declared_move_constructor,
1099 type_has_user_declared_move_assign,
1100 type_build_ctor_call, type_build_dtor_call,
1101 type_requires_array_cookie, explain_non_literal_class): Likewise.
1102 (finish_struct): Use lkp_iterator.
1103 (resolve_address_of_overloaded_function): Use OVL_NAME, lkp_iterator.
1104 (note_name_declared_in_class): Use OVL_NAME.
1105 * cxx-pretty-print.c (pp_cxx_unqualified_id): Use OVL_FIRST.
1106 (pp_cxx_qualified_id, cxx_pretty_printer::id_expression,
1107 cxx_pretty_printer::expression): Likewise.
1108 * decl2.c (check_classfn): Use ovl_iterator.
1109 * pt.c (retrieve_specialization): Use ovl_iterator.
1110 * tree.c (cp_tree_equal): Use lkp_iterator.
1111 (type_has_nontrivial_copy_init): Use ovl_iterator.
1113 * typeck2.c (cxx_incomplete_type_diagnostic): Revert change and
1114 check is_overloaded_fn.
1116 2017-05-16 Martin Liska <mliska@suse.cz>
1118 * parser.c (cp_lexer_print_token): Add default value for flags
1119 argument of print_gimple_stmt, print_gimple_expr,
1120 print_generic_stmt and print_generic_expr.
1122 2017-05-16 Nathan Sidwell <nathan@acm.org>
1124 * cp-tree.h (class ovl_iterator, class lkp_iterator): New OVERLOAD
1126 (MAYBE_BASELINK_FUNCTIONS): New.
1127 * constraint.cc (resolve_constraint_check): Use lkp_iterator.
1128 * decl2.c (maybe_warn_sized_delete): Use ovl_iterator.
1129 * lambda.c (maybe_generic_this_capture): Use lkp_iterator.
1130 * method.c (inherited_ctor_binfo): Use ovl_iterator.
1131 (binfo_inherited_from): Likewise.
1132 * parser.c (lookup_literal_operator): Use lkp_iterator.
1133 * pt.c (iterative_hash_template_arg): Use lkp_iterator.
1134 (print_candidates_1): Likewise.
1135 (determine_specialization): Likewise.
1136 (resolve_overloaded_unification): Likewise.
1137 (resolve_nondeduced_context): Likewise.
1138 (type_dependent_expression_p): Likewise.
1139 (dependent_template_p): Likewise.
1140 * ptree.c (cxx_print_xnode): Likewise.
1141 * semantics.c (omp_reduction_lookup): Use lkp_iterator.
1142 (classtype_has_nothrow_assign_or_copy_p): Use ovl_iterator.
1143 * typeck.c (check_template_keyword): Use lkp_iterator.
1145 * cp-tree.h (OVL_FIRST, OVL_NAME): New.
1147 * constexpr.c (function_concept_check): Use OVL_FIRST.
1148 * cvt.c (build_expr_type_conversion): Likewise.
1149 * decl.c (poplevel, grokdeclarator): Use OVL_NAME.
1150 * decl2.c (mark_used): Use OVL_FIRST.
1151 * error.c (dump_decl): Use OVL_FIRST, OVL_NAME.
1152 (dump_expr, location_of): Use OVL_FIRST.
1153 * friend.c (do_friend): Use OVL_NAME.
1154 * init.c (build_offset_ref): Use OVL_FIRST.
1155 * mangle.c (write_member_name): Likewise.
1156 (write_expression): Use OVL_NAME.
1157 * method.c (strip_inheriting_ctors): Use OVL_FIRST.
1158 * name-lookup.c (pushdecl_class_level): Use OVL_NAME.
1159 * pt.c (check_explicit_specialization): Use OVL_FIRST.
1160 (check_template_shadow): Likewise.
1161 (tsubst_template_args): Use OVL_NAME.
1162 (tsubst_baselink): Use OVL_FIRST.
1163 * semantics.c (perform_koenig_lookup): Use OVL_NAME.
1164 * tree.c (get_first_fn): Use OVL_FIRST.
1165 * typeck.c (finish_class_member_access_expr): Use OVL_NAME.
1166 (cp_build_addr_expr_1): Use OVL_FIRST.
1168 * pt.c (tsubst_copy_and_build): Remove unnecessary COMPONENT_REF
1170 * semantics.c (finish_id_expression): Directly init local var.
1171 (finish_omp_reduction_clause): Use really_overloaded_fn.
1172 * tree.c (get_fns): Document. Assert we got an overload.
1173 (get_first_fn) Document.
1174 * typeck.c (cp_build_addr_expr_1): Pass arg directly to
1175 really_overloaded_fn.
1176 * typeck2.c (cxx_incomplete_type_diagnostic): Use get_first_fn directly.
1178 * cp-tree.h (SCOPE_DEPTH): New.
1179 * name-lookup.h (is_nested_namespace): Declare.
1180 * name-lookup.c (is_nested_namespace): New.
1181 (is_ancestor): Use it.
1182 (set_decl_namespace): Likewise.
1183 (push_namespace): Set SCOPE_DEPTH.
1184 * pt.c (check_specialization_namespace): Use is_nested_namespace.
1185 (check_unqualigied_spec_or_inst): Likewise.
1187 2017-05-15 Nathan Sidwell <nathan@acm.org>
1190 * cp-tree.h (DECL_NAMESPACE_INLINE_P): New.
1191 * name-lookup.h (push_namespace): Return int, add make_inline arg.
1192 * name-lookup.c (push_namespace): Deal with inline directly.
1193 Return pushed count.
1194 * parser.c (cp_parser_namespace_definition): Adjust for
1195 push_namespace change.
1197 2017-05-11 Nathan Sidwell <nathan@acm.org>
1199 * cp-lang.c (get_global_decls, cxx_pushdecl, LANG_HOOK_GETDECLS,
1200 LANG_HOOKS_PUSHDECL): Move to ...
1201 * cp-objcp-common.c (cp_get_global_decls, cp_pushdec,
1202 LANG_HOOK_DECLS, LANG_HOOKS_PUSHDECL): ... here.
1203 * cp-objcp-common.h (cp_get_global_decls, cp_pushdecl): Declare.
1205 * name-lookup.h (pushdecl): Add default friend parm.
1206 (pushdecl_maybe_friend): Delete.
1207 (pushdecl_top_level): Add default friend parm.
1208 (pushdecl_top_level_maybe_friend): Delete.
1209 * name-lookup.c (pushdecl_maybe_friend): Delete.
1210 (pushdecl): Add is_friend parm.
1211 (pushdecl_top_level): Add is friend_parm.
1212 (pushdecl_top_level_maybe_friend, pushdecl_top_level_1): Delete.
1213 (pushdecl_top_level_and_finish): Do pushing and finishing directly.
1214 * friend.c (do_friend): Adjust.
1215 * pt.c (tsubst_friend_class): Adjust.
1217 Revert pushdecl_top_level_and_finish name change.
1218 * name-lookup.h (pushdecl_top_level_and_finish): Resurrect old name.
1219 * name-lookup.c (pushdecl_top_level_and_finish): Likewise.
1220 * decl.c (cp_make_fname_decl): Adjust.
1221 * decl2.c (get_guard, handle_tls_init): Adjust.
1222 * rtti.c (get_tinfo_decl, tinfo_base_init): Adjust.
1224 * name-lookup.c (pushdecl_outermost_localscope): Always
1225 conditionally stop timer.
1227 * decl.c (xref_tag_1): Don't frob ts_lambda scope here.
1228 * name-lookup.c (pushtag_1): Deal with ts_lambda scope.
1230 * cp-tree.h (pushdecl, pushdecl_maybe_friend, pushtag,
1231 pushtag_top_level_maybe_friend,
1232 pushdecl_top_level_and_finish): Move declarations to ...
1233 * name-lookup.h: ... here. Group pushdecl variants.
1234 (pushdecl_top_level_and_finish): Rename to ...
1235 (pushdecl_top_level_with_init): ... here.
1236 * decl.c (cp_make_fname_decl): Use pushdecl_top_level_with_init.
1237 * decl2.c (get_guard, handle_tls_init): Likewise.
1238 * rtti.c (get_tinfo_decl, tinfo_base_init): Likewise.
1239 * lambda.c (maybe_add_lambda_conv_op): Use namespace_bindings_p.
1240 * method.c (implicitly_declare_fn): Likewise.
1241 * searchc (node_debug_info_needed): Likewise.
1242 * name-lookup.c (pushdecl_top_level_and_finish): Rename to ...
1243 (pushdecl_top_level_with_init): ... here.
1244 (pop_everything): Use namespace_bindings_p.
1246 * name-lookup.h (pop_binding): Rename to pop_local_binding.
1247 (getdecls): Rename to get_local_decls.
1248 * name-lookup.c (pop_binding): Rename to ...
1249 (pop_local_binding): ... here.
1250 (pop_bindings_and_leave_scope): Adjust.
1251 (getdecls): Rename to ...
1252 (get_local_decls): ... here. Assert local scope.
1253 * decl.c (poplevel): Assert not namespace. Adjust and simplify
1255 (store_parm_decls): Adjust get_local_decls call.
1256 (parser.c (synthesize_implicit_template_parm): Likewise.
1258 2017-05-11 Ville Voutilainen <ville.voutilainen@gmail.com>
1261 * method.c (is_trivially_xible): Reject void types.
1263 2017-05-10 Nathan Sidwell <nathan@acm.org>
1265 * class.c (handle_using_decl): Always use OVL_CURRENT.
1266 (resolve_address_of_overloaded_function): Move iterator decl into
1267 for scope. Don't strip anticipated decls here.
1269 * pt.c (print_candidates_1): Separate TREE_LIST and OVERLOAD
1271 (print_candidates): Adjust.
1273 * cp-tree.h (build_new_function_call): Lose koenig_p arg. Fix
1275 * call.c (build_new_function_call): Lose koenig_p arg. Remove
1276 koenig_p handling here.
1277 * pt.c (push_template_decl_real): Unconditionally retrofit_lang_decl.
1278 (tsubst_omp_clauses): Likewise.
1279 (do_class_deduction): Adjust buld_new_function_call calls.
1280 * semantics.c (finish_call_expr): Likewise.
1282 2017-05-10 Jason Merrill <jason@redhat.com>
1284 * pt.c (unify_parameter_deduction_failure, unify_cv_qual_mismatch)
1285 (unify_type_mismatch, unify_parameter_pack_mismatch)
1286 (unify_ptrmem_cst_mismatch, unify_expression_unequal)
1287 (unify_parameter_pack_inconsistent, unify_inconsistency)
1288 (unify_vla_arg, unify_method_type_error, unify_arity)
1289 (unify_arg_conversion, unify_no_common_base)
1290 (unify_inconsistent_template_template_parameters)
1291 (unify_template_deduction_failure)
1292 (unify_template_argument_mismatch)
1293 (unify_overload_resolution_failure): Call unify_invalid.
1295 CWG 1847 - Clarifying compatibility during partial ordering
1296 * pt.c (more_specialized_fn): No order between two non-deducible
1299 * pt.c (dependent_type_p): Make sure we aren't called with
1302 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
1303 * pt.c (convert_template_argument): Just return an argument pack.
1304 (coerce_template_parameter_pack, template_parm_to_arg)
1305 (extract_fnparm_pack, make_argument_pack, tsubst_template_args)
1306 (tsubst_decl, tsubst, type_unification_real, unify_pack_expansion):
1307 Don't set the type of a NONTYPE_ARGUMENT_PACK.
1308 * parser.c (make_char_string_pack, make_string_pack): Likewise.
1310 2017-05-10 Nathan Sidwell <nathan@acm.org>
1312 * cp-tree.h (add_method, clone_function_decl): Change last arg to
1314 * class.c (add_method): Change third arg to bool. Adjust.
1315 (one_inheriting_sig, one_inherited_ctor): Adjust.
1316 (clone_function_decl): Change 2nd arg to bool. Adjust.
1317 (clone_constructors_and_destructors): Adjust.
1318 * lambda.c (maybe_add_lambda_conv_op): Adjust.
1319 * method.c (lazily_declare_fn): Adjust.
1320 * pt.c (tsubst_decl, instantiate_template_1): Adjust.
1321 * semantics.c (finish_member_declaration): Adjust.
1323 2017-05-10 Paolo Carlini <paolo.carlini@oracle.com>
1326 * decl.c (finish_function): To improve error recovery, change the
1327 logic for calling apply_deduced_return_type.
1329 2017-05-09 Jason Merrill <jason@redhat.com>
1331 PR c++/80605 - __is_standard_layout and empty base
1332 * class.c (check_bases): Ignore empty bases.
1334 PR c++/70979 - literal class and closure types
1335 * class.c (finalize_literal_type_property): Handle closures
1337 (explain_non_literal_class): Likewise.
1339 PR c++/66297, DR 1684 - literal class and constexpr member fns
1340 * constexpr.c (is_valid_constexpr_fn): Only complain about
1341 non-literal enclosing class in C++11.
1342 * class.c (finalize_literal_type_property): Likewise.
1344 2017-05-09 Paolo Carlini <paolo.carlini@oracle.com>
1347 * pt.c (tsubst_decl): Early return error_mark_node if
1348 grok_ctor_properties returns false.
1350 2017-05-09 Jason Merrill <jason@redhat.com>
1352 PR c++/70167 - array prvalue treated as lvalue
1353 * cp-tree.h (CONSTRUCTOR_C99_COMPOUND_LITERAL): New.
1355 * semantics.c (finish_compound_literal): Add fcl_context parameter.
1356 Only make a static variable for C99 syntax.
1357 * parser.c (cp_parser_postfix_expression): Pass it.
1358 * pt.c (tsubst_copy_and_build): Likewise.
1359 * call.c (extend_ref_init_temps): Set
1360 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
1362 2017-05-09 Nathan Sidwell <nathan@acm.org>
1364 * cp-lang.c (get_global_decls, cxx_pushdecl): New.
1365 (LANG_HOOKS_GETDECLS, LANG_HOOKS_PUSHDECL): Override.
1366 * name-lookup.h (pushdecl_top_level): Declare.
1368 2017-05-08 Jason Merrill <jason@redhat.com>
1370 PR c++/80178 - parameter passing for uncopyable classes
1371 * tree.c (type_has_nontrivial_copy_init): True for classes with only
1372 deleted copy/move ctors.
1373 (remember_deleted_copy, maybe_warn_parm_abi): New.
1374 * decl.c (require_complete_types_for_parms, check_function_type):
1375 Call maybe_warn_parm_abi.
1376 * call.c (convert_for_arg_passing, build_cxx_call): Likewise.
1378 2017-05-08 Nathan Sidwell <nathan@acm.org>
1380 * decl.c (builtin_function_1): Set DECL_ANTICIPATED before pushing.
1381 (start_preparsed_function): Do decl pushing before setting
1382 current_funciton_decl and announcing it.
1384 * name-lookup.h (pushdecl_with_scope): Replace with ...
1385 (pushdecl_outermost_localscope): ... this.
1386 * name-lookup.c (pushdecl_with_scope): Replace with ...
1387 (pushdecl_outermost_localscope): ... this.
1388 (pushdecl_namespace_level): Adjust.
1389 * decl.c (cp_make_fname_decl): Use pushdecl_outermost_localscope.
1390 * lambda.c (insert_capture_proxy): Likewise.
1392 * class.c (build_vtbl_initializer): Don't shadow outer variable
1395 Revert _binding -> _value change.
1396 * name-lookup.h (get_namespace_value, set_global_value): Rename to ...
1397 (get_namespace_binding, set_global_binding): ... these.
1398 * name-lookup.c (get_namespace_value, set_global_value): Rename to ...
1399 (get_namespace_binding, set_global_binding): ... these.
1400 (arg_assoc_namespace, pushdecl_maybe_friend_1,
1401 check_for_out_of_scope_variable, push_overloaded_decl_1,
1402 lookup_name_innermost_nonclass_level, push_namespace): Adjust.
1403 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
1404 SET_IDENTIFIER_GLOBAL_VALUE): Adjust.
1405 * decl.c (poplevel): Adjust.
1406 * pt.c (make_constrained_auto): Likewise.
1408 2017-05-07 Volker Reichelt <v.reichelt@netcologne.de>
1410 PR translation/80280
1411 * call.c (print_z_candidate): Fix quoting.
1413 2017-05-05 David Malcolm <dmalcolm@redhat.com>
1415 * error.c (pedwarn_cxx98): Replace report_diagnostic
1416 with diagnostic_report_diagnostic.
1418 2017-05-05 Nathan Sidwell <nathan@acm.org>
1420 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value.
1421 (SET_IDENTIFIER_GLOBAL_VALUE): Use set_global_value.
1422 (IDENTIFIER_NAMESPACE_VALUE): Delete.
1423 * name-lookup.h (namespace_binding, set_namespace_binding): Replace
1425 (get_namespace_value, set_global_value): ... these.
1426 (get_global_value_if_present, is_typename_at_global_scope): Delete.
1427 * decl.c (poplevel): Use get_namespace_value.
1428 (grokdeclarator): Use IDENTIFIER_GLOBAL_VALUE.
1429 * class.c (build_vtbl_initializer): Stash library decl in
1430 static var. Use IDENTIFIER_GLOBAL_VALUE.
1431 * except.c (do_get_exception_ptr, do_begin_catch, do_end_catch,
1432 do_allocate_exception, do_free_exception, build_throw): Likewise.
1433 * init.c (throw_bad_array_new_length): Likewise.
1434 * rtti.c (throw_bad_cast, throw_bad_typeid): Likewise.
1435 * name-lookup.c (arg_assoc_namespace, pushdecl_maybe_friend_1,
1436 check_for_our_of_scope_variable, push_overloaded_decl_1): Use
1437 get_namespace_value.
1438 (set_namespace_binding_1): Rename to
1439 (set_namespace_binding): ... here.
1440 (set_global_value): New.
1441 (lookup_name_innermost_nonclass_level_1, push_namespace): Use
1442 get_namespace_value.
1443 * pt.c (listify): Use get_namespace_value.
1445 * call.c (make_temporary_var_for_ref_to_temp): Push decl into
1447 * lex.c (unqualified_name_lookup_error): Likewise.
1449 * class.c (alter_class): Use retrofit_lang_decl directly.
1450 * decl.c (push_local_name, dupliate_decls): Likewise.
1451 * semantics.c (omp_privatize_field): Likewise.
1453 Kill walk_namespaces.
1454 * cp-tree.h (walk_namespaces_fn, walk_namespaces): Delete.
1455 * decl.c (walk_namespaces_r, walk_namespaces): Delete.
1457 Kill per-namespace static_decls.
1458 * cp-tree.h (static_decls): Declare.
1459 (wrapup_globals_for_namespace,
1460 diagnose_inline_vars_for_namespace): Replace with ...
1461 (wrapup_namespace_globals): ... this.
1462 * decl.c (static_decls): Define.
1463 (wrapup_globals_for_namespace,
1464 diagnose_inline_vars_for_namespace): Replace with ...
1465 (wrapup_namespace_globals): ... this.
1466 (cxx_init_decl_processing): Initialize static_decls.
1467 * decl2.c (c_parse_final_cleanups): Adjust.
1468 * name-lookup.h (cp_binding_level): Remove static_decls member.
1469 * name-lookup.c (add_decl_to_level): Adjust.
1470 (begin_scope): Adjust.
1472 2017-05-05 Paolo Carlini <paolo.carlini@oracle.com>
1475 * decl.c (reshape_init): Unconditionally return error_mark_node
1476 upon error about too many initializers.
1478 2017-05-04 Nathan Sidwell <nathan@acm.org>
1480 * constraint.cc (diagnose_check_constraint): Fix %E thinko.
1482 2017-05-04 Martin Sebor <msebor@redhat.com>
1484 PR translation/80280
1485 * call.c (print_z_candidate): Add missing quoting to %D and other
1487 (build_op_call_1): Same.
1488 * constraint.cc (diagnose_check_constraint): Same.
1489 * mangle.c (mangle_decl): Same.
1490 * name-lookup.c (cp_binding_level_debug): Same.
1491 (set_decl_namespace): Same.
1492 * parser.c (cp_parser_tx_qualifier_opt): Same.
1493 * pt.c (print_candidates_1): Same.
1494 (check_template_variable): Same.
1495 (tsubst_default_argument): Same.
1496 (most_specialized_partial_spec): Same.
1497 * semantics.c (omp_reduction_lookup): Same.
1498 * tree.c (check_abi_tag_redeclaration): Same.
1499 * typeck.c (comptypes): Same.
1500 * typeck2.c (abstract_virtuals_error_sfinae): Same.
1502 2017-05-04 Nathan Sidwell <nathan@acm.org>
1505 * cp-tree.h (enum cp_tree_index): Add CPTI_GLOBAL,
1506 CPTI_GLOBAL_TYPE, CPTI_GLOBAL_IDENTIFIER, CPTI_ANON_IDENTIFIER,
1507 CPTI_INIT_LIST_IDENTIFIER.
1508 (global_namespace, global_type_node, global_identifier,
1509 anon_identifier, init_list_identifier): New.
1510 * decl.c (global_type_node, global_scope_name): Delete.
1511 (initialize_predefined_identifiers): Add new identifiers.
1512 (cxx_init_decl_processing): Adjust.
1513 * name-lookup.h (global_namespace, global_type_node): Delete.
1514 * name-lookup.c (global_namespace, anonymous_namespace_name,
1515 get_anonymous_namespace_name): Delete.
1516 (namespace_scope_ht_size, begin_scope, pushtag_1,
1517 push_namespace): Adjust,
1518 * call.c (type_has_extended_temps): Use init_list_identifier.
1519 * pt.c (listify): Likewise.
1521 * name-lookup.c: Reorder functions to make merging from modules
1524 2017-05-03 Jason Merrill <jason@redhat.com>
1526 * constexpr.c (cxx_eval_outermost_constant_expr): Use TV_CONSTEXPR.
1528 2017-05-03 Nathan Sidwell <nathan@acm.org>
1530 * cp-tree.h (enum cp_tree_index, cp_global_trees): Move earlier,
1531 along with #defines, to before name-lookup include.
1533 2017-05-02 Paolo Carlini <paolo.carlini@oracle.com>
1535 * pt.c (is_auto_or_concept): Remove.
1536 (type_uses_auto_or_concept): Remove, unused.
1537 (find_parameter_packs_r, extract_autos_r, is_auto_r): Adjust.
1538 * parser.c (tree_type_is_auto_or_concept): Remove, unused.
1539 * cp-tree.h (is_auto_or_concept): Remove.
1541 2017-05-01 Xi Ruoyao <ryxi@stu.xidian.edu.cn>
1544 * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Don't
1545 add pedigree operation and detach call here.
1546 * cp-gimplify.c (cp_gimplify_expr): Remove the calls to
1547 cilk_cp_gimplify_call_params_in_spawned_fn.
1548 (cilk_cp_gimplify_call_params_in_spawned_fn): Remove function.
1549 * semantics.c (simplify_aggr_init_expr): Copy EXPR_CILK_SPAWN.
1551 2017-04-29 Volker Reichelt <v.reichelt@netcologne.de>
1553 * parser.c (cp_parser_member_declaration): Add fix-it hints for
1554 stray comma and missing semicolon at end of member declaration.
1556 2017-04-27 Volker Reichelt <v.reichelt@netcologne.de>
1558 * parser.c (cp_parser_cast_expression): Add target type of cast to
1560 * error.c (type_to_string): Add '{enum}' suffix to enumeration types.
1562 2017-04-26 Paolo Carlini <paolo.carlini@oracle.com>
1564 * decl.c (grok_ctor_properties, ambi_op_p, unary_op_p): Change
1565 return type to bool.
1566 * cp-tree.h (grok_ctor_properties): Update.
1568 2017-04-26 Volker Reichelt <v.reichelt@netcologne.de>
1570 * parser.c (cp_parser_nested_name_specifier_opt): Add fix-it
1571 information to diagnostic of invalid colon in nested-name-specifier.
1573 2017-04-25 Volker Reichelt <v.reichelt@netcologne.de>
1575 * parser.c (cp_parser_elaborated_type_specifier): Add fix-it to
1576 diagnostic of invalid class/struct keyword after enum.
1578 2017-04-25 David Malcolm <dmalcolm@redhat.com>
1580 * parser.c (cp_parser_member_declaration): Add fix-it hint
1581 for removing stray semicolons.
1583 2017-04-25 David Malcolm <dmalcolm@redhat.com>
1585 * name-lookup.c (get_std_name_hint): New function.
1586 (maybe_suggest_missing_header): New function.
1587 (suggest_alternative_in_explicit_scope): Call
1588 maybe_suggest_missing_header.
1590 2017-04-25 David Malcolm <dmalcolm@redhat.com>
1593 * name-lookup.c (suggest_alternative_in_explicit_scope): Convert
1594 candidate type of bm from tree to const char *.
1595 (consider_binding_level): Likewise.
1596 (lookup_name_fuzzy): Likewise, using this to merge the best
1597 result from the preprocessor into bm, rather than immediately
1598 returning, so that better matches from reserved words can "win".
1599 Guard the rejection of keywords that don't start decl-specifiers
1600 so it only happens for FUZZY_LOOKUP_TYPENAME.
1602 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
1604 * decl.c (grokdeclarator): Use %qT instead of %<%T%> in diagnostics.
1605 (start_enum): Likewise.
1606 (build_enumerator): Likewise. Use %qE instead of plain %E.
1607 * parser.c (cp_parser_mem_initializer_list): Use %qD instead of
1608 %<%D%> in diagnostics.
1609 (cp_parser_elaborated_type_specifier): Likewise.
1610 * pt.c (make_pack_expansion): Use %qT and %qE instead of
1611 %<%T%> and %<%E%> in diagnostics.
1612 (tsubst_pack_expansion): Likewise.
1614 2017-04-24 David Malcolm <dmalcolm@redhat.com>
1617 * parser.c (cp_parser_unary_expression): Generate a location
1618 range for alignof and sizeof expressions.
1620 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
1622 * parser.c (cp_parser_cv_qualifier_seq_opt): Add fix-it info to
1624 (cp_parser_virt_specifier_seq_opt): Likewise.
1625 (set_and_check_decl_spec_loc): Likewise twice.
1627 2017-04-21 Jason Merrill <jason@redhat.com>
1629 PR c++/80179 - ICE with initialized flexible array member.
1630 * constexpr.c (verify_ctor_sanity): Handle flexible array members.
1632 2017-04-21 Richard Biener <rguenther@suse.de>
1634 * cp-tree.h (copy_decl): Annotate with CXX_MEM_STAT_INFO.
1635 (copy_type): Likewise.
1636 * lex.c (copy_decl): Pass down mem-stat info.
1637 (copy_type): Likewise.
1639 2017-04-20 Jonathan Wakely <jwakely@redhat.com>
1642 * init.c (build_new_1): Suppress notes about over-aligned new when
1643 the warning is suppressed.
1645 2017-04-20 Volker Reichelt <v.reichelt@netcologne.de>
1647 * parser.c (cp_parser_member_declaration): Add warning with fixit
1648 information for extra semicolon after in-class function definition.
1650 2017-04-20 Jakub Jelinek <jakub@redhat.com>
1653 * tree.c (build_cplus_array_type): Call build_array_type
1654 with the intended TYPE_TYPELESS_STORAGE flag value, instead
1655 of calling build_array_type and modifying later TYPE_TYPELESS_STORAGE
1658 2017-04-18 Marek Polacek <polacek@redhat.com>
1660 PR c++/80244 - ICE with attribute in template alias.
1661 * tree.c (strip_typedefs): Handle UNDERLYING_TYPE.
1663 PR c++/80241 - ICE with alignas pack expansion.
1664 * error.c (dump_expr): Handle TREE_LIST.
1665 * parser.c (cp_parser_std_attribute_list): Return error_mark if
1666 make_pack_expansion returns an error.
1668 2017-04-17 Bernd Edlinger <bernd.edlinger@hotmail.de>
1671 * class.c (fixup_may_alias): Fix all type variants.
1673 2017-04-17 Jason Merrill <jason@redhat.com>
1675 PR c++/80415 - wrong error with default arg and array reference.
1676 * tree.c (lvalue_kind): Return clk_class for an array prvalue.
1678 * pt.c (tsubst_init): Set TARGET_EXPR_DIRECT_INIT_P.
1680 2017-04-15 Alexandre Oliva <aoliva@redhat.com>
1682 * decl.c (name_unnamed_type): Split out of...
1683 (grokdeclarator): ... this.
1684 * decl.h (name_unnamed_type): Declare.
1686 2017-04-12 Richard Biener <rguenther@suse.de>
1687 Bernd Edlinger <bernd.edlinger@hotmail.de>
1690 * tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
1691 for arrays of character or std::byte type.
1693 2017-04-11 Jason Merrill <jason@redhat.com>
1695 PR c++/80294 - ICE with constexpr and inheritance.
1696 * constexpr.c (reduced_constant_expression_p):
1697 A null constructor element is non-constant.
1698 (cxx_eval_indirect_ref): Don't VERIFY_CONSTANT before
1699 returning an empty base.
1701 2017-04-11 Jakub Jelinek <jakub@redhat.com>
1704 * decl.c (cp_finish_decomp): If processing_template_decl on
1705 non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't
1706 change their DECL_VALUE_EXPR nor cp_finish_decl them. Instead make
1707 sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst
1709 * pt.c (value_dependent_expression_p) <case VAR_DECL>: For variables
1710 with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
1713 2017-04-11 Jakub Jelinek <jakub@redhat.com>
1716 * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.
1718 2017-04-10 Jakub Jelinek <jakub@redhat.com>
1721 * tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
1722 operand, if it is a static member function, recurse on the
1725 2017-04-10 Marek Polacek <polacek@redhat.com>
1728 * typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL. Set
1729 ORIG_TYPE earlier and not only when shortening.
1731 2017-04-07 Jason Merrill <jason@redhat.com>
1733 PR c++/80356 - ICE with reference to function template argument.
1735 * pt.c (convert_nontype_argument_function): Adjust type even with a
1736 value-dependent argument.
1738 PR c++/80267 - ICE with nested capture of reference
1740 * pt.c (tsubst_copy): Handle lookup finding a capture proxy.
1742 2017-04-07 Marek Polacek <polacek@redhat.com>
1745 * typeck.c (cp_build_binary_op): Convert COP[01] to ORIG_TYPE.
1748 * call.c (build_over_call): Don't check cxx_dialect.
1749 * cp-gimplify.c (cp_gimplify_init_expr): Don't check cxx_dialect nor
1750 whether SUB is a CONSTRUCTOR.
1751 * init.c (build_new_1): Don't check cxx_dialect.
1752 * tree.c (replace_placeholders): Add a function comment. Return if
1753 not in C++14, or if the object isn't a (member of a) class.
1754 * typeck2.c (store_init_value): Don't check cxx_dialect nor whether
1755 TYPE is CLASS_TYPE_P.
1757 2017-04-05 Jakub Jelinek <jakub@redhat.com>
1760 * pt.c (canonical_type_parameter): Use vec_safe_grow_cleared instead
1761 of a loop doing vec_safe_push of NULL. Formatting fixes.
1762 (rewrite_template_parm): Copy TEMPLATE_PARM_PARAMETER_PACK from oldidx
1763 to newidx before calling canonical_type_parameter on newtype.
1765 2017-04-04 Volker Reichelt <v.reichelt@netcologne.de>
1768 * cxx-pretty-print.c (cxx_pretty_printer::expression): Add
1769 UNARY_PLUS_EXPR case.
1771 2017-04-03 Jason Merrill <jason@redhat.com>
1773 * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
1775 2017-04-03 Jonathan Wakely <jwakely@redhat.com>
1777 * class.c (update_vtable_entry_for_fn): Fix typo in comment.
1778 * decl2.c (one_static_initialization_or_destruction): Likewise.
1779 * name-lookup.c (store_bindings): Likewise.
1780 * parser.c (make_call_declarator): Likewise.
1781 * pt.c (check_explicit_specialization): Likewise.
1783 2017-04-03 Jason Merrill <jason@redhat.com>
1785 PR sanitizer/79993 - ICE with VLA initialization from string
1786 PR c++/69487 - wrong VLA initialization from string
1787 * init.c (finish_length_check): Split out from build_vec_init.
1788 (build_vec_init): Handle STRING_CST.
1789 * typeck2.c (split_nonconstant_init): Handle STRING_CST.
1790 (digest_init_r): Don't give a STRING_CST VLA type.
1792 2017-03-31 Jakub Jelinek <jakub@redhat.com>
1795 * cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
1796 REFERENCE_TYPE. Adjust ubsan_maybe_instrument_reference caller
1797 for NOP_EXPR to REFERENCE_TYPE.
1800 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
1801 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
1803 * semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
1804 Remove extraneous parens.
1805 (finish_trait_expr): Handle CPTK_IS_AGGREGATE.
1806 * parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
1807 (cp_parser_trait_expr): Likewise.
1809 2017-03-27 Jakub Jelinek <jakub@redhat.com>
1812 * cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
1813 * typeck.c (cxx_mark_addressable): Likewise. Look through
1814 VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
1816 (cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
1818 2017-03-24 Jason Merrill <jason@redhat.com>
1820 PR c++/77339 - ICE with invalid use of alias template.
1821 * pt.c (lookup_template_class_1): Don't try to enter the scope of an
1824 2017-03-24 Marek Polacek <polacek@redhat.com>
1827 * cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
1828 doesn't have side effects.
1830 2017-03-23 Jason Merrill <jason@redhat.com>
1832 PR c++/80150 - ICE with overloaded variadic deduction.
1833 * pt.c (try_one_overload): Remove asserts.
1835 PR c++/77563 - missing ambiguous conversion error.
1836 * call.c (convert_like_real): Use LOOKUP_IMPLICIT.
1838 2017-03-23 Marek Polacek <polacek@redhat.com>
1840 * cp-tree.h: Remove a C_RID_YYCODE reference.
1842 2017-03-22 Jakub Jelinek <jakub@redhat.com>
1845 * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
1846 case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
1847 processing_template_decl.
1849 2017-03-21 Paolo Carlini <paolo.carlini@oracle.com>
1852 * name-lookup.c (pushtag_1): Add check for bogus, non template,
1853 std::initializer_list.
1855 2017-03-21 Jakub Jelinek <jakub@redhat.com>
1858 * init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.
1860 2017-03-21 Ville Voutilainen <ville.voutilainen@gmail.com>
1863 * init.c (std_placement_new_fn_p): New.
1864 (build_new_1): Call it.
1866 2017-03-20 Jason Merrill <jason@redhat.com>
1868 PR c++/80096 - ICE with C++17 non-type auto.
1869 * pt.c (tsubst): Delay tsubst of type of template non-type
1872 PR c++/79519 - ICE with deleted template friend.
1873 * decl.c (grokdeclarator): Complain about misplaced function
1874 definition using =, as well.
1876 PR c++/79640 - infinite recursion with generic lambda.
1877 * pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
1878 before substituting its initializer.
1880 2017-03-20 Marek Polacek <polacek@redhat.com>
1881 Paolo Carlini <paolo.carlini@oracle.com>
1883 PR c++/80059 - ICE with noexcept and __transaction_atomic
1884 * except.c (build_must_not_throw_expr): Call
1885 instantiate_non_dependent_expr.
1887 2017-03-19 Jason Merrill <jason@redhat.com>
1889 PR c++/80084 - wrong C++17 decomposition by reference of parameter.
1890 * decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
1891 reference decomposition.
1893 PR c++/80077 - error with constexpr and -fno-elide-constructors.
1894 * constexpr.c (cxx_eval_call_expression): Set ctx->call while
1895 expanding trivial constructor.
1897 2017-03-17 Jason Merrill <jason@redhat.com>
1899 PR c++/78345 - ICE initializing array from lambda.
1900 * init.c (build_aggr_init): Check array initializer.
1901 (build_vec_init): Check the type of a CONSTRUCTOR.
1903 PR c++/80073 - C++17 ICE with virtual base.
1904 * decl.c (xref_basetypes): Also check for indirect vbases.
1906 2017-03-16 Jason Merrill <jason@redhat.com>
1908 * decl.c (start_enum): std::byte aliases anything.
1911 * constexpr.c (lookup_placeholder): Tweak.
1913 2017-03-15 Jason Merrill <jason@redhat.com>
1915 PR c++/80043 - ICE with -fpermissive
1916 * typeck.c (convert_for_assignment): Handle instantiate_type
1917 not giving an error.
1919 2017-03-14 Nathan Sidwell <nathan@acm.org>
1921 PR c++/79393 DR 1658 workaround
1922 * method.c (synthesized_method_base_walk): Inihibit abstract class
1923 virtual base access check here.
1924 (synthesized_method_walk): Not here.
1926 2017-03-13 Nathan Sidwell <nathan@acm.org>
1928 PR c++/79393 DR 1658 workaround
1929 * method.c (synthesized_method_walk): Check vbases of abstract
1930 classes for dtor walk.
1932 2017-03-10 David Malcolm <dmalcolm@redhat.com>
1934 PR translation/79848
1935 * decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
1937 2017-03-10 Jason Merrill <jason@redhat.com>
1939 PR c++/79960 - alias templates and partial ordering
1940 * pt.c (comp_template_args): Add partial_order parm.
1941 (template_args_equal): Likewise.
1942 (comp_template_args_porder): New.
1943 (get_partial_spec_bindings): Use it.
1945 2017-03-10 Marek Polacek <polacek@redhat.com>
1948 * decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
1950 2017-03-10 Jakub Jelinek <jakub@redhat.com>
1953 * optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
1954 Use XALLOCAVEC macro.
1957 * decl.c (finish_enum_value_list): If value is error_mark_node,
1958 don't copy it and change its type.
1959 * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
1960 of CONST_DECL is error_mark_node.
1962 2017-03-09 Marek Polacek <polacek@redhat.com>
1964 PR c++/79900 - ICE in strip_typedefs
1965 * tree.c (strip_typedefs): Skip the attribute handling if T is
1966 a variant type which hasn't been updated yet.
1968 PR c++/79687 - wrong code with pointer-to-member
1969 * init.c (constant_value_1): Break if the variable has a dynamic
1972 2017-03-08 Jason Merrill <jason@redhat.com>
1974 PR c++/79797 - ICE with self-reference in array DMI.
1975 * constexpr.c (lookup_placeholder): Split out...
1976 (cxx_eval_constant_expression): ...from here.
1978 2017-03-07 Jakub Jelinek <jakub@redhat.com>
1981 * parser.c (cp_parser_omp_cancellation_point,
1982 cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
1983 cp_parser_omp_target_update): Change "may only be used in compound
1984 statements" diagnostics, such that the same translatable string is
1985 used for all pragmas.
1986 (cp_parser_pragma): Likewise. Use error_at instead of
1987 cp_parser_error for that diagnostics.
1989 2017-03-06 Marek Polacek <polacek@redhat.com>
1991 PR c++/79796 - ICE with NSDMI and this pointer
1992 * call.c (build_over_call): Handle NSDMI with a 'this' by calling
1993 replace_placeholders.
1995 2017-03-06 Jakub Jelinek <jakub@redhat.com>
1998 * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
2001 2017-03-06 Jason Merrill <jason@redhat.com>
2003 Revert "Allow deduction guides to look into primary template."
2004 * cp-tree.h, parser.c, pt.c, search.c: Revert.
2006 2017-03-05 Paolo Carlini <paolo.carlini@oracle.com>
2009 * except.c (build_must_not_throw_expr): Perform the implicit
2010 conversions on the condition.
2012 2017-03-03 Jason Merrill <jason@redhat.com>
2014 * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
2017 Core issues 2273 and 2277
2018 * call.c (joust): Adjust using-declaration tiebreaker to handle
2019 the intermediate base case.
2020 * method.c (strip_inheriting_ctors): Just return the argument if
2021 !flag_new_inheriting_ctors.
2023 2017-03-03 Richard Biener <rguenther@suse.de>
2026 * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
2028 2017-03-03 Marek Polacek <polacek@redhat.com>
2031 * typeck.c (string_conv_p): In C++11, always call pedwarn with
2034 2017-03-02 Jason Merrill <jason@redhat.com>
2036 Update overload resolution with deduction guides.
2037 * pt.c (do_class_deduction): Always build the copy guide.
2038 (copy_guide_p, template_guide_p): New.
2039 (build_deduction_guide): Remember the original constructor.
2040 * call.c (joust): Prefer the copy guide and non-template guides.
2042 Allow deduction guides to look into primary template.
2043 * cp-tree.h (struct saved_scope): Add deduction_guide_type.
2044 (struct cp_decl_specifier_seq): Add constructor_p.
2045 * parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
2046 (cp_parser_init_declarator): Check it. Set ctor_dtor_or_conv_p.
2047 Clear deduction_guide_type. Don't handle deduction guide names.
2048 (cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
2049 (cp_parser_direct_declarator): Likewise. Handle deduction guides.
2050 (cp_parser_member_declaration, cp_parser_cache_defarg)
2051 (cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
2052 * pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
2053 (build_deduction_guide): Set deduction_guide_type.
2054 (dependent_scope_p): Check deduction_guide_type.
2055 * search.c (lookup_member): Likewise.
2057 2017-03-02 Jakub Jelinek <jakub@redhat.com>
2060 * init.c (mark_exp_read_r): New function.
2061 (emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
2062 whole arguments instead of plain mark_exp_read on TREE_LIST values.
2064 2017-03-01 Jason Merrill <jason@redhat.com>
2066 Class template argument deduction in new-expression
2067 * init.c (build_new): Handle deduction from no initializer.
2068 * parser.c (cp_parser_new_expression): Don't require a single
2069 expression for class template deduction.
2070 * typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
2071 class template placeholder.
2072 * pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
2073 (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
2074 (redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
2076 2017-03-01 Jakub Jelinek <jakub@redhat.com>
2079 * init.c (emit_mem_initializers): When not constructing vbases of
2080 abstract classes, mark arguments as read for
2081 -Wunused-but-set-parameter.
2083 2017-02-28 Jason Merrill <jason@redhat.com>
2085 Class template argument deduction refinements
2086 * call.c (joust): Move deduction guide tiebreaker down.
2087 * decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
2088 deduction with no initializer.
2089 * pt.c (build_deduction_guide): Handle implicit default/copy ctor.
2090 (do_class_deduction): Use that rather than special case.
2091 (do_auto_deduction): Handle null initializer.
2093 2017-02-28 Jakub Jelinek <jakub@redhat.com>
2095 * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
2096 instead of just cond ? "..." : "...".
2097 (grokdeclarator): Likewise.
2098 (build_enumerator): Likewise.
2099 * init.c (build_new_1): Likewise.
2100 * call.c (build_new_method_call_1): Likewise.
2101 * parser.c: Include intl.h.
2102 (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
2103 "enter"/"exit" keyword.
2104 (cp_finalize_oacc_routine): Don't use %s to supply portions of the
2107 2017-02-27 Jason Merrill <jason@redhat.com>
2109 PR c++/71568 - SFINAE forming pointer to member function
2110 * init.c (build_offset_ref): Check the return value of
2111 perform_or_defer_access_check.
2113 2017-02-27 Marek Polacek <polacek@redhat.com>
2115 * decl.c (expand_static_init): Add missing } in a comment.
2117 2017-02-27 Volker Reichelt <v.reichelt@netcologne.de>
2119 * init.c: Include intl.h.
2120 (build_new_1): Move message strings into pedwarn to make them
2121 -Wformat-security friendly. Mark string for translation.
2122 * pt.c (tsubst_copy_and_build): Mark string for translation.
2123 Make the pointer const.
2124 * semantics.c (finish_id_expression): Mark strings for translation.
2126 2017-02-25 Jakub Jelinek <jakub@redhat.com>
2128 * call.c (build_op_delete_call): Make msg1 and msg2 const.
2130 2017-02-24 Jakub Jelinek <jakub@redhat.com>
2133 * call.c (build_over_call): Call check_function_arguments even for
2134 -Wrestrict, adjust check_function_arguments caller.
2135 * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
2137 * typeck.c (cp_build_function_call_vec): Adjust
2138 check_function_arguments caller.
2140 2017-02-24 Marek Polacek <polacek@redhat.com>
2142 PR translation/79705
2143 * decl.c (check_redeclaration_exception_specification): Mark a string
2144 for translation. Make the pointer const.
2146 2017-02-23 Paolo Carlini <paolo.carlini@oracle.com>
2149 * pt.c (register_specialization): Check duplicate_decls return value
2150 for error_mark_node and pass it back.
2152 2017-02-22 Jason Merrill <jason@redhat.com>
2154 PR c++/79679 - missing destructor for argument
2155 * call.c (build_over_call): Don't pass tf_no_cleanup to argument
2158 * pt.c (do_class_deduction): Handle 0 argument case.
2160 2017-02-22 Jakub Jelinek <jakub@redhat.com>
2163 * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
2164 SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
2165 * constexpr.c (potential_constant_expression_1): Handle
2166 OMP_*, OACC_* and CILK_* trees. Use error_at with
2167 EXPR_LOC_OR_LOC (t, input_location) computed early
2168 instead of error, or error_at with location_of (t).
2170 2017-02-22 Marek Polacek <polacek@redhat.com>
2173 * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
2174 if the alignas expression is erroneous.
2175 * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
2179 * semantics.c (finish_underlying_type): Bail out for incomplete enums.
2181 2017-02-21 Jason Merrill <jason@redhat.com>
2183 PR c++/50308 - wrong deprecated warning with ADL
2184 PR c++/17729 - duplicate deprecated warning
2185 * semantics.c (finish_id_expression): Only call mark_used on a
2186 function if we aren't building a call.
2188 PR c++/41727 - ICE with partial spec of partial instantiation
2189 * pt.c (process_partial_specialization): For now, don't check more
2190 specialized if there is more than one level of args.
2192 2017-02-21 Marek Polacek <polacek@redhat.com>
2195 * cp-tree.h (maybe_reject_flexarray_init): Declare.
2196 * init.c (maybe_reject_flexarray_init): No longer static.
2197 Add check for current_function_decl.
2198 * parser.c (cp_parser_late_parse_one_default_arg): Reject
2199 a default mem-initializer for a flexible array.
2201 2017-02-21 Jakub Jelinek <jakub@redhat.com>
2202 Paolo Carlini <paolo.carlini@oracle.com>
2205 * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
2207 * pt.c (tsubst_decomp_names): Return error_mark_node if the first
2208 decl after the decomposition artificial decl has error_mark_node.
2209 * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
2210 instead of just == error_mark_node comparison.
2212 2017-02-21 Jakub Jelinek <jakub@redhat.com>
2215 * decl.c: Include gimplify.h.
2216 (cp_finish_decomp): Make sure there is no sharing of trees
2217 in between DECL_VALUE_EXPR of decomposition decls.
2220 * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
2223 * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
2224 call cplus_expand_constant on it first.
2226 2017-02-19 Jason Merrill <jason@redhat.com>
2228 PR c++/78139 - destructor needed by new-expression
2229 * call.c (build_special_member_call): Use tf_no_cleanup.
2231 PR c++/78282 - auto template and pack expansion
2232 * pt.c (find_parameter_packs_r): Don't walk into the type of
2233 templates other than template template-parameters.
2235 PR c++/79606 - ICE with this->base_member in NSDMI
2236 * class.c (build_base_path): Check processing_template_decl.
2238 PR c++/79607 - ICE with T{} initializer
2239 * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
2241 PR c++/79566 - elaborated-type-specifier in range for
2242 * parser.c (cp_parser_simple_declaration): Fix check for type
2245 PR c++/79400 - confusing suggestion of 'noexcept'
2246 * parser.c (cp_parser_exception_specification_opt): Remove
2247 suggestion for deprecated dynamic exception-specification.
2249 PR c++/79470 - partial ordering with reference parameters
2250 * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
2252 PR c++/79500 - ICE with non-template deduction guide
2253 * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
2254 DECL_TEMPLATE_RESULT.
2256 PR c++/79580 - ICE with compound literal
2257 * parser.c (cp_parser_class_head): If we're in the middle of an
2258 expression, use ts_within_enclosing_non_class.
2260 PR c++/79503 - inherited ctor taking base class
2261 * call.c (add_function_candidate): Also check that
2262 DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
2264 2017-02-19 Paolo Carlini <paolo.carlini@oracle.com>
2267 * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
2270 2017-02-19 Eric Fiselier <eric@efcs.ca>
2271 Jonathan Wakely <jwakely@redhat.com>
2274 * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
2275 control warning about literal suffix identifiers without a leading
2278 2017-02-17 Jason Merrill <jason@redhat.com>
2280 PR c++/79508 - lookup error with member template
2281 * parser.c (cp_parser_template_name): Clear
2282 parser->context->object_type if we aren't doing lookup.
2284 PR c++/78690 - ICE with using and global type with same name
2285 * pt.c (type_dependent_object_expression_p): True for
2288 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
2289 * pt.c (convert_template_argument): Just return an auto arg pack.
2290 (tsubst_template_args): Don't tsubst an auto pack type.
2292 PR c++/79556 - C++17 ICE with non-type auto
2293 * pt.c (do_auto_deduction): Don't try to deduce from null type.
2295 PR c++/79533 - C++17 ICE with temporary cast to reference
2296 * call.c (build_over_call): Conversion to a reference prevents copy
2299 2017-02-16 Jakub Jelinek <jakub@redhat.com>
2300 Jason Merrill <jason@redhat.com>
2302 PR c++/79502 - lost nodiscard attribute
2303 * pt.c (apply_late_template_attributes): Do apply non-dependent
2304 attributes to types.
2306 2017-02-16 Jason Merrill <jason@redhat.com>
2308 PR c++/78572 - ICE with self-modifying array initializer
2309 * constexpr.c (cxx_eval_store_expression): The object we're
2310 initializing is outside the constant-expression.
2311 (cxx_eval_call_expression): Set ctx->call.
2313 PR c++/79050 - ICE with undeduced auto and LTO
2314 * decl.c (poplevel): Remove undeduced auto decls.
2316 2017-02-16 Jakub Jelinek <jakub@redhat.com>
2319 * parser.c (cp_parser_omp_target): For -fopenmp-simd
2320 ignore #pragma omp target even when not followed by identifier.
2322 2017-02-15 Jason Merrill <jason@redhat.com>
2323 Jakub Jelinek <jakub@redhat.com>
2325 PR c++/79464 - ICE in IPA with omitted constructor parms
2326 * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
2327 (adjust_clone_args): Adjust.
2328 (add_method): Remember omitted parms.
2329 * call.c (add_function_candidate): Likewise.
2330 * mangle.c (write_method_parms): Likewise.
2331 * method.c (ctor_omit_inherited_parms): Return false if there are no
2334 2017-02-15 Martin Sebor <msebor@redhat.com>
2337 * init.c (maybe_reject_flexarray_init): New function.
2338 (perform_member_init): Call it.
2340 2017-02-15 Jakub Jelinek <jakub@redhat.com>
2343 * parser.c (cp_parser_std_attribute): Don't pedwarn about
2344 [[deprecated]] with -std=c++11 and [[fallthrough]] with
2345 -std=c++11 and -std=c++14.
2348 * decl.c (grokdeclarator): For static data members, handle thread_p
2349 only after handling inline.
2351 2017-02-14 Marek Polacek <polacek@redhat.com>
2355 * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
2356 clobbering if the postfix expression isn't an EXPR_P.
2358 2017-02-13 Jason Merrill <jason@redhat.com>
2360 PR c++/79461 - ICE with lambda in constexpr constructor
2361 * constexpr.c (build_data_member_initialization): Ignore
2362 initialization of a local variable.
2364 2017-02-13 Jakub Jelinek <jakub@redhat.com>
2366 * init.c (warn_placement_new_too_small): Add missing space in
2368 * parser.c (cp_parser_oacc_declare): Likewise.
2369 * mangle.c (maybe_check_abi_tags): Likewise.
2372 * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
2373 on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
2374 in the rightmost operand.
2376 2017-02-13 Nathan Sidwell <nathan@acm.org>
2378 PR c++/79296 - ICE mangling localized template instantiation
2379 * decl2.c (determine_visibility): Use template fn context for
2380 local class instantiations.
2382 2017-02-11 Jason Merrill <jason@redhat.com>
2384 PR c++/77659 - ICE with new and C++14 aggregate NSDMI
2385 * init.c (build_new): Make backups of any CONSTRUCTORs in init.
2386 (build_new_1): Use replace_placeholders.
2387 * tree.c (replace_placeholders_t): Also track whether we've seen a
2389 (replace_placeholders, replace_placeholders_r): Adjust.
2390 * cp-tree.h: Adjust.
2392 PR c++/77790 - ICE with auto function in C++11 mode
2393 * decl.c (undeduced_auto_decl): Remove C++14 limitation.
2394 (require_deduced_type): Add complain parm, return bool.
2395 * cp-tree.h: Adjust.
2396 * decl2.c (mark_used): Use require_deduced_type.
2398 2017-02-10 Jason Merrill <jason@redhat.com>
2400 PR c++/78908 - template ops and bitfields
2401 * tree.c (build_min_non_dep): Use unlowered_expr_type.
2403 PR c++/78897 - constexpr union
2404 * constexpr.c (cxx_eval_store_expression): A store to a union member
2405 erases a previous store to another member.
2407 PR c++/71285 - member of fold-expression
2408 * semantics.c (finish_unary_fold_expr)
2409 (finish_binary_fold_expr): Use null type for fold-expressions.
2411 PR c++/79401 - protected inherited constructor
2412 * call.c (enforce_access): For inheriting constructor, find a base
2413 binfo in the path we already have.
2415 2017-02-10 Marek Polacek <polacek@redhat.com>
2418 * pt.c (type_dependent_expression_p): Check if the expression type
2422 * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
2423 if warnings shouldn't be given.
2425 2017-02-10 Paolo Carlini <paolo.carlini@oracle.com>
2428 * pt.c (tsubst_decl): Don't try to preserve a typedef that names
2429 an error_mark_node as type.
2431 2017-02-09 Jakub Jelinek <jakub@redhat.com>
2432 Jason Merrill <jason@redhat.com>
2435 * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
2436 from pattern to type.
2438 2017-02-09 Jason Merrill <jason@redhat.com>
2440 PR c++/79316 - default argument in deduction guide
2441 PR c++/79350 - explicit deduction guide
2442 * parser.c (cp_parser_constructor_declarator_p)
2443 (cp_parser_direct_declarator): Parse deduction guides more like
2445 * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
2446 * tree.c (special_function_p): Return it.
2447 * decl.c (check_special_function_return_type): Handle it.
2448 (grokdeclarator, grokfndecl): Adjust.
2449 (cp_finish_decl): Pass flags to do_auto_deduction.
2450 * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
2451 * pt.c (dguide_name_p): Take a const_tree.
2452 (do_class_deduction): Handle explicit.
2453 (do_auto_deduction): Pass flags through.
2454 (build_deduction_guide): Copy explicit flag.
2456 2017-02-09 Jakub Jelinek <jakub@redhat.com>
2459 * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
2460 non-pragma_compound context here.
2461 (cp_parser_omp_target): Likewise.
2462 (cp_parser_pragma): Don't call push_omp_privatization_clauses and
2463 parsing for ordered and target omp pragmas in non-pragma_stmt
2464 non-pragma_compound contexts.
2467 * parser.c (cp_parser_oacc_declare): Formatting fix.
2468 (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
2469 automatic variables.
2471 2016-02-09 Nathan Sidwell <nathan@codesourcery.com>
2472 Chung-Lin Tang <cltang@codesourcery.com>
2474 * parser.c (cp_parser_oacc_clause_tile): Disallow collapse. Fix
2475 parsing. Parse constant expression. Remove semantic checking.
2476 (cp_parser_omp_clause_collapse): Disallow tile.
2477 (cp_parser_omp_for_loop): Deal with tile clause. Don't emit a parse
2478 error about missing for after already emitting one. Use more
2479 conventional for idiom for unbounded loop.
2480 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
2481 * semantics.c (finish_omp_clauses): Correct TILE semantic check.
2482 (finish_omp_for): Deal with tile clause.
2484 2017-02-07 Nathan Sidwell <nathan@acm.org>
2486 * method.c (synthesized_method_base_walk): New. Broken out of ...
2487 (synthesized_method_walk): ... here. Call it. Cleanup
2490 2017-02-07 Patrick Palka <ppalka@gcc.gnu.org>
2493 * typeck2.c (process_init_constructor_union): Consider only
2494 FIELD_DECLs when looking for an NSDMI.
2496 2017-02-06 Jason Merrill <jason@redhat.com>
2498 PR c++/71193 - incomplete types in templates
2499 * parser.c (cp_parser_postfix_dot_deref_expression): In a template
2500 handle incomplete type by pedwarning and then treating as dependent.
2502 2017-02-06 Jakub Jelinek <jakub@redhat.com>
2505 * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
2506 (potential_constant_expression_1): Likewise.
2509 * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
2510 allow one fewer than expected arguments if flag_permissive.
2513 * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
2514 * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
2515 with error_mark_node type.
2517 2017-02-03 Jason Merrill <jason@redhat.com>
2519 PR c++/78689 - ICE on constructor with label
2520 * optimize.c (maybe_clone_body): Replace omitted parameters with
2522 * class.c (build_clone): Fix logic for omitting inherited parms.
2524 PR c++/12245 - excessive memory use
2525 * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
2526 back in. Don't cache constants.
2527 (maybe_constant_init): Don't cache constants.
2529 PR c++/79294 - ICE with invalid template argument
2530 * pt.c (convert_nontype_argument_function): Check value-dependence.
2531 (convert_nontype_argument): Don't check it here for function ptrs.
2533 2017-02-02 Richard Biener <rguenther@suse.de>
2536 * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
2537 it lazily on the first changed element only and copy it
2538 fully upfront, only storing changed elements.
2540 2017-02-02 Paolo Carlini <paolo.carlini@oracle.com>
2543 * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
2546 2017-01-31 Jakub Jelinek <jakub@redhat.com>
2549 * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
2552 2017-01-31 David Malcolm <dmalcolm@redhat.com>
2555 * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
2556 any namespace aliases.
2558 2017-01-31 Nathan Sidwell <nathan@acm.org>
2561 * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
2565 * pt.c: (instantiate_decl): Push to top level when current
2566 function scope doesn't match. Only push lmabda scope stack when
2569 * cp-tree.h (instantiate_decl): Make defer_ok bool.
2570 * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
2571 (instantiate_decl): Simplify and reorder state saving and restoration.
2574 * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
2575 * semantics.c (finish_member_declaration): Assert class is being
2578 2017-01-30 Alexandre Oliva <aoliva@redhat.com>
2580 Introduce C++ support in libcc1.
2581 * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
2582 (ansi_opname): Rename to...
2583 (cp_operator_id): ... this. Adjust all callers.
2584 (ansi_assopname): Rename to...
2585 (cp_assignment_operator_id): ... this. Adjust all callers.
2586 (cp_literal_operator_id): Declare.
2587 (set_global_friend): Declare.
2588 (is_global_friend): Declare.
2589 (enum cp_oracle_request): New type.
2590 (cp_binding_oracle_function): New type.
2591 (cp_binding_oracle): Declare.
2592 (cp_finish_injected_record_type): Declare.
2593 * friend.c (global_friend): New var.
2594 (set_global_friend): New fn.
2595 (is_global_friend): New fn.
2596 (is_friend): Call is_global_friend.
2597 * name-lookup.c (cp_binding_oracle): New var.
2598 (query_oracle): New fn.
2599 (qualified_lookup_using_namespace): Call query_oracle.
2600 (lookup_name_real_1): Likewise.
2601 * parser.c (cp_literal_operator_id): Drop static.
2602 * search.c (friend_accessible_p): Call is_global_friend.
2603 * semantics.c (is_this_parameter): Accept a variable if the
2604 binding oracle is enabled.
2606 2017-01-27 Jason Merrill <jason@redhat.com>
2608 PR c++/78771 - ICE with inherited constructor.
2609 * call.c (build_over_call): Call deduce_inheriting_ctor here.
2610 * pt.c (tsubst_decl): Not here.
2611 * class.c (add_method): Or here.
2612 * method.c (deduce_inheriting_ctor): Handle clones.
2613 (implicitly_declare_fn): Don't deduce inheriting ctors yet.
2615 2017-01-27 Adam Butcher <adam@jessamine.co.uk>
2618 * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
2620 * cp/cp-tree.h: Declare it.
2621 * cp/semantics.c (finish_id_expression): Resolve names within a default
2622 capturing generic lambda defined within a template prior to
2623 instantiation to allow for captures to be added to the closure type.
2625 2017-01-26 Jakub Jelinek <jakub@redhat.com>
2628 * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
2629 * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
2630 * parser.c (cp_parser_builtin_offsetof): Pass result of
2631 build_static_cast of null_pointer_node to finish_offsetof.
2632 * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
2633 it for -Winvalid-offsetof pedwarn instead of trying to guess
2634 original offsetof type from EXPR. Save OBJECT_PTR as a new
2635 second operand to OFFSETOF_EXPR.
2636 * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
2637 finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
2640 2017-01-26 Jason Merrill <jason@redhat.com>
2642 * name-lookup.c (parse_using_directive): Deprecate strong using.
2644 PR c++/79176 - lambda ICE with -flto -Os
2645 * decl2.c (vague_linkage_p): Handle decloned 'tors.
2646 * tree.c (decl_linkage): Likewise.
2648 2017-01-25 Martin Sebor <msebor@redhat.com>
2650 * decl.c (grokdeclarator): Fix a typo in a comment.
2652 2017-01-25 Jakub Jelinek <jakub@redhat.com>
2655 * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
2659 * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
2660 OPT_Wpedantic on lambda templates for -std=c++14 and higher.
2662 2017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
2665 * decl.c (cxx_init_decl_processing): Pass main_input_filename
2666 to build_translation_unit_decl.
2668 2017-01-24 Jakub Jelinek <jakub@redhat.com>
2671 * cp-gimplify.c (cp_genericize_r): Add result of
2672 convert_from_reference on invisiref parm to p_set.
2674 2017-01-24 Nathan Sidwell <nathan@acm.org>
2676 PR c++/78469 - defaulted ctor and inaccessible dtor
2677 * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
2678 * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
2679 * tree.c (build_target_expr): Check tf_no_cleanup.
2681 PR c++/79118 - anon-members and constexpr
2682 * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
2683 ctor decl. Recursively check anonymous members.
2684 (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
2686 (explain_invalid_constexpr_fn): Likewise.
2688 2017-01-23 Nathan Sidwell <nathan@acm.org>
2690 PR c++/71710 - template using directive of field
2691 * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
2694 PR c++/71406 - ICE with scope-ref'd template id exprs
2696 * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
2697 before breaking up TEMPLATE_ID_EXPR.
2699 2017-01-20 Nathan Sidwell <nathan@acm.org>
2701 PR c++/78495 - wrong code inherited ctor and invisi-ref parm
2702 * cp-gimplify.c (cp_generize_r): Don't skip thunks.
2704 2017-01-20 David Malcolm <dmalcolm@redhat.com>
2708 * cp-tree.h (suggest_alternatives_for): Add bool param.
2709 (suggest_alternative_in_explicit_scope): New decl.
2710 * error.c (qualified_name_lookup_error): When SCOPE is a namespace
2711 that isn't the global one, call new function
2712 suggest_alternative_in_explicit_scope, only calling
2713 suggest_alternatives_for if it fails, and disabling near match
2714 searches fort that case. When SCOPE is the global namespace,
2715 pass true for new param to suggest_alternatives_for to allow for
2717 * lex.c (unqualified_name_lookup_error): Pass true for new param
2718 to suggest_alternatives_for.
2719 * name-lookup.c (consider_binding_level): Add forward decl.
2720 (suggest_alternatives_for): Add "suggest_misspellings" param,
2721 using it to conditionalize the fuzzy name-lookup code.
2722 (suggest_alternative_in_explicit_scope): New function.
2723 * parser.c (cp_parser_primary_expression): When calling
2724 finish_id_expression, pass location of id_expression rather
2725 than that of id_expr_token.
2726 (cp_parser_id_expression): Convert local "unqualified_id" from
2727 tree to cp_expr to avoid implicitly dropping location information.
2729 2017-01-20 Marek Polacek <polacek@redhat.com>
2732 * call.c (build_conditional_expr_1): Warn about duplicated branches.
2733 * semantics.c (finish_expr_stmt): Build statement using the proper
2736 2017-01-19 Jason Merrill <jason@redhat.com>
2738 US 20 - forwarding references and class template argument deduction
2739 * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
2740 * pt.c (push_template_decl_real): Set it.
2741 (maybe_adjust_types_for_deduction): Check it.
2742 (rewrite_template_parm): Copy it.
2744 US 19 - deduction guides and constructors
2745 * call.c (joust): Prefer deduction guides to constructors.
2746 * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
2747 (deduction_guide_p): Check DECL_P.
2749 * decl.c (check_initializer): Always use build_aggr_init for array
2752 PR c++/79130 - decomposition and direct-initialization
2753 * init.c (build_aggr_init): Communicate direct-initialization to
2755 (build_vec_init): Check for array copy sooner.
2756 * parser.c (cp_parser_decomposition_declaration): Remove call to
2757 build_x_compound_expr_from_list.
2759 2017-01-18 Jason Merrill <jason@redhat.com>
2761 PR c++/68666 - member variable template-id
2762 * typeck.c (finish_class_member_access_expr): Handle variable
2764 * pt.c (lookup_and_finish_template_variable): No longer static.
2765 * cp-tree.h: Declare it.
2767 2017-01-18 Nathan Sidwell <nathan@acm.org>
2770 * call.c (build_over_call): When checking ellipsis conversions for
2771 an inherited ctor, make sure there is at least one conversion.
2773 2017-01-18 Jason Merrill <jason@redhat.com>
2775 PR c++/78894 - ICE with class deduction and default arg
2776 * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
2778 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
2781 * mangle.c (write_discriminator): Reorganize abi warning check.
2783 2017-01-18 Nathan Sidwell <nathan@acm.org>
2785 * cp-tree.h: Clarify exception spec node comment.
2786 * except.c (nothrow_spec_p): Simplify by checking node-equality.
2789 * mangle.c (write_exception_spec): Check nothrow explicitly.
2790 (write_encoding): Don't increment processing_template_decl around
2793 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
2796 * mangle.c (write_template_args): Add "on" for operator names.
2798 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
2801 * mangle.c (write_discriminator): Handle discriminator >= 10.
2803 2017-01-17 Nathan Sidwell <nathan@acm.org>
2806 * cp-tree.h (maybe_generic_this_capture): Declare.
2807 * lambda.c (resolvable_dummy_lambda): New, broken out of ...
2808 (maybe_resolve_dummy): ... here. Call it.
2809 (maybe_generic_this_capture): New.
2810 * parser.c (cp_parser_postfix_expression): Speculatively capture
2811 this in generic lambda in unresolved member function call.
2812 * pt.c (tsubst_copy_and_build): Force hard error from failed
2813 member function lookup in generic lambda.
2815 2017-01-17 Aldy Hernandez <aldyh@redhat.com>
2818 * cp-array-notation.c (expand_array_notation_exprs): Handle
2821 2017-01-11 Jason Merrill <jason@redhat.com>
2823 PR c++/78337 - ICE on invalid with generic lambda
2824 * semantics.c (process_outer_var_ref): Check if containing_function
2825 is null. Move inform call under complain test.
2827 2017-01-11 Nathan Sidwell <nathan@acm.org>
2830 * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
2833 2017-01-11 Nathan Sidwell <nathan@acm.org>
2835 * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
2837 2017-01-11 Jakub Jelinek <jakub@redhat.com>
2840 * parser.c (cp_parser_std_attribute_spec): Remove over-eager
2841 assertion. Formatting fix.
2844 * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
2847 2017-01-10 David Malcolm <dmalcolm@redhat.com>
2850 * parser.c (cp_parser_class_specifier_1): Only suggest inserting
2851 a missing semicolon if we have a valid insertion location for
2854 2017-01-10 Jason Merrill <jason@redhat.com>
2856 FI 20, decomposition declaration with parenthesized initializer.
2857 * parser.c (cp_parser_decomposition_declaration): Use
2858 cp_parser_initializer.
2860 2017-01-09 Jason Merrill <jason@redhat.com>
2862 Implement P0195R2, C++17 variadic using.
2863 * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
2864 * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
2865 * error.c (dump_decl): Likewise.
2867 2017-01-09 Jakub Jelinek <jakub@redhat.com>
2869 PR translation/79019
2870 PR translation/79020
2871 * semantics.c (finish_omp_clauses): Add missing whitespace to
2872 translatable strings.
2873 * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
2875 2017-01-07 Jason Merrill <jason@redhat.com>
2877 PR c++/78948 - instantiation from discarded statement
2878 * parser.h (struct cp_parser): Remove in_discarded_stmt field.
2879 * cp-tree.h (in_discarded_stmt): Declare it.
2880 (struct saved_scope): Add discarded_stmt bitfield.
2881 (in_discarded_stmt): New macro.
2882 * decl2.c (mark_used): Check it.
2883 * parser.c (cp_parser_selection_statement): Adjust.
2884 (cp_parser_jump_statement): Adjust.
2886 2017-01-05 Jakub Jelinek <jakub@redhat.com>
2889 * decl.c (cp_finish_decomp): Remove probe variable, if tt is
2890 REFERENCE_REF_P, set tt to its operand.
2893 * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
2894 unions even for C++11 and later.
2896 2017-01-05 Nathan Sidwell <nathan@acm.org>
2899 * pt.c (convert_nontype_argument): Don't try and see if integral
2900 or enum expressions are constants prematurely.
2902 2017-01-04 Marek Polacek <polacek@redhat.com>
2905 * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
2906 a zero character literal.
2908 2017-01-04 Jakub Jelinek <jakub@redhat.com>
2911 * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
2915 * parser.c (cp_parser_simple_declaration): Only complain about
2916 inconsistent auto deduction if auto_result doesn't use auto.
2918 * parser.c (cp_parser_simple_declaration): Diagnose function
2919 declaration among more than one init-declarators with auto
2923 * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
2924 assertion, as lexer->buffer may be NULL.
2926 2017-01-04 Marek Polacek <polacek@redhat.com>
2930 * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
2932 2017-01-04 Nathan Sidwell <nathan@acm.org>
2935 * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
2936 (lambda_capture_field_type): Update prototype.
2937 * lambda.c (lambda_capture_field_type): Add is_reference parm.
2938 Add referenceness here.
2939 (add_capture): Adjust lambda_capture_field_type call, refactor
2941 * pt.c (tsubst): Adjust lambda_capture_field_type call.
2943 2017-01-01 Jakub Jelinek <jakub@redhat.com>
2945 Update copyright years.
2947 Copyright (C) 2017 Free Software Foundation, Inc.
2949 Copying and distribution of this file, with or without modification,
2950 are permitted in any medium without royalty provided the copyright
2951 notice and this notice are preserved.