5b561e6bdbb74dbb55ea2f3e6732954002b61a0f
[gcc.git] / gcc / cp / ChangeLog
1 2019-09-23 Paolo Carlini <paolo.carlini@oracle.com>
2
3 * pt.c (check_explicit_specialization): Use cp_expr_loc_or_input_loc.
4 (process_partial_specialization): Likewise.
5 (convert_nontype_argument_function): Likewise.
6 (invalid_tparm_referent_p): Likewise.
7 (convert_template_argument): Likewise.
8 (check_valid_ptrmem_cst_expr): Tidy.
9
10 2019-09-23 Jason Merrill <jason@redhat.com>
11
12 PR c++/91809 - bit-field and ellipsis.
13 * call.c (convert_arg_to_ellipsis): Don't call decay_conversion for
14 arithmetic arguments.
15
16 2019-09-23 Marek Polacek <polacek@redhat.com>
17
18 PR c++/91844 - Implement CWG 2352, Similar types and reference binding.
19 * call.c (reference_related_p): Use similar_type_p instead of
20 same_type_p.
21 (reference_compatible_p): Update implementation to match CWG 2352.
22 * cp-tree.h (similar_type_p): Declare.
23 * typeck.c (similar_type_p): New.
24
25 2019-09-22 Marek Polacek <polacek@redhat.com>
26
27 PR c++/91819 - ICE with operator++ and enum.
28 * call.c (build_new_op_1): Set arg2_type.
29
30 2019-09-17 Jason Merrill <jason@redhat.com>
31
32 * parser.c (cp_parser_statement): Handle [[likely]] on
33 compound-statement.
34
35 2019-09-19 Jason Merrill <jason@redhat.com>
36
37 Revert:
38 * call.c (build_new_op_1): Don't apply any standard conversions to
39 the operands of a built-in operator. Don't suppress conversions in
40 cp_build_unary_op.
41 * typeck.c (cp_build_unary_op): Do integral promotions for enums.
42
43 2019-09-16 Paolo Carlini <paolo.carlini@oracle.com>
44
45 * decl.c (grokdeclarator): Use declspecs->locations and
46 declarator->id_loc in a few error messages.
47 * pt.c (finish_member_template_decl): Use DECL_SOURCE_LOCATION.
48 (push_template_decl_real): Likewise.
49
50 2019-09-15 Jason Merrill <jason@redhat.com>
51
52 PR c++/30277 - int-width bit-field promotion.
53 PR c++/33819 - long bit-field promotion.
54 * typeck.c (cp_perform_integral_promotions): Handle large bit-fields
55 properly. Handle 32-bit non-int bit-fields properly.
56 (is_bitfield_expr_with_lowered_type): Don't look through NOP_EXPR.
57
58 PR c++/82165 - enum bitfields and operator overloading.
59 * call.c (build_new_op_1): Use unlowered_expr_type.
60
61 * call.c (build_new_op_1): Don't apply any standard conversions to
62 the operands of a built-in operator. Don't suppress conversions in
63 cp_build_unary_op.
64 * typeck.c (cp_build_unary_op): Do integral promotions for enums.
65
66 2019-09-15 Marek Polacek <polacek@redhat.com>
67
68 PR c++/91740 - ICE with constexpr call and ?: in ARRAY_REF.
69 * pt.c (build_non_dependent_expr): Call build_non_dependent_expr for
70 the first operand.
71
72 2019-09-15 Nathan Sidwell <nathan@acm.org>
73
74 * cp-tree.h (DECL_CLONED_FUNCTION_P): Reimplement using
75 IDENTIFIER_CDTOR_P, correct documentation.
76 (DECL_CLONED_FUNCTION): Directly access field.
77 (decl_cloned_function_p): Delete.
78 * class.c (decl_cloned_function_p): Delete.
79 * pt.c (instantiate_template_1): Check DECL_CHAIN is a decl.
80
81 2019-09-11 Nathan Sidwell <nathan@acm.org>
82
83 * c-objcp-common.c (cp-objcp-common.c): Alphababetize and
84 correctly mark all C++ nodes.
85 * decl.c (cp_tree_node_structure): Alphabetize.
86
87 2019-09-10 Marek Polacek <polacek@redhat.com>
88
89 PR c++/91673 - ICE with noexcept in alias-declaration.
90 * parser.c (CP_PARSER_FLAGS_DELAY_NOEXCEPT): New parser flag.
91 (cp_parser_lambda_declarator_opt): Pass CP_PARSER_FLAGS_NONE to
92 cp_parser_exception_specification_opt.
93 (cp_parser_direct_declarator): Adjust a call to
94 cp_parser_exception_specification_opt.
95 (cp_parser_member_declaration): Pass CP_PARSER_FLAGS_DELAY_NOEXCEPT
96 to cp_parser_declarator if not processing a friend or typedef
97 declaration.
98 (cp_parser_late_noexcept_specifier): Adjust a call to
99 cp_parser_noexcept_specification_opt.
100 (cp_parser_noexcept_specification_opt): New parameter for parser flags,
101 drop the FRIEND_P parameter. Use the new parameter.
102 (cp_parser_exception_specification_opt): Likewise.
103 (cp_parser_transaction): Adjust a call to
104 cp_parser_noexcept_specification_opt.
105 (cp_parser_transaction_expression): Likewise.
106
107 2019-09-10 Marek Polacek <polacek@redhat.com>
108
109 PR c++/91705 - constexpr evaluation rejects ++/-- on floats.
110 * constexpr.c (cxx_eval_increment_expression): Call fold_simple on
111 the offset.
112
113 2019-09-10 Paolo Carlini <paolo.carlini@oracle.com>
114
115 * decl.c (has_designator_problem): Use cp_expr_loc_or_input_loc
116 in error_at.
117 (build_enumerator): Likewise.
118 (cp_finish_decl): Use DECL_SOURCE_LOCATION.
119 (grokdeclarator): Use id_loc in two error_at; change errror
120 message about constinit together constexpr to use two ranges.
121
122 2019-09-09 Marek Polacek <polacek@redhat.com>
123
124 PR c++/84374 - diagnose invalid uses of decltype(auto).
125 * decl.c (grokdeclarator): Diagnose wrong usage of decltype(auto) in
126 a function declaration.
127
128 2019-09-06 Nathan Sidwell <nathan@acm.org>
129
130 PR c++/91125
131 * cp-tree.h (IDENTIFIER_REPO_CHOSEN, DECL_REPO_AVAILABLE_P): Delete.
132 (struct lang_decl_base): Remove repo_available_p.
133 * decl.c (duplicate_decls): Don't copy DECL_REPO_AVAILABLE_P.
134
135 (Reserve TREE_LANG_FLAG_3 for modules.
136 * cp-tree.h (DECL_CONSTRUCTION_VTABLE_P): Delete.
137 (DECL_NON_TRIVIALLY_INITIALIZED_P): Move to TREE_LANG_FLAG_6.
138 * class.c (build_ctor_vtbl_group): Don't set
139 DECL_CONSTRUCTION_VTABLE_P.
140 * decl2.c (determine_visibility_from_class): Don't check
141 DECL_CONSTRUCTION_VTABLE_P anymore.
142
143 2019-09-06 Martin Liska <mliska@suse.cz>
144
145 PR c++/91125
146 * Make-lang.in: Remove repo.o.
147 * config-lang.in: Likewise.
148 * cp-tree.h (init_repo): Remove declarations
149 of repo-related functions.
150 (repo_emit_p): Likewise.
151 (repo_export_class_p): Likewise.
152 (finish_repo): Likewise.
153 * decl2.c (import_export_class): Always
154 set -1 value/
155 (mark_needed): Remove -frepo from comment.
156 (import_export_decl): Similarly here.
157 (c_parse_final_cleanups): Remove call of finish_repo.
158 * lex.c (cxx_init): Remove call to init_repo.
159 * optimize.c (can_alias_cdtor): Remove dead condition.
160 * pt.c (push_template_decl_real): Update comment.
161 (instantiate_decl): Remove dead code used for -frepo.
162 * repo.c: Remove.
163
164 2019-09-05 Marek Polacek <polacek@redhat.com>
165
166 PR c++/91644 - ICE with constinit in function template.
167 * decl.c (start_decl): Call retrofit_lang_decl for constinit variables.
168 * pt.c (tsubst_expr): Pass LOOKUP_CONSTINIT down to cp_finish_decl for
169 constinit variables.
170
171 2019-09-05 Nathan Sidwell <nathan@acm.org>
172
173 * cp-tree.h (DECL_VTABLE_OR_VTT_P): Forward to DECL_VIRTUAL_P.
174
175 2019-09-04 Marek Polacek <polacek@redhat.com>
176
177 * call.c (build_over_call): Remove -fdeduce-init-list implementation.
178 * pt.c (unify): Likewise.
179
180 2019-09-01 Marek Polacek <polacek@redhat.com>
181
182 PR c++/91129 - wrong error with binary op in template argument.
183 * typeck.c (warn_for_null_address): Use fold_for_warn instead of
184 fold_non_dependent_expr.
185 (cp_build_binary_op): Likewise.
186
187 2019-08-30 Jason Merrill <jason@redhat.com>
188
189 Add source location to TRAIT_EXPR.
190 * cp-tree.h (TRAIT_EXPR_LOCATION): New.
191 (struct tree_trait_expr): Add locus field.
192 * parser.c (cp_parser_trait_expr): Pass trait_loc down.
193 * pt.c (tsubst_copy_and_build) [TRAIT_EXPR]: Likewise.
194 * semantics.c (finish_trait_expr): Add location parm.
195 * tree.c (cp_expr_location): Handle TRAIT_EXPR.
196
197 2019-08-29 Paolo Carlini <paolo.carlini@oracle.com>
198
199 * decl.c (check_var_type): Add location_t parameter and use it.
200 (grokdeclarator): Adjust call.
201 * pt.c (tsubst_decl): Likewise.
202 * cp-tree.h: Adjust declaration.
203
204 2019-08-28 Marek Polacek <polacek@redhat.com>
205
206 Implement P1152R4: Deprecating some uses of volatile.
207 PR c++/91361
208 * cp-gimplify.c (cp_fold): Set TREE_THIS_VOLATILE.
209 * decl.c (grokdeclarator): Warn about a volatile-qualified structured
210 binding and return type.
211 (grokparms): Warn about a volatile-qualified function parameter.
212 * expr.c (mark_use) <case MODIFY_EXPR>: Emit a -Wvolatile warning.
213 * typeck.c (cp_build_unary_op): Emit a -Wvolatile warning for pre and
214 post ++/-- on a volatile operand.
215 (genericize_compound_lvalue): Use a better location. Don't lose
216 TREE_THIS_VOLATILE.
217 (cp_build_modify_expr): Emit a -Wvolatile warning for a compound
218 assignment whose LHS is volatile-qualified. Build the assignment with
219 a more precise location.
220
221 2019-08-28 Marek Polacek <polacek@redhat.com>
222
223 PR c++/91360 - Implement C++20 P1143R2: constinit.
224 * cp-tree.h (TINFO_VAR_DECLARED_CONSTINIT): Define.
225 (LOOKUP_CONSTINIT): Define.
226 (enum cp_decl_spec): Add ds_constinit.
227 * decl.c (check_tag_decl): Give an error for constinit in type
228 declarations.
229 (check_initializer): Also check LOOKUP_CONSTINIT.
230 (cp_finish_decl): Add checking for a constinit declaration. Set
231 TINFO_VAR_DECLARED_CONSTINIT.
232 (grokdeclarator): Add checking for a declaration with the constinit
233 specifier.
234 * lex.c (init_reswords): Handle D_CXX20.
235 * parser.c (cp_lexer_get_preprocessor_token): Pass a better location
236 to warning_at. Warn about C++20 keywords.
237 (cp_keyword_starts_decl_specifier_p): Handle RID_CONSTINIT.
238 (cp_parser_diagnose_invalid_type_name): Add an inform about constinit.
239 (cp_parser_decomposition_declaration): Maybe pass LOOKUP_CONSTINIT to
240 cp_finish_decl.
241 (cp_parser_decl_specifier_seq): Handle RID_CONSTINIT.
242 (cp_parser_init_declarator): Maybe pass LOOKUP_CONSTINIT to
243 cp_finish_decl.
244 (set_and_check_decl_spec_loc): Add "constinit".
245 * pt.c (tsubst_decl): Set TINFO_VAR_DECLARED_CONSTINIT.
246 (instantiate_decl): Maybe pass LOOKUP_CONSTINIT to cp_finish_decl.
247 * typeck2.c (store_init_value): If a constinit variable wasn't
248 initialized using a constant initializer, give an error.
249
250 2019-08-28 Nathan Sidwell <nathan@acm.org>
251
252 PR c++/90613
253 * name-lookup.c (cp_emit_debug_info): Check for builtins during
254 overload iteration.
255
256 2019-08-27 Marek Polacek <polacek@redhat.com>
257
258 PR c++/81676 - bogus -Wunused warnings in constexpr if.
259 * semantics.c (maybe_mark_exp_read_r): New function.
260 (finish_if_stmt): Call it on THEN_CLAUSE and ELSE_CLAUSE.
261
262 PR c++/91428 - warn about std::is_constant_evaluated in if constexpr.
263 * cp-tree.h (decl_in_std_namespace_p): Declare.
264 * semantics.c (is_std_constant_evaluated_p): New.
265 (finish_if_stmt_cond): Warn about "std::is_constant_evaluated ()" in
266 an if-constexpr.
267 * typeck.c (decl_in_std_namespace_p): No longer static.
268
269 2019-08-26 Jason Merrill <jason@redhat.com>
270
271 * decl.c (duplicate_decls): Always merge DECL_DECLARED_CONSTEXPR_P.
272
273 2019-08-26 Marek Polacek <polacek@redhat.com>
274
275 PR c++/91545 - ICE in constexpr store evaluation.
276 * constexpr.c (cxx_eval_store_expression): Check FIELD_DECL instead
277 of DECL_P.
278
279 2019-08-24 Nathan Sidwell <nathan@acm.org>
280
281 * class.c (check_for_overrides): Conversion operators need
282 checking too.
283
284 2019-08-24 Paolo Carlini <paolo.carlini@oracle.com>
285
286 * semantics.c (finish_switch_cond): Improve error message location.
287
288 2019-08-23 Jason Merrill <jason@redhat.com>
289
290 * decl2.c (decl_dependent_p): New.
291 (mark_used): Check it instead of just processing_template_decl.
292
293 2019-08-23 Jason Merrill <jason@redhat.com>
294
295 * parser.c (cp_parser_nested_name_specifier_opt): Avoid redundant
296 error.
297
298 2019-08-23 Marek Polacek <polacek@redhat.com>
299
300 PR c++/91521 - wrong error with operator->.
301 * decl.c (grokdeclarator): Return error_mark_node for an invalid
302 trailing return type.
303
304 PR c++/79817 - attribute deprecated on namespace.
305 * cp-tree.h (cp_warn_deprecated_use_scopes): Declare.
306 * decl.c (grokdeclarator): Call cp_warn_deprecated_use_scopes.
307 (type_is_deprecated): Likewise.
308 * decl2.c (cp_warn_deprecated_use_scopes): New function.
309 * name-lookup.c (handle_namespace_attrs): Handle attribute deprecated.
310 * parser.c (cp_parser_namespace_alias_definition): Call
311 cp_warn_deprecated_use_scopes.
312 (cp_parser_using_declaration): Likewise.
313 (cp_parser_using_directive): Likewise.
314 * semantics.c (finish_id_expression_1): Likewise.
315
316 2019-08-23 Nathan Sidwell <nathan@acm.org>
317
318 * class.c (check_for_override): Checking IDENTIFIER_VIRTUAL_P is
319 sufficient, reorder DECL_OVERRIDE_P check.
320
321 2019-08-23 Iain Sandoe <iain@sandoe.co.uk>
322
323 PR pch/61250
324 * parser.c (cp_parser_initial_pragma): Call c_common_no_more_pch ()
325 after determining that the first token is not
326 PRAGMA_GCC_PCH_PREPROCESS.
327
328 2019-08-22 Marek Polacek <polacek@redhat.com>
329
330 PR c++/91304 - prefix attributes ignored in condition.
331 * parser.c (cp_parser_condition): Handle prefix attributes.
332
333 2019-08-21 Richard Sandiford <richard.sandiford@arm.com>
334
335 PR c++/91505
336 * decl.c (duplicate_decls): Call copy_attributes_to_builtin inside
337 the BUILT_IN_NORMAL block rather than afterward.
338
339 2019-08-19 Marek Polacek <polacek@redhat.com>
340
341 PR c++/91264 - detect modifying const objects in constexpr.
342 * constexpr.c (modifying_const_object_error): New function.
343 (cxx_eval_call_expression): Set TREE_READONLY on a CONSTRUCTOR of
344 a const-qualified object after it's been fully constructed.
345 (modifying_const_object_p): New function.
346 (cxx_eval_store_expression): Detect modifying a const object
347 during constant expression evaluation.
348 (cxx_eval_increment_expression): Use a better location when building
349 up the store.
350 (cxx_eval_constant_expression) <case DECL_EXPR>: Mark a constant
351 object's constructor TREE_READONLY.
352
353 2019-08-15 Jason Merrill <jason@redhat.com>
354
355 PR c++/90393 - ICE with thow in ?:
356
357 PR c++/64372, DR 1560 - Gratuitous lvalue-to-rvalue conversion in ?:
358 * tree.c (lvalue_kind): Handle throw in one arm.
359 * typeck.c (rationalize_conditional_expr): Likewise.
360 (cp_build_modify_expr): Likewise.
361
362 2019-08-14 Jason Merrill <jason@redhat.com>
363
364 Implement P0848R3, Conditionally Trivial Special Member Functions.
365 * tree.c (special_memfn_p): New.
366 * class.c (add_method): When overloading, hide ineligible special
367 member fns.
368 (check_methods): Set TYPE_HAS_COMPLEX_* here.
369 * decl.c (grok_special_member_properties): Not here.
370 * name-lookup.c (push_class_level_binding_1): Move overloaded
371 functions case down, accept FUNCTION_DECL as target_decl.
372
373 2019-08-14 Jonathan Wakely <jwakely@redhat.com>
374
375 PR c++/91436
376 * name-lookup.c (get_std_name_hint): Fix min_dialect field for
377 complex_literals and make_unique entries.
378
379 2019-08-14 Jakub Jelinek <jakub@redhat.com>
380 Marek Polacek <polacek@redhat.com>
381
382 PR c++/91391 - bogus -Wcomma-subscript warning.
383 * parser.c (cp_parser_postfix_open_square_expression): Don't warn about
384 a deprecated comma here. Pass warn_comma_subscript down to
385 cp_parser_expression.
386 (cp_parser_expression): New bool parameter. Warn about uses of a comma
387 operator within a subscripting expression.
388 (cp_parser_skip_to_closing_square_bracket): Revert to pre-r274121 state.
389 (cp_parser_skip_to_closing_square_bracket_1): Remove.
390
391 2019-08-14 Jonathan Wakely <jwakely@redhat.com>
392
393 * name-lookup.c (get_std_name_hint): Add more entries.
394
395 2019-08-14 Paolo Carlini <paolo.carlini@oracle.com>
396
397 * decl2.c (grok_array_decl): Use the location of the open square
398 bracket in error message about invalid types.
399
400 2019-08-14 Paolo Carlini <paolo.carlini@oracle.com>
401
402 * decl.c (grokdeclarator): Check here for typedef a function
403 definition or a member function definition.
404 (start_function): Adjust.
405 (grokmethod): Likewise.
406
407 2019-08-13 Richard Sandiford <richard.sandiford@arm.com>
408
409 PR middle-end/91421
410 * decl.c (duplicate_decls): Use copy_decl_built_in_function.
411 * pt.c (declare_integer_pack): Use set_decl_built_in_function.
412
413 2019-08-13 Marek Polacek <polacek@redhat.com>
414
415 PR c++/90473 - wrong code with nullptr in default argument.
416 * call.c (null_ptr_cst_p): Update quote from the standard.
417 * decl.c (check_default_argument): Don't return nullptr when the arg
418 has side-effects.
419
420 2019-08-13 Marek Polacek <polacek@redhat.com>
421
422 * cp-tree.h (DECL_MUTABLE_P): Use FIELD_DECL_CHECK.
423
424 2019-08-10 Jakub Jelinek <jakub@redhat.com>
425
426 * parser.c (cp_parser_omp_clause_name): Parse device_type.
427 (cp_parser_omp_clause_device_type): New function.
428 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_DEVICE_TYPE.
429 (OMP_DECLARE_TARGET_CLAUSE_MASK): Add PRAGMA_OMP_CLAUSE_DEVICE_TYPE.
430 (cp_parser_omp_declare_target): Handle device_type clauses. Remove
431 diagnostics for declare target with clauses nested in clause-less
432 declare target declaration-definition-seq.
433 * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_DEVICE_TYPE.
434
435 2019-08-09 Jakub Jelinek <jakub@redhat.com>
436
437 * parser.c (check_no_duplicate_clause): Simplify using
438 omp_find_clause.
439 (cp_parser_omp_clause_if): Fix up printing of target {enter,exit} data
440 directive name modifiers.
441
442 PR c/91401
443 * parser.c (cp_parser_omp_clause_dist_schedule): Comment out the
444 check_no_duplicate_clause call, instead emit a warning for duplicate
445 dist_schedule clauses.
446
447 2019-08-08 Paolo Carlini <paolo.carlini@oracle.com>
448
449 * decl.c (grokdeclarator): Use id_loc and EXPR_LOCATION in
450 a few error messages.
451
452 2019-08-08 Marek Polacek <polacek@redhat.com>
453
454 PR c++/87519 - bogus warning with -Wsign-conversion.
455 * typeck.c (cp_build_binary_op): Use same_type_p instead of comparing
456 the types directly.
457
458 * constexpr.c (inline_asm_in_constexpr_error): New.
459 (cxx_eval_constant_expression) <case ASM_EXPR>: Call it.
460 (potential_constant_expression_1) <case ASM_EXPR>: Likewise.
461
462 2019-08-08 Jakub Jelinek <jakub@redhat.com>
463
464 * semantics.c (finish_omp_clauses): For C_ORT_OMP
465 OMP_CLAUSE_USE_DEVICE_* clauses use oacc_reduction_head bitmap
466 instead of generic_head to track duplicates.
467
468 2019-08-07 Marek Polacek <polacek@redhat.com>
469
470 PR c++/81429 - wrong parsing of constructor with C++11 attribute.
471 * parser.c (cp_parser_constructor_declarator_p): Handle the scenario
472 when a parameter declaration begins with [[attribute]].
473
474 2019-08-07 Marek Polacek <polacek@redhat.com>
475
476 PR c++/91346 - Implement P1668R1, allow unevaluated asm in constexpr.
477 * constexpr.c (cxx_eval_constant_expression): Handle ASM_EXPR.
478 (potential_constant_expression_1) <case ASM_EXPR>: Allow.
479 * cp-tree.h (finish_asm_stmt): Adjust.
480 * parser.c (cp_parser_asm_definition): Grab the locaion of "asm" and
481 use it. Change an error to a pedwarn. Allow asm in C++2a, warn
482 otherwise.
483 * pt.c (tsubst_expr): Pass a location down to finish_asm_stmt.
484 * semantics.c (finish_asm_stmt): New location_t parameter. Use it.
485
486 2019-08-07 Jakub Jelinek <jakub@redhat.com>
487
488 * parser.c (cp_parser_omp_clause_name): Parse use_device_addr clause.
489 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_USE_DEVICE_ADDR.
490 (OMP_TARGET_DATA_CLAUSE_MASK): Add PRAGMA_OMP_CLAUSE_USE_DEVICE_ADDR.
491 (cp_parser_omp_target_data): Handle PRAGMA_OMP_CLAUSE_USE_DEVICE_ADDR
492 like PRAGMA_OMP_CLAUSE_USE_DEVICE_PTR, adjust diagnostics about no
493 map or use_device_* clauses.
494 * semantics.c (finish_omp_clauses): For OMP_CLAUSE_USE_DEVICE_PTR
495 in OpenMP, require pointer or reference to pointer type rather than
496 pointer or array or reference to pointer or array type. Handle
497 OMP_CLAUSE_USE_DEVICE_ADDR.
498 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_USE_DEVICE_ADDR.
499
500 2019-08-06 Jason Merrill <jason@redhat.com>
501
502 PR c++/91378 - ICE with noexcept and auto return type.
503 * pt.c (maybe_instantiate_noexcept): push_to_top_level.
504
505 2019-08-06 Paolo Carlini <paolo.carlini@oracle.com>
506
507 * decl.c (check_array_designated_initializer): Use
508 cp_expr_loc_or_input_loc in one place.
509
510 2019-08-06 Jakub Jelinek <jakub@redhat.com>
511
512 * parser.c (cp_parser_omp_for_loop): For OMP_LOOP, ignore parallel
513 clauses and predetermine iterator as lastprivate.
514 * semantics.c (handle_omp_for_class_iterator): Use
515 OMP_CLAUSE_LASTPRIVATE_LOOP_IV instead of
516 OMP_CLAUSE_LASTPRIVATE_TASKLOOP_IV, set it for lastprivate also
517 on OMP_LOOP construct. If a clause is missing for class iterator
518 on OMP_LOOP, add firstprivate clause, and if there is private
519 clause, turn it into firstprivate too.
520 (finish_omp_for): Formatting fix. For OMP_LOOP, adjust
521 OMP_CLAUSE_LASTPRIVATE_LOOP_IV clause CP_CLAUSE_INFO, so that it
522 uses copy ctor instead of default ctor.
523 * cp-gimplify.c (cp_gimplify_expr): Handle OMP_LOOP like
524 OMP_DISTRIBUTE etc.
525 (cp_fold_r): Likewise.
526 (cp_genericize_r): Likewise.
527 (cxx_omp_finish_clause): Also finish lastprivate clause with
528 OMP_CLAUSE_LASTPRIVATE_LOOP_IV flag.
529 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_BIND.
530 (tsubst_omp_for_iterator): For OMP_LOOP, ignore parallel
531 clauses and predetermine iterator as lastprivate.
532 * constexpr.c (potential_constant_expression_1): Handle OMP_LOOP
533 like OMP_DISTRIBUTE etc.
534
535 2019-08-05 Marek Polacek <polacek@redhat.com>
536
537 DR 2413 - typename in conversion-function-ids.
538 * parser.c (cp_parser_conversion_type_id): Call
539 cp_parser_type_specifier_seq with CP_PARSER_FLAGS_TYPENAME_OPTIONAL
540 instead of CP_PARSER_FLAGS_NONE.
541
542 2019-08-05 Paolo Carlini <paolo.carlini@oracle.com>
543
544 * cp-tree.h (cp_expr_loc_or_input_loc): New.
545 (cxx_incomplete_type_diagnostic): Use it.
546 * call.c (build_converted_constant_expr_internal, convert_like_real,
547 convert_arg_to_ellipsis, convert_for_arg_passing, build_over_call,
548 build_cxx_call, perform_implicit_conversion_flags,
549 initialize_reference): Likewise.
550 * constexpr.c (cxx_eval_internal_function, cxx_eval_call_expression,
551 eval_and_check_array_index, cxx_eval_store_expression,
552 cxx_eval_statement_list, cxx_eval_loop_expr,
553 cxx_eval_constant_expression, potential_constant_expression_1):
554 Likewise.
555 * constraint.cc (check_for_logical_overloads,
556 satisfy_predicate_constraint): Likewise.
557 * cp-gimplify.c (cp_gimplify_expr): Likewise.
558 * cvt.c (cp_convert_to_pointer, convert_to_reference,
559 cp_convert_and_check, ocp_convert, maybe_warn_nodiscard): Likewise.
560 * decl.c (pop_switch): Likewise.
561 * decl2.c (delete_sanity): Likewise.
562 * error.c (location_of): Likewise.
563 * init.c (maybe_warn_list_ctor, build_aggr_init,
564 warn_placement_new_too_small, build_new_1, build_vec_init): Likewise.
565 * lex.c (unqualified_name_lookup_error): Likewise.
566 * parser.c (cp_parser_initializer_list, cp_parser_omp_for_cond):
567 Likewise.
568 * pt.c (check_for_bare_parameter_packs, check_valid_ptrmem_cst_expr,
569 unify_arg_conversion, convert_nontype_argument,
570 tsubst_copy_and_build, resolve_typename_type): Likewise.
571 * semantics.c (maybe_convert_cond, finish_call_expr,
572 cp_build_vec_convert): Likewise.
573 * typeck.c (decay_conversion, rationalize_conditional_expr,
574 cp_build_unary_op, build_x_compound_expr_from_list,
575 maybe_warn_about_returning_address_of_local,
576 maybe_warn_pessimizing_move): Likewise.
577 * typeck2.c (check_narrowing, digest_init_r,
578 process_init_constructor_array): Likewise.
579
580 2019-08-05 Tom Honermann <tom@honermann.net>
581
582 * parser.c (cp_parser_template_declaration_after_parameters): Enable
583 class template argument deduction for non-type template parameters
584 in literal operator templates.
585
586 2019-08-05 Marek Polacek <polacek@redhat.com>
587
588 PR c++/91338 - Implement P1161R3: Deprecate a[b,c].
589 * parser.c (cp_parser_postfix_open_square_expression): Warn about uses
590 of a comma operator within a subscripting expression.
591 (cp_parser_skip_to_closing_square_bracket_1): New function, made out
592 of...
593 (cp_parser_skip_to_closing_square_bracket): ...this.
594
595 2019-08-05 Jason Merrill <jason@redhat.com>
596
597 * semantics.c (force_paren_expr): Preserve location.
598
599 2019-08-02 Marek Polacek <polacek@redhat.com>
600
601 PR c++/91230 - wrong error with __PRETTY_FUNCTION__ and generic lambda.
602 * pt.c (value_dependent_expression_p): Consider __PRETTY_FUNCTION__
603 inside a template function value-dependent.
604
605 2019-08-02 Paolo Carlini <paolo.carlini@oracle.com>
606
607 * tree.c (handle_nodiscard_attribute): Do not warn about nodiscard
608 applied to a constructor.
609
610 2019-08-02 Martin Liska <mliska@suse.cz>
611
612 * decl.c (grok_op_properties):
613 Mark DECL_SET_IS_OPERATOR_DELETE for user-provided delete operators.
614
615 2019-08-01 Martin Sebor <msebor@redhat.com>
616
617 PR c++/90947
618 * decl.c (reshape_init_array_1): Avoid truncating initializer
619 lists containing string literals.
620
621 2019-08-01 Marek Polacek <polacek@redhat.com>
622
623 PR c++/90805 - detect narrowing in case values.
624 * decl.c (case_conversion): Detect narrowing in case values.
625
626 2019-07-31 Paolo Carlini <paolo.carlini@oracle.com>
627
628 * decl2.c (delete_sanity): Improve diagnostic locations, use
629 cp_expr_loc_or_loc in four places.
630
631 2019-07-31 Jason Merrill <jason@redhat.com>
632
633 PR c++/90538 - multiple expansions of capture packs
634 * cp-tree.h (DECLTYPE_FOR_INIT_CAPTURE): Remove.
635 * lambda.c (add_capture): Copy parameter packs from init.
636 (lambda_capture_field_type): Always use auto for init-capture.
637 * pt.c (uses_parameter_packs): Return tree.
638 (tsubst) [DECLTYPE_TYPE]: Remove init-capture handling.
639 (gen_elem_of_pack_expansion_instantiation): Don't push
640 local_specialization_stack.
641 (prepend_one_capture): New.
642 (tsubst_lambda_expr): Use it. Don't touch local_specializations.
643 (do_auto_deduction): Avoid redundant error.
644
645 Fix copy_node of TEMPLATE_INFO.
646 * cp-tree.h (struct tree_template_info): Use tree_base instead of
647 tree_common. Add tmpl and args fields.
648 (TI_TEMPLATE, TI_ARGS): Adjust.
649
650 2019-07-30 Martin Liska <mliska@suse.cz>
651
652 PR tree-optimization/91270
653 * tree-ssa-dce.c (propagate_necessity): Mark 2nd argument
654 of delete operator as needed.
655
656 2019-07-25 Martin Liska <mliska@suse.cz>
657 Dominik Infuhr <dominik.infuehr@theobroma-systems.com>
658
659 PR c++/23383
660 * decl.c (cxx_init_decl_processing): Mark delete operators
661 with DECL_SET_IS_OPERATOR_DELETE.
662
663 2019-07-25 Martin Liska <mliska@suse.cz>
664
665 * decl.c (duplicate_decls): Use new macros
666 (e.g. DECL_SET_LAMBDA_FUNCTION and DECL_LAMBDA_FUNCTION_P).
667 (cxx_init_decl_processing): Likewise.
668 (grok_op_properties): Likewise.
669 * parser.c (cp_parser_lambda_declarator_opt): Likewise.
670
671 2019-07-24 Martin Sebor <msebor@redhat.com>
672
673 PR driver/80545
674 * decl.c (finish_function): Use lang_mask.
675
676 2019-07-20 Jason Merrill <jason@redhat.com>
677
678 * cp-tree.h (ovl_iterator::using_p): A USING_DECL by itself was also
679 introduced by a using-declaration.
680
681 2019-07-20 Jason Merrill <jason@redhat.com>
682
683 Reduce memory consumption for push/pop_access_scope.
684 * name-lookup.c (leave_scope): Do add class levels other than
685 previous_class_level to free_binding_level.
686 (invalidate_class_lookup_cache): Move from class.c, add to
687 free_binding_level.
688 * pt.c (saved_access_scope): Change from list to vec.
689
690 2019-07-20 Jakub Jelinek <jakub@redhat.com>
691
692 * cp-tree.h (OMP_FOR_GIMPLIFYING_P): Use OMP_LOOPING_CHECK
693 instead of OMP_LOOP_CHECK.
694 * parser.c (cp_parser_omp_clause_name): Handle bind clause.
695 (cp_parser_omp_clause_bind): New function.
696 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_BIND.
697 (OMP_LOOP_CLAUSE_MASK): Define.
698 (cp_parser_omp_loop): New function.
699 (cp_parser_omp_parallel, cp_parser_omp_teams): Handle parsing of
700 loop combined with parallel or teams.
701 (cp_parser_omp_construct): Handle PRAGMA_OMP_LOOP.
702 (cp_parser_pragma): Likewise.
703 * pt.c (tsubst_expr): Handle OMP_LOOP.
704 * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_BIND.
705
706 2019-07-19 Jason Merrill <jason@redhat.com>
707
708 PR c++/90101 - dependent class non-type parameter.
709 * pt.c (invalid_nontype_parm_type_p): Check for dependent class type.
710
711 2019-07-18 Jason Merrill <jason@redhat.com>
712
713 PR c++/90098 - partial specialization and class non-type parms.
714 PR c++/90099
715 PR c++/90101
716 * call.c (build_converted_constant_expr_internal): Don't copy.
717 * pt.c (process_partial_specialization): Allow VIEW_CONVERT_EXPR
718 around class non-type parameter.
719 (unify) [TEMPLATE_PARM_INDEX]: Ignore cv-quals.
720
721 2019-07-16 Jason Merrill <jason@redhat.com>
722
723 * parser.c (make_location): Add overload taking cp_lexer* as last
724 parameter.
725
726 * parser.c (cp_parser_simple_type_specifier): Separate tentative
727 parses for optional type-spec and CTAD.
728
729 * parser.c (cp_parser_nested_name_specifier_opt): If the token is
730 already CPP_NESTED_NAME_SPECIFIER, leave it alone.
731
732 2019-07-12 Jakub Jelinek <jakub@redhat.com>
733
734 * parser.c (cp_parser_omp_clause_name): Handle order clause.
735 (cp_parser_omp_clause_order): New function.
736 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_ORDER.
737 (OMP_SIMD_CLAUSE_MASK, OMP_FOR_CLAUSE_MASK): Add
738 PRAGMA_OMP_CLAUSE_ORDER.
739 * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_ORDER.
740 * pt.c (tsubst_omp_clauses): Likewise.
741
742 2019-07-10 Paolo Carlini <paolo.carlini@oracle.com>
743
744 * decl.c (get_type_quals,
745 smallest_type_location (const cp_decl_specifier_seq*)): New.
746 (check_tag_decl): Use smallest_type_location in error_at about
747 multiple types in one declaration.
748 (grokdeclarator): Use locations[ds_complex] in error_at about
749 complex invalid; use locations[ds_storage_class] in error_at
750 about static cdtor; use id_loc in error_at about flexible
751 array member in union; use get_type_quals.
752
753 2019-07-09 Martin Sebor <msebor@redhat.com>
754
755 PR c++/61339
756 * cp-tree.h: Change class-key of PODs to struct and others to class.
757 * search.c: Same.
758 * semantics.c (finalize_nrv_r): Same.
759
760 2019-07-09 Martin Sebor <msebor@redhat.com>
761
762 PR c++/61339
763 * constexpr.c (cxx_eval_call_expression): Change class-key from class
764 to struct and vice versa to match convention and avoid -Wclass-is-pod
765 and -Wstruct-no-pod.
766 * constraint.cc (get_concept_definition): Same.
767 * cp-tree.h: Same.
768 * cxx-pretty-print.h: Same.
769 * error.c: Same.
770 * logic.cc (term_list::replace): Same.
771 * name-lookup.c (find_local_binding): Same.
772 * pt.c (tsubst_binary_right_fold): Same.
773 * search.c (field_accessor_p): Same.
774 * semantics.c (expand_or_defer_fn): Same.
775
776 2019-07-08 Jakub Jelinek <jakub@redhat.com>
777
778 PR c++/91110
779 * decl2.c (cp_omp_mappable_type_1): Don't emit any note for
780 error_mark_node type.
781
782 2019-07-05 Jakub Jelinek <jakub@redhat.com>
783
784 PR c++/67184
785 PR c++/69445
786 * call.c (build_new_method_call_1): Remove set but not used variable
787 binfo.
788
789 2019-07-05 Paolo Carlini <paolo.carlini@oracle.com>
790
791 PR c++/67184 (again)
792 PR c++/69445
793 * call.c (build_over_call): Devirtualize user-defined operators
794 coming from a base too.
795 (build_new_method_call_1): Do not devirtualize here.
796
797 2019-07-04 Marek Polacek <polacek@redhat.com>
798
799 DR 1813
800 PR c++/83374 - __is_standard_layout wrong for a class with repeated
801 bases.
802 * class.c (check_bases): Set CLASSTYPE_NON_STD_LAYOUT for a class if
803 CLASSTYPE_REPEATED_BASE_P is true.
804
805 2019-07-04 Andrew Stubbs <ams@codesourcery.com>
806
807 * cp-tree.h (cp_omp_emit_unmappable_type_notes): New prototype.
808 * decl.c (cp_finish_decl): Call cp_omp_emit_unmappable_type_notes.
809 * decl2.c (cp_omp_mappable_type): Move contents to ...
810 (cp_omp_mappable_type_1): ... here and add note output.
811 (cp_omp_emit_unmappable_type_notes): New function.
812 * semantics.c (finish_omp_clauses): Call
813 cp_omp_emit_unmappable_type_notes in four places.
814
815 2019-07-03 Martin Liska <mliska@suse.cz>
816
817 * call.c (build_new_op_1): Remove dead assignemts.
818 * typeck.c (cp_build_binary_op): Likewise.
819
820 2019-06-27 Jason Merrill <jason@redhat.com>
821
822 PR c++/55442 - memory-hog with highly recursive constexpr.
823 * constexpr.c (push_cx_call_context): Return depth.
824 (cxx_eval_call_expression): Don't cache past constexpr_cache_depth.
825
826 2019-06-27 Jan Hubicka <jh@suse.cz>
827
828 * class.c (layout_class_type): Set TYPE_CXX_ODR_P for as-base
829 type copy.
830
831 2019-06-27 Martin Liska <mliska@suse.cz>
832
833 * class.c (adjust_clone_args): Remove obviously
834 dead assignments.
835 (dump_class_hierarchy_r): Likewise.
836 * decl.c (check_initializer): Likewise.
837 * parser.c (cp_parser_lambda_expression): Likewise.
838 * pt.c (unify_bound_ttp_args): Likewise.
839 (convert_template_argument): Likewise.
840 * rtti.c (build_headof): Likewise.
841 * typeck.c (convert_for_initialization): Likewise.
842
843 2019-06-25 Jason Merrill <jason@redhat.com>
844
845 PR c++/70462 - unnecessary base ctor variant with final.
846 * optimize.c (populate_clone_array): Skip base variant if
847 CLASSTYPE_FINAL.
848 (maybe_clone_body): We don't need an alias if we are only defining
849 one clone.
850
851 * class.c (resolves_to_fixed_type_p): Check CLASSTYPE_FINAL.
852
853 2019-06-25 Jakub Jelinek <jakub@redhat.com>
854
855 PR c++/90969
856 * constexpr.c (cxx_eval_array_reference): Don't look through VCE from
857 vector type if lval.
858
859 2019-06-25 Jozef Lawrynowicz <jozef.l@mittosystems.com>
860
861 * lex.c (init_reswords): Create keyword for "__intN__" type.
862 * cp-tree.h (cp_decl_specifier_seq): New bitfield "int_n_alt".
863 * decl.c (grokdeclarator): Don't pedwarn about "__intN" ISO
864 C incompatibility if alternate "__intN__" form is used.
865 * parser.c (cp_parser_simple_type_specifier): Set
866 decl_specs->int_n_alt if "__intN__" form is used.
867
868 2019-06-24 Jan Hubicka <jh@suse.cz>
869
870 * lex.c (cxx_make_type): Set TYPE_CXX_ODR_P.
871
872 2019-06-24 Jason Merrill <jason@redhat.com>
873
874 * class.c (layout_class_type): Don't use a separate
875 CLASSTYPE_AS_BASE if it's the same size.
876
877 2019-06-23 Marek Polacek <polacek@redhat.com>
878
879 * call.c (convert_default_arg): Use DEFERRED_PARSE instead of
880 DEFAULT_ARG.
881 * cp-objcp-common.c (cp_tree_size): Likewise. Use tree_deferred_parse
882 instead of tree_default_arg.
883 * cp-tree.def: Rename DEFAULT_ARG to DEFERRED_PARSE.
884 * cp-tree.h: Rename DEFARG_TOKENS to DEFPARSE_TOKENS. Rename
885 DEFARG_INSTANTIATIONS to DEFPARSE_INSTANTIATIONS. Rename
886 tree_default_arg to tree_deferred_parse.
887 (UNPARSED_NOEXCEPT_SPEC_P): Use DEFERRED_PARSE instead of DEFAULT_ARG.
888 (cp_tree_node_structure_enum): Rename TS_CP_DEFAULT_ARG to
889 TS_CP_DEFERRED_PARSE.
890 (lang_tree_node): Rename tree_default_arg to tree_deferred_parse.
891 Rename default_arg to deferred_parse. Use TS_CP_DEFERRED_PARSE instead
892 of TS_CP_DEFAULT_ARG.
893 (defarg_location): Remove declaration.
894 (defparse_location): Add declaration.
895 * decl.c (grokfndecl): Use DEFERRED_PARSE instead of DEFAULT_ARG.
896 Call defparse_location instead of defarg_location.
897 (check_default_argument): Use DEFERRED_PARSE instead of DEFAULT_ARG.
898 (cp_tree_node_structure): Likewise. Use TS_CP_DEFERRED_PARSE instead
899 of TS_CP_DEFAULT_ARG.
900 * decl2.c (grokfield): Use DEFERRED_PARSE instead of DEFAULT_ARG.
901 * error.c (dump_expr): Likewise.
902 (location_of): Likewise.
903 * init.c (get_nsdmi): Likewise.
904 * parser.c (cp_parser_save_noexcept): Likewise. Use DEFPARSE_TOKENS
905 instead of DEFARG_TOKENS.
906 (cp_parser_late_noexcept_specifier): Likewise.
907 (cp_parser_late_parse_one_default_arg): Use DEFPARSE_TOKENS instead
908 of DEFARG_TOKENS.
909 (cp_parser_late_parsing_default_args): Use DEFERRED_PARSE instead of
910 DEFAULT_ARG. Use DEFPARSE_INSTANTIATIONS instead of
911 DEFARG_INSTANTIATIONS.
912 (cp_parser_cache_defarg): Use DEFERRED_PARSE instead of DEFAULT_ARG.
913 Use DEFPARSE_TOKENS instead of DEFARG_TOKENS. Use
914 DEFPARSE_INSTANTIATIONS instead of DEFARG_INSTANTIATIONS.
915 (defparse_location): Renamed from defarg_location.
916 * pt.c (tsubst_default_argument): Use DEFERRED_PARSE instead of
917 DEFAULT_ARG.
918 (tsubst_arg_types): Likewise.
919 (dependent_type_p_r): Likewise.
920 * tree.c (cp_tree_equal): Likewise.
921 (cp_walk_subtrees): Likewise.
922 * typeck.c (convert_arguments): Likewise.
923
924 2019-06-22 Marek Polacek <polacek@redhat.com>
925
926 PR c++/86476 - noexcept-specifier is a complete-class context.
927 PR c++/52869
928 * cp-tree.def (DEFAULT_ARG): Update commentary.
929 * cp-tree.h (UNPARSED_NOEXCEPT_SPEC_P): New macro.
930 (tree_default_arg): Use tree_base instead of tree_common.
931 (do_push_parm_decls, maybe_check_overriding_exception_spec): Declare.
932 * decl.c (do_push_parm_decls): New function, broken out of...
933 (store_parm_decls): ...here. Call it.
934 * except.c (nothrow_spec_p): Accept DEFAULT_ARG in the assert.
935 * parser.c (cp_parser_noexcept_specification_opt,
936 cp_parser_late_noexcept_specifier, noexcept_override_late_checks):
937 Forward-declare.
938 (unparsed_noexcepts): New macro.
939 (push_unparsed_function_queues): Update initializer.
940 (cp_parser_direct_declarator): Pass FRIEND_P to
941 cp_parser_exception_specification_opt.
942 (inject_parm_decls): New.
943 (pop_injected_parms): New.
944 (cp_parser_class_specifier_1): Implement delayed parsing of
945 noexcept-specifiers.
946 (cp_parser_save_noexcept): New.
947 (cp_parser_late_noexcept_specifier): New.
948 (noexcept_override_late_checks): New.
949 (cp_parser_noexcept_specification_opt): Add FRIEND_P parameter. Call
950 cp_parser_save_noexcept instead of the normal processing if needed.
951 (cp_parser_exception_specification_opt): Add FRIEND_P parameter and
952 pass it to cp_parser_noexcept_specification_opt.
953 (cp_parser_save_member_function_body): Fix comment.
954 (cp_parser_save_default_args): Maybe save the noexcept-specifier to
955 post process.
956 (cp_parser_transaction): Update call to
957 cp_parser_noexcept_specification_opt.
958 (cp_parser_transaction_expression): Likewise.
959 * parser.h (cp_unparsed_functions_entry): Add new field to carry
960 a noexcept-specifier.
961 * pt.c (dependent_type_p_r): Handle unparsed noexcept expression.
962 * search.c (maybe_check_overriding_exception_spec): New function, broken
963 out of...
964 (check_final_overrider): ...here. Call
965 maybe_check_overriding_exception_spec.
966 * tree.c (canonical_eh_spec): Handle UNPARSED_NOEXCEPT_SPEC_P.
967 (cp_tree_equal): Handle DEFAULT_ARG.
968
969 PR c++/90881 - bogus -Wunused-value in unevaluated context.
970 * cvt.c (convert_to_void): Don't emit unused warnings in
971 an unevaluated context.
972
973 2019-06-22 Paolo Carlini <paolo.carlini@oracle.com>
974
975 * decl.c (grokdeclarator): Use id_loc, typespec_loc, and
976 locations[ds_storage_class] in a few additional places.
977
978 2019-06-21 Paolo Carlini <paolo.carlini@oracle.com>
979
980 PR c++/90909
981 Revert:
982 2019-05-21 Paolo Carlini <paolo.carlini@oracle.com>
983
984 PR c++/67184
985 PR c++/69445
986 * call.c (build_over_call): Devirtualize when the final overrider
987 comes from the base.
988
989 2019-06-21 Marek Polacek <polacek@redhat.com>
990
991 PR c++/61490 - qualified-id in friend function definition.
992 * decl.c (grokdeclarator): Diagnose qualified-id in friend function
993 definition. Improve location for diagnostics of friend functions.
994
995 PR c++/60223 - ICE with T{} in non-deduced context.
996 * pt.c (unify): Allow COMPOUND_LITERAL_P in a non-deduced context.
997
998 PR c++/64235 - missing syntax error with invalid alignas.
999 * parser.c (cp_parser_std_attribute_spec): Commit to tentative parse
1000 if there's a missing close paren.
1001
1002 PR c++/90490 - fix decltype issues in noexcept-specifier.
1003 * except.c (build_noexcept_spec): Call
1004 instantiate_non_dependent_expr_sfinae before
1005 build_converted_constant_expr instead of calling
1006 instantiate_non_dependent_expr after it. Add
1007 processing_template_decl_sentinel.
1008
1009 2019-06-21 Jakub Jelinek <jakub@redhat.com>
1010
1011 PR c++/90950
1012 * semantics.c (finish_omp_clauses): Don't reject references to
1013 incomplete types if processing_template_decl.
1014
1015 2019-06-19 Marek Polacek <polacek@redhat.com>
1016
1017 PR c++/60364 - noreturn after first decl not diagnosed.
1018 * decl.c (duplicate_decls): Give an error when a function is
1019 declared [[noreturn]] after its first declaration.
1020 * parser.c (cp_parser_std_attribute): Don't treat C++11 noreturn
1021 attribute as equivalent to GNU's.
1022 * tree.c (std_attribute_table): Add noreturn.
1023
1024 2019-06-19 Jakub Jelinek <jakub@redhat.com>
1025
1026 * cp-gimplify.c (cp_genericize_r): Handle OMP_CLAUSE_{IN,EX}CLUSIVE
1027 like OMP_CLAUSE_SHARED.
1028
1029 2019-06-18 Jason Merrill <jason@redhat.com>
1030
1031 * constexpr.c (cxx_eval_store_expression): Delay target evaluation.
1032
1033 2019-06-18 Jason Merrill <jason@redhat.com>
1034
1035 * constexpr.c (eval_and_check_array_index): Split out from...
1036 (cxx_eval_array_reference): ...here.
1037 (cxx_eval_store_expression): Use it here, too.
1038 (diag_array_subscript): Take location. Strip location wrapper.
1039
1040 2019-06-18 Jason Merrill <jason@redhat.com>
1041
1042 * constexpr.c (cxx_eval_constant_expression): Handle conversion from
1043 and then to the same type.
1044
1045 2019-06-18 Jason Merrill <jason@redhat.com>
1046
1047 * constexpr.c (unshare_constructor): Add MEM_STAT_DECL.
1048
1049 2019-06-17 Jakub Jelinek <jakub@redhat.com>
1050
1051 * semantics.c (finish_omp_clauses): For OMP_CLAUSE_REDUCTION_INSCAN
1052 set need_copy_assignment.
1053
1054 2019-06-17 Marek Polacek <polacek@redhat.com>
1055
1056 PR c++/83820 - excessive attribute arguments not detected.
1057 * parser.c (cp_parser_std_attribute): Detect excessive arguments.
1058
1059 2019-06-17 Nathan Sidwell <nathan@acm.org>
1060
1061 PR c++/90754
1062 * name-lookup.c (lookup_type_scope_1): Calll qualify_lookup before
1063 checking context.
1064
1065 2019-06-14 Marek Polacek <polacek@redhat.com>
1066
1067 PR c++/90884 - stray note with -Wctor-dtor-privacy.
1068 * class.c (maybe_warn_about_overly_private_class): Guard the call to
1069 inform.
1070
1071 2019-06-12 Jason Merrill <jason@redhat.com>
1072
1073 PR c++/85552 - wrong instantiation of dtor for DMI.
1074 * typeck2.c (digest_nsdmi_init): Set tf_no_cleanup for direct-init.
1075
1076 2019-06-13 Paolo Carlini <paolo.carlini@oracle.com>
1077
1078 * decl.c (grokdeclarator): Use id_loc in five additional places
1079 in the last part of the function.
1080
1081 2019-06-13 Paolo Carlini <paolo.carlini@oracle.com>
1082
1083 * decl.c (grokdeclarator): Move further up the declaration of
1084 id_loc, use it immediately, update its value after the loop
1085 over declarator, use it again in the final part of function;
1086 improve locations of error messages about multiple data types
1087 and conflicting specifiers.
1088
1089 2019-06-13 Richard Biener <rguenther@suse.de>
1090
1091 PR c++/90801
1092 * typeck2.c (split_nonconstant_init_1): Properly count
1093 num_split_elts, optimize single constructor elt removal.
1094
1095 2019-06-12 Marek Polacek <polacek@redhat.com>
1096
1097 PR c++/66999 - 'this' captured by reference.
1098 * parser.c (cp_parser_lambda_introducer): Reject `&this'. Use
1099 cp_lexer_nth_token_is instead of cp_lexer_peek_nth_token.
1100
1101 PR c++/90825 - endless recursion when evaluating sizeof.
1102 PR c++/90832 - endless recursion when evaluating sizeof.
1103 * constexpr.c (cxx_eval_constant_expression): Don't recurse on the
1104 result of fold_sizeof_expr if is returns a SIZEOF_EXPR.
1105 * typeck.c (cxx_sizeof_expr): Only return a SIZEOF_EXPR if the operand
1106 is instantiation-dependent.
1107
1108 PR c++/90736 - bogus error with alignof.
1109 * constexpr.c (adjust_temp_type): Use cv_unqualified type.
1110
1111 2019-06-11 Matthew Beliveau <mbelivea@redhat.com>
1112
1113 PR c++/90449 - add -Winaccessible-base option.
1114 * class.c (warn_about_ambiguous_bases): Changed name to:
1115 maybe_warn_about_inaccessible_bases.
1116 (maybe_warn_about_inaccessible_bases): Implemented new
1117 Winaccessible-base warning option for both direct and virtual
1118 base warnings.
1119 (layout_class_type): Call to warn_about_ambiguous_bases changed to fit
1120 new name.
1121
1122 2019-06-11 Richard Biener <rguenther@suse.de>
1123
1124 PR c++/90801
1125 * typeck2.c (split_nonconstant_init_1): Avoid ordered remove
1126 from CONSTRUCTOR by marking to remove elements and doing all
1127 of them in a O(n) scan.
1128
1129 2019-06-11 Jakub Jelinek <jakub@redhat.com>
1130
1131 PR c++/90810
1132 * init.c (constant_value_1): Handle VECTOR_CST DECL_INITIAL for
1133 !DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P decls like CONSTRUCTOR.
1134
1135 2019-06-11 Martin Liska <mliska@suse.cz>
1136
1137 PR c++/87847
1138 * pt.c (init_template_processing): Disable hash table
1139 sanitization for decl_specializations and type_specializations.
1140
1141 2019-06-10 Jason Merrill <jason@redhat.com>
1142
1143 * constexpr.c (free_constructor): New.
1144 (cxx_eval_call_expression): Free parameter value CONSTRUCTORs.
1145
1146 * constexpr.c (unshare_constructor): Only unshare if T is itself a
1147 CONSTRUCTOR.
1148 (cxx_eval_call_expression): Don't call it on the result here.
1149
1150 Reduce constexpr_call memory consumption.
1151 * constexpr.c (cxx_bind_parameters_in_call): Use TREE_VEC rather
1152 than TREE_LIST.
1153 (constexpr_call_hasher::equal, cxx_bind_parameters_in_call)
1154 (cxx_eval_call_expression): Adjust.
1155
1156 2019-06-10 Jakub Jelinek <jakub@redhat.com>
1157
1158 * parser.c (cp_parser_omp_clause_reduction): Don't sorry_at on inscan
1159 reductions.
1160 (cp_parser_omp_scan_loop_body): New function.
1161 (cp_parser_omp_for_loop): Call cp_parser_omp_scan_loop_body if there
1162 are inscan reduction clauses.
1163 (cp_parser_pragma): Reject PRAGMA_OMP_SCAN.
1164 * semantics.c (finish_omp_clauses): Reject mixing inscan with
1165 non-inscan reductions on the same construct, or inscan reductions with
1166 ordered or schedule clauses, or inscan array reductions.
1167 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_{IN,EX}CLUSIVE.
1168 (tsubst_expr): Handle OMP_SCAN.
1169
1170 2019-06-07 Jason Merrill <jason@redhat.com>
1171
1172 * constexpr.c (cxx_eval_constant_expression): Call
1173 STRIP_ANY_LOCATION_WRAPPER early.
1174 [CONVERT_EXPR]: Don't build anything for conversion to void.
1175 [ADDR_EXPR]: ggc_free unused ADDR_EXPR.
1176
1177 2019-06-05 Martin Sebor <msebor@redhat.com>
1178
1179 PR c/90737
1180 * typeck.c (maybe_warn_about_returning_address_of_local): Only
1181 consider functions returning pointers as candidates for
1182 -Wreturn-local-addr.
1183
1184 2019-06-05 Paolo Carlini <paolo.carlini@oracle.com>
1185
1186 * decl.c (smallest_type_location): New.
1187 (check_special_function_return_type): Use it.
1188 (grokdeclarator): Lkewise.
1189
1190 2019-06-05 Paolo Carlini <paolo.carlini@oracle.com>
1191
1192 * decl.c (grokdeclarator): Use locations[ds_friend]
1193 in one place.
1194
1195 2019-06-05 Martin Sebor <msebor@redhat.com>
1196
1197 * call.c (build_conditional_expr_1): Adjust quoting and hyphenation.
1198 (convert_like_real): Same.
1199 (convert_arg_to_ellipsis): Same.
1200 * constexpr.c (diag_array_subscript): Same.
1201 * constraint.cc (diagnose_trait_expression): Same.
1202 * cvt.c (ocp_convert): Same.
1203 * decl.c (start_decl): Same.
1204 (check_for_uninitialized_const_var): Same.
1205 (grokfndecl): Same.
1206 (check_special_function_return_type): Same.
1207 (finish_enum_value_list): Same.
1208 (start_preparsed_function): Same.
1209 * parser.c (cp_parser_decl_specifier_seq): Same.
1210 * typeck.c (cp_build_binary_op): Same.
1211 (build_static_cast_1): Same.
1212
1213 2019-06-04 Nina Dinka Ranns <dinka.ranns@gmail.com>
1214
1215 PR c++/63149 - Wrong auto deduction from braced-init-list.
1216 * pt.c (listify_autos): use non cv qualified auto_node in
1217 std::initializer_list<auto>.
1218
1219 2019-06-04 Paolo Carlini <paolo.carlini@oracle.com>
1220
1221 * decl.c (grokdeclarator): Use declarator->id_loc in two
1222 additional places.
1223
1224 2019-06-04 Nathan Sidwell <nathan@acm.org>
1225
1226 * name-lookup.c (lookup_type_scope_1): Reimplement, handle local
1227 and namespace scopes separately.
1228
1229 2019-06-04 Harald van Dijk <harald@gigawatt.nl>
1230
1231 PR c++/60531 - Wrong error about unresolved overloaded function
1232 * typeck.c (cp_build_binary_op): See if overload can be resolved.
1233 (cp_build_unary_op): Ditto.
1234
1235 2019-06-04 Jason Merrill <jason@redhat.com>
1236
1237 Reduce accumulated garbage in constexpr evaluation.
1238 * constexpr.c (cxx_eval_call_expression): ggc_free any bindings we
1239 don't save.
1240 (cxx_eval_increment_expression): ggc_free the MODIFY_EXPR after
1241 evaluating it.
1242
1243 2019-06-04 Jakub Jelinek <jakub@redhat.com>
1244
1245 * cp-tree.h (CP_OMP_CLAUSE_INFO): Allow for any clauses up to _condvar_
1246 instead of only up to linear.
1247
1248 2019-06-03 Paolo Carlini <paolo.carlini@oracle.com>
1249
1250 * parser.c (cp_parser_unqualified_id): Use build_min_nt_loc in
1251 five places.
1252
1253 2019-06-01 Ville Voutilainen <ville.voutilainen@gmail.com>
1254
1255 PR c++/85254
1256 * class.c (fixup_type_variants): Handle CLASSTYPE_FINAL.
1257
1258 2019-05-31 Nathan Sidwell <nathan@acm.org>
1259
1260 * cp-tree.h (IDENTIFIER_LAMBDA_P): New.
1261 (TYPE_ANON_P): New.
1262 (LAMBDA_TYPE_P, TYPE_UNNAMED_P): Likewise.
1263 (LAMBDANAME_PREFIX, LAMBDANAME_FORMAT): Delete.
1264 (make_lambda_name): Don't declare.
1265 * error.c (dump_aggr_type): Check for lambdas before other
1266 anonymous names.
1267 * lambda.c (begin_lambda_type): Use make_anon_name.
1268 * cp-lang.c (cxx_dwarf_name): Lambda names smell anonymous.
1269 * mangle.c (write_local_name): Likewise.
1270 * name-lookup.c (lambda_cnt, make_lambda_name): Delete.
1271
1272 2019-05-30 Marek Polacek <polacek@redhat.com>
1273
1274 * cp-tree.h (TYPE_HAS_NONTRIVIAL_DESTRUCTOR): Fix a typo.
1275
1276 2019-05-31 Paolo Carlini <paolo.carlini@oracle.com>
1277
1278 * decl.c (grokdeclarator): Use declarator->id_loc in five
1279 error_at calls.
1280
1281 2019-05-29 Jakub Jelinek <jakub@redhat.com>
1282
1283 PR c++/90598
1284 * tree.c (lvalue_kind): Return clk_none for expressions with
1285 with VOID_TYPE_P.
1286
1287 2019-05-29 Paolo Carlini <paolo.carlini@oracle.com>
1288
1289 PR c++/89875
1290 * parser.c (cp_parser_sizeof_operand): When the type-id production
1291 did not work out commit to the tentative parse.
1292
1293 2019-05-29 Jakub Jelinek <jakub@redhat.com>
1294
1295 P1091R3 - Extending structured bindings to be more like var decls
1296 P1381R1 - Reference capture of structured bindings
1297 * decl.c (cp_maybe_mangle_decomp): Handle TREE_STATIC decls even at
1298 function scope.
1299 (cp_finish_decomp): Copy over various decl properties from decl to
1300 v[i] in the tuple case.
1301 (grokdeclarator): Allow static, thread_local and __thread for C++2a
1302 and use pedwarn instead of error for older standard revisions.
1303 Make other structured binding diagnostic messages more i18n friendly.
1304
1305 2019-05-28 Nathan Sidwell <nathan@acm.org>
1306
1307 * decl.c (duplicate_decls): Assert a template newdecl has no
1308 specializations.
1309
1310 2019-05-28 Marek Polacek <polacek@redhat.com>
1311
1312 PR c++/90548 - ICE with generic lambda and empty pack.
1313 * pt.c (tsubst_copy_and_build): Handle pack expansion properly.
1314
1315 2019-05-28 Nathan Sidwell <nathan@acm.org>
1316
1317 * cp-tree.h (make_anon_name): Drop declaration.
1318 (TYPE_UNNAMED_P): Use IDENTIFIER_ANON_P.
1319 * cp-lang.c (cxx_dwarf_name): Likewise.
1320 * class.c (find_flexarrays): Likewise.
1321 * decl.c (name_unnamed_type, xref_tag_1): Likewise.
1322 * error.c (dump_aggr_type): Likewise.
1323 * pt.c (push_template_decl_real): Likewise.
1324 * name-lookup.c (consider_binding_level): Likewise.
1325 (anon_cnt, make_anon_name): Delete.
1326
1327 2019-05-25 Marek Polacek <polacek@redhat.com>
1328
1329 PR c++/90572 - wrong disambiguation in friend declaration.
1330 * parser.c (cp_parser_constructor_declarator_p): Don't allow missing
1331 typename for friend declarations.
1332
1333 2019-05-23 Jonathan Wakely <jwakely@redhat.com>
1334
1335 * cp-tree.h (CP_AGGREGATE_TYPE_P): Fix whitespace.
1336
1337 * init.c (std_placement_new_fn_p): Remove outdated TODO comment that
1338 was resolved by r254694.
1339
1340 2019-05-22 Jason Merrill <jason@redhat.com>
1341
1342 PR c++/20408 - unnecessary code for empty struct.
1343 * call.c (build_call_a): Use simple_empty_class_p.
1344
1345 PR c++/86485 - -Wmaybe-unused with empty class ?:
1346 * cp-gimplify.c (simple_empty_class_p): Also true for MODIFY_EXPR.
1347
1348 2019-05-21 Paolo Carlini <paolo.carlini@oracle.com>
1349
1350 * parser.c (cp_parser_template_declaration_after_parameters): Use
1351 DECL_SOURCE_LOCATION in literal operator template errors.
1352
1353 2019-05-21 Paolo Carlini <paolo.carlini@oracle.com>
1354
1355 PR c++/67184
1356 PR c++/69445
1357 * call.c (build_over_call): Devirtualize when the final overrider
1358 comes from the base.
1359
1360 2019-05-21 Nathan Sidwell <nathan@acm.org>
1361
1362 * name-lookup.c (do_nonmember_using_decl): Drop INSERT_P
1363 parameter. Document.
1364 (finish_nonmember_using_decl): Adjust do_nonmember_using_decl
1365 calls. Remove stray FIXME comment.
1366
1367 * name-lookup.h (struct cp_binding_level): Drop usings field.
1368 (finish_namespace_using_decl, finish_local_using_decl): Replace with ...
1369 (finish_nonmember_using_decl): ... this.
1370 * name-lookup.c (push_using_decl_1, push_using_decl):
1371 (do_nonmember_using_decl): ... here. Add INSERT_P arg. Reimplement.
1372 (validate_nonmember_using_decl, finish_namespace_using_decl)
1373 (finish_local_using_decl): Replace with ...
1374 (finish_nonmember_using_decl): ... this. Drop DECL parm.
1375 * parser.c (cp_parser_using_declaration): Don't do lookup here.
1376 * pt.c (tsubst_expr): Do not do using decl lookup here.
1377
1378 2019-05-21 Eric Botcazou <ebotcazou@adacore.com>
1379
1380 * decl2.c (cpp_check) <IS_ASSIGNMENT_OPERATOR>: New case.
1381
1382 2019-05-20 Marek Polacek <polacek@redhat.com>
1383
1384 CWG 2094 - volatile scalars are trivially copyable.
1385 PR c++/85679
1386 * tree.c (trivially_copyable_p): Don't check CP_TYPE_VOLATILE_P for
1387 scalar types.
1388
1389 2019-05-20 Marek Polacek <polacek@redhat.com>
1390
1391 * pt.c (convert_template_argument): Add a diagnostic for the
1392 [temp.arg]/2 ambiguity case.
1393
1394 * name-lookup.c (finish_using_directive): Don't issue inform() if the
1395 warning didn't trigger. Add quoting. Tweak the inform message.
1396
1397 2019-05-20 Paolo Carlini <paolo.carlini@oracle.com>
1398
1399 * cp-tree.h: Remove remnants of CONV_NONCONVERTING.
1400
1401 2019-05-20 Nathan Sidwell <nathan@acm.org>
1402
1403 * name-lookup.c (finish_namespace_using_directive)
1404 (finish_local_using_directive): Merge to ...
1405 (finish_using_directive): ... here. Handle both contexts.
1406 * name-lookup.h (finish_namespace_using_directive)
1407 (finish_local_using_directive): Replace with ...
1408 (finish_using_directive): ... this.
1409 * parser.c (cp_parser_using_directive): Adjust.
1410 * pt.c (tsubst_expr): Likewise.
1411
1412 * cp-tree.h (struct lang_decl_ns): Remove usings field.
1413 (DECL_NAMESPACE_USING): Delete.
1414 * name-lookup.c (name_lookup::search_usings): Use namespace's
1415 binding scope.
1416 (name_lookup::queue_namespae): Likewise.
1417 (finish_namespace_using_directive, push_namespace): Likewise.
1418 (has_using_namespace_std_directive): Just search the entire
1419 binding stack.
1420
1421 2019-05-20 Jonathan Wakely <jwakely@redhat.com>
1422
1423 PR c++/90532 Ensure __is_constructible(T[]) is false
1424 * method.c (is_xible_helper): Return error_mark_node for construction
1425 of an array of unknown bound.
1426
1427 2019-05-17 Thomas Schwinge <thomas@codesourcery.com>
1428
1429 PR c++/89433
1430 * parser.c (cp_finalize_oacc_routine): Rework checking if already
1431 marked with an OpenACC 'routine' directive.
1432
1433 PR c++/89433
1434 * parser.c (cp_parser_oacc_routine)
1435 (cp_parser_late_parsing_oacc_routine): Normalize order of clauses.
1436 (cp_finalize_oacc_routine): Call oacc_verify_routine_clauses.
1437
1438 PR c++/89433
1439 * parser.c (cp_finalize_oacc_routine): Refer to OpenACC 'routine'
1440 clauses from "omp declare target" attribute.
1441
1442 2019-05-16 Martin Sebor <msebor@redhat.com>
1443
1444 * call.c (print_z_candidate): Wrap diagnostic text in a gettext
1445 macro. Adjust.
1446 (print_z_candidates): Same.
1447 (build_conditional_expr_1): Quote keywords, operators, and types
1448 in diagnostics.
1449 (build_op_delete_call): Same.
1450 (maybe_print_user_conv_context): Wrap diagnostic text in a gettext
1451 macro.
1452 (convert_like_real): Same.
1453 (convert_arg_to_ellipsis): Quote keywords, operators, and types
1454 in diagnostics.
1455 (build_over_call): Same.
1456 (joust): Break up an overlong line. Wrap diagnostic text in a gettext
1457 macro.
1458 * constexpr.c (cxx_eval_check_shift_p): Spell out >= in English.
1459 (cxx_eval_constant_expression): Quote keywords, operators, and types
1460 in diagnostics.
1461 (potential_constant_expression_1): Same.
1462 * cp-gimplify.c (cp_genericize_r): Same.
1463 * cvt.c (maybe_warn_nodiscard): Quote keywords, operators, and types
1464 in diagnostics.
1465 (type_promotes_to): Same.
1466 * decl.c (check_previous_goto_1): Same.
1467 (check_goto): Same.
1468 (start_decl): Same.
1469 (cp_finish_decl): Avoid parenthesizing a sentence for consistency.
1470 (grok_op_properties): Quote keywords, operators, and types
1471 in diagnostics.
1472 * decl2.c (grokfield): Same.
1473 (coerce_delete_type): Same.
1474 * except.c (is_admissible_throw_operand_or_catch_parameter): Same.
1475 * friend.c (do_friend): Quote C++ tokens.
1476 * init.c (build_new_1): Quote keywords, operators, and types
1477 in diagnostics.
1478 (build_vec_delete_1): Same.
1479 (build_delete): Same.
1480 * lex.c (parse_strconst_pragma): Same.
1481 (handle_pragma_implementation): Same.
1482 (unqualified_fn_lookup_error): Same.
1483 * mangle.c (write_type): Same.
1484 * method.c (defaulted_late_check): Avoid two consecutive punctuators.
1485 * name-lookup.c (cp_binding_level_debug): Remove a trailing newline.
1486 (pop_everything): Same.
1487 * parser.c (cp_lexer_start_debugging): Quote a macro name.
1488 in a diagnostic
1489 (cp_lexer_stop_debugging): Same.
1490 (cp_parser_userdef_numeric_literal): Quote a C++ header name
1491 in a diagnostic.
1492 (cp_parser_nested_name_specifier_opt): Quote keywords, operators,
1493 and types in diagnostics.
1494 (cp_parser_question_colon_clause): Same.
1495 (cp_parser_asm_definition): Same.
1496 (cp_parser_init_declarator): Same.
1497 (cp_parser_template_declaration_after_parameters): Avoid capitalizing
1498 a sentence in a diagnostic.
1499 (cp_parser_omp_declare_reduction): Quote keywords, operators, and types
1500 in diagnostics.
1501 (cp_parser_transaction): Same.
1502 * pt.c (maybe_process_partial_specialization): Replace second call
1503 to permerror with inform for consistency with other uses.
1504 (expand_integer_pack): Quote keywords, operators, and types
1505 in diagnostics.
1506 * rtti.c (get_typeid): Quote keywords, operators, and types
1507 in diagnostics.
1508 (build_dynamic_cast_1): Same.
1509 * semantics.c (finish_asm_stmt): Same.
1510 (finish_label_decl): Same.
1511 (finish_bases): Same.
1512 (finish_offsetof): Same.
1513 (cp_check_omp_declare_reduction): Same.
1514 (finish_decltype_type): Same.
1515 * tree.c (handle_init_priority_attribute): Same. Add detail
1516 to diagnostics.
1517 (maybe_warn_zero_as_null_pointer_constant): Same.
1518 * typeck.c (cp_build_binary_op): Quote keywords, operators, and types
1519 in diagnostics.
1520 (cp_build_unary_op): Same.
1521 (check_for_casting_away_constness): Same.
1522 (build_static_cast): Same.
1523 (build_const_cast_1): Same.
1524 (maybe_warn_about_returning_address_of_local): Same.
1525 (check_return_expr): Same.
1526 * typeck2.c (abstract_virtuals_error_sfinae): Same.
1527 (digest_init_r): Replace a tab with spaces in a diagnostic.
1528 (build_functional_cast): Quote keywords, operators, and types
1529 in diagnostics.
1530
1531 2019-05-15 Jakub Jelinek <jakub@redhat.com>
1532
1533 PR debug/90197
1534 * cp-gimplify.c (genericize_cp_loop): Emit a DEBUG_BEGIN_STMT
1535 before the condition (or if missing or constant non-zero at the end
1536 of the loop. Emit a DEBUG_BEGIN_STMT before the increment expression
1537 if any. Don't call protected_set_expr_location on incr if it already
1538 has a location.
1539
1540 2019-05-15 Marek Polacek <polacek@redhat.com>
1541
1542 CWG 2096 - constraints on literal unions.
1543 * class.c (check_field_decls): Initialize booleans directly. A union
1544 is literal if at least one of its non-static data members is of
1545 non-volatile literal type.
1546
1547 2019-05-15 Paolo Carlini <paolo.carlini@oracle.com>
1548
1549 * cp-tree.h (REFERENCE_VLA_OK): Remove.
1550 * lambda.c (build_capture_proxy): Remove use of the above.
1551
1552 2019-05-15 Paolo Carlini <paolo.carlini@oracle.com>
1553
1554 * call.c (perform_overload_resolution, build_new_method_call_1):
1555 Use OVL_P; remove redundant TEMPLATE_DECL checks.
1556 * decl.c (grokfndecl): Likewise.
1557 * mangle.c (write_expression): Likewise.
1558 * parser.c (cp_parser_template_id): Likewise.
1559 * pt.c (resolve_overloaded_unification, type_dependent_expression_p):
1560 Likewise.
1561 * search.c (build_baselink): Likewise.
1562 * tree.c (is_overloaded_fn, dependent_name, maybe_get_fns): Likewise.
1563
1564 2019-05-14 Paolo Carlini <paolo.carlini@oracle.com>
1565
1566 PR preprocessor/90382
1567 * decl.c (grokdeclarator): Fix value assigned to typespec_loc, use
1568 min_location.
1569
1570 2019-05-13 Jason Merrill <jason@redhat.com>
1571
1572 Use releasing_vec more broadly.
1573 * cp-tree.h (struct releasing_vec): Replace get_ref method with
1574 operator&.
1575 (vec_safe_push, vec_safe_reserve, vec_safe_length, vec_safe_splice):
1576 Forwarding functions for releasing_vec.
1577 (release_tree_vector): Declare but don't define.
1578 * call.c (build_op_delete_call, build_temp, call_copy_ctor)
1579 (perform_direct_initialization_if_possible): Use releasing_vec.
1580 * constexpr.c (cxx_eval_vec_init_1, cxx_eval_store_expression):
1581 Likewise.
1582 * cp-gimplify.c (cp_fold): Likewise.
1583 * cvt.c (force_rvalue, ocp_convert): Likewise.
1584 * decl.c (get_tuple_decomp_init): Likewise.
1585 * except.c (build_throw): Likewise.
1586 * init.c (perform_member_init, expand_default_init): Likewise.
1587 * method.c (do_build_copy_assign, locate_fn_flags): Likewise.
1588 * parser.c (cp_parser_userdef_char_literal)
1589 (cp_parser_userdef_numeric_literal)
1590 (cp_parser_userdef_string_literal)
1591 (cp_parser_perform_range_for_lookup)
1592 (cp_parser_range_for_member_function, cp_parser_omp_for_loop)
1593 (cp_parser_omp_for_loop_init): Likewise.
1594 * pt.c (tsubst_copy_and_build, do_class_deduction): Likewise.
1595 * semantics.c (calculate_direct_bases, calculate_bases)
1596 (finish_omp_barrier, finish_omp_flush, finish_omp_taskwait)
1597 (finish_omp_taskyield, finish_omp_cancel)
1598 (finish_omp_cancellation_point): Likewise.
1599 * tree.c (build_vec_init_elt, strip_typedefs, strip_typedefs_expr)
1600 (build_min_non_dep_op_overload): Likewise.
1601 * typeck.c (build_function_call_vec, cp_build_function_call_nary)
1602 (cp_build_modify_expr): Likewise.
1603 * typeck2.c (build_functional_cast): Likewise.
1604
1605 2019-05-11 Paolo Carlini <paolo.carlini@oracle.com>
1606
1607 * typeck.c (cp_build_function_call_vec): When mark_used fails
1608 unconditionally return error_mark_node.
1609
1610 2019-05-10 Paolo Carlini <paolo.carlini@oracle.com>
1611
1612 * decl.c (grokvardecl): Use an accurate location in error message
1613 about main as a global variable.
1614
1615 2019-05-10 Paolo Carlini <paolo.carlini@oracle.com>
1616
1617 * call.c (build_call_a): Use FUNC_OR_METHOD_TYPE_P.
1618 * cp-gimplify.c (cp_fold): Likewise.
1619 * cp-objcp-common.c (cp_type_dwarf_attribute): Likewise.
1620 * cp-tree.h (TYPE_OBJ_P, TYPE_PTROBV_P): Likewise.
1621 * cvt.c (perform_qualification_conversions): Likewise.
1622 * decl.c (grokdeclarator): Likewise.
1623 * decl2.c (build_memfn_type): Likewise.
1624 * mangle.c (canonicalize_for_substitution, write_type): Likewise.
1625 * parser.c (cp_parser_omp_declare_reduction): Likewise.
1626 * pt.c (check_explicit_specialization, uses_deducible_template_parms,
1627 check_cv_quals_for_unify, dependent_type_p_r): Likewise.
1628 * rtti.c (ptr_initializer): Likewise.
1629 * semantics.c (finish_asm_stmt, finish_offsetof,
1630 cp_check_omp_declare_reduction): Likewise.
1631 * tree.c (cp_build_qualified_type_real,
1632 cp_build_type_attribute_variant, cxx_type_hash_eq,
1633 cxx_copy_lang_qualifiers, cp_free_lang_data): Likewise.
1634 * typeck.c (structural_comptypes, convert_arguments,
1635 cp_build_addr_expr_1, unary_complex_lvalue, cp_build_c_cast,
1636 cp_build_modify_expr, comp_ptr_ttypes_real, type_memfn_rqual):
1637 Likewise.
1638
1639 2019-05-10 Marek Polacek <polacek@redhat.com>
1640
1641 PR c++/78010 - bogus -Wsuggest-override warning on final function.
1642 * class.c (check_for_override): Don't warn for final functions.
1643
1644 2019-05-10 Jakub Jelinek <jakub@redhat.com>
1645
1646 PR pch/90326
1647 * config-lang.in (gtfiles): Remove c-family/c-lex.c, add
1648 c-family/c-cppbuiltin.c.
1649
1650 2019-05-09 Paolo Carlini <paolo.carlini@oracle.com>
1651
1652 PR c++/90382
1653 Revert:
1654 2018-04-26 Paolo Carlini <paolo.carlini@oracle.com>
1655
1656 * decl.c (grokdeclarator): Fix value assigned to typespec_loc, use
1657 min_location.
1658
1659 2019-05-08 Nathan Sidwell <nathan@acm.org>
1660
1661 Kill DECL_SAVED_FUNCTION_DATA .
1662 * cp-tree.h (language_function): Remove x_auto_return_pattern.
1663 (current_function_auto_return_pattern): Delete.
1664 (lang_decl_fn): Replace saved_language_function with
1665 saved_auto_return type.
1666 (DECL_SAVED_FUNCTION_DATA): Delete.
1667 (DECL_SAVED_AUTO_RETURN_TYPE): New.
1668 (FNDECL_USED_AUTO): Correct documentation.
1669 * decl.c (duplicate_decls): Adjust AUTO return handling.
1670 (start_preparsed_function): Replace
1671 current_function_auto_return_pattern with
1672 DECL_SAVED_AUTO_RETURN_TYPE. Remove DECL_SAVED_FUNCTION_DATA
1673 zapping.
1674 (finish_function): Likewise.
1675 (save_function_data): Delete.
1676 (fndecl_declared_return_type): Reimplement.
1677 * mangle.c (write_unqualified_name): Use DECL_SAVED_AUTO_RETURN_TYPE.
1678 * method.c (make_thunk, make_alias_for): Likewise.
1679 * parser.c (cp_parser_jump_statement): Likewise.
1680 * pt.c (do_auto_deduction): Likewise.
1681 * typeck.c (check_return_expr): Likewise.
1682
1683 2019-05-06 Jason Merrill <jason@redhat.com>
1684
1685 PR c++/90171 - reorganize usual_deallocation_fn_p
1686 * call.c (struct dealloc_info): New.
1687 (usual_deallocation_fn_p): Take a dealloc_info*.
1688 (aligned_deallocation_fn_p, sized_deallocation_fn_p): Remove.
1689 (build_op_delete_call): Adjust.
1690
1691 2019-05-07 Jason Merrill <jason@redhat.com>
1692
1693 PR c++/86485 - -Wmaybe-unused with empty class ?:
1694 * typeck.c (build_static_cast_1): Use cp_build_addr_expr.
1695
1696 * pt.c (type_dependent_expression_p): A non-type template parm with
1697 a placeholder type is type-dependent.
1698
1699 2019-05-06 Marek Polacek <polacek@redhat.com>
1700
1701 PR c++/90265 - ICE with generic lambda.
1702 * pt.c (tsubst_copy_and_build): Use a dedicated variable for the last
1703 element in the vector.
1704
1705 2019-05-03 Martin Liska <mliska@suse.cz>
1706
1707 * call.c (build_aggr_conv): Use is_empty instead of
1708 elements () == 0 (and similar usages).
1709 * parser.c (cp_parser_lambda_introducer): Likewise.
1710
1711 2019-05-02 Nathan Sidwell <nathan@acm.org>
1712
1713 * semantics.c (finish_id_expression_1): Remove unreachable code.
1714
1715 2019-05-01 Nathan Sidwell <nathan@acm.org>
1716
1717 * name-lookup.h (get_class_binding_direct): Change final arg to
1718 bool.
1719 (get_class_binding): Likewise.
1720 * name-lookup.c (get_class_binding_direct): Replace TYPE_OR_FNS
1721 arg with WANT_TYPE bool. Simplify.
1722 (get_class_binding): Adjust final arg.
1723 * decl.c (reshape_init_class): Adjust get_class_binding calls.
1724
1725 2019-04-30 Nathan Sidwell <nathan@acm.org>
1726
1727 * cp-objcp-common.c (cp_common_init_ts): Use MARK_TS_EXP for _EXPR
1728 nodes. Call c_common_init_ts.
1729
1730 2019-04-29 Nathan Sidwell <nathan@acm.org>
1731
1732 * decl.c (duplicate_decls): Add whitespace, move comments into
1733 conditional blocks.
1734 * method.c (explain_implicit_non_constexpr): Refactor.
1735 * pt.c (check_explicit_specialization): Fix indentation.
1736 * semantics.c (process_outer_var_ref): Reformat.
1737 (finish_id_expression_1): Use STRIP_TEMPLATE.
1738
1739 2019-04-26 Jonathan Wakely <jwakely@redhat.com>
1740
1741 PR c++/90243 - orphaned note in uninstantiated constexpr function
1742 * decl.c (check_for_uninitialized_const_var): Suppress notes if no
1743 error was shown.
1744
1745 2019-04-26 Paolo Carlini <paolo.carlini@oracle.com>
1746
1747 PR c++/90173
1748 * decl.c (grokdeclarator): Set type to error_mark_node
1749 upon error about template placeholder type non followed
1750 by a simple declarator-id.
1751
1752 2019-04-26 Paolo Carlini <paolo.carlini@oracle.com>
1753
1754 * decl.c (grokdeclarator): Fix value assigned to typespec_loc, use
1755 min_location.
1756
1757 2019-04-24 Jason Merrill <jason@redhat.com>
1758
1759 PR c++/90227 - error with template parameter packs.
1760 * pt.c (coerce_template_parms): Do add empty pack when
1761 require_all_args.
1762
1763 2019-04-24 Richard Biener <rguenther@suse.de>
1764
1765 * call.c (null_ptr_cst_p): Order checks according to expensiveness.
1766 (conversion_null_warnings): Likewise.
1767 * typeck.c (same_type_ignoring_top_level_qualifiers_p): Return
1768 early if type1 == type2.
1769
1770 2019-04-22 Jason Merrill <jason@redhat.com>
1771
1772 PR c++/87366 - wrong error with alias template.
1773 * typeck.c (structural_comptypes): When comparing_specializations,
1774 aliases are unequal.
1775 (comptypes): When comparing_specializations, do structural
1776 comparison.
1777
1778 2019-04-19 Jason Merrill <jason@redhat.com>
1779
1780 PR c++/90190 - CTAD with list-constructor.
1781 * pt.c (do_class_deduction): Don't try the single element deduction
1782 if the single element is also a braced list.
1783
1784 PR c++/90171 - ICE with destroying delete with size_t parm.
1785 * call.c (sized_deallocation_fn_p): New. Use it instead of
1786 second_parm_is_size_t in most cases.
1787 (second_parm_is_size_t): Don't check for aligned.
1788
1789 2019-04-19 Paolo Carlini <paolo.carlini@oracle.com>
1790
1791 PR c++/89900
1792 * pt.c (fn_type_unification): When handling null explicit
1793 arguments do not special case non-parameter packs.
1794
1795 2019-04-19 Jakub Jelinek <jakub@redhat.com>
1796
1797 PR c++/90138
1798 * pt.c (process_template_parm): Set decl to pushdecl result. If
1799 !is_non_type, also set parm to that.
1800
1801 PR c/89888
1802 * decl.c (struct cp_switch): Remove outside_range_p member.
1803 (push_switch): Don't clear it.
1804 (pop_switch): Adjust c_do_switch_warnings caller.
1805 (finish_case_label): Adjust c_add_case_label caller.
1806
1807 PR c++/90108
1808 * decl.c (duplicate_decls): If remove is main variant and
1809 DECL_ORIGINAL_TYPE is some other type, remove a DECL_ORIGINAL_TYPE
1810 variant that has newdecl as TYPE_NAME if any.
1811
1812 2019-04-18 Jason Merrill <jason@redhat.com>
1813
1814 PR c++/87554 - ICE with extern template and reference member.
1815 * decl.c (cp_finish_decl): Don't set DECL_INITIAL of external vars.
1816
1817 2019-04-17 Jason Merrill <jason@redhat.com>
1818
1819 PR c++/90047 - ICE with enable_if alias template.
1820 * pt.c (tsubst_decl) [TYPE_DECL]: Don't put an erroneous decl in the
1821 hash table when we're in SFINAE context.
1822
1823 2019-04-17 Marek Polacek <polacek@redhat.com>
1824
1825 PR c++/90124 - bogus error with incomplete type in decltype.
1826 * typeck.c (build_class_member_access_expr): Check
1827 cp_unevaluated_operand.
1828
1829 2019-04-12 Jakub Jelinek <jakub@redhat.com>
1830
1831 PR c/89933
1832 * decl.c (duplicate_decls): When newdecl's type is its main variant,
1833 don't try to remove it from the variant list, but instead assert
1834 it has no variants.
1835
1836 2019-04-12 Martin Sebor <msebor@redhat.com>
1837
1838 PR c/88383
1839 PR c/89288
1840 * parser.c (cp_parser_has_attribute_expression): Handle assignment
1841 expressions.
1842
1843 2019-04-12 Jason Merrill <jason@redhat.com>
1844
1845 * call.c (null_member_pointer_value_p): Handle an empty CONSTRUCTOR
1846 of PMF type.
1847
1848 2019-04-12 Marek Polacek <polacek@redhat.com>
1849
1850 * except.c (build_noexcept_spec): Use build_converted_constant_bool_expr
1851 instead of perform_implicit_conversion_flags.
1852
1853 PR c++/87603 - constexpr functions are no longer noexcept.
1854 * constexpr.c (is_sub_constant_expr): Remove unused function.
1855 * cp-tree.h (is_sub_constant_expr): Remove declaration.
1856 * except.c (check_noexcept_r): Don't consider a call to a constexpr
1857 function noexcept.
1858
1859 2019-04-11 Jakub Jelinek <jakub@redhat.com>
1860
1861 PR translation/90035
1862 * parser.h (struct cp_parser): Add
1863 type_definition_forbidden_message_arg member.
1864 * parser.c (cp_debug_parser): Print it.
1865 (cp_parser_check_type_definition): Pass
1866 parser->type_definition_forbidden_message_arg as second argument to
1867 error.
1868 (cp_parser_has_attribute_expression, cp_parser_sizeof_operand): Set
1869 parser->type_definition_forbidden_message_arg and use G_() with
1870 %qs for parser->type_definition_forbidden_message instead of
1871 building untranslatable message using concat.
1872
1873 2019-04-09 Jakub Jelinek <jakub@redhat.com>
1874
1875 PR translation/90011
1876 * typeck2.c (check_narrowing): Remove trailing space from diagnostics.
1877
1878 2019-04-08 Marek Polacek <polacek@redhat.com>
1879
1880 * typeck2.c (digest_init_r): Don't condition the object slicing warning
1881 on flag_checking.
1882
1883 2019-04-08 Paolo Carlini <paolo.carlini@oracle.com>
1884
1885 PR c++/89914
1886 * semantics.c (trait_expr_value): Don't use TYPE_NOTHROW_P
1887 when maybe_instantiate_noexcept fails.
1888 (classtype_has_nothrow_assign_or_copy_p): Likewise.
1889 * method.c (implicitly_declare_fn): Avoid passing error_mark_node
1890 to build_exception_variant.
1891
1892 2019-04-05 Marek Polacek <polacek@redhat.com>
1893
1894 PR c++/87145 - bogus error converting class type in template arg list.
1895 * pt.c (convert_nontype_argument): Don't call
1896 build_converted_constant_expr if it could involve calling a conversion
1897 function with a instantiation-dependent constructor as its argument.
1898
1899 2019-04-05 Martin Sebor <msebor@redhat.com>
1900
1901 PR bootstrap/89980
1902 * decl.c (reshape_init_array_1): Avoid treating empty strings
1903 as zeros in array initializers.
1904 Use trivial_type_p () instead of TYPE_HAS_TRIVIAL_DFLT().
1905
1906 2019-04-04 Jason Merrill <jason@redhat.com>
1907
1908 PR c++/89948 - ICE with break in statement-expr.
1909 * constexpr.c (cxx_eval_statement_list): Jumping out of a
1910 statement-expr is non-constant.
1911
1912 2019-04-04 Jason Merrill <jason@redhat.com>
1913
1914 PR c++/89966 - error with non-type auto tparm.
1915 * pt.c (do_auto_deduction): Clear tf_partial.
1916
1917 2019-04-04 Jason Merrill <jason@redhat.com>
1918
1919 PR c++/86986 - ICE with TTP with parameter pack.
1920 * pt.c (coerce_template_parameter_pack): Only look at the type of a
1921 non-type parameter pack.
1922 (fixed_parameter_pack_p_1): Don't recurse into the type of a
1923 non-type parameter pack.
1924 (coerce_template_template_parms): Call add_outermost_template_args.
1925
1926 2019-04-04 Martin Sebor <msebor@redhat.com>
1927
1928 PR c++/89974
1929 PR c++/89878
1930 PR c++/89833
1931 PR c++/47488
1932 * decl.c (reshape_init_array_1): Strip trailing zero-initializers
1933 from arrays of trivial type and known size.
1934 * mangle.c (write_expression): Convert braced initializer lists
1935 to STRING_CSTs.
1936 (write_expression): Trim trailing zero-initializers from arrays
1937 of trivial type.
1938 (write_template_arg_literal): Mangle strings the same as braced
1939 initializer lists.
1940
1941 2019-04-03 Jason Merrill <jason@redhat.com>
1942
1943 PR c++/81866 - ICE with member template and default targ.
1944 * pt.c (tsubst_template_decl): Handle getting a type from
1945 retrieve_specialization.
1946
1947 PR c++/86586 - -fcompare-debug=-Wsign-compare.
1948 * typeck.c (cp_build_binary_op): Don't fold for -Wsign-compare.
1949
1950 PR c++/89331 - ICE with offsetof in incomplete class.
1951 * semantics.c (finish_offsetof): Handle error_mark_node.
1952 * typeck.c (build_class_member_access_expr): Call
1953 complete_type_or_maybe_complain before converting to base.
1954
1955 PR c++/89917 - ICE with lambda in variadic mem-init.
1956 * pt.c (make_pack_expansion): Change type_pack_expansion_p to false.
1957
1958 2019-04-01 Jason Merrill <jason@redhat.com>
1959
1960 PR c++/86946 - ICE with function call in template argument.
1961 DR 1321
1962 * pt.c (iterative_hash_template_arg) [CALL_EXPR]: Use
1963 dependent_name.
1964
1965 2019-04-01 Paolo Carlini <paolo.carlini@oracle.com>
1966
1967 PR c++/62207
1968 * pt.c (tsubst_copy): Deal with lookup_name not returing a variable.
1969
1970 2019-03-31 Marek Polacek <polacek@redhat.com>
1971
1972 PR c++/89852 - ICE with C++11 functional cast with { }.
1973 * constexpr.c (fold_non_dependent_expr_template): New static function
1974 broken out of...
1975 (fold_non_dependent_expr): ...here.
1976 (fold_non_dependent_init): New function.
1977 * cp-tree.h (fold_non_dependent_init): Declare.
1978 * typeck2.c (massage_init_elt): Call fold_non_dependent_init instead
1979 of fold_non_dependent_expr. Don't call maybe_constant_init.
1980
1981 2019-03-30 Jason Merrill <jason@redhat.com>
1982
1983 PR c++/89744 - ICE with specialization of member class template.
1984 * pt.c (lookup_template_class_1): If the partial instantiation is
1985 explicitly specialized, adjust.
1986 (maybe_process_partial_specialization): Also adjust
1987 CLASSTYPE_TI_ARGS.
1988
1989 2019-03-29 Jakub Jelinek <jakub@redhat.com>
1990
1991 PR sanitizer/89869
1992 * typeck.c: Include gimplify.h.
1993 (cp_build_modify_expr) <case COND_EXPR>: Unshare rhs before using it
1994 for second time. Formatting fixes.
1995
1996 2019-03-29 Marek Polacek <polacek@redhat.com>
1997
1998 PR c++/89876 - ICE with deprecated conversion.
1999 * call.c (convert_like_real): Only give warnings with tf_warning.
2000
2001 2019-03-28 Marek Polacek <polacek@redhat.com>
2002
2003 PR c++/89612 - ICE with member friend template with noexcept.
2004 * pt.c (maybe_instantiate_noexcept): For function templates, use their
2005 template result (function decl). Don't set up local specializations.
2006 Temporarily turn on processing_template_decl. Update the template type
2007 too.
2008
2009 PR c++/89836 - bool constant expression and explicit conversions.
2010 * call.c (build_converted_constant_expr_internal): New function,
2011 renamed from...
2012 (build_converted_constant_expr): ...this. New.
2013 (build_converted_constant_bool_expr): New.
2014 * cp-tree.h (build_converted_constant_bool_expr): Declare.
2015 * decl.c (build_explicit_specifier): Call
2016 build_converted_constant_bool_expr.
2017
2018 2019-03-28 Jakub Jelinek <jakub@redhat.com>
2019
2020 PR c++/89785
2021 * constexpr.c (struct check_for_return_continue_data): New type.
2022 (check_for_return_continue): New function.
2023 (potential_constant_expression_1) <case SWITCH_STMT>: Walk
2024 SWITCH_STMT_BODY to find RETURN_EXPRs or CONTINUE_STMTs not nested
2025 in loop bodies and set *jump_target to that if found.
2026
2027 2019-03-27 Jason Merrill <jason@redhat.com>
2028
2029 PR c++/89831 - error with qualified-id in const member function.
2030 * semantics.c (finish_non_static_data_member): Use object cv-quals
2031 in scoped case, too.
2032
2033 PR c++/89421 - ICE with lambda in template parameter list.
2034 * parser.c (cp_parser_lambda_expression): Also reject a lambda in a
2035 template parameter list before C++20.
2036 * pt.c (type_dependent_expression_p): True for LAMBDA_EXPR.
2037 * semantics.c (begin_class_definition): Restore error about defining
2038 non-lambda class in template parm list.
2039
2040 2019-03-26 Jason Merrill <jason@redhat.com>
2041
2042 PR c++/86932 - missed SFINAE with empty pack.
2043 * pt.c (coerce_template_parms): Don't add an empty pack if
2044 tf_partial.
2045 (fn_type_unification): Pass tf_partial to coerce_template_parms.
2046
2047 PR c++/86429 - constexpr variable in lambda.
2048 PR c++/82643
2049 PR c++/87327
2050 * constexpr.c (cxx_eval_constant_expression): In a lambda function,
2051 try evaluating the captured variable directly.
2052
2053 2019-03-26 Jakub Jelinek <jakub@redhat.com>
2054
2055 PR c++/89796
2056 * semantics.c (finish_omp_atomic): Add warning_sentinel for
2057 -Wunused-value around finish_expr_stmt call.
2058
2059 2019-03-25 Paolo Carlini <paolo.carlini@oracle.com>
2060
2061 PR c++/84661
2062 PR c++/85013
2063 * parser.c (cp_parser_binary_expression): Don't call cp_fully_fold
2064 to undo the disabling of warnings.
2065
2066 2019-03-25 Jason Merrill <jason@redhat.com>
2067
2068 PR c++/87748 - substitution failure error with decltype.
2069 * pt.c (most_specialized_partial_spec): Clear
2070 processing_template_decl.
2071
2072 2019-03-25 Marek Polacek <polacek@redhat.com>
2073
2074 PR c++/89214 - ICE when initializing aggregates with bases.
2075 * typeck2.c (digest_init_r): Warn about object slicing instead of
2076 crashing.
2077
2078 PR c++/89705 - ICE with reference binding with conversion function.
2079 * call.c (reference_binding): If the result of the conversion function
2080 is a prvalue of non-class type, use the cv-unqualified type.
2081
2082 2019-03-25 Nathan Sidwell <nathan@acm.org>
2083
2084 * lambda.c (maybe_add_lambda_conv_op): Don't add to comdat group.
2085
2086 2019-03-22 Jakub Jelinek <jakub@redhat.com>
2087
2088 PR c++/60702
2089 * cp-tree.h (get_tls_wrapper_fn): Remove declaration.
2090 (maybe_get_tls_wrapper_call): Declare.
2091 * decl2.c (get_tls_wrapper_fn): Make static.
2092 (maybe_get_tls_wrapper_call): New function.
2093 * typeck.c (build_class_member_access_expr): Handle accesses to TLS
2094 variables.
2095 * semantics.c (finish_qualified_id_expr): Likewise.
2096 (finish_id_expression_1): Use maybe_get_tls_wrapper_call.
2097 * pt.c (tsubst_copy_and_build): Likewise.
2098
2099 PR c++/87481
2100 * constexpr.c (struct constexpr_ctx): Add constexpr_ops_count member.
2101 (cxx_eval_constant_expression): When not skipping, not constant class
2102 or location wrapper, increment *ctx->constexpr_ops_count and if it is
2103 above constexpr_loop_nest_limit, diagnose failure.
2104 (cxx_eval_outermost_constant_expr): Add constexpr_ops_count and
2105 initialize ctx.constexpr_ops_count to its address.
2106 (is_sub_constant_expr): Likewise.
2107
2108 2019-03-21 Jakub Jelinek <jakub@redhat.com>
2109
2110 PR c++/71446
2111 * call.c (filed_in_pset): Change pset from hash_set<tree> * to
2112 hash_set<tree, true> &, adjust uses accordingly.
2113 (build_aggr_conv): Change pset from hash_set<tree> *
2114 to hash_set<tree, true>. Replace goto fail; with return NULL;,
2115 adjust pset uses.
2116
2117 PR c++/89767
2118 * parser.c (cp_parser_lambda_introducer): Add ids and first_capture_id
2119 variables, check for duplicates in this function.
2120 * lambda.c (add_capture): Don't check for duplicates nor use
2121 IDENTIFIER_MARKED.
2122 (register_capture_members): Don't clear IDENTIFIER_MARKED here.
2123
2124 2019-03-21 Paolo Carlini <paolo.carlini@oracle.com>
2125
2126 PR c++/89571
2127 * method.c (after_nsdmi_defaulted_late_checks): Avoid passing
2128 error_mark_node to comp_except_specs.
2129
2130 2019-03-20 Jason Merrill <jason@redhat.com>
2131
2132 PR c++/87480 - decltype of member access in default template arg
2133 * pt.c (type_unification_real): Accept a dependent result in
2134 template context.
2135
2136 2019-03-19 Martin Sebor <msebor@redhat.com>
2137
2138 PR tree-optimization/89688
2139 * typeck2.c (store_init_value): Call braced_lists_to_string for more
2140 kinds of initializers.
2141
2142 2019-03-18 Jason Merrill <jason@redhat.com>
2143
2144 PR c++/89630 - ICE with dependent using-decl as template arg.
2145 * tree.c (cp_tree_equal): Always return false for USING_DECL.
2146
2147 PR c++/89761 - ICE with sizeof... in pack expansion.
2148 * pt.c (argument_pack_element_is_expansion_p): Handle
2149 ARGUMENT_PACK_SELECT.
2150
2151 PR c++/89640 - GNU attributes on lambda.
2152 * parser.c (cp_parser_lambda_declarator_opt): Allow GNU attributes.
2153
2154 PR c++/89682 - wrong access error in default argument.
2155 * pt.c (tsubst_default_argument): Don't defer access checks.
2156
2157 2019-03-18 Paolo Carlini <paolo.carlini@oracle.com>
2158
2159 PR c++/85014
2160 * semantics.c (finish_non_static_data_member): Check return value
2161 of context_for_name_lookup and immediately return error_mark_node
2162 if isn't a type.
2163
2164 2019-03-17 Jason Merrill <jason@redhat.com>
2165
2166 PR c++/89571 - ICE with ill-formed noexcept on constructor.
2167 * pt.c (maybe_instantiate_noexcept): Only return false if defaulted.
2168 (regenerate_decl_from_template): Use it for noexcept-specs.
2169
2170 2019-03-14 Jason Merrill <jason@redhat.com>
2171
2172 * parser.c (cp_parser_decl_specifier_seq): Support C++20
2173 concept-definition syntax without 'bool'.
2174
2175 2019-03-14 Jakub Jelinek <jakub@redhat.com>
2176
2177 PR c++/89512
2178 * semantics.c (finish_qualified_id_expr): Reject variable templates.
2179
2180 PR c++/89652
2181 * constexpr.c (struct constexpr_ctx): Change save_exprs type from
2182 hash_set<tree> to vec<tree>.
2183 (cxx_eval_call_expression): Adjust for save_exprs being a vec instead
2184 of hash_set.
2185 (cxx_eval_loop_expr): Likewise. Truncate the vector after each
2186 removal of SAVE_EXPRs from values.
2187 (cxx_eval_constant_expression) <case SAVE_EXPR>: Call safe_push
2188 method on save_exprs instead of add.
2189
2190 2019-03-13 Jason Merrill <jason@redhat.com>
2191
2192 PR c++/86521 - C++17 copy elision in initialization by constructor.
2193 * call.c (joust_maybe_elide_copy): New.
2194 (joust): Call it.
2195
2196 2019-03-13 Marek Polacek <polacek@redhat.com>
2197
2198 PR c++/88979 - further P0634 fix for constructors.
2199 * parser.c (cp_parser_decl_specifier_seq): Pass flags to
2200 cp_parser_constructor_declarator_p.
2201 (cp_parser_direct_declarator): Allow missing typename for constructor
2202 parameters.
2203 (cp_parser_constructor_declarator_p): Add FLAGS parameter. Pass it to
2204 cp_parser_type_specifier.
2205
2206 PR c++/89686 - mixing init-capture and simple-capture in lambda.
2207 * parser.c (cp_parser_lambda_introducer): Give error when combining
2208 init-capture and simple-capture.
2209
2210 PR c++/89660 - bogus error with -Wredundant-move.
2211 * typeck.c (maybe_warn_pessimizing_move): Only accept (T &) &arg
2212 as the std::move's argument. Don't call convert_for_initialization
2213 when warn_redundant_move isn't on.
2214
2215 2019-03-11 Jason Merrill <jason@redhat.com>
2216
2217 PR c++/86521 - wrong overload resolution with ref-qualifiers.
2218 * call.c (build_user_type_conversion_1): Don't use a conversion to a
2219 reference of the wrong rvalueness for direct binding.
2220
2221 2019-03-11 Martin Liska <mliska@suse.cz>
2222
2223 * cvt.c (build_expr_type_conversion): Wrap apostrophes
2224 in gcc internal format with %'.
2225 * decl.c (check_no_redeclaration_friend_default_args): Likewise.
2226 (grokfndecl): Likewise.
2227 * name-lookup.c (do_pushtag): Likewise.
2228 * pt.c (unify_parameter_deduction_failure): Likewise.
2229 (unify_template_deduction_failure): Likewise.
2230
2231 2019-03-11 Martin Liska <mliska@suse.cz>
2232
2233 * call.c (convert_arg_to_ellipsis): Wrap an option name
2234 in a string format message and fix GNU coding style.
2235 (build_over_call): Likewise.
2236 * class.c (check_field_decl): Likewise.
2237 (layout_nonempty_base_or_field): Likewise.
2238 * constexpr.c (cxx_eval_loop_expr): Likewise.
2239 * cvt.c (type_promotes_to): Likewise.
2240 * decl.c (cxx_init_decl_processing): Likewise.
2241 (mark_inline_variable): Likewise.
2242 (grokdeclarator): Likewise.
2243 * decl2.c (record_mangling): Likewise.
2244 * error.c (maybe_warn_cpp0x): Likewise.
2245 * except.c (doing_eh): Likewise.
2246 * mangle.c (maybe_check_abi_tags): Likewise.
2247 * parser.c (cp_parser_diagnose_invalid_type_name): Likewise.
2248 (cp_parser_userdef_numeric_literal): Likewise.
2249 (cp_parser_primary_expression): Likewise.
2250 (cp_parser_unqualified_id): Likewise.
2251 (cp_parser_pseudo_destructor_name): Likewise.
2252 (cp_parser_builtin_offsetof): Likewise.
2253 (cp_parser_lambda_expression): Likewise.
2254 (cp_parser_lambda_introducer): Likewise.
2255 (cp_parser_lambda_declarator_opt): Likewise.
2256 (cp_parser_selection_statement): Likewise.
2257 (cp_parser_init_statement): Likewise.
2258 (cp_parser_decomposition_declaration): Likewise.
2259 (cp_parser_function_specifier_opt): Likewise.
2260 (cp_parser_static_assert): Likewise.
2261 (cp_parser_simple_type_specifier): Likewise.
2262 (cp_parser_namespace_definition): Likewise.
2263 (cp_parser_using_declaration): Likewise.
2264 (cp_parser_ctor_initializer_opt_and_function_body): Likewise.
2265 (cp_parser_initializer_list): Likewise.
2266 (cp_parser_type_parameter_key): Likewise.
2267 (cp_parser_member_declaration): Likewise.
2268 (cp_parser_try_block): Likewise.
2269 (cp_parser_std_attribute_spec): Likewise.
2270 (cp_parser_requires_clause_opt): Likewise.
2271 * pt.c (check_template_variable): Likewise.
2272 (check_default_tmpl_args): Likewise.
2273 (push_tinst_level_loc): Likewise.
2274 (instantiate_pending_templates): Likewise.
2275 (invalid_nontype_parm_type_p): Likewise.
2276 * repo.c (get_base_filename): Likewise.
2277 * rtti.c (typeid_ok_p): Likewise.
2278 (build_dynamic_cast_1): Likewise.
2279 * tree.c (maybe_warn_parm_abi): Likewise.
2280
2281 2019-03-08 Jakub Jelinek <jakub@redhat.com>
2282
2283 PR other/80058
2284 * parser.c (cp_parser_template_declaration_after_parameters): Avoid
2285 one space before " at the end of line and another after " on another
2286 line in a string literal.
2287
2288 PR tree-optimization/89550
2289 * semantics.c (maybe_convert_cond): Only set TREE_NO_WARNING if
2290 warning_at returned true.
2291 * decl2.c (c_parse_final_cleanups): Likewise.
2292 * typeck.c (convert_for_assignment): Likewise.
2293 * decl.c (finish_function): Likewise.
2294
2295 PR c++/89585
2296 * parser.c (cp_parser_asm_definition): Just warn instead of error
2297 on volatile qualifier outside of function body.
2298
2299 PR c++/89599
2300 * constexpr.c (potential_constant_expression_1): Reject
2301 REINTERPRET_CAST_P NOP_EXPRs.
2302
2303 PR c++/89622
2304 * call.c (joust): Call print_z_candidate only if pedwarn returned
2305 true.
2306
2307 2019-03-07 Jason Merrill <jason@redhat.com>
2308
2309 PR c++/88123 - lambda and using-directive.
2310 * name-lookup.c (op_unqualified_lookup)
2311 (maybe_save_operator_binding, discard_operator_bindings)
2312 (push_operator_bindings): New.
2313 * typeck.c (build_x_binary_op, build_x_unary_op): Call
2314 maybe_save_operator_binding.
2315 * decl.c (start_preparsed_function): Call push_operator_bindings.
2316 * tree.c (cp_free_lang_data): Call discard_operator_bindings.
2317
2318 PR c++/88820 - ICE with CTAD and member template used in DMI.
2319 * pt.c (do_class_deduction): Handle parm used as its own arg.
2320
2321 2019-03-07 Jakub Jelinek <jakub@redhat.com>
2322
2323 PR c++/89585
2324 * parser.c (cp_parser_asm_definition): Parse asm qualifiers even
2325 at toplevel, but diagnose them.
2326
2327 2019-03-06 Jason Merrill <jason@redhat.com>
2328
2329 PR c++/89381 - implicit copy and using-declaration.
2330 * class.c (classtype_has_move_assign_or_move_ctor_p): Don't consider
2331 op= brought in by a using-declaration.
2332
2333 2019-03-06 Jakub Jelinek <jakub@redhat.com>
2334
2335 PR c++/87148
2336 * init.c (build_value_init_noctor): Ignore flexible array members.
2337
2338 2019-03-06 Jason Merrill <jason@redhat.com>
2339
2340 PR c++/89576 - if constexpr of lambda capture.
2341 * semantics.c (maybe_convert_cond): Do convert a non-dependent
2342 condition in a template.
2343 * typeck.c (condition_conversion): Handle being called in a
2344 template.
2345
2346 2019-03-06 Marek Polacek <polacek@redhat.com>
2347
2348 PR c++/87378 - bogus -Wredundant-move warning.
2349 * typeck.c (maybe_warn_pessimizing_move): See if the maybe-rvalue
2350 overload resolution would actually succeed.
2351
2352 2019-03-05 Jason Merrill <jason@redhat.com>
2353
2354 * class.c (is_really_empty_class): Add ignore_vptr parm.
2355 (trivial_default_constructor_is_constexpr): Pass it.
2356 * call.c (build_over_call): Pass it.
2357 * constexpr.c (cxx_eval_constant_expression): Pass it instead of
2358 checking TYPE_POLYMORPHIC_P.
2359 (cxx_eval_component_reference, potential_constant_expression_1):
2360 Pass it.
2361 * cp-gimplify.c (simple_empty_class_p): Pass it.
2362 * init.c (expand_aggr_init_1): Pass it.
2363
2364 2019-03-04 Paolo Carlini <paolo.carlini@oracle.com>
2365
2366 PR c++/84605
2367 * parser.c (cp_parser_class_head): Reject TYPE_BEING_DEFINED too.
2368
2369 2019-03-04 Jakub Jelinek <jakub@redhat.com>
2370
2371 PR c++/71446
2372 * call.c (field_in_pset): New function.
2373 (build_aggr_conv): Handle CONSTRUCTOR_IS_DESIGNATED_INIT correctly.
2374
2375 2019-03-02 Jakub Jelinek <jakub@redhat.com>
2376
2377 PR c++/71446
2378 * cp-tree.h (CONSTRUCTOR_IS_DESIGNATED_INIT): Define.
2379 * parser.c (cp_parser_braced_list): Adjust cp_parser_initializer_list
2380 caller, set CONSTRUCTOR_IS_DESIGNATED_INIT.
2381 (cp_parser_initializer_list): Add designated parameter, set *designated
2382 to a bool whether any designators were parsed.
2383 * decl.c (reshape_init): Copy over CONSTRUCTOR_IS_DESIGNATED_INIT if
2384 needed.
2385 * pt.c (tsubst_copy_and_build): Likewise.
2386 * call.c (implicit_conversion): If CONSTRUCTOR_IS_DESIGNATED_INIT,
2387 don't call build_list_conv, nor build_complex_conv, nor attempt to
2388 convert a single element initializer to scalar.
2389
2390 2019-03-01 Marek Polacek <polacek@redhat.com>
2391
2392 PR c++/89537 - missing location for error with non-static member fn.
2393 * call.c (resolve_args): Use EXPR_LOCATION.
2394 * typeck.c (build_class_member_access_expr): Use input_location.
2395
2396 PR c++/89532 - ICE with incomplete type in decltype.
2397 * semantics.c (finish_compound_literal): Return error_mark_node
2398 if digest_init_flags returns error_mark_node.
2399
2400 2019-03-01 Jakub Jelinek <jakub@redhat.com>
2401
2402 Implement P1002R1, Try-catch blocks in constexpr functions
2403 PR c++/89513
2404 * parser.c (cp_parser_ctor_initializer_opt_and_function_body):
2405 Diagnose constexpr ctor or function with function-try-block with
2406 pedwarn for c++17 and earlier. Formatting fix.
2407 (cp_parser_try_block): Use pedwarn instead of error and only for
2408 c++17 and earlier when try block appears in constexpr function.
2409 * constexpr.c (build_constexpr_constructor_member_initializers):
2410 Handle TRY_BLOCK here instead of erroring on it.
2411
2412 2019-02-28 Jason Merrill <jason@redhat.com>
2413
2414 PR c++/88183 - ICE with .* fold-expression.
2415 * pt.c (fold_expression) [DOTSTAR_EXPR]: Remove special handling.
2416
2417 PR c++/86969 - ICE with constexpr if and recursive generic lambdas.
2418 * class.c, lambda.c, pt.c: Revert earlier change.
2419 * lambda.c (add_capture): Don't special-case capture of dependent
2420 VLA.
2421
2422 * name-lookup.c (print_binding_level): Print this_entity.
2423
2424 2019-02-27 Marek Polacek <polacek@redhat.com>
2425
2426 PR c++/88857 - ICE with value-initialization of argument in template.
2427 * call.c (convert_like_real): Don't call build_value_init in template.
2428
2429 2019-02-27 Jason Merrill <jason@redhat.com>
2430
2431 PR c++/86969 - ICE with constexpr if and recursive generic lambdas.
2432 * semantics.c (process_outer_var_ref): Do capture dependent vars.
2433 * class.c (finish_struct): Only add TAG_DEFN if T is in
2434 current_function_decl.
2435 * lambda.c (vla_capture_type): Force the capture type out into the
2436 lambda's enclosing function.
2437 (add_capture): Pass in the lambda.
2438 * pt.c (tsubst_lambda_expr): complete_type a VLA capture type.
2439
2440 2019-02-27 Marek Polacek <polacek@redhat.com>
2441
2442 PR c++/89511 - ICE with using-declaration and unscoped enumerator.
2443 * parser.c (cp_parser_using_declaration): For an unscoped enum
2444 only use its context if it's not a function declaration.
2445
2446 2019-02-27 Paolo Carlini <paolo.carlini@oracle.com>
2447
2448 PR c++/89488
2449 * method.c (process_subob_fn): When maybe_instantiate_noexcept
2450 returns false don't call merge_exception_specifiers.
2451
2452 2019-02-27 Paolo Carlini <paolo.carlini@oracle.com>
2453
2454 PR c++/88987
2455 * parser.c (cp_parser_noexcept_specification_opt): Return NULL_TREE
2456 for a non-constant parsed expression.
2457
2458 2019-02-26 Jakub Jelinek <jakub@redhat.com>
2459
2460 PR c++/89481
2461 * constexpr.c (cxx_eval_store_expression): When changing active union
2462 member, set no_zero_init.
2463
2464 2019-02-23 Marek Polacek <polacek@redhat.com>
2465
2466 PR c++/88294 - ICE with non-constant noexcept-specifier.
2467 * pt.c (maybe_instantiate_noexcept): Set up the list of local
2468 specializations. Set current_class_{ptr,ref}.
2469
2470 2019-02-22 David Malcolm <dmalcolm@redhat.com>
2471
2472 PR c++/89390
2473 * parser.c (cp_parser_unqualified_id): Capture and use locations
2474 for destructors.
2475
2476 2019-02-22 Marek Polacek <polacek@redhat.com>
2477
2478 PR c++/89420 - ICE with CAST_EXPR in explicit-specifier.
2479 * decl.c (build_explicit_specifier): Don't check
2480 processing_template_decl. Call instantiation_dependent_expression_p
2481 instead of value_dependent_expression_p. Call
2482 instantiate_non_dependent_expr_sfinae before
2483 build_converted_constant_expr instead of calling
2484 instantiate_non_dependent_expr after it. Add
2485 processing_template_decl_sentinel.
2486
2487 2019-02-22 Thomas Schwinge <thomas@codesourcery.com>
2488
2489 * parser.c (cp_parser_oacc_simple_clause): Remove parser formal
2490 parameter, move loc formal parameter to the front. Adjust all
2491 users.
2492 (cp_parser_oacc_shape_clause): Add loc formal parameter. Adjust
2493 all users.
2494
2495 2019-02-21 Jason Merrill <jason@redhat.com>
2496
2497 PR c++/87685 - generic lambda 'this' capture error.
2498 * lambda.c (lambda_expr_this_capture): Change add_capture_p to int.
2499 (maybe_generic_this_capture): Pass -1.
2500
2501 PR c++/88394 - ICE with VLA init-capture.
2502 * lambda.c (is_normal_capture_proxy): Check DECL_CAPTURED_VARIABLE.
2503
2504 PR c++/88869 - C++17 ICE with CTAD and explicit specialization.
2505 * pt.c (do_class_deduction): Don't include explicit specialization
2506 args in outer_args.
2507
2508 PR c++/89422 - ICE with -g and lambda in default arg in template.
2509 * pt.c (tsubst_function_decl): SET_DECL_FRIEND_CONTEXT sooner.
2510
2511 2019-02-21 Jason Merrill <jason@redhat.com>
2512
2513 PR c++/88419 - C++17 ICE with class template arg deduction.
2514 * pt.c (make_template_placeholder): Set TYPE_CANONICAL after
2515 CLASS_PLACEHOLDER_TEMPLATE.
2516
2517 2019-02-21 Jakub Jelinek <jakub@redhat.com>
2518
2519 PR c++/89285
2520 * constexpr.c (struct constexpr_fundef): Add parms and result members.
2521 (retrieve_constexpr_fundef): Adjust for the above change.
2522 (register_constexpr_fundef): Save constexpr body with copy_fn,
2523 temporarily set DECL_CONTEXT on DECL_RESULT before that.
2524 (get_fundef_copy): Change FUN argument to FUNDEF with
2525 constexpr_fundef * type, grab body and parms/result out of
2526 constexpr_fundef struct and temporarily change it for copy_fn calls
2527 too.
2528 (cxx_eval_builtin_function_call): For __builtin_FUNCTION temporarily
2529 adjust current_function_decl from ctx->call context. Test
2530 !potential_constant_expression instead of !is_constant_expression.
2531 (cxx_bind_parameters_in_call): Grab parameters from new_call. Undo
2532 convert_for_arg_passing changes for TREE_ADDRESSABLE type passing.
2533 (cxx_eval_call_expression): Adjust get_fundef_copy caller.
2534 (cxx_eval_conditional_expression): For IF_STMT, allow then or else
2535 operands to be NULL.
2536 (label_matches): Handle BREAK_STMT and CONTINUE_STMT.
2537 (cxx_eval_loop_expr): Add support for FOR_STMT, WHILE_STMT and DO_STMT.
2538 (cxx_eval_switch_expr): Add support for SWITCH_STMT.
2539 (cxx_eval_constant_expression): Handle IF_STMT, FOR_STMT, WHILE_STMT,
2540 DO_STMT, CONTINUE_STMT, SWITCH_STMT, BREAK_STMT and CONTINUE_STMT.
2541 For SIZEOF_EXPR, recurse on the result of fold_sizeof_expr. Ignore
2542 DECL_EXPR with USING_DECL operand.
2543 * lambda.c (maybe_add_lambda_conv_op): Build thisarg using
2544 build_int_cst to make it a valid constant expression.
2545
2546 2019-02-20 Jason Merrill <jason@redhat.com>
2547
2548 PR c++/88690 - C++17 ICE with empty base in aggregate.
2549 * typeck2.c (process_init_constructor_record): Skip trivial
2550 initialization of an empty base.
2551
2552 2019-02-21 Richard Biener <rguenther@suse.de>
2553
2554 PR middle-end/89392
2555 * vtable-class-hierarchy.c (vtv_generate_init_routine): Do not
2556 make symtab process new functions here.
2557
2558 2019-02-20 Jason Merrill <jason@redhat.com>
2559
2560 PR c++/87921 - wrong error with inline static data member.
2561 * decl2.c (finish_static_data_member_decl): Don't set DECL_IN_AGGR_P
2562 for a non-template inline variable. Do nothing for an
2563 already-instantiated variable.
2564 (c_parse_final_cleanups): Check DECL_IN_AGGR_P without
2565 DECL_INLINE_VAR_P.
2566 * decl.c (check_initializer): Likewise.
2567 (make_rtl_for_nonlocal_decl): Likewise.
2568 * pt.c (instantiate_decl): Likewise.
2569 * typeck2.c (store_init_value): Likewise.
2570
2571 2019-02-20 Jakub Jelinek <jakub@redhat.com>
2572
2573 PR c++/89403
2574 * decl2.c (c_parse_final_cleanups): Move TREE_ASM_WRITTEN setting
2575 for flag_syntax_only from here...
2576 * semantics.c (expand_or_defer_fn_1): ... here.
2577
2578 PR c++/89405
2579 * decl.c (maybe_commonize_var): When clearing TREE_PUBLIC and
2580 DECL_COMMON, set DECL_INTERFACE_KNOWN.
2581
2582 PR c++/89336
2583 * constexpr.c (cxx_eval_store_expression): Diagnose changing of active
2584 union member for -std=c++17 and earlier.
2585
2586 2019-02-19 Jason Merrill <jason@redhat.com>
2587
2588 PR c++/87513 - 'sorry' mangling PMF template-id.
2589 * mangle.c (write_expression): Handle SCOPE_REF to BASELINK.
2590
2591 2019-02-19 Jason Merrill <jason@redhat.com>
2592
2593 PR c++/88380 - wrong-code with flexible array and NSDMI.
2594 * typeck2.c (process_init_constructor_record): Skip flexarrays.
2595
2596 2019-02-20 will wray <wjwray@gmail.com>
2597
2598 PR c++/88572 - wrong handling of braces on scalar init.
2599 * decl.c (reshape_init_r): Allow braces around scalar initializer
2600 within aggregate init. Reject double braced-init of scalar
2601 variable.
2602
2603 2019-02-20 Paolo Carlini <paolo.carlini@oracle.com>
2604
2605 PR c++/84536
2606 * pt.c (tsubst_init): Diagnose an initializer expanding to an
2607 empty list of expressions; tweak wrt dependent types.
2608 (regenerate_decl_from_template): For VAR_DECLs call tsubst_init
2609 instead of tsubst_expr.
2610
2611 2019-02-19 Jason Merrill <jason@redhat.com>
2612
2613 PR c++/88368 - wrong 'use of deleted function'
2614 * method.c (walk_field_subobs): Remember errors from get_nsdmi.
2615 (get_defaulted_eh_spec): Call push_tinst_level.
2616 * pt.c (maybe_instantiate_noexcept): Keep error_mark_node.
2617 * typeck2.c (merge_exception_specifiers): Handle error_mark_node.
2618
2619 2019-02-19 Chung-Lin Tang <cltang@codesourcery.com>
2620
2621 PR c/87924
2622 * parser.c (cp_parser_oacc_clause_wait): Add representation of wait
2623 clause without argument as 'wait (GOMP_ASYNC_NOVAL)', adjust comments.
2624
2625 2019-02-19 Jakub Jelinek <jakub@redhat.com>
2626
2627 PR c++/89387
2628 * lambda.c (maybe_generic_this_capture): Don't check
2629 DECL_NONSTATIC_MEMBER_FUNCTION_P on USING_DECLs.
2630
2631 PR c++/89391
2632 * typeck.c (build_reinterpret_cast_1): Don't handle void to
2633 && conversion go through build_target_expr_with_type.
2634
2635 PR c++/89390
2636 * error.c (qualified_name_lookup_error): Only call
2637 suggest_alternative_in_scoped_enum if name is IDENTIFIER_NODE.
2638
2639 2019-02-19 Tom Honermann <tom@honermann.net>
2640
2641 * name-lookup.c (get_std_name_hint): Added u8string as a name hint.
2642
2643 2019-02-18 Jason Merrill <jason@redhat.com>
2644
2645 PR c++/89336 - multiple stores in constexpr stmt.
2646 * constexpr.c (cxx_eval_store_expression): Preevaluate scalar or
2647 assigned value.
2648
2649 * pt.c (check_explicit_specialization): If the declarator is a
2650 template-id, only check whether the arguments are dependent.
2651
2652 Improve duplicate [[likely]] diagnostic.
2653 * parser.c (cp_parser_statement): Make attrs_loc a range. Pass it
2654 to process_stmt_hotness_attribute.
2655 * cp-gimplify.c (process_stmt_hotness_attribute): Take attrs_loc.
2656 (genericize_if_stmt): Use likely/unlikely instead of predictor_name.
2657
2658 2019-02-17 Marek Polacek <polacek@redhat.com>
2659
2660 PR c++/89217 - ICE with list-initialization in range-based for loop.
2661 * constexpr.c (unshare_constructor): No longer static.
2662 * cp-tree.h (unshare_constructor): Declare.
2663 * semantics.c (finish_compound_literal): When dealing with a
2664 non-dependent expression in a template, return the original
2665 expression. Pass LOOKUP_NO_NARROWING to digest_init_flags.
2666
2667 2019-02-13 Marek Polacek <polacek@redhat.com>
2668
2669 PR c++/89297 - ICE with OVERLOAD in template.
2670 * semantics.c (finish_compound_literal): Call
2671 instantiate_non_dependent_expr_sfinae.
2672
2673 2019-02-13 Alexandre Oliva <aoliva@redhat.com>
2674
2675 PR c++/86379
2676 * cp-tree.h (USING_DECL_SCOPE): Use result rather than type.
2677 * name-lookup.c (strip_using_decl): Use USING_DECL_SCOPE.
2678 * search.c (protected_accessible_p): Follow USING_DECL_DECLS.
2679 (shared_member_p): Likewise.
2680 (lookup_member): Likewise.
2681 * decl.c (grok_special_member_properties): Skip USING_DECLs.
2682 * semantics.c (finish_omp_declare_simd_methods): Likewise.
2683 (finish_qualified_id_expr): Do not call shared_member_p with
2684 a dependent expr.
2685
2686 PR c++/87322
2687 * pt.c (tsubst_lambda_expr): Avoid duplicate tsubsting.
2688 Move cp_evaluated resetting before signature tsubsting.
2689 (gen_elem_of_pack_expansion_instantiation): Separate local
2690 specializations per index.
2691
2692 2019-02-13 David Malcolm <dmalcolm@redhat.com>
2693
2694 PR c++/89036
2695 * class.c (add_method): Drop destructor assertion.
2696
2697 2019-02-13 Paolo Carlini <paolo.carlini@oracle.com>
2698
2699 PR c++/88986
2700 * decl.c (make_typename_type): Allow for TYPE_PACK_EXPANSION as
2701 context (the first argument).
2702 * pt.c (tsubst, case TYPENAME_TYPE): Handle TYPE_PACK_EXPANSION
2703 as context.
2704
2705 2019-02-12 Jason Merrill <jason@redhat.com>
2706
2707 PR c++/89144 - link error with constexpr initializer_list.
2708 * call.c (convert_like_real) [ck_list]: Don't allocate a temporary
2709 array for an empty list.
2710 * typeck2.c (store_init_value): Don't use cxx_constant_init in a
2711 template.
2712
2713 2019-02-11 Jason Merrill <jason@redhat.com>
2714
2715 PR c++/89241 - ICE with __func__ in lambda in template.
2716 * pt.c (enclosing_instantiation_of): Also check
2717 instantiated_lambda_fn_p for the template context.
2718
2719 2019-02-11 Marek Polacek <polacek@redhat.com>
2720
2721 PR c++/89212 - ICE converting nullptr to pointer-to-member-function.
2722 * pt.c (tsubst_copy_and_build) <case CONSTRUCTOR>: Return early for
2723 null member pointer value.
2724
2725 2019-02-11 Jakub Jelinek <jakub@redhat.com>
2726
2727 PR c++/88977
2728 * pt.c (convert_nontype_argument): Pass true as manifestly_const_eval
2729 to maybe_constant_value calls.
2730
2731 2019-02-11 Marek Polacek <polacek@redhat.com>
2732
2733 * typeck2.c (digest_init_r): Remove commented code.
2734
2735 2019-02-11 Martin Sebor <msebor@redhat.com>
2736
2737 PR c++/87996
2738 * decl.c (compute_array_index_type_loc): Preserve signed sizes
2739 for diagnostics. Call valid_array_size_p instead of error.
2740 * init.c (build_new_1): Compute size for diagnostic. Call
2741 invalid_array_size_error
2742 (build_new): Call valid_array_size_p instead of error.
2743
2744 2019-02-07 Alexandre Oliva <aoliva@redhat.com>
2745
2746 PR c++/86218
2747 * call.c (compare_ics): Deal with ck_aggr in either cs.
2748
2749 2019-02-06 David Malcolm <dmalcolm@redhat.com>
2750
2751 PR c++/71302
2752 * call.c (get_location_for_expr_unwinding_for_system_header): New
2753 function.
2754 (conversion_null_warnings): Use it when getting locations for
2755 EXPR, effectively adding a call to
2756 get_location_for_expr_unwinding_for_system_header for
2757 -Wconversion-null and making use of EXPR_LOCATION for
2758 -Wzero-as-null-pointer-constant.
2759
2760 2019-02-05 Jakub Jelinek <jakub@redhat.com>
2761
2762 PR c++/89187
2763 * optimize.c (maybe_thunk_body): Clear TREE_ADDRESSABLE on
2764 PARM_DECLs of the thunk.
2765 * lambda.c (maybe_add_lambda_conv_op): Likewise.
2766
2767 2019-02-05 Marek Polacek <polacek@redhat.com>
2768
2769 PR c++/89158 - by-value capture of constexpr variable broken.
2770 * call.c (convert_like_real) <case ck_user>: Call mark_exp_read
2771 instead of mark_rvalue_use.
2772
2773 2019-02-05 Alexandre Oliva <aoliva@redhat.com>
2774
2775 PR c++/87770
2776 * pt.c (instantiates_primary_template_p): New.
2777 (type_dependent_expression_p): Use it.
2778
2779 2019-02-01 Jason Merrill <jason@redhat.com>
2780
2781 PR c++/88761 - ICE with reference capture of constant.
2782 * lambda.c (mark_const_cap_r): Do walk subtrees of DECL_EXPR for
2783 non-proxy decls.
2784
2785 2019-02-01 Marek Polacek <polacek@redhat.com>
2786
2787 PR c++/88325 - ICE with invalid out-of-line template member definition.
2788 * parser.c (cp_parser_class_name): Don't call make_typename_type
2789 for overloads.
2790
2791 2019-02-01 Jakub Jelinek <jakub@redhat.com>
2792
2793 PR c++/87175
2794 * parser.c (cp_parser_gnu_attributes_opt): Set ok to false
2795 if require_open failed.
2796
2797 2019-01-31 Marek Polacek <polacek@redhat.com>
2798
2799 PR c++/89083, c++/80864 - ICE with list initialization in template.
2800 * constexpr.c (adjust_temp_type): Use copy_node and change the type
2801 instead of using build_constructor.
2802 * decl.c (reshape_init_r): Don't reshape a digested initializer.
2803 Return the initializer for COMPOUND_LITERAL_P.
2804
2805 PR c++/88983 - ICE with switch in constexpr function.
2806 * constexpr.c (cxx_eval_switch_expr): Use SWITCH_COND and SWITCH_BODY.
2807 (cxx_eval_constant_expression) <case COND_EXPR>: Don't look for the
2808 label in the else branch if we found it in the then branch.
2809
2810 2019-01-30 Jason Merrill <jason@redhat.com>
2811
2812 PR c++/88752 - ICE with lambda and constexpr if.
2813 * cp-tree.h (LAMBDA_EXPR_INSTANTIATED): New.
2814 * pt.c (tsubst_lambda_expr): Set it.
2815 (instantiated_lambda_fn_p): Check it.
2816 (enclosing_instantiation_of): Use it.
2817
2818 2019-01-31 Jakub Jelinek <jakub@redhat.com>
2819
2820 PR libstdc++/88170
2821 * cxx-pretty-print.c (pp_cxx_enumeration_constant): Print always as
2822 a C cast in pp_c_flag_gnu_v3 mode.
2823
2824 2019-01-30 Jakub Jelinek <jakub@redhat.com>
2825
2826 PR c++/88988
2827 * lambda.c (is_capture_proxy): Don't return true for
2828 DECL_OMP_PRIVATIZED_MEMBER artificial vars.
2829
2830 2019-01-30 Marek Polacek <polacek@redhat.com>
2831
2832 PR c++/89119 - ICE with value-initialization in template.
2833 * pt.c (tsubst_copy_and_build): Handle RANGE_EXPR.
2834
2835 2019-01-29 Jason Merrill <jason@redhat.com>
2836
2837 PR c++/86943 - wrong code converting lambda to function pointer.
2838 * lambda.c (maybe_add_lambda_conv_op): Use a template-id in the
2839 call. Only forward parms for decltype.
2840 * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Handle CALL_FROM_THUNK_P
2841 specially.
2842 * typeck.c (check_return_expr): Don't mess with a thunk call.
2843
2844 2019-01-28 Jason Merrill <jason@redhat.com>
2845
2846 PR c++/89089 - ICE with [[no_unique_address]].
2847 PR c++/88865 - wrong layout with [[no_unique_address]].
2848 * class.c (check_field_decls): A potentially-overlapping field makes
2849 the class non-layout-POD, but not non-empty.
2850 (end_of_class): Always consider empty data members.
2851 (layout_class_type): Set DECL_SIZE for empty fields.
2852
2853 2019-01-28 Marek Polacek <polacek@redhat.com>
2854
2855 PR c++/88358 - name wrongly treated as type.
2856 * parser.c (cp_parser_direct_declarator): Don't assume a qualified-id
2857 in parameter-list is a type if the function's declarator-id is not
2858 qualified.
2859
2860 2019-01-27 Marek Polacek <polacek@redhat.com>
2861
2862 PR c++/88815 - narrowing conversion lost in decltype.
2863 PR c++/78244 - narrowing conversion in template not detected.
2864 * cp-tree.h (CONSTRUCTOR_IS_DEPENDENT): New.
2865 * pt.c (instantiation_dependent_r): Consider a CONSTRUCTOR with
2866 CONSTRUCTOR_IS_DEPENDENT instantiation-dependent.
2867 * semantics.c (finish_compound_literal): When the compound literal
2868 isn't instantiation-dependent and the type isn't type-dependent,
2869 fall back to the normal processing. Set CONSTRUCTOR_IS_DEPENDENT.
2870
2871 PR c++/89024 - ICE with incomplete enum type.
2872 * call.c (standard_conversion): When converting an
2873 ARITHMETIC_TYPE_P to an incomplete type, return NULL.
2874
2875 2019-01-25 Paolo Carlini <paolo.carlini@oracle.com>
2876
2877 PR c++/88969
2878 * call.c (build_op_delete_call): Implement 7.6.2.5/(10.1).
2879 * decl2.c (coerce_delete_type): Use build_pointer_type instead
2880 of TYPE_POINTER_TO.
2881
2882 2019-01-24 Jason Merrill <jason@redhat.com>
2883
2884 PR c++/89001 - mangling of reference temporaries
2885 * cp-tree.h (struct saved_scope): Add ref_temp_count.
2886 (current_ref_temp_count): New macro.
2887 * mangle.c (mangle_ref_init_variable): Use it.
2888 * typeck2.c (store_init_value): Clear it.
2889 * call.c (make_temporary_var_for_ref_to_temp): Copy public and
2890 comdat.
2891
2892 2019-01-24 Jakub Jelinek <jakub@redhat.com>
2893
2894 PR c++/88976
2895 * semantics.c (finish_omp_cancel): Diagnose more than one if
2896 on #pragma omp cancel with different modifiers. Use
2897 maybe_convert_cond when not in template or build_x_binary_op
2898 otherwise.
2899
2900 2019-01-23 Marek Polacek <polacek@redhat.com>
2901
2902 PR c++/88757 - qualified name treated wrongly as type.
2903 * parser.c (cp_parser_direct_declarator): Don't treat qualified-ids
2904 in parameter-list as types if name lookup for declarator-id didn't
2905 find one or more function templates.
2906
2907 2019-01-23 Jakub Jelinek <jakub@redhat.com>
2908
2909 PR c/44715
2910 * cp-gimplify.c (genericize_cp_loop): Call begin_bc_block only
2911 after genericizing cond and incr expressions.
2912
2913 PR c++/88984
2914 * cp-gimplify.c (genericize_switch_stmt): Move cond genericization
2915 before the begin_bc_block call.
2916
2917 2019-01-21 Jason Merrill <jason@redhat.com>
2918
2919 PR c++/87893 - constexpr ctor ICE on ARM.
2920 PR c++/88293 - ICE with comma expression.
2921 * constexpr.c (initialized_type): Don't shortcut non-void type.
2922 Handle COMPOUND_EXPR.
2923 (cxx_eval_outermost_constant_expr): Return early for void type.
2924
2925 2019-01-21 Jakub Jelinek <jakub@redhat.com>
2926
2927 PR c++/88949
2928 * optimize.c (cxx_copy_decl): New function.
2929 (clone_body): Use it instead of copy_decl_no_change.
2930
2931 PR sanitizer/88901
2932 * typeck.c (cp_build_binary_op): Don't instrument
2933 SANITIZE_POINTER_COMPARE if processing_template_decl.
2934 (pointer_diff): Similarly for SANITIZE_POINTER_SUBTRACT.
2935
2936 2019-01-18 Jason Merrill <jason@redhat.com>
2937
2938 PR c++/88875 - error with explicit list constructor.
2939 * call.c (reference_binding): Don't modify EXPR. Set
2940 need_temporary_p on the ck_user conversion for a temporary.
2941 (convert_like_real): Check it.
2942
2943 2019-01-18 H.J. Lu <hongjiu.lu@intel.com>
2944
2945 PR c/51628
2946 PR c/88664
2947 * call.c (convert_for_arg_passing): Upate the
2948 warn_for_address_or_pointer_of_packed_member call.
2949 * typeck.c (convert_for_assignment): Likewise.
2950
2951 2019-01-17 Jason Merrill <jason@redhat.com>
2952
2953 PR c++/86205 - ICE with ?: of throw and template-id.
2954 * pt.c (resolve_nondeduced_context_or_error): Split out from...
2955 * typeck.c (decay_conversion): ...here.
2956 * call.c (build_conditional_expr_1): Use it.
2957
2958 PR c++/86740, ICE with constexpr if and nested generic lambdas.
2959 * tree.c (cp_walk_subtrees): Handle LAMBDA_EXPR.
2960
2961 2019-01-17 Paolo Carlini <paolo.carlini@oracle.com>
2962
2963 * decl.c (grokdeclarator): Use typespec_loc in error messages
2964 about 'auto' and trailing return type.
2965
2966 2019-01-17 David Malcolm <dmalcolm@redhat.com>
2967
2968 PR c++/88699
2969 * class.c (add_method): Don't use DECL_DESTRUCTOR_P on
2970 USING_DECLs.
2971
2972 2019-01-17 Nathan Sidwell <nathan@acm.org>
2973
2974 PR c++/86610
2975 * semantics.c (process_outer_var_ref): Only skip dependent types
2976 in templates.
2977
2978 2019-01-17 Alexandre Oliva <aoliva@redhat.com>
2979
2980 PR c++/87768
2981 * cp-tree.h (saved_scope): Add suppress_location_wrappers.
2982 * name-lookup.c (do_push_to_top_level): Save and reset it.
2983 (do_pop_from_top_level): Restore it.
2984
2985 PR c++/86648
2986 * pt.c (make_template_placeholder): Use auto_identifier.
2987 (is_auto): Drop CLASS_PLACEHOLDER_TEMPLATE test.
2988 * error.c (dump_type): Handle template placeholders.
2989 * cxx-pretty-print.c (pp_cx_unqualified_id): Likewise.
2990
2991 PR c++/88146
2992 * cvt.c (convert_to_void): Handle all cdtor calls as if
2993 returning void.
2994
2995 2019-01-16 Paolo Carlini <paolo.carlini@oracle.com>
2996
2997 * decl.c (grokdeclarator): Use locations[ds_storage_class] in
2998 error messages about ill-formed uses of mutable.
2999
3000 2019-01-16 Marek Polacek <polacek@redhat.com>
3001
3002 PR c++/78244 - narrowing conversion in template not detected.
3003 * call.c (perform_implicit_conversion_flags): Set
3004 IMPLICIT_CONV_EXPR_BRACED_INIT.
3005 * cp-tree.h (IMPLICIT_CONV_EXPR_BRACED_INIT): New.
3006 * pt.c (tsubst_copy_and_build): Use it.
3007
3008 2019-01-15 David Malcolm <dmalcolm@redhat.com>
3009
3010 PR c++/88795
3011 * pt.c (build_deduction_guide): Bail out if tsubst_arg_types
3012 fails.
3013
3014 2019-01-15 Paolo Carlini <paolo.carlini@oracle.com>
3015
3016 * decl.c (start_decl): Improve error location.
3017 * decl2.c (grokfield): Likewise.
3018
3019 2019-01-15 Paolo Carlini <paolo.carlini@oracle.com>
3020
3021 * decl.c (grokdeclarator): Move further up the location_t loc
3022 declaration and use the location when building a TYPE_DECL for
3023 a typedef name.
3024 * decl2.c (grokbitfield): Use DECL_SOURCE_LOCATION in the error
3025 about an ill-formed bit-field as typedef.
3026
3027 2019-01-14 Marek Polacek <polacek@redhat.com>
3028
3029 PR c++/88830 - ICE with abstract class.
3030 * decl2.c (maybe_emit_vtables): Check CLASSTYPE_LAZY_DESTRUCTOR.
3031 Fix formatting.
3032
3033 PR c++/88825 - ICE with bogus function return type deduction.
3034 * typeck.c (can_do_nrvo_p): Check error_mark_node.
3035
3036 2019-01-14 Tom Honermann <tom@honermann.net>
3037
3038 Implement P0482R5, char8_t: A type for UTF-8 characters and strings
3039 * cvt.c (type_promotes_to): Handle char8_t promotion.
3040 * decl.c (grokdeclarator): Handle invalid type specifier
3041 combinations involving char8_t.
3042 * lex.c (init_reswords): Add char8_t as a reserved word.
3043 * mangle.c (write_builtin_type): Add name mangling for char8_t (Du).
3044 * parser.c (cp_keyword_starts_decl_specifier_p)
3045 (cp_parser_simple_type_specifier): Recognize char8_t as a simple
3046 type specifier.
3047 (cp_parser_string_literal): Use char8_array_type_node for the type
3048 of CPP_UTF8STRING.
3049 (cp_parser_set_decl_spec_type): Tolerate char8_t typedefs in system
3050 headers.
3051 * rtti.c (emit_support_tinfos): type_info support for char8_t.
3052 * tree.c (char_type_p): Recognize char8_t as a character type.
3053 * typeck.c (string_conv_p): Handle conversions of u8 string
3054 literals of char8_t type.
3055 (check_literal_operator_args): Handle UDLs with u8 string literals
3056 of char8_t type.
3057 * typeck2.c (ordinary_char_type_p): New.
3058 (digest_init_r): Disallow initializing a char array with a u8 string
3059 literal.
3060
3061 2019-01-14 Martin Liska <mliska@suse.cz>
3062
3063 PR gcov-profile/88263
3064 * decl2.c (get_tls_wrapper_fn): Use DECL_SOURCE_LOCATION
3065 as location of the TLS wrapper.
3066
3067 2019-01-12 Paolo Carlini <paolo.carlini@oracle.com>
3068
3069 * decl.c (cp_finish_decl): Improve error location.
3070 * decl2.c (grokfield): Likewise, improve two locations.
3071
3072 2019-01-11 Marek Polacek <polacek@redhat.com>
3073
3074 PR c++/88692, c++/87882 - -Wredundant-move false positive with *this.
3075 * typeck.c (maybe_warn_pessimizing_move): Return if ARG isn't
3076 ADDR_EXPR.
3077
3078 2019-01-11 Jason Merrill <jason@redhat.com>
3079
3080 PR c++/88312 - pack expansion of decltype.
3081 * pt.c (instantiation_dependent_r): A template non-type parameter
3082 pack is instantiation-dependent.
3083
3084 2019-01-11 Jason Merrill <jason@redhat.com>
3085
3086 PR c++/88613 - ICE with use of const var in lambda.
3087 * expr.c (mark_use): Fix location wrapper handling.
3088 * cp-gimplify.c (cp_fold_maybe_rvalue): Call mark_rvalue_use.
3089
3090 2019-01-11 Tobias Burnus <burnus@net-b.de>
3091
3092 PR C++/88114
3093 * decl2.c (maybe_emit_vtables): If needed, generate code for
3094 the destructor of an abstract class.
3095 (mark_used): Update comment for older function-name change.
3096
3097 2019-01-11 Paolo Carlini <paolo.carlini@oracle.com>
3098
3099 * decl.c (start_decl): Improve error location.
3100 (grokdeclarator): Likewise, improve two locations.
3101
3102 2019-01-09 Sandra Loosemore <sandra@codesourcery.com>
3103
3104 PR other/16615
3105
3106 * cp-tree.h: Mechanically replace "can not" with "cannot".
3107 * parser.c: Likewise.
3108 * pt.c: Likewise.
3109
3110 2019-01-08 Paolo Carlini <paolo.carlini@oracle.com>
3111
3112 * decl.c (grok_reference_init): Improve error location.
3113 (grokdeclarator): Likewise, improve two locations.
3114
3115 2019-01-08 Marek Polacek <polacek@redhat.com>
3116
3117 PR c++/88538 - braced-init-list in template-argument-list.
3118 * parser.c (cp_parser_template_argument): Handle braced-init-list when
3119 in C++20.
3120
3121 PR c++/88548 - this accepted in static member functions.
3122 * parser.c (cp_debug_parser): Adjust printing of
3123 local_variables_forbidden_p.
3124 (cp_parser_new): Set local_variables_forbidden_p to 0 rather than false.
3125 (cp_parser_primary_expression): When checking
3126 local_variables_forbidden_p, use THIS_FORBIDDEN or
3127 LOCAL_VARS_FORBIDDEN.
3128 (cp_parser_lambda_body): Update the type of
3129 local_variables_forbidden_p. Set it to 0 rather than false.
3130 (cp_parser_condition): Adjust call to cp_parser_declarator.
3131 (cp_parser_explicit_instantiation): Likewise.
3132 (cp_parser_init_declarator): Likewise.
3133 (cp_parser_declarator): New parameter. Use it.
3134 (cp_parser_direct_declarator): New parameter. Use it to set
3135 local_variables_forbidden_p. Adjust call to cp_parser_declarator.
3136 (cp_parser_type_id_1): Adjust call to cp_parser_declarator.
3137 (cp_parser_parameter_declaration): Likewise.
3138 (cp_parser_default_argument): Update the type of
3139 local_variables_forbidden_p. Set it to LOCAL_VARS_AND_THIS_FORBIDDEN
3140 rather than true.
3141 (cp_parser_member_declaration): Tell cp_parser_declarator if we saw
3142 'static' or 'friend'.
3143 (cp_parser_exception_declaration): Adjust call to cp_parser_declarator.
3144 (cp_parser_late_parsing_default_args): Update the type of
3145 local_variables_forbidden_p. Set it to LOCAL_VARS_AND_THIS_FORBIDDEN
3146 rather than true.
3147 (cp_parser_cache_defarg): Adjust call to cp_parser_declarator.
3148 (cp_parser_objc_class_ivars): Likewise.
3149 (cp_parser_objc_struct_declaration): Likewise.
3150 (cp_parser_omp_for_loop_init): Likewise.
3151 * parser.h (cp_parser): Change the type of local_variables_forbidden_p
3152 to unsigned char.
3153 (LOCAL_VARS_FORBIDDEN, LOCAL_VARS_AND_THIS_FORBIDDEN, THIS_FORBIDDEN):
3154 Define.
3155
3156 2019-01-08 Paolo Carlini <paolo.carlini@oracle.com>
3157
3158 * decl.c (start_decl): Improve permerror location.
3159
3160 2019-01-08 Jonathan Wakely <jwakely@redhat.com>
3161 Jakub Jelinek <jakub@redhat.com>
3162
3163 PR c++/88554
3164 * decl.c (finish_function): For -Wreturn-type don't add a return *this;
3165 fixit hint if current_class_ref is NULL. Use a single if instead of
3166 two nested ones.
3167
3168 2019-01-07 Paolo Carlini <paolo.carlini@oracle.com>
3169
3170 * decl.c (start_decl): Improve two error_at locations.
3171 (expand_static_init): Likewise.
3172
3173 2019-01-07 Marek Polacek <polacek@redhat.com>
3174
3175 PR c++/88741 - wrong error with initializer-string.
3176 * decl.c (cp_complete_array_type): Strip any location wrappers.
3177
3178 2019-01-07 Bernd Edlinger <bernd.edlinger@hotmail.de>
3179
3180 PR c++/88261
3181 PR c++/69338
3182 PR c++/69696
3183 PR c++/69697
3184 * cp-tree.h (LOOKUP_ALLOW_FLEXARRAY_INIT): New flag value.
3185 * typeck2.c (digest_init_r): Raise an error for non-static
3186 initialization of a flexible array member.
3187 (process_init_constructor, massage_init_elt,
3188 process_init_constructor_array, process_init_constructor_record,
3189 process_init_constructor_union, process_init_constructor): Add the
3190 flags parameter and pass it thru.
3191 (store_init_value): Pass LOOKUP_ALLOW_FLEXARRAY_INIT parameter to
3192 digest_init_flags for static decls.
3193
3194 2019-01-07 Jakub Jelinek <jakub@redhat.com>
3195
3196 PR c++/85052
3197 * cp-tree.h (cp_build_vec_convert): Declare.
3198 * parser.c (cp_parser_postfix_expression): Parse
3199 __builtin_convertvector.
3200 * constexpr.c: Include fold-const-call.h.
3201 (cxx_eval_internal_function): Handle IFN_VEC_CONVERT.
3202 (potential_constant_expression_1): Likewise.
3203 * semantics.c (cp_build_vec_convert): New function.
3204 * pt.c (tsubst_copy_and_build): Handle CALL_EXPR to
3205 IFN_VEC_CONVERT.
3206
3207 2019-01-03 Jakub Jelinek <jakub@redhat.com>
3208
3209 PR c++/88636
3210 * decl.c (builtin_function_1): Return result of pushdecl_top_level
3211 or pushdecl rather than decl.
3212
3213 2019-01-03 Paolo Carlini <paolo.carlini@oracle.com>
3214
3215 * tree.c (handle_nodiscard_attribute): Improve warning location.
3216
3217 2019-01-02 Marek Polacek <polacek@redhat.com>
3218
3219 PR c++/88612 - ICE with -Waddress-of-packed-member.
3220 * call.c (convert_for_arg_passing): Only give warnings with tf_warning.
3221 * typeck.c (convert_for_assignment): Likewise.
3222
3223 PR c++/88631 - CTAD failing for value-initialization.
3224 * typeck2.c (build_functional_cast): Try deducing the template
3225 arguments even if there are no arguments to deduce from.
3226
3227 2019-01-01 Jakub Jelinek <jakub@redhat.com>
3228
3229 Update copyright years.
3230 \f
3231 Copyright (C) 2019 Free Software Foundation, Inc.
3232
3233 Copying and distribution of this file, with or without modification,
3234 are permitted in any medium without royalty provided the copyright
3235 notice and this notice are preserved.