1 2017-06-19 Nathan Sidwell <nathan@acm.org>
3 * pt.c (coerce_template_parms): Fix indentation.
4 (tsubst_decl): Remove repeated SET_DECL_RTL. Move VAR_P handling
8 * name-lookup.c (update_binding): Only warn about constructors
11 2017-06-17 Jason Merrill <jason@redhat.com>
13 PR c++/60063 - -Wunused-local-typedefs and templates.
14 * decl2.c (is_late_template_attribute): Return false for "used".
16 PR c++/70844 - -Wuseless-cast and inheriting constructor.
17 * method.c (forward_parm): Suppress warn_useless_cast.
19 2017-06-16 Jason Merrill <jason@redhat.com>
21 PR c++/81045 - Wrong type-dependence with auto return type.
22 * pt.c (type_dependent_expression_p): An undeduced auto outside the
23 template isn't dependent.
24 * call.c (build_over_call): Instantiate undeduced auto even in a
27 PR c++/80465 - ICE with generic lambda with noexcept-specifier.
28 * lambda.c (maybe_add_lambda_conv_op): Keep processing_template_decl
29 set longer for a generic lambda.
31 PR c++/80614 - Wrong mangling for C++17 noexcept type
32 * mangle.c (write_type): Put the eh spec back on the function type.
34 PR c++/81102 - Wrong error with partial specialization.
35 * pt.c (unify) [TEMPLATE_PARM_INDEX]: Strip reference when comparing
36 types. Do type deduction later.
38 PR c++/81074 - ICE with partial specialization of member template.
40 * pt.c (get_partial_spec_bindings): Only coerce innermost args.
42 PR c++/80831 - ICE with -fsyntax-only.
43 * decl2.c (c_parse_final_cleanups): Use cgraph_node::get_create.
45 PR c++/80639 - ICE with invalid PMF initialization.
46 PR c++/80043 - ICE with -fpermissive
47 * typeck.c (convert_for_assignment): Recurse when instantiate_type
48 returns without an error.
50 2017-06-16 Nathan Sidwell <nathan@acm.org>
52 * pt.c (tsubst_baselink): Fix & clarify formatting.
54 * cp-tree.h (build_this_parm, cp_build_parm_decl,
55 build_artificial_parm): Add FN parm.
56 * decl.c (start_cleanup_fn): Adjust.
57 (build_this_parm): Add FN parm, pass it through.
58 (grokfndecl): Adjust parm building.
59 * decl2.c (cp_build_parm_decl): Add FN parm, set context.
60 (build_artificial_parm): Add FN parm, pass through.
61 (maybe_retrofit_in_chrg): Adjust parm building.
62 (start_static_storage_duration_function): Likwise.
63 * lambda.c (maybe_aadd_lambda_conv_op): Likewise.
64 * method.c (implicitly_declare_fn): Likewise.
65 * parser.c (inject_this_parameter): Likewise.
67 Symbol tables are insert only.
68 * cp-tree.h (default_hash_traits <lang_identifier *>): Don't
69 derive from pointer_hash. Make undeletable.
71 * class.c (resort_type_method_vec): Avoid potential unsigned
74 Don't defer noexcept_deferred_spec.
75 * cp-tree.h (unevaluated_noexcept_spec): Don't declare.
76 * decl.c (cxx_init_decl_processing): Initialize
77 noexcept_deferred_spec.
78 * except.c (unevaluated_noexcept_spec): Delete.
79 * class.c (deduce_noexcept_on_destructor): Use
80 noexcept_deferred_spec directly.
81 * method.c (implicitly_declare_fn): Likewise.
83 Make keyed_classes a vector.
84 * cp-tree.h (CPTI_KEYED_CLASSES, keyed_classes): Delete.
85 (keyed_classes): Declare as vector.
86 * decl.c (keyed_classes): Define.
87 (cxx_init_decl_processing): Allocate it.
88 (record_key_method_defined): Use vec_safe_push.
89 * class.c (finish_struct_1): Likewise.
90 * pt.c (instantiate_class_template_1): Likewise.
91 * decl2.c (c_parse_final_cleanups): Reverse iterate keyed_classes.
94 * rtti.c (enum tinfo_kind): Add TK_DERIVED_TYPES,
95 TK_VMI_CLASS_TYPES, TK_MAX. Delete TK_FIXED.
97 (typeid_ok_p): Add quotes to error messages. Use get_tinfo_desc.
98 (get_tinfo_decl): Use get_tinfo_desc.
99 (get_pseudo_ti_init): Likewise. Adjust VMI construction.
100 (create_pseudo_type_info): Delete.
101 (get_pseudo_ti_index): Just determine the index.
102 (get_tinfo_desc): New. Create all types lazily.
103 (create_tinfo_types): Just allocate the descriptor array.
104 (emit_support_tinfos): Use non-inserting type lookup. Set builtin
107 2017-06-15 Martin Sebor <msebor@redhat.com>
110 * call.c (first_non_public_field, maybe_warn_class_memaccess): New
112 (has_trivial_copy_assign_p, has_trivial_copy_p): Ditto.
113 (build_cxx_call): Call maybe_warn_class_memaccess.
115 2017-06-14 Jakub Jelinek <jakub@redhat.com>
117 * cp-gimplify.c (cp_genericize_r): Turn most of the function
118 into a switch (TREE_CODE (stmt)) statement from long else if
121 2017-06-13 Jakub Jelinek <jakub@redhat.com>
124 * cp-gimplify.c (cp_genericize_r): Don't instrument MEM_REF second
125 argument even if it has REFERENCE_TYPE.
128 * cp-gimplify.c (cp_genericize): Only look for VAR_DECLs in
129 BLOCK_VARS (outer) chain.
130 (cxx_omp_const_qual_no_mutable): Likewise.
132 2017-06-13 Martin Liska <mliska@suse.cz>
135 * class.c (build_base_path): Use sanitize_flags_p.
136 * cp-gimplify.c (cp_genericize_r): Likewise.
137 (cp_genericize_tree): Likewise.
138 (cp_genericize): Likewise.
139 * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
140 * decl.c (compute_array_index_type): Likewise.
141 (start_preparsed_function): Likewise.
142 * decl2.c (one_static_initialization_or_destruction): Likewise.
143 * init.c (finish_length_check): Likewise.
144 * lambda.c (maybe_add_lambda_conv_op): Likewise.
145 * typeck.c (cp_build_binary_op): Likewise.
146 (build_static_cast_1): Likewise.
148 2017-06-11 Jason Merrill <jason@redhat.com>
150 * error.c (dump_expr): Use is_this_parameter.
152 * cp-tree.h, decl2.c, mangle.c, parser.c, pt.c, semantics.c: Use
155 2017-06-09 Jason Merrill <jason@redhat.com>
157 Missing bits from N4268, constant evaluation for all non-type args.
158 * call.c (build_converted_constant_expr): Rename from
159 build_integral_nontype_arg_conv, handle all types.
160 * pt.c (convert_nontype_argument): In C++17 call it for all types.
161 Move NOP stripping inside pointer case, don't strip ADDR_EXPR.
162 * cvt.c (strip_fnptr_conv): Also strip conversions to the same type.
164 Overhaul pointer-to-member conversion and template argument handling.
165 * call.c (standard_conversion): Avoid creating ck_pmem when the
166 class type is the same.
167 * cvt.c (can_convert_qual): Split from
168 perform_qualification_conversions.
169 * constexpr.c (cxx_eval_constant_expression): Check it.
170 * typeck.c (convert_ptrmem): Only cplus_expand_constant if
171 adjustment is necessary.
172 * pt.c (check_valid_ptrmem_cst_expr): Compare class types.
173 (convert_nontype_argument): Avoid redundant error.
175 * call.c (convert_like_real): Remove "inner" parameter.
176 Don't replace a constant with its value.
177 * cp-gimplify.c (cp_fully_fold): Use cp_fold_rvalue.
179 * pt.c (convert_nontype_argument): Check NULLPTR_TYPE_P rather than
182 * parser.c (cp_parser_constant_expression): Check
183 potential_rvalue_constant_expression after decay_conversion.
184 * pt.c (convert_nontype_argument): Don't require linkage in C++17.
186 PR c++/80384 - ICE with dependent noexcept-specifier
187 * pt.c (dependent_type_p_r) [FUNCTION_TYPE]: Check for dependent
190 * constexpr.c (potential_constant_expression_1): Allow 'this' capture.
192 2017-06-09 Jan Hubicka <hubicka@ucw.cz>
194 * class.c (build_vtbl_initializer): Mark dvirt_fn as cold.
195 * decl.c (cxx_init_decl_processing, push_throw_library_fn): Likewise.
196 (excpet.c): Mark terminate as cold.
198 2017-06-08 Jakub Jelinek <jakub@redhat.com>
201 * semantics.c (handle_omp_array_sections_1): Convert TYPE_MAX_VALUE
202 to sizetype before size_binop.
205 * cp-gimplify.c (cxx_omp_finish_clause): When changing clause
206 to OMP_CLAUSE_SHARED, also clear OMP_CLAUSE_SHARED_FIRSTPRIVATE
207 and OMP_CLAUSE_SHARED_READONLY flags.
209 2017-06-08 Jan Hubicka <hubicka@ucw.cz>
211 * cp-tree.h (lang_check_failed): Annotate by ATTRIBUTE_COLD.
213 2017-06-07 Nathan Sidwell <nathan@acm.org>
215 * class.c (layout_class_type): Restructure overlong-bitfield tpe
218 2017-06-07 Jonathan Wakely <jwakely@redhat.com>
221 * pt.c (do_class_deduction): Build qualified type.
223 2017-06-06 Nathan Sidwell <nathan@acm.org>
225 * name-lookup.c (suggest_alternatives_for): Use qualified lookup
226 sans using directives. Don't walk into inline namespaces.
229 * name-lookup.c (adl_class_only): Don't add visible friends.
231 2017-06-05 Volker Reichelt <v.reichelt@netcologne.de>
233 * parser.c (cp_parser_base_specifier): Fix typos in error messages.
235 2017-06-02 Nathan Sidwell <nathan@acm.org>
237 Remove lang_type_ptrmem.
238 * cp-tree.h (lang_type_header): Remove is_lang_type_class. Move
240 (lang_type_class): ... this. Reorder bitfields. Rename to ...
241 (lang_type): ... this. Delete old definition.
242 (lang_type_ptrmem): Delete.
243 (LANG_TYPE_CLASS_CHECK): Simply get TYPE_LANG_SPECIFIC. Adjust uses.
244 (LANG_TYPE_PTRMEM_CHECK): Delete.
245 (TYPE_GET_PTRMEMFUNC_TYPE, TYPE_SET_PTRMEMFUNC_TYPE): Delete.
246 (TYPE_PTRMEMFUNC_TYPE): New. Use TYPE_LANG_SLOT_1.
247 * decl.c (build_ptrmemfunc_type): Adjust.
248 * lex.c (copy_lang_type): Remove lang_type_ptrmem handling.
249 (maybe_add_lang_type_raw): Don't set u.c.h.is_lang_type_class.
251 * class.c (check_bases_and_members): Adjust vec_new_uses_cookie
254 Remove cp_binding_level::namespaces
255 * name-lookup.h (cp_binding_level): Lose namespaces field.
256 * name-lookup.c (add_decl_to_level): Chain namespaces on the names
258 (suggest_alternatives_for): Adjust for namespace list. Do
259 breadth-first search.
260 * decl2.c (collect_source_refs): Namespaces are on the regulr
262 (collect_ada_namespace): Likewise.
264 2017-06-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
266 * typeck.c (cp_build_binary_op): Implement the -Wsizeof_pointer_div
269 2017-06-01 Ville Voutilainen <ville.voutilainen@gmail.com>
272 * method.c (constructible_expr): Strip array types before calling
275 2017-06-01 Paolo Carlini <paolo.carlini@oracle.com>
278 * cvt.c (convert_to_void): Possibly call maybe_warn_nodiscard
279 for case INDIRECT_REF too in the main switch.
281 2017-05-31 Jason Merrill <jason@redhat.com>
283 PR c++/80840 - ICE with constexpr and reference
284 * pt.c (convert_nontype_argument): Don't test whether a decl is
285 value-dependent when binding to a reference.
287 2017-05-31 Nathan Sidwell <nathan@acm.org>
289 * cp-tree.h (lang_decl_slector): New enum.
290 (lang_decl_base): Make selector an enum. Drop decomposition_p
292 (lang_decl): Use enum for discrimination.
293 (LANG_DECL_FN_CHECK, LANG_DECL_NS_CHECK, LANG_DECL_PARM_CHECK,
294 LANG_DECL_DEOMP_CHECK): Use enum.
295 (DECL_DECOMPOSITION_P): Use selector value.
296 (SET_DECL_DECOMPOSITION_P): Delete.
297 (retrofit_lang_decl): Lose SEL parm.
298 (fit_decomposition_lang_decl): Declare.
299 * decl.c (cp_finish_decomp, grokdeclarator): Use
300 fit_decomposition_lang_decl.
301 * lex.c (maybe_add_lang_decl_raw): New. Broken out of
303 (set_decl_linkage): New. Broken out of retrofit_lang_decl. Use enum.
304 (fit_decomposition_lang_decl): Likewise.
305 (retrofit_lang_decl): Use worker functions.
306 (cxx_dup_lang_specific_decl): Use selector enum.
307 (maybe_add_lang_type_raw): New. Broken out of ...
308 (cxx_make_type_name): ... here. Call it.
310 2017-05-30 Jason Merrill <jason@redhat.com>
312 PR c++/80856 - ICE with local extern in template
313 * semantics.c (finish_call_expr): Replace a local extern overload
314 set in a template with the IDENTIFIER_NODE.
316 2017-05-30 David Malcolm <dmalcolm@redhat.com>
318 * call.c (perform_implicit_conversion_flags): Convert
319 "from %qT to %qT" to "from %qH to %qI" in diagnostic.
320 (print_conversion_rejection): Replace pairs of %qT with
321 %qH and %qI in various places.
322 (build_user_type_conversion_1): Likewise.
323 (build_integral_nontype_arg_conv): Likewise.
324 (build_conditional_expr_1): Likewise.
325 (convert_like_real): Likewise.
326 (convert_arg_to_ellipsis): Likewise.
328 (initialize_reference): Likewise.
329 * cvt.c (cp_convert_to_pointer): Likewise.
330 (cp_convert_to_pointer): Likewise.
331 (convert_to_reference): Likewise.
332 (ocp_convert): Likewise.
333 * error.c (cp_printer): Gain bool and const char ** parameters.
334 (struct deferred_printed_type): New struct.
335 (class cxx_format_postprocessor): New class.
336 (cxx_initialize_diagnostics): Wire up a cxx_format_postprocessor
337 to pp->m_format_postprocessor.
338 (comparable_template_types_p): New function.
339 (newline_and_indent): New function.
340 (arg_to_string): New function.
341 (print_nonequal_arg): New function.
342 (print_template_differences): New function.
343 (type_to_string_with_compare): New function.
344 (print_template_tree_comparison): New function.
345 (append_formatted_chunk): New function.
346 (add_quotes): New function.
347 (cxx_format_postprocessor::handle): New function.
348 (defer_phase_2_of_type_diff): New function.
349 (cp_printer): Add "quoted" and "buffer_ptr" params. Implement
351 * typeck.c (cp_build_binary_op): Replace pairs of %qT with
352 %qH and %qI in various places.
353 (convert_member_func_to_ptr): Likewise.
354 (build_reinterpret_cast_1): Likewise.
355 (convert_for_assignment): Likewise.
356 * typeck2.c (check_narrowing): Likewise.
358 2017-05-30 Nathan Sidwell <nathan@acm.org>
360 Kill IDENTIFIER_NAMESPACE_BINDINGS
361 * cp-tree.h (lang_identifier): Delete namespace_bindings.
362 (IDENTIFIER_NAMESPACE_BINDINGS): Delete.
363 (lang_decl_ns): Add bindings.
364 (DECL_NAMESPACE_BINDINGS): New.
365 * lex.c (retrofit_lang_decl): Create namespace hash table.
366 * name-lookup.c (find_namespace_slot): Change to use hash-map.
367 * ptree.c (cxx_print_binding): Delete.
368 (cxx_print_identifier): Remove NAMESPACE_BINDING printing.
370 * cp-tree.def (OVERLOAD): Fix comment.
371 * cp-tree.h: Fix comments and whitespace.
372 * error.c (dump_decl): Use pp_cxx_colon_colon, ovl_scope.
373 * name-lookup.c (add_decl_to_level): Assert not class.
374 (check_local_shadow): Use OVL_P.
375 (pushdecl_with_scope_1): Rename to ...
376 (do_pushdecl_with_Scope): ... here.
377 (do_nonmember_using_decl): Use qualified_namespace_lookup return
379 (push_class_level_binding_1): Use OVL_P.
380 (pushdecl_namespace_level): Use do_pushdecl_with_scope.
381 (pushtag_1): Rename to ...
382 (do_pushtag): ... here. Adjust do_pushdecl_with_scope call.
384 (store_class_bindings): Do not time here.
385 * name-lookup.h (pushdecl_outermost_localscope): Reorder.
386 * pt.c (listify): Declare argvec at point of initialization.
389 * name-lookup.c (add_decl_to_level): Assert not making a circular
391 (update_binding): Don't prematurely slide artificial decl.
393 2017-05-29 Alexandre Oliva <aoliva@redhat.com>
395 * cp-tree.h (lang_identifier): Drop oracle_looked_up, unused.
397 2017-05-29 Nathan Sidwell <nathan@acm.org>
400 * cp-tree.h (lookup_maybe_add): Add DEDUPING argument.
401 * name-lookup.c (name_lookup): Add deduping field.
402 (name_lookup::preserve_state, name_lookup::restore_state): Deal
404 (name_lookup::add_overload): New.
405 (name_lookup::add_value, name_lookup::add_fns): Call add_overload.
406 (name_lookup::search_adl): Set deduping. Don't unmark here.
407 * pt.c (most_specialized_instantiation): Revert previous change,
408 Assert not given duplicates.
409 * tree.c (lookup_mark): Just mark the underlying decls.
410 (lookup_maybe_add): Dedup using marked decls.
413 * ptree.c (cxx_print_xnode): Show internal OVERLOAD structure.
414 * tree.c (ovl_insert, ovl_iterator_remove_node): Fix copying assert.
416 Stat hack representation
417 * name-lookup.c (STAT_HACK_P, STAT_TYPE, STAT_DECL,
418 MAYBE_STAT_DECL, MAYBE_STAT_TYPE): New.
420 (find_namespace_binding): Replace with ...
421 (find_namespace_slot): ... this.
422 (find_namespace_value): New.
423 (name_lookup::search_namespace_only,
424 name_lookup::adl_namespace_only): Adjust.
425 (update_binding): Add SLOT parameter, adjust.
426 (check_local_shadow): Use find_namespace_value.
427 (set_local_extern_decl_linkage): Likewise.
428 (do_pushdecl): Adjust for namespace slot.
429 (push_local_binding): Assert not a namespace binding.
430 (check_for_out_of_scope_variable): Use find_namespace_value.
431 (set_identifier_type_value_with_scope): Likewise.
432 (get_namespace_binding): Likewise.
433 (set_namespace_binding): Delete.
434 (set_global_binding): Directly update the binding.
435 (finish_namespace_using_decl): Likewise.
436 (lookup_type_scope_1): Use find_namespace_slot and update.
437 (do_push_nested_namespace): Use find_namespace_value.
440 * pt.c (most_specialized_instantiation): Cope with duplicate
444 * cp-tree.h (build_min_nt_call_vec): Declare.
445 * decl.c (build_offset_ref_call_from_tree): Call it.
446 * parser.c (cp_parser_postfix_expression): Likewise.
447 * pt.c (tsubst_copy_and_build): Likewise.
448 * semantics.c (finish_call_expr): Likewise.
449 * tree.c (build_min_nt_loc): Keep unresolved lookups.
450 (build_min): Likewise.
451 (build_min_non_dep): Likewise.
452 (build_min_non_dep_call_vec): Likewise.
453 (build_min_nt_call_vec): New.
456 * tree.c (ovl_copy): Adjust assert, copy OVL_LOOKUP.
458 (lookup_keep): Call it.
460 2017-05-26 Nathan Sidwell <nathan@acm.org>
463 * name-lookup.c (push_inline_namespaces): New.
464 (push_namespace): Look inside inline namespaces.
466 Inline and using namespace representation change.
467 * cp-tree.h (struct lang_decl_ns): Delete ns_using. Add usings,
469 (DECL_NAMESPACE_USING): Adjust.
470 (DECL_NAMESPACE_INLINEES): New.
471 * name-lookup.h (struct cp_binding_level): Change usings
473 * name-lookup.c (name_lookup::do_queue_usings,
474 name_lookup::queue_usings): Adjust.
475 (name_lookup::search_namespace, name_lookup::search_usings,
476 name_lookup::queue_namespace): Adjust.
477 (name_lookup::adl_namespace_only): Adjust.
478 (add_using_namespace, push_namespace): Push onto vector.
479 (pop_namespace): Add timing logic.
481 * call.c (build_operator_new_call): Do namelookup and ADL here.
482 (build_new_op_1): Likewise.
483 * name-lookup.h (lookup_function_nonclass): Delete declaration.
484 (do_using_directive): Likewise.
485 * name-lookup.c (set_namespace_binding, push_local_binding): Don't
487 (struct scope_binding): Delete.
488 (EMPTY_SCOPE_BINDING): Delete.
489 (set_decl_namespace): Use OVL_P.
490 (finish_local_using_decl): Lose unnecesary checks.
491 (lookup_function_nonclass): Delete.
492 (cp_emit_debug_info_for_using): Use MAYBE_BASELINK_P.
494 * cp-tree.h (OVL_CHAIN): Check looking at OVERLOAD.
495 (ovl_iterator): Add allow_inner field. Adjust ctor. Make
497 (ovl_iterator::maybe_push, ovl_iterator::pop): New.
498 (lkp_iterator): Add outer field. Adjust ctor.
499 (lkp_iterator::operator++): New.
500 (lookup_mark, lookup_maybe_add): Declare.
501 * name-lookup.c (name_lookup): Delete fn_set member.
502 (name_lookup::preserve_state, name_lookup::restore_state): Unmark
504 (name_lookup::add_value): Use lookup_add directly.
505 (name_lookup::add_fns: Use lookup_maybe_add.
506 (name_lookup::search_adl): Mark and unmark fns.
508 * pt.c (check_explicit_specialization): Use lookup_add directly.
509 * ptree.c (cxx_print_xnode): Show complete overload structure.
510 * tree.c (lookup_mark, lookup_maybe_add): New.
512 * name-lookup.c (name_lookup::search_adl): ADL OMP UDR type args.
514 2017-05-26 Jakub Jelinek <jakub@redhat.com>
516 * cp-tree.h (struct lang_decl_decomp): New type.
517 (struct lang_decl): Add u.decomp.
518 (LANG_DECL_DECOMP_CHECK): Define.
519 (DECL_DECOMPOSITION_P): Note it is set also on the vars
520 for user identifiers.
521 (DECL_DECOMP_BASE): Define.
522 (retrofit_lang_decl): Add extra int = 0 argument.
523 * lex.c (retrofit_lang_decl): Add SEL argument, if non-zero
524 use it to influence the selector choices and for selector
525 0 to non-zero transition copy old content.
526 (cxx_dup_lang_specific_decl): Handle DECL_DECOMPOSITION_P.
527 * decl.c (poplevel): For DECL_DECOMPOSITION_P, check
528 !DECL_DECOMP_BASE instead of !DECL_VALUE_EXPR. Adjust warning
529 wording if decl is a structured binding.
530 (cp_finish_decomp): Pass 4 as the new argument to retrofit_lang_decl.
531 Set DECL_DECOMP_BASE. Ignore DECL_READ_P sets from initialization
532 of individual variables for tuple structured bindings.
533 (grokdeclarator): Pass 4 as the new argument to retrofit_lang_decl.
534 Clear DECL_DECOMP_BASE.
535 * decl2.c (mark_used): Mark DECL_DECOMP_BASE TREE_USED as well.
536 * pt.c (tsubst_decomp_names): Assert DECL_DECOMP_BASE matches what
538 * expr.c (mark_exp_read): Recurse on DECL_DECOMP_BASE instead of
541 2017-05-25 Jason Merrill <jason@redhat.com>
543 PR c++/80605 - __is_standard_layout and zero-length array
544 * class.c (check_bases): Use DECL_FIELD_IS_BASE.
546 2017-05-25 Nathan Sidwell <nathan@acm.org>
548 Kill OVL_CURRENT, OVL_NEXT.
549 * cp-tree.h (OVL_CURRENT, OVL_NEXT): Delete.
550 * name-lookup.c (set_decl_namespace): Use ovl_iterator.
551 (consider_binding_level): Use OVL_FIRST.
552 (cp_emit_debug_info_for_using): Use lkp_iterator.
553 * pt.c (check_explicit_specialization): Use ovl_iterator.
555 Kill DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS.
556 * cp-tree.h (lang_decl_ns): Remove ns_users field.
557 (DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS): Delete.
558 (TREE_INDIRECT_USING): Delete.
559 * name-lookup.h (is_associated_namespace): Delete.
560 * name-lookup.c (name_lookup::search_usings,
561 name_lookup::do_queue_usings): Usings are always direct.
562 (is_associated_namespace): Delete.
563 (handle_namespace_attrs): Use DECL_NAMESPACE_INLINE_P.
564 (namespace_ancestor_1, namespace_ancestor): Delete.
565 (push_using_directive_1, push_using_directive): Delete.
566 (add_using_namespace_1): Delete.
567 (add_using_namespace): Reimplement.
568 (emit_debug_info_using_namespace): New.
569 (finish_namespace_using_directive, finish_local_using_directive,
570 push_namespace): Adjust.
571 * tree.c (cp_free_lang_data): Remove DECL_NAMESPACE_USERS handling.
573 2017-05-25 Volker Reichelt <v.reichelt@netcologne.de>
575 * semantics.c (finish_handler_parms): Warn about non-reference type
578 2017-05-25 Nathan Sidwell <nathan@acm.org>
580 Reimplement unqualified namespace lookup.
581 * name-lookup.c (name_lookup::using_pair,
582 name_lookup::using_queue): New typedefs.
583 (name_lookup::queue_namespace, name_lookup::do_queue_usings,
584 name_lookup::queue_usings): New.
585 (name_lookup::search_unqualified): New.
586 (merge_functions, same_entity_p, ambiguous_decl,
587 unqualified_namespace_lookup_1, unqualified_namespace_lookup,
588 lookup_using_namespace): Delete.
589 (lookup_name_real_1): Adjust.
591 Reimplement qualified namespace lookup.
592 * name-lookup.c (name_lookup::flags): New member. Adjust ctor.
593 (name_lookup::ambiguous, name_lookup::add_value,
594 name_lookup::add_type, name_lookup::process_binding): New.
595 (name_lookup::search_namespace_only,
596 name_lookup::search_namespace, name_lookup::search_usings): New.
597 (name_lookup::search_qualified): New.
598 (do_nonmember_using_decl, suggest_alternatives_for,
599 lookup_qualified_name): Adjust.
600 (tree_vec_contains): Delete.
601 (qualified_lookup_using_namespace): Rename to ...
602 (qualified_namespace_lookup): ... here. Reimplement.
605 * cp-tree.h (LOOKUP_SEEN_P, LOOKUP_FOUND_P): New.
606 * name-lookup.h (lookup_arg_dependent): Return plain tree.
607 * name-lookup.c (arg_lookup, arg_assoc, arg_assoc_args,
608 arg_assoc_args_vec, arg_assoc_type, add_function,
609 arg_assoc_namespace, arg_assoc_class_only, arg_assoc_bases,
610 arg_assoc_class, arg_assoc_template_arg, arg_assoc,
611 lookup_arg_dependent_1): Delete.
612 (name_lookup): New lookup object.
613 (name_lookup::preserve_state, name_lookup::restore_state,
614 name_lookup::mark_seen, name_lookup::find_and_mark,
615 name_lookup::add_fns, name_lookup::adl_namespace_only,
616 name_lookup::adl_namespace, name_lookup::adl_class_only,
617 name_lookup::adl_bases, name_lookup::adl_class,
618 name_lookup::adl_expr, name_lookup::adl_type,
619 name_lookup::adl_template_arg, name_lookup::search_adl): New.
620 (lookup_arg_dependent): Return a plain tree. Adjust.
621 (is_associated_namespace): Move later.
623 2017-05-24 Nathan Sidwell <nathan@acm.org>
625 * friend.c (do_friend): Remove check for existing decl.
626 * name-lookup.h (lookup_name_innermost_nonclass_level): Delete.
627 * name-lookup.c (push_local_binding): Directly look for binding.
628 (lookup_name_innermost_nonclass_level_1): Delete.
629 (lookup_name_innermost_nonclass_level): Delete.
631 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Alphabetize.
633 * cp-tree.h (cp_free_lang_data): Add extern.
634 (ovl_skip_hidden, is_overloaded_fn, really_overloaded_fn): Add
636 (type_unknown_p): Return bool, make inline, lose TREE_LIST check.
637 * typeck.c (type_unknown_p): Delete.
638 * tree.c (is_overloaded_fn): Use MAYBE_BASELINE_FUNCTIONS, adjust
640 (dependent_name): Likewise.
641 (decl_anon_ns_mem_p): Simplify.
643 2017-05-24 Jonathan Wakely <jwakely@redhat.com>
646 * tree.c (reshape_init): Use unqualified type for direct enum init.
647 * typeck.c (maybe_warn_about_cast_ignoring_quals): New.
648 (build_static_cast_1, build_reinterpret_cast_1): Strip cv-quals from
649 non-class destination types.
650 (build_const_cast_1): Strip cv-quals from destination types.
651 (build_static_cast, build_reinterpret_cast, build_const_cast)
652 (cp_build_c_cast): Add calls to maybe_warn_about_cast_ignoring_quals.
654 2017-05-24 Martin Sebor <msebor@redhat.com>
657 * call.c (fully_fold_internal): Adjust.
659 2017-05-24 Nathan Sidwell <nathan@acm.org>
661 * cp-tree.h (ovl_skip_hidden): Declare.
662 * tree.c (ovl_skip_hidden): New.
663 * name-lookup.c (arg_assoc_namespace): Call ovl_skip_hidden.
664 (lookup_arg_dependent_1): Likewise.
665 (ambiguous_decl): Use DECL_HIDDEN_P, ovl_skip_hidden.
666 (hidden_name_p, remove_hidden_names): Delete.
667 (lookup_name_real_1): Do not strip hidden names.
668 * name-lookup.h (hidden_name_p, remove_hidden_names): Delete.
670 * cp-tree.h (OVL_HIDDEN_P): New.
671 (ovl_iterator::hidden_p, ovl_iterator::reveal_node): New.
672 (ovl_iterator::reveal_node): Declare.
673 * tree.c (ovl_copy): Copy OVL_HIDDEN_P.
674 (ovl_insert): Order on hiddenness.
675 (ovl_iterator::reveal_node): New.
676 * name-lookup.c (anticipated_builtin_p): New.
677 (supplement_binding_1): Use it.
678 (set_local_extern_decl_linkage): Use hidden_p.
679 (do_pushdecl): Deal with unhiding a hidden decl, use
680 anticipated_builtin_p.
681 (do_nonmember_using_decl): Use anticipated_decl_p.
682 (lookup_name_real_1): Use DECL_HIDDEN_P.
684 2017-05-23 Jason Merrill <jason@redhat.com>
686 -Wunused and C++17 structured bindings
687 * decl.c (poplevel): Don't warn about unused structured bindings,
689 * error.c (dump_simple_decl): Handle structured bindings.
690 * expr.c (mark_exp_read): Look through DECL_VALUE_EXPR.
692 2017-05-23 Nathan Sidwell <nathan@acm.org>
694 * cp-tree.h (PUSH_GLOBAL, PUSH_LOCAL, PUSH_USING): Delete.
695 * name-lookup.c (create_local_binding): New.
696 (update_binding): New.
697 (pushdecl_maybe_friend_1): Rename to ...
698 (do_pushdecl): ... this. Reimplement.
700 (push_overloaded_decl_1, push_overloaded_decl): Delete.
702 2017-05-23 Jason Merrill <jason@redhat.com>
704 PR c++/80396 - built-in for make_integer_sequence.
705 * pt.c (builtin_pack_fn_p, builtin_pack_call_p)
706 (expand_integer_pack, expand_builtin_pack_call): New.
707 (find_parameter_packs_r): Check builtin_pack_call_p.
708 (check_for_bare_parameter_packs): Handle it.
709 (tsubst_pack_expansion): Call expand_builtin_pack_call.
710 (declare_integer_pack): New.
711 (init_template_processing): Call it.
712 * decl2.c (mark_used): Check builtin_pack_fn_p.
714 2017-05-23 Nathan Sidwell <nathan@acm.org>
716 * name-lookup.c (find_namespace_binding): New.
717 (pushdecl_maybe_friend_1): Use CP_DECL_CONTEXT.
718 (set_identifier_type_value_with_scope): Use find_namespace_binding.
719 (find_binding, cp_binding_level_find_binding_for_name,
720 binding_for_name, namespace_binding_1): Delete.
721 (push_overloaded_decl_1): Use CP_DECL_CONTEXT.
722 (get_namespace_binding, set_namespace_binding,
723 finish_namespace_using_decl, unqualified_namespace_lookup_1,
724 qualified_lookup_using_namespace, lookup_type_scope_1,
725 lookup_name_innermost_nonclass_level_1): Use find_namespace_binding.
728 * parser.c (cp_parser_template_id): Keep the lookup when stashing
731 * cp-tree.h (DECL_HIDDEN_P): New.
732 * name-lookup.c (set_decl_context,
733 set_local_extern_decl_linkage): New, broken out of ...
734 (pushdecl_maybe_friend_1): ... here. Call them.
736 2017-05-23 Thomas Schwinge <thomas@codesourcery.com>
738 * parser.c (OACC_KERNELS_CLAUSE_MASK): Add
739 "PRAGMA_OACC_CLAUSE_NUM_GANGS", "PRAGMA_OACC_CLAUSE_NUM_WORKERS",
742 2017-05-23 Nathan Sidwell <nathan@acm.org>
744 * cp-tree.h (OVL_P): New.
745 * name-lookup.h (push_local_binding): Delete.
746 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
747 (finish_namespace_using_decl, finish_local_using_decl): ... here
748 * name-lookup.c (add_decl_to_level): Swap args.
749 (pop_bindings_and_leave_scope): Look inside TREE_LIST.
750 (diagnose_name_conflict): Check contexts are same for redecl.
751 (update_local_overload): New.
752 (compparms_for_decl_and_using): Rename to ...
753 (matching_fn_p): ... here.
754 (pushdecl_maybe_friend_1): Adjust add_decl_to_level,
755 push_local_bindings call.
756 (push_local_binding): Make static, replace FLAGS arg with
758 (validate_nonmember_using_decl): Use OVL_FIRST.
759 (do_nonmember_using_decl): Use in/out parameters. Use
760 lkp_iterator and simplify.
761 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
762 (finish_namespace_using_decl, finish_local_using_decl): ... here.
764 (lookup_type_current_level): Delete.
765 * parser.c (cp_parser_using_declaration): Adjust.
766 * pt.c (tsubst_expr): Adjust.
768 2017-05-22 Nathan Sidwell <nathan@acm.org>
770 * name-lookup.h (parse_using_directive): Replace with ...
771 (finish_namespace_using_directive): ... this and ...
772 (finish_local_using_directive): ... this.
773 * name-lookup.c (add_using_namespace_1): Move later.
774 (add_using_namespace): Move later, add namespace_p arg, remove
776 (push_using_directive_1): Directly recurse.
777 (do_using_directive, parse_using_directive): Delete, split into ...
778 (finish_namespace_using_directive): ... this and ...
779 (finish_local_using_directive): ... this.
780 (push_namespace): Use add_using_namespace.
781 * parser.c (cp_parser_using_directive): Call
782 finish_namespace_using_directive or finish_local_using_directive.
783 * pt.c (tsubst_expr): Call finish_local_using_directive.
785 * cp-objcp-common.c (cp_register_dumps): Register raw dumper.
786 * cp-tree.h (raw_dump_id): Declare.
787 * decl2.c (raw_dump_id): Define.
788 (dump_tu): Use raw_dump_id.
790 * config-lang.in (gtfiles): Sort list, break lines.
792 * cp-tree.h (CPTI_TERMINATE, CPTI_CALL_UNEXPECTED): Rename to ...
793 (CPTI_TERMINATE_FN, CPTI_CALL_UNEXPECTED_FN): ... here.
794 ( CPTI_GET_EXCEPTION_PTR_FN, CPTI_BEGIN_CATCH_FN, CPTI_END_CATCH_FN,
795 CPTI_ALLOCATE_EXCEPTION_FN, CPTI_FREE_EXCEPTION_FN, CPTI_THROW_FN,
796 CPTI_RETHROW_FN): New.
797 (noexcept_deferred_spec): New.
798 (terminate_node, call_unexpected_node): Rename to ...
799 (terminate_fn, call_unexpected_fn): ... here.
800 (get_exception_ptr_fn, begin_catch_fn, end_catch_fn,
801 allocate_exception_fn, free_exception_fn, throw_fn, rethrow_fn): New.
802 * except.c (fn1..fn5, throw_fn, rethrow_rn, spec): Delete.
803 (init_exception_processing): Adjust.
804 (declare_library_fn): Create and push the fns here.
805 (do_get_exception_ptr, do_begin_catch, do_end_catch,
806 do_allocate_exception_ptr, do_free_exception_ptr): Adjust
807 declare_library_fn use.
808 (unevaluated_noexcept_spec): Adjust.
809 * cp-gimplify.c (genericize_eh_spec_block,
810 gimplify_most_not_throw_expr): Adjust.
812 * name-lookup.c (pushdecl_top_level,
813 pushdecl_top_level_and_finish): Move after namespace pushing and
815 (push_to_top_level): Rename to ...
816 (do_push_to_top_level): ... here. Remove timing code.
817 (pop_from_top_level_1): Rename to ...
818 (do_pop_from_top_level): ... here.
819 (do_push_nested_namespace, do_pop_nested_namespace)
820 (push_to_top_level): New wrapper for do_push_to_top_level.
821 (pop_from_top_level): Adjust.
822 (push_nested_namepace, pop_nested_namespace): Wrappers for workers.
824 2017-05-19 Bernd Edlinger <bernd.edlinger@hotmail.de>
826 * config-lang.in (gtfiles): Add c-family/c-format.c,
827 except.c, init.c, lambda.c and friend.c.
828 * class.c (dvirt_fn): Move out of function scope,
830 * except.c (fn1-5, throw_fn, rethrow_fn, spec): Likewise.
831 * init.c (fn): Likewise.
832 * lambda.c (ptr_id, max_id): Likewise.
833 * friend.c (global_friend): Add GTY attribute.
835 2017-05-19 Nathan Sidwell <nathan@acm.org>
837 * call.c (add_list_candidates): Use OVL_FIRST.
838 (build_new_method_call_1): Likewise.
839 * cp-tree.h (OVL_SINGLE_P): New.
840 (TYPE_HIDDEN_P): New.
841 * decl.c (xref_tag_1): Use TYPE_HIDDEN_P.
842 * dump.c (cp_tump_tree): Adjust overload dumping.
843 * error.c (dump_decl): Use OVL_SINGLE_P, simplify context
845 * method.c (lazily_declare_fn): Assert we added it.
846 * parser.c (cp_parser_nested_name_specifier): Use OVL_SINGLE_P,
848 (cp_parser_template_name): Use lkp_iterator.
849 * pt.c (begin_template_parm_list): Fixup comment.
850 (instantiate_class_template_1): Use TYPE_HIDDEN_P.
851 * tree.c (ovl_iterator::remove_node): Cope with inherited ctors.
852 (ovl_scope): Use lkp_iterator.
854 2017-05-19 Thomas Schwinge <thomas@codesourcery.com>
856 * parser.c (cp_parser_omp_clause_default): Handle
857 "OMP_CLAUSE_DEFAULT_PRESENT".
859 * parser.c (cp_parser_omp_clause_default): Avoid printing more
860 than one syntax error message.
862 2017-05-19 Nathan Sidwell <nathan@acm.org>
864 * class.c (class_dump_id): Define.
865 (dump_class_hierarchy, dump_vtable, dump_vtt): Use it.
866 * cp-objcp-common.c (cp_register_dumps): New.
867 * cp-objcp-common.h (cp_register_dumps): Declare.
868 (LANG_HOOKS_REGISTER_DUMPS): Override.
869 * cp-tree.h (class_dump_id): Declare.
871 2017-05-18 Nathan Sidwell <nathan@acm.org>
873 * cp-tree.h (OVL_ARG_DEPENDENT): Delete.
875 (lookup_keep): Declare.
876 * name-lookup.c (add_function): Don't set OVL_ARG_DEPENDENT.
877 * pt.c (tsubst_copy): Assert lookup is persistent.
878 * semantics.c (finish_call_expr): Use lkp_iterator, call
880 * tree.c (ovl_copy): New.
881 (ovl_insert, ovl_iterator::remove_node): Copy immutable nodes.
884 * cp-tree.h (OVL_USED): Replace with ...
885 (OVL_USING_P): ... this.
886 (ovl_iterator::using_p): Adjust.
887 * name-lookup.c (push_overloaded_decl_1,
888 do_nonmember_using_decl): Adjust.
889 * search.c (lookup_field_r): Adjust.
890 * tree.c (ovl_insert, ovl_scope): Adjust.
892 * cp-tree.h (lookup_add): Swap args.
893 (ovl_cons, build_overload): Delete.
894 * name-lookup.c (add_function, push_overloaded_decl_1,
895 do_nonmember_using_decl, merge_functions, remove_hidden_names):
896 Use lookup_add, ovl_insert.
897 * pt.c (check_explicit_specialization): Use lookup_add.
898 (do_class_deduction): Likewise. Refactor if.
899 * tree.c (lookup_add): Swap args.
900 (ovl_cons, build_overload): Delete.
902 * name-lookup.c (find_local_binding): New, broken out of ...
903 (lookup_name_innermost_nonclass_level_1): ... here. Call it.
904 (set_namespace_binding): Swap scope & name args.
905 (namespace_binding_1): Likewise.
906 (pushdecl_maybe_friend_1): Adjust set_namespace_binding call.
907 (push_overloaded_decl_1): Likewise.
908 (set_global_binding): Likewise.
909 (get_namespace_binding): Adjust namespace_binding_1 call.
911 2017-05-17 Nathan Sidwell <nathan@acm.org>
913 * cp-tree.h (default_hash_traits <lang_identifier *>): New
915 * name-lookup.c (lookup_extern_c_fun_in_all_ns): Delete.
916 (extern_c_fns): New hash table.
917 (check_extern_c_conflict): New, broken out of ...
918 (pushdecl_maybe_friend_1): ... here. Call it.
919 (c_linkage_bindings): Just look in hash table.
921 2017-05-17 Ville Voutilainen <ville.voutilainen@gmail.com>
925 Implement new C++ intrinsics __is_assignable and __is_constructible.
926 * cp-tree.h (CPTK_IS_ASSIGNABLE, CPTK_IS_CONSTRUCTIBLE): New.
928 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
929 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
930 * method.c (constructible_expr): Set cp_unevaluated.
931 (is_xible_helper): New.
932 (is_trivially_xible): Adjust.
934 * parser.c (cp_parser_primary_expression): Handle
935 RID_IS_ASSIGNABLE and RID_IS_CONSTRUCTIBLE.
936 (cp_parser_trait_expr): Likewise.
937 * semantics.c (trait_expr_value): Handle
938 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
940 2017-05-17 Nathan Sidwell <nathan@acm.org>
942 * cp-tree.h (ovl_iterator::using_p): New predicate.
943 (ovl_iterator::remove_node): New worker.
944 (ovl_insert): Declare.
945 * tree.c (ovl_insert): New.
946 (ovl_iterator::remove_node): New.
947 * class.c (add_method): Use ovl_iterator, ovl_insert.
948 (clone_function_decl): Fix description.
949 (clone_constructors_and_destructors): Use ovl_iterator.
951 * class.c (handle_using_decl): Use OVL_FIRST, ovl_iterator.
952 (maybe_warn_about_overly_private_class): Use ovl_iterator.
953 (method_name_cmp, resort_method_name_cmp): Use OVL_NAME.
954 (resort_type_method_vec, finish_struct_methods): Use OVL_FIRST.
955 (get_base_fndecls): Use ovl_iterator.
956 (warn_hidden): Use OVL_NAME, ovl_iterator.
957 (add_implicitly_declared_members): Use ovl_iterator.
958 * constraint.cc (normalize_template_id_expression): Use OVL_FIRST,
960 (finish_shorthand_constraint): Simplify, use ovl_make.
961 * pt.c (make_constrained_auto): Simplify. Use ovl_make.
962 * search.c (shared_member_p): Use ovl_iterator.
963 (lookup_field_fuzzy_info::fuzzy_lookup_fn): Use OVL_NAME.
964 (lookup_conversion_operator): Use OVL_FIRST.
965 (lookup_fnfiels_idx_nolazy): Use OVL_FIRST, OVL_NAME.
966 (look_for_overrides_here): Use ovl_iterator.
967 (lookup_conversions_r): Use OVL_FIRST, OVL_NAME, ovl_iterator.
968 * typeck.c (build_x_unary_op): Use ovl_make.
970 2017-05-17 Martin Liska <mliska@suse.cz>
972 * class.c (dump_class_hierarchy): Introduce dump_flags_t type and
973 use it instead of int type.
974 (dump_vtable): Likewise.
975 (dump_vtt): Likewise.
976 * decl2.c (dump_tu): Likewise.
978 2017-05-16 David Malcolm <dmalcolm@redhat.com>
980 * call.c (enforce_access): Add access_failure_info * param and use
981 it to record access failures.
982 * cp-tree.h (class access_failure_info): New class.
983 (enforce_access): Add access_failure_info * param, defaulting to
985 (lookup_member): Likewise.
986 (locate_field_accessor): New function decl.
987 (perform_or_defer_access_check): Add access_failure_info * param,
989 * search.c (lookup_member): Add access_failure_info * param and
990 pass it on to call to perform_or_defer_access_check.
991 (matches_code_and_type_p): New function.
992 (field_access_p): New function.
993 (direct_accessor_p): New function.
994 (reference_accessor_p): New function.
995 (field_accessor_p): New function.
996 (struct locate_field_data): New struct.
997 (dfs_locate_field_accessor_pre): New function.
998 (locate_field_accessor): New function.
999 * semantics.c (perform_or_defer_access_check): Add
1000 access_failure_info * param, and pass it on to call to
1002 * typeck.c (access_failure_info::record_access_failure): New method.
1003 (access_failure_info::maybe_suggest_accessor): New method.
1004 (finish_class_member_access_expr): Pass an access_failure_info
1005 instance to the lookup_member call, and call its
1006 maybe_suggest_accessor method afterwards.
1008 2017-05-16 Marek Polacek <polacek@redhat.com>
1012 * cp-gimplify.c (cp_fold): Handle SAVE_EXPR.
1014 2017-05-16 Nathan Sidwell <nathan@acm.org>
1016 * name-lookup.c (check_local_shadow): New, broke out of ...
1017 (pushdecl_maybe_friend_1): ... here. Call it.
1019 * cp-tree.h (OVL_NESTED_P, OVL_LOOKUP_P): New.
1020 (ovl_first): Move inline definition to end of file.
1021 (ovl_make, lookup_add): Declare.
1022 (get_fns, get_first_fn): Make pure.
1023 * tree.c (ovl_cache): New.
1024 (ovl_make, lookup_add): New.
1025 * pt.c (do_class_deduction): Don't add candidates that will be
1028 * call.c (build_user_type_conversion_1): Use OVL_FIRST.
1029 (print_error_for_call_failure): Use OVL_NAME.
1030 (build_op_call_1): Use ovl_iterator.
1031 (add_candidates): Use OVL_FIRST & lkp_iterator.
1032 (build_op_delete_call): Use MAYBE_BASELINK_FUNCTIONS &
1034 * class.c (deduce_noexcept_on_destructors): Use ovl_iterator.
1035 (type_has_user_nondefault_constructor,
1036 in_class_defaulted_default_constructor,
1037 type_has_user_provided_constructor,
1038 type_has_user_provided_or_explicit_constructor,
1039 type_has_non_user_provided_default_constructor,
1040 vbase_has_user_provided_move_assign,
1041 type_has_move_constructor, type_has_move_assign,
1042 type_has_user_declared_move_constructor,
1043 type_has_user_declared_move_assign,
1044 type_build_ctor_call, type_build_dtor_call,
1045 type_requires_array_cookie, explain_non_literal_class): Likewise.
1046 (finish_struct): Use lkp_iterator.
1047 (resolve_address_of_overloaded_function): Use OVL_NAME, lkp_iterator.
1048 (note_name_declared_in_class): Use OVL_NAME.
1049 * cxx-pretty-print.c (pp_cxx_unqualified_id): Use OVL_FIRST.
1050 (pp_cxx_qualified_id, cxx_pretty_printer::id_expression,
1051 cxx_pretty_printer::expression): Likewise.
1052 * decl2.c (check_classfn): Use ovl_iterator.
1053 * pt.c (retrieve_specialization): Use ovl_iterator.
1054 * tree.c (cp_tree_equal): Use lkp_iterator.
1055 (type_has_nontrivial_copy_init): Use ovl_iterator.
1057 * typeck2.c (cxx_incomplete_type_diagnostic): Revert change and
1058 check is_overloaded_fn.
1060 2017-05-16 Martin Liska <mliska@suse.cz>
1062 * parser.c (cp_lexer_print_token): Add default value for flags
1063 argument of print_gimple_stmt, print_gimple_expr,
1064 print_generic_stmt and print_generic_expr.
1066 2017-05-16 Nathan Sidwell <nathan@acm.org>
1068 * cp-tree.h (class ovl_iterator, class lkp_iterator): New OVERLOAD
1070 (MAYBE_BASELINK_FUNCTIONS): New.
1071 * constraint.cc (resolve_constraint_check): Use lkp_iterator.
1072 * decl2.c (maybe_warn_sized_delete): Use ovl_iterator.
1073 * lambda.c (maybe_generic_this_capture): Use lkp_iterator.
1074 * method.c (inherited_ctor_binfo): Use ovl_iterator.
1075 (binfo_inherited_from): Likewise.
1076 * parser.c (lookup_literal_operator): Use lkp_iterator.
1077 * pt.c (iterative_hash_template_arg): Use lkp_iterator.
1078 (print_candidates_1): Likewise.
1079 (determine_specialization): Likewise.
1080 (resolve_overloaded_unification): Likewise.
1081 (resolve_nondeduced_context): Likewise.
1082 (type_dependent_expression_p): Likewise.
1083 (dependent_template_p): Likewise.
1084 * ptree.c (cxx_print_xnode): Likewise.
1085 * semantics.c (omp_reduction_lookup): Use lkp_iterator.
1086 (classtype_has_nothrow_assign_or_copy_p): Use ovl_iterator.
1087 * typeck.c (check_template_keyword): Use lkp_iterator.
1089 * cp-tree.h (OVL_FIRST, OVL_NAME): New.
1091 * constexpr.c (function_concept_check): Use OVL_FIRST.
1092 * cvt.c (build_expr_type_conversion): Likewise.
1093 * decl.c (poplevel, grokdeclarator): Use OVL_NAME.
1094 * decl2.c (mark_used): Use OVL_FIRST.
1095 * error.c (dump_decl): Use OVL_FIRST, OVL_NAME.
1096 (dump_expr, location_of): Use OVL_FIRST.
1097 * friend.c (do_friend): Use OVL_NAME.
1098 * init.c (build_offset_ref): Use OVL_FIRST.
1099 * mangle.c (write_member_name): Likewise.
1100 (write_expression): Use OVL_NAME.
1101 * method.c (strip_inheriting_ctors): Use OVL_FIRST.
1102 * name-lookup.c (pushdecl_class_level): Use OVL_NAME.
1103 * pt.c (check_explicit_specialization): Use OVL_FIRST.
1104 (check_template_shadow): Likewise.
1105 (tsubst_template_args): Use OVL_NAME.
1106 (tsubst_baselink): Use OVL_FIRST.
1107 * semantics.c (perform_koenig_lookup): Use OVL_NAME.
1108 * tree.c (get_first_fn): Use OVL_FIRST.
1109 * typeck.c (finish_class_member_access_expr): Use OVL_NAME.
1110 (cp_build_addr_expr_1): Use OVL_FIRST.
1112 * pt.c (tsubst_copy_and_build): Remove unnecessary COMPONENT_REF
1114 * semantics.c (finish_id_expression): Directly init local var.
1115 (finish_omp_reduction_clause): Use really_overloaded_fn.
1116 * tree.c (get_fns): Document. Assert we got an overload.
1117 (get_first_fn) Document.
1118 * typeck.c (cp_build_addr_expr_1): Pass arg directly to
1119 really_overloaded_fn.
1120 * typeck2.c (cxx_incomplete_type_diagnostic): Use get_first_fn directly.
1122 * cp-tree.h (SCOPE_DEPTH): New.
1123 * name-lookup.h (is_nested_namespace): Declare.
1124 * name-lookup.c (is_nested_namespace): New.
1125 (is_ancestor): Use it.
1126 (set_decl_namespace): Likewise.
1127 (push_namespace): Set SCOPE_DEPTH.
1128 * pt.c (check_specialization_namespace): Use is_nested_namespace.
1129 (check_unqualigied_spec_or_inst): Likewise.
1131 2017-05-15 Nathan Sidwell <nathan@acm.org>
1134 * cp-tree.h (DECL_NAMESPACE_INLINE_P): New.
1135 * name-lookup.h (push_namespace): Return int, add make_inline arg.
1136 * name-lookup.c (push_namespace): Deal with inline directly.
1137 Return pushed count.
1138 * parser.c (cp_parser_namespace_definition): Adjust for
1139 push_namespace change.
1141 2017-05-11 Nathan Sidwell <nathan@acm.org>
1143 * cp-lang.c (get_global_decls, cxx_pushdecl, LANG_HOOK_GETDECLS,
1144 LANG_HOOKS_PUSHDECL): Move to ...
1145 * cp-objcp-common.c (cp_get_global_decls, cp_pushdec,
1146 LANG_HOOK_DECLS, LANG_HOOKS_PUSHDECL): ... here.
1147 * cp-objcp-common.h (cp_get_global_decls, cp_pushdecl): Declare.
1149 * name-lookup.h (pushdecl): Add default friend parm.
1150 (pushdecl_maybe_friend): Delete.
1151 (pushdecl_top_level): Add default friend parm.
1152 (pushdecl_top_level_maybe_friend): Delete.
1153 * name-lookup.c (pushdecl_maybe_friend): Delete.
1154 (pushdecl): Add is_friend parm.
1155 (pushdecl_top_level): Add is friend_parm.
1156 (pushdecl_top_level_maybe_friend, pushdecl_top_level_1): Delete.
1157 (pushdecl_top_level_and_finish): Do pushing and finishing directly.
1158 * friend.c (do_friend): Adjust.
1159 * pt.c (tsubst_friend_class): Adjust.
1161 Revert pushdecl_top_level_and_finish name change.
1162 * name-lookup.h (pushdecl_top_level_and_finish): Resurrect old name.
1163 * name-lookup.c (pushdecl_top_level_and_finish): Likewise.
1164 * decl.c (cp_make_fname_decl): Adjust.
1165 * decl2.c (get_guard, handle_tls_init): Adjust.
1166 * rtti.c (get_tinfo_decl, tinfo_base_init): Adjust.
1168 * name-lookup.c (pushdecl_outermost_localscope): Always
1169 conditionally stop timer.
1171 * decl.c (xref_tag_1): Don't frob ts_lambda scope here.
1172 * name-lookup.c (pushtag_1): Deal with ts_lambda scope.
1174 * cp-tree.h (pushdecl, pushdecl_maybe_friend, pushtag,
1175 pushtag_top_level_maybe_friend,
1176 pushdecl_top_level_and_finish): Move declarations to ...
1177 * name-lookup.h: ... here. Group pushdecl variants.
1178 (pushdecl_top_level_and_finish): Rename to ...
1179 (pushdecl_top_level_with_init): ... here.
1180 * decl.c (cp_make_fname_decl): Use pushdecl_top_level_with_init.
1181 * decl2.c (get_guard, handle_tls_init): Likewise.
1182 * rtti.c (get_tinfo_decl, tinfo_base_init): Likewise.
1183 * lambda.c (maybe_add_lambda_conv_op): Use namespace_bindings_p.
1184 * method.c (implicitly_declare_fn): Likewise.
1185 * searchc (node_debug_info_needed): Likewise.
1186 * name-lookup.c (pushdecl_top_level_and_finish): Rename to ...
1187 (pushdecl_top_level_with_init): ... here.
1188 (pop_everything): Use namespace_bindings_p.
1190 * name-lookup.h (pop_binding): Rename to pop_local_binding.
1191 (getdecls): Rename to get_local_decls.
1192 * name-lookup.c (pop_binding): Rename to ...
1193 (pop_local_binding): ... here.
1194 (pop_bindings_and_leave_scope): Adjust.
1195 (getdecls): Rename to ...
1196 (get_local_decls): ... here. Assert local scope.
1197 * decl.c (poplevel): Assert not namespace. Adjust and simplify
1199 (store_parm_decls): Adjust get_local_decls call.
1200 (parser.c (synthesize_implicit_template_parm): Likewise.
1202 2017-05-11 Ville Voutilainen <ville.voutilainen@gmail.com>
1205 * method.c (is_trivially_xible): Reject void types.
1207 2017-05-10 Nathan Sidwell <nathan@acm.org>
1209 * class.c (handle_using_decl): Always use OVL_CURRENT.
1210 (resolve_address_of_overloaded_function): Move iterator decl into
1211 for scope. Don't strip anticipated decls here.
1213 * pt.c (print_candidates_1): Separate TREE_LIST and OVERLOAD
1215 (print_candidates): Adjust.
1217 * cp-tree.h (build_new_function_call): Lose koenig_p arg. Fix
1219 * call.c (build_new_function_call): Lose koenig_p arg. Remove
1220 koenig_p handling here.
1221 * pt.c (push_template_decl_real): Unconditionally retrofit_lang_decl.
1222 (tsubst_omp_clauses): Likewise.
1223 (do_class_deduction): Adjust buld_new_function_call calls.
1224 * semantics.c (finish_call_expr): Likewise.
1226 2017-05-10 Jason Merrill <jason@redhat.com>
1228 * pt.c (unify_parameter_deduction_failure, unify_cv_qual_mismatch)
1229 (unify_type_mismatch, unify_parameter_pack_mismatch)
1230 (unify_ptrmem_cst_mismatch, unify_expression_unequal)
1231 (unify_parameter_pack_inconsistent, unify_inconsistency)
1232 (unify_vla_arg, unify_method_type_error, unify_arity)
1233 (unify_arg_conversion, unify_no_common_base)
1234 (unify_inconsistent_template_template_parameters)
1235 (unify_template_deduction_failure)
1236 (unify_template_argument_mismatch)
1237 (unify_overload_resolution_failure): Call unify_invalid.
1239 CWG 1847 - Clarifying compatibility during partial ordering
1240 * pt.c (more_specialized_fn): No order between two non-deducible
1243 * pt.c (dependent_type_p): Make sure we aren't called with
1246 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
1247 * pt.c (convert_template_argument): Just return an argument pack.
1248 (coerce_template_parameter_pack, template_parm_to_arg)
1249 (extract_fnparm_pack, make_argument_pack, tsubst_template_args)
1250 (tsubst_decl, tsubst, type_unification_real, unify_pack_expansion):
1251 Don't set the type of a NONTYPE_ARGUMENT_PACK.
1252 * parser.c (make_char_string_pack, make_string_pack): Likewise.
1254 2017-05-10 Nathan Sidwell <nathan@acm.org>
1256 * cp-tree.h (add_method, clone_function_decl): Change last arg to
1258 * class.c (add_method): Change third arg to bool. Adjust.
1259 (one_inheriting_sig, one_inherited_ctor): Adjust.
1260 (clone_function_decl): Change 2nd arg to bool. Adjust.
1261 (clone_constructors_and_destructors): Adjust.
1262 * lambda.c (maybe_add_lambda_conv_op): Adjust.
1263 * method.c (lazily_declare_fn): Adjust.
1264 * pt.c (tsubst_decl, instantiate_template_1): Adjust.
1265 * semantics.c (finish_member_declaration): Adjust.
1267 2017-05-10 Paolo Carlini <paolo.carlini@oracle.com>
1270 * decl.c (finish_function): To improve error recovery, change the
1271 logic for calling apply_deduced_return_type.
1273 2017-05-09 Jason Merrill <jason@redhat.com>
1275 PR c++/80605 - __is_standard_layout and empty base
1276 * class.c (check_bases): Ignore empty bases.
1278 PR c++/70979 - literal class and closure types
1279 * class.c (finalize_literal_type_property): Handle closures
1281 (explain_non_literal_class): Likewise.
1283 PR c++/66297, DR 1684 - literal class and constexpr member fns
1284 * constexpr.c (is_valid_constexpr_fn): Only complain about
1285 non-literal enclosing class in C++11.
1286 * class.c (finalize_literal_type_property): Likewise.
1288 2017-05-09 Paolo Carlini <paolo.carlini@oracle.com>
1291 * pt.c (tsubst_decl): Early return error_mark_node if
1292 grok_ctor_properties returns false.
1294 2017-05-09 Jason Merrill <jason@redhat.com>
1296 PR c++/70167 - array prvalue treated as lvalue
1297 * cp-tree.h (CONSTRUCTOR_C99_COMPOUND_LITERAL): New.
1299 * semantics.c (finish_compound_literal): Add fcl_context parameter.
1300 Only make a static variable for C99 syntax.
1301 * parser.c (cp_parser_postfix_expression): Pass it.
1302 * pt.c (tsubst_copy_and_build): Likewise.
1303 * call.c (extend_ref_init_temps): Set
1304 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
1306 2017-05-09 Nathan Sidwell <nathan@acm.org>
1308 * cp-lang.c (get_global_decls, cxx_pushdecl): New.
1309 (LANG_HOOKS_GETDECLS, LANG_HOOKS_PUSHDECL): Override.
1310 * name-lookup.h (pushdecl_top_level): Declare.
1312 2017-05-08 Jason Merrill <jason@redhat.com>
1314 PR c++/80178 - parameter passing for uncopyable classes
1315 * tree.c (type_has_nontrivial_copy_init): True for classes with only
1316 deleted copy/move ctors.
1317 (remember_deleted_copy, maybe_warn_parm_abi): New.
1318 * decl.c (require_complete_types_for_parms, check_function_type):
1319 Call maybe_warn_parm_abi.
1320 * call.c (convert_for_arg_passing, build_cxx_call): Likewise.
1322 2017-05-08 Nathan Sidwell <nathan@acm.org>
1324 * decl.c (builtin_function_1): Set DECL_ANTICIPATED before pushing.
1325 (start_preparsed_function): Do decl pushing before setting
1326 current_funciton_decl and announcing it.
1328 * name-lookup.h (pushdecl_with_scope): Replace with ...
1329 (pushdecl_outermost_localscope): ... this.
1330 * name-lookup.c (pushdecl_with_scope): Replace with ...
1331 (pushdecl_outermost_localscope): ... this.
1332 (pushdecl_namespace_level): Adjust.
1333 * decl.c (cp_make_fname_decl): Use pushdecl_outermost_localscope.
1334 * lambda.c (insert_capture_proxy): Likewise.
1336 * class.c (build_vtbl_initializer): Don't shadow outer variable
1339 Revert _binding -> _value change.
1340 * name-lookup.h (get_namespace_value, set_global_value): Rename to ...
1341 (get_namespace_binding, set_global_binding): ... these.
1342 * name-lookup.c (get_namespace_value, set_global_value): Rename to ...
1343 (get_namespace_binding, set_global_binding): ... these.
1344 (arg_assoc_namespace, pushdecl_maybe_friend_1,
1345 check_for_out_of_scope_variable, push_overloaded_decl_1,
1346 lookup_name_innermost_nonclass_level, push_namespace): Adjust.
1347 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
1348 SET_IDENTIFIER_GLOBAL_VALUE): Adjust.
1349 * decl.c (poplevel): Adjust.
1350 * pt.c (make_constrained_auto): Likewise.
1352 2017-05-07 Volker Reichelt <v.reichelt@netcologne.de>
1354 PR translation/80280
1355 * call.c (print_z_candidate): Fix quoting.
1357 2017-05-05 David Malcolm <dmalcolm@redhat.com>
1359 * error.c (pedwarn_cxx98): Replace report_diagnostic
1360 with diagnostic_report_diagnostic.
1362 2017-05-05 Nathan Sidwell <nathan@acm.org>
1364 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value.
1365 (SET_IDENTIFIER_GLOBAL_VALUE): Use set_global_value.
1366 (IDENTIFIER_NAMESPACE_VALUE): Delete.
1367 * name-lookup.h (namespace_binding, set_namespace_binding): Replace
1369 (get_namespace_value, set_global_value): ... these.
1370 (get_global_value_if_present, is_typename_at_global_scope): Delete.
1371 * decl.c (poplevel): Use get_namespace_value.
1372 (grokdeclarator): Use IDENTIFIER_GLOBAL_VALUE.
1373 * class.c (build_vtbl_initializer): Stash library decl in
1374 static var. Use IDENTIFIER_GLOBAL_VALUE.
1375 * except.c (do_get_exception_ptr, do_begin_catch, do_end_catch,
1376 do_allocate_exception, do_free_exception, build_throw): Likewise.
1377 * init.c (throw_bad_array_new_length): Likewise.
1378 * rtti.c (throw_bad_cast, throw_bad_typeid): Likewise.
1379 * name-lookup.c (arg_assoc_namespace, pushdecl_maybe_friend_1,
1380 check_for_our_of_scope_variable, push_overloaded_decl_1): Use
1381 get_namespace_value.
1382 (set_namespace_binding_1): Rename to
1383 (set_namespace_binding): ... here.
1384 (set_global_value): New.
1385 (lookup_name_innermost_nonclass_level_1, push_namespace): Use
1386 get_namespace_value.
1387 * pt.c (listify): Use get_namespace_value.
1389 * call.c (make_temporary_var_for_ref_to_temp): Push decl into
1391 * lex.c (unqualified_name_lookup_error): Likewise.
1393 * class.c (alter_class): Use retrofit_lang_decl directly.
1394 * decl.c (push_local_name, dupliate_decls): Likewise.
1395 * semantics.c (omp_privatize_field): Likewise.
1397 Kill walk_namespaces.
1398 * cp-tree.h (walk_namespaces_fn, walk_namespaces): Delete.
1399 * decl.c (walk_namespaces_r, walk_namespaces): Delete.
1401 Kill per-namespace static_decls.
1402 * cp-tree.h (static_decls): Declare.
1403 (wrapup_globals_for_namespace,
1404 diagnose_inline_vars_for_namespace): Replace with ...
1405 (wrapup_namespace_globals): ... this.
1406 * decl.c (static_decls): Define.
1407 (wrapup_globals_for_namespace,
1408 diagnose_inline_vars_for_namespace): Replace with ...
1409 (wrapup_namespace_globals): ... this.
1410 (cxx_init_decl_processing): Initialize static_decls.
1411 * decl2.c (c_parse_final_cleanups): Adjust.
1412 * name-lookup.h (cp_binding_level): Remove static_decls member.
1413 * name-lookup.c (add_decl_to_level): Adjust.
1414 (begin_scope): Adjust.
1416 2017-05-05 Paolo Carlini <paolo.carlini@oracle.com>
1419 * decl.c (reshape_init): Unconditionally return error_mark_node
1420 upon error about too many initializers.
1422 2017-05-04 Nathan Sidwell <nathan@acm.org>
1424 * constraint.cc (diagnose_check_constraint): Fix %E thinko.
1426 2017-05-04 Martin Sebor <msebor@redhat.com>
1428 PR translation/80280
1429 * call.c (print_z_candidate): Add missing quoting to %D and other
1431 (build_op_call_1): Same.
1432 * constraint.cc (diagnose_check_constraint): Same.
1433 * mangle.c (mangle_decl): Same.
1434 * name-lookup.c (cp_binding_level_debug): Same.
1435 (set_decl_namespace): Same.
1436 * parser.c (cp_parser_tx_qualifier_opt): Same.
1437 * pt.c (print_candidates_1): Same.
1438 (check_template_variable): Same.
1439 (tsubst_default_argument): Same.
1440 (most_specialized_partial_spec): Same.
1441 * semantics.c (omp_reduction_lookup): Same.
1442 * tree.c (check_abi_tag_redeclaration): Same.
1443 * typeck.c (comptypes): Same.
1444 * typeck2.c (abstract_virtuals_error_sfinae): Same.
1446 2017-05-04 Nathan Sidwell <nathan@acm.org>
1449 * cp-tree.h (enum cp_tree_index): Add CPTI_GLOBAL,
1450 CPTI_GLOBAL_TYPE, CPTI_GLOBAL_IDENTIFIER, CPTI_ANON_IDENTIFIER,
1451 CPTI_INIT_LIST_IDENTIFIER.
1452 (global_namespace, global_type_node, global_identifier,
1453 anon_identifier, init_list_identifier): New.
1454 * decl.c (global_type_node, global_scope_name): Delete.
1455 (initialize_predefined_identifiers): Add new identifiers.
1456 (cxx_init_decl_processing): Adjust.
1457 * name-lookup.h (global_namespace, global_type_node): Delete.
1458 * name-lookup.c (global_namespace, anonymous_namespace_name,
1459 get_anonymous_namespace_name): Delete.
1460 (namespace_scope_ht_size, begin_scope, pushtag_1,
1461 push_namespace): Adjust,
1462 * call.c (type_has_extended_temps): Use init_list_identifier.
1463 * pt.c (listify): Likewise.
1465 * name-lookup.c: Reorder functions to make merging from modules
1468 2017-05-03 Jason Merrill <jason@redhat.com>
1470 * constexpr.c (cxx_eval_outermost_constant_expr): Use TV_CONSTEXPR.
1472 2017-05-03 Nathan Sidwell <nathan@acm.org>
1474 * cp-tree.h (enum cp_tree_index, cp_global_trees): Move earlier,
1475 along with #defines, to before name-lookup include.
1477 2017-05-02 Paolo Carlini <paolo.carlini@oracle.com>
1479 * pt.c (is_auto_or_concept): Remove.
1480 (type_uses_auto_or_concept): Remove, unused.
1481 (find_parameter_packs_r, extract_autos_r, is_auto_r): Adjust.
1482 * parser.c (tree_type_is_auto_or_concept): Remove, unused.
1483 * cp-tree.h (is_auto_or_concept): Remove.
1485 2017-05-01 Xi Ruoyao <ryxi@stu.xidian.edu.cn>
1488 * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Don't
1489 add pedigree operation and detach call here.
1490 * cp-gimplify.c (cp_gimplify_expr): Remove the calls to
1491 cilk_cp_gimplify_call_params_in_spawned_fn.
1492 (cilk_cp_gimplify_call_params_in_spawned_fn): Remove function.
1493 * semantics.c (simplify_aggr_init_expr): Copy EXPR_CILK_SPAWN.
1495 2017-04-29 Volker Reichelt <v.reichelt@netcologne.de>
1497 * parser.c (cp_parser_member_declaration): Add fix-it hints for
1498 stray comma and missing semicolon at end of member declaration.
1500 2017-04-27 Volker Reichelt <v.reichelt@netcologne.de>
1502 * parser.c (cp_parser_cast_expression): Add target type of cast to
1504 * error.c (type_to_string): Add '{enum}' suffix to enumeration types.
1506 2017-04-26 Paolo Carlini <paolo.carlini@oracle.com>
1508 * decl.c (grok_ctor_properties, ambi_op_p, unary_op_p): Change
1509 return type to bool.
1510 * cp-tree.h (grok_ctor_properties): Update.
1512 2017-04-26 Volker Reichelt <v.reichelt@netcologne.de>
1514 * parser.c (cp_parser_nested_name_specifier_opt): Add fix-it
1515 information to diagnostic of invalid colon in nested-name-specifier.
1517 2017-04-25 Volker Reichelt <v.reichelt@netcologne.de>
1519 * parser.c (cp_parser_elaborated_type_specifier): Add fix-it to
1520 diagnostic of invalid class/struct keyword after enum.
1522 2017-04-25 David Malcolm <dmalcolm@redhat.com>
1524 * parser.c (cp_parser_member_declaration): Add fix-it hint
1525 for removing stray semicolons.
1527 2017-04-25 David Malcolm <dmalcolm@redhat.com>
1529 * name-lookup.c (get_std_name_hint): New function.
1530 (maybe_suggest_missing_header): New function.
1531 (suggest_alternative_in_explicit_scope): Call
1532 maybe_suggest_missing_header.
1534 2017-04-25 David Malcolm <dmalcolm@redhat.com>
1537 * name-lookup.c (suggest_alternative_in_explicit_scope): Convert
1538 candidate type of bm from tree to const char *.
1539 (consider_binding_level): Likewise.
1540 (lookup_name_fuzzy): Likewise, using this to merge the best
1541 result from the preprocessor into bm, rather than immediately
1542 returning, so that better matches from reserved words can "win".
1543 Guard the rejection of keywords that don't start decl-specifiers
1544 so it only happens for FUZZY_LOOKUP_TYPENAME.
1546 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
1548 * decl.c (grokdeclarator): Use %qT instead of %<%T%> in diagnostics.
1549 (start_enum): Likewise.
1550 (build_enumerator): Likewise. Use %qE instead of plain %E.
1551 * parser.c (cp_parser_mem_initializer_list): Use %qD instead of
1552 %<%D%> in diagnostics.
1553 (cp_parser_elaborated_type_specifier): Likewise.
1554 * pt.c (make_pack_expansion): Use %qT and %qE instead of
1555 %<%T%> and %<%E%> in diagnostics.
1556 (tsubst_pack_expansion): Likewise.
1558 2017-04-24 David Malcolm <dmalcolm@redhat.com>
1561 * parser.c (cp_parser_unary_expression): Generate a location
1562 range for alignof and sizeof expressions.
1564 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
1566 * parser.c (cp_parser_cv_qualifier_seq_opt): Add fix-it info to
1568 (cp_parser_virt_specifier_seq_opt): Likewise.
1569 (set_and_check_decl_spec_loc): Likewise twice.
1571 2017-04-21 Jason Merrill <jason@redhat.com>
1573 PR c++/80179 - ICE with initialized flexible array member.
1574 * constexpr.c (verify_ctor_sanity): Handle flexible array members.
1576 2017-04-21 Richard Biener <rguenther@suse.de>
1578 * cp-tree.h (copy_decl): Annotate with CXX_MEM_STAT_INFO.
1579 (copy_type): Likewise.
1580 * lex.c (copy_decl): Pass down mem-stat info.
1581 (copy_type): Likewise.
1583 2017-04-20 Jonathan Wakely <jwakely@redhat.com>
1586 * init.c (build_new_1): Suppress notes about over-aligned new when
1587 the warning is suppressed.
1589 2017-04-20 Volker Reichelt <v.reichelt@netcologne.de>
1591 * parser.c (cp_parser_member_declaration): Add warning with fixit
1592 information for extra semicolon after in-class function definition.
1594 2017-04-20 Jakub Jelinek <jakub@redhat.com>
1597 * tree.c (build_cplus_array_type): Call build_array_type
1598 with the intended TYPE_TYPELESS_STORAGE flag value, instead
1599 of calling build_array_type and modifying later TYPE_TYPELESS_STORAGE
1602 2017-04-18 Marek Polacek <polacek@redhat.com>
1604 PR c++/80244 - ICE with attribute in template alias.
1605 * tree.c (strip_typedefs): Handle UNDERLYING_TYPE.
1607 PR c++/80241 - ICE with alignas pack expansion.
1608 * error.c (dump_expr): Handle TREE_LIST.
1609 * parser.c (cp_parser_std_attribute_list): Return error_mark if
1610 make_pack_expansion returns an error.
1612 2017-04-17 Bernd Edlinger <bernd.edlinger@hotmail.de>
1615 * class.c (fixup_may_alias): Fix all type variants.
1617 2017-04-17 Jason Merrill <jason@redhat.com>
1619 PR c++/80415 - wrong error with default arg and array reference.
1620 * tree.c (lvalue_kind): Return clk_class for an array prvalue.
1622 * pt.c (tsubst_init): Set TARGET_EXPR_DIRECT_INIT_P.
1624 2017-04-15 Alexandre Oliva <aoliva@redhat.com>
1626 * decl.c (name_unnamed_type): Split out of...
1627 (grokdeclarator): ... this.
1628 * decl.h (name_unnamed_type): Declare.
1630 2017-04-12 Richard Biener <rguenther@suse.de>
1631 Bernd Edlinger <bernd.edlinger@hotmail.de>
1634 * tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
1635 for arrays of character or std::byte type.
1637 2017-04-11 Jason Merrill <jason@redhat.com>
1639 PR c++/80294 - ICE with constexpr and inheritance.
1640 * constexpr.c (reduced_constant_expression_p):
1641 A null constructor element is non-constant.
1642 (cxx_eval_indirect_ref): Don't VERIFY_CONSTANT before
1643 returning an empty base.
1645 2017-04-11 Jakub Jelinek <jakub@redhat.com>
1648 * decl.c (cp_finish_decomp): If processing_template_decl on
1649 non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't
1650 change their DECL_VALUE_EXPR nor cp_finish_decl them. Instead make
1651 sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst
1653 * pt.c (value_dependent_expression_p) <case VAR_DECL>: For variables
1654 with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
1657 2017-04-11 Jakub Jelinek <jakub@redhat.com>
1660 * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.
1662 2017-04-10 Jakub Jelinek <jakub@redhat.com>
1665 * tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
1666 operand, if it is a static member function, recurse on the
1669 2017-04-10 Marek Polacek <polacek@redhat.com>
1672 * typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL. Set
1673 ORIG_TYPE earlier and not only when shortening.
1675 2017-04-07 Jason Merrill <jason@redhat.com>
1677 PR c++/80356 - ICE with reference to function template argument.
1679 * pt.c (convert_nontype_argument_function): Adjust type even with a
1680 value-dependent argument.
1682 PR c++/80267 - ICE with nested capture of reference
1684 * pt.c (tsubst_copy): Handle lookup finding a capture proxy.
1686 2017-04-07 Marek Polacek <polacek@redhat.com>
1689 * typeck.c (cp_build_binary_op): Convert COP[01] to ORIG_TYPE.
1692 * call.c (build_over_call): Don't check cxx_dialect.
1693 * cp-gimplify.c (cp_gimplify_init_expr): Don't check cxx_dialect nor
1694 whether SUB is a CONSTRUCTOR.
1695 * init.c (build_new_1): Don't check cxx_dialect.
1696 * tree.c (replace_placeholders): Add a function comment. Return if
1697 not in C++14, or if the object isn't a (member of a) class.
1698 * typeck2.c (store_init_value): Don't check cxx_dialect nor whether
1699 TYPE is CLASS_TYPE_P.
1701 2017-04-05 Jakub Jelinek <jakub@redhat.com>
1704 * pt.c (canonical_type_parameter): Use vec_safe_grow_cleared instead
1705 of a loop doing vec_safe_push of NULL. Formatting fixes.
1706 (rewrite_template_parm): Copy TEMPLATE_PARM_PARAMETER_PACK from oldidx
1707 to newidx before calling canonical_type_parameter on newtype.
1709 2017-04-04 Volker Reichelt <v.reichelt@netcologne.de>
1712 * cxx-pretty-print.c (cxx_pretty_printer::expression): Add
1713 UNARY_PLUS_EXPR case.
1715 2017-04-03 Jason Merrill <jason@redhat.com>
1717 * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
1719 2017-04-03 Jonathan Wakely <jwakely@redhat.com>
1721 * class.c (update_vtable_entry_for_fn): Fix typo in comment.
1722 * decl2.c (one_static_initialization_or_destruction): Likewise.
1723 * name-lookup.c (store_bindings): Likewise.
1724 * parser.c (make_call_declarator): Likewise.
1725 * pt.c (check_explicit_specialization): Likewise.
1727 2017-04-03 Jason Merrill <jason@redhat.com>
1729 PR sanitizer/79993 - ICE with VLA initialization from string
1730 PR c++/69487 - wrong VLA initialization from string
1731 * init.c (finish_length_check): Split out from build_vec_init.
1732 (build_vec_init): Handle STRING_CST.
1733 * typeck2.c (split_nonconstant_init): Handle STRING_CST.
1734 (digest_init_r): Don't give a STRING_CST VLA type.
1736 2017-03-31 Jakub Jelinek <jakub@redhat.com>
1739 * cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
1740 REFERENCE_TYPE. Adjust ubsan_maybe_instrument_reference caller
1741 for NOP_EXPR to REFERENCE_TYPE.
1744 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
1745 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
1747 * semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
1748 Remove extraneous parens.
1749 (finish_trait_expr): Handle CPTK_IS_AGGREGATE.
1750 * parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
1751 (cp_parser_trait_expr): Likewise.
1753 2017-03-27 Jakub Jelinek <jakub@redhat.com>
1756 * cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
1757 * typeck.c (cxx_mark_addressable): Likewise. Look through
1758 VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
1760 (cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
1762 2017-03-24 Jason Merrill <jason@redhat.com>
1764 PR c++/77339 - ICE with invalid use of alias template.
1765 * pt.c (lookup_template_class_1): Don't try to enter the scope of an
1768 2017-03-24 Marek Polacek <polacek@redhat.com>
1771 * cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
1772 doesn't have side effects.
1774 2017-03-23 Jason Merrill <jason@redhat.com>
1776 PR c++/80150 - ICE with overloaded variadic deduction.
1777 * pt.c (try_one_overload): Remove asserts.
1779 PR c++/77563 - missing ambiguous conversion error.
1780 * call.c (convert_like_real): Use LOOKUP_IMPLICIT.
1782 2017-03-23 Marek Polacek <polacek@redhat.com>
1784 * cp-tree.h: Remove a C_RID_YYCODE reference.
1786 2017-03-22 Jakub Jelinek <jakub@redhat.com>
1789 * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
1790 case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
1791 processing_template_decl.
1793 2017-03-21 Paolo Carlini <paolo.carlini@oracle.com>
1796 * name-lookup.c (pushtag_1): Add check for bogus, non template,
1797 std::initializer_list.
1799 2017-03-21 Jakub Jelinek <jakub@redhat.com>
1802 * init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.
1804 2017-03-21 Ville Voutilainen <ville.voutilainen@gmail.com>
1807 * init.c (std_placement_new_fn_p): New.
1808 (build_new_1): Call it.
1810 2017-03-20 Jason Merrill <jason@redhat.com>
1812 PR c++/80096 - ICE with C++17 non-type auto.
1813 * pt.c (tsubst): Delay tsubst of type of template non-type
1816 PR c++/79519 - ICE with deleted template friend.
1817 * decl.c (grokdeclarator): Complain about misplaced function
1818 definition using =, as well.
1820 PR c++/79640 - infinite recursion with generic lambda.
1821 * pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
1822 before substituting its initializer.
1824 2017-03-20 Marek Polacek <polacek@redhat.com>
1825 Paolo Carlini <paolo.carlini@oracle.com>
1827 PR c++/80059 - ICE with noexcept and __transaction_atomic
1828 * except.c (build_must_not_throw_expr): Call
1829 instantiate_non_dependent_expr.
1831 2017-03-19 Jason Merrill <jason@redhat.com>
1833 PR c++/80084 - wrong C++17 decomposition by reference of parameter.
1834 * decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
1835 reference decomposition.
1837 PR c++/80077 - error with constexpr and -fno-elide-constructors.
1838 * constexpr.c (cxx_eval_call_expression): Set ctx->call while
1839 expanding trivial constructor.
1841 2017-03-17 Jason Merrill <jason@redhat.com>
1843 PR c++/78345 - ICE initializing array from lambda.
1844 * init.c (build_aggr_init): Check array initializer.
1845 (build_vec_init): Check the type of a CONSTRUCTOR.
1847 PR c++/80073 - C++17 ICE with virtual base.
1848 * decl.c (xref_basetypes): Also check for indirect vbases.
1850 2017-03-16 Jason Merrill <jason@redhat.com>
1852 * decl.c (start_enum): std::byte aliases anything.
1855 * constexpr.c (lookup_placeholder): Tweak.
1857 2017-03-15 Jason Merrill <jason@redhat.com>
1859 PR c++/80043 - ICE with -fpermissive
1860 * typeck.c (convert_for_assignment): Handle instantiate_type
1861 not giving an error.
1863 2017-03-14 Nathan Sidwell <nathan@acm.org>
1865 PR c++/79393 DR 1658 workaround
1866 * method.c (synthesized_method_base_walk): Inihibit abstract class
1867 virtual base access check here.
1868 (synthesized_method_walk): Not here.
1870 2017-03-13 Nathan Sidwell <nathan@acm.org>
1872 PR c++/79393 DR 1658 workaround
1873 * method.c (synthesized_method_walk): Check vbases of abstract
1874 classes for dtor walk.
1876 2017-03-10 David Malcolm <dmalcolm@redhat.com>
1878 PR translation/79848
1879 * decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
1881 2017-03-10 Jason Merrill <jason@redhat.com>
1883 PR c++/79960 - alias templates and partial ordering
1884 * pt.c (comp_template_args): Add partial_order parm.
1885 (template_args_equal): Likewise.
1886 (comp_template_args_porder): New.
1887 (get_partial_spec_bindings): Use it.
1889 2017-03-10 Marek Polacek <polacek@redhat.com>
1892 * decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
1894 2017-03-10 Jakub Jelinek <jakub@redhat.com>
1897 * optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
1898 Use XALLOCAVEC macro.
1901 * decl.c (finish_enum_value_list): If value is error_mark_node,
1902 don't copy it and change its type.
1903 * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
1904 of CONST_DECL is error_mark_node.
1906 2017-03-09 Marek Polacek <polacek@redhat.com>
1908 PR c++/79900 - ICE in strip_typedefs
1909 * tree.c (strip_typedefs): Skip the attribute handling if T is
1910 a variant type which hasn't been updated yet.
1912 PR c++/79687 - wrong code with pointer-to-member
1913 * init.c (constant_value_1): Break if the variable has a dynamic
1916 2017-03-08 Jason Merrill <jason@redhat.com>
1918 PR c++/79797 - ICE with self-reference in array DMI.
1919 * constexpr.c (lookup_placeholder): Split out...
1920 (cxx_eval_constant_expression): ...from here.
1922 2017-03-07 Jakub Jelinek <jakub@redhat.com>
1925 * parser.c (cp_parser_omp_cancellation_point,
1926 cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
1927 cp_parser_omp_target_update): Change "may only be used in compound
1928 statements" diagnostics, such that the same translatable string is
1929 used for all pragmas.
1930 (cp_parser_pragma): Likewise. Use error_at instead of
1931 cp_parser_error for that diagnostics.
1933 2017-03-06 Marek Polacek <polacek@redhat.com>
1935 PR c++/79796 - ICE with NSDMI and this pointer
1936 * call.c (build_over_call): Handle NSDMI with a 'this' by calling
1937 replace_placeholders.
1939 2017-03-06 Jakub Jelinek <jakub@redhat.com>
1942 * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
1945 2017-03-06 Jason Merrill <jason@redhat.com>
1947 Revert "Allow deduction guides to look into primary template."
1948 * cp-tree.h, parser.c, pt.c, search.c: Revert.
1950 2017-03-05 Paolo Carlini <paolo.carlini@oracle.com>
1953 * except.c (build_must_not_throw_expr): Perform the implicit
1954 conversions on the condition.
1956 2017-03-03 Jason Merrill <jason@redhat.com>
1958 * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
1961 Core issues 2273 and 2277
1962 * call.c (joust): Adjust using-declaration tiebreaker to handle
1963 the intermediate base case.
1964 * method.c (strip_inheriting_ctors): Just return the argument if
1965 !flag_new_inheriting_ctors.
1967 2017-03-03 Richard Biener <rguenther@suse.de>
1970 * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
1972 2017-03-03 Marek Polacek <polacek@redhat.com>
1975 * typeck.c (string_conv_p): In C++11, always call pedwarn with
1978 2017-03-02 Jason Merrill <jason@redhat.com>
1980 Update overload resolution with deduction guides.
1981 * pt.c (do_class_deduction): Always build the copy guide.
1982 (copy_guide_p, template_guide_p): New.
1983 (build_deduction_guide): Remember the original constructor.
1984 * call.c (joust): Prefer the copy guide and non-template guides.
1986 Allow deduction guides to look into primary template.
1987 * cp-tree.h (struct saved_scope): Add deduction_guide_type.
1988 (struct cp_decl_specifier_seq): Add constructor_p.
1989 * parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
1990 (cp_parser_init_declarator): Check it. Set ctor_dtor_or_conv_p.
1991 Clear deduction_guide_type. Don't handle deduction guide names.
1992 (cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
1993 (cp_parser_direct_declarator): Likewise. Handle deduction guides.
1994 (cp_parser_member_declaration, cp_parser_cache_defarg)
1995 (cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
1996 * pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
1997 (build_deduction_guide): Set deduction_guide_type.
1998 (dependent_scope_p): Check deduction_guide_type.
1999 * search.c (lookup_member): Likewise.
2001 2017-03-02 Jakub Jelinek <jakub@redhat.com>
2004 * init.c (mark_exp_read_r): New function.
2005 (emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
2006 whole arguments instead of plain mark_exp_read on TREE_LIST values.
2008 2017-03-01 Jason Merrill <jason@redhat.com>
2010 Class template argument deduction in new-expression
2011 * init.c (build_new): Handle deduction from no initializer.
2012 * parser.c (cp_parser_new_expression): Don't require a single
2013 expression for class template deduction.
2014 * typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
2015 class template placeholder.
2016 * pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
2017 (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
2018 (redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
2020 2017-03-01 Jakub Jelinek <jakub@redhat.com>
2023 * init.c (emit_mem_initializers): When not constructing vbases of
2024 abstract classes, mark arguments as read for
2025 -Wunused-but-set-parameter.
2027 2017-02-28 Jason Merrill <jason@redhat.com>
2029 Class template argument deduction refinements
2030 * call.c (joust): Move deduction guide tiebreaker down.
2031 * decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
2032 deduction with no initializer.
2033 * pt.c (build_deduction_guide): Handle implicit default/copy ctor.
2034 (do_class_deduction): Use that rather than special case.
2035 (do_auto_deduction): Handle null initializer.
2037 2017-02-28 Jakub Jelinek <jakub@redhat.com>
2039 * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
2040 instead of just cond ? "..." : "...".
2041 (grokdeclarator): Likewise.
2042 (build_enumerator): Likewise.
2043 * init.c (build_new_1): Likewise.
2044 * call.c (build_new_method_call_1): Likewise.
2045 * parser.c: Include intl.h.
2046 (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
2047 "enter"/"exit" keyword.
2048 (cp_finalize_oacc_routine): Don't use %s to supply portions of the
2051 2017-02-27 Jason Merrill <jason@redhat.com>
2053 PR c++/71568 - SFINAE forming pointer to member function
2054 * init.c (build_offset_ref): Check the return value of
2055 perform_or_defer_access_check.
2057 2017-02-27 Marek Polacek <polacek@redhat.com>
2059 * decl.c (expand_static_init): Add missing } in a comment.
2061 2017-02-27 Volker Reichelt <v.reichelt@netcologne.de>
2063 * init.c: Include intl.h.
2064 (build_new_1): Move message strings into pedwarn to make them
2065 -Wformat-security friendly. Mark string for translation.
2066 * pt.c (tsubst_copy_and_build): Mark string for translation.
2067 Make the pointer const.
2068 * semantics.c (finish_id_expression): Mark strings for translation.
2070 2017-02-25 Jakub Jelinek <jakub@redhat.com>
2072 * call.c (build_op_delete_call): Make msg1 and msg2 const.
2074 2017-02-24 Jakub Jelinek <jakub@redhat.com>
2077 * call.c (build_over_call): Call check_function_arguments even for
2078 -Wrestrict, adjust check_function_arguments caller.
2079 * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
2081 * typeck.c (cp_build_function_call_vec): Adjust
2082 check_function_arguments caller.
2084 2017-02-24 Marek Polacek <polacek@redhat.com>
2086 PR translation/79705
2087 * decl.c (check_redeclaration_exception_specification): Mark a string
2088 for translation. Make the pointer const.
2090 2017-02-23 Paolo Carlini <paolo.carlini@oracle.com>
2093 * pt.c (register_specialization): Check duplicate_decls return value
2094 for error_mark_node and pass it back.
2096 2017-02-22 Jason Merrill <jason@redhat.com>
2098 PR c++/79679 - missing destructor for argument
2099 * call.c (build_over_call): Don't pass tf_no_cleanup to argument
2102 * pt.c (do_class_deduction): Handle 0 argument case.
2104 2017-02-22 Jakub Jelinek <jakub@redhat.com>
2107 * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
2108 SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
2109 * constexpr.c (potential_constant_expression_1): Handle
2110 OMP_*, OACC_* and CILK_* trees. Use error_at with
2111 EXPR_LOC_OR_LOC (t, input_location) computed early
2112 instead of error, or error_at with location_of (t).
2114 2017-02-22 Marek Polacek <polacek@redhat.com>
2117 * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
2118 if the alignas expression is erroneous.
2119 * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
2123 * semantics.c (finish_underlying_type): Bail out for incomplete enums.
2125 2017-02-21 Jason Merrill <jason@redhat.com>
2127 PR c++/50308 - wrong deprecated warning with ADL
2128 PR c++/17729 - duplicate deprecated warning
2129 * semantics.c (finish_id_expression): Only call mark_used on a
2130 function if we aren't building a call.
2132 PR c++/41727 - ICE with partial spec of partial instantiation
2133 * pt.c (process_partial_specialization): For now, don't check more
2134 specialized if there is more than one level of args.
2136 2017-02-21 Marek Polacek <polacek@redhat.com>
2139 * cp-tree.h (maybe_reject_flexarray_init): Declare.
2140 * init.c (maybe_reject_flexarray_init): No longer static.
2141 Add check for current_function_decl.
2142 * parser.c (cp_parser_late_parse_one_default_arg): Reject
2143 a default mem-initializer for a flexible array.
2145 2017-02-21 Jakub Jelinek <jakub@redhat.com>
2146 Paolo Carlini <paolo.carlini@oracle.com>
2149 * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
2151 * pt.c (tsubst_decomp_names): Return error_mark_node if the first
2152 decl after the decomposition artificial decl has error_mark_node.
2153 * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
2154 instead of just == error_mark_node comparison.
2156 2017-02-21 Jakub Jelinek <jakub@redhat.com>
2159 * decl.c: Include gimplify.h.
2160 (cp_finish_decomp): Make sure there is no sharing of trees
2161 in between DECL_VALUE_EXPR of decomposition decls.
2164 * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
2167 * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
2168 call cplus_expand_constant on it first.
2170 2017-02-19 Jason Merrill <jason@redhat.com>
2172 PR c++/78139 - destructor needed by new-expression
2173 * call.c (build_special_member_call): Use tf_no_cleanup.
2175 PR c++/78282 - auto template and pack expansion
2176 * pt.c (find_parameter_packs_r): Don't walk into the type of
2177 templates other than template template-parameters.
2179 PR c++/79606 - ICE with this->base_member in NSDMI
2180 * class.c (build_base_path): Check processing_template_decl.
2182 PR c++/79607 - ICE with T{} initializer
2183 * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
2185 PR c++/79566 - elaborated-type-specifier in range for
2186 * parser.c (cp_parser_simple_declaration): Fix check for type
2189 PR c++/79400 - confusing suggestion of 'noexcept'
2190 * parser.c (cp_parser_exception_specification_opt): Remove
2191 suggestion for deprecated dynamic exception-specification.
2193 PR c++/79470 - partial ordering with reference parameters
2194 * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
2196 PR c++/79500 - ICE with non-template deduction guide
2197 * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
2198 DECL_TEMPLATE_RESULT.
2200 PR c++/79580 - ICE with compound literal
2201 * parser.c (cp_parser_class_head): If we're in the middle of an
2202 expression, use ts_within_enclosing_non_class.
2204 PR c++/79503 - inherited ctor taking base class
2205 * call.c (add_function_candidate): Also check that
2206 DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
2208 2017-02-19 Paolo Carlini <paolo.carlini@oracle.com>
2211 * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
2214 2017-02-19 Eric Fiselier <eric@efcs.ca>
2215 Jonathan Wakely <jwakely@redhat.com>
2218 * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
2219 control warning about literal suffix identifiers without a leading
2222 2017-02-17 Jason Merrill <jason@redhat.com>
2224 PR c++/79508 - lookup error with member template
2225 * parser.c (cp_parser_template_name): Clear
2226 parser->context->object_type if we aren't doing lookup.
2228 PR c++/78690 - ICE with using and global type with same name
2229 * pt.c (type_dependent_object_expression_p): True for
2232 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
2233 * pt.c (convert_template_argument): Just return an auto arg pack.
2234 (tsubst_template_args): Don't tsubst an auto pack type.
2236 PR c++/79556 - C++17 ICE with non-type auto
2237 * pt.c (do_auto_deduction): Don't try to deduce from null type.
2239 PR c++/79533 - C++17 ICE with temporary cast to reference
2240 * call.c (build_over_call): Conversion to a reference prevents copy
2243 2017-02-16 Jakub Jelinek <jakub@redhat.com>
2244 Jason Merrill <jason@redhat.com>
2246 PR c++/79502 - lost nodiscard attribute
2247 * pt.c (apply_late_template_attributes): Do apply non-dependent
2248 attributes to types.
2250 2017-02-16 Jason Merrill <jason@redhat.com>
2252 PR c++/78572 - ICE with self-modifying array initializer
2253 * constexpr.c (cxx_eval_store_expression): The object we're
2254 initializing is outside the constant-expression.
2255 (cxx_eval_call_expression): Set ctx->call.
2257 PR c++/79050 - ICE with undeduced auto and LTO
2258 * decl.c (poplevel): Remove undeduced auto decls.
2260 2017-02-16 Jakub Jelinek <jakub@redhat.com>
2263 * parser.c (cp_parser_omp_target): For -fopenmp-simd
2264 ignore #pragma omp target even when not followed by identifier.
2266 2017-02-15 Jason Merrill <jason@redhat.com>
2267 Jakub Jelinek <jakub@redhat.com>
2269 PR c++/79464 - ICE in IPA with omitted constructor parms
2270 * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
2271 (adjust_clone_args): Adjust.
2272 (add_method): Remember omitted parms.
2273 * call.c (add_function_candidate): Likewise.
2274 * mangle.c (write_method_parms): Likewise.
2275 * method.c (ctor_omit_inherited_parms): Return false if there are no
2278 2017-02-15 Martin Sebor <msebor@redhat.com>
2281 * init.c (maybe_reject_flexarray_init): New function.
2282 (perform_member_init): Call it.
2284 2017-02-15 Jakub Jelinek <jakub@redhat.com>
2287 * parser.c (cp_parser_std_attribute): Don't pedwarn about
2288 [[deprecated]] with -std=c++11 and [[fallthrough]] with
2289 -std=c++11 and -std=c++14.
2292 * decl.c (grokdeclarator): For static data members, handle thread_p
2293 only after handling inline.
2295 2017-02-14 Marek Polacek <polacek@redhat.com>
2299 * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
2300 clobbering if the postfix expression isn't an EXPR_P.
2302 2017-02-13 Jason Merrill <jason@redhat.com>
2304 PR c++/79461 - ICE with lambda in constexpr constructor
2305 * constexpr.c (build_data_member_initialization): Ignore
2306 initialization of a local variable.
2308 2017-02-13 Jakub Jelinek <jakub@redhat.com>
2310 * init.c (warn_placement_new_too_small): Add missing space in
2312 * parser.c (cp_parser_oacc_declare): Likewise.
2313 * mangle.c (maybe_check_abi_tags): Likewise.
2316 * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
2317 on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
2318 in the rightmost operand.
2320 2017-02-13 Nathan Sidwell <nathan@acm.org>
2322 PR c++/79296 - ICE mangling localized template instantiation
2323 * decl2.c (determine_visibility): Use template fn context for
2324 local class instantiations.
2326 2017-02-11 Jason Merrill <jason@redhat.com>
2328 PR c++/77659 - ICE with new and C++14 aggregate NSDMI
2329 * init.c (build_new): Make backups of any CONSTRUCTORs in init.
2330 (build_new_1): Use replace_placeholders.
2331 * tree.c (replace_placeholders_t): Also track whether we've seen a
2333 (replace_placeholders, replace_placeholders_r): Adjust.
2334 * cp-tree.h: Adjust.
2336 PR c++/77790 - ICE with auto function in C++11 mode
2337 * decl.c (undeduced_auto_decl): Remove C++14 limitation.
2338 (require_deduced_type): Add complain parm, return bool.
2339 * cp-tree.h: Adjust.
2340 * decl2.c (mark_used): Use require_deduced_type.
2342 2017-02-10 Jason Merrill <jason@redhat.com>
2344 PR c++/78908 - template ops and bitfields
2345 * tree.c (build_min_non_dep): Use unlowered_expr_type.
2347 PR c++/78897 - constexpr union
2348 * constexpr.c (cxx_eval_store_expression): A store to a union member
2349 erases a previous store to another member.
2351 PR c++/71285 - member of fold-expression
2352 * semantics.c (finish_unary_fold_expr)
2353 (finish_binary_fold_expr): Use null type for fold-expressions.
2355 PR c++/79401 - protected inherited constructor
2356 * call.c (enforce_access): For inheriting constructor, find a base
2357 binfo in the path we already have.
2359 2017-02-10 Marek Polacek <polacek@redhat.com>
2362 * pt.c (type_dependent_expression_p): Check if the expression type
2366 * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
2367 if warnings shouldn't be given.
2369 2017-02-10 Paolo Carlini <paolo.carlini@oracle.com>
2372 * pt.c (tsubst_decl): Don't try to preserve a typedef that names
2373 an error_mark_node as type.
2375 2017-02-09 Jakub Jelinek <jakub@redhat.com>
2376 Jason Merrill <jason@redhat.com>
2379 * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
2380 from pattern to type.
2382 2017-02-09 Jason Merrill <jason@redhat.com>
2384 PR c++/79316 - default argument in deduction guide
2385 PR c++/79350 - explicit deduction guide
2386 * parser.c (cp_parser_constructor_declarator_p)
2387 (cp_parser_direct_declarator): Parse deduction guides more like
2389 * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
2390 * tree.c (special_function_p): Return it.
2391 * decl.c (check_special_function_return_type): Handle it.
2392 (grokdeclarator, grokfndecl): Adjust.
2393 (cp_finish_decl): Pass flags to do_auto_deduction.
2394 * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
2395 * pt.c (dguide_name_p): Take a const_tree.
2396 (do_class_deduction): Handle explicit.
2397 (do_auto_deduction): Pass flags through.
2398 (build_deduction_guide): Copy explicit flag.
2400 2017-02-09 Jakub Jelinek <jakub@redhat.com>
2403 * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
2404 non-pragma_compound context here.
2405 (cp_parser_omp_target): Likewise.
2406 (cp_parser_pragma): Don't call push_omp_privatization_clauses and
2407 parsing for ordered and target omp pragmas in non-pragma_stmt
2408 non-pragma_compound contexts.
2411 * parser.c (cp_parser_oacc_declare): Formatting fix.
2412 (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
2413 automatic variables.
2415 2016-02-09 Nathan Sidwell <nathan@codesourcery.com>
2416 Chung-Lin Tang <cltang@codesourcery.com>
2418 * parser.c (cp_parser_oacc_clause_tile): Disallow collapse. Fix
2419 parsing. Parse constant expression. Remove semantic checking.
2420 (cp_parser_omp_clause_collapse): Disallow tile.
2421 (cp_parser_omp_for_loop): Deal with tile clause. Don't emit a parse
2422 error about missing for after already emitting one. Use more
2423 conventional for idiom for unbounded loop.
2424 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
2425 * semantics.c (finish_omp_clauses): Correct TILE semantic check.
2426 (finish_omp_for): Deal with tile clause.
2428 2017-02-07 Nathan Sidwell <nathan@acm.org>
2430 * method.c (synthesized_method_base_walk): New. Broken out of ...
2431 (synthesized_method_walk): ... here. Call it. Cleanup
2434 2017-02-07 Patrick Palka <ppalka@gcc.gnu.org>
2437 * typeck2.c (process_init_constructor_union): Consider only
2438 FIELD_DECLs when looking for an NSDMI.
2440 2017-02-06 Jason Merrill <jason@redhat.com>
2442 PR c++/71193 - incomplete types in templates
2443 * parser.c (cp_parser_postfix_dot_deref_expression): In a template
2444 handle incomplete type by pedwarning and then treating as dependent.
2446 2017-02-06 Jakub Jelinek <jakub@redhat.com>
2449 * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
2450 (potential_constant_expression_1): Likewise.
2453 * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
2454 allow one fewer than expected arguments if flag_permissive.
2457 * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
2458 * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
2459 with error_mark_node type.
2461 2017-02-03 Jason Merrill <jason@redhat.com>
2463 PR c++/78689 - ICE on constructor with label
2464 * optimize.c (maybe_clone_body): Replace omitted parameters with
2466 * class.c (build_clone): Fix logic for omitting inherited parms.
2468 PR c++/12245 - excessive memory use
2469 * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
2470 back in. Don't cache constants.
2471 (maybe_constant_init): Don't cache constants.
2473 PR c++/79294 - ICE with invalid template argument
2474 * pt.c (convert_nontype_argument_function): Check value-dependence.
2475 (convert_nontype_argument): Don't check it here for function ptrs.
2477 2017-02-02 Richard Biener <rguenther@suse.de>
2480 * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
2481 it lazily on the first changed element only and copy it
2482 fully upfront, only storing changed elements.
2484 2017-02-02 Paolo Carlini <paolo.carlini@oracle.com>
2487 * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
2490 2017-01-31 Jakub Jelinek <jakub@redhat.com>
2493 * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
2496 2017-01-31 David Malcolm <dmalcolm@redhat.com>
2499 * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
2500 any namespace aliases.
2502 2017-01-31 Nathan Sidwell <nathan@acm.org>
2505 * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
2509 * pt.c: (instantiate_decl): Push to top level when current
2510 function scope doesn't match. Only push lmabda scope stack when
2513 * cp-tree.h (instantiate_decl): Make defer_ok bool.
2514 * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
2515 (instantiate_decl): Simplify and reorder state saving and restoration.
2518 * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
2519 * semantics.c (finish_member_declaration): Assert class is being
2522 2017-01-30 Alexandre Oliva <aoliva@redhat.com>
2524 Introduce C++ support in libcc1.
2525 * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
2526 (ansi_opname): Rename to...
2527 (cp_operator_id): ... this. Adjust all callers.
2528 (ansi_assopname): Rename to...
2529 (cp_assignment_operator_id): ... this. Adjust all callers.
2530 (cp_literal_operator_id): Declare.
2531 (set_global_friend): Declare.
2532 (is_global_friend): Declare.
2533 (enum cp_oracle_request): New type.
2534 (cp_binding_oracle_function): New type.
2535 (cp_binding_oracle): Declare.
2536 (cp_finish_injected_record_type): Declare.
2537 * friend.c (global_friend): New var.
2538 (set_global_friend): New fn.
2539 (is_global_friend): New fn.
2540 (is_friend): Call is_global_friend.
2541 * name-lookup.c (cp_binding_oracle): New var.
2542 (query_oracle): New fn.
2543 (qualified_lookup_using_namespace): Call query_oracle.
2544 (lookup_name_real_1): Likewise.
2545 * parser.c (cp_literal_operator_id): Drop static.
2546 * search.c (friend_accessible_p): Call is_global_friend.
2547 * semantics.c (is_this_parameter): Accept a variable if the
2548 binding oracle is enabled.
2550 2017-01-27 Jason Merrill <jason@redhat.com>
2552 PR c++/78771 - ICE with inherited constructor.
2553 * call.c (build_over_call): Call deduce_inheriting_ctor here.
2554 * pt.c (tsubst_decl): Not here.
2555 * class.c (add_method): Or here.
2556 * method.c (deduce_inheriting_ctor): Handle clones.
2557 (implicitly_declare_fn): Don't deduce inheriting ctors yet.
2559 2017-01-27 Adam Butcher <adam@jessamine.co.uk>
2562 * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
2564 * cp/cp-tree.h: Declare it.
2565 * cp/semantics.c (finish_id_expression): Resolve names within a default
2566 capturing generic lambda defined within a template prior to
2567 instantiation to allow for captures to be added to the closure type.
2569 2017-01-26 Jakub Jelinek <jakub@redhat.com>
2572 * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
2573 * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
2574 * parser.c (cp_parser_builtin_offsetof): Pass result of
2575 build_static_cast of null_pointer_node to finish_offsetof.
2576 * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
2577 it for -Winvalid-offsetof pedwarn instead of trying to guess
2578 original offsetof type from EXPR. Save OBJECT_PTR as a new
2579 second operand to OFFSETOF_EXPR.
2580 * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
2581 finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
2584 2017-01-26 Jason Merrill <jason@redhat.com>
2586 * name-lookup.c (parse_using_directive): Deprecate strong using.
2588 PR c++/79176 - lambda ICE with -flto -Os
2589 * decl2.c (vague_linkage_p): Handle decloned 'tors.
2590 * tree.c (decl_linkage): Likewise.
2592 2017-01-25 Martin Sebor <msebor@redhat.com>
2594 * decl.c (grokdeclarator): Fix a typo in a comment.
2596 2017-01-25 Jakub Jelinek <jakub@redhat.com>
2599 * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
2603 * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
2604 OPT_Wpedantic on lambda templates for -std=c++14 and higher.
2606 2017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
2609 * decl.c (cxx_init_decl_processing): Pass main_input_filename
2610 to build_translation_unit_decl.
2612 2017-01-24 Jakub Jelinek <jakub@redhat.com>
2615 * cp-gimplify.c (cp_genericize_r): Add result of
2616 convert_from_reference on invisiref parm to p_set.
2618 2017-01-24 Nathan Sidwell <nathan@acm.org>
2620 PR c++/78469 - defaulted ctor and inaccessible dtor
2621 * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
2622 * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
2623 * tree.c (build_target_expr): Check tf_no_cleanup.
2625 PR c++/79118 - anon-members and constexpr
2626 * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
2627 ctor decl. Recursively check anonymous members.
2628 (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
2630 (explain_invalid_constexpr_fn): Likewise.
2632 2017-01-23 Nathan Sidwell <nathan@acm.org>
2634 PR c++/71710 - template using directive of field
2635 * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
2638 PR c++/71406 - ICE with scope-ref'd template id exprs
2640 * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
2641 before breaking up TEMPLATE_ID_EXPR.
2643 2017-01-20 Nathan Sidwell <nathan@acm.org>
2645 PR c++/78495 - wrong code inherited ctor and invisi-ref parm
2646 * cp-gimplify.c (cp_generize_r): Don't skip thunks.
2648 2017-01-20 David Malcolm <dmalcolm@redhat.com>
2652 * cp-tree.h (suggest_alternatives_for): Add bool param.
2653 (suggest_alternative_in_explicit_scope): New decl.
2654 * error.c (qualified_name_lookup_error): When SCOPE is a namespace
2655 that isn't the global one, call new function
2656 suggest_alternative_in_explicit_scope, only calling
2657 suggest_alternatives_for if it fails, and disabling near match
2658 searches fort that case. When SCOPE is the global namespace,
2659 pass true for new param to suggest_alternatives_for to allow for
2661 * lex.c (unqualified_name_lookup_error): Pass true for new param
2662 to suggest_alternatives_for.
2663 * name-lookup.c (consider_binding_level): Add forward decl.
2664 (suggest_alternatives_for): Add "suggest_misspellings" param,
2665 using it to conditionalize the fuzzy name-lookup code.
2666 (suggest_alternative_in_explicit_scope): New function.
2667 * parser.c (cp_parser_primary_expression): When calling
2668 finish_id_expression, pass location of id_expression rather
2669 than that of id_expr_token.
2670 (cp_parser_id_expression): Convert local "unqualified_id" from
2671 tree to cp_expr to avoid implicitly dropping location information.
2673 2017-01-20 Marek Polacek <polacek@redhat.com>
2676 * call.c (build_conditional_expr_1): Warn about duplicated branches.
2677 * semantics.c (finish_expr_stmt): Build statement using the proper
2680 2017-01-19 Jason Merrill <jason@redhat.com>
2682 US 20 - forwarding references and class template argument deduction
2683 * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
2684 * pt.c (push_template_decl_real): Set it.
2685 (maybe_adjust_types_for_deduction): Check it.
2686 (rewrite_template_parm): Copy it.
2688 US 19 - deduction guides and constructors
2689 * call.c (joust): Prefer deduction guides to constructors.
2690 * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
2691 (deduction_guide_p): Check DECL_P.
2693 * decl.c (check_initializer): Always use build_aggr_init for array
2696 PR c++/79130 - decomposition and direct-initialization
2697 * init.c (build_aggr_init): Communicate direct-initialization to
2699 (build_vec_init): Check for array copy sooner.
2700 * parser.c (cp_parser_decomposition_declaration): Remove call to
2701 build_x_compound_expr_from_list.
2703 2017-01-18 Jason Merrill <jason@redhat.com>
2705 PR c++/68666 - member variable template-id
2706 * typeck.c (finish_class_member_access_expr): Handle variable
2708 * pt.c (lookup_and_finish_template_variable): No longer static.
2709 * cp-tree.h: Declare it.
2711 2017-01-18 Nathan Sidwell <nathan@acm.org>
2714 * call.c (build_over_call): When checking ellipsis conversions for
2715 an inherited ctor, make sure there is at least one conversion.
2717 2017-01-18 Jason Merrill <jason@redhat.com>
2719 PR c++/78894 - ICE with class deduction and default arg
2720 * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
2722 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
2725 * mangle.c (write_discriminator): Reorganize abi warning check.
2727 2017-01-18 Nathan Sidwell <nathan@acm.org>
2729 * cp-tree.h: Clarify exception spec node comment.
2730 * except.c (nothrow_spec_p): Simplify by checking node-equality.
2733 * mangle.c (write_exception_spec): Check nothrow explicitly.
2734 (write_encoding): Don't increment processing_template_decl around
2737 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
2740 * mangle.c (write_template_args): Add "on" for operator names.
2742 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
2745 * mangle.c (write_discriminator): Handle discriminator >= 10.
2747 2017-01-17 Nathan Sidwell <nathan@acm.org>
2750 * cp-tree.h (maybe_generic_this_capture): Declare.
2751 * lambda.c (resolvable_dummy_lambda): New, broken out of ...
2752 (maybe_resolve_dummy): ... here. Call it.
2753 (maybe_generic_this_capture): New.
2754 * parser.c (cp_parser_postfix_expression): Speculatively capture
2755 this in generic lambda in unresolved member function call.
2756 * pt.c (tsubst_copy_and_build): Force hard error from failed
2757 member function lookup in generic lambda.
2759 2017-01-17 Aldy Hernandez <aldyh@redhat.com>
2762 * cp-array-notation.c (expand_array_notation_exprs): Handle
2765 2017-01-11 Jason Merrill <jason@redhat.com>
2767 PR c++/78337 - ICE on invalid with generic lambda
2768 * semantics.c (process_outer_var_ref): Check if containing_function
2769 is null. Move inform call under complain test.
2771 2017-01-11 Nathan Sidwell <nathan@acm.org>
2774 * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
2777 2017-01-11 Nathan Sidwell <nathan@acm.org>
2779 * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
2781 2017-01-11 Jakub Jelinek <jakub@redhat.com>
2784 * parser.c (cp_parser_std_attribute_spec): Remove over-eager
2785 assertion. Formatting fix.
2788 * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
2791 2017-01-10 David Malcolm <dmalcolm@redhat.com>
2794 * parser.c (cp_parser_class_specifier_1): Only suggest inserting
2795 a missing semicolon if we have a valid insertion location for
2798 2017-01-10 Jason Merrill <jason@redhat.com>
2800 FI 20, decomposition declaration with parenthesized initializer.
2801 * parser.c (cp_parser_decomposition_declaration): Use
2802 cp_parser_initializer.
2804 2017-01-09 Jason Merrill <jason@redhat.com>
2806 Implement P0195R2, C++17 variadic using.
2807 * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
2808 * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
2809 * error.c (dump_decl): Likewise.
2811 2017-01-09 Jakub Jelinek <jakub@redhat.com>
2813 PR translation/79019
2814 PR translation/79020
2815 * semantics.c (finish_omp_clauses): Add missing whitespace to
2816 translatable strings.
2817 * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
2819 2017-01-07 Jason Merrill <jason@redhat.com>
2821 PR c++/78948 - instantiation from discarded statement
2822 * parser.h (struct cp_parser): Remove in_discarded_stmt field.
2823 * cp-tree.h (in_discarded_stmt): Declare it.
2824 (struct saved_scope): Add discarded_stmt bitfield.
2825 (in_discarded_stmt): New macro.
2826 * decl2.c (mark_used): Check it.
2827 * parser.c (cp_parser_selection_statement): Adjust.
2828 (cp_parser_jump_statement): Adjust.
2830 2017-01-05 Jakub Jelinek <jakub@redhat.com>
2833 * decl.c (cp_finish_decomp): Remove probe variable, if tt is
2834 REFERENCE_REF_P, set tt to its operand.
2837 * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
2838 unions even for C++11 and later.
2840 2017-01-05 Nathan Sidwell <nathan@acm.org>
2843 * pt.c (convert_nontype_argument): Don't try and see if integral
2844 or enum expressions are constants prematurely.
2846 2017-01-04 Marek Polacek <polacek@redhat.com>
2849 * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
2850 a zero character literal.
2852 2017-01-04 Jakub Jelinek <jakub@redhat.com>
2855 * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
2859 * parser.c (cp_parser_simple_declaration): Only complain about
2860 inconsistent auto deduction if auto_result doesn't use auto.
2862 * parser.c (cp_parser_simple_declaration): Diagnose function
2863 declaration among more than one init-declarators with auto
2867 * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
2868 assertion, as lexer->buffer may be NULL.
2870 2017-01-04 Marek Polacek <polacek@redhat.com>
2874 * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
2876 2017-01-04 Nathan Sidwell <nathan@acm.org>
2879 * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
2880 (lambda_capture_field_type): Update prototype.
2881 * lambda.c (lambda_capture_field_type): Add is_reference parm.
2882 Add referenceness here.
2883 (add_capture): Adjust lambda_capture_field_type call, refactor
2885 * pt.c (tsubst): Adjust lambda_capture_field_type call.
2887 2017-01-01 Jakub Jelinek <jakub@redhat.com>
2889 Update copyright years.
2891 Copyright (C) 2017 Free Software Foundation, Inc.
2893 Copying and distribution of this file, with or without modification,
2894 are permitted in any medium without royalty provided the copyright
2895 notice and this notice are preserved.