1 2017-05-24 Nathan Sidwell <nathan@acm.org>
3 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Alphabetize.
5 * cp-tree.h (cp_free_lang_data): Add extern.
6 (ovl_skip_hidden, is_overloaded_fn, really_overloaded_fn): Add
8 (type_unknown_p): Return bool, make inline, lose TREE_LIST check.
9 * typeck.c (type_unknown_p): Delete.
10 * tree.c (is_overloaded_fn): Use MAYBE_BASELINE_FUNCTIONS, adjust
12 (dependent_name): Likewise.
13 (decl_anon_ns_mem_p): Simplify.
15 2017-05-24 Jonathan Wakely <jwakely@redhat.com>
18 * tree.c (reshape_init): Use unqualified type for direct enum init.
19 * typeck.c (maybe_warn_about_cast_ignoring_quals): New.
20 (build_static_cast_1, build_reinterpret_cast_1): Strip cv-quals from
21 non-class destination types.
22 (build_const_cast_1): Strip cv-quals from destination types.
23 (build_static_cast, build_reinterpret_cast, build_const_cast)
24 (cp_build_c_cast): Add calls to maybe_warn_about_cast_ignoring_quals.
26 2017-05-24 Martin Sebor <msebor@redhat.com>
29 * call.c (fully_fold_internal): Adjust.
31 2017-05-24 Nathan Sidwell <nathan@acm.org>
33 * cp-tree.h (ovl_skip_hidden): Declare.
34 * tree.c (ovl_skip_hidden): New.
35 * name-lookup.c (arg_assoc_namespace): Call ovl_skip_hidden.
36 (lookup_arg_dependent_1): Likewise.
37 (ambiguous_decl): Use DECL_HIDDEN_P, ovl_skip_hidden.
38 (hidden_name_p, remove_hidden_names): Delete.
39 (lookup_name_real_1): Do not strip hidden names.
40 * name-lookup.h (hidden_name_p, remove_hidden_names): Delete.
42 * cp-tree.h (OVL_HIDDEN_P): New.
43 (ovl_iterator::hidden_p, ovl_iterator::reveal_node): New.
44 (ovl_iterator::reveal_node): Declare.
45 * tree.c (ovl_copy): Copy OVL_HIDDEN_P.
46 (ovl_insert): Order on hiddenness.
47 (ovl_iterator::reveal_node): New.
48 * name-lookup.c (anticipated_builtin_p): New.
49 (supplement_binding_1): Use it.
50 (set_local_extern_decl_linkage): Use hidden_p.
51 (do_pushdecl): Deal with unhiding a hidden decl, use
52 anticipated_builtin_p.
53 (do_nonmember_using_decl): Use anticipated_decl_p.
54 (lookup_name_real_1): Use DECL_HIDDEN_P.
56 2017-05-23 Jason Merrill <jason@redhat.com>
58 -Wunused and C++17 structured bindings
59 * decl.c (poplevel): Don't warn about unused structured bindings,
61 * error.c (dump_simple_decl): Handle structured bindings.
62 * expr.c (mark_exp_read): Look through DECL_VALUE_EXPR.
64 2017-05-23 Nathan Sidwell <nathan@acm.org>
66 * cp-tree.h (PUSH_GLOBAL, PUSH_LOCAL, PUSH_USING): Delete.
67 * name-lookup.c (create_local_binding): New.
68 (update_binding): New.
69 (pushdecl_maybe_friend_1): Rename to ...
70 (do_pushdecl): ... this. Reimplement.
72 (push_overloaded_decl_1, push_overloaded_decl): Delete.
74 2017-05-23 Jason Merrill <jason@redhat.com>
76 PR c++/80396 - built-in for make_integer_sequence.
77 * pt.c (builtin_pack_fn_p, builtin_pack_call_p)
78 (expand_integer_pack, expand_builtin_pack_call): New.
79 (find_parameter_packs_r): Check builtin_pack_call_p.
80 (check_for_bare_parameter_packs): Handle it.
81 (tsubst_pack_expansion): Call expand_builtin_pack_call.
82 (declare_integer_pack): New.
83 (init_template_processing): Call it.
84 * decl2.c (mark_used): Check builtin_pack_fn_p.
86 2017-05-23 Nathan Sidwell <nathan@acm.org>
88 * name-lookup.c (find_namespace_binding): New.
89 (pushdecl_maybe_friend_1): Use CP_DECL_CONTEXT.
90 (set_identifier_type_value_with_scope): Use find_namespace_binding.
91 (find_binding, cp_binding_level_find_binding_for_name,
92 binding_for_name, namespace_binding_1): Delete.
93 (push_overloaded_decl_1): Use CP_DECL_CONTEXT.
94 (get_namespace_binding, set_namespace_binding,
95 finish_namespace_using_decl, unqualified_namespace_lookup_1,
96 qualified_lookup_using_namespace, lookup_type_scope_1,
97 lookup_name_innermost_nonclass_level_1): Use find_namespace_binding.
100 * parser.c (cp_parser_template_id): Keep the lookup when stashing
103 * cp-tree.h (DECL_HIDDEN_P): New.
104 * name-lookup.c (set_decl_context,
105 set_local_extern_decl_linkage): New, broken out of ...
106 (pushdecl_maybe_friend_1): ... here. Call them.
108 2017-05-23 Thomas Schwinge <thomas@codesourcery.com>
110 * parser.c (OACC_KERNELS_CLAUSE_MASK): Add
111 "PRAGMA_OACC_CLAUSE_NUM_GANGS", "PRAGMA_OACC_CLAUSE_NUM_WORKERS",
114 2017-05-23 Nathan Sidwell <nathan@acm.org>
116 * cp-tree.h (OVL_P): New.
117 * name-lookup.h (push_local_binding): Delete.
118 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
119 (finish_namespace_using_decl, finish_local_using_decl): ... here
120 * name-lookup.c (add_decl_to_level): Swap args.
121 (pop_bindings_and_leave_scope): Look inside TREE_LIST.
122 (diagnose_name_conflict): Check contexts are same for redecl.
123 (update_local_overload): New.
124 (compparms_for_decl_and_using): Rename to ...
125 (matching_fn_p): ... here.
126 (pushdecl_maybe_friend_1): Adjust add_decl_to_level,
127 push_local_bindings call.
128 (push_local_binding): Make static, replace FLAGS arg with
130 (validate_nonmember_using_decl): Use OVL_FIRST.
131 (do_nonmember_using_decl): Use in/out parameters. Use
132 lkp_iterator and simplify.
133 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
134 (finish_namespace_using_decl, finish_local_using_decl): ... here.
136 (lookup_type_current_level): Delete.
137 * parser.c (cp_parser_using_declaration): Adjust.
138 * pt.c (tsubst_expr): Adjust.
140 2017-05-22 Nathan Sidwell <nathan@acm.org>
142 * name-lookup.h (parse_using_directive): Replace with ...
143 (finish_namespace_using_directive): ... this and ...
144 (finish_local_using_directive): ... this.
145 * name-lookup.c (add_using_namespace_1): Move later.
146 (add_using_namespace): Move later, add namespace_p arg, remove
148 (push_using_directive_1): Directly recurse.
149 (do_using_directive, parse_using_directive): Delete, split into ...
150 (finish_namespace_using_directive): ... this and ...
151 (finish_local_using_directive): ... this.
152 (push_namespace): Use add_using_namespace.
153 * parser.c (cp_parser_using_directive): Call
154 finish_namespace_using_directive or finish_local_using_directive.
155 * pt.c (tsubst_expr): Call finish_local_using_directive.
157 * cp-objcp-common.c (cp_register_dumps): Register raw dumper.
158 * cp-tree.h (raw_dump_id): Declare.
159 * decl2.c (raw_dump_id): Define.
160 (dump_tu): Use raw_dump_id.
162 * config-lang.in (gtfiles): Sort list, break lines.
164 * cp-tree.h (CPTI_TERMINATE, CPTI_CALL_UNEXPECTED): Rename to ...
165 (CPTI_TERMINATE_FN, CPTI_CALL_UNEXPECTED_FN): ... here.
166 ( CPTI_GET_EXCEPTION_PTR_FN, CPTI_BEGIN_CATCH_FN, CPTI_END_CATCH_FN,
167 CPTI_ALLOCATE_EXCEPTION_FN, CPTI_FREE_EXCEPTION_FN, CPTI_THROW_FN,
168 CPTI_RETHROW_FN): New.
169 (noexcept_deferred_spec): New.
170 (terminate_node, call_unexpected_node): Rename to ...
171 (terminate_fn, call_unexpected_fn): ... here.
172 (get_exception_ptr_fn, begin_catch_fn, end_catch_fn,
173 allocate_exception_fn, free_exception_fn, throw_fn, rethrow_fn): New.
174 * except.c (fn1..fn5, throw_fn, rethrow_rn, spec): Delete.
175 (init_exception_processing): Adjust.
176 (declare_library_fn): Create and push the fns here.
177 (do_get_exception_ptr, do_begin_catch, do_end_catch,
178 do_allocate_exception_ptr, do_free_exception_ptr): Adjust
179 declare_library_fn use.
180 (unevaluated_noexcept_spec): Adjust.
181 * cp-gimplify.c (genericize_eh_spec_block,
182 gimplify_most_not_throw_expr): Adjust.
184 * name-lookup.c (pushdecl_top_level,
185 pushdecl_top_level_and_finish): Move after namespace pushing and
187 (push_to_top_level): Rename to ...
188 (do_push_to_top_level): ... here. Remove timing code.
189 (pop_from_top_level_1): Rename to ...
190 (do_pop_from_top_level): ... here.
191 (do_push_nested_namespace, do_pop_nested_namespace)
192 (push_to_top_level): New wrapper for do_push_to_top_level.
193 (pop_from_top_level): Adjust.
194 (push_nested_namepace, pop_nested_namespace): Wrappers for workers.
196 2017-05-19 Bernd Edlinger <bernd.edlinger@hotmail.de>
198 * config-lang.in (gtfiles): Add c-family/c-format.c,
199 except.c, init.c, lambda.c and friend.c.
200 * class.c (dvirt_fn): Move out of function scope,
202 * except.c (fn1-5, throw_fn, rethrow_fn, spec): Likewise.
203 * init.c (fn): Likewise.
204 * lambda.c (ptr_id, max_id): Likewise.
205 * friend.c (global_friend): Add GTY attribute.
207 2017-05-19 Nathan Sidwell <nathan@acm.org>
209 * call.c (add_list_candidates): Use OVL_FIRST.
210 (build_new_method_call_1): Likewise.
211 * cp-tree.h (OVL_SINGLE_P): New.
212 (TYPE_HIDDEN_P): New.
213 * decl.c (xref_tag_1): Use TYPE_HIDDEN_P.
214 * dump.c (cp_tump_tree): Adjust overload dumping.
215 * error.c (dump_decl): Use OVL_SINGLE_P, simplify context
217 * method.c (lazily_declare_fn): Assert we added it.
218 * parser.c (cp_parser_nested_name_specifier): Use OVL_SINGLE_P,
220 (cp_parser_template_name): Use lkp_iterator.
221 * pt.c (begin_template_parm_list): Fixup comment.
222 (instantiate_class_template_1): Use TYPE_HIDDEN_P.
223 * tree.c (ovl_iterator::remove_node): Cope with inherited ctors.
224 (ovl_scope): Use lkp_iterator.
226 2017-05-19 Thomas Schwinge <thomas@codesourcery.com>
228 * parser.c (cp_parser_omp_clause_default): Handle
229 "OMP_CLAUSE_DEFAULT_PRESENT".
231 * parser.c (cp_parser_omp_clause_default): Avoid printing more
232 than one syntax error message.
234 2017-05-19 Nathan Sidwell <nathan@acm.org>
236 * class.c (class_dump_id): Define.
237 (dump_class_hierarchy, dump_vtable, dump_vtt): Use it.
238 * cp-objcp-common.c (cp_register_dumps): New.
239 * cp-objcp-common.h (cp_register_dumps): Declare.
240 (LANG_HOOKS_REGISTER_DUMPS): Override.
241 * cp-tree.h (class_dump_id): Declare.
243 2017-05-18 Nathan Sidwell <nathan@acm.org>
245 * cp-tree.h (OVL_ARG_DEPENDENT): Delete.
247 (lookup_keep): Declare.
248 * name-lookup.c (add_function): Don't set OVL_ARG_DEPENDENT.
249 * pt.c (tsubst_copy): Assert lookup is persistent.
250 * semantics.c (finish_call_expr): Use lkp_iterator, call
252 * tree.c (ovl_copy): New.
253 (ovl_insert, ovl_iterator::remove_node): Copy immutable nodes.
256 * cp-tree.h (OVL_USED): Replace with ...
257 (OVL_USING_P): ... this.
258 (ovl_iterator::using_p): Adjust.
259 * name-lookup.c (push_overloaded_decl_1,
260 do_nonmember_using_decl): Adjust.
261 * search.c (lookup_field_r): Adjust.
262 * tree.c (ovl_insert, ovl_scope): Adjust.
264 * cp-tree.h (lookup_add): Swap args.
265 (ovl_cons, build_overload): Delete.
266 * name-lookup.c (add_function, push_overloaded_decl_1,
267 do_nonmember_using_decl, merge_functions, remove_hidden_names):
268 Use lookup_add, ovl_insert.
269 * pt.c (check_explicit_specialization): Use lookup_add.
270 (do_class_deduction): Likewise. Refactor if.
271 * tree.c (lookup_add): Swap args.
272 (ovl_cons, build_overload): Delete.
274 * name-lookup.c (find_local_binding): New, broken out of ...
275 (lookup_name_innermost_nonclass_level_1): ... here. Call it.
276 (set_namespace_binding): Swap scope & name args.
277 (namespace_binding_1): Likewise.
278 (pushdecl_maybe_friend_1): Adjust set_namespace_binding call.
279 (push_overloaded_decl_1): Likewise.
280 (set_global_binding): Likewise.
281 (get_namespace_binding): Adjust namespace_binding_1 call.
283 2017-05-17 Nathan Sidwell <nathan@acm.org>
285 * cp-tree.h (default_hash_traits <lang_identifier *>): New
287 * name-lookup.c (lookup_extern_c_fun_in_all_ns): Delete.
288 (extern_c_fns): New hash table.
289 (check_extern_c_conflict): New, broken out of ...
290 (pushdecl_maybe_friend_1): ... here. Call it.
291 (c_linkage_bindings): Just look in hash table.
293 2017-05-17 Ville Voutilainen <ville.voutilainen@gmail.com>
297 Implement new C++ intrinsics __is_assignable and __is_constructible.
298 * cp-tree.h (CPTK_IS_ASSIGNABLE, CPTK_IS_CONSTRUCTIBLE): New.
300 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
301 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
302 * method.c (constructible_expr): Set cp_unevaluated.
303 (is_xible_helper): New.
304 (is_trivially_xible): Adjust.
306 * parser.c (cp_parser_primary_expression): Handle
307 RID_IS_ASSIGNABLE and RID_IS_CONSTRUCTIBLE.
308 (cp_parser_trait_expr): Likewise.
309 * semantics.c (trait_expr_value): Handle
310 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
312 2017-05-17 Nathan Sidwell <nathan@acm.org>
314 * cp-tree.h (ovl_iterator::using_p): New predicate.
315 (ovl_iterator::remove_node): New worker.
316 (ovl_insert): Declare.
317 * tree.c (ovl_insert): New.
318 (ovl_iterator::remove_node): New.
319 * class.c (add_method): Use ovl_iterator, ovl_insert.
320 (clone_function_decl): Fix description.
321 (clone_constructors_and_destructors): Use ovl_iterator.
323 * class.c (handle_using_decl): Use OVL_FIRST, ovl_iterator.
324 (maybe_warn_about_overly_private_class): Use ovl_iterator.
325 (method_name_cmp, resort_method_name_cmp): Use OVL_NAME.
326 (resort_type_method_vec, finish_struct_methods): Use OVL_FIRST.
327 (get_base_fndecls): Use ovl_iterator.
328 (warn_hidden): Use OVL_NAME, ovl_iterator.
329 (add_implicitly_declared_members): Use ovl_iterator.
330 * constraint.cc (normalize_template_id_expression): Use OVL_FIRST,
332 (finish_shorthand_constraint): Simplify, use ovl_make.
333 * pt.c (make_constrained_auto): Simplify. Use ovl_make.
334 * search.c (shared_member_p): Use ovl_iterator.
335 (lookup_field_fuzzy_info::fuzzy_lookup_fn): Use OVL_NAME.
336 (lookup_conversion_operator): Use OVL_FIRST.
337 (lookup_fnfiels_idx_nolazy): Use OVL_FIRST, OVL_NAME.
338 (look_for_overrides_here): Use ovl_iterator.
339 (lookup_conversions_r): Use OVL_FIRST, OVL_NAME, ovl_iterator.
340 * typeck.c (build_x_unary_op): Use ovl_make.
342 2017-05-17 Martin Liska <mliska@suse.cz>
344 * class.c (dump_class_hierarchy): Introduce dump_flags_t type and
345 use it instead of int type.
346 (dump_vtable): Likewise.
347 (dump_vtt): Likewise.
348 * decl2.c (dump_tu): Likewise.
350 2017-05-16 David Malcolm <dmalcolm@redhat.com>
352 * call.c (enforce_access): Add access_failure_info * param and use
353 it to record access failures.
354 * cp-tree.h (class access_failure_info): New class.
355 (enforce_access): Add access_failure_info * param, defaulting to
357 (lookup_member): Likewise.
358 (locate_field_accessor): New function decl.
359 (perform_or_defer_access_check): Add access_failure_info * param,
361 * search.c (lookup_member): Add access_failure_info * param and
362 pass it on to call to perform_or_defer_access_check.
363 (matches_code_and_type_p): New function.
364 (field_access_p): New function.
365 (direct_accessor_p): New function.
366 (reference_accessor_p): New function.
367 (field_accessor_p): New function.
368 (struct locate_field_data): New struct.
369 (dfs_locate_field_accessor_pre): New function.
370 (locate_field_accessor): New function.
371 * semantics.c (perform_or_defer_access_check): Add
372 access_failure_info * param, and pass it on to call to
374 * typeck.c (access_failure_info::record_access_failure): New method.
375 (access_failure_info::maybe_suggest_accessor): New method.
376 (finish_class_member_access_expr): Pass an access_failure_info
377 instance to the lookup_member call, and call its
378 maybe_suggest_accessor method afterwards.
380 2017-05-16 Marek Polacek <polacek@redhat.com>
384 * cp-gimplify.c (cp_fold): Handle SAVE_EXPR.
386 2017-05-16 Nathan Sidwell <nathan@acm.org>
388 * name-lookup.c (check_local_shadow): New, broke out of ...
389 (pushdecl_maybe_friend_1): ... here. Call it.
391 * cp-tree.h (OVL_NESTED_P, OVL_LOOKUP_P): New.
392 (ovl_first): Move inline definition to end of file.
393 (ovl_make, lookup_add): Declare.
394 (get_fns, get_first_fn): Make pure.
395 * tree.c (ovl_cache): New.
396 (ovl_make, lookup_add): New.
397 * pt.c (do_class_deduction): Don't add candidates that will be
400 * call.c (build_user_type_conversion_1): Use OVL_FIRST.
401 (print_error_for_call_failure): Use OVL_NAME.
402 (build_op_call_1): Use ovl_iterator.
403 (add_candidates): Use OVL_FIRST & lkp_iterator.
404 (build_op_delete_call): Use MAYBE_BASELINK_FUNCTIONS &
406 * class.c (deduce_noexcept_on_destructors): Use ovl_iterator.
407 (type_has_user_nondefault_constructor,
408 in_class_defaulted_default_constructor,
409 type_has_user_provided_constructor,
410 type_has_user_provided_or_explicit_constructor,
411 type_has_non_user_provided_default_constructor,
412 vbase_has_user_provided_move_assign,
413 type_has_move_constructor, type_has_move_assign,
414 type_has_user_declared_move_constructor,
415 type_has_user_declared_move_assign,
416 type_build_ctor_call, type_build_dtor_call,
417 type_requires_array_cookie, explain_non_literal_class): Likewise.
418 (finish_struct): Use lkp_iterator.
419 (resolve_address_of_overloaded_function): Use OVL_NAME, lkp_iterator.
420 (note_name_declared_in_class): Use OVL_NAME.
421 * cxx-pretty-print.c (pp_cxx_unqualified_id): Use OVL_FIRST.
422 (pp_cxx_qualified_id, cxx_pretty_printer::id_expression,
423 cxx_pretty_printer::expression): Likewise.
424 * decl2.c (check_classfn): Use ovl_iterator.
425 * pt.c (retrieve_specialization): Use ovl_iterator.
426 * tree.c (cp_tree_equal): Use lkp_iterator.
427 (type_has_nontrivial_copy_init): Use ovl_iterator.
429 * typeck2.c (cxx_incomplete_type_diagnostic): Revert change and
430 check is_overloaded_fn.
432 2017-05-16 Martin Liska <mliska@suse.cz>
434 * parser.c (cp_lexer_print_token): Add default value for flags
435 argument of print_gimple_stmt, print_gimple_expr,
436 print_generic_stmt and print_generic_expr.
438 2017-05-16 Nathan Sidwell <nathan@acm.org>
440 * cp-tree.h (class ovl_iterator, class lkp_iterator): New OVERLOAD
442 (MAYBE_BASELINK_FUNCTIONS): New.
443 * constraint.cc (resolve_constraint_check): Use lkp_iterator.
444 * decl2.c (maybe_warn_sized_delete): Use ovl_iterator.
445 * lambda.c (maybe_generic_this_capture): Use lkp_iterator.
446 * method.c (inherited_ctor_binfo): Use ovl_iterator.
447 (binfo_inherited_from): Likewise.
448 * parser.c (lookup_literal_operator): Use lkp_iterator.
449 * pt.c (iterative_hash_template_arg): Use lkp_iterator.
450 (print_candidates_1): Likewise.
451 (determine_specialization): Likewise.
452 (resolve_overloaded_unification): Likewise.
453 (resolve_nondeduced_context): Likewise.
454 (type_dependent_expression_p): Likewise.
455 (dependent_template_p): Likewise.
456 * ptree.c (cxx_print_xnode): Likewise.
457 * semantics.c (omp_reduction_lookup): Use lkp_iterator.
458 (classtype_has_nothrow_assign_or_copy_p): Use ovl_iterator.
459 * typeck.c (check_template_keyword): Use lkp_iterator.
461 * cp-tree.h (OVL_FIRST, OVL_NAME): New.
463 * constexpr.c (function_concept_check): Use OVL_FIRST.
464 * cvt.c (build_expr_type_conversion): Likewise.
465 * decl.c (poplevel, grokdeclarator): Use OVL_NAME.
466 * decl2.c (mark_used): Use OVL_FIRST.
467 * error.c (dump_decl): Use OVL_FIRST, OVL_NAME.
468 (dump_expr, location_of): Use OVL_FIRST.
469 * friend.c (do_friend): Use OVL_NAME.
470 * init.c (build_offset_ref): Use OVL_FIRST.
471 * mangle.c (write_member_name): Likewise.
472 (write_expression): Use OVL_NAME.
473 * method.c (strip_inheriting_ctors): Use OVL_FIRST.
474 * name-lookup.c (pushdecl_class_level): Use OVL_NAME.
475 * pt.c (check_explicit_specialization): Use OVL_FIRST.
476 (check_template_shadow): Likewise.
477 (tsubst_template_args): Use OVL_NAME.
478 (tsubst_baselink): Use OVL_FIRST.
479 * semantics.c (perform_koenig_lookup): Use OVL_NAME.
480 * tree.c (get_first_fn): Use OVL_FIRST.
481 * typeck.c (finish_class_member_access_expr): Use OVL_NAME.
482 (cp_build_addr_expr_1): Use OVL_FIRST.
484 * pt.c (tsubst_copy_and_build): Remove unnecessary COMPONENT_REF
486 * semantics.c (finish_id_expression): Directly init local var.
487 (finish_omp_reduction_clause): Use really_overloaded_fn.
488 * tree.c (get_fns): Document. Assert we got an overload.
489 (get_first_fn) Document.
490 * typeck.c (cp_build_addr_expr_1): Pass arg directly to
491 really_overloaded_fn.
492 * typeck2.c (cxx_incomplete_type_diagnostic): Use get_first_fn directly.
494 * cp-tree.h (SCOPE_DEPTH): New.
495 * name-lookup.h (is_nested_namespace): Declare.
496 * name-lookup.c (is_nested_namespace): New.
497 (is_ancestor): Use it.
498 (set_decl_namespace): Likewise.
499 (push_namespace): Set SCOPE_DEPTH.
500 * pt.c (check_specialization_namespace): Use is_nested_namespace.
501 (check_unqualigied_spec_or_inst): Likewise.
503 2017-05-15 Nathan Sidwell <nathan@acm.org>
506 * cp-tree.h (DECL_NAMESPACE_INLINE_P): New.
507 * name-lookup.h (push_namespace): Return int, add make_inline arg.
508 * name-lookup.c (push_namespace): Deal with inline directly.
510 * parser.c (cp_parser_namespace_definition): Adjust for
511 push_namespace change.
513 2017-05-11 Nathan Sidwell <nathan@acm.org>
515 * cp-lang.c (get_global_decls, cxx_pushdecl, LANG_HOOK_GETDECLS,
516 LANG_HOOKS_PUSHDECL): Move to ...
517 * cp-objcp-common.c (cp_get_global_decls, cp_pushdec,
518 LANG_HOOK_DECLS, LANG_HOOKS_PUSHDECL): ... here.
519 * cp-objcp-common.h (cp_get_global_decls, cp_pushdecl): Declare.
521 * name-lookup.h (pushdecl): Add default friend parm.
522 (pushdecl_maybe_friend): Delete.
523 (pushdecl_top_level): Add default friend parm.
524 (pushdecl_top_level_maybe_friend): Delete.
525 * name-lookup.c (pushdecl_maybe_friend): Delete.
526 (pushdecl): Add is_friend parm.
527 (pushdecl_top_level): Add is friend_parm.
528 (pushdecl_top_level_maybe_friend, pushdecl_top_level_1): Delete.
529 (pushdecl_top_level_and_finish): Do pushing and finishing directly.
530 * friend.c (do_friend): Adjust.
531 * pt.c (tsubst_friend_class): Adjust.
533 Revert pushdecl_top_level_and_finish name change.
534 * name-lookup.h (pushdecl_top_level_and_finish): Resurrect old name.
535 * name-lookup.c (pushdecl_top_level_and_finish): Likewise.
536 * decl.c (cp_make_fname_decl): Adjust.
537 * decl2.c (get_guard, handle_tls_init): Adjust.
538 * rtti.c (get_tinfo_decl, tinfo_base_init): Adjust.
540 * name-lookup.c (pushdecl_outermost_localscope): Always
541 conditionally stop timer.
543 * decl.c (xref_tag_1): Don't frob ts_lambda scope here.
544 * name-lookup.c (pushtag_1): Deal with ts_lambda scope.
546 * cp-tree.h (pushdecl, pushdecl_maybe_friend, pushtag,
547 pushtag_top_level_maybe_friend,
548 pushdecl_top_level_and_finish): Move declarations to ...
549 * name-lookup.h: ... here. Group pushdecl variants.
550 (pushdecl_top_level_and_finish): Rename to ...
551 (pushdecl_top_level_with_init): ... here.
552 * decl.c (cp_make_fname_decl): Use pushdecl_top_level_with_init.
553 * decl2.c (get_guard, handle_tls_init): Likewise.
554 * rtti.c (get_tinfo_decl, tinfo_base_init): Likewise.
555 * lambda.c (maybe_add_lambda_conv_op): Use namespace_bindings_p.
556 * method.c (implicitly_declare_fn): Likewise.
557 * searchc (node_debug_info_needed): Likewise.
558 * name-lookup.c (pushdecl_top_level_and_finish): Rename to ...
559 (pushdecl_top_level_with_init): ... here.
560 (pop_everything): Use namespace_bindings_p.
562 * name-lookup.h (pop_binding): Rename to pop_local_binding.
563 (getdecls): Rename to get_local_decls.
564 * name-lookup.c (pop_binding): Rename to ...
565 (pop_local_binding): ... here.
566 (pop_bindings_and_leave_scope): Adjust.
567 (getdecls): Rename to ...
568 (get_local_decls): ... here. Assert local scope.
569 * decl.c (poplevel): Assert not namespace. Adjust and simplify
571 (store_parm_decls): Adjust get_local_decls call.
572 (parser.c (synthesize_implicit_template_parm): Likewise.
574 2017-05-11 Ville Voutilainen <ville.voutilainen@gmail.com>
577 * method.c (is_trivially_xible): Reject void types.
579 2017-05-10 Nathan Sidwell <nathan@acm.org>
581 * class.c (handle_using_decl): Always use OVL_CURRENT.
582 (resolve_address_of_overloaded_function): Move iterator decl into
583 for scope. Don't strip anticipated decls here.
585 * pt.c (print_candidates_1): Separate TREE_LIST and OVERLOAD
587 (print_candidates): Adjust.
589 * cp-tree.h (build_new_function_call): Lose koenig_p arg. Fix
591 * call.c (build_new_function_call): Lose koenig_p arg. Remove
592 koenig_p handling here.
593 * pt.c (push_template_decl_real): Unconditionally retrofit_lang_decl.
594 (tsubst_omp_clauses): Likewise.
595 (do_class_deduction): Adjust buld_new_function_call calls.
596 * semantics.c (finish_call_expr): Likewise.
598 2017-05-10 Jason Merrill <jason@redhat.com>
600 * pt.c (unify_parameter_deduction_failure, unify_cv_qual_mismatch)
601 (unify_type_mismatch, unify_parameter_pack_mismatch)
602 (unify_ptrmem_cst_mismatch, unify_expression_unequal)
603 (unify_parameter_pack_inconsistent, unify_inconsistency)
604 (unify_vla_arg, unify_method_type_error, unify_arity)
605 (unify_arg_conversion, unify_no_common_base)
606 (unify_inconsistent_template_template_parameters)
607 (unify_template_deduction_failure)
608 (unify_template_argument_mismatch)
609 (unify_overload_resolution_failure): Call unify_invalid.
611 CWG 1847 - Clarifying compatibility during partial ordering
612 * pt.c (more_specialized_fn): No order between two non-deducible
615 * pt.c (dependent_type_p): Make sure we aren't called with
618 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
619 * pt.c (convert_template_argument): Just return an argument pack.
620 (coerce_template_parameter_pack, template_parm_to_arg)
621 (extract_fnparm_pack, make_argument_pack, tsubst_template_args)
622 (tsubst_decl, tsubst, type_unification_real, unify_pack_expansion):
623 Don't set the type of a NONTYPE_ARGUMENT_PACK.
624 * parser.c (make_char_string_pack, make_string_pack): Likewise.
626 2017-05-10 Nathan Sidwell <nathan@acm.org>
628 * cp-tree.h (add_method, clone_function_decl): Change last arg to
630 * class.c (add_method): Change third arg to bool. Adjust.
631 (one_inheriting_sig, one_inherited_ctor): Adjust.
632 (clone_function_decl): Change 2nd arg to bool. Adjust.
633 (clone_constructors_and_destructors): Adjust.
634 * lambda.c (maybe_add_lambda_conv_op): Adjust.
635 * method.c (lazily_declare_fn): Adjust.
636 * pt.c (tsubst_decl, instantiate_template_1): Adjust.
637 * semantics.c (finish_member_declaration): Adjust.
639 2017-05-10 Paolo Carlini <paolo.carlini@oracle.com>
642 * decl.c (finish_function): To improve error recovery, change the
643 logic for calling apply_deduced_return_type.
645 2017-05-09 Jason Merrill <jason@redhat.com>
647 * class.c (check_bases): Ignore empty bases.
649 PR c++/70979 - literal class and closure types
650 * class.c (finalize_literal_type_property): Handle closures
652 (explain_non_literal_class): Likewise.
654 PR c++/66297, DR 1684 - literal class and constexpr member fns
655 * constexpr.c (is_valid_constexpr_fn): Only complain about
656 non-literal enclosing class in C++11.
657 * class.c (finalize_literal_type_property): Likewise.
659 2017-05-09 Paolo Carlini <paolo.carlini@oracle.com>
662 * pt.c (tsubst_decl): Early return error_mark_node if
663 grok_ctor_properties returns false.
665 2017-05-09 Jason Merrill <jason@redhat.com>
667 PR c++/70167 - array prvalue treated as lvalue
668 * cp-tree.h (CONSTRUCTOR_C99_COMPOUND_LITERAL): New.
670 * semantics.c (finish_compound_literal): Add fcl_context parameter.
671 Only make a static variable for C99 syntax.
672 * parser.c (cp_parser_postfix_expression): Pass it.
673 * pt.c (tsubst_copy_and_build): Likewise.
674 * call.c (extend_ref_init_temps): Set
675 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
677 2017-05-09 Nathan Sidwell <nathan@acm.org>
679 * cp-lang.c (get_global_decls, cxx_pushdecl): New.
680 (LANG_HOOKS_GETDECLS, LANG_HOOKS_PUSHDECL): Override.
681 * name-lookup.h (pushdecl_top_level): Declare.
683 2017-05-08 Jason Merrill <jason@redhat.com>
685 PR c++/80178 - parameter passing for uncopyable classes
686 * tree.c (type_has_nontrivial_copy_init): True for classes with only
687 deleted copy/move ctors.
688 (remember_deleted_copy, maybe_warn_parm_abi): New.
689 * decl.c (require_complete_types_for_parms, check_function_type):
690 Call maybe_warn_parm_abi.
691 * call.c (convert_for_arg_passing, build_cxx_call): Likewise.
693 2017-05-08 Nathan Sidwell <nathan@acm.org>
695 * decl.c (builtin_function_1): Set DECL_ANTICIPATED before pushing.
696 (start_preparsed_function): Do decl pushing before setting
697 current_funciton_decl and announcing it.
699 * name-lookup.h (pushdecl_with_scope): Replace with ...
700 (pushdecl_outermost_localscope): ... this.
701 * name-lookup.c (pushdecl_with_scope): Replace with ...
702 (pushdecl_outermost_localscope): ... this.
703 (pushdecl_namespace_level): Adjust.
704 * decl.c (cp_make_fname_decl): Use pushdecl_outermost_localscope.
705 * lambda.c (insert_capture_proxy): Likewise.
707 * class.c (build_vtbl_initializer): Don't shadow outer variable
710 Revert _binding -> _value change.
711 * name-lookup.h (get_namespace_value, set_global_value): Rename to ...
712 (get_namespace_binding, set_global_binding): ... these.
713 * name-lookup.c (get_namespace_value, set_global_value): Rename to ...
714 (get_namespace_binding, set_global_binding): ... these.
715 (arg_assoc_namespace, pushdecl_maybe_friend_1,
716 check_for_out_of_scope_variable, push_overloaded_decl_1,
717 lookup_name_innermost_nonclass_level, push_namespace): Adjust.
718 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
719 SET_IDENTIFIER_GLOBAL_VALUE): Adjust.
720 * decl.c (poplevel): Adjust.
721 * pt.c (make_constrained_auto): Likewise.
723 2017-05-07 Volker Reichelt <v.reichelt@netcologne.de>
726 * call.c (print_z_candidate): Fix quoting.
728 2017-05-05 David Malcolm <dmalcolm@redhat.com>
730 * error.c (pedwarn_cxx98): Replace report_diagnostic
731 with diagnostic_report_diagnostic.
733 2017-05-05 Nathan Sidwell <nathan@acm.org>
735 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value.
736 (SET_IDENTIFIER_GLOBAL_VALUE): Use set_global_value.
737 (IDENTIFIER_NAMESPACE_VALUE): Delete.
738 * name-lookup.h (namespace_binding, set_namespace_binding): Replace
740 (get_namespace_value, set_global_value): ... these.
741 (get_global_value_if_present, is_typename_at_global_scope): Delete.
742 * decl.c (poplevel): Use get_namespace_value.
743 (grokdeclarator): Use IDENTIFIER_GLOBAL_VALUE.
744 * class.c (build_vtbl_initializer): Stash library decl in
745 static var. Use IDENTIFIER_GLOBAL_VALUE.
746 * except.c (do_get_exception_ptr, do_begin_catch, do_end_catch,
747 do_allocate_exception, do_free_exception, build_throw): Likewise.
748 * init.c (throw_bad_array_new_length): Likewise.
749 * rtti.c (throw_bad_cast, throw_bad_typeid): Likewise.
750 * name-lookup.c (arg_assoc_namespace, pushdecl_maybe_friend_1,
751 check_for_our_of_scope_variable, push_overloaded_decl_1): Use
753 (set_namespace_binding_1): Rename to
754 (set_namespace_binding): ... here.
755 (set_global_value): New.
756 (lookup_name_innermost_nonclass_level_1, push_namespace): Use
758 * pt.c (listify): Use get_namespace_value.
760 * call.c (make_temporary_var_for_ref_to_temp): Push decl into
762 * lex.c (unqualified_name_lookup_error): Likewise.
764 * class.c (alter_class): Use retrofit_lang_decl directly.
765 * decl.c (push_local_name, dupliate_decls): Likewise.
766 * semantics.c (omp_privatize_field): Likewise.
768 Kill walk_namespaces.
769 * cp-tree.h (walk_namespaces_fn, walk_namespaces): Delete.
770 * decl.c (walk_namespaces_r, walk_namespaces): Delete.
772 Kill per-namespace static_decls.
773 * cp-tree.h (static_decls): Declare.
774 (wrapup_globals_for_namespace,
775 diagnose_inline_vars_for_namespace): Replace with ...
776 (wrapup_namespace_globals): ... this.
777 * decl.c (static_decls): Define.
778 (wrapup_globals_for_namespace,
779 diagnose_inline_vars_for_namespace): Replace with ...
780 (wrapup_namespace_globals): ... this.
781 (cxx_init_decl_processing): Initialize static_decls.
782 * decl2.c (c_parse_final_cleanups): Adjust.
783 * name-lookup.h (cp_binding_level): Remove static_decls member.
784 * name-lookup.c (add_decl_to_level): Adjust.
785 (begin_scope): Adjust.
787 2017-05-05 Paolo Carlini <paolo.carlini@oracle.com>
790 * decl.c (reshape_init): Unconditionally return error_mark_node
791 upon error about too many initializers.
793 2017-05-04 Nathan Sidwell <nathan@acm.org>
795 * constraint.cc (diagnose_check_constraint): Fix %E thinko.
797 2017-05-04 Martin Sebor <msebor@redhat.com>
800 * call.c (print_z_candidate): Add missing quoting to %D and other
802 (build_op_call_1): Same.
803 * constraint.cc (diagnose_check_constraint): Same.
804 * mangle.c (mangle_decl): Same.
805 * name-lookup.c (cp_binding_level_debug): Same.
806 (set_decl_namespace): Same.
807 * parser.c (cp_parser_tx_qualifier_opt): Same.
808 * pt.c (print_candidates_1): Same.
809 (check_template_variable): Same.
810 (tsubst_default_argument): Same.
811 (most_specialized_partial_spec): Same.
812 * semantics.c (omp_reduction_lookup): Same.
813 * tree.c (check_abi_tag_redeclaration): Same.
814 * typeck.c (comptypes): Same.
815 * typeck2.c (abstract_virtuals_error_sfinae): Same.
817 2017-05-04 Nathan Sidwell <nathan@acm.org>
820 * cp-tree.h (enum cp_tree_index): Add CPTI_GLOBAL,
821 CPTI_GLOBAL_TYPE, CPTI_GLOBAL_IDENTIFIER, CPTI_ANON_IDENTIFIER,
822 CPTI_INIT_LIST_IDENTIFIER.
823 (global_namespace, global_type_node, global_identifier,
824 anon_identifier, init_list_identifier): New.
825 * decl.c (global_type_node, global_scope_name): Delete.
826 (initialize_predefined_identifiers): Add new identifiers.
827 (cxx_init_decl_processing): Adjust.
828 * name-lookup.h (global_namespace, global_type_node): Delete.
829 * name-lookup.c (global_namespace, anonymous_namespace_name,
830 get_anonymous_namespace_name): Delete.
831 (namespace_scope_ht_size, begin_scope, pushtag_1,
832 push_namespace): Adjust,
833 * call.c (type_has_extended_temps): Use init_list_identifier.
834 * pt.c (listify): Likewise.
836 * name-lookup.c: Reorder functions to make merging from modules
839 2017-05-03 Jason Merrill <jason@redhat.com>
841 * constexpr.c (cxx_eval_outermost_constant_expr): Use TV_CONSTEXPR.
843 2017-05-03 Nathan Sidwell <nathan@acm.org>
845 * cp-tree.h (enum cp_tree_index, cp_global_trees): Move earlier,
846 along with #defines, to before name-lookup include.
848 2017-05-02 Paolo Carlini <paolo.carlini@oracle.com>
850 * pt.c (is_auto_or_concept): Remove.
851 (type_uses_auto_or_concept): Remove, unused.
852 (find_parameter_packs_r, extract_autos_r, is_auto_r): Adjust.
853 * parser.c (tree_type_is_auto_or_concept): Remove, unused.
854 * cp-tree.h (is_auto_or_concept): Remove.
856 2017-05-01 Xi Ruoyao <ryxi@stu.xidian.edu.cn>
859 * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Don't
860 add pedigree operation and detach call here.
861 * cp-gimplify.c (cp_gimplify_expr): Remove the calls to
862 cilk_cp_gimplify_call_params_in_spawned_fn.
863 (cilk_cp_gimplify_call_params_in_spawned_fn): Remove function.
864 * semantics.c (simplify_aggr_init_expr): Copy EXPR_CILK_SPAWN.
866 2017-04-29 Volker Reichelt <v.reichelt@netcologne.de>
868 * parser.c (cp_parser_member_declaration): Add fix-it hints for
869 stray comma and missing semicolon at end of member declaration.
871 2017-04-27 Volker Reichelt <v.reichelt@netcologne.de>
873 * parser.c (cp_parser_cast_expression): Add target type of cast to
875 * error.c (type_to_string): Add '{enum}' suffix to enumeration types.
877 2017-04-26 Paolo Carlini <paolo.carlini@oracle.com>
879 * decl.c (grok_ctor_properties, ambi_op_p, unary_op_p): Change
881 * cp-tree.h (grok_ctor_properties): Update.
883 2017-04-26 Volker Reichelt <v.reichelt@netcologne.de>
885 * parser.c (cp_parser_nested_name_specifier_opt): Add fix-it
886 information to diagnostic of invalid colon in nested-name-specifier.
888 2017-04-25 Volker Reichelt <v.reichelt@netcologne.de>
890 * parser.c (cp_parser_elaborated_type_specifier): Add fix-it to
891 diagnostic of invalid class/struct keyword after enum.
893 2017-04-25 David Malcolm <dmalcolm@redhat.com>
895 * parser.c (cp_parser_member_declaration): Add fix-it hint
896 for removing stray semicolons.
898 2017-04-25 David Malcolm <dmalcolm@redhat.com>
900 * name-lookup.c (get_std_name_hint): New function.
901 (maybe_suggest_missing_header): New function.
902 (suggest_alternative_in_explicit_scope): Call
903 maybe_suggest_missing_header.
905 2017-04-25 David Malcolm <dmalcolm@redhat.com>
908 * name-lookup.c (suggest_alternative_in_explicit_scope): Convert
909 candidate type of bm from tree to const char *.
910 (consider_binding_level): Likewise.
911 (lookup_name_fuzzy): Likewise, using this to merge the best
912 result from the preprocessor into bm, rather than immediately
913 returning, so that better matches from reserved words can "win".
914 Guard the rejection of keywords that don't start decl-specifiers
915 so it only happens for FUZZY_LOOKUP_TYPENAME.
917 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
919 * decl.c (grokdeclarator): Use %qT instead of %<%T%> in diagnostics.
920 (start_enum): Likewise.
921 (build_enumerator): Likewise. Use %qE instead of plain %E.
922 * parser.c (cp_parser_mem_initializer_list): Use %qD instead of
923 %<%D%> in diagnostics.
924 (cp_parser_elaborated_type_specifier): Likewise.
925 * pt.c (make_pack_expansion): Use %qT and %qE instead of
926 %<%T%> and %<%E%> in diagnostics.
927 (tsubst_pack_expansion): Likewise.
929 2017-04-24 David Malcolm <dmalcolm@redhat.com>
932 * parser.c (cp_parser_unary_expression): Generate a location
933 range for alignof and sizeof expressions.
935 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
937 * parser.c (cp_parser_cv_qualifier_seq_opt): Add fix-it info to
939 (cp_parser_virt_specifier_seq_opt): Likewise.
940 (set_and_check_decl_spec_loc): Likewise twice.
942 2017-04-21 Jason Merrill <jason@redhat.com>
944 PR c++/80179 - ICE with initialized flexible array member.
945 * constexpr.c (verify_ctor_sanity): Handle flexible array members.
947 2017-04-21 Richard Biener <rguenther@suse.de>
949 * cp-tree.h (copy_decl): Annotate with CXX_MEM_STAT_INFO.
950 (copy_type): Likewise.
951 * lex.c (copy_decl): Pass down mem-stat info.
952 (copy_type): Likewise.
954 2017-04-20 Jonathan Wakely <jwakely@redhat.com>
957 * init.c (build_new_1): Suppress notes about over-aligned new when
958 the warning is suppressed.
960 2017-04-20 Volker Reichelt <v.reichelt@netcologne.de>
962 * parser.c (cp_parser_member_declaration): Add warning with fixit
963 information for extra semicolon after in-class function definition.
965 2017-04-20 Jakub Jelinek <jakub@redhat.com>
968 * tree.c (build_cplus_array_type): Call build_array_type
969 with the intended TYPE_TYPELESS_STORAGE flag value, instead
970 of calling build_array_type and modifying later TYPE_TYPELESS_STORAGE
973 2017-04-18 Marek Polacek <polacek@redhat.com>
975 PR c++/80244 - ICE with attribute in template alias.
976 * tree.c (strip_typedefs): Handle UNDERLYING_TYPE.
978 PR c++/80241 - ICE with alignas pack expansion.
979 * error.c (dump_expr): Handle TREE_LIST.
980 * parser.c (cp_parser_std_attribute_list): Return error_mark if
981 make_pack_expansion returns an error.
983 2017-04-17 Bernd Edlinger <bernd.edlinger@hotmail.de>
986 * class.c (fixup_may_alias): Fix all type variants.
988 2017-04-17 Jason Merrill <jason@redhat.com>
990 PR c++/80415 - wrong error with default arg and array reference.
991 * tree.c (lvalue_kind): Return clk_class for an array prvalue.
993 * pt.c (tsubst_init): Set TARGET_EXPR_DIRECT_INIT_P.
995 2017-04-15 Alexandre Oliva <aoliva@redhat.com>
997 * decl.c (name_unnamed_type): Split out of...
998 (grokdeclarator): ... this.
999 * decl.h (name_unnamed_type): Declare.
1001 2017-04-12 Richard Biener <rguenther@suse.de>
1002 Bernd Edlinger <bernd.edlinger@hotmail.de>
1005 * tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
1006 for arrays of character or std::byte type.
1008 2017-04-11 Jason Merrill <jason@redhat.com>
1010 PR c++/80294 - ICE with constexpr and inheritance.
1011 * constexpr.c (reduced_constant_expression_p):
1012 A null constructor element is non-constant.
1013 (cxx_eval_indirect_ref): Don't VERIFY_CONSTANT before
1014 returning an empty base.
1016 2017-04-11 Jakub Jelinek <jakub@redhat.com>
1019 * decl.c (cp_finish_decomp): If processing_template_decl on
1020 non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't
1021 change their DECL_VALUE_EXPR nor cp_finish_decl them. Instead make
1022 sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst
1024 * pt.c (value_dependent_expression_p) <case VAR_DECL>: For variables
1025 with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
1028 2017-04-11 Jakub Jelinek <jakub@redhat.com>
1031 * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.
1033 2017-04-10 Jakub Jelinek <jakub@redhat.com>
1036 * tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
1037 operand, if it is a static member function, recurse on the
1040 2017-04-10 Marek Polacek <polacek@redhat.com>
1043 * typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL. Set
1044 ORIG_TYPE earlier and not only when shortening.
1046 2017-04-07 Jason Merrill <jason@redhat.com>
1048 PR c++/80356 - ICE with reference to function template argument.
1050 * pt.c (convert_nontype_argument_function): Adjust type even with a
1051 value-dependent argument.
1053 PR c++/80267 - ICE with nested capture of reference
1055 * pt.c (tsubst_copy): Handle lookup finding a capture proxy.
1057 2017-04-07 Marek Polacek <polacek@redhat.com>
1060 * typeck.c (cp_build_binary_op): Convert COP[01] to ORIG_TYPE.
1063 * call.c (build_over_call): Don't check cxx_dialect.
1064 * cp-gimplify.c (cp_gimplify_init_expr): Don't check cxx_dialect nor
1065 whether SUB is a CONSTRUCTOR.
1066 * init.c (build_new_1): Don't check cxx_dialect.
1067 * tree.c (replace_placeholders): Add a function comment. Return if
1068 not in C++14, or if the object isn't a (member of a) class.
1069 * typeck2.c (store_init_value): Don't check cxx_dialect nor whether
1070 TYPE is CLASS_TYPE_P.
1072 2017-04-05 Jakub Jelinek <jakub@redhat.com>
1075 * pt.c (canonical_type_parameter): Use vec_safe_grow_cleared instead
1076 of a loop doing vec_safe_push of NULL. Formatting fixes.
1077 (rewrite_template_parm): Copy TEMPLATE_PARM_PARAMETER_PACK from oldidx
1078 to newidx before calling canonical_type_parameter on newtype.
1080 2017-04-04 Volker Reichelt <v.reichelt@netcologne.de>
1083 * cxx-pretty-print.c (cxx_pretty_printer::expression): Add
1084 UNARY_PLUS_EXPR case.
1086 2017-04-03 Jason Merrill <jason@redhat.com>
1088 * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
1090 2017-04-03 Jonathan Wakely <jwakely@redhat.com>
1092 * class.c (update_vtable_entry_for_fn): Fix typo in comment.
1093 * decl2.c (one_static_initialization_or_destruction): Likewise.
1094 * name-lookup.c (store_bindings): Likewise.
1095 * parser.c (make_call_declarator): Likewise.
1096 * pt.c (check_explicit_specialization): Likewise.
1098 2017-04-03 Jason Merrill <jason@redhat.com>
1100 PR sanitizer/79993 - ICE with VLA initialization from string
1101 PR c++/69487 - wrong VLA initialization from string
1102 * init.c (finish_length_check): Split out from build_vec_init.
1103 (build_vec_init): Handle STRING_CST.
1104 * typeck2.c (split_nonconstant_init): Handle STRING_CST.
1105 (digest_init_r): Don't give a STRING_CST VLA type.
1107 2017-03-31 Jakub Jelinek <jakub@redhat.com>
1110 * cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
1111 REFERENCE_TYPE. Adjust ubsan_maybe_instrument_reference caller
1112 for NOP_EXPR to REFERENCE_TYPE.
1115 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
1116 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
1118 * semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
1119 Remove extraneous parens.
1120 (finish_trait_expr): Handle CPTK_IS_AGGREGATE.
1121 * parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
1122 (cp_parser_trait_expr): Likewise.
1124 2017-03-27 Jakub Jelinek <jakub@redhat.com>
1127 * cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
1128 * typeck.c (cxx_mark_addressable): Likewise. Look through
1129 VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
1131 (cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
1133 2017-03-24 Jason Merrill <jason@redhat.com>
1135 PR c++/77339 - ICE with invalid use of alias template.
1136 * pt.c (lookup_template_class_1): Don't try to enter the scope of an
1139 2017-03-24 Marek Polacek <polacek@redhat.com>
1142 * cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
1143 doesn't have side effects.
1145 2017-03-23 Jason Merrill <jason@redhat.com>
1147 PR c++/80150 - ICE with overloaded variadic deduction.
1148 * pt.c (try_one_overload): Remove asserts.
1150 PR c++/77563 - missing ambiguous conversion error.
1151 * call.c (convert_like_real): Use LOOKUP_IMPLICIT.
1153 2017-03-23 Marek Polacek <polacek@redhat.com>
1155 * cp-tree.h: Remove a C_RID_YYCODE reference.
1157 2017-03-22 Jakub Jelinek <jakub@redhat.com>
1160 * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
1161 case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
1162 processing_template_decl.
1164 2017-03-21 Paolo Carlini <paolo.carlini@oracle.com>
1167 * name-lookup.c (pushtag_1): Add check for bogus, non template,
1168 std::initializer_list.
1170 2017-03-21 Jakub Jelinek <jakub@redhat.com>
1173 * init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.
1175 2017-03-21 Ville Voutilainen <ville.voutilainen@gmail.com>
1178 * init.c (std_placement_new_fn_p): New.
1179 (build_new_1): Call it.
1181 2017-03-20 Jason Merrill <jason@redhat.com>
1183 PR c++/80096 - ICE with C++17 non-type auto.
1184 * pt.c (tsubst): Delay tsubst of type of template non-type
1187 PR c++/79519 - ICE with deleted template friend.
1188 * decl.c (grokdeclarator): Complain about misplaced function
1189 definition using =, as well.
1191 PR c++/79640 - infinite recursion with generic lambda.
1192 * pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
1193 before substituting its initializer.
1195 2017-03-20 Marek Polacek <polacek@redhat.com>
1196 Paolo Carlini <paolo.carlini@oracle.com>
1198 PR c++/80059 - ICE with noexcept and __transaction_atomic
1199 * except.c (build_must_not_throw_expr): Call
1200 instantiate_non_dependent_expr.
1202 2017-03-19 Jason Merrill <jason@redhat.com>
1204 PR c++/80084 - wrong C++17 decomposition by reference of parameter.
1205 * decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
1206 reference decomposition.
1208 PR c++/80077 - error with constexpr and -fno-elide-constructors.
1209 * constexpr.c (cxx_eval_call_expression): Set ctx->call while
1210 expanding trivial constructor.
1212 2017-03-17 Jason Merrill <jason@redhat.com>
1214 PR c++/78345 - ICE initializing array from lambda.
1215 * init.c (build_aggr_init): Check array initializer.
1216 (build_vec_init): Check the type of a CONSTRUCTOR.
1218 PR c++/80073 - C++17 ICE with virtual base.
1219 * decl.c (xref_basetypes): Also check for indirect vbases.
1221 2017-03-16 Jason Merrill <jason@redhat.com>
1223 * decl.c (start_enum): std::byte aliases anything.
1226 * constexpr.c (lookup_placeholder): Tweak.
1228 2017-03-15 Jason Merrill <jason@redhat.com>
1230 PR c++/80043 - ICE with -fpermissive
1231 * typeck.c (convert_for_assignment): Handle instantiate_type
1232 not giving an error.
1234 2017-03-14 Nathan Sidwell <nathan@acm.org>
1236 PR c++/79393 DR 1658 workaround
1237 * method.c (synthesized_method_base_walk): Inihibit abstract class
1238 virtual base access check here.
1239 (synthesized_method_walk): Not here.
1241 2017-03-13 Nathan Sidwell <nathan@acm.org>
1243 PR c++/79393 DR 1658 workaround
1244 * method.c (synthesized_method_walk): Check vbases of abstract
1245 classes for dtor walk.
1247 2017-03-10 David Malcolm <dmalcolm@redhat.com>
1249 PR translation/79848
1250 * decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
1252 2017-03-10 Jason Merrill <jason@redhat.com>
1254 PR c++/79960 - alias templates and partial ordering
1255 * pt.c (comp_template_args): Add partial_order parm.
1256 (template_args_equal): Likewise.
1257 (comp_template_args_porder): New.
1258 (get_partial_spec_bindings): Use it.
1260 2017-03-10 Marek Polacek <polacek@redhat.com>
1263 * decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
1265 2017-03-10 Jakub Jelinek <jakub@redhat.com>
1268 * optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
1269 Use XALLOCAVEC macro.
1272 * decl.c (finish_enum_value_list): If value is error_mark_node,
1273 don't copy it and change its type.
1274 * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
1275 of CONST_DECL is error_mark_node.
1277 2017-03-09 Marek Polacek <polacek@redhat.com>
1279 PR c++/79900 - ICE in strip_typedefs
1280 * tree.c (strip_typedefs): Skip the attribute handling if T is
1281 a variant type which hasn't been updated yet.
1283 PR c++/79687 - wrong code with pointer-to-member
1284 * init.c (constant_value_1): Break if the variable has a dynamic
1287 2017-03-08 Jason Merrill <jason@redhat.com>
1289 PR c++/79797 - ICE with self-reference in array DMI.
1290 * constexpr.c (lookup_placeholder): Split out...
1291 (cxx_eval_constant_expression): ...from here.
1293 2017-03-07 Jakub Jelinek <jakub@redhat.com>
1296 * parser.c (cp_parser_omp_cancellation_point,
1297 cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
1298 cp_parser_omp_target_update): Change "may only be used in compound
1299 statements" diagnostics, such that the same translatable string is
1300 used for all pragmas.
1301 (cp_parser_pragma): Likewise. Use error_at instead of
1302 cp_parser_error for that diagnostics.
1304 2017-03-06 Marek Polacek <polacek@redhat.com>
1306 PR c++/79796 - ICE with NSDMI and this pointer
1307 * call.c (build_over_call): Handle NSDMI with a 'this' by calling
1308 replace_placeholders.
1310 2017-03-06 Jakub Jelinek <jakub@redhat.com>
1313 * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
1316 2017-03-06 Jason Merrill <jason@redhat.com>
1318 Revert "Allow deduction guides to look into primary template."
1319 * cp-tree.h, parser.c, pt.c, search.c: Revert.
1321 2017-03-05 Paolo Carlini <paolo.carlini@oracle.com>
1324 * except.c (build_must_not_throw_expr): Perform the implicit
1325 conversions on the condition.
1327 2017-03-03 Jason Merrill <jason@redhat.com>
1329 * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
1332 Core issues 2273 and 2277
1333 * call.c (joust): Adjust using-declaration tiebreaker to handle
1334 the intermediate base case.
1335 * method.c (strip_inheriting_ctors): Just return the argument if
1336 !flag_new_inheriting_ctors.
1338 2017-03-03 Richard Biener <rguenther@suse.de>
1341 * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
1343 2017-03-03 Marek Polacek <polacek@redhat.com>
1346 * typeck.c (string_conv_p): In C++11, always call pedwarn with
1349 2017-03-02 Jason Merrill <jason@redhat.com>
1351 Update overload resolution with deduction guides.
1352 * pt.c (do_class_deduction): Always build the copy guide.
1353 (copy_guide_p, template_guide_p): New.
1354 (build_deduction_guide): Remember the original constructor.
1355 * call.c (joust): Prefer the copy guide and non-template guides.
1357 Allow deduction guides to look into primary template.
1358 * cp-tree.h (struct saved_scope): Add deduction_guide_type.
1359 (struct cp_decl_specifier_seq): Add constructor_p.
1360 * parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
1361 (cp_parser_init_declarator): Check it. Set ctor_dtor_or_conv_p.
1362 Clear deduction_guide_type. Don't handle deduction guide names.
1363 (cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
1364 (cp_parser_direct_declarator): Likewise. Handle deduction guides.
1365 (cp_parser_member_declaration, cp_parser_cache_defarg)
1366 (cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
1367 * pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
1368 (build_deduction_guide): Set deduction_guide_type.
1369 (dependent_scope_p): Check deduction_guide_type.
1370 * search.c (lookup_member): Likewise.
1372 2017-03-02 Jakub Jelinek <jakub@redhat.com>
1375 * init.c (mark_exp_read_r): New function.
1376 (emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
1377 whole arguments instead of plain mark_exp_read on TREE_LIST values.
1379 2017-03-01 Jason Merrill <jason@redhat.com>
1381 Class template argument deduction in new-expression
1382 * init.c (build_new): Handle deduction from no initializer.
1383 * parser.c (cp_parser_new_expression): Don't require a single
1384 expression for class template deduction.
1385 * typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
1386 class template placeholder.
1387 * pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
1388 (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
1389 (redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
1391 2017-03-01 Jakub Jelinek <jakub@redhat.com>
1394 * init.c (emit_mem_initializers): When not constructing vbases of
1395 abstract classes, mark arguments as read for
1396 -Wunused-but-set-parameter.
1398 2017-02-28 Jason Merrill <jason@redhat.com>
1400 Class template argument deduction refinements
1401 * call.c (joust): Move deduction guide tiebreaker down.
1402 * decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
1403 deduction with no initializer.
1404 * pt.c (build_deduction_guide): Handle implicit default/copy ctor.
1405 (do_class_deduction): Use that rather than special case.
1406 (do_auto_deduction): Handle null initializer.
1408 2017-02-28 Jakub Jelinek <jakub@redhat.com>
1410 * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
1411 instead of just cond ? "..." : "...".
1412 (grokdeclarator): Likewise.
1413 (build_enumerator): Likewise.
1414 * init.c (build_new_1): Likewise.
1415 * call.c (build_new_method_call_1): Likewise.
1416 * parser.c: Include intl.h.
1417 (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
1418 "enter"/"exit" keyword.
1419 (cp_finalize_oacc_routine): Don't use %s to supply portions of the
1422 2017-02-27 Jason Merrill <jason@redhat.com>
1424 PR c++/71568 - SFINAE forming pointer to member function
1425 * init.c (build_offset_ref): Check the return value of
1426 perform_or_defer_access_check.
1428 2017-02-27 Marek Polacek <polacek@redhat.com>
1430 * decl.c (expand_static_init): Add missing } in a comment.
1432 2017-02-27 Volker Reichelt <v.reichelt@netcologne.de>
1434 * init.c: Include intl.h.
1435 (build_new_1): Move message strings into pedwarn to make them
1436 -Wformat-security friendly. Mark string for translation.
1437 * pt.c (tsubst_copy_and_build): Mark string for translation.
1438 Make the pointer const.
1439 * semantics.c (finish_id_expression): Mark strings for translation.
1441 2017-02-25 Jakub Jelinek <jakub@redhat.com>
1443 * call.c (build_op_delete_call): Make msg1 and msg2 const.
1445 2017-02-24 Jakub Jelinek <jakub@redhat.com>
1448 * call.c (build_over_call): Call check_function_arguments even for
1449 -Wrestrict, adjust check_function_arguments caller.
1450 * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
1452 * typeck.c (cp_build_function_call_vec): Adjust
1453 check_function_arguments caller.
1455 2017-02-24 Marek Polacek <polacek@redhat.com>
1457 PR translation/79705
1458 * decl.c (check_redeclaration_exception_specification): Mark a string
1459 for translation. Make the pointer const.
1461 2017-02-23 Paolo Carlini <paolo.carlini@oracle.com>
1464 * pt.c (register_specialization): Check duplicate_decls return value
1465 for error_mark_node and pass it back.
1467 2017-02-22 Jason Merrill <jason@redhat.com>
1469 PR c++/79679 - missing destructor for argument
1470 * call.c (build_over_call): Don't pass tf_no_cleanup to argument
1473 * pt.c (do_class_deduction): Handle 0 argument case.
1475 2017-02-22 Jakub Jelinek <jakub@redhat.com>
1478 * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
1479 SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
1480 * constexpr.c (potential_constant_expression_1): Handle
1481 OMP_*, OACC_* and CILK_* trees. Use error_at with
1482 EXPR_LOC_OR_LOC (t, input_location) computed early
1483 instead of error, or error_at with location_of (t).
1485 2017-02-22 Marek Polacek <polacek@redhat.com>
1488 * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
1489 if the alignas expression is erroneous.
1490 * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
1494 * semantics.c (finish_underlying_type): Bail out for incomplete enums.
1496 2017-02-21 Jason Merrill <jason@redhat.com>
1498 PR c++/50308 - wrong deprecated warning with ADL
1499 PR c++/17729 - duplicate deprecated warning
1500 * semantics.c (finish_id_expression): Only call mark_used on a
1501 function if we aren't building a call.
1503 PR c++/41727 - ICE with partial spec of partial instantiation
1504 * pt.c (process_partial_specialization): For now, don't check more
1505 specialized if there is more than one level of args.
1507 2017-02-21 Marek Polacek <polacek@redhat.com>
1510 * cp-tree.h (maybe_reject_flexarray_init): Declare.
1511 * init.c (maybe_reject_flexarray_init): No longer static.
1512 Add check for current_function_decl.
1513 * parser.c (cp_parser_late_parse_one_default_arg): Reject
1514 a default mem-initializer for a flexible array.
1516 2017-02-21 Jakub Jelinek <jakub@redhat.com>
1517 Paolo Carlini <paolo.carlini@oracle.com>
1520 * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
1522 * pt.c (tsubst_decomp_names): Return error_mark_node if the first
1523 decl after the decomposition artificial decl has error_mark_node.
1524 * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
1525 instead of just == error_mark_node comparison.
1527 2017-02-21 Jakub Jelinek <jakub@redhat.com>
1530 * decl.c: Include gimplify.h.
1531 (cp_finish_decomp): Make sure there is no sharing of trees
1532 in between DECL_VALUE_EXPR of decomposition decls.
1535 * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
1538 * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
1539 call cplus_expand_constant on it first.
1541 2017-02-19 Jason Merrill <jason@redhat.com>
1543 PR c++/78139 - destructor needed by new-expression
1544 * call.c (build_special_member_call): Use tf_no_cleanup.
1546 PR c++/78282 - auto template and pack expansion
1547 * pt.c (find_parameter_packs_r): Don't walk into the type of
1548 templates other than template template-parameters.
1550 PR c++/79606 - ICE with this->base_member in NSDMI
1551 * class.c (build_base_path): Check processing_template_decl.
1553 PR c++/79607 - ICE with T{} initializer
1554 * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
1556 PR c++/79566 - elaborated-type-specifier in range for
1557 * parser.c (cp_parser_simple_declaration): Fix check for type
1560 PR c++/79400 - confusing suggestion of 'noexcept'
1561 * parser.c (cp_parser_exception_specification_opt): Remove
1562 suggestion for deprecated dynamic exception-specification.
1564 PR c++/79470 - partial ordering with reference parameters
1565 * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
1567 PR c++/79500 - ICE with non-template deduction guide
1568 * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
1569 DECL_TEMPLATE_RESULT.
1571 PR c++/79580 - ICE with compound literal
1572 * parser.c (cp_parser_class_head): If we're in the middle of an
1573 expression, use ts_within_enclosing_non_class.
1575 PR c++/79503 - inherited ctor taking base class
1576 * call.c (add_function_candidate): Also check that
1577 DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
1579 2017-02-19 Paolo Carlini <paolo.carlini@oracle.com>
1582 * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
1585 2017-02-19 Eric Fiselier <eric@efcs.ca>
1586 Jonathan Wakely <jwakely@redhat.com>
1589 * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
1590 control warning about literal suffix identifiers without a leading
1593 2017-02-17 Jason Merrill <jason@redhat.com>
1595 PR c++/79508 - lookup error with member template
1596 * parser.c (cp_parser_template_name): Clear
1597 parser->context->object_type if we aren't doing lookup.
1599 PR c++/78690 - ICE with using and global type with same name
1600 * pt.c (type_dependent_object_expression_p): True for
1603 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
1604 * pt.c (convert_template_argument): Just return an auto arg pack.
1605 (tsubst_template_args): Don't tsubst an auto pack type.
1607 PR c++/79556 - C++17 ICE with non-type auto
1608 * pt.c (do_auto_deduction): Don't try to deduce from null type.
1610 PR c++/79533 - C++17 ICE with temporary cast to reference
1611 * call.c (build_over_call): Conversion to a reference prevents copy
1614 2017-02-16 Jakub Jelinek <jakub@redhat.com>
1615 Jason Merrill <jason@redhat.com>
1617 PR c++/79502 - lost nodiscard attribute
1618 * pt.c (apply_late_template_attributes): Do apply non-dependent
1619 attributes to types.
1621 2017-02-16 Jason Merrill <jason@redhat.com>
1623 PR c++/78572 - ICE with self-modifying array initializer
1624 * constexpr.c (cxx_eval_store_expression): The object we're
1625 initializing is outside the constant-expression.
1626 (cxx_eval_call_expression): Set ctx->call.
1628 PR c++/79050 - ICE with undeduced auto and LTO
1629 * decl.c (poplevel): Remove undeduced auto decls.
1631 2017-02-16 Jakub Jelinek <jakub@redhat.com>
1634 * parser.c (cp_parser_omp_target): For -fopenmp-simd
1635 ignore #pragma omp target even when not followed by identifier.
1637 2017-02-15 Jason Merrill <jason@redhat.com>
1638 Jakub Jelinek <jakub@redhat.com>
1640 PR c++/79464 - ICE in IPA with omitted constructor parms
1641 * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
1642 (adjust_clone_args): Adjust.
1643 (add_method): Remember omitted parms.
1644 * call.c (add_function_candidate): Likewise.
1645 * mangle.c (write_method_parms): Likewise.
1646 * method.c (ctor_omit_inherited_parms): Return false if there are no
1649 2017-02-15 Martin Sebor <msebor@redhat.com>
1652 * init.c (maybe_reject_flexarray_init): New function.
1653 (perform_member_init): Call it.
1655 2017-02-15 Jakub Jelinek <jakub@redhat.com>
1658 * parser.c (cp_parser_std_attribute): Don't pedwarn about
1659 [[deprecated]] with -std=c++11 and [[fallthrough]] with
1660 -std=c++11 and -std=c++14.
1663 * decl.c (grokdeclarator): For static data members, handle thread_p
1664 only after handling inline.
1666 2017-02-14 Marek Polacek <polacek@redhat.com>
1670 * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
1671 clobbering if the postfix expression isn't an EXPR_P.
1673 2017-02-13 Jason Merrill <jason@redhat.com>
1675 PR c++/79461 - ICE with lambda in constexpr constructor
1676 * constexpr.c (build_data_member_initialization): Ignore
1677 initialization of a local variable.
1679 2017-02-13 Jakub Jelinek <jakub@redhat.com>
1681 * init.c (warn_placement_new_too_small): Add missing space in
1683 * parser.c (cp_parser_oacc_declare): Likewise.
1684 * mangle.c (maybe_check_abi_tags): Likewise.
1687 * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
1688 on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
1689 in the rightmost operand.
1691 2017-02-13 Nathan Sidwell <nathan@acm.org>
1693 PR c++/79296 - ICE mangling localized template instantiation
1694 * decl2.c (determine_visibility): Use template fn context for
1695 local class instantiations.
1697 2017-02-11 Jason Merrill <jason@redhat.com>
1699 PR c++/77659 - ICE with new and C++14 aggregate NSDMI
1700 * init.c (build_new): Make backups of any CONSTRUCTORs in init.
1701 (build_new_1): Use replace_placeholders.
1702 * tree.c (replace_placeholders_t): Also track whether we've seen a
1704 (replace_placeholders, replace_placeholders_r): Adjust.
1705 * cp-tree.h: Adjust.
1707 PR c++/77790 - ICE with auto function in C++11 mode
1708 * decl.c (undeduced_auto_decl): Remove C++14 limitation.
1709 (require_deduced_type): Add complain parm, return bool.
1710 * cp-tree.h: Adjust.
1711 * decl2.c (mark_used): Use require_deduced_type.
1713 2017-02-10 Jason Merrill <jason@redhat.com>
1715 PR c++/78908 - template ops and bitfields
1716 * tree.c (build_min_non_dep): Use unlowered_expr_type.
1718 PR c++/78897 - constexpr union
1719 * constexpr.c (cxx_eval_store_expression): A store to a union member
1720 erases a previous store to another member.
1722 PR c++/71285 - member of fold-expression
1723 * semantics.c (finish_unary_fold_expr)
1724 (finish_binary_fold_expr): Use null type for fold-expressions.
1726 PR c++/79401 - protected inherited constructor
1727 * call.c (enforce_access): For inheriting constructor, find a base
1728 binfo in the path we already have.
1730 2017-02-10 Marek Polacek <polacek@redhat.com>
1733 * pt.c (type_dependent_expression_p): Check if the expression type
1737 * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
1738 if warnings shouldn't be given.
1740 2017-02-10 Paolo Carlini <paolo.carlini@oracle.com>
1743 * pt.c (tsubst_decl): Don't try to preserve a typedef that names
1744 an error_mark_node as type.
1746 2017-02-09 Jakub Jelinek <jakub@redhat.com>
1747 Jason Merrill <jason@redhat.com>
1750 * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
1751 from pattern to type.
1753 2017-02-09 Jason Merrill <jason@redhat.com>
1755 PR c++/79316 - default argument in deduction guide
1756 PR c++/79350 - explicit deduction guide
1757 * parser.c (cp_parser_constructor_declarator_p)
1758 (cp_parser_direct_declarator): Parse deduction guides more like
1760 * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
1761 * tree.c (special_function_p): Return it.
1762 * decl.c (check_special_function_return_type): Handle it.
1763 (grokdeclarator, grokfndecl): Adjust.
1764 (cp_finish_decl): Pass flags to do_auto_deduction.
1765 * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
1766 * pt.c (dguide_name_p): Take a const_tree.
1767 (do_class_deduction): Handle explicit.
1768 (do_auto_deduction): Pass flags through.
1769 (build_deduction_guide): Copy explicit flag.
1771 2017-02-09 Jakub Jelinek <jakub@redhat.com>
1774 * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
1775 non-pragma_compound context here.
1776 (cp_parser_omp_target): Likewise.
1777 (cp_parser_pragma): Don't call push_omp_privatization_clauses and
1778 parsing for ordered and target omp pragmas in non-pragma_stmt
1779 non-pragma_compound contexts.
1782 * parser.c (cp_parser_oacc_declare): Formatting fix.
1783 (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
1784 automatic variables.
1786 2016-02-09 Nathan Sidwell <nathan@codesourcery.com>
1787 Chung-Lin Tang <cltang@codesourcery.com>
1789 * parser.c (cp_parser_oacc_clause_tile): Disallow collapse. Fix
1790 parsing. Parse constant expression. Remove semantic checking.
1791 (cp_parser_omp_clause_collapse): Disallow tile.
1792 (cp_parser_omp_for_loop): Deal with tile clause. Don't emit a parse
1793 error about missing for after already emitting one. Use more
1794 conventional for idiom for unbounded loop.
1795 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
1796 * semantics.c (finish_omp_clauses): Correct TILE semantic check.
1797 (finish_omp_for): Deal with tile clause.
1799 2017-02-07 Nathan Sidwell <nathan@acm.org>
1801 * method.c (synthesized_method_base_walk): New. Broken out of ...
1802 (synthesized_method_walk): ... here. Call it. Cleanup
1805 2017-02-07 Patrick Palka <ppalka@gcc.gnu.org>
1808 * typeck2.c (process_init_constructor_union): Consider only
1809 FIELD_DECLs when looking for an NSDMI.
1811 2017-02-06 Jason Merrill <jason@redhat.com>
1813 PR c++/71193 - incomplete types in templates
1814 * parser.c (cp_parser_postfix_dot_deref_expression): In a template
1815 handle incomplete type by pedwarning and then treating as dependent.
1817 2017-02-06 Jakub Jelinek <jakub@redhat.com>
1820 * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
1821 (potential_constant_expression_1): Likewise.
1824 * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
1825 allow one fewer than expected arguments if flag_permissive.
1828 * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
1829 * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
1830 with error_mark_node type.
1832 2017-02-03 Jason Merrill <jason@redhat.com>
1834 PR c++/78689 - ICE on constructor with label
1835 * optimize.c (maybe_clone_body): Replace omitted parameters with
1837 * class.c (build_clone): Fix logic for omitting inherited parms.
1839 PR c++/12245 - excessive memory use
1840 * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
1841 back in. Don't cache constants.
1842 (maybe_constant_init): Don't cache constants.
1844 PR c++/79294 - ICE with invalid template argument
1845 * pt.c (convert_nontype_argument_function): Check value-dependence.
1846 (convert_nontype_argument): Don't check it here for function ptrs.
1848 2017-02-02 Richard Biener <rguenther@suse.de>
1851 * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
1852 it lazily on the first changed element only and copy it
1853 fully upfront, only storing changed elements.
1855 2017-02-02 Paolo Carlini <paolo.carlini@oracle.com>
1858 * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
1861 2017-01-31 Jakub Jelinek <jakub@redhat.com>
1864 * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
1867 2017-01-31 David Malcolm <dmalcolm@redhat.com>
1870 * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
1871 any namespace aliases.
1873 2017-01-31 Nathan Sidwell <nathan@acm.org>
1876 * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
1880 * pt.c: (instantiate_decl): Push to top level when current
1881 function scope doesn't match. Only push lmabda scope stack when
1884 * cp-tree.h (instantiate_decl): Make defer_ok bool.
1885 * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
1886 (instantiate_decl): Simplify and reorder state saving and restoration.
1889 * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
1890 * semantics.c (finish_member_declaration): Assert class is being
1893 2017-01-30 Alexandre Oliva <aoliva@redhat.com>
1895 Introduce C++ support in libcc1.
1896 * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
1897 (ansi_opname): Rename to...
1898 (cp_operator_id): ... this. Adjust all callers.
1899 (ansi_assopname): Rename to...
1900 (cp_assignment_operator_id): ... this. Adjust all callers.
1901 (cp_literal_operator_id): Declare.
1902 (set_global_friend): Declare.
1903 (is_global_friend): Declare.
1904 (enum cp_oracle_request): New type.
1905 (cp_binding_oracle_function): New type.
1906 (cp_binding_oracle): Declare.
1907 (cp_finish_injected_record_type): Declare.
1908 * friend.c (global_friend): New var.
1909 (set_global_friend): New fn.
1910 (is_global_friend): New fn.
1911 (is_friend): Call is_global_friend.
1912 * name-lookup.c (cp_binding_oracle): New var.
1913 (query_oracle): New fn.
1914 (qualified_lookup_using_namespace): Call query_oracle.
1915 (lookup_name_real_1): Likewise.
1916 * parser.c (cp_literal_operator_id): Drop static.
1917 * search.c (friend_accessible_p): Call is_global_friend.
1918 * semantics.c (is_this_parameter): Accept a variable if the
1919 binding oracle is enabled.
1921 2017-01-27 Jason Merrill <jason@redhat.com>
1923 PR c++/78771 - ICE with inherited constructor.
1924 * call.c (build_over_call): Call deduce_inheriting_ctor here.
1925 * pt.c (tsubst_decl): Not here.
1926 * class.c (add_method): Or here.
1927 * method.c (deduce_inheriting_ctor): Handle clones.
1928 (implicitly_declare_fn): Don't deduce inheriting ctors yet.
1930 2017-01-27 Adam Butcher <adam@jessamine.co.uk>
1933 * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
1935 * cp/cp-tree.h: Declare it.
1936 * cp/semantics.c (finish_id_expression): Resolve names within a default
1937 capturing generic lambda defined within a template prior to
1938 instantiation to allow for captures to be added to the closure type.
1940 2017-01-26 Jakub Jelinek <jakub@redhat.com>
1943 * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
1944 * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
1945 * parser.c (cp_parser_builtin_offsetof): Pass result of
1946 build_static_cast of null_pointer_node to finish_offsetof.
1947 * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
1948 it for -Winvalid-offsetof pedwarn instead of trying to guess
1949 original offsetof type from EXPR. Save OBJECT_PTR as a new
1950 second operand to OFFSETOF_EXPR.
1951 * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
1952 finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
1955 2017-01-26 Jason Merrill <jason@redhat.com>
1957 * name-lookup.c (parse_using_directive): Deprecate strong using.
1959 PR c++/79176 - lambda ICE with -flto -Os
1960 * decl2.c (vague_linkage_p): Handle decloned 'tors.
1961 * tree.c (decl_linkage): Likewise.
1963 2017-01-25 Martin Sebor <msebor@redhat.com>
1965 * decl.c (grokdeclarator): Fix a typo in a comment.
1967 2017-01-25 Jakub Jelinek <jakub@redhat.com>
1970 * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
1974 * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
1975 OPT_Wpedantic on lambda templates for -std=c++14 and higher.
1977 2017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
1980 * decl.c (cxx_init_decl_processing): Pass main_input_filename
1981 to build_translation_unit_decl.
1983 2017-01-24 Jakub Jelinek <jakub@redhat.com>
1986 * cp-gimplify.c (cp_genericize_r): Add result of
1987 convert_from_reference on invisiref parm to p_set.
1989 2017-01-24 Nathan Sidwell <nathan@acm.org>
1991 PR c++/78469 - defaulted ctor and inaccessible dtor
1992 * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
1993 * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
1994 * tree.c (build_target_expr): Check tf_no_cleanup.
1996 PR c++/79118 - anon-members and constexpr
1997 * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
1998 ctor decl. Recursively check anonymous members.
1999 (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
2001 (explain_invalid_constexpr_fn): Likewise.
2003 2017-01-23 Nathan Sidwell <nathan@acm.org>
2005 PR c++/71710 - template using directive of field
2006 * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
2009 PR c++/71406 - ICE with scope-ref'd template id exprs
2011 * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
2012 before breaking up TEMPLATE_ID_EXPR.
2014 2017-01-20 Nathan Sidwell <nathan@acm.org>
2016 PR c++/78495 - wrong code inherited ctor and invisi-ref parm
2017 * cp-gimplify.c (cp_generize_r): Don't skip thunks.
2019 2017-01-20 David Malcolm <dmalcolm@redhat.com>
2023 * cp-tree.h (suggest_alternatives_for): Add bool param.
2024 (suggest_alternative_in_explicit_scope): New decl.
2025 * error.c (qualified_name_lookup_error): When SCOPE is a namespace
2026 that isn't the global one, call new function
2027 suggest_alternative_in_explicit_scope, only calling
2028 suggest_alternatives_for if it fails, and disabling near match
2029 searches fort that case. When SCOPE is the global namespace,
2030 pass true for new param to suggest_alternatives_for to allow for
2032 * lex.c (unqualified_name_lookup_error): Pass true for new param
2033 to suggest_alternatives_for.
2034 * name-lookup.c (consider_binding_level): Add forward decl.
2035 (suggest_alternatives_for): Add "suggest_misspellings" param,
2036 using it to conditionalize the fuzzy name-lookup code.
2037 (suggest_alternative_in_explicit_scope): New function.
2038 * parser.c (cp_parser_primary_expression): When calling
2039 finish_id_expression, pass location of id_expression rather
2040 than that of id_expr_token.
2041 (cp_parser_id_expression): Convert local "unqualified_id" from
2042 tree to cp_expr to avoid implicitly dropping location information.
2044 2017-01-20 Marek Polacek <polacek@redhat.com>
2047 * call.c (build_conditional_expr_1): Warn about duplicated branches.
2048 * semantics.c (finish_expr_stmt): Build statement using the proper
2051 2017-01-19 Jason Merrill <jason@redhat.com>
2053 US 20 - forwarding references and class template argument deduction
2054 * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
2055 * pt.c (push_template_decl_real): Set it.
2056 (maybe_adjust_types_for_deduction): Check it.
2057 (rewrite_template_parm): Copy it.
2059 US 19 - deduction guides and constructors
2060 * call.c (joust): Prefer deduction guides to constructors.
2061 * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
2062 (deduction_guide_p): Check DECL_P.
2064 * decl.c (check_initializer): Always use build_aggr_init for array
2067 PR c++/79130 - decomposition and direct-initialization
2068 * init.c (build_aggr_init): Communicate direct-initialization to
2070 (build_vec_init): Check for array copy sooner.
2071 * parser.c (cp_parser_decomposition_declaration): Remove call to
2072 build_x_compound_expr_from_list.
2074 2017-01-18 Jason Merrill <jason@redhat.com>
2076 PR c++/68666 - member variable template-id
2077 * typeck.c (finish_class_member_access_expr): Handle variable
2079 * pt.c (lookup_and_finish_template_variable): No longer static.
2080 * cp-tree.h: Declare it.
2082 2017-01-18 Nathan Sidwell <nathan@acm.org>
2085 * call.c (build_over_call): When checking ellipsis conversions for
2086 an inherited ctor, make sure there is at least one conversion.
2088 2017-01-18 Jason Merrill <jason@redhat.com>
2090 PR c++/78894 - ICE with class deduction and default arg
2091 * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
2093 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
2096 * mangle.c (write_discriminator): Reorganize abi warning check.
2098 2017-01-18 Nathan Sidwell <nathan@acm.org>
2100 * cp-tree.h: Clarify exception spec node comment.
2101 * except.c (nothrow_spec_p): Simplify by checking node-equality.
2104 * mangle.c (write_exception_spec): Check nothrow explicitly.
2105 (write_encoding): Don't increment processing_template_decl around
2108 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
2111 * mangle.c (write_template_args): Add "on" for operator names.
2113 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
2116 * mangle.c (write_discriminator): Handle discriminator >= 10.
2118 2017-01-17 Nathan Sidwell <nathan@acm.org>
2121 * cp-tree.h (maybe_generic_this_capture): Declare.
2122 * lambda.c (resolvable_dummy_lambda): New, broken out of ...
2123 (maybe_resolve_dummy): ... here. Call it.
2124 (maybe_generic_this_capture): New.
2125 * parser.c (cp_parser_postfix_expression): Speculatively capture
2126 this in generic lambda in unresolved member function call.
2127 * pt.c (tsubst_copy_and_build): Force hard error from failed
2128 member function lookup in generic lambda.
2130 2017-01-17 Aldy Hernandez <aldyh@redhat.com>
2133 * cp-array-notation.c (expand_array_notation_exprs): Handle
2136 2017-01-11 Jason Merrill <jason@redhat.com>
2138 PR c++/78337 - ICE on invalid with generic lambda
2139 * semantics.c (process_outer_var_ref): Check if containing_function
2140 is null. Move inform call under complain test.
2142 2017-01-11 Nathan Sidwell <nathan@acm.org>
2145 * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
2148 2017-01-11 Nathan Sidwell <nathan@acm.org>
2150 * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
2152 2017-01-11 Jakub Jelinek <jakub@redhat.com>
2155 * parser.c (cp_parser_std_attribute_spec): Remove over-eager
2156 assertion. Formatting fix.
2159 * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
2162 2017-01-10 David Malcolm <dmalcolm@redhat.com>
2165 * parser.c (cp_parser_class_specifier_1): Only suggest inserting
2166 a missing semicolon if we have a valid insertion location for
2169 2017-01-10 Jason Merrill <jason@redhat.com>
2171 FI 20, decomposition declaration with parenthesized initializer.
2172 * parser.c (cp_parser_decomposition_declaration): Use
2173 cp_parser_initializer.
2175 2017-01-09 Jason Merrill <jason@redhat.com>
2177 Implement P0195R2, C++17 variadic using.
2178 * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
2179 * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
2180 * error.c (dump_decl): Likewise.
2182 2017-01-09 Jakub Jelinek <jakub@redhat.com>
2184 PR translation/79019
2185 PR translation/79020
2186 * semantics.c (finish_omp_clauses): Add missing whitespace to
2187 translatable strings.
2188 * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
2190 2017-01-07 Jason Merrill <jason@redhat.com>
2192 PR c++/78948 - instantiation from discarded statement
2193 * parser.h (struct cp_parser): Remove in_discarded_stmt field.
2194 * cp-tree.h (in_discarded_stmt): Declare it.
2195 (struct saved_scope): Add discarded_stmt bitfield.
2196 (in_discarded_stmt): New macro.
2197 * decl2.c (mark_used): Check it.
2198 * parser.c (cp_parser_selection_statement): Adjust.
2199 (cp_parser_jump_statement): Adjust.
2201 2017-01-05 Jakub Jelinek <jakub@redhat.com>
2204 * decl.c (cp_finish_decomp): Remove probe variable, if tt is
2205 REFERENCE_REF_P, set tt to its operand.
2208 * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
2209 unions even for C++11 and later.
2211 2017-01-05 Nathan Sidwell <nathan@acm.org>
2214 * pt.c (convert_nontype_argument): Don't try and see if integral
2215 or enum expressions are constants prematurely.
2217 2017-01-04 Marek Polacek <polacek@redhat.com>
2220 * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
2221 a zero character literal.
2223 2017-01-04 Jakub Jelinek <jakub@redhat.com>
2226 * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
2230 * parser.c (cp_parser_simple_declaration): Only complain about
2231 inconsistent auto deduction if auto_result doesn't use auto.
2233 * parser.c (cp_parser_simple_declaration): Diagnose function
2234 declaration among more than one init-declarators with auto
2238 * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
2239 assertion, as lexer->buffer may be NULL.
2241 2017-01-04 Marek Polacek <polacek@redhat.com>
2245 * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
2247 2017-01-04 Nathan Sidwell <nathan@acm.org>
2250 * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
2251 (lambda_capture_field_type): Update prototype.
2252 * lambda.c (lambda_capture_field_type): Add is_reference parm.
2253 Add referenceness here.
2254 (add_capture): Adjust lambda_capture_field_type call, refactor
2256 * pt.c (tsubst): Adjust lambda_capture_field_type call.
2258 2017-01-01 Jakub Jelinek <jakub@redhat.com>
2260 Update copyright years.
2262 Copyright (C) 2017 Free Software Foundation, Inc.
2264 Copying and distribution of this file, with or without modification,
2265 are permitted in any medium without royalty provided the copyright
2266 notice and this notice are preserved.