1 2017-06-07 Jonathan Wakely <jwakely@redhat.com>
4 * pt.c (do_class_deduction): Build qualified type.
6 2017-06-06 Nathan Sidwell <nathan@acm.org>
8 * name-lookup.c (suggest_alternatives_for): Use qualified lookup
9 sans using directives. Don't walk into inline namespaces.
12 * name-lookup.c (adl_class_only): Don't add visible friends.
14 2017-06-05 Volker Reichelt <v.reichelt@netcologne.de>
16 * parser.c (cp_parser_base_specifier): Fix typos in error messages.
18 2017-06-02 Nathan Sidwell <nathan@acm.org>
20 Remove lang_type_ptrmem.
21 * cp-tree.h (lang_type_header): Remove is_lang_type_class. Move
23 (lang_type_class): ... this. Reorder bitfields. Rename to ...
24 (lang_type): ... this. Delete old definition.
25 (lang_type_ptrmem): Delete.
26 (LANG_TYPE_CLASS_CHECK): Simply get TYPE_LANG_SPECIFIC. Adjust uses.
27 (LANG_TYPE_PTRMEM_CHECK): Delete.
28 (TYPE_GET_PTRMEMFUNC_TYPE, TYPE_SET_PTRMEMFUNC_TYPE): Delete.
29 (TYPE_PTRMEMFUNC_TYPE): New. Use TYPE_LANG_SLOT_1.
30 * decl.c (build_ptrmemfunc_type): Adjust.
31 * lex.c (copy_lang_type): Remove lang_type_ptrmem handling.
32 (maybe_add_lang_type_raw): Don't set u.c.h.is_lang_type_class.
34 * class.c (check_bases_and_members): Adjust vec_new_uses_cookie
37 Remove cp_binding_level::namespaces
38 * name-lookup.h (cp_binding_level): Lose namespaces field.
39 * name-lookup.c (add_decl_to_level): Chain namespaces on the names
41 (suggest_alternatives_for): Adjust for namespace list. Do
43 * decl2.c (collect_source_refs): Namespaces are on the regulr
45 (collect_ada_namespace): Likewise.
47 2017-06-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
49 * typeck.c (cp_build_binary_op): Implement the -Wsizeof_pointer_div
52 2017-06-01 Ville Voutilainen <ville.voutilainen@gmail.com>
55 * method.c (constructible_expr): Strip array types before calling
58 2017-06-01 Paolo Carlini <paolo.carlini@oracle.com>
61 * cvt.c (convert_to_void): Possibly call maybe_warn_nodiscard
62 for case INDIRECT_REF too in the main switch.
64 2017-05-31 Jason Merrill <jason@redhat.com>
66 PR c++/80840 - ICE with constexpr and reference
67 * pt.c (convert_nontype_argument): Don't test whether a decl is
68 value-dependent when binding to a reference.
70 2017-05-31 Nathan Sidwell <nathan@acm.org>
72 * cp-tree.h (lang_decl_slector): New enum.
73 (lang_decl_base): Make selector an enum. Drop decomposition_p
75 (lang_decl): Use enum for discrimination.
76 (LANG_DECL_FN_CHECK, LANG_DECL_NS_CHECK, LANG_DECL_PARM_CHECK,
77 LANG_DECL_DEOMP_CHECK): Use enum.
78 (DECL_DECOMPOSITION_P): Use selector value.
79 (SET_DECL_DECOMPOSITION_P): Delete.
80 (retrofit_lang_decl): Lose SEL parm.
81 (fit_decomposition_lang_decl): Declare.
82 * decl.c (cp_finish_decomp, grokdeclarator): Use
83 fit_decomposition_lang_decl.
84 * lex.c (maybe_add_lang_decl_raw): New. Broken out of
86 (set_decl_linkage): New. Broken out of retrofit_lang_decl. Use enum.
87 (fit_decomposition_lang_decl): Likewise.
88 (retrofit_lang_decl): Use worker functions.
89 (cxx_dup_lang_specific_decl): Use selector enum.
90 (maybe_add_lang_type_raw): New. Broken out of ...
91 (cxx_make_type_name): ... here. Call it.
93 2017-05-30 Jason Merrill <jason@redhat.com>
95 PR c++/80856 - ICE with local extern in template
96 * semantics.c (finish_call_expr): Replace a local extern overload
97 set in a template with the IDENTIFIER_NODE.
99 2017-05-30 David Malcolm <dmalcolm@redhat.com>
101 * call.c (perform_implicit_conversion_flags): Convert
102 "from %qT to %qT" to "from %qH to %qI" in diagnostic.
103 (print_conversion_rejection): Replace pairs of %qT with
104 %qH and %qI in various places.
105 (build_user_type_conversion_1): Likewise.
106 (build_integral_nontype_arg_conv): Likewise.
107 (build_conditional_expr_1): Likewise.
108 (convert_like_real): Likewise.
109 (convert_arg_to_ellipsis): Likewise.
111 (initialize_reference): Likewise.
112 * cvt.c (cp_convert_to_pointer): Likewise.
113 (cp_convert_to_pointer): Likewise.
114 (convert_to_reference): Likewise.
115 (ocp_convert): Likewise.
116 * error.c (cp_printer): Gain bool and const char ** parameters.
117 (struct deferred_printed_type): New struct.
118 (class cxx_format_postprocessor): New class.
119 (cxx_initialize_diagnostics): Wire up a cxx_format_postprocessor
120 to pp->m_format_postprocessor.
121 (comparable_template_types_p): New function.
122 (newline_and_indent): New function.
123 (arg_to_string): New function.
124 (print_nonequal_arg): New function.
125 (print_template_differences): New function.
126 (type_to_string_with_compare): New function.
127 (print_template_tree_comparison): New function.
128 (append_formatted_chunk): New function.
129 (add_quotes): New function.
130 (cxx_format_postprocessor::handle): New function.
131 (defer_phase_2_of_type_diff): New function.
132 (cp_printer): Add "quoted" and "buffer_ptr" params. Implement
134 * typeck.c (cp_build_binary_op): Replace pairs of %qT with
135 %qH and %qI in various places.
136 (convert_member_func_to_ptr): Likewise.
137 (build_reinterpret_cast_1): Likewise.
138 (convert_for_assignment): Likewise.
139 * typeck2.c (check_narrowing): Likewise.
141 2017-05-30 Nathan Sidwell <nathan@acm.org>
143 Kill IDENTIFIER_NAMESPACE_BINDINGS
144 * cp-tree.h (lang_identifier): Delete namespace_bindings.
145 (IDENTIFIER_NAMESPACE_BINDINGS): Delete.
146 (lang_decl_ns): Add bindings.
147 (DECL_NAMESPACE_BINDINGS): New.
148 * lex.c (retrofit_lang_decl): Create namespace hash table.
149 * name-lookup.c (find_namespace_slot): Change to use hash-map.
150 * ptree.c (cxx_print_binding): Delete.
151 (cxx_print_identifier): Remove NAMESPACE_BINDING printing.
153 * cp-tree.def (OVERLOAD): Fix comment.
154 * cp-tree.h: Fix comments and whitespace.
155 * error.c (dump_decl): Use pp_cxx_colon_colon, ovl_scope.
156 * name-lookup.c (add_decl_to_level): Assert not class.
157 (check_local_shadow): Use OVL_P.
158 (pushdecl_with_scope_1): Rename to ...
159 (do_pushdecl_with_Scope): ... here.
160 (do_nonmember_using_decl): Use qualified_namespace_lookup return
162 (push_class_level_binding_1): Use OVL_P.
163 (pushdecl_namespace_level): Use do_pushdecl_with_scope.
164 (pushtag_1): Rename to ...
165 (do_pushtag): ... here. Adjust do_pushdecl_with_scope call.
167 (store_class_bindings): Do not time here.
168 * name-lookup.h (pushdecl_outermost_localscope): Reorder.
169 * pt.c (listify): Declare argvec at point of initialization.
172 * name-lookup.c (add_decl_to_level): Assert not making a circular
174 (update_binding): Don't prematurely slide artificial decl.
176 2017-05-29 Alexandre Oliva <aoliva@redhat.com>
178 * cp-tree.h (lang_identifier): Drop oracle_looked_up, unused.
180 2017-05-29 Nathan Sidwell <nathan@acm.org>
183 * cp-tree.h (lookup_maybe_add): Add DEDUPING argument.
184 * name-lookup.c (name_lookup): Add deduping field.
185 (name_lookup::preserve_state, name_lookup::restore_state): Deal
187 (name_lookup::add_overload): New.
188 (name_lookup::add_value, name_lookup::add_fns): Call add_overload.
189 (name_lookup::search_adl): Set deduping. Don't unmark here.
190 * pt.c (most_specialized_instantiation): Revert previous change,
191 Assert not given duplicates.
192 * tree.c (lookup_mark): Just mark the underlying decls.
193 (lookup_maybe_add): Dedup using marked decls.
196 * ptree.c (cxx_print_xnode): Show internal OVERLOAD structure.
197 * tree.c (ovl_insert, ovl_iterator_remove_node): Fix copying assert.
199 Stat hack representation
200 * name-lookup.c (STAT_HACK_P, STAT_TYPE, STAT_DECL,
201 MAYBE_STAT_DECL, MAYBE_STAT_TYPE): New.
203 (find_namespace_binding): Replace with ...
204 (find_namespace_slot): ... this.
205 (find_namespace_value): New.
206 (name_lookup::search_namespace_only,
207 name_lookup::adl_namespace_only): Adjust.
208 (update_binding): Add SLOT parameter, adjust.
209 (check_local_shadow): Use find_namespace_value.
210 (set_local_extern_decl_linkage): Likewise.
211 (do_pushdecl): Adjust for namespace slot.
212 (push_local_binding): Assert not a namespace binding.
213 (check_for_out_of_scope_variable): Use find_namespace_value.
214 (set_identifier_type_value_with_scope): Likewise.
215 (get_namespace_binding): Likewise.
216 (set_namespace_binding): Delete.
217 (set_global_binding): Directly update the binding.
218 (finish_namespace_using_decl): Likewise.
219 (lookup_type_scope_1): Use find_namespace_slot and update.
220 (do_push_nested_namespace): Use find_namespace_value.
223 * pt.c (most_specialized_instantiation): Cope with duplicate
227 * cp-tree.h (build_min_nt_call_vec): Declare.
228 * decl.c (build_offset_ref_call_from_tree): Call it.
229 * parser.c (cp_parser_postfix_expression): Likewise.
230 * pt.c (tsubst_copy_and_build): Likewise.
231 * semantics.c (finish_call_expr): Likewise.
232 * tree.c (build_min_nt_loc): Keep unresolved lookups.
233 (build_min): Likewise.
234 (build_min_non_dep): Likewise.
235 (build_min_non_dep_call_vec): Likewise.
236 (build_min_nt_call_vec): New.
239 * tree.c (ovl_copy): Adjust assert, copy OVL_LOOKUP.
241 (lookup_keep): Call it.
243 2017-05-26 Nathan Sidwell <nathan@acm.org>
246 * name-lookup.c (push_inline_namespaces): New.
247 (push_namespace): Look inside inline namespaces.
249 Inline and using namespace representation change.
250 * cp-tree.h (struct lang_decl_ns): Delete ns_using. Add usings,
252 (DECL_NAMESPACE_USING): Adjust.
253 (DECL_NAMESPACE_INLINEES): New.
254 * name-lookup.h (struct cp_binding_level): Change usings
256 * name-lookup.c (name_lookup::do_queue_usings,
257 name_lookup::queue_usings): Adjust.
258 (name_lookup::search_namespace, name_lookup::search_usings,
259 name_lookup::queue_namespace): Adjust.
260 (name_lookup::adl_namespace_only): Adjust.
261 (add_using_namespace, push_namespace): Push onto vector.
262 (pop_namespace): Add timing logic.
264 * call.c (build_operator_new_call): Do namelookup and ADL here.
265 (build_new_op_1): Likewise.
266 * name-lookup.h (lookup_function_nonclass): Delete declaration.
267 (do_using_directive): Likewise.
268 * name-lookup.c (set_namespace_binding, push_local_binding): Don't
270 (struct scope_binding): Delete.
271 (EMPTY_SCOPE_BINDING): Delete.
272 (set_decl_namespace): Use OVL_P.
273 (finish_local_using_decl): Lose unnecesary checks.
274 (lookup_function_nonclass): Delete.
275 (cp_emit_debug_info_for_using): Use MAYBE_BASELINK_P.
277 * cp-tree.h (OVL_CHAIN): Check looking at OVERLOAD.
278 (ovl_iterator): Add allow_inner field. Adjust ctor. Make
280 (ovl_iterator::maybe_push, ovl_iterator::pop): New.
281 (lkp_iterator): Add outer field. Adjust ctor.
282 (lkp_iterator::operator++): New.
283 (lookup_mark, lookup_maybe_add): Declare.
284 * name-lookup.c (name_lookup): Delete fn_set member.
285 (name_lookup::preserve_state, name_lookup::restore_state): Unmark
287 (name_lookup::add_value): Use lookup_add directly.
288 (name_lookup::add_fns: Use lookup_maybe_add.
289 (name_lookup::search_adl): Mark and unmark fns.
291 * pt.c (check_explicit_specialization): Use lookup_add directly.
292 * ptree.c (cxx_print_xnode): Show complete overload structure.
293 * tree.c (lookup_mark, lookup_maybe_add): New.
295 * name-lookup.c (name_lookup::search_adl): ADL OMP UDR type args.
297 2017-05-26 Jakub Jelinek <jakub@redhat.com>
299 * cp-tree.h (struct lang_decl_decomp): New type.
300 (struct lang_decl): Add u.decomp.
301 (LANG_DECL_DECOMP_CHECK): Define.
302 (DECL_DECOMPOSITION_P): Note it is set also on the vars
303 for user identifiers.
304 (DECL_DECOMP_BASE): Define.
305 (retrofit_lang_decl): Add extra int = 0 argument.
306 * lex.c (retrofit_lang_decl): Add SEL argument, if non-zero
307 use it to influence the selector choices and for selector
308 0 to non-zero transition copy old content.
309 (cxx_dup_lang_specific_decl): Handle DECL_DECOMPOSITION_P.
310 * decl.c (poplevel): For DECL_DECOMPOSITION_P, check
311 !DECL_DECOMP_BASE instead of !DECL_VALUE_EXPR. Adjust warning
312 wording if decl is a structured binding.
313 (cp_finish_decomp): Pass 4 as the new argument to retrofit_lang_decl.
314 Set DECL_DECOMP_BASE. Ignore DECL_READ_P sets from initialization
315 of individual variables for tuple structured bindings.
316 (grokdeclarator): Pass 4 as the new argument to retrofit_lang_decl.
317 Clear DECL_DECOMP_BASE.
318 * decl2.c (mark_used): Mark DECL_DECOMP_BASE TREE_USED as well.
319 * pt.c (tsubst_decomp_names): Assert DECL_DECOMP_BASE matches what
321 * expr.c (mark_exp_read): Recurse on DECL_DECOMP_BASE instead of
324 2017-05-25 Jason Merrill <jason@redhat.com>
326 PR c++/80605 - __is_standard_layout and zero-length array
327 * class.c (check_bases): Use DECL_FIELD_IS_BASE.
329 2017-05-25 Nathan Sidwell <nathan@acm.org>
331 Kill OVL_CURRENT, OVL_NEXT.
332 * cp-tree.h (OVL_CURRENT, OVL_NEXT): Delete.
333 * name-lookup.c (set_decl_namespace): Use ovl_iterator.
334 (consider_binding_level): Use OVL_FIRST.
335 (cp_emit_debug_info_for_using): Use lkp_iterator.
336 * pt.c (check_explicit_specialization): Use ovl_iterator.
338 Kill DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS.
339 * cp-tree.h (lang_decl_ns): Remove ns_users field.
340 (DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS): Delete.
341 (TREE_INDIRECT_USING): Delete.
342 * name-lookup.h (is_associated_namespace): Delete.
343 * name-lookup.c (name_lookup::search_usings,
344 name_lookup::do_queue_usings): Usings are always direct.
345 (is_associated_namespace): Delete.
346 (handle_namespace_attrs): Use DECL_NAMESPACE_INLINE_P.
347 (namespace_ancestor_1, namespace_ancestor): Delete.
348 (push_using_directive_1, push_using_directive): Delete.
349 (add_using_namespace_1): Delete.
350 (add_using_namespace): Reimplement.
351 (emit_debug_info_using_namespace): New.
352 (finish_namespace_using_directive, finish_local_using_directive,
353 push_namespace): Adjust.
354 * tree.c (cp_free_lang_data): Remove DECL_NAMESPACE_USERS handling.
356 2017-05-25 Volker Reichelt <v.reichelt@netcologne.de>
358 * semantics.c (finish_handler_parms): Warn about non-reference type
361 2017-05-25 Nathan Sidwell <nathan@acm.org>
363 Reimplement unqualified namespace lookup.
364 * name-lookup.c (name_lookup::using_pair,
365 name_lookup::using_queue): New typedefs.
366 (name_lookup::queue_namespace, name_lookup::do_queue_usings,
367 name_lookup::queue_usings): New.
368 (name_lookup::search_unqualified): New.
369 (merge_functions, same_entity_p, ambiguous_decl,
370 unqualified_namespace_lookup_1, unqualified_namespace_lookup,
371 lookup_using_namespace): Delete.
372 (lookup_name_real_1): Adjust.
374 Reimplement qualified namespace lookup.
375 * name-lookup.c (name_lookup::flags): New member. Adjust ctor.
376 (name_lookup::ambiguous, name_lookup::add_value,
377 name_lookup::add_type, name_lookup::process_binding): New.
378 (name_lookup::search_namespace_only,
379 name_lookup::search_namespace, name_lookup::search_usings): New.
380 (name_lookup::search_qualified): New.
381 (do_nonmember_using_decl, suggest_alternatives_for,
382 lookup_qualified_name): Adjust.
383 (tree_vec_contains): Delete.
384 (qualified_lookup_using_namespace): Rename to ...
385 (qualified_namespace_lookup): ... here. Reimplement.
388 * cp-tree.h (LOOKUP_SEEN_P, LOOKUP_FOUND_P): New.
389 * name-lookup.h (lookup_arg_dependent): Return plain tree.
390 * name-lookup.c (arg_lookup, arg_assoc, arg_assoc_args,
391 arg_assoc_args_vec, arg_assoc_type, add_function,
392 arg_assoc_namespace, arg_assoc_class_only, arg_assoc_bases,
393 arg_assoc_class, arg_assoc_template_arg, arg_assoc,
394 lookup_arg_dependent_1): Delete.
395 (name_lookup): New lookup object.
396 (name_lookup::preserve_state, name_lookup::restore_state,
397 name_lookup::mark_seen, name_lookup::find_and_mark,
398 name_lookup::add_fns, name_lookup::adl_namespace_only,
399 name_lookup::adl_namespace, name_lookup::adl_class_only,
400 name_lookup::adl_bases, name_lookup::adl_class,
401 name_lookup::adl_expr, name_lookup::adl_type,
402 name_lookup::adl_template_arg, name_lookup::search_adl): New.
403 (lookup_arg_dependent): Return a plain tree. Adjust.
404 (is_associated_namespace): Move later.
406 2017-05-24 Nathan Sidwell <nathan@acm.org>
408 * friend.c (do_friend): Remove check for existing decl.
409 * name-lookup.h (lookup_name_innermost_nonclass_level): Delete.
410 * name-lookup.c (push_local_binding): Directly look for binding.
411 (lookup_name_innermost_nonclass_level_1): Delete.
412 (lookup_name_innermost_nonclass_level): Delete.
414 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Alphabetize.
416 * cp-tree.h (cp_free_lang_data): Add extern.
417 (ovl_skip_hidden, is_overloaded_fn, really_overloaded_fn): Add
419 (type_unknown_p): Return bool, make inline, lose TREE_LIST check.
420 * typeck.c (type_unknown_p): Delete.
421 * tree.c (is_overloaded_fn): Use MAYBE_BASELINE_FUNCTIONS, adjust
423 (dependent_name): Likewise.
424 (decl_anon_ns_mem_p): Simplify.
426 2017-05-24 Jonathan Wakely <jwakely@redhat.com>
429 * tree.c (reshape_init): Use unqualified type for direct enum init.
430 * typeck.c (maybe_warn_about_cast_ignoring_quals): New.
431 (build_static_cast_1, build_reinterpret_cast_1): Strip cv-quals from
432 non-class destination types.
433 (build_const_cast_1): Strip cv-quals from destination types.
434 (build_static_cast, build_reinterpret_cast, build_const_cast)
435 (cp_build_c_cast): Add calls to maybe_warn_about_cast_ignoring_quals.
437 2017-05-24 Martin Sebor <msebor@redhat.com>
440 * call.c (fully_fold_internal): Adjust.
442 2017-05-24 Nathan Sidwell <nathan@acm.org>
444 * cp-tree.h (ovl_skip_hidden): Declare.
445 * tree.c (ovl_skip_hidden): New.
446 * name-lookup.c (arg_assoc_namespace): Call ovl_skip_hidden.
447 (lookup_arg_dependent_1): Likewise.
448 (ambiguous_decl): Use DECL_HIDDEN_P, ovl_skip_hidden.
449 (hidden_name_p, remove_hidden_names): Delete.
450 (lookup_name_real_1): Do not strip hidden names.
451 * name-lookup.h (hidden_name_p, remove_hidden_names): Delete.
453 * cp-tree.h (OVL_HIDDEN_P): New.
454 (ovl_iterator::hidden_p, ovl_iterator::reveal_node): New.
455 (ovl_iterator::reveal_node): Declare.
456 * tree.c (ovl_copy): Copy OVL_HIDDEN_P.
457 (ovl_insert): Order on hiddenness.
458 (ovl_iterator::reveal_node): New.
459 * name-lookup.c (anticipated_builtin_p): New.
460 (supplement_binding_1): Use it.
461 (set_local_extern_decl_linkage): Use hidden_p.
462 (do_pushdecl): Deal with unhiding a hidden decl, use
463 anticipated_builtin_p.
464 (do_nonmember_using_decl): Use anticipated_decl_p.
465 (lookup_name_real_1): Use DECL_HIDDEN_P.
467 2017-05-23 Jason Merrill <jason@redhat.com>
469 -Wunused and C++17 structured bindings
470 * decl.c (poplevel): Don't warn about unused structured bindings,
472 * error.c (dump_simple_decl): Handle structured bindings.
473 * expr.c (mark_exp_read): Look through DECL_VALUE_EXPR.
475 2017-05-23 Nathan Sidwell <nathan@acm.org>
477 * cp-tree.h (PUSH_GLOBAL, PUSH_LOCAL, PUSH_USING): Delete.
478 * name-lookup.c (create_local_binding): New.
479 (update_binding): New.
480 (pushdecl_maybe_friend_1): Rename to ...
481 (do_pushdecl): ... this. Reimplement.
483 (push_overloaded_decl_1, push_overloaded_decl): Delete.
485 2017-05-23 Jason Merrill <jason@redhat.com>
487 PR c++/80396 - built-in for make_integer_sequence.
488 * pt.c (builtin_pack_fn_p, builtin_pack_call_p)
489 (expand_integer_pack, expand_builtin_pack_call): New.
490 (find_parameter_packs_r): Check builtin_pack_call_p.
491 (check_for_bare_parameter_packs): Handle it.
492 (tsubst_pack_expansion): Call expand_builtin_pack_call.
493 (declare_integer_pack): New.
494 (init_template_processing): Call it.
495 * decl2.c (mark_used): Check builtin_pack_fn_p.
497 2017-05-23 Nathan Sidwell <nathan@acm.org>
499 * name-lookup.c (find_namespace_binding): New.
500 (pushdecl_maybe_friend_1): Use CP_DECL_CONTEXT.
501 (set_identifier_type_value_with_scope): Use find_namespace_binding.
502 (find_binding, cp_binding_level_find_binding_for_name,
503 binding_for_name, namespace_binding_1): Delete.
504 (push_overloaded_decl_1): Use CP_DECL_CONTEXT.
505 (get_namespace_binding, set_namespace_binding,
506 finish_namespace_using_decl, unqualified_namespace_lookup_1,
507 qualified_lookup_using_namespace, lookup_type_scope_1,
508 lookup_name_innermost_nonclass_level_1): Use find_namespace_binding.
511 * parser.c (cp_parser_template_id): Keep the lookup when stashing
514 * cp-tree.h (DECL_HIDDEN_P): New.
515 * name-lookup.c (set_decl_context,
516 set_local_extern_decl_linkage): New, broken out of ...
517 (pushdecl_maybe_friend_1): ... here. Call them.
519 2017-05-23 Thomas Schwinge <thomas@codesourcery.com>
521 * parser.c (OACC_KERNELS_CLAUSE_MASK): Add
522 "PRAGMA_OACC_CLAUSE_NUM_GANGS", "PRAGMA_OACC_CLAUSE_NUM_WORKERS",
525 2017-05-23 Nathan Sidwell <nathan@acm.org>
527 * cp-tree.h (OVL_P): New.
528 * name-lookup.h (push_local_binding): Delete.
529 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
530 (finish_namespace_using_decl, finish_local_using_decl): ... here
531 * name-lookup.c (add_decl_to_level): Swap args.
532 (pop_bindings_and_leave_scope): Look inside TREE_LIST.
533 (diagnose_name_conflict): Check contexts are same for redecl.
534 (update_local_overload): New.
535 (compparms_for_decl_and_using): Rename to ...
536 (matching_fn_p): ... here.
537 (pushdecl_maybe_friend_1): Adjust add_decl_to_level,
538 push_local_bindings call.
539 (push_local_binding): Make static, replace FLAGS arg with
541 (validate_nonmember_using_decl): Use OVL_FIRST.
542 (do_nonmember_using_decl): Use in/out parameters. Use
543 lkp_iterator and simplify.
544 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
545 (finish_namespace_using_decl, finish_local_using_decl): ... here.
547 (lookup_type_current_level): Delete.
548 * parser.c (cp_parser_using_declaration): Adjust.
549 * pt.c (tsubst_expr): Adjust.
551 2017-05-22 Nathan Sidwell <nathan@acm.org>
553 * name-lookup.h (parse_using_directive): Replace with ...
554 (finish_namespace_using_directive): ... this and ...
555 (finish_local_using_directive): ... this.
556 * name-lookup.c (add_using_namespace_1): Move later.
557 (add_using_namespace): Move later, add namespace_p arg, remove
559 (push_using_directive_1): Directly recurse.
560 (do_using_directive, parse_using_directive): Delete, split into ...
561 (finish_namespace_using_directive): ... this and ...
562 (finish_local_using_directive): ... this.
563 (push_namespace): Use add_using_namespace.
564 * parser.c (cp_parser_using_directive): Call
565 finish_namespace_using_directive or finish_local_using_directive.
566 * pt.c (tsubst_expr): Call finish_local_using_directive.
568 * cp-objcp-common.c (cp_register_dumps): Register raw dumper.
569 * cp-tree.h (raw_dump_id): Declare.
570 * decl2.c (raw_dump_id): Define.
571 (dump_tu): Use raw_dump_id.
573 * config-lang.in (gtfiles): Sort list, break lines.
575 * cp-tree.h (CPTI_TERMINATE, CPTI_CALL_UNEXPECTED): Rename to ...
576 (CPTI_TERMINATE_FN, CPTI_CALL_UNEXPECTED_FN): ... here.
577 ( CPTI_GET_EXCEPTION_PTR_FN, CPTI_BEGIN_CATCH_FN, CPTI_END_CATCH_FN,
578 CPTI_ALLOCATE_EXCEPTION_FN, CPTI_FREE_EXCEPTION_FN, CPTI_THROW_FN,
579 CPTI_RETHROW_FN): New.
580 (noexcept_deferred_spec): New.
581 (terminate_node, call_unexpected_node): Rename to ...
582 (terminate_fn, call_unexpected_fn): ... here.
583 (get_exception_ptr_fn, begin_catch_fn, end_catch_fn,
584 allocate_exception_fn, free_exception_fn, throw_fn, rethrow_fn): New.
585 * except.c (fn1..fn5, throw_fn, rethrow_rn, spec): Delete.
586 (init_exception_processing): Adjust.
587 (declare_library_fn): Create and push the fns here.
588 (do_get_exception_ptr, do_begin_catch, do_end_catch,
589 do_allocate_exception_ptr, do_free_exception_ptr): Adjust
590 declare_library_fn use.
591 (unevaluated_noexcept_spec): Adjust.
592 * cp-gimplify.c (genericize_eh_spec_block,
593 gimplify_most_not_throw_expr): Adjust.
595 * name-lookup.c (pushdecl_top_level,
596 pushdecl_top_level_and_finish): Move after namespace pushing and
598 (push_to_top_level): Rename to ...
599 (do_push_to_top_level): ... here. Remove timing code.
600 (pop_from_top_level_1): Rename to ...
601 (do_pop_from_top_level): ... here.
602 (do_push_nested_namespace, do_pop_nested_namespace)
603 (push_to_top_level): New wrapper for do_push_to_top_level.
604 (pop_from_top_level): Adjust.
605 (push_nested_namepace, pop_nested_namespace): Wrappers for workers.
607 2017-05-19 Bernd Edlinger <bernd.edlinger@hotmail.de>
609 * config-lang.in (gtfiles): Add c-family/c-format.c,
610 except.c, init.c, lambda.c and friend.c.
611 * class.c (dvirt_fn): Move out of function scope,
613 * except.c (fn1-5, throw_fn, rethrow_fn, spec): Likewise.
614 * init.c (fn): Likewise.
615 * lambda.c (ptr_id, max_id): Likewise.
616 * friend.c (global_friend): Add GTY attribute.
618 2017-05-19 Nathan Sidwell <nathan@acm.org>
620 * call.c (add_list_candidates): Use OVL_FIRST.
621 (build_new_method_call_1): Likewise.
622 * cp-tree.h (OVL_SINGLE_P): New.
623 (TYPE_HIDDEN_P): New.
624 * decl.c (xref_tag_1): Use TYPE_HIDDEN_P.
625 * dump.c (cp_tump_tree): Adjust overload dumping.
626 * error.c (dump_decl): Use OVL_SINGLE_P, simplify context
628 * method.c (lazily_declare_fn): Assert we added it.
629 * parser.c (cp_parser_nested_name_specifier): Use OVL_SINGLE_P,
631 (cp_parser_template_name): Use lkp_iterator.
632 * pt.c (begin_template_parm_list): Fixup comment.
633 (instantiate_class_template_1): Use TYPE_HIDDEN_P.
634 * tree.c (ovl_iterator::remove_node): Cope with inherited ctors.
635 (ovl_scope): Use lkp_iterator.
637 2017-05-19 Thomas Schwinge <thomas@codesourcery.com>
639 * parser.c (cp_parser_omp_clause_default): Handle
640 "OMP_CLAUSE_DEFAULT_PRESENT".
642 * parser.c (cp_parser_omp_clause_default): Avoid printing more
643 than one syntax error message.
645 2017-05-19 Nathan Sidwell <nathan@acm.org>
647 * class.c (class_dump_id): Define.
648 (dump_class_hierarchy, dump_vtable, dump_vtt): Use it.
649 * cp-objcp-common.c (cp_register_dumps): New.
650 * cp-objcp-common.h (cp_register_dumps): Declare.
651 (LANG_HOOKS_REGISTER_DUMPS): Override.
652 * cp-tree.h (class_dump_id): Declare.
654 2017-05-18 Nathan Sidwell <nathan@acm.org>
656 * cp-tree.h (OVL_ARG_DEPENDENT): Delete.
658 (lookup_keep): Declare.
659 * name-lookup.c (add_function): Don't set OVL_ARG_DEPENDENT.
660 * pt.c (tsubst_copy): Assert lookup is persistent.
661 * semantics.c (finish_call_expr): Use lkp_iterator, call
663 * tree.c (ovl_copy): New.
664 (ovl_insert, ovl_iterator::remove_node): Copy immutable nodes.
667 * cp-tree.h (OVL_USED): Replace with ...
668 (OVL_USING_P): ... this.
669 (ovl_iterator::using_p): Adjust.
670 * name-lookup.c (push_overloaded_decl_1,
671 do_nonmember_using_decl): Adjust.
672 * search.c (lookup_field_r): Adjust.
673 * tree.c (ovl_insert, ovl_scope): Adjust.
675 * cp-tree.h (lookup_add): Swap args.
676 (ovl_cons, build_overload): Delete.
677 * name-lookup.c (add_function, push_overloaded_decl_1,
678 do_nonmember_using_decl, merge_functions, remove_hidden_names):
679 Use lookup_add, ovl_insert.
680 * pt.c (check_explicit_specialization): Use lookup_add.
681 (do_class_deduction): Likewise. Refactor if.
682 * tree.c (lookup_add): Swap args.
683 (ovl_cons, build_overload): Delete.
685 * name-lookup.c (find_local_binding): New, broken out of ...
686 (lookup_name_innermost_nonclass_level_1): ... here. Call it.
687 (set_namespace_binding): Swap scope & name args.
688 (namespace_binding_1): Likewise.
689 (pushdecl_maybe_friend_1): Adjust set_namespace_binding call.
690 (push_overloaded_decl_1): Likewise.
691 (set_global_binding): Likewise.
692 (get_namespace_binding): Adjust namespace_binding_1 call.
694 2017-05-17 Nathan Sidwell <nathan@acm.org>
696 * cp-tree.h (default_hash_traits <lang_identifier *>): New
698 * name-lookup.c (lookup_extern_c_fun_in_all_ns): Delete.
699 (extern_c_fns): New hash table.
700 (check_extern_c_conflict): New, broken out of ...
701 (pushdecl_maybe_friend_1): ... here. Call it.
702 (c_linkage_bindings): Just look in hash table.
704 2017-05-17 Ville Voutilainen <ville.voutilainen@gmail.com>
708 Implement new C++ intrinsics __is_assignable and __is_constructible.
709 * cp-tree.h (CPTK_IS_ASSIGNABLE, CPTK_IS_CONSTRUCTIBLE): New.
711 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
712 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
713 * method.c (constructible_expr): Set cp_unevaluated.
714 (is_xible_helper): New.
715 (is_trivially_xible): Adjust.
717 * parser.c (cp_parser_primary_expression): Handle
718 RID_IS_ASSIGNABLE and RID_IS_CONSTRUCTIBLE.
719 (cp_parser_trait_expr): Likewise.
720 * semantics.c (trait_expr_value): Handle
721 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
723 2017-05-17 Nathan Sidwell <nathan@acm.org>
725 * cp-tree.h (ovl_iterator::using_p): New predicate.
726 (ovl_iterator::remove_node): New worker.
727 (ovl_insert): Declare.
728 * tree.c (ovl_insert): New.
729 (ovl_iterator::remove_node): New.
730 * class.c (add_method): Use ovl_iterator, ovl_insert.
731 (clone_function_decl): Fix description.
732 (clone_constructors_and_destructors): Use ovl_iterator.
734 * class.c (handle_using_decl): Use OVL_FIRST, ovl_iterator.
735 (maybe_warn_about_overly_private_class): Use ovl_iterator.
736 (method_name_cmp, resort_method_name_cmp): Use OVL_NAME.
737 (resort_type_method_vec, finish_struct_methods): Use OVL_FIRST.
738 (get_base_fndecls): Use ovl_iterator.
739 (warn_hidden): Use OVL_NAME, ovl_iterator.
740 (add_implicitly_declared_members): Use ovl_iterator.
741 * constraint.cc (normalize_template_id_expression): Use OVL_FIRST,
743 (finish_shorthand_constraint): Simplify, use ovl_make.
744 * pt.c (make_constrained_auto): Simplify. Use ovl_make.
745 * search.c (shared_member_p): Use ovl_iterator.
746 (lookup_field_fuzzy_info::fuzzy_lookup_fn): Use OVL_NAME.
747 (lookup_conversion_operator): Use OVL_FIRST.
748 (lookup_fnfiels_idx_nolazy): Use OVL_FIRST, OVL_NAME.
749 (look_for_overrides_here): Use ovl_iterator.
750 (lookup_conversions_r): Use OVL_FIRST, OVL_NAME, ovl_iterator.
751 * typeck.c (build_x_unary_op): Use ovl_make.
753 2017-05-17 Martin Liska <mliska@suse.cz>
755 * class.c (dump_class_hierarchy): Introduce dump_flags_t type and
756 use it instead of int type.
757 (dump_vtable): Likewise.
758 (dump_vtt): Likewise.
759 * decl2.c (dump_tu): Likewise.
761 2017-05-16 David Malcolm <dmalcolm@redhat.com>
763 * call.c (enforce_access): Add access_failure_info * param and use
764 it to record access failures.
765 * cp-tree.h (class access_failure_info): New class.
766 (enforce_access): Add access_failure_info * param, defaulting to
768 (lookup_member): Likewise.
769 (locate_field_accessor): New function decl.
770 (perform_or_defer_access_check): Add access_failure_info * param,
772 * search.c (lookup_member): Add access_failure_info * param and
773 pass it on to call to perform_or_defer_access_check.
774 (matches_code_and_type_p): New function.
775 (field_access_p): New function.
776 (direct_accessor_p): New function.
777 (reference_accessor_p): New function.
778 (field_accessor_p): New function.
779 (struct locate_field_data): New struct.
780 (dfs_locate_field_accessor_pre): New function.
781 (locate_field_accessor): New function.
782 * semantics.c (perform_or_defer_access_check): Add
783 access_failure_info * param, and pass it on to call to
785 * typeck.c (access_failure_info::record_access_failure): New method.
786 (access_failure_info::maybe_suggest_accessor): New method.
787 (finish_class_member_access_expr): Pass an access_failure_info
788 instance to the lookup_member call, and call its
789 maybe_suggest_accessor method afterwards.
791 2017-05-16 Marek Polacek <polacek@redhat.com>
795 * cp-gimplify.c (cp_fold): Handle SAVE_EXPR.
797 2017-05-16 Nathan Sidwell <nathan@acm.org>
799 * name-lookup.c (check_local_shadow): New, broke out of ...
800 (pushdecl_maybe_friend_1): ... here. Call it.
802 * cp-tree.h (OVL_NESTED_P, OVL_LOOKUP_P): New.
803 (ovl_first): Move inline definition to end of file.
804 (ovl_make, lookup_add): Declare.
805 (get_fns, get_first_fn): Make pure.
806 * tree.c (ovl_cache): New.
807 (ovl_make, lookup_add): New.
808 * pt.c (do_class_deduction): Don't add candidates that will be
811 * call.c (build_user_type_conversion_1): Use OVL_FIRST.
812 (print_error_for_call_failure): Use OVL_NAME.
813 (build_op_call_1): Use ovl_iterator.
814 (add_candidates): Use OVL_FIRST & lkp_iterator.
815 (build_op_delete_call): Use MAYBE_BASELINK_FUNCTIONS &
817 * class.c (deduce_noexcept_on_destructors): Use ovl_iterator.
818 (type_has_user_nondefault_constructor,
819 in_class_defaulted_default_constructor,
820 type_has_user_provided_constructor,
821 type_has_user_provided_or_explicit_constructor,
822 type_has_non_user_provided_default_constructor,
823 vbase_has_user_provided_move_assign,
824 type_has_move_constructor, type_has_move_assign,
825 type_has_user_declared_move_constructor,
826 type_has_user_declared_move_assign,
827 type_build_ctor_call, type_build_dtor_call,
828 type_requires_array_cookie, explain_non_literal_class): Likewise.
829 (finish_struct): Use lkp_iterator.
830 (resolve_address_of_overloaded_function): Use OVL_NAME, lkp_iterator.
831 (note_name_declared_in_class): Use OVL_NAME.
832 * cxx-pretty-print.c (pp_cxx_unqualified_id): Use OVL_FIRST.
833 (pp_cxx_qualified_id, cxx_pretty_printer::id_expression,
834 cxx_pretty_printer::expression): Likewise.
835 * decl2.c (check_classfn): Use ovl_iterator.
836 * pt.c (retrieve_specialization): Use ovl_iterator.
837 * tree.c (cp_tree_equal): Use lkp_iterator.
838 (type_has_nontrivial_copy_init): Use ovl_iterator.
840 * typeck2.c (cxx_incomplete_type_diagnostic): Revert change and
841 check is_overloaded_fn.
843 2017-05-16 Martin Liska <mliska@suse.cz>
845 * parser.c (cp_lexer_print_token): Add default value for flags
846 argument of print_gimple_stmt, print_gimple_expr,
847 print_generic_stmt and print_generic_expr.
849 2017-05-16 Nathan Sidwell <nathan@acm.org>
851 * cp-tree.h (class ovl_iterator, class lkp_iterator): New OVERLOAD
853 (MAYBE_BASELINK_FUNCTIONS): New.
854 * constraint.cc (resolve_constraint_check): Use lkp_iterator.
855 * decl2.c (maybe_warn_sized_delete): Use ovl_iterator.
856 * lambda.c (maybe_generic_this_capture): Use lkp_iterator.
857 * method.c (inherited_ctor_binfo): Use ovl_iterator.
858 (binfo_inherited_from): Likewise.
859 * parser.c (lookup_literal_operator): Use lkp_iterator.
860 * pt.c (iterative_hash_template_arg): Use lkp_iterator.
861 (print_candidates_1): Likewise.
862 (determine_specialization): Likewise.
863 (resolve_overloaded_unification): Likewise.
864 (resolve_nondeduced_context): Likewise.
865 (type_dependent_expression_p): Likewise.
866 (dependent_template_p): Likewise.
867 * ptree.c (cxx_print_xnode): Likewise.
868 * semantics.c (omp_reduction_lookup): Use lkp_iterator.
869 (classtype_has_nothrow_assign_or_copy_p): Use ovl_iterator.
870 * typeck.c (check_template_keyword): Use lkp_iterator.
872 * cp-tree.h (OVL_FIRST, OVL_NAME): New.
874 * constexpr.c (function_concept_check): Use OVL_FIRST.
875 * cvt.c (build_expr_type_conversion): Likewise.
876 * decl.c (poplevel, grokdeclarator): Use OVL_NAME.
877 * decl2.c (mark_used): Use OVL_FIRST.
878 * error.c (dump_decl): Use OVL_FIRST, OVL_NAME.
879 (dump_expr, location_of): Use OVL_FIRST.
880 * friend.c (do_friend): Use OVL_NAME.
881 * init.c (build_offset_ref): Use OVL_FIRST.
882 * mangle.c (write_member_name): Likewise.
883 (write_expression): Use OVL_NAME.
884 * method.c (strip_inheriting_ctors): Use OVL_FIRST.
885 * name-lookup.c (pushdecl_class_level): Use OVL_NAME.
886 * pt.c (check_explicit_specialization): Use OVL_FIRST.
887 (check_template_shadow): Likewise.
888 (tsubst_template_args): Use OVL_NAME.
889 (tsubst_baselink): Use OVL_FIRST.
890 * semantics.c (perform_koenig_lookup): Use OVL_NAME.
891 * tree.c (get_first_fn): Use OVL_FIRST.
892 * typeck.c (finish_class_member_access_expr): Use OVL_NAME.
893 (cp_build_addr_expr_1): Use OVL_FIRST.
895 * pt.c (tsubst_copy_and_build): Remove unnecessary COMPONENT_REF
897 * semantics.c (finish_id_expression): Directly init local var.
898 (finish_omp_reduction_clause): Use really_overloaded_fn.
899 * tree.c (get_fns): Document. Assert we got an overload.
900 (get_first_fn) Document.
901 * typeck.c (cp_build_addr_expr_1): Pass arg directly to
902 really_overloaded_fn.
903 * typeck2.c (cxx_incomplete_type_diagnostic): Use get_first_fn directly.
905 * cp-tree.h (SCOPE_DEPTH): New.
906 * name-lookup.h (is_nested_namespace): Declare.
907 * name-lookup.c (is_nested_namespace): New.
908 (is_ancestor): Use it.
909 (set_decl_namespace): Likewise.
910 (push_namespace): Set SCOPE_DEPTH.
911 * pt.c (check_specialization_namespace): Use is_nested_namespace.
912 (check_unqualigied_spec_or_inst): Likewise.
914 2017-05-15 Nathan Sidwell <nathan@acm.org>
917 * cp-tree.h (DECL_NAMESPACE_INLINE_P): New.
918 * name-lookup.h (push_namespace): Return int, add make_inline arg.
919 * name-lookup.c (push_namespace): Deal with inline directly.
921 * parser.c (cp_parser_namespace_definition): Adjust for
922 push_namespace change.
924 2017-05-11 Nathan Sidwell <nathan@acm.org>
926 * cp-lang.c (get_global_decls, cxx_pushdecl, LANG_HOOK_GETDECLS,
927 LANG_HOOKS_PUSHDECL): Move to ...
928 * cp-objcp-common.c (cp_get_global_decls, cp_pushdec,
929 LANG_HOOK_DECLS, LANG_HOOKS_PUSHDECL): ... here.
930 * cp-objcp-common.h (cp_get_global_decls, cp_pushdecl): Declare.
932 * name-lookup.h (pushdecl): Add default friend parm.
933 (pushdecl_maybe_friend): Delete.
934 (pushdecl_top_level): Add default friend parm.
935 (pushdecl_top_level_maybe_friend): Delete.
936 * name-lookup.c (pushdecl_maybe_friend): Delete.
937 (pushdecl): Add is_friend parm.
938 (pushdecl_top_level): Add is friend_parm.
939 (pushdecl_top_level_maybe_friend, pushdecl_top_level_1): Delete.
940 (pushdecl_top_level_and_finish): Do pushing and finishing directly.
941 * friend.c (do_friend): Adjust.
942 * pt.c (tsubst_friend_class): Adjust.
944 Revert pushdecl_top_level_and_finish name change.
945 * name-lookup.h (pushdecl_top_level_and_finish): Resurrect old name.
946 * name-lookup.c (pushdecl_top_level_and_finish): Likewise.
947 * decl.c (cp_make_fname_decl): Adjust.
948 * decl2.c (get_guard, handle_tls_init): Adjust.
949 * rtti.c (get_tinfo_decl, tinfo_base_init): Adjust.
951 * name-lookup.c (pushdecl_outermost_localscope): Always
952 conditionally stop timer.
954 * decl.c (xref_tag_1): Don't frob ts_lambda scope here.
955 * name-lookup.c (pushtag_1): Deal with ts_lambda scope.
957 * cp-tree.h (pushdecl, pushdecl_maybe_friend, pushtag,
958 pushtag_top_level_maybe_friend,
959 pushdecl_top_level_and_finish): Move declarations to ...
960 * name-lookup.h: ... here. Group pushdecl variants.
961 (pushdecl_top_level_and_finish): Rename to ...
962 (pushdecl_top_level_with_init): ... here.
963 * decl.c (cp_make_fname_decl): Use pushdecl_top_level_with_init.
964 * decl2.c (get_guard, handle_tls_init): Likewise.
965 * rtti.c (get_tinfo_decl, tinfo_base_init): Likewise.
966 * lambda.c (maybe_add_lambda_conv_op): Use namespace_bindings_p.
967 * method.c (implicitly_declare_fn): Likewise.
968 * searchc (node_debug_info_needed): Likewise.
969 * name-lookup.c (pushdecl_top_level_and_finish): Rename to ...
970 (pushdecl_top_level_with_init): ... here.
971 (pop_everything): Use namespace_bindings_p.
973 * name-lookup.h (pop_binding): Rename to pop_local_binding.
974 (getdecls): Rename to get_local_decls.
975 * name-lookup.c (pop_binding): Rename to ...
976 (pop_local_binding): ... here.
977 (pop_bindings_and_leave_scope): Adjust.
978 (getdecls): Rename to ...
979 (get_local_decls): ... here. Assert local scope.
980 * decl.c (poplevel): Assert not namespace. Adjust and simplify
982 (store_parm_decls): Adjust get_local_decls call.
983 (parser.c (synthesize_implicit_template_parm): Likewise.
985 2017-05-11 Ville Voutilainen <ville.voutilainen@gmail.com>
988 * method.c (is_trivially_xible): Reject void types.
990 2017-05-10 Nathan Sidwell <nathan@acm.org>
992 * class.c (handle_using_decl): Always use OVL_CURRENT.
993 (resolve_address_of_overloaded_function): Move iterator decl into
994 for scope. Don't strip anticipated decls here.
996 * pt.c (print_candidates_1): Separate TREE_LIST and OVERLOAD
998 (print_candidates): Adjust.
1000 * cp-tree.h (build_new_function_call): Lose koenig_p arg. Fix
1002 * call.c (build_new_function_call): Lose koenig_p arg. Remove
1003 koenig_p handling here.
1004 * pt.c (push_template_decl_real): Unconditionally retrofit_lang_decl.
1005 (tsubst_omp_clauses): Likewise.
1006 (do_class_deduction): Adjust buld_new_function_call calls.
1007 * semantics.c (finish_call_expr): Likewise.
1009 2017-05-10 Jason Merrill <jason@redhat.com>
1011 * pt.c (unify_parameter_deduction_failure, unify_cv_qual_mismatch)
1012 (unify_type_mismatch, unify_parameter_pack_mismatch)
1013 (unify_ptrmem_cst_mismatch, unify_expression_unequal)
1014 (unify_parameter_pack_inconsistent, unify_inconsistency)
1015 (unify_vla_arg, unify_method_type_error, unify_arity)
1016 (unify_arg_conversion, unify_no_common_base)
1017 (unify_inconsistent_template_template_parameters)
1018 (unify_template_deduction_failure)
1019 (unify_template_argument_mismatch)
1020 (unify_overload_resolution_failure): Call unify_invalid.
1022 CWG 1847 - Clarifying compatibility during partial ordering
1023 * pt.c (more_specialized_fn): No order between two non-deducible
1026 * pt.c (dependent_type_p): Make sure we aren't called with
1029 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
1030 * pt.c (convert_template_argument): Just return an argument pack.
1031 (coerce_template_parameter_pack, template_parm_to_arg)
1032 (extract_fnparm_pack, make_argument_pack, tsubst_template_args)
1033 (tsubst_decl, tsubst, type_unification_real, unify_pack_expansion):
1034 Don't set the type of a NONTYPE_ARGUMENT_PACK.
1035 * parser.c (make_char_string_pack, make_string_pack): Likewise.
1037 2017-05-10 Nathan Sidwell <nathan@acm.org>
1039 * cp-tree.h (add_method, clone_function_decl): Change last arg to
1041 * class.c (add_method): Change third arg to bool. Adjust.
1042 (one_inheriting_sig, one_inherited_ctor): Adjust.
1043 (clone_function_decl): Change 2nd arg to bool. Adjust.
1044 (clone_constructors_and_destructors): Adjust.
1045 * lambda.c (maybe_add_lambda_conv_op): Adjust.
1046 * method.c (lazily_declare_fn): Adjust.
1047 * pt.c (tsubst_decl, instantiate_template_1): Adjust.
1048 * semantics.c (finish_member_declaration): Adjust.
1050 2017-05-10 Paolo Carlini <paolo.carlini@oracle.com>
1053 * decl.c (finish_function): To improve error recovery, change the
1054 logic for calling apply_deduced_return_type.
1056 2017-05-09 Jason Merrill <jason@redhat.com>
1058 PR c++/80605 - __is_standard_layout and empty base
1059 * class.c (check_bases): Ignore empty bases.
1061 PR c++/70979 - literal class and closure types
1062 * class.c (finalize_literal_type_property): Handle closures
1064 (explain_non_literal_class): Likewise.
1066 PR c++/66297, DR 1684 - literal class and constexpr member fns
1067 * constexpr.c (is_valid_constexpr_fn): Only complain about
1068 non-literal enclosing class in C++11.
1069 * class.c (finalize_literal_type_property): Likewise.
1071 2017-05-09 Paolo Carlini <paolo.carlini@oracle.com>
1074 * pt.c (tsubst_decl): Early return error_mark_node if
1075 grok_ctor_properties returns false.
1077 2017-05-09 Jason Merrill <jason@redhat.com>
1079 PR c++/70167 - array prvalue treated as lvalue
1080 * cp-tree.h (CONSTRUCTOR_C99_COMPOUND_LITERAL): New.
1082 * semantics.c (finish_compound_literal): Add fcl_context parameter.
1083 Only make a static variable for C99 syntax.
1084 * parser.c (cp_parser_postfix_expression): Pass it.
1085 * pt.c (tsubst_copy_and_build): Likewise.
1086 * call.c (extend_ref_init_temps): Set
1087 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
1089 2017-05-09 Nathan Sidwell <nathan@acm.org>
1091 * cp-lang.c (get_global_decls, cxx_pushdecl): New.
1092 (LANG_HOOKS_GETDECLS, LANG_HOOKS_PUSHDECL): Override.
1093 * name-lookup.h (pushdecl_top_level): Declare.
1095 2017-05-08 Jason Merrill <jason@redhat.com>
1097 PR c++/80178 - parameter passing for uncopyable classes
1098 * tree.c (type_has_nontrivial_copy_init): True for classes with only
1099 deleted copy/move ctors.
1100 (remember_deleted_copy, maybe_warn_parm_abi): New.
1101 * decl.c (require_complete_types_for_parms, check_function_type):
1102 Call maybe_warn_parm_abi.
1103 * call.c (convert_for_arg_passing, build_cxx_call): Likewise.
1105 2017-05-08 Nathan Sidwell <nathan@acm.org>
1107 * decl.c (builtin_function_1): Set DECL_ANTICIPATED before pushing.
1108 (start_preparsed_function): Do decl pushing before setting
1109 current_funciton_decl and announcing it.
1111 * name-lookup.h (pushdecl_with_scope): Replace with ...
1112 (pushdecl_outermost_localscope): ... this.
1113 * name-lookup.c (pushdecl_with_scope): Replace with ...
1114 (pushdecl_outermost_localscope): ... this.
1115 (pushdecl_namespace_level): Adjust.
1116 * decl.c (cp_make_fname_decl): Use pushdecl_outermost_localscope.
1117 * lambda.c (insert_capture_proxy): Likewise.
1119 * class.c (build_vtbl_initializer): Don't shadow outer variable
1122 Revert _binding -> _value change.
1123 * name-lookup.h (get_namespace_value, set_global_value): Rename to ...
1124 (get_namespace_binding, set_global_binding): ... these.
1125 * name-lookup.c (get_namespace_value, set_global_value): Rename to ...
1126 (get_namespace_binding, set_global_binding): ... these.
1127 (arg_assoc_namespace, pushdecl_maybe_friend_1,
1128 check_for_out_of_scope_variable, push_overloaded_decl_1,
1129 lookup_name_innermost_nonclass_level, push_namespace): Adjust.
1130 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
1131 SET_IDENTIFIER_GLOBAL_VALUE): Adjust.
1132 * decl.c (poplevel): Adjust.
1133 * pt.c (make_constrained_auto): Likewise.
1135 2017-05-07 Volker Reichelt <v.reichelt@netcologne.de>
1137 PR translation/80280
1138 * call.c (print_z_candidate): Fix quoting.
1140 2017-05-05 David Malcolm <dmalcolm@redhat.com>
1142 * error.c (pedwarn_cxx98): Replace report_diagnostic
1143 with diagnostic_report_diagnostic.
1145 2017-05-05 Nathan Sidwell <nathan@acm.org>
1147 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value.
1148 (SET_IDENTIFIER_GLOBAL_VALUE): Use set_global_value.
1149 (IDENTIFIER_NAMESPACE_VALUE): Delete.
1150 * name-lookup.h (namespace_binding, set_namespace_binding): Replace
1152 (get_namespace_value, set_global_value): ... these.
1153 (get_global_value_if_present, is_typename_at_global_scope): Delete.
1154 * decl.c (poplevel): Use get_namespace_value.
1155 (grokdeclarator): Use IDENTIFIER_GLOBAL_VALUE.
1156 * class.c (build_vtbl_initializer): Stash library decl in
1157 static var. Use IDENTIFIER_GLOBAL_VALUE.
1158 * except.c (do_get_exception_ptr, do_begin_catch, do_end_catch,
1159 do_allocate_exception, do_free_exception, build_throw): Likewise.
1160 * init.c (throw_bad_array_new_length): Likewise.
1161 * rtti.c (throw_bad_cast, throw_bad_typeid): Likewise.
1162 * name-lookup.c (arg_assoc_namespace, pushdecl_maybe_friend_1,
1163 check_for_our_of_scope_variable, push_overloaded_decl_1): Use
1164 get_namespace_value.
1165 (set_namespace_binding_1): Rename to
1166 (set_namespace_binding): ... here.
1167 (set_global_value): New.
1168 (lookup_name_innermost_nonclass_level_1, push_namespace): Use
1169 get_namespace_value.
1170 * pt.c (listify): Use get_namespace_value.
1172 * call.c (make_temporary_var_for_ref_to_temp): Push decl into
1174 * lex.c (unqualified_name_lookup_error): Likewise.
1176 * class.c (alter_class): Use retrofit_lang_decl directly.
1177 * decl.c (push_local_name, dupliate_decls): Likewise.
1178 * semantics.c (omp_privatize_field): Likewise.
1180 Kill walk_namespaces.
1181 * cp-tree.h (walk_namespaces_fn, walk_namespaces): Delete.
1182 * decl.c (walk_namespaces_r, walk_namespaces): Delete.
1184 Kill per-namespace static_decls.
1185 * cp-tree.h (static_decls): Declare.
1186 (wrapup_globals_for_namespace,
1187 diagnose_inline_vars_for_namespace): Replace with ...
1188 (wrapup_namespace_globals): ... this.
1189 * decl.c (static_decls): Define.
1190 (wrapup_globals_for_namespace,
1191 diagnose_inline_vars_for_namespace): Replace with ...
1192 (wrapup_namespace_globals): ... this.
1193 (cxx_init_decl_processing): Initialize static_decls.
1194 * decl2.c (c_parse_final_cleanups): Adjust.
1195 * name-lookup.h (cp_binding_level): Remove static_decls member.
1196 * name-lookup.c (add_decl_to_level): Adjust.
1197 (begin_scope): Adjust.
1199 2017-05-05 Paolo Carlini <paolo.carlini@oracle.com>
1202 * decl.c (reshape_init): Unconditionally return error_mark_node
1203 upon error about too many initializers.
1205 2017-05-04 Nathan Sidwell <nathan@acm.org>
1207 * constraint.cc (diagnose_check_constraint): Fix %E thinko.
1209 2017-05-04 Martin Sebor <msebor@redhat.com>
1211 PR translation/80280
1212 * call.c (print_z_candidate): Add missing quoting to %D and other
1214 (build_op_call_1): Same.
1215 * constraint.cc (diagnose_check_constraint): Same.
1216 * mangle.c (mangle_decl): Same.
1217 * name-lookup.c (cp_binding_level_debug): Same.
1218 (set_decl_namespace): Same.
1219 * parser.c (cp_parser_tx_qualifier_opt): Same.
1220 * pt.c (print_candidates_1): Same.
1221 (check_template_variable): Same.
1222 (tsubst_default_argument): Same.
1223 (most_specialized_partial_spec): Same.
1224 * semantics.c (omp_reduction_lookup): Same.
1225 * tree.c (check_abi_tag_redeclaration): Same.
1226 * typeck.c (comptypes): Same.
1227 * typeck2.c (abstract_virtuals_error_sfinae): Same.
1229 2017-05-04 Nathan Sidwell <nathan@acm.org>
1232 * cp-tree.h (enum cp_tree_index): Add CPTI_GLOBAL,
1233 CPTI_GLOBAL_TYPE, CPTI_GLOBAL_IDENTIFIER, CPTI_ANON_IDENTIFIER,
1234 CPTI_INIT_LIST_IDENTIFIER.
1235 (global_namespace, global_type_node, global_identifier,
1236 anon_identifier, init_list_identifier): New.
1237 * decl.c (global_type_node, global_scope_name): Delete.
1238 (initialize_predefined_identifiers): Add new identifiers.
1239 (cxx_init_decl_processing): Adjust.
1240 * name-lookup.h (global_namespace, global_type_node): Delete.
1241 * name-lookup.c (global_namespace, anonymous_namespace_name,
1242 get_anonymous_namespace_name): Delete.
1243 (namespace_scope_ht_size, begin_scope, pushtag_1,
1244 push_namespace): Adjust,
1245 * call.c (type_has_extended_temps): Use init_list_identifier.
1246 * pt.c (listify): Likewise.
1248 * name-lookup.c: Reorder functions to make merging from modules
1251 2017-05-03 Jason Merrill <jason@redhat.com>
1253 * constexpr.c (cxx_eval_outermost_constant_expr): Use TV_CONSTEXPR.
1255 2017-05-03 Nathan Sidwell <nathan@acm.org>
1257 * cp-tree.h (enum cp_tree_index, cp_global_trees): Move earlier,
1258 along with #defines, to before name-lookup include.
1260 2017-05-02 Paolo Carlini <paolo.carlini@oracle.com>
1262 * pt.c (is_auto_or_concept): Remove.
1263 (type_uses_auto_or_concept): Remove, unused.
1264 (find_parameter_packs_r, extract_autos_r, is_auto_r): Adjust.
1265 * parser.c (tree_type_is_auto_or_concept): Remove, unused.
1266 * cp-tree.h (is_auto_or_concept): Remove.
1268 2017-05-01 Xi Ruoyao <ryxi@stu.xidian.edu.cn>
1271 * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Don't
1272 add pedigree operation and detach call here.
1273 * cp-gimplify.c (cp_gimplify_expr): Remove the calls to
1274 cilk_cp_gimplify_call_params_in_spawned_fn.
1275 (cilk_cp_gimplify_call_params_in_spawned_fn): Remove function.
1276 * semantics.c (simplify_aggr_init_expr): Copy EXPR_CILK_SPAWN.
1278 2017-04-29 Volker Reichelt <v.reichelt@netcologne.de>
1280 * parser.c (cp_parser_member_declaration): Add fix-it hints for
1281 stray comma and missing semicolon at end of member declaration.
1283 2017-04-27 Volker Reichelt <v.reichelt@netcologne.de>
1285 * parser.c (cp_parser_cast_expression): Add target type of cast to
1287 * error.c (type_to_string): Add '{enum}' suffix to enumeration types.
1289 2017-04-26 Paolo Carlini <paolo.carlini@oracle.com>
1291 * decl.c (grok_ctor_properties, ambi_op_p, unary_op_p): Change
1292 return type to bool.
1293 * cp-tree.h (grok_ctor_properties): Update.
1295 2017-04-26 Volker Reichelt <v.reichelt@netcologne.de>
1297 * parser.c (cp_parser_nested_name_specifier_opt): Add fix-it
1298 information to diagnostic of invalid colon in nested-name-specifier.
1300 2017-04-25 Volker Reichelt <v.reichelt@netcologne.de>
1302 * parser.c (cp_parser_elaborated_type_specifier): Add fix-it to
1303 diagnostic of invalid class/struct keyword after enum.
1305 2017-04-25 David Malcolm <dmalcolm@redhat.com>
1307 * parser.c (cp_parser_member_declaration): Add fix-it hint
1308 for removing stray semicolons.
1310 2017-04-25 David Malcolm <dmalcolm@redhat.com>
1312 * name-lookup.c (get_std_name_hint): New function.
1313 (maybe_suggest_missing_header): New function.
1314 (suggest_alternative_in_explicit_scope): Call
1315 maybe_suggest_missing_header.
1317 2017-04-25 David Malcolm <dmalcolm@redhat.com>
1320 * name-lookup.c (suggest_alternative_in_explicit_scope): Convert
1321 candidate type of bm from tree to const char *.
1322 (consider_binding_level): Likewise.
1323 (lookup_name_fuzzy): Likewise, using this to merge the best
1324 result from the preprocessor into bm, rather than immediately
1325 returning, so that better matches from reserved words can "win".
1326 Guard the rejection of keywords that don't start decl-specifiers
1327 so it only happens for FUZZY_LOOKUP_TYPENAME.
1329 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
1331 * decl.c (grokdeclarator): Use %qT instead of %<%T%> in diagnostics.
1332 (start_enum): Likewise.
1333 (build_enumerator): Likewise. Use %qE instead of plain %E.
1334 * parser.c (cp_parser_mem_initializer_list): Use %qD instead of
1335 %<%D%> in diagnostics.
1336 (cp_parser_elaborated_type_specifier): Likewise.
1337 * pt.c (make_pack_expansion): Use %qT and %qE instead of
1338 %<%T%> and %<%E%> in diagnostics.
1339 (tsubst_pack_expansion): Likewise.
1341 2017-04-24 David Malcolm <dmalcolm@redhat.com>
1344 * parser.c (cp_parser_unary_expression): Generate a location
1345 range for alignof and sizeof expressions.
1347 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
1349 * parser.c (cp_parser_cv_qualifier_seq_opt): Add fix-it info to
1351 (cp_parser_virt_specifier_seq_opt): Likewise.
1352 (set_and_check_decl_spec_loc): Likewise twice.
1354 2017-04-21 Jason Merrill <jason@redhat.com>
1356 PR c++/80179 - ICE with initialized flexible array member.
1357 * constexpr.c (verify_ctor_sanity): Handle flexible array members.
1359 2017-04-21 Richard Biener <rguenther@suse.de>
1361 * cp-tree.h (copy_decl): Annotate with CXX_MEM_STAT_INFO.
1362 (copy_type): Likewise.
1363 * lex.c (copy_decl): Pass down mem-stat info.
1364 (copy_type): Likewise.
1366 2017-04-20 Jonathan Wakely <jwakely@redhat.com>
1369 * init.c (build_new_1): Suppress notes about over-aligned new when
1370 the warning is suppressed.
1372 2017-04-20 Volker Reichelt <v.reichelt@netcologne.de>
1374 * parser.c (cp_parser_member_declaration): Add warning with fixit
1375 information for extra semicolon after in-class function definition.
1377 2017-04-20 Jakub Jelinek <jakub@redhat.com>
1380 * tree.c (build_cplus_array_type): Call build_array_type
1381 with the intended TYPE_TYPELESS_STORAGE flag value, instead
1382 of calling build_array_type and modifying later TYPE_TYPELESS_STORAGE
1385 2017-04-18 Marek Polacek <polacek@redhat.com>
1387 PR c++/80244 - ICE with attribute in template alias.
1388 * tree.c (strip_typedefs): Handle UNDERLYING_TYPE.
1390 PR c++/80241 - ICE with alignas pack expansion.
1391 * error.c (dump_expr): Handle TREE_LIST.
1392 * parser.c (cp_parser_std_attribute_list): Return error_mark if
1393 make_pack_expansion returns an error.
1395 2017-04-17 Bernd Edlinger <bernd.edlinger@hotmail.de>
1398 * class.c (fixup_may_alias): Fix all type variants.
1400 2017-04-17 Jason Merrill <jason@redhat.com>
1402 PR c++/80415 - wrong error with default arg and array reference.
1403 * tree.c (lvalue_kind): Return clk_class for an array prvalue.
1405 * pt.c (tsubst_init): Set TARGET_EXPR_DIRECT_INIT_P.
1407 2017-04-15 Alexandre Oliva <aoliva@redhat.com>
1409 * decl.c (name_unnamed_type): Split out of...
1410 (grokdeclarator): ... this.
1411 * decl.h (name_unnamed_type): Declare.
1413 2017-04-12 Richard Biener <rguenther@suse.de>
1414 Bernd Edlinger <bernd.edlinger@hotmail.de>
1417 * tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
1418 for arrays of character or std::byte type.
1420 2017-04-11 Jason Merrill <jason@redhat.com>
1422 PR c++/80294 - ICE with constexpr and inheritance.
1423 * constexpr.c (reduced_constant_expression_p):
1424 A null constructor element is non-constant.
1425 (cxx_eval_indirect_ref): Don't VERIFY_CONSTANT before
1426 returning an empty base.
1428 2017-04-11 Jakub Jelinek <jakub@redhat.com>
1431 * decl.c (cp_finish_decomp): If processing_template_decl on
1432 non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't
1433 change their DECL_VALUE_EXPR nor cp_finish_decl them. Instead make
1434 sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst
1436 * pt.c (value_dependent_expression_p) <case VAR_DECL>: For variables
1437 with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
1440 2017-04-11 Jakub Jelinek <jakub@redhat.com>
1443 * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.
1445 2017-04-10 Jakub Jelinek <jakub@redhat.com>
1448 * tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
1449 operand, if it is a static member function, recurse on the
1452 2017-04-10 Marek Polacek <polacek@redhat.com>
1455 * typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL. Set
1456 ORIG_TYPE earlier and not only when shortening.
1458 2017-04-07 Jason Merrill <jason@redhat.com>
1460 PR c++/80356 - ICE with reference to function template argument.
1462 * pt.c (convert_nontype_argument_function): Adjust type even with a
1463 value-dependent argument.
1465 PR c++/80267 - ICE with nested capture of reference
1467 * pt.c (tsubst_copy): Handle lookup finding a capture proxy.
1469 2017-04-07 Marek Polacek <polacek@redhat.com>
1472 * typeck.c (cp_build_binary_op): Convert COP[01] to ORIG_TYPE.
1475 * call.c (build_over_call): Don't check cxx_dialect.
1476 * cp-gimplify.c (cp_gimplify_init_expr): Don't check cxx_dialect nor
1477 whether SUB is a CONSTRUCTOR.
1478 * init.c (build_new_1): Don't check cxx_dialect.
1479 * tree.c (replace_placeholders): Add a function comment. Return if
1480 not in C++14, or if the object isn't a (member of a) class.
1481 * typeck2.c (store_init_value): Don't check cxx_dialect nor whether
1482 TYPE is CLASS_TYPE_P.
1484 2017-04-05 Jakub Jelinek <jakub@redhat.com>
1487 * pt.c (canonical_type_parameter): Use vec_safe_grow_cleared instead
1488 of a loop doing vec_safe_push of NULL. Formatting fixes.
1489 (rewrite_template_parm): Copy TEMPLATE_PARM_PARAMETER_PACK from oldidx
1490 to newidx before calling canonical_type_parameter on newtype.
1492 2017-04-04 Volker Reichelt <v.reichelt@netcologne.de>
1495 * cxx-pretty-print.c (cxx_pretty_printer::expression): Add
1496 UNARY_PLUS_EXPR case.
1498 2017-04-03 Jason Merrill <jason@redhat.com>
1500 * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
1502 2017-04-03 Jonathan Wakely <jwakely@redhat.com>
1504 * class.c (update_vtable_entry_for_fn): Fix typo in comment.
1505 * decl2.c (one_static_initialization_or_destruction): Likewise.
1506 * name-lookup.c (store_bindings): Likewise.
1507 * parser.c (make_call_declarator): Likewise.
1508 * pt.c (check_explicit_specialization): Likewise.
1510 2017-04-03 Jason Merrill <jason@redhat.com>
1512 PR sanitizer/79993 - ICE with VLA initialization from string
1513 PR c++/69487 - wrong VLA initialization from string
1514 * init.c (finish_length_check): Split out from build_vec_init.
1515 (build_vec_init): Handle STRING_CST.
1516 * typeck2.c (split_nonconstant_init): Handle STRING_CST.
1517 (digest_init_r): Don't give a STRING_CST VLA type.
1519 2017-03-31 Jakub Jelinek <jakub@redhat.com>
1522 * cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
1523 REFERENCE_TYPE. Adjust ubsan_maybe_instrument_reference caller
1524 for NOP_EXPR to REFERENCE_TYPE.
1527 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
1528 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
1530 * semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
1531 Remove extraneous parens.
1532 (finish_trait_expr): Handle CPTK_IS_AGGREGATE.
1533 * parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
1534 (cp_parser_trait_expr): Likewise.
1536 2017-03-27 Jakub Jelinek <jakub@redhat.com>
1539 * cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
1540 * typeck.c (cxx_mark_addressable): Likewise. Look through
1541 VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
1543 (cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
1545 2017-03-24 Jason Merrill <jason@redhat.com>
1547 PR c++/77339 - ICE with invalid use of alias template.
1548 * pt.c (lookup_template_class_1): Don't try to enter the scope of an
1551 2017-03-24 Marek Polacek <polacek@redhat.com>
1554 * cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
1555 doesn't have side effects.
1557 2017-03-23 Jason Merrill <jason@redhat.com>
1559 PR c++/80150 - ICE with overloaded variadic deduction.
1560 * pt.c (try_one_overload): Remove asserts.
1562 PR c++/77563 - missing ambiguous conversion error.
1563 * call.c (convert_like_real): Use LOOKUP_IMPLICIT.
1565 2017-03-23 Marek Polacek <polacek@redhat.com>
1567 * cp-tree.h: Remove a C_RID_YYCODE reference.
1569 2017-03-22 Jakub Jelinek <jakub@redhat.com>
1572 * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
1573 case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
1574 processing_template_decl.
1576 2017-03-21 Paolo Carlini <paolo.carlini@oracle.com>
1579 * name-lookup.c (pushtag_1): Add check for bogus, non template,
1580 std::initializer_list.
1582 2017-03-21 Jakub Jelinek <jakub@redhat.com>
1585 * init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.
1587 2017-03-21 Ville Voutilainen <ville.voutilainen@gmail.com>
1590 * init.c (std_placement_new_fn_p): New.
1591 (build_new_1): Call it.
1593 2017-03-20 Jason Merrill <jason@redhat.com>
1595 PR c++/80096 - ICE with C++17 non-type auto.
1596 * pt.c (tsubst): Delay tsubst of type of template non-type
1599 PR c++/79519 - ICE with deleted template friend.
1600 * decl.c (grokdeclarator): Complain about misplaced function
1601 definition using =, as well.
1603 PR c++/79640 - infinite recursion with generic lambda.
1604 * pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
1605 before substituting its initializer.
1607 2017-03-20 Marek Polacek <polacek@redhat.com>
1608 Paolo Carlini <paolo.carlini@oracle.com>
1610 PR c++/80059 - ICE with noexcept and __transaction_atomic
1611 * except.c (build_must_not_throw_expr): Call
1612 instantiate_non_dependent_expr.
1614 2017-03-19 Jason Merrill <jason@redhat.com>
1616 PR c++/80084 - wrong C++17 decomposition by reference of parameter.
1617 * decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
1618 reference decomposition.
1620 PR c++/80077 - error with constexpr and -fno-elide-constructors.
1621 * constexpr.c (cxx_eval_call_expression): Set ctx->call while
1622 expanding trivial constructor.
1624 2017-03-17 Jason Merrill <jason@redhat.com>
1626 PR c++/78345 - ICE initializing array from lambda.
1627 * init.c (build_aggr_init): Check array initializer.
1628 (build_vec_init): Check the type of a CONSTRUCTOR.
1630 PR c++/80073 - C++17 ICE with virtual base.
1631 * decl.c (xref_basetypes): Also check for indirect vbases.
1633 2017-03-16 Jason Merrill <jason@redhat.com>
1635 * decl.c (start_enum): std::byte aliases anything.
1638 * constexpr.c (lookup_placeholder): Tweak.
1640 2017-03-15 Jason Merrill <jason@redhat.com>
1642 PR c++/80043 - ICE with -fpermissive
1643 * typeck.c (convert_for_assignment): Handle instantiate_type
1644 not giving an error.
1646 2017-03-14 Nathan Sidwell <nathan@acm.org>
1648 PR c++/79393 DR 1658 workaround
1649 * method.c (synthesized_method_base_walk): Inihibit abstract class
1650 virtual base access check here.
1651 (synthesized_method_walk): Not here.
1653 2017-03-13 Nathan Sidwell <nathan@acm.org>
1655 PR c++/79393 DR 1658 workaround
1656 * method.c (synthesized_method_walk): Check vbases of abstract
1657 classes for dtor walk.
1659 2017-03-10 David Malcolm <dmalcolm@redhat.com>
1661 PR translation/79848
1662 * decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
1664 2017-03-10 Jason Merrill <jason@redhat.com>
1666 PR c++/79960 - alias templates and partial ordering
1667 * pt.c (comp_template_args): Add partial_order parm.
1668 (template_args_equal): Likewise.
1669 (comp_template_args_porder): New.
1670 (get_partial_spec_bindings): Use it.
1672 2017-03-10 Marek Polacek <polacek@redhat.com>
1675 * decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
1677 2017-03-10 Jakub Jelinek <jakub@redhat.com>
1680 * optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
1681 Use XALLOCAVEC macro.
1684 * decl.c (finish_enum_value_list): If value is error_mark_node,
1685 don't copy it and change its type.
1686 * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
1687 of CONST_DECL is error_mark_node.
1689 2017-03-09 Marek Polacek <polacek@redhat.com>
1691 PR c++/79900 - ICE in strip_typedefs
1692 * tree.c (strip_typedefs): Skip the attribute handling if T is
1693 a variant type which hasn't been updated yet.
1695 PR c++/79687 - wrong code with pointer-to-member
1696 * init.c (constant_value_1): Break if the variable has a dynamic
1699 2017-03-08 Jason Merrill <jason@redhat.com>
1701 PR c++/79797 - ICE with self-reference in array DMI.
1702 * constexpr.c (lookup_placeholder): Split out...
1703 (cxx_eval_constant_expression): ...from here.
1705 2017-03-07 Jakub Jelinek <jakub@redhat.com>
1708 * parser.c (cp_parser_omp_cancellation_point,
1709 cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
1710 cp_parser_omp_target_update): Change "may only be used in compound
1711 statements" diagnostics, such that the same translatable string is
1712 used for all pragmas.
1713 (cp_parser_pragma): Likewise. Use error_at instead of
1714 cp_parser_error for that diagnostics.
1716 2017-03-06 Marek Polacek <polacek@redhat.com>
1718 PR c++/79796 - ICE with NSDMI and this pointer
1719 * call.c (build_over_call): Handle NSDMI with a 'this' by calling
1720 replace_placeholders.
1722 2017-03-06 Jakub Jelinek <jakub@redhat.com>
1725 * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
1728 2017-03-06 Jason Merrill <jason@redhat.com>
1730 Revert "Allow deduction guides to look into primary template."
1731 * cp-tree.h, parser.c, pt.c, search.c: Revert.
1733 2017-03-05 Paolo Carlini <paolo.carlini@oracle.com>
1736 * except.c (build_must_not_throw_expr): Perform the implicit
1737 conversions on the condition.
1739 2017-03-03 Jason Merrill <jason@redhat.com>
1741 * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
1744 Core issues 2273 and 2277
1745 * call.c (joust): Adjust using-declaration tiebreaker to handle
1746 the intermediate base case.
1747 * method.c (strip_inheriting_ctors): Just return the argument if
1748 !flag_new_inheriting_ctors.
1750 2017-03-03 Richard Biener <rguenther@suse.de>
1753 * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
1755 2017-03-03 Marek Polacek <polacek@redhat.com>
1758 * typeck.c (string_conv_p): In C++11, always call pedwarn with
1761 2017-03-02 Jason Merrill <jason@redhat.com>
1763 Update overload resolution with deduction guides.
1764 * pt.c (do_class_deduction): Always build the copy guide.
1765 (copy_guide_p, template_guide_p): New.
1766 (build_deduction_guide): Remember the original constructor.
1767 * call.c (joust): Prefer the copy guide and non-template guides.
1769 Allow deduction guides to look into primary template.
1770 * cp-tree.h (struct saved_scope): Add deduction_guide_type.
1771 (struct cp_decl_specifier_seq): Add constructor_p.
1772 * parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
1773 (cp_parser_init_declarator): Check it. Set ctor_dtor_or_conv_p.
1774 Clear deduction_guide_type. Don't handle deduction guide names.
1775 (cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
1776 (cp_parser_direct_declarator): Likewise. Handle deduction guides.
1777 (cp_parser_member_declaration, cp_parser_cache_defarg)
1778 (cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
1779 * pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
1780 (build_deduction_guide): Set deduction_guide_type.
1781 (dependent_scope_p): Check deduction_guide_type.
1782 * search.c (lookup_member): Likewise.
1784 2017-03-02 Jakub Jelinek <jakub@redhat.com>
1787 * init.c (mark_exp_read_r): New function.
1788 (emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
1789 whole arguments instead of plain mark_exp_read on TREE_LIST values.
1791 2017-03-01 Jason Merrill <jason@redhat.com>
1793 Class template argument deduction in new-expression
1794 * init.c (build_new): Handle deduction from no initializer.
1795 * parser.c (cp_parser_new_expression): Don't require a single
1796 expression for class template deduction.
1797 * typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
1798 class template placeholder.
1799 * pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
1800 (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
1801 (redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
1803 2017-03-01 Jakub Jelinek <jakub@redhat.com>
1806 * init.c (emit_mem_initializers): When not constructing vbases of
1807 abstract classes, mark arguments as read for
1808 -Wunused-but-set-parameter.
1810 2017-02-28 Jason Merrill <jason@redhat.com>
1812 Class template argument deduction refinements
1813 * call.c (joust): Move deduction guide tiebreaker down.
1814 * decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
1815 deduction with no initializer.
1816 * pt.c (build_deduction_guide): Handle implicit default/copy ctor.
1817 (do_class_deduction): Use that rather than special case.
1818 (do_auto_deduction): Handle null initializer.
1820 2017-02-28 Jakub Jelinek <jakub@redhat.com>
1822 * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
1823 instead of just cond ? "..." : "...".
1824 (grokdeclarator): Likewise.
1825 (build_enumerator): Likewise.
1826 * init.c (build_new_1): Likewise.
1827 * call.c (build_new_method_call_1): Likewise.
1828 * parser.c: Include intl.h.
1829 (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
1830 "enter"/"exit" keyword.
1831 (cp_finalize_oacc_routine): Don't use %s to supply portions of the
1834 2017-02-27 Jason Merrill <jason@redhat.com>
1836 PR c++/71568 - SFINAE forming pointer to member function
1837 * init.c (build_offset_ref): Check the return value of
1838 perform_or_defer_access_check.
1840 2017-02-27 Marek Polacek <polacek@redhat.com>
1842 * decl.c (expand_static_init): Add missing } in a comment.
1844 2017-02-27 Volker Reichelt <v.reichelt@netcologne.de>
1846 * init.c: Include intl.h.
1847 (build_new_1): Move message strings into pedwarn to make them
1848 -Wformat-security friendly. Mark string for translation.
1849 * pt.c (tsubst_copy_and_build): Mark string for translation.
1850 Make the pointer const.
1851 * semantics.c (finish_id_expression): Mark strings for translation.
1853 2017-02-25 Jakub Jelinek <jakub@redhat.com>
1855 * call.c (build_op_delete_call): Make msg1 and msg2 const.
1857 2017-02-24 Jakub Jelinek <jakub@redhat.com>
1860 * call.c (build_over_call): Call check_function_arguments even for
1861 -Wrestrict, adjust check_function_arguments caller.
1862 * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
1864 * typeck.c (cp_build_function_call_vec): Adjust
1865 check_function_arguments caller.
1867 2017-02-24 Marek Polacek <polacek@redhat.com>
1869 PR translation/79705
1870 * decl.c (check_redeclaration_exception_specification): Mark a string
1871 for translation. Make the pointer const.
1873 2017-02-23 Paolo Carlini <paolo.carlini@oracle.com>
1876 * pt.c (register_specialization): Check duplicate_decls return value
1877 for error_mark_node and pass it back.
1879 2017-02-22 Jason Merrill <jason@redhat.com>
1881 PR c++/79679 - missing destructor for argument
1882 * call.c (build_over_call): Don't pass tf_no_cleanup to argument
1885 * pt.c (do_class_deduction): Handle 0 argument case.
1887 2017-02-22 Jakub Jelinek <jakub@redhat.com>
1890 * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
1891 SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
1892 * constexpr.c (potential_constant_expression_1): Handle
1893 OMP_*, OACC_* and CILK_* trees. Use error_at with
1894 EXPR_LOC_OR_LOC (t, input_location) computed early
1895 instead of error, or error_at with location_of (t).
1897 2017-02-22 Marek Polacek <polacek@redhat.com>
1900 * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
1901 if the alignas expression is erroneous.
1902 * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
1906 * semantics.c (finish_underlying_type): Bail out for incomplete enums.
1908 2017-02-21 Jason Merrill <jason@redhat.com>
1910 PR c++/50308 - wrong deprecated warning with ADL
1911 PR c++/17729 - duplicate deprecated warning
1912 * semantics.c (finish_id_expression): Only call mark_used on a
1913 function if we aren't building a call.
1915 PR c++/41727 - ICE with partial spec of partial instantiation
1916 * pt.c (process_partial_specialization): For now, don't check more
1917 specialized if there is more than one level of args.
1919 2017-02-21 Marek Polacek <polacek@redhat.com>
1922 * cp-tree.h (maybe_reject_flexarray_init): Declare.
1923 * init.c (maybe_reject_flexarray_init): No longer static.
1924 Add check for current_function_decl.
1925 * parser.c (cp_parser_late_parse_one_default_arg): Reject
1926 a default mem-initializer for a flexible array.
1928 2017-02-21 Jakub Jelinek <jakub@redhat.com>
1929 Paolo Carlini <paolo.carlini@oracle.com>
1932 * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
1934 * pt.c (tsubst_decomp_names): Return error_mark_node if the first
1935 decl after the decomposition artificial decl has error_mark_node.
1936 * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
1937 instead of just == error_mark_node comparison.
1939 2017-02-21 Jakub Jelinek <jakub@redhat.com>
1942 * decl.c: Include gimplify.h.
1943 (cp_finish_decomp): Make sure there is no sharing of trees
1944 in between DECL_VALUE_EXPR of decomposition decls.
1947 * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
1950 * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
1951 call cplus_expand_constant on it first.
1953 2017-02-19 Jason Merrill <jason@redhat.com>
1955 PR c++/78139 - destructor needed by new-expression
1956 * call.c (build_special_member_call): Use tf_no_cleanup.
1958 PR c++/78282 - auto template and pack expansion
1959 * pt.c (find_parameter_packs_r): Don't walk into the type of
1960 templates other than template template-parameters.
1962 PR c++/79606 - ICE with this->base_member in NSDMI
1963 * class.c (build_base_path): Check processing_template_decl.
1965 PR c++/79607 - ICE with T{} initializer
1966 * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
1968 PR c++/79566 - elaborated-type-specifier in range for
1969 * parser.c (cp_parser_simple_declaration): Fix check for type
1972 PR c++/79400 - confusing suggestion of 'noexcept'
1973 * parser.c (cp_parser_exception_specification_opt): Remove
1974 suggestion for deprecated dynamic exception-specification.
1976 PR c++/79470 - partial ordering with reference parameters
1977 * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
1979 PR c++/79500 - ICE with non-template deduction guide
1980 * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
1981 DECL_TEMPLATE_RESULT.
1983 PR c++/79580 - ICE with compound literal
1984 * parser.c (cp_parser_class_head): If we're in the middle of an
1985 expression, use ts_within_enclosing_non_class.
1987 PR c++/79503 - inherited ctor taking base class
1988 * call.c (add_function_candidate): Also check that
1989 DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
1991 2017-02-19 Paolo Carlini <paolo.carlini@oracle.com>
1994 * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
1997 2017-02-19 Eric Fiselier <eric@efcs.ca>
1998 Jonathan Wakely <jwakely@redhat.com>
2001 * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
2002 control warning about literal suffix identifiers without a leading
2005 2017-02-17 Jason Merrill <jason@redhat.com>
2007 PR c++/79508 - lookup error with member template
2008 * parser.c (cp_parser_template_name): Clear
2009 parser->context->object_type if we aren't doing lookup.
2011 PR c++/78690 - ICE with using and global type with same name
2012 * pt.c (type_dependent_object_expression_p): True for
2015 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
2016 * pt.c (convert_template_argument): Just return an auto arg pack.
2017 (tsubst_template_args): Don't tsubst an auto pack type.
2019 PR c++/79556 - C++17 ICE with non-type auto
2020 * pt.c (do_auto_deduction): Don't try to deduce from null type.
2022 PR c++/79533 - C++17 ICE with temporary cast to reference
2023 * call.c (build_over_call): Conversion to a reference prevents copy
2026 2017-02-16 Jakub Jelinek <jakub@redhat.com>
2027 Jason Merrill <jason@redhat.com>
2029 PR c++/79502 - lost nodiscard attribute
2030 * pt.c (apply_late_template_attributes): Do apply non-dependent
2031 attributes to types.
2033 2017-02-16 Jason Merrill <jason@redhat.com>
2035 PR c++/78572 - ICE with self-modifying array initializer
2036 * constexpr.c (cxx_eval_store_expression): The object we're
2037 initializing is outside the constant-expression.
2038 (cxx_eval_call_expression): Set ctx->call.
2040 PR c++/79050 - ICE with undeduced auto and LTO
2041 * decl.c (poplevel): Remove undeduced auto decls.
2043 2017-02-16 Jakub Jelinek <jakub@redhat.com>
2046 * parser.c (cp_parser_omp_target): For -fopenmp-simd
2047 ignore #pragma omp target even when not followed by identifier.
2049 2017-02-15 Jason Merrill <jason@redhat.com>
2050 Jakub Jelinek <jakub@redhat.com>
2052 PR c++/79464 - ICE in IPA with omitted constructor parms
2053 * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
2054 (adjust_clone_args): Adjust.
2055 (add_method): Remember omitted parms.
2056 * call.c (add_function_candidate): Likewise.
2057 * mangle.c (write_method_parms): Likewise.
2058 * method.c (ctor_omit_inherited_parms): Return false if there are no
2061 2017-02-15 Martin Sebor <msebor@redhat.com>
2064 * init.c (maybe_reject_flexarray_init): New function.
2065 (perform_member_init): Call it.
2067 2017-02-15 Jakub Jelinek <jakub@redhat.com>
2070 * parser.c (cp_parser_std_attribute): Don't pedwarn about
2071 [[deprecated]] with -std=c++11 and [[fallthrough]] with
2072 -std=c++11 and -std=c++14.
2075 * decl.c (grokdeclarator): For static data members, handle thread_p
2076 only after handling inline.
2078 2017-02-14 Marek Polacek <polacek@redhat.com>
2082 * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
2083 clobbering if the postfix expression isn't an EXPR_P.
2085 2017-02-13 Jason Merrill <jason@redhat.com>
2087 PR c++/79461 - ICE with lambda in constexpr constructor
2088 * constexpr.c (build_data_member_initialization): Ignore
2089 initialization of a local variable.
2091 2017-02-13 Jakub Jelinek <jakub@redhat.com>
2093 * init.c (warn_placement_new_too_small): Add missing space in
2095 * parser.c (cp_parser_oacc_declare): Likewise.
2096 * mangle.c (maybe_check_abi_tags): Likewise.
2099 * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
2100 on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
2101 in the rightmost operand.
2103 2017-02-13 Nathan Sidwell <nathan@acm.org>
2105 PR c++/79296 - ICE mangling localized template instantiation
2106 * decl2.c (determine_visibility): Use template fn context for
2107 local class instantiations.
2109 2017-02-11 Jason Merrill <jason@redhat.com>
2111 PR c++/77659 - ICE with new and C++14 aggregate NSDMI
2112 * init.c (build_new): Make backups of any CONSTRUCTORs in init.
2113 (build_new_1): Use replace_placeholders.
2114 * tree.c (replace_placeholders_t): Also track whether we've seen a
2116 (replace_placeholders, replace_placeholders_r): Adjust.
2117 * cp-tree.h: Adjust.
2119 PR c++/77790 - ICE with auto function in C++11 mode
2120 * decl.c (undeduced_auto_decl): Remove C++14 limitation.
2121 (require_deduced_type): Add complain parm, return bool.
2122 * cp-tree.h: Adjust.
2123 * decl2.c (mark_used): Use require_deduced_type.
2125 2017-02-10 Jason Merrill <jason@redhat.com>
2127 PR c++/78908 - template ops and bitfields
2128 * tree.c (build_min_non_dep): Use unlowered_expr_type.
2130 PR c++/78897 - constexpr union
2131 * constexpr.c (cxx_eval_store_expression): A store to a union member
2132 erases a previous store to another member.
2134 PR c++/71285 - member of fold-expression
2135 * semantics.c (finish_unary_fold_expr)
2136 (finish_binary_fold_expr): Use null type for fold-expressions.
2138 PR c++/79401 - protected inherited constructor
2139 * call.c (enforce_access): For inheriting constructor, find a base
2140 binfo in the path we already have.
2142 2017-02-10 Marek Polacek <polacek@redhat.com>
2145 * pt.c (type_dependent_expression_p): Check if the expression type
2149 * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
2150 if warnings shouldn't be given.
2152 2017-02-10 Paolo Carlini <paolo.carlini@oracle.com>
2155 * pt.c (tsubst_decl): Don't try to preserve a typedef that names
2156 an error_mark_node as type.
2158 2017-02-09 Jakub Jelinek <jakub@redhat.com>
2159 Jason Merrill <jason@redhat.com>
2162 * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
2163 from pattern to type.
2165 2017-02-09 Jason Merrill <jason@redhat.com>
2167 PR c++/79316 - default argument in deduction guide
2168 PR c++/79350 - explicit deduction guide
2169 * parser.c (cp_parser_constructor_declarator_p)
2170 (cp_parser_direct_declarator): Parse deduction guides more like
2172 * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
2173 * tree.c (special_function_p): Return it.
2174 * decl.c (check_special_function_return_type): Handle it.
2175 (grokdeclarator, grokfndecl): Adjust.
2176 (cp_finish_decl): Pass flags to do_auto_deduction.
2177 * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
2178 * pt.c (dguide_name_p): Take a const_tree.
2179 (do_class_deduction): Handle explicit.
2180 (do_auto_deduction): Pass flags through.
2181 (build_deduction_guide): Copy explicit flag.
2183 2017-02-09 Jakub Jelinek <jakub@redhat.com>
2186 * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
2187 non-pragma_compound context here.
2188 (cp_parser_omp_target): Likewise.
2189 (cp_parser_pragma): Don't call push_omp_privatization_clauses and
2190 parsing for ordered and target omp pragmas in non-pragma_stmt
2191 non-pragma_compound contexts.
2194 * parser.c (cp_parser_oacc_declare): Formatting fix.
2195 (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
2196 automatic variables.
2198 2016-02-09 Nathan Sidwell <nathan@codesourcery.com>
2199 Chung-Lin Tang <cltang@codesourcery.com>
2201 * parser.c (cp_parser_oacc_clause_tile): Disallow collapse. Fix
2202 parsing. Parse constant expression. Remove semantic checking.
2203 (cp_parser_omp_clause_collapse): Disallow tile.
2204 (cp_parser_omp_for_loop): Deal with tile clause. Don't emit a parse
2205 error about missing for after already emitting one. Use more
2206 conventional for idiom for unbounded loop.
2207 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
2208 * semantics.c (finish_omp_clauses): Correct TILE semantic check.
2209 (finish_omp_for): Deal with tile clause.
2211 2017-02-07 Nathan Sidwell <nathan@acm.org>
2213 * method.c (synthesized_method_base_walk): New. Broken out of ...
2214 (synthesized_method_walk): ... here. Call it. Cleanup
2217 2017-02-07 Patrick Palka <ppalka@gcc.gnu.org>
2220 * typeck2.c (process_init_constructor_union): Consider only
2221 FIELD_DECLs when looking for an NSDMI.
2223 2017-02-06 Jason Merrill <jason@redhat.com>
2225 PR c++/71193 - incomplete types in templates
2226 * parser.c (cp_parser_postfix_dot_deref_expression): In a template
2227 handle incomplete type by pedwarning and then treating as dependent.
2229 2017-02-06 Jakub Jelinek <jakub@redhat.com>
2232 * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
2233 (potential_constant_expression_1): Likewise.
2236 * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
2237 allow one fewer than expected arguments if flag_permissive.
2240 * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
2241 * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
2242 with error_mark_node type.
2244 2017-02-03 Jason Merrill <jason@redhat.com>
2246 PR c++/78689 - ICE on constructor with label
2247 * optimize.c (maybe_clone_body): Replace omitted parameters with
2249 * class.c (build_clone): Fix logic for omitting inherited parms.
2251 PR c++/12245 - excessive memory use
2252 * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
2253 back in. Don't cache constants.
2254 (maybe_constant_init): Don't cache constants.
2256 PR c++/79294 - ICE with invalid template argument
2257 * pt.c (convert_nontype_argument_function): Check value-dependence.
2258 (convert_nontype_argument): Don't check it here for function ptrs.
2260 2017-02-02 Richard Biener <rguenther@suse.de>
2263 * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
2264 it lazily on the first changed element only and copy it
2265 fully upfront, only storing changed elements.
2267 2017-02-02 Paolo Carlini <paolo.carlini@oracle.com>
2270 * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
2273 2017-01-31 Jakub Jelinek <jakub@redhat.com>
2276 * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
2279 2017-01-31 David Malcolm <dmalcolm@redhat.com>
2282 * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
2283 any namespace aliases.
2285 2017-01-31 Nathan Sidwell <nathan@acm.org>
2288 * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
2292 * pt.c: (instantiate_decl): Push to top level when current
2293 function scope doesn't match. Only push lmabda scope stack when
2296 * cp-tree.h (instantiate_decl): Make defer_ok bool.
2297 * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
2298 (instantiate_decl): Simplify and reorder state saving and restoration.
2301 * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
2302 * semantics.c (finish_member_declaration): Assert class is being
2305 2017-01-30 Alexandre Oliva <aoliva@redhat.com>
2307 Introduce C++ support in libcc1.
2308 * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
2309 (ansi_opname): Rename to...
2310 (cp_operator_id): ... this. Adjust all callers.
2311 (ansi_assopname): Rename to...
2312 (cp_assignment_operator_id): ... this. Adjust all callers.
2313 (cp_literal_operator_id): Declare.
2314 (set_global_friend): Declare.
2315 (is_global_friend): Declare.
2316 (enum cp_oracle_request): New type.
2317 (cp_binding_oracle_function): New type.
2318 (cp_binding_oracle): Declare.
2319 (cp_finish_injected_record_type): Declare.
2320 * friend.c (global_friend): New var.
2321 (set_global_friend): New fn.
2322 (is_global_friend): New fn.
2323 (is_friend): Call is_global_friend.
2324 * name-lookup.c (cp_binding_oracle): New var.
2325 (query_oracle): New fn.
2326 (qualified_lookup_using_namespace): Call query_oracle.
2327 (lookup_name_real_1): Likewise.
2328 * parser.c (cp_literal_operator_id): Drop static.
2329 * search.c (friend_accessible_p): Call is_global_friend.
2330 * semantics.c (is_this_parameter): Accept a variable if the
2331 binding oracle is enabled.
2333 2017-01-27 Jason Merrill <jason@redhat.com>
2335 PR c++/78771 - ICE with inherited constructor.
2336 * call.c (build_over_call): Call deduce_inheriting_ctor here.
2337 * pt.c (tsubst_decl): Not here.
2338 * class.c (add_method): Or here.
2339 * method.c (deduce_inheriting_ctor): Handle clones.
2340 (implicitly_declare_fn): Don't deduce inheriting ctors yet.
2342 2017-01-27 Adam Butcher <adam@jessamine.co.uk>
2345 * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
2347 * cp/cp-tree.h: Declare it.
2348 * cp/semantics.c (finish_id_expression): Resolve names within a default
2349 capturing generic lambda defined within a template prior to
2350 instantiation to allow for captures to be added to the closure type.
2352 2017-01-26 Jakub Jelinek <jakub@redhat.com>
2355 * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
2356 * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
2357 * parser.c (cp_parser_builtin_offsetof): Pass result of
2358 build_static_cast of null_pointer_node to finish_offsetof.
2359 * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
2360 it for -Winvalid-offsetof pedwarn instead of trying to guess
2361 original offsetof type from EXPR. Save OBJECT_PTR as a new
2362 second operand to OFFSETOF_EXPR.
2363 * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
2364 finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
2367 2017-01-26 Jason Merrill <jason@redhat.com>
2369 * name-lookup.c (parse_using_directive): Deprecate strong using.
2371 PR c++/79176 - lambda ICE with -flto -Os
2372 * decl2.c (vague_linkage_p): Handle decloned 'tors.
2373 * tree.c (decl_linkage): Likewise.
2375 2017-01-25 Martin Sebor <msebor@redhat.com>
2377 * decl.c (grokdeclarator): Fix a typo in a comment.
2379 2017-01-25 Jakub Jelinek <jakub@redhat.com>
2382 * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
2386 * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
2387 OPT_Wpedantic on lambda templates for -std=c++14 and higher.
2389 2017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
2392 * decl.c (cxx_init_decl_processing): Pass main_input_filename
2393 to build_translation_unit_decl.
2395 2017-01-24 Jakub Jelinek <jakub@redhat.com>
2398 * cp-gimplify.c (cp_genericize_r): Add result of
2399 convert_from_reference on invisiref parm to p_set.
2401 2017-01-24 Nathan Sidwell <nathan@acm.org>
2403 PR c++/78469 - defaulted ctor and inaccessible dtor
2404 * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
2405 * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
2406 * tree.c (build_target_expr): Check tf_no_cleanup.
2408 PR c++/79118 - anon-members and constexpr
2409 * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
2410 ctor decl. Recursively check anonymous members.
2411 (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
2413 (explain_invalid_constexpr_fn): Likewise.
2415 2017-01-23 Nathan Sidwell <nathan@acm.org>
2417 PR c++/71710 - template using directive of field
2418 * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
2421 PR c++/71406 - ICE with scope-ref'd template id exprs
2423 * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
2424 before breaking up TEMPLATE_ID_EXPR.
2426 2017-01-20 Nathan Sidwell <nathan@acm.org>
2428 PR c++/78495 - wrong code inherited ctor and invisi-ref parm
2429 * cp-gimplify.c (cp_generize_r): Don't skip thunks.
2431 2017-01-20 David Malcolm <dmalcolm@redhat.com>
2435 * cp-tree.h (suggest_alternatives_for): Add bool param.
2436 (suggest_alternative_in_explicit_scope): New decl.
2437 * error.c (qualified_name_lookup_error): When SCOPE is a namespace
2438 that isn't the global one, call new function
2439 suggest_alternative_in_explicit_scope, only calling
2440 suggest_alternatives_for if it fails, and disabling near match
2441 searches fort that case. When SCOPE is the global namespace,
2442 pass true for new param to suggest_alternatives_for to allow for
2444 * lex.c (unqualified_name_lookup_error): Pass true for new param
2445 to suggest_alternatives_for.
2446 * name-lookup.c (consider_binding_level): Add forward decl.
2447 (suggest_alternatives_for): Add "suggest_misspellings" param,
2448 using it to conditionalize the fuzzy name-lookup code.
2449 (suggest_alternative_in_explicit_scope): New function.
2450 * parser.c (cp_parser_primary_expression): When calling
2451 finish_id_expression, pass location of id_expression rather
2452 than that of id_expr_token.
2453 (cp_parser_id_expression): Convert local "unqualified_id" from
2454 tree to cp_expr to avoid implicitly dropping location information.
2456 2017-01-20 Marek Polacek <polacek@redhat.com>
2459 * call.c (build_conditional_expr_1): Warn about duplicated branches.
2460 * semantics.c (finish_expr_stmt): Build statement using the proper
2463 2017-01-19 Jason Merrill <jason@redhat.com>
2465 US 20 - forwarding references and class template argument deduction
2466 * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
2467 * pt.c (push_template_decl_real): Set it.
2468 (maybe_adjust_types_for_deduction): Check it.
2469 (rewrite_template_parm): Copy it.
2471 US 19 - deduction guides and constructors
2472 * call.c (joust): Prefer deduction guides to constructors.
2473 * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
2474 (deduction_guide_p): Check DECL_P.
2476 * decl.c (check_initializer): Always use build_aggr_init for array
2479 PR c++/79130 - decomposition and direct-initialization
2480 * init.c (build_aggr_init): Communicate direct-initialization to
2482 (build_vec_init): Check for array copy sooner.
2483 * parser.c (cp_parser_decomposition_declaration): Remove call to
2484 build_x_compound_expr_from_list.
2486 2017-01-18 Jason Merrill <jason@redhat.com>
2488 PR c++/68666 - member variable template-id
2489 * typeck.c (finish_class_member_access_expr): Handle variable
2491 * pt.c (lookup_and_finish_template_variable): No longer static.
2492 * cp-tree.h: Declare it.
2494 2017-01-18 Nathan Sidwell <nathan@acm.org>
2497 * call.c (build_over_call): When checking ellipsis conversions for
2498 an inherited ctor, make sure there is at least one conversion.
2500 2017-01-18 Jason Merrill <jason@redhat.com>
2502 PR c++/78894 - ICE with class deduction and default arg
2503 * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
2505 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
2508 * mangle.c (write_discriminator): Reorganize abi warning check.
2510 2017-01-18 Nathan Sidwell <nathan@acm.org>
2512 * cp-tree.h: Clarify exception spec node comment.
2513 * except.c (nothrow_spec_p): Simplify by checking node-equality.
2516 * mangle.c (write_exception_spec): Check nothrow explicitly.
2517 (write_encoding): Don't increment processing_template_decl around
2520 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
2523 * mangle.c (write_template_args): Add "on" for operator names.
2525 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
2528 * mangle.c (write_discriminator): Handle discriminator >= 10.
2530 2017-01-17 Nathan Sidwell <nathan@acm.org>
2533 * cp-tree.h (maybe_generic_this_capture): Declare.
2534 * lambda.c (resolvable_dummy_lambda): New, broken out of ...
2535 (maybe_resolve_dummy): ... here. Call it.
2536 (maybe_generic_this_capture): New.
2537 * parser.c (cp_parser_postfix_expression): Speculatively capture
2538 this in generic lambda in unresolved member function call.
2539 * pt.c (tsubst_copy_and_build): Force hard error from failed
2540 member function lookup in generic lambda.
2542 2017-01-17 Aldy Hernandez <aldyh@redhat.com>
2545 * cp-array-notation.c (expand_array_notation_exprs): Handle
2548 2017-01-11 Jason Merrill <jason@redhat.com>
2550 PR c++/78337 - ICE on invalid with generic lambda
2551 * semantics.c (process_outer_var_ref): Check if containing_function
2552 is null. Move inform call under complain test.
2554 2017-01-11 Nathan Sidwell <nathan@acm.org>
2557 * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
2560 2017-01-11 Nathan Sidwell <nathan@acm.org>
2562 * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
2564 2017-01-11 Jakub Jelinek <jakub@redhat.com>
2567 * parser.c (cp_parser_std_attribute_spec): Remove over-eager
2568 assertion. Formatting fix.
2571 * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
2574 2017-01-10 David Malcolm <dmalcolm@redhat.com>
2577 * parser.c (cp_parser_class_specifier_1): Only suggest inserting
2578 a missing semicolon if we have a valid insertion location for
2581 2017-01-10 Jason Merrill <jason@redhat.com>
2583 FI 20, decomposition declaration with parenthesized initializer.
2584 * parser.c (cp_parser_decomposition_declaration): Use
2585 cp_parser_initializer.
2587 2017-01-09 Jason Merrill <jason@redhat.com>
2589 Implement P0195R2, C++17 variadic using.
2590 * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
2591 * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
2592 * error.c (dump_decl): Likewise.
2594 2017-01-09 Jakub Jelinek <jakub@redhat.com>
2596 PR translation/79019
2597 PR translation/79020
2598 * semantics.c (finish_omp_clauses): Add missing whitespace to
2599 translatable strings.
2600 * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
2602 2017-01-07 Jason Merrill <jason@redhat.com>
2604 PR c++/78948 - instantiation from discarded statement
2605 * parser.h (struct cp_parser): Remove in_discarded_stmt field.
2606 * cp-tree.h (in_discarded_stmt): Declare it.
2607 (struct saved_scope): Add discarded_stmt bitfield.
2608 (in_discarded_stmt): New macro.
2609 * decl2.c (mark_used): Check it.
2610 * parser.c (cp_parser_selection_statement): Adjust.
2611 (cp_parser_jump_statement): Adjust.
2613 2017-01-05 Jakub Jelinek <jakub@redhat.com>
2616 * decl.c (cp_finish_decomp): Remove probe variable, if tt is
2617 REFERENCE_REF_P, set tt to its operand.
2620 * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
2621 unions even for C++11 and later.
2623 2017-01-05 Nathan Sidwell <nathan@acm.org>
2626 * pt.c (convert_nontype_argument): Don't try and see if integral
2627 or enum expressions are constants prematurely.
2629 2017-01-04 Marek Polacek <polacek@redhat.com>
2632 * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
2633 a zero character literal.
2635 2017-01-04 Jakub Jelinek <jakub@redhat.com>
2638 * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
2642 * parser.c (cp_parser_simple_declaration): Only complain about
2643 inconsistent auto deduction if auto_result doesn't use auto.
2645 * parser.c (cp_parser_simple_declaration): Diagnose function
2646 declaration among more than one init-declarators with auto
2650 * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
2651 assertion, as lexer->buffer may be NULL.
2653 2017-01-04 Marek Polacek <polacek@redhat.com>
2657 * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
2659 2017-01-04 Nathan Sidwell <nathan@acm.org>
2662 * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
2663 (lambda_capture_field_type): Update prototype.
2664 * lambda.c (lambda_capture_field_type): Add is_reference parm.
2665 Add referenceness here.
2666 (add_capture): Adjust lambda_capture_field_type call, refactor
2668 * pt.c (tsubst): Adjust lambda_capture_field_type call.
2670 2017-01-01 Jakub Jelinek <jakub@redhat.com>
2672 Update copyright years.
2674 Copyright (C) 2017 Free Software Foundation, Inc.
2676 Copying and distribution of this file, with or without modification,
2677 are permitted in any medium without royalty provided the copyright
2678 notice and this notice are preserved.