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