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