1 2017-05-26 Nathan Sidwell <nathan@acm.org>
3 * cp-tree.h (OVL_CHAIN): Check looking at OVERLOAD.
4 (ovl_iterator): Add allow_inner field. Adjust ctor. Make
6 (ovl_iterator::maybe_push, ovl_iterator::pop): New.
7 (lkp_iterator): Add outer field. Adjust ctor.
8 (lkp_iterator::operator++): New.
9 (lookup_mark, lookup_maybe_add): Declare.
10 * name-lookup.c (name_lookup): Delete fn_set member.
11 (name_lookup::preserve_state, name_lookup::restore_state): Unmark
13 (name_lookup::add_value): Use lookup_add directly.
14 (name_lookup::add_fns: Use lookup_maybe_add.
15 (name_lookup::search_adl): Mark and unmark fns.
17 * pt.c (check_explicit_specialization): Use lookup_add directly.
18 * ptree.c (cxx_print_xnode): Show complete overload structure.
19 * tree.c (lookup_mark, lookup_maybe_add): New.
21 * name-lookup.c (name_lookup::search_adl): ADL OMP UDR type args.
23 2017-05-26 Jakub Jelinek <jakub@redhat.com>
25 * cp-tree.h (struct lang_decl_decomp): New type.
26 (struct lang_decl): Add u.decomp.
27 (LANG_DECL_DECOMP_CHECK): Define.
28 (DECL_DECOMPOSITION_P): Note it is set also on the vars
30 (DECL_DECOMP_BASE): Define.
31 (retrofit_lang_decl): Add extra int = 0 argument.
32 * lex.c (retrofit_lang_decl): Add SEL argument, if non-zero
33 use it to influence the selector choices and for selector
34 0 to non-zero transition copy old content.
35 (cxx_dup_lang_specific_decl): Handle DECL_DECOMPOSITION_P.
36 * decl.c (poplevel): For DECL_DECOMPOSITION_P, check
37 !DECL_DECOMP_BASE instead of !DECL_VALUE_EXPR. Adjust warning
38 wording if decl is a structured binding.
39 (cp_finish_decomp): Pass 4 as the new argument to retrofit_lang_decl.
40 Set DECL_DECOMP_BASE. Ignore DECL_READ_P sets from initialization
41 of individual variables for tuple structured bindings.
42 (grokdeclarator): Pass 4 as the new argument to retrofit_lang_decl.
43 Clear DECL_DECOMP_BASE.
44 * decl2.c (mark_used): Mark DECL_DECOMP_BASE TREE_USED as well.
45 * pt.c (tsubst_decomp_names): Assert DECL_DECOMP_BASE matches what
47 * expr.c (mark_exp_read): Recurse on DECL_DECOMP_BASE instead of
50 2017-05-25 Jason Merrill <jason@redhat.com>
52 PR c++/80605 - __is_standard_layout and zero-length array
53 * class.c (check_bases): Use DECL_FIELD_IS_BASE.
55 2017-05-25 Nathan Sidwell <nathan@acm.org>
57 Kill OVL_CURRENT, OVL_NEXT.
58 * cp-tree.h (OVL_CURRENT, OVL_NEXT): Delete.
59 * name-lookup.c (set_decl_namespace): Use ovl_iterator.
60 (consider_binding_level): Use OVL_FIRST.
61 (cp_emit_debug_info_for_using): Use lkp_iterator.
62 * pt.c (check_explicit_specialization): Use ovl_iterator.
64 Kill DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS.
65 * cp-tree.h (lang_decl_ns): Remove ns_users field.
66 (DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS): Delete.
67 (TREE_INDIRECT_USING): Delete.
68 * name-lookup.h (is_associated_namespace): Delete.
69 * name-lookup.c (name_lookup::search_usings,
70 name_lookup::do_queue_usings): Usings are always direct.
71 (is_associated_namespace): Delete.
72 (handle_namespace_attrs): Use DECL_NAMESPACE_INLINE_P.
73 (namespace_ancestor_1, namespace_ancestor): Delete.
74 (push_using_directive_1, push_using_directive): Delete.
75 (add_using_namespace_1): Delete.
76 (add_using_namespace): Reimplement.
77 (emit_debug_info_using_namespace): New.
78 (finish_namespace_using_directive, finish_local_using_directive,
79 push_namespace): Adjust.
80 * tree.c (cp_free_lang_data): Remove DECL_NAMESPACE_USERS handling.
82 2017-05-25 Volker Reichelt <v.reichelt@netcologne.de>
84 * semantics.c (finish_handler_parms): Warn about non-reference type
87 2017-05-25 Nathan Sidwell <nathan@acm.org>
89 Reimplement unqualified namespace lookup.
90 * name-lookup.c (name_lookup::using_pair,
91 name_lookup::using_queue): New typedefs.
92 (name_lookup::queue_namespace, name_lookup::do_queue_usings,
93 name_lookup::queue_usings): New.
94 (name_lookup::search_unqualified): New.
95 (merge_functions, same_entity_p, ambiguous_decl,
96 unqualified_namespace_lookup_1, unqualified_namespace_lookup,
97 lookup_using_namespace): Delete.
98 (lookup_name_real_1): Adjust.
100 Reimplement qualified namespace lookup.
101 * name-lookup.c (name_lookup::flags): New member. Adjust ctor.
102 (name_lookup::ambiguous, name_lookup::add_value,
103 name_lookup::add_type, name_lookup::process_binding): New.
104 (name_lookup::search_namespace_only,
105 name_lookup::search_namespace, name_lookup::search_usings): New.
106 (name_lookup::search_qualified): New.
107 (do_nonmember_using_decl, suggest_alternatives_for,
108 lookup_qualified_name): Adjust.
109 (tree_vec_contains): Delete.
110 (qualified_lookup_using_namespace): Rename to ...
111 (qualified_namespace_lookup): ... here. Reimplement.
114 * cp-tree.h (LOOKUP_SEEN_P, LOOKUP_FOUND_P): New.
115 * name-lookup.h (lookup_arg_dependent): Return plain tree.
116 * name-lookup.c (arg_lookup, arg_assoc, arg_assoc_args,
117 arg_assoc_args_vec, arg_assoc_type, add_function,
118 arg_assoc_namespace, arg_assoc_class_only, arg_assoc_bases,
119 arg_assoc_class, arg_assoc_template_arg, arg_assoc,
120 lookup_arg_dependent_1): Delete.
121 (name_lookup): New lookup object.
122 (name_lookup::preserve_state, name_lookup::restore_state,
123 name_lookup::mark_seen, name_lookup::find_and_mark,
124 name_lookup::add_fns, name_lookup::adl_namespace_only,
125 name_lookup::adl_namespace, name_lookup::adl_class_only,
126 name_lookup::adl_bases, name_lookup::adl_class,
127 name_lookup::adl_expr, name_lookup::adl_type,
128 name_lookup::adl_template_arg, name_lookup::search_adl): New.
129 (lookup_arg_dependent): Return a plain tree. Adjust.
130 (is_associated_namespace): Move later.
132 2017-05-24 Nathan Sidwell <nathan@acm.org>
134 * friend.c (do_friend): Remove check for existing decl.
135 * name-lookup.h (lookup_name_innermost_nonclass_level): Delete.
136 * name-lookup.c (push_local_binding): Directly look for binding.
137 (lookup_name_innermost_nonclass_level_1): Delete.
138 (lookup_name_innermost_nonclass_level): Delete.
140 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Alphabetize.
142 * cp-tree.h (cp_free_lang_data): Add extern.
143 (ovl_skip_hidden, is_overloaded_fn, really_overloaded_fn): Add
145 (type_unknown_p): Return bool, make inline, lose TREE_LIST check.
146 * typeck.c (type_unknown_p): Delete.
147 * tree.c (is_overloaded_fn): Use MAYBE_BASELINE_FUNCTIONS, adjust
149 (dependent_name): Likewise.
150 (decl_anon_ns_mem_p): Simplify.
152 2017-05-24 Jonathan Wakely <jwakely@redhat.com>
155 * tree.c (reshape_init): Use unqualified type for direct enum init.
156 * typeck.c (maybe_warn_about_cast_ignoring_quals): New.
157 (build_static_cast_1, build_reinterpret_cast_1): Strip cv-quals from
158 non-class destination types.
159 (build_const_cast_1): Strip cv-quals from destination types.
160 (build_static_cast, build_reinterpret_cast, build_const_cast)
161 (cp_build_c_cast): Add calls to maybe_warn_about_cast_ignoring_quals.
163 2017-05-24 Martin Sebor <msebor@redhat.com>
166 * call.c (fully_fold_internal): Adjust.
168 2017-05-24 Nathan Sidwell <nathan@acm.org>
170 * cp-tree.h (ovl_skip_hidden): Declare.
171 * tree.c (ovl_skip_hidden): New.
172 * name-lookup.c (arg_assoc_namespace): Call ovl_skip_hidden.
173 (lookup_arg_dependent_1): Likewise.
174 (ambiguous_decl): Use DECL_HIDDEN_P, ovl_skip_hidden.
175 (hidden_name_p, remove_hidden_names): Delete.
176 (lookup_name_real_1): Do not strip hidden names.
177 * name-lookup.h (hidden_name_p, remove_hidden_names): Delete.
179 * cp-tree.h (OVL_HIDDEN_P): New.
180 (ovl_iterator::hidden_p, ovl_iterator::reveal_node): New.
181 (ovl_iterator::reveal_node): Declare.
182 * tree.c (ovl_copy): Copy OVL_HIDDEN_P.
183 (ovl_insert): Order on hiddenness.
184 (ovl_iterator::reveal_node): New.
185 * name-lookup.c (anticipated_builtin_p): New.
186 (supplement_binding_1): Use it.
187 (set_local_extern_decl_linkage): Use hidden_p.
188 (do_pushdecl): Deal with unhiding a hidden decl, use
189 anticipated_builtin_p.
190 (do_nonmember_using_decl): Use anticipated_decl_p.
191 (lookup_name_real_1): Use DECL_HIDDEN_P.
193 2017-05-23 Jason Merrill <jason@redhat.com>
195 -Wunused and C++17 structured bindings
196 * decl.c (poplevel): Don't warn about unused structured bindings,
198 * error.c (dump_simple_decl): Handle structured bindings.
199 * expr.c (mark_exp_read): Look through DECL_VALUE_EXPR.
201 2017-05-23 Nathan Sidwell <nathan@acm.org>
203 * cp-tree.h (PUSH_GLOBAL, PUSH_LOCAL, PUSH_USING): Delete.
204 * name-lookup.c (create_local_binding): New.
205 (update_binding): New.
206 (pushdecl_maybe_friend_1): Rename to ...
207 (do_pushdecl): ... this. Reimplement.
209 (push_overloaded_decl_1, push_overloaded_decl): Delete.
211 2017-05-23 Jason Merrill <jason@redhat.com>
213 PR c++/80396 - built-in for make_integer_sequence.
214 * pt.c (builtin_pack_fn_p, builtin_pack_call_p)
215 (expand_integer_pack, expand_builtin_pack_call): New.
216 (find_parameter_packs_r): Check builtin_pack_call_p.
217 (check_for_bare_parameter_packs): Handle it.
218 (tsubst_pack_expansion): Call expand_builtin_pack_call.
219 (declare_integer_pack): New.
220 (init_template_processing): Call it.
221 * decl2.c (mark_used): Check builtin_pack_fn_p.
223 2017-05-23 Nathan Sidwell <nathan@acm.org>
225 * name-lookup.c (find_namespace_binding): New.
226 (pushdecl_maybe_friend_1): Use CP_DECL_CONTEXT.
227 (set_identifier_type_value_with_scope): Use find_namespace_binding.
228 (find_binding, cp_binding_level_find_binding_for_name,
229 binding_for_name, namespace_binding_1): Delete.
230 (push_overloaded_decl_1): Use CP_DECL_CONTEXT.
231 (get_namespace_binding, set_namespace_binding,
232 finish_namespace_using_decl, unqualified_namespace_lookup_1,
233 qualified_lookup_using_namespace, lookup_type_scope_1,
234 lookup_name_innermost_nonclass_level_1): Use find_namespace_binding.
237 * parser.c (cp_parser_template_id): Keep the lookup when stashing
240 * cp-tree.h (DECL_HIDDEN_P): New.
241 * name-lookup.c (set_decl_context,
242 set_local_extern_decl_linkage): New, broken out of ...
243 (pushdecl_maybe_friend_1): ... here. Call them.
245 2017-05-23 Thomas Schwinge <thomas@codesourcery.com>
247 * parser.c (OACC_KERNELS_CLAUSE_MASK): Add
248 "PRAGMA_OACC_CLAUSE_NUM_GANGS", "PRAGMA_OACC_CLAUSE_NUM_WORKERS",
251 2017-05-23 Nathan Sidwell <nathan@acm.org>
253 * cp-tree.h (OVL_P): New.
254 * name-lookup.h (push_local_binding): Delete.
255 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
256 (finish_namespace_using_decl, finish_local_using_decl): ... here
257 * name-lookup.c (add_decl_to_level): Swap args.
258 (pop_bindings_and_leave_scope): Look inside TREE_LIST.
259 (diagnose_name_conflict): Check contexts are same for redecl.
260 (update_local_overload): New.
261 (compparms_for_decl_and_using): Rename to ...
262 (matching_fn_p): ... here.
263 (pushdecl_maybe_friend_1): Adjust add_decl_to_level,
264 push_local_bindings call.
265 (push_local_binding): Make static, replace FLAGS arg with
267 (validate_nonmember_using_decl): Use OVL_FIRST.
268 (do_nonmember_using_decl): Use in/out parameters. Use
269 lkp_iterator and simplify.
270 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
271 (finish_namespace_using_decl, finish_local_using_decl): ... here.
273 (lookup_type_current_level): Delete.
274 * parser.c (cp_parser_using_declaration): Adjust.
275 * pt.c (tsubst_expr): Adjust.
277 2017-05-22 Nathan Sidwell <nathan@acm.org>
279 * name-lookup.h (parse_using_directive): Replace with ...
280 (finish_namespace_using_directive): ... this and ...
281 (finish_local_using_directive): ... this.
282 * name-lookup.c (add_using_namespace_1): Move later.
283 (add_using_namespace): Move later, add namespace_p arg, remove
285 (push_using_directive_1): Directly recurse.
286 (do_using_directive, parse_using_directive): Delete, split into ...
287 (finish_namespace_using_directive): ... this and ...
288 (finish_local_using_directive): ... this.
289 (push_namespace): Use add_using_namespace.
290 * parser.c (cp_parser_using_directive): Call
291 finish_namespace_using_directive or finish_local_using_directive.
292 * pt.c (tsubst_expr): Call finish_local_using_directive.
294 * cp-objcp-common.c (cp_register_dumps): Register raw dumper.
295 * cp-tree.h (raw_dump_id): Declare.
296 * decl2.c (raw_dump_id): Define.
297 (dump_tu): Use raw_dump_id.
299 * config-lang.in (gtfiles): Sort list, break lines.
301 * cp-tree.h (CPTI_TERMINATE, CPTI_CALL_UNEXPECTED): Rename to ...
302 (CPTI_TERMINATE_FN, CPTI_CALL_UNEXPECTED_FN): ... here.
303 ( CPTI_GET_EXCEPTION_PTR_FN, CPTI_BEGIN_CATCH_FN, CPTI_END_CATCH_FN,
304 CPTI_ALLOCATE_EXCEPTION_FN, CPTI_FREE_EXCEPTION_FN, CPTI_THROW_FN,
305 CPTI_RETHROW_FN): New.
306 (noexcept_deferred_spec): New.
307 (terminate_node, call_unexpected_node): Rename to ...
308 (terminate_fn, call_unexpected_fn): ... here.
309 (get_exception_ptr_fn, begin_catch_fn, end_catch_fn,
310 allocate_exception_fn, free_exception_fn, throw_fn, rethrow_fn): New.
311 * except.c (fn1..fn5, throw_fn, rethrow_rn, spec): Delete.
312 (init_exception_processing): Adjust.
313 (declare_library_fn): Create and push the fns here.
314 (do_get_exception_ptr, do_begin_catch, do_end_catch,
315 do_allocate_exception_ptr, do_free_exception_ptr): Adjust
316 declare_library_fn use.
317 (unevaluated_noexcept_spec): Adjust.
318 * cp-gimplify.c (genericize_eh_spec_block,
319 gimplify_most_not_throw_expr): Adjust.
321 * name-lookup.c (pushdecl_top_level,
322 pushdecl_top_level_and_finish): Move after namespace pushing and
324 (push_to_top_level): Rename to ...
325 (do_push_to_top_level): ... here. Remove timing code.
326 (pop_from_top_level_1): Rename to ...
327 (do_pop_from_top_level): ... here.
328 (do_push_nested_namespace, do_pop_nested_namespace)
329 (push_to_top_level): New wrapper for do_push_to_top_level.
330 (pop_from_top_level): Adjust.
331 (push_nested_namepace, pop_nested_namespace): Wrappers for workers.
333 2017-05-19 Bernd Edlinger <bernd.edlinger@hotmail.de>
335 * config-lang.in (gtfiles): Add c-family/c-format.c,
336 except.c, init.c, lambda.c and friend.c.
337 * class.c (dvirt_fn): Move out of function scope,
339 * except.c (fn1-5, throw_fn, rethrow_fn, spec): Likewise.
340 * init.c (fn): Likewise.
341 * lambda.c (ptr_id, max_id): Likewise.
342 * friend.c (global_friend): Add GTY attribute.
344 2017-05-19 Nathan Sidwell <nathan@acm.org>
346 * call.c (add_list_candidates): Use OVL_FIRST.
347 (build_new_method_call_1): Likewise.
348 * cp-tree.h (OVL_SINGLE_P): New.
349 (TYPE_HIDDEN_P): New.
350 * decl.c (xref_tag_1): Use TYPE_HIDDEN_P.
351 * dump.c (cp_tump_tree): Adjust overload dumping.
352 * error.c (dump_decl): Use OVL_SINGLE_P, simplify context
354 * method.c (lazily_declare_fn): Assert we added it.
355 * parser.c (cp_parser_nested_name_specifier): Use OVL_SINGLE_P,
357 (cp_parser_template_name): Use lkp_iterator.
358 * pt.c (begin_template_parm_list): Fixup comment.
359 (instantiate_class_template_1): Use TYPE_HIDDEN_P.
360 * tree.c (ovl_iterator::remove_node): Cope with inherited ctors.
361 (ovl_scope): Use lkp_iterator.
363 2017-05-19 Thomas Schwinge <thomas@codesourcery.com>
365 * parser.c (cp_parser_omp_clause_default): Handle
366 "OMP_CLAUSE_DEFAULT_PRESENT".
368 * parser.c (cp_parser_omp_clause_default): Avoid printing more
369 than one syntax error message.
371 2017-05-19 Nathan Sidwell <nathan@acm.org>
373 * class.c (class_dump_id): Define.
374 (dump_class_hierarchy, dump_vtable, dump_vtt): Use it.
375 * cp-objcp-common.c (cp_register_dumps): New.
376 * cp-objcp-common.h (cp_register_dumps): Declare.
377 (LANG_HOOKS_REGISTER_DUMPS): Override.
378 * cp-tree.h (class_dump_id): Declare.
380 2017-05-18 Nathan Sidwell <nathan@acm.org>
382 * cp-tree.h (OVL_ARG_DEPENDENT): Delete.
384 (lookup_keep): Declare.
385 * name-lookup.c (add_function): Don't set OVL_ARG_DEPENDENT.
386 * pt.c (tsubst_copy): Assert lookup is persistent.
387 * semantics.c (finish_call_expr): Use lkp_iterator, call
389 * tree.c (ovl_copy): New.
390 (ovl_insert, ovl_iterator::remove_node): Copy immutable nodes.
393 * cp-tree.h (OVL_USED): Replace with ...
394 (OVL_USING_P): ... this.
395 (ovl_iterator::using_p): Adjust.
396 * name-lookup.c (push_overloaded_decl_1,
397 do_nonmember_using_decl): Adjust.
398 * search.c (lookup_field_r): Adjust.
399 * tree.c (ovl_insert, ovl_scope): Adjust.
401 * cp-tree.h (lookup_add): Swap args.
402 (ovl_cons, build_overload): Delete.
403 * name-lookup.c (add_function, push_overloaded_decl_1,
404 do_nonmember_using_decl, merge_functions, remove_hidden_names):
405 Use lookup_add, ovl_insert.
406 * pt.c (check_explicit_specialization): Use lookup_add.
407 (do_class_deduction): Likewise. Refactor if.
408 * tree.c (lookup_add): Swap args.
409 (ovl_cons, build_overload): Delete.
411 * name-lookup.c (find_local_binding): New, broken out of ...
412 (lookup_name_innermost_nonclass_level_1): ... here. Call it.
413 (set_namespace_binding): Swap scope & name args.
414 (namespace_binding_1): Likewise.
415 (pushdecl_maybe_friend_1): Adjust set_namespace_binding call.
416 (push_overloaded_decl_1): Likewise.
417 (set_global_binding): Likewise.
418 (get_namespace_binding): Adjust namespace_binding_1 call.
420 2017-05-17 Nathan Sidwell <nathan@acm.org>
422 * cp-tree.h (default_hash_traits <lang_identifier *>): New
424 * name-lookup.c (lookup_extern_c_fun_in_all_ns): Delete.
425 (extern_c_fns): New hash table.
426 (check_extern_c_conflict): New, broken out of ...
427 (pushdecl_maybe_friend_1): ... here. Call it.
428 (c_linkage_bindings): Just look in hash table.
430 2017-05-17 Ville Voutilainen <ville.voutilainen@gmail.com>
434 Implement new C++ intrinsics __is_assignable and __is_constructible.
435 * cp-tree.h (CPTK_IS_ASSIGNABLE, CPTK_IS_CONSTRUCTIBLE): New.
437 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
438 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
439 * method.c (constructible_expr): Set cp_unevaluated.
440 (is_xible_helper): New.
441 (is_trivially_xible): Adjust.
443 * parser.c (cp_parser_primary_expression): Handle
444 RID_IS_ASSIGNABLE and RID_IS_CONSTRUCTIBLE.
445 (cp_parser_trait_expr): Likewise.
446 * semantics.c (trait_expr_value): Handle
447 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
449 2017-05-17 Nathan Sidwell <nathan@acm.org>
451 * cp-tree.h (ovl_iterator::using_p): New predicate.
452 (ovl_iterator::remove_node): New worker.
453 (ovl_insert): Declare.
454 * tree.c (ovl_insert): New.
455 (ovl_iterator::remove_node): New.
456 * class.c (add_method): Use ovl_iterator, ovl_insert.
457 (clone_function_decl): Fix description.
458 (clone_constructors_and_destructors): Use ovl_iterator.
460 * class.c (handle_using_decl): Use OVL_FIRST, ovl_iterator.
461 (maybe_warn_about_overly_private_class): Use ovl_iterator.
462 (method_name_cmp, resort_method_name_cmp): Use OVL_NAME.
463 (resort_type_method_vec, finish_struct_methods): Use OVL_FIRST.
464 (get_base_fndecls): Use ovl_iterator.
465 (warn_hidden): Use OVL_NAME, ovl_iterator.
466 (add_implicitly_declared_members): Use ovl_iterator.
467 * constraint.cc (normalize_template_id_expression): Use OVL_FIRST,
469 (finish_shorthand_constraint): Simplify, use ovl_make.
470 * pt.c (make_constrained_auto): Simplify. Use ovl_make.
471 * search.c (shared_member_p): Use ovl_iterator.
472 (lookup_field_fuzzy_info::fuzzy_lookup_fn): Use OVL_NAME.
473 (lookup_conversion_operator): Use OVL_FIRST.
474 (lookup_fnfiels_idx_nolazy): Use OVL_FIRST, OVL_NAME.
475 (look_for_overrides_here): Use ovl_iterator.
476 (lookup_conversions_r): Use OVL_FIRST, OVL_NAME, ovl_iterator.
477 * typeck.c (build_x_unary_op): Use ovl_make.
479 2017-05-17 Martin Liska <mliska@suse.cz>
481 * class.c (dump_class_hierarchy): Introduce dump_flags_t type and
482 use it instead of int type.
483 (dump_vtable): Likewise.
484 (dump_vtt): Likewise.
485 * decl2.c (dump_tu): Likewise.
487 2017-05-16 David Malcolm <dmalcolm@redhat.com>
489 * call.c (enforce_access): Add access_failure_info * param and use
490 it to record access failures.
491 * cp-tree.h (class access_failure_info): New class.
492 (enforce_access): Add access_failure_info * param, defaulting to
494 (lookup_member): Likewise.
495 (locate_field_accessor): New function decl.
496 (perform_or_defer_access_check): Add access_failure_info * param,
498 * search.c (lookup_member): Add access_failure_info * param and
499 pass it on to call to perform_or_defer_access_check.
500 (matches_code_and_type_p): New function.
501 (field_access_p): New function.
502 (direct_accessor_p): New function.
503 (reference_accessor_p): New function.
504 (field_accessor_p): New function.
505 (struct locate_field_data): New struct.
506 (dfs_locate_field_accessor_pre): New function.
507 (locate_field_accessor): New function.
508 * semantics.c (perform_or_defer_access_check): Add
509 access_failure_info * param, and pass it on to call to
511 * typeck.c (access_failure_info::record_access_failure): New method.
512 (access_failure_info::maybe_suggest_accessor): New method.
513 (finish_class_member_access_expr): Pass an access_failure_info
514 instance to the lookup_member call, and call its
515 maybe_suggest_accessor method afterwards.
517 2017-05-16 Marek Polacek <polacek@redhat.com>
521 * cp-gimplify.c (cp_fold): Handle SAVE_EXPR.
523 2017-05-16 Nathan Sidwell <nathan@acm.org>
525 * name-lookup.c (check_local_shadow): New, broke out of ...
526 (pushdecl_maybe_friend_1): ... here. Call it.
528 * cp-tree.h (OVL_NESTED_P, OVL_LOOKUP_P): New.
529 (ovl_first): Move inline definition to end of file.
530 (ovl_make, lookup_add): Declare.
531 (get_fns, get_first_fn): Make pure.
532 * tree.c (ovl_cache): New.
533 (ovl_make, lookup_add): New.
534 * pt.c (do_class_deduction): Don't add candidates that will be
537 * call.c (build_user_type_conversion_1): Use OVL_FIRST.
538 (print_error_for_call_failure): Use OVL_NAME.
539 (build_op_call_1): Use ovl_iterator.
540 (add_candidates): Use OVL_FIRST & lkp_iterator.
541 (build_op_delete_call): Use MAYBE_BASELINK_FUNCTIONS &
543 * class.c (deduce_noexcept_on_destructors): Use ovl_iterator.
544 (type_has_user_nondefault_constructor,
545 in_class_defaulted_default_constructor,
546 type_has_user_provided_constructor,
547 type_has_user_provided_or_explicit_constructor,
548 type_has_non_user_provided_default_constructor,
549 vbase_has_user_provided_move_assign,
550 type_has_move_constructor, type_has_move_assign,
551 type_has_user_declared_move_constructor,
552 type_has_user_declared_move_assign,
553 type_build_ctor_call, type_build_dtor_call,
554 type_requires_array_cookie, explain_non_literal_class): Likewise.
555 (finish_struct): Use lkp_iterator.
556 (resolve_address_of_overloaded_function): Use OVL_NAME, lkp_iterator.
557 (note_name_declared_in_class): Use OVL_NAME.
558 * cxx-pretty-print.c (pp_cxx_unqualified_id): Use OVL_FIRST.
559 (pp_cxx_qualified_id, cxx_pretty_printer::id_expression,
560 cxx_pretty_printer::expression): Likewise.
561 * decl2.c (check_classfn): Use ovl_iterator.
562 * pt.c (retrieve_specialization): Use ovl_iterator.
563 * tree.c (cp_tree_equal): Use lkp_iterator.
564 (type_has_nontrivial_copy_init): Use ovl_iterator.
566 * typeck2.c (cxx_incomplete_type_diagnostic): Revert change and
567 check is_overloaded_fn.
569 2017-05-16 Martin Liska <mliska@suse.cz>
571 * parser.c (cp_lexer_print_token): Add default value for flags
572 argument of print_gimple_stmt, print_gimple_expr,
573 print_generic_stmt and print_generic_expr.
575 2017-05-16 Nathan Sidwell <nathan@acm.org>
577 * cp-tree.h (class ovl_iterator, class lkp_iterator): New OVERLOAD
579 (MAYBE_BASELINK_FUNCTIONS): New.
580 * constraint.cc (resolve_constraint_check): Use lkp_iterator.
581 * decl2.c (maybe_warn_sized_delete): Use ovl_iterator.
582 * lambda.c (maybe_generic_this_capture): Use lkp_iterator.
583 * method.c (inherited_ctor_binfo): Use ovl_iterator.
584 (binfo_inherited_from): Likewise.
585 * parser.c (lookup_literal_operator): Use lkp_iterator.
586 * pt.c (iterative_hash_template_arg): Use lkp_iterator.
587 (print_candidates_1): Likewise.
588 (determine_specialization): Likewise.
589 (resolve_overloaded_unification): Likewise.
590 (resolve_nondeduced_context): Likewise.
591 (type_dependent_expression_p): Likewise.
592 (dependent_template_p): Likewise.
593 * ptree.c (cxx_print_xnode): Likewise.
594 * semantics.c (omp_reduction_lookup): Use lkp_iterator.
595 (classtype_has_nothrow_assign_or_copy_p): Use ovl_iterator.
596 * typeck.c (check_template_keyword): Use lkp_iterator.
598 * cp-tree.h (OVL_FIRST, OVL_NAME): New.
600 * constexpr.c (function_concept_check): Use OVL_FIRST.
601 * cvt.c (build_expr_type_conversion): Likewise.
602 * decl.c (poplevel, grokdeclarator): Use OVL_NAME.
603 * decl2.c (mark_used): Use OVL_FIRST.
604 * error.c (dump_decl): Use OVL_FIRST, OVL_NAME.
605 (dump_expr, location_of): Use OVL_FIRST.
606 * friend.c (do_friend): Use OVL_NAME.
607 * init.c (build_offset_ref): Use OVL_FIRST.
608 * mangle.c (write_member_name): Likewise.
609 (write_expression): Use OVL_NAME.
610 * method.c (strip_inheriting_ctors): Use OVL_FIRST.
611 * name-lookup.c (pushdecl_class_level): Use OVL_NAME.
612 * pt.c (check_explicit_specialization): Use OVL_FIRST.
613 (check_template_shadow): Likewise.
614 (tsubst_template_args): Use OVL_NAME.
615 (tsubst_baselink): Use OVL_FIRST.
616 * semantics.c (perform_koenig_lookup): Use OVL_NAME.
617 * tree.c (get_first_fn): Use OVL_FIRST.
618 * typeck.c (finish_class_member_access_expr): Use OVL_NAME.
619 (cp_build_addr_expr_1): Use OVL_FIRST.
621 * pt.c (tsubst_copy_and_build): Remove unnecessary COMPONENT_REF
623 * semantics.c (finish_id_expression): Directly init local var.
624 (finish_omp_reduction_clause): Use really_overloaded_fn.
625 * tree.c (get_fns): Document. Assert we got an overload.
626 (get_first_fn) Document.
627 * typeck.c (cp_build_addr_expr_1): Pass arg directly to
628 really_overloaded_fn.
629 * typeck2.c (cxx_incomplete_type_diagnostic): Use get_first_fn directly.
631 * cp-tree.h (SCOPE_DEPTH): New.
632 * name-lookup.h (is_nested_namespace): Declare.
633 * name-lookup.c (is_nested_namespace): New.
634 (is_ancestor): Use it.
635 (set_decl_namespace): Likewise.
636 (push_namespace): Set SCOPE_DEPTH.
637 * pt.c (check_specialization_namespace): Use is_nested_namespace.
638 (check_unqualigied_spec_or_inst): Likewise.
640 2017-05-15 Nathan Sidwell <nathan@acm.org>
643 * cp-tree.h (DECL_NAMESPACE_INLINE_P): New.
644 * name-lookup.h (push_namespace): Return int, add make_inline arg.
645 * name-lookup.c (push_namespace): Deal with inline directly.
647 * parser.c (cp_parser_namespace_definition): Adjust for
648 push_namespace change.
650 2017-05-11 Nathan Sidwell <nathan@acm.org>
652 * cp-lang.c (get_global_decls, cxx_pushdecl, LANG_HOOK_GETDECLS,
653 LANG_HOOKS_PUSHDECL): Move to ...
654 * cp-objcp-common.c (cp_get_global_decls, cp_pushdec,
655 LANG_HOOK_DECLS, LANG_HOOKS_PUSHDECL): ... here.
656 * cp-objcp-common.h (cp_get_global_decls, cp_pushdecl): Declare.
658 * name-lookup.h (pushdecl): Add default friend parm.
659 (pushdecl_maybe_friend): Delete.
660 (pushdecl_top_level): Add default friend parm.
661 (pushdecl_top_level_maybe_friend): Delete.
662 * name-lookup.c (pushdecl_maybe_friend): Delete.
663 (pushdecl): Add is_friend parm.
664 (pushdecl_top_level): Add is friend_parm.
665 (pushdecl_top_level_maybe_friend, pushdecl_top_level_1): Delete.
666 (pushdecl_top_level_and_finish): Do pushing and finishing directly.
667 * friend.c (do_friend): Adjust.
668 * pt.c (tsubst_friend_class): Adjust.
670 Revert pushdecl_top_level_and_finish name change.
671 * name-lookup.h (pushdecl_top_level_and_finish): Resurrect old name.
672 * name-lookup.c (pushdecl_top_level_and_finish): Likewise.
673 * decl.c (cp_make_fname_decl): Adjust.
674 * decl2.c (get_guard, handle_tls_init): Adjust.
675 * rtti.c (get_tinfo_decl, tinfo_base_init): Adjust.
677 * name-lookup.c (pushdecl_outermost_localscope): Always
678 conditionally stop timer.
680 * decl.c (xref_tag_1): Don't frob ts_lambda scope here.
681 * name-lookup.c (pushtag_1): Deal with ts_lambda scope.
683 * cp-tree.h (pushdecl, pushdecl_maybe_friend, pushtag,
684 pushtag_top_level_maybe_friend,
685 pushdecl_top_level_and_finish): Move declarations to ...
686 * name-lookup.h: ... here. Group pushdecl variants.
687 (pushdecl_top_level_and_finish): Rename to ...
688 (pushdecl_top_level_with_init): ... here.
689 * decl.c (cp_make_fname_decl): Use pushdecl_top_level_with_init.
690 * decl2.c (get_guard, handle_tls_init): Likewise.
691 * rtti.c (get_tinfo_decl, tinfo_base_init): Likewise.
692 * lambda.c (maybe_add_lambda_conv_op): Use namespace_bindings_p.
693 * method.c (implicitly_declare_fn): Likewise.
694 * searchc (node_debug_info_needed): Likewise.
695 * name-lookup.c (pushdecl_top_level_and_finish): Rename to ...
696 (pushdecl_top_level_with_init): ... here.
697 (pop_everything): Use namespace_bindings_p.
699 * name-lookup.h (pop_binding): Rename to pop_local_binding.
700 (getdecls): Rename to get_local_decls.
701 * name-lookup.c (pop_binding): Rename to ...
702 (pop_local_binding): ... here.
703 (pop_bindings_and_leave_scope): Adjust.
704 (getdecls): Rename to ...
705 (get_local_decls): ... here. Assert local scope.
706 * decl.c (poplevel): Assert not namespace. Adjust and simplify
708 (store_parm_decls): Adjust get_local_decls call.
709 (parser.c (synthesize_implicit_template_parm): Likewise.
711 2017-05-11 Ville Voutilainen <ville.voutilainen@gmail.com>
714 * method.c (is_trivially_xible): Reject void types.
716 2017-05-10 Nathan Sidwell <nathan@acm.org>
718 * class.c (handle_using_decl): Always use OVL_CURRENT.
719 (resolve_address_of_overloaded_function): Move iterator decl into
720 for scope. Don't strip anticipated decls here.
722 * pt.c (print_candidates_1): Separate TREE_LIST and OVERLOAD
724 (print_candidates): Adjust.
726 * cp-tree.h (build_new_function_call): Lose koenig_p arg. Fix
728 * call.c (build_new_function_call): Lose koenig_p arg. Remove
729 koenig_p handling here.
730 * pt.c (push_template_decl_real): Unconditionally retrofit_lang_decl.
731 (tsubst_omp_clauses): Likewise.
732 (do_class_deduction): Adjust buld_new_function_call calls.
733 * semantics.c (finish_call_expr): Likewise.
735 2017-05-10 Jason Merrill <jason@redhat.com>
737 * pt.c (unify_parameter_deduction_failure, unify_cv_qual_mismatch)
738 (unify_type_mismatch, unify_parameter_pack_mismatch)
739 (unify_ptrmem_cst_mismatch, unify_expression_unequal)
740 (unify_parameter_pack_inconsistent, unify_inconsistency)
741 (unify_vla_arg, unify_method_type_error, unify_arity)
742 (unify_arg_conversion, unify_no_common_base)
743 (unify_inconsistent_template_template_parameters)
744 (unify_template_deduction_failure)
745 (unify_template_argument_mismatch)
746 (unify_overload_resolution_failure): Call unify_invalid.
748 CWG 1847 - Clarifying compatibility during partial ordering
749 * pt.c (more_specialized_fn): No order between two non-deducible
752 * pt.c (dependent_type_p): Make sure we aren't called with
755 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
756 * pt.c (convert_template_argument): Just return an argument pack.
757 (coerce_template_parameter_pack, template_parm_to_arg)
758 (extract_fnparm_pack, make_argument_pack, tsubst_template_args)
759 (tsubst_decl, tsubst, type_unification_real, unify_pack_expansion):
760 Don't set the type of a NONTYPE_ARGUMENT_PACK.
761 * parser.c (make_char_string_pack, make_string_pack): Likewise.
763 2017-05-10 Nathan Sidwell <nathan@acm.org>
765 * cp-tree.h (add_method, clone_function_decl): Change last arg to
767 * class.c (add_method): Change third arg to bool. Adjust.
768 (one_inheriting_sig, one_inherited_ctor): Adjust.
769 (clone_function_decl): Change 2nd arg to bool. Adjust.
770 (clone_constructors_and_destructors): Adjust.
771 * lambda.c (maybe_add_lambda_conv_op): Adjust.
772 * method.c (lazily_declare_fn): Adjust.
773 * pt.c (tsubst_decl, instantiate_template_1): Adjust.
774 * semantics.c (finish_member_declaration): Adjust.
776 2017-05-10 Paolo Carlini <paolo.carlini@oracle.com>
779 * decl.c (finish_function): To improve error recovery, change the
780 logic for calling apply_deduced_return_type.
782 2017-05-09 Jason Merrill <jason@redhat.com>
784 PR c++/80605 - __is_standard_layout and empty base
785 * class.c (check_bases): Ignore empty bases.
787 PR c++/70979 - literal class and closure types
788 * class.c (finalize_literal_type_property): Handle closures
790 (explain_non_literal_class): Likewise.
792 PR c++/66297, DR 1684 - literal class and constexpr member fns
793 * constexpr.c (is_valid_constexpr_fn): Only complain about
794 non-literal enclosing class in C++11.
795 * class.c (finalize_literal_type_property): Likewise.
797 2017-05-09 Paolo Carlini <paolo.carlini@oracle.com>
800 * pt.c (tsubst_decl): Early return error_mark_node if
801 grok_ctor_properties returns false.
803 2017-05-09 Jason Merrill <jason@redhat.com>
805 PR c++/70167 - array prvalue treated as lvalue
806 * cp-tree.h (CONSTRUCTOR_C99_COMPOUND_LITERAL): New.
808 * semantics.c (finish_compound_literal): Add fcl_context parameter.
809 Only make a static variable for C99 syntax.
810 * parser.c (cp_parser_postfix_expression): Pass it.
811 * pt.c (tsubst_copy_and_build): Likewise.
812 * call.c (extend_ref_init_temps): Set
813 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
815 2017-05-09 Nathan Sidwell <nathan@acm.org>
817 * cp-lang.c (get_global_decls, cxx_pushdecl): New.
818 (LANG_HOOKS_GETDECLS, LANG_HOOKS_PUSHDECL): Override.
819 * name-lookup.h (pushdecl_top_level): Declare.
821 2017-05-08 Jason Merrill <jason@redhat.com>
823 PR c++/80178 - parameter passing for uncopyable classes
824 * tree.c (type_has_nontrivial_copy_init): True for classes with only
825 deleted copy/move ctors.
826 (remember_deleted_copy, maybe_warn_parm_abi): New.
827 * decl.c (require_complete_types_for_parms, check_function_type):
828 Call maybe_warn_parm_abi.
829 * call.c (convert_for_arg_passing, build_cxx_call): Likewise.
831 2017-05-08 Nathan Sidwell <nathan@acm.org>
833 * decl.c (builtin_function_1): Set DECL_ANTICIPATED before pushing.
834 (start_preparsed_function): Do decl pushing before setting
835 current_funciton_decl and announcing it.
837 * name-lookup.h (pushdecl_with_scope): Replace with ...
838 (pushdecl_outermost_localscope): ... this.
839 * name-lookup.c (pushdecl_with_scope): Replace with ...
840 (pushdecl_outermost_localscope): ... this.
841 (pushdecl_namespace_level): Adjust.
842 * decl.c (cp_make_fname_decl): Use pushdecl_outermost_localscope.
843 * lambda.c (insert_capture_proxy): Likewise.
845 * class.c (build_vtbl_initializer): Don't shadow outer variable
848 Revert _binding -> _value change.
849 * name-lookup.h (get_namespace_value, set_global_value): Rename to ...
850 (get_namespace_binding, set_global_binding): ... these.
851 * name-lookup.c (get_namespace_value, set_global_value): Rename to ...
852 (get_namespace_binding, set_global_binding): ... these.
853 (arg_assoc_namespace, pushdecl_maybe_friend_1,
854 check_for_out_of_scope_variable, push_overloaded_decl_1,
855 lookup_name_innermost_nonclass_level, push_namespace): Adjust.
856 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
857 SET_IDENTIFIER_GLOBAL_VALUE): Adjust.
858 * decl.c (poplevel): Adjust.
859 * pt.c (make_constrained_auto): Likewise.
861 2017-05-07 Volker Reichelt <v.reichelt@netcologne.de>
864 * call.c (print_z_candidate): Fix quoting.
866 2017-05-05 David Malcolm <dmalcolm@redhat.com>
868 * error.c (pedwarn_cxx98): Replace report_diagnostic
869 with diagnostic_report_diagnostic.
871 2017-05-05 Nathan Sidwell <nathan@acm.org>
873 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value.
874 (SET_IDENTIFIER_GLOBAL_VALUE): Use set_global_value.
875 (IDENTIFIER_NAMESPACE_VALUE): Delete.
876 * name-lookup.h (namespace_binding, set_namespace_binding): Replace
878 (get_namespace_value, set_global_value): ... these.
879 (get_global_value_if_present, is_typename_at_global_scope): Delete.
880 * decl.c (poplevel): Use get_namespace_value.
881 (grokdeclarator): Use IDENTIFIER_GLOBAL_VALUE.
882 * class.c (build_vtbl_initializer): Stash library decl in
883 static var. Use IDENTIFIER_GLOBAL_VALUE.
884 * except.c (do_get_exception_ptr, do_begin_catch, do_end_catch,
885 do_allocate_exception, do_free_exception, build_throw): Likewise.
886 * init.c (throw_bad_array_new_length): Likewise.
887 * rtti.c (throw_bad_cast, throw_bad_typeid): Likewise.
888 * name-lookup.c (arg_assoc_namespace, pushdecl_maybe_friend_1,
889 check_for_our_of_scope_variable, push_overloaded_decl_1): Use
891 (set_namespace_binding_1): Rename to
892 (set_namespace_binding): ... here.
893 (set_global_value): New.
894 (lookup_name_innermost_nonclass_level_1, push_namespace): Use
896 * pt.c (listify): Use get_namespace_value.
898 * call.c (make_temporary_var_for_ref_to_temp): Push decl into
900 * lex.c (unqualified_name_lookup_error): Likewise.
902 * class.c (alter_class): Use retrofit_lang_decl directly.
903 * decl.c (push_local_name, dupliate_decls): Likewise.
904 * semantics.c (omp_privatize_field): Likewise.
906 Kill walk_namespaces.
907 * cp-tree.h (walk_namespaces_fn, walk_namespaces): Delete.
908 * decl.c (walk_namespaces_r, walk_namespaces): Delete.
910 Kill per-namespace static_decls.
911 * cp-tree.h (static_decls): Declare.
912 (wrapup_globals_for_namespace,
913 diagnose_inline_vars_for_namespace): Replace with ...
914 (wrapup_namespace_globals): ... this.
915 * decl.c (static_decls): Define.
916 (wrapup_globals_for_namespace,
917 diagnose_inline_vars_for_namespace): Replace with ...
918 (wrapup_namespace_globals): ... this.
919 (cxx_init_decl_processing): Initialize static_decls.
920 * decl2.c (c_parse_final_cleanups): Adjust.
921 * name-lookup.h (cp_binding_level): Remove static_decls member.
922 * name-lookup.c (add_decl_to_level): Adjust.
923 (begin_scope): Adjust.
925 2017-05-05 Paolo Carlini <paolo.carlini@oracle.com>
928 * decl.c (reshape_init): Unconditionally return error_mark_node
929 upon error about too many initializers.
931 2017-05-04 Nathan Sidwell <nathan@acm.org>
933 * constraint.cc (diagnose_check_constraint): Fix %E thinko.
935 2017-05-04 Martin Sebor <msebor@redhat.com>
938 * call.c (print_z_candidate): Add missing quoting to %D and other
940 (build_op_call_1): Same.
941 * constraint.cc (diagnose_check_constraint): Same.
942 * mangle.c (mangle_decl): Same.
943 * name-lookup.c (cp_binding_level_debug): Same.
944 (set_decl_namespace): Same.
945 * parser.c (cp_parser_tx_qualifier_opt): Same.
946 * pt.c (print_candidates_1): Same.
947 (check_template_variable): Same.
948 (tsubst_default_argument): Same.
949 (most_specialized_partial_spec): Same.
950 * semantics.c (omp_reduction_lookup): Same.
951 * tree.c (check_abi_tag_redeclaration): Same.
952 * typeck.c (comptypes): Same.
953 * typeck2.c (abstract_virtuals_error_sfinae): Same.
955 2017-05-04 Nathan Sidwell <nathan@acm.org>
958 * cp-tree.h (enum cp_tree_index): Add CPTI_GLOBAL,
959 CPTI_GLOBAL_TYPE, CPTI_GLOBAL_IDENTIFIER, CPTI_ANON_IDENTIFIER,
960 CPTI_INIT_LIST_IDENTIFIER.
961 (global_namespace, global_type_node, global_identifier,
962 anon_identifier, init_list_identifier): New.
963 * decl.c (global_type_node, global_scope_name): Delete.
964 (initialize_predefined_identifiers): Add new identifiers.
965 (cxx_init_decl_processing): Adjust.
966 * name-lookup.h (global_namespace, global_type_node): Delete.
967 * name-lookup.c (global_namespace, anonymous_namespace_name,
968 get_anonymous_namespace_name): Delete.
969 (namespace_scope_ht_size, begin_scope, pushtag_1,
970 push_namespace): Adjust,
971 * call.c (type_has_extended_temps): Use init_list_identifier.
972 * pt.c (listify): Likewise.
974 * name-lookup.c: Reorder functions to make merging from modules
977 2017-05-03 Jason Merrill <jason@redhat.com>
979 * constexpr.c (cxx_eval_outermost_constant_expr): Use TV_CONSTEXPR.
981 2017-05-03 Nathan Sidwell <nathan@acm.org>
983 * cp-tree.h (enum cp_tree_index, cp_global_trees): Move earlier,
984 along with #defines, to before name-lookup include.
986 2017-05-02 Paolo Carlini <paolo.carlini@oracle.com>
988 * pt.c (is_auto_or_concept): Remove.
989 (type_uses_auto_or_concept): Remove, unused.
990 (find_parameter_packs_r, extract_autos_r, is_auto_r): Adjust.
991 * parser.c (tree_type_is_auto_or_concept): Remove, unused.
992 * cp-tree.h (is_auto_or_concept): Remove.
994 2017-05-01 Xi Ruoyao <ryxi@stu.xidian.edu.cn>
997 * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Don't
998 add pedigree operation and detach call here.
999 * cp-gimplify.c (cp_gimplify_expr): Remove the calls to
1000 cilk_cp_gimplify_call_params_in_spawned_fn.
1001 (cilk_cp_gimplify_call_params_in_spawned_fn): Remove function.
1002 * semantics.c (simplify_aggr_init_expr): Copy EXPR_CILK_SPAWN.
1004 2017-04-29 Volker Reichelt <v.reichelt@netcologne.de>
1006 * parser.c (cp_parser_member_declaration): Add fix-it hints for
1007 stray comma and missing semicolon at end of member declaration.
1009 2017-04-27 Volker Reichelt <v.reichelt@netcologne.de>
1011 * parser.c (cp_parser_cast_expression): Add target type of cast to
1013 * error.c (type_to_string): Add '{enum}' suffix to enumeration types.
1015 2017-04-26 Paolo Carlini <paolo.carlini@oracle.com>
1017 * decl.c (grok_ctor_properties, ambi_op_p, unary_op_p): Change
1018 return type to bool.
1019 * cp-tree.h (grok_ctor_properties): Update.
1021 2017-04-26 Volker Reichelt <v.reichelt@netcologne.de>
1023 * parser.c (cp_parser_nested_name_specifier_opt): Add fix-it
1024 information to diagnostic of invalid colon in nested-name-specifier.
1026 2017-04-25 Volker Reichelt <v.reichelt@netcologne.de>
1028 * parser.c (cp_parser_elaborated_type_specifier): Add fix-it to
1029 diagnostic of invalid class/struct keyword after enum.
1031 2017-04-25 David Malcolm <dmalcolm@redhat.com>
1033 * parser.c (cp_parser_member_declaration): Add fix-it hint
1034 for removing stray semicolons.
1036 2017-04-25 David Malcolm <dmalcolm@redhat.com>
1038 * name-lookup.c (get_std_name_hint): New function.
1039 (maybe_suggest_missing_header): New function.
1040 (suggest_alternative_in_explicit_scope): Call
1041 maybe_suggest_missing_header.
1043 2017-04-25 David Malcolm <dmalcolm@redhat.com>
1046 * name-lookup.c (suggest_alternative_in_explicit_scope): Convert
1047 candidate type of bm from tree to const char *.
1048 (consider_binding_level): Likewise.
1049 (lookup_name_fuzzy): Likewise, using this to merge the best
1050 result from the preprocessor into bm, rather than immediately
1051 returning, so that better matches from reserved words can "win".
1052 Guard the rejection of keywords that don't start decl-specifiers
1053 so it only happens for FUZZY_LOOKUP_TYPENAME.
1055 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
1057 * decl.c (grokdeclarator): Use %qT instead of %<%T%> in diagnostics.
1058 (start_enum): Likewise.
1059 (build_enumerator): Likewise. Use %qE instead of plain %E.
1060 * parser.c (cp_parser_mem_initializer_list): Use %qD instead of
1061 %<%D%> in diagnostics.
1062 (cp_parser_elaborated_type_specifier): Likewise.
1063 * pt.c (make_pack_expansion): Use %qT and %qE instead of
1064 %<%T%> and %<%E%> in diagnostics.
1065 (tsubst_pack_expansion): Likewise.
1067 2017-04-24 David Malcolm <dmalcolm@redhat.com>
1070 * parser.c (cp_parser_unary_expression): Generate a location
1071 range for alignof and sizeof expressions.
1073 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
1075 * parser.c (cp_parser_cv_qualifier_seq_opt): Add fix-it info to
1077 (cp_parser_virt_specifier_seq_opt): Likewise.
1078 (set_and_check_decl_spec_loc): Likewise twice.
1080 2017-04-21 Jason Merrill <jason@redhat.com>
1082 PR c++/80179 - ICE with initialized flexible array member.
1083 * constexpr.c (verify_ctor_sanity): Handle flexible array members.
1085 2017-04-21 Richard Biener <rguenther@suse.de>
1087 * cp-tree.h (copy_decl): Annotate with CXX_MEM_STAT_INFO.
1088 (copy_type): Likewise.
1089 * lex.c (copy_decl): Pass down mem-stat info.
1090 (copy_type): Likewise.
1092 2017-04-20 Jonathan Wakely <jwakely@redhat.com>
1095 * init.c (build_new_1): Suppress notes about over-aligned new when
1096 the warning is suppressed.
1098 2017-04-20 Volker Reichelt <v.reichelt@netcologne.de>
1100 * parser.c (cp_parser_member_declaration): Add warning with fixit
1101 information for extra semicolon after in-class function definition.
1103 2017-04-20 Jakub Jelinek <jakub@redhat.com>
1106 * tree.c (build_cplus_array_type): Call build_array_type
1107 with the intended TYPE_TYPELESS_STORAGE flag value, instead
1108 of calling build_array_type and modifying later TYPE_TYPELESS_STORAGE
1111 2017-04-18 Marek Polacek <polacek@redhat.com>
1113 PR c++/80244 - ICE with attribute in template alias.
1114 * tree.c (strip_typedefs): Handle UNDERLYING_TYPE.
1116 PR c++/80241 - ICE with alignas pack expansion.
1117 * error.c (dump_expr): Handle TREE_LIST.
1118 * parser.c (cp_parser_std_attribute_list): Return error_mark if
1119 make_pack_expansion returns an error.
1121 2017-04-17 Bernd Edlinger <bernd.edlinger@hotmail.de>
1124 * class.c (fixup_may_alias): Fix all type variants.
1126 2017-04-17 Jason Merrill <jason@redhat.com>
1128 PR c++/80415 - wrong error with default arg and array reference.
1129 * tree.c (lvalue_kind): Return clk_class for an array prvalue.
1131 * pt.c (tsubst_init): Set TARGET_EXPR_DIRECT_INIT_P.
1133 2017-04-15 Alexandre Oliva <aoliva@redhat.com>
1135 * decl.c (name_unnamed_type): Split out of...
1136 (grokdeclarator): ... this.
1137 * decl.h (name_unnamed_type): Declare.
1139 2017-04-12 Richard Biener <rguenther@suse.de>
1140 Bernd Edlinger <bernd.edlinger@hotmail.de>
1143 * tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
1144 for arrays of character or std::byte type.
1146 2017-04-11 Jason Merrill <jason@redhat.com>
1148 PR c++/80294 - ICE with constexpr and inheritance.
1149 * constexpr.c (reduced_constant_expression_p):
1150 A null constructor element is non-constant.
1151 (cxx_eval_indirect_ref): Don't VERIFY_CONSTANT before
1152 returning an empty base.
1154 2017-04-11 Jakub Jelinek <jakub@redhat.com>
1157 * decl.c (cp_finish_decomp): If processing_template_decl on
1158 non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't
1159 change their DECL_VALUE_EXPR nor cp_finish_decl them. Instead make
1160 sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst
1162 * pt.c (value_dependent_expression_p) <case VAR_DECL>: For variables
1163 with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
1166 2017-04-11 Jakub Jelinek <jakub@redhat.com>
1169 * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.
1171 2017-04-10 Jakub Jelinek <jakub@redhat.com>
1174 * tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
1175 operand, if it is a static member function, recurse on the
1178 2017-04-10 Marek Polacek <polacek@redhat.com>
1181 * typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL. Set
1182 ORIG_TYPE earlier and not only when shortening.
1184 2017-04-07 Jason Merrill <jason@redhat.com>
1186 PR c++/80356 - ICE with reference to function template argument.
1188 * pt.c (convert_nontype_argument_function): Adjust type even with a
1189 value-dependent argument.
1191 PR c++/80267 - ICE with nested capture of reference
1193 * pt.c (tsubst_copy): Handle lookup finding a capture proxy.
1195 2017-04-07 Marek Polacek <polacek@redhat.com>
1198 * typeck.c (cp_build_binary_op): Convert COP[01] to ORIG_TYPE.
1201 * call.c (build_over_call): Don't check cxx_dialect.
1202 * cp-gimplify.c (cp_gimplify_init_expr): Don't check cxx_dialect nor
1203 whether SUB is a CONSTRUCTOR.
1204 * init.c (build_new_1): Don't check cxx_dialect.
1205 * tree.c (replace_placeholders): Add a function comment. Return if
1206 not in C++14, or if the object isn't a (member of a) class.
1207 * typeck2.c (store_init_value): Don't check cxx_dialect nor whether
1208 TYPE is CLASS_TYPE_P.
1210 2017-04-05 Jakub Jelinek <jakub@redhat.com>
1213 * pt.c (canonical_type_parameter): Use vec_safe_grow_cleared instead
1214 of a loop doing vec_safe_push of NULL. Formatting fixes.
1215 (rewrite_template_parm): Copy TEMPLATE_PARM_PARAMETER_PACK from oldidx
1216 to newidx before calling canonical_type_parameter on newtype.
1218 2017-04-04 Volker Reichelt <v.reichelt@netcologne.de>
1221 * cxx-pretty-print.c (cxx_pretty_printer::expression): Add
1222 UNARY_PLUS_EXPR case.
1224 2017-04-03 Jason Merrill <jason@redhat.com>
1226 * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
1228 2017-04-03 Jonathan Wakely <jwakely@redhat.com>
1230 * class.c (update_vtable_entry_for_fn): Fix typo in comment.
1231 * decl2.c (one_static_initialization_or_destruction): Likewise.
1232 * name-lookup.c (store_bindings): Likewise.
1233 * parser.c (make_call_declarator): Likewise.
1234 * pt.c (check_explicit_specialization): Likewise.
1236 2017-04-03 Jason Merrill <jason@redhat.com>
1238 PR sanitizer/79993 - ICE with VLA initialization from string
1239 PR c++/69487 - wrong VLA initialization from string
1240 * init.c (finish_length_check): Split out from build_vec_init.
1241 (build_vec_init): Handle STRING_CST.
1242 * typeck2.c (split_nonconstant_init): Handle STRING_CST.
1243 (digest_init_r): Don't give a STRING_CST VLA type.
1245 2017-03-31 Jakub Jelinek <jakub@redhat.com>
1248 * cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
1249 REFERENCE_TYPE. Adjust ubsan_maybe_instrument_reference caller
1250 for NOP_EXPR to REFERENCE_TYPE.
1253 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
1254 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
1256 * semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
1257 Remove extraneous parens.
1258 (finish_trait_expr): Handle CPTK_IS_AGGREGATE.
1259 * parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
1260 (cp_parser_trait_expr): Likewise.
1262 2017-03-27 Jakub Jelinek <jakub@redhat.com>
1265 * cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
1266 * typeck.c (cxx_mark_addressable): Likewise. Look through
1267 VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
1269 (cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
1271 2017-03-24 Jason Merrill <jason@redhat.com>
1273 PR c++/77339 - ICE with invalid use of alias template.
1274 * pt.c (lookup_template_class_1): Don't try to enter the scope of an
1277 2017-03-24 Marek Polacek <polacek@redhat.com>
1280 * cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
1281 doesn't have side effects.
1283 2017-03-23 Jason Merrill <jason@redhat.com>
1285 PR c++/80150 - ICE with overloaded variadic deduction.
1286 * pt.c (try_one_overload): Remove asserts.
1288 PR c++/77563 - missing ambiguous conversion error.
1289 * call.c (convert_like_real): Use LOOKUP_IMPLICIT.
1291 2017-03-23 Marek Polacek <polacek@redhat.com>
1293 * cp-tree.h: Remove a C_RID_YYCODE reference.
1295 2017-03-22 Jakub Jelinek <jakub@redhat.com>
1298 * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
1299 case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
1300 processing_template_decl.
1302 2017-03-21 Paolo Carlini <paolo.carlini@oracle.com>
1305 * name-lookup.c (pushtag_1): Add check for bogus, non template,
1306 std::initializer_list.
1308 2017-03-21 Jakub Jelinek <jakub@redhat.com>
1311 * init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.
1313 2017-03-21 Ville Voutilainen <ville.voutilainen@gmail.com>
1316 * init.c (std_placement_new_fn_p): New.
1317 (build_new_1): Call it.
1319 2017-03-20 Jason Merrill <jason@redhat.com>
1321 PR c++/80096 - ICE with C++17 non-type auto.
1322 * pt.c (tsubst): Delay tsubst of type of template non-type
1325 PR c++/79519 - ICE with deleted template friend.
1326 * decl.c (grokdeclarator): Complain about misplaced function
1327 definition using =, as well.
1329 PR c++/79640 - infinite recursion with generic lambda.
1330 * pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
1331 before substituting its initializer.
1333 2017-03-20 Marek Polacek <polacek@redhat.com>
1334 Paolo Carlini <paolo.carlini@oracle.com>
1336 PR c++/80059 - ICE with noexcept and __transaction_atomic
1337 * except.c (build_must_not_throw_expr): Call
1338 instantiate_non_dependent_expr.
1340 2017-03-19 Jason Merrill <jason@redhat.com>
1342 PR c++/80084 - wrong C++17 decomposition by reference of parameter.
1343 * decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
1344 reference decomposition.
1346 PR c++/80077 - error with constexpr and -fno-elide-constructors.
1347 * constexpr.c (cxx_eval_call_expression): Set ctx->call while
1348 expanding trivial constructor.
1350 2017-03-17 Jason Merrill <jason@redhat.com>
1352 PR c++/78345 - ICE initializing array from lambda.
1353 * init.c (build_aggr_init): Check array initializer.
1354 (build_vec_init): Check the type of a CONSTRUCTOR.
1356 PR c++/80073 - C++17 ICE with virtual base.
1357 * decl.c (xref_basetypes): Also check for indirect vbases.
1359 2017-03-16 Jason Merrill <jason@redhat.com>
1361 * decl.c (start_enum): std::byte aliases anything.
1364 * constexpr.c (lookup_placeholder): Tweak.
1366 2017-03-15 Jason Merrill <jason@redhat.com>
1368 PR c++/80043 - ICE with -fpermissive
1369 * typeck.c (convert_for_assignment): Handle instantiate_type
1370 not giving an error.
1372 2017-03-14 Nathan Sidwell <nathan@acm.org>
1374 PR c++/79393 DR 1658 workaround
1375 * method.c (synthesized_method_base_walk): Inihibit abstract class
1376 virtual base access check here.
1377 (synthesized_method_walk): Not here.
1379 2017-03-13 Nathan Sidwell <nathan@acm.org>
1381 PR c++/79393 DR 1658 workaround
1382 * method.c (synthesized_method_walk): Check vbases of abstract
1383 classes for dtor walk.
1385 2017-03-10 David Malcolm <dmalcolm@redhat.com>
1387 PR translation/79848
1388 * decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
1390 2017-03-10 Jason Merrill <jason@redhat.com>
1392 PR c++/79960 - alias templates and partial ordering
1393 * pt.c (comp_template_args): Add partial_order parm.
1394 (template_args_equal): Likewise.
1395 (comp_template_args_porder): New.
1396 (get_partial_spec_bindings): Use it.
1398 2017-03-10 Marek Polacek <polacek@redhat.com>
1401 * decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
1403 2017-03-10 Jakub Jelinek <jakub@redhat.com>
1406 * optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
1407 Use XALLOCAVEC macro.
1410 * decl.c (finish_enum_value_list): If value is error_mark_node,
1411 don't copy it and change its type.
1412 * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
1413 of CONST_DECL is error_mark_node.
1415 2017-03-09 Marek Polacek <polacek@redhat.com>
1417 PR c++/79900 - ICE in strip_typedefs
1418 * tree.c (strip_typedefs): Skip the attribute handling if T is
1419 a variant type which hasn't been updated yet.
1421 PR c++/79687 - wrong code with pointer-to-member
1422 * init.c (constant_value_1): Break if the variable has a dynamic
1425 2017-03-08 Jason Merrill <jason@redhat.com>
1427 PR c++/79797 - ICE with self-reference in array DMI.
1428 * constexpr.c (lookup_placeholder): Split out...
1429 (cxx_eval_constant_expression): ...from here.
1431 2017-03-07 Jakub Jelinek <jakub@redhat.com>
1434 * parser.c (cp_parser_omp_cancellation_point,
1435 cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
1436 cp_parser_omp_target_update): Change "may only be used in compound
1437 statements" diagnostics, such that the same translatable string is
1438 used for all pragmas.
1439 (cp_parser_pragma): Likewise. Use error_at instead of
1440 cp_parser_error for that diagnostics.
1442 2017-03-06 Marek Polacek <polacek@redhat.com>
1444 PR c++/79796 - ICE with NSDMI and this pointer
1445 * call.c (build_over_call): Handle NSDMI with a 'this' by calling
1446 replace_placeholders.
1448 2017-03-06 Jakub Jelinek <jakub@redhat.com>
1451 * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
1454 2017-03-06 Jason Merrill <jason@redhat.com>
1456 Revert "Allow deduction guides to look into primary template."
1457 * cp-tree.h, parser.c, pt.c, search.c: Revert.
1459 2017-03-05 Paolo Carlini <paolo.carlini@oracle.com>
1462 * except.c (build_must_not_throw_expr): Perform the implicit
1463 conversions on the condition.
1465 2017-03-03 Jason Merrill <jason@redhat.com>
1467 * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
1470 Core issues 2273 and 2277
1471 * call.c (joust): Adjust using-declaration tiebreaker to handle
1472 the intermediate base case.
1473 * method.c (strip_inheriting_ctors): Just return the argument if
1474 !flag_new_inheriting_ctors.
1476 2017-03-03 Richard Biener <rguenther@suse.de>
1479 * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
1481 2017-03-03 Marek Polacek <polacek@redhat.com>
1484 * typeck.c (string_conv_p): In C++11, always call pedwarn with
1487 2017-03-02 Jason Merrill <jason@redhat.com>
1489 Update overload resolution with deduction guides.
1490 * pt.c (do_class_deduction): Always build the copy guide.
1491 (copy_guide_p, template_guide_p): New.
1492 (build_deduction_guide): Remember the original constructor.
1493 * call.c (joust): Prefer the copy guide and non-template guides.
1495 Allow deduction guides to look into primary template.
1496 * cp-tree.h (struct saved_scope): Add deduction_guide_type.
1497 (struct cp_decl_specifier_seq): Add constructor_p.
1498 * parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
1499 (cp_parser_init_declarator): Check it. Set ctor_dtor_or_conv_p.
1500 Clear deduction_guide_type. Don't handle deduction guide names.
1501 (cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
1502 (cp_parser_direct_declarator): Likewise. Handle deduction guides.
1503 (cp_parser_member_declaration, cp_parser_cache_defarg)
1504 (cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
1505 * pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
1506 (build_deduction_guide): Set deduction_guide_type.
1507 (dependent_scope_p): Check deduction_guide_type.
1508 * search.c (lookup_member): Likewise.
1510 2017-03-02 Jakub Jelinek <jakub@redhat.com>
1513 * init.c (mark_exp_read_r): New function.
1514 (emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
1515 whole arguments instead of plain mark_exp_read on TREE_LIST values.
1517 2017-03-01 Jason Merrill <jason@redhat.com>
1519 Class template argument deduction in new-expression
1520 * init.c (build_new): Handle deduction from no initializer.
1521 * parser.c (cp_parser_new_expression): Don't require a single
1522 expression for class template deduction.
1523 * typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
1524 class template placeholder.
1525 * pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
1526 (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
1527 (redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
1529 2017-03-01 Jakub Jelinek <jakub@redhat.com>
1532 * init.c (emit_mem_initializers): When not constructing vbases of
1533 abstract classes, mark arguments as read for
1534 -Wunused-but-set-parameter.
1536 2017-02-28 Jason Merrill <jason@redhat.com>
1538 Class template argument deduction refinements
1539 * call.c (joust): Move deduction guide tiebreaker down.
1540 * decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
1541 deduction with no initializer.
1542 * pt.c (build_deduction_guide): Handle implicit default/copy ctor.
1543 (do_class_deduction): Use that rather than special case.
1544 (do_auto_deduction): Handle null initializer.
1546 2017-02-28 Jakub Jelinek <jakub@redhat.com>
1548 * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
1549 instead of just cond ? "..." : "...".
1550 (grokdeclarator): Likewise.
1551 (build_enumerator): Likewise.
1552 * init.c (build_new_1): Likewise.
1553 * call.c (build_new_method_call_1): Likewise.
1554 * parser.c: Include intl.h.
1555 (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
1556 "enter"/"exit" keyword.
1557 (cp_finalize_oacc_routine): Don't use %s to supply portions of the
1560 2017-02-27 Jason Merrill <jason@redhat.com>
1562 PR c++/71568 - SFINAE forming pointer to member function
1563 * init.c (build_offset_ref): Check the return value of
1564 perform_or_defer_access_check.
1566 2017-02-27 Marek Polacek <polacek@redhat.com>
1568 * decl.c (expand_static_init): Add missing } in a comment.
1570 2017-02-27 Volker Reichelt <v.reichelt@netcologne.de>
1572 * init.c: Include intl.h.
1573 (build_new_1): Move message strings into pedwarn to make them
1574 -Wformat-security friendly. Mark string for translation.
1575 * pt.c (tsubst_copy_and_build): Mark string for translation.
1576 Make the pointer const.
1577 * semantics.c (finish_id_expression): Mark strings for translation.
1579 2017-02-25 Jakub Jelinek <jakub@redhat.com>
1581 * call.c (build_op_delete_call): Make msg1 and msg2 const.
1583 2017-02-24 Jakub Jelinek <jakub@redhat.com>
1586 * call.c (build_over_call): Call check_function_arguments even for
1587 -Wrestrict, adjust check_function_arguments caller.
1588 * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
1590 * typeck.c (cp_build_function_call_vec): Adjust
1591 check_function_arguments caller.
1593 2017-02-24 Marek Polacek <polacek@redhat.com>
1595 PR translation/79705
1596 * decl.c (check_redeclaration_exception_specification): Mark a string
1597 for translation. Make the pointer const.
1599 2017-02-23 Paolo Carlini <paolo.carlini@oracle.com>
1602 * pt.c (register_specialization): Check duplicate_decls return value
1603 for error_mark_node and pass it back.
1605 2017-02-22 Jason Merrill <jason@redhat.com>
1607 PR c++/79679 - missing destructor for argument
1608 * call.c (build_over_call): Don't pass tf_no_cleanup to argument
1611 * pt.c (do_class_deduction): Handle 0 argument case.
1613 2017-02-22 Jakub Jelinek <jakub@redhat.com>
1616 * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
1617 SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
1618 * constexpr.c (potential_constant_expression_1): Handle
1619 OMP_*, OACC_* and CILK_* trees. Use error_at with
1620 EXPR_LOC_OR_LOC (t, input_location) computed early
1621 instead of error, or error_at with location_of (t).
1623 2017-02-22 Marek Polacek <polacek@redhat.com>
1626 * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
1627 if the alignas expression is erroneous.
1628 * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
1632 * semantics.c (finish_underlying_type): Bail out for incomplete enums.
1634 2017-02-21 Jason Merrill <jason@redhat.com>
1636 PR c++/50308 - wrong deprecated warning with ADL
1637 PR c++/17729 - duplicate deprecated warning
1638 * semantics.c (finish_id_expression): Only call mark_used on a
1639 function if we aren't building a call.
1641 PR c++/41727 - ICE with partial spec of partial instantiation
1642 * pt.c (process_partial_specialization): For now, don't check more
1643 specialized if there is more than one level of args.
1645 2017-02-21 Marek Polacek <polacek@redhat.com>
1648 * cp-tree.h (maybe_reject_flexarray_init): Declare.
1649 * init.c (maybe_reject_flexarray_init): No longer static.
1650 Add check for current_function_decl.
1651 * parser.c (cp_parser_late_parse_one_default_arg): Reject
1652 a default mem-initializer for a flexible array.
1654 2017-02-21 Jakub Jelinek <jakub@redhat.com>
1655 Paolo Carlini <paolo.carlini@oracle.com>
1658 * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
1660 * pt.c (tsubst_decomp_names): Return error_mark_node if the first
1661 decl after the decomposition artificial decl has error_mark_node.
1662 * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
1663 instead of just == error_mark_node comparison.
1665 2017-02-21 Jakub Jelinek <jakub@redhat.com>
1668 * decl.c: Include gimplify.h.
1669 (cp_finish_decomp): Make sure there is no sharing of trees
1670 in between DECL_VALUE_EXPR of decomposition decls.
1673 * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
1676 * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
1677 call cplus_expand_constant on it first.
1679 2017-02-19 Jason Merrill <jason@redhat.com>
1681 PR c++/78139 - destructor needed by new-expression
1682 * call.c (build_special_member_call): Use tf_no_cleanup.
1684 PR c++/78282 - auto template and pack expansion
1685 * pt.c (find_parameter_packs_r): Don't walk into the type of
1686 templates other than template template-parameters.
1688 PR c++/79606 - ICE with this->base_member in NSDMI
1689 * class.c (build_base_path): Check processing_template_decl.
1691 PR c++/79607 - ICE with T{} initializer
1692 * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
1694 PR c++/79566 - elaborated-type-specifier in range for
1695 * parser.c (cp_parser_simple_declaration): Fix check for type
1698 PR c++/79400 - confusing suggestion of 'noexcept'
1699 * parser.c (cp_parser_exception_specification_opt): Remove
1700 suggestion for deprecated dynamic exception-specification.
1702 PR c++/79470 - partial ordering with reference parameters
1703 * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
1705 PR c++/79500 - ICE with non-template deduction guide
1706 * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
1707 DECL_TEMPLATE_RESULT.
1709 PR c++/79580 - ICE with compound literal
1710 * parser.c (cp_parser_class_head): If we're in the middle of an
1711 expression, use ts_within_enclosing_non_class.
1713 PR c++/79503 - inherited ctor taking base class
1714 * call.c (add_function_candidate): Also check that
1715 DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
1717 2017-02-19 Paolo Carlini <paolo.carlini@oracle.com>
1720 * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
1723 2017-02-19 Eric Fiselier <eric@efcs.ca>
1724 Jonathan Wakely <jwakely@redhat.com>
1727 * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
1728 control warning about literal suffix identifiers without a leading
1731 2017-02-17 Jason Merrill <jason@redhat.com>
1733 PR c++/79508 - lookup error with member template
1734 * parser.c (cp_parser_template_name): Clear
1735 parser->context->object_type if we aren't doing lookup.
1737 PR c++/78690 - ICE with using and global type with same name
1738 * pt.c (type_dependent_object_expression_p): True for
1741 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
1742 * pt.c (convert_template_argument): Just return an auto arg pack.
1743 (tsubst_template_args): Don't tsubst an auto pack type.
1745 PR c++/79556 - C++17 ICE with non-type auto
1746 * pt.c (do_auto_deduction): Don't try to deduce from null type.
1748 PR c++/79533 - C++17 ICE with temporary cast to reference
1749 * call.c (build_over_call): Conversion to a reference prevents copy
1752 2017-02-16 Jakub Jelinek <jakub@redhat.com>
1753 Jason Merrill <jason@redhat.com>
1755 PR c++/79502 - lost nodiscard attribute
1756 * pt.c (apply_late_template_attributes): Do apply non-dependent
1757 attributes to types.
1759 2017-02-16 Jason Merrill <jason@redhat.com>
1761 PR c++/78572 - ICE with self-modifying array initializer
1762 * constexpr.c (cxx_eval_store_expression): The object we're
1763 initializing is outside the constant-expression.
1764 (cxx_eval_call_expression): Set ctx->call.
1766 PR c++/79050 - ICE with undeduced auto and LTO
1767 * decl.c (poplevel): Remove undeduced auto decls.
1769 2017-02-16 Jakub Jelinek <jakub@redhat.com>
1772 * parser.c (cp_parser_omp_target): For -fopenmp-simd
1773 ignore #pragma omp target even when not followed by identifier.
1775 2017-02-15 Jason Merrill <jason@redhat.com>
1776 Jakub Jelinek <jakub@redhat.com>
1778 PR c++/79464 - ICE in IPA with omitted constructor parms
1779 * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
1780 (adjust_clone_args): Adjust.
1781 (add_method): Remember omitted parms.
1782 * call.c (add_function_candidate): Likewise.
1783 * mangle.c (write_method_parms): Likewise.
1784 * method.c (ctor_omit_inherited_parms): Return false if there are no
1787 2017-02-15 Martin Sebor <msebor@redhat.com>
1790 * init.c (maybe_reject_flexarray_init): New function.
1791 (perform_member_init): Call it.
1793 2017-02-15 Jakub Jelinek <jakub@redhat.com>
1796 * parser.c (cp_parser_std_attribute): Don't pedwarn about
1797 [[deprecated]] with -std=c++11 and [[fallthrough]] with
1798 -std=c++11 and -std=c++14.
1801 * decl.c (grokdeclarator): For static data members, handle thread_p
1802 only after handling inline.
1804 2017-02-14 Marek Polacek <polacek@redhat.com>
1808 * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
1809 clobbering if the postfix expression isn't an EXPR_P.
1811 2017-02-13 Jason Merrill <jason@redhat.com>
1813 PR c++/79461 - ICE with lambda in constexpr constructor
1814 * constexpr.c (build_data_member_initialization): Ignore
1815 initialization of a local variable.
1817 2017-02-13 Jakub Jelinek <jakub@redhat.com>
1819 * init.c (warn_placement_new_too_small): Add missing space in
1821 * parser.c (cp_parser_oacc_declare): Likewise.
1822 * mangle.c (maybe_check_abi_tags): Likewise.
1825 * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
1826 on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
1827 in the rightmost operand.
1829 2017-02-13 Nathan Sidwell <nathan@acm.org>
1831 PR c++/79296 - ICE mangling localized template instantiation
1832 * decl2.c (determine_visibility): Use template fn context for
1833 local class instantiations.
1835 2017-02-11 Jason Merrill <jason@redhat.com>
1837 PR c++/77659 - ICE with new and C++14 aggregate NSDMI
1838 * init.c (build_new): Make backups of any CONSTRUCTORs in init.
1839 (build_new_1): Use replace_placeholders.
1840 * tree.c (replace_placeholders_t): Also track whether we've seen a
1842 (replace_placeholders, replace_placeholders_r): Adjust.
1843 * cp-tree.h: Adjust.
1845 PR c++/77790 - ICE with auto function in C++11 mode
1846 * decl.c (undeduced_auto_decl): Remove C++14 limitation.
1847 (require_deduced_type): Add complain parm, return bool.
1848 * cp-tree.h: Adjust.
1849 * decl2.c (mark_used): Use require_deduced_type.
1851 2017-02-10 Jason Merrill <jason@redhat.com>
1853 PR c++/78908 - template ops and bitfields
1854 * tree.c (build_min_non_dep): Use unlowered_expr_type.
1856 PR c++/78897 - constexpr union
1857 * constexpr.c (cxx_eval_store_expression): A store to a union member
1858 erases a previous store to another member.
1860 PR c++/71285 - member of fold-expression
1861 * semantics.c (finish_unary_fold_expr)
1862 (finish_binary_fold_expr): Use null type for fold-expressions.
1864 PR c++/79401 - protected inherited constructor
1865 * call.c (enforce_access): For inheriting constructor, find a base
1866 binfo in the path we already have.
1868 2017-02-10 Marek Polacek <polacek@redhat.com>
1871 * pt.c (type_dependent_expression_p): Check if the expression type
1875 * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
1876 if warnings shouldn't be given.
1878 2017-02-10 Paolo Carlini <paolo.carlini@oracle.com>
1881 * pt.c (tsubst_decl): Don't try to preserve a typedef that names
1882 an error_mark_node as type.
1884 2017-02-09 Jakub Jelinek <jakub@redhat.com>
1885 Jason Merrill <jason@redhat.com>
1888 * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
1889 from pattern to type.
1891 2017-02-09 Jason Merrill <jason@redhat.com>
1893 PR c++/79316 - default argument in deduction guide
1894 PR c++/79350 - explicit deduction guide
1895 * parser.c (cp_parser_constructor_declarator_p)
1896 (cp_parser_direct_declarator): Parse deduction guides more like
1898 * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
1899 * tree.c (special_function_p): Return it.
1900 * decl.c (check_special_function_return_type): Handle it.
1901 (grokdeclarator, grokfndecl): Adjust.
1902 (cp_finish_decl): Pass flags to do_auto_deduction.
1903 * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
1904 * pt.c (dguide_name_p): Take a const_tree.
1905 (do_class_deduction): Handle explicit.
1906 (do_auto_deduction): Pass flags through.
1907 (build_deduction_guide): Copy explicit flag.
1909 2017-02-09 Jakub Jelinek <jakub@redhat.com>
1912 * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
1913 non-pragma_compound context here.
1914 (cp_parser_omp_target): Likewise.
1915 (cp_parser_pragma): Don't call push_omp_privatization_clauses and
1916 parsing for ordered and target omp pragmas in non-pragma_stmt
1917 non-pragma_compound contexts.
1920 * parser.c (cp_parser_oacc_declare): Formatting fix.
1921 (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
1922 automatic variables.
1924 2016-02-09 Nathan Sidwell <nathan@codesourcery.com>
1925 Chung-Lin Tang <cltang@codesourcery.com>
1927 * parser.c (cp_parser_oacc_clause_tile): Disallow collapse. Fix
1928 parsing. Parse constant expression. Remove semantic checking.
1929 (cp_parser_omp_clause_collapse): Disallow tile.
1930 (cp_parser_omp_for_loop): Deal with tile clause. Don't emit a parse
1931 error about missing for after already emitting one. Use more
1932 conventional for idiom for unbounded loop.
1933 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
1934 * semantics.c (finish_omp_clauses): Correct TILE semantic check.
1935 (finish_omp_for): Deal with tile clause.
1937 2017-02-07 Nathan Sidwell <nathan@acm.org>
1939 * method.c (synthesized_method_base_walk): New. Broken out of ...
1940 (synthesized_method_walk): ... here. Call it. Cleanup
1943 2017-02-07 Patrick Palka <ppalka@gcc.gnu.org>
1946 * typeck2.c (process_init_constructor_union): Consider only
1947 FIELD_DECLs when looking for an NSDMI.
1949 2017-02-06 Jason Merrill <jason@redhat.com>
1951 PR c++/71193 - incomplete types in templates
1952 * parser.c (cp_parser_postfix_dot_deref_expression): In a template
1953 handle incomplete type by pedwarning and then treating as dependent.
1955 2017-02-06 Jakub Jelinek <jakub@redhat.com>
1958 * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
1959 (potential_constant_expression_1): Likewise.
1962 * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
1963 allow one fewer than expected arguments if flag_permissive.
1966 * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
1967 * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
1968 with error_mark_node type.
1970 2017-02-03 Jason Merrill <jason@redhat.com>
1972 PR c++/78689 - ICE on constructor with label
1973 * optimize.c (maybe_clone_body): Replace omitted parameters with
1975 * class.c (build_clone): Fix logic for omitting inherited parms.
1977 PR c++/12245 - excessive memory use
1978 * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
1979 back in. Don't cache constants.
1980 (maybe_constant_init): Don't cache constants.
1982 PR c++/79294 - ICE with invalid template argument
1983 * pt.c (convert_nontype_argument_function): Check value-dependence.
1984 (convert_nontype_argument): Don't check it here for function ptrs.
1986 2017-02-02 Richard Biener <rguenther@suse.de>
1989 * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
1990 it lazily on the first changed element only and copy it
1991 fully upfront, only storing changed elements.
1993 2017-02-02 Paolo Carlini <paolo.carlini@oracle.com>
1996 * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
1999 2017-01-31 Jakub Jelinek <jakub@redhat.com>
2002 * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
2005 2017-01-31 David Malcolm <dmalcolm@redhat.com>
2008 * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
2009 any namespace aliases.
2011 2017-01-31 Nathan Sidwell <nathan@acm.org>
2014 * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
2018 * pt.c: (instantiate_decl): Push to top level when current
2019 function scope doesn't match. Only push lmabda scope stack when
2022 * cp-tree.h (instantiate_decl): Make defer_ok bool.
2023 * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
2024 (instantiate_decl): Simplify and reorder state saving and restoration.
2027 * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
2028 * semantics.c (finish_member_declaration): Assert class is being
2031 2017-01-30 Alexandre Oliva <aoliva@redhat.com>
2033 Introduce C++ support in libcc1.
2034 * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
2035 (ansi_opname): Rename to...
2036 (cp_operator_id): ... this. Adjust all callers.
2037 (ansi_assopname): Rename to...
2038 (cp_assignment_operator_id): ... this. Adjust all callers.
2039 (cp_literal_operator_id): Declare.
2040 (set_global_friend): Declare.
2041 (is_global_friend): Declare.
2042 (enum cp_oracle_request): New type.
2043 (cp_binding_oracle_function): New type.
2044 (cp_binding_oracle): Declare.
2045 (cp_finish_injected_record_type): Declare.
2046 * friend.c (global_friend): New var.
2047 (set_global_friend): New fn.
2048 (is_global_friend): New fn.
2049 (is_friend): Call is_global_friend.
2050 * name-lookup.c (cp_binding_oracle): New var.
2051 (query_oracle): New fn.
2052 (qualified_lookup_using_namespace): Call query_oracle.
2053 (lookup_name_real_1): Likewise.
2054 * parser.c (cp_literal_operator_id): Drop static.
2055 * search.c (friend_accessible_p): Call is_global_friend.
2056 * semantics.c (is_this_parameter): Accept a variable if the
2057 binding oracle is enabled.
2059 2017-01-27 Jason Merrill <jason@redhat.com>
2061 PR c++/78771 - ICE with inherited constructor.
2062 * call.c (build_over_call): Call deduce_inheriting_ctor here.
2063 * pt.c (tsubst_decl): Not here.
2064 * class.c (add_method): Or here.
2065 * method.c (deduce_inheriting_ctor): Handle clones.
2066 (implicitly_declare_fn): Don't deduce inheriting ctors yet.
2068 2017-01-27 Adam Butcher <adam@jessamine.co.uk>
2071 * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
2073 * cp/cp-tree.h: Declare it.
2074 * cp/semantics.c (finish_id_expression): Resolve names within a default
2075 capturing generic lambda defined within a template prior to
2076 instantiation to allow for captures to be added to the closure type.
2078 2017-01-26 Jakub Jelinek <jakub@redhat.com>
2081 * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
2082 * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
2083 * parser.c (cp_parser_builtin_offsetof): Pass result of
2084 build_static_cast of null_pointer_node to finish_offsetof.
2085 * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
2086 it for -Winvalid-offsetof pedwarn instead of trying to guess
2087 original offsetof type from EXPR. Save OBJECT_PTR as a new
2088 second operand to OFFSETOF_EXPR.
2089 * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
2090 finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
2093 2017-01-26 Jason Merrill <jason@redhat.com>
2095 * name-lookup.c (parse_using_directive): Deprecate strong using.
2097 PR c++/79176 - lambda ICE with -flto -Os
2098 * decl2.c (vague_linkage_p): Handle decloned 'tors.
2099 * tree.c (decl_linkage): Likewise.
2101 2017-01-25 Martin Sebor <msebor@redhat.com>
2103 * decl.c (grokdeclarator): Fix a typo in a comment.
2105 2017-01-25 Jakub Jelinek <jakub@redhat.com>
2108 * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
2112 * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
2113 OPT_Wpedantic on lambda templates for -std=c++14 and higher.
2115 2017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
2118 * decl.c (cxx_init_decl_processing): Pass main_input_filename
2119 to build_translation_unit_decl.
2121 2017-01-24 Jakub Jelinek <jakub@redhat.com>
2124 * cp-gimplify.c (cp_genericize_r): Add result of
2125 convert_from_reference on invisiref parm to p_set.
2127 2017-01-24 Nathan Sidwell <nathan@acm.org>
2129 PR c++/78469 - defaulted ctor and inaccessible dtor
2130 * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
2131 * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
2132 * tree.c (build_target_expr): Check tf_no_cleanup.
2134 PR c++/79118 - anon-members and constexpr
2135 * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
2136 ctor decl. Recursively check anonymous members.
2137 (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
2139 (explain_invalid_constexpr_fn): Likewise.
2141 2017-01-23 Nathan Sidwell <nathan@acm.org>
2143 PR c++/71710 - template using directive of field
2144 * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
2147 PR c++/71406 - ICE with scope-ref'd template id exprs
2149 * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
2150 before breaking up TEMPLATE_ID_EXPR.
2152 2017-01-20 Nathan Sidwell <nathan@acm.org>
2154 PR c++/78495 - wrong code inherited ctor and invisi-ref parm
2155 * cp-gimplify.c (cp_generize_r): Don't skip thunks.
2157 2017-01-20 David Malcolm <dmalcolm@redhat.com>
2161 * cp-tree.h (suggest_alternatives_for): Add bool param.
2162 (suggest_alternative_in_explicit_scope): New decl.
2163 * error.c (qualified_name_lookup_error): When SCOPE is a namespace
2164 that isn't the global one, call new function
2165 suggest_alternative_in_explicit_scope, only calling
2166 suggest_alternatives_for if it fails, and disabling near match
2167 searches fort that case. When SCOPE is the global namespace,
2168 pass true for new param to suggest_alternatives_for to allow for
2170 * lex.c (unqualified_name_lookup_error): Pass true for new param
2171 to suggest_alternatives_for.
2172 * name-lookup.c (consider_binding_level): Add forward decl.
2173 (suggest_alternatives_for): Add "suggest_misspellings" param,
2174 using it to conditionalize the fuzzy name-lookup code.
2175 (suggest_alternative_in_explicit_scope): New function.
2176 * parser.c (cp_parser_primary_expression): When calling
2177 finish_id_expression, pass location of id_expression rather
2178 than that of id_expr_token.
2179 (cp_parser_id_expression): Convert local "unqualified_id" from
2180 tree to cp_expr to avoid implicitly dropping location information.
2182 2017-01-20 Marek Polacek <polacek@redhat.com>
2185 * call.c (build_conditional_expr_1): Warn about duplicated branches.
2186 * semantics.c (finish_expr_stmt): Build statement using the proper
2189 2017-01-19 Jason Merrill <jason@redhat.com>
2191 US 20 - forwarding references and class template argument deduction
2192 * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
2193 * pt.c (push_template_decl_real): Set it.
2194 (maybe_adjust_types_for_deduction): Check it.
2195 (rewrite_template_parm): Copy it.
2197 US 19 - deduction guides and constructors
2198 * call.c (joust): Prefer deduction guides to constructors.
2199 * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
2200 (deduction_guide_p): Check DECL_P.
2202 * decl.c (check_initializer): Always use build_aggr_init for array
2205 PR c++/79130 - decomposition and direct-initialization
2206 * init.c (build_aggr_init): Communicate direct-initialization to
2208 (build_vec_init): Check for array copy sooner.
2209 * parser.c (cp_parser_decomposition_declaration): Remove call to
2210 build_x_compound_expr_from_list.
2212 2017-01-18 Jason Merrill <jason@redhat.com>
2214 PR c++/68666 - member variable template-id
2215 * typeck.c (finish_class_member_access_expr): Handle variable
2217 * pt.c (lookup_and_finish_template_variable): No longer static.
2218 * cp-tree.h: Declare it.
2220 2017-01-18 Nathan Sidwell <nathan@acm.org>
2223 * call.c (build_over_call): When checking ellipsis conversions for
2224 an inherited ctor, make sure there is at least one conversion.
2226 2017-01-18 Jason Merrill <jason@redhat.com>
2228 PR c++/78894 - ICE with class deduction and default arg
2229 * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
2231 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
2234 * mangle.c (write_discriminator): Reorganize abi warning check.
2236 2017-01-18 Nathan Sidwell <nathan@acm.org>
2238 * cp-tree.h: Clarify exception spec node comment.
2239 * except.c (nothrow_spec_p): Simplify by checking node-equality.
2242 * mangle.c (write_exception_spec): Check nothrow explicitly.
2243 (write_encoding): Don't increment processing_template_decl around
2246 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
2249 * mangle.c (write_template_args): Add "on" for operator names.
2251 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
2254 * mangle.c (write_discriminator): Handle discriminator >= 10.
2256 2017-01-17 Nathan Sidwell <nathan@acm.org>
2259 * cp-tree.h (maybe_generic_this_capture): Declare.
2260 * lambda.c (resolvable_dummy_lambda): New, broken out of ...
2261 (maybe_resolve_dummy): ... here. Call it.
2262 (maybe_generic_this_capture): New.
2263 * parser.c (cp_parser_postfix_expression): Speculatively capture
2264 this in generic lambda in unresolved member function call.
2265 * pt.c (tsubst_copy_and_build): Force hard error from failed
2266 member function lookup in generic lambda.
2268 2017-01-17 Aldy Hernandez <aldyh@redhat.com>
2271 * cp-array-notation.c (expand_array_notation_exprs): Handle
2274 2017-01-11 Jason Merrill <jason@redhat.com>
2276 PR c++/78337 - ICE on invalid with generic lambda
2277 * semantics.c (process_outer_var_ref): Check if containing_function
2278 is null. Move inform call under complain test.
2280 2017-01-11 Nathan Sidwell <nathan@acm.org>
2283 * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
2286 2017-01-11 Nathan Sidwell <nathan@acm.org>
2288 * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
2290 2017-01-11 Jakub Jelinek <jakub@redhat.com>
2293 * parser.c (cp_parser_std_attribute_spec): Remove over-eager
2294 assertion. Formatting fix.
2297 * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
2300 2017-01-10 David Malcolm <dmalcolm@redhat.com>
2303 * parser.c (cp_parser_class_specifier_1): Only suggest inserting
2304 a missing semicolon if we have a valid insertion location for
2307 2017-01-10 Jason Merrill <jason@redhat.com>
2309 FI 20, decomposition declaration with parenthesized initializer.
2310 * parser.c (cp_parser_decomposition_declaration): Use
2311 cp_parser_initializer.
2313 2017-01-09 Jason Merrill <jason@redhat.com>
2315 Implement P0195R2, C++17 variadic using.
2316 * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
2317 * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
2318 * error.c (dump_decl): Likewise.
2320 2017-01-09 Jakub Jelinek <jakub@redhat.com>
2322 PR translation/79019
2323 PR translation/79020
2324 * semantics.c (finish_omp_clauses): Add missing whitespace to
2325 translatable strings.
2326 * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
2328 2017-01-07 Jason Merrill <jason@redhat.com>
2330 PR c++/78948 - instantiation from discarded statement
2331 * parser.h (struct cp_parser): Remove in_discarded_stmt field.
2332 * cp-tree.h (in_discarded_stmt): Declare it.
2333 (struct saved_scope): Add discarded_stmt bitfield.
2334 (in_discarded_stmt): New macro.
2335 * decl2.c (mark_used): Check it.
2336 * parser.c (cp_parser_selection_statement): Adjust.
2337 (cp_parser_jump_statement): Adjust.
2339 2017-01-05 Jakub Jelinek <jakub@redhat.com>
2342 * decl.c (cp_finish_decomp): Remove probe variable, if tt is
2343 REFERENCE_REF_P, set tt to its operand.
2346 * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
2347 unions even for C++11 and later.
2349 2017-01-05 Nathan Sidwell <nathan@acm.org>
2352 * pt.c (convert_nontype_argument): Don't try and see if integral
2353 or enum expressions are constants prematurely.
2355 2017-01-04 Marek Polacek <polacek@redhat.com>
2358 * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
2359 a zero character literal.
2361 2017-01-04 Jakub Jelinek <jakub@redhat.com>
2364 * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
2368 * parser.c (cp_parser_simple_declaration): Only complain about
2369 inconsistent auto deduction if auto_result doesn't use auto.
2371 * parser.c (cp_parser_simple_declaration): Diagnose function
2372 declaration among more than one init-declarators with auto
2376 * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
2377 assertion, as lexer->buffer may be NULL.
2379 2017-01-04 Marek Polacek <polacek@redhat.com>
2383 * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
2385 2017-01-04 Nathan Sidwell <nathan@acm.org>
2388 * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
2389 (lambda_capture_field_type): Update prototype.
2390 * lambda.c (lambda_capture_field_type): Add is_reference parm.
2391 Add referenceness here.
2392 (add_capture): Adjust lambda_capture_field_type call, refactor
2394 * pt.c (tsubst): Adjust lambda_capture_field_type call.
2396 2017-01-01 Jakub Jelinek <jakub@redhat.com>
2398 Update copyright years.
2400 Copyright (C) 2017 Free Software Foundation, Inc.
2402 Copying and distribution of this file, with or without modification,
2403 are permitted in any medium without royalty provided the copyright
2404 notice and this notice are preserved.