1 2017-06-09 Jason Merrill <jason@redhat.com>
3 PR c++/80384 - ICE with dependent noexcept-specifier
4 * pt.c (dependent_type_p_r) [FUNCTION_TYPE]: Check for dependent
7 * constexpr.c (potential_constant_expression_1): Allow 'this' capture.
9 2017-06-09 Jan Hubicka <hubicka@ucw.cz>
11 * class.c (build_vtbl_initializer): Mark dvirt_fn as cold.
12 * decl.c (cxx_init_decl_processing, push_throw_library_fn): Likewise.
13 (excpet.c): Mark terminate as cold.
15 2017-06-08 Jakub Jelinek <jakub@redhat.com>
18 * semantics.c (handle_omp_array_sections_1): Convert TYPE_MAX_VALUE
19 to sizetype before size_binop.
22 * cp-gimplify.c (cxx_omp_finish_clause): When changing clause
23 to OMP_CLAUSE_SHARED, also clear OMP_CLAUSE_SHARED_FIRSTPRIVATE
24 and OMP_CLAUSE_SHARED_READONLY flags.
26 2017-06-08 Jan Hubicka <hubicka@ucw.cz>
28 * cp-tree.h (lang_check_failed): Annotate by ATTRIBUTE_COLD.
30 2017-06-07 Nathan Sidwell <nathan@acm.org>
32 * class.c (layout_class_type): Restructure overlong-bitfield tpe
35 2017-06-07 Jonathan Wakely <jwakely@redhat.com>
38 * pt.c (do_class_deduction): Build qualified type.
40 2017-06-06 Nathan Sidwell <nathan@acm.org>
42 * name-lookup.c (suggest_alternatives_for): Use qualified lookup
43 sans using directives. Don't walk into inline namespaces.
46 * name-lookup.c (adl_class_only): Don't add visible friends.
48 2017-06-05 Volker Reichelt <v.reichelt@netcologne.de>
50 * parser.c (cp_parser_base_specifier): Fix typos in error messages.
52 2017-06-02 Nathan Sidwell <nathan@acm.org>
54 Remove lang_type_ptrmem.
55 * cp-tree.h (lang_type_header): Remove is_lang_type_class. Move
57 (lang_type_class): ... this. Reorder bitfields. Rename to ...
58 (lang_type): ... this. Delete old definition.
59 (lang_type_ptrmem): Delete.
60 (LANG_TYPE_CLASS_CHECK): Simply get TYPE_LANG_SPECIFIC. Adjust uses.
61 (LANG_TYPE_PTRMEM_CHECK): Delete.
62 (TYPE_GET_PTRMEMFUNC_TYPE, TYPE_SET_PTRMEMFUNC_TYPE): Delete.
63 (TYPE_PTRMEMFUNC_TYPE): New. Use TYPE_LANG_SLOT_1.
64 * decl.c (build_ptrmemfunc_type): Adjust.
65 * lex.c (copy_lang_type): Remove lang_type_ptrmem handling.
66 (maybe_add_lang_type_raw): Don't set u.c.h.is_lang_type_class.
68 * class.c (check_bases_and_members): Adjust vec_new_uses_cookie
71 Remove cp_binding_level::namespaces
72 * name-lookup.h (cp_binding_level): Lose namespaces field.
73 * name-lookup.c (add_decl_to_level): Chain namespaces on the names
75 (suggest_alternatives_for): Adjust for namespace list. Do
77 * decl2.c (collect_source_refs): Namespaces are on the regulr
79 (collect_ada_namespace): Likewise.
81 2017-06-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
83 * typeck.c (cp_build_binary_op): Implement the -Wsizeof_pointer_div
86 2017-06-01 Ville Voutilainen <ville.voutilainen@gmail.com>
89 * method.c (constructible_expr): Strip array types before calling
92 2017-06-01 Paolo Carlini <paolo.carlini@oracle.com>
95 * cvt.c (convert_to_void): Possibly call maybe_warn_nodiscard
96 for case INDIRECT_REF too in the main switch.
98 2017-05-31 Jason Merrill <jason@redhat.com>
100 PR c++/80840 - ICE with constexpr and reference
101 * pt.c (convert_nontype_argument): Don't test whether a decl is
102 value-dependent when binding to a reference.
104 2017-05-31 Nathan Sidwell <nathan@acm.org>
106 * cp-tree.h (lang_decl_slector): New enum.
107 (lang_decl_base): Make selector an enum. Drop decomposition_p
109 (lang_decl): Use enum for discrimination.
110 (LANG_DECL_FN_CHECK, LANG_DECL_NS_CHECK, LANG_DECL_PARM_CHECK,
111 LANG_DECL_DEOMP_CHECK): Use enum.
112 (DECL_DECOMPOSITION_P): Use selector value.
113 (SET_DECL_DECOMPOSITION_P): Delete.
114 (retrofit_lang_decl): Lose SEL parm.
115 (fit_decomposition_lang_decl): Declare.
116 * decl.c (cp_finish_decomp, grokdeclarator): Use
117 fit_decomposition_lang_decl.
118 * lex.c (maybe_add_lang_decl_raw): New. Broken out of
120 (set_decl_linkage): New. Broken out of retrofit_lang_decl. Use enum.
121 (fit_decomposition_lang_decl): Likewise.
122 (retrofit_lang_decl): Use worker functions.
123 (cxx_dup_lang_specific_decl): Use selector enum.
124 (maybe_add_lang_type_raw): New. Broken out of ...
125 (cxx_make_type_name): ... here. Call it.
127 2017-05-30 Jason Merrill <jason@redhat.com>
129 PR c++/80856 - ICE with local extern in template
130 * semantics.c (finish_call_expr): Replace a local extern overload
131 set in a template with the IDENTIFIER_NODE.
133 2017-05-30 David Malcolm <dmalcolm@redhat.com>
135 * call.c (perform_implicit_conversion_flags): Convert
136 "from %qT to %qT" to "from %qH to %qI" in diagnostic.
137 (print_conversion_rejection): Replace pairs of %qT with
138 %qH and %qI in various places.
139 (build_user_type_conversion_1): Likewise.
140 (build_integral_nontype_arg_conv): Likewise.
141 (build_conditional_expr_1): Likewise.
142 (convert_like_real): Likewise.
143 (convert_arg_to_ellipsis): Likewise.
145 (initialize_reference): Likewise.
146 * cvt.c (cp_convert_to_pointer): Likewise.
147 (cp_convert_to_pointer): Likewise.
148 (convert_to_reference): Likewise.
149 (ocp_convert): Likewise.
150 * error.c (cp_printer): Gain bool and const char ** parameters.
151 (struct deferred_printed_type): New struct.
152 (class cxx_format_postprocessor): New class.
153 (cxx_initialize_diagnostics): Wire up a cxx_format_postprocessor
154 to pp->m_format_postprocessor.
155 (comparable_template_types_p): New function.
156 (newline_and_indent): New function.
157 (arg_to_string): New function.
158 (print_nonequal_arg): New function.
159 (print_template_differences): New function.
160 (type_to_string_with_compare): New function.
161 (print_template_tree_comparison): New function.
162 (append_formatted_chunk): New function.
163 (add_quotes): New function.
164 (cxx_format_postprocessor::handle): New function.
165 (defer_phase_2_of_type_diff): New function.
166 (cp_printer): Add "quoted" and "buffer_ptr" params. Implement
168 * typeck.c (cp_build_binary_op): Replace pairs of %qT with
169 %qH and %qI in various places.
170 (convert_member_func_to_ptr): Likewise.
171 (build_reinterpret_cast_1): Likewise.
172 (convert_for_assignment): Likewise.
173 * typeck2.c (check_narrowing): Likewise.
175 2017-05-30 Nathan Sidwell <nathan@acm.org>
177 Kill IDENTIFIER_NAMESPACE_BINDINGS
178 * cp-tree.h (lang_identifier): Delete namespace_bindings.
179 (IDENTIFIER_NAMESPACE_BINDINGS): Delete.
180 (lang_decl_ns): Add bindings.
181 (DECL_NAMESPACE_BINDINGS): New.
182 * lex.c (retrofit_lang_decl): Create namespace hash table.
183 * name-lookup.c (find_namespace_slot): Change to use hash-map.
184 * ptree.c (cxx_print_binding): Delete.
185 (cxx_print_identifier): Remove NAMESPACE_BINDING printing.
187 * cp-tree.def (OVERLOAD): Fix comment.
188 * cp-tree.h: Fix comments and whitespace.
189 * error.c (dump_decl): Use pp_cxx_colon_colon, ovl_scope.
190 * name-lookup.c (add_decl_to_level): Assert not class.
191 (check_local_shadow): Use OVL_P.
192 (pushdecl_with_scope_1): Rename to ...
193 (do_pushdecl_with_Scope): ... here.
194 (do_nonmember_using_decl): Use qualified_namespace_lookup return
196 (push_class_level_binding_1): Use OVL_P.
197 (pushdecl_namespace_level): Use do_pushdecl_with_scope.
198 (pushtag_1): Rename to ...
199 (do_pushtag): ... here. Adjust do_pushdecl_with_scope call.
201 (store_class_bindings): Do not time here.
202 * name-lookup.h (pushdecl_outermost_localscope): Reorder.
203 * pt.c (listify): Declare argvec at point of initialization.
206 * name-lookup.c (add_decl_to_level): Assert not making a circular
208 (update_binding): Don't prematurely slide artificial decl.
210 2017-05-29 Alexandre Oliva <aoliva@redhat.com>
212 * cp-tree.h (lang_identifier): Drop oracle_looked_up, unused.
214 2017-05-29 Nathan Sidwell <nathan@acm.org>
217 * cp-tree.h (lookup_maybe_add): Add DEDUPING argument.
218 * name-lookup.c (name_lookup): Add deduping field.
219 (name_lookup::preserve_state, name_lookup::restore_state): Deal
221 (name_lookup::add_overload): New.
222 (name_lookup::add_value, name_lookup::add_fns): Call add_overload.
223 (name_lookup::search_adl): Set deduping. Don't unmark here.
224 * pt.c (most_specialized_instantiation): Revert previous change,
225 Assert not given duplicates.
226 * tree.c (lookup_mark): Just mark the underlying decls.
227 (lookup_maybe_add): Dedup using marked decls.
230 * ptree.c (cxx_print_xnode): Show internal OVERLOAD structure.
231 * tree.c (ovl_insert, ovl_iterator_remove_node): Fix copying assert.
233 Stat hack representation
234 * name-lookup.c (STAT_HACK_P, STAT_TYPE, STAT_DECL,
235 MAYBE_STAT_DECL, MAYBE_STAT_TYPE): New.
237 (find_namespace_binding): Replace with ...
238 (find_namespace_slot): ... this.
239 (find_namespace_value): New.
240 (name_lookup::search_namespace_only,
241 name_lookup::adl_namespace_only): Adjust.
242 (update_binding): Add SLOT parameter, adjust.
243 (check_local_shadow): Use find_namespace_value.
244 (set_local_extern_decl_linkage): Likewise.
245 (do_pushdecl): Adjust for namespace slot.
246 (push_local_binding): Assert not a namespace binding.
247 (check_for_out_of_scope_variable): Use find_namespace_value.
248 (set_identifier_type_value_with_scope): Likewise.
249 (get_namespace_binding): Likewise.
250 (set_namespace_binding): Delete.
251 (set_global_binding): Directly update the binding.
252 (finish_namespace_using_decl): Likewise.
253 (lookup_type_scope_1): Use find_namespace_slot and update.
254 (do_push_nested_namespace): Use find_namespace_value.
257 * pt.c (most_specialized_instantiation): Cope with duplicate
261 * cp-tree.h (build_min_nt_call_vec): Declare.
262 * decl.c (build_offset_ref_call_from_tree): Call it.
263 * parser.c (cp_parser_postfix_expression): Likewise.
264 * pt.c (tsubst_copy_and_build): Likewise.
265 * semantics.c (finish_call_expr): Likewise.
266 * tree.c (build_min_nt_loc): Keep unresolved lookups.
267 (build_min): Likewise.
268 (build_min_non_dep): Likewise.
269 (build_min_non_dep_call_vec): Likewise.
270 (build_min_nt_call_vec): New.
273 * tree.c (ovl_copy): Adjust assert, copy OVL_LOOKUP.
275 (lookup_keep): Call it.
277 2017-05-26 Nathan Sidwell <nathan@acm.org>
280 * name-lookup.c (push_inline_namespaces): New.
281 (push_namespace): Look inside inline namespaces.
283 Inline and using namespace representation change.
284 * cp-tree.h (struct lang_decl_ns): Delete ns_using. Add usings,
286 (DECL_NAMESPACE_USING): Adjust.
287 (DECL_NAMESPACE_INLINEES): New.
288 * name-lookup.h (struct cp_binding_level): Change usings
290 * name-lookup.c (name_lookup::do_queue_usings,
291 name_lookup::queue_usings): Adjust.
292 (name_lookup::search_namespace, name_lookup::search_usings,
293 name_lookup::queue_namespace): Adjust.
294 (name_lookup::adl_namespace_only): Adjust.
295 (add_using_namespace, push_namespace): Push onto vector.
296 (pop_namespace): Add timing logic.
298 * call.c (build_operator_new_call): Do namelookup and ADL here.
299 (build_new_op_1): Likewise.
300 * name-lookup.h (lookup_function_nonclass): Delete declaration.
301 (do_using_directive): Likewise.
302 * name-lookup.c (set_namespace_binding, push_local_binding): Don't
304 (struct scope_binding): Delete.
305 (EMPTY_SCOPE_BINDING): Delete.
306 (set_decl_namespace): Use OVL_P.
307 (finish_local_using_decl): Lose unnecesary checks.
308 (lookup_function_nonclass): Delete.
309 (cp_emit_debug_info_for_using): Use MAYBE_BASELINK_P.
311 * cp-tree.h (OVL_CHAIN): Check looking at OVERLOAD.
312 (ovl_iterator): Add allow_inner field. Adjust ctor. Make
314 (ovl_iterator::maybe_push, ovl_iterator::pop): New.
315 (lkp_iterator): Add outer field. Adjust ctor.
316 (lkp_iterator::operator++): New.
317 (lookup_mark, lookup_maybe_add): Declare.
318 * name-lookup.c (name_lookup): Delete fn_set member.
319 (name_lookup::preserve_state, name_lookup::restore_state): Unmark
321 (name_lookup::add_value): Use lookup_add directly.
322 (name_lookup::add_fns: Use lookup_maybe_add.
323 (name_lookup::search_adl): Mark and unmark fns.
325 * pt.c (check_explicit_specialization): Use lookup_add directly.
326 * ptree.c (cxx_print_xnode): Show complete overload structure.
327 * tree.c (lookup_mark, lookup_maybe_add): New.
329 * name-lookup.c (name_lookup::search_adl): ADL OMP UDR type args.
331 2017-05-26 Jakub Jelinek <jakub@redhat.com>
333 * cp-tree.h (struct lang_decl_decomp): New type.
334 (struct lang_decl): Add u.decomp.
335 (LANG_DECL_DECOMP_CHECK): Define.
336 (DECL_DECOMPOSITION_P): Note it is set also on the vars
337 for user identifiers.
338 (DECL_DECOMP_BASE): Define.
339 (retrofit_lang_decl): Add extra int = 0 argument.
340 * lex.c (retrofit_lang_decl): Add SEL argument, if non-zero
341 use it to influence the selector choices and for selector
342 0 to non-zero transition copy old content.
343 (cxx_dup_lang_specific_decl): Handle DECL_DECOMPOSITION_P.
344 * decl.c (poplevel): For DECL_DECOMPOSITION_P, check
345 !DECL_DECOMP_BASE instead of !DECL_VALUE_EXPR. Adjust warning
346 wording if decl is a structured binding.
347 (cp_finish_decomp): Pass 4 as the new argument to retrofit_lang_decl.
348 Set DECL_DECOMP_BASE. Ignore DECL_READ_P sets from initialization
349 of individual variables for tuple structured bindings.
350 (grokdeclarator): Pass 4 as the new argument to retrofit_lang_decl.
351 Clear DECL_DECOMP_BASE.
352 * decl2.c (mark_used): Mark DECL_DECOMP_BASE TREE_USED as well.
353 * pt.c (tsubst_decomp_names): Assert DECL_DECOMP_BASE matches what
355 * expr.c (mark_exp_read): Recurse on DECL_DECOMP_BASE instead of
358 2017-05-25 Jason Merrill <jason@redhat.com>
360 PR c++/80605 - __is_standard_layout and zero-length array
361 * class.c (check_bases): Use DECL_FIELD_IS_BASE.
363 2017-05-25 Nathan Sidwell <nathan@acm.org>
365 Kill OVL_CURRENT, OVL_NEXT.
366 * cp-tree.h (OVL_CURRENT, OVL_NEXT): Delete.
367 * name-lookup.c (set_decl_namespace): Use ovl_iterator.
368 (consider_binding_level): Use OVL_FIRST.
369 (cp_emit_debug_info_for_using): Use lkp_iterator.
370 * pt.c (check_explicit_specialization): Use ovl_iterator.
372 Kill DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS.
373 * cp-tree.h (lang_decl_ns): Remove ns_users field.
374 (DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS): Delete.
375 (TREE_INDIRECT_USING): Delete.
376 * name-lookup.h (is_associated_namespace): Delete.
377 * name-lookup.c (name_lookup::search_usings,
378 name_lookup::do_queue_usings): Usings are always direct.
379 (is_associated_namespace): Delete.
380 (handle_namespace_attrs): Use DECL_NAMESPACE_INLINE_P.
381 (namespace_ancestor_1, namespace_ancestor): Delete.
382 (push_using_directive_1, push_using_directive): Delete.
383 (add_using_namespace_1): Delete.
384 (add_using_namespace): Reimplement.
385 (emit_debug_info_using_namespace): New.
386 (finish_namespace_using_directive, finish_local_using_directive,
387 push_namespace): Adjust.
388 * tree.c (cp_free_lang_data): Remove DECL_NAMESPACE_USERS handling.
390 2017-05-25 Volker Reichelt <v.reichelt@netcologne.de>
392 * semantics.c (finish_handler_parms): Warn about non-reference type
395 2017-05-25 Nathan Sidwell <nathan@acm.org>
397 Reimplement unqualified namespace lookup.
398 * name-lookup.c (name_lookup::using_pair,
399 name_lookup::using_queue): New typedefs.
400 (name_lookup::queue_namespace, name_lookup::do_queue_usings,
401 name_lookup::queue_usings): New.
402 (name_lookup::search_unqualified): New.
403 (merge_functions, same_entity_p, ambiguous_decl,
404 unqualified_namespace_lookup_1, unqualified_namespace_lookup,
405 lookup_using_namespace): Delete.
406 (lookup_name_real_1): Adjust.
408 Reimplement qualified namespace lookup.
409 * name-lookup.c (name_lookup::flags): New member. Adjust ctor.
410 (name_lookup::ambiguous, name_lookup::add_value,
411 name_lookup::add_type, name_lookup::process_binding): New.
412 (name_lookup::search_namespace_only,
413 name_lookup::search_namespace, name_lookup::search_usings): New.
414 (name_lookup::search_qualified): New.
415 (do_nonmember_using_decl, suggest_alternatives_for,
416 lookup_qualified_name): Adjust.
417 (tree_vec_contains): Delete.
418 (qualified_lookup_using_namespace): Rename to ...
419 (qualified_namespace_lookup): ... here. Reimplement.
422 * cp-tree.h (LOOKUP_SEEN_P, LOOKUP_FOUND_P): New.
423 * name-lookup.h (lookup_arg_dependent): Return plain tree.
424 * name-lookup.c (arg_lookup, arg_assoc, arg_assoc_args,
425 arg_assoc_args_vec, arg_assoc_type, add_function,
426 arg_assoc_namespace, arg_assoc_class_only, arg_assoc_bases,
427 arg_assoc_class, arg_assoc_template_arg, arg_assoc,
428 lookup_arg_dependent_1): Delete.
429 (name_lookup): New lookup object.
430 (name_lookup::preserve_state, name_lookup::restore_state,
431 name_lookup::mark_seen, name_lookup::find_and_mark,
432 name_lookup::add_fns, name_lookup::adl_namespace_only,
433 name_lookup::adl_namespace, name_lookup::adl_class_only,
434 name_lookup::adl_bases, name_lookup::adl_class,
435 name_lookup::adl_expr, name_lookup::adl_type,
436 name_lookup::adl_template_arg, name_lookup::search_adl): New.
437 (lookup_arg_dependent): Return a plain tree. Adjust.
438 (is_associated_namespace): Move later.
440 2017-05-24 Nathan Sidwell <nathan@acm.org>
442 * friend.c (do_friend): Remove check for existing decl.
443 * name-lookup.h (lookup_name_innermost_nonclass_level): Delete.
444 * name-lookup.c (push_local_binding): Directly look for binding.
445 (lookup_name_innermost_nonclass_level_1): Delete.
446 (lookup_name_innermost_nonclass_level): Delete.
448 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Alphabetize.
450 * cp-tree.h (cp_free_lang_data): Add extern.
451 (ovl_skip_hidden, is_overloaded_fn, really_overloaded_fn): Add
453 (type_unknown_p): Return bool, make inline, lose TREE_LIST check.
454 * typeck.c (type_unknown_p): Delete.
455 * tree.c (is_overloaded_fn): Use MAYBE_BASELINE_FUNCTIONS, adjust
457 (dependent_name): Likewise.
458 (decl_anon_ns_mem_p): Simplify.
460 2017-05-24 Jonathan Wakely <jwakely@redhat.com>
463 * tree.c (reshape_init): Use unqualified type for direct enum init.
464 * typeck.c (maybe_warn_about_cast_ignoring_quals): New.
465 (build_static_cast_1, build_reinterpret_cast_1): Strip cv-quals from
466 non-class destination types.
467 (build_const_cast_1): Strip cv-quals from destination types.
468 (build_static_cast, build_reinterpret_cast, build_const_cast)
469 (cp_build_c_cast): Add calls to maybe_warn_about_cast_ignoring_quals.
471 2017-05-24 Martin Sebor <msebor@redhat.com>
474 * call.c (fully_fold_internal): Adjust.
476 2017-05-24 Nathan Sidwell <nathan@acm.org>
478 * cp-tree.h (ovl_skip_hidden): Declare.
479 * tree.c (ovl_skip_hidden): New.
480 * name-lookup.c (arg_assoc_namespace): Call ovl_skip_hidden.
481 (lookup_arg_dependent_1): Likewise.
482 (ambiguous_decl): Use DECL_HIDDEN_P, ovl_skip_hidden.
483 (hidden_name_p, remove_hidden_names): Delete.
484 (lookup_name_real_1): Do not strip hidden names.
485 * name-lookup.h (hidden_name_p, remove_hidden_names): Delete.
487 * cp-tree.h (OVL_HIDDEN_P): New.
488 (ovl_iterator::hidden_p, ovl_iterator::reveal_node): New.
489 (ovl_iterator::reveal_node): Declare.
490 * tree.c (ovl_copy): Copy OVL_HIDDEN_P.
491 (ovl_insert): Order on hiddenness.
492 (ovl_iterator::reveal_node): New.
493 * name-lookup.c (anticipated_builtin_p): New.
494 (supplement_binding_1): Use it.
495 (set_local_extern_decl_linkage): Use hidden_p.
496 (do_pushdecl): Deal with unhiding a hidden decl, use
497 anticipated_builtin_p.
498 (do_nonmember_using_decl): Use anticipated_decl_p.
499 (lookup_name_real_1): Use DECL_HIDDEN_P.
501 2017-05-23 Jason Merrill <jason@redhat.com>
503 -Wunused and C++17 structured bindings
504 * decl.c (poplevel): Don't warn about unused structured bindings,
506 * error.c (dump_simple_decl): Handle structured bindings.
507 * expr.c (mark_exp_read): Look through DECL_VALUE_EXPR.
509 2017-05-23 Nathan Sidwell <nathan@acm.org>
511 * cp-tree.h (PUSH_GLOBAL, PUSH_LOCAL, PUSH_USING): Delete.
512 * name-lookup.c (create_local_binding): New.
513 (update_binding): New.
514 (pushdecl_maybe_friend_1): Rename to ...
515 (do_pushdecl): ... this. Reimplement.
517 (push_overloaded_decl_1, push_overloaded_decl): Delete.
519 2017-05-23 Jason Merrill <jason@redhat.com>
521 PR c++/80396 - built-in for make_integer_sequence.
522 * pt.c (builtin_pack_fn_p, builtin_pack_call_p)
523 (expand_integer_pack, expand_builtin_pack_call): New.
524 (find_parameter_packs_r): Check builtin_pack_call_p.
525 (check_for_bare_parameter_packs): Handle it.
526 (tsubst_pack_expansion): Call expand_builtin_pack_call.
527 (declare_integer_pack): New.
528 (init_template_processing): Call it.
529 * decl2.c (mark_used): Check builtin_pack_fn_p.
531 2017-05-23 Nathan Sidwell <nathan@acm.org>
533 * name-lookup.c (find_namespace_binding): New.
534 (pushdecl_maybe_friend_1): Use CP_DECL_CONTEXT.
535 (set_identifier_type_value_with_scope): Use find_namespace_binding.
536 (find_binding, cp_binding_level_find_binding_for_name,
537 binding_for_name, namespace_binding_1): Delete.
538 (push_overloaded_decl_1): Use CP_DECL_CONTEXT.
539 (get_namespace_binding, set_namespace_binding,
540 finish_namespace_using_decl, unqualified_namespace_lookup_1,
541 qualified_lookup_using_namespace, lookup_type_scope_1,
542 lookup_name_innermost_nonclass_level_1): Use find_namespace_binding.
545 * parser.c (cp_parser_template_id): Keep the lookup when stashing
548 * cp-tree.h (DECL_HIDDEN_P): New.
549 * name-lookup.c (set_decl_context,
550 set_local_extern_decl_linkage): New, broken out of ...
551 (pushdecl_maybe_friend_1): ... here. Call them.
553 2017-05-23 Thomas Schwinge <thomas@codesourcery.com>
555 * parser.c (OACC_KERNELS_CLAUSE_MASK): Add
556 "PRAGMA_OACC_CLAUSE_NUM_GANGS", "PRAGMA_OACC_CLAUSE_NUM_WORKERS",
559 2017-05-23 Nathan Sidwell <nathan@acm.org>
561 * cp-tree.h (OVL_P): New.
562 * name-lookup.h (push_local_binding): Delete.
563 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
564 (finish_namespace_using_decl, finish_local_using_decl): ... here
565 * name-lookup.c (add_decl_to_level): Swap args.
566 (pop_bindings_and_leave_scope): Look inside TREE_LIST.
567 (diagnose_name_conflict): Check contexts are same for redecl.
568 (update_local_overload): New.
569 (compparms_for_decl_and_using): Rename to ...
570 (matching_fn_p): ... here.
571 (pushdecl_maybe_friend_1): Adjust add_decl_to_level,
572 push_local_bindings call.
573 (push_local_binding): Make static, replace FLAGS arg with
575 (validate_nonmember_using_decl): Use OVL_FIRST.
576 (do_nonmember_using_decl): Use in/out parameters. Use
577 lkp_iterator and simplify.
578 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
579 (finish_namespace_using_decl, finish_local_using_decl): ... here.
581 (lookup_type_current_level): Delete.
582 * parser.c (cp_parser_using_declaration): Adjust.
583 * pt.c (tsubst_expr): Adjust.
585 2017-05-22 Nathan Sidwell <nathan@acm.org>
587 * name-lookup.h (parse_using_directive): Replace with ...
588 (finish_namespace_using_directive): ... this and ...
589 (finish_local_using_directive): ... this.
590 * name-lookup.c (add_using_namespace_1): Move later.
591 (add_using_namespace): Move later, add namespace_p arg, remove
593 (push_using_directive_1): Directly recurse.
594 (do_using_directive, parse_using_directive): Delete, split into ...
595 (finish_namespace_using_directive): ... this and ...
596 (finish_local_using_directive): ... this.
597 (push_namespace): Use add_using_namespace.
598 * parser.c (cp_parser_using_directive): Call
599 finish_namespace_using_directive or finish_local_using_directive.
600 * pt.c (tsubst_expr): Call finish_local_using_directive.
602 * cp-objcp-common.c (cp_register_dumps): Register raw dumper.
603 * cp-tree.h (raw_dump_id): Declare.
604 * decl2.c (raw_dump_id): Define.
605 (dump_tu): Use raw_dump_id.
607 * config-lang.in (gtfiles): Sort list, break lines.
609 * cp-tree.h (CPTI_TERMINATE, CPTI_CALL_UNEXPECTED): Rename to ...
610 (CPTI_TERMINATE_FN, CPTI_CALL_UNEXPECTED_FN): ... here.
611 ( CPTI_GET_EXCEPTION_PTR_FN, CPTI_BEGIN_CATCH_FN, CPTI_END_CATCH_FN,
612 CPTI_ALLOCATE_EXCEPTION_FN, CPTI_FREE_EXCEPTION_FN, CPTI_THROW_FN,
613 CPTI_RETHROW_FN): New.
614 (noexcept_deferred_spec): New.
615 (terminate_node, call_unexpected_node): Rename to ...
616 (terminate_fn, call_unexpected_fn): ... here.
617 (get_exception_ptr_fn, begin_catch_fn, end_catch_fn,
618 allocate_exception_fn, free_exception_fn, throw_fn, rethrow_fn): New.
619 * except.c (fn1..fn5, throw_fn, rethrow_rn, spec): Delete.
620 (init_exception_processing): Adjust.
621 (declare_library_fn): Create and push the fns here.
622 (do_get_exception_ptr, do_begin_catch, do_end_catch,
623 do_allocate_exception_ptr, do_free_exception_ptr): Adjust
624 declare_library_fn use.
625 (unevaluated_noexcept_spec): Adjust.
626 * cp-gimplify.c (genericize_eh_spec_block,
627 gimplify_most_not_throw_expr): Adjust.
629 * name-lookup.c (pushdecl_top_level,
630 pushdecl_top_level_and_finish): Move after namespace pushing and
632 (push_to_top_level): Rename to ...
633 (do_push_to_top_level): ... here. Remove timing code.
634 (pop_from_top_level_1): Rename to ...
635 (do_pop_from_top_level): ... here.
636 (do_push_nested_namespace, do_pop_nested_namespace)
637 (push_to_top_level): New wrapper for do_push_to_top_level.
638 (pop_from_top_level): Adjust.
639 (push_nested_namepace, pop_nested_namespace): Wrappers for workers.
641 2017-05-19 Bernd Edlinger <bernd.edlinger@hotmail.de>
643 * config-lang.in (gtfiles): Add c-family/c-format.c,
644 except.c, init.c, lambda.c and friend.c.
645 * class.c (dvirt_fn): Move out of function scope,
647 * except.c (fn1-5, throw_fn, rethrow_fn, spec): Likewise.
648 * init.c (fn): Likewise.
649 * lambda.c (ptr_id, max_id): Likewise.
650 * friend.c (global_friend): Add GTY attribute.
652 2017-05-19 Nathan Sidwell <nathan@acm.org>
654 * call.c (add_list_candidates): Use OVL_FIRST.
655 (build_new_method_call_1): Likewise.
656 * cp-tree.h (OVL_SINGLE_P): New.
657 (TYPE_HIDDEN_P): New.
658 * decl.c (xref_tag_1): Use TYPE_HIDDEN_P.
659 * dump.c (cp_tump_tree): Adjust overload dumping.
660 * error.c (dump_decl): Use OVL_SINGLE_P, simplify context
662 * method.c (lazily_declare_fn): Assert we added it.
663 * parser.c (cp_parser_nested_name_specifier): Use OVL_SINGLE_P,
665 (cp_parser_template_name): Use lkp_iterator.
666 * pt.c (begin_template_parm_list): Fixup comment.
667 (instantiate_class_template_1): Use TYPE_HIDDEN_P.
668 * tree.c (ovl_iterator::remove_node): Cope with inherited ctors.
669 (ovl_scope): Use lkp_iterator.
671 2017-05-19 Thomas Schwinge <thomas@codesourcery.com>
673 * parser.c (cp_parser_omp_clause_default): Handle
674 "OMP_CLAUSE_DEFAULT_PRESENT".
676 * parser.c (cp_parser_omp_clause_default): Avoid printing more
677 than one syntax error message.
679 2017-05-19 Nathan Sidwell <nathan@acm.org>
681 * class.c (class_dump_id): Define.
682 (dump_class_hierarchy, dump_vtable, dump_vtt): Use it.
683 * cp-objcp-common.c (cp_register_dumps): New.
684 * cp-objcp-common.h (cp_register_dumps): Declare.
685 (LANG_HOOKS_REGISTER_DUMPS): Override.
686 * cp-tree.h (class_dump_id): Declare.
688 2017-05-18 Nathan Sidwell <nathan@acm.org>
690 * cp-tree.h (OVL_ARG_DEPENDENT): Delete.
692 (lookup_keep): Declare.
693 * name-lookup.c (add_function): Don't set OVL_ARG_DEPENDENT.
694 * pt.c (tsubst_copy): Assert lookup is persistent.
695 * semantics.c (finish_call_expr): Use lkp_iterator, call
697 * tree.c (ovl_copy): New.
698 (ovl_insert, ovl_iterator::remove_node): Copy immutable nodes.
701 * cp-tree.h (OVL_USED): Replace with ...
702 (OVL_USING_P): ... this.
703 (ovl_iterator::using_p): Adjust.
704 * name-lookup.c (push_overloaded_decl_1,
705 do_nonmember_using_decl): Adjust.
706 * search.c (lookup_field_r): Adjust.
707 * tree.c (ovl_insert, ovl_scope): Adjust.
709 * cp-tree.h (lookup_add): Swap args.
710 (ovl_cons, build_overload): Delete.
711 * name-lookup.c (add_function, push_overloaded_decl_1,
712 do_nonmember_using_decl, merge_functions, remove_hidden_names):
713 Use lookup_add, ovl_insert.
714 * pt.c (check_explicit_specialization): Use lookup_add.
715 (do_class_deduction): Likewise. Refactor if.
716 * tree.c (lookup_add): Swap args.
717 (ovl_cons, build_overload): Delete.
719 * name-lookup.c (find_local_binding): New, broken out of ...
720 (lookup_name_innermost_nonclass_level_1): ... here. Call it.
721 (set_namespace_binding): Swap scope & name args.
722 (namespace_binding_1): Likewise.
723 (pushdecl_maybe_friend_1): Adjust set_namespace_binding call.
724 (push_overloaded_decl_1): Likewise.
725 (set_global_binding): Likewise.
726 (get_namespace_binding): Adjust namespace_binding_1 call.
728 2017-05-17 Nathan Sidwell <nathan@acm.org>
730 * cp-tree.h (default_hash_traits <lang_identifier *>): New
732 * name-lookup.c (lookup_extern_c_fun_in_all_ns): Delete.
733 (extern_c_fns): New hash table.
734 (check_extern_c_conflict): New, broken out of ...
735 (pushdecl_maybe_friend_1): ... here. Call it.
736 (c_linkage_bindings): Just look in hash table.
738 2017-05-17 Ville Voutilainen <ville.voutilainen@gmail.com>
742 Implement new C++ intrinsics __is_assignable and __is_constructible.
743 * cp-tree.h (CPTK_IS_ASSIGNABLE, CPTK_IS_CONSTRUCTIBLE): New.
745 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
746 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
747 * method.c (constructible_expr): Set cp_unevaluated.
748 (is_xible_helper): New.
749 (is_trivially_xible): Adjust.
751 * parser.c (cp_parser_primary_expression): Handle
752 RID_IS_ASSIGNABLE and RID_IS_CONSTRUCTIBLE.
753 (cp_parser_trait_expr): Likewise.
754 * semantics.c (trait_expr_value): Handle
755 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
757 2017-05-17 Nathan Sidwell <nathan@acm.org>
759 * cp-tree.h (ovl_iterator::using_p): New predicate.
760 (ovl_iterator::remove_node): New worker.
761 (ovl_insert): Declare.
762 * tree.c (ovl_insert): New.
763 (ovl_iterator::remove_node): New.
764 * class.c (add_method): Use ovl_iterator, ovl_insert.
765 (clone_function_decl): Fix description.
766 (clone_constructors_and_destructors): Use ovl_iterator.
768 * class.c (handle_using_decl): Use OVL_FIRST, ovl_iterator.
769 (maybe_warn_about_overly_private_class): Use ovl_iterator.
770 (method_name_cmp, resort_method_name_cmp): Use OVL_NAME.
771 (resort_type_method_vec, finish_struct_methods): Use OVL_FIRST.
772 (get_base_fndecls): Use ovl_iterator.
773 (warn_hidden): Use OVL_NAME, ovl_iterator.
774 (add_implicitly_declared_members): Use ovl_iterator.
775 * constraint.cc (normalize_template_id_expression): Use OVL_FIRST,
777 (finish_shorthand_constraint): Simplify, use ovl_make.
778 * pt.c (make_constrained_auto): Simplify. Use ovl_make.
779 * search.c (shared_member_p): Use ovl_iterator.
780 (lookup_field_fuzzy_info::fuzzy_lookup_fn): Use OVL_NAME.
781 (lookup_conversion_operator): Use OVL_FIRST.
782 (lookup_fnfiels_idx_nolazy): Use OVL_FIRST, OVL_NAME.
783 (look_for_overrides_here): Use ovl_iterator.
784 (lookup_conversions_r): Use OVL_FIRST, OVL_NAME, ovl_iterator.
785 * typeck.c (build_x_unary_op): Use ovl_make.
787 2017-05-17 Martin Liska <mliska@suse.cz>
789 * class.c (dump_class_hierarchy): Introduce dump_flags_t type and
790 use it instead of int type.
791 (dump_vtable): Likewise.
792 (dump_vtt): Likewise.
793 * decl2.c (dump_tu): Likewise.
795 2017-05-16 David Malcolm <dmalcolm@redhat.com>
797 * call.c (enforce_access): Add access_failure_info * param and use
798 it to record access failures.
799 * cp-tree.h (class access_failure_info): New class.
800 (enforce_access): Add access_failure_info * param, defaulting to
802 (lookup_member): Likewise.
803 (locate_field_accessor): New function decl.
804 (perform_or_defer_access_check): Add access_failure_info * param,
806 * search.c (lookup_member): Add access_failure_info * param and
807 pass it on to call to perform_or_defer_access_check.
808 (matches_code_and_type_p): New function.
809 (field_access_p): New function.
810 (direct_accessor_p): New function.
811 (reference_accessor_p): New function.
812 (field_accessor_p): New function.
813 (struct locate_field_data): New struct.
814 (dfs_locate_field_accessor_pre): New function.
815 (locate_field_accessor): New function.
816 * semantics.c (perform_or_defer_access_check): Add
817 access_failure_info * param, and pass it on to call to
819 * typeck.c (access_failure_info::record_access_failure): New method.
820 (access_failure_info::maybe_suggest_accessor): New method.
821 (finish_class_member_access_expr): Pass an access_failure_info
822 instance to the lookup_member call, and call its
823 maybe_suggest_accessor method afterwards.
825 2017-05-16 Marek Polacek <polacek@redhat.com>
829 * cp-gimplify.c (cp_fold): Handle SAVE_EXPR.
831 2017-05-16 Nathan Sidwell <nathan@acm.org>
833 * name-lookup.c (check_local_shadow): New, broke out of ...
834 (pushdecl_maybe_friend_1): ... here. Call it.
836 * cp-tree.h (OVL_NESTED_P, OVL_LOOKUP_P): New.
837 (ovl_first): Move inline definition to end of file.
838 (ovl_make, lookup_add): Declare.
839 (get_fns, get_first_fn): Make pure.
840 * tree.c (ovl_cache): New.
841 (ovl_make, lookup_add): New.
842 * pt.c (do_class_deduction): Don't add candidates that will be
845 * call.c (build_user_type_conversion_1): Use OVL_FIRST.
846 (print_error_for_call_failure): Use OVL_NAME.
847 (build_op_call_1): Use ovl_iterator.
848 (add_candidates): Use OVL_FIRST & lkp_iterator.
849 (build_op_delete_call): Use MAYBE_BASELINK_FUNCTIONS &
851 * class.c (deduce_noexcept_on_destructors): Use ovl_iterator.
852 (type_has_user_nondefault_constructor,
853 in_class_defaulted_default_constructor,
854 type_has_user_provided_constructor,
855 type_has_user_provided_or_explicit_constructor,
856 type_has_non_user_provided_default_constructor,
857 vbase_has_user_provided_move_assign,
858 type_has_move_constructor, type_has_move_assign,
859 type_has_user_declared_move_constructor,
860 type_has_user_declared_move_assign,
861 type_build_ctor_call, type_build_dtor_call,
862 type_requires_array_cookie, explain_non_literal_class): Likewise.
863 (finish_struct): Use lkp_iterator.
864 (resolve_address_of_overloaded_function): Use OVL_NAME, lkp_iterator.
865 (note_name_declared_in_class): Use OVL_NAME.
866 * cxx-pretty-print.c (pp_cxx_unqualified_id): Use OVL_FIRST.
867 (pp_cxx_qualified_id, cxx_pretty_printer::id_expression,
868 cxx_pretty_printer::expression): Likewise.
869 * decl2.c (check_classfn): Use ovl_iterator.
870 * pt.c (retrieve_specialization): Use ovl_iterator.
871 * tree.c (cp_tree_equal): Use lkp_iterator.
872 (type_has_nontrivial_copy_init): Use ovl_iterator.
874 * typeck2.c (cxx_incomplete_type_diagnostic): Revert change and
875 check is_overloaded_fn.
877 2017-05-16 Martin Liska <mliska@suse.cz>
879 * parser.c (cp_lexer_print_token): Add default value for flags
880 argument of print_gimple_stmt, print_gimple_expr,
881 print_generic_stmt and print_generic_expr.
883 2017-05-16 Nathan Sidwell <nathan@acm.org>
885 * cp-tree.h (class ovl_iterator, class lkp_iterator): New OVERLOAD
887 (MAYBE_BASELINK_FUNCTIONS): New.
888 * constraint.cc (resolve_constraint_check): Use lkp_iterator.
889 * decl2.c (maybe_warn_sized_delete): Use ovl_iterator.
890 * lambda.c (maybe_generic_this_capture): Use lkp_iterator.
891 * method.c (inherited_ctor_binfo): Use ovl_iterator.
892 (binfo_inherited_from): Likewise.
893 * parser.c (lookup_literal_operator): Use lkp_iterator.
894 * pt.c (iterative_hash_template_arg): Use lkp_iterator.
895 (print_candidates_1): Likewise.
896 (determine_specialization): Likewise.
897 (resolve_overloaded_unification): Likewise.
898 (resolve_nondeduced_context): Likewise.
899 (type_dependent_expression_p): Likewise.
900 (dependent_template_p): Likewise.
901 * ptree.c (cxx_print_xnode): Likewise.
902 * semantics.c (omp_reduction_lookup): Use lkp_iterator.
903 (classtype_has_nothrow_assign_or_copy_p): Use ovl_iterator.
904 * typeck.c (check_template_keyword): Use lkp_iterator.
906 * cp-tree.h (OVL_FIRST, OVL_NAME): New.
908 * constexpr.c (function_concept_check): Use OVL_FIRST.
909 * cvt.c (build_expr_type_conversion): Likewise.
910 * decl.c (poplevel, grokdeclarator): Use OVL_NAME.
911 * decl2.c (mark_used): Use OVL_FIRST.
912 * error.c (dump_decl): Use OVL_FIRST, OVL_NAME.
913 (dump_expr, location_of): Use OVL_FIRST.
914 * friend.c (do_friend): Use OVL_NAME.
915 * init.c (build_offset_ref): Use OVL_FIRST.
916 * mangle.c (write_member_name): Likewise.
917 (write_expression): Use OVL_NAME.
918 * method.c (strip_inheriting_ctors): Use OVL_FIRST.
919 * name-lookup.c (pushdecl_class_level): Use OVL_NAME.
920 * pt.c (check_explicit_specialization): Use OVL_FIRST.
921 (check_template_shadow): Likewise.
922 (tsubst_template_args): Use OVL_NAME.
923 (tsubst_baselink): Use OVL_FIRST.
924 * semantics.c (perform_koenig_lookup): Use OVL_NAME.
925 * tree.c (get_first_fn): Use OVL_FIRST.
926 * typeck.c (finish_class_member_access_expr): Use OVL_NAME.
927 (cp_build_addr_expr_1): Use OVL_FIRST.
929 * pt.c (tsubst_copy_and_build): Remove unnecessary COMPONENT_REF
931 * semantics.c (finish_id_expression): Directly init local var.
932 (finish_omp_reduction_clause): Use really_overloaded_fn.
933 * tree.c (get_fns): Document. Assert we got an overload.
934 (get_first_fn) Document.
935 * typeck.c (cp_build_addr_expr_1): Pass arg directly to
936 really_overloaded_fn.
937 * typeck2.c (cxx_incomplete_type_diagnostic): Use get_first_fn directly.
939 * cp-tree.h (SCOPE_DEPTH): New.
940 * name-lookup.h (is_nested_namespace): Declare.
941 * name-lookup.c (is_nested_namespace): New.
942 (is_ancestor): Use it.
943 (set_decl_namespace): Likewise.
944 (push_namespace): Set SCOPE_DEPTH.
945 * pt.c (check_specialization_namespace): Use is_nested_namespace.
946 (check_unqualigied_spec_or_inst): Likewise.
948 2017-05-15 Nathan Sidwell <nathan@acm.org>
951 * cp-tree.h (DECL_NAMESPACE_INLINE_P): New.
952 * name-lookup.h (push_namespace): Return int, add make_inline arg.
953 * name-lookup.c (push_namespace): Deal with inline directly.
955 * parser.c (cp_parser_namespace_definition): Adjust for
956 push_namespace change.
958 2017-05-11 Nathan Sidwell <nathan@acm.org>
960 * cp-lang.c (get_global_decls, cxx_pushdecl, LANG_HOOK_GETDECLS,
961 LANG_HOOKS_PUSHDECL): Move to ...
962 * cp-objcp-common.c (cp_get_global_decls, cp_pushdec,
963 LANG_HOOK_DECLS, LANG_HOOKS_PUSHDECL): ... here.
964 * cp-objcp-common.h (cp_get_global_decls, cp_pushdecl): Declare.
966 * name-lookup.h (pushdecl): Add default friend parm.
967 (pushdecl_maybe_friend): Delete.
968 (pushdecl_top_level): Add default friend parm.
969 (pushdecl_top_level_maybe_friend): Delete.
970 * name-lookup.c (pushdecl_maybe_friend): Delete.
971 (pushdecl): Add is_friend parm.
972 (pushdecl_top_level): Add is friend_parm.
973 (pushdecl_top_level_maybe_friend, pushdecl_top_level_1): Delete.
974 (pushdecl_top_level_and_finish): Do pushing and finishing directly.
975 * friend.c (do_friend): Adjust.
976 * pt.c (tsubst_friend_class): Adjust.
978 Revert pushdecl_top_level_and_finish name change.
979 * name-lookup.h (pushdecl_top_level_and_finish): Resurrect old name.
980 * name-lookup.c (pushdecl_top_level_and_finish): Likewise.
981 * decl.c (cp_make_fname_decl): Adjust.
982 * decl2.c (get_guard, handle_tls_init): Adjust.
983 * rtti.c (get_tinfo_decl, tinfo_base_init): Adjust.
985 * name-lookup.c (pushdecl_outermost_localscope): Always
986 conditionally stop timer.
988 * decl.c (xref_tag_1): Don't frob ts_lambda scope here.
989 * name-lookup.c (pushtag_1): Deal with ts_lambda scope.
991 * cp-tree.h (pushdecl, pushdecl_maybe_friend, pushtag,
992 pushtag_top_level_maybe_friend,
993 pushdecl_top_level_and_finish): Move declarations to ...
994 * name-lookup.h: ... here. Group pushdecl variants.
995 (pushdecl_top_level_and_finish): Rename to ...
996 (pushdecl_top_level_with_init): ... here.
997 * decl.c (cp_make_fname_decl): Use pushdecl_top_level_with_init.
998 * decl2.c (get_guard, handle_tls_init): Likewise.
999 * rtti.c (get_tinfo_decl, tinfo_base_init): Likewise.
1000 * lambda.c (maybe_add_lambda_conv_op): Use namespace_bindings_p.
1001 * method.c (implicitly_declare_fn): Likewise.
1002 * searchc (node_debug_info_needed): Likewise.
1003 * name-lookup.c (pushdecl_top_level_and_finish): Rename to ...
1004 (pushdecl_top_level_with_init): ... here.
1005 (pop_everything): Use namespace_bindings_p.
1007 * name-lookup.h (pop_binding): Rename to pop_local_binding.
1008 (getdecls): Rename to get_local_decls.
1009 * name-lookup.c (pop_binding): Rename to ...
1010 (pop_local_binding): ... here.
1011 (pop_bindings_and_leave_scope): Adjust.
1012 (getdecls): Rename to ...
1013 (get_local_decls): ... here. Assert local scope.
1014 * decl.c (poplevel): Assert not namespace. Adjust and simplify
1016 (store_parm_decls): Adjust get_local_decls call.
1017 (parser.c (synthesize_implicit_template_parm): Likewise.
1019 2017-05-11 Ville Voutilainen <ville.voutilainen@gmail.com>
1022 * method.c (is_trivially_xible): Reject void types.
1024 2017-05-10 Nathan Sidwell <nathan@acm.org>
1026 * class.c (handle_using_decl): Always use OVL_CURRENT.
1027 (resolve_address_of_overloaded_function): Move iterator decl into
1028 for scope. Don't strip anticipated decls here.
1030 * pt.c (print_candidates_1): Separate TREE_LIST and OVERLOAD
1032 (print_candidates): Adjust.
1034 * cp-tree.h (build_new_function_call): Lose koenig_p arg. Fix
1036 * call.c (build_new_function_call): Lose koenig_p arg. Remove
1037 koenig_p handling here.
1038 * pt.c (push_template_decl_real): Unconditionally retrofit_lang_decl.
1039 (tsubst_omp_clauses): Likewise.
1040 (do_class_deduction): Adjust buld_new_function_call calls.
1041 * semantics.c (finish_call_expr): Likewise.
1043 2017-05-10 Jason Merrill <jason@redhat.com>
1045 * pt.c (unify_parameter_deduction_failure, unify_cv_qual_mismatch)
1046 (unify_type_mismatch, unify_parameter_pack_mismatch)
1047 (unify_ptrmem_cst_mismatch, unify_expression_unequal)
1048 (unify_parameter_pack_inconsistent, unify_inconsistency)
1049 (unify_vla_arg, unify_method_type_error, unify_arity)
1050 (unify_arg_conversion, unify_no_common_base)
1051 (unify_inconsistent_template_template_parameters)
1052 (unify_template_deduction_failure)
1053 (unify_template_argument_mismatch)
1054 (unify_overload_resolution_failure): Call unify_invalid.
1056 CWG 1847 - Clarifying compatibility during partial ordering
1057 * pt.c (more_specialized_fn): No order between two non-deducible
1060 * pt.c (dependent_type_p): Make sure we aren't called with
1063 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
1064 * pt.c (convert_template_argument): Just return an argument pack.
1065 (coerce_template_parameter_pack, template_parm_to_arg)
1066 (extract_fnparm_pack, make_argument_pack, tsubst_template_args)
1067 (tsubst_decl, tsubst, type_unification_real, unify_pack_expansion):
1068 Don't set the type of a NONTYPE_ARGUMENT_PACK.
1069 * parser.c (make_char_string_pack, make_string_pack): Likewise.
1071 2017-05-10 Nathan Sidwell <nathan@acm.org>
1073 * cp-tree.h (add_method, clone_function_decl): Change last arg to
1075 * class.c (add_method): Change third arg to bool. Adjust.
1076 (one_inheriting_sig, one_inherited_ctor): Adjust.
1077 (clone_function_decl): Change 2nd arg to bool. Adjust.
1078 (clone_constructors_and_destructors): Adjust.
1079 * lambda.c (maybe_add_lambda_conv_op): Adjust.
1080 * method.c (lazily_declare_fn): Adjust.
1081 * pt.c (tsubst_decl, instantiate_template_1): Adjust.
1082 * semantics.c (finish_member_declaration): Adjust.
1084 2017-05-10 Paolo Carlini <paolo.carlini@oracle.com>
1087 * decl.c (finish_function): To improve error recovery, change the
1088 logic for calling apply_deduced_return_type.
1090 2017-05-09 Jason Merrill <jason@redhat.com>
1092 PR c++/80605 - __is_standard_layout and empty base
1093 * class.c (check_bases): Ignore empty bases.
1095 PR c++/70979 - literal class and closure types
1096 * class.c (finalize_literal_type_property): Handle closures
1098 (explain_non_literal_class): Likewise.
1100 PR c++/66297, DR 1684 - literal class and constexpr member fns
1101 * constexpr.c (is_valid_constexpr_fn): Only complain about
1102 non-literal enclosing class in C++11.
1103 * class.c (finalize_literal_type_property): Likewise.
1105 2017-05-09 Paolo Carlini <paolo.carlini@oracle.com>
1108 * pt.c (tsubst_decl): Early return error_mark_node if
1109 grok_ctor_properties returns false.
1111 2017-05-09 Jason Merrill <jason@redhat.com>
1113 PR c++/70167 - array prvalue treated as lvalue
1114 * cp-tree.h (CONSTRUCTOR_C99_COMPOUND_LITERAL): New.
1116 * semantics.c (finish_compound_literal): Add fcl_context parameter.
1117 Only make a static variable for C99 syntax.
1118 * parser.c (cp_parser_postfix_expression): Pass it.
1119 * pt.c (tsubst_copy_and_build): Likewise.
1120 * call.c (extend_ref_init_temps): Set
1121 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
1123 2017-05-09 Nathan Sidwell <nathan@acm.org>
1125 * cp-lang.c (get_global_decls, cxx_pushdecl): New.
1126 (LANG_HOOKS_GETDECLS, LANG_HOOKS_PUSHDECL): Override.
1127 * name-lookup.h (pushdecl_top_level): Declare.
1129 2017-05-08 Jason Merrill <jason@redhat.com>
1131 PR c++/80178 - parameter passing for uncopyable classes
1132 * tree.c (type_has_nontrivial_copy_init): True for classes with only
1133 deleted copy/move ctors.
1134 (remember_deleted_copy, maybe_warn_parm_abi): New.
1135 * decl.c (require_complete_types_for_parms, check_function_type):
1136 Call maybe_warn_parm_abi.
1137 * call.c (convert_for_arg_passing, build_cxx_call): Likewise.
1139 2017-05-08 Nathan Sidwell <nathan@acm.org>
1141 * decl.c (builtin_function_1): Set DECL_ANTICIPATED before pushing.
1142 (start_preparsed_function): Do decl pushing before setting
1143 current_funciton_decl and announcing it.
1145 * name-lookup.h (pushdecl_with_scope): Replace with ...
1146 (pushdecl_outermost_localscope): ... this.
1147 * name-lookup.c (pushdecl_with_scope): Replace with ...
1148 (pushdecl_outermost_localscope): ... this.
1149 (pushdecl_namespace_level): Adjust.
1150 * decl.c (cp_make_fname_decl): Use pushdecl_outermost_localscope.
1151 * lambda.c (insert_capture_proxy): Likewise.
1153 * class.c (build_vtbl_initializer): Don't shadow outer variable
1156 Revert _binding -> _value change.
1157 * name-lookup.h (get_namespace_value, set_global_value): Rename to ...
1158 (get_namespace_binding, set_global_binding): ... these.
1159 * name-lookup.c (get_namespace_value, set_global_value): Rename to ...
1160 (get_namespace_binding, set_global_binding): ... these.
1161 (arg_assoc_namespace, pushdecl_maybe_friend_1,
1162 check_for_out_of_scope_variable, push_overloaded_decl_1,
1163 lookup_name_innermost_nonclass_level, push_namespace): Adjust.
1164 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
1165 SET_IDENTIFIER_GLOBAL_VALUE): Adjust.
1166 * decl.c (poplevel): Adjust.
1167 * pt.c (make_constrained_auto): Likewise.
1169 2017-05-07 Volker Reichelt <v.reichelt@netcologne.de>
1171 PR translation/80280
1172 * call.c (print_z_candidate): Fix quoting.
1174 2017-05-05 David Malcolm <dmalcolm@redhat.com>
1176 * error.c (pedwarn_cxx98): Replace report_diagnostic
1177 with diagnostic_report_diagnostic.
1179 2017-05-05 Nathan Sidwell <nathan@acm.org>
1181 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value.
1182 (SET_IDENTIFIER_GLOBAL_VALUE): Use set_global_value.
1183 (IDENTIFIER_NAMESPACE_VALUE): Delete.
1184 * name-lookup.h (namespace_binding, set_namespace_binding): Replace
1186 (get_namespace_value, set_global_value): ... these.
1187 (get_global_value_if_present, is_typename_at_global_scope): Delete.
1188 * decl.c (poplevel): Use get_namespace_value.
1189 (grokdeclarator): Use IDENTIFIER_GLOBAL_VALUE.
1190 * class.c (build_vtbl_initializer): Stash library decl in
1191 static var. Use IDENTIFIER_GLOBAL_VALUE.
1192 * except.c (do_get_exception_ptr, do_begin_catch, do_end_catch,
1193 do_allocate_exception, do_free_exception, build_throw): Likewise.
1194 * init.c (throw_bad_array_new_length): Likewise.
1195 * rtti.c (throw_bad_cast, throw_bad_typeid): Likewise.
1196 * name-lookup.c (arg_assoc_namespace, pushdecl_maybe_friend_1,
1197 check_for_our_of_scope_variable, push_overloaded_decl_1): Use
1198 get_namespace_value.
1199 (set_namespace_binding_1): Rename to
1200 (set_namespace_binding): ... here.
1201 (set_global_value): New.
1202 (lookup_name_innermost_nonclass_level_1, push_namespace): Use
1203 get_namespace_value.
1204 * pt.c (listify): Use get_namespace_value.
1206 * call.c (make_temporary_var_for_ref_to_temp): Push decl into
1208 * lex.c (unqualified_name_lookup_error): Likewise.
1210 * class.c (alter_class): Use retrofit_lang_decl directly.
1211 * decl.c (push_local_name, dupliate_decls): Likewise.
1212 * semantics.c (omp_privatize_field): Likewise.
1214 Kill walk_namespaces.
1215 * cp-tree.h (walk_namespaces_fn, walk_namespaces): Delete.
1216 * decl.c (walk_namespaces_r, walk_namespaces): Delete.
1218 Kill per-namespace static_decls.
1219 * cp-tree.h (static_decls): Declare.
1220 (wrapup_globals_for_namespace,
1221 diagnose_inline_vars_for_namespace): Replace with ...
1222 (wrapup_namespace_globals): ... this.
1223 * decl.c (static_decls): Define.
1224 (wrapup_globals_for_namespace,
1225 diagnose_inline_vars_for_namespace): Replace with ...
1226 (wrapup_namespace_globals): ... this.
1227 (cxx_init_decl_processing): Initialize static_decls.
1228 * decl2.c (c_parse_final_cleanups): Adjust.
1229 * name-lookup.h (cp_binding_level): Remove static_decls member.
1230 * name-lookup.c (add_decl_to_level): Adjust.
1231 (begin_scope): Adjust.
1233 2017-05-05 Paolo Carlini <paolo.carlini@oracle.com>
1236 * decl.c (reshape_init): Unconditionally return error_mark_node
1237 upon error about too many initializers.
1239 2017-05-04 Nathan Sidwell <nathan@acm.org>
1241 * constraint.cc (diagnose_check_constraint): Fix %E thinko.
1243 2017-05-04 Martin Sebor <msebor@redhat.com>
1245 PR translation/80280
1246 * call.c (print_z_candidate): Add missing quoting to %D and other
1248 (build_op_call_1): Same.
1249 * constraint.cc (diagnose_check_constraint): Same.
1250 * mangle.c (mangle_decl): Same.
1251 * name-lookup.c (cp_binding_level_debug): Same.
1252 (set_decl_namespace): Same.
1253 * parser.c (cp_parser_tx_qualifier_opt): Same.
1254 * pt.c (print_candidates_1): Same.
1255 (check_template_variable): Same.
1256 (tsubst_default_argument): Same.
1257 (most_specialized_partial_spec): Same.
1258 * semantics.c (omp_reduction_lookup): Same.
1259 * tree.c (check_abi_tag_redeclaration): Same.
1260 * typeck.c (comptypes): Same.
1261 * typeck2.c (abstract_virtuals_error_sfinae): Same.
1263 2017-05-04 Nathan Sidwell <nathan@acm.org>
1266 * cp-tree.h (enum cp_tree_index): Add CPTI_GLOBAL,
1267 CPTI_GLOBAL_TYPE, CPTI_GLOBAL_IDENTIFIER, CPTI_ANON_IDENTIFIER,
1268 CPTI_INIT_LIST_IDENTIFIER.
1269 (global_namespace, global_type_node, global_identifier,
1270 anon_identifier, init_list_identifier): New.
1271 * decl.c (global_type_node, global_scope_name): Delete.
1272 (initialize_predefined_identifiers): Add new identifiers.
1273 (cxx_init_decl_processing): Adjust.
1274 * name-lookup.h (global_namespace, global_type_node): Delete.
1275 * name-lookup.c (global_namespace, anonymous_namespace_name,
1276 get_anonymous_namespace_name): Delete.
1277 (namespace_scope_ht_size, begin_scope, pushtag_1,
1278 push_namespace): Adjust,
1279 * call.c (type_has_extended_temps): Use init_list_identifier.
1280 * pt.c (listify): Likewise.
1282 * name-lookup.c: Reorder functions to make merging from modules
1285 2017-05-03 Jason Merrill <jason@redhat.com>
1287 * constexpr.c (cxx_eval_outermost_constant_expr): Use TV_CONSTEXPR.
1289 2017-05-03 Nathan Sidwell <nathan@acm.org>
1291 * cp-tree.h (enum cp_tree_index, cp_global_trees): Move earlier,
1292 along with #defines, to before name-lookup include.
1294 2017-05-02 Paolo Carlini <paolo.carlini@oracle.com>
1296 * pt.c (is_auto_or_concept): Remove.
1297 (type_uses_auto_or_concept): Remove, unused.
1298 (find_parameter_packs_r, extract_autos_r, is_auto_r): Adjust.
1299 * parser.c (tree_type_is_auto_or_concept): Remove, unused.
1300 * cp-tree.h (is_auto_or_concept): Remove.
1302 2017-05-01 Xi Ruoyao <ryxi@stu.xidian.edu.cn>
1305 * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Don't
1306 add pedigree operation and detach call here.
1307 * cp-gimplify.c (cp_gimplify_expr): Remove the calls to
1308 cilk_cp_gimplify_call_params_in_spawned_fn.
1309 (cilk_cp_gimplify_call_params_in_spawned_fn): Remove function.
1310 * semantics.c (simplify_aggr_init_expr): Copy EXPR_CILK_SPAWN.
1312 2017-04-29 Volker Reichelt <v.reichelt@netcologne.de>
1314 * parser.c (cp_parser_member_declaration): Add fix-it hints for
1315 stray comma and missing semicolon at end of member declaration.
1317 2017-04-27 Volker Reichelt <v.reichelt@netcologne.de>
1319 * parser.c (cp_parser_cast_expression): Add target type of cast to
1321 * error.c (type_to_string): Add '{enum}' suffix to enumeration types.
1323 2017-04-26 Paolo Carlini <paolo.carlini@oracle.com>
1325 * decl.c (grok_ctor_properties, ambi_op_p, unary_op_p): Change
1326 return type to bool.
1327 * cp-tree.h (grok_ctor_properties): Update.
1329 2017-04-26 Volker Reichelt <v.reichelt@netcologne.de>
1331 * parser.c (cp_parser_nested_name_specifier_opt): Add fix-it
1332 information to diagnostic of invalid colon in nested-name-specifier.
1334 2017-04-25 Volker Reichelt <v.reichelt@netcologne.de>
1336 * parser.c (cp_parser_elaborated_type_specifier): Add fix-it to
1337 diagnostic of invalid class/struct keyword after enum.
1339 2017-04-25 David Malcolm <dmalcolm@redhat.com>
1341 * parser.c (cp_parser_member_declaration): Add fix-it hint
1342 for removing stray semicolons.
1344 2017-04-25 David Malcolm <dmalcolm@redhat.com>
1346 * name-lookup.c (get_std_name_hint): New function.
1347 (maybe_suggest_missing_header): New function.
1348 (suggest_alternative_in_explicit_scope): Call
1349 maybe_suggest_missing_header.
1351 2017-04-25 David Malcolm <dmalcolm@redhat.com>
1354 * name-lookup.c (suggest_alternative_in_explicit_scope): Convert
1355 candidate type of bm from tree to const char *.
1356 (consider_binding_level): Likewise.
1357 (lookup_name_fuzzy): Likewise, using this to merge the best
1358 result from the preprocessor into bm, rather than immediately
1359 returning, so that better matches from reserved words can "win".
1360 Guard the rejection of keywords that don't start decl-specifiers
1361 so it only happens for FUZZY_LOOKUP_TYPENAME.
1363 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
1365 * decl.c (grokdeclarator): Use %qT instead of %<%T%> in diagnostics.
1366 (start_enum): Likewise.
1367 (build_enumerator): Likewise. Use %qE instead of plain %E.
1368 * parser.c (cp_parser_mem_initializer_list): Use %qD instead of
1369 %<%D%> in diagnostics.
1370 (cp_parser_elaborated_type_specifier): Likewise.
1371 * pt.c (make_pack_expansion): Use %qT and %qE instead of
1372 %<%T%> and %<%E%> in diagnostics.
1373 (tsubst_pack_expansion): Likewise.
1375 2017-04-24 David Malcolm <dmalcolm@redhat.com>
1378 * parser.c (cp_parser_unary_expression): Generate a location
1379 range for alignof and sizeof expressions.
1381 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
1383 * parser.c (cp_parser_cv_qualifier_seq_opt): Add fix-it info to
1385 (cp_parser_virt_specifier_seq_opt): Likewise.
1386 (set_and_check_decl_spec_loc): Likewise twice.
1388 2017-04-21 Jason Merrill <jason@redhat.com>
1390 PR c++/80179 - ICE with initialized flexible array member.
1391 * constexpr.c (verify_ctor_sanity): Handle flexible array members.
1393 2017-04-21 Richard Biener <rguenther@suse.de>
1395 * cp-tree.h (copy_decl): Annotate with CXX_MEM_STAT_INFO.
1396 (copy_type): Likewise.
1397 * lex.c (copy_decl): Pass down mem-stat info.
1398 (copy_type): Likewise.
1400 2017-04-20 Jonathan Wakely <jwakely@redhat.com>
1403 * init.c (build_new_1): Suppress notes about over-aligned new when
1404 the warning is suppressed.
1406 2017-04-20 Volker Reichelt <v.reichelt@netcologne.de>
1408 * parser.c (cp_parser_member_declaration): Add warning with fixit
1409 information for extra semicolon after in-class function definition.
1411 2017-04-20 Jakub Jelinek <jakub@redhat.com>
1414 * tree.c (build_cplus_array_type): Call build_array_type
1415 with the intended TYPE_TYPELESS_STORAGE flag value, instead
1416 of calling build_array_type and modifying later TYPE_TYPELESS_STORAGE
1419 2017-04-18 Marek Polacek <polacek@redhat.com>
1421 PR c++/80244 - ICE with attribute in template alias.
1422 * tree.c (strip_typedefs): Handle UNDERLYING_TYPE.
1424 PR c++/80241 - ICE with alignas pack expansion.
1425 * error.c (dump_expr): Handle TREE_LIST.
1426 * parser.c (cp_parser_std_attribute_list): Return error_mark if
1427 make_pack_expansion returns an error.
1429 2017-04-17 Bernd Edlinger <bernd.edlinger@hotmail.de>
1432 * class.c (fixup_may_alias): Fix all type variants.
1434 2017-04-17 Jason Merrill <jason@redhat.com>
1436 PR c++/80415 - wrong error with default arg and array reference.
1437 * tree.c (lvalue_kind): Return clk_class for an array prvalue.
1439 * pt.c (tsubst_init): Set TARGET_EXPR_DIRECT_INIT_P.
1441 2017-04-15 Alexandre Oliva <aoliva@redhat.com>
1443 * decl.c (name_unnamed_type): Split out of...
1444 (grokdeclarator): ... this.
1445 * decl.h (name_unnamed_type): Declare.
1447 2017-04-12 Richard Biener <rguenther@suse.de>
1448 Bernd Edlinger <bernd.edlinger@hotmail.de>
1451 * tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
1452 for arrays of character or std::byte type.
1454 2017-04-11 Jason Merrill <jason@redhat.com>
1456 PR c++/80294 - ICE with constexpr and inheritance.
1457 * constexpr.c (reduced_constant_expression_p):
1458 A null constructor element is non-constant.
1459 (cxx_eval_indirect_ref): Don't VERIFY_CONSTANT before
1460 returning an empty base.
1462 2017-04-11 Jakub Jelinek <jakub@redhat.com>
1465 * decl.c (cp_finish_decomp): If processing_template_decl on
1466 non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't
1467 change their DECL_VALUE_EXPR nor cp_finish_decl them. Instead make
1468 sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst
1470 * pt.c (value_dependent_expression_p) <case VAR_DECL>: For variables
1471 with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
1474 2017-04-11 Jakub Jelinek <jakub@redhat.com>
1477 * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.
1479 2017-04-10 Jakub Jelinek <jakub@redhat.com>
1482 * tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
1483 operand, if it is a static member function, recurse on the
1486 2017-04-10 Marek Polacek <polacek@redhat.com>
1489 * typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL. Set
1490 ORIG_TYPE earlier and not only when shortening.
1492 2017-04-07 Jason Merrill <jason@redhat.com>
1494 PR c++/80356 - ICE with reference to function template argument.
1496 * pt.c (convert_nontype_argument_function): Adjust type even with a
1497 value-dependent argument.
1499 PR c++/80267 - ICE with nested capture of reference
1501 * pt.c (tsubst_copy): Handle lookup finding a capture proxy.
1503 2017-04-07 Marek Polacek <polacek@redhat.com>
1506 * typeck.c (cp_build_binary_op): Convert COP[01] to ORIG_TYPE.
1509 * call.c (build_over_call): Don't check cxx_dialect.
1510 * cp-gimplify.c (cp_gimplify_init_expr): Don't check cxx_dialect nor
1511 whether SUB is a CONSTRUCTOR.
1512 * init.c (build_new_1): Don't check cxx_dialect.
1513 * tree.c (replace_placeholders): Add a function comment. Return if
1514 not in C++14, or if the object isn't a (member of a) class.
1515 * typeck2.c (store_init_value): Don't check cxx_dialect nor whether
1516 TYPE is CLASS_TYPE_P.
1518 2017-04-05 Jakub Jelinek <jakub@redhat.com>
1521 * pt.c (canonical_type_parameter): Use vec_safe_grow_cleared instead
1522 of a loop doing vec_safe_push of NULL. Formatting fixes.
1523 (rewrite_template_parm): Copy TEMPLATE_PARM_PARAMETER_PACK from oldidx
1524 to newidx before calling canonical_type_parameter on newtype.
1526 2017-04-04 Volker Reichelt <v.reichelt@netcologne.de>
1529 * cxx-pretty-print.c (cxx_pretty_printer::expression): Add
1530 UNARY_PLUS_EXPR case.
1532 2017-04-03 Jason Merrill <jason@redhat.com>
1534 * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
1536 2017-04-03 Jonathan Wakely <jwakely@redhat.com>
1538 * class.c (update_vtable_entry_for_fn): Fix typo in comment.
1539 * decl2.c (one_static_initialization_or_destruction): Likewise.
1540 * name-lookup.c (store_bindings): Likewise.
1541 * parser.c (make_call_declarator): Likewise.
1542 * pt.c (check_explicit_specialization): Likewise.
1544 2017-04-03 Jason Merrill <jason@redhat.com>
1546 PR sanitizer/79993 - ICE with VLA initialization from string
1547 PR c++/69487 - wrong VLA initialization from string
1548 * init.c (finish_length_check): Split out from build_vec_init.
1549 (build_vec_init): Handle STRING_CST.
1550 * typeck2.c (split_nonconstant_init): Handle STRING_CST.
1551 (digest_init_r): Don't give a STRING_CST VLA type.
1553 2017-03-31 Jakub Jelinek <jakub@redhat.com>
1556 * cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
1557 REFERENCE_TYPE. Adjust ubsan_maybe_instrument_reference caller
1558 for NOP_EXPR to REFERENCE_TYPE.
1561 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
1562 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
1564 * semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
1565 Remove extraneous parens.
1566 (finish_trait_expr): Handle CPTK_IS_AGGREGATE.
1567 * parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
1568 (cp_parser_trait_expr): Likewise.
1570 2017-03-27 Jakub Jelinek <jakub@redhat.com>
1573 * cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
1574 * typeck.c (cxx_mark_addressable): Likewise. Look through
1575 VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
1577 (cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
1579 2017-03-24 Jason Merrill <jason@redhat.com>
1581 PR c++/77339 - ICE with invalid use of alias template.
1582 * pt.c (lookup_template_class_1): Don't try to enter the scope of an
1585 2017-03-24 Marek Polacek <polacek@redhat.com>
1588 * cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
1589 doesn't have side effects.
1591 2017-03-23 Jason Merrill <jason@redhat.com>
1593 PR c++/80150 - ICE with overloaded variadic deduction.
1594 * pt.c (try_one_overload): Remove asserts.
1596 PR c++/77563 - missing ambiguous conversion error.
1597 * call.c (convert_like_real): Use LOOKUP_IMPLICIT.
1599 2017-03-23 Marek Polacek <polacek@redhat.com>
1601 * cp-tree.h: Remove a C_RID_YYCODE reference.
1603 2017-03-22 Jakub Jelinek <jakub@redhat.com>
1606 * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
1607 case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
1608 processing_template_decl.
1610 2017-03-21 Paolo Carlini <paolo.carlini@oracle.com>
1613 * name-lookup.c (pushtag_1): Add check for bogus, non template,
1614 std::initializer_list.
1616 2017-03-21 Jakub Jelinek <jakub@redhat.com>
1619 * init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.
1621 2017-03-21 Ville Voutilainen <ville.voutilainen@gmail.com>
1624 * init.c (std_placement_new_fn_p): New.
1625 (build_new_1): Call it.
1627 2017-03-20 Jason Merrill <jason@redhat.com>
1629 PR c++/80096 - ICE with C++17 non-type auto.
1630 * pt.c (tsubst): Delay tsubst of type of template non-type
1633 PR c++/79519 - ICE with deleted template friend.
1634 * decl.c (grokdeclarator): Complain about misplaced function
1635 definition using =, as well.
1637 PR c++/79640 - infinite recursion with generic lambda.
1638 * pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
1639 before substituting its initializer.
1641 2017-03-20 Marek Polacek <polacek@redhat.com>
1642 Paolo Carlini <paolo.carlini@oracle.com>
1644 PR c++/80059 - ICE with noexcept and __transaction_atomic
1645 * except.c (build_must_not_throw_expr): Call
1646 instantiate_non_dependent_expr.
1648 2017-03-19 Jason Merrill <jason@redhat.com>
1650 PR c++/80084 - wrong C++17 decomposition by reference of parameter.
1651 * decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
1652 reference decomposition.
1654 PR c++/80077 - error with constexpr and -fno-elide-constructors.
1655 * constexpr.c (cxx_eval_call_expression): Set ctx->call while
1656 expanding trivial constructor.
1658 2017-03-17 Jason Merrill <jason@redhat.com>
1660 PR c++/78345 - ICE initializing array from lambda.
1661 * init.c (build_aggr_init): Check array initializer.
1662 (build_vec_init): Check the type of a CONSTRUCTOR.
1664 PR c++/80073 - C++17 ICE with virtual base.
1665 * decl.c (xref_basetypes): Also check for indirect vbases.
1667 2017-03-16 Jason Merrill <jason@redhat.com>
1669 * decl.c (start_enum): std::byte aliases anything.
1672 * constexpr.c (lookup_placeholder): Tweak.
1674 2017-03-15 Jason Merrill <jason@redhat.com>
1676 PR c++/80043 - ICE with -fpermissive
1677 * typeck.c (convert_for_assignment): Handle instantiate_type
1678 not giving an error.
1680 2017-03-14 Nathan Sidwell <nathan@acm.org>
1682 PR c++/79393 DR 1658 workaround
1683 * method.c (synthesized_method_base_walk): Inihibit abstract class
1684 virtual base access check here.
1685 (synthesized_method_walk): Not here.
1687 2017-03-13 Nathan Sidwell <nathan@acm.org>
1689 PR c++/79393 DR 1658 workaround
1690 * method.c (synthesized_method_walk): Check vbases of abstract
1691 classes for dtor walk.
1693 2017-03-10 David Malcolm <dmalcolm@redhat.com>
1695 PR translation/79848
1696 * decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
1698 2017-03-10 Jason Merrill <jason@redhat.com>
1700 PR c++/79960 - alias templates and partial ordering
1701 * pt.c (comp_template_args): Add partial_order parm.
1702 (template_args_equal): Likewise.
1703 (comp_template_args_porder): New.
1704 (get_partial_spec_bindings): Use it.
1706 2017-03-10 Marek Polacek <polacek@redhat.com>
1709 * decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
1711 2017-03-10 Jakub Jelinek <jakub@redhat.com>
1714 * optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
1715 Use XALLOCAVEC macro.
1718 * decl.c (finish_enum_value_list): If value is error_mark_node,
1719 don't copy it and change its type.
1720 * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
1721 of CONST_DECL is error_mark_node.
1723 2017-03-09 Marek Polacek <polacek@redhat.com>
1725 PR c++/79900 - ICE in strip_typedefs
1726 * tree.c (strip_typedefs): Skip the attribute handling if T is
1727 a variant type which hasn't been updated yet.
1729 PR c++/79687 - wrong code with pointer-to-member
1730 * init.c (constant_value_1): Break if the variable has a dynamic
1733 2017-03-08 Jason Merrill <jason@redhat.com>
1735 PR c++/79797 - ICE with self-reference in array DMI.
1736 * constexpr.c (lookup_placeholder): Split out...
1737 (cxx_eval_constant_expression): ...from here.
1739 2017-03-07 Jakub Jelinek <jakub@redhat.com>
1742 * parser.c (cp_parser_omp_cancellation_point,
1743 cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
1744 cp_parser_omp_target_update): Change "may only be used in compound
1745 statements" diagnostics, such that the same translatable string is
1746 used for all pragmas.
1747 (cp_parser_pragma): Likewise. Use error_at instead of
1748 cp_parser_error for that diagnostics.
1750 2017-03-06 Marek Polacek <polacek@redhat.com>
1752 PR c++/79796 - ICE with NSDMI and this pointer
1753 * call.c (build_over_call): Handle NSDMI with a 'this' by calling
1754 replace_placeholders.
1756 2017-03-06 Jakub Jelinek <jakub@redhat.com>
1759 * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
1762 2017-03-06 Jason Merrill <jason@redhat.com>
1764 Revert "Allow deduction guides to look into primary template."
1765 * cp-tree.h, parser.c, pt.c, search.c: Revert.
1767 2017-03-05 Paolo Carlini <paolo.carlini@oracle.com>
1770 * except.c (build_must_not_throw_expr): Perform the implicit
1771 conversions on the condition.
1773 2017-03-03 Jason Merrill <jason@redhat.com>
1775 * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
1778 Core issues 2273 and 2277
1779 * call.c (joust): Adjust using-declaration tiebreaker to handle
1780 the intermediate base case.
1781 * method.c (strip_inheriting_ctors): Just return the argument if
1782 !flag_new_inheriting_ctors.
1784 2017-03-03 Richard Biener <rguenther@suse.de>
1787 * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
1789 2017-03-03 Marek Polacek <polacek@redhat.com>
1792 * typeck.c (string_conv_p): In C++11, always call pedwarn with
1795 2017-03-02 Jason Merrill <jason@redhat.com>
1797 Update overload resolution with deduction guides.
1798 * pt.c (do_class_deduction): Always build the copy guide.
1799 (copy_guide_p, template_guide_p): New.
1800 (build_deduction_guide): Remember the original constructor.
1801 * call.c (joust): Prefer the copy guide and non-template guides.
1803 Allow deduction guides to look into primary template.
1804 * cp-tree.h (struct saved_scope): Add deduction_guide_type.
1805 (struct cp_decl_specifier_seq): Add constructor_p.
1806 * parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
1807 (cp_parser_init_declarator): Check it. Set ctor_dtor_or_conv_p.
1808 Clear deduction_guide_type. Don't handle deduction guide names.
1809 (cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
1810 (cp_parser_direct_declarator): Likewise. Handle deduction guides.
1811 (cp_parser_member_declaration, cp_parser_cache_defarg)
1812 (cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
1813 * pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
1814 (build_deduction_guide): Set deduction_guide_type.
1815 (dependent_scope_p): Check deduction_guide_type.
1816 * search.c (lookup_member): Likewise.
1818 2017-03-02 Jakub Jelinek <jakub@redhat.com>
1821 * init.c (mark_exp_read_r): New function.
1822 (emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
1823 whole arguments instead of plain mark_exp_read on TREE_LIST values.
1825 2017-03-01 Jason Merrill <jason@redhat.com>
1827 Class template argument deduction in new-expression
1828 * init.c (build_new): Handle deduction from no initializer.
1829 * parser.c (cp_parser_new_expression): Don't require a single
1830 expression for class template deduction.
1831 * typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
1832 class template placeholder.
1833 * pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
1834 (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
1835 (redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
1837 2017-03-01 Jakub Jelinek <jakub@redhat.com>
1840 * init.c (emit_mem_initializers): When not constructing vbases of
1841 abstract classes, mark arguments as read for
1842 -Wunused-but-set-parameter.
1844 2017-02-28 Jason Merrill <jason@redhat.com>
1846 Class template argument deduction refinements
1847 * call.c (joust): Move deduction guide tiebreaker down.
1848 * decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
1849 deduction with no initializer.
1850 * pt.c (build_deduction_guide): Handle implicit default/copy ctor.
1851 (do_class_deduction): Use that rather than special case.
1852 (do_auto_deduction): Handle null initializer.
1854 2017-02-28 Jakub Jelinek <jakub@redhat.com>
1856 * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
1857 instead of just cond ? "..." : "...".
1858 (grokdeclarator): Likewise.
1859 (build_enumerator): Likewise.
1860 * init.c (build_new_1): Likewise.
1861 * call.c (build_new_method_call_1): Likewise.
1862 * parser.c: Include intl.h.
1863 (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
1864 "enter"/"exit" keyword.
1865 (cp_finalize_oacc_routine): Don't use %s to supply portions of the
1868 2017-02-27 Jason Merrill <jason@redhat.com>
1870 PR c++/71568 - SFINAE forming pointer to member function
1871 * init.c (build_offset_ref): Check the return value of
1872 perform_or_defer_access_check.
1874 2017-02-27 Marek Polacek <polacek@redhat.com>
1876 * decl.c (expand_static_init): Add missing } in a comment.
1878 2017-02-27 Volker Reichelt <v.reichelt@netcologne.de>
1880 * init.c: Include intl.h.
1881 (build_new_1): Move message strings into pedwarn to make them
1882 -Wformat-security friendly. Mark string for translation.
1883 * pt.c (tsubst_copy_and_build): Mark string for translation.
1884 Make the pointer const.
1885 * semantics.c (finish_id_expression): Mark strings for translation.
1887 2017-02-25 Jakub Jelinek <jakub@redhat.com>
1889 * call.c (build_op_delete_call): Make msg1 and msg2 const.
1891 2017-02-24 Jakub Jelinek <jakub@redhat.com>
1894 * call.c (build_over_call): Call check_function_arguments even for
1895 -Wrestrict, adjust check_function_arguments caller.
1896 * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
1898 * typeck.c (cp_build_function_call_vec): Adjust
1899 check_function_arguments caller.
1901 2017-02-24 Marek Polacek <polacek@redhat.com>
1903 PR translation/79705
1904 * decl.c (check_redeclaration_exception_specification): Mark a string
1905 for translation. Make the pointer const.
1907 2017-02-23 Paolo Carlini <paolo.carlini@oracle.com>
1910 * pt.c (register_specialization): Check duplicate_decls return value
1911 for error_mark_node and pass it back.
1913 2017-02-22 Jason Merrill <jason@redhat.com>
1915 PR c++/79679 - missing destructor for argument
1916 * call.c (build_over_call): Don't pass tf_no_cleanup to argument
1919 * pt.c (do_class_deduction): Handle 0 argument case.
1921 2017-02-22 Jakub Jelinek <jakub@redhat.com>
1924 * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
1925 SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
1926 * constexpr.c (potential_constant_expression_1): Handle
1927 OMP_*, OACC_* and CILK_* trees. Use error_at with
1928 EXPR_LOC_OR_LOC (t, input_location) computed early
1929 instead of error, or error_at with location_of (t).
1931 2017-02-22 Marek Polacek <polacek@redhat.com>
1934 * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
1935 if the alignas expression is erroneous.
1936 * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
1940 * semantics.c (finish_underlying_type): Bail out for incomplete enums.
1942 2017-02-21 Jason Merrill <jason@redhat.com>
1944 PR c++/50308 - wrong deprecated warning with ADL
1945 PR c++/17729 - duplicate deprecated warning
1946 * semantics.c (finish_id_expression): Only call mark_used on a
1947 function if we aren't building a call.
1949 PR c++/41727 - ICE with partial spec of partial instantiation
1950 * pt.c (process_partial_specialization): For now, don't check more
1951 specialized if there is more than one level of args.
1953 2017-02-21 Marek Polacek <polacek@redhat.com>
1956 * cp-tree.h (maybe_reject_flexarray_init): Declare.
1957 * init.c (maybe_reject_flexarray_init): No longer static.
1958 Add check for current_function_decl.
1959 * parser.c (cp_parser_late_parse_one_default_arg): Reject
1960 a default mem-initializer for a flexible array.
1962 2017-02-21 Jakub Jelinek <jakub@redhat.com>
1963 Paolo Carlini <paolo.carlini@oracle.com>
1966 * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
1968 * pt.c (tsubst_decomp_names): Return error_mark_node if the first
1969 decl after the decomposition artificial decl has error_mark_node.
1970 * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
1971 instead of just == error_mark_node comparison.
1973 2017-02-21 Jakub Jelinek <jakub@redhat.com>
1976 * decl.c: Include gimplify.h.
1977 (cp_finish_decomp): Make sure there is no sharing of trees
1978 in between DECL_VALUE_EXPR of decomposition decls.
1981 * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
1984 * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
1985 call cplus_expand_constant on it first.
1987 2017-02-19 Jason Merrill <jason@redhat.com>
1989 PR c++/78139 - destructor needed by new-expression
1990 * call.c (build_special_member_call): Use tf_no_cleanup.
1992 PR c++/78282 - auto template and pack expansion
1993 * pt.c (find_parameter_packs_r): Don't walk into the type of
1994 templates other than template template-parameters.
1996 PR c++/79606 - ICE with this->base_member in NSDMI
1997 * class.c (build_base_path): Check processing_template_decl.
1999 PR c++/79607 - ICE with T{} initializer
2000 * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
2002 PR c++/79566 - elaborated-type-specifier in range for
2003 * parser.c (cp_parser_simple_declaration): Fix check for type
2006 PR c++/79400 - confusing suggestion of 'noexcept'
2007 * parser.c (cp_parser_exception_specification_opt): Remove
2008 suggestion for deprecated dynamic exception-specification.
2010 PR c++/79470 - partial ordering with reference parameters
2011 * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
2013 PR c++/79500 - ICE with non-template deduction guide
2014 * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
2015 DECL_TEMPLATE_RESULT.
2017 PR c++/79580 - ICE with compound literal
2018 * parser.c (cp_parser_class_head): If we're in the middle of an
2019 expression, use ts_within_enclosing_non_class.
2021 PR c++/79503 - inherited ctor taking base class
2022 * call.c (add_function_candidate): Also check that
2023 DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
2025 2017-02-19 Paolo Carlini <paolo.carlini@oracle.com>
2028 * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
2031 2017-02-19 Eric Fiselier <eric@efcs.ca>
2032 Jonathan Wakely <jwakely@redhat.com>
2035 * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
2036 control warning about literal suffix identifiers without a leading
2039 2017-02-17 Jason Merrill <jason@redhat.com>
2041 PR c++/79508 - lookup error with member template
2042 * parser.c (cp_parser_template_name): Clear
2043 parser->context->object_type if we aren't doing lookup.
2045 PR c++/78690 - ICE with using and global type with same name
2046 * pt.c (type_dependent_object_expression_p): True for
2049 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
2050 * pt.c (convert_template_argument): Just return an auto arg pack.
2051 (tsubst_template_args): Don't tsubst an auto pack type.
2053 PR c++/79556 - C++17 ICE with non-type auto
2054 * pt.c (do_auto_deduction): Don't try to deduce from null type.
2056 PR c++/79533 - C++17 ICE with temporary cast to reference
2057 * call.c (build_over_call): Conversion to a reference prevents copy
2060 2017-02-16 Jakub Jelinek <jakub@redhat.com>
2061 Jason Merrill <jason@redhat.com>
2063 PR c++/79502 - lost nodiscard attribute
2064 * pt.c (apply_late_template_attributes): Do apply non-dependent
2065 attributes to types.
2067 2017-02-16 Jason Merrill <jason@redhat.com>
2069 PR c++/78572 - ICE with self-modifying array initializer
2070 * constexpr.c (cxx_eval_store_expression): The object we're
2071 initializing is outside the constant-expression.
2072 (cxx_eval_call_expression): Set ctx->call.
2074 PR c++/79050 - ICE with undeduced auto and LTO
2075 * decl.c (poplevel): Remove undeduced auto decls.
2077 2017-02-16 Jakub Jelinek <jakub@redhat.com>
2080 * parser.c (cp_parser_omp_target): For -fopenmp-simd
2081 ignore #pragma omp target even when not followed by identifier.
2083 2017-02-15 Jason Merrill <jason@redhat.com>
2084 Jakub Jelinek <jakub@redhat.com>
2086 PR c++/79464 - ICE in IPA with omitted constructor parms
2087 * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
2088 (adjust_clone_args): Adjust.
2089 (add_method): Remember omitted parms.
2090 * call.c (add_function_candidate): Likewise.
2091 * mangle.c (write_method_parms): Likewise.
2092 * method.c (ctor_omit_inherited_parms): Return false if there are no
2095 2017-02-15 Martin Sebor <msebor@redhat.com>
2098 * init.c (maybe_reject_flexarray_init): New function.
2099 (perform_member_init): Call it.
2101 2017-02-15 Jakub Jelinek <jakub@redhat.com>
2104 * parser.c (cp_parser_std_attribute): Don't pedwarn about
2105 [[deprecated]] with -std=c++11 and [[fallthrough]] with
2106 -std=c++11 and -std=c++14.
2109 * decl.c (grokdeclarator): For static data members, handle thread_p
2110 only after handling inline.
2112 2017-02-14 Marek Polacek <polacek@redhat.com>
2116 * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
2117 clobbering if the postfix expression isn't an EXPR_P.
2119 2017-02-13 Jason Merrill <jason@redhat.com>
2121 PR c++/79461 - ICE with lambda in constexpr constructor
2122 * constexpr.c (build_data_member_initialization): Ignore
2123 initialization of a local variable.
2125 2017-02-13 Jakub Jelinek <jakub@redhat.com>
2127 * init.c (warn_placement_new_too_small): Add missing space in
2129 * parser.c (cp_parser_oacc_declare): Likewise.
2130 * mangle.c (maybe_check_abi_tags): Likewise.
2133 * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
2134 on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
2135 in the rightmost operand.
2137 2017-02-13 Nathan Sidwell <nathan@acm.org>
2139 PR c++/79296 - ICE mangling localized template instantiation
2140 * decl2.c (determine_visibility): Use template fn context for
2141 local class instantiations.
2143 2017-02-11 Jason Merrill <jason@redhat.com>
2145 PR c++/77659 - ICE with new and C++14 aggregate NSDMI
2146 * init.c (build_new): Make backups of any CONSTRUCTORs in init.
2147 (build_new_1): Use replace_placeholders.
2148 * tree.c (replace_placeholders_t): Also track whether we've seen a
2150 (replace_placeholders, replace_placeholders_r): Adjust.
2151 * cp-tree.h: Adjust.
2153 PR c++/77790 - ICE with auto function in C++11 mode
2154 * decl.c (undeduced_auto_decl): Remove C++14 limitation.
2155 (require_deduced_type): Add complain parm, return bool.
2156 * cp-tree.h: Adjust.
2157 * decl2.c (mark_used): Use require_deduced_type.
2159 2017-02-10 Jason Merrill <jason@redhat.com>
2161 PR c++/78908 - template ops and bitfields
2162 * tree.c (build_min_non_dep): Use unlowered_expr_type.
2164 PR c++/78897 - constexpr union
2165 * constexpr.c (cxx_eval_store_expression): A store to a union member
2166 erases a previous store to another member.
2168 PR c++/71285 - member of fold-expression
2169 * semantics.c (finish_unary_fold_expr)
2170 (finish_binary_fold_expr): Use null type for fold-expressions.
2172 PR c++/79401 - protected inherited constructor
2173 * call.c (enforce_access): For inheriting constructor, find a base
2174 binfo in the path we already have.
2176 2017-02-10 Marek Polacek <polacek@redhat.com>
2179 * pt.c (type_dependent_expression_p): Check if the expression type
2183 * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
2184 if warnings shouldn't be given.
2186 2017-02-10 Paolo Carlini <paolo.carlini@oracle.com>
2189 * pt.c (tsubst_decl): Don't try to preserve a typedef that names
2190 an error_mark_node as type.
2192 2017-02-09 Jakub Jelinek <jakub@redhat.com>
2193 Jason Merrill <jason@redhat.com>
2196 * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
2197 from pattern to type.
2199 2017-02-09 Jason Merrill <jason@redhat.com>
2201 PR c++/79316 - default argument in deduction guide
2202 PR c++/79350 - explicit deduction guide
2203 * parser.c (cp_parser_constructor_declarator_p)
2204 (cp_parser_direct_declarator): Parse deduction guides more like
2206 * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
2207 * tree.c (special_function_p): Return it.
2208 * decl.c (check_special_function_return_type): Handle it.
2209 (grokdeclarator, grokfndecl): Adjust.
2210 (cp_finish_decl): Pass flags to do_auto_deduction.
2211 * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
2212 * pt.c (dguide_name_p): Take a const_tree.
2213 (do_class_deduction): Handle explicit.
2214 (do_auto_deduction): Pass flags through.
2215 (build_deduction_guide): Copy explicit flag.
2217 2017-02-09 Jakub Jelinek <jakub@redhat.com>
2220 * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
2221 non-pragma_compound context here.
2222 (cp_parser_omp_target): Likewise.
2223 (cp_parser_pragma): Don't call push_omp_privatization_clauses and
2224 parsing for ordered and target omp pragmas in non-pragma_stmt
2225 non-pragma_compound contexts.
2228 * parser.c (cp_parser_oacc_declare): Formatting fix.
2229 (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
2230 automatic variables.
2232 2016-02-09 Nathan Sidwell <nathan@codesourcery.com>
2233 Chung-Lin Tang <cltang@codesourcery.com>
2235 * parser.c (cp_parser_oacc_clause_tile): Disallow collapse. Fix
2236 parsing. Parse constant expression. Remove semantic checking.
2237 (cp_parser_omp_clause_collapse): Disallow tile.
2238 (cp_parser_omp_for_loop): Deal with tile clause. Don't emit a parse
2239 error about missing for after already emitting one. Use more
2240 conventional for idiom for unbounded loop.
2241 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
2242 * semantics.c (finish_omp_clauses): Correct TILE semantic check.
2243 (finish_omp_for): Deal with tile clause.
2245 2017-02-07 Nathan Sidwell <nathan@acm.org>
2247 * method.c (synthesized_method_base_walk): New. Broken out of ...
2248 (synthesized_method_walk): ... here. Call it. Cleanup
2251 2017-02-07 Patrick Palka <ppalka@gcc.gnu.org>
2254 * typeck2.c (process_init_constructor_union): Consider only
2255 FIELD_DECLs when looking for an NSDMI.
2257 2017-02-06 Jason Merrill <jason@redhat.com>
2259 PR c++/71193 - incomplete types in templates
2260 * parser.c (cp_parser_postfix_dot_deref_expression): In a template
2261 handle incomplete type by pedwarning and then treating as dependent.
2263 2017-02-06 Jakub Jelinek <jakub@redhat.com>
2266 * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
2267 (potential_constant_expression_1): Likewise.
2270 * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
2271 allow one fewer than expected arguments if flag_permissive.
2274 * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
2275 * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
2276 with error_mark_node type.
2278 2017-02-03 Jason Merrill <jason@redhat.com>
2280 PR c++/78689 - ICE on constructor with label
2281 * optimize.c (maybe_clone_body): Replace omitted parameters with
2283 * class.c (build_clone): Fix logic for omitting inherited parms.
2285 PR c++/12245 - excessive memory use
2286 * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
2287 back in. Don't cache constants.
2288 (maybe_constant_init): Don't cache constants.
2290 PR c++/79294 - ICE with invalid template argument
2291 * pt.c (convert_nontype_argument_function): Check value-dependence.
2292 (convert_nontype_argument): Don't check it here for function ptrs.
2294 2017-02-02 Richard Biener <rguenther@suse.de>
2297 * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
2298 it lazily on the first changed element only and copy it
2299 fully upfront, only storing changed elements.
2301 2017-02-02 Paolo Carlini <paolo.carlini@oracle.com>
2304 * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
2307 2017-01-31 Jakub Jelinek <jakub@redhat.com>
2310 * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
2313 2017-01-31 David Malcolm <dmalcolm@redhat.com>
2316 * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
2317 any namespace aliases.
2319 2017-01-31 Nathan Sidwell <nathan@acm.org>
2322 * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
2326 * pt.c: (instantiate_decl): Push to top level when current
2327 function scope doesn't match. Only push lmabda scope stack when
2330 * cp-tree.h (instantiate_decl): Make defer_ok bool.
2331 * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
2332 (instantiate_decl): Simplify and reorder state saving and restoration.
2335 * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
2336 * semantics.c (finish_member_declaration): Assert class is being
2339 2017-01-30 Alexandre Oliva <aoliva@redhat.com>
2341 Introduce C++ support in libcc1.
2342 * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
2343 (ansi_opname): Rename to...
2344 (cp_operator_id): ... this. Adjust all callers.
2345 (ansi_assopname): Rename to...
2346 (cp_assignment_operator_id): ... this. Adjust all callers.
2347 (cp_literal_operator_id): Declare.
2348 (set_global_friend): Declare.
2349 (is_global_friend): Declare.
2350 (enum cp_oracle_request): New type.
2351 (cp_binding_oracle_function): New type.
2352 (cp_binding_oracle): Declare.
2353 (cp_finish_injected_record_type): Declare.
2354 * friend.c (global_friend): New var.
2355 (set_global_friend): New fn.
2356 (is_global_friend): New fn.
2357 (is_friend): Call is_global_friend.
2358 * name-lookup.c (cp_binding_oracle): New var.
2359 (query_oracle): New fn.
2360 (qualified_lookup_using_namespace): Call query_oracle.
2361 (lookup_name_real_1): Likewise.
2362 * parser.c (cp_literal_operator_id): Drop static.
2363 * search.c (friend_accessible_p): Call is_global_friend.
2364 * semantics.c (is_this_parameter): Accept a variable if the
2365 binding oracle is enabled.
2367 2017-01-27 Jason Merrill <jason@redhat.com>
2369 PR c++/78771 - ICE with inherited constructor.
2370 * call.c (build_over_call): Call deduce_inheriting_ctor here.
2371 * pt.c (tsubst_decl): Not here.
2372 * class.c (add_method): Or here.
2373 * method.c (deduce_inheriting_ctor): Handle clones.
2374 (implicitly_declare_fn): Don't deduce inheriting ctors yet.
2376 2017-01-27 Adam Butcher <adam@jessamine.co.uk>
2379 * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
2381 * cp/cp-tree.h: Declare it.
2382 * cp/semantics.c (finish_id_expression): Resolve names within a default
2383 capturing generic lambda defined within a template prior to
2384 instantiation to allow for captures to be added to the closure type.
2386 2017-01-26 Jakub Jelinek <jakub@redhat.com>
2389 * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
2390 * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
2391 * parser.c (cp_parser_builtin_offsetof): Pass result of
2392 build_static_cast of null_pointer_node to finish_offsetof.
2393 * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
2394 it for -Winvalid-offsetof pedwarn instead of trying to guess
2395 original offsetof type from EXPR. Save OBJECT_PTR as a new
2396 second operand to OFFSETOF_EXPR.
2397 * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
2398 finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
2401 2017-01-26 Jason Merrill <jason@redhat.com>
2403 * name-lookup.c (parse_using_directive): Deprecate strong using.
2405 PR c++/79176 - lambda ICE with -flto -Os
2406 * decl2.c (vague_linkage_p): Handle decloned 'tors.
2407 * tree.c (decl_linkage): Likewise.
2409 2017-01-25 Martin Sebor <msebor@redhat.com>
2411 * decl.c (grokdeclarator): Fix a typo in a comment.
2413 2017-01-25 Jakub Jelinek <jakub@redhat.com>
2416 * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
2420 * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
2421 OPT_Wpedantic on lambda templates for -std=c++14 and higher.
2423 2017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
2426 * decl.c (cxx_init_decl_processing): Pass main_input_filename
2427 to build_translation_unit_decl.
2429 2017-01-24 Jakub Jelinek <jakub@redhat.com>
2432 * cp-gimplify.c (cp_genericize_r): Add result of
2433 convert_from_reference on invisiref parm to p_set.
2435 2017-01-24 Nathan Sidwell <nathan@acm.org>
2437 PR c++/78469 - defaulted ctor and inaccessible dtor
2438 * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
2439 * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
2440 * tree.c (build_target_expr): Check tf_no_cleanup.
2442 PR c++/79118 - anon-members and constexpr
2443 * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
2444 ctor decl. Recursively check anonymous members.
2445 (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
2447 (explain_invalid_constexpr_fn): Likewise.
2449 2017-01-23 Nathan Sidwell <nathan@acm.org>
2451 PR c++/71710 - template using directive of field
2452 * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
2455 PR c++/71406 - ICE with scope-ref'd template id exprs
2457 * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
2458 before breaking up TEMPLATE_ID_EXPR.
2460 2017-01-20 Nathan Sidwell <nathan@acm.org>
2462 PR c++/78495 - wrong code inherited ctor and invisi-ref parm
2463 * cp-gimplify.c (cp_generize_r): Don't skip thunks.
2465 2017-01-20 David Malcolm <dmalcolm@redhat.com>
2469 * cp-tree.h (suggest_alternatives_for): Add bool param.
2470 (suggest_alternative_in_explicit_scope): New decl.
2471 * error.c (qualified_name_lookup_error): When SCOPE is a namespace
2472 that isn't the global one, call new function
2473 suggest_alternative_in_explicit_scope, only calling
2474 suggest_alternatives_for if it fails, and disabling near match
2475 searches fort that case. When SCOPE is the global namespace,
2476 pass true for new param to suggest_alternatives_for to allow for
2478 * lex.c (unqualified_name_lookup_error): Pass true for new param
2479 to suggest_alternatives_for.
2480 * name-lookup.c (consider_binding_level): Add forward decl.
2481 (suggest_alternatives_for): Add "suggest_misspellings" param,
2482 using it to conditionalize the fuzzy name-lookup code.
2483 (suggest_alternative_in_explicit_scope): New function.
2484 * parser.c (cp_parser_primary_expression): When calling
2485 finish_id_expression, pass location of id_expression rather
2486 than that of id_expr_token.
2487 (cp_parser_id_expression): Convert local "unqualified_id" from
2488 tree to cp_expr to avoid implicitly dropping location information.
2490 2017-01-20 Marek Polacek <polacek@redhat.com>
2493 * call.c (build_conditional_expr_1): Warn about duplicated branches.
2494 * semantics.c (finish_expr_stmt): Build statement using the proper
2497 2017-01-19 Jason Merrill <jason@redhat.com>
2499 US 20 - forwarding references and class template argument deduction
2500 * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
2501 * pt.c (push_template_decl_real): Set it.
2502 (maybe_adjust_types_for_deduction): Check it.
2503 (rewrite_template_parm): Copy it.
2505 US 19 - deduction guides and constructors
2506 * call.c (joust): Prefer deduction guides to constructors.
2507 * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
2508 (deduction_guide_p): Check DECL_P.
2510 * decl.c (check_initializer): Always use build_aggr_init for array
2513 PR c++/79130 - decomposition and direct-initialization
2514 * init.c (build_aggr_init): Communicate direct-initialization to
2516 (build_vec_init): Check for array copy sooner.
2517 * parser.c (cp_parser_decomposition_declaration): Remove call to
2518 build_x_compound_expr_from_list.
2520 2017-01-18 Jason Merrill <jason@redhat.com>
2522 PR c++/68666 - member variable template-id
2523 * typeck.c (finish_class_member_access_expr): Handle variable
2525 * pt.c (lookup_and_finish_template_variable): No longer static.
2526 * cp-tree.h: Declare it.
2528 2017-01-18 Nathan Sidwell <nathan@acm.org>
2531 * call.c (build_over_call): When checking ellipsis conversions for
2532 an inherited ctor, make sure there is at least one conversion.
2534 2017-01-18 Jason Merrill <jason@redhat.com>
2536 PR c++/78894 - ICE with class deduction and default arg
2537 * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
2539 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
2542 * mangle.c (write_discriminator): Reorganize abi warning check.
2544 2017-01-18 Nathan Sidwell <nathan@acm.org>
2546 * cp-tree.h: Clarify exception spec node comment.
2547 * except.c (nothrow_spec_p): Simplify by checking node-equality.
2550 * mangle.c (write_exception_spec): Check nothrow explicitly.
2551 (write_encoding): Don't increment processing_template_decl around
2554 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
2557 * mangle.c (write_template_args): Add "on" for operator names.
2559 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
2562 * mangle.c (write_discriminator): Handle discriminator >= 10.
2564 2017-01-17 Nathan Sidwell <nathan@acm.org>
2567 * cp-tree.h (maybe_generic_this_capture): Declare.
2568 * lambda.c (resolvable_dummy_lambda): New, broken out of ...
2569 (maybe_resolve_dummy): ... here. Call it.
2570 (maybe_generic_this_capture): New.
2571 * parser.c (cp_parser_postfix_expression): Speculatively capture
2572 this in generic lambda in unresolved member function call.
2573 * pt.c (tsubst_copy_and_build): Force hard error from failed
2574 member function lookup in generic lambda.
2576 2017-01-17 Aldy Hernandez <aldyh@redhat.com>
2579 * cp-array-notation.c (expand_array_notation_exprs): Handle
2582 2017-01-11 Jason Merrill <jason@redhat.com>
2584 PR c++/78337 - ICE on invalid with generic lambda
2585 * semantics.c (process_outer_var_ref): Check if containing_function
2586 is null. Move inform call under complain test.
2588 2017-01-11 Nathan Sidwell <nathan@acm.org>
2591 * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
2594 2017-01-11 Nathan Sidwell <nathan@acm.org>
2596 * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
2598 2017-01-11 Jakub Jelinek <jakub@redhat.com>
2601 * parser.c (cp_parser_std_attribute_spec): Remove over-eager
2602 assertion. Formatting fix.
2605 * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
2608 2017-01-10 David Malcolm <dmalcolm@redhat.com>
2611 * parser.c (cp_parser_class_specifier_1): Only suggest inserting
2612 a missing semicolon if we have a valid insertion location for
2615 2017-01-10 Jason Merrill <jason@redhat.com>
2617 FI 20, decomposition declaration with parenthesized initializer.
2618 * parser.c (cp_parser_decomposition_declaration): Use
2619 cp_parser_initializer.
2621 2017-01-09 Jason Merrill <jason@redhat.com>
2623 Implement P0195R2, C++17 variadic using.
2624 * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
2625 * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
2626 * error.c (dump_decl): Likewise.
2628 2017-01-09 Jakub Jelinek <jakub@redhat.com>
2630 PR translation/79019
2631 PR translation/79020
2632 * semantics.c (finish_omp_clauses): Add missing whitespace to
2633 translatable strings.
2634 * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
2636 2017-01-07 Jason Merrill <jason@redhat.com>
2638 PR c++/78948 - instantiation from discarded statement
2639 * parser.h (struct cp_parser): Remove in_discarded_stmt field.
2640 * cp-tree.h (in_discarded_stmt): Declare it.
2641 (struct saved_scope): Add discarded_stmt bitfield.
2642 (in_discarded_stmt): New macro.
2643 * decl2.c (mark_used): Check it.
2644 * parser.c (cp_parser_selection_statement): Adjust.
2645 (cp_parser_jump_statement): Adjust.
2647 2017-01-05 Jakub Jelinek <jakub@redhat.com>
2650 * decl.c (cp_finish_decomp): Remove probe variable, if tt is
2651 REFERENCE_REF_P, set tt to its operand.
2654 * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
2655 unions even for C++11 and later.
2657 2017-01-05 Nathan Sidwell <nathan@acm.org>
2660 * pt.c (convert_nontype_argument): Don't try and see if integral
2661 or enum expressions are constants prematurely.
2663 2017-01-04 Marek Polacek <polacek@redhat.com>
2666 * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
2667 a zero character literal.
2669 2017-01-04 Jakub Jelinek <jakub@redhat.com>
2672 * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
2676 * parser.c (cp_parser_simple_declaration): Only complain about
2677 inconsistent auto deduction if auto_result doesn't use auto.
2679 * parser.c (cp_parser_simple_declaration): Diagnose function
2680 declaration among more than one init-declarators with auto
2684 * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
2685 assertion, as lexer->buffer may be NULL.
2687 2017-01-04 Marek Polacek <polacek@redhat.com>
2691 * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
2693 2017-01-04 Nathan Sidwell <nathan@acm.org>
2696 * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
2697 (lambda_capture_field_type): Update prototype.
2698 * lambda.c (lambda_capture_field_type): Add is_reference parm.
2699 Add referenceness here.
2700 (add_capture): Adjust lambda_capture_field_type call, refactor
2702 * pt.c (tsubst): Adjust lambda_capture_field_type call.
2704 2017-01-01 Jakub Jelinek <jakub@redhat.com>
2706 Update copyright years.
2708 Copyright (C) 2017 Free Software Foundation, Inc.
2710 Copying and distribution of this file, with or without modification,
2711 are permitted in any medium without royalty provided the copyright
2712 notice and this notice are preserved.