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