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