]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/cp/ChangeLog
PR c++/91363 - P0960R3: Parenthesized initialization of aggregates.
[thirdparty/gcc.git] / gcc / cp / ChangeLog
1 2019-12-03 Marek Polacek <polacek@redhat.com>
2
3 PR c++/91363 - P0960R3: Parenthesized initialization of aggregates.
4 * call.c (build_new_method_call_1): Handle parenthesized initialization
5 of aggregates by building up a CONSTRUCTOR.
6 (extend_ref_init_temps): Do nothing for CONSTRUCTOR_IS_PAREN_INIT.
7 * cp-tree.h (CONSTRUCTOR_IS_PAREN_INIT, LOOKUP_AGGREGATE_PAREN_INIT):
8 Define.
9 * decl.c (grok_reference_init): Handle aggregate initialization from
10 a parenthesized list of values.
11 (reshape_init): Do nothing for CONSTRUCTOR_IS_PAREN_INIT.
12 (check_initializer): Handle initialization of an array from a
13 parenthesized list of values. Use NULL_TREE instead of NULL.
14 * tree.c (build_cplus_new): Handle BRACE_ENCLOSED_INITIALIZER_P.
15 * typeck2.c (digest_init_r): Set LOOKUP_AGGREGATE_PAREN_INIT if it
16 receives a CONSTRUCTOR with CONSTRUCTOR_IS_PAREN_INIT set. Allow
17 narrowing when LOOKUP_AGGREGATE_PAREN_INIT.
18 (massage_init_elt): Don't lose LOOKUP_AGGREGATE_PAREN_INIT when passing
19 flags to digest_init_r.
20
21 2019-12-03 Jakub Jelinek <jakub@redhat.com>
22
23 PR c++/92732
24 * typeck2.c (digest_nsdmi_init): For bitfields, use
25 DECL_BIT_FIELD_TYPE instead of TREE_TYPE.
26
27 2019-12-03 Jason Merrill <jason@redhat.com>
28 Jakub Jelinek <jakub@redhat.com>
29
30 PR c++/92705
31 * call.c (strip_standard_conversion): New function.
32 (build_new_op_1): Use it for user_conv_p.
33 (compare_ics): Likewise.
34 (source_type): Likewise.
35
36 2019-12-03 Jakub Jelinek <jakub@redhat.com>
37
38 PR c++/92695
39 * constexpr.c (cxx_bind_parameters_in_call): For virtual calls,
40 adjust the first argument to point to the derived object rather
41 than its base.
42
43 2019-12-02 Jakub Jelinek <jakub@redhat.com>
44
45 PR c++/92695
46 * constexpr.c (cxx_eval_constant_expression) <case OBJ_TYPE_REF>: Use
47 STRIP_NOPS before checking for ADDR_EXPR.
48
49 2019-11-29 Jakub Jelinek <jakub@redhat.com>
50
51 PR c++/60228
52 * parser.c (cp_parser_omp_declare_reduction_exprs): If
53 processing_template_decl, wrap the combiner or initializer
54 into EXPR_STMT.
55 * decl.c (start_preparsed_function): Don't start a lambda scope
56 for DECL_OMP_DECLARE_REDUCTION_P functions.
57 (finish_function): Don't finish a lambda scope for
58 DECL_OMP_DECLARE_REDUCTION_P functions, nor cp_fold_function
59 them nor cp_genericize them.
60 * mangle.c (decl_mangling_context): Look through
61 DECL_OMP_DECLARE_REDUCTION_P functions.
62 * semantics.c (expand_or_defer_fn_1): For DECL_OMP_DECLARE_REDUCTION_P
63 functions, use tentative linkage, don't keep their bodies with
64 -fkeep-inline-functions and return false at the end.
65
66 2019-11-28 Jakub Jelinek <jakub@redhat.com>
67
68 PR c++/92695
69 * decl2.c (mark_used): Don't call note_vague_linkage_fn for pure
70 virtual functions, even if they are declared inline.
71
72 2019-11-16 Jason Merrill <jason@redhat.com>
73
74 Implement P1814R0, CTAD for alias templates.
75 * pt.c (rewrite_tparm_list): Factor out of build_deduction_guide.
76 (maybe_aggr_guide): Check for copy-init here.
77 (alias_ctad_tweaks, deduction_guides_for): New.
78 (ctor_deduction_guides_for): Factor out of do_class_deduction.
79 (ctad_template_p): New.
80 * parser.c (cp_parser_simple_type_specifier): Use it.
81 * constraint.cc (append_constraint): New.
82
83 2019-11-16 Jason Merrill <jason@redhat.com>
84
85 * cxx-pretty-print.c (pp_cxx_unqualified_id): Handle alias
86 template-id.
87 * pt.c (complex_alias_template_p): True if constraints.
88 (get_underlying_template, tsubst): Check alias constraints.
89 (push_template_decl_real): Set alias constraints here.
90 * parser.c (cp_parser_alias_declaration): Not here.
91 * constraint.cc (get_constraints): Take const_tree.
92
93 2019-11-12 Jason Merrill <jason@redhat.com>
94
95 PR c++/92206 - ICE with typedef to dependent alias.
96 * pt.c (dependent_alias_template_spec_p)
97 (alias_template_specialization_p): Add transparent_typedefs
98 parameter.
99 (iterative_hash_template_arg, any_template_parm_r)
100 (primary_template_specialization_p, tsubst, dependent_type_p_r):
101 Adjust.
102 * decl.c (check_elaborated_type_specifier): Adjust.
103 * error.c (dump_template_bindings, dump_aggr_type): Adjust.
104
105 2019-11-27 Andrew Sutton <asutton@lock3software.com>
106
107 PR c++/92236
108 Defer evaluation of concept checks so that static assertions can
109 emit more detailed diagnostics.
110 * constexpr.c (cxx_eval_call_expression): Handle concept checks.
111 (cxx_eval_constant_expression): Diagnose misuse of function concepts
112 as template-id expressions. Follow the usual return path for results.
113 (cxx_eval_outermost_constant_expr): Avoid calling
114 cp_get_callee_fndecl_nofold for function concepts.
115 * constraint.cc (build_function_check): Fully type the concept check
116 so that we don't ICE in conversions.
117 * cp-gimplify.c (cp_genericize_r) [CALL_EXPR]: Handle concept checks.
118 [TEMPLATE_ID_EXPR] Likewise.
119 * cvt.c (convert_to_void): Always evaluate concept checks so we don't
120 accidentally ignore them. Substitution during satisfaction can make
121 a program ill-formed (example in g++.dg/cpp2a/concepts6.C).
122 * pt.c (tsubst_copy_and_build): [CALL_EXPR]: Don't evaluate concepts.
123 [TEMPLATE_ID_EXPR]: Likewise.
124 * semantics.c (finish_call_expr): Don't evaluate concepts.
125 (finish_id_expression_1): Likewise.
126 (finish_static_assert): Preserve the original condition so we can
127 diagnose concept errors when a check returns false.
128
129 2019-11-27 Andrew Sutton <asutton@lock3software.com>
130
131 PR c++/92439
132 Improve quality of diagnostics for subexpressions that need parens.
133 * parser.c (cp_parser_requires_clause_opt): Add a flag to indicate
134 when parsing a requires-clause before lambda parameters, and...
135 (cp_parser_lambda_declarator_opt): ... use that here ...
136 (cp_parser_type_parameter): ... and here ...
137 (cp_parser_late_return_type_opt): ... and here ...
138 (cp_parser_explicit_template_declaration): ... and here.
139 (cp_parser_diagnose_ungrouped_constraint_plain): Adjust the message
140 because this can apply to subexpressions that are not immediately
141 after a requires-clause.
142 (cp_parser_diagnose_ungrouped_constraint_rich): Likewise.
143 (primary_constraint_error): New.
144 (cp_parser_constraint_requires_parens): New.
145 (cp_parser_unary_constraint_requires_parens): New.
146 (cp_parser_constraint_primary_expression): Check for unary expressions
147 before parsing the primary expression. Also check for binary and
148 postfix operators after a successful parse of the primary expression.
149 Force a re-parse if the result would form a lower-precedence string.
150 (cp_parser_constraint_logical_and_expression): Propagate lambda flag;
151 move checks for ill-formed constraints into the constraint primary
152 expression.
153 (cp_parser_constraint_logical_or_expression): Likewise.
154 (cp_parser_requires_clause_expression): Propagate lambda flag.
155
156 2019-11-27 Andrew Sutton <asutton@lock3software.com>
157
158 PR c++/88395
159 * constraint.cc (satisfy_declaration_constraints): Push tinst levels
160 around satisfaction.
161
162 2019-11-27 Andrew Sutton <asutton@lock3software.com>
163
164 Diagnose certain constraint errors as hard errors, but otherwise treat
165 them the same as normal SFINAE-type errors. Also, generally clean up
166 the satisfaction functions.
167
168 * constexpr.c (cxx_eval_constant_expression): Use
169 evaluate_concept_check.
170 * constraint.cc (normalize_concept_definition): Accept a diagnostic
171 flag and only cache when not diagnosing errors.
172 (decl_satisfied_cache): Map to trees instead of bools.
173 (satisfy_atom): Guarantee a location for the errors, propagate complain
174 flags to force_rvalue, and emit errors for non-boolean constraints.
175 (get_normalized_constraints_and_args): New overloads. Factored out of
176 satisfy_constraint_expression and satisfy_declaration_constraints.
177 (satisfy_constraint_expression): Propagate diagnostic info to
178 normalization.
179 (satisfy_declaration_constraints): New. Factored out of
180 constraints_satisfied_p.
181 (constraint_satisfaction_value): New. Calls
182 satisfy_constraint_expression or satisfy_declaration_constraints.
183 (constraints_satisfied_p): Call constraint_satisfaction_value.
184 (evaluate_concept_check): Don't take tsubst_falgs_t. Replay
185 satisfaction if an error is encountered.
186 (current_failed_constraint): Moved from pt.c.
187 (diagnose_constraints): Call constraint_satisfaction_value.
188 * cp-tree.h: Update declarations.
189 * pt.c (current_failed_constraint): Moved to constraint.cc.
190 * semantics.c (finish_id_expression_1): Remove a duplicate case.
191
192 2019-11-27 Jakub Jelinek <jakub@redhat.com>
193
194 PR c++/92524
195 * tree.c (replace_placeholders_r): Don't walk constructor elts with
196 RANGE_EXPR indexes.
197
198 2019-11-26 Jason Merrill <jason@redhat.com>
199
200 * pt.c (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Remember the
201 location of a variable template-id.
202 * constexpr.c (cxx_eval_constant_expression): Get expr location
203 before stripping location wrappers.
204 (non_const_var_error): Take location argument.
205
206 2019-11-26 Paolo Carlini <paolo.carlini@oracle.com>
207
208 * typeck.c (cp_build_unary_op): Consistently use the accurate
209 location in seven additional diagnostic messages.
210 (cp_build_compound_expr): Use cp_expr_loc_or_input_loc in one place.
211
212 2019-11-26 Jakub Jelinek <jakub@redhat.com>
213
214 PR c++/92648
215 * parser.c (cp_parser_std_attribute): For unknown attributes,
216 skip balanced token seq instead of trying to parse
217 attribute-argument-clause as expression list. Formatting fix.
218
219 PR c++/61414
220 * class.c (enum_to_min_precision): New hash_map.
221 (enum_min_precision): New function.
222 (check_bitfield_decl): Use it.
223
224 2019-11-25 Paolo Carlini <paolo.carlini@oracle.com>
225
226 * typeck.c (cp_build_indirect_ref_1): Add location_t parameter
227 and use it in error messages.
228 (build_x_indirect_ref): Adjust call.
229 (build_indirect_ref): Likewise.
230 (cp_build_fold_indirect_ref): Likewise.
231 (cp_build_array_ref): Likewise.
232 * call.c (build_new_op_1): Likewise.
233 * semantics.c (finish_omp_clauses): Likewise.
234 (finish_omp_depobj): Likewise.
235 * typeck2.c (build_x_arrow): Likewise.
236 * cp-tree.h (cp_build_indirect_ref): Update declaration.
237
238 * call.c (build_new_op_1): Use location argument in warning_at.
239
240 * typeck.c (cp_build_modify_expr): Consistently use the
241 location_t argument.
242
243 2019-11-23 Bernd Edlinger <bernd.edlinger@hotmail.de>
244
245 PR c++/92365
246 * name-lookup.c (check_local_shadow): Use can_convert_arg
247 instead of can_convert.
248
249 2019-11-22 Marek Polacek <polacek@redhat.com>
250
251 PR c++/88337 - P1327R1: Allow polymorphic typeid in constexpr.
252 * constexpr.c (potential_constant_expression_1): Allow a typeid
253 expression whose operand is of polymorphic type in constexpr in
254 C++20.
255 * rtti.c (build_typeid): Remove obsolete FIXME comment.
256
257 2019-11-22 Jakub Jelinek <jakub@redhat.com>
258
259 PR c/90677
260 * cp-objcp-common.c (identifier_global_tag): Define.
261
262 PR c++/92458
263 * init.c (nsdmi_inst): Change type to
264 decl_tree_cache_map * from tree_cache_map *.
265 * constraint.cc (decl_constraints): Likewise.
266 * decl.c (get_tuple_decomp_init): Likewise.
267 * pt.c (defarg_inst, explicit_specifier_map): Likewise.
268 (tsubst_default_argument, store_explicit_specifier): Use
269 decl_tree_cache_map::create_ggc rather than
270 tree_cache_map::create_ggc.
271 * cp-objcp-common.c (debug_type_map): Change type to
272 type_tree_cache_map * from tree_cache_map *.
273
274 2019-11-21 Marek Polacek <polacek@redhat.com>
275
276 PR c++/92450 - ICE with invalid nested name specifier.
277 * parser.c (cp_parser_member_declaration): Don't attempt to print
278 erroneous bit-field diagnostic if grokdeclarator returns
279 error_mark_node.
280
281 2019-11-21 Jakub Jelinek <jakub@redhat.com>
282 Jason Merrill <jason@redhat.com>
283
284 PR c++/90842
285 * parser.c (cp_parser_decl_specifier_seq): For concept or typedef
286 break early if CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR.
287 For type specifiers, set CP_PARSER_FLAGS_NO_TYPE_DEFINITIONS
288 if CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR is set.
289
290 2019-11-20 Paolo Carlini <paolo.carlini@oracle.com>
291
292 * typeck2.c (build_x_arrow): Early return if decay_conversion
293 returns error_mark_node.
294
295 2019-11-20 Jakub Jelinek <jakub@redhat.com>
296
297 PR c++/90767
298 * call.c (complain_about_no_candidates_for_method_call): If
299 conv->from is not a type, pass to complain_about_bad_argument
300 lvalue_type of conv->from.
301
302 2019-11-20 Paolo Carlini <paolo.carlini@oracle.com>
303
304 * cvt.c (ocp_convert): Use additional warning sentinel.
305
306 2019-11-19 Jakub Jelinek <jakub@redhat.com>
307
308 PR c++/92414
309 * constexpr.c (cxx_eval_outermost_constant_expr): If DECL_INITIAL
310 on object is erroneous, return t without trying to evaluate
311 a constexpr dtor.
312
313 2019-11-12 Jason Merrill <jason@redhat.com>
314
315 * call.c (same_fn_or_template): Change to cand_parms_match.
316 (joust): Adjust.
317 (print_z_candidate): Mark rewritten/reversed candidates.
318 (build_new_op_1): Warn about recursive call with reversed arguments.
319
320 2019-11-15 Andrew Sutton <asutton@lock3software.com>
321
322 PR c++/89913
323 * pt.c (get_underlying_template): Exit loop if the original type
324 of the alias is null.
325
326 2019-11-19 Andrew Sutton <asutton@lock3software.com>
327
328 PR c++/92078
329 * pt.c (maybe_new_partial_specialization): Apply access to newly
330 created partial specializations. Update comment style.
331
332 2019-11-19 Andrew Sutton <asutton@lock3software.com>
333
334 PR c++/92078
335 * pt.c (maybe_new_partial_specialization): Apply access to newly
336 created partial specializations. Update comment style.
337
338 2019-11-19 Andrew Sutton <asutton@lock3software.com>
339
340 PR c++/92403
341 Suppress diagnostics substituting into a requires-expression.
342 * pt.c (tsubst_copy_and_build): Perform the first substitution without
343 diagnostics and a second only if tsubst_requries_expr returns an error.
344
345 2019-11-19 Jakub Jelinek <jakub@redhat.com>
346
347 PR c++/92504
348 * semantics.c (handle_omp_for_class_iterator): Don't call
349 cp_fully_fold on cond.
350
351 2019-11-18 Paolo Carlini <paolo.carlini@oracle.com>
352
353 * typeck.c (cp_build_addr_expr_1): Use cp_expr_loc_or_input_loc
354 in three places.
355 (cxx_sizeof_expr): Use it in one additional place.
356 (cxx_alignof_expr): Likewise.
357 (lvalue_or_else): Likewise.
358
359 2019-11-18 Marek Polacek <polacek@redhat.com>
360
361 PR c++/91962 - ICE with reference binding and qualification conversion.
362 * call.c (convert_like_real) <case ck_ref_bind>: Check need_temporary_p.
363
364 2019-11-17 Jakub Jelinek <jakub@redhat.com>
365
366 * method.c (lookup_comparison_result): Use %qD instead of %<%T::%D%>
367 to print the decl.
368 (lookup_comparison_category): Use %qD instead of %<std::%D%> to print
369 the decl.
370
371 2019-11-15 Paolo Carlini <paolo.carlini@oracle.com>
372
373 * typeck.c (cp_truthvalue_conversion): Add tsubst_flags_t parameter
374 and use it in calls; also pass the location_t of the expression to
375 cp_build_binary_op and c_common_truthvalue_conversion.
376 * rtti.c (build_dynamic_cast_1): Adjust call.
377 * cvt.c (ocp_convert): Likewise.
378 * cp-gimplify.c (cp_fold): Likewise.
379 * cp-tree.h (cp_truthvalue_conversion): Update declaration.
380
381 2019-11-14 Jason Merrill <jason@redhat.com>
382
383 Implement P1816R0, class template argument deduction for aggregates.
384 * pt.c (maybe_aggr_guide, collect_ctor_idx_types): New.
385 (is_spec_or_derived): Split out from do_class_deduction.
386 (build_deduction_guide): Handle aggregate guide.
387 * class.c (finish_struct): Set CLASSTYPE_NON_AGGREGATE in a
388 template.
389 * cp-tree.h (CP_AGGREGATE_TYPE_P): An incomplete class is not an
390 aggregate.
391
392 2019-11-14 Richard Sandiford <richard.sandiford@arm.com>
393
394 * call.c (build_conditional_expr_1): Use truth_type_for instead
395 of build_same_sized_truth_vector_type.
396 * typeck.c (build_vec_cmp): Likewise.
397
398 2019-11-14 Jakub Jelinek <jakub@redhat.com>
399
400 * parser.c (cp_parser_omp_context_selector): Don't require score
401 argument to fit into shwi, just to be INTEGER_CST. Diagnose
402 negative score.
403 * pt.c (tsubst_attribute): Likewise.
404
405 * parser.c (cp_parser_omp_context_selector): Rename
406 CTX_PROPERTY_IDLIST to CTX_PROPERTY_NAME_LIST, add CTX_PROPERTY_ID.
407 Use CTX_PROPERTY_ID for atomic_default_mem_order, only allow a single
408 identifier in that. For CTX_PROPERTY_NAME_LIST, allow identifiers
409 and string literals.
410 * pt.c (tsubst_attribute): Fix up STRING_CST handling if allow_string.
411
412 2019-11-13 Marek Polacek <polacek@redhat.com>
413
414 PR c++/89070 - bogus [[nodiscard]] warning in SFINAE.
415 * cvt.c (convert_to_void): Guard maybe_warn_nodiscard calls with
416 tf_warning.
417
418 2019-11-13 Richard Sandiford <richard.sandiford@arm.com>
419
420 PR c++/92206
421 * cp-tree.h (STF_STRIP_DEPENDENT): New constant.
422 * tree.c (strip_typedefs): Add STF_STRIP_DEPENDENT to the flags
423 when calling strip_typedefs recursively on a DECL_ORIGINAL_TYPE.
424 Don't apply the fix for DR1558 in that case; allow aliases with
425 dependent template parameters to be stripped instead.
426
427 2019-11-12 Nathan Sidwell <nathan@acm.org>
428
429 * name-lookup.c (lookup_using_decl): New function, merged from ...
430 (do_class_using_decl): ... here. Call it. And ...
431 (finish_nonmember_using_decl): ... here. Call it.
432
433 2019-11-12 Martin Liska <mliska@suse.cz>
434
435 * name-lookup.c: Do not include params.h.
436 * typeck.c: Likewise.
437
438 2019-11-12 Martin Liska <mliska@suse.cz>
439
440 * name-lookup.c (namespace_hints::namespace_hints): Replace old
441 parameter syntax with the new one, include opts.h if needed. Use
442 SET_OPTION_IF_UNSET macro.
443 * typeck.c (comptypes): Likewise.
444
445 2019-11-12 Maciej W. Rozycki <macro@codesourcery.com>
446 Frederik Harwath <frederik@codesourcery.com>
447
448 gcc/cp/
449 * constexpr.c (potential_constant_expression_1): Handle
450 OACC_SERIAL.
451 * parser.c (OACC_SERIAL_CLAUSE_MASK): New macro.
452 (cp_parser_oacc_kernels_parallel): Rename function to...
453 (cp_parser_oacc_compute): ... this. Handle PRAGMA_OACC_SERIAL.
454 (cp_parser_omp_construct): Update accordingly.
455 (cp_parser_pragma): Handle PRAGMA_OACC_SERIAL. Fix alphabetic
456 order.
457 * pt.c (tsubst_expr): Handle OACC_SERIAL.
458
459 2019-11-11 Jason Merrill <jason@redhat.com>
460
461 Implement P1946R0, Allow defaulting comparisons by value.
462 * method.c (early_check_defaulted_comparison): Accept by-value,
463 reject mixed by-value and by-reference parms.
464 * decl.c (grokdeclarator): Set funcdef_flag for defaulted friend.
465 * decl2.c (grokfield): Don't SET_DECL_FRIEND_CONTEXT.
466
467 * typeck.c (cp_build_binary_op): Sorry about <=> on VECTOR_TYPE.
468
469 2019-11-11 Jakub Jelinek <jakub@redhat.com>
470
471 PR c++/92447
472 * decl.c (finish_function): Move ctype initialization before
473 DECL_DELETED_FN handling.
474
475 * semantics.c (finish_translation_unit): Diagnose declare target
476 without corresponding end declare target.
477
478 2019-11-10 Jason Merrill <jason@redhat.com>
479
480 Implement D1957R0, T* to bool should be considered narrowing.
481 * typeck2.c (check_narrowing): Treat pointer->bool as a narrowing
482 conversion with -std=c++2a.
483
484 2019-11-08 Marek Polacek <polacek@redhat.com>
485
486 PR c++/92215 - flawed diagnostic for bit-field with non-integral type.
487 * parser.c (cp_parser_member_declaration): Add a diagnostic for
488 bit-fields with non-integral types.
489
490 2019-11-08 Jakub Jelinek <jakub@redhat.com>
491
492 * init.c (build_vec_delete_1): Fix a comment typo - mist -> must.
493
494 2019-11-07 Jason Merrill <jason@redhat.com>
495
496 Implement D1959R0, remove weak_equality and strong_equality.
497 * method.c (enum comp_cat_tag, comp_cat_info): Remove *_equality.
498 (genericize_spaceship, common_comparison_type): Likewise.
499 * typeck.c (cp_build_binary_op): Move SPACESHIP_EXPR to be with the
500 relational operators, exclude other types no longer supported.
501
502 2019-11-06 Jason Merrill <jason@redhat.com>
503
504 Implement D1907R1 "structural type".
505 * tree.c (structural_type_p): New.
506 * pt.c (invalid_nontype_parm_type_p): Use it.
507 * class.c (build_base_field_1): Take binfo. Copy TREE_PRIVATE.
508 (build_base_field): Pass binfo.
509
510 PR c++/92150 - partial specialization with class NTTP.
511 * pt.c (unify): Handle VIEW_CONVERT_EXPR.
512
513 * pt.c (use_pack_expansion_extra_args_p): Still do substitution if
514 all packs are simple pack expansions.
515 (add_extra_args): Check that the extra args aren't dependent.
516
517 2019-11-06 Andrew Sutton <asutton@lock3software.com>
518
519 Use satisfaction with nested requirements.
520 * constraint.cc (build_parameter_mapping): Use
521 current_template_parms when the declaration is not available.
522 (norm_info::norm_info) Make explicit.
523 (normalize_constraint_expression): Factor into a separate overload
524 that takes arguments, and use that in the original function.
525 (tsubst_nested_requirement): Use satisfy_constraint instead of
526 trying to evaluate this as a constant expression.
527 (finish_nested_requirement): Keep the normalized constraint and the
528 original normalization arguments with the requirement.
529 (diagnose_nested_requirement): Use satisfy_constraint. Tentatively
530 implement more comprehensive diagnostics, but do not enable.
531 * parser.c (cp_parser_requires_expression): Relax requirement that
532 requires-expressions can live only inside templates.
533 * pt.c (any_template_parm_r): Look into type of PARM_DECL.
534
535 2019-11-06 Jason Merrill <jason@redhat.com>
536
537 C++20 NB CA378 - Remove constrained non-template functions.
538 * decl.c (grokfndecl): Reject constraints on non-templated function.
539
540 2019-11-06 Matthias Kretz <m.kretz@gsi.de>
541
542 * parser.c (cp_parser_operator): Parse operator?: as an
543 attempt to overload the conditional operator.
544
545 2019-11-05 Jason Merrill <jason@redhat.com>
546
547 Implement C++20 operator<=>.
548 * cp-tree.h (struct lang_decl_fn): Add maybe_deleted bitfield.
549 (DECL_MAYBE_DELETED): New.
550 (enum special_function_kind): Add sfk_comparison.
551 (LOOKUP_REWRITTEN, LOOKUP_REVERSED): New.
552 * call.c (struct z_candidate): Add rewritten and reversed methods.
553 (add_builtin_candidate): Handle SPACESHIP_EXPR.
554 (add_builtin_candidates): Likewise.
555 (add_candidates): Don't add a reversed candidate if the parms are
556 the same.
557 (add_operator_candidates): Split out from build_new_op_1. Handle
558 rewritten and reversed candidates.
559 (add_candidate): Swap conversions of reversed candidate.
560 (build_new_op_1): Swap them back. Build a second operation for
561 rewritten candidates.
562 (extract_call_expr): Handle rewritten calls.
563 (same_fn_or_template): New.
564 (joust): Handle rewritten and reversed candidates.
565 * class.c (add_implicitly_declared_members): Add implicit op==.
566 (classtype_has_op, classtype_has_defaulted_op): New.
567 * constexpr.c (cxx_eval_binary_expression): Handle SPACESHIP_EXPR.
568 (cxx_eval_constant_expression, potential_constant_expression_1):
569 Likewise.
570 * cp-gimplify.c (genericize_spaceship): New.
571 (cp_genericize_r): Use it.
572 * cp-objcp-common.c (cp_common_init_ts): Handle SPACESHIP_EXPR.
573 * decl.c (finish_function): Handle deleted function.
574 * decl2.c (grokfield): SET_DECL_FRIEND_CONTEXT on defaulted friend.
575 (mark_used): Check DECL_MAYBE_DELETED. Remove assumption that
576 defaulted functions are non-static members.
577 * error.c (dump_expr): Handle SPACESHIP_EXPR.
578 * method.c (type_has_trivial_fn): False for sfk_comparison.
579 (enum comp_cat_tag, struct comp_cat_info_t): New types.
580 (comp_cat_cache): New array variable.
581 (lookup_comparison_result, lookup_comparison_category)
582 (is_cat, cat_tag_for, spaceship_comp_cat)
583 (spaceship_type, genericize_spaceship)
584 (common_comparison_type, early_check_defaulted_comparison)
585 (comp_info, build_comparison_op): New.
586 (synthesize_method): Handle sfk_comparison. Handle deleted.
587 (get_defaulted_eh_spec, maybe_explain_implicit_delete)
588 (explain_implicit_non_constexpr, implicitly_declare_fn)
589 (defaulted_late_check, defaultable_fn_check): Handle sfk_comparison.
590 * name-lookup.c (get_std_name_hint): Add comparison categories.
591 * tree.c (special_function_p): Add sfk_comparison.
592 * typeck.c (cp_build_binary_op): Handle SPACESHIP_EXPR.
593
594 2019-11-05 Tim van Deurzen <tim@kompiler.org>
595
596 Add new tree code for the spaceship operator.
597 * cp-tree.def: Add new tree code.
598 * operators.def: New binary operator.
599 * parser.c: Add new token and tree code.
600
601 2019-09-15 Jason Merrill <jason@redhat.com>
602
603 * call.c (build_new_op_1): Don't apply any standard conversions to
604 the operands of a built-in operator. Don't suppress conversions in
605 cp_build_unary_op.
606 * typeck.c (cp_build_unary_op): Do integral promotions for enums.
607
608 2019-11-04 Jason Merrill <jason@redhat.com>
609
610 Use vec instead of raw array for built-in candidates.
611 * call.c (build_builtin_candidate): Take args in a vec.
612 (add_builtin_candidate, add_builtin_candidates): Likewise.
613 (build_conditional_expr_1, build_new_op_1): Adjust.
614
615 2019-11-04 Jason Merrill <jason@redhat.com>
616
617 * constexpr.c (explain_invalid_constexpr_fn): Show location of fn.
618
619 * pt.c (maybe_instantiate_noexcept): Only update clones if we
620 instantiated.
621
622 * typeck.c (contextual_conv_bool): New.
623
624 * name-lookup.c (lookup_qualified_name): Add wrapper overload taking
625 C string rather than identifier.
626 * parser.c (cp_parser_userdef_numeric_literal): Use it.
627 * rtti.c (emit_support_tinfos): Use it.
628 * cp-tree.h (ovl_op_identifier): Change to inline functions.
629 (build_x_binary_op): Add wrapper with fewer parms.
630
631 2019-11-05 Jason Merrill <jason@redhat.com>
632
633 * decl2.c (mark_used): Diagnose use of a function with unsatisfied
634 constraints here.
635 * typeck.c (cp_build_function_call_vec): Not here.
636
637 2019-11-05 Nathan Sidwell <nathan@acm.org>
638
639 PR c++/92370
640 * parser.c (cp_parser_error_1): Check EOF and UNKNOWN_LOCATION
641 when skipping over version control marker.
642
643 2019-11-05 Jakub Jelinek <jakub@redhat.com>
644
645 PR c++/92343
646 * constexpr.c (potential_constant_expression_1): Return true rather
647 than false for PREDICT_EXPR.
648
649 * decl.c (omp_declare_variant_finalize_one): Call
650 declare_simd_adjust_this not just on the context, but also on the
651 variant-id expression for methods. Don't call
652 cp_get_callee_fndecl_nofold, call cp_get_callee and only if it is
653 safe cp_get_fndecl_from_callee. Don't try to print as %qD
654 NULL in diagnostics.
655 * pt.c (tsubst_attribute): Handle "omp declare variant base"
656 attribute.
657 (tsubst_function_decl): Call omp_declare_variant_finalize
658 if there are any "omp declare variant base" attributes left.
659
660 2019-11-04 Kamlesh Kumar <kamleshbhalui@gmail.com>
661
662 PR c++/91979 - mangling nullptr expression
663 * mangle.c (write_template_arg_literal): Handle nullptr
664 mangling.
665
666 2019-11-04 Jason Merrill <jason@redhat.com>
667
668 * typeck.c (check_return_expr): Avoid redundant error.
669
670 2019-11-02 Paolo Carlini <paolo.carlini@oracle.com>
671
672 * typeck.c (composite_pointer_type): Add a const op_location_t&
673 parameter and use it in diagnostics.
674 (composite_pointer_error): Likewise.
675 (composite_pointer_type_r): Add a const op_location_t&
676 parameter and forward it.
677 (cp_build_binary_op): Adjust calls.
678 (common_pointer_type): Likewise.
679 * call.c (add_builtin_candidate): Likewise.
680 (build_conditional_expr_1): Likewise.
681 * cp-tree.h (composite_pointer_type): Update declaration.
682
683 * typeck.c (cxx_sizeof_expr): Use cp_expr_loc_or_input_loc
684 in permerror.
685 (cxx_alignof_expr): Likewise.
686 (lvalue_or_else): Likewise.
687
688 2019-11-02 Jakub Jelinek <jakub@redhat.com>
689
690 * decl.c (omp_declare_variant_finalize_one): Use
691 omp_get_context_selector instead of c_omp_get_context_selector.
692
693 PR c++/89640
694 * parser.c (cp_parser_decl_specifier_seq): Don't parse attributes
695 if CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR.
696
697 PR c++/88335 - Implement P1073R3: Immediate functions
698 * cp-tree.h (struct lang_decl_fn): Add immediate_fn_p bit.
699 (DECL_IMMEDIATE_FUNCTION_P, SET_DECL_IMMEDIATE_FUNCTION_P): Define.
700 (enum cp_decl_spec): Add ds_consteval.
701 (fold_non_dependent_expr): Add another tree argument defaulted to
702 NULL_TREE.
703 * name-lookup.h (struct cp_binding_level): Add immediate_fn_ctx_p
704 member.
705 * parser.c (cp_keyword_starts_decl_specifier_p): Adjust comments
706 for C++11 and C++20 specifiers. Handle RID_CONSTEVAL.
707 (CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR): Adjust comment.
708 (CP_PARSER_FLAGS_CONSTEVAL): New.
709 (cp_parser_skip_balanced_tokens): New forward declaration.
710 (cp_parser_lambda_declarator_opt): Handle ds_consteval. Set
711 current_binding_level->immediate_fn_ctx_p before parsing parameter
712 list if decl-specifier-seq contains consteval specifier.
713 (cp_parser_decl_specifier_seq): Handle RID_CONSTEVAL.
714 (cp_parser_explicit_instantiation): Diagnose explicit instantiation
715 with consteval specifier.
716 (cp_parser_init_declarator): For consteval or into flags
717 CP_PARSER_FLAGS_CONSTEVAL.
718 (cp_parser_direct_declarator): If CP_PARSER_FLAGS_CONSTEVAL, set
719 current_binding_level->immediate_fn_ctx_p in the sk_function_parms
720 scope.
721 (set_and_check_decl_spec_loc): Add consteval entry, formatting fix.
722 * call.c (build_addr_func): For direct calls to immediate functions
723 use build_address rather than decay_conversion.
724 (build_over_call): Evaluate immediate function invocations.
725 * error.c (dump_function_decl): Handle DECL_IMMEDIATE_FUNCTION_P.
726 * semantics.c (expand_or_defer_fn_1): Use tentative linkage and don't
727 call mark_needed for immediate functions.
728 * typeck.c (cxx_sizeof_or_alignof_expr): Likewise. Formatting fix.
729 (cp_build_addr_expr_1): Reject taking address of immediate function
730 outside of immediate function.
731 * decl.c (validate_constexpr_redeclaration): Diagnose consteval
732 vs. non-consteval or vice versa redeclaration. Use
733 SET_DECL_IMMEDIATE_FUNCTION_P if new_decl is immediate function.
734 (check_tag_decl): Use %qs with keyword string to simplify translation.
735 Handle ds_consteval.
736 (start_decl): Adjust diagnostics for static or thread_local variables
737 in immediate functions.
738 (grokfndecl): Call sorry_at on virtual consteval. Use %qs with keyword
739 to string to simplify translation. Diagnose consteval main. Use
740 SET_DECL_IMMEDIATE_FUNCTION_P for consteval.
741 (grokdeclarator): Handle consteval. Use %qs with keyword strings to
742 simplify translation. Use separate ifs instead of chained else if
743 for invalid specifiers. For constinit clear constinit_p rather than
744 constexpr_p.
745 * constexpr.c (find_immediate_fndecl): New function.
746 (cxx_eval_outermost_constant_expr): Allow consteval calls returning
747 void. Diagnose returning address of immediate function from consteval
748 evaluation.
749 (fold_non_dependent_expr_template): Add OBJECT argument, pass it
750 through to cxx_eval_outermost_constant_expr.
751 (fold_non_dependent_expr): Add OBJECT argument, pass it through to
752 fold_non_dependent_expr_template.
753 (fold_non_dependent_init): Adjust fold_non_dependent_expr_template
754 caller.
755 * method.c (defaulted_late_check): Adjust diagnostics for consteval.
756 * lambda.c (maybe_add_lambda_conv_op): Copy over
757 DECL_DECLARED_CONSTEXPR_P and DECL_IMMEDIATE_FUNCTION_P bits from
758 callop to both artificial functions.
759 * init.c (build_value_init): Don't do further processing if
760 build_special_member_call returned a TREE_CONSTANT. Formatting fix.
761
762 PR c++/91369 - Implement P0784R7: constexpr new
763 * cp-tree.h (CALL_FROM_NEW_OR_DELETE_P): Define.
764 * init.c (build_new_1, build_vec_delete_1, build_delete): Set
765 CALL_FROM_NEW_OR_DELETE_P on the CALL_EXPR to allocator functions.
766 * constexpr.c (is_std_allocator_allocate): Only allow
767 global replaceable allocator functions if CALL_FROM_NEW_OR_DELETE_P
768 or in std::allocate<T>::{,de}allocate.
769 (potential_constant_expression_1): Likewise.
770
771 2019-11-01 Nathan Sidwell <nathan@acm.org>
772
773 * class.c (check_field_decls): Refactor.
774
775 2019-10-31 Jakub Jelinek <jakub@redhat.com>
776
777 PR c++/90947
778 * cp-tree.h (type_initializer_zero_p): Declare.
779 * decl.c (reshape_init_array_1): Formatting fix.
780 * tree.c (type_initializer_zero_p): New function. Moved from
781 ../tree.c, use next_initializable_field, formatting fix. Return
782 false for TYPE_NON_AGGREGATE_CLASS types.
783
784 2019-10-30 Jason Merrill <jason@redhat.com>
785
786 PR c++/92268 - hard error satisfying return-type-requirement
787 * constraint.cc (type_deducible_p): Check for substitution failure.
788 (diagnose_compound_requirement): Adjust diagnostic.
789 * pt.c (do_auto_deduction): Don't pass cargs to
790 constraints_satisfied_p.
791
792 2019-10-30 Jakub Jelinek <jakub@redhat.com>
793
794 PR c++/91369 - Implement P0784R7: constexpr new
795 * constexpr.c (cxx_replaceable_global_alloc_fn): Don't return true
796 for placement new.
797 (cxx_placement_new_fn, is_std_construct_at): New functions.
798 (cxx_eval_call_expression): Allow placement new in std::construct_at.
799 (potential_constant_expression_1): Likewise.
800
801 * typeck.c (decl_in_std_namespace_p): Return true also for decls
802 in inline namespaces inside of std namespace.
803
804 2019-10-30 Bernd Edlinger <bernd.edlinger@hotmail.de>
805
806 PR c++/92024
807 * name-lookup.c (check_local_shadow): Shadowing TYPE_DECLs
808 is always a -Wshadow=compatible-local warning, unless
809 -Wshadow is used.
810
811 2019-10-30 Jason Merrill <jason@redhat.com>
812
813 * cxx-pretty-print.c (get_fold_operator): Use OVL_OP_INFO.
814
815 2019-10-30 Marek Polacek <polacek@redhat.com>
816
817 PR c++/92134 - constinit malfunction in static data member.
818 * decl2.c (grokfield): Set LOOKUP_CONSTINIT.
819
820 2019-10-30 Jakub Jelinek <jakub@redhat.com>
821
822 * cp-tree.h (omp_declare_variant_finalize, build_local_temp): Declare.
823 * decl.c: Include omp-general.h.
824 (declare_simd_adjust_this): Add forward declaration.
825 (omp_declare_variant_finalize_one, omp_declare_variant_finalize): New
826 function.
827 (cp_finish_decl, finish_function): Call omp_declare_variant_finalize.
828 * parser.c (cp_finish_omp_declare_variant): Adjust parsing of the
829 variant id-expression and propagate enough information to
830 omp_declare_variant_finalize_one in the attribute so that it can
831 finalize it.
832 * class.c (finish_struct): Call omp_declare_variant_finalize.
833 * tree.c (build_local_temp): No longer static, remove forward
834 declaration.
835
836 2019-10-30 Paolo Carlini <paolo.carlini@oracle.com>
837
838 * typeck.c (cp_build_modify_expr): Prefer error + inform to
839 error + error in one place.
840 (get_delta_difference_1): Likewise.
841 (get_delta_difference): Likewise, in two places.
842
843 2019-10-29 Paolo Carlini <paolo.carlini@oracle.com>
844
845 * typeck.c (build_x_unary_op): Use the location_t argument in
846 three error_at.
847
848 2019-10-29 Marek Polacek <polacek@redhat.com>
849
850 PR c++/90998 - ICE with copy elision in init by ctor and -Wconversion.
851 * call.c (joust): Don't attempt to warn if ->second_conv is null.
852
853 2019-10-29 Jakub Jelinek <jakub@redhat.com>
854
855 PR c++/92201
856 * cp-gimplify.c (cp_gimplify_expr): If gimplify_to_rvalue changes the
857 function pointer type, re-add cast to the original one.
858
859 2019-10-29 Marek Polacek <polacek@redhat.com>
860
861 PR c++/91548 - fix detecting modifying const objects for ARRAY_REF.
862 * constexpr.c (cxx_eval_store_expression): Don't call
863 modifying_const_object_p for ARRAY_REF.
864
865 2019-10-29 Richard Sandiford <richard.sandiford@arm.com>
866
867 * cp-objcp-common.h (cxx_simulate_enum_decl): Declare.
868 (LANG_HOOKS_SIMULATE_ENUM_DECL): Define to the above.
869 * decl.c (cxx_simulate_enum_decl): New function.
870
871 2019-10-29 Richard Sandiford <richard.sandiford@arm.com>
872
873 * cp-tree.h (cxx_simulate_builtin_function_decl): Declare.
874 * decl.c (cxx_simulate_builtin_function_decl): New function.
875 * cp-objcp-common.h (LANG_HOOKS_SIMULATE_BUILTIN_FUNCTION_DECL):
876 Define to the above.
877
878 2019-10-28 Martin Sebor <msebor@redhat.com>
879
880 PR c/66970
881 * cp-objcp-common.c (names_builtin_p): Define new function.
882
883 2019-10-28 Nathan Sidwell <nathan@acm.org>
884
885 * parser.h (struct cp_token): Drop {ENUM,BOOL}_BITFIELD C-ism.
886 Add tree_check_p flag, use as nested union discriminator.
887 (struct cp_lexer): Add saved_type & saved_keyword fields.
888 * parser.c (eof_token): Delete.
889 (cp_lexer_new_main): Always init last_token to last token of
890 buffer.
891 (cp_lexer_new_from_tokens): Overlay EOF token at end of range.
892 (cp_lexer_destroy): Restore token under the EOF.
893 (cp_lexer_previous_token_position): No check for eof_token here.
894 (cp_lexer_get_preprocessor_token): Clear tree_check_p.
895 (cp_lexer_peek_nth_token): Check CPP_EOF not eof_token.
896 (cp_lexer_consume_token): Assert not CPP_EOF, no check for
897 eof_token.
898 (cp_lexer_purge_token): Likewise.
899 (cp_lexer_purge_tokens_after): No check for EOF token.
900 (cp_parser_nested_name_specifier, cp_parser_decltype)
901 (cp_parser_template_id): Set tree_check_p.
902
903 2019-10-24 Jakub Jelinek <jakub@redhat.com>
904
905 * decl2.c (cplus_decl_attributes): Add "omp declare target block"
906 attribute in between declare target and end declare target
907 pragmas.
908
909 * call.c (convert_arg_to_ellipsis): Add missing space in string
910 literal.
911
912 2019-10-24 Marek Polacek <polacek@redhat.com>
913
914 * decl.c (reshape_init_r): Add missing space.
915
916 2019-10-24 Nathan Sidwell <nathan@acm.org>
917
918 * pt.c (reduce_template_parm_level): Attach the new TPI to the new
919 DECL.
920 (convert_generic_types_to_packs): Pass the copied type to
921 reduce_templatE_parm_level.
922
923 2019-10-23 Nathan Sidwell <nathan@acm.org>
924
925 * cp-tree.c (CPTI_STD_IDENTIFIER): Delete.
926 (std_identifier): Delete.
927 (DECL_NAME_SPACE_STD_P): Compare against std_node.
928 * decl.c (initialize_predefined_identifiers): 'std' is not needed.
929 (cxx_init_decl_processing): Adjust creation of ::std. Use
930 {push,pop}_nested_namespace.
931 (cxx_builtin_function): Use {push,pop}_nested_namespace.
932 * except.c (init_exception_processing): Likewise.
933 * rtti.c (init_rtti_processing): Likewise.
934
935 2019-10-23 Jason Merrill <jason@redhat.com>
936
937 Implement P1286R2, Contra CWG1778
938 * method.c (defaulted_late_check): Don't check explicit
939 exception-specification on defaulted function.
940 (after_nsdmi_defaulted_late_checks): Remove.
941 * parser.h (struct cp_unparsed_functions_entry): Remove classes.
942 * parser.c (unparsed_classes): Remove.
943 (push_unparsed_function_queues, cp_parser_class_specifier_1):
944 Adjust.
945
946 2019-10-23 Jakub Jelinek <jakub@redhat.com>
947
948 * constexpr.c (cxx_eval_constant_expression) <case CLEANUP_STMT>:
949 Temporarily change input_location to CLEANUP_STMT location.
950
951 2019-10-22 Jakub Jelinek <jakub@redhat.com>
952
953 PR tree-optimization/85887
954 * decl.c (expand_static_init): Drop ECF_LEAF from __cxa_guard_acquire
955 and __cxa_guard_release.
956
957 2019-10-22 Marc Glisse <marc.glisse@inria.fr>
958
959 PR c++/85746
960 * constexpr.c (cxx_eval_builtin_function_call): Only set
961 force_folding_builtin_constant_p if manifestly_const_eval.
962
963 2019-10-22 Richard Sandiford <richard.sandiford@arm.com>
964
965 * cp-tree.h (STF_USER_VISIBLE): New constant.
966 (strip_typedefs, strip_typedefs_expr): Take a flags argument.
967 * tree.c (strip_typedefs, strip_typedefs_expr): Likewise,
968 updating mutual calls accordingly. When STF_USER_VISIBLE is true,
969 only look through typedefs if user_facing_original_type_p.
970 * error.c (dump_template_bindings, type_to_string): Pass
971 STF_USER_VISIBLE to strip_typedefs.
972 (dump_type): Likewise, unless pp_c_flag_gnu_v3 is set.
973
974 2019-10-21 Kamlesh Kumar <kamleshbhalui@gmail.com>
975 Jason Merrill <jason@redhat.com>
976
977 PR c++/83534 - typeinfo of noexcept function
978 * rtti.c (get_tinfo_decl_dynamic): Do not call
979 TYPE_MAIN_VARIANT for function.
980 (get_typeid): Likewise.
981
982 2019-10-21 Paolo Carlini <paolo.carlini@oracle.com>
983
984 * parser.c (cp_parser_class_head): Improve error recovery upon
985 extra qualification error.
986
987 2019-10-21 Jakub Jelinek <jakub@redhat.com>
988
989 PR c++/92015
990 * constexpr.c (cxx_eval_component_reference, cxx_eval_bit_field_ref):
991 Use STRIP_ANY_LOCATION_WRAPPER on CONSTRUCTOR elts.
992
993 2019-10-21 Marek Polacek <polacek@redhat.com>
994
995 PR c++/92062 - ODR-use ignored for static member of class template.
996 * pt.c (has_value_dependent_address): Strip location wrappers.
997
998 2019-10-21 Marek Polacek <polacek@redhat.com>
999
1000 PR c++/92106 - ICE with structured bindings and -Wreturn-local-addr.
1001 * typeck.c (maybe_warn_about_returning_address_of_local): Avoid
1002 recursing on null initializer and return false instead.
1003
1004 2019-10-17 JeanHeyd Meneide <phdofthehouse@gmail.com>
1005
1006 Implement p1301 [[nodiscard("should have a reason")]] + p1771 DR
1007 * tree.c (handle_nodiscard_attribute): Handle C++2a nodiscard
1008 string message.
1009 (std_attribute_table) Increase nodiscard argument handling
1010 max_length from 0 to 1.
1011 * parser.c (cp_parser_check_std_attribute): Add requirement
1012 that nodiscard only be seen once in attribute-list.
1013 (cp_parser_std_attribute): Check that empty parenthesis lists are
1014 not specified for attributes that have max_length > 0 (e.g.
1015 [[attr()]]).
1016 * cvt.c (maybe_warn_nodiscard): Add nodiscard message to
1017 output, if applicable.
1018 (convert_to_void): Allow constructors to be nodiscard-able (P1771).
1019
1020 2019-10-18 Nathan Sidwell <nathan@acm.org>
1021
1022 * cp-tree.h (struct lang_type): Remove was_anonymous.
1023 (TYPE_WAS_UNNAMED): Implement by checking TYPE_DECL &
1024 TYPE_STUB_DECL.
1025 * decl.c (name_unnamed_type): Don't set TYPE_WAS_UNNAMED.
1026
1027 2019-10-17 Paolo Carlini <paolo.carlini@oracle.com>
1028
1029 * decl.c (grokfndecl): Remove redundant use of in_system_header_at.
1030 (compute_array_index_type_loc): Likewise.
1031 (grokdeclarator): Likewise.
1032 * error.c (cp_printer): Likewise.
1033 * lambda.c (add_default_capture): Likewise.
1034 * parser.c (cp_parser_primary_expression): Likewise.
1035 (cp_parser_selection_statement): Likewise.
1036 (cp_parser_toplevel_declaration): Likewise.
1037 (cp_parser_enumerator_list): Likewise.
1038 (cp_parser_using_declaration): Likewise.
1039 (cp_parser_member_declaration): Likewise.
1040 (cp_parser_exception_specification_opt): Likewise.
1041 (cp_parser_std_attribute_spec): Likewise.
1042 * pt.c (do_decl_instantiation): Likewise.
1043 (do_type_instantiation): Likewise.
1044 * typeck.c (cp_build_unary_op): Likewise.
1045
1046 * decl.c (check_tag_decl): Pass to in_system_header_at the same
1047 location used for the permerror.
1048 (grokdeclarator): Likewise.
1049
1050 * decl.c (check_tag_decl): Use locations[ds_typedef] in error_at.
1051
1052 2019-10-17 Jason Merrill <jason@redhat.com>
1053
1054 * cp-gimplify.c (cp_gimplify_expr): Use get_initialized_tmp_var.
1055 (gimplify_to_rvalue): Remove default NULL argument.
1056
1057 2019-10-17 Nathan Sidwell <nathan@acm.org>
1058
1059 * decl.c (builtin_function_1): Merge into ...
1060 (cxx_builtin_function): ... here. Nadger the decl before maybe
1061 copying it. Set the context.
1062 (cxx_builtin_function_ext_scope): Push to top level, then call
1063 cxx_builtin_function.
1064
1065 2019-10-16 Luis Machado <luis.machado@linaro.org>
1066
1067 * cp-gimplify.c: Fix reference to non-existing tree-gimple.c file.
1068
1069 2019-10-16 Jakub Jelinek <jakub@redhat.com>
1070
1071 * decl.c (cxx_maybe_build_cleanup): When clearing location of cleanup,
1072 if cleanup is a nop, clear location of its operand too.
1073
1074 2019-10-15 Andrew Sutton <asutton@lock3software.com>
1075
1076 Finish moving constraint and logic functionality of out pt.c.
1077 Reimplement and re-enable subsumption caching.
1078
1079 * config-lang.in (gtfiles): Add logic.cc.
1080 * constraint.cc (atomic_constraints_identical_p): Add assertions.
1081 (hash_atomic_constraint): Likewise.
1082 (constraints_equivalent_p): New.
1083 (inchash::add_constraint): New.
1084 (iterative_hash_constraint): New.
1085 (decl_constraints): Moved from pt.c.
1086 (get_constraints): Likewise.
1087 (set_constraints): Likewise.
1088 (remove_constraints): Likewise.
1089 * cp-tree.h (CONSTR_P): New.
1090 (init_constraint_processing): Remove.
1091 (constraints_equivalent_p, iterative_hash_constraint): Declare.
1092 * decl.c (cxx_init_decl_processing): Don't initialize constraints.
1093 * logic.cc (subsumption_entry): Moved from pt.c.
1094 (subsumption_hasher): Likewise.
1095 (subsumption_cache): Likewise.
1096 (lookup_subsumption): Likewise.
1097 (save_subsumption): Likewise.
1098 (subsumes_constraints_nonnull): Use subsumption cache.
1099 * pt.c: Move aforementioned declarations out of this file.
1100 (init_constraint_processing): Remove.
1101
1102 2019-10-15 Andrew Sutton <asutton@lock3software.com>
1103
1104 * parser.c (cp_parser_constructor_declarator_p): Pass an empty
1105 decl-specifier-seq to make sure we parse type constraints as part
1106 of a type-specifier.
1107
1108 2019-10-15 Nathan Sidwell <nathan@acm.org>
1109
1110 * class.c (build_clones): Break out of clone_function_decl. Just
1111 build the clones.
1112 (clone_function_decl): Call build_clones, then maybe add them to
1113 the method vector.
1114
1115 * class.c (build_clone): Refactor to clarify recursiveness.
1116
1117 2019-10-14 Jason Merrill <jason@redhat.com>
1118
1119 PR c++/91930 - ICE with constrained inherited default ctor.
1120 * name-lookup.c (do_class_using_decl): Set TYPE_HAS_USER_CONSTRUCTOR
1121 for inherited constructor.
1122
1123 2019-10-14 Paolo Carlini <paolo.carlini@oracle.com>
1124
1125 * decl.c (check_tag_decl): Use DECL_SOURCE_LOCATION.
1126
1127 2019-10-14 Jakub Jelinek <jakub@redhat.com>
1128
1129 PR c++/92084
1130 * semantics.c (handle_omp_array_sections_1): Temporarily disable
1131 -fstrong-eval-order also for in_reduction and task_reduction clauses.
1132
1133 * parser.c (cp_parser_omp_all_clauses): Change bool NESTED_P argument
1134 into int NESTED, if it is 2, diagnose missing commas in between
1135 clauses.
1136 (cp_parser_omp_context_selector): Pass 2 as last argument to
1137 cp_parser_omp_all_clauses.
1138
1139 2019-10-12 Jakub Jelinek <jakub@redhat.com>
1140
1141 * parser.c (cp_parser_omp_context_selector): Improve error recovery.
1142 For simd properties, put them directly into TREE_VALUE.
1143 (cp_finish_omp_declare_variant): Add "omp declare variant base"
1144 attribute rather than "omp declare variant".
1145
1146 2019-10-11 Marek Polacek <polacek@redhat.com>
1147
1148 PR c++/92049 - extra error with -fchecking=2.
1149 * pt.c (build_non_dependent_expr): Call fold_non_dependent_expr
1150 with tf_none.
1151
1152 2019-10-11 Paolo Carlini <paolo.carlini@oracle.com>
1153
1154 * typeck.c (cp_build_binary_op): Do not handle RROTATE_EXPR and
1155 LROTATE_EXPR.
1156 * constexpr.c (cxx_eval_constant_expression): Likewise.
1157 (potential_constant_expression_1): Likewise.
1158 * pt.c (tsubst_copy): Likewise.
1159
1160 2019-10-11 Jason Merrill <jason@redhat.com>
1161
1162 * decl2.c (mark_used): Don't clobber DECL_SOURCE_LOCATION on
1163 explicitly defaulted functions.
1164 * method.c (synthesize_method): Likewise.
1165
1166 2019-10-11 Jakub Jelinek <jakub@redhat.com>
1167
1168 PR c++/91987
1169 * decl2.c (grok_array_decl): For -fstrong-eval-order, when array ref
1170 operands have been swapped and at least one operand has side-effects,
1171 revert the swapping before calling build_array_ref.
1172 * typeck.c (cp_build_array_ref): For non-ARRAY_TYPE array ref with
1173 side-effects on the index operand, if -fstrong-eval-order use
1174 save_expr around the array operand.
1175 (cp_build_binary_op): For shifts with side-effects in the second
1176 operand, wrap first operand into SAVE_EXPR and evaluate it before
1177 the shift.
1178 * semantics.c (handle_omp_array_sections_1): Temporarily disable
1179 flag_strong_eval_order during OMP_CLAUSE_REDUCTION array section
1180 processing.
1181 * cp-gimplify.c (gimplify_to_rvalue): New function.
1182 (cp_gimplify_expr): Use it.
1183
1184 2019-10-10 Marek Polacek <polacek@redhat.com>
1185
1186 * typeck.c (comp_ptr_ttypes_real): Change the return type to bool.
1187 Use false instead of 0.
1188
1189 2019-10-10 Jakub Jelinek <jakub@redhat.com>
1190
1191 * parser.h (struct cp_omp_declare_simd_data): Add variant_p member.
1192 * parser.c (cp_ensure_no_omp_declare_simd): Handle both declare simd
1193 and declare variant.
1194 (cp_parser_oacc_all_clauses): Formatting fix.
1195 (cp_parser_omp_all_clauses): Add NESTED_P argument, if true, terminate
1196 processing on closing paren and don't skip to end of pragma line.
1197 (cp_parser_omp_declare_simd): Add VARIANT_P argument. Handle also
1198 declare variant.
1199 (omp_construct_selectors, omp_device_selectors,
1200 omp_implementation_selectors, omp_user_selectors): New variables.
1201 (cp_parser_omp_context_selector,
1202 cp_parser_omp_context_selector_specification,
1203 cp_finish_omp_declare_variant): New functions.
1204 (cp_parser_late_parsing_omp_declare_simd): Handle also declare variant.
1205 (cp_parser_omp_declare): Handle declare variant.
1206
1207 2019-10-09 Jason Merrill <jason@redhat.com>
1208
1209 * cp-tree.h (template_info_decl_check): Check ENABLE_TREE_CHECKING.
1210
1211 2019-10-09 Marek Polacek <polacek@redhat.com>
1212
1213 PR c++/91364 - P0388R4: Permit conversions to arrays of unknown bound.
1214 PR c++/69531 - DR 1307: Differently bounded array parameters.
1215 PR c++/88128 - DR 330: Qual convs and pointers to arrays of pointers.
1216 * call.c (build_array_conv): Build ck_identity at the beginning
1217 of the conversion.
1218 (standard_conversion): Pass bounds_none to comp_ptr_ttypes_const.
1219 (maybe_warn_array_conv): New.
1220 (convert_like_real): Call it. Add an error message about converting
1221 from arrays of unknown bounds.
1222 (conv_get_original_expr): New.
1223 (nelts_initialized_by_list_init): New.
1224 (conv_binds_to_array_of_unknown_bound): New.
1225 (compare_ics): Implement list-initialization ranking based on
1226 array sizes, as specified in DR 1307 and P0388R.
1227 * cp-tree.h (comp_ptr_ttypes_const): Adjust declaration.
1228 (compare_bounds_t): New enum.
1229 * typeck.c (comp_array_types): New bool and compare_bounds_t
1230 parameters. Use them.
1231 (structural_comptypes): Adjust the call to comp_array_types.
1232 (similar_type_p): Handle ARRAY_TYPE.
1233 (build_const_cast_1): Pass bounds_none to comp_ptr_ttypes_const.
1234 (comp_ptr_ttypes_real): Don't check cv-quals of ARRAY_TYPEs. Use
1235 comp_array_types to compare array types. Look through arrays as per
1236 DR 330.
1237 (comp_ptr_ttypes_const): Use comp_array_types to compare array types.
1238 Look through arrays as per DR 330.
1239
1240 2019-10-09 Marek Polacek <polacek@redhat.com>
1241
1242 PR c++/92032 - DR 1601: Promotion of enum with fixed underlying type.
1243 * call.c (standard_conversion): When converting an enumeration with
1244 a fixed underlying type to the underlying type, give it the cr_promotion
1245 rank.
1246 (compare_ics): Implement a tiebreaker as per CWG 1601.
1247
1248 2019-10-08 Andrew Sutton <asutton@lock3software.com>
1249 Jason Merrill <jason@redhat.com>
1250
1251 Update the concepts implementation to conform to the C++20
1252 specification, improve compile times, and generally clean up
1253 the implementation.
1254 * call.c (build_new_function_call): Don't evaluate concepts here.
1255 (constraint_failure): Don't record the template.
1256 (print_z_candidate): Don't extract the template.
1257 * class.c (add_method): When overloading, hide ineligible special
1258 member fns.
1259 (check_methods): Set TYPE_HAS_COMPLEX_* here.
1260 * constexpr.c (cxx_eval_constant_expression): Evaluate concepts.
1261 (maybe_initialize_fundef_copies_table): Remove.
1262 (get_fundef_copy): Use hash_map_safe_get_or_insert.
1263 (clear_cv_and_fold_caches): Clear the satisfaction cache.
1264 * constraint.cc (known_non_bool_p): New.
1265 (parsing_constraint_expression_sentinel): Renamed from
1266 expanding_constraint_sentinel.
1267 (check_constraint_operands): New.
1268 (check_constraint_atom): New.
1269 (finish_constraint_binary_op): New.
1270 (finish_constraint_or_expr): Likewise.
1271 (finish_constraint_and_expr): Likewise.
1272 (finish_constraint_primary_expr): Likewise.
1273 (combine_constraint_expressions): New.
1274 (finish_requires_expr): Add location parm.
1275 (get_concept_definition): Return the initializer of concept definitions.
1276 (get_template_head_requirements): New.
1277 (get_trailing_function_requirements): New.
1278 (deduce_constrained_parameter): Check if the identifier or template-id
1279 is a concept definition.
1280 (resolve_concept_definition_check): Removed.
1281 (resolve_variable_concept_check): Removed.
1282 (resolve_concept_check): New.
1283 (resolve_constraint_check): Handle concept definitions.
1284 converting arguments.
1285 (function_concept_check_p): Removed.
1286 (variable_concept_check_p): Removed.
1287 (unpack_concept_check): New.
1288 (get_concept_check_template): New.
1289 (build_call_check): Moved and renamed to build_function_check.
1290 (build_concept_check_arguments): make static.
1291 (build_function_check): Always do overload resolution
1292 in order to force conversion of template arguments (i.e., actually
1293 check that the use of a concept is valid).
1294 (build_standard_check): Renamed from build_real_concept_check.
1295 (build_real_concept_check): Build checks for C++2a concepts by
1296 (build_wildcard_concept_check): New.
1297 (build_concept_check): Use build_real_concept_check. New overload.
1298 (build_constraints): Save expressions, not normalized constraints.
1299 (build_concept_id): New. Pass tf_warning_or_error.
1300 (build_type_constraint): New.
1301 (finish_type_constraints): New.
1302 (associate_classtype_constraints): Also add constraints to union
1303 types. Note the original declaration in errors. Don't return
1304 error_mark_node in order to avoid an assertion later.
1305 (push_down_pack_expansion): Remove.
1306 (finish_shorthand_constraint): Make fold expressions, not naked
1307 parameter packs. Always apply the constraint to each template argument.
1308 (check_introduction_list): New. Fail if not enough
1309 names are introduced.
1310 (finish_template_introduction): Don't normalize constraints. Pass
1311 tsubst flags. Check for insufficient introductions.
1312 (placeholder_extract_concept_and_args): Handle the template-id case.
1313 Unpack function concept checks correctly.
1314 (tsubst_simple_requirement): Return errors if they occur. Don't
1315 process as a template.
1316 (tsubst_type_requirement): Likewise.
1317 (type_deducible_p): New. Wrap the input expression in parens for the
1318 purpose of deduction.
1319 (expression_convertible_t): New.
1320 (tsubst_compound_requirement): Use new deduction, conversion predicates.
1321 (tsubst_nested_requirement): Return errors if they occur. Don't
1322 process as a template. Instantiate and evaluate the nested requirement.
1323 (tsubst_valid_expression_requirement): New.
1324 (tsubst_simple_requirement): Use tsubst_valid_expression_requirement.
1325 (tsubst_compound_requirement): Use tsubst_valid_expression_requirement.
1326 (check_constaint_variables): New.
1327 (tsubst_constraint_variables): Check that type substitutions are valid.
1328 (tsubst_requires_expr): Likewise. Produce new requires-exprs during
1329 template substitution. Copy the previous local specialization stack,
1330 so references to non-local parameters can be found. Use cp_unevaluated.
1331 (tsubst_constraint): New. Don't evaluate concept checks.
1332 (subst_info): New.
1333 (norm_info): New. Used to build a normalization tree for concept check
1334 diagnostics.
1335 (debug_parameter_mapping): New.
1336 (debug_argument_list): New.
1337 (expand_concept): Removed.
1338 (normalize_logical_operation): Pass subst_info through call.
1339 (normalize_pack_expansion): Remove.
1340 (normalize_simple_requirement): Removed
1341 (normalize_type_requirement): Removed
1342 (normalize_compound_requirement): Removed
1343 (normalize_nested_requirement): Removed
1344 (normalize_requirement): Removed
1345 (normalize_requirements): Removed
1346 (normalize_requires_expression): Removed
1347 (normalize_variable_concept_check): Removed.
1348 (normalize_function_concept_check): Removed.
1349 (normalize_concept_check): Merged all normalize_*_check here.
1350 Substitute through written template arguments before normalizing the
1351 definition. Only substitute the innermost template arguments.
1352 (check_for_logical_overloads): Delete.
1353 (map_arguments): New. Associate template parameters with arguments.
1354 (build_parameter_mapping): New. Extract used parameters.
1355 (normalize_expression): Rewrite.
1356 (normalize_conjunction): Removed
1357 (normalize_disjunction): Removed
1358 (normalize_predicate_constraint): Removed
1359 (normalize_parameterized_constraint): Removed
1360 (normalized_map): New variable.
1361 (get_normalized_constraints): New entry point for normalization.
1362 Establishes a timer.
1363 (get_normalized_constraints_from_info): New.
1364 (get_normalized_constraints_from_decl): New. Turn on template processing
1365 prior to normalization. Handle inheriting ctors. Build the
1366 normalization arguments from the full set of template parameters of the
1367 most general template. This guarantees that we have no concrete arguments
1368 in the parameter mapping (e.g., from template members of class
1369 templates). Cache normalizations.
1370 (normalize_concept_definition): New. Cache normalizations.
1371 (normalize_template_requirements): New.
1372 (normalize_nontemplate_requirements): New.
1373 (normalize_constraint_expression): New.
1374 (tsubst_parameter_mapping): New.
1375 (get_mapped_args): New.
1376 (parameter_mapping_equivalent_p): New. Use template_args_equal.
1377 (atomic_constraints_identical_p): New.
1378 (hash_atomic_constraint): New.
1379 (satisfying_constraint_p): New. Guard against recursive evaluation of
1380 constraints during satisfaction.
1381 (satisfy_conjunction): New.
1382 (satisfy_disjunction): New.
1383 (sat_entry): New class for hashing satisfaction results.
1384 (sat_hasher): New hash traits.
1385 (sat_cache): New.
1386 (get_satisfaction): New. Returns cached satisfaction result.
1387 (save_satisfaction): New. Caches a satisfaction result.
1388 (clear_satisfaction_cache): New.
1389 (satisfaction_cache): New. Helps manage satisfaction cache requests.
1390 (decl_satisfied_cache): New.
1391 (satisfy_atom): New.
1392 (satisfy_constraint_r): New.
1393 (satisfy_constraint): Use new satisfaction algorithm.
1394 (evaluate_concept_check): New.
1395 (evaluate_concept): Removed.
1396 (evaluate_function_concept): Removed.
1397 (evaluate_variable_concept): Removed.
1398 (satisfy_constraint_expression): New.
1399 (constraint_expression_satisfied_p): New.
1400 (constraints_satisfied_p): Use strip_inheriting_ctors. Use
1401 push_/pop_access_scope.
1402 (more_constrained): Normalize before calling out to subsumption. Allow
1403 classes as arguments.
1404 (strictly_subsumes): Allow non-templates as arguments. Accept a new
1405 template argument.
1406 (weakly_subsumes): New.
1407 (at_least_as_constrained): Removed.
1408 (diagnose_other_expression): Removed.
1409 (diagnose_predicate_constraint): Removed.
1410 (diagnose_pack_expansion): Removed.
1411 (diagnose_check_constraint): Removed.
1412 (diagnose_logical_constraint): Removed.
1413 (diagnose_expression_constraint): Removed.
1414 (diagnose_type_constraint): Removed.
1415 (diagnose_implicit_conversion_constraint): Removed.
1416 (diagnose_argument_deduction_constraint): Removed.
1417 (diagnose_exception_constraint): Removed.
1418 (diagnose_parameterized_constraint): Removed.
1419 (diagnose_argument_deduction_constraint): Removed.
1420 (diagnose_argument_deduction_constraint): Removed.
1421 (diagnose_argument_deduction_constraint): Removed.
1422 (diagnose_trait_expr): New.
1423 (diagnose_requires_expr): New.
1424 (diagnose_atomic_constraint): New.
1425 (diagnose_valid_expression) Stop wrongly diagnosing valid expressions.
1426 Don't substitute as if in template decls. This causes substitution
1427 to generate expressions that aren't suitable for use with the noexcept
1428 routines.
1429 (diagnose_valid_type) Likewise.
1430 (diagnose_compound_requirement) Actually emit diagnostics for
1431 the causes of errors.Call force_paren_expr_uneval.
1432 (diagnose_declaration_constraints): Turn on template processing to
1433 suppress certain analyses.
1434 * cp-objcp-common.c (cp_common_init_ts): Make concepts typed.
1435 (cp_get_debug_type): Use hash_map_safe_*.
1436 * cp-tree.h: New function declarations for semantic actions, other
1437 facilities. Remove declaration no longer used or needed. Remove
1438 unused _CONSTR macros.
1439 (LANG_DECL_HAS_MIN): Add CONCEPT_DECL.
1440 (template_info_decl_check): Factor macro check into an inline function.
1441 (DECL_TEMPLATE_INFO): Use new check facility.
1442 (finish_concept_definition): New. Don't invalid concept declarations
1443 with invalid initializers.
1444 (find_template_parameters): New.
1445 (concept_definition_p): New.
1446 (concept_check_p): New.
1447 (variable_concept_check_p): New.
1448 (force_paren_expr_uneval): New.
1449 (ovl_iterator::using_p): A USING_DECL by itself was also
1450 introduced by a using-declaration.
1451 (struct tree_template_info): Use tree_base instead of
1452 tree_common. Add tmpl and args fields.
1453 (TI_TEMPLATE, TI_ARGS): Adjust.
1454 (DECLTYPE_FOR_INIT_CAPTURE): Remove.
1455 (CONSTR_CHECK, CONSTR_INFO, CONSTR_EXPR, CONSTR_CONTEXT): New.
1456 (ATOMIC_CONSTR_MAP, TRAIT_EXPR_LOCATION): New.
1457 (struct tree_trait_expr): Add locus field.
1458 (enum tsubst_flags): Add tf_norm as a hint to generate normalization
1459 context when diagnosing constraint failure.
1460 * cp-tree.def: Remove unused _CONSTR nodes and rename PRED_CONSTR
1461 to ATOMIC_CONSTR.
1462 (CONCEPT_DECL): New.
1463 * cxx-pretty-print.c: Remove constraint printing code.
1464 (pp_cxx_concept_definition): New.
1465 (pp_cxx_template_declaration): Print concept definitions.
1466 (pp_cxx_check_constraint): Update printing for concept definitions.
1467 (pp_cxx_nested_name_specifier): Fix a weird
1468 case where we're printing '::::' for concepts.
1469 (simple_type_specifier): Print requirements for placeholder types.
1470 (pp_cxx_constrained_type_spec): Print the associated requirements of
1471 a placeholder type.
1472 (pp_cxx_compound_requirement): Add space before the '->'.
1473 (pp_cxx_parameter_mapping): Print the parameter mapping.
1474 (pp_cxx_atomic_constraint): Use the function above.
1475 * decl.c (redeclaration_error_message): New error for concepts.
1476 (grokdeclarator): Check for and disallow decltype(auto) in parameter
1477 declarations.
1478 (grokfndecl): Don't normalize constraints. Add check for constraints
1479 on declaration.
1480 (grokvardecl): Don't normalize constraints.
1481 (grok_special_member_properties): Don't set TYPE_HAS_COMPLEX_*.
1482 (function_requirements_equivalent_p): New. Compare trailing
1483 requires clauses. Compare combined constraints in pre-C++20 mode.
1484 (decls_match): Compare trailing requires clauses. Compare template
1485 heads for function templates. Remove old constraint comparison.
1486 Simplify comparison of functions, function templates.
1487 (duplicate_function_template_decls): New. Refactor a nasty if
1488 condition into a single predicate.
1489 (require_deduced_type): Don't complain if we already complained about
1490 deduction failure.
1491 (finish_function): Perform auto deduction to ensure that constraints
1492 are checked even when functions contain no return statements. Only do
1493 auto deduction if we haven't previously seen any return statements.
1494 This prevents multiple diagnostics of the same error.
1495 (store_decomp_type): Remove.
1496 (cp_finish_decomp): Use hash_map_safe_put.
1497 * error.c: Remove constraint printing code.
1498 (dump_decl): Dump concept definitions. Handle wildcard declarations.
1499 (dump_template_decl): Likewise.
1500 (dump_type): Print associated requirements for placeholder
1501 types.
1502 (rebuild_concept_check): New.
1503 (maybe_print_single_constraint_context): New.
1504 (maybe_print_constraint_context): Recursively print nested contexts.
1505 * init.c (get_nsdmi): Use hash_map_safe_*.
1506 * lambda.c (maybe_add_lambda_conv_op): Bail if deduction failed.
1507 (add_capture): Copy parameter packs from init.
1508 (lambda_capture_field_type): Always use auto for init-capture.
1509 * logic.cc: Completely rewrite.
1510 (constraint_hash): New.
1511 (clause/ctor): Save atoms in the hash table.
1512 (replace): Save atoms during replacement.
1513 (insert): Save atoms during insertion.
1514 (contains): Only search the hash table for containment.
1515 (clause): Keep a hash of atomic constraints.
1516 (clause::clause): Explicitly copy the hash table when copying.
1517 (disjunction_p, conjunction_p, atomic_p, dnf_size, cnf_size): New.
1518 (diagnose_constraint_size): New.
1519 (subsumes_constraints_nonnull): Compare the sizes of normalized formula
1520 to determine the cheapest decomposition.
1521 * name-lookup.c (diagnose_name_conflict): Diagnose name issues with
1522 concepts.
1523 (matching_fn_p): Check constraints.
1524 (push_class_level_binding_1): Move overloaded functions case down,
1525 accept FUNCTION_DECL as target_decl.
1526 * parser.c (enum required_token): New required token for auto.
1527 (make_location): Add overload taking lexer as last parm.
1528 (cp_parser_required_error): Diagnose missing auto.
1529 (cp_parser_diagnose_ungrouped_constraint_plain): New.
1530 (cp_parser_diagnose_ungrouped_constraint_plain): New.
1531 (cp_parser_constraint_primary_expression): New. Tentatively parse the
1532 primary expression. If that fails tentatively parse a lower
1533 precedence expression in order to diagnose the error.
1534 (cp_parser_check_non_logical_constraint): New. Performs a trial
1535 parse of the right-hand-side of non-logical operators in order to
1536 generate good diagnostics.
1537 (cp_parser_constraint_logical_and_expression): New.
1538 (cp_parser_constraint_logical_or_expression): New.
1539 (cp_parser_requires_clause_expression): New.
1540 (cp_parser_requires_clause): Renamed to cp_parser_constraint_expression.
1541 (cp_parser_requires_clause_opt): Parse the requires-clause differently
1542 in -fconcepts and -std=c++2a modes.
1543 (cp_parser_requirement_list): Rename to cp_parser_requirement_seq.
1544 Rewrite so that semicolons are parsed
1545 along with requirements, not the sequence.
1546 (cp_parser_simple_requirement): Expect a semicolon at end.
1547 (cp_parser_compound_requirement): Expect a semicolon at end. Only
1548 allow trailing-return-type with -fconcepts-ts.
1549 (cp_parser_nested_requirement): Expect a semicolon at end. Parse
1550 constraint-expressions.
1551 (cp_parser_concept_definition): New. Don't fail parsing the concept
1552 definition if the initializer is ill-formed. Don't declare the concept
1553 before parsing the initializer.
1554 (cp_parser_constraint_expression): Declare earlier.
1555 (cp_parser_type_requirement): Current scope is not valid.
1556 (cp_parser_requires_expression): Commit to the tentative parse.
1557 (cp_parser_decl_specifier_seq): Warn when concept appears to be used
1558 as a decl-specifier.
1559 (cp_parser_template_declaration_after_parameters): Parse concept
1560 definitions.
1561 (cp_parser_template_id): Don't try to resolve a concept template-id yet.
1562 (cp_parser_template_id_expr): Resolve it as a concept check.
1563 (cp_parser_decl_specifier_seq): Warn on 'concept bool'.
1564 (cp_parser_type_parameter): Combine expressions not
1565 constraints.
1566 (cp_parser_explicit_template_declaration): Combine expressions not
1567 constraints.
1568 (cp_parser_maybe_concept_name): Removed.
1569 (cp_parser_simple_type_specifier): Handle an error condition of
1570 a bad constrained type specifier. Expect auto or decltype after
1571 a concept name. Also handle the case where we have a template-id
1572 as a concept check.
1573 (cp_parser_template_introduction): Diagnose errors on invalid
1574 introductions. Give up if it doesn't start with a concept name.
1575 Pedwarn if not -fconcepts-ts.
1576 (synthesize_implicit_template_parm): Don't do consistent binding.
1577 Use a new flag for constrained parameters. Combine expressions,
1578 not constraints. Fail if we get a placeholder in block scope.
1579 Placeholders that do not constrain types are not allowed in parameter
1580 declarations, so don't handle them.
1581 (cp_parser_placeholder_type_specifier): New. Implement parsing of
1582 placeholder type specifiers following a concept name or partial
1583 concept check. Disallow decltype(auto) parameters.
1584 (cp_parser_nested_name_specifier_opt): If the token is already
1585 CPP_NESTED_NAME_SPECIFIER, leave it alone.
1586 (cp_parser_id_expression, cp_parser_unqualified_id): Call
1587 cp_parser_template_id_expr.
1588 (cp_parser_placeholder_type_specifier): Add tentative parm. Don't
1589 expect a WILDCARD_DECL.
1590 (cp_parser_trait_expr): Pass trait_loc down.
1591 (cp_parser_postfix_expression): Do set location of dependent member
1592 call.
1593 * pt.c (finish_concept_definition): New.
1594 (push_template_decl_real): Handle concept definitions.
1595 (start_concept_definition): Let push_template_decl_real handle the
1596 creation of the template.
1597 (get_constraints): Return null if the table hasn't been initialized.
1598 (tsubst_copy_and_build): Build template-id expressions for concept
1599 checks.
1600 [TRAIT_EXPR]: Pass trait_loc down.
1601 (lookup_template_class_1): Add the template name to the constraint
1602 failure diagnostic.
1603 (lookup_and_finish_template_variable): Build concept checks
1604 with the correct arguments.
1605 (tsubst_function_decl): Don't substitute through constraints.
1606 Always associate constraints with functions.
1607 (template_parm_level_and_index): Make non-static.
1608 (for_each_template_parm_r): Handle requires expressions.
1609 (keep_template_parm): New.
1610 (find_template_parameters): New.
1611 (more_specialized_fn): Change how winners and losers are chosen.
1612 (make_constrained_auto): Don't normalize constraints.
1613 (template_parameters_equivalent_p): New. Compare template
1614 parameters. Add a comparison for implicitly vs. explicitly declared
1615 parameters.
1616 (template_parameter_lists_equivalent_p): New. Compare template
1617 parameter lists.
1618 (template_requirements_equivalent_p): New.
1619 (template_heads_equivalent_p): New. Compare template heads.
1620 (template_parameter_constraints_equivalent_p): New.
1621 (is_compatible_template_arg): Use weakly_subsumes.
1622 (maybe_new_partial_specialization): Use new constraint comparison
1623 for finding specializations.
1624 (process_partial_specialization): Pass main template as argument.
1625 (more_specialized_partial_spec): Don't immediately return when
1626 detecting a winner.
1627 (make_constrained_auto): Handle concept definitions.
1628 (do_auto_deduction): Update auto deduction for new concept model.
1629 Extract the function concept correctly; rename constr to check to
1630 reflect the kind of node.
1631 (tsubst): Adjust wildcard argument during substitution.
1632 [DECLTYPE_TYPE]: Remove init-capture handling.
1633 (tsubst_copy_and_build): Build concept checks, not template ids.
1634 Defer checks of function concepts. Handle concepts before variable
1635 templates. Handle calls to function concepts explicitly.
1636 (coerce_template_parms): Use concept_definition_p. Handle a deduction
1637 error where a potentially empty pack can be supplied after the last
1638 parameter of a concept.
1639 (finish_template_variable): Don't process concepts here.
1640 (instantiation_dependent_r): Use concept_check_p.
1641 (tsubst_template_args): Make non-static.
1642 (make_constrained_placeholder_type): New. Refactored from
1643 make_constrained_auto.
1644 (make_constrained_auto) Use make_constrained_placeholder_type.
1645 (make_constrained_decltype_auto) New.
1646 (tsubst_function_parms): New.
1647 (value_dependent_expression_p) [TEMPLATE_ID_EXPR]: Use
1648 concept_definition_p.
1649 (push_access_scope, pop_access_scope): No longer static.
1650 (tsubst_template_parm): Substitute TEMPLATE_PARM_CONSTRAINTS.
1651 (tsubst_friend_function): Use tsubst_constraint. Use generic_targs_for.
1652 (get_underlying_template) Use generic_targs_for.
1653 (uses_parameter_packs): Return tree.
1654 (gen_elem_of_pack_expansion_instantiation): Don't push
1655 local_specialization_stack.
1656 (prepend_one_capture): New.
1657 (tsubst_lambda_expr): Use prepend_one_capture. Don't touch
1658 local_specializations.
1659 (template_parms_level_to_args): No longer static.
1660 (add_outermost_template_args): Likewise.
1661 (find_template_parameter_info): New. Provide context for finding
1662 template parameters.
1663 (keep_template_parm): Don't keep parameters declared at depth levels
1664 greater than those of the template parameters of the source declaration.
1665 Don't propagate cv-qualified types. Return 0, so we find all template
1666 parameters, not the just first.
1667 (any_template_parm_r): New. Handle cases that are mishandled by
1668 for_each_template_parm_r.
1669 (generic_targs_for): Factor out of coerce_template_args_for_ttp.
1670 (tsubst_argument_pack): Factor out of tsubst_template_args.
1671 (constraint_sat_entry): Removed.
1672 (constraint_sat_hasher): Removed.
1673 (concept_spec_entry): Removed.
1674 (concept_spec_hasher): Removed.
1675 (constraint_memos): Removed.
1676 (concept_memos): Removed.
1677 (lookup_constraint_satisfaction): Removed.
1678 (memoize_constraint_satisfaction): Removed.
1679 (lookup_concept_satisfaction): Removed.
1680 (memoize_concept_satisfaction): Removed.
1681 (concept_expansions): Removed.
1682 (get_concept_expansion): Removed.
1683 (save_concept_expansion): Removed.
1684 (init_constraint_processing): Remove initialization of non-existing
1685 resources.
1686 (find_template_requirement): New. Search for the sub-requirement
1687 within the associated constraints.
1688 (convert_generic_types_to_packs): Also transform the associated
1689 constraint and update the current template requirements.
1690 (store_defaulted_ttp, lookup_defaulted_ttp): Remove.
1691 (add_defaults_to_ttp): Use hash_map_safe_*.
1692 * semantics.c (finish_call_expr): Diagnose calls to concepts.
1693 Handle concept checks explicitly.
1694 (finish_id_expression): Evaluate variable concepts as part of
1695 id-expression processing. Don't treat variable concepts as variables,
1696 and don't process function concepts as plain id-expressions.
1697 (force_paren_expr): Add even_uneval parm.
1698 (finish_trait_expr): Add location parm.
1699 * tree.c (special_memfn_p): New.
1700 (cp_expr_location): Handle TRAIT_EXPR.
1701 * typeck.c (check_return_expr): Actually use the diagnostic kind
1702 when performing return-type deduction.
1703 * typeck2.c (build_functional_cast): Don't rely on the location of
1704 'auto'.
1705
1706 2019-10-09 Paolo Carlini <paolo.carlini@oracle.com>
1707
1708 * decl.c (grok_ctor_properties): Use DECL_SOURCE_LOCATION.
1709 * typeck.c (cp_build_binary_op): Use the op_location_t argument
1710 in many error messages.
1711
1712 2019-10-08 Martin Sebor <msebor@redhat.com>
1713
1714 PR c++/92001
1715 * call.c (maybe_warn_class_memaccess): Handle arrays.
1716
1717 2019-10-07 Paolo Carlini <paolo.carlini@oracle.com>
1718
1719 * call.c (resolve_args): Use cp_expr_loc_or_input_loc in one place.
1720 * decl.c (grokdeclarator): Use id_loc in one place.
1721 * decl2.c (build_anon_union_vars): Use DECL_SOURCE_LOCATION.
1722 * parser.c (cp_parser_delete_expression): Fix the location of the
1723 returned expression.
1724 (cp_parser_throw_expression): Likewise.
1725 * pt.c (determine_specialization): Use DECL_SOURCE_LOCATION.
1726
1727 2019-10-05 Jakub Jelinek <jakub@redhat.com>
1728
1729 PR c++/91369 - Implement P0784R7: constexpr new
1730 * cp-tree.h (enum cp_tree_index): Add CPTI_HEAP_UNINIT_IDENTIFIER,
1731 CPTI_HEAP_IDENTIFIER and CPTI_HEAP_DELETED_IDENTIFIER.
1732 (heap_uninit_identifier, heap_identifier, heap_deleted_identifier):
1733 Define.
1734 (type_has_constexpr_destructor, build_new_constexpr_heap_type,
1735 cxx_constant_dtor): Declare.
1736 * class.c (type_maybe_constexpr_default_constructor): Make static.
1737 (type_maybe_constexpr_destructor, type_has_constexpr_destructor): New
1738 functions.
1739 (finalize_literal_type_property): For c++2a, don't clear
1740 CLASSTYPE_LITERAL_P for types without trivial destructors unless they
1741 have non-constexpr destructors.
1742 (explain_non_literal_class): For c++2a, complain about non-constexpr
1743 destructors rather than about non-trivial destructors.
1744 * constexpr.c: Include stor-layout.h.
1745 (struct constexpr_global_ctx): New type.
1746 (struct constexpr_ctx): Add global field, remove values and
1747 constexpr_ops_count.
1748 (cxx_replaceable_global_alloc_fn): New inline function.
1749 (cxx_eval_call_expression): For c++2a allow calls to replaceable
1750 global allocation functions, for new return address of a heap uninit
1751 var, for delete record its deletion. Change ctx->values->{get,put} to
1752 ctx->global->values.{get,put}.
1753 (non_const_var_error): Add auto_diagnostic_group sentinel. Emit
1754 special diagnostics for heap variables.
1755 (cxx_eval_store_expression): Change ctx->values->{get,put} to
1756 ctx->global->values.{get,put}.
1757 (cxx_eval_loop_expr): Initialize jump_target if NULL. Change
1758 new_ctx.values->remove to ctx->global->values.remove.
1759 (cxx_eval_constant_expression): Change *ctx->constexpr_ops_count
1760 to ctx->global->constexpr_ops_count. Change ctx->values->{get,put} to
1761 ctx->global->values.{get,put}.
1762 <case NOP_EXPR>: Formatting fix. On cast of replaceable global
1763 allocation function to some pointer type, adjust the type of
1764 the heap variable and change name from heap_uninit_identifier
1765 to heap_identifier.
1766 (find_heap_var_refs): New function.
1767 (cxx_eval_outermost_constant_expr): Add constexpr_dtor argument,
1768 handle evaluation of constexpr dtors and add tracking of heap
1769 variables. Use tf_no_cleanup for get_target_expr_with_sfinae.
1770 (cxx_constant_value): Adjust cxx_eval_outermost_constant_expr caller.
1771 (cxx_constant_dtor): New function.
1772 (maybe_constant_value, fold_non_dependent_expr_template,
1773 maybe_constant_init_1): Adjust cxx_eval_outermost_constant_expr
1774 callers.
1775 (potential_constant_expression_1): Ignore clobbers. Allow
1776 COND_EXPR_IS_VEC_DELETE for c++2a.
1777 * decl.c (initialize_predefined_identifiers): Add heap identifiers.
1778 (decl_maybe_constant_destruction): New function.
1779 (cp_finish_decl): Don't clear TREE_READONLY for constexpr variables
1780 with non-trivial, but constexpr destructors.
1781 (register_dtor_fn): For constexpr variables with constexpr non-trivial
1782 destructors call cxx_maybe_build_cleanup instead of adding destructor
1783 calls at runtime.
1784 (expand_static_init): For constexpr variables with constexpr
1785 non-trivial destructors call cxx_maybe_build_cleanup.
1786 (grokdeclarator): Allow constexpr destructors for c++2a. Formatting
1787 fix.
1788 (cxx_maybe_build_cleanup): For constexpr variables with constexpr
1789 non-trivial destructors call cxx_constant_dtor instead of adding
1790 destructor calls at runtime.
1791 * init.c: Include stor-layout.h.
1792 (build_new_constexpr_heap_type, maybe_wrap_new_for_constexpr): New
1793 functions.
1794 (build_new_1): For c++2a and new[], add cast around the alloc call
1795 to help constexpr evaluation figure out the type of the heap storage.
1796 (build_vec_delete_1): Set DECL_INITIAL of tbase and emit a DECL_EXPR
1797 for it instead of initializing an uninitialized variable.
1798 * method.c: Include intl.h.
1799 (SFK_CTOR_P, SFK_DTOR_P, SFK_ASSIGN_P, SFK_COPY_P, SFK_MOVE_P): Move
1800 definitions earlier.
1801 (process_subob_fn): Add sfk argument, adjust non-constexpr call
1802 diagnostics based on it.
1803 (walk_field_subobs): Formatting fixes. Adjust process_subob_fn caller.
1804 (synthesized_method_base_walk): Likewise.
1805 (synthesized_method_walk): Set *constexpr_p to true for dtors in c++2a.
1806 Fix up DR number in comment.
1807 (implicitly_declare_fn): Formatting fix.
1808 * typeck2.c (store_init_value): Don't call cp_fully_fold_init on
1809 initializers of automatic non-constexpr variables in constexpr
1810 functions.
1811
1812 2019-10-04 Jakub Jelinek <jakub@redhat.com>
1813
1814 PR c++/71504
1815 * constexpr.c (cxx_fold_indirect_ref_1): New function.
1816 (cxx_fold_indirect_ref): Use it.
1817
1818 PR c++/91974
1819 * cp-gimplify.c (cp_gimplify_expr) <case CALL_EXPR>: For
1820 -fstrong-eval-order ensure CALL_EXPR_FN side-effects are evaluated
1821 before any arguments. Additionally, ensure CALL_EXPR_FN that isn't
1822 invariant nor OBJ_TYPE_REF nor SSA_NAME is forced into a temporary.
1823
1824 2019-10-03 Paolo Carlini <paolo.carlini@oracle.com>
1825
1826 * init.c (build_new): Use cp_expr_loc_or_input_loc in two places.
1827 * name-lookup.c (do_pushdecl): Use DECL_SOURCE_LOCATION.
1828 (push_class_level_binding_1): Likewise.
1829 (set_decl_namespace): Likewise.
1830
1831 2019-10-03 Jakub Jelinek <jakub@redhat.com>
1832
1833 * constexpr.c (cxx_eval_constant_expression) <case CLEANUP_STMT>: If
1834 not skipping upon entry to body, run cleanup with the same *jump_target
1835 as it started to run the cleanup even if the body returns, breaks or
1836 continues.
1837 (potential_constant_expression_1): Allow CLEANUP_STMT.
1838
1839 * constexpr.c (cxx_eval_store_expression): Formatting fix. Handle
1840 const_object_being_modified with array type.
1841
1842 2019-10-02 Jason Merrill <jason@redhat.com>
1843
1844 * typeck2.c (store_init_value): Only clear_cv_and_fold_caches if the
1845 value is constant.
1846
1847 2019-09-30 Jason Merrill <jason@redhat.com>
1848
1849 Use hash_map_safe_* functions.
1850 * constexpr.c (maybe_initialize_fundef_copies_table): Remove.
1851 (get_fundef_copy): Use hash_map_safe_get_or_insert.
1852 * cp-objcp-common.c (cp_get_debug_type): Use hash_map_safe_*.
1853 * decl.c (store_decomp_type): Remove.
1854 (cp_finish_decomp): Use hash_map_safe_put.
1855 * init.c (get_nsdmi): Use hash_map_safe_*.
1856 * pt.c (store_defaulted_ttp, lookup_defaulted_ttp): Remove.
1857 (add_defaults_to_ttp): Use hash_map_safe_*.
1858
1859 2019-10-02 Richard Biener <rguenther@suse.de>
1860
1861 PR c++/91606
1862 * decl.c (build_ptrmemfunc_type): Mark pointer-to-member
1863 fat pointer structure members as DECL_NONADDRESSABLE_P.
1864
1865 2019-09-28 Marek Polacek <polacek@redhat.com>
1866
1867 PR c++/91889 - follow-up fix for DR 2352.
1868 * call.c (involves_qualification_conversion_p): New function.
1869 (direct_reference_binding): Build a ck_qual if the conversion
1870 would involve a qualification conversion.
1871 (convert_like_real): Strip the conversion created by the ck_qual
1872 in direct_reference_binding.
1873
1874 PR c++/91921 - stray warning with -Woverloaded-virtual.
1875 * class.c (warn_hidden): Only emit the second part of
1876 -Woverloaded-virtual if the first part was issued. Use inform instead
1877 warning_at.
1878
1879 PR c++/91923 - failure-to-SFINAE with class type NTTP in C++17.
1880 * pt.c (invalid_nontype_parm_type_p): Only emit errors when
1881 tf_error.
1882
1883 2019-09-27 Jakub Jelinek <jakub@redhat.com>
1884
1885 PR c++/88203
1886 * parser.c (cp_parser_omp_var_list_no_open): Parse predefined
1887 variables.
1888 * semantics.c (finish_omp_clauses): Allow predefined variables in
1889 shared and firstprivate clauses, even when they are predetermined
1890 shared.
1891 * cp-gimplify.c (cxx_omp_predetermined_sharing_1): Return
1892 OMP_CLAUSE_DEFAULT_SHARED for predefined variables.
1893
1894 2019-09-27 Jason Merrill <jason@redhat.com>
1895
1896 * constexpr.c (cxx_fold_indirect_ref): Use similar_type_p.
1897 (cxx_eval_indirect_ref): Likewise. Improve error location.
1898
1899 * cp-tree.h (class iloc_sentinel): New.
1900 * decl.c (grokdeclarator, finish_enum_value_list): Use it.
1901 * mangle.c (mangle_decl_string): Use it.
1902 * pt.c (perform_typedefs_access_check): Use it.
1903
1904 2019-09-27 Richard Sandiford <richard.sandiford@arm.com>
1905
1906 * cp-tree.h (build_cxx_call): Take the original function decl
1907 as an optional final parameter.
1908 (cp_build_function_call_vec): Likewise.
1909 * call.c (build_cxx_call): Likewise. Pass all built-in calls to
1910 check_builtin_function_arguments.
1911 * typeck.c (build_function_call_vec): Take the original function
1912 decl as an optional final parameter and pass it to
1913 cp_build_function_call_vec.
1914 (cp_build_function_call_vec): Take the original function
1915 decl as an optional final parameter and pass it to build_cxx_call.
1916
1917 2019-09-25 Marek Polacek <polacek@redhat.com>
1918
1919 PR c++/91877 - ICE with converting member of packed struct.
1920 * call.c (convert_like_real): Use similar_type_p in an assert.
1921
1922 2019-09-25 Paolo Carlini <paolo.carlini@oracle.com>
1923
1924 * name-lookup.c (check_extern_c_conflict): Use DECL_SOURCE_LOCATION.
1925 (check_local_shadow): Use it in three additional places.
1926
1927 2019-09-24 Jason Merrill <jason@redhat.com>
1928
1929 * parser.c (cp_parser_postfix_expression): Do set location of
1930 dependent member call.
1931
1932 2019-09-24 Marek Polacek <polacek@redhat.com>
1933
1934 PR c++/91868 - improve -Wshadow location.
1935 * name-lookup.c (check_local_shadow): Use DECL_SOURCE_LOCATION
1936 instead of input_location.
1937
1938 PR c++/91845 - ICE with invalid pointer-to-member.
1939 * expr.c (mark_use): Use error_operand_p.
1940 * typeck2.c (build_m_component_ref): Check error_operand_p after
1941 calling mark_[lr]value_use.
1942
1943 2019-09-23 Paolo Carlini <paolo.carlini@oracle.com>
1944
1945 * pt.c (check_explicit_specialization): Use cp_expr_loc_or_input_loc.
1946 (process_partial_specialization): Likewise.
1947 (convert_nontype_argument_function): Likewise.
1948 (invalid_tparm_referent_p): Likewise.
1949 (convert_template_argument): Likewise.
1950 (check_valid_ptrmem_cst_expr): Tidy.
1951
1952 2019-09-23 Jason Merrill <jason@redhat.com>
1953
1954 PR c++/91809 - bit-field and ellipsis.
1955 * call.c (convert_arg_to_ellipsis): Don't call decay_conversion for
1956 arithmetic arguments.
1957
1958 2019-09-23 Marek Polacek <polacek@redhat.com>
1959
1960 PR c++/91844 - Implement CWG 2352, Similar types and reference binding.
1961 * call.c (reference_related_p): Use similar_type_p instead of
1962 same_type_p.
1963 (reference_compatible_p): Update implementation to match CWG 2352.
1964 * cp-tree.h (similar_type_p): Declare.
1965 * typeck.c (similar_type_p): New.
1966
1967 2019-09-22 Marek Polacek <polacek@redhat.com>
1968
1969 PR c++/91819 - ICE with operator++ and enum.
1970 * call.c (build_new_op_1): Set arg2_type.
1971
1972 2019-09-17 Jason Merrill <jason@redhat.com>
1973
1974 * parser.c (cp_parser_statement): Handle [[likely]] on
1975 compound-statement.
1976
1977 2019-09-19 Jason Merrill <jason@redhat.com>
1978
1979 Revert:
1980 * call.c (build_new_op_1): Don't apply any standard conversions to
1981 the operands of a built-in operator. Don't suppress conversions in
1982 cp_build_unary_op.
1983 * typeck.c (cp_build_unary_op): Do integral promotions for enums.
1984
1985 2019-09-16 Paolo Carlini <paolo.carlini@oracle.com>
1986
1987 * decl.c (grokdeclarator): Use declspecs->locations and
1988 declarator->id_loc in a few error messages.
1989 * pt.c (finish_member_template_decl): Use DECL_SOURCE_LOCATION.
1990 (push_template_decl_real): Likewise.
1991
1992 2019-09-15 Jason Merrill <jason@redhat.com>
1993
1994 PR c++/30277 - int-width bit-field promotion.
1995 PR c++/33819 - long bit-field promotion.
1996 * typeck.c (cp_perform_integral_promotions): Handle large bit-fields
1997 properly. Handle 32-bit non-int bit-fields properly.
1998 (is_bitfield_expr_with_lowered_type): Don't look through NOP_EXPR.
1999
2000 PR c++/82165 - enum bitfields and operator overloading.
2001 * call.c (build_new_op_1): Use unlowered_expr_type.
2002
2003 * call.c (build_new_op_1): Don't apply any standard conversions to
2004 the operands of a built-in operator. Don't suppress conversions in
2005 cp_build_unary_op.
2006 * typeck.c (cp_build_unary_op): Do integral promotions for enums.
2007
2008 2019-09-15 Marek Polacek <polacek@redhat.com>
2009
2010 PR c++/91740 - ICE with constexpr call and ?: in ARRAY_REF.
2011 * pt.c (build_non_dependent_expr): Call build_non_dependent_expr for
2012 the first operand.
2013
2014 2019-09-15 Nathan Sidwell <nathan@acm.org>
2015
2016 * cp-tree.h (DECL_CLONED_FUNCTION_P): Reimplement using
2017 IDENTIFIER_CDTOR_P, correct documentation.
2018 (DECL_CLONED_FUNCTION): Directly access field.
2019 (decl_cloned_function_p): Delete.
2020 * class.c (decl_cloned_function_p): Delete.
2021 * pt.c (instantiate_template_1): Check DECL_CHAIN is a decl.
2022
2023 2019-09-11 Nathan Sidwell <nathan@acm.org>
2024
2025 * c-objcp-common.c (cp-objcp-common.c): Alphababetize and
2026 correctly mark all C++ nodes.
2027 * decl.c (cp_tree_node_structure): Alphabetize.
2028
2029 2019-09-10 Marek Polacek <polacek@redhat.com>
2030
2031 PR c++/91673 - ICE with noexcept in alias-declaration.
2032 * parser.c (CP_PARSER_FLAGS_DELAY_NOEXCEPT): New parser flag.
2033 (cp_parser_lambda_declarator_opt): Pass CP_PARSER_FLAGS_NONE to
2034 cp_parser_exception_specification_opt.
2035 (cp_parser_direct_declarator): Adjust a call to
2036 cp_parser_exception_specification_opt.
2037 (cp_parser_member_declaration): Pass CP_PARSER_FLAGS_DELAY_NOEXCEPT
2038 to cp_parser_declarator if not processing a friend or typedef
2039 declaration.
2040 (cp_parser_late_noexcept_specifier): Adjust a call to
2041 cp_parser_noexcept_specification_opt.
2042 (cp_parser_noexcept_specification_opt): New parameter for parser flags,
2043 drop the FRIEND_P parameter. Use the new parameter.
2044 (cp_parser_exception_specification_opt): Likewise.
2045 (cp_parser_transaction): Adjust a call to
2046 cp_parser_noexcept_specification_opt.
2047 (cp_parser_transaction_expression): Likewise.
2048
2049 2019-09-10 Marek Polacek <polacek@redhat.com>
2050
2051 PR c++/91705 - constexpr evaluation rejects ++/-- on floats.
2052 * constexpr.c (cxx_eval_increment_expression): Call fold_simple on
2053 the offset.
2054
2055 2019-09-10 Paolo Carlini <paolo.carlini@oracle.com>
2056
2057 * decl.c (has_designator_problem): Use cp_expr_loc_or_input_loc
2058 in error_at.
2059 (build_enumerator): Likewise.
2060 (cp_finish_decl): Use DECL_SOURCE_LOCATION.
2061 (grokdeclarator): Use id_loc in two error_at; change errror
2062 message about constinit together constexpr to use two ranges.
2063
2064 2019-09-09 Marek Polacek <polacek@redhat.com>
2065
2066 PR c++/84374 - diagnose invalid uses of decltype(auto).
2067 * decl.c (grokdeclarator): Diagnose wrong usage of decltype(auto) in
2068 a function declaration.
2069
2070 2019-09-06 Nathan Sidwell <nathan@acm.org>
2071
2072 PR c++/91125
2073 * cp-tree.h (IDENTIFIER_REPO_CHOSEN, DECL_REPO_AVAILABLE_P): Delete.
2074 (struct lang_decl_base): Remove repo_available_p.
2075 * decl.c (duplicate_decls): Don't copy DECL_REPO_AVAILABLE_P.
2076
2077 (Reserve TREE_LANG_FLAG_3 for modules.
2078 * cp-tree.h (DECL_CONSTRUCTION_VTABLE_P): Delete.
2079 (DECL_NON_TRIVIALLY_INITIALIZED_P): Move to TREE_LANG_FLAG_6.
2080 * class.c (build_ctor_vtbl_group): Don't set
2081 DECL_CONSTRUCTION_VTABLE_P.
2082 * decl2.c (determine_visibility_from_class): Don't check
2083 DECL_CONSTRUCTION_VTABLE_P anymore.
2084
2085 2019-09-06 Martin Liska <mliska@suse.cz>
2086
2087 PR c++/91125
2088 * Make-lang.in: Remove repo.o.
2089 * config-lang.in: Likewise.
2090 * cp-tree.h (init_repo): Remove declarations
2091 of repo-related functions.
2092 (repo_emit_p): Likewise.
2093 (repo_export_class_p): Likewise.
2094 (finish_repo): Likewise.
2095 * decl2.c (import_export_class): Always
2096 set -1 value/
2097 (mark_needed): Remove -frepo from comment.
2098 (import_export_decl): Similarly here.
2099 (c_parse_final_cleanups): Remove call of finish_repo.
2100 * lex.c (cxx_init): Remove call to init_repo.
2101 * optimize.c (can_alias_cdtor): Remove dead condition.
2102 * pt.c (push_template_decl_real): Update comment.
2103 (instantiate_decl): Remove dead code used for -frepo.
2104 * repo.c: Remove.
2105
2106 2019-09-05 Marek Polacek <polacek@redhat.com>
2107
2108 PR c++/91644 - ICE with constinit in function template.
2109 * decl.c (start_decl): Call retrofit_lang_decl for constinit variables.
2110 * pt.c (tsubst_expr): Pass LOOKUP_CONSTINIT down to cp_finish_decl for
2111 constinit variables.
2112
2113 2019-09-05 Nathan Sidwell <nathan@acm.org>
2114
2115 * cp-tree.h (DECL_VTABLE_OR_VTT_P): Forward to DECL_VIRTUAL_P.
2116
2117 2019-09-04 Marek Polacek <polacek@redhat.com>
2118
2119 * call.c (build_over_call): Remove -fdeduce-init-list implementation.
2120 * pt.c (unify): Likewise.
2121
2122 2019-09-01 Marek Polacek <polacek@redhat.com>
2123
2124 PR c++/91129 - wrong error with binary op in template argument.
2125 * typeck.c (warn_for_null_address): Use fold_for_warn instead of
2126 fold_non_dependent_expr.
2127 (cp_build_binary_op): Likewise.
2128
2129 2019-08-30 Jason Merrill <jason@redhat.com>
2130
2131 Add source location to TRAIT_EXPR.
2132 * cp-tree.h (TRAIT_EXPR_LOCATION): New.
2133 (struct tree_trait_expr): Add locus field.
2134 * parser.c (cp_parser_trait_expr): Pass trait_loc down.
2135 * pt.c (tsubst_copy_and_build) [TRAIT_EXPR]: Likewise.
2136 * semantics.c (finish_trait_expr): Add location parm.
2137 * tree.c (cp_expr_location): Handle TRAIT_EXPR.
2138
2139 2019-08-29 Paolo Carlini <paolo.carlini@oracle.com>
2140
2141 * decl.c (check_var_type): Add location_t parameter and use it.
2142 (grokdeclarator): Adjust call.
2143 * pt.c (tsubst_decl): Likewise.
2144 * cp-tree.h: Adjust declaration.
2145
2146 2019-08-28 Marek Polacek <polacek@redhat.com>
2147
2148 Implement P1152R4: Deprecating some uses of volatile.
2149 PR c++/91361
2150 * cp-gimplify.c (cp_fold): Set TREE_THIS_VOLATILE.
2151 * decl.c (grokdeclarator): Warn about a volatile-qualified structured
2152 binding and return type.
2153 (grokparms): Warn about a volatile-qualified function parameter.
2154 * expr.c (mark_use) <case MODIFY_EXPR>: Emit a -Wvolatile warning.
2155 * typeck.c (cp_build_unary_op): Emit a -Wvolatile warning for pre and
2156 post ++/-- on a volatile operand.
2157 (genericize_compound_lvalue): Use a better location. Don't lose
2158 TREE_THIS_VOLATILE.
2159 (cp_build_modify_expr): Emit a -Wvolatile warning for a compound
2160 assignment whose LHS is volatile-qualified. Build the assignment with
2161 a more precise location.
2162
2163 2019-08-28 Marek Polacek <polacek@redhat.com>
2164
2165 PR c++/91360 - Implement C++20 P1143R2: constinit.
2166 * cp-tree.h (TINFO_VAR_DECLARED_CONSTINIT): Define.
2167 (LOOKUP_CONSTINIT): Define.
2168 (enum cp_decl_spec): Add ds_constinit.
2169 * decl.c (check_tag_decl): Give an error for constinit in type
2170 declarations.
2171 (check_initializer): Also check LOOKUP_CONSTINIT.
2172 (cp_finish_decl): Add checking for a constinit declaration. Set
2173 TINFO_VAR_DECLARED_CONSTINIT.
2174 (grokdeclarator): Add checking for a declaration with the constinit
2175 specifier.
2176 * lex.c (init_reswords): Handle D_CXX20.
2177 * parser.c (cp_lexer_get_preprocessor_token): Pass a better location
2178 to warning_at. Warn about C++20 keywords.
2179 (cp_keyword_starts_decl_specifier_p): Handle RID_CONSTINIT.
2180 (cp_parser_diagnose_invalid_type_name): Add an inform about constinit.
2181 (cp_parser_decomposition_declaration): Maybe pass LOOKUP_CONSTINIT to
2182 cp_finish_decl.
2183 (cp_parser_decl_specifier_seq): Handle RID_CONSTINIT.
2184 (cp_parser_init_declarator): Maybe pass LOOKUP_CONSTINIT to
2185 cp_finish_decl.
2186 (set_and_check_decl_spec_loc): Add "constinit".
2187 * pt.c (tsubst_decl): Set TINFO_VAR_DECLARED_CONSTINIT.
2188 (instantiate_decl): Maybe pass LOOKUP_CONSTINIT to cp_finish_decl.
2189 * typeck2.c (store_init_value): If a constinit variable wasn't
2190 initialized using a constant initializer, give an error.
2191
2192 2019-08-28 Nathan Sidwell <nathan@acm.org>
2193
2194 PR c++/90613
2195 * name-lookup.c (cp_emit_debug_info): Check for builtins during
2196 overload iteration.
2197
2198 2019-08-27 Marek Polacek <polacek@redhat.com>
2199
2200 PR c++/81676 - bogus -Wunused warnings in constexpr if.
2201 * semantics.c (maybe_mark_exp_read_r): New function.
2202 (finish_if_stmt): Call it on THEN_CLAUSE and ELSE_CLAUSE.
2203
2204 PR c++/91428 - warn about std::is_constant_evaluated in if constexpr.
2205 * cp-tree.h (decl_in_std_namespace_p): Declare.
2206 * semantics.c (is_std_constant_evaluated_p): New.
2207 (finish_if_stmt_cond): Warn about "std::is_constant_evaluated ()" in
2208 an if-constexpr.
2209 * typeck.c (decl_in_std_namespace_p): No longer static.
2210
2211 2019-08-26 Jason Merrill <jason@redhat.com>
2212
2213 * decl.c (duplicate_decls): Always merge DECL_DECLARED_CONSTEXPR_P.
2214
2215 2019-08-26 Marek Polacek <polacek@redhat.com>
2216
2217 PR c++/91545 - ICE in constexpr store evaluation.
2218 * constexpr.c (cxx_eval_store_expression): Check FIELD_DECL instead
2219 of DECL_P.
2220
2221 2019-08-24 Nathan Sidwell <nathan@acm.org>
2222
2223 * class.c (check_for_overrides): Conversion operators need
2224 checking too.
2225
2226 2019-08-24 Paolo Carlini <paolo.carlini@oracle.com>
2227
2228 * semantics.c (finish_switch_cond): Improve error message location.
2229
2230 2019-08-23 Jason Merrill <jason@redhat.com>
2231
2232 * decl2.c (decl_dependent_p): New.
2233 (mark_used): Check it instead of just processing_template_decl.
2234
2235 2019-08-23 Jason Merrill <jason@redhat.com>
2236
2237 * parser.c (cp_parser_nested_name_specifier_opt): Avoid redundant
2238 error.
2239
2240 2019-08-23 Marek Polacek <polacek@redhat.com>
2241
2242 PR c++/91521 - wrong error with operator->.
2243 * decl.c (grokdeclarator): Return error_mark_node for an invalid
2244 trailing return type.
2245
2246 PR c++/79817 - attribute deprecated on namespace.
2247 * cp-tree.h (cp_warn_deprecated_use_scopes): Declare.
2248 * decl.c (grokdeclarator): Call cp_warn_deprecated_use_scopes.
2249 (type_is_deprecated): Likewise.
2250 * decl2.c (cp_warn_deprecated_use_scopes): New function.
2251 * name-lookup.c (handle_namespace_attrs): Handle attribute deprecated.
2252 * parser.c (cp_parser_namespace_alias_definition): Call
2253 cp_warn_deprecated_use_scopes.
2254 (cp_parser_using_declaration): Likewise.
2255 (cp_parser_using_directive): Likewise.
2256 * semantics.c (finish_id_expression_1): Likewise.
2257
2258 2019-08-23 Nathan Sidwell <nathan@acm.org>
2259
2260 * class.c (check_for_override): Checking IDENTIFIER_VIRTUAL_P is
2261 sufficient, reorder DECL_OVERRIDE_P check.
2262
2263 2019-08-23 Iain Sandoe <iain@sandoe.co.uk>
2264
2265 PR pch/61250
2266 * parser.c (cp_parser_initial_pragma): Call c_common_no_more_pch ()
2267 after determining that the first token is not
2268 PRAGMA_GCC_PCH_PREPROCESS.
2269
2270 2019-08-22 Marek Polacek <polacek@redhat.com>
2271
2272 PR c++/91304 - prefix attributes ignored in condition.
2273 * parser.c (cp_parser_condition): Handle prefix attributes.
2274
2275 2019-08-21 Richard Sandiford <richard.sandiford@arm.com>
2276
2277 PR c++/91505
2278 * decl.c (duplicate_decls): Call copy_attributes_to_builtin inside
2279 the BUILT_IN_NORMAL block rather than afterward.
2280
2281 2019-08-19 Marek Polacek <polacek@redhat.com>
2282
2283 PR c++/91264 - detect modifying const objects in constexpr.
2284 * constexpr.c (modifying_const_object_error): New function.
2285 (cxx_eval_call_expression): Set TREE_READONLY on a CONSTRUCTOR of
2286 a const-qualified object after it's been fully constructed.
2287 (modifying_const_object_p): New function.
2288 (cxx_eval_store_expression): Detect modifying a const object
2289 during constant expression evaluation.
2290 (cxx_eval_increment_expression): Use a better location when building
2291 up the store.
2292 (cxx_eval_constant_expression) <case DECL_EXPR>: Mark a constant
2293 object's constructor TREE_READONLY.
2294
2295 2019-08-15 Jason Merrill <jason@redhat.com>
2296
2297 PR c++/90393 - ICE with thow in ?:
2298
2299 PR c++/64372, DR 1560 - Gratuitous lvalue-to-rvalue conversion in ?:
2300 * tree.c (lvalue_kind): Handle throw in one arm.
2301 * typeck.c (rationalize_conditional_expr): Likewise.
2302 (cp_build_modify_expr): Likewise.
2303
2304 2019-08-14 Jason Merrill <jason@redhat.com>
2305
2306 Implement P0848R3, Conditionally Trivial Special Member Functions.
2307 * tree.c (special_memfn_p): New.
2308 * class.c (add_method): When overloading, hide ineligible special
2309 member fns.
2310 (check_methods): Set TYPE_HAS_COMPLEX_* here.
2311 * decl.c (grok_special_member_properties): Not here.
2312 * name-lookup.c (push_class_level_binding_1): Move overloaded
2313 functions case down, accept FUNCTION_DECL as target_decl.
2314
2315 2019-08-14 Jonathan Wakely <jwakely@redhat.com>
2316
2317 PR c++/91436
2318 * name-lookup.c (get_std_name_hint): Fix min_dialect field for
2319 complex_literals and make_unique entries.
2320
2321 2019-08-14 Jakub Jelinek <jakub@redhat.com>
2322 Marek Polacek <polacek@redhat.com>
2323
2324 PR c++/91391 - bogus -Wcomma-subscript warning.
2325 * parser.c (cp_parser_postfix_open_square_expression): Don't warn about
2326 a deprecated comma here. Pass warn_comma_subscript down to
2327 cp_parser_expression.
2328 (cp_parser_expression): New bool parameter. Warn about uses of a comma
2329 operator within a subscripting expression.
2330 (cp_parser_skip_to_closing_square_bracket): Revert to pre-r274121 state.
2331 (cp_parser_skip_to_closing_square_bracket_1): Remove.
2332
2333 2019-08-14 Jonathan Wakely <jwakely@redhat.com>
2334
2335 * name-lookup.c (get_std_name_hint): Add more entries.
2336
2337 2019-08-14 Paolo Carlini <paolo.carlini@oracle.com>
2338
2339 * decl2.c (grok_array_decl): Use the location of the open square
2340 bracket in error message about invalid types.
2341
2342 2019-08-14 Paolo Carlini <paolo.carlini@oracle.com>
2343
2344 * decl.c (grokdeclarator): Check here for typedef a function
2345 definition or a member function definition.
2346 (start_function): Adjust.
2347 (grokmethod): Likewise.
2348
2349 2019-08-13 Richard Sandiford <richard.sandiford@arm.com>
2350
2351 PR middle-end/91421
2352 * decl.c (duplicate_decls): Use copy_decl_built_in_function.
2353 * pt.c (declare_integer_pack): Use set_decl_built_in_function.
2354
2355 2019-08-13 Marek Polacek <polacek@redhat.com>
2356
2357 PR c++/90473 - wrong code with nullptr in default argument.
2358 * call.c (null_ptr_cst_p): Update quote from the standard.
2359 * decl.c (check_default_argument): Don't return nullptr when the arg
2360 has side-effects.
2361
2362 2019-08-13 Marek Polacek <polacek@redhat.com>
2363
2364 * cp-tree.h (DECL_MUTABLE_P): Use FIELD_DECL_CHECK.
2365
2366 2019-08-10 Jakub Jelinek <jakub@redhat.com>
2367
2368 * parser.c (cp_parser_omp_clause_name): Parse device_type.
2369 (cp_parser_omp_clause_device_type): New function.
2370 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_DEVICE_TYPE.
2371 (OMP_DECLARE_TARGET_CLAUSE_MASK): Add PRAGMA_OMP_CLAUSE_DEVICE_TYPE.
2372 (cp_parser_omp_declare_target): Handle device_type clauses. Remove
2373 diagnostics for declare target with clauses nested in clause-less
2374 declare target declaration-definition-seq.
2375 * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_DEVICE_TYPE.
2376
2377 2019-08-09 Jakub Jelinek <jakub@redhat.com>
2378
2379 * parser.c (check_no_duplicate_clause): Simplify using
2380 omp_find_clause.
2381 (cp_parser_omp_clause_if): Fix up printing of target {enter,exit} data
2382 directive name modifiers.
2383
2384 PR c/91401
2385 * parser.c (cp_parser_omp_clause_dist_schedule): Comment out the
2386 check_no_duplicate_clause call, instead emit a warning for duplicate
2387 dist_schedule clauses.
2388
2389 2019-08-08 Paolo Carlini <paolo.carlini@oracle.com>
2390
2391 * decl.c (grokdeclarator): Use id_loc and EXPR_LOCATION in
2392 a few error messages.
2393
2394 2019-08-08 Marek Polacek <polacek@redhat.com>
2395
2396 PR c++/87519 - bogus warning with -Wsign-conversion.
2397 * typeck.c (cp_build_binary_op): Use same_type_p instead of comparing
2398 the types directly.
2399
2400 * constexpr.c (inline_asm_in_constexpr_error): New.
2401 (cxx_eval_constant_expression) <case ASM_EXPR>: Call it.
2402 (potential_constant_expression_1) <case ASM_EXPR>: Likewise.
2403
2404 2019-08-08 Jakub Jelinek <jakub@redhat.com>
2405
2406 * semantics.c (finish_omp_clauses): For C_ORT_OMP
2407 OMP_CLAUSE_USE_DEVICE_* clauses use oacc_reduction_head bitmap
2408 instead of generic_head to track duplicates.
2409
2410 2019-08-07 Marek Polacek <polacek@redhat.com>
2411
2412 PR c++/81429 - wrong parsing of constructor with C++11 attribute.
2413 * parser.c (cp_parser_constructor_declarator_p): Handle the scenario
2414 when a parameter declaration begins with [[attribute]].
2415
2416 2019-08-07 Marek Polacek <polacek@redhat.com>
2417
2418 PR c++/91346 - Implement P1668R1, allow unevaluated asm in constexpr.
2419 * constexpr.c (cxx_eval_constant_expression): Handle ASM_EXPR.
2420 (potential_constant_expression_1) <case ASM_EXPR>: Allow.
2421 * cp-tree.h (finish_asm_stmt): Adjust.
2422 * parser.c (cp_parser_asm_definition): Grab the locaion of "asm" and
2423 use it. Change an error to a pedwarn. Allow asm in C++2a, warn
2424 otherwise.
2425 * pt.c (tsubst_expr): Pass a location down to finish_asm_stmt.
2426 * semantics.c (finish_asm_stmt): New location_t parameter. Use it.
2427
2428 2019-08-07 Jakub Jelinek <jakub@redhat.com>
2429
2430 * parser.c (cp_parser_omp_clause_name): Parse use_device_addr clause.
2431 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_USE_DEVICE_ADDR.
2432 (OMP_TARGET_DATA_CLAUSE_MASK): Add PRAGMA_OMP_CLAUSE_USE_DEVICE_ADDR.
2433 (cp_parser_omp_target_data): Handle PRAGMA_OMP_CLAUSE_USE_DEVICE_ADDR
2434 like PRAGMA_OMP_CLAUSE_USE_DEVICE_PTR, adjust diagnostics about no
2435 map or use_device_* clauses.
2436 * semantics.c (finish_omp_clauses): For OMP_CLAUSE_USE_DEVICE_PTR
2437 in OpenMP, require pointer or reference to pointer type rather than
2438 pointer or array or reference to pointer or array type. Handle
2439 OMP_CLAUSE_USE_DEVICE_ADDR.
2440 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_USE_DEVICE_ADDR.
2441
2442 2019-08-06 Jason Merrill <jason@redhat.com>
2443
2444 PR c++/91378 - ICE with noexcept and auto return type.
2445 * pt.c (maybe_instantiate_noexcept): push_to_top_level.
2446
2447 2019-08-06 Paolo Carlini <paolo.carlini@oracle.com>
2448
2449 * decl.c (check_array_designated_initializer): Use
2450 cp_expr_loc_or_input_loc in one place.
2451
2452 2019-08-06 Jakub Jelinek <jakub@redhat.com>
2453
2454 * parser.c (cp_parser_omp_for_loop): For OMP_LOOP, ignore parallel
2455 clauses and predetermine iterator as lastprivate.
2456 * semantics.c (handle_omp_for_class_iterator): Use
2457 OMP_CLAUSE_LASTPRIVATE_LOOP_IV instead of
2458 OMP_CLAUSE_LASTPRIVATE_TASKLOOP_IV, set it for lastprivate also
2459 on OMP_LOOP construct. If a clause is missing for class iterator
2460 on OMP_LOOP, add firstprivate clause, and if there is private
2461 clause, turn it into firstprivate too.
2462 (finish_omp_for): Formatting fix. For OMP_LOOP, adjust
2463 OMP_CLAUSE_LASTPRIVATE_LOOP_IV clause CP_CLAUSE_INFO, so that it
2464 uses copy ctor instead of default ctor.
2465 * cp-gimplify.c (cp_gimplify_expr): Handle OMP_LOOP like
2466 OMP_DISTRIBUTE etc.
2467 (cp_fold_r): Likewise.
2468 (cp_genericize_r): Likewise.
2469 (cxx_omp_finish_clause): Also finish lastprivate clause with
2470 OMP_CLAUSE_LASTPRIVATE_LOOP_IV flag.
2471 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_BIND.
2472 (tsubst_omp_for_iterator): For OMP_LOOP, ignore parallel
2473 clauses and predetermine iterator as lastprivate.
2474 * constexpr.c (potential_constant_expression_1): Handle OMP_LOOP
2475 like OMP_DISTRIBUTE etc.
2476
2477 2019-08-05 Marek Polacek <polacek@redhat.com>
2478
2479 DR 2413 - typename in conversion-function-ids.
2480 * parser.c (cp_parser_conversion_type_id): Call
2481 cp_parser_type_specifier_seq with CP_PARSER_FLAGS_TYPENAME_OPTIONAL
2482 instead of CP_PARSER_FLAGS_NONE.
2483
2484 2019-08-05 Paolo Carlini <paolo.carlini@oracle.com>
2485
2486 * cp-tree.h (cp_expr_loc_or_input_loc): New.
2487 (cxx_incomplete_type_diagnostic): Use it.
2488 * call.c (build_converted_constant_expr_internal, convert_like_real,
2489 convert_arg_to_ellipsis, convert_for_arg_passing, build_over_call,
2490 build_cxx_call, perform_implicit_conversion_flags,
2491 initialize_reference): Likewise.
2492 * constexpr.c (cxx_eval_internal_function, cxx_eval_call_expression,
2493 eval_and_check_array_index, cxx_eval_store_expression,
2494 cxx_eval_statement_list, cxx_eval_loop_expr,
2495 cxx_eval_constant_expression, potential_constant_expression_1):
2496 Likewise.
2497 * constraint.cc (check_for_logical_overloads,
2498 satisfy_predicate_constraint): Likewise.
2499 * cp-gimplify.c (cp_gimplify_expr): Likewise.
2500 * cvt.c (cp_convert_to_pointer, convert_to_reference,
2501 cp_convert_and_check, ocp_convert, maybe_warn_nodiscard): Likewise.
2502 * decl.c (pop_switch): Likewise.
2503 * decl2.c (delete_sanity): Likewise.
2504 * error.c (location_of): Likewise.
2505 * init.c (maybe_warn_list_ctor, build_aggr_init,
2506 warn_placement_new_too_small, build_new_1, build_vec_init): Likewise.
2507 * lex.c (unqualified_name_lookup_error): Likewise.
2508 * parser.c (cp_parser_initializer_list, cp_parser_omp_for_cond):
2509 Likewise.
2510 * pt.c (check_for_bare_parameter_packs, check_valid_ptrmem_cst_expr,
2511 unify_arg_conversion, convert_nontype_argument,
2512 tsubst_copy_and_build, resolve_typename_type): Likewise.
2513 * semantics.c (maybe_convert_cond, finish_call_expr,
2514 cp_build_vec_convert): Likewise.
2515 * typeck.c (decay_conversion, rationalize_conditional_expr,
2516 cp_build_unary_op, build_x_compound_expr_from_list,
2517 maybe_warn_about_returning_address_of_local,
2518 maybe_warn_pessimizing_move): Likewise.
2519 * typeck2.c (check_narrowing, digest_init_r,
2520 process_init_constructor_array): Likewise.
2521
2522 2019-08-05 Tom Honermann <tom@honermann.net>
2523
2524 * parser.c (cp_parser_template_declaration_after_parameters): Enable
2525 class template argument deduction for non-type template parameters
2526 in literal operator templates.
2527
2528 2019-08-05 Marek Polacek <polacek@redhat.com>
2529
2530 PR c++/91338 - Implement P1161R3: Deprecate a[b,c].
2531 * parser.c (cp_parser_postfix_open_square_expression): Warn about uses
2532 of a comma operator within a subscripting expression.
2533 (cp_parser_skip_to_closing_square_bracket_1): New function, made out
2534 of...
2535 (cp_parser_skip_to_closing_square_bracket): ...this.
2536
2537 2019-08-05 Jason Merrill <jason@redhat.com>
2538
2539 * semantics.c (force_paren_expr): Preserve location.
2540
2541 2019-08-02 Marek Polacek <polacek@redhat.com>
2542
2543 PR c++/91230 - wrong error with __PRETTY_FUNCTION__ and generic lambda.
2544 * pt.c (value_dependent_expression_p): Consider __PRETTY_FUNCTION__
2545 inside a template function value-dependent.
2546
2547 2019-08-02 Paolo Carlini <paolo.carlini@oracle.com>
2548
2549 * tree.c (handle_nodiscard_attribute): Do not warn about nodiscard
2550 applied to a constructor.
2551
2552 2019-08-02 Martin Liska <mliska@suse.cz>
2553
2554 * decl.c (grok_op_properties):
2555 Mark DECL_SET_IS_OPERATOR_DELETE for user-provided delete operators.
2556
2557 2019-08-01 Martin Sebor <msebor@redhat.com>
2558
2559 PR c++/90947
2560 * decl.c (reshape_init_array_1): Avoid truncating initializer
2561 lists containing string literals.
2562
2563 2019-08-01 Marek Polacek <polacek@redhat.com>
2564
2565 PR c++/90805 - detect narrowing in case values.
2566 * decl.c (case_conversion): Detect narrowing in case values.
2567
2568 2019-07-31 Paolo Carlini <paolo.carlini@oracle.com>
2569
2570 * decl2.c (delete_sanity): Improve diagnostic locations, use
2571 cp_expr_loc_or_loc in four places.
2572
2573 2019-07-31 Jason Merrill <jason@redhat.com>
2574
2575 PR c++/90538 - multiple expansions of capture packs
2576 * cp-tree.h (DECLTYPE_FOR_INIT_CAPTURE): Remove.
2577 * lambda.c (add_capture): Copy parameter packs from init.
2578 (lambda_capture_field_type): Always use auto for init-capture.
2579 * pt.c (uses_parameter_packs): Return tree.
2580 (tsubst) [DECLTYPE_TYPE]: Remove init-capture handling.
2581 (gen_elem_of_pack_expansion_instantiation): Don't push
2582 local_specialization_stack.
2583 (prepend_one_capture): New.
2584 (tsubst_lambda_expr): Use it. Don't touch local_specializations.
2585 (do_auto_deduction): Avoid redundant error.
2586
2587 Fix copy_node of TEMPLATE_INFO.
2588 * cp-tree.h (struct tree_template_info): Use tree_base instead of
2589 tree_common. Add tmpl and args fields.
2590 (TI_TEMPLATE, TI_ARGS): Adjust.
2591
2592 2019-07-30 Martin Liska <mliska@suse.cz>
2593
2594 PR tree-optimization/91270
2595 * tree-ssa-dce.c (propagate_necessity): Mark 2nd argument
2596 of delete operator as needed.
2597
2598 2019-07-25 Martin Liska <mliska@suse.cz>
2599 Dominik Infuhr <dominik.infuehr@theobroma-systems.com>
2600
2601 PR c++/23383
2602 * decl.c (cxx_init_decl_processing): Mark delete operators
2603 with DECL_SET_IS_OPERATOR_DELETE.
2604
2605 2019-07-25 Martin Liska <mliska@suse.cz>
2606
2607 * decl.c (duplicate_decls): Use new macros
2608 (e.g. DECL_SET_LAMBDA_FUNCTION and DECL_LAMBDA_FUNCTION_P).
2609 (cxx_init_decl_processing): Likewise.
2610 (grok_op_properties): Likewise.
2611 * parser.c (cp_parser_lambda_declarator_opt): Likewise.
2612
2613 2019-07-24 Martin Sebor <msebor@redhat.com>
2614
2615 PR driver/80545
2616 * decl.c (finish_function): Use lang_mask.
2617
2618 2019-07-20 Jason Merrill <jason@redhat.com>
2619
2620 * cp-tree.h (ovl_iterator::using_p): A USING_DECL by itself was also
2621 introduced by a using-declaration.
2622
2623 2019-07-20 Jason Merrill <jason@redhat.com>
2624
2625 Reduce memory consumption for push/pop_access_scope.
2626 * name-lookup.c (leave_scope): Do add class levels other than
2627 previous_class_level to free_binding_level.
2628 (invalidate_class_lookup_cache): Move from class.c, add to
2629 free_binding_level.
2630 * pt.c (saved_access_scope): Change from list to vec.
2631
2632 2019-07-20 Jakub Jelinek <jakub@redhat.com>
2633
2634 * cp-tree.h (OMP_FOR_GIMPLIFYING_P): Use OMP_LOOPING_CHECK
2635 instead of OMP_LOOP_CHECK.
2636 * parser.c (cp_parser_omp_clause_name): Handle bind clause.
2637 (cp_parser_omp_clause_bind): New function.
2638 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_BIND.
2639 (OMP_LOOP_CLAUSE_MASK): Define.
2640 (cp_parser_omp_loop): New function.
2641 (cp_parser_omp_parallel, cp_parser_omp_teams): Handle parsing of
2642 loop combined with parallel or teams.
2643 (cp_parser_omp_construct): Handle PRAGMA_OMP_LOOP.
2644 (cp_parser_pragma): Likewise.
2645 * pt.c (tsubst_expr): Handle OMP_LOOP.
2646 * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_BIND.
2647
2648 2019-07-19 Jason Merrill <jason@redhat.com>
2649
2650 PR c++/90101 - dependent class non-type parameter.
2651 * pt.c (invalid_nontype_parm_type_p): Check for dependent class type.
2652
2653 2019-07-18 Jason Merrill <jason@redhat.com>
2654
2655 PR c++/90098 - partial specialization and class non-type parms.
2656 PR c++/90099
2657 PR c++/90101
2658 * call.c (build_converted_constant_expr_internal): Don't copy.
2659 * pt.c (process_partial_specialization): Allow VIEW_CONVERT_EXPR
2660 around class non-type parameter.
2661 (unify) [TEMPLATE_PARM_INDEX]: Ignore cv-quals.
2662
2663 2019-07-16 Jason Merrill <jason@redhat.com>
2664
2665 * parser.c (make_location): Add overload taking cp_lexer* as last
2666 parameter.
2667
2668 * parser.c (cp_parser_simple_type_specifier): Separate tentative
2669 parses for optional type-spec and CTAD.
2670
2671 * parser.c (cp_parser_nested_name_specifier_opt): If the token is
2672 already CPP_NESTED_NAME_SPECIFIER, leave it alone.
2673
2674 2019-07-12 Jakub Jelinek <jakub@redhat.com>
2675
2676 * parser.c (cp_parser_omp_clause_name): Handle order clause.
2677 (cp_parser_omp_clause_order): New function.
2678 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_ORDER.
2679 (OMP_SIMD_CLAUSE_MASK, OMP_FOR_CLAUSE_MASK): Add
2680 PRAGMA_OMP_CLAUSE_ORDER.
2681 * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_ORDER.
2682 * pt.c (tsubst_omp_clauses): Likewise.
2683
2684 2019-07-10 Paolo Carlini <paolo.carlini@oracle.com>
2685
2686 * decl.c (get_type_quals,
2687 smallest_type_location (const cp_decl_specifier_seq*)): New.
2688 (check_tag_decl): Use smallest_type_location in error_at about
2689 multiple types in one declaration.
2690 (grokdeclarator): Use locations[ds_complex] in error_at about
2691 complex invalid; use locations[ds_storage_class] in error_at
2692 about static cdtor; use id_loc in error_at about flexible
2693 array member in union; use get_type_quals.
2694
2695 2019-07-09 Martin Sebor <msebor@redhat.com>
2696
2697 PR c++/61339
2698 * cp-tree.h: Change class-key of PODs to struct and others to class.
2699 * search.c: Same.
2700 * semantics.c (finalize_nrv_r): Same.
2701
2702 2019-07-09 Martin Sebor <msebor@redhat.com>
2703
2704 PR c++/61339
2705 * constexpr.c (cxx_eval_call_expression): Change class-key from class
2706 to struct and vice versa to match convention and avoid -Wclass-is-pod
2707 and -Wstruct-no-pod.
2708 * constraint.cc (get_concept_definition): Same.
2709 * cp-tree.h: Same.
2710 * cxx-pretty-print.h: Same.
2711 * error.c: Same.
2712 * logic.cc (term_list::replace): Same.
2713 * name-lookup.c (find_local_binding): Same.
2714 * pt.c (tsubst_binary_right_fold): Same.
2715 * search.c (field_accessor_p): Same.
2716 * semantics.c (expand_or_defer_fn): Same.
2717
2718 2019-07-08 Jakub Jelinek <jakub@redhat.com>
2719
2720 PR c++/91110
2721 * decl2.c (cp_omp_mappable_type_1): Don't emit any note for
2722 error_mark_node type.
2723
2724 2019-07-05 Jakub Jelinek <jakub@redhat.com>
2725
2726 PR c++/67184
2727 PR c++/69445
2728 * call.c (build_new_method_call_1): Remove set but not used variable
2729 binfo.
2730
2731 2019-07-05 Paolo Carlini <paolo.carlini@oracle.com>
2732
2733 PR c++/67184 (again)
2734 PR c++/69445
2735 * call.c (build_over_call): Devirtualize user-defined operators
2736 coming from a base too.
2737 (build_new_method_call_1): Do not devirtualize here.
2738
2739 2019-07-04 Marek Polacek <polacek@redhat.com>
2740
2741 DR 1813
2742 PR c++/83374 - __is_standard_layout wrong for a class with repeated
2743 bases.
2744 * class.c (check_bases): Set CLASSTYPE_NON_STD_LAYOUT for a class if
2745 CLASSTYPE_REPEATED_BASE_P is true.
2746
2747 2019-07-04 Andrew Stubbs <ams@codesourcery.com>
2748
2749 * cp-tree.h (cp_omp_emit_unmappable_type_notes): New prototype.
2750 * decl.c (cp_finish_decl): Call cp_omp_emit_unmappable_type_notes.
2751 * decl2.c (cp_omp_mappable_type): Move contents to ...
2752 (cp_omp_mappable_type_1): ... here and add note output.
2753 (cp_omp_emit_unmappable_type_notes): New function.
2754 * semantics.c (finish_omp_clauses): Call
2755 cp_omp_emit_unmappable_type_notes in four places.
2756
2757 2019-07-03 Martin Liska <mliska@suse.cz>
2758
2759 * call.c (build_new_op_1): Remove dead assignemts.
2760 * typeck.c (cp_build_binary_op): Likewise.
2761
2762 2019-06-27 Jason Merrill <jason@redhat.com>
2763
2764 PR c++/55442 - memory-hog with highly recursive constexpr.
2765 * constexpr.c (push_cx_call_context): Return depth.
2766 (cxx_eval_call_expression): Don't cache past constexpr_cache_depth.
2767
2768 2019-06-27 Jan Hubicka <jh@suse.cz>
2769
2770 * class.c (layout_class_type): Set TYPE_CXX_ODR_P for as-base
2771 type copy.
2772
2773 2019-06-27 Martin Liska <mliska@suse.cz>
2774
2775 * class.c (adjust_clone_args): Remove obviously
2776 dead assignments.
2777 (dump_class_hierarchy_r): Likewise.
2778 * decl.c (check_initializer): Likewise.
2779 * parser.c (cp_parser_lambda_expression): Likewise.
2780 * pt.c (unify_bound_ttp_args): Likewise.
2781 (convert_template_argument): Likewise.
2782 * rtti.c (build_headof): Likewise.
2783 * typeck.c (convert_for_initialization): Likewise.
2784
2785 2019-06-25 Jason Merrill <jason@redhat.com>
2786
2787 PR c++/70462 - unnecessary base ctor variant with final.
2788 * optimize.c (populate_clone_array): Skip base variant if
2789 CLASSTYPE_FINAL.
2790 (maybe_clone_body): We don't need an alias if we are only defining
2791 one clone.
2792
2793 * class.c (resolves_to_fixed_type_p): Check CLASSTYPE_FINAL.
2794
2795 2019-06-25 Jakub Jelinek <jakub@redhat.com>
2796
2797 PR c++/90969
2798 * constexpr.c (cxx_eval_array_reference): Don't look through VCE from
2799 vector type if lval.
2800
2801 2019-06-25 Jozef Lawrynowicz <jozef.l@mittosystems.com>
2802
2803 * lex.c (init_reswords): Create keyword for "__intN__" type.
2804 * cp-tree.h (cp_decl_specifier_seq): New bitfield "int_n_alt".
2805 * decl.c (grokdeclarator): Don't pedwarn about "__intN" ISO
2806 C incompatibility if alternate "__intN__" form is used.
2807 * parser.c (cp_parser_simple_type_specifier): Set
2808 decl_specs->int_n_alt if "__intN__" form is used.
2809
2810 2019-06-24 Jan Hubicka <jh@suse.cz>
2811
2812 * lex.c (cxx_make_type): Set TYPE_CXX_ODR_P.
2813
2814 2019-06-24 Jason Merrill <jason@redhat.com>
2815
2816 * class.c (layout_class_type): Don't use a separate
2817 CLASSTYPE_AS_BASE if it's the same size.
2818
2819 2019-06-23 Marek Polacek <polacek@redhat.com>
2820
2821 * call.c (convert_default_arg): Use DEFERRED_PARSE instead of
2822 DEFAULT_ARG.
2823 * cp-objcp-common.c (cp_tree_size): Likewise. Use tree_deferred_parse
2824 instead of tree_default_arg.
2825 * cp-tree.def: Rename DEFAULT_ARG to DEFERRED_PARSE.
2826 * cp-tree.h: Rename DEFARG_TOKENS to DEFPARSE_TOKENS. Rename
2827 DEFARG_INSTANTIATIONS to DEFPARSE_INSTANTIATIONS. Rename
2828 tree_default_arg to tree_deferred_parse.
2829 (UNPARSED_NOEXCEPT_SPEC_P): Use DEFERRED_PARSE instead of DEFAULT_ARG.
2830 (cp_tree_node_structure_enum): Rename TS_CP_DEFAULT_ARG to
2831 TS_CP_DEFERRED_PARSE.
2832 (lang_tree_node): Rename tree_default_arg to tree_deferred_parse.
2833 Rename default_arg to deferred_parse. Use TS_CP_DEFERRED_PARSE instead
2834 of TS_CP_DEFAULT_ARG.
2835 (defarg_location): Remove declaration.
2836 (defparse_location): Add declaration.
2837 * decl.c (grokfndecl): Use DEFERRED_PARSE instead of DEFAULT_ARG.
2838 Call defparse_location instead of defarg_location.
2839 (check_default_argument): Use DEFERRED_PARSE instead of DEFAULT_ARG.
2840 (cp_tree_node_structure): Likewise. Use TS_CP_DEFERRED_PARSE instead
2841 of TS_CP_DEFAULT_ARG.
2842 * decl2.c (grokfield): Use DEFERRED_PARSE instead of DEFAULT_ARG.
2843 * error.c (dump_expr): Likewise.
2844 (location_of): Likewise.
2845 * init.c (get_nsdmi): Likewise.
2846 * parser.c (cp_parser_save_noexcept): Likewise. Use DEFPARSE_TOKENS
2847 instead of DEFARG_TOKENS.
2848 (cp_parser_late_noexcept_specifier): Likewise.
2849 (cp_parser_late_parse_one_default_arg): Use DEFPARSE_TOKENS instead
2850 of DEFARG_TOKENS.
2851 (cp_parser_late_parsing_default_args): Use DEFERRED_PARSE instead of
2852 DEFAULT_ARG. Use DEFPARSE_INSTANTIATIONS instead of
2853 DEFARG_INSTANTIATIONS.
2854 (cp_parser_cache_defarg): Use DEFERRED_PARSE instead of DEFAULT_ARG.
2855 Use DEFPARSE_TOKENS instead of DEFARG_TOKENS. Use
2856 DEFPARSE_INSTANTIATIONS instead of DEFARG_INSTANTIATIONS.
2857 (defparse_location): Renamed from defarg_location.
2858 * pt.c (tsubst_default_argument): Use DEFERRED_PARSE instead of
2859 DEFAULT_ARG.
2860 (tsubst_arg_types): Likewise.
2861 (dependent_type_p_r): Likewise.
2862 * tree.c (cp_tree_equal): Likewise.
2863 (cp_walk_subtrees): Likewise.
2864 * typeck.c (convert_arguments): Likewise.
2865
2866 2019-06-22 Marek Polacek <polacek@redhat.com>
2867
2868 PR c++/86476 - noexcept-specifier is a complete-class context.
2869 PR c++/52869
2870 * cp-tree.def (DEFAULT_ARG): Update commentary.
2871 * cp-tree.h (UNPARSED_NOEXCEPT_SPEC_P): New macro.
2872 (tree_default_arg): Use tree_base instead of tree_common.
2873 (do_push_parm_decls, maybe_check_overriding_exception_spec): Declare.
2874 * decl.c (do_push_parm_decls): New function, broken out of...
2875 (store_parm_decls): ...here. Call it.
2876 * except.c (nothrow_spec_p): Accept DEFAULT_ARG in the assert.
2877 * parser.c (cp_parser_noexcept_specification_opt,
2878 cp_parser_late_noexcept_specifier, noexcept_override_late_checks):
2879 Forward-declare.
2880 (unparsed_noexcepts): New macro.
2881 (push_unparsed_function_queues): Update initializer.
2882 (cp_parser_direct_declarator): Pass FRIEND_P to
2883 cp_parser_exception_specification_opt.
2884 (inject_parm_decls): New.
2885 (pop_injected_parms): New.
2886 (cp_parser_class_specifier_1): Implement delayed parsing of
2887 noexcept-specifiers.
2888 (cp_parser_save_noexcept): New.
2889 (cp_parser_late_noexcept_specifier): New.
2890 (noexcept_override_late_checks): New.
2891 (cp_parser_noexcept_specification_opt): Add FRIEND_P parameter. Call
2892 cp_parser_save_noexcept instead of the normal processing if needed.
2893 (cp_parser_exception_specification_opt): Add FRIEND_P parameter and
2894 pass it to cp_parser_noexcept_specification_opt.
2895 (cp_parser_save_member_function_body): Fix comment.
2896 (cp_parser_save_default_args): Maybe save the noexcept-specifier to
2897 post process.
2898 (cp_parser_transaction): Update call to
2899 cp_parser_noexcept_specification_opt.
2900 (cp_parser_transaction_expression): Likewise.
2901 * parser.h (cp_unparsed_functions_entry): Add new field to carry
2902 a noexcept-specifier.
2903 * pt.c (dependent_type_p_r): Handle unparsed noexcept expression.
2904 * search.c (maybe_check_overriding_exception_spec): New function, broken
2905 out of...
2906 (check_final_overrider): ...here. Call
2907 maybe_check_overriding_exception_spec.
2908 * tree.c (canonical_eh_spec): Handle UNPARSED_NOEXCEPT_SPEC_P.
2909 (cp_tree_equal): Handle DEFAULT_ARG.
2910
2911 PR c++/90881 - bogus -Wunused-value in unevaluated context.
2912 * cvt.c (convert_to_void): Don't emit unused warnings in
2913 an unevaluated context.
2914
2915 2019-06-22 Paolo Carlini <paolo.carlini@oracle.com>
2916
2917 * decl.c (grokdeclarator): Use id_loc, typespec_loc, and
2918 locations[ds_storage_class] in a few additional places.
2919
2920 2019-06-21 Paolo Carlini <paolo.carlini@oracle.com>
2921
2922 PR c++/90909
2923 Revert:
2924 2019-05-21 Paolo Carlini <paolo.carlini@oracle.com>
2925
2926 PR c++/67184
2927 PR c++/69445
2928 * call.c (build_over_call): Devirtualize when the final overrider
2929 comes from the base.
2930
2931 2019-06-21 Marek Polacek <polacek@redhat.com>
2932
2933 PR c++/61490 - qualified-id in friend function definition.
2934 * decl.c (grokdeclarator): Diagnose qualified-id in friend function
2935 definition. Improve location for diagnostics of friend functions.
2936
2937 PR c++/60223 - ICE with T{} in non-deduced context.
2938 * pt.c (unify): Allow COMPOUND_LITERAL_P in a non-deduced context.
2939
2940 PR c++/64235 - missing syntax error with invalid alignas.
2941 * parser.c (cp_parser_std_attribute_spec): Commit to tentative parse
2942 if there's a missing close paren.
2943
2944 PR c++/90490 - fix decltype issues in noexcept-specifier.
2945 * except.c (build_noexcept_spec): Call
2946 instantiate_non_dependent_expr_sfinae before
2947 build_converted_constant_expr instead of calling
2948 instantiate_non_dependent_expr after it. Add
2949 processing_template_decl_sentinel.
2950
2951 2019-06-21 Jakub Jelinek <jakub@redhat.com>
2952
2953 PR c++/90950
2954 * semantics.c (finish_omp_clauses): Don't reject references to
2955 incomplete types if processing_template_decl.
2956
2957 2019-06-19 Marek Polacek <polacek@redhat.com>
2958
2959 PR c++/60364 - noreturn after first decl not diagnosed.
2960 * decl.c (duplicate_decls): Give an error when a function is
2961 declared [[noreturn]] after its first declaration.
2962 * parser.c (cp_parser_std_attribute): Don't treat C++11 noreturn
2963 attribute as equivalent to GNU's.
2964 * tree.c (std_attribute_table): Add noreturn.
2965
2966 2019-06-19 Jakub Jelinek <jakub@redhat.com>
2967
2968 * cp-gimplify.c (cp_genericize_r): Handle OMP_CLAUSE_{IN,EX}CLUSIVE
2969 like OMP_CLAUSE_SHARED.
2970
2971 2019-06-18 Jason Merrill <jason@redhat.com>
2972
2973 * constexpr.c (cxx_eval_store_expression): Delay target evaluation.
2974
2975 2019-06-18 Jason Merrill <jason@redhat.com>
2976
2977 * constexpr.c (eval_and_check_array_index): Split out from...
2978 (cxx_eval_array_reference): ...here.
2979 (cxx_eval_store_expression): Use it here, too.
2980 (diag_array_subscript): Take location. Strip location wrapper.
2981
2982 2019-06-18 Jason Merrill <jason@redhat.com>
2983
2984 * constexpr.c (cxx_eval_constant_expression): Handle conversion from
2985 and then to the same type.
2986
2987 2019-06-18 Jason Merrill <jason@redhat.com>
2988
2989 * constexpr.c (unshare_constructor): Add MEM_STAT_DECL.
2990
2991 2019-06-17 Jakub Jelinek <jakub@redhat.com>
2992
2993 * semantics.c (finish_omp_clauses): For OMP_CLAUSE_REDUCTION_INSCAN
2994 set need_copy_assignment.
2995
2996 2019-06-17 Marek Polacek <polacek@redhat.com>
2997
2998 PR c++/83820 - excessive attribute arguments not detected.
2999 * parser.c (cp_parser_std_attribute): Detect excessive arguments.
3000
3001 2019-06-17 Nathan Sidwell <nathan@acm.org>
3002
3003 PR c++/90754
3004 * name-lookup.c (lookup_type_scope_1): Calll qualify_lookup before
3005 checking context.
3006
3007 2019-06-14 Marek Polacek <polacek@redhat.com>
3008
3009 PR c++/90884 - stray note with -Wctor-dtor-privacy.
3010 * class.c (maybe_warn_about_overly_private_class): Guard the call to
3011 inform.
3012
3013 2019-06-12 Jason Merrill <jason@redhat.com>
3014
3015 PR c++/85552 - wrong instantiation of dtor for DMI.
3016 * typeck2.c (digest_nsdmi_init): Set tf_no_cleanup for direct-init.
3017
3018 2019-06-13 Paolo Carlini <paolo.carlini@oracle.com>
3019
3020 * decl.c (grokdeclarator): Use id_loc in five additional places
3021 in the last part of the function.
3022
3023 2019-06-13 Paolo Carlini <paolo.carlini@oracle.com>
3024
3025 * decl.c (grokdeclarator): Move further up the declaration of
3026 id_loc, use it immediately, update its value after the loop
3027 over declarator, use it again in the final part of function;
3028 improve locations of error messages about multiple data types
3029 and conflicting specifiers.
3030
3031 2019-06-13 Richard Biener <rguenther@suse.de>
3032
3033 PR c++/90801
3034 * typeck2.c (split_nonconstant_init_1): Properly count
3035 num_split_elts, optimize single constructor elt removal.
3036
3037 2019-06-12 Marek Polacek <polacek@redhat.com>
3038
3039 PR c++/66999 - 'this' captured by reference.
3040 * parser.c (cp_parser_lambda_introducer): Reject `&this'. Use
3041 cp_lexer_nth_token_is instead of cp_lexer_peek_nth_token.
3042
3043 PR c++/90825 - endless recursion when evaluating sizeof.
3044 PR c++/90832 - endless recursion when evaluating sizeof.
3045 * constexpr.c (cxx_eval_constant_expression): Don't recurse on the
3046 result of fold_sizeof_expr if is returns a SIZEOF_EXPR.
3047 * typeck.c (cxx_sizeof_expr): Only return a SIZEOF_EXPR if the operand
3048 is instantiation-dependent.
3049
3050 PR c++/90736 - bogus error with alignof.
3051 * constexpr.c (adjust_temp_type): Use cv_unqualified type.
3052
3053 2019-06-11 Matthew Beliveau <mbelivea@redhat.com>
3054
3055 PR c++/90449 - add -Winaccessible-base option.
3056 * class.c (warn_about_ambiguous_bases): Changed name to:
3057 maybe_warn_about_inaccessible_bases.
3058 (maybe_warn_about_inaccessible_bases): Implemented new
3059 Winaccessible-base warning option for both direct and virtual
3060 base warnings.
3061 (layout_class_type): Call to warn_about_ambiguous_bases changed to fit
3062 new name.
3063
3064 2019-06-11 Richard Biener <rguenther@suse.de>
3065
3066 PR c++/90801
3067 * typeck2.c (split_nonconstant_init_1): Avoid ordered remove
3068 from CONSTRUCTOR by marking to remove elements and doing all
3069 of them in a O(n) scan.
3070
3071 2019-06-11 Jakub Jelinek <jakub@redhat.com>
3072
3073 PR c++/90810
3074 * init.c (constant_value_1): Handle VECTOR_CST DECL_INITIAL for
3075 !DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P decls like CONSTRUCTOR.
3076
3077 2019-06-11 Martin Liska <mliska@suse.cz>
3078
3079 PR c++/87847
3080 * pt.c (init_template_processing): Disable hash table
3081 sanitization for decl_specializations and type_specializations.
3082
3083 2019-06-10 Jason Merrill <jason@redhat.com>
3084
3085 * constexpr.c (free_constructor): New.
3086 (cxx_eval_call_expression): Free parameter value CONSTRUCTORs.
3087
3088 * constexpr.c (unshare_constructor): Only unshare if T is itself a
3089 CONSTRUCTOR.
3090 (cxx_eval_call_expression): Don't call it on the result here.
3091
3092 Reduce constexpr_call memory consumption.
3093 * constexpr.c (cxx_bind_parameters_in_call): Use TREE_VEC rather
3094 than TREE_LIST.
3095 (constexpr_call_hasher::equal, cxx_bind_parameters_in_call)
3096 (cxx_eval_call_expression): Adjust.
3097
3098 2019-06-10 Jakub Jelinek <jakub@redhat.com>
3099
3100 * parser.c (cp_parser_omp_clause_reduction): Don't sorry_at on inscan
3101 reductions.
3102 (cp_parser_omp_scan_loop_body): New function.
3103 (cp_parser_omp_for_loop): Call cp_parser_omp_scan_loop_body if there
3104 are inscan reduction clauses.
3105 (cp_parser_pragma): Reject PRAGMA_OMP_SCAN.
3106 * semantics.c (finish_omp_clauses): Reject mixing inscan with
3107 non-inscan reductions on the same construct, or inscan reductions with
3108 ordered or schedule clauses, or inscan array reductions.
3109 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_{IN,EX}CLUSIVE.
3110 (tsubst_expr): Handle OMP_SCAN.
3111
3112 2019-06-07 Jason Merrill <jason@redhat.com>
3113
3114 * constexpr.c (cxx_eval_constant_expression): Call
3115 STRIP_ANY_LOCATION_WRAPPER early.
3116 [CONVERT_EXPR]: Don't build anything for conversion to void.
3117 [ADDR_EXPR]: ggc_free unused ADDR_EXPR.
3118
3119 2019-06-05 Martin Sebor <msebor@redhat.com>
3120
3121 PR c/90737
3122 * typeck.c (maybe_warn_about_returning_address_of_local): Only
3123 consider functions returning pointers as candidates for
3124 -Wreturn-local-addr.
3125
3126 2019-06-05 Paolo Carlini <paolo.carlini@oracle.com>
3127
3128 * decl.c (smallest_type_location): New.
3129 (check_special_function_return_type): Use it.
3130 (grokdeclarator): Lkewise.
3131
3132 2019-06-05 Paolo Carlini <paolo.carlini@oracle.com>
3133
3134 * decl.c (grokdeclarator): Use locations[ds_friend]
3135 in one place.
3136
3137 2019-06-05 Martin Sebor <msebor@redhat.com>
3138
3139 * call.c (build_conditional_expr_1): Adjust quoting and hyphenation.
3140 (convert_like_real): Same.
3141 (convert_arg_to_ellipsis): Same.
3142 * constexpr.c (diag_array_subscript): Same.
3143 * constraint.cc (diagnose_trait_expression): Same.
3144 * cvt.c (ocp_convert): Same.
3145 * decl.c (start_decl): Same.
3146 (check_for_uninitialized_const_var): Same.
3147 (grokfndecl): Same.
3148 (check_special_function_return_type): Same.
3149 (finish_enum_value_list): Same.
3150 (start_preparsed_function): Same.
3151 * parser.c (cp_parser_decl_specifier_seq): Same.
3152 * typeck.c (cp_build_binary_op): Same.
3153 (build_static_cast_1): Same.
3154
3155 2019-06-04 Nina Dinka Ranns <dinka.ranns@gmail.com>
3156
3157 PR c++/63149 - Wrong auto deduction from braced-init-list.
3158 * pt.c (listify_autos): use non cv qualified auto_node in
3159 std::initializer_list<auto>.
3160
3161 2019-06-04 Paolo Carlini <paolo.carlini@oracle.com>
3162
3163 * decl.c (grokdeclarator): Use declarator->id_loc in two
3164 additional places.
3165
3166 2019-06-04 Nathan Sidwell <nathan@acm.org>
3167
3168 * name-lookup.c (lookup_type_scope_1): Reimplement, handle local
3169 and namespace scopes separately.
3170
3171 2019-06-04 Harald van Dijk <harald@gigawatt.nl>
3172
3173 PR c++/60531 - Wrong error about unresolved overloaded function
3174 * typeck.c (cp_build_binary_op): See if overload can be resolved.
3175 (cp_build_unary_op): Ditto.
3176
3177 2019-06-04 Jason Merrill <jason@redhat.com>
3178
3179 Reduce accumulated garbage in constexpr evaluation.
3180 * constexpr.c (cxx_eval_call_expression): ggc_free any bindings we
3181 don't save.
3182 (cxx_eval_increment_expression): ggc_free the MODIFY_EXPR after
3183 evaluating it.
3184
3185 2019-06-04 Jakub Jelinek <jakub@redhat.com>
3186
3187 * cp-tree.h (CP_OMP_CLAUSE_INFO): Allow for any clauses up to _condvar_
3188 instead of only up to linear.
3189
3190 2019-06-03 Paolo Carlini <paolo.carlini@oracle.com>
3191
3192 * parser.c (cp_parser_unqualified_id): Use build_min_nt_loc in
3193 five places.
3194
3195 2019-06-01 Ville Voutilainen <ville.voutilainen@gmail.com>
3196
3197 PR c++/85254
3198 * class.c (fixup_type_variants): Handle CLASSTYPE_FINAL.
3199
3200 2019-05-31 Nathan Sidwell <nathan@acm.org>
3201
3202 * cp-tree.h (IDENTIFIER_LAMBDA_P): New.
3203 (TYPE_ANON_P): New.
3204 (LAMBDA_TYPE_P, TYPE_UNNAMED_P): Likewise.
3205 (LAMBDANAME_PREFIX, LAMBDANAME_FORMAT): Delete.
3206 (make_lambda_name): Don't declare.
3207 * error.c (dump_aggr_type): Check for lambdas before other
3208 anonymous names.
3209 * lambda.c (begin_lambda_type): Use make_anon_name.
3210 * cp-lang.c (cxx_dwarf_name): Lambda names smell anonymous.
3211 * mangle.c (write_local_name): Likewise.
3212 * name-lookup.c (lambda_cnt, make_lambda_name): Delete.
3213
3214 2019-05-30 Marek Polacek <polacek@redhat.com>
3215
3216 * cp-tree.h (TYPE_HAS_NONTRIVIAL_DESTRUCTOR): Fix a typo.
3217
3218 2019-05-31 Paolo Carlini <paolo.carlini@oracle.com>
3219
3220 * decl.c (grokdeclarator): Use declarator->id_loc in five
3221 error_at calls.
3222
3223 2019-05-29 Jakub Jelinek <jakub@redhat.com>
3224
3225 PR c++/90598
3226 * tree.c (lvalue_kind): Return clk_none for expressions with
3227 with VOID_TYPE_P.
3228
3229 2019-05-29 Paolo Carlini <paolo.carlini@oracle.com>
3230
3231 PR c++/89875
3232 * parser.c (cp_parser_sizeof_operand): When the type-id production
3233 did not work out commit to the tentative parse.
3234
3235 2019-05-29 Jakub Jelinek <jakub@redhat.com>
3236
3237 P1091R3 - Extending structured bindings to be more like var decls
3238 P1381R1 - Reference capture of structured bindings
3239 * decl.c (cp_maybe_mangle_decomp): Handle TREE_STATIC decls even at
3240 function scope.
3241 (cp_finish_decomp): Copy over various decl properties from decl to
3242 v[i] in the tuple case.
3243 (grokdeclarator): Allow static, thread_local and __thread for C++2a
3244 and use pedwarn instead of error for older standard revisions.
3245 Make other structured binding diagnostic messages more i18n friendly.
3246
3247 2019-05-28 Nathan Sidwell <nathan@acm.org>
3248
3249 * decl.c (duplicate_decls): Assert a template newdecl has no
3250 specializations.
3251
3252 2019-05-28 Marek Polacek <polacek@redhat.com>
3253
3254 PR c++/90548 - ICE with generic lambda and empty pack.
3255 * pt.c (tsubst_copy_and_build): Handle pack expansion properly.
3256
3257 2019-05-28 Nathan Sidwell <nathan@acm.org>
3258
3259 * cp-tree.h (make_anon_name): Drop declaration.
3260 (TYPE_UNNAMED_P): Use IDENTIFIER_ANON_P.
3261 * cp-lang.c (cxx_dwarf_name): Likewise.
3262 * class.c (find_flexarrays): Likewise.
3263 * decl.c (name_unnamed_type, xref_tag_1): Likewise.
3264 * error.c (dump_aggr_type): Likewise.
3265 * pt.c (push_template_decl_real): Likewise.
3266 * name-lookup.c (consider_binding_level): Likewise.
3267 (anon_cnt, make_anon_name): Delete.
3268
3269 2019-05-25 Marek Polacek <polacek@redhat.com>
3270
3271 PR c++/90572 - wrong disambiguation in friend declaration.
3272 * parser.c (cp_parser_constructor_declarator_p): Don't allow missing
3273 typename for friend declarations.
3274
3275 2019-05-23 Jonathan Wakely <jwakely@redhat.com>
3276
3277 * cp-tree.h (CP_AGGREGATE_TYPE_P): Fix whitespace.
3278
3279 * init.c (std_placement_new_fn_p): Remove outdated TODO comment that
3280 was resolved by r254694.
3281
3282 2019-05-22 Jason Merrill <jason@redhat.com>
3283
3284 PR c++/20408 - unnecessary code for empty struct.
3285 * call.c (build_call_a): Use simple_empty_class_p.
3286
3287 PR c++/86485 - -Wmaybe-unused with empty class ?:
3288 * cp-gimplify.c (simple_empty_class_p): Also true for MODIFY_EXPR.
3289
3290 2019-05-21 Paolo Carlini <paolo.carlini@oracle.com>
3291
3292 * parser.c (cp_parser_template_declaration_after_parameters): Use
3293 DECL_SOURCE_LOCATION in literal operator template errors.
3294
3295 2019-05-21 Paolo Carlini <paolo.carlini@oracle.com>
3296
3297 PR c++/67184
3298 PR c++/69445
3299 * call.c (build_over_call): Devirtualize when the final overrider
3300 comes from the base.
3301
3302 2019-05-21 Nathan Sidwell <nathan@acm.org>
3303
3304 * name-lookup.c (do_nonmember_using_decl): Drop INSERT_P
3305 parameter. Document.
3306 (finish_nonmember_using_decl): Adjust do_nonmember_using_decl
3307 calls. Remove stray FIXME comment.
3308
3309 * name-lookup.h (struct cp_binding_level): Drop usings field.
3310 (finish_namespace_using_decl, finish_local_using_decl): Replace with ...
3311 (finish_nonmember_using_decl): ... this.
3312 * name-lookup.c (push_using_decl_1, push_using_decl):
3313 (do_nonmember_using_decl): ... here. Add INSERT_P arg. Reimplement.
3314 (validate_nonmember_using_decl, finish_namespace_using_decl)
3315 (finish_local_using_decl): Replace with ...
3316 (finish_nonmember_using_decl): ... this. Drop DECL parm.
3317 * parser.c (cp_parser_using_declaration): Don't do lookup here.
3318 * pt.c (tsubst_expr): Do not do using decl lookup here.
3319
3320 2019-05-21 Eric Botcazou <ebotcazou@adacore.com>
3321
3322 * decl2.c (cpp_check) <IS_ASSIGNMENT_OPERATOR>: New case.
3323
3324 2019-05-20 Marek Polacek <polacek@redhat.com>
3325
3326 CWG 2094 - volatile scalars are trivially copyable.
3327 PR c++/85679
3328 * tree.c (trivially_copyable_p): Don't check CP_TYPE_VOLATILE_P for
3329 scalar types.
3330
3331 2019-05-20 Marek Polacek <polacek@redhat.com>
3332
3333 * pt.c (convert_template_argument): Add a diagnostic for the
3334 [temp.arg]/2 ambiguity case.
3335
3336 * name-lookup.c (finish_using_directive): Don't issue inform() if the
3337 warning didn't trigger. Add quoting. Tweak the inform message.
3338
3339 2019-05-20 Paolo Carlini <paolo.carlini@oracle.com>
3340
3341 * cp-tree.h: Remove remnants of CONV_NONCONVERTING.
3342
3343 2019-05-20 Nathan Sidwell <nathan@acm.org>
3344
3345 * name-lookup.c (finish_namespace_using_directive)
3346 (finish_local_using_directive): Merge to ...
3347 (finish_using_directive): ... here. Handle both contexts.
3348 * name-lookup.h (finish_namespace_using_directive)
3349 (finish_local_using_directive): Replace with ...
3350 (finish_using_directive): ... this.
3351 * parser.c (cp_parser_using_directive): Adjust.
3352 * pt.c (tsubst_expr): Likewise.
3353
3354 * cp-tree.h (struct lang_decl_ns): Remove usings field.
3355 (DECL_NAMESPACE_USING): Delete.
3356 * name-lookup.c (name_lookup::search_usings): Use namespace's
3357 binding scope.
3358 (name_lookup::queue_namespae): Likewise.
3359 (finish_namespace_using_directive, push_namespace): Likewise.
3360 (has_using_namespace_std_directive): Just search the entire
3361 binding stack.
3362
3363 2019-05-20 Jonathan Wakely <jwakely@redhat.com>
3364
3365 PR c++/90532 Ensure __is_constructible(T[]) is false
3366 * method.c (is_xible_helper): Return error_mark_node for construction
3367 of an array of unknown bound.
3368
3369 2019-05-17 Thomas Schwinge <thomas@codesourcery.com>
3370
3371 PR c++/89433
3372 * parser.c (cp_finalize_oacc_routine): Rework checking if already
3373 marked with an OpenACC 'routine' directive.
3374
3375 PR c++/89433
3376 * parser.c (cp_parser_oacc_routine)
3377 (cp_parser_late_parsing_oacc_routine): Normalize order of clauses.
3378 (cp_finalize_oacc_routine): Call oacc_verify_routine_clauses.
3379
3380 PR c++/89433
3381 * parser.c (cp_finalize_oacc_routine): Refer to OpenACC 'routine'
3382 clauses from "omp declare target" attribute.
3383
3384 2019-05-16 Martin Sebor <msebor@redhat.com>
3385
3386 * call.c (print_z_candidate): Wrap diagnostic text in a gettext
3387 macro. Adjust.
3388 (print_z_candidates): Same.
3389 (build_conditional_expr_1): Quote keywords, operators, and types
3390 in diagnostics.
3391 (build_op_delete_call): Same.
3392 (maybe_print_user_conv_context): Wrap diagnostic text in a gettext
3393 macro.
3394 (convert_like_real): Same.
3395 (convert_arg_to_ellipsis): Quote keywords, operators, and types
3396 in diagnostics.
3397 (build_over_call): Same.
3398 (joust): Break up an overlong line. Wrap diagnostic text in a gettext
3399 macro.
3400 * constexpr.c (cxx_eval_check_shift_p): Spell out >= in English.
3401 (cxx_eval_constant_expression): Quote keywords, operators, and types
3402 in diagnostics.
3403 (potential_constant_expression_1): Same.
3404 * cp-gimplify.c (cp_genericize_r): Same.
3405 * cvt.c (maybe_warn_nodiscard): Quote keywords, operators, and types
3406 in diagnostics.
3407 (type_promotes_to): Same.
3408 * decl.c (check_previous_goto_1): Same.
3409 (check_goto): Same.
3410 (start_decl): Same.
3411 (cp_finish_decl): Avoid parenthesizing a sentence for consistency.
3412 (grok_op_properties): Quote keywords, operators, and types
3413 in diagnostics.
3414 * decl2.c (grokfield): Same.
3415 (coerce_delete_type): Same.
3416 * except.c (is_admissible_throw_operand_or_catch_parameter): Same.
3417 * friend.c (do_friend): Quote C++ tokens.
3418 * init.c (build_new_1): Quote keywords, operators, and types
3419 in diagnostics.
3420 (build_vec_delete_1): Same.
3421 (build_delete): Same.
3422 * lex.c (parse_strconst_pragma): Same.
3423 (handle_pragma_implementation): Same.
3424 (unqualified_fn_lookup_error): Same.
3425 * mangle.c (write_type): Same.
3426 * method.c (defaulted_late_check): Avoid two consecutive punctuators.
3427 * name-lookup.c (cp_binding_level_debug): Remove a trailing newline.
3428 (pop_everything): Same.
3429 * parser.c (cp_lexer_start_debugging): Quote a macro name.
3430 in a diagnostic
3431 (cp_lexer_stop_debugging): Same.
3432 (cp_parser_userdef_numeric_literal): Quote a C++ header name
3433 in a diagnostic.
3434 (cp_parser_nested_name_specifier_opt): Quote keywords, operators,
3435 and types in diagnostics.
3436 (cp_parser_question_colon_clause): Same.
3437 (cp_parser_asm_definition): Same.
3438 (cp_parser_init_declarator): Same.
3439 (cp_parser_template_declaration_after_parameters): Avoid capitalizing
3440 a sentence in a diagnostic.
3441 (cp_parser_omp_declare_reduction): Quote keywords, operators, and types
3442 in diagnostics.
3443 (cp_parser_transaction): Same.
3444 * pt.c (maybe_process_partial_specialization): Replace second call
3445 to permerror with inform for consistency with other uses.
3446 (expand_integer_pack): Quote keywords, operators, and types
3447 in diagnostics.
3448 * rtti.c (get_typeid): Quote keywords, operators, and types
3449 in diagnostics.
3450 (build_dynamic_cast_1): Same.
3451 * semantics.c (finish_asm_stmt): Same.
3452 (finish_label_decl): Same.
3453 (finish_bases): Same.
3454 (finish_offsetof): Same.
3455 (cp_check_omp_declare_reduction): Same.
3456 (finish_decltype_type): Same.
3457 * tree.c (handle_init_priority_attribute): Same. Add detail
3458 to diagnostics.
3459 (maybe_warn_zero_as_null_pointer_constant): Same.
3460 * typeck.c (cp_build_binary_op): Quote keywords, operators, and types
3461 in diagnostics.
3462 (cp_build_unary_op): Same.
3463 (check_for_casting_away_constness): Same.
3464 (build_static_cast): Same.
3465 (build_const_cast_1): Same.
3466 (maybe_warn_about_returning_address_of_local): Same.
3467 (check_return_expr): Same.
3468 * typeck2.c (abstract_virtuals_error_sfinae): Same.
3469 (digest_init_r): Replace a tab with spaces in a diagnostic.
3470 (build_functional_cast): Quote keywords, operators, and types
3471 in diagnostics.
3472
3473 2019-05-15 Jakub Jelinek <jakub@redhat.com>
3474
3475 PR debug/90197
3476 * cp-gimplify.c (genericize_cp_loop): Emit a DEBUG_BEGIN_STMT
3477 before the condition (or if missing or constant non-zero at the end
3478 of the loop. Emit a DEBUG_BEGIN_STMT before the increment expression
3479 if any. Don't call protected_set_expr_location on incr if it already
3480 has a location.
3481
3482 2019-05-15 Marek Polacek <polacek@redhat.com>
3483
3484 CWG 2096 - constraints on literal unions.
3485 * class.c (check_field_decls): Initialize booleans directly. A union
3486 is literal if at least one of its non-static data members is of
3487 non-volatile literal type.
3488
3489 2019-05-15 Paolo Carlini <paolo.carlini@oracle.com>
3490
3491 * cp-tree.h (REFERENCE_VLA_OK): Remove.
3492 * lambda.c (build_capture_proxy): Remove use of the above.
3493
3494 2019-05-15 Paolo Carlini <paolo.carlini@oracle.com>
3495
3496 * call.c (perform_overload_resolution, build_new_method_call_1):
3497 Use OVL_P; remove redundant TEMPLATE_DECL checks.
3498 * decl.c (grokfndecl): Likewise.
3499 * mangle.c (write_expression): Likewise.
3500 * parser.c (cp_parser_template_id): Likewise.
3501 * pt.c (resolve_overloaded_unification, type_dependent_expression_p):
3502 Likewise.
3503 * search.c (build_baselink): Likewise.
3504 * tree.c (is_overloaded_fn, dependent_name, maybe_get_fns): Likewise.
3505
3506 2019-05-14 Paolo Carlini <paolo.carlini@oracle.com>
3507
3508 PR preprocessor/90382
3509 * decl.c (grokdeclarator): Fix value assigned to typespec_loc, use
3510 min_location.
3511
3512 2019-05-13 Jason Merrill <jason@redhat.com>
3513
3514 Use releasing_vec more broadly.
3515 * cp-tree.h (struct releasing_vec): Replace get_ref method with
3516 operator&.
3517 (vec_safe_push, vec_safe_reserve, vec_safe_length, vec_safe_splice):
3518 Forwarding functions for releasing_vec.
3519 (release_tree_vector): Declare but don't define.
3520 * call.c (build_op_delete_call, build_temp, call_copy_ctor)
3521 (perform_direct_initialization_if_possible): Use releasing_vec.
3522 * constexpr.c (cxx_eval_vec_init_1, cxx_eval_store_expression):
3523 Likewise.
3524 * cp-gimplify.c (cp_fold): Likewise.
3525 * cvt.c (force_rvalue, ocp_convert): Likewise.
3526 * decl.c (get_tuple_decomp_init): Likewise.
3527 * except.c (build_throw): Likewise.
3528 * init.c (perform_member_init, expand_default_init): Likewise.
3529 * method.c (do_build_copy_assign, locate_fn_flags): Likewise.
3530 * parser.c (cp_parser_userdef_char_literal)
3531 (cp_parser_userdef_numeric_literal)
3532 (cp_parser_userdef_string_literal)
3533 (cp_parser_perform_range_for_lookup)
3534 (cp_parser_range_for_member_function, cp_parser_omp_for_loop)
3535 (cp_parser_omp_for_loop_init): Likewise.
3536 * pt.c (tsubst_copy_and_build, do_class_deduction): Likewise.
3537 * semantics.c (calculate_direct_bases, calculate_bases)
3538 (finish_omp_barrier, finish_omp_flush, finish_omp_taskwait)
3539 (finish_omp_taskyield, finish_omp_cancel)
3540 (finish_omp_cancellation_point): Likewise.
3541 * tree.c (build_vec_init_elt, strip_typedefs, strip_typedefs_expr)
3542 (build_min_non_dep_op_overload): Likewise.
3543 * typeck.c (build_function_call_vec, cp_build_function_call_nary)
3544 (cp_build_modify_expr): Likewise.
3545 * typeck2.c (build_functional_cast): Likewise.
3546
3547 2019-05-11 Paolo Carlini <paolo.carlini@oracle.com>
3548
3549 * typeck.c (cp_build_function_call_vec): When mark_used fails
3550 unconditionally return error_mark_node.
3551
3552 2019-05-10 Paolo Carlini <paolo.carlini@oracle.com>
3553
3554 * decl.c (grokvardecl): Use an accurate location in error message
3555 about main as a global variable.
3556
3557 2019-05-10 Paolo Carlini <paolo.carlini@oracle.com>
3558
3559 * call.c (build_call_a): Use FUNC_OR_METHOD_TYPE_P.
3560 * cp-gimplify.c (cp_fold): Likewise.
3561 * cp-objcp-common.c (cp_type_dwarf_attribute): Likewise.
3562 * cp-tree.h (TYPE_OBJ_P, TYPE_PTROBV_P): Likewise.
3563 * cvt.c (perform_qualification_conversions): Likewise.
3564 * decl.c (grokdeclarator): Likewise.
3565 * decl2.c (build_memfn_type): Likewise.
3566 * mangle.c (canonicalize_for_substitution, write_type): Likewise.
3567 * parser.c (cp_parser_omp_declare_reduction): Likewise.
3568 * pt.c (check_explicit_specialization, uses_deducible_template_parms,
3569 check_cv_quals_for_unify, dependent_type_p_r): Likewise.
3570 * rtti.c (ptr_initializer): Likewise.
3571 * semantics.c (finish_asm_stmt, finish_offsetof,
3572 cp_check_omp_declare_reduction): Likewise.
3573 * tree.c (cp_build_qualified_type_real,
3574 cp_build_type_attribute_variant, cxx_type_hash_eq,
3575 cxx_copy_lang_qualifiers, cp_free_lang_data): Likewise.
3576 * typeck.c (structural_comptypes, convert_arguments,
3577 cp_build_addr_expr_1, unary_complex_lvalue, cp_build_c_cast,
3578 cp_build_modify_expr, comp_ptr_ttypes_real, type_memfn_rqual):
3579 Likewise.
3580
3581 2019-05-10 Marek Polacek <polacek@redhat.com>
3582
3583 PR c++/78010 - bogus -Wsuggest-override warning on final function.
3584 * class.c (check_for_override): Don't warn for final functions.
3585
3586 2019-05-10 Jakub Jelinek <jakub@redhat.com>
3587
3588 PR pch/90326
3589 * config-lang.in (gtfiles): Remove c-family/c-lex.c, add
3590 c-family/c-cppbuiltin.c.
3591
3592 2019-05-09 Paolo Carlini <paolo.carlini@oracle.com>
3593
3594 PR c++/90382
3595 Revert:
3596 2018-04-26 Paolo Carlini <paolo.carlini@oracle.com>
3597
3598 * decl.c (grokdeclarator): Fix value assigned to typespec_loc, use
3599 min_location.
3600
3601 2019-05-08 Nathan Sidwell <nathan@acm.org>
3602
3603 Kill DECL_SAVED_FUNCTION_DATA .
3604 * cp-tree.h (language_function): Remove x_auto_return_pattern.
3605 (current_function_auto_return_pattern): Delete.
3606 (lang_decl_fn): Replace saved_language_function with
3607 saved_auto_return type.
3608 (DECL_SAVED_FUNCTION_DATA): Delete.
3609 (DECL_SAVED_AUTO_RETURN_TYPE): New.
3610 (FNDECL_USED_AUTO): Correct documentation.
3611 * decl.c (duplicate_decls): Adjust AUTO return handling.
3612 (start_preparsed_function): Replace
3613 current_function_auto_return_pattern with
3614 DECL_SAVED_AUTO_RETURN_TYPE. Remove DECL_SAVED_FUNCTION_DATA
3615 zapping.
3616 (finish_function): Likewise.
3617 (save_function_data): Delete.
3618 (fndecl_declared_return_type): Reimplement.
3619 * mangle.c (write_unqualified_name): Use DECL_SAVED_AUTO_RETURN_TYPE.
3620 * method.c (make_thunk, make_alias_for): Likewise.
3621 * parser.c (cp_parser_jump_statement): Likewise.
3622 * pt.c (do_auto_deduction): Likewise.
3623 * typeck.c (check_return_expr): Likewise.
3624
3625 2019-05-06 Jason Merrill <jason@redhat.com>
3626
3627 PR c++/90171 - reorganize usual_deallocation_fn_p
3628 * call.c (struct dealloc_info): New.
3629 (usual_deallocation_fn_p): Take a dealloc_info*.
3630 (aligned_deallocation_fn_p, sized_deallocation_fn_p): Remove.
3631 (build_op_delete_call): Adjust.
3632
3633 2019-05-07 Jason Merrill <jason@redhat.com>
3634
3635 PR c++/86485 - -Wmaybe-unused with empty class ?:
3636 * typeck.c (build_static_cast_1): Use cp_build_addr_expr.
3637
3638 * pt.c (type_dependent_expression_p): A non-type template parm with
3639 a placeholder type is type-dependent.
3640
3641 2019-05-06 Marek Polacek <polacek@redhat.com>
3642
3643 PR c++/90265 - ICE with generic lambda.
3644 * pt.c (tsubst_copy_and_build): Use a dedicated variable for the last
3645 element in the vector.
3646
3647 2019-05-03 Martin Liska <mliska@suse.cz>
3648
3649 * call.c (build_aggr_conv): Use is_empty instead of
3650 elements () == 0 (and similar usages).
3651 * parser.c (cp_parser_lambda_introducer): Likewise.
3652
3653 2019-05-02 Nathan Sidwell <nathan@acm.org>
3654
3655 * semantics.c (finish_id_expression_1): Remove unreachable code.
3656
3657 2019-05-01 Nathan Sidwell <nathan@acm.org>
3658
3659 * name-lookup.h (get_class_binding_direct): Change final arg to
3660 bool.
3661 (get_class_binding): Likewise.
3662 * name-lookup.c (get_class_binding_direct): Replace TYPE_OR_FNS
3663 arg with WANT_TYPE bool. Simplify.
3664 (get_class_binding): Adjust final arg.
3665 * decl.c (reshape_init_class): Adjust get_class_binding calls.
3666
3667 2019-04-30 Nathan Sidwell <nathan@acm.org>
3668
3669 * cp-objcp-common.c (cp_common_init_ts): Use MARK_TS_EXP for _EXPR
3670 nodes. Call c_common_init_ts.
3671
3672 2019-04-29 Nathan Sidwell <nathan@acm.org>
3673
3674 * decl.c (duplicate_decls): Add whitespace, move comments into
3675 conditional blocks.
3676 * method.c (explain_implicit_non_constexpr): Refactor.
3677 * pt.c (check_explicit_specialization): Fix indentation.
3678 * semantics.c (process_outer_var_ref): Reformat.
3679 (finish_id_expression_1): Use STRIP_TEMPLATE.
3680
3681 2019-04-26 Jonathan Wakely <jwakely@redhat.com>
3682
3683 PR c++/90243 - orphaned note in uninstantiated constexpr function
3684 * decl.c (check_for_uninitialized_const_var): Suppress notes if no
3685 error was shown.
3686
3687 2019-04-26 Paolo Carlini <paolo.carlini@oracle.com>
3688
3689 PR c++/90173
3690 * decl.c (grokdeclarator): Set type to error_mark_node
3691 upon error about template placeholder type non followed
3692 by a simple declarator-id.
3693
3694 2019-04-26 Paolo Carlini <paolo.carlini@oracle.com>
3695
3696 * decl.c (grokdeclarator): Fix value assigned to typespec_loc, use
3697 min_location.
3698
3699 2019-04-24 Jason Merrill <jason@redhat.com>
3700
3701 PR c++/90227 - error with template parameter packs.
3702 * pt.c (coerce_template_parms): Do add empty pack when
3703 require_all_args.
3704
3705 2019-04-24 Richard Biener <rguenther@suse.de>
3706
3707 * call.c (null_ptr_cst_p): Order checks according to expensiveness.
3708 (conversion_null_warnings): Likewise.
3709 * typeck.c (same_type_ignoring_top_level_qualifiers_p): Return
3710 early if type1 == type2.
3711
3712 2019-04-22 Jason Merrill <jason@redhat.com>
3713
3714 PR c++/87366 - wrong error with alias template.
3715 * typeck.c (structural_comptypes): When comparing_specializations,
3716 aliases are unequal.
3717 (comptypes): When comparing_specializations, do structural
3718 comparison.
3719
3720 2019-04-19 Jason Merrill <jason@redhat.com>
3721
3722 PR c++/90190 - CTAD with list-constructor.
3723 * pt.c (do_class_deduction): Don't try the single element deduction
3724 if the single element is also a braced list.
3725
3726 PR c++/90171 - ICE with destroying delete with size_t parm.
3727 * call.c (sized_deallocation_fn_p): New. Use it instead of
3728 second_parm_is_size_t in most cases.
3729 (second_parm_is_size_t): Don't check for aligned.
3730
3731 2019-04-19 Paolo Carlini <paolo.carlini@oracle.com>
3732
3733 PR c++/89900
3734 * pt.c (fn_type_unification): When handling null explicit
3735 arguments do not special case non-parameter packs.
3736
3737 2019-04-19 Jakub Jelinek <jakub@redhat.com>
3738
3739 PR c++/90138
3740 * pt.c (process_template_parm): Set decl to pushdecl result. If
3741 !is_non_type, also set parm to that.
3742
3743 PR c/89888
3744 * decl.c (struct cp_switch): Remove outside_range_p member.
3745 (push_switch): Don't clear it.
3746 (pop_switch): Adjust c_do_switch_warnings caller.
3747 (finish_case_label): Adjust c_add_case_label caller.
3748
3749 PR c++/90108
3750 * decl.c (duplicate_decls): If remove is main variant and
3751 DECL_ORIGINAL_TYPE is some other type, remove a DECL_ORIGINAL_TYPE
3752 variant that has newdecl as TYPE_NAME if any.
3753
3754 2019-04-18 Jason Merrill <jason@redhat.com>
3755
3756 PR c++/87554 - ICE with extern template and reference member.
3757 * decl.c (cp_finish_decl): Don't set DECL_INITIAL of external vars.
3758
3759 2019-04-17 Jason Merrill <jason@redhat.com>
3760
3761 PR c++/90047 - ICE with enable_if alias template.
3762 * pt.c (tsubst_decl) [TYPE_DECL]: Don't put an erroneous decl in the
3763 hash table when we're in SFINAE context.
3764
3765 2019-04-17 Marek Polacek <polacek@redhat.com>
3766
3767 PR c++/90124 - bogus error with incomplete type in decltype.
3768 * typeck.c (build_class_member_access_expr): Check
3769 cp_unevaluated_operand.
3770
3771 2019-04-12 Jakub Jelinek <jakub@redhat.com>
3772
3773 PR c/89933
3774 * decl.c (duplicate_decls): When newdecl's type is its main variant,
3775 don't try to remove it from the variant list, but instead assert
3776 it has no variants.
3777
3778 2019-04-12 Martin Sebor <msebor@redhat.com>
3779
3780 PR c/88383
3781 PR c/89288
3782 * parser.c (cp_parser_has_attribute_expression): Handle assignment
3783 expressions.
3784
3785 2019-04-12 Jason Merrill <jason@redhat.com>
3786
3787 * call.c (null_member_pointer_value_p): Handle an empty CONSTRUCTOR
3788 of PMF type.
3789
3790 2019-04-12 Marek Polacek <polacek@redhat.com>
3791
3792 * except.c (build_noexcept_spec): Use build_converted_constant_bool_expr
3793 instead of perform_implicit_conversion_flags.
3794
3795 PR c++/87603 - constexpr functions are no longer noexcept.
3796 * constexpr.c (is_sub_constant_expr): Remove unused function.
3797 * cp-tree.h (is_sub_constant_expr): Remove declaration.
3798 * except.c (check_noexcept_r): Don't consider a call to a constexpr
3799 function noexcept.
3800
3801 2019-04-11 Jakub Jelinek <jakub@redhat.com>
3802
3803 PR translation/90035
3804 * parser.h (struct cp_parser): Add
3805 type_definition_forbidden_message_arg member.
3806 * parser.c (cp_debug_parser): Print it.
3807 (cp_parser_check_type_definition): Pass
3808 parser->type_definition_forbidden_message_arg as second argument to
3809 error.
3810 (cp_parser_has_attribute_expression, cp_parser_sizeof_operand): Set
3811 parser->type_definition_forbidden_message_arg and use G_() with
3812 %qs for parser->type_definition_forbidden_message instead of
3813 building untranslatable message using concat.
3814
3815 2019-04-09 Jakub Jelinek <jakub@redhat.com>
3816
3817 PR translation/90011
3818 * typeck2.c (check_narrowing): Remove trailing space from diagnostics.
3819
3820 2019-04-08 Marek Polacek <polacek@redhat.com>
3821
3822 * typeck2.c (digest_init_r): Don't condition the object slicing warning
3823 on flag_checking.
3824
3825 2019-04-08 Paolo Carlini <paolo.carlini@oracle.com>
3826
3827 PR c++/89914
3828 * semantics.c (trait_expr_value): Don't use TYPE_NOTHROW_P
3829 when maybe_instantiate_noexcept fails.
3830 (classtype_has_nothrow_assign_or_copy_p): Likewise.
3831 * method.c (implicitly_declare_fn): Avoid passing error_mark_node
3832 to build_exception_variant.
3833
3834 2019-04-05 Marek Polacek <polacek@redhat.com>
3835
3836 PR c++/87145 - bogus error converting class type in template arg list.
3837 * pt.c (convert_nontype_argument): Don't call
3838 build_converted_constant_expr if it could involve calling a conversion
3839 function with a instantiation-dependent constructor as its argument.
3840
3841 2019-04-05 Martin Sebor <msebor@redhat.com>
3842
3843 PR bootstrap/89980
3844 * decl.c (reshape_init_array_1): Avoid treating empty strings
3845 as zeros in array initializers.
3846 Use trivial_type_p () instead of TYPE_HAS_TRIVIAL_DFLT().
3847
3848 2019-04-04 Jason Merrill <jason@redhat.com>
3849
3850 PR c++/89948 - ICE with break in statement-expr.
3851 * constexpr.c (cxx_eval_statement_list): Jumping out of a
3852 statement-expr is non-constant.
3853
3854 2019-04-04 Jason Merrill <jason@redhat.com>
3855
3856 PR c++/89966 - error with non-type auto tparm.
3857 * pt.c (do_auto_deduction): Clear tf_partial.
3858
3859 2019-04-04 Jason Merrill <jason@redhat.com>
3860
3861 PR c++/86986 - ICE with TTP with parameter pack.
3862 * pt.c (coerce_template_parameter_pack): Only look at the type of a
3863 non-type parameter pack.
3864 (fixed_parameter_pack_p_1): Don't recurse into the type of a
3865 non-type parameter pack.
3866 (coerce_template_template_parms): Call add_outermost_template_args.
3867
3868 2019-04-04 Martin Sebor <msebor@redhat.com>
3869
3870 PR c++/89974
3871 PR c++/89878
3872 PR c++/89833
3873 PR c++/47488
3874 * decl.c (reshape_init_array_1): Strip trailing zero-initializers
3875 from arrays of trivial type and known size.
3876 * mangle.c (write_expression): Convert braced initializer lists
3877 to STRING_CSTs.
3878 (write_expression): Trim trailing zero-initializers from arrays
3879 of trivial type.
3880 (write_template_arg_literal): Mangle strings the same as braced
3881 initializer lists.
3882
3883 2019-04-03 Jason Merrill <jason@redhat.com>
3884
3885 PR c++/81866 - ICE with member template and default targ.
3886 * pt.c (tsubst_template_decl): Handle getting a type from
3887 retrieve_specialization.
3888
3889 PR c++/86586 - -fcompare-debug=-Wsign-compare.
3890 * typeck.c (cp_build_binary_op): Don't fold for -Wsign-compare.
3891
3892 PR c++/89331 - ICE with offsetof in incomplete class.
3893 * semantics.c (finish_offsetof): Handle error_mark_node.
3894 * typeck.c (build_class_member_access_expr): Call
3895 complete_type_or_maybe_complain before converting to base.
3896
3897 PR c++/89917 - ICE with lambda in variadic mem-init.
3898 * pt.c (make_pack_expansion): Change type_pack_expansion_p to false.
3899
3900 2019-04-01 Jason Merrill <jason@redhat.com>
3901
3902 PR c++/86946 - ICE with function call in template argument.
3903 DR 1321
3904 * pt.c (iterative_hash_template_arg) [CALL_EXPR]: Use
3905 dependent_name.
3906
3907 2019-04-01 Paolo Carlini <paolo.carlini@oracle.com>
3908
3909 PR c++/62207
3910 * pt.c (tsubst_copy): Deal with lookup_name not returing a variable.
3911
3912 2019-03-31 Marek Polacek <polacek@redhat.com>
3913
3914 PR c++/89852 - ICE with C++11 functional cast with { }.
3915 * constexpr.c (fold_non_dependent_expr_template): New static function
3916 broken out of...
3917 (fold_non_dependent_expr): ...here.
3918 (fold_non_dependent_init): New function.
3919 * cp-tree.h (fold_non_dependent_init): Declare.
3920 * typeck2.c (massage_init_elt): Call fold_non_dependent_init instead
3921 of fold_non_dependent_expr. Don't call maybe_constant_init.
3922
3923 2019-03-30 Jason Merrill <jason@redhat.com>
3924
3925 PR c++/89744 - ICE with specialization of member class template.
3926 * pt.c (lookup_template_class_1): If the partial instantiation is
3927 explicitly specialized, adjust.
3928 (maybe_process_partial_specialization): Also adjust
3929 CLASSTYPE_TI_ARGS.
3930
3931 2019-03-29 Jakub Jelinek <jakub@redhat.com>
3932
3933 PR sanitizer/89869
3934 * typeck.c: Include gimplify.h.
3935 (cp_build_modify_expr) <case COND_EXPR>: Unshare rhs before using it
3936 for second time. Formatting fixes.
3937
3938 2019-03-29 Marek Polacek <polacek@redhat.com>
3939
3940 PR c++/89876 - ICE with deprecated conversion.
3941 * call.c (convert_like_real): Only give warnings with tf_warning.
3942
3943 2019-03-28 Marek Polacek <polacek@redhat.com>
3944
3945 PR c++/89612 - ICE with member friend template with noexcept.
3946 * pt.c (maybe_instantiate_noexcept): For function templates, use their
3947 template result (function decl). Don't set up local specializations.
3948 Temporarily turn on processing_template_decl. Update the template type
3949 too.
3950
3951 PR c++/89836 - bool constant expression and explicit conversions.
3952 * call.c (build_converted_constant_expr_internal): New function,
3953 renamed from...
3954 (build_converted_constant_expr): ...this. New.
3955 (build_converted_constant_bool_expr): New.
3956 * cp-tree.h (build_converted_constant_bool_expr): Declare.
3957 * decl.c (build_explicit_specifier): Call
3958 build_converted_constant_bool_expr.
3959
3960 2019-03-28 Jakub Jelinek <jakub@redhat.com>
3961
3962 PR c++/89785
3963 * constexpr.c (struct check_for_return_continue_data): New type.
3964 (check_for_return_continue): New function.
3965 (potential_constant_expression_1) <case SWITCH_STMT>: Walk
3966 SWITCH_STMT_BODY to find RETURN_EXPRs or CONTINUE_STMTs not nested
3967 in loop bodies and set *jump_target to that if found.
3968
3969 2019-03-27 Jason Merrill <jason@redhat.com>
3970
3971 PR c++/89831 - error with qualified-id in const member function.
3972 * semantics.c (finish_non_static_data_member): Use object cv-quals
3973 in scoped case, too.
3974
3975 PR c++/89421 - ICE with lambda in template parameter list.
3976 * parser.c (cp_parser_lambda_expression): Also reject a lambda in a
3977 template parameter list before C++20.
3978 * pt.c (type_dependent_expression_p): True for LAMBDA_EXPR.
3979 * semantics.c (begin_class_definition): Restore error about defining
3980 non-lambda class in template parm list.
3981
3982 2019-03-26 Jason Merrill <jason@redhat.com>
3983
3984 PR c++/86932 - missed SFINAE with empty pack.
3985 * pt.c (coerce_template_parms): Don't add an empty pack if
3986 tf_partial.
3987 (fn_type_unification): Pass tf_partial to coerce_template_parms.
3988
3989 PR c++/86429 - constexpr variable in lambda.
3990 PR c++/82643
3991 PR c++/87327
3992 * constexpr.c (cxx_eval_constant_expression): In a lambda function,
3993 try evaluating the captured variable directly.
3994
3995 2019-03-26 Jakub Jelinek <jakub@redhat.com>
3996
3997 PR c++/89796
3998 * semantics.c (finish_omp_atomic): Add warning_sentinel for
3999 -Wunused-value around finish_expr_stmt call.
4000
4001 2019-03-25 Paolo Carlini <paolo.carlini@oracle.com>
4002
4003 PR c++/84661
4004 PR c++/85013
4005 * parser.c (cp_parser_binary_expression): Don't call cp_fully_fold
4006 to undo the disabling of warnings.
4007
4008 2019-03-25 Jason Merrill <jason@redhat.com>
4009
4010 PR c++/87748 - substitution failure error with decltype.
4011 * pt.c (most_specialized_partial_spec): Clear
4012 processing_template_decl.
4013
4014 2019-03-25 Marek Polacek <polacek@redhat.com>
4015
4016 PR c++/89214 - ICE when initializing aggregates with bases.
4017 * typeck2.c (digest_init_r): Warn about object slicing instead of
4018 crashing.
4019
4020 PR c++/89705 - ICE with reference binding with conversion function.
4021 * call.c (reference_binding): If the result of the conversion function
4022 is a prvalue of non-class type, use the cv-unqualified type.
4023
4024 2019-03-25 Nathan Sidwell <nathan@acm.org>
4025
4026 * lambda.c (maybe_add_lambda_conv_op): Don't add to comdat group.
4027
4028 2019-03-22 Jakub Jelinek <jakub@redhat.com>
4029
4030 PR c++/60702
4031 * cp-tree.h (get_tls_wrapper_fn): Remove declaration.
4032 (maybe_get_tls_wrapper_call): Declare.
4033 * decl2.c (get_tls_wrapper_fn): Make static.
4034 (maybe_get_tls_wrapper_call): New function.
4035 * typeck.c (build_class_member_access_expr): Handle accesses to TLS
4036 variables.
4037 * semantics.c (finish_qualified_id_expr): Likewise.
4038 (finish_id_expression_1): Use maybe_get_tls_wrapper_call.
4039 * pt.c (tsubst_copy_and_build): Likewise.
4040
4041 PR c++/87481
4042 * constexpr.c (struct constexpr_ctx): Add constexpr_ops_count member.
4043 (cxx_eval_constant_expression): When not skipping, not constant class
4044 or location wrapper, increment *ctx->constexpr_ops_count and if it is
4045 above constexpr_loop_nest_limit, diagnose failure.
4046 (cxx_eval_outermost_constant_expr): Add constexpr_ops_count and
4047 initialize ctx.constexpr_ops_count to its address.
4048 (is_sub_constant_expr): Likewise.
4049
4050 2019-03-21 Jakub Jelinek <jakub@redhat.com>
4051
4052 PR c++/71446
4053 * call.c (filed_in_pset): Change pset from hash_set<tree> * to
4054 hash_set<tree, true> &, adjust uses accordingly.
4055 (build_aggr_conv): Change pset from hash_set<tree> *
4056 to hash_set<tree, true>. Replace goto fail; with return NULL;,
4057 adjust pset uses.
4058
4059 PR c++/89767
4060 * parser.c (cp_parser_lambda_introducer): Add ids and first_capture_id
4061 variables, check for duplicates in this function.
4062 * lambda.c (add_capture): Don't check for duplicates nor use
4063 IDENTIFIER_MARKED.
4064 (register_capture_members): Don't clear IDENTIFIER_MARKED here.
4065
4066 2019-03-21 Paolo Carlini <paolo.carlini@oracle.com>
4067
4068 PR c++/89571
4069 * method.c (after_nsdmi_defaulted_late_checks): Avoid passing
4070 error_mark_node to comp_except_specs.
4071
4072 2019-03-20 Jason Merrill <jason@redhat.com>
4073
4074 PR c++/87480 - decltype of member access in default template arg
4075 * pt.c (type_unification_real): Accept a dependent result in
4076 template context.
4077
4078 2019-03-19 Martin Sebor <msebor@redhat.com>
4079
4080 PR tree-optimization/89688
4081 * typeck2.c (store_init_value): Call braced_lists_to_string for more
4082 kinds of initializers.
4083
4084 2019-03-18 Jason Merrill <jason@redhat.com>
4085
4086 PR c++/89630 - ICE with dependent using-decl as template arg.
4087 * tree.c (cp_tree_equal): Always return false for USING_DECL.
4088
4089 PR c++/89761 - ICE with sizeof... in pack expansion.
4090 * pt.c (argument_pack_element_is_expansion_p): Handle
4091 ARGUMENT_PACK_SELECT.
4092
4093 PR c++/89640 - GNU attributes on lambda.
4094 * parser.c (cp_parser_lambda_declarator_opt): Allow GNU attributes.
4095
4096 PR c++/89682 - wrong access error in default argument.
4097 * pt.c (tsubst_default_argument): Don't defer access checks.
4098
4099 2019-03-18 Paolo Carlini <paolo.carlini@oracle.com>
4100
4101 PR c++/85014
4102 * semantics.c (finish_non_static_data_member): Check return value
4103 of context_for_name_lookup and immediately return error_mark_node
4104 if isn't a type.
4105
4106 2019-03-17 Jason Merrill <jason@redhat.com>
4107
4108 PR c++/89571 - ICE with ill-formed noexcept on constructor.
4109 * pt.c (maybe_instantiate_noexcept): Only return false if defaulted.
4110 (regenerate_decl_from_template): Use it for noexcept-specs.
4111
4112 2019-03-14 Jason Merrill <jason@redhat.com>
4113
4114 * parser.c (cp_parser_decl_specifier_seq): Support C++20
4115 concept-definition syntax without 'bool'.
4116
4117 2019-03-14 Jakub Jelinek <jakub@redhat.com>
4118
4119 PR c++/89512
4120 * semantics.c (finish_qualified_id_expr): Reject variable templates.
4121
4122 PR c++/89652
4123 * constexpr.c (struct constexpr_ctx): Change save_exprs type from
4124 hash_set<tree> to vec<tree>.
4125 (cxx_eval_call_expression): Adjust for save_exprs being a vec instead
4126 of hash_set.
4127 (cxx_eval_loop_expr): Likewise. Truncate the vector after each
4128 removal of SAVE_EXPRs from values.
4129 (cxx_eval_constant_expression) <case SAVE_EXPR>: Call safe_push
4130 method on save_exprs instead of add.
4131
4132 2019-03-13 Jason Merrill <jason@redhat.com>
4133
4134 PR c++/86521 - C++17 copy elision in initialization by constructor.
4135 * call.c (joust_maybe_elide_copy): New.
4136 (joust): Call it.
4137
4138 2019-03-13 Marek Polacek <polacek@redhat.com>
4139
4140 PR c++/88979 - further P0634 fix for constructors.
4141 * parser.c (cp_parser_decl_specifier_seq): Pass flags to
4142 cp_parser_constructor_declarator_p.
4143 (cp_parser_direct_declarator): Allow missing typename for constructor
4144 parameters.
4145 (cp_parser_constructor_declarator_p): Add FLAGS parameter. Pass it to
4146 cp_parser_type_specifier.
4147
4148 PR c++/89686 - mixing init-capture and simple-capture in lambda.
4149 * parser.c (cp_parser_lambda_introducer): Give error when combining
4150 init-capture and simple-capture.
4151
4152 PR c++/89660 - bogus error with -Wredundant-move.
4153 * typeck.c (maybe_warn_pessimizing_move): Only accept (T &) &arg
4154 as the std::move's argument. Don't call convert_for_initialization
4155 when warn_redundant_move isn't on.
4156
4157 2019-03-11 Jason Merrill <jason@redhat.com>
4158
4159 PR c++/86521 - wrong overload resolution with ref-qualifiers.
4160 * call.c (build_user_type_conversion_1): Don't use a conversion to a
4161 reference of the wrong rvalueness for direct binding.
4162
4163 2019-03-11 Martin Liska <mliska@suse.cz>
4164
4165 * cvt.c (build_expr_type_conversion): Wrap apostrophes
4166 in gcc internal format with %'.
4167 * decl.c (check_no_redeclaration_friend_default_args): Likewise.
4168 (grokfndecl): Likewise.
4169 * name-lookup.c (do_pushtag): Likewise.
4170 * pt.c (unify_parameter_deduction_failure): Likewise.
4171 (unify_template_deduction_failure): Likewise.
4172
4173 2019-03-11 Martin Liska <mliska@suse.cz>
4174
4175 * call.c (convert_arg_to_ellipsis): Wrap an option name
4176 in a string format message and fix GNU coding style.
4177 (build_over_call): Likewise.
4178 * class.c (check_field_decl): Likewise.
4179 (layout_nonempty_base_or_field): Likewise.
4180 * constexpr.c (cxx_eval_loop_expr): Likewise.
4181 * cvt.c (type_promotes_to): Likewise.
4182 * decl.c (cxx_init_decl_processing): Likewise.
4183 (mark_inline_variable): Likewise.
4184 (grokdeclarator): Likewise.
4185 * decl2.c (record_mangling): Likewise.
4186 * error.c (maybe_warn_cpp0x): Likewise.
4187 * except.c (doing_eh): Likewise.
4188 * mangle.c (maybe_check_abi_tags): Likewise.
4189 * parser.c (cp_parser_diagnose_invalid_type_name): Likewise.
4190 (cp_parser_userdef_numeric_literal): Likewise.
4191 (cp_parser_primary_expression): Likewise.
4192 (cp_parser_unqualified_id): Likewise.
4193 (cp_parser_pseudo_destructor_name): Likewise.
4194 (cp_parser_builtin_offsetof): Likewise.
4195 (cp_parser_lambda_expression): Likewise.
4196 (cp_parser_lambda_introducer): Likewise.
4197 (cp_parser_lambda_declarator_opt): Likewise.
4198 (cp_parser_selection_statement): Likewise.
4199 (cp_parser_init_statement): Likewise.
4200 (cp_parser_decomposition_declaration): Likewise.
4201 (cp_parser_function_specifier_opt): Likewise.
4202 (cp_parser_static_assert): Likewise.
4203 (cp_parser_simple_type_specifier): Likewise.
4204 (cp_parser_namespace_definition): Likewise.
4205 (cp_parser_using_declaration): Likewise.
4206 (cp_parser_ctor_initializer_opt_and_function_body): Likewise.
4207 (cp_parser_initializer_list): Likewise.
4208 (cp_parser_type_parameter_key): Likewise.
4209 (cp_parser_member_declaration): Likewise.
4210 (cp_parser_try_block): Likewise.
4211 (cp_parser_std_attribute_spec): Likewise.
4212 (cp_parser_requires_clause_opt): Likewise.
4213 * pt.c (check_template_variable): Likewise.
4214 (check_default_tmpl_args): Likewise.
4215 (push_tinst_level_loc): Likewise.
4216 (instantiate_pending_templates): Likewise.
4217 (invalid_nontype_parm_type_p): Likewise.
4218 * repo.c (get_base_filename): Likewise.
4219 * rtti.c (typeid_ok_p): Likewise.
4220 (build_dynamic_cast_1): Likewise.
4221 * tree.c (maybe_warn_parm_abi): Likewise.
4222
4223 2019-03-08 Jakub Jelinek <jakub@redhat.com>
4224
4225 PR other/80058
4226 * parser.c (cp_parser_template_declaration_after_parameters): Avoid
4227 one space before " at the end of line and another after " on another
4228 line in a string literal.
4229
4230 PR tree-optimization/89550
4231 * semantics.c (maybe_convert_cond): Only set TREE_NO_WARNING if
4232 warning_at returned true.
4233 * decl2.c (c_parse_final_cleanups): Likewise.
4234 * typeck.c (convert_for_assignment): Likewise.
4235 * decl.c (finish_function): Likewise.
4236
4237 PR c++/89585
4238 * parser.c (cp_parser_asm_definition): Just warn instead of error
4239 on volatile qualifier outside of function body.
4240
4241 PR c++/89599
4242 * constexpr.c (potential_constant_expression_1): Reject
4243 REINTERPRET_CAST_P NOP_EXPRs.
4244
4245 PR c++/89622
4246 * call.c (joust): Call print_z_candidate only if pedwarn returned
4247 true.
4248
4249 2019-03-07 Jason Merrill <jason@redhat.com>
4250
4251 PR c++/88123 - lambda and using-directive.
4252 * name-lookup.c (op_unqualified_lookup)
4253 (maybe_save_operator_binding, discard_operator_bindings)
4254 (push_operator_bindings): New.
4255 * typeck.c (build_x_binary_op, build_x_unary_op): Call
4256 maybe_save_operator_binding.
4257 * decl.c (start_preparsed_function): Call push_operator_bindings.
4258 * tree.c (cp_free_lang_data): Call discard_operator_bindings.
4259
4260 PR c++/88820 - ICE with CTAD and member template used in DMI.
4261 * pt.c (do_class_deduction): Handle parm used as its own arg.
4262
4263 2019-03-07 Jakub Jelinek <jakub@redhat.com>
4264
4265 PR c++/89585
4266 * parser.c (cp_parser_asm_definition): Parse asm qualifiers even
4267 at toplevel, but diagnose them.
4268
4269 2019-03-06 Jason Merrill <jason@redhat.com>
4270
4271 PR c++/89381 - implicit copy and using-declaration.
4272 * class.c (classtype_has_move_assign_or_move_ctor_p): Don't consider
4273 op= brought in by a using-declaration.
4274
4275 2019-03-06 Jakub Jelinek <jakub@redhat.com>
4276
4277 PR c++/87148
4278 * init.c (build_value_init_noctor): Ignore flexible array members.
4279
4280 2019-03-06 Jason Merrill <jason@redhat.com>
4281
4282 PR c++/89576 - if constexpr of lambda capture.
4283 * semantics.c (maybe_convert_cond): Do convert a non-dependent
4284 condition in a template.
4285 * typeck.c (condition_conversion): Handle being called in a
4286 template.
4287
4288 2019-03-06 Marek Polacek <polacek@redhat.com>
4289
4290 PR c++/87378 - bogus -Wredundant-move warning.
4291 * typeck.c (maybe_warn_pessimizing_move): See if the maybe-rvalue
4292 overload resolution would actually succeed.
4293
4294 2019-03-05 Jason Merrill <jason@redhat.com>
4295
4296 * class.c (is_really_empty_class): Add ignore_vptr parm.
4297 (trivial_default_constructor_is_constexpr): Pass it.
4298 * call.c (build_over_call): Pass it.
4299 * constexpr.c (cxx_eval_constant_expression): Pass it instead of
4300 checking TYPE_POLYMORPHIC_P.
4301 (cxx_eval_component_reference, potential_constant_expression_1):
4302 Pass it.
4303 * cp-gimplify.c (simple_empty_class_p): Pass it.
4304 * init.c (expand_aggr_init_1): Pass it.
4305
4306 2019-03-04 Paolo Carlini <paolo.carlini@oracle.com>
4307
4308 PR c++/84605
4309 * parser.c (cp_parser_class_head): Reject TYPE_BEING_DEFINED too.
4310
4311 2019-03-04 Jakub Jelinek <jakub@redhat.com>
4312
4313 PR c++/71446
4314 * call.c (field_in_pset): New function.
4315 (build_aggr_conv): Handle CONSTRUCTOR_IS_DESIGNATED_INIT correctly.
4316
4317 2019-03-02 Jakub Jelinek <jakub@redhat.com>
4318
4319 PR c++/71446
4320 * cp-tree.h (CONSTRUCTOR_IS_DESIGNATED_INIT): Define.
4321 * parser.c (cp_parser_braced_list): Adjust cp_parser_initializer_list
4322 caller, set CONSTRUCTOR_IS_DESIGNATED_INIT.
4323 (cp_parser_initializer_list): Add designated parameter, set *designated
4324 to a bool whether any designators were parsed.
4325 * decl.c (reshape_init): Copy over CONSTRUCTOR_IS_DESIGNATED_INIT if
4326 needed.
4327 * pt.c (tsubst_copy_and_build): Likewise.
4328 * call.c (implicit_conversion): If CONSTRUCTOR_IS_DESIGNATED_INIT,
4329 don't call build_list_conv, nor build_complex_conv, nor attempt to
4330 convert a single element initializer to scalar.
4331
4332 2019-03-01 Marek Polacek <polacek@redhat.com>
4333
4334 PR c++/89537 - missing location for error with non-static member fn.
4335 * call.c (resolve_args): Use EXPR_LOCATION.
4336 * typeck.c (build_class_member_access_expr): Use input_location.
4337
4338 PR c++/89532 - ICE with incomplete type in decltype.
4339 * semantics.c (finish_compound_literal): Return error_mark_node
4340 if digest_init_flags returns error_mark_node.
4341
4342 2019-03-01 Jakub Jelinek <jakub@redhat.com>
4343
4344 Implement P1002R1, Try-catch blocks in constexpr functions
4345 PR c++/89513
4346 * parser.c (cp_parser_ctor_initializer_opt_and_function_body):
4347 Diagnose constexpr ctor or function with function-try-block with
4348 pedwarn for c++17 and earlier. Formatting fix.
4349 (cp_parser_try_block): Use pedwarn instead of error and only for
4350 c++17 and earlier when try block appears in constexpr function.
4351 * constexpr.c (build_constexpr_constructor_member_initializers):
4352 Handle TRY_BLOCK here instead of erroring on it.
4353
4354 2019-02-28 Jason Merrill <jason@redhat.com>
4355
4356 PR c++/88183 - ICE with .* fold-expression.
4357 * pt.c (fold_expression) [DOTSTAR_EXPR]: Remove special handling.
4358
4359 PR c++/86969 - ICE with constexpr if and recursive generic lambdas.
4360 * class.c, lambda.c, pt.c: Revert earlier change.
4361 * lambda.c (add_capture): Don't special-case capture of dependent
4362 VLA.
4363
4364 * name-lookup.c (print_binding_level): Print this_entity.
4365
4366 2019-02-27 Marek Polacek <polacek@redhat.com>
4367
4368 PR c++/88857 - ICE with value-initialization of argument in template.
4369 * call.c (convert_like_real): Don't call build_value_init in template.
4370
4371 2019-02-27 Jason Merrill <jason@redhat.com>
4372
4373 PR c++/86969 - ICE with constexpr if and recursive generic lambdas.
4374 * semantics.c (process_outer_var_ref): Do capture dependent vars.
4375 * class.c (finish_struct): Only add TAG_DEFN if T is in
4376 current_function_decl.
4377 * lambda.c (vla_capture_type): Force the capture type out into the
4378 lambda's enclosing function.
4379 (add_capture): Pass in the lambda.
4380 * pt.c (tsubst_lambda_expr): complete_type a VLA capture type.
4381
4382 2019-02-27 Marek Polacek <polacek@redhat.com>
4383
4384 PR c++/89511 - ICE with using-declaration and unscoped enumerator.
4385 * parser.c (cp_parser_using_declaration): For an unscoped enum
4386 only use its context if it's not a function declaration.
4387
4388 2019-02-27 Paolo Carlini <paolo.carlini@oracle.com>
4389
4390 PR c++/89488
4391 * method.c (process_subob_fn): When maybe_instantiate_noexcept
4392 returns false don't call merge_exception_specifiers.
4393
4394 2019-02-27 Paolo Carlini <paolo.carlini@oracle.com>
4395
4396 PR c++/88987
4397 * parser.c (cp_parser_noexcept_specification_opt): Return NULL_TREE
4398 for a non-constant parsed expression.
4399
4400 2019-02-26 Jakub Jelinek <jakub@redhat.com>
4401
4402 PR c++/89481
4403 * constexpr.c (cxx_eval_store_expression): When changing active union
4404 member, set no_zero_init.
4405
4406 2019-02-23 Marek Polacek <polacek@redhat.com>
4407
4408 PR c++/88294 - ICE with non-constant noexcept-specifier.
4409 * pt.c (maybe_instantiate_noexcept): Set up the list of local
4410 specializations. Set current_class_{ptr,ref}.
4411
4412 2019-02-22 David Malcolm <dmalcolm@redhat.com>
4413
4414 PR c++/89390
4415 * parser.c (cp_parser_unqualified_id): Capture and use locations
4416 for destructors.
4417
4418 2019-02-22 Marek Polacek <polacek@redhat.com>
4419
4420 PR c++/89420 - ICE with CAST_EXPR in explicit-specifier.
4421 * decl.c (build_explicit_specifier): Don't check
4422 processing_template_decl. Call instantiation_dependent_expression_p
4423 instead of value_dependent_expression_p. Call
4424 instantiate_non_dependent_expr_sfinae before
4425 build_converted_constant_expr instead of calling
4426 instantiate_non_dependent_expr after it. Add
4427 processing_template_decl_sentinel.
4428
4429 2019-02-22 Thomas Schwinge <thomas@codesourcery.com>
4430
4431 * parser.c (cp_parser_oacc_simple_clause): Remove parser formal
4432 parameter, move loc formal parameter to the front. Adjust all
4433 users.
4434 (cp_parser_oacc_shape_clause): Add loc formal parameter. Adjust
4435 all users.
4436
4437 2019-02-21 Jason Merrill <jason@redhat.com>
4438
4439 PR c++/87685 - generic lambda 'this' capture error.
4440 * lambda.c (lambda_expr_this_capture): Change add_capture_p to int.
4441 (maybe_generic_this_capture): Pass -1.
4442
4443 PR c++/88394 - ICE with VLA init-capture.
4444 * lambda.c (is_normal_capture_proxy): Check DECL_CAPTURED_VARIABLE.
4445
4446 PR c++/88869 - C++17 ICE with CTAD and explicit specialization.
4447 * pt.c (do_class_deduction): Don't include explicit specialization
4448 args in outer_args.
4449
4450 PR c++/89422 - ICE with -g and lambda in default arg in template.
4451 * pt.c (tsubst_function_decl): SET_DECL_FRIEND_CONTEXT sooner.
4452
4453 2019-02-21 Jason Merrill <jason@redhat.com>
4454
4455 PR c++/88419 - C++17 ICE with class template arg deduction.
4456 * pt.c (make_template_placeholder): Set TYPE_CANONICAL after
4457 CLASS_PLACEHOLDER_TEMPLATE.
4458
4459 2019-02-21 Jakub Jelinek <jakub@redhat.com>
4460
4461 PR c++/89285
4462 * constexpr.c (struct constexpr_fundef): Add parms and result members.
4463 (retrieve_constexpr_fundef): Adjust for the above change.
4464 (register_constexpr_fundef): Save constexpr body with copy_fn,
4465 temporarily set DECL_CONTEXT on DECL_RESULT before that.
4466 (get_fundef_copy): Change FUN argument to FUNDEF with
4467 constexpr_fundef * type, grab body and parms/result out of
4468 constexpr_fundef struct and temporarily change it for copy_fn calls
4469 too.
4470 (cxx_eval_builtin_function_call): For __builtin_FUNCTION temporarily
4471 adjust current_function_decl from ctx->call context. Test
4472 !potential_constant_expression instead of !is_constant_expression.
4473 (cxx_bind_parameters_in_call): Grab parameters from new_call. Undo
4474 convert_for_arg_passing changes for TREE_ADDRESSABLE type passing.
4475 (cxx_eval_call_expression): Adjust get_fundef_copy caller.
4476 (cxx_eval_conditional_expression): For IF_STMT, allow then or else
4477 operands to be NULL.
4478 (label_matches): Handle BREAK_STMT and CONTINUE_STMT.
4479 (cxx_eval_loop_expr): Add support for FOR_STMT, WHILE_STMT and DO_STMT.
4480 (cxx_eval_switch_expr): Add support for SWITCH_STMT.
4481 (cxx_eval_constant_expression): Handle IF_STMT, FOR_STMT, WHILE_STMT,
4482 DO_STMT, CONTINUE_STMT, SWITCH_STMT, BREAK_STMT and CONTINUE_STMT.
4483 For SIZEOF_EXPR, recurse on the result of fold_sizeof_expr. Ignore
4484 DECL_EXPR with USING_DECL operand.
4485 * lambda.c (maybe_add_lambda_conv_op): Build thisarg using
4486 build_int_cst to make it a valid constant expression.
4487
4488 2019-02-20 Jason Merrill <jason@redhat.com>
4489
4490 PR c++/88690 - C++17 ICE with empty base in aggregate.
4491 * typeck2.c (process_init_constructor_record): Skip trivial
4492 initialization of an empty base.
4493
4494 2019-02-21 Richard Biener <rguenther@suse.de>
4495
4496 PR middle-end/89392
4497 * vtable-class-hierarchy.c (vtv_generate_init_routine): Do not
4498 make symtab process new functions here.
4499
4500 2019-02-20 Jason Merrill <jason@redhat.com>
4501
4502 PR c++/87921 - wrong error with inline static data member.
4503 * decl2.c (finish_static_data_member_decl): Don't set DECL_IN_AGGR_P
4504 for a non-template inline variable. Do nothing for an
4505 already-instantiated variable.
4506 (c_parse_final_cleanups): Check DECL_IN_AGGR_P without
4507 DECL_INLINE_VAR_P.
4508 * decl.c (check_initializer): Likewise.
4509 (make_rtl_for_nonlocal_decl): Likewise.
4510 * pt.c (instantiate_decl): Likewise.
4511 * typeck2.c (store_init_value): Likewise.
4512
4513 2019-02-20 Jakub Jelinek <jakub@redhat.com>
4514
4515 PR c++/89403
4516 * decl2.c (c_parse_final_cleanups): Move TREE_ASM_WRITTEN setting
4517 for flag_syntax_only from here...
4518 * semantics.c (expand_or_defer_fn_1): ... here.
4519
4520 PR c++/89405
4521 * decl.c (maybe_commonize_var): When clearing TREE_PUBLIC and
4522 DECL_COMMON, set DECL_INTERFACE_KNOWN.
4523
4524 PR c++/89336
4525 * constexpr.c (cxx_eval_store_expression): Diagnose changing of active
4526 union member for -std=c++17 and earlier.
4527
4528 2019-02-19 Jason Merrill <jason@redhat.com>
4529
4530 PR c++/87513 - 'sorry' mangling PMF template-id.
4531 * mangle.c (write_expression): Handle SCOPE_REF to BASELINK.
4532
4533 2019-02-19 Jason Merrill <jason@redhat.com>
4534
4535 PR c++/88380 - wrong-code with flexible array and NSDMI.
4536 * typeck2.c (process_init_constructor_record): Skip flexarrays.
4537
4538 2019-02-20 will wray <wjwray@gmail.com>
4539
4540 PR c++/88572 - wrong handling of braces on scalar init.
4541 * decl.c (reshape_init_r): Allow braces around scalar initializer
4542 within aggregate init. Reject double braced-init of scalar
4543 variable.
4544
4545 2019-02-20 Paolo Carlini <paolo.carlini@oracle.com>
4546
4547 PR c++/84536
4548 * pt.c (tsubst_init): Diagnose an initializer expanding to an
4549 empty list of expressions; tweak wrt dependent types.
4550 (regenerate_decl_from_template): For VAR_DECLs call tsubst_init
4551 instead of tsubst_expr.
4552
4553 2019-02-19 Jason Merrill <jason@redhat.com>
4554
4555 PR c++/88368 - wrong 'use of deleted function'
4556 * method.c (walk_field_subobs): Remember errors from get_nsdmi.
4557 (get_defaulted_eh_spec): Call push_tinst_level.
4558 * pt.c (maybe_instantiate_noexcept): Keep error_mark_node.
4559 * typeck2.c (merge_exception_specifiers): Handle error_mark_node.
4560
4561 2019-02-19 Chung-Lin Tang <cltang@codesourcery.com>
4562
4563 PR c/87924
4564 * parser.c (cp_parser_oacc_clause_wait): Add representation of wait
4565 clause without argument as 'wait (GOMP_ASYNC_NOVAL)', adjust comments.
4566
4567 2019-02-19 Jakub Jelinek <jakub@redhat.com>
4568
4569 PR c++/89387
4570 * lambda.c (maybe_generic_this_capture): Don't check
4571 DECL_NONSTATIC_MEMBER_FUNCTION_P on USING_DECLs.
4572
4573 PR c++/89391
4574 * typeck.c (build_reinterpret_cast_1): Don't handle void to
4575 && conversion go through build_target_expr_with_type.
4576
4577 PR c++/89390
4578 * error.c (qualified_name_lookup_error): Only call
4579 suggest_alternative_in_scoped_enum if name is IDENTIFIER_NODE.
4580
4581 2019-02-19 Tom Honermann <tom@honermann.net>
4582
4583 * name-lookup.c (get_std_name_hint): Added u8string as a name hint.
4584
4585 2019-02-18 Jason Merrill <jason@redhat.com>
4586
4587 PR c++/89336 - multiple stores in constexpr stmt.
4588 * constexpr.c (cxx_eval_store_expression): Preevaluate scalar or
4589 assigned value.
4590
4591 * pt.c (check_explicit_specialization): If the declarator is a
4592 template-id, only check whether the arguments are dependent.
4593
4594 Improve duplicate [[likely]] diagnostic.
4595 * parser.c (cp_parser_statement): Make attrs_loc a range. Pass it
4596 to process_stmt_hotness_attribute.
4597 * cp-gimplify.c (process_stmt_hotness_attribute): Take attrs_loc.
4598 (genericize_if_stmt): Use likely/unlikely instead of predictor_name.
4599
4600 2019-02-17 Marek Polacek <polacek@redhat.com>
4601
4602 PR c++/89217 - ICE with list-initialization in range-based for loop.
4603 * constexpr.c (unshare_constructor): No longer static.
4604 * cp-tree.h (unshare_constructor): Declare.
4605 * semantics.c (finish_compound_literal): When dealing with a
4606 non-dependent expression in a template, return the original
4607 expression. Pass LOOKUP_NO_NARROWING to digest_init_flags.
4608
4609 2019-02-13 Marek Polacek <polacek@redhat.com>
4610
4611 PR c++/89297 - ICE with OVERLOAD in template.
4612 * semantics.c (finish_compound_literal): Call
4613 instantiate_non_dependent_expr_sfinae.
4614
4615 2019-02-13 Alexandre Oliva <aoliva@redhat.com>
4616
4617 PR c++/86379
4618 * cp-tree.h (USING_DECL_SCOPE): Use result rather than type.
4619 * name-lookup.c (strip_using_decl): Use USING_DECL_SCOPE.
4620 * search.c (protected_accessible_p): Follow USING_DECL_DECLS.
4621 (shared_member_p): Likewise.
4622 (lookup_member): Likewise.
4623 * decl.c (grok_special_member_properties): Skip USING_DECLs.
4624 * semantics.c (finish_omp_declare_simd_methods): Likewise.
4625 (finish_qualified_id_expr): Do not call shared_member_p with
4626 a dependent expr.
4627
4628 PR c++/87322
4629 * pt.c (tsubst_lambda_expr): Avoid duplicate tsubsting.
4630 Move cp_evaluated resetting before signature tsubsting.
4631 (gen_elem_of_pack_expansion_instantiation): Separate local
4632 specializations per index.
4633
4634 2019-02-13 David Malcolm <dmalcolm@redhat.com>
4635
4636 PR c++/89036
4637 * class.c (add_method): Drop destructor assertion.
4638
4639 2019-02-13 Paolo Carlini <paolo.carlini@oracle.com>
4640
4641 PR c++/88986
4642 * decl.c (make_typename_type): Allow for TYPE_PACK_EXPANSION as
4643 context (the first argument).
4644 * pt.c (tsubst, case TYPENAME_TYPE): Handle TYPE_PACK_EXPANSION
4645 as context.
4646
4647 2019-02-12 Jason Merrill <jason@redhat.com>
4648
4649 PR c++/89144 - link error with constexpr initializer_list.
4650 * call.c (convert_like_real) [ck_list]: Don't allocate a temporary
4651 array for an empty list.
4652 * typeck2.c (store_init_value): Don't use cxx_constant_init in a
4653 template.
4654
4655 2019-02-11 Jason Merrill <jason@redhat.com>
4656
4657 PR c++/89241 - ICE with __func__ in lambda in template.
4658 * pt.c (enclosing_instantiation_of): Also check
4659 instantiated_lambda_fn_p for the template context.
4660
4661 2019-02-11 Marek Polacek <polacek@redhat.com>
4662
4663 PR c++/89212 - ICE converting nullptr to pointer-to-member-function.
4664 * pt.c (tsubst_copy_and_build) <case CONSTRUCTOR>: Return early for
4665 null member pointer value.
4666
4667 2019-02-11 Jakub Jelinek <jakub@redhat.com>
4668
4669 PR c++/88977
4670 * pt.c (convert_nontype_argument): Pass true as manifestly_const_eval
4671 to maybe_constant_value calls.
4672
4673 2019-02-11 Marek Polacek <polacek@redhat.com>
4674
4675 * typeck2.c (digest_init_r): Remove commented code.
4676
4677 2019-02-11 Martin Sebor <msebor@redhat.com>
4678
4679 PR c++/87996
4680 * decl.c (compute_array_index_type_loc): Preserve signed sizes
4681 for diagnostics. Call valid_array_size_p instead of error.
4682 * init.c (build_new_1): Compute size for diagnostic. Call
4683 invalid_array_size_error
4684 (build_new): Call valid_array_size_p instead of error.
4685
4686 2019-02-07 Alexandre Oliva <aoliva@redhat.com>
4687
4688 PR c++/86218
4689 * call.c (compare_ics): Deal with ck_aggr in either cs.
4690
4691 2019-02-06 David Malcolm <dmalcolm@redhat.com>
4692
4693 PR c++/71302
4694 * call.c (get_location_for_expr_unwinding_for_system_header): New
4695 function.
4696 (conversion_null_warnings): Use it when getting locations for
4697 EXPR, effectively adding a call to
4698 get_location_for_expr_unwinding_for_system_header for
4699 -Wconversion-null and making use of EXPR_LOCATION for
4700 -Wzero-as-null-pointer-constant.
4701
4702 2019-02-05 Jakub Jelinek <jakub@redhat.com>
4703
4704 PR c++/89187
4705 * optimize.c (maybe_thunk_body): Clear TREE_ADDRESSABLE on
4706 PARM_DECLs of the thunk.
4707 * lambda.c (maybe_add_lambda_conv_op): Likewise.
4708
4709 2019-02-05 Marek Polacek <polacek@redhat.com>
4710
4711 PR c++/89158 - by-value capture of constexpr variable broken.
4712 * call.c (convert_like_real) <case ck_user>: Call mark_exp_read
4713 instead of mark_rvalue_use.
4714
4715 2019-02-05 Alexandre Oliva <aoliva@redhat.com>
4716
4717 PR c++/87770
4718 * pt.c (instantiates_primary_template_p): New.
4719 (type_dependent_expression_p): Use it.
4720
4721 2019-02-01 Jason Merrill <jason@redhat.com>
4722
4723 PR c++/88761 - ICE with reference capture of constant.
4724 * lambda.c (mark_const_cap_r): Do walk subtrees of DECL_EXPR for
4725 non-proxy decls.
4726
4727 2019-02-01 Marek Polacek <polacek@redhat.com>
4728
4729 PR c++/88325 - ICE with invalid out-of-line template member definition.
4730 * parser.c (cp_parser_class_name): Don't call make_typename_type
4731 for overloads.
4732
4733 2019-02-01 Jakub Jelinek <jakub@redhat.com>
4734
4735 PR c++/87175
4736 * parser.c (cp_parser_gnu_attributes_opt): Set ok to false
4737 if require_open failed.
4738
4739 2019-01-31 Marek Polacek <polacek@redhat.com>
4740
4741 PR c++/89083, c++/80864 - ICE with list initialization in template.
4742 * constexpr.c (adjust_temp_type): Use copy_node and change the type
4743 instead of using build_constructor.
4744 * decl.c (reshape_init_r): Don't reshape a digested initializer.
4745 Return the initializer for COMPOUND_LITERAL_P.
4746
4747 PR c++/88983 - ICE with switch in constexpr function.
4748 * constexpr.c (cxx_eval_switch_expr): Use SWITCH_COND and SWITCH_BODY.
4749 (cxx_eval_constant_expression) <case COND_EXPR>: Don't look for the
4750 label in the else branch if we found it in the then branch.
4751
4752 2019-01-30 Jason Merrill <jason@redhat.com>
4753
4754 PR c++/88752 - ICE with lambda and constexpr if.
4755 * cp-tree.h (LAMBDA_EXPR_INSTANTIATED): New.
4756 * pt.c (tsubst_lambda_expr): Set it.
4757 (instantiated_lambda_fn_p): Check it.
4758 (enclosing_instantiation_of): Use it.
4759
4760 2019-01-31 Jakub Jelinek <jakub@redhat.com>
4761
4762 PR libstdc++/88170
4763 * cxx-pretty-print.c (pp_cxx_enumeration_constant): Print always as
4764 a C cast in pp_c_flag_gnu_v3 mode.
4765
4766 2019-01-30 Jakub Jelinek <jakub@redhat.com>
4767
4768 PR c++/88988
4769 * lambda.c (is_capture_proxy): Don't return true for
4770 DECL_OMP_PRIVATIZED_MEMBER artificial vars.
4771
4772 2019-01-30 Marek Polacek <polacek@redhat.com>
4773
4774 PR c++/89119 - ICE with value-initialization in template.
4775 * pt.c (tsubst_copy_and_build): Handle RANGE_EXPR.
4776
4777 2019-01-29 Jason Merrill <jason@redhat.com>
4778
4779 PR c++/86943 - wrong code converting lambda to function pointer.
4780 * lambda.c (maybe_add_lambda_conv_op): Use a template-id in the
4781 call. Only forward parms for decltype.
4782 * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Handle CALL_FROM_THUNK_P
4783 specially.
4784 * typeck.c (check_return_expr): Don't mess with a thunk call.
4785
4786 2019-01-28 Jason Merrill <jason@redhat.com>
4787
4788 PR c++/89089 - ICE with [[no_unique_address]].
4789 PR c++/88865 - wrong layout with [[no_unique_address]].
4790 * class.c (check_field_decls): A potentially-overlapping field makes
4791 the class non-layout-POD, but not non-empty.
4792 (end_of_class): Always consider empty data members.
4793 (layout_class_type): Set DECL_SIZE for empty fields.
4794
4795 2019-01-28 Marek Polacek <polacek@redhat.com>
4796
4797 PR c++/88358 - name wrongly treated as type.
4798 * parser.c (cp_parser_direct_declarator): Don't assume a qualified-id
4799 in parameter-list is a type if the function's declarator-id is not
4800 qualified.
4801
4802 2019-01-27 Marek Polacek <polacek@redhat.com>
4803
4804 PR c++/88815 - narrowing conversion lost in decltype.
4805 PR c++/78244 - narrowing conversion in template not detected.
4806 * cp-tree.h (CONSTRUCTOR_IS_DEPENDENT): New.
4807 * pt.c (instantiation_dependent_r): Consider a CONSTRUCTOR with
4808 CONSTRUCTOR_IS_DEPENDENT instantiation-dependent.
4809 * semantics.c (finish_compound_literal): When the compound literal
4810 isn't instantiation-dependent and the type isn't type-dependent,
4811 fall back to the normal processing. Set CONSTRUCTOR_IS_DEPENDENT.
4812
4813 PR c++/89024 - ICE with incomplete enum type.
4814 * call.c (standard_conversion): When converting an
4815 ARITHMETIC_TYPE_P to an incomplete type, return NULL.
4816
4817 2019-01-25 Paolo Carlini <paolo.carlini@oracle.com>
4818
4819 PR c++/88969
4820 * call.c (build_op_delete_call): Implement 7.6.2.5/(10.1).
4821 * decl2.c (coerce_delete_type): Use build_pointer_type instead
4822 of TYPE_POINTER_TO.
4823
4824 2019-01-24 Jason Merrill <jason@redhat.com>
4825
4826 PR c++/89001 - mangling of reference temporaries
4827 * cp-tree.h (struct saved_scope): Add ref_temp_count.
4828 (current_ref_temp_count): New macro.
4829 * mangle.c (mangle_ref_init_variable): Use it.
4830 * typeck2.c (store_init_value): Clear it.
4831 * call.c (make_temporary_var_for_ref_to_temp): Copy public and
4832 comdat.
4833
4834 2019-01-24 Jakub Jelinek <jakub@redhat.com>
4835
4836 PR c++/88976
4837 * semantics.c (finish_omp_cancel): Diagnose more than one if
4838 on #pragma omp cancel with different modifiers. Use
4839 maybe_convert_cond when not in template or build_x_binary_op
4840 otherwise.
4841
4842 2019-01-23 Marek Polacek <polacek@redhat.com>
4843
4844 PR c++/88757 - qualified name treated wrongly as type.
4845 * parser.c (cp_parser_direct_declarator): Don't treat qualified-ids
4846 in parameter-list as types if name lookup for declarator-id didn't
4847 find one or more function templates.
4848
4849 2019-01-23 Jakub Jelinek <jakub@redhat.com>
4850
4851 PR c/44715
4852 * cp-gimplify.c (genericize_cp_loop): Call begin_bc_block only
4853 after genericizing cond and incr expressions.
4854
4855 PR c++/88984
4856 * cp-gimplify.c (genericize_switch_stmt): Move cond genericization
4857 before the begin_bc_block call.
4858
4859 2019-01-21 Jason Merrill <jason@redhat.com>
4860
4861 PR c++/87893 - constexpr ctor ICE on ARM.
4862 PR c++/88293 - ICE with comma expression.
4863 * constexpr.c (initialized_type): Don't shortcut non-void type.
4864 Handle COMPOUND_EXPR.
4865 (cxx_eval_outermost_constant_expr): Return early for void type.
4866
4867 2019-01-21 Jakub Jelinek <jakub@redhat.com>
4868
4869 PR c++/88949
4870 * optimize.c (cxx_copy_decl): New function.
4871 (clone_body): Use it instead of copy_decl_no_change.
4872
4873 PR sanitizer/88901
4874 * typeck.c (cp_build_binary_op): Don't instrument
4875 SANITIZE_POINTER_COMPARE if processing_template_decl.
4876 (pointer_diff): Similarly for SANITIZE_POINTER_SUBTRACT.
4877
4878 2019-01-18 Jason Merrill <jason@redhat.com>
4879
4880 PR c++/88875 - error with explicit list constructor.
4881 * call.c (reference_binding): Don't modify EXPR. Set
4882 need_temporary_p on the ck_user conversion for a temporary.
4883 (convert_like_real): Check it.
4884
4885 2019-01-18 H.J. Lu <hongjiu.lu@intel.com>
4886
4887 PR c/51628
4888 PR c/88664
4889 * call.c (convert_for_arg_passing): Upate the
4890 warn_for_address_or_pointer_of_packed_member call.
4891 * typeck.c (convert_for_assignment): Likewise.
4892
4893 2019-01-17 Jason Merrill <jason@redhat.com>
4894
4895 PR c++/86205 - ICE with ?: of throw and template-id.
4896 * pt.c (resolve_nondeduced_context_or_error): Split out from...
4897 * typeck.c (decay_conversion): ...here.
4898 * call.c (build_conditional_expr_1): Use it.
4899
4900 PR c++/86740, ICE with constexpr if and nested generic lambdas.
4901 * tree.c (cp_walk_subtrees): Handle LAMBDA_EXPR.
4902
4903 2019-01-17 Paolo Carlini <paolo.carlini@oracle.com>
4904
4905 * decl.c (grokdeclarator): Use typespec_loc in error messages
4906 about 'auto' and trailing return type.
4907
4908 2019-01-17 David Malcolm <dmalcolm@redhat.com>
4909
4910 PR c++/88699
4911 * class.c (add_method): Don't use DECL_DESTRUCTOR_P on
4912 USING_DECLs.
4913
4914 2019-01-17 Nathan Sidwell <nathan@acm.org>
4915
4916 PR c++/86610
4917 * semantics.c (process_outer_var_ref): Only skip dependent types
4918 in templates.
4919
4920 2019-01-17 Alexandre Oliva <aoliva@redhat.com>
4921
4922 PR c++/87768
4923 * cp-tree.h (saved_scope): Add suppress_location_wrappers.
4924 * name-lookup.c (do_push_to_top_level): Save and reset it.
4925 (do_pop_from_top_level): Restore it.
4926
4927 PR c++/86648
4928 * pt.c (make_template_placeholder): Use auto_identifier.
4929 (is_auto): Drop CLASS_PLACEHOLDER_TEMPLATE test.
4930 * error.c (dump_type): Handle template placeholders.
4931 * cxx-pretty-print.c (pp_cx_unqualified_id): Likewise.
4932
4933 PR c++/88146
4934 * cvt.c (convert_to_void): Handle all cdtor calls as if
4935 returning void.
4936
4937 2019-01-16 Paolo Carlini <paolo.carlini@oracle.com>
4938
4939 * decl.c (grokdeclarator): Use locations[ds_storage_class] in
4940 error messages about ill-formed uses of mutable.
4941
4942 2019-01-16 Marek Polacek <polacek@redhat.com>
4943
4944 PR c++/78244 - narrowing conversion in template not detected.
4945 * call.c (perform_implicit_conversion_flags): Set
4946 IMPLICIT_CONV_EXPR_BRACED_INIT.
4947 * cp-tree.h (IMPLICIT_CONV_EXPR_BRACED_INIT): New.
4948 * pt.c (tsubst_copy_and_build): Use it.
4949
4950 2019-01-15 David Malcolm <dmalcolm@redhat.com>
4951
4952 PR c++/88795
4953 * pt.c (build_deduction_guide): Bail out if tsubst_arg_types
4954 fails.
4955
4956 2019-01-15 Paolo Carlini <paolo.carlini@oracle.com>
4957
4958 * decl.c (start_decl): Improve error location.
4959 * decl2.c (grokfield): Likewise.
4960
4961 2019-01-15 Paolo Carlini <paolo.carlini@oracle.com>
4962
4963 * decl.c (grokdeclarator): Move further up the location_t loc
4964 declaration and use the location when building a TYPE_DECL for
4965 a typedef name.
4966 * decl2.c (grokbitfield): Use DECL_SOURCE_LOCATION in the error
4967 about an ill-formed bit-field as typedef.
4968
4969 2019-01-14 Marek Polacek <polacek@redhat.com>
4970
4971 PR c++/88830 - ICE with abstract class.
4972 * decl2.c (maybe_emit_vtables): Check CLASSTYPE_LAZY_DESTRUCTOR.
4973 Fix formatting.
4974
4975 PR c++/88825 - ICE with bogus function return type deduction.
4976 * typeck.c (can_do_nrvo_p): Check error_mark_node.
4977
4978 2019-01-14 Tom Honermann <tom@honermann.net>
4979
4980 Implement P0482R5, char8_t: A type for UTF-8 characters and strings
4981 * cvt.c (type_promotes_to): Handle char8_t promotion.
4982 * decl.c (grokdeclarator): Handle invalid type specifier
4983 combinations involving char8_t.
4984 * lex.c (init_reswords): Add char8_t as a reserved word.
4985 * mangle.c (write_builtin_type): Add name mangling for char8_t (Du).
4986 * parser.c (cp_keyword_starts_decl_specifier_p)
4987 (cp_parser_simple_type_specifier): Recognize char8_t as a simple
4988 type specifier.
4989 (cp_parser_string_literal): Use char8_array_type_node for the type
4990 of CPP_UTF8STRING.
4991 (cp_parser_set_decl_spec_type): Tolerate char8_t typedefs in system
4992 headers.
4993 * rtti.c (emit_support_tinfos): type_info support for char8_t.
4994 * tree.c (char_type_p): Recognize char8_t as a character type.
4995 * typeck.c (string_conv_p): Handle conversions of u8 string
4996 literals of char8_t type.
4997 (check_literal_operator_args): Handle UDLs with u8 string literals
4998 of char8_t type.
4999 * typeck2.c (ordinary_char_type_p): New.
5000 (digest_init_r): Disallow initializing a char array with a u8 string
5001 literal.
5002
5003 2019-01-14 Martin Liska <mliska@suse.cz>
5004
5005 PR gcov-profile/88263
5006 * decl2.c (get_tls_wrapper_fn): Use DECL_SOURCE_LOCATION
5007 as location of the TLS wrapper.
5008
5009 2019-01-12 Paolo Carlini <paolo.carlini@oracle.com>
5010
5011 * decl.c (cp_finish_decl): Improve error location.
5012 * decl2.c (grokfield): Likewise, improve two locations.
5013
5014 2019-01-11 Marek Polacek <polacek@redhat.com>
5015
5016 PR c++/88692, c++/87882 - -Wredundant-move false positive with *this.
5017 * typeck.c (maybe_warn_pessimizing_move): Return if ARG isn't
5018 ADDR_EXPR.
5019
5020 2019-01-11 Jason Merrill <jason@redhat.com>
5021
5022 PR c++/88312 - pack expansion of decltype.
5023 * pt.c (instantiation_dependent_r): A template non-type parameter
5024 pack is instantiation-dependent.
5025
5026 2019-01-11 Jason Merrill <jason@redhat.com>
5027
5028 PR c++/88613 - ICE with use of const var in lambda.
5029 * expr.c (mark_use): Fix location wrapper handling.
5030 * cp-gimplify.c (cp_fold_maybe_rvalue): Call mark_rvalue_use.
5031
5032 2019-01-11 Tobias Burnus <burnus@net-b.de>
5033
5034 PR C++/88114
5035 * decl2.c (maybe_emit_vtables): If needed, generate code for
5036 the destructor of an abstract class.
5037 (mark_used): Update comment for older function-name change.
5038
5039 2019-01-11 Paolo Carlini <paolo.carlini@oracle.com>
5040
5041 * decl.c (start_decl): Improve error location.
5042 (grokdeclarator): Likewise, improve two locations.
5043
5044 2019-01-09 Sandra Loosemore <sandra@codesourcery.com>
5045
5046 PR other/16615
5047
5048 * cp-tree.h: Mechanically replace "can not" with "cannot".
5049 * parser.c: Likewise.
5050 * pt.c: Likewise.
5051
5052 2019-01-08 Paolo Carlini <paolo.carlini@oracle.com>
5053
5054 * decl.c (grok_reference_init): Improve error location.
5055 (grokdeclarator): Likewise, improve two locations.
5056
5057 2019-01-08 Marek Polacek <polacek@redhat.com>
5058
5059 PR c++/88538 - braced-init-list in template-argument-list.
5060 * parser.c (cp_parser_template_argument): Handle braced-init-list when
5061 in C++20.
5062
5063 PR c++/88548 - this accepted in static member functions.
5064 * parser.c (cp_debug_parser): Adjust printing of
5065 local_variables_forbidden_p.
5066 (cp_parser_new): Set local_variables_forbidden_p to 0 rather than false.
5067 (cp_parser_primary_expression): When checking
5068 local_variables_forbidden_p, use THIS_FORBIDDEN or
5069 LOCAL_VARS_FORBIDDEN.
5070 (cp_parser_lambda_body): Update the type of
5071 local_variables_forbidden_p. Set it to 0 rather than false.
5072 (cp_parser_condition): Adjust call to cp_parser_declarator.
5073 (cp_parser_explicit_instantiation): Likewise.
5074 (cp_parser_init_declarator): Likewise.
5075 (cp_parser_declarator): New parameter. Use it.
5076 (cp_parser_direct_declarator): New parameter. Use it to set
5077 local_variables_forbidden_p. Adjust call to cp_parser_declarator.
5078 (cp_parser_type_id_1): Adjust call to cp_parser_declarator.
5079 (cp_parser_parameter_declaration): Likewise.
5080 (cp_parser_default_argument): Update the type of
5081 local_variables_forbidden_p. Set it to LOCAL_VARS_AND_THIS_FORBIDDEN
5082 rather than true.
5083 (cp_parser_member_declaration): Tell cp_parser_declarator if we saw
5084 'static' or 'friend'.
5085 (cp_parser_exception_declaration): Adjust call to cp_parser_declarator.
5086 (cp_parser_late_parsing_default_args): Update the type of
5087 local_variables_forbidden_p. Set it to LOCAL_VARS_AND_THIS_FORBIDDEN
5088 rather than true.
5089 (cp_parser_cache_defarg): Adjust call to cp_parser_declarator.
5090 (cp_parser_objc_class_ivars): Likewise.
5091 (cp_parser_objc_struct_declaration): Likewise.
5092 (cp_parser_omp_for_loop_init): Likewise.
5093 * parser.h (cp_parser): Change the type of local_variables_forbidden_p
5094 to unsigned char.
5095 (LOCAL_VARS_FORBIDDEN, LOCAL_VARS_AND_THIS_FORBIDDEN, THIS_FORBIDDEN):
5096 Define.
5097
5098 2019-01-08 Paolo Carlini <paolo.carlini@oracle.com>
5099
5100 * decl.c (start_decl): Improve permerror location.
5101
5102 2019-01-08 Jonathan Wakely <jwakely@redhat.com>
5103 Jakub Jelinek <jakub@redhat.com>
5104
5105 PR c++/88554
5106 * decl.c (finish_function): For -Wreturn-type don't add a return *this;
5107 fixit hint if current_class_ref is NULL. Use a single if instead of
5108 two nested ones.
5109
5110 2019-01-07 Paolo Carlini <paolo.carlini@oracle.com>
5111
5112 * decl.c (start_decl): Improve two error_at locations.
5113 (expand_static_init): Likewise.
5114
5115 2019-01-07 Marek Polacek <polacek@redhat.com>
5116
5117 PR c++/88741 - wrong error with initializer-string.
5118 * decl.c (cp_complete_array_type): Strip any location wrappers.
5119
5120 2019-01-07 Bernd Edlinger <bernd.edlinger@hotmail.de>
5121
5122 PR c++/88261
5123 PR c++/69338
5124 PR c++/69696
5125 PR c++/69697
5126 * cp-tree.h (LOOKUP_ALLOW_FLEXARRAY_INIT): New flag value.
5127 * typeck2.c (digest_init_r): Raise an error for non-static
5128 initialization of a flexible array member.
5129 (process_init_constructor, massage_init_elt,
5130 process_init_constructor_array, process_init_constructor_record,
5131 process_init_constructor_union, process_init_constructor): Add the
5132 flags parameter and pass it thru.
5133 (store_init_value): Pass LOOKUP_ALLOW_FLEXARRAY_INIT parameter to
5134 digest_init_flags for static decls.
5135
5136 2019-01-07 Jakub Jelinek <jakub@redhat.com>
5137
5138 PR c++/85052
5139 * cp-tree.h (cp_build_vec_convert): Declare.
5140 * parser.c (cp_parser_postfix_expression): Parse
5141 __builtin_convertvector.
5142 * constexpr.c: Include fold-const-call.h.
5143 (cxx_eval_internal_function): Handle IFN_VEC_CONVERT.
5144 (potential_constant_expression_1): Likewise.
5145 * semantics.c (cp_build_vec_convert): New function.
5146 * pt.c (tsubst_copy_and_build): Handle CALL_EXPR to
5147 IFN_VEC_CONVERT.
5148
5149 2019-01-03 Jakub Jelinek <jakub@redhat.com>
5150
5151 PR c++/88636
5152 * decl.c (builtin_function_1): Return result of pushdecl_top_level
5153 or pushdecl rather than decl.
5154
5155 2019-01-03 Paolo Carlini <paolo.carlini@oracle.com>
5156
5157 * tree.c (handle_nodiscard_attribute): Improve warning location.
5158
5159 2019-01-02 Marek Polacek <polacek@redhat.com>
5160
5161 PR c++/88612 - ICE with -Waddress-of-packed-member.
5162 * call.c (convert_for_arg_passing): Only give warnings with tf_warning.
5163 * typeck.c (convert_for_assignment): Likewise.
5164
5165 PR c++/88631 - CTAD failing for value-initialization.
5166 * typeck2.c (build_functional_cast): Try deducing the template
5167 arguments even if there are no arguments to deduce from.
5168
5169 2019-01-01 Jakub Jelinek <jakub@redhat.com>
5170
5171 Update copyright years.
5172 \f
5173 Copyright (C) 2019 Free Software Foundation, Inc.
5174
5175 Copying and distribution of this file, with or without modification,
5176 are permitted in any medium without royalty provided the copyright
5177 notice and this notice are preserved.