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