1 2017-05-30 Jason Merrill <jason@redhat.com>
3 PR c++/80856 - ICE with local extern in template
4 * semantics.c (finish_call_expr): Replace a local extern overload
5 set in a template with the IDENTIFIER_NODE.
7 2017-05-30 David Malcolm <dmalcolm@redhat.com>
9 * call.c (perform_implicit_conversion_flags): Convert
10 "from %qT to %qT" to "from %qH to %qI" in diagnostic.
11 (print_conversion_rejection): Replace pairs of %qT with
12 %qH and %qI in various places.
13 (build_user_type_conversion_1): Likewise.
14 (build_integral_nontype_arg_conv): Likewise.
15 (build_conditional_expr_1): Likewise.
16 (convert_like_real): Likewise.
17 (convert_arg_to_ellipsis): Likewise.
19 (initialize_reference): Likewise.
20 * cvt.c (cp_convert_to_pointer): Likewise.
21 (cp_convert_to_pointer): Likewise.
22 (convert_to_reference): Likewise.
23 (ocp_convert): Likewise.
24 * error.c (cp_printer): Gain bool and const char ** parameters.
25 (struct deferred_printed_type): New struct.
26 (class cxx_format_postprocessor): New class.
27 (cxx_initialize_diagnostics): Wire up a cxx_format_postprocessor
28 to pp->m_format_postprocessor.
29 (comparable_template_types_p): New function.
30 (newline_and_indent): New function.
31 (arg_to_string): New function.
32 (print_nonequal_arg): New function.
33 (print_template_differences): New function.
34 (type_to_string_with_compare): New function.
35 (print_template_tree_comparison): New function.
36 (append_formatted_chunk): New function.
37 (add_quotes): New function.
38 (cxx_format_postprocessor::handle): New function.
39 (defer_phase_2_of_type_diff): New function.
40 (cp_printer): Add "quoted" and "buffer_ptr" params. Implement
42 * typeck.c (cp_build_binary_op): Replace pairs of %qT with
43 %qH and %qI in various places.
44 (convert_member_func_to_ptr): Likewise.
45 (build_reinterpret_cast_1): Likewise.
46 (convert_for_assignment): Likewise.
47 * typeck2.c (check_narrowing): Likewise.
49 2017-05-30 Nathan Sidwell <nathan@acm.org>
51 Kill IDENTIFIER_NAMESPACE_BINDINGS
52 * cp-tree.h (lang_identifier): Delete namespace_bindings.
53 (IDENTIFIER_NAMESPACE_BINDINGS): Delete.
54 (lang_decl_ns): Add bindings.
55 (DECL_NAMESPACE_BINDINGS): New.
56 * lex.c (retrofit_lang_decl): Create namespace hash table.
57 * name-lookup.c (find_namespace_slot): Change to use hash-map.
58 * ptree.c (cxx_print_binding): Delete.
59 (cxx_print_identifier): Remove NAMESPACE_BINDING printing.
61 * cp-tree.def (OVERLOAD): Fix comment.
62 * cp-tree.h: Fix comments and whitespace.
63 * error.c (dump_decl): Use pp_cxx_colon_colon, ovl_scope.
64 * name-lookup.c (add_decl_to_level): Assert not class.
65 (check_local_shadow): Use OVL_P.
66 (pushdecl_with_scope_1): Rename to ...
67 (do_pushdecl_with_Scope): ... here.
68 (do_nonmember_using_decl): Use qualified_namespace_lookup return
70 (push_class_level_binding_1): Use OVL_P.
71 (pushdecl_namespace_level): Use do_pushdecl_with_scope.
72 (pushtag_1): Rename to ...
73 (do_pushtag): ... here. Adjust do_pushdecl_with_scope call.
75 (store_class_bindings): Do not time here.
76 * name-lookup.h (pushdecl_outermost_localscope): Reorder.
77 * pt.c (listify): Declare argvec at point of initialization.
80 * name-lookup.c (add_decl_to_level): Assert not making a circular
82 (update_binding): Don't prematurely slide artificial decl.
84 2017-05-29 Alexandre Oliva <aoliva@redhat.com>
86 * cp-tree.h (lang_identifier): Drop oracle_looked_up, unused.
88 2017-05-29 Nathan Sidwell <nathan@acm.org>
91 * cp-tree.h (lookup_maybe_add): Add DEDUPING argument.
92 * name-lookup.c (name_lookup): Add deduping field.
93 (name_lookup::preserve_state, name_lookup::restore_state): Deal
95 (name_lookup::add_overload): New.
96 (name_lookup::add_value, name_lookup::add_fns): Call add_overload.
97 (name_lookup::search_adl): Set deduping. Don't unmark here.
98 * pt.c (most_specialized_instantiation): Revert previous change,
99 Assert not given duplicates.
100 * tree.c (lookup_mark): Just mark the underlying decls.
101 (lookup_maybe_add): Dedup using marked decls.
104 * ptree.c (cxx_print_xnode): Show internal OVERLOAD structure.
105 * tree.c (ovl_insert, ovl_iterator_remove_node): Fix copying assert.
107 Stat hack representation
108 * name-lookup.c (STAT_HACK_P, STAT_TYPE, STAT_DECL,
109 MAYBE_STAT_DECL, MAYBE_STAT_TYPE): New.
111 (find_namespace_binding): Replace with ...
112 (find_namespace_slot): ... this.
113 (find_namespace_value): New.
114 (name_lookup::search_namespace_only,
115 name_lookup::adl_namespace_only): Adjust.
116 (update_binding): Add SLOT parameter, adjust.
117 (check_local_shadow): Use find_namespace_value.
118 (set_local_extern_decl_linkage): Likewise.
119 (do_pushdecl): Adjust for namespace slot.
120 (push_local_binding): Assert not a namespace binding.
121 (check_for_out_of_scope_variable): Use find_namespace_value.
122 (set_identifier_type_value_with_scope): Likewise.
123 (get_namespace_binding): Likewise.
124 (set_namespace_binding): Delete.
125 (set_global_binding): Directly update the binding.
126 (finish_namespace_using_decl): Likewise.
127 (lookup_type_scope_1): Use find_namespace_slot and update.
128 (do_push_nested_namespace): Use find_namespace_value.
131 * pt.c (most_specialized_instantiation): Cope with duplicate
135 * cp-tree.h (build_min_nt_call_vec): Declare.
136 * decl.c (build_offset_ref_call_from_tree): Call it.
137 * parser.c (cp_parser_postfix_expression): Likewise.
138 * pt.c (tsubst_copy_and_build): Likewise.
139 * semantics.c (finish_call_expr): Likewise.
140 * tree.c (build_min_nt_loc): Keep unresolved lookups.
141 (build_min): Likewise.
142 (build_min_non_dep): Likewise.
143 (build_min_non_dep_call_vec): Likewise.
144 (build_min_nt_call_vec): New.
147 * tree.c (ovl_copy): Adjust assert, copy OVL_LOOKUP.
149 (lookup_keep): Call it.
151 2017-05-26 Nathan Sidwell <nathan@acm.org>
154 * name-lookup.c (push_inline_namespaces): New.
155 (push_namespace): Look inside inline namespaces.
157 Inline and using namespace representation change.
158 * cp-tree.h (struct lang_decl_ns): Delete ns_using. Add usings,
160 (DECL_NAMESPACE_USING): Adjust.
161 (DECL_NAMESPACE_INLINEES): New.
162 * name-lookup.h (struct cp_binding_level): Change usings
164 * name-lookup.c (name_lookup::do_queue_usings,
165 name_lookup::queue_usings): Adjust.
166 (name_lookup::search_namespace, name_lookup::search_usings,
167 name_lookup::queue_namespace): Adjust.
168 (name_lookup::adl_namespace_only): Adjust.
169 (add_using_namespace, push_namespace): Push onto vector.
170 (pop_namespace): Add timing logic.
172 * call.c (build_operator_new_call): Do namelookup and ADL here.
173 (build_new_op_1): Likewise.
174 * name-lookup.h (lookup_function_nonclass): Delete declaration.
175 (do_using_directive): Likewise.
176 * name-lookup.c (set_namespace_binding, push_local_binding): Don't
178 (struct scope_binding): Delete.
179 (EMPTY_SCOPE_BINDING): Delete.
180 (set_decl_namespace): Use OVL_P.
181 (finish_local_using_decl): Lose unnecesary checks.
182 (lookup_function_nonclass): Delete.
183 (cp_emit_debug_info_for_using): Use MAYBE_BASELINK_P.
185 * cp-tree.h (OVL_CHAIN): Check looking at OVERLOAD.
186 (ovl_iterator): Add allow_inner field. Adjust ctor. Make
188 (ovl_iterator::maybe_push, ovl_iterator::pop): New.
189 (lkp_iterator): Add outer field. Adjust ctor.
190 (lkp_iterator::operator++): New.
191 (lookup_mark, lookup_maybe_add): Declare.
192 * name-lookup.c (name_lookup): Delete fn_set member.
193 (name_lookup::preserve_state, name_lookup::restore_state): Unmark
195 (name_lookup::add_value): Use lookup_add directly.
196 (name_lookup::add_fns: Use lookup_maybe_add.
197 (name_lookup::search_adl): Mark and unmark fns.
199 * pt.c (check_explicit_specialization): Use lookup_add directly.
200 * ptree.c (cxx_print_xnode): Show complete overload structure.
201 * tree.c (lookup_mark, lookup_maybe_add): New.
203 * name-lookup.c (name_lookup::search_adl): ADL OMP UDR type args.
205 2017-05-26 Jakub Jelinek <jakub@redhat.com>
207 * cp-tree.h (struct lang_decl_decomp): New type.
208 (struct lang_decl): Add u.decomp.
209 (LANG_DECL_DECOMP_CHECK): Define.
210 (DECL_DECOMPOSITION_P): Note it is set also on the vars
211 for user identifiers.
212 (DECL_DECOMP_BASE): Define.
213 (retrofit_lang_decl): Add extra int = 0 argument.
214 * lex.c (retrofit_lang_decl): Add SEL argument, if non-zero
215 use it to influence the selector choices and for selector
216 0 to non-zero transition copy old content.
217 (cxx_dup_lang_specific_decl): Handle DECL_DECOMPOSITION_P.
218 * decl.c (poplevel): For DECL_DECOMPOSITION_P, check
219 !DECL_DECOMP_BASE instead of !DECL_VALUE_EXPR. Adjust warning
220 wording if decl is a structured binding.
221 (cp_finish_decomp): Pass 4 as the new argument to retrofit_lang_decl.
222 Set DECL_DECOMP_BASE. Ignore DECL_READ_P sets from initialization
223 of individual variables for tuple structured bindings.
224 (grokdeclarator): Pass 4 as the new argument to retrofit_lang_decl.
225 Clear DECL_DECOMP_BASE.
226 * decl2.c (mark_used): Mark DECL_DECOMP_BASE TREE_USED as well.
227 * pt.c (tsubst_decomp_names): Assert DECL_DECOMP_BASE matches what
229 * expr.c (mark_exp_read): Recurse on DECL_DECOMP_BASE instead of
232 2017-05-25 Jason Merrill <jason@redhat.com>
234 PR c++/80605 - __is_standard_layout and zero-length array
235 * class.c (check_bases): Use DECL_FIELD_IS_BASE.
237 2017-05-25 Nathan Sidwell <nathan@acm.org>
239 Kill OVL_CURRENT, OVL_NEXT.
240 * cp-tree.h (OVL_CURRENT, OVL_NEXT): Delete.
241 * name-lookup.c (set_decl_namespace): Use ovl_iterator.
242 (consider_binding_level): Use OVL_FIRST.
243 (cp_emit_debug_info_for_using): Use lkp_iterator.
244 * pt.c (check_explicit_specialization): Use ovl_iterator.
246 Kill DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS.
247 * cp-tree.h (lang_decl_ns): Remove ns_users field.
248 (DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS): Delete.
249 (TREE_INDIRECT_USING): Delete.
250 * name-lookup.h (is_associated_namespace): Delete.
251 * name-lookup.c (name_lookup::search_usings,
252 name_lookup::do_queue_usings): Usings are always direct.
253 (is_associated_namespace): Delete.
254 (handle_namespace_attrs): Use DECL_NAMESPACE_INLINE_P.
255 (namespace_ancestor_1, namespace_ancestor): Delete.
256 (push_using_directive_1, push_using_directive): Delete.
257 (add_using_namespace_1): Delete.
258 (add_using_namespace): Reimplement.
259 (emit_debug_info_using_namespace): New.
260 (finish_namespace_using_directive, finish_local_using_directive,
261 push_namespace): Adjust.
262 * tree.c (cp_free_lang_data): Remove DECL_NAMESPACE_USERS handling.
264 2017-05-25 Volker Reichelt <v.reichelt@netcologne.de>
266 * semantics.c (finish_handler_parms): Warn about non-reference type
269 2017-05-25 Nathan Sidwell <nathan@acm.org>
271 Reimplement unqualified namespace lookup.
272 * name-lookup.c (name_lookup::using_pair,
273 name_lookup::using_queue): New typedefs.
274 (name_lookup::queue_namespace, name_lookup::do_queue_usings,
275 name_lookup::queue_usings): New.
276 (name_lookup::search_unqualified): New.
277 (merge_functions, same_entity_p, ambiguous_decl,
278 unqualified_namespace_lookup_1, unqualified_namespace_lookup,
279 lookup_using_namespace): Delete.
280 (lookup_name_real_1): Adjust.
282 Reimplement qualified namespace lookup.
283 * name-lookup.c (name_lookup::flags): New member. Adjust ctor.
284 (name_lookup::ambiguous, name_lookup::add_value,
285 name_lookup::add_type, name_lookup::process_binding): New.
286 (name_lookup::search_namespace_only,
287 name_lookup::search_namespace, name_lookup::search_usings): New.
288 (name_lookup::search_qualified): New.
289 (do_nonmember_using_decl, suggest_alternatives_for,
290 lookup_qualified_name): Adjust.
291 (tree_vec_contains): Delete.
292 (qualified_lookup_using_namespace): Rename to ...
293 (qualified_namespace_lookup): ... here. Reimplement.
296 * cp-tree.h (LOOKUP_SEEN_P, LOOKUP_FOUND_P): New.
297 * name-lookup.h (lookup_arg_dependent): Return plain tree.
298 * name-lookup.c (arg_lookup, arg_assoc, arg_assoc_args,
299 arg_assoc_args_vec, arg_assoc_type, add_function,
300 arg_assoc_namespace, arg_assoc_class_only, arg_assoc_bases,
301 arg_assoc_class, arg_assoc_template_arg, arg_assoc,
302 lookup_arg_dependent_1): Delete.
303 (name_lookup): New lookup object.
304 (name_lookup::preserve_state, name_lookup::restore_state,
305 name_lookup::mark_seen, name_lookup::find_and_mark,
306 name_lookup::add_fns, name_lookup::adl_namespace_only,
307 name_lookup::adl_namespace, name_lookup::adl_class_only,
308 name_lookup::adl_bases, name_lookup::adl_class,
309 name_lookup::adl_expr, name_lookup::adl_type,
310 name_lookup::adl_template_arg, name_lookup::search_adl): New.
311 (lookup_arg_dependent): Return a plain tree. Adjust.
312 (is_associated_namespace): Move later.
314 2017-05-24 Nathan Sidwell <nathan@acm.org>
316 * friend.c (do_friend): Remove check for existing decl.
317 * name-lookup.h (lookup_name_innermost_nonclass_level): Delete.
318 * name-lookup.c (push_local_binding): Directly look for binding.
319 (lookup_name_innermost_nonclass_level_1): Delete.
320 (lookup_name_innermost_nonclass_level): Delete.
322 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Alphabetize.
324 * cp-tree.h (cp_free_lang_data): Add extern.
325 (ovl_skip_hidden, is_overloaded_fn, really_overloaded_fn): Add
327 (type_unknown_p): Return bool, make inline, lose TREE_LIST check.
328 * typeck.c (type_unknown_p): Delete.
329 * tree.c (is_overloaded_fn): Use MAYBE_BASELINE_FUNCTIONS, adjust
331 (dependent_name): Likewise.
332 (decl_anon_ns_mem_p): Simplify.
334 2017-05-24 Jonathan Wakely <jwakely@redhat.com>
337 * tree.c (reshape_init): Use unqualified type for direct enum init.
338 * typeck.c (maybe_warn_about_cast_ignoring_quals): New.
339 (build_static_cast_1, build_reinterpret_cast_1): Strip cv-quals from
340 non-class destination types.
341 (build_const_cast_1): Strip cv-quals from destination types.
342 (build_static_cast, build_reinterpret_cast, build_const_cast)
343 (cp_build_c_cast): Add calls to maybe_warn_about_cast_ignoring_quals.
345 2017-05-24 Martin Sebor <msebor@redhat.com>
348 * call.c (fully_fold_internal): Adjust.
350 2017-05-24 Nathan Sidwell <nathan@acm.org>
352 * cp-tree.h (ovl_skip_hidden): Declare.
353 * tree.c (ovl_skip_hidden): New.
354 * name-lookup.c (arg_assoc_namespace): Call ovl_skip_hidden.
355 (lookup_arg_dependent_1): Likewise.
356 (ambiguous_decl): Use DECL_HIDDEN_P, ovl_skip_hidden.
357 (hidden_name_p, remove_hidden_names): Delete.
358 (lookup_name_real_1): Do not strip hidden names.
359 * name-lookup.h (hidden_name_p, remove_hidden_names): Delete.
361 * cp-tree.h (OVL_HIDDEN_P): New.
362 (ovl_iterator::hidden_p, ovl_iterator::reveal_node): New.
363 (ovl_iterator::reveal_node): Declare.
364 * tree.c (ovl_copy): Copy OVL_HIDDEN_P.
365 (ovl_insert): Order on hiddenness.
366 (ovl_iterator::reveal_node): New.
367 * name-lookup.c (anticipated_builtin_p): New.
368 (supplement_binding_1): Use it.
369 (set_local_extern_decl_linkage): Use hidden_p.
370 (do_pushdecl): Deal with unhiding a hidden decl, use
371 anticipated_builtin_p.
372 (do_nonmember_using_decl): Use anticipated_decl_p.
373 (lookup_name_real_1): Use DECL_HIDDEN_P.
375 2017-05-23 Jason Merrill <jason@redhat.com>
377 -Wunused and C++17 structured bindings
378 * decl.c (poplevel): Don't warn about unused structured bindings,
380 * error.c (dump_simple_decl): Handle structured bindings.
381 * expr.c (mark_exp_read): Look through DECL_VALUE_EXPR.
383 2017-05-23 Nathan Sidwell <nathan@acm.org>
385 * cp-tree.h (PUSH_GLOBAL, PUSH_LOCAL, PUSH_USING): Delete.
386 * name-lookup.c (create_local_binding): New.
387 (update_binding): New.
388 (pushdecl_maybe_friend_1): Rename to ...
389 (do_pushdecl): ... this. Reimplement.
391 (push_overloaded_decl_1, push_overloaded_decl): Delete.
393 2017-05-23 Jason Merrill <jason@redhat.com>
395 PR c++/80396 - built-in for make_integer_sequence.
396 * pt.c (builtin_pack_fn_p, builtin_pack_call_p)
397 (expand_integer_pack, expand_builtin_pack_call): New.
398 (find_parameter_packs_r): Check builtin_pack_call_p.
399 (check_for_bare_parameter_packs): Handle it.
400 (tsubst_pack_expansion): Call expand_builtin_pack_call.
401 (declare_integer_pack): New.
402 (init_template_processing): Call it.
403 * decl2.c (mark_used): Check builtin_pack_fn_p.
405 2017-05-23 Nathan Sidwell <nathan@acm.org>
407 * name-lookup.c (find_namespace_binding): New.
408 (pushdecl_maybe_friend_1): Use CP_DECL_CONTEXT.
409 (set_identifier_type_value_with_scope): Use find_namespace_binding.
410 (find_binding, cp_binding_level_find_binding_for_name,
411 binding_for_name, namespace_binding_1): Delete.
412 (push_overloaded_decl_1): Use CP_DECL_CONTEXT.
413 (get_namespace_binding, set_namespace_binding,
414 finish_namespace_using_decl, unqualified_namespace_lookup_1,
415 qualified_lookup_using_namespace, lookup_type_scope_1,
416 lookup_name_innermost_nonclass_level_1): Use find_namespace_binding.
419 * parser.c (cp_parser_template_id): Keep the lookup when stashing
422 * cp-tree.h (DECL_HIDDEN_P): New.
423 * name-lookup.c (set_decl_context,
424 set_local_extern_decl_linkage): New, broken out of ...
425 (pushdecl_maybe_friend_1): ... here. Call them.
427 2017-05-23 Thomas Schwinge <thomas@codesourcery.com>
429 * parser.c (OACC_KERNELS_CLAUSE_MASK): Add
430 "PRAGMA_OACC_CLAUSE_NUM_GANGS", "PRAGMA_OACC_CLAUSE_NUM_WORKERS",
433 2017-05-23 Nathan Sidwell <nathan@acm.org>
435 * cp-tree.h (OVL_P): New.
436 * name-lookup.h (push_local_binding): Delete.
437 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
438 (finish_namespace_using_decl, finish_local_using_decl): ... here
439 * name-lookup.c (add_decl_to_level): Swap args.
440 (pop_bindings_and_leave_scope): Look inside TREE_LIST.
441 (diagnose_name_conflict): Check contexts are same for redecl.
442 (update_local_overload): New.
443 (compparms_for_decl_and_using): Rename to ...
444 (matching_fn_p): ... here.
445 (pushdecl_maybe_friend_1): Adjust add_decl_to_level,
446 push_local_bindings call.
447 (push_local_binding): Make static, replace FLAGS arg with
449 (validate_nonmember_using_decl): Use OVL_FIRST.
450 (do_nonmember_using_decl): Use in/out parameters. Use
451 lkp_iterator and simplify.
452 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
453 (finish_namespace_using_decl, finish_local_using_decl): ... here.
455 (lookup_type_current_level): Delete.
456 * parser.c (cp_parser_using_declaration): Adjust.
457 * pt.c (tsubst_expr): Adjust.
459 2017-05-22 Nathan Sidwell <nathan@acm.org>
461 * name-lookup.h (parse_using_directive): Replace with ...
462 (finish_namespace_using_directive): ... this and ...
463 (finish_local_using_directive): ... this.
464 * name-lookup.c (add_using_namespace_1): Move later.
465 (add_using_namespace): Move later, add namespace_p arg, remove
467 (push_using_directive_1): Directly recurse.
468 (do_using_directive, parse_using_directive): Delete, split into ...
469 (finish_namespace_using_directive): ... this and ...
470 (finish_local_using_directive): ... this.
471 (push_namespace): Use add_using_namespace.
472 * parser.c (cp_parser_using_directive): Call
473 finish_namespace_using_directive or finish_local_using_directive.
474 * pt.c (tsubst_expr): Call finish_local_using_directive.
476 * cp-objcp-common.c (cp_register_dumps): Register raw dumper.
477 * cp-tree.h (raw_dump_id): Declare.
478 * decl2.c (raw_dump_id): Define.
479 (dump_tu): Use raw_dump_id.
481 * config-lang.in (gtfiles): Sort list, break lines.
483 * cp-tree.h (CPTI_TERMINATE, CPTI_CALL_UNEXPECTED): Rename to ...
484 (CPTI_TERMINATE_FN, CPTI_CALL_UNEXPECTED_FN): ... here.
485 ( CPTI_GET_EXCEPTION_PTR_FN, CPTI_BEGIN_CATCH_FN, CPTI_END_CATCH_FN,
486 CPTI_ALLOCATE_EXCEPTION_FN, CPTI_FREE_EXCEPTION_FN, CPTI_THROW_FN,
487 CPTI_RETHROW_FN): New.
488 (noexcept_deferred_spec): New.
489 (terminate_node, call_unexpected_node): Rename to ...
490 (terminate_fn, call_unexpected_fn): ... here.
491 (get_exception_ptr_fn, begin_catch_fn, end_catch_fn,
492 allocate_exception_fn, free_exception_fn, throw_fn, rethrow_fn): New.
493 * except.c (fn1..fn5, throw_fn, rethrow_rn, spec): Delete.
494 (init_exception_processing): Adjust.
495 (declare_library_fn): Create and push the fns here.
496 (do_get_exception_ptr, do_begin_catch, do_end_catch,
497 do_allocate_exception_ptr, do_free_exception_ptr): Adjust
498 declare_library_fn use.
499 (unevaluated_noexcept_spec): Adjust.
500 * cp-gimplify.c (genericize_eh_spec_block,
501 gimplify_most_not_throw_expr): Adjust.
503 * name-lookup.c (pushdecl_top_level,
504 pushdecl_top_level_and_finish): Move after namespace pushing and
506 (push_to_top_level): Rename to ...
507 (do_push_to_top_level): ... here. Remove timing code.
508 (pop_from_top_level_1): Rename to ...
509 (do_pop_from_top_level): ... here.
510 (do_push_nested_namespace, do_pop_nested_namespace)
511 (push_to_top_level): New wrapper for do_push_to_top_level.
512 (pop_from_top_level): Adjust.
513 (push_nested_namepace, pop_nested_namespace): Wrappers for workers.
515 2017-05-19 Bernd Edlinger <bernd.edlinger@hotmail.de>
517 * config-lang.in (gtfiles): Add c-family/c-format.c,
518 except.c, init.c, lambda.c and friend.c.
519 * class.c (dvirt_fn): Move out of function scope,
521 * except.c (fn1-5, throw_fn, rethrow_fn, spec): Likewise.
522 * init.c (fn): Likewise.
523 * lambda.c (ptr_id, max_id): Likewise.
524 * friend.c (global_friend): Add GTY attribute.
526 2017-05-19 Nathan Sidwell <nathan@acm.org>
528 * call.c (add_list_candidates): Use OVL_FIRST.
529 (build_new_method_call_1): Likewise.
530 * cp-tree.h (OVL_SINGLE_P): New.
531 (TYPE_HIDDEN_P): New.
532 * decl.c (xref_tag_1): Use TYPE_HIDDEN_P.
533 * dump.c (cp_tump_tree): Adjust overload dumping.
534 * error.c (dump_decl): Use OVL_SINGLE_P, simplify context
536 * method.c (lazily_declare_fn): Assert we added it.
537 * parser.c (cp_parser_nested_name_specifier): Use OVL_SINGLE_P,
539 (cp_parser_template_name): Use lkp_iterator.
540 * pt.c (begin_template_parm_list): Fixup comment.
541 (instantiate_class_template_1): Use TYPE_HIDDEN_P.
542 * tree.c (ovl_iterator::remove_node): Cope with inherited ctors.
543 (ovl_scope): Use lkp_iterator.
545 2017-05-19 Thomas Schwinge <thomas@codesourcery.com>
547 * parser.c (cp_parser_omp_clause_default): Handle
548 "OMP_CLAUSE_DEFAULT_PRESENT".
550 * parser.c (cp_parser_omp_clause_default): Avoid printing more
551 than one syntax error message.
553 2017-05-19 Nathan Sidwell <nathan@acm.org>
555 * class.c (class_dump_id): Define.
556 (dump_class_hierarchy, dump_vtable, dump_vtt): Use it.
557 * cp-objcp-common.c (cp_register_dumps): New.
558 * cp-objcp-common.h (cp_register_dumps): Declare.
559 (LANG_HOOKS_REGISTER_DUMPS): Override.
560 * cp-tree.h (class_dump_id): Declare.
562 2017-05-18 Nathan Sidwell <nathan@acm.org>
564 * cp-tree.h (OVL_ARG_DEPENDENT): Delete.
566 (lookup_keep): Declare.
567 * name-lookup.c (add_function): Don't set OVL_ARG_DEPENDENT.
568 * pt.c (tsubst_copy): Assert lookup is persistent.
569 * semantics.c (finish_call_expr): Use lkp_iterator, call
571 * tree.c (ovl_copy): New.
572 (ovl_insert, ovl_iterator::remove_node): Copy immutable nodes.
575 * cp-tree.h (OVL_USED): Replace with ...
576 (OVL_USING_P): ... this.
577 (ovl_iterator::using_p): Adjust.
578 * name-lookup.c (push_overloaded_decl_1,
579 do_nonmember_using_decl): Adjust.
580 * search.c (lookup_field_r): Adjust.
581 * tree.c (ovl_insert, ovl_scope): Adjust.
583 * cp-tree.h (lookup_add): Swap args.
584 (ovl_cons, build_overload): Delete.
585 * name-lookup.c (add_function, push_overloaded_decl_1,
586 do_nonmember_using_decl, merge_functions, remove_hidden_names):
587 Use lookup_add, ovl_insert.
588 * pt.c (check_explicit_specialization): Use lookup_add.
589 (do_class_deduction): Likewise. Refactor if.
590 * tree.c (lookup_add): Swap args.
591 (ovl_cons, build_overload): Delete.
593 * name-lookup.c (find_local_binding): New, broken out of ...
594 (lookup_name_innermost_nonclass_level_1): ... here. Call it.
595 (set_namespace_binding): Swap scope & name args.
596 (namespace_binding_1): Likewise.
597 (pushdecl_maybe_friend_1): Adjust set_namespace_binding call.
598 (push_overloaded_decl_1): Likewise.
599 (set_global_binding): Likewise.
600 (get_namespace_binding): Adjust namespace_binding_1 call.
602 2017-05-17 Nathan Sidwell <nathan@acm.org>
604 * cp-tree.h (default_hash_traits <lang_identifier *>): New
606 * name-lookup.c (lookup_extern_c_fun_in_all_ns): Delete.
607 (extern_c_fns): New hash table.
608 (check_extern_c_conflict): New, broken out of ...
609 (pushdecl_maybe_friend_1): ... here. Call it.
610 (c_linkage_bindings): Just look in hash table.
612 2017-05-17 Ville Voutilainen <ville.voutilainen@gmail.com>
616 Implement new C++ intrinsics __is_assignable and __is_constructible.
617 * cp-tree.h (CPTK_IS_ASSIGNABLE, CPTK_IS_CONSTRUCTIBLE): New.
619 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
620 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
621 * method.c (constructible_expr): Set cp_unevaluated.
622 (is_xible_helper): New.
623 (is_trivially_xible): Adjust.
625 * parser.c (cp_parser_primary_expression): Handle
626 RID_IS_ASSIGNABLE and RID_IS_CONSTRUCTIBLE.
627 (cp_parser_trait_expr): Likewise.
628 * semantics.c (trait_expr_value): Handle
629 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
631 2017-05-17 Nathan Sidwell <nathan@acm.org>
633 * cp-tree.h (ovl_iterator::using_p): New predicate.
634 (ovl_iterator::remove_node): New worker.
635 (ovl_insert): Declare.
636 * tree.c (ovl_insert): New.
637 (ovl_iterator::remove_node): New.
638 * class.c (add_method): Use ovl_iterator, ovl_insert.
639 (clone_function_decl): Fix description.
640 (clone_constructors_and_destructors): Use ovl_iterator.
642 * class.c (handle_using_decl): Use OVL_FIRST, ovl_iterator.
643 (maybe_warn_about_overly_private_class): Use ovl_iterator.
644 (method_name_cmp, resort_method_name_cmp): Use OVL_NAME.
645 (resort_type_method_vec, finish_struct_methods): Use OVL_FIRST.
646 (get_base_fndecls): Use ovl_iterator.
647 (warn_hidden): Use OVL_NAME, ovl_iterator.
648 (add_implicitly_declared_members): Use ovl_iterator.
649 * constraint.cc (normalize_template_id_expression): Use OVL_FIRST,
651 (finish_shorthand_constraint): Simplify, use ovl_make.
652 * pt.c (make_constrained_auto): Simplify. Use ovl_make.
653 * search.c (shared_member_p): Use ovl_iterator.
654 (lookup_field_fuzzy_info::fuzzy_lookup_fn): Use OVL_NAME.
655 (lookup_conversion_operator): Use OVL_FIRST.
656 (lookup_fnfiels_idx_nolazy): Use OVL_FIRST, OVL_NAME.
657 (look_for_overrides_here): Use ovl_iterator.
658 (lookup_conversions_r): Use OVL_FIRST, OVL_NAME, ovl_iterator.
659 * typeck.c (build_x_unary_op): Use ovl_make.
661 2017-05-17 Martin Liska <mliska@suse.cz>
663 * class.c (dump_class_hierarchy): Introduce dump_flags_t type and
664 use it instead of int type.
665 (dump_vtable): Likewise.
666 (dump_vtt): Likewise.
667 * decl2.c (dump_tu): Likewise.
669 2017-05-16 David Malcolm <dmalcolm@redhat.com>
671 * call.c (enforce_access): Add access_failure_info * param and use
672 it to record access failures.
673 * cp-tree.h (class access_failure_info): New class.
674 (enforce_access): Add access_failure_info * param, defaulting to
676 (lookup_member): Likewise.
677 (locate_field_accessor): New function decl.
678 (perform_or_defer_access_check): Add access_failure_info * param,
680 * search.c (lookup_member): Add access_failure_info * param and
681 pass it on to call to perform_or_defer_access_check.
682 (matches_code_and_type_p): New function.
683 (field_access_p): New function.
684 (direct_accessor_p): New function.
685 (reference_accessor_p): New function.
686 (field_accessor_p): New function.
687 (struct locate_field_data): New struct.
688 (dfs_locate_field_accessor_pre): New function.
689 (locate_field_accessor): New function.
690 * semantics.c (perform_or_defer_access_check): Add
691 access_failure_info * param, and pass it on to call to
693 * typeck.c (access_failure_info::record_access_failure): New method.
694 (access_failure_info::maybe_suggest_accessor): New method.
695 (finish_class_member_access_expr): Pass an access_failure_info
696 instance to the lookup_member call, and call its
697 maybe_suggest_accessor method afterwards.
699 2017-05-16 Marek Polacek <polacek@redhat.com>
703 * cp-gimplify.c (cp_fold): Handle SAVE_EXPR.
705 2017-05-16 Nathan Sidwell <nathan@acm.org>
707 * name-lookup.c (check_local_shadow): New, broke out of ...
708 (pushdecl_maybe_friend_1): ... here. Call it.
710 * cp-tree.h (OVL_NESTED_P, OVL_LOOKUP_P): New.
711 (ovl_first): Move inline definition to end of file.
712 (ovl_make, lookup_add): Declare.
713 (get_fns, get_first_fn): Make pure.
714 * tree.c (ovl_cache): New.
715 (ovl_make, lookup_add): New.
716 * pt.c (do_class_deduction): Don't add candidates that will be
719 * call.c (build_user_type_conversion_1): Use OVL_FIRST.
720 (print_error_for_call_failure): Use OVL_NAME.
721 (build_op_call_1): Use ovl_iterator.
722 (add_candidates): Use OVL_FIRST & lkp_iterator.
723 (build_op_delete_call): Use MAYBE_BASELINK_FUNCTIONS &
725 * class.c (deduce_noexcept_on_destructors): Use ovl_iterator.
726 (type_has_user_nondefault_constructor,
727 in_class_defaulted_default_constructor,
728 type_has_user_provided_constructor,
729 type_has_user_provided_or_explicit_constructor,
730 type_has_non_user_provided_default_constructor,
731 vbase_has_user_provided_move_assign,
732 type_has_move_constructor, type_has_move_assign,
733 type_has_user_declared_move_constructor,
734 type_has_user_declared_move_assign,
735 type_build_ctor_call, type_build_dtor_call,
736 type_requires_array_cookie, explain_non_literal_class): Likewise.
737 (finish_struct): Use lkp_iterator.
738 (resolve_address_of_overloaded_function): Use OVL_NAME, lkp_iterator.
739 (note_name_declared_in_class): Use OVL_NAME.
740 * cxx-pretty-print.c (pp_cxx_unqualified_id): Use OVL_FIRST.
741 (pp_cxx_qualified_id, cxx_pretty_printer::id_expression,
742 cxx_pretty_printer::expression): Likewise.
743 * decl2.c (check_classfn): Use ovl_iterator.
744 * pt.c (retrieve_specialization): Use ovl_iterator.
745 * tree.c (cp_tree_equal): Use lkp_iterator.
746 (type_has_nontrivial_copy_init): Use ovl_iterator.
748 * typeck2.c (cxx_incomplete_type_diagnostic): Revert change and
749 check is_overloaded_fn.
751 2017-05-16 Martin Liska <mliska@suse.cz>
753 * parser.c (cp_lexer_print_token): Add default value for flags
754 argument of print_gimple_stmt, print_gimple_expr,
755 print_generic_stmt and print_generic_expr.
757 2017-05-16 Nathan Sidwell <nathan@acm.org>
759 * cp-tree.h (class ovl_iterator, class lkp_iterator): New OVERLOAD
761 (MAYBE_BASELINK_FUNCTIONS): New.
762 * constraint.cc (resolve_constraint_check): Use lkp_iterator.
763 * decl2.c (maybe_warn_sized_delete): Use ovl_iterator.
764 * lambda.c (maybe_generic_this_capture): Use lkp_iterator.
765 * method.c (inherited_ctor_binfo): Use ovl_iterator.
766 (binfo_inherited_from): Likewise.
767 * parser.c (lookup_literal_operator): Use lkp_iterator.
768 * pt.c (iterative_hash_template_arg): Use lkp_iterator.
769 (print_candidates_1): Likewise.
770 (determine_specialization): Likewise.
771 (resolve_overloaded_unification): Likewise.
772 (resolve_nondeduced_context): Likewise.
773 (type_dependent_expression_p): Likewise.
774 (dependent_template_p): Likewise.
775 * ptree.c (cxx_print_xnode): Likewise.
776 * semantics.c (omp_reduction_lookup): Use lkp_iterator.
777 (classtype_has_nothrow_assign_or_copy_p): Use ovl_iterator.
778 * typeck.c (check_template_keyword): Use lkp_iterator.
780 * cp-tree.h (OVL_FIRST, OVL_NAME): New.
782 * constexpr.c (function_concept_check): Use OVL_FIRST.
783 * cvt.c (build_expr_type_conversion): Likewise.
784 * decl.c (poplevel, grokdeclarator): Use OVL_NAME.
785 * decl2.c (mark_used): Use OVL_FIRST.
786 * error.c (dump_decl): Use OVL_FIRST, OVL_NAME.
787 (dump_expr, location_of): Use OVL_FIRST.
788 * friend.c (do_friend): Use OVL_NAME.
789 * init.c (build_offset_ref): Use OVL_FIRST.
790 * mangle.c (write_member_name): Likewise.
791 (write_expression): Use OVL_NAME.
792 * method.c (strip_inheriting_ctors): Use OVL_FIRST.
793 * name-lookup.c (pushdecl_class_level): Use OVL_NAME.
794 * pt.c (check_explicit_specialization): Use OVL_FIRST.
795 (check_template_shadow): Likewise.
796 (tsubst_template_args): Use OVL_NAME.
797 (tsubst_baselink): Use OVL_FIRST.
798 * semantics.c (perform_koenig_lookup): Use OVL_NAME.
799 * tree.c (get_first_fn): Use OVL_FIRST.
800 * typeck.c (finish_class_member_access_expr): Use OVL_NAME.
801 (cp_build_addr_expr_1): Use OVL_FIRST.
803 * pt.c (tsubst_copy_and_build): Remove unnecessary COMPONENT_REF
805 * semantics.c (finish_id_expression): Directly init local var.
806 (finish_omp_reduction_clause): Use really_overloaded_fn.
807 * tree.c (get_fns): Document. Assert we got an overload.
808 (get_first_fn) Document.
809 * typeck.c (cp_build_addr_expr_1): Pass arg directly to
810 really_overloaded_fn.
811 * typeck2.c (cxx_incomplete_type_diagnostic): Use get_first_fn directly.
813 * cp-tree.h (SCOPE_DEPTH): New.
814 * name-lookup.h (is_nested_namespace): Declare.
815 * name-lookup.c (is_nested_namespace): New.
816 (is_ancestor): Use it.
817 (set_decl_namespace): Likewise.
818 (push_namespace): Set SCOPE_DEPTH.
819 * pt.c (check_specialization_namespace): Use is_nested_namespace.
820 (check_unqualigied_spec_or_inst): Likewise.
822 2017-05-15 Nathan Sidwell <nathan@acm.org>
825 * cp-tree.h (DECL_NAMESPACE_INLINE_P): New.
826 * name-lookup.h (push_namespace): Return int, add make_inline arg.
827 * name-lookup.c (push_namespace): Deal with inline directly.
829 * parser.c (cp_parser_namespace_definition): Adjust for
830 push_namespace change.
832 2017-05-11 Nathan Sidwell <nathan@acm.org>
834 * cp-lang.c (get_global_decls, cxx_pushdecl, LANG_HOOK_GETDECLS,
835 LANG_HOOKS_PUSHDECL): Move to ...
836 * cp-objcp-common.c (cp_get_global_decls, cp_pushdec,
837 LANG_HOOK_DECLS, LANG_HOOKS_PUSHDECL): ... here.
838 * cp-objcp-common.h (cp_get_global_decls, cp_pushdecl): Declare.
840 * name-lookup.h (pushdecl): Add default friend parm.
841 (pushdecl_maybe_friend): Delete.
842 (pushdecl_top_level): Add default friend parm.
843 (pushdecl_top_level_maybe_friend): Delete.
844 * name-lookup.c (pushdecl_maybe_friend): Delete.
845 (pushdecl): Add is_friend parm.
846 (pushdecl_top_level): Add is friend_parm.
847 (pushdecl_top_level_maybe_friend, pushdecl_top_level_1): Delete.
848 (pushdecl_top_level_and_finish): Do pushing and finishing directly.
849 * friend.c (do_friend): Adjust.
850 * pt.c (tsubst_friend_class): Adjust.
852 Revert pushdecl_top_level_and_finish name change.
853 * name-lookup.h (pushdecl_top_level_and_finish): Resurrect old name.
854 * name-lookup.c (pushdecl_top_level_and_finish): Likewise.
855 * decl.c (cp_make_fname_decl): Adjust.
856 * decl2.c (get_guard, handle_tls_init): Adjust.
857 * rtti.c (get_tinfo_decl, tinfo_base_init): Adjust.
859 * name-lookup.c (pushdecl_outermost_localscope): Always
860 conditionally stop timer.
862 * decl.c (xref_tag_1): Don't frob ts_lambda scope here.
863 * name-lookup.c (pushtag_1): Deal with ts_lambda scope.
865 * cp-tree.h (pushdecl, pushdecl_maybe_friend, pushtag,
866 pushtag_top_level_maybe_friend,
867 pushdecl_top_level_and_finish): Move declarations to ...
868 * name-lookup.h: ... here. Group pushdecl variants.
869 (pushdecl_top_level_and_finish): Rename to ...
870 (pushdecl_top_level_with_init): ... here.
871 * decl.c (cp_make_fname_decl): Use pushdecl_top_level_with_init.
872 * decl2.c (get_guard, handle_tls_init): Likewise.
873 * rtti.c (get_tinfo_decl, tinfo_base_init): Likewise.
874 * lambda.c (maybe_add_lambda_conv_op): Use namespace_bindings_p.
875 * method.c (implicitly_declare_fn): Likewise.
876 * searchc (node_debug_info_needed): Likewise.
877 * name-lookup.c (pushdecl_top_level_and_finish): Rename to ...
878 (pushdecl_top_level_with_init): ... here.
879 (pop_everything): Use namespace_bindings_p.
881 * name-lookup.h (pop_binding): Rename to pop_local_binding.
882 (getdecls): Rename to get_local_decls.
883 * name-lookup.c (pop_binding): Rename to ...
884 (pop_local_binding): ... here.
885 (pop_bindings_and_leave_scope): Adjust.
886 (getdecls): Rename to ...
887 (get_local_decls): ... here. Assert local scope.
888 * decl.c (poplevel): Assert not namespace. Adjust and simplify
890 (store_parm_decls): Adjust get_local_decls call.
891 (parser.c (synthesize_implicit_template_parm): Likewise.
893 2017-05-11 Ville Voutilainen <ville.voutilainen@gmail.com>
896 * method.c (is_trivially_xible): Reject void types.
898 2017-05-10 Nathan Sidwell <nathan@acm.org>
900 * class.c (handle_using_decl): Always use OVL_CURRENT.
901 (resolve_address_of_overloaded_function): Move iterator decl into
902 for scope. Don't strip anticipated decls here.
904 * pt.c (print_candidates_1): Separate TREE_LIST and OVERLOAD
906 (print_candidates): Adjust.
908 * cp-tree.h (build_new_function_call): Lose koenig_p arg. Fix
910 * call.c (build_new_function_call): Lose koenig_p arg. Remove
911 koenig_p handling here.
912 * pt.c (push_template_decl_real): Unconditionally retrofit_lang_decl.
913 (tsubst_omp_clauses): Likewise.
914 (do_class_deduction): Adjust buld_new_function_call calls.
915 * semantics.c (finish_call_expr): Likewise.
917 2017-05-10 Jason Merrill <jason@redhat.com>
919 * pt.c (unify_parameter_deduction_failure, unify_cv_qual_mismatch)
920 (unify_type_mismatch, unify_parameter_pack_mismatch)
921 (unify_ptrmem_cst_mismatch, unify_expression_unequal)
922 (unify_parameter_pack_inconsistent, unify_inconsistency)
923 (unify_vla_arg, unify_method_type_error, unify_arity)
924 (unify_arg_conversion, unify_no_common_base)
925 (unify_inconsistent_template_template_parameters)
926 (unify_template_deduction_failure)
927 (unify_template_argument_mismatch)
928 (unify_overload_resolution_failure): Call unify_invalid.
930 CWG 1847 - Clarifying compatibility during partial ordering
931 * pt.c (more_specialized_fn): No order between two non-deducible
934 * pt.c (dependent_type_p): Make sure we aren't called with
937 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
938 * pt.c (convert_template_argument): Just return an argument pack.
939 (coerce_template_parameter_pack, template_parm_to_arg)
940 (extract_fnparm_pack, make_argument_pack, tsubst_template_args)
941 (tsubst_decl, tsubst, type_unification_real, unify_pack_expansion):
942 Don't set the type of a NONTYPE_ARGUMENT_PACK.
943 * parser.c (make_char_string_pack, make_string_pack): Likewise.
945 2017-05-10 Nathan Sidwell <nathan@acm.org>
947 * cp-tree.h (add_method, clone_function_decl): Change last arg to
949 * class.c (add_method): Change third arg to bool. Adjust.
950 (one_inheriting_sig, one_inherited_ctor): Adjust.
951 (clone_function_decl): Change 2nd arg to bool. Adjust.
952 (clone_constructors_and_destructors): Adjust.
953 * lambda.c (maybe_add_lambda_conv_op): Adjust.
954 * method.c (lazily_declare_fn): Adjust.
955 * pt.c (tsubst_decl, instantiate_template_1): Adjust.
956 * semantics.c (finish_member_declaration): Adjust.
958 2017-05-10 Paolo Carlini <paolo.carlini@oracle.com>
961 * decl.c (finish_function): To improve error recovery, change the
962 logic for calling apply_deduced_return_type.
964 2017-05-09 Jason Merrill <jason@redhat.com>
966 PR c++/80605 - __is_standard_layout and empty base
967 * class.c (check_bases): Ignore empty bases.
969 PR c++/70979 - literal class and closure types
970 * class.c (finalize_literal_type_property): Handle closures
972 (explain_non_literal_class): Likewise.
974 PR c++/66297, DR 1684 - literal class and constexpr member fns
975 * constexpr.c (is_valid_constexpr_fn): Only complain about
976 non-literal enclosing class in C++11.
977 * class.c (finalize_literal_type_property): Likewise.
979 2017-05-09 Paolo Carlini <paolo.carlini@oracle.com>
982 * pt.c (tsubst_decl): Early return error_mark_node if
983 grok_ctor_properties returns false.
985 2017-05-09 Jason Merrill <jason@redhat.com>
987 PR c++/70167 - array prvalue treated as lvalue
988 * cp-tree.h (CONSTRUCTOR_C99_COMPOUND_LITERAL): New.
990 * semantics.c (finish_compound_literal): Add fcl_context parameter.
991 Only make a static variable for C99 syntax.
992 * parser.c (cp_parser_postfix_expression): Pass it.
993 * pt.c (tsubst_copy_and_build): Likewise.
994 * call.c (extend_ref_init_temps): Set
995 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
997 2017-05-09 Nathan Sidwell <nathan@acm.org>
999 * cp-lang.c (get_global_decls, cxx_pushdecl): New.
1000 (LANG_HOOKS_GETDECLS, LANG_HOOKS_PUSHDECL): Override.
1001 * name-lookup.h (pushdecl_top_level): Declare.
1003 2017-05-08 Jason Merrill <jason@redhat.com>
1005 PR c++/80178 - parameter passing for uncopyable classes
1006 * tree.c (type_has_nontrivial_copy_init): True for classes with only
1007 deleted copy/move ctors.
1008 (remember_deleted_copy, maybe_warn_parm_abi): New.
1009 * decl.c (require_complete_types_for_parms, check_function_type):
1010 Call maybe_warn_parm_abi.
1011 * call.c (convert_for_arg_passing, build_cxx_call): Likewise.
1013 2017-05-08 Nathan Sidwell <nathan@acm.org>
1015 * decl.c (builtin_function_1): Set DECL_ANTICIPATED before pushing.
1016 (start_preparsed_function): Do decl pushing before setting
1017 current_funciton_decl and announcing it.
1019 * name-lookup.h (pushdecl_with_scope): Replace with ...
1020 (pushdecl_outermost_localscope): ... this.
1021 * name-lookup.c (pushdecl_with_scope): Replace with ...
1022 (pushdecl_outermost_localscope): ... this.
1023 (pushdecl_namespace_level): Adjust.
1024 * decl.c (cp_make_fname_decl): Use pushdecl_outermost_localscope.
1025 * lambda.c (insert_capture_proxy): Likewise.
1027 * class.c (build_vtbl_initializer): Don't shadow outer variable
1030 Revert _binding -> _value change.
1031 * name-lookup.h (get_namespace_value, set_global_value): Rename to ...
1032 (get_namespace_binding, set_global_binding): ... these.
1033 * name-lookup.c (get_namespace_value, set_global_value): Rename to ...
1034 (get_namespace_binding, set_global_binding): ... these.
1035 (arg_assoc_namespace, pushdecl_maybe_friend_1,
1036 check_for_out_of_scope_variable, push_overloaded_decl_1,
1037 lookup_name_innermost_nonclass_level, push_namespace): Adjust.
1038 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
1039 SET_IDENTIFIER_GLOBAL_VALUE): Adjust.
1040 * decl.c (poplevel): Adjust.
1041 * pt.c (make_constrained_auto): Likewise.
1043 2017-05-07 Volker Reichelt <v.reichelt@netcologne.de>
1045 PR translation/80280
1046 * call.c (print_z_candidate): Fix quoting.
1048 2017-05-05 David Malcolm <dmalcolm@redhat.com>
1050 * error.c (pedwarn_cxx98): Replace report_diagnostic
1051 with diagnostic_report_diagnostic.
1053 2017-05-05 Nathan Sidwell <nathan@acm.org>
1055 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value.
1056 (SET_IDENTIFIER_GLOBAL_VALUE): Use set_global_value.
1057 (IDENTIFIER_NAMESPACE_VALUE): Delete.
1058 * name-lookup.h (namespace_binding, set_namespace_binding): Replace
1060 (get_namespace_value, set_global_value): ... these.
1061 (get_global_value_if_present, is_typename_at_global_scope): Delete.
1062 * decl.c (poplevel): Use get_namespace_value.
1063 (grokdeclarator): Use IDENTIFIER_GLOBAL_VALUE.
1064 * class.c (build_vtbl_initializer): Stash library decl in
1065 static var. Use IDENTIFIER_GLOBAL_VALUE.
1066 * except.c (do_get_exception_ptr, do_begin_catch, do_end_catch,
1067 do_allocate_exception, do_free_exception, build_throw): Likewise.
1068 * init.c (throw_bad_array_new_length): Likewise.
1069 * rtti.c (throw_bad_cast, throw_bad_typeid): Likewise.
1070 * name-lookup.c (arg_assoc_namespace, pushdecl_maybe_friend_1,
1071 check_for_our_of_scope_variable, push_overloaded_decl_1): Use
1072 get_namespace_value.
1073 (set_namespace_binding_1): Rename to
1074 (set_namespace_binding): ... here.
1075 (set_global_value): New.
1076 (lookup_name_innermost_nonclass_level_1, push_namespace): Use
1077 get_namespace_value.
1078 * pt.c (listify): Use get_namespace_value.
1080 * call.c (make_temporary_var_for_ref_to_temp): Push decl into
1082 * lex.c (unqualified_name_lookup_error): Likewise.
1084 * class.c (alter_class): Use retrofit_lang_decl directly.
1085 * decl.c (push_local_name, dupliate_decls): Likewise.
1086 * semantics.c (omp_privatize_field): Likewise.
1088 Kill walk_namespaces.
1089 * cp-tree.h (walk_namespaces_fn, walk_namespaces): Delete.
1090 * decl.c (walk_namespaces_r, walk_namespaces): Delete.
1092 Kill per-namespace static_decls.
1093 * cp-tree.h (static_decls): Declare.
1094 (wrapup_globals_for_namespace,
1095 diagnose_inline_vars_for_namespace): Replace with ...
1096 (wrapup_namespace_globals): ... this.
1097 * decl.c (static_decls): Define.
1098 (wrapup_globals_for_namespace,
1099 diagnose_inline_vars_for_namespace): Replace with ...
1100 (wrapup_namespace_globals): ... this.
1101 (cxx_init_decl_processing): Initialize static_decls.
1102 * decl2.c (c_parse_final_cleanups): Adjust.
1103 * name-lookup.h (cp_binding_level): Remove static_decls member.
1104 * name-lookup.c (add_decl_to_level): Adjust.
1105 (begin_scope): Adjust.
1107 2017-05-05 Paolo Carlini <paolo.carlini@oracle.com>
1110 * decl.c (reshape_init): Unconditionally return error_mark_node
1111 upon error about too many initializers.
1113 2017-05-04 Nathan Sidwell <nathan@acm.org>
1115 * constraint.cc (diagnose_check_constraint): Fix %E thinko.
1117 2017-05-04 Martin Sebor <msebor@redhat.com>
1119 PR translation/80280
1120 * call.c (print_z_candidate): Add missing quoting to %D and other
1122 (build_op_call_1): Same.
1123 * constraint.cc (diagnose_check_constraint): Same.
1124 * mangle.c (mangle_decl): Same.
1125 * name-lookup.c (cp_binding_level_debug): Same.
1126 (set_decl_namespace): Same.
1127 * parser.c (cp_parser_tx_qualifier_opt): Same.
1128 * pt.c (print_candidates_1): Same.
1129 (check_template_variable): Same.
1130 (tsubst_default_argument): Same.
1131 (most_specialized_partial_spec): Same.
1132 * semantics.c (omp_reduction_lookup): Same.
1133 * tree.c (check_abi_tag_redeclaration): Same.
1134 * typeck.c (comptypes): Same.
1135 * typeck2.c (abstract_virtuals_error_sfinae): Same.
1137 2017-05-04 Nathan Sidwell <nathan@acm.org>
1140 * cp-tree.h (enum cp_tree_index): Add CPTI_GLOBAL,
1141 CPTI_GLOBAL_TYPE, CPTI_GLOBAL_IDENTIFIER, CPTI_ANON_IDENTIFIER,
1142 CPTI_INIT_LIST_IDENTIFIER.
1143 (global_namespace, global_type_node, global_identifier,
1144 anon_identifier, init_list_identifier): New.
1145 * decl.c (global_type_node, global_scope_name): Delete.
1146 (initialize_predefined_identifiers): Add new identifiers.
1147 (cxx_init_decl_processing): Adjust.
1148 * name-lookup.h (global_namespace, global_type_node): Delete.
1149 * name-lookup.c (global_namespace, anonymous_namespace_name,
1150 get_anonymous_namespace_name): Delete.
1151 (namespace_scope_ht_size, begin_scope, pushtag_1,
1152 push_namespace): Adjust,
1153 * call.c (type_has_extended_temps): Use init_list_identifier.
1154 * pt.c (listify): Likewise.
1156 * name-lookup.c: Reorder functions to make merging from modules
1159 2017-05-03 Jason Merrill <jason@redhat.com>
1161 * constexpr.c (cxx_eval_outermost_constant_expr): Use TV_CONSTEXPR.
1163 2017-05-03 Nathan Sidwell <nathan@acm.org>
1165 * cp-tree.h (enum cp_tree_index, cp_global_trees): Move earlier,
1166 along with #defines, to before name-lookup include.
1168 2017-05-02 Paolo Carlini <paolo.carlini@oracle.com>
1170 * pt.c (is_auto_or_concept): Remove.
1171 (type_uses_auto_or_concept): Remove, unused.
1172 (find_parameter_packs_r, extract_autos_r, is_auto_r): Adjust.
1173 * parser.c (tree_type_is_auto_or_concept): Remove, unused.
1174 * cp-tree.h (is_auto_or_concept): Remove.
1176 2017-05-01 Xi Ruoyao <ryxi@stu.xidian.edu.cn>
1179 * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Don't
1180 add pedigree operation and detach call here.
1181 * cp-gimplify.c (cp_gimplify_expr): Remove the calls to
1182 cilk_cp_gimplify_call_params_in_spawned_fn.
1183 (cilk_cp_gimplify_call_params_in_spawned_fn): Remove function.
1184 * semantics.c (simplify_aggr_init_expr): Copy EXPR_CILK_SPAWN.
1186 2017-04-29 Volker Reichelt <v.reichelt@netcologne.de>
1188 * parser.c (cp_parser_member_declaration): Add fix-it hints for
1189 stray comma and missing semicolon at end of member declaration.
1191 2017-04-27 Volker Reichelt <v.reichelt@netcologne.de>
1193 * parser.c (cp_parser_cast_expression): Add target type of cast to
1195 * error.c (type_to_string): Add '{enum}' suffix to enumeration types.
1197 2017-04-26 Paolo Carlini <paolo.carlini@oracle.com>
1199 * decl.c (grok_ctor_properties, ambi_op_p, unary_op_p): Change
1200 return type to bool.
1201 * cp-tree.h (grok_ctor_properties): Update.
1203 2017-04-26 Volker Reichelt <v.reichelt@netcologne.de>
1205 * parser.c (cp_parser_nested_name_specifier_opt): Add fix-it
1206 information to diagnostic of invalid colon in nested-name-specifier.
1208 2017-04-25 Volker Reichelt <v.reichelt@netcologne.de>
1210 * parser.c (cp_parser_elaborated_type_specifier): Add fix-it to
1211 diagnostic of invalid class/struct keyword after enum.
1213 2017-04-25 David Malcolm <dmalcolm@redhat.com>
1215 * parser.c (cp_parser_member_declaration): Add fix-it hint
1216 for removing stray semicolons.
1218 2017-04-25 David Malcolm <dmalcolm@redhat.com>
1220 * name-lookup.c (get_std_name_hint): New function.
1221 (maybe_suggest_missing_header): New function.
1222 (suggest_alternative_in_explicit_scope): Call
1223 maybe_suggest_missing_header.
1225 2017-04-25 David Malcolm <dmalcolm@redhat.com>
1228 * name-lookup.c (suggest_alternative_in_explicit_scope): Convert
1229 candidate type of bm from tree to const char *.
1230 (consider_binding_level): Likewise.
1231 (lookup_name_fuzzy): Likewise, using this to merge the best
1232 result from the preprocessor into bm, rather than immediately
1233 returning, so that better matches from reserved words can "win".
1234 Guard the rejection of keywords that don't start decl-specifiers
1235 so it only happens for FUZZY_LOOKUP_TYPENAME.
1237 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
1239 * decl.c (grokdeclarator): Use %qT instead of %<%T%> in diagnostics.
1240 (start_enum): Likewise.
1241 (build_enumerator): Likewise. Use %qE instead of plain %E.
1242 * parser.c (cp_parser_mem_initializer_list): Use %qD instead of
1243 %<%D%> in diagnostics.
1244 (cp_parser_elaborated_type_specifier): Likewise.
1245 * pt.c (make_pack_expansion): Use %qT and %qE instead of
1246 %<%T%> and %<%E%> in diagnostics.
1247 (tsubst_pack_expansion): Likewise.
1249 2017-04-24 David Malcolm <dmalcolm@redhat.com>
1252 * parser.c (cp_parser_unary_expression): Generate a location
1253 range for alignof and sizeof expressions.
1255 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
1257 * parser.c (cp_parser_cv_qualifier_seq_opt): Add fix-it info to
1259 (cp_parser_virt_specifier_seq_opt): Likewise.
1260 (set_and_check_decl_spec_loc): Likewise twice.
1262 2017-04-21 Jason Merrill <jason@redhat.com>
1264 PR c++/80179 - ICE with initialized flexible array member.
1265 * constexpr.c (verify_ctor_sanity): Handle flexible array members.
1267 2017-04-21 Richard Biener <rguenther@suse.de>
1269 * cp-tree.h (copy_decl): Annotate with CXX_MEM_STAT_INFO.
1270 (copy_type): Likewise.
1271 * lex.c (copy_decl): Pass down mem-stat info.
1272 (copy_type): Likewise.
1274 2017-04-20 Jonathan Wakely <jwakely@redhat.com>
1277 * init.c (build_new_1): Suppress notes about over-aligned new when
1278 the warning is suppressed.
1280 2017-04-20 Volker Reichelt <v.reichelt@netcologne.de>
1282 * parser.c (cp_parser_member_declaration): Add warning with fixit
1283 information for extra semicolon after in-class function definition.
1285 2017-04-20 Jakub Jelinek <jakub@redhat.com>
1288 * tree.c (build_cplus_array_type): Call build_array_type
1289 with the intended TYPE_TYPELESS_STORAGE flag value, instead
1290 of calling build_array_type and modifying later TYPE_TYPELESS_STORAGE
1293 2017-04-18 Marek Polacek <polacek@redhat.com>
1295 PR c++/80244 - ICE with attribute in template alias.
1296 * tree.c (strip_typedefs): Handle UNDERLYING_TYPE.
1298 PR c++/80241 - ICE with alignas pack expansion.
1299 * error.c (dump_expr): Handle TREE_LIST.
1300 * parser.c (cp_parser_std_attribute_list): Return error_mark if
1301 make_pack_expansion returns an error.
1303 2017-04-17 Bernd Edlinger <bernd.edlinger@hotmail.de>
1306 * class.c (fixup_may_alias): Fix all type variants.
1308 2017-04-17 Jason Merrill <jason@redhat.com>
1310 PR c++/80415 - wrong error with default arg and array reference.
1311 * tree.c (lvalue_kind): Return clk_class for an array prvalue.
1313 * pt.c (tsubst_init): Set TARGET_EXPR_DIRECT_INIT_P.
1315 2017-04-15 Alexandre Oliva <aoliva@redhat.com>
1317 * decl.c (name_unnamed_type): Split out of...
1318 (grokdeclarator): ... this.
1319 * decl.h (name_unnamed_type): Declare.
1321 2017-04-12 Richard Biener <rguenther@suse.de>
1322 Bernd Edlinger <bernd.edlinger@hotmail.de>
1325 * tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
1326 for arrays of character or std::byte type.
1328 2017-04-11 Jason Merrill <jason@redhat.com>
1330 PR c++/80294 - ICE with constexpr and inheritance.
1331 * constexpr.c (reduced_constant_expression_p):
1332 A null constructor element is non-constant.
1333 (cxx_eval_indirect_ref): Don't VERIFY_CONSTANT before
1334 returning an empty base.
1336 2017-04-11 Jakub Jelinek <jakub@redhat.com>
1339 * decl.c (cp_finish_decomp): If processing_template_decl on
1340 non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't
1341 change their DECL_VALUE_EXPR nor cp_finish_decl them. Instead make
1342 sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst
1344 * pt.c (value_dependent_expression_p) <case VAR_DECL>: For variables
1345 with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
1348 2017-04-11 Jakub Jelinek <jakub@redhat.com>
1351 * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.
1353 2017-04-10 Jakub Jelinek <jakub@redhat.com>
1356 * tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
1357 operand, if it is a static member function, recurse on the
1360 2017-04-10 Marek Polacek <polacek@redhat.com>
1363 * typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL. Set
1364 ORIG_TYPE earlier and not only when shortening.
1366 2017-04-07 Jason Merrill <jason@redhat.com>
1368 PR c++/80356 - ICE with reference to function template argument.
1370 * pt.c (convert_nontype_argument_function): Adjust type even with a
1371 value-dependent argument.
1373 PR c++/80267 - ICE with nested capture of reference
1375 * pt.c (tsubst_copy): Handle lookup finding a capture proxy.
1377 2017-04-07 Marek Polacek <polacek@redhat.com>
1380 * typeck.c (cp_build_binary_op): Convert COP[01] to ORIG_TYPE.
1383 * call.c (build_over_call): Don't check cxx_dialect.
1384 * cp-gimplify.c (cp_gimplify_init_expr): Don't check cxx_dialect nor
1385 whether SUB is a CONSTRUCTOR.
1386 * init.c (build_new_1): Don't check cxx_dialect.
1387 * tree.c (replace_placeholders): Add a function comment. Return if
1388 not in C++14, or if the object isn't a (member of a) class.
1389 * typeck2.c (store_init_value): Don't check cxx_dialect nor whether
1390 TYPE is CLASS_TYPE_P.
1392 2017-04-05 Jakub Jelinek <jakub@redhat.com>
1395 * pt.c (canonical_type_parameter): Use vec_safe_grow_cleared instead
1396 of a loop doing vec_safe_push of NULL. Formatting fixes.
1397 (rewrite_template_parm): Copy TEMPLATE_PARM_PARAMETER_PACK from oldidx
1398 to newidx before calling canonical_type_parameter on newtype.
1400 2017-04-04 Volker Reichelt <v.reichelt@netcologne.de>
1403 * cxx-pretty-print.c (cxx_pretty_printer::expression): Add
1404 UNARY_PLUS_EXPR case.
1406 2017-04-03 Jason Merrill <jason@redhat.com>
1408 * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
1410 2017-04-03 Jonathan Wakely <jwakely@redhat.com>
1412 * class.c (update_vtable_entry_for_fn): Fix typo in comment.
1413 * decl2.c (one_static_initialization_or_destruction): Likewise.
1414 * name-lookup.c (store_bindings): Likewise.
1415 * parser.c (make_call_declarator): Likewise.
1416 * pt.c (check_explicit_specialization): Likewise.
1418 2017-04-03 Jason Merrill <jason@redhat.com>
1420 PR sanitizer/79993 - ICE with VLA initialization from string
1421 PR c++/69487 - wrong VLA initialization from string
1422 * init.c (finish_length_check): Split out from build_vec_init.
1423 (build_vec_init): Handle STRING_CST.
1424 * typeck2.c (split_nonconstant_init): Handle STRING_CST.
1425 (digest_init_r): Don't give a STRING_CST VLA type.
1427 2017-03-31 Jakub Jelinek <jakub@redhat.com>
1430 * cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
1431 REFERENCE_TYPE. Adjust ubsan_maybe_instrument_reference caller
1432 for NOP_EXPR to REFERENCE_TYPE.
1435 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
1436 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
1438 * semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
1439 Remove extraneous parens.
1440 (finish_trait_expr): Handle CPTK_IS_AGGREGATE.
1441 * parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
1442 (cp_parser_trait_expr): Likewise.
1444 2017-03-27 Jakub Jelinek <jakub@redhat.com>
1447 * cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
1448 * typeck.c (cxx_mark_addressable): Likewise. Look through
1449 VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
1451 (cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
1453 2017-03-24 Jason Merrill <jason@redhat.com>
1455 PR c++/77339 - ICE with invalid use of alias template.
1456 * pt.c (lookup_template_class_1): Don't try to enter the scope of an
1459 2017-03-24 Marek Polacek <polacek@redhat.com>
1462 * cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
1463 doesn't have side effects.
1465 2017-03-23 Jason Merrill <jason@redhat.com>
1467 PR c++/80150 - ICE with overloaded variadic deduction.
1468 * pt.c (try_one_overload): Remove asserts.
1470 PR c++/77563 - missing ambiguous conversion error.
1471 * call.c (convert_like_real): Use LOOKUP_IMPLICIT.
1473 2017-03-23 Marek Polacek <polacek@redhat.com>
1475 * cp-tree.h: Remove a C_RID_YYCODE reference.
1477 2017-03-22 Jakub Jelinek <jakub@redhat.com>
1480 * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
1481 case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
1482 processing_template_decl.
1484 2017-03-21 Paolo Carlini <paolo.carlini@oracle.com>
1487 * name-lookup.c (pushtag_1): Add check for bogus, non template,
1488 std::initializer_list.
1490 2017-03-21 Jakub Jelinek <jakub@redhat.com>
1493 * init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.
1495 2017-03-21 Ville Voutilainen <ville.voutilainen@gmail.com>
1498 * init.c (std_placement_new_fn_p): New.
1499 (build_new_1): Call it.
1501 2017-03-20 Jason Merrill <jason@redhat.com>
1503 PR c++/80096 - ICE with C++17 non-type auto.
1504 * pt.c (tsubst): Delay tsubst of type of template non-type
1507 PR c++/79519 - ICE with deleted template friend.
1508 * decl.c (grokdeclarator): Complain about misplaced function
1509 definition using =, as well.
1511 PR c++/79640 - infinite recursion with generic lambda.
1512 * pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
1513 before substituting its initializer.
1515 2017-03-20 Marek Polacek <polacek@redhat.com>
1516 Paolo Carlini <paolo.carlini@oracle.com>
1518 PR c++/80059 - ICE with noexcept and __transaction_atomic
1519 * except.c (build_must_not_throw_expr): Call
1520 instantiate_non_dependent_expr.
1522 2017-03-19 Jason Merrill <jason@redhat.com>
1524 PR c++/80084 - wrong C++17 decomposition by reference of parameter.
1525 * decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
1526 reference decomposition.
1528 PR c++/80077 - error with constexpr and -fno-elide-constructors.
1529 * constexpr.c (cxx_eval_call_expression): Set ctx->call while
1530 expanding trivial constructor.
1532 2017-03-17 Jason Merrill <jason@redhat.com>
1534 PR c++/78345 - ICE initializing array from lambda.
1535 * init.c (build_aggr_init): Check array initializer.
1536 (build_vec_init): Check the type of a CONSTRUCTOR.
1538 PR c++/80073 - C++17 ICE with virtual base.
1539 * decl.c (xref_basetypes): Also check for indirect vbases.
1541 2017-03-16 Jason Merrill <jason@redhat.com>
1543 * decl.c (start_enum): std::byte aliases anything.
1546 * constexpr.c (lookup_placeholder): Tweak.
1548 2017-03-15 Jason Merrill <jason@redhat.com>
1550 PR c++/80043 - ICE with -fpermissive
1551 * typeck.c (convert_for_assignment): Handle instantiate_type
1552 not giving an error.
1554 2017-03-14 Nathan Sidwell <nathan@acm.org>
1556 PR c++/79393 DR 1658 workaround
1557 * method.c (synthesized_method_base_walk): Inihibit abstract class
1558 virtual base access check here.
1559 (synthesized_method_walk): Not here.
1561 2017-03-13 Nathan Sidwell <nathan@acm.org>
1563 PR c++/79393 DR 1658 workaround
1564 * method.c (synthesized_method_walk): Check vbases of abstract
1565 classes for dtor walk.
1567 2017-03-10 David Malcolm <dmalcolm@redhat.com>
1569 PR translation/79848
1570 * decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
1572 2017-03-10 Jason Merrill <jason@redhat.com>
1574 PR c++/79960 - alias templates and partial ordering
1575 * pt.c (comp_template_args): Add partial_order parm.
1576 (template_args_equal): Likewise.
1577 (comp_template_args_porder): New.
1578 (get_partial_spec_bindings): Use it.
1580 2017-03-10 Marek Polacek <polacek@redhat.com>
1583 * decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
1585 2017-03-10 Jakub Jelinek <jakub@redhat.com>
1588 * optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
1589 Use XALLOCAVEC macro.
1592 * decl.c (finish_enum_value_list): If value is error_mark_node,
1593 don't copy it and change its type.
1594 * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
1595 of CONST_DECL is error_mark_node.
1597 2017-03-09 Marek Polacek <polacek@redhat.com>
1599 PR c++/79900 - ICE in strip_typedefs
1600 * tree.c (strip_typedefs): Skip the attribute handling if T is
1601 a variant type which hasn't been updated yet.
1603 PR c++/79687 - wrong code with pointer-to-member
1604 * init.c (constant_value_1): Break if the variable has a dynamic
1607 2017-03-08 Jason Merrill <jason@redhat.com>
1609 PR c++/79797 - ICE with self-reference in array DMI.
1610 * constexpr.c (lookup_placeholder): Split out...
1611 (cxx_eval_constant_expression): ...from here.
1613 2017-03-07 Jakub Jelinek <jakub@redhat.com>
1616 * parser.c (cp_parser_omp_cancellation_point,
1617 cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
1618 cp_parser_omp_target_update): Change "may only be used in compound
1619 statements" diagnostics, such that the same translatable string is
1620 used for all pragmas.
1621 (cp_parser_pragma): Likewise. Use error_at instead of
1622 cp_parser_error for that diagnostics.
1624 2017-03-06 Marek Polacek <polacek@redhat.com>
1626 PR c++/79796 - ICE with NSDMI and this pointer
1627 * call.c (build_over_call): Handle NSDMI with a 'this' by calling
1628 replace_placeholders.
1630 2017-03-06 Jakub Jelinek <jakub@redhat.com>
1633 * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
1636 2017-03-06 Jason Merrill <jason@redhat.com>
1638 Revert "Allow deduction guides to look into primary template."
1639 * cp-tree.h, parser.c, pt.c, search.c: Revert.
1641 2017-03-05 Paolo Carlini <paolo.carlini@oracle.com>
1644 * except.c (build_must_not_throw_expr): Perform the implicit
1645 conversions on the condition.
1647 2017-03-03 Jason Merrill <jason@redhat.com>
1649 * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
1652 Core issues 2273 and 2277
1653 * call.c (joust): Adjust using-declaration tiebreaker to handle
1654 the intermediate base case.
1655 * method.c (strip_inheriting_ctors): Just return the argument if
1656 !flag_new_inheriting_ctors.
1658 2017-03-03 Richard Biener <rguenther@suse.de>
1661 * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
1663 2017-03-03 Marek Polacek <polacek@redhat.com>
1666 * typeck.c (string_conv_p): In C++11, always call pedwarn with
1669 2017-03-02 Jason Merrill <jason@redhat.com>
1671 Update overload resolution with deduction guides.
1672 * pt.c (do_class_deduction): Always build the copy guide.
1673 (copy_guide_p, template_guide_p): New.
1674 (build_deduction_guide): Remember the original constructor.
1675 * call.c (joust): Prefer the copy guide and non-template guides.
1677 Allow deduction guides to look into primary template.
1678 * cp-tree.h (struct saved_scope): Add deduction_guide_type.
1679 (struct cp_decl_specifier_seq): Add constructor_p.
1680 * parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
1681 (cp_parser_init_declarator): Check it. Set ctor_dtor_or_conv_p.
1682 Clear deduction_guide_type. Don't handle deduction guide names.
1683 (cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
1684 (cp_parser_direct_declarator): Likewise. Handle deduction guides.
1685 (cp_parser_member_declaration, cp_parser_cache_defarg)
1686 (cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
1687 * pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
1688 (build_deduction_guide): Set deduction_guide_type.
1689 (dependent_scope_p): Check deduction_guide_type.
1690 * search.c (lookup_member): Likewise.
1692 2017-03-02 Jakub Jelinek <jakub@redhat.com>
1695 * init.c (mark_exp_read_r): New function.
1696 (emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
1697 whole arguments instead of plain mark_exp_read on TREE_LIST values.
1699 2017-03-01 Jason Merrill <jason@redhat.com>
1701 Class template argument deduction in new-expression
1702 * init.c (build_new): Handle deduction from no initializer.
1703 * parser.c (cp_parser_new_expression): Don't require a single
1704 expression for class template deduction.
1705 * typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
1706 class template placeholder.
1707 * pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
1708 (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
1709 (redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
1711 2017-03-01 Jakub Jelinek <jakub@redhat.com>
1714 * init.c (emit_mem_initializers): When not constructing vbases of
1715 abstract classes, mark arguments as read for
1716 -Wunused-but-set-parameter.
1718 2017-02-28 Jason Merrill <jason@redhat.com>
1720 Class template argument deduction refinements
1721 * call.c (joust): Move deduction guide tiebreaker down.
1722 * decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
1723 deduction with no initializer.
1724 * pt.c (build_deduction_guide): Handle implicit default/copy ctor.
1725 (do_class_deduction): Use that rather than special case.
1726 (do_auto_deduction): Handle null initializer.
1728 2017-02-28 Jakub Jelinek <jakub@redhat.com>
1730 * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
1731 instead of just cond ? "..." : "...".
1732 (grokdeclarator): Likewise.
1733 (build_enumerator): Likewise.
1734 * init.c (build_new_1): Likewise.
1735 * call.c (build_new_method_call_1): Likewise.
1736 * parser.c: Include intl.h.
1737 (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
1738 "enter"/"exit" keyword.
1739 (cp_finalize_oacc_routine): Don't use %s to supply portions of the
1742 2017-02-27 Jason Merrill <jason@redhat.com>
1744 PR c++/71568 - SFINAE forming pointer to member function
1745 * init.c (build_offset_ref): Check the return value of
1746 perform_or_defer_access_check.
1748 2017-02-27 Marek Polacek <polacek@redhat.com>
1750 * decl.c (expand_static_init): Add missing } in a comment.
1752 2017-02-27 Volker Reichelt <v.reichelt@netcologne.de>
1754 * init.c: Include intl.h.
1755 (build_new_1): Move message strings into pedwarn to make them
1756 -Wformat-security friendly. Mark string for translation.
1757 * pt.c (tsubst_copy_and_build): Mark string for translation.
1758 Make the pointer const.
1759 * semantics.c (finish_id_expression): Mark strings for translation.
1761 2017-02-25 Jakub Jelinek <jakub@redhat.com>
1763 * call.c (build_op_delete_call): Make msg1 and msg2 const.
1765 2017-02-24 Jakub Jelinek <jakub@redhat.com>
1768 * call.c (build_over_call): Call check_function_arguments even for
1769 -Wrestrict, adjust check_function_arguments caller.
1770 * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
1772 * typeck.c (cp_build_function_call_vec): Adjust
1773 check_function_arguments caller.
1775 2017-02-24 Marek Polacek <polacek@redhat.com>
1777 PR translation/79705
1778 * decl.c (check_redeclaration_exception_specification): Mark a string
1779 for translation. Make the pointer const.
1781 2017-02-23 Paolo Carlini <paolo.carlini@oracle.com>
1784 * pt.c (register_specialization): Check duplicate_decls return value
1785 for error_mark_node and pass it back.
1787 2017-02-22 Jason Merrill <jason@redhat.com>
1789 PR c++/79679 - missing destructor for argument
1790 * call.c (build_over_call): Don't pass tf_no_cleanup to argument
1793 * pt.c (do_class_deduction): Handle 0 argument case.
1795 2017-02-22 Jakub Jelinek <jakub@redhat.com>
1798 * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
1799 SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
1800 * constexpr.c (potential_constant_expression_1): Handle
1801 OMP_*, OACC_* and CILK_* trees. Use error_at with
1802 EXPR_LOC_OR_LOC (t, input_location) computed early
1803 instead of error, or error_at with location_of (t).
1805 2017-02-22 Marek Polacek <polacek@redhat.com>
1808 * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
1809 if the alignas expression is erroneous.
1810 * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
1814 * semantics.c (finish_underlying_type): Bail out for incomplete enums.
1816 2017-02-21 Jason Merrill <jason@redhat.com>
1818 PR c++/50308 - wrong deprecated warning with ADL
1819 PR c++/17729 - duplicate deprecated warning
1820 * semantics.c (finish_id_expression): Only call mark_used on a
1821 function if we aren't building a call.
1823 PR c++/41727 - ICE with partial spec of partial instantiation
1824 * pt.c (process_partial_specialization): For now, don't check more
1825 specialized if there is more than one level of args.
1827 2017-02-21 Marek Polacek <polacek@redhat.com>
1830 * cp-tree.h (maybe_reject_flexarray_init): Declare.
1831 * init.c (maybe_reject_flexarray_init): No longer static.
1832 Add check for current_function_decl.
1833 * parser.c (cp_parser_late_parse_one_default_arg): Reject
1834 a default mem-initializer for a flexible array.
1836 2017-02-21 Jakub Jelinek <jakub@redhat.com>
1837 Paolo Carlini <paolo.carlini@oracle.com>
1840 * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
1842 * pt.c (tsubst_decomp_names): Return error_mark_node if the first
1843 decl after the decomposition artificial decl has error_mark_node.
1844 * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
1845 instead of just == error_mark_node comparison.
1847 2017-02-21 Jakub Jelinek <jakub@redhat.com>
1850 * decl.c: Include gimplify.h.
1851 (cp_finish_decomp): Make sure there is no sharing of trees
1852 in between DECL_VALUE_EXPR of decomposition decls.
1855 * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
1858 * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
1859 call cplus_expand_constant on it first.
1861 2017-02-19 Jason Merrill <jason@redhat.com>
1863 PR c++/78139 - destructor needed by new-expression
1864 * call.c (build_special_member_call): Use tf_no_cleanup.
1866 PR c++/78282 - auto template and pack expansion
1867 * pt.c (find_parameter_packs_r): Don't walk into the type of
1868 templates other than template template-parameters.
1870 PR c++/79606 - ICE with this->base_member in NSDMI
1871 * class.c (build_base_path): Check processing_template_decl.
1873 PR c++/79607 - ICE with T{} initializer
1874 * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
1876 PR c++/79566 - elaborated-type-specifier in range for
1877 * parser.c (cp_parser_simple_declaration): Fix check for type
1880 PR c++/79400 - confusing suggestion of 'noexcept'
1881 * parser.c (cp_parser_exception_specification_opt): Remove
1882 suggestion for deprecated dynamic exception-specification.
1884 PR c++/79470 - partial ordering with reference parameters
1885 * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
1887 PR c++/79500 - ICE with non-template deduction guide
1888 * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
1889 DECL_TEMPLATE_RESULT.
1891 PR c++/79580 - ICE with compound literal
1892 * parser.c (cp_parser_class_head): If we're in the middle of an
1893 expression, use ts_within_enclosing_non_class.
1895 PR c++/79503 - inherited ctor taking base class
1896 * call.c (add_function_candidate): Also check that
1897 DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
1899 2017-02-19 Paolo Carlini <paolo.carlini@oracle.com>
1902 * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
1905 2017-02-19 Eric Fiselier <eric@efcs.ca>
1906 Jonathan Wakely <jwakely@redhat.com>
1909 * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
1910 control warning about literal suffix identifiers without a leading
1913 2017-02-17 Jason Merrill <jason@redhat.com>
1915 PR c++/79508 - lookup error with member template
1916 * parser.c (cp_parser_template_name): Clear
1917 parser->context->object_type if we aren't doing lookup.
1919 PR c++/78690 - ICE with using and global type with same name
1920 * pt.c (type_dependent_object_expression_p): True for
1923 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
1924 * pt.c (convert_template_argument): Just return an auto arg pack.
1925 (tsubst_template_args): Don't tsubst an auto pack type.
1927 PR c++/79556 - C++17 ICE with non-type auto
1928 * pt.c (do_auto_deduction): Don't try to deduce from null type.
1930 PR c++/79533 - C++17 ICE with temporary cast to reference
1931 * call.c (build_over_call): Conversion to a reference prevents copy
1934 2017-02-16 Jakub Jelinek <jakub@redhat.com>
1935 Jason Merrill <jason@redhat.com>
1937 PR c++/79502 - lost nodiscard attribute
1938 * pt.c (apply_late_template_attributes): Do apply non-dependent
1939 attributes to types.
1941 2017-02-16 Jason Merrill <jason@redhat.com>
1943 PR c++/78572 - ICE with self-modifying array initializer
1944 * constexpr.c (cxx_eval_store_expression): The object we're
1945 initializing is outside the constant-expression.
1946 (cxx_eval_call_expression): Set ctx->call.
1948 PR c++/79050 - ICE with undeduced auto and LTO
1949 * decl.c (poplevel): Remove undeduced auto decls.
1951 2017-02-16 Jakub Jelinek <jakub@redhat.com>
1954 * parser.c (cp_parser_omp_target): For -fopenmp-simd
1955 ignore #pragma omp target even when not followed by identifier.
1957 2017-02-15 Jason Merrill <jason@redhat.com>
1958 Jakub Jelinek <jakub@redhat.com>
1960 PR c++/79464 - ICE in IPA with omitted constructor parms
1961 * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
1962 (adjust_clone_args): Adjust.
1963 (add_method): Remember omitted parms.
1964 * call.c (add_function_candidate): Likewise.
1965 * mangle.c (write_method_parms): Likewise.
1966 * method.c (ctor_omit_inherited_parms): Return false if there are no
1969 2017-02-15 Martin Sebor <msebor@redhat.com>
1972 * init.c (maybe_reject_flexarray_init): New function.
1973 (perform_member_init): Call it.
1975 2017-02-15 Jakub Jelinek <jakub@redhat.com>
1978 * parser.c (cp_parser_std_attribute): Don't pedwarn about
1979 [[deprecated]] with -std=c++11 and [[fallthrough]] with
1980 -std=c++11 and -std=c++14.
1983 * decl.c (grokdeclarator): For static data members, handle thread_p
1984 only after handling inline.
1986 2017-02-14 Marek Polacek <polacek@redhat.com>
1990 * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
1991 clobbering if the postfix expression isn't an EXPR_P.
1993 2017-02-13 Jason Merrill <jason@redhat.com>
1995 PR c++/79461 - ICE with lambda in constexpr constructor
1996 * constexpr.c (build_data_member_initialization): Ignore
1997 initialization of a local variable.
1999 2017-02-13 Jakub Jelinek <jakub@redhat.com>
2001 * init.c (warn_placement_new_too_small): Add missing space in
2003 * parser.c (cp_parser_oacc_declare): Likewise.
2004 * mangle.c (maybe_check_abi_tags): Likewise.
2007 * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
2008 on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
2009 in the rightmost operand.
2011 2017-02-13 Nathan Sidwell <nathan@acm.org>
2013 PR c++/79296 - ICE mangling localized template instantiation
2014 * decl2.c (determine_visibility): Use template fn context for
2015 local class instantiations.
2017 2017-02-11 Jason Merrill <jason@redhat.com>
2019 PR c++/77659 - ICE with new and C++14 aggregate NSDMI
2020 * init.c (build_new): Make backups of any CONSTRUCTORs in init.
2021 (build_new_1): Use replace_placeholders.
2022 * tree.c (replace_placeholders_t): Also track whether we've seen a
2024 (replace_placeholders, replace_placeholders_r): Adjust.
2025 * cp-tree.h: Adjust.
2027 PR c++/77790 - ICE with auto function in C++11 mode
2028 * decl.c (undeduced_auto_decl): Remove C++14 limitation.
2029 (require_deduced_type): Add complain parm, return bool.
2030 * cp-tree.h: Adjust.
2031 * decl2.c (mark_used): Use require_deduced_type.
2033 2017-02-10 Jason Merrill <jason@redhat.com>
2035 PR c++/78908 - template ops and bitfields
2036 * tree.c (build_min_non_dep): Use unlowered_expr_type.
2038 PR c++/78897 - constexpr union
2039 * constexpr.c (cxx_eval_store_expression): A store to a union member
2040 erases a previous store to another member.
2042 PR c++/71285 - member of fold-expression
2043 * semantics.c (finish_unary_fold_expr)
2044 (finish_binary_fold_expr): Use null type for fold-expressions.
2046 PR c++/79401 - protected inherited constructor
2047 * call.c (enforce_access): For inheriting constructor, find a base
2048 binfo in the path we already have.
2050 2017-02-10 Marek Polacek <polacek@redhat.com>
2053 * pt.c (type_dependent_expression_p): Check if the expression type
2057 * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
2058 if warnings shouldn't be given.
2060 2017-02-10 Paolo Carlini <paolo.carlini@oracle.com>
2063 * pt.c (tsubst_decl): Don't try to preserve a typedef that names
2064 an error_mark_node as type.
2066 2017-02-09 Jakub Jelinek <jakub@redhat.com>
2067 Jason Merrill <jason@redhat.com>
2070 * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
2071 from pattern to type.
2073 2017-02-09 Jason Merrill <jason@redhat.com>
2075 PR c++/79316 - default argument in deduction guide
2076 PR c++/79350 - explicit deduction guide
2077 * parser.c (cp_parser_constructor_declarator_p)
2078 (cp_parser_direct_declarator): Parse deduction guides more like
2080 * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
2081 * tree.c (special_function_p): Return it.
2082 * decl.c (check_special_function_return_type): Handle it.
2083 (grokdeclarator, grokfndecl): Adjust.
2084 (cp_finish_decl): Pass flags to do_auto_deduction.
2085 * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
2086 * pt.c (dguide_name_p): Take a const_tree.
2087 (do_class_deduction): Handle explicit.
2088 (do_auto_deduction): Pass flags through.
2089 (build_deduction_guide): Copy explicit flag.
2091 2017-02-09 Jakub Jelinek <jakub@redhat.com>
2094 * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
2095 non-pragma_compound context here.
2096 (cp_parser_omp_target): Likewise.
2097 (cp_parser_pragma): Don't call push_omp_privatization_clauses and
2098 parsing for ordered and target omp pragmas in non-pragma_stmt
2099 non-pragma_compound contexts.
2102 * parser.c (cp_parser_oacc_declare): Formatting fix.
2103 (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
2104 automatic variables.
2106 2016-02-09 Nathan Sidwell <nathan@codesourcery.com>
2107 Chung-Lin Tang <cltang@codesourcery.com>
2109 * parser.c (cp_parser_oacc_clause_tile): Disallow collapse. Fix
2110 parsing. Parse constant expression. Remove semantic checking.
2111 (cp_parser_omp_clause_collapse): Disallow tile.
2112 (cp_parser_omp_for_loop): Deal with tile clause. Don't emit a parse
2113 error about missing for after already emitting one. Use more
2114 conventional for idiom for unbounded loop.
2115 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
2116 * semantics.c (finish_omp_clauses): Correct TILE semantic check.
2117 (finish_omp_for): Deal with tile clause.
2119 2017-02-07 Nathan Sidwell <nathan@acm.org>
2121 * method.c (synthesized_method_base_walk): New. Broken out of ...
2122 (synthesized_method_walk): ... here. Call it. Cleanup
2125 2017-02-07 Patrick Palka <ppalka@gcc.gnu.org>
2128 * typeck2.c (process_init_constructor_union): Consider only
2129 FIELD_DECLs when looking for an NSDMI.
2131 2017-02-06 Jason Merrill <jason@redhat.com>
2133 PR c++/71193 - incomplete types in templates
2134 * parser.c (cp_parser_postfix_dot_deref_expression): In a template
2135 handle incomplete type by pedwarning and then treating as dependent.
2137 2017-02-06 Jakub Jelinek <jakub@redhat.com>
2140 * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
2141 (potential_constant_expression_1): Likewise.
2144 * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
2145 allow one fewer than expected arguments if flag_permissive.
2148 * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
2149 * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
2150 with error_mark_node type.
2152 2017-02-03 Jason Merrill <jason@redhat.com>
2154 PR c++/78689 - ICE on constructor with label
2155 * optimize.c (maybe_clone_body): Replace omitted parameters with
2157 * class.c (build_clone): Fix logic for omitting inherited parms.
2159 PR c++/12245 - excessive memory use
2160 * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
2161 back in. Don't cache constants.
2162 (maybe_constant_init): Don't cache constants.
2164 PR c++/79294 - ICE with invalid template argument
2165 * pt.c (convert_nontype_argument_function): Check value-dependence.
2166 (convert_nontype_argument): Don't check it here for function ptrs.
2168 2017-02-02 Richard Biener <rguenther@suse.de>
2171 * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
2172 it lazily on the first changed element only and copy it
2173 fully upfront, only storing changed elements.
2175 2017-02-02 Paolo Carlini <paolo.carlini@oracle.com>
2178 * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
2181 2017-01-31 Jakub Jelinek <jakub@redhat.com>
2184 * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
2187 2017-01-31 David Malcolm <dmalcolm@redhat.com>
2190 * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
2191 any namespace aliases.
2193 2017-01-31 Nathan Sidwell <nathan@acm.org>
2196 * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
2200 * pt.c: (instantiate_decl): Push to top level when current
2201 function scope doesn't match. Only push lmabda scope stack when
2204 * cp-tree.h (instantiate_decl): Make defer_ok bool.
2205 * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
2206 (instantiate_decl): Simplify and reorder state saving and restoration.
2209 * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
2210 * semantics.c (finish_member_declaration): Assert class is being
2213 2017-01-30 Alexandre Oliva <aoliva@redhat.com>
2215 Introduce C++ support in libcc1.
2216 * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
2217 (ansi_opname): Rename to...
2218 (cp_operator_id): ... this. Adjust all callers.
2219 (ansi_assopname): Rename to...
2220 (cp_assignment_operator_id): ... this. Adjust all callers.
2221 (cp_literal_operator_id): Declare.
2222 (set_global_friend): Declare.
2223 (is_global_friend): Declare.
2224 (enum cp_oracle_request): New type.
2225 (cp_binding_oracle_function): New type.
2226 (cp_binding_oracle): Declare.
2227 (cp_finish_injected_record_type): Declare.
2228 * friend.c (global_friend): New var.
2229 (set_global_friend): New fn.
2230 (is_global_friend): New fn.
2231 (is_friend): Call is_global_friend.
2232 * name-lookup.c (cp_binding_oracle): New var.
2233 (query_oracle): New fn.
2234 (qualified_lookup_using_namespace): Call query_oracle.
2235 (lookup_name_real_1): Likewise.
2236 * parser.c (cp_literal_operator_id): Drop static.
2237 * search.c (friend_accessible_p): Call is_global_friend.
2238 * semantics.c (is_this_parameter): Accept a variable if the
2239 binding oracle is enabled.
2241 2017-01-27 Jason Merrill <jason@redhat.com>
2243 PR c++/78771 - ICE with inherited constructor.
2244 * call.c (build_over_call): Call deduce_inheriting_ctor here.
2245 * pt.c (tsubst_decl): Not here.
2246 * class.c (add_method): Or here.
2247 * method.c (deduce_inheriting_ctor): Handle clones.
2248 (implicitly_declare_fn): Don't deduce inheriting ctors yet.
2250 2017-01-27 Adam Butcher <adam@jessamine.co.uk>
2253 * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
2255 * cp/cp-tree.h: Declare it.
2256 * cp/semantics.c (finish_id_expression): Resolve names within a default
2257 capturing generic lambda defined within a template prior to
2258 instantiation to allow for captures to be added to the closure type.
2260 2017-01-26 Jakub Jelinek <jakub@redhat.com>
2263 * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
2264 * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
2265 * parser.c (cp_parser_builtin_offsetof): Pass result of
2266 build_static_cast of null_pointer_node to finish_offsetof.
2267 * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
2268 it for -Winvalid-offsetof pedwarn instead of trying to guess
2269 original offsetof type from EXPR. Save OBJECT_PTR as a new
2270 second operand to OFFSETOF_EXPR.
2271 * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
2272 finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
2275 2017-01-26 Jason Merrill <jason@redhat.com>
2277 * name-lookup.c (parse_using_directive): Deprecate strong using.
2279 PR c++/79176 - lambda ICE with -flto -Os
2280 * decl2.c (vague_linkage_p): Handle decloned 'tors.
2281 * tree.c (decl_linkage): Likewise.
2283 2017-01-25 Martin Sebor <msebor@redhat.com>
2285 * decl.c (grokdeclarator): Fix a typo in a comment.
2287 2017-01-25 Jakub Jelinek <jakub@redhat.com>
2290 * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
2294 * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
2295 OPT_Wpedantic on lambda templates for -std=c++14 and higher.
2297 2017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
2300 * decl.c (cxx_init_decl_processing): Pass main_input_filename
2301 to build_translation_unit_decl.
2303 2017-01-24 Jakub Jelinek <jakub@redhat.com>
2306 * cp-gimplify.c (cp_genericize_r): Add result of
2307 convert_from_reference on invisiref parm to p_set.
2309 2017-01-24 Nathan Sidwell <nathan@acm.org>
2311 PR c++/78469 - defaulted ctor and inaccessible dtor
2312 * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
2313 * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
2314 * tree.c (build_target_expr): Check tf_no_cleanup.
2316 PR c++/79118 - anon-members and constexpr
2317 * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
2318 ctor decl. Recursively check anonymous members.
2319 (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
2321 (explain_invalid_constexpr_fn): Likewise.
2323 2017-01-23 Nathan Sidwell <nathan@acm.org>
2325 PR c++/71710 - template using directive of field
2326 * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
2329 PR c++/71406 - ICE with scope-ref'd template id exprs
2331 * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
2332 before breaking up TEMPLATE_ID_EXPR.
2334 2017-01-20 Nathan Sidwell <nathan@acm.org>
2336 PR c++/78495 - wrong code inherited ctor and invisi-ref parm
2337 * cp-gimplify.c (cp_generize_r): Don't skip thunks.
2339 2017-01-20 David Malcolm <dmalcolm@redhat.com>
2343 * cp-tree.h (suggest_alternatives_for): Add bool param.
2344 (suggest_alternative_in_explicit_scope): New decl.
2345 * error.c (qualified_name_lookup_error): When SCOPE is a namespace
2346 that isn't the global one, call new function
2347 suggest_alternative_in_explicit_scope, only calling
2348 suggest_alternatives_for if it fails, and disabling near match
2349 searches fort that case. When SCOPE is the global namespace,
2350 pass true for new param to suggest_alternatives_for to allow for
2352 * lex.c (unqualified_name_lookup_error): Pass true for new param
2353 to suggest_alternatives_for.
2354 * name-lookup.c (consider_binding_level): Add forward decl.
2355 (suggest_alternatives_for): Add "suggest_misspellings" param,
2356 using it to conditionalize the fuzzy name-lookup code.
2357 (suggest_alternative_in_explicit_scope): New function.
2358 * parser.c (cp_parser_primary_expression): When calling
2359 finish_id_expression, pass location of id_expression rather
2360 than that of id_expr_token.
2361 (cp_parser_id_expression): Convert local "unqualified_id" from
2362 tree to cp_expr to avoid implicitly dropping location information.
2364 2017-01-20 Marek Polacek <polacek@redhat.com>
2367 * call.c (build_conditional_expr_1): Warn about duplicated branches.
2368 * semantics.c (finish_expr_stmt): Build statement using the proper
2371 2017-01-19 Jason Merrill <jason@redhat.com>
2373 US 20 - forwarding references and class template argument deduction
2374 * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
2375 * pt.c (push_template_decl_real): Set it.
2376 (maybe_adjust_types_for_deduction): Check it.
2377 (rewrite_template_parm): Copy it.
2379 US 19 - deduction guides and constructors
2380 * call.c (joust): Prefer deduction guides to constructors.
2381 * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
2382 (deduction_guide_p): Check DECL_P.
2384 * decl.c (check_initializer): Always use build_aggr_init for array
2387 PR c++/79130 - decomposition and direct-initialization
2388 * init.c (build_aggr_init): Communicate direct-initialization to
2390 (build_vec_init): Check for array copy sooner.
2391 * parser.c (cp_parser_decomposition_declaration): Remove call to
2392 build_x_compound_expr_from_list.
2394 2017-01-18 Jason Merrill <jason@redhat.com>
2396 PR c++/68666 - member variable template-id
2397 * typeck.c (finish_class_member_access_expr): Handle variable
2399 * pt.c (lookup_and_finish_template_variable): No longer static.
2400 * cp-tree.h: Declare it.
2402 2017-01-18 Nathan Sidwell <nathan@acm.org>
2405 * call.c (build_over_call): When checking ellipsis conversions for
2406 an inherited ctor, make sure there is at least one conversion.
2408 2017-01-18 Jason Merrill <jason@redhat.com>
2410 PR c++/78894 - ICE with class deduction and default arg
2411 * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
2413 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
2416 * mangle.c (write_discriminator): Reorganize abi warning check.
2418 2017-01-18 Nathan Sidwell <nathan@acm.org>
2420 * cp-tree.h: Clarify exception spec node comment.
2421 * except.c (nothrow_spec_p): Simplify by checking node-equality.
2424 * mangle.c (write_exception_spec): Check nothrow explicitly.
2425 (write_encoding): Don't increment processing_template_decl around
2428 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
2431 * mangle.c (write_template_args): Add "on" for operator names.
2433 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
2436 * mangle.c (write_discriminator): Handle discriminator >= 10.
2438 2017-01-17 Nathan Sidwell <nathan@acm.org>
2441 * cp-tree.h (maybe_generic_this_capture): Declare.
2442 * lambda.c (resolvable_dummy_lambda): New, broken out of ...
2443 (maybe_resolve_dummy): ... here. Call it.
2444 (maybe_generic_this_capture): New.
2445 * parser.c (cp_parser_postfix_expression): Speculatively capture
2446 this in generic lambda in unresolved member function call.
2447 * pt.c (tsubst_copy_and_build): Force hard error from failed
2448 member function lookup in generic lambda.
2450 2017-01-17 Aldy Hernandez <aldyh@redhat.com>
2453 * cp-array-notation.c (expand_array_notation_exprs): Handle
2456 2017-01-11 Jason Merrill <jason@redhat.com>
2458 PR c++/78337 - ICE on invalid with generic lambda
2459 * semantics.c (process_outer_var_ref): Check if containing_function
2460 is null. Move inform call under complain test.
2462 2017-01-11 Nathan Sidwell <nathan@acm.org>
2465 * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
2468 2017-01-11 Nathan Sidwell <nathan@acm.org>
2470 * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
2472 2017-01-11 Jakub Jelinek <jakub@redhat.com>
2475 * parser.c (cp_parser_std_attribute_spec): Remove over-eager
2476 assertion. Formatting fix.
2479 * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
2482 2017-01-10 David Malcolm <dmalcolm@redhat.com>
2485 * parser.c (cp_parser_class_specifier_1): Only suggest inserting
2486 a missing semicolon if we have a valid insertion location for
2489 2017-01-10 Jason Merrill <jason@redhat.com>
2491 FI 20, decomposition declaration with parenthesized initializer.
2492 * parser.c (cp_parser_decomposition_declaration): Use
2493 cp_parser_initializer.
2495 2017-01-09 Jason Merrill <jason@redhat.com>
2497 Implement P0195R2, C++17 variadic using.
2498 * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
2499 * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
2500 * error.c (dump_decl): Likewise.
2502 2017-01-09 Jakub Jelinek <jakub@redhat.com>
2504 PR translation/79019
2505 PR translation/79020
2506 * semantics.c (finish_omp_clauses): Add missing whitespace to
2507 translatable strings.
2508 * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
2510 2017-01-07 Jason Merrill <jason@redhat.com>
2512 PR c++/78948 - instantiation from discarded statement
2513 * parser.h (struct cp_parser): Remove in_discarded_stmt field.
2514 * cp-tree.h (in_discarded_stmt): Declare it.
2515 (struct saved_scope): Add discarded_stmt bitfield.
2516 (in_discarded_stmt): New macro.
2517 * decl2.c (mark_used): Check it.
2518 * parser.c (cp_parser_selection_statement): Adjust.
2519 (cp_parser_jump_statement): Adjust.
2521 2017-01-05 Jakub Jelinek <jakub@redhat.com>
2524 * decl.c (cp_finish_decomp): Remove probe variable, if tt is
2525 REFERENCE_REF_P, set tt to its operand.
2528 * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
2529 unions even for C++11 and later.
2531 2017-01-05 Nathan Sidwell <nathan@acm.org>
2534 * pt.c (convert_nontype_argument): Don't try and see if integral
2535 or enum expressions are constants prematurely.
2537 2017-01-04 Marek Polacek <polacek@redhat.com>
2540 * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
2541 a zero character literal.
2543 2017-01-04 Jakub Jelinek <jakub@redhat.com>
2546 * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
2550 * parser.c (cp_parser_simple_declaration): Only complain about
2551 inconsistent auto deduction if auto_result doesn't use auto.
2553 * parser.c (cp_parser_simple_declaration): Diagnose function
2554 declaration among more than one init-declarators with auto
2558 * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
2559 assertion, as lexer->buffer may be NULL.
2561 2017-01-04 Marek Polacek <polacek@redhat.com>
2565 * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
2567 2017-01-04 Nathan Sidwell <nathan@acm.org>
2570 * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
2571 (lambda_capture_field_type): Update prototype.
2572 * lambda.c (lambda_capture_field_type): Add is_reference parm.
2573 Add referenceness here.
2574 (add_capture): Adjust lambda_capture_field_type call, refactor
2576 * pt.c (tsubst): Adjust lambda_capture_field_type call.
2578 2017-01-01 Jakub Jelinek <jakub@redhat.com>
2580 Update copyright years.
2582 Copyright (C) 2017 Free Software Foundation, Inc.
2584 Copying and distribution of this file, with or without modification,
2585 are permitted in any medium without royalty provided the copyright
2586 notice and this notice are preserved.