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