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