1 2017-05-26 Nathan Sidwell <nathan@acm.org>
4 * tree.c (ovl_copy): Adjust assert, copy OVL_LOOKUP.
6 (lookup_keep): Call it.
9 * name-lookup.c (push_inline_namespaces): New.
10 (push_namespace): Look inside inline namespaces.
12 Inline and using namespace representation change.
13 * cp-tree.h (struct lang_decl_ns): Delete ns_using. Add usings,
15 (DECL_NAMESPACE_USING): Adjust.
16 (DECL_NAMESPACE_INLINEES): New.
17 * name-lookup.h (struct cp_binding_level): Change usings
19 * name-lookup.c (name_lookup::do_queue_usings,
20 name_lookup::queue_usings): Adjust.
21 (name_lookup::search_namespace, name_lookup::search_usings,
22 name_lookup::queue_namespace): Adjust.
23 (name_lookup::adl_namespace_only): Adjust.
24 (add_using_namespace, push_namespace): Push onto vector.
25 (pop_namespace): Add timing logic.
27 * call.c (build_operator_new_call): Do namelookup and ADL here.
28 (build_new_op_1): Likewise.
29 * name-lookup.h (lookup_function_nonclass): Delete declaration.
30 (do_using_directive): Likewise.
31 * name-lookup.c (set_namespace_binding, push_local_binding): Don't
33 (struct scope_binding): Delete.
34 (EMPTY_SCOPE_BINDING): Delete.
35 (set_decl_namespace): Use OVL_P.
36 (finish_local_using_decl): Lose unnecesary checks.
37 (lookup_function_nonclass): Delete.
38 (cp_emit_debug_info_for_using): Use MAYBE_BASELINK_P.
40 * cp-tree.h (OVL_CHAIN): Check looking at OVERLOAD.
41 (ovl_iterator): Add allow_inner field. Adjust ctor. Make
43 (ovl_iterator::maybe_push, ovl_iterator::pop): New.
44 (lkp_iterator): Add outer field. Adjust ctor.
45 (lkp_iterator::operator++): New.
46 (lookup_mark, lookup_maybe_add): Declare.
47 * name-lookup.c (name_lookup): Delete fn_set member.
48 (name_lookup::preserve_state, name_lookup::restore_state): Unmark
50 (name_lookup::add_value): Use lookup_add directly.
51 (name_lookup::add_fns: Use lookup_maybe_add.
52 (name_lookup::search_adl): Mark and unmark fns.
54 * pt.c (check_explicit_specialization): Use lookup_add directly.
55 * ptree.c (cxx_print_xnode): Show complete overload structure.
56 * tree.c (lookup_mark, lookup_maybe_add): New.
58 * name-lookup.c (name_lookup::search_adl): ADL OMP UDR type args.
60 2017-05-26 Jakub Jelinek <jakub@redhat.com>
62 * cp-tree.h (struct lang_decl_decomp): New type.
63 (struct lang_decl): Add u.decomp.
64 (LANG_DECL_DECOMP_CHECK): Define.
65 (DECL_DECOMPOSITION_P): Note it is set also on the vars
67 (DECL_DECOMP_BASE): Define.
68 (retrofit_lang_decl): Add extra int = 0 argument.
69 * lex.c (retrofit_lang_decl): Add SEL argument, if non-zero
70 use it to influence the selector choices and for selector
71 0 to non-zero transition copy old content.
72 (cxx_dup_lang_specific_decl): Handle DECL_DECOMPOSITION_P.
73 * decl.c (poplevel): For DECL_DECOMPOSITION_P, check
74 !DECL_DECOMP_BASE instead of !DECL_VALUE_EXPR. Adjust warning
75 wording if decl is a structured binding.
76 (cp_finish_decomp): Pass 4 as the new argument to retrofit_lang_decl.
77 Set DECL_DECOMP_BASE. Ignore DECL_READ_P sets from initialization
78 of individual variables for tuple structured bindings.
79 (grokdeclarator): Pass 4 as the new argument to retrofit_lang_decl.
80 Clear DECL_DECOMP_BASE.
81 * decl2.c (mark_used): Mark DECL_DECOMP_BASE TREE_USED as well.
82 * pt.c (tsubst_decomp_names): Assert DECL_DECOMP_BASE matches what
84 * expr.c (mark_exp_read): Recurse on DECL_DECOMP_BASE instead of
87 2017-05-25 Jason Merrill <jason@redhat.com>
89 PR c++/80605 - __is_standard_layout and zero-length array
90 * class.c (check_bases): Use DECL_FIELD_IS_BASE.
92 2017-05-25 Nathan Sidwell <nathan@acm.org>
94 Kill OVL_CURRENT, OVL_NEXT.
95 * cp-tree.h (OVL_CURRENT, OVL_NEXT): Delete.
96 * name-lookup.c (set_decl_namespace): Use ovl_iterator.
97 (consider_binding_level): Use OVL_FIRST.
98 (cp_emit_debug_info_for_using): Use lkp_iterator.
99 * pt.c (check_explicit_specialization): Use ovl_iterator.
101 Kill DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS.
102 * cp-tree.h (lang_decl_ns): Remove ns_users field.
103 (DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS): Delete.
104 (TREE_INDIRECT_USING): Delete.
105 * name-lookup.h (is_associated_namespace): Delete.
106 * name-lookup.c (name_lookup::search_usings,
107 name_lookup::do_queue_usings): Usings are always direct.
108 (is_associated_namespace): Delete.
109 (handle_namespace_attrs): Use DECL_NAMESPACE_INLINE_P.
110 (namespace_ancestor_1, namespace_ancestor): Delete.
111 (push_using_directive_1, push_using_directive): Delete.
112 (add_using_namespace_1): Delete.
113 (add_using_namespace): Reimplement.
114 (emit_debug_info_using_namespace): New.
115 (finish_namespace_using_directive, finish_local_using_directive,
116 push_namespace): Adjust.
117 * tree.c (cp_free_lang_data): Remove DECL_NAMESPACE_USERS handling.
119 2017-05-25 Volker Reichelt <v.reichelt@netcologne.de>
121 * semantics.c (finish_handler_parms): Warn about non-reference type
124 2017-05-25 Nathan Sidwell <nathan@acm.org>
126 Reimplement unqualified namespace lookup.
127 * name-lookup.c (name_lookup::using_pair,
128 name_lookup::using_queue): New typedefs.
129 (name_lookup::queue_namespace, name_lookup::do_queue_usings,
130 name_lookup::queue_usings): New.
131 (name_lookup::search_unqualified): New.
132 (merge_functions, same_entity_p, ambiguous_decl,
133 unqualified_namespace_lookup_1, unqualified_namespace_lookup,
134 lookup_using_namespace): Delete.
135 (lookup_name_real_1): Adjust.
137 Reimplement qualified namespace lookup.
138 * name-lookup.c (name_lookup::flags): New member. Adjust ctor.
139 (name_lookup::ambiguous, name_lookup::add_value,
140 name_lookup::add_type, name_lookup::process_binding): New.
141 (name_lookup::search_namespace_only,
142 name_lookup::search_namespace, name_lookup::search_usings): New.
143 (name_lookup::search_qualified): New.
144 (do_nonmember_using_decl, suggest_alternatives_for,
145 lookup_qualified_name): Adjust.
146 (tree_vec_contains): Delete.
147 (qualified_lookup_using_namespace): Rename to ...
148 (qualified_namespace_lookup): ... here. Reimplement.
151 * cp-tree.h (LOOKUP_SEEN_P, LOOKUP_FOUND_P): New.
152 * name-lookup.h (lookup_arg_dependent): Return plain tree.
153 * name-lookup.c (arg_lookup, arg_assoc, arg_assoc_args,
154 arg_assoc_args_vec, arg_assoc_type, add_function,
155 arg_assoc_namespace, arg_assoc_class_only, arg_assoc_bases,
156 arg_assoc_class, arg_assoc_template_arg, arg_assoc,
157 lookup_arg_dependent_1): Delete.
158 (name_lookup): New lookup object.
159 (name_lookup::preserve_state, name_lookup::restore_state,
160 name_lookup::mark_seen, name_lookup::find_and_mark,
161 name_lookup::add_fns, name_lookup::adl_namespace_only,
162 name_lookup::adl_namespace, name_lookup::adl_class_only,
163 name_lookup::adl_bases, name_lookup::adl_class,
164 name_lookup::adl_expr, name_lookup::adl_type,
165 name_lookup::adl_template_arg, name_lookup::search_adl): New.
166 (lookup_arg_dependent): Return a plain tree. Adjust.
167 (is_associated_namespace): Move later.
169 2017-05-24 Nathan Sidwell <nathan@acm.org>
171 * friend.c (do_friend): Remove check for existing decl.
172 * name-lookup.h (lookup_name_innermost_nonclass_level): Delete.
173 * name-lookup.c (push_local_binding): Directly look for binding.
174 (lookup_name_innermost_nonclass_level_1): Delete.
175 (lookup_name_innermost_nonclass_level): Delete.
177 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Alphabetize.
179 * cp-tree.h (cp_free_lang_data): Add extern.
180 (ovl_skip_hidden, is_overloaded_fn, really_overloaded_fn): Add
182 (type_unknown_p): Return bool, make inline, lose TREE_LIST check.
183 * typeck.c (type_unknown_p): Delete.
184 * tree.c (is_overloaded_fn): Use MAYBE_BASELINE_FUNCTIONS, adjust
186 (dependent_name): Likewise.
187 (decl_anon_ns_mem_p): Simplify.
189 2017-05-24 Jonathan Wakely <jwakely@redhat.com>
192 * tree.c (reshape_init): Use unqualified type for direct enum init.
193 * typeck.c (maybe_warn_about_cast_ignoring_quals): New.
194 (build_static_cast_1, build_reinterpret_cast_1): Strip cv-quals from
195 non-class destination types.
196 (build_const_cast_1): Strip cv-quals from destination types.
197 (build_static_cast, build_reinterpret_cast, build_const_cast)
198 (cp_build_c_cast): Add calls to maybe_warn_about_cast_ignoring_quals.
200 2017-05-24 Martin Sebor <msebor@redhat.com>
203 * call.c (fully_fold_internal): Adjust.
205 2017-05-24 Nathan Sidwell <nathan@acm.org>
207 * cp-tree.h (ovl_skip_hidden): Declare.
208 * tree.c (ovl_skip_hidden): New.
209 * name-lookup.c (arg_assoc_namespace): Call ovl_skip_hidden.
210 (lookup_arg_dependent_1): Likewise.
211 (ambiguous_decl): Use DECL_HIDDEN_P, ovl_skip_hidden.
212 (hidden_name_p, remove_hidden_names): Delete.
213 (lookup_name_real_1): Do not strip hidden names.
214 * name-lookup.h (hidden_name_p, remove_hidden_names): Delete.
216 * cp-tree.h (OVL_HIDDEN_P): New.
217 (ovl_iterator::hidden_p, ovl_iterator::reveal_node): New.
218 (ovl_iterator::reveal_node): Declare.
219 * tree.c (ovl_copy): Copy OVL_HIDDEN_P.
220 (ovl_insert): Order on hiddenness.
221 (ovl_iterator::reveal_node): New.
222 * name-lookup.c (anticipated_builtin_p): New.
223 (supplement_binding_1): Use it.
224 (set_local_extern_decl_linkage): Use hidden_p.
225 (do_pushdecl): Deal with unhiding a hidden decl, use
226 anticipated_builtin_p.
227 (do_nonmember_using_decl): Use anticipated_decl_p.
228 (lookup_name_real_1): Use DECL_HIDDEN_P.
230 2017-05-23 Jason Merrill <jason@redhat.com>
232 -Wunused and C++17 structured bindings
233 * decl.c (poplevel): Don't warn about unused structured bindings,
235 * error.c (dump_simple_decl): Handle structured bindings.
236 * expr.c (mark_exp_read): Look through DECL_VALUE_EXPR.
238 2017-05-23 Nathan Sidwell <nathan@acm.org>
240 * cp-tree.h (PUSH_GLOBAL, PUSH_LOCAL, PUSH_USING): Delete.
241 * name-lookup.c (create_local_binding): New.
242 (update_binding): New.
243 (pushdecl_maybe_friend_1): Rename to ...
244 (do_pushdecl): ... this. Reimplement.
246 (push_overloaded_decl_1, push_overloaded_decl): Delete.
248 2017-05-23 Jason Merrill <jason@redhat.com>
250 PR c++/80396 - built-in for make_integer_sequence.
251 * pt.c (builtin_pack_fn_p, builtin_pack_call_p)
252 (expand_integer_pack, expand_builtin_pack_call): New.
253 (find_parameter_packs_r): Check builtin_pack_call_p.
254 (check_for_bare_parameter_packs): Handle it.
255 (tsubst_pack_expansion): Call expand_builtin_pack_call.
256 (declare_integer_pack): New.
257 (init_template_processing): Call it.
258 * decl2.c (mark_used): Check builtin_pack_fn_p.
260 2017-05-23 Nathan Sidwell <nathan@acm.org>
262 * name-lookup.c (find_namespace_binding): New.
263 (pushdecl_maybe_friend_1): Use CP_DECL_CONTEXT.
264 (set_identifier_type_value_with_scope): Use find_namespace_binding.
265 (find_binding, cp_binding_level_find_binding_for_name,
266 binding_for_name, namespace_binding_1): Delete.
267 (push_overloaded_decl_1): Use CP_DECL_CONTEXT.
268 (get_namespace_binding, set_namespace_binding,
269 finish_namespace_using_decl, unqualified_namespace_lookup_1,
270 qualified_lookup_using_namespace, lookup_type_scope_1,
271 lookup_name_innermost_nonclass_level_1): Use find_namespace_binding.
274 * parser.c (cp_parser_template_id): Keep the lookup when stashing
277 * cp-tree.h (DECL_HIDDEN_P): New.
278 * name-lookup.c (set_decl_context,
279 set_local_extern_decl_linkage): New, broken out of ...
280 (pushdecl_maybe_friend_1): ... here. Call them.
282 2017-05-23 Thomas Schwinge <thomas@codesourcery.com>
284 * parser.c (OACC_KERNELS_CLAUSE_MASK): Add
285 "PRAGMA_OACC_CLAUSE_NUM_GANGS", "PRAGMA_OACC_CLAUSE_NUM_WORKERS",
288 2017-05-23 Nathan Sidwell <nathan@acm.org>
290 * cp-tree.h (OVL_P): New.
291 * name-lookup.h (push_local_binding): Delete.
292 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
293 (finish_namespace_using_decl, finish_local_using_decl): ... here
294 * name-lookup.c (add_decl_to_level): Swap args.
295 (pop_bindings_and_leave_scope): Look inside TREE_LIST.
296 (diagnose_name_conflict): Check contexts are same for redecl.
297 (update_local_overload): New.
298 (compparms_for_decl_and_using): Rename to ...
299 (matching_fn_p): ... here.
300 (pushdecl_maybe_friend_1): Adjust add_decl_to_level,
301 push_local_bindings call.
302 (push_local_binding): Make static, replace FLAGS arg with
304 (validate_nonmember_using_decl): Use OVL_FIRST.
305 (do_nonmember_using_decl): Use in/out parameters. Use
306 lkp_iterator and simplify.
307 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
308 (finish_namespace_using_decl, finish_local_using_decl): ... here.
310 (lookup_type_current_level): Delete.
311 * parser.c (cp_parser_using_declaration): Adjust.
312 * pt.c (tsubst_expr): Adjust.
314 2017-05-22 Nathan Sidwell <nathan@acm.org>
316 * name-lookup.h (parse_using_directive): Replace with ...
317 (finish_namespace_using_directive): ... this and ...
318 (finish_local_using_directive): ... this.
319 * name-lookup.c (add_using_namespace_1): Move later.
320 (add_using_namespace): Move later, add namespace_p arg, remove
322 (push_using_directive_1): Directly recurse.
323 (do_using_directive, parse_using_directive): Delete, split into ...
324 (finish_namespace_using_directive): ... this and ...
325 (finish_local_using_directive): ... this.
326 (push_namespace): Use add_using_namespace.
327 * parser.c (cp_parser_using_directive): Call
328 finish_namespace_using_directive or finish_local_using_directive.
329 * pt.c (tsubst_expr): Call finish_local_using_directive.
331 * cp-objcp-common.c (cp_register_dumps): Register raw dumper.
332 * cp-tree.h (raw_dump_id): Declare.
333 * decl2.c (raw_dump_id): Define.
334 (dump_tu): Use raw_dump_id.
336 * config-lang.in (gtfiles): Sort list, break lines.
338 * cp-tree.h (CPTI_TERMINATE, CPTI_CALL_UNEXPECTED): Rename to ...
339 (CPTI_TERMINATE_FN, CPTI_CALL_UNEXPECTED_FN): ... here.
340 ( CPTI_GET_EXCEPTION_PTR_FN, CPTI_BEGIN_CATCH_FN, CPTI_END_CATCH_FN,
341 CPTI_ALLOCATE_EXCEPTION_FN, CPTI_FREE_EXCEPTION_FN, CPTI_THROW_FN,
342 CPTI_RETHROW_FN): New.
343 (noexcept_deferred_spec): New.
344 (terminate_node, call_unexpected_node): Rename to ...
345 (terminate_fn, call_unexpected_fn): ... here.
346 (get_exception_ptr_fn, begin_catch_fn, end_catch_fn,
347 allocate_exception_fn, free_exception_fn, throw_fn, rethrow_fn): New.
348 * except.c (fn1..fn5, throw_fn, rethrow_rn, spec): Delete.
349 (init_exception_processing): Adjust.
350 (declare_library_fn): Create and push the fns here.
351 (do_get_exception_ptr, do_begin_catch, do_end_catch,
352 do_allocate_exception_ptr, do_free_exception_ptr): Adjust
353 declare_library_fn use.
354 (unevaluated_noexcept_spec): Adjust.
355 * cp-gimplify.c (genericize_eh_spec_block,
356 gimplify_most_not_throw_expr): Adjust.
358 * name-lookup.c (pushdecl_top_level,
359 pushdecl_top_level_and_finish): Move after namespace pushing and
361 (push_to_top_level): Rename to ...
362 (do_push_to_top_level): ... here. Remove timing code.
363 (pop_from_top_level_1): Rename to ...
364 (do_pop_from_top_level): ... here.
365 (do_push_nested_namespace, do_pop_nested_namespace)
366 (push_to_top_level): New wrapper for do_push_to_top_level.
367 (pop_from_top_level): Adjust.
368 (push_nested_namepace, pop_nested_namespace): Wrappers for workers.
370 2017-05-19 Bernd Edlinger <bernd.edlinger@hotmail.de>
372 * config-lang.in (gtfiles): Add c-family/c-format.c,
373 except.c, init.c, lambda.c and friend.c.
374 * class.c (dvirt_fn): Move out of function scope,
376 * except.c (fn1-5, throw_fn, rethrow_fn, spec): Likewise.
377 * init.c (fn): Likewise.
378 * lambda.c (ptr_id, max_id): Likewise.
379 * friend.c (global_friend): Add GTY attribute.
381 2017-05-19 Nathan Sidwell <nathan@acm.org>
383 * call.c (add_list_candidates): Use OVL_FIRST.
384 (build_new_method_call_1): Likewise.
385 * cp-tree.h (OVL_SINGLE_P): New.
386 (TYPE_HIDDEN_P): New.
387 * decl.c (xref_tag_1): Use TYPE_HIDDEN_P.
388 * dump.c (cp_tump_tree): Adjust overload dumping.
389 * error.c (dump_decl): Use OVL_SINGLE_P, simplify context
391 * method.c (lazily_declare_fn): Assert we added it.
392 * parser.c (cp_parser_nested_name_specifier): Use OVL_SINGLE_P,
394 (cp_parser_template_name): Use lkp_iterator.
395 * pt.c (begin_template_parm_list): Fixup comment.
396 (instantiate_class_template_1): Use TYPE_HIDDEN_P.
397 * tree.c (ovl_iterator::remove_node): Cope with inherited ctors.
398 (ovl_scope): Use lkp_iterator.
400 2017-05-19 Thomas Schwinge <thomas@codesourcery.com>
402 * parser.c (cp_parser_omp_clause_default): Handle
403 "OMP_CLAUSE_DEFAULT_PRESENT".
405 * parser.c (cp_parser_omp_clause_default): Avoid printing more
406 than one syntax error message.
408 2017-05-19 Nathan Sidwell <nathan@acm.org>
410 * class.c (class_dump_id): Define.
411 (dump_class_hierarchy, dump_vtable, dump_vtt): Use it.
412 * cp-objcp-common.c (cp_register_dumps): New.
413 * cp-objcp-common.h (cp_register_dumps): Declare.
414 (LANG_HOOKS_REGISTER_DUMPS): Override.
415 * cp-tree.h (class_dump_id): Declare.
417 2017-05-18 Nathan Sidwell <nathan@acm.org>
419 * cp-tree.h (OVL_ARG_DEPENDENT): Delete.
421 (lookup_keep): Declare.
422 * name-lookup.c (add_function): Don't set OVL_ARG_DEPENDENT.
423 * pt.c (tsubst_copy): Assert lookup is persistent.
424 * semantics.c (finish_call_expr): Use lkp_iterator, call
426 * tree.c (ovl_copy): New.
427 (ovl_insert, ovl_iterator::remove_node): Copy immutable nodes.
430 * cp-tree.h (OVL_USED): Replace with ...
431 (OVL_USING_P): ... this.
432 (ovl_iterator::using_p): Adjust.
433 * name-lookup.c (push_overloaded_decl_1,
434 do_nonmember_using_decl): Adjust.
435 * search.c (lookup_field_r): Adjust.
436 * tree.c (ovl_insert, ovl_scope): Adjust.
438 * cp-tree.h (lookup_add): Swap args.
439 (ovl_cons, build_overload): Delete.
440 * name-lookup.c (add_function, push_overloaded_decl_1,
441 do_nonmember_using_decl, merge_functions, remove_hidden_names):
442 Use lookup_add, ovl_insert.
443 * pt.c (check_explicit_specialization): Use lookup_add.
444 (do_class_deduction): Likewise. Refactor if.
445 * tree.c (lookup_add): Swap args.
446 (ovl_cons, build_overload): Delete.
448 * name-lookup.c (find_local_binding): New, broken out of ...
449 (lookup_name_innermost_nonclass_level_1): ... here. Call it.
450 (set_namespace_binding): Swap scope & name args.
451 (namespace_binding_1): Likewise.
452 (pushdecl_maybe_friend_1): Adjust set_namespace_binding call.
453 (push_overloaded_decl_1): Likewise.
454 (set_global_binding): Likewise.
455 (get_namespace_binding): Adjust namespace_binding_1 call.
457 2017-05-17 Nathan Sidwell <nathan@acm.org>
459 * cp-tree.h (default_hash_traits <lang_identifier *>): New
461 * name-lookup.c (lookup_extern_c_fun_in_all_ns): Delete.
462 (extern_c_fns): New hash table.
463 (check_extern_c_conflict): New, broken out of ...
464 (pushdecl_maybe_friend_1): ... here. Call it.
465 (c_linkage_bindings): Just look in hash table.
467 2017-05-17 Ville Voutilainen <ville.voutilainen@gmail.com>
471 Implement new C++ intrinsics __is_assignable and __is_constructible.
472 * cp-tree.h (CPTK_IS_ASSIGNABLE, CPTK_IS_CONSTRUCTIBLE): New.
474 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
475 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
476 * method.c (constructible_expr): Set cp_unevaluated.
477 (is_xible_helper): New.
478 (is_trivially_xible): Adjust.
480 * parser.c (cp_parser_primary_expression): Handle
481 RID_IS_ASSIGNABLE and RID_IS_CONSTRUCTIBLE.
482 (cp_parser_trait_expr): Likewise.
483 * semantics.c (trait_expr_value): Handle
484 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
486 2017-05-17 Nathan Sidwell <nathan@acm.org>
488 * cp-tree.h (ovl_iterator::using_p): New predicate.
489 (ovl_iterator::remove_node): New worker.
490 (ovl_insert): Declare.
491 * tree.c (ovl_insert): New.
492 (ovl_iterator::remove_node): New.
493 * class.c (add_method): Use ovl_iterator, ovl_insert.
494 (clone_function_decl): Fix description.
495 (clone_constructors_and_destructors): Use ovl_iterator.
497 * class.c (handle_using_decl): Use OVL_FIRST, ovl_iterator.
498 (maybe_warn_about_overly_private_class): Use ovl_iterator.
499 (method_name_cmp, resort_method_name_cmp): Use OVL_NAME.
500 (resort_type_method_vec, finish_struct_methods): Use OVL_FIRST.
501 (get_base_fndecls): Use ovl_iterator.
502 (warn_hidden): Use OVL_NAME, ovl_iterator.
503 (add_implicitly_declared_members): Use ovl_iterator.
504 * constraint.cc (normalize_template_id_expression): Use OVL_FIRST,
506 (finish_shorthand_constraint): Simplify, use ovl_make.
507 * pt.c (make_constrained_auto): Simplify. Use ovl_make.
508 * search.c (shared_member_p): Use ovl_iterator.
509 (lookup_field_fuzzy_info::fuzzy_lookup_fn): Use OVL_NAME.
510 (lookup_conversion_operator): Use OVL_FIRST.
511 (lookup_fnfiels_idx_nolazy): Use OVL_FIRST, OVL_NAME.
512 (look_for_overrides_here): Use ovl_iterator.
513 (lookup_conversions_r): Use OVL_FIRST, OVL_NAME, ovl_iterator.
514 * typeck.c (build_x_unary_op): Use ovl_make.
516 2017-05-17 Martin Liska <mliska@suse.cz>
518 * class.c (dump_class_hierarchy): Introduce dump_flags_t type and
519 use it instead of int type.
520 (dump_vtable): Likewise.
521 (dump_vtt): Likewise.
522 * decl2.c (dump_tu): Likewise.
524 2017-05-16 David Malcolm <dmalcolm@redhat.com>
526 * call.c (enforce_access): Add access_failure_info * param and use
527 it to record access failures.
528 * cp-tree.h (class access_failure_info): New class.
529 (enforce_access): Add access_failure_info * param, defaulting to
531 (lookup_member): Likewise.
532 (locate_field_accessor): New function decl.
533 (perform_or_defer_access_check): Add access_failure_info * param,
535 * search.c (lookup_member): Add access_failure_info * param and
536 pass it on to call to perform_or_defer_access_check.
537 (matches_code_and_type_p): New function.
538 (field_access_p): New function.
539 (direct_accessor_p): New function.
540 (reference_accessor_p): New function.
541 (field_accessor_p): New function.
542 (struct locate_field_data): New struct.
543 (dfs_locate_field_accessor_pre): New function.
544 (locate_field_accessor): New function.
545 * semantics.c (perform_or_defer_access_check): Add
546 access_failure_info * param, and pass it on to call to
548 * typeck.c (access_failure_info::record_access_failure): New method.
549 (access_failure_info::maybe_suggest_accessor): New method.
550 (finish_class_member_access_expr): Pass an access_failure_info
551 instance to the lookup_member call, and call its
552 maybe_suggest_accessor method afterwards.
554 2017-05-16 Marek Polacek <polacek@redhat.com>
558 * cp-gimplify.c (cp_fold): Handle SAVE_EXPR.
560 2017-05-16 Nathan Sidwell <nathan@acm.org>
562 * name-lookup.c (check_local_shadow): New, broke out of ...
563 (pushdecl_maybe_friend_1): ... here. Call it.
565 * cp-tree.h (OVL_NESTED_P, OVL_LOOKUP_P): New.
566 (ovl_first): Move inline definition to end of file.
567 (ovl_make, lookup_add): Declare.
568 (get_fns, get_first_fn): Make pure.
569 * tree.c (ovl_cache): New.
570 (ovl_make, lookup_add): New.
571 * pt.c (do_class_deduction): Don't add candidates that will be
574 * call.c (build_user_type_conversion_1): Use OVL_FIRST.
575 (print_error_for_call_failure): Use OVL_NAME.
576 (build_op_call_1): Use ovl_iterator.
577 (add_candidates): Use OVL_FIRST & lkp_iterator.
578 (build_op_delete_call): Use MAYBE_BASELINK_FUNCTIONS &
580 * class.c (deduce_noexcept_on_destructors): Use ovl_iterator.
581 (type_has_user_nondefault_constructor,
582 in_class_defaulted_default_constructor,
583 type_has_user_provided_constructor,
584 type_has_user_provided_or_explicit_constructor,
585 type_has_non_user_provided_default_constructor,
586 vbase_has_user_provided_move_assign,
587 type_has_move_constructor, type_has_move_assign,
588 type_has_user_declared_move_constructor,
589 type_has_user_declared_move_assign,
590 type_build_ctor_call, type_build_dtor_call,
591 type_requires_array_cookie, explain_non_literal_class): Likewise.
592 (finish_struct): Use lkp_iterator.
593 (resolve_address_of_overloaded_function): Use OVL_NAME, lkp_iterator.
594 (note_name_declared_in_class): Use OVL_NAME.
595 * cxx-pretty-print.c (pp_cxx_unqualified_id): Use OVL_FIRST.
596 (pp_cxx_qualified_id, cxx_pretty_printer::id_expression,
597 cxx_pretty_printer::expression): Likewise.
598 * decl2.c (check_classfn): Use ovl_iterator.
599 * pt.c (retrieve_specialization): Use ovl_iterator.
600 * tree.c (cp_tree_equal): Use lkp_iterator.
601 (type_has_nontrivial_copy_init): Use ovl_iterator.
603 * typeck2.c (cxx_incomplete_type_diagnostic): Revert change and
604 check is_overloaded_fn.
606 2017-05-16 Martin Liska <mliska@suse.cz>
608 * parser.c (cp_lexer_print_token): Add default value for flags
609 argument of print_gimple_stmt, print_gimple_expr,
610 print_generic_stmt and print_generic_expr.
612 2017-05-16 Nathan Sidwell <nathan@acm.org>
614 * cp-tree.h (class ovl_iterator, class lkp_iterator): New OVERLOAD
616 (MAYBE_BASELINK_FUNCTIONS): New.
617 * constraint.cc (resolve_constraint_check): Use lkp_iterator.
618 * decl2.c (maybe_warn_sized_delete): Use ovl_iterator.
619 * lambda.c (maybe_generic_this_capture): Use lkp_iterator.
620 * method.c (inherited_ctor_binfo): Use ovl_iterator.
621 (binfo_inherited_from): Likewise.
622 * parser.c (lookup_literal_operator): Use lkp_iterator.
623 * pt.c (iterative_hash_template_arg): Use lkp_iterator.
624 (print_candidates_1): Likewise.
625 (determine_specialization): Likewise.
626 (resolve_overloaded_unification): Likewise.
627 (resolve_nondeduced_context): Likewise.
628 (type_dependent_expression_p): Likewise.
629 (dependent_template_p): Likewise.
630 * ptree.c (cxx_print_xnode): Likewise.
631 * semantics.c (omp_reduction_lookup): Use lkp_iterator.
632 (classtype_has_nothrow_assign_or_copy_p): Use ovl_iterator.
633 * typeck.c (check_template_keyword): Use lkp_iterator.
635 * cp-tree.h (OVL_FIRST, OVL_NAME): New.
637 * constexpr.c (function_concept_check): Use OVL_FIRST.
638 * cvt.c (build_expr_type_conversion): Likewise.
639 * decl.c (poplevel, grokdeclarator): Use OVL_NAME.
640 * decl2.c (mark_used): Use OVL_FIRST.
641 * error.c (dump_decl): Use OVL_FIRST, OVL_NAME.
642 (dump_expr, location_of): Use OVL_FIRST.
643 * friend.c (do_friend): Use OVL_NAME.
644 * init.c (build_offset_ref): Use OVL_FIRST.
645 * mangle.c (write_member_name): Likewise.
646 (write_expression): Use OVL_NAME.
647 * method.c (strip_inheriting_ctors): Use OVL_FIRST.
648 * name-lookup.c (pushdecl_class_level): Use OVL_NAME.
649 * pt.c (check_explicit_specialization): Use OVL_FIRST.
650 (check_template_shadow): Likewise.
651 (tsubst_template_args): Use OVL_NAME.
652 (tsubst_baselink): Use OVL_FIRST.
653 * semantics.c (perform_koenig_lookup): Use OVL_NAME.
654 * tree.c (get_first_fn): Use OVL_FIRST.
655 * typeck.c (finish_class_member_access_expr): Use OVL_NAME.
656 (cp_build_addr_expr_1): Use OVL_FIRST.
658 * pt.c (tsubst_copy_and_build): Remove unnecessary COMPONENT_REF
660 * semantics.c (finish_id_expression): Directly init local var.
661 (finish_omp_reduction_clause): Use really_overloaded_fn.
662 * tree.c (get_fns): Document. Assert we got an overload.
663 (get_first_fn) Document.
664 * typeck.c (cp_build_addr_expr_1): Pass arg directly to
665 really_overloaded_fn.
666 * typeck2.c (cxx_incomplete_type_diagnostic): Use get_first_fn directly.
668 * cp-tree.h (SCOPE_DEPTH): New.
669 * name-lookup.h (is_nested_namespace): Declare.
670 * name-lookup.c (is_nested_namespace): New.
671 (is_ancestor): Use it.
672 (set_decl_namespace): Likewise.
673 (push_namespace): Set SCOPE_DEPTH.
674 * pt.c (check_specialization_namespace): Use is_nested_namespace.
675 (check_unqualigied_spec_or_inst): Likewise.
677 2017-05-15 Nathan Sidwell <nathan@acm.org>
680 * cp-tree.h (DECL_NAMESPACE_INLINE_P): New.
681 * name-lookup.h (push_namespace): Return int, add make_inline arg.
682 * name-lookup.c (push_namespace): Deal with inline directly.
684 * parser.c (cp_parser_namespace_definition): Adjust for
685 push_namespace change.
687 2017-05-11 Nathan Sidwell <nathan@acm.org>
689 * cp-lang.c (get_global_decls, cxx_pushdecl, LANG_HOOK_GETDECLS,
690 LANG_HOOKS_PUSHDECL): Move to ...
691 * cp-objcp-common.c (cp_get_global_decls, cp_pushdec,
692 LANG_HOOK_DECLS, LANG_HOOKS_PUSHDECL): ... here.
693 * cp-objcp-common.h (cp_get_global_decls, cp_pushdecl): Declare.
695 * name-lookup.h (pushdecl): Add default friend parm.
696 (pushdecl_maybe_friend): Delete.
697 (pushdecl_top_level): Add default friend parm.
698 (pushdecl_top_level_maybe_friend): Delete.
699 * name-lookup.c (pushdecl_maybe_friend): Delete.
700 (pushdecl): Add is_friend parm.
701 (pushdecl_top_level): Add is friend_parm.
702 (pushdecl_top_level_maybe_friend, pushdecl_top_level_1): Delete.
703 (pushdecl_top_level_and_finish): Do pushing and finishing directly.
704 * friend.c (do_friend): Adjust.
705 * pt.c (tsubst_friend_class): Adjust.
707 Revert pushdecl_top_level_and_finish name change.
708 * name-lookup.h (pushdecl_top_level_and_finish): Resurrect old name.
709 * name-lookup.c (pushdecl_top_level_and_finish): Likewise.
710 * decl.c (cp_make_fname_decl): Adjust.
711 * decl2.c (get_guard, handle_tls_init): Adjust.
712 * rtti.c (get_tinfo_decl, tinfo_base_init): Adjust.
714 * name-lookup.c (pushdecl_outermost_localscope): Always
715 conditionally stop timer.
717 * decl.c (xref_tag_1): Don't frob ts_lambda scope here.
718 * name-lookup.c (pushtag_1): Deal with ts_lambda scope.
720 * cp-tree.h (pushdecl, pushdecl_maybe_friend, pushtag,
721 pushtag_top_level_maybe_friend,
722 pushdecl_top_level_and_finish): Move declarations to ...
723 * name-lookup.h: ... here. Group pushdecl variants.
724 (pushdecl_top_level_and_finish): Rename to ...
725 (pushdecl_top_level_with_init): ... here.
726 * decl.c (cp_make_fname_decl): Use pushdecl_top_level_with_init.
727 * decl2.c (get_guard, handle_tls_init): Likewise.
728 * rtti.c (get_tinfo_decl, tinfo_base_init): Likewise.
729 * lambda.c (maybe_add_lambda_conv_op): Use namespace_bindings_p.
730 * method.c (implicitly_declare_fn): Likewise.
731 * searchc (node_debug_info_needed): Likewise.
732 * name-lookup.c (pushdecl_top_level_and_finish): Rename to ...
733 (pushdecl_top_level_with_init): ... here.
734 (pop_everything): Use namespace_bindings_p.
736 * name-lookup.h (pop_binding): Rename to pop_local_binding.
737 (getdecls): Rename to get_local_decls.
738 * name-lookup.c (pop_binding): Rename to ...
739 (pop_local_binding): ... here.
740 (pop_bindings_and_leave_scope): Adjust.
741 (getdecls): Rename to ...
742 (get_local_decls): ... here. Assert local scope.
743 * decl.c (poplevel): Assert not namespace. Adjust and simplify
745 (store_parm_decls): Adjust get_local_decls call.
746 (parser.c (synthesize_implicit_template_parm): Likewise.
748 2017-05-11 Ville Voutilainen <ville.voutilainen@gmail.com>
751 * method.c (is_trivially_xible): Reject void types.
753 2017-05-10 Nathan Sidwell <nathan@acm.org>
755 * class.c (handle_using_decl): Always use OVL_CURRENT.
756 (resolve_address_of_overloaded_function): Move iterator decl into
757 for scope. Don't strip anticipated decls here.
759 * pt.c (print_candidates_1): Separate TREE_LIST and OVERLOAD
761 (print_candidates): Adjust.
763 * cp-tree.h (build_new_function_call): Lose koenig_p arg. Fix
765 * call.c (build_new_function_call): Lose koenig_p arg. Remove
766 koenig_p handling here.
767 * pt.c (push_template_decl_real): Unconditionally retrofit_lang_decl.
768 (tsubst_omp_clauses): Likewise.
769 (do_class_deduction): Adjust buld_new_function_call calls.
770 * semantics.c (finish_call_expr): Likewise.
772 2017-05-10 Jason Merrill <jason@redhat.com>
774 * pt.c (unify_parameter_deduction_failure, unify_cv_qual_mismatch)
775 (unify_type_mismatch, unify_parameter_pack_mismatch)
776 (unify_ptrmem_cst_mismatch, unify_expression_unequal)
777 (unify_parameter_pack_inconsistent, unify_inconsistency)
778 (unify_vla_arg, unify_method_type_error, unify_arity)
779 (unify_arg_conversion, unify_no_common_base)
780 (unify_inconsistent_template_template_parameters)
781 (unify_template_deduction_failure)
782 (unify_template_argument_mismatch)
783 (unify_overload_resolution_failure): Call unify_invalid.
785 CWG 1847 - Clarifying compatibility during partial ordering
786 * pt.c (more_specialized_fn): No order between two non-deducible
789 * pt.c (dependent_type_p): Make sure we aren't called with
792 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
793 * pt.c (convert_template_argument): Just return an argument pack.
794 (coerce_template_parameter_pack, template_parm_to_arg)
795 (extract_fnparm_pack, make_argument_pack, tsubst_template_args)
796 (tsubst_decl, tsubst, type_unification_real, unify_pack_expansion):
797 Don't set the type of a NONTYPE_ARGUMENT_PACK.
798 * parser.c (make_char_string_pack, make_string_pack): Likewise.
800 2017-05-10 Nathan Sidwell <nathan@acm.org>
802 * cp-tree.h (add_method, clone_function_decl): Change last arg to
804 * class.c (add_method): Change third arg to bool. Adjust.
805 (one_inheriting_sig, one_inherited_ctor): Adjust.
806 (clone_function_decl): Change 2nd arg to bool. Adjust.
807 (clone_constructors_and_destructors): Adjust.
808 * lambda.c (maybe_add_lambda_conv_op): Adjust.
809 * method.c (lazily_declare_fn): Adjust.
810 * pt.c (tsubst_decl, instantiate_template_1): Adjust.
811 * semantics.c (finish_member_declaration): Adjust.
813 2017-05-10 Paolo Carlini <paolo.carlini@oracle.com>
816 * decl.c (finish_function): To improve error recovery, change the
817 logic for calling apply_deduced_return_type.
819 2017-05-09 Jason Merrill <jason@redhat.com>
821 PR c++/80605 - __is_standard_layout and empty base
822 * class.c (check_bases): Ignore empty bases.
824 PR c++/70979 - literal class and closure types
825 * class.c (finalize_literal_type_property): Handle closures
827 (explain_non_literal_class): Likewise.
829 PR c++/66297, DR 1684 - literal class and constexpr member fns
830 * constexpr.c (is_valid_constexpr_fn): Only complain about
831 non-literal enclosing class in C++11.
832 * class.c (finalize_literal_type_property): Likewise.
834 2017-05-09 Paolo Carlini <paolo.carlini@oracle.com>
837 * pt.c (tsubst_decl): Early return error_mark_node if
838 grok_ctor_properties returns false.
840 2017-05-09 Jason Merrill <jason@redhat.com>
842 PR c++/70167 - array prvalue treated as lvalue
843 * cp-tree.h (CONSTRUCTOR_C99_COMPOUND_LITERAL): New.
845 * semantics.c (finish_compound_literal): Add fcl_context parameter.
846 Only make a static variable for C99 syntax.
847 * parser.c (cp_parser_postfix_expression): Pass it.
848 * pt.c (tsubst_copy_and_build): Likewise.
849 * call.c (extend_ref_init_temps): Set
850 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
852 2017-05-09 Nathan Sidwell <nathan@acm.org>
854 * cp-lang.c (get_global_decls, cxx_pushdecl): New.
855 (LANG_HOOKS_GETDECLS, LANG_HOOKS_PUSHDECL): Override.
856 * name-lookup.h (pushdecl_top_level): Declare.
858 2017-05-08 Jason Merrill <jason@redhat.com>
860 PR c++/80178 - parameter passing for uncopyable classes
861 * tree.c (type_has_nontrivial_copy_init): True for classes with only
862 deleted copy/move ctors.
863 (remember_deleted_copy, maybe_warn_parm_abi): New.
864 * decl.c (require_complete_types_for_parms, check_function_type):
865 Call maybe_warn_parm_abi.
866 * call.c (convert_for_arg_passing, build_cxx_call): Likewise.
868 2017-05-08 Nathan Sidwell <nathan@acm.org>
870 * decl.c (builtin_function_1): Set DECL_ANTICIPATED before pushing.
871 (start_preparsed_function): Do decl pushing before setting
872 current_funciton_decl and announcing it.
874 * name-lookup.h (pushdecl_with_scope): Replace with ...
875 (pushdecl_outermost_localscope): ... this.
876 * name-lookup.c (pushdecl_with_scope): Replace with ...
877 (pushdecl_outermost_localscope): ... this.
878 (pushdecl_namespace_level): Adjust.
879 * decl.c (cp_make_fname_decl): Use pushdecl_outermost_localscope.
880 * lambda.c (insert_capture_proxy): Likewise.
882 * class.c (build_vtbl_initializer): Don't shadow outer variable
885 Revert _binding -> _value change.
886 * name-lookup.h (get_namespace_value, set_global_value): Rename to ...
887 (get_namespace_binding, set_global_binding): ... these.
888 * name-lookup.c (get_namespace_value, set_global_value): Rename to ...
889 (get_namespace_binding, set_global_binding): ... these.
890 (arg_assoc_namespace, pushdecl_maybe_friend_1,
891 check_for_out_of_scope_variable, push_overloaded_decl_1,
892 lookup_name_innermost_nonclass_level, push_namespace): Adjust.
893 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
894 SET_IDENTIFIER_GLOBAL_VALUE): Adjust.
895 * decl.c (poplevel): Adjust.
896 * pt.c (make_constrained_auto): Likewise.
898 2017-05-07 Volker Reichelt <v.reichelt@netcologne.de>
901 * call.c (print_z_candidate): Fix quoting.
903 2017-05-05 David Malcolm <dmalcolm@redhat.com>
905 * error.c (pedwarn_cxx98): Replace report_diagnostic
906 with diagnostic_report_diagnostic.
908 2017-05-05 Nathan Sidwell <nathan@acm.org>
910 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value.
911 (SET_IDENTIFIER_GLOBAL_VALUE): Use set_global_value.
912 (IDENTIFIER_NAMESPACE_VALUE): Delete.
913 * name-lookup.h (namespace_binding, set_namespace_binding): Replace
915 (get_namespace_value, set_global_value): ... these.
916 (get_global_value_if_present, is_typename_at_global_scope): Delete.
917 * decl.c (poplevel): Use get_namespace_value.
918 (grokdeclarator): Use IDENTIFIER_GLOBAL_VALUE.
919 * class.c (build_vtbl_initializer): Stash library decl in
920 static var. Use IDENTIFIER_GLOBAL_VALUE.
921 * except.c (do_get_exception_ptr, do_begin_catch, do_end_catch,
922 do_allocate_exception, do_free_exception, build_throw): Likewise.
923 * init.c (throw_bad_array_new_length): Likewise.
924 * rtti.c (throw_bad_cast, throw_bad_typeid): Likewise.
925 * name-lookup.c (arg_assoc_namespace, pushdecl_maybe_friend_1,
926 check_for_our_of_scope_variable, push_overloaded_decl_1): Use
928 (set_namespace_binding_1): Rename to
929 (set_namespace_binding): ... here.
930 (set_global_value): New.
931 (lookup_name_innermost_nonclass_level_1, push_namespace): Use
933 * pt.c (listify): Use get_namespace_value.
935 * call.c (make_temporary_var_for_ref_to_temp): Push decl into
937 * lex.c (unqualified_name_lookup_error): Likewise.
939 * class.c (alter_class): Use retrofit_lang_decl directly.
940 * decl.c (push_local_name, dupliate_decls): Likewise.
941 * semantics.c (omp_privatize_field): Likewise.
943 Kill walk_namespaces.
944 * cp-tree.h (walk_namespaces_fn, walk_namespaces): Delete.
945 * decl.c (walk_namespaces_r, walk_namespaces): Delete.
947 Kill per-namespace static_decls.
948 * cp-tree.h (static_decls): Declare.
949 (wrapup_globals_for_namespace,
950 diagnose_inline_vars_for_namespace): Replace with ...
951 (wrapup_namespace_globals): ... this.
952 * decl.c (static_decls): Define.
953 (wrapup_globals_for_namespace,
954 diagnose_inline_vars_for_namespace): Replace with ...
955 (wrapup_namespace_globals): ... this.
956 (cxx_init_decl_processing): Initialize static_decls.
957 * decl2.c (c_parse_final_cleanups): Adjust.
958 * name-lookup.h (cp_binding_level): Remove static_decls member.
959 * name-lookup.c (add_decl_to_level): Adjust.
960 (begin_scope): Adjust.
962 2017-05-05 Paolo Carlini <paolo.carlini@oracle.com>
965 * decl.c (reshape_init): Unconditionally return error_mark_node
966 upon error about too many initializers.
968 2017-05-04 Nathan Sidwell <nathan@acm.org>
970 * constraint.cc (diagnose_check_constraint): Fix %E thinko.
972 2017-05-04 Martin Sebor <msebor@redhat.com>
975 * call.c (print_z_candidate): Add missing quoting to %D and other
977 (build_op_call_1): Same.
978 * constraint.cc (diagnose_check_constraint): Same.
979 * mangle.c (mangle_decl): Same.
980 * name-lookup.c (cp_binding_level_debug): Same.
981 (set_decl_namespace): Same.
982 * parser.c (cp_parser_tx_qualifier_opt): Same.
983 * pt.c (print_candidates_1): Same.
984 (check_template_variable): Same.
985 (tsubst_default_argument): Same.
986 (most_specialized_partial_spec): Same.
987 * semantics.c (omp_reduction_lookup): Same.
988 * tree.c (check_abi_tag_redeclaration): Same.
989 * typeck.c (comptypes): Same.
990 * typeck2.c (abstract_virtuals_error_sfinae): Same.
992 2017-05-04 Nathan Sidwell <nathan@acm.org>
995 * cp-tree.h (enum cp_tree_index): Add CPTI_GLOBAL,
996 CPTI_GLOBAL_TYPE, CPTI_GLOBAL_IDENTIFIER, CPTI_ANON_IDENTIFIER,
997 CPTI_INIT_LIST_IDENTIFIER.
998 (global_namespace, global_type_node, global_identifier,
999 anon_identifier, init_list_identifier): New.
1000 * decl.c (global_type_node, global_scope_name): Delete.
1001 (initialize_predefined_identifiers): Add new identifiers.
1002 (cxx_init_decl_processing): Adjust.
1003 * name-lookup.h (global_namespace, global_type_node): Delete.
1004 * name-lookup.c (global_namespace, anonymous_namespace_name,
1005 get_anonymous_namespace_name): Delete.
1006 (namespace_scope_ht_size, begin_scope, pushtag_1,
1007 push_namespace): Adjust,
1008 * call.c (type_has_extended_temps): Use init_list_identifier.
1009 * pt.c (listify): Likewise.
1011 * name-lookup.c: Reorder functions to make merging from modules
1014 2017-05-03 Jason Merrill <jason@redhat.com>
1016 * constexpr.c (cxx_eval_outermost_constant_expr): Use TV_CONSTEXPR.
1018 2017-05-03 Nathan Sidwell <nathan@acm.org>
1020 * cp-tree.h (enum cp_tree_index, cp_global_trees): Move earlier,
1021 along with #defines, to before name-lookup include.
1023 2017-05-02 Paolo Carlini <paolo.carlini@oracle.com>
1025 * pt.c (is_auto_or_concept): Remove.
1026 (type_uses_auto_or_concept): Remove, unused.
1027 (find_parameter_packs_r, extract_autos_r, is_auto_r): Adjust.
1028 * parser.c (tree_type_is_auto_or_concept): Remove, unused.
1029 * cp-tree.h (is_auto_or_concept): Remove.
1031 2017-05-01 Xi Ruoyao <ryxi@stu.xidian.edu.cn>
1034 * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Don't
1035 add pedigree operation and detach call here.
1036 * cp-gimplify.c (cp_gimplify_expr): Remove the calls to
1037 cilk_cp_gimplify_call_params_in_spawned_fn.
1038 (cilk_cp_gimplify_call_params_in_spawned_fn): Remove function.
1039 * semantics.c (simplify_aggr_init_expr): Copy EXPR_CILK_SPAWN.
1041 2017-04-29 Volker Reichelt <v.reichelt@netcologne.de>
1043 * parser.c (cp_parser_member_declaration): Add fix-it hints for
1044 stray comma and missing semicolon at end of member declaration.
1046 2017-04-27 Volker Reichelt <v.reichelt@netcologne.de>
1048 * parser.c (cp_parser_cast_expression): Add target type of cast to
1050 * error.c (type_to_string): Add '{enum}' suffix to enumeration types.
1052 2017-04-26 Paolo Carlini <paolo.carlini@oracle.com>
1054 * decl.c (grok_ctor_properties, ambi_op_p, unary_op_p): Change
1055 return type to bool.
1056 * cp-tree.h (grok_ctor_properties): Update.
1058 2017-04-26 Volker Reichelt <v.reichelt@netcologne.de>
1060 * parser.c (cp_parser_nested_name_specifier_opt): Add fix-it
1061 information to diagnostic of invalid colon in nested-name-specifier.
1063 2017-04-25 Volker Reichelt <v.reichelt@netcologne.de>
1065 * parser.c (cp_parser_elaborated_type_specifier): Add fix-it to
1066 diagnostic of invalid class/struct keyword after enum.
1068 2017-04-25 David Malcolm <dmalcolm@redhat.com>
1070 * parser.c (cp_parser_member_declaration): Add fix-it hint
1071 for removing stray semicolons.
1073 2017-04-25 David Malcolm <dmalcolm@redhat.com>
1075 * name-lookup.c (get_std_name_hint): New function.
1076 (maybe_suggest_missing_header): New function.
1077 (suggest_alternative_in_explicit_scope): Call
1078 maybe_suggest_missing_header.
1080 2017-04-25 David Malcolm <dmalcolm@redhat.com>
1083 * name-lookup.c (suggest_alternative_in_explicit_scope): Convert
1084 candidate type of bm from tree to const char *.
1085 (consider_binding_level): Likewise.
1086 (lookup_name_fuzzy): Likewise, using this to merge the best
1087 result from the preprocessor into bm, rather than immediately
1088 returning, so that better matches from reserved words can "win".
1089 Guard the rejection of keywords that don't start decl-specifiers
1090 so it only happens for FUZZY_LOOKUP_TYPENAME.
1092 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
1094 * decl.c (grokdeclarator): Use %qT instead of %<%T%> in diagnostics.
1095 (start_enum): Likewise.
1096 (build_enumerator): Likewise. Use %qE instead of plain %E.
1097 * parser.c (cp_parser_mem_initializer_list): Use %qD instead of
1098 %<%D%> in diagnostics.
1099 (cp_parser_elaborated_type_specifier): Likewise.
1100 * pt.c (make_pack_expansion): Use %qT and %qE instead of
1101 %<%T%> and %<%E%> in diagnostics.
1102 (tsubst_pack_expansion): Likewise.
1104 2017-04-24 David Malcolm <dmalcolm@redhat.com>
1107 * parser.c (cp_parser_unary_expression): Generate a location
1108 range for alignof and sizeof expressions.
1110 2017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
1112 * parser.c (cp_parser_cv_qualifier_seq_opt): Add fix-it info to
1114 (cp_parser_virt_specifier_seq_opt): Likewise.
1115 (set_and_check_decl_spec_loc): Likewise twice.
1117 2017-04-21 Jason Merrill <jason@redhat.com>
1119 PR c++/80179 - ICE with initialized flexible array member.
1120 * constexpr.c (verify_ctor_sanity): Handle flexible array members.
1122 2017-04-21 Richard Biener <rguenther@suse.de>
1124 * cp-tree.h (copy_decl): Annotate with CXX_MEM_STAT_INFO.
1125 (copy_type): Likewise.
1126 * lex.c (copy_decl): Pass down mem-stat info.
1127 (copy_type): Likewise.
1129 2017-04-20 Jonathan Wakely <jwakely@redhat.com>
1132 * init.c (build_new_1): Suppress notes about over-aligned new when
1133 the warning is suppressed.
1135 2017-04-20 Volker Reichelt <v.reichelt@netcologne.de>
1137 * parser.c (cp_parser_member_declaration): Add warning with fixit
1138 information for extra semicolon after in-class function definition.
1140 2017-04-20 Jakub Jelinek <jakub@redhat.com>
1143 * tree.c (build_cplus_array_type): Call build_array_type
1144 with the intended TYPE_TYPELESS_STORAGE flag value, instead
1145 of calling build_array_type and modifying later TYPE_TYPELESS_STORAGE
1148 2017-04-18 Marek Polacek <polacek@redhat.com>
1150 PR c++/80244 - ICE with attribute in template alias.
1151 * tree.c (strip_typedefs): Handle UNDERLYING_TYPE.
1153 PR c++/80241 - ICE with alignas pack expansion.
1154 * error.c (dump_expr): Handle TREE_LIST.
1155 * parser.c (cp_parser_std_attribute_list): Return error_mark if
1156 make_pack_expansion returns an error.
1158 2017-04-17 Bernd Edlinger <bernd.edlinger@hotmail.de>
1161 * class.c (fixup_may_alias): Fix all type variants.
1163 2017-04-17 Jason Merrill <jason@redhat.com>
1165 PR c++/80415 - wrong error with default arg and array reference.
1166 * tree.c (lvalue_kind): Return clk_class for an array prvalue.
1168 * pt.c (tsubst_init): Set TARGET_EXPR_DIRECT_INIT_P.
1170 2017-04-15 Alexandre Oliva <aoliva@redhat.com>
1172 * decl.c (name_unnamed_type): Split out of...
1173 (grokdeclarator): ... this.
1174 * decl.h (name_unnamed_type): Declare.
1176 2017-04-12 Richard Biener <rguenther@suse.de>
1177 Bernd Edlinger <bernd.edlinger@hotmail.de>
1180 * tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
1181 for arrays of character or std::byte type.
1183 2017-04-11 Jason Merrill <jason@redhat.com>
1185 PR c++/80294 - ICE with constexpr and inheritance.
1186 * constexpr.c (reduced_constant_expression_p):
1187 A null constructor element is non-constant.
1188 (cxx_eval_indirect_ref): Don't VERIFY_CONSTANT before
1189 returning an empty base.
1191 2017-04-11 Jakub Jelinek <jakub@redhat.com>
1194 * decl.c (cp_finish_decomp): If processing_template_decl on
1195 non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't
1196 change their DECL_VALUE_EXPR nor cp_finish_decl them. Instead make
1197 sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst
1199 * pt.c (value_dependent_expression_p) <case VAR_DECL>: For variables
1200 with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
1203 2017-04-11 Jakub Jelinek <jakub@redhat.com>
1206 * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.
1208 2017-04-10 Jakub Jelinek <jakub@redhat.com>
1211 * tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
1212 operand, if it is a static member function, recurse on the
1215 2017-04-10 Marek Polacek <polacek@redhat.com>
1218 * typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL. Set
1219 ORIG_TYPE earlier and not only when shortening.
1221 2017-04-07 Jason Merrill <jason@redhat.com>
1223 PR c++/80356 - ICE with reference to function template argument.
1225 * pt.c (convert_nontype_argument_function): Adjust type even with a
1226 value-dependent argument.
1228 PR c++/80267 - ICE with nested capture of reference
1230 * pt.c (tsubst_copy): Handle lookup finding a capture proxy.
1232 2017-04-07 Marek Polacek <polacek@redhat.com>
1235 * typeck.c (cp_build_binary_op): Convert COP[01] to ORIG_TYPE.
1238 * call.c (build_over_call): Don't check cxx_dialect.
1239 * cp-gimplify.c (cp_gimplify_init_expr): Don't check cxx_dialect nor
1240 whether SUB is a CONSTRUCTOR.
1241 * init.c (build_new_1): Don't check cxx_dialect.
1242 * tree.c (replace_placeholders): Add a function comment. Return if
1243 not in C++14, or if the object isn't a (member of a) class.
1244 * typeck2.c (store_init_value): Don't check cxx_dialect nor whether
1245 TYPE is CLASS_TYPE_P.
1247 2017-04-05 Jakub Jelinek <jakub@redhat.com>
1250 * pt.c (canonical_type_parameter): Use vec_safe_grow_cleared instead
1251 of a loop doing vec_safe_push of NULL. Formatting fixes.
1252 (rewrite_template_parm): Copy TEMPLATE_PARM_PARAMETER_PACK from oldidx
1253 to newidx before calling canonical_type_parameter on newtype.
1255 2017-04-04 Volker Reichelt <v.reichelt@netcologne.de>
1258 * cxx-pretty-print.c (cxx_pretty_printer::expression): Add
1259 UNARY_PLUS_EXPR case.
1261 2017-04-03 Jason Merrill <jason@redhat.com>
1263 * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
1265 2017-04-03 Jonathan Wakely <jwakely@redhat.com>
1267 * class.c (update_vtable_entry_for_fn): Fix typo in comment.
1268 * decl2.c (one_static_initialization_or_destruction): Likewise.
1269 * name-lookup.c (store_bindings): Likewise.
1270 * parser.c (make_call_declarator): Likewise.
1271 * pt.c (check_explicit_specialization): Likewise.
1273 2017-04-03 Jason Merrill <jason@redhat.com>
1275 PR sanitizer/79993 - ICE with VLA initialization from string
1276 PR c++/69487 - wrong VLA initialization from string
1277 * init.c (finish_length_check): Split out from build_vec_init.
1278 (build_vec_init): Handle STRING_CST.
1279 * typeck2.c (split_nonconstant_init): Handle STRING_CST.
1280 (digest_init_r): Don't give a STRING_CST VLA type.
1282 2017-03-31 Jakub Jelinek <jakub@redhat.com>
1285 * cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
1286 REFERENCE_TYPE. Adjust ubsan_maybe_instrument_reference caller
1287 for NOP_EXPR to REFERENCE_TYPE.
1290 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
1291 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
1293 * semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
1294 Remove extraneous parens.
1295 (finish_trait_expr): Handle CPTK_IS_AGGREGATE.
1296 * parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
1297 (cp_parser_trait_expr): Likewise.
1299 2017-03-27 Jakub Jelinek <jakub@redhat.com>
1302 * cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
1303 * typeck.c (cxx_mark_addressable): Likewise. Look through
1304 VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
1306 (cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
1308 2017-03-24 Jason Merrill <jason@redhat.com>
1310 PR c++/77339 - ICE with invalid use of alias template.
1311 * pt.c (lookup_template_class_1): Don't try to enter the scope of an
1314 2017-03-24 Marek Polacek <polacek@redhat.com>
1317 * cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
1318 doesn't have side effects.
1320 2017-03-23 Jason Merrill <jason@redhat.com>
1322 PR c++/80150 - ICE with overloaded variadic deduction.
1323 * pt.c (try_one_overload): Remove asserts.
1325 PR c++/77563 - missing ambiguous conversion error.
1326 * call.c (convert_like_real): Use LOOKUP_IMPLICIT.
1328 2017-03-23 Marek Polacek <polacek@redhat.com>
1330 * cp-tree.h: Remove a C_RID_YYCODE reference.
1332 2017-03-22 Jakub Jelinek <jakub@redhat.com>
1335 * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
1336 case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
1337 processing_template_decl.
1339 2017-03-21 Paolo Carlini <paolo.carlini@oracle.com>
1342 * name-lookup.c (pushtag_1): Add check for bogus, non template,
1343 std::initializer_list.
1345 2017-03-21 Jakub Jelinek <jakub@redhat.com>
1348 * init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.
1350 2017-03-21 Ville Voutilainen <ville.voutilainen@gmail.com>
1353 * init.c (std_placement_new_fn_p): New.
1354 (build_new_1): Call it.
1356 2017-03-20 Jason Merrill <jason@redhat.com>
1358 PR c++/80096 - ICE with C++17 non-type auto.
1359 * pt.c (tsubst): Delay tsubst of type of template non-type
1362 PR c++/79519 - ICE with deleted template friend.
1363 * decl.c (grokdeclarator): Complain about misplaced function
1364 definition using =, as well.
1366 PR c++/79640 - infinite recursion with generic lambda.
1367 * pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
1368 before substituting its initializer.
1370 2017-03-20 Marek Polacek <polacek@redhat.com>
1371 Paolo Carlini <paolo.carlini@oracle.com>
1373 PR c++/80059 - ICE with noexcept and __transaction_atomic
1374 * except.c (build_must_not_throw_expr): Call
1375 instantiate_non_dependent_expr.
1377 2017-03-19 Jason Merrill <jason@redhat.com>
1379 PR c++/80084 - wrong C++17 decomposition by reference of parameter.
1380 * decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
1381 reference decomposition.
1383 PR c++/80077 - error with constexpr and -fno-elide-constructors.
1384 * constexpr.c (cxx_eval_call_expression): Set ctx->call while
1385 expanding trivial constructor.
1387 2017-03-17 Jason Merrill <jason@redhat.com>
1389 PR c++/78345 - ICE initializing array from lambda.
1390 * init.c (build_aggr_init): Check array initializer.
1391 (build_vec_init): Check the type of a CONSTRUCTOR.
1393 PR c++/80073 - C++17 ICE with virtual base.
1394 * decl.c (xref_basetypes): Also check for indirect vbases.
1396 2017-03-16 Jason Merrill <jason@redhat.com>
1398 * decl.c (start_enum): std::byte aliases anything.
1401 * constexpr.c (lookup_placeholder): Tweak.
1403 2017-03-15 Jason Merrill <jason@redhat.com>
1405 PR c++/80043 - ICE with -fpermissive
1406 * typeck.c (convert_for_assignment): Handle instantiate_type
1407 not giving an error.
1409 2017-03-14 Nathan Sidwell <nathan@acm.org>
1411 PR c++/79393 DR 1658 workaround
1412 * method.c (synthesized_method_base_walk): Inihibit abstract class
1413 virtual base access check here.
1414 (synthesized_method_walk): Not here.
1416 2017-03-13 Nathan Sidwell <nathan@acm.org>
1418 PR c++/79393 DR 1658 workaround
1419 * method.c (synthesized_method_walk): Check vbases of abstract
1420 classes for dtor walk.
1422 2017-03-10 David Malcolm <dmalcolm@redhat.com>
1424 PR translation/79848
1425 * decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
1427 2017-03-10 Jason Merrill <jason@redhat.com>
1429 PR c++/79960 - alias templates and partial ordering
1430 * pt.c (comp_template_args): Add partial_order parm.
1431 (template_args_equal): Likewise.
1432 (comp_template_args_porder): New.
1433 (get_partial_spec_bindings): Use it.
1435 2017-03-10 Marek Polacek <polacek@redhat.com>
1438 * decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
1440 2017-03-10 Jakub Jelinek <jakub@redhat.com>
1443 * optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
1444 Use XALLOCAVEC macro.
1447 * decl.c (finish_enum_value_list): If value is error_mark_node,
1448 don't copy it and change its type.
1449 * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
1450 of CONST_DECL is error_mark_node.
1452 2017-03-09 Marek Polacek <polacek@redhat.com>
1454 PR c++/79900 - ICE in strip_typedefs
1455 * tree.c (strip_typedefs): Skip the attribute handling if T is
1456 a variant type which hasn't been updated yet.
1458 PR c++/79687 - wrong code with pointer-to-member
1459 * init.c (constant_value_1): Break if the variable has a dynamic
1462 2017-03-08 Jason Merrill <jason@redhat.com>
1464 PR c++/79797 - ICE with self-reference in array DMI.
1465 * constexpr.c (lookup_placeholder): Split out...
1466 (cxx_eval_constant_expression): ...from here.
1468 2017-03-07 Jakub Jelinek <jakub@redhat.com>
1471 * parser.c (cp_parser_omp_cancellation_point,
1472 cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
1473 cp_parser_omp_target_update): Change "may only be used in compound
1474 statements" diagnostics, such that the same translatable string is
1475 used for all pragmas.
1476 (cp_parser_pragma): Likewise. Use error_at instead of
1477 cp_parser_error for that diagnostics.
1479 2017-03-06 Marek Polacek <polacek@redhat.com>
1481 PR c++/79796 - ICE with NSDMI and this pointer
1482 * call.c (build_over_call): Handle NSDMI with a 'this' by calling
1483 replace_placeholders.
1485 2017-03-06 Jakub Jelinek <jakub@redhat.com>
1488 * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
1491 2017-03-06 Jason Merrill <jason@redhat.com>
1493 Revert "Allow deduction guides to look into primary template."
1494 * cp-tree.h, parser.c, pt.c, search.c: Revert.
1496 2017-03-05 Paolo Carlini <paolo.carlini@oracle.com>
1499 * except.c (build_must_not_throw_expr): Perform the implicit
1500 conversions on the condition.
1502 2017-03-03 Jason Merrill <jason@redhat.com>
1504 * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
1507 Core issues 2273 and 2277
1508 * call.c (joust): Adjust using-declaration tiebreaker to handle
1509 the intermediate base case.
1510 * method.c (strip_inheriting_ctors): Just return the argument if
1511 !flag_new_inheriting_ctors.
1513 2017-03-03 Richard Biener <rguenther@suse.de>
1516 * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
1518 2017-03-03 Marek Polacek <polacek@redhat.com>
1521 * typeck.c (string_conv_p): In C++11, always call pedwarn with
1524 2017-03-02 Jason Merrill <jason@redhat.com>
1526 Update overload resolution with deduction guides.
1527 * pt.c (do_class_deduction): Always build the copy guide.
1528 (copy_guide_p, template_guide_p): New.
1529 (build_deduction_guide): Remember the original constructor.
1530 * call.c (joust): Prefer the copy guide and non-template guides.
1532 Allow deduction guides to look into primary template.
1533 * cp-tree.h (struct saved_scope): Add deduction_guide_type.
1534 (struct cp_decl_specifier_seq): Add constructor_p.
1535 * parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
1536 (cp_parser_init_declarator): Check it. Set ctor_dtor_or_conv_p.
1537 Clear deduction_guide_type. Don't handle deduction guide names.
1538 (cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
1539 (cp_parser_direct_declarator): Likewise. Handle deduction guides.
1540 (cp_parser_member_declaration, cp_parser_cache_defarg)
1541 (cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
1542 * pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
1543 (build_deduction_guide): Set deduction_guide_type.
1544 (dependent_scope_p): Check deduction_guide_type.
1545 * search.c (lookup_member): Likewise.
1547 2017-03-02 Jakub Jelinek <jakub@redhat.com>
1550 * init.c (mark_exp_read_r): New function.
1551 (emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
1552 whole arguments instead of plain mark_exp_read on TREE_LIST values.
1554 2017-03-01 Jason Merrill <jason@redhat.com>
1556 Class template argument deduction in new-expression
1557 * init.c (build_new): Handle deduction from no initializer.
1558 * parser.c (cp_parser_new_expression): Don't require a single
1559 expression for class template deduction.
1560 * typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
1561 class template placeholder.
1562 * pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
1563 (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
1564 (redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
1566 2017-03-01 Jakub Jelinek <jakub@redhat.com>
1569 * init.c (emit_mem_initializers): When not constructing vbases of
1570 abstract classes, mark arguments as read for
1571 -Wunused-but-set-parameter.
1573 2017-02-28 Jason Merrill <jason@redhat.com>
1575 Class template argument deduction refinements
1576 * call.c (joust): Move deduction guide tiebreaker down.
1577 * decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
1578 deduction with no initializer.
1579 * pt.c (build_deduction_guide): Handle implicit default/copy ctor.
1580 (do_class_deduction): Use that rather than special case.
1581 (do_auto_deduction): Handle null initializer.
1583 2017-02-28 Jakub Jelinek <jakub@redhat.com>
1585 * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
1586 instead of just cond ? "..." : "...".
1587 (grokdeclarator): Likewise.
1588 (build_enumerator): Likewise.
1589 * init.c (build_new_1): Likewise.
1590 * call.c (build_new_method_call_1): Likewise.
1591 * parser.c: Include intl.h.
1592 (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
1593 "enter"/"exit" keyword.
1594 (cp_finalize_oacc_routine): Don't use %s to supply portions of the
1597 2017-02-27 Jason Merrill <jason@redhat.com>
1599 PR c++/71568 - SFINAE forming pointer to member function
1600 * init.c (build_offset_ref): Check the return value of
1601 perform_or_defer_access_check.
1603 2017-02-27 Marek Polacek <polacek@redhat.com>
1605 * decl.c (expand_static_init): Add missing } in a comment.
1607 2017-02-27 Volker Reichelt <v.reichelt@netcologne.de>
1609 * init.c: Include intl.h.
1610 (build_new_1): Move message strings into pedwarn to make them
1611 -Wformat-security friendly. Mark string for translation.
1612 * pt.c (tsubst_copy_and_build): Mark string for translation.
1613 Make the pointer const.
1614 * semantics.c (finish_id_expression): Mark strings for translation.
1616 2017-02-25 Jakub Jelinek <jakub@redhat.com>
1618 * call.c (build_op_delete_call): Make msg1 and msg2 const.
1620 2017-02-24 Jakub Jelinek <jakub@redhat.com>
1623 * call.c (build_over_call): Call check_function_arguments even for
1624 -Wrestrict, adjust check_function_arguments caller.
1625 * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
1627 * typeck.c (cp_build_function_call_vec): Adjust
1628 check_function_arguments caller.
1630 2017-02-24 Marek Polacek <polacek@redhat.com>
1632 PR translation/79705
1633 * decl.c (check_redeclaration_exception_specification): Mark a string
1634 for translation. Make the pointer const.
1636 2017-02-23 Paolo Carlini <paolo.carlini@oracle.com>
1639 * pt.c (register_specialization): Check duplicate_decls return value
1640 for error_mark_node and pass it back.
1642 2017-02-22 Jason Merrill <jason@redhat.com>
1644 PR c++/79679 - missing destructor for argument
1645 * call.c (build_over_call): Don't pass tf_no_cleanup to argument
1648 * pt.c (do_class_deduction): Handle 0 argument case.
1650 2017-02-22 Jakub Jelinek <jakub@redhat.com>
1653 * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
1654 SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
1655 * constexpr.c (potential_constant_expression_1): Handle
1656 OMP_*, OACC_* and CILK_* trees. Use error_at with
1657 EXPR_LOC_OR_LOC (t, input_location) computed early
1658 instead of error, or error_at with location_of (t).
1660 2017-02-22 Marek Polacek <polacek@redhat.com>
1663 * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
1664 if the alignas expression is erroneous.
1665 * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
1669 * semantics.c (finish_underlying_type): Bail out for incomplete enums.
1671 2017-02-21 Jason Merrill <jason@redhat.com>
1673 PR c++/50308 - wrong deprecated warning with ADL
1674 PR c++/17729 - duplicate deprecated warning
1675 * semantics.c (finish_id_expression): Only call mark_used on a
1676 function if we aren't building a call.
1678 PR c++/41727 - ICE with partial spec of partial instantiation
1679 * pt.c (process_partial_specialization): For now, don't check more
1680 specialized if there is more than one level of args.
1682 2017-02-21 Marek Polacek <polacek@redhat.com>
1685 * cp-tree.h (maybe_reject_flexarray_init): Declare.
1686 * init.c (maybe_reject_flexarray_init): No longer static.
1687 Add check for current_function_decl.
1688 * parser.c (cp_parser_late_parse_one_default_arg): Reject
1689 a default mem-initializer for a flexible array.
1691 2017-02-21 Jakub Jelinek <jakub@redhat.com>
1692 Paolo Carlini <paolo.carlini@oracle.com>
1695 * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
1697 * pt.c (tsubst_decomp_names): Return error_mark_node if the first
1698 decl after the decomposition artificial decl has error_mark_node.
1699 * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
1700 instead of just == error_mark_node comparison.
1702 2017-02-21 Jakub Jelinek <jakub@redhat.com>
1705 * decl.c: Include gimplify.h.
1706 (cp_finish_decomp): Make sure there is no sharing of trees
1707 in between DECL_VALUE_EXPR of decomposition decls.
1710 * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
1713 * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
1714 call cplus_expand_constant on it first.
1716 2017-02-19 Jason Merrill <jason@redhat.com>
1718 PR c++/78139 - destructor needed by new-expression
1719 * call.c (build_special_member_call): Use tf_no_cleanup.
1721 PR c++/78282 - auto template and pack expansion
1722 * pt.c (find_parameter_packs_r): Don't walk into the type of
1723 templates other than template template-parameters.
1725 PR c++/79606 - ICE with this->base_member in NSDMI
1726 * class.c (build_base_path): Check processing_template_decl.
1728 PR c++/79607 - ICE with T{} initializer
1729 * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
1731 PR c++/79566 - elaborated-type-specifier in range for
1732 * parser.c (cp_parser_simple_declaration): Fix check for type
1735 PR c++/79400 - confusing suggestion of 'noexcept'
1736 * parser.c (cp_parser_exception_specification_opt): Remove
1737 suggestion for deprecated dynamic exception-specification.
1739 PR c++/79470 - partial ordering with reference parameters
1740 * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
1742 PR c++/79500 - ICE with non-template deduction guide
1743 * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
1744 DECL_TEMPLATE_RESULT.
1746 PR c++/79580 - ICE with compound literal
1747 * parser.c (cp_parser_class_head): If we're in the middle of an
1748 expression, use ts_within_enclosing_non_class.
1750 PR c++/79503 - inherited ctor taking base class
1751 * call.c (add_function_candidate): Also check that
1752 DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
1754 2017-02-19 Paolo Carlini <paolo.carlini@oracle.com>
1757 * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
1760 2017-02-19 Eric Fiselier <eric@efcs.ca>
1761 Jonathan Wakely <jwakely@redhat.com>
1764 * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
1765 control warning about literal suffix identifiers without a leading
1768 2017-02-17 Jason Merrill <jason@redhat.com>
1770 PR c++/79508 - lookup error with member template
1771 * parser.c (cp_parser_template_name): Clear
1772 parser->context->object_type if we aren't doing lookup.
1774 PR c++/78690 - ICE with using and global type with same name
1775 * pt.c (type_dependent_object_expression_p): True for
1778 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
1779 * pt.c (convert_template_argument): Just return an auto arg pack.
1780 (tsubst_template_args): Don't tsubst an auto pack type.
1782 PR c++/79556 - C++17 ICE with non-type auto
1783 * pt.c (do_auto_deduction): Don't try to deduce from null type.
1785 PR c++/79533 - C++17 ICE with temporary cast to reference
1786 * call.c (build_over_call): Conversion to a reference prevents copy
1789 2017-02-16 Jakub Jelinek <jakub@redhat.com>
1790 Jason Merrill <jason@redhat.com>
1792 PR c++/79502 - lost nodiscard attribute
1793 * pt.c (apply_late_template_attributes): Do apply non-dependent
1794 attributes to types.
1796 2017-02-16 Jason Merrill <jason@redhat.com>
1798 PR c++/78572 - ICE with self-modifying array initializer
1799 * constexpr.c (cxx_eval_store_expression): The object we're
1800 initializing is outside the constant-expression.
1801 (cxx_eval_call_expression): Set ctx->call.
1803 PR c++/79050 - ICE with undeduced auto and LTO
1804 * decl.c (poplevel): Remove undeduced auto decls.
1806 2017-02-16 Jakub Jelinek <jakub@redhat.com>
1809 * parser.c (cp_parser_omp_target): For -fopenmp-simd
1810 ignore #pragma omp target even when not followed by identifier.
1812 2017-02-15 Jason Merrill <jason@redhat.com>
1813 Jakub Jelinek <jakub@redhat.com>
1815 PR c++/79464 - ICE in IPA with omitted constructor parms
1816 * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
1817 (adjust_clone_args): Adjust.
1818 (add_method): Remember omitted parms.
1819 * call.c (add_function_candidate): Likewise.
1820 * mangle.c (write_method_parms): Likewise.
1821 * method.c (ctor_omit_inherited_parms): Return false if there are no
1824 2017-02-15 Martin Sebor <msebor@redhat.com>
1827 * init.c (maybe_reject_flexarray_init): New function.
1828 (perform_member_init): Call it.
1830 2017-02-15 Jakub Jelinek <jakub@redhat.com>
1833 * parser.c (cp_parser_std_attribute): Don't pedwarn about
1834 [[deprecated]] with -std=c++11 and [[fallthrough]] with
1835 -std=c++11 and -std=c++14.
1838 * decl.c (grokdeclarator): For static data members, handle thread_p
1839 only after handling inline.
1841 2017-02-14 Marek Polacek <polacek@redhat.com>
1845 * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
1846 clobbering if the postfix expression isn't an EXPR_P.
1848 2017-02-13 Jason Merrill <jason@redhat.com>
1850 PR c++/79461 - ICE with lambda in constexpr constructor
1851 * constexpr.c (build_data_member_initialization): Ignore
1852 initialization of a local variable.
1854 2017-02-13 Jakub Jelinek <jakub@redhat.com>
1856 * init.c (warn_placement_new_too_small): Add missing space in
1858 * parser.c (cp_parser_oacc_declare): Likewise.
1859 * mangle.c (maybe_check_abi_tags): Likewise.
1862 * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
1863 on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
1864 in the rightmost operand.
1866 2017-02-13 Nathan Sidwell <nathan@acm.org>
1868 PR c++/79296 - ICE mangling localized template instantiation
1869 * decl2.c (determine_visibility): Use template fn context for
1870 local class instantiations.
1872 2017-02-11 Jason Merrill <jason@redhat.com>
1874 PR c++/77659 - ICE with new and C++14 aggregate NSDMI
1875 * init.c (build_new): Make backups of any CONSTRUCTORs in init.
1876 (build_new_1): Use replace_placeholders.
1877 * tree.c (replace_placeholders_t): Also track whether we've seen a
1879 (replace_placeholders, replace_placeholders_r): Adjust.
1880 * cp-tree.h: Adjust.
1882 PR c++/77790 - ICE with auto function in C++11 mode
1883 * decl.c (undeduced_auto_decl): Remove C++14 limitation.
1884 (require_deduced_type): Add complain parm, return bool.
1885 * cp-tree.h: Adjust.
1886 * decl2.c (mark_used): Use require_deduced_type.
1888 2017-02-10 Jason Merrill <jason@redhat.com>
1890 PR c++/78908 - template ops and bitfields
1891 * tree.c (build_min_non_dep): Use unlowered_expr_type.
1893 PR c++/78897 - constexpr union
1894 * constexpr.c (cxx_eval_store_expression): A store to a union member
1895 erases a previous store to another member.
1897 PR c++/71285 - member of fold-expression
1898 * semantics.c (finish_unary_fold_expr)
1899 (finish_binary_fold_expr): Use null type for fold-expressions.
1901 PR c++/79401 - protected inherited constructor
1902 * call.c (enforce_access): For inheriting constructor, find a base
1903 binfo in the path we already have.
1905 2017-02-10 Marek Polacek <polacek@redhat.com>
1908 * pt.c (type_dependent_expression_p): Check if the expression type
1912 * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
1913 if warnings shouldn't be given.
1915 2017-02-10 Paolo Carlini <paolo.carlini@oracle.com>
1918 * pt.c (tsubst_decl): Don't try to preserve a typedef that names
1919 an error_mark_node as type.
1921 2017-02-09 Jakub Jelinek <jakub@redhat.com>
1922 Jason Merrill <jason@redhat.com>
1925 * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
1926 from pattern to type.
1928 2017-02-09 Jason Merrill <jason@redhat.com>
1930 PR c++/79316 - default argument in deduction guide
1931 PR c++/79350 - explicit deduction guide
1932 * parser.c (cp_parser_constructor_declarator_p)
1933 (cp_parser_direct_declarator): Parse deduction guides more like
1935 * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
1936 * tree.c (special_function_p): Return it.
1937 * decl.c (check_special_function_return_type): Handle it.
1938 (grokdeclarator, grokfndecl): Adjust.
1939 (cp_finish_decl): Pass flags to do_auto_deduction.
1940 * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
1941 * pt.c (dguide_name_p): Take a const_tree.
1942 (do_class_deduction): Handle explicit.
1943 (do_auto_deduction): Pass flags through.
1944 (build_deduction_guide): Copy explicit flag.
1946 2017-02-09 Jakub Jelinek <jakub@redhat.com>
1949 * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
1950 non-pragma_compound context here.
1951 (cp_parser_omp_target): Likewise.
1952 (cp_parser_pragma): Don't call push_omp_privatization_clauses and
1953 parsing for ordered and target omp pragmas in non-pragma_stmt
1954 non-pragma_compound contexts.
1957 * parser.c (cp_parser_oacc_declare): Formatting fix.
1958 (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
1959 automatic variables.
1961 2016-02-09 Nathan Sidwell <nathan@codesourcery.com>
1962 Chung-Lin Tang <cltang@codesourcery.com>
1964 * parser.c (cp_parser_oacc_clause_tile): Disallow collapse. Fix
1965 parsing. Parse constant expression. Remove semantic checking.
1966 (cp_parser_omp_clause_collapse): Disallow tile.
1967 (cp_parser_omp_for_loop): Deal with tile clause. Don't emit a parse
1968 error about missing for after already emitting one. Use more
1969 conventional for idiom for unbounded loop.
1970 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
1971 * semantics.c (finish_omp_clauses): Correct TILE semantic check.
1972 (finish_omp_for): Deal with tile clause.
1974 2017-02-07 Nathan Sidwell <nathan@acm.org>
1976 * method.c (synthesized_method_base_walk): New. Broken out of ...
1977 (synthesized_method_walk): ... here. Call it. Cleanup
1980 2017-02-07 Patrick Palka <ppalka@gcc.gnu.org>
1983 * typeck2.c (process_init_constructor_union): Consider only
1984 FIELD_DECLs when looking for an NSDMI.
1986 2017-02-06 Jason Merrill <jason@redhat.com>
1988 PR c++/71193 - incomplete types in templates
1989 * parser.c (cp_parser_postfix_dot_deref_expression): In a template
1990 handle incomplete type by pedwarning and then treating as dependent.
1992 2017-02-06 Jakub Jelinek <jakub@redhat.com>
1995 * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
1996 (potential_constant_expression_1): Likewise.
1999 * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
2000 allow one fewer than expected arguments if flag_permissive.
2003 * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
2004 * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
2005 with error_mark_node type.
2007 2017-02-03 Jason Merrill <jason@redhat.com>
2009 PR c++/78689 - ICE on constructor with label
2010 * optimize.c (maybe_clone_body): Replace omitted parameters with
2012 * class.c (build_clone): Fix logic for omitting inherited parms.
2014 PR c++/12245 - excessive memory use
2015 * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
2016 back in. Don't cache constants.
2017 (maybe_constant_init): Don't cache constants.
2019 PR c++/79294 - ICE with invalid template argument
2020 * pt.c (convert_nontype_argument_function): Check value-dependence.
2021 (convert_nontype_argument): Don't check it here for function ptrs.
2023 2017-02-02 Richard Biener <rguenther@suse.de>
2026 * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
2027 it lazily on the first changed element only and copy it
2028 fully upfront, only storing changed elements.
2030 2017-02-02 Paolo Carlini <paolo.carlini@oracle.com>
2033 * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
2036 2017-01-31 Jakub Jelinek <jakub@redhat.com>
2039 * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
2042 2017-01-31 David Malcolm <dmalcolm@redhat.com>
2045 * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
2046 any namespace aliases.
2048 2017-01-31 Nathan Sidwell <nathan@acm.org>
2051 * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
2055 * pt.c: (instantiate_decl): Push to top level when current
2056 function scope doesn't match. Only push lmabda scope stack when
2059 * cp-tree.h (instantiate_decl): Make defer_ok bool.
2060 * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
2061 (instantiate_decl): Simplify and reorder state saving and restoration.
2064 * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
2065 * semantics.c (finish_member_declaration): Assert class is being
2068 2017-01-30 Alexandre Oliva <aoliva@redhat.com>
2070 Introduce C++ support in libcc1.
2071 * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
2072 (ansi_opname): Rename to...
2073 (cp_operator_id): ... this. Adjust all callers.
2074 (ansi_assopname): Rename to...
2075 (cp_assignment_operator_id): ... this. Adjust all callers.
2076 (cp_literal_operator_id): Declare.
2077 (set_global_friend): Declare.
2078 (is_global_friend): Declare.
2079 (enum cp_oracle_request): New type.
2080 (cp_binding_oracle_function): New type.
2081 (cp_binding_oracle): Declare.
2082 (cp_finish_injected_record_type): Declare.
2083 * friend.c (global_friend): New var.
2084 (set_global_friend): New fn.
2085 (is_global_friend): New fn.
2086 (is_friend): Call is_global_friend.
2087 * name-lookup.c (cp_binding_oracle): New var.
2088 (query_oracle): New fn.
2089 (qualified_lookup_using_namespace): Call query_oracle.
2090 (lookup_name_real_1): Likewise.
2091 * parser.c (cp_literal_operator_id): Drop static.
2092 * search.c (friend_accessible_p): Call is_global_friend.
2093 * semantics.c (is_this_parameter): Accept a variable if the
2094 binding oracle is enabled.
2096 2017-01-27 Jason Merrill <jason@redhat.com>
2098 PR c++/78771 - ICE with inherited constructor.
2099 * call.c (build_over_call): Call deduce_inheriting_ctor here.
2100 * pt.c (tsubst_decl): Not here.
2101 * class.c (add_method): Or here.
2102 * method.c (deduce_inheriting_ctor): Handle clones.
2103 (implicitly_declare_fn): Don't deduce inheriting ctors yet.
2105 2017-01-27 Adam Butcher <adam@jessamine.co.uk>
2108 * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
2110 * cp/cp-tree.h: Declare it.
2111 * cp/semantics.c (finish_id_expression): Resolve names within a default
2112 capturing generic lambda defined within a template prior to
2113 instantiation to allow for captures to be added to the closure type.
2115 2017-01-26 Jakub Jelinek <jakub@redhat.com>
2118 * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
2119 * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
2120 * parser.c (cp_parser_builtin_offsetof): Pass result of
2121 build_static_cast of null_pointer_node to finish_offsetof.
2122 * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
2123 it for -Winvalid-offsetof pedwarn instead of trying to guess
2124 original offsetof type from EXPR. Save OBJECT_PTR as a new
2125 second operand to OFFSETOF_EXPR.
2126 * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
2127 finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
2130 2017-01-26 Jason Merrill <jason@redhat.com>
2132 * name-lookup.c (parse_using_directive): Deprecate strong using.
2134 PR c++/79176 - lambda ICE with -flto -Os
2135 * decl2.c (vague_linkage_p): Handle decloned 'tors.
2136 * tree.c (decl_linkage): Likewise.
2138 2017-01-25 Martin Sebor <msebor@redhat.com>
2140 * decl.c (grokdeclarator): Fix a typo in a comment.
2142 2017-01-25 Jakub Jelinek <jakub@redhat.com>
2145 * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
2149 * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
2150 OPT_Wpedantic on lambda templates for -std=c++14 and higher.
2152 2017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
2155 * decl.c (cxx_init_decl_processing): Pass main_input_filename
2156 to build_translation_unit_decl.
2158 2017-01-24 Jakub Jelinek <jakub@redhat.com>
2161 * cp-gimplify.c (cp_genericize_r): Add result of
2162 convert_from_reference on invisiref parm to p_set.
2164 2017-01-24 Nathan Sidwell <nathan@acm.org>
2166 PR c++/78469 - defaulted ctor and inaccessible dtor
2167 * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
2168 * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
2169 * tree.c (build_target_expr): Check tf_no_cleanup.
2171 PR c++/79118 - anon-members and constexpr
2172 * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
2173 ctor decl. Recursively check anonymous members.
2174 (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
2176 (explain_invalid_constexpr_fn): Likewise.
2178 2017-01-23 Nathan Sidwell <nathan@acm.org>
2180 PR c++/71710 - template using directive of field
2181 * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
2184 PR c++/71406 - ICE with scope-ref'd template id exprs
2186 * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
2187 before breaking up TEMPLATE_ID_EXPR.
2189 2017-01-20 Nathan Sidwell <nathan@acm.org>
2191 PR c++/78495 - wrong code inherited ctor and invisi-ref parm
2192 * cp-gimplify.c (cp_generize_r): Don't skip thunks.
2194 2017-01-20 David Malcolm <dmalcolm@redhat.com>
2198 * cp-tree.h (suggest_alternatives_for): Add bool param.
2199 (suggest_alternative_in_explicit_scope): New decl.
2200 * error.c (qualified_name_lookup_error): When SCOPE is a namespace
2201 that isn't the global one, call new function
2202 suggest_alternative_in_explicit_scope, only calling
2203 suggest_alternatives_for if it fails, and disabling near match
2204 searches fort that case. When SCOPE is the global namespace,
2205 pass true for new param to suggest_alternatives_for to allow for
2207 * lex.c (unqualified_name_lookup_error): Pass true for new param
2208 to suggest_alternatives_for.
2209 * name-lookup.c (consider_binding_level): Add forward decl.
2210 (suggest_alternatives_for): Add "suggest_misspellings" param,
2211 using it to conditionalize the fuzzy name-lookup code.
2212 (suggest_alternative_in_explicit_scope): New function.
2213 * parser.c (cp_parser_primary_expression): When calling
2214 finish_id_expression, pass location of id_expression rather
2215 than that of id_expr_token.
2216 (cp_parser_id_expression): Convert local "unqualified_id" from
2217 tree to cp_expr to avoid implicitly dropping location information.
2219 2017-01-20 Marek Polacek <polacek@redhat.com>
2222 * call.c (build_conditional_expr_1): Warn about duplicated branches.
2223 * semantics.c (finish_expr_stmt): Build statement using the proper
2226 2017-01-19 Jason Merrill <jason@redhat.com>
2228 US 20 - forwarding references and class template argument deduction
2229 * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
2230 * pt.c (push_template_decl_real): Set it.
2231 (maybe_adjust_types_for_deduction): Check it.
2232 (rewrite_template_parm): Copy it.
2234 US 19 - deduction guides and constructors
2235 * call.c (joust): Prefer deduction guides to constructors.
2236 * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
2237 (deduction_guide_p): Check DECL_P.
2239 * decl.c (check_initializer): Always use build_aggr_init for array
2242 PR c++/79130 - decomposition and direct-initialization
2243 * init.c (build_aggr_init): Communicate direct-initialization to
2245 (build_vec_init): Check for array copy sooner.
2246 * parser.c (cp_parser_decomposition_declaration): Remove call to
2247 build_x_compound_expr_from_list.
2249 2017-01-18 Jason Merrill <jason@redhat.com>
2251 PR c++/68666 - member variable template-id
2252 * typeck.c (finish_class_member_access_expr): Handle variable
2254 * pt.c (lookup_and_finish_template_variable): No longer static.
2255 * cp-tree.h: Declare it.
2257 2017-01-18 Nathan Sidwell <nathan@acm.org>
2260 * call.c (build_over_call): When checking ellipsis conversions for
2261 an inherited ctor, make sure there is at least one conversion.
2263 2017-01-18 Jason Merrill <jason@redhat.com>
2265 PR c++/78894 - ICE with class deduction and default arg
2266 * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
2268 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
2271 * mangle.c (write_discriminator): Reorganize abi warning check.
2273 2017-01-18 Nathan Sidwell <nathan@acm.org>
2275 * cp-tree.h: Clarify exception spec node comment.
2276 * except.c (nothrow_spec_p): Simplify by checking node-equality.
2279 * mangle.c (write_exception_spec): Check nothrow explicitly.
2280 (write_encoding): Don't increment processing_template_decl around
2283 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
2286 * mangle.c (write_template_args): Add "on" for operator names.
2288 2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
2291 * mangle.c (write_discriminator): Handle discriminator >= 10.
2293 2017-01-17 Nathan Sidwell <nathan@acm.org>
2296 * cp-tree.h (maybe_generic_this_capture): Declare.
2297 * lambda.c (resolvable_dummy_lambda): New, broken out of ...
2298 (maybe_resolve_dummy): ... here. Call it.
2299 (maybe_generic_this_capture): New.
2300 * parser.c (cp_parser_postfix_expression): Speculatively capture
2301 this in generic lambda in unresolved member function call.
2302 * pt.c (tsubst_copy_and_build): Force hard error from failed
2303 member function lookup in generic lambda.
2305 2017-01-17 Aldy Hernandez <aldyh@redhat.com>
2308 * cp-array-notation.c (expand_array_notation_exprs): Handle
2311 2017-01-11 Jason Merrill <jason@redhat.com>
2313 PR c++/78337 - ICE on invalid with generic lambda
2314 * semantics.c (process_outer_var_ref): Check if containing_function
2315 is null. Move inform call under complain test.
2317 2017-01-11 Nathan Sidwell <nathan@acm.org>
2320 * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
2323 2017-01-11 Nathan Sidwell <nathan@acm.org>
2325 * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
2327 2017-01-11 Jakub Jelinek <jakub@redhat.com>
2330 * parser.c (cp_parser_std_attribute_spec): Remove over-eager
2331 assertion. Formatting fix.
2334 * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
2337 2017-01-10 David Malcolm <dmalcolm@redhat.com>
2340 * parser.c (cp_parser_class_specifier_1): Only suggest inserting
2341 a missing semicolon if we have a valid insertion location for
2344 2017-01-10 Jason Merrill <jason@redhat.com>
2346 FI 20, decomposition declaration with parenthesized initializer.
2347 * parser.c (cp_parser_decomposition_declaration): Use
2348 cp_parser_initializer.
2350 2017-01-09 Jason Merrill <jason@redhat.com>
2352 Implement P0195R2, C++17 variadic using.
2353 * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
2354 * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
2355 * error.c (dump_decl): Likewise.
2357 2017-01-09 Jakub Jelinek <jakub@redhat.com>
2359 PR translation/79019
2360 PR translation/79020
2361 * semantics.c (finish_omp_clauses): Add missing whitespace to
2362 translatable strings.
2363 * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
2365 2017-01-07 Jason Merrill <jason@redhat.com>
2367 PR c++/78948 - instantiation from discarded statement
2368 * parser.h (struct cp_parser): Remove in_discarded_stmt field.
2369 * cp-tree.h (in_discarded_stmt): Declare it.
2370 (struct saved_scope): Add discarded_stmt bitfield.
2371 (in_discarded_stmt): New macro.
2372 * decl2.c (mark_used): Check it.
2373 * parser.c (cp_parser_selection_statement): Adjust.
2374 (cp_parser_jump_statement): Adjust.
2376 2017-01-05 Jakub Jelinek <jakub@redhat.com>
2379 * decl.c (cp_finish_decomp): Remove probe variable, if tt is
2380 REFERENCE_REF_P, set tt to its operand.
2383 * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
2384 unions even for C++11 and later.
2386 2017-01-05 Nathan Sidwell <nathan@acm.org>
2389 * pt.c (convert_nontype_argument): Don't try and see if integral
2390 or enum expressions are constants prematurely.
2392 2017-01-04 Marek Polacek <polacek@redhat.com>
2395 * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
2396 a zero character literal.
2398 2017-01-04 Jakub Jelinek <jakub@redhat.com>
2401 * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
2405 * parser.c (cp_parser_simple_declaration): Only complain about
2406 inconsistent auto deduction if auto_result doesn't use auto.
2408 * parser.c (cp_parser_simple_declaration): Diagnose function
2409 declaration among more than one init-declarators with auto
2413 * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
2414 assertion, as lexer->buffer may be NULL.
2416 2017-01-04 Marek Polacek <polacek@redhat.com>
2420 * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
2422 2017-01-04 Nathan Sidwell <nathan@acm.org>
2425 * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
2426 (lambda_capture_field_type): Update prototype.
2427 * lambda.c (lambda_capture_field_type): Add is_reference parm.
2428 Add referenceness here.
2429 (add_capture): Adjust lambda_capture_field_type call, refactor
2431 * pt.c (tsubst): Adjust lambda_capture_field_type call.
2433 2017-01-01 Jakub Jelinek <jakub@redhat.com>
2435 Update copyright years.
2437 Copyright (C) 2017 Free Software Foundation, Inc.
2439 Copying and distribution of this file, with or without modification,
2440 are permitted in any medium without royalty provided the copyright
2441 notice and this notice are preserved.