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