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