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