PR c++/64235 - missing syntax error with invalid alignas.
[gcc.git] / gcc / cp / ChangeLog
1 2019-06-21 Marek Polacek <polacek@redhat.com>
2
3 PR c++/64235 - missing syntax error with invalid alignas.
4 * parser.c (cp_parser_std_attribute_spec): Commit to tentative parse
5 if there's a missing close paren.
6
7 PR c++/90490 - fix decltype issues in noexcept-specifier.
8 * except.c (build_noexcept_spec): Call
9 instantiate_non_dependent_expr_sfinae before
10 build_converted_constant_expr instead of calling
11 instantiate_non_dependent_expr after it. Add
12 processing_template_decl_sentinel.
13
14 2019-06-21 Jakub Jelinek <jakub@redhat.com>
15
16 PR c++/90950
17 * semantics.c (finish_omp_clauses): Don't reject references to
18 incomplete types if processing_template_decl.
19
20 2019-06-19 Marek Polacek <polacek@redhat.com>
21
22 PR c++/60364 - noreturn after first decl not diagnosed.
23 * decl.c (duplicate_decls): Give an error when a function is
24 declared [[noreturn]] after its first declaration.
25 * parser.c (cp_parser_std_attribute): Don't treat C++11 noreturn
26 attribute as equivalent to GNU's.
27 * tree.c (std_attribute_table): Add noreturn.
28
29 2019-06-19 Jakub Jelinek <jakub@redhat.com>
30
31 * cp-gimplify.c (cp_genericize_r): Handle OMP_CLAUSE_{IN,EX}CLUSIVE
32 like OMP_CLAUSE_SHARED.
33
34 2019-06-18 Jason Merrill <jason@redhat.com>
35
36 * constexpr.c (cxx_eval_store_expression): Delay target evaluation.
37
38 2019-06-18 Jason Merrill <jason@redhat.com>
39
40 * constexpr.c (eval_and_check_array_index): Split out from...
41 (cxx_eval_array_reference): ...here.
42 (cxx_eval_store_expression): Use it here, too.
43 (diag_array_subscript): Take location. Strip location wrapper.
44
45 2019-06-18 Jason Merrill <jason@redhat.com>
46
47 * constexpr.c (cxx_eval_constant_expression): Handle conversion from
48 and then to the same type.
49
50 2019-06-18 Jason Merrill <jason@redhat.com>
51
52 * constexpr.c (unshare_constructor): Add MEM_STAT_DECL.
53
54 2019-06-17 Jakub Jelinek <jakub@redhat.com>
55
56 * semantics.c (finish_omp_clauses): For OMP_CLAUSE_REDUCTION_INSCAN
57 set need_copy_assignment.
58
59 2019-06-17 Marek Polacek <polacek@redhat.com>
60
61 PR c++/83820 - excessive attribute arguments not detected.
62 * parser.c (cp_parser_std_attribute): Detect excessive arguments.
63
64 2019-06-17 Nathan Sidwell <nathan@acm.org>
65
66 PR c++/90754
67 * name-lookup.c (lookup_type_scope_1): Calll qualify_lookup before
68 checking context.
69
70 2019-06-14 Marek Polacek <polacek@redhat.com>
71
72 PR c++/90884 - stray note with -Wctor-dtor-privacy.
73 * class.c (maybe_warn_about_overly_private_class): Guard the call to
74 inform.
75
76 2019-06-12 Jason Merrill <jason@redhat.com>
77
78 PR c++/85552 - wrong instantiation of dtor for DMI.
79 * typeck2.c (digest_nsdmi_init): Set tf_no_cleanup for direct-init.
80
81 2019-06-13 Paolo Carlini <paolo.carlini@oracle.com>
82
83 * decl.c (grokdeclarator): Use id_loc in five additional places
84 in the last part of the function.
85
86 2019-06-13 Paolo Carlini <paolo.carlini@oracle.com>
87
88 * decl.c (grokdeclarator): Move further up the declaration of
89 id_loc, use it immediately, update its value after the loop
90 over declarator, use it again in the final part of function;
91 improve locations of error messages about multiple data types
92 and conflicting specifiers.
93
94 2019-06-13 Richard Biener <rguenther@suse.de>
95
96 PR c++/90801
97 * typeck2.c (split_nonconstant_init_1): Properly count
98 num_split_elts, optimize single constructor elt removal.
99
100 2019-06-12 Marek Polacek <polacek@redhat.com>
101
102 PR c++/66999 - 'this' captured by reference.
103 * parser.c (cp_parser_lambda_introducer): Reject `&this'. Use
104 cp_lexer_nth_token_is instead of cp_lexer_peek_nth_token.
105
106 PR c++/90825 - endless recursion when evaluating sizeof.
107 PR c++/90832 - endless recursion when evaluating sizeof.
108 * constexpr.c (cxx_eval_constant_expression): Don't recurse on the
109 result of fold_sizeof_expr if is returns a SIZEOF_EXPR.
110 * typeck.c (cxx_sizeof_expr): Only return a SIZEOF_EXPR if the operand
111 is instantiation-dependent.
112
113 PR c++/90736 - bogus error with alignof.
114 * constexpr.c (adjust_temp_type): Use cv_unqualified type.
115
116 2019-06-11 Matthew Beliveau <mbelivea@redhat.com>
117
118 PR c++/90449 - add -Winaccessible-base option.
119 * class.c (warn_about_ambiguous_bases): Changed name to:
120 maybe_warn_about_inaccessible_bases.
121 (maybe_warn_about_inaccessible_bases): Implemented new
122 Winaccessible-base warning option for both direct and virtual
123 base warnings.
124 (layout_class_type): Call to warn_about_ambiguous_bases changed to fit
125 new name.
126
127 2019-06-11 Richard Biener <rguenther@suse.de>
128
129 PR c++/90801
130 * typeck2.c (split_nonconstant_init_1): Avoid ordered remove
131 from CONSTRUCTOR by marking to remove elements and doing all
132 of them in a O(n) scan.
133
134 2019-06-11 Jakub Jelinek <jakub@redhat.com>
135
136 PR c++/90810
137 * init.c (constant_value_1): Handle VECTOR_CST DECL_INITIAL for
138 !DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P decls like CONSTRUCTOR.
139
140 2019-06-11 Martin Liska <mliska@suse.cz>
141
142 PR c++/87847
143 * pt.c (init_template_processing): Disable hash table
144 sanitization for decl_specializations and type_specializations.
145
146 2019-06-10 Jason Merrill <jason@redhat.com>
147
148 * constexpr.c (free_constructor): New.
149 (cxx_eval_call_expression): Free parameter value CONSTRUCTORs.
150
151 * constexpr.c (unshare_constructor): Only unshare if T is itself a
152 CONSTRUCTOR.
153 (cxx_eval_call_expression): Don't call it on the result here.
154
155 Reduce constexpr_call memory consumption.
156 * constexpr.c (cxx_bind_parameters_in_call): Use TREE_VEC rather
157 than TREE_LIST.
158 (constexpr_call_hasher::equal, cxx_bind_parameters_in_call)
159 (cxx_eval_call_expression): Adjust.
160
161 2019-06-10 Jakub Jelinek <jakub@redhat.com>
162
163 * parser.c (cp_parser_omp_clause_reduction): Don't sorry_at on inscan
164 reductions.
165 (cp_parser_omp_scan_loop_body): New function.
166 (cp_parser_omp_for_loop): Call cp_parser_omp_scan_loop_body if there
167 are inscan reduction clauses.
168 (cp_parser_pragma): Reject PRAGMA_OMP_SCAN.
169 * semantics.c (finish_omp_clauses): Reject mixing inscan with
170 non-inscan reductions on the same construct, or inscan reductions with
171 ordered or schedule clauses, or inscan array reductions.
172 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_{IN,EX}CLUSIVE.
173 (tsubst_expr): Handle OMP_SCAN.
174
175 2019-06-07 Jason Merrill <jason@redhat.com>
176
177 * constexpr.c (cxx_eval_constant_expression): Call
178 STRIP_ANY_LOCATION_WRAPPER early.
179 [CONVERT_EXPR]: Don't build anything for conversion to void.
180 [ADDR_EXPR]: ggc_free unused ADDR_EXPR.
181
182 2019-06-05 Martin Sebor <msebor@redhat.com>
183
184 PR c/90737
185 * typeck.c (maybe_warn_about_returning_address_of_local): Only
186 consider functions returning pointers as candidates for
187 -Wreturn-local-addr.
188
189 2019-06-05 Paolo Carlini <paolo.carlini@oracle.com>
190
191 * decl.c (smallest_type_location): New.
192 (check_special_function_return_type): Use it.
193 (grokdeclarator): Lkewise.
194
195 2019-06-05 Paolo Carlini <paolo.carlini@oracle.com>
196
197 * decl.c (grokdeclarator): Use locations[ds_friend]
198 in one place.
199
200 2019-06-05 Martin Sebor <msebor@redhat.com>
201
202 * call.c (build_conditional_expr_1): Adjust quoting and hyphenation.
203 (convert_like_real): Same.
204 (convert_arg_to_ellipsis): Same.
205 * constexpr.c (diag_array_subscript): Same.
206 * constraint.cc (diagnose_trait_expression): Same.
207 * cvt.c (ocp_convert): Same.
208 * decl.c (start_decl): Same.
209 (check_for_uninitialized_const_var): Same.
210 (grokfndecl): Same.
211 (check_special_function_return_type): Same.
212 (finish_enum_value_list): Same.
213 (start_preparsed_function): Same.
214 * parser.c (cp_parser_decl_specifier_seq): Same.
215 * typeck.c (cp_build_binary_op): Same.
216 (build_static_cast_1): Same.
217
218 2019-06-04 Nina Dinka Ranns <dinka.ranns@gmail.com>
219
220 PR c++/63149 - Wrong auto deduction from braced-init-list.
221 * pt.c (listify_autos): use non cv qualified auto_node in
222 std::initializer_list<auto>.
223
224 2019-06-04 Paolo Carlini <paolo.carlini@oracle.com>
225
226 * decl.c (grokdeclarator): Use declarator->id_loc in two
227 additional places.
228
229 2019-06-04 Nathan Sidwell <nathan@acm.org>
230
231 * name-lookup.c (lookup_type_scope_1): Reimplement, handle local
232 and namespace scopes separately.
233
234 2019-06-04 Harald van Dijk <harald@gigawatt.nl>
235
236 PR c++/60531 - Wrong error about unresolved overloaded function
237 * typeck.c (cp_build_binary_op): See if overload can be resolved.
238 (cp_build_unary_op): Ditto.
239
240 2019-06-04 Jason Merrill <jason@redhat.com>
241
242 Reduce accumulated garbage in constexpr evaluation.
243 * constexpr.c (cxx_eval_call_expression): ggc_free any bindings we
244 don't save.
245 (cxx_eval_increment_expression): ggc_free the MODIFY_EXPR after
246 evaluating it.
247
248 2019-06-04 Jakub Jelinek <jakub@redhat.com>
249
250 * cp-tree.h (CP_OMP_CLAUSE_INFO): Allow for any clauses up to _condvar_
251 instead of only up to linear.
252
253 2019-06-03 Paolo Carlini <paolo.carlini@oracle.com>
254
255 * parser.c (cp_parser_unqualified_id): Use build_min_nt_loc in
256 five places.
257
258 2019-06-01 Ville Voutilainen <ville.voutilainen@gmail.com>
259
260 PR c++/85254
261 * class.c (fixup_type_variants): Handle CLASSTYPE_FINAL.
262
263 2019-05-31 Nathan Sidwell <nathan@acm.org>
264
265 * cp-tree.h (IDENTIFIER_LAMBDA_P): New.
266 (TYPE_ANON_P): New.
267 (LAMBDA_TYPE_P, TYPE_UNNAMED_P): Likewise.
268 (LAMBDANAME_PREFIX, LAMBDANAME_FORMAT): Delete.
269 (make_lambda_name): Don't declare.
270 * error.c (dump_aggr_type): Check for lambdas before other
271 anonymous names.
272 * lambda.c (begin_lambda_type): Use make_anon_name.
273 * cp-lang.c (cxx_dwarf_name): Lambda names smell anonymous.
274 * mangle.c (write_local_name): Likewise.
275 * name-lookup.c (lambda_cnt, make_lambda_name): Delete.
276
277 2019-05-30 Marek Polacek <polacek@redhat.com>
278
279 * cp-tree.h (TYPE_HAS_NONTRIVIAL_DESTRUCTOR): Fix a typo.
280
281 2019-05-31 Paolo Carlini <paolo.carlini@oracle.com>
282
283 * decl.c (grokdeclarator): Use declarator->id_loc in five
284 error_at calls.
285
286 2019-05-29 Jakub Jelinek <jakub@redhat.com>
287
288 PR c++/90598
289 * tree.c (lvalue_kind): Return clk_none for expressions with
290 with VOID_TYPE_P.
291
292 2019-05-29 Paolo Carlini <paolo.carlini@oracle.com>
293
294 PR c++/89875
295 * parser.c (cp_parser_sizeof_operand): When the type-id production
296 did not work out commit to the tentative parse.
297
298 2019-05-29 Jakub Jelinek <jakub@redhat.com>
299
300 P1091R3 - Extending structured bindings to be more like var decls
301 P1381R1 - Reference capture of structured bindings
302 * decl.c (cp_maybe_mangle_decomp): Handle TREE_STATIC decls even at
303 function scope.
304 (cp_finish_decomp): Copy over various decl properties from decl to
305 v[i] in the tuple case.
306 (grokdeclarator): Allow static, thread_local and __thread for C++2a
307 and use pedwarn instead of error for older standard revisions.
308 Make other structured binding diagnostic messages more i18n friendly.
309
310 2019-05-28 Nathan Sidwell <nathan@acm.org>
311
312 * decl.c (duplicate_decls): Assert a template newdecl has no
313 specializations.
314
315 2019-05-28 Marek Polacek <polacek@redhat.com>
316
317 PR c++/90548 - ICE with generic lambda and empty pack.
318 * pt.c (tsubst_copy_and_build): Handle pack expansion properly.
319
320 2019-05-28 Nathan Sidwell <nathan@acm.org>
321
322 * cp-tree.h (make_anon_name): Drop declaration.
323 (TYPE_UNNAMED_P): Use IDENTIFIER_ANON_P.
324 * cp-lang.c (cxx_dwarf_name): Likewise.
325 * class.c (find_flexarrays): Likewise.
326 * decl.c (name_unnamed_type, xref_tag_1): Likewise.
327 * error.c (dump_aggr_type): Likewise.
328 * pt.c (push_template_decl_real): Likewise.
329 * name-lookup.c (consider_binding_level): Likewise.
330 (anon_cnt, make_anon_name): Delete.
331
332 2019-05-25 Marek Polacek <polacek@redhat.com>
333
334 PR c++/90572 - wrong disambiguation in friend declaration.
335 * parser.c (cp_parser_constructor_declarator_p): Don't allow missing
336 typename for friend declarations.
337
338 2019-05-23 Jonathan Wakely <jwakely@redhat.com>
339
340 * cp-tree.h (CP_AGGREGATE_TYPE_P): Fix whitespace.
341
342 * init.c (std_placement_new_fn_p): Remove outdated TODO comment that
343 was resolved by r254694.
344
345 2019-05-22 Jason Merrill <jason@redhat.com>
346
347 PR c++/20408 - unnecessary code for empty struct.
348 * call.c (build_call_a): Use simple_empty_class_p.
349
350 PR c++/86485 - -Wmaybe-unused with empty class ?:
351 * cp-gimplify.c (simple_empty_class_p): Also true for MODIFY_EXPR.
352
353 2019-05-21 Paolo Carlini <paolo.carlini@oracle.com>
354
355 * parser.c (cp_parser_template_declaration_after_parameters): Use
356 DECL_SOURCE_LOCATION in literal operator template errors.
357
358 2019-05-21 Paolo Carlini <paolo.carlini@oracle.com>
359
360 PR c++/67184
361 PR c++/69445
362 * call.c (build_over_call): Devirtualize when the final overrider
363 comes from the base.
364
365 2019-05-21 Nathan Sidwell <nathan@acm.org>
366
367 * name-lookup.c (do_nonmember_using_decl): Drop INSERT_P
368 parameter. Document.
369 (finish_nonmember_using_decl): Adjust do_nonmember_using_decl
370 calls. Remove stray FIXME comment.
371
372 * name-lookup.h (struct cp_binding_level): Drop usings field.
373 (finish_namespace_using_decl, finish_local_using_decl): Replace with ...
374 (finish_nonmember_using_decl): ... this.
375 * name-lookup.c (push_using_decl_1, push_using_decl):
376 (do_nonmember_using_decl): ... here. Add INSERT_P arg. Reimplement.
377 (validate_nonmember_using_decl, finish_namespace_using_decl)
378 (finish_local_using_decl): Replace with ...
379 (finish_nonmember_using_decl): ... this. Drop DECL parm.
380 * parser.c (cp_parser_using_declaration): Don't do lookup here.
381 * pt.c (tsubst_expr): Do not do using decl lookup here.
382
383 2019-05-21 Eric Botcazou <ebotcazou@adacore.com>
384
385 * decl2.c (cpp_check) <IS_ASSIGNMENT_OPERATOR>: New case.
386
387 2019-05-20 Marek Polacek <polacek@redhat.com>
388
389 CWG 2094 - volatile scalars are trivially copyable.
390 PR c++/85679
391 * tree.c (trivially_copyable_p): Don't check CP_TYPE_VOLATILE_P for
392 scalar types.
393
394 2019-05-20 Marek Polacek <polacek@redhat.com>
395
396 * pt.c (convert_template_argument): Add a diagnostic for the
397 [temp.arg]/2 ambiguity case.
398
399 * name-lookup.c (finish_using_directive): Don't issue inform() if the
400 warning didn't trigger. Add quoting. Tweak the inform message.
401
402 2019-05-20 Paolo Carlini <paolo.carlini@oracle.com>
403
404 * cp-tree.h: Remove remnants of CONV_NONCONVERTING.
405
406 2019-05-20 Nathan Sidwell <nathan@acm.org>
407
408 * name-lookup.c (finish_namespace_using_directive)
409 (finish_local_using_directive): Merge to ...
410 (finish_using_directive): ... here. Handle both contexts.
411 * name-lookup.h (finish_namespace_using_directive)
412 (finish_local_using_directive): Replace with ...
413 (finish_using_directive): ... this.
414 * parser.c (cp_parser_using_directive): Adjust.
415 * pt.c (tsubst_expr): Likewise.
416
417 * cp-tree.h (struct lang_decl_ns): Remove usings field.
418 (DECL_NAMESPACE_USING): Delete.
419 * name-lookup.c (name_lookup::search_usings): Use namespace's
420 binding scope.
421 (name_lookup::queue_namespae): Likewise.
422 (finish_namespace_using_directive, push_namespace): Likewise.
423 (has_using_namespace_std_directive): Just search the entire
424 binding stack.
425
426 2019-05-20 Jonathan Wakely <jwakely@redhat.com>
427
428 PR c++/90532 Ensure __is_constructible(T[]) is false
429 * method.c (is_xible_helper): Return error_mark_node for construction
430 of an array of unknown bound.
431
432 2019-05-17 Thomas Schwinge <thomas@codesourcery.com>
433
434 PR c++/89433
435 * parser.c (cp_finalize_oacc_routine): Rework checking if already
436 marked with an OpenACC 'routine' directive.
437
438 PR c++/89433
439 * parser.c (cp_parser_oacc_routine)
440 (cp_parser_late_parsing_oacc_routine): Normalize order of clauses.
441 (cp_finalize_oacc_routine): Call oacc_verify_routine_clauses.
442
443 PR c++/89433
444 * parser.c (cp_finalize_oacc_routine): Refer to OpenACC 'routine'
445 clauses from "omp declare target" attribute.
446
447 2019-05-16 Martin Sebor <msebor@redhat.com>
448
449 * call.c (print_z_candidate): Wrap diagnostic text in a gettext
450 macro. Adjust.
451 (print_z_candidates): Same.
452 (build_conditional_expr_1): Quote keywords, operators, and types
453 in diagnostics.
454 (build_op_delete_call): Same.
455 (maybe_print_user_conv_context): Wrap diagnostic text in a gettext
456 macro.
457 (convert_like_real): Same.
458 (convert_arg_to_ellipsis): Quote keywords, operators, and types
459 in diagnostics.
460 (build_over_call): Same.
461 (joust): Break up an overlong line. Wrap diagnostic text in a gettext
462 macro.
463 * constexpr.c (cxx_eval_check_shift_p): Spell out >= in English.
464 (cxx_eval_constant_expression): Quote keywords, operators, and types
465 in diagnostics.
466 (potential_constant_expression_1): Same.
467 * cp-gimplify.c (cp_genericize_r): Same.
468 * cvt.c (maybe_warn_nodiscard): Quote keywords, operators, and types
469 in diagnostics.
470 (type_promotes_to): Same.
471 * decl.c (check_previous_goto_1): Same.
472 (check_goto): Same.
473 (start_decl): Same.
474 (cp_finish_decl): Avoid parenthesizing a sentence for consistency.
475 (grok_op_properties): Quote keywords, operators, and types
476 in diagnostics.
477 * decl2.c (grokfield): Same.
478 (coerce_delete_type): Same.
479 * except.c (is_admissible_throw_operand_or_catch_parameter): Same.
480 * friend.c (do_friend): Quote C++ tokens.
481 * init.c (build_new_1): Quote keywords, operators, and types
482 in diagnostics.
483 (build_vec_delete_1): Same.
484 (build_delete): Same.
485 * lex.c (parse_strconst_pragma): Same.
486 (handle_pragma_implementation): Same.
487 (unqualified_fn_lookup_error): Same.
488 * mangle.c (write_type): Same.
489 * method.c (defaulted_late_check): Avoid two consecutive punctuators.
490 * name-lookup.c (cp_binding_level_debug): Remove a trailing newline.
491 (pop_everything): Same.
492 * parser.c (cp_lexer_start_debugging): Quote a macro name.
493 in a diagnostic
494 (cp_lexer_stop_debugging): Same.
495 (cp_parser_userdef_numeric_literal): Quote a C++ header name
496 in a diagnostic.
497 (cp_parser_nested_name_specifier_opt): Quote keywords, operators,
498 and types in diagnostics.
499 (cp_parser_question_colon_clause): Same.
500 (cp_parser_asm_definition): Same.
501 (cp_parser_init_declarator): Same.
502 (cp_parser_template_declaration_after_parameters): Avoid capitalizing
503 a sentence in a diagnostic.
504 (cp_parser_omp_declare_reduction): Quote keywords, operators, and types
505 in diagnostics.
506 (cp_parser_transaction): Same.
507 * pt.c (maybe_process_partial_specialization): Replace second call
508 to permerror with inform for consistency with other uses.
509 (expand_integer_pack): Quote keywords, operators, and types
510 in diagnostics.
511 * rtti.c (get_typeid): Quote keywords, operators, and types
512 in diagnostics.
513 (build_dynamic_cast_1): Same.
514 * semantics.c (finish_asm_stmt): Same.
515 (finish_label_decl): Same.
516 (finish_bases): Same.
517 (finish_offsetof): Same.
518 (cp_check_omp_declare_reduction): Same.
519 (finish_decltype_type): Same.
520 * tree.c (handle_init_priority_attribute): Same. Add detail
521 to diagnostics.
522 (maybe_warn_zero_as_null_pointer_constant): Same.
523 * typeck.c (cp_build_binary_op): Quote keywords, operators, and types
524 in diagnostics.
525 (cp_build_unary_op): Same.
526 (check_for_casting_away_constness): Same.
527 (build_static_cast): Same.
528 (build_const_cast_1): Same.
529 (maybe_warn_about_returning_address_of_local): Same.
530 (check_return_expr): Same.
531 * typeck2.c (abstract_virtuals_error_sfinae): Same.
532 (digest_init_r): Replace a tab with spaces in a diagnostic.
533 (build_functional_cast): Quote keywords, operators, and types
534 in diagnostics.
535
536 2019-05-15 Jakub Jelinek <jakub@redhat.com>
537
538 PR debug/90197
539 * cp-gimplify.c (genericize_cp_loop): Emit a DEBUG_BEGIN_STMT
540 before the condition (or if missing or constant non-zero at the end
541 of the loop. Emit a DEBUG_BEGIN_STMT before the increment expression
542 if any. Don't call protected_set_expr_location on incr if it already
543 has a location.
544
545 2019-05-15 Marek Polacek <polacek@redhat.com>
546
547 CWG 2096 - constraints on literal unions.
548 * class.c (check_field_decls): Initialize booleans directly. A union
549 is literal if at least one of its non-static data members is of
550 non-volatile literal type.
551
552 2019-05-15 Paolo Carlini <paolo.carlini@oracle.com>
553
554 * cp-tree.h (REFERENCE_VLA_OK): Remove.
555 * lambda.c (build_capture_proxy): Remove use of the above.
556
557 2019-05-15 Paolo Carlini <paolo.carlini@oracle.com>
558
559 * call.c (perform_overload_resolution, build_new_method_call_1):
560 Use OVL_P; remove redundant TEMPLATE_DECL checks.
561 * decl.c (grokfndecl): Likewise.
562 * mangle.c (write_expression): Likewise.
563 * parser.c (cp_parser_template_id): Likewise.
564 * pt.c (resolve_overloaded_unification, type_dependent_expression_p):
565 Likewise.
566 * search.c (build_baselink): Likewise.
567 * tree.c (is_overloaded_fn, dependent_name, maybe_get_fns): Likewise.
568
569 2019-05-14 Paolo Carlini <paolo.carlini@oracle.com>
570
571 PR preprocessor/90382
572 * decl.c (grokdeclarator): Fix value assigned to typespec_loc, use
573 min_location.
574
575 2019-05-13 Jason Merrill <jason@redhat.com>
576
577 Use releasing_vec more broadly.
578 * cp-tree.h (struct releasing_vec): Replace get_ref method with
579 operator&.
580 (vec_safe_push, vec_safe_reserve, vec_safe_length, vec_safe_splice):
581 Forwarding functions for releasing_vec.
582 (release_tree_vector): Declare but don't define.
583 * call.c (build_op_delete_call, build_temp, call_copy_ctor)
584 (perform_direct_initialization_if_possible): Use releasing_vec.
585 * constexpr.c (cxx_eval_vec_init_1, cxx_eval_store_expression):
586 Likewise.
587 * cp-gimplify.c (cp_fold): Likewise.
588 * cvt.c (force_rvalue, ocp_convert): Likewise.
589 * decl.c (get_tuple_decomp_init): Likewise.
590 * except.c (build_throw): Likewise.
591 * init.c (perform_member_init, expand_default_init): Likewise.
592 * method.c (do_build_copy_assign, locate_fn_flags): Likewise.
593 * parser.c (cp_parser_userdef_char_literal)
594 (cp_parser_userdef_numeric_literal)
595 (cp_parser_userdef_string_literal)
596 (cp_parser_perform_range_for_lookup)
597 (cp_parser_range_for_member_function, cp_parser_omp_for_loop)
598 (cp_parser_omp_for_loop_init): Likewise.
599 * pt.c (tsubst_copy_and_build, do_class_deduction): Likewise.
600 * semantics.c (calculate_direct_bases, calculate_bases)
601 (finish_omp_barrier, finish_omp_flush, finish_omp_taskwait)
602 (finish_omp_taskyield, finish_omp_cancel)
603 (finish_omp_cancellation_point): Likewise.
604 * tree.c (build_vec_init_elt, strip_typedefs, strip_typedefs_expr)
605 (build_min_non_dep_op_overload): Likewise.
606 * typeck.c (build_function_call_vec, cp_build_function_call_nary)
607 (cp_build_modify_expr): Likewise.
608 * typeck2.c (build_functional_cast): Likewise.
609
610 2019-05-11 Paolo Carlini <paolo.carlini@oracle.com>
611
612 * typeck.c (cp_build_function_call_vec): When mark_used fails
613 unconditionally return error_mark_node.
614
615 2019-05-10 Paolo Carlini <paolo.carlini@oracle.com>
616
617 * decl.c (grokvardecl): Use an accurate location in error message
618 about main as a global variable.
619
620 2019-05-10 Paolo Carlini <paolo.carlini@oracle.com>
621
622 * call.c (build_call_a): Use FUNC_OR_METHOD_TYPE_P.
623 * cp-gimplify.c (cp_fold): Likewise.
624 * cp-objcp-common.c (cp_type_dwarf_attribute): Likewise.
625 * cp-tree.h (TYPE_OBJ_P, TYPE_PTROBV_P): Likewise.
626 * cvt.c (perform_qualification_conversions): Likewise.
627 * decl.c (grokdeclarator): Likewise.
628 * decl2.c (build_memfn_type): Likewise.
629 * mangle.c (canonicalize_for_substitution, write_type): Likewise.
630 * parser.c (cp_parser_omp_declare_reduction): Likewise.
631 * pt.c (check_explicit_specialization, uses_deducible_template_parms,
632 check_cv_quals_for_unify, dependent_type_p_r): Likewise.
633 * rtti.c (ptr_initializer): Likewise.
634 * semantics.c (finish_asm_stmt, finish_offsetof,
635 cp_check_omp_declare_reduction): Likewise.
636 * tree.c (cp_build_qualified_type_real,
637 cp_build_type_attribute_variant, cxx_type_hash_eq,
638 cxx_copy_lang_qualifiers, cp_free_lang_data): Likewise.
639 * typeck.c (structural_comptypes, convert_arguments,
640 cp_build_addr_expr_1, unary_complex_lvalue, cp_build_c_cast,
641 cp_build_modify_expr, comp_ptr_ttypes_real, type_memfn_rqual):
642 Likewise.
643
644 2019-05-10 Marek Polacek <polacek@redhat.com>
645
646 PR c++/78010 - bogus -Wsuggest-override warning on final function.
647 * class.c (check_for_override): Don't warn for final functions.
648
649 2019-05-10 Jakub Jelinek <jakub@redhat.com>
650
651 PR pch/90326
652 * config-lang.in (gtfiles): Remove c-family/c-lex.c, add
653 c-family/c-cppbuiltin.c.
654
655 2019-05-09 Paolo Carlini <paolo.carlini@oracle.com>
656
657 PR c++/90382
658 Revert:
659 2018-04-26 Paolo Carlini <paolo.carlini@oracle.com>
660
661 * decl.c (grokdeclarator): Fix value assigned to typespec_loc, use
662 min_location.
663
664 2019-05-08 Nathan Sidwell <nathan@acm.org>
665
666 Kill DECL_SAVED_FUNCTION_DATA .
667 * cp-tree.h (language_function): Remove x_auto_return_pattern.
668 (current_function_auto_return_pattern): Delete.
669 (lang_decl_fn): Replace saved_language_function with
670 saved_auto_return type.
671 (DECL_SAVED_FUNCTION_DATA): Delete.
672 (DECL_SAVED_AUTO_RETURN_TYPE): New.
673 (FNDECL_USED_AUTO): Correct documentation.
674 * decl.c (duplicate_decls): Adjust AUTO return handling.
675 (start_preparsed_function): Replace
676 current_function_auto_return_pattern with
677 DECL_SAVED_AUTO_RETURN_TYPE. Remove DECL_SAVED_FUNCTION_DATA
678 zapping.
679 (finish_function): Likewise.
680 (save_function_data): Delete.
681 (fndecl_declared_return_type): Reimplement.
682 * mangle.c (write_unqualified_name): Use DECL_SAVED_AUTO_RETURN_TYPE.
683 * method.c (make_thunk, make_alias_for): Likewise.
684 * parser.c (cp_parser_jump_statement): Likewise.
685 * pt.c (do_auto_deduction): Likewise.
686 * typeck.c (check_return_expr): Likewise.
687
688 2019-05-06 Jason Merrill <jason@redhat.com>
689
690 PR c++/90171 - reorganize usual_deallocation_fn_p
691 * call.c (struct dealloc_info): New.
692 (usual_deallocation_fn_p): Take a dealloc_info*.
693 (aligned_deallocation_fn_p, sized_deallocation_fn_p): Remove.
694 (build_op_delete_call): Adjust.
695
696 2019-05-07 Jason Merrill <jason@redhat.com>
697
698 PR c++/86485 - -Wmaybe-unused with empty class ?:
699 * typeck.c (build_static_cast_1): Use cp_build_addr_expr.
700
701 * pt.c (type_dependent_expression_p): A non-type template parm with
702 a placeholder type is type-dependent.
703
704 2019-05-06 Marek Polacek <polacek@redhat.com>
705
706 PR c++/90265 - ICE with generic lambda.
707 * pt.c (tsubst_copy_and_build): Use a dedicated variable for the last
708 element in the vector.
709
710 2019-05-03 Martin Liska <mliska@suse.cz>
711
712 * call.c (build_aggr_conv): Use is_empty instead of
713 elements () == 0 (and similar usages).
714 * parser.c (cp_parser_lambda_introducer): Likewise.
715
716 2019-05-02 Nathan Sidwell <nathan@acm.org>
717
718 * semantics.c (finish_id_expression_1): Remove unreachable code.
719
720 2019-05-01 Nathan Sidwell <nathan@acm.org>
721
722 * name-lookup.h (get_class_binding_direct): Change final arg to
723 bool.
724 (get_class_binding): Likewise.
725 * name-lookup.c (get_class_binding_direct): Replace TYPE_OR_FNS
726 arg with WANT_TYPE bool. Simplify.
727 (get_class_binding): Adjust final arg.
728 * decl.c (reshape_init_class): Adjust get_class_binding calls.
729
730 2019-04-30 Nathan Sidwell <nathan@acm.org>
731
732 * cp-objcp-common.c (cp_common_init_ts): Use MARK_TS_EXP for _EXPR
733 nodes. Call c_common_init_ts.
734
735 2019-04-29 Nathan Sidwell <nathan@acm.org>
736
737 * decl.c (duplicate_decls): Add whitespace, move comments into
738 conditional blocks.
739 * method.c (explain_implicit_non_constexpr): Refactor.
740 * pt.c (check_explicit_specialization): Fix indentation.
741 * semantics.c (process_outer_var_ref): Reformat.
742 (finish_id_expression_1): Use STRIP_TEMPLATE.
743
744 2019-04-26 Jonathan Wakely <jwakely@redhat.com>
745
746 PR c++/90243 - orphaned note in uninstantiated constexpr function
747 * decl.c (check_for_uninitialized_const_var): Suppress notes if no
748 error was shown.
749
750 2019-04-26 Paolo Carlini <paolo.carlini@oracle.com>
751
752 PR c++/90173
753 * decl.c (grokdeclarator): Set type to error_mark_node
754 upon error about template placeholder type non followed
755 by a simple declarator-id.
756
757 2019-04-26 Paolo Carlini <paolo.carlini@oracle.com>
758
759 * decl.c (grokdeclarator): Fix value assigned to typespec_loc, use
760 min_location.
761
762 2019-04-24 Jason Merrill <jason@redhat.com>
763
764 PR c++/90227 - error with template parameter packs.
765 * pt.c (coerce_template_parms): Do add empty pack when
766 require_all_args.
767
768 2019-04-24 Richard Biener <rguenther@suse.de>
769
770 * call.c (null_ptr_cst_p): Order checks according to expensiveness.
771 (conversion_null_warnings): Likewise.
772 * typeck.c (same_type_ignoring_top_level_qualifiers_p): Return
773 early if type1 == type2.
774
775 2019-04-22 Jason Merrill <jason@redhat.com>
776
777 PR c++/87366 - wrong error with alias template.
778 * typeck.c (structural_comptypes): When comparing_specializations,
779 aliases are unequal.
780 (comptypes): When comparing_specializations, do structural
781 comparison.
782
783 2019-04-19 Jason Merrill <jason@redhat.com>
784
785 PR c++/90190 - CTAD with list-constructor.
786 * pt.c (do_class_deduction): Don't try the single element deduction
787 if the single element is also a braced list.
788
789 PR c++/90171 - ICE with destroying delete with size_t parm.
790 * call.c (sized_deallocation_fn_p): New. Use it instead of
791 second_parm_is_size_t in most cases.
792 (second_parm_is_size_t): Don't check for aligned.
793
794 2019-04-19 Paolo Carlini <paolo.carlini@oracle.com>
795
796 PR c++/89900
797 * pt.c (fn_type_unification): When handling null explicit
798 arguments do not special case non-parameter packs.
799
800 2019-04-19 Jakub Jelinek <jakub@redhat.com>
801
802 PR c++/90138
803 * pt.c (process_template_parm): Set decl to pushdecl result. If
804 !is_non_type, also set parm to that.
805
806 PR c/89888
807 * decl.c (struct cp_switch): Remove outside_range_p member.
808 (push_switch): Don't clear it.
809 (pop_switch): Adjust c_do_switch_warnings caller.
810 (finish_case_label): Adjust c_add_case_label caller.
811
812 PR c++/90108
813 * decl.c (duplicate_decls): If remove is main variant and
814 DECL_ORIGINAL_TYPE is some other type, remove a DECL_ORIGINAL_TYPE
815 variant that has newdecl as TYPE_NAME if any.
816
817 2019-04-18 Jason Merrill <jason@redhat.com>
818
819 PR c++/87554 - ICE with extern template and reference member.
820 * decl.c (cp_finish_decl): Don't set DECL_INITIAL of external vars.
821
822 2019-04-17 Jason Merrill <jason@redhat.com>
823
824 PR c++/90047 - ICE with enable_if alias template.
825 * pt.c (tsubst_decl) [TYPE_DECL]: Don't put an erroneous decl in the
826 hash table when we're in SFINAE context.
827
828 2019-04-17 Marek Polacek <polacek@redhat.com>
829
830 PR c++/90124 - bogus error with incomplete type in decltype.
831 * typeck.c (build_class_member_access_expr): Check
832 cp_unevaluated_operand.
833
834 2019-04-12 Jakub Jelinek <jakub@redhat.com>
835
836 PR c/89933
837 * decl.c (duplicate_decls): When newdecl's type is its main variant,
838 don't try to remove it from the variant list, but instead assert
839 it has no variants.
840
841 2019-04-12 Martin Sebor <msebor@redhat.com>
842
843 PR c/88383
844 PR c/89288
845 * parser.c (cp_parser_has_attribute_expression): Handle assignment
846 expressions.
847
848 2019-04-12 Jason Merrill <jason@redhat.com>
849
850 * call.c (null_member_pointer_value_p): Handle an empty CONSTRUCTOR
851 of PMF type.
852
853 2019-04-12 Marek Polacek <polacek@redhat.com>
854
855 * except.c (build_noexcept_spec): Use build_converted_constant_bool_expr
856 instead of perform_implicit_conversion_flags.
857
858 PR c++/87603 - constexpr functions are no longer noexcept.
859 * constexpr.c (is_sub_constant_expr): Remove unused function.
860 * cp-tree.h (is_sub_constant_expr): Remove declaration.
861 * except.c (check_noexcept_r): Don't consider a call to a constexpr
862 function noexcept.
863
864 2019-04-11 Jakub Jelinek <jakub@redhat.com>
865
866 PR translation/90035
867 * parser.h (struct cp_parser): Add
868 type_definition_forbidden_message_arg member.
869 * parser.c (cp_debug_parser): Print it.
870 (cp_parser_check_type_definition): Pass
871 parser->type_definition_forbidden_message_arg as second argument to
872 error.
873 (cp_parser_has_attribute_expression, cp_parser_sizeof_operand): Set
874 parser->type_definition_forbidden_message_arg and use G_() with
875 %qs for parser->type_definition_forbidden_message instead of
876 building untranslatable message using concat.
877
878 2019-04-09 Jakub Jelinek <jakub@redhat.com>
879
880 PR translation/90011
881 * typeck2.c (check_narrowing): Remove trailing space from diagnostics.
882
883 2019-04-08 Marek Polacek <polacek@redhat.com>
884
885 * typeck2.c (digest_init_r): Don't condition the object slicing warning
886 on flag_checking.
887
888 2019-04-08 Paolo Carlini <paolo.carlini@oracle.com>
889
890 PR c++/89914
891 * semantics.c (trait_expr_value): Don't use TYPE_NOTHROW_P
892 when maybe_instantiate_noexcept fails.
893 (classtype_has_nothrow_assign_or_copy_p): Likewise.
894 * method.c (implicitly_declare_fn): Avoid passing error_mark_node
895 to build_exception_variant.
896
897 2019-04-05 Marek Polacek <polacek@redhat.com>
898
899 PR c++/87145 - bogus error converting class type in template arg list.
900 * pt.c (convert_nontype_argument): Don't call
901 build_converted_constant_expr if it could involve calling a conversion
902 function with a instantiation-dependent constructor as its argument.
903
904 2019-04-05 Martin Sebor <msebor@redhat.com>
905
906 PR bootstrap/89980
907 * decl.c (reshape_init_array_1): Avoid treating empty strings
908 as zeros in array initializers.
909 Use trivial_type_p () instead of TYPE_HAS_TRIVIAL_DFLT().
910
911 2019-04-04 Jason Merrill <jason@redhat.com>
912
913 PR c++/89948 - ICE with break in statement-expr.
914 * constexpr.c (cxx_eval_statement_list): Jumping out of a
915 statement-expr is non-constant.
916
917 2019-04-04 Jason Merrill <jason@redhat.com>
918
919 PR c++/89966 - error with non-type auto tparm.
920 * pt.c (do_auto_deduction): Clear tf_partial.
921
922 2019-04-04 Jason Merrill <jason@redhat.com>
923
924 PR c++/86986 - ICE with TTP with parameter pack.
925 * pt.c (coerce_template_parameter_pack): Only look at the type of a
926 non-type parameter pack.
927 (fixed_parameter_pack_p_1): Don't recurse into the type of a
928 non-type parameter pack.
929 (coerce_template_template_parms): Call add_outermost_template_args.
930
931 2019-04-04 Martin Sebor <msebor@redhat.com>
932
933 PR c++/89974
934 PR c++/89878
935 PR c++/89833
936 PR c++/47488
937 * decl.c (reshape_init_array_1): Strip trailing zero-initializers
938 from arrays of trivial type and known size.
939 * mangle.c (write_expression): Convert braced initializer lists
940 to STRING_CSTs.
941 (write_expression): Trim trailing zero-initializers from arrays
942 of trivial type.
943 (write_template_arg_literal): Mangle strings the same as braced
944 initializer lists.
945
946 2019-04-03 Jason Merrill <jason@redhat.com>
947
948 PR c++/81866 - ICE with member template and default targ.
949 * pt.c (tsubst_template_decl): Handle getting a type from
950 retrieve_specialization.
951
952 PR c++/86586 - -fcompare-debug=-Wsign-compare.
953 * typeck.c (cp_build_binary_op): Don't fold for -Wsign-compare.
954
955 PR c++/89331 - ICE with offsetof in incomplete class.
956 * semantics.c (finish_offsetof): Handle error_mark_node.
957 * typeck.c (build_class_member_access_expr): Call
958 complete_type_or_maybe_complain before converting to base.
959
960 PR c++/89917 - ICE with lambda in variadic mem-init.
961 * pt.c (make_pack_expansion): Change type_pack_expansion_p to false.
962
963 2019-04-01 Jason Merrill <jason@redhat.com>
964
965 PR c++/86946 - ICE with function call in template argument.
966 DR 1321
967 * pt.c (iterative_hash_template_arg) [CALL_EXPR]: Use
968 dependent_name.
969
970 2019-04-01 Paolo Carlini <paolo.carlini@oracle.com>
971
972 PR c++/62207
973 * pt.c (tsubst_copy): Deal with lookup_name not returing a variable.
974
975 2019-03-31 Marek Polacek <polacek@redhat.com>
976
977 PR c++/89852 - ICE with C++11 functional cast with { }.
978 * constexpr.c (fold_non_dependent_expr_template): New static function
979 broken out of...
980 (fold_non_dependent_expr): ...here.
981 (fold_non_dependent_init): New function.
982 * cp-tree.h (fold_non_dependent_init): Declare.
983 * typeck2.c (massage_init_elt): Call fold_non_dependent_init instead
984 of fold_non_dependent_expr. Don't call maybe_constant_init.
985
986 2019-03-30 Jason Merrill <jason@redhat.com>
987
988 PR c++/89744 - ICE with specialization of member class template.
989 * pt.c (lookup_template_class_1): If the partial instantiation is
990 explicitly specialized, adjust.
991 (maybe_process_partial_specialization): Also adjust
992 CLASSTYPE_TI_ARGS.
993
994 2019-03-29 Jakub Jelinek <jakub@redhat.com>
995
996 PR sanitizer/89869
997 * typeck.c: Include gimplify.h.
998 (cp_build_modify_expr) <case COND_EXPR>: Unshare rhs before using it
999 for second time. Formatting fixes.
1000
1001 2019-03-29 Marek Polacek <polacek@redhat.com>
1002
1003 PR c++/89876 - ICE with deprecated conversion.
1004 * call.c (convert_like_real): Only give warnings with tf_warning.
1005
1006 2019-03-28 Marek Polacek <polacek@redhat.com>
1007
1008 PR c++/89612 - ICE with member friend template with noexcept.
1009 * pt.c (maybe_instantiate_noexcept): For function templates, use their
1010 template result (function decl). Don't set up local specializations.
1011 Temporarily turn on processing_template_decl. Update the template type
1012 too.
1013
1014 PR c++/89836 - bool constant expression and explicit conversions.
1015 * call.c (build_converted_constant_expr_internal): New function,
1016 renamed from...
1017 (build_converted_constant_expr): ...this. New.
1018 (build_converted_constant_bool_expr): New.
1019 * cp-tree.h (build_converted_constant_bool_expr): Declare.
1020 * decl.c (build_explicit_specifier): Call
1021 build_converted_constant_bool_expr.
1022
1023 2019-03-28 Jakub Jelinek <jakub@redhat.com>
1024
1025 PR c++/89785
1026 * constexpr.c (struct check_for_return_continue_data): New type.
1027 (check_for_return_continue): New function.
1028 (potential_constant_expression_1) <case SWITCH_STMT>: Walk
1029 SWITCH_STMT_BODY to find RETURN_EXPRs or CONTINUE_STMTs not nested
1030 in loop bodies and set *jump_target to that if found.
1031
1032 2019-03-27 Jason Merrill <jason@redhat.com>
1033
1034 PR c++/89831 - error with qualified-id in const member function.
1035 * semantics.c (finish_non_static_data_member): Use object cv-quals
1036 in scoped case, too.
1037
1038 PR c++/89421 - ICE with lambda in template parameter list.
1039 * parser.c (cp_parser_lambda_expression): Also reject a lambda in a
1040 template parameter list before C++20.
1041 * pt.c (type_dependent_expression_p): True for LAMBDA_EXPR.
1042 * semantics.c (begin_class_definition): Restore error about defining
1043 non-lambda class in template parm list.
1044
1045 2019-03-26 Jason Merrill <jason@redhat.com>
1046
1047 PR c++/86932 - missed SFINAE with empty pack.
1048 * pt.c (coerce_template_parms): Don't add an empty pack if
1049 tf_partial.
1050 (fn_type_unification): Pass tf_partial to coerce_template_parms.
1051
1052 PR c++/86429 - constexpr variable in lambda.
1053 PR c++/82643
1054 PR c++/87327
1055 * constexpr.c (cxx_eval_constant_expression): In a lambda function,
1056 try evaluating the captured variable directly.
1057
1058 2019-03-26 Jakub Jelinek <jakub@redhat.com>
1059
1060 PR c++/89796
1061 * semantics.c (finish_omp_atomic): Add warning_sentinel for
1062 -Wunused-value around finish_expr_stmt call.
1063
1064 2019-03-25 Paolo Carlini <paolo.carlini@oracle.com>
1065
1066 PR c++/84661
1067 PR c++/85013
1068 * parser.c (cp_parser_binary_expression): Don't call cp_fully_fold
1069 to undo the disabling of warnings.
1070
1071 2019-03-25 Jason Merrill <jason@redhat.com>
1072
1073 PR c++/87748 - substitution failure error with decltype.
1074 * pt.c (most_specialized_partial_spec): Clear
1075 processing_template_decl.
1076
1077 2019-03-25 Marek Polacek <polacek@redhat.com>
1078
1079 PR c++/89214 - ICE when initializing aggregates with bases.
1080 * typeck2.c (digest_init_r): Warn about object slicing instead of
1081 crashing.
1082
1083 PR c++/89705 - ICE with reference binding with conversion function.
1084 * call.c (reference_binding): If the result of the conversion function
1085 is a prvalue of non-class type, use the cv-unqualified type.
1086
1087 2019-03-25 Nathan Sidwell <nathan@acm.org>
1088
1089 * lambda.c (maybe_add_lambda_conv_op): Don't add to comdat group.
1090
1091 2019-03-22 Jakub Jelinek <jakub@redhat.com>
1092
1093 PR c++/60702
1094 * cp-tree.h (get_tls_wrapper_fn): Remove declaration.
1095 (maybe_get_tls_wrapper_call): Declare.
1096 * decl2.c (get_tls_wrapper_fn): Make static.
1097 (maybe_get_tls_wrapper_call): New function.
1098 * typeck.c (build_class_member_access_expr): Handle accesses to TLS
1099 variables.
1100 * semantics.c (finish_qualified_id_expr): Likewise.
1101 (finish_id_expression_1): Use maybe_get_tls_wrapper_call.
1102 * pt.c (tsubst_copy_and_build): Likewise.
1103
1104 PR c++/87481
1105 * constexpr.c (struct constexpr_ctx): Add constexpr_ops_count member.
1106 (cxx_eval_constant_expression): When not skipping, not constant class
1107 or location wrapper, increment *ctx->constexpr_ops_count and if it is
1108 above constexpr_loop_nest_limit, diagnose failure.
1109 (cxx_eval_outermost_constant_expr): Add constexpr_ops_count and
1110 initialize ctx.constexpr_ops_count to its address.
1111 (is_sub_constant_expr): Likewise.
1112
1113 2019-03-21 Jakub Jelinek <jakub@redhat.com>
1114
1115 PR c++/71446
1116 * call.c (filed_in_pset): Change pset from hash_set<tree> * to
1117 hash_set<tree, true> &, adjust uses accordingly.
1118 (build_aggr_conv): Change pset from hash_set<tree> *
1119 to hash_set<tree, true>. Replace goto fail; with return NULL;,
1120 adjust pset uses.
1121
1122 PR c++/89767
1123 * parser.c (cp_parser_lambda_introducer): Add ids and first_capture_id
1124 variables, check for duplicates in this function.
1125 * lambda.c (add_capture): Don't check for duplicates nor use
1126 IDENTIFIER_MARKED.
1127 (register_capture_members): Don't clear IDENTIFIER_MARKED here.
1128
1129 2019-03-21 Paolo Carlini <paolo.carlini@oracle.com>
1130
1131 PR c++/89571
1132 * method.c (after_nsdmi_defaulted_late_checks): Avoid passing
1133 error_mark_node to comp_except_specs.
1134
1135 2019-03-20 Jason Merrill <jason@redhat.com>
1136
1137 PR c++/87480 - decltype of member access in default template arg
1138 * pt.c (type_unification_real): Accept a dependent result in
1139 template context.
1140
1141 2019-03-19 Martin Sebor <msebor@redhat.com>
1142
1143 PR tree-optimization/89688
1144 * typeck2.c (store_init_value): Call braced_lists_to_string for more
1145 kinds of initializers.
1146
1147 2019-03-18 Jason Merrill <jason@redhat.com>
1148
1149 PR c++/89630 - ICE with dependent using-decl as template arg.
1150 * tree.c (cp_tree_equal): Always return false for USING_DECL.
1151
1152 PR c++/89761 - ICE with sizeof... in pack expansion.
1153 * pt.c (argument_pack_element_is_expansion_p): Handle
1154 ARGUMENT_PACK_SELECT.
1155
1156 PR c++/89640 - GNU attributes on lambda.
1157 * parser.c (cp_parser_lambda_declarator_opt): Allow GNU attributes.
1158
1159 PR c++/89682 - wrong access error in default argument.
1160 * pt.c (tsubst_default_argument): Don't defer access checks.
1161
1162 2019-03-18 Paolo Carlini <paolo.carlini@oracle.com>
1163
1164 PR c++/85014
1165 * semantics.c (finish_non_static_data_member): Check return value
1166 of context_for_name_lookup and immediately return error_mark_node
1167 if isn't a type.
1168
1169 2019-03-17 Jason Merrill <jason@redhat.com>
1170
1171 PR c++/89571 - ICE with ill-formed noexcept on constructor.
1172 * pt.c (maybe_instantiate_noexcept): Only return false if defaulted.
1173 (regenerate_decl_from_template): Use it for noexcept-specs.
1174
1175 2019-03-14 Jason Merrill <jason@redhat.com>
1176
1177 * parser.c (cp_parser_decl_specifier_seq): Support C++20
1178 concept-definition syntax without 'bool'.
1179
1180 2019-03-14 Jakub Jelinek <jakub@redhat.com>
1181
1182 PR c++/89512
1183 * semantics.c (finish_qualified_id_expr): Reject variable templates.
1184
1185 PR c++/89652
1186 * constexpr.c (struct constexpr_ctx): Change save_exprs type from
1187 hash_set<tree> to vec<tree>.
1188 (cxx_eval_call_expression): Adjust for save_exprs being a vec instead
1189 of hash_set.
1190 (cxx_eval_loop_expr): Likewise. Truncate the vector after each
1191 removal of SAVE_EXPRs from values.
1192 (cxx_eval_constant_expression) <case SAVE_EXPR>: Call safe_push
1193 method on save_exprs instead of add.
1194
1195 2019-03-13 Jason Merrill <jason@redhat.com>
1196
1197 PR c++/86521 - C++17 copy elision in initialization by constructor.
1198 * call.c (joust_maybe_elide_copy): New.
1199 (joust): Call it.
1200
1201 2019-03-13 Marek Polacek <polacek@redhat.com>
1202
1203 PR c++/88979 - further P0634 fix for constructors.
1204 * parser.c (cp_parser_decl_specifier_seq): Pass flags to
1205 cp_parser_constructor_declarator_p.
1206 (cp_parser_direct_declarator): Allow missing typename for constructor
1207 parameters.
1208 (cp_parser_constructor_declarator_p): Add FLAGS parameter. Pass it to
1209 cp_parser_type_specifier.
1210
1211 PR c++/89686 - mixing init-capture and simple-capture in lambda.
1212 * parser.c (cp_parser_lambda_introducer): Give error when combining
1213 init-capture and simple-capture.
1214
1215 PR c++/89660 - bogus error with -Wredundant-move.
1216 * typeck.c (maybe_warn_pessimizing_move): Only accept (T &) &arg
1217 as the std::move's argument. Don't call convert_for_initialization
1218 when warn_redundant_move isn't on.
1219
1220 2019-03-11 Jason Merrill <jason@redhat.com>
1221
1222 PR c++/86521 - wrong overload resolution with ref-qualifiers.
1223 * call.c (build_user_type_conversion_1): Don't use a conversion to a
1224 reference of the wrong rvalueness for direct binding.
1225
1226 2019-03-11 Martin Liska <mliska@suse.cz>
1227
1228 * cvt.c (build_expr_type_conversion): Wrap apostrophes
1229 in gcc internal format with %'.
1230 * decl.c (check_no_redeclaration_friend_default_args): Likewise.
1231 (grokfndecl): Likewise.
1232 * name-lookup.c (do_pushtag): Likewise.
1233 * pt.c (unify_parameter_deduction_failure): Likewise.
1234 (unify_template_deduction_failure): Likewise.
1235
1236 2019-03-11 Martin Liska <mliska@suse.cz>
1237
1238 * call.c (convert_arg_to_ellipsis): Wrap an option name
1239 in a string format message and fix GNU coding style.
1240 (build_over_call): Likewise.
1241 * class.c (check_field_decl): Likewise.
1242 (layout_nonempty_base_or_field): Likewise.
1243 * constexpr.c (cxx_eval_loop_expr): Likewise.
1244 * cvt.c (type_promotes_to): Likewise.
1245 * decl.c (cxx_init_decl_processing): Likewise.
1246 (mark_inline_variable): Likewise.
1247 (grokdeclarator): Likewise.
1248 * decl2.c (record_mangling): Likewise.
1249 * error.c (maybe_warn_cpp0x): Likewise.
1250 * except.c (doing_eh): Likewise.
1251 * mangle.c (maybe_check_abi_tags): Likewise.
1252 * parser.c (cp_parser_diagnose_invalid_type_name): Likewise.
1253 (cp_parser_userdef_numeric_literal): Likewise.
1254 (cp_parser_primary_expression): Likewise.
1255 (cp_parser_unqualified_id): Likewise.
1256 (cp_parser_pseudo_destructor_name): Likewise.
1257 (cp_parser_builtin_offsetof): Likewise.
1258 (cp_parser_lambda_expression): Likewise.
1259 (cp_parser_lambda_introducer): Likewise.
1260 (cp_parser_lambda_declarator_opt): Likewise.
1261 (cp_parser_selection_statement): Likewise.
1262 (cp_parser_init_statement): Likewise.
1263 (cp_parser_decomposition_declaration): Likewise.
1264 (cp_parser_function_specifier_opt): Likewise.
1265 (cp_parser_static_assert): Likewise.
1266 (cp_parser_simple_type_specifier): Likewise.
1267 (cp_parser_namespace_definition): Likewise.
1268 (cp_parser_using_declaration): Likewise.
1269 (cp_parser_ctor_initializer_opt_and_function_body): Likewise.
1270 (cp_parser_initializer_list): Likewise.
1271 (cp_parser_type_parameter_key): Likewise.
1272 (cp_parser_member_declaration): Likewise.
1273 (cp_parser_try_block): Likewise.
1274 (cp_parser_std_attribute_spec): Likewise.
1275 (cp_parser_requires_clause_opt): Likewise.
1276 * pt.c (check_template_variable): Likewise.
1277 (check_default_tmpl_args): Likewise.
1278 (push_tinst_level_loc): Likewise.
1279 (instantiate_pending_templates): Likewise.
1280 (invalid_nontype_parm_type_p): Likewise.
1281 * repo.c (get_base_filename): Likewise.
1282 * rtti.c (typeid_ok_p): Likewise.
1283 (build_dynamic_cast_1): Likewise.
1284 * tree.c (maybe_warn_parm_abi): Likewise.
1285
1286 2019-03-08 Jakub Jelinek <jakub@redhat.com>
1287
1288 PR other/80058
1289 * parser.c (cp_parser_template_declaration_after_parameters): Avoid
1290 one space before " at the end of line and another after " on another
1291 line in a string literal.
1292
1293 PR tree-optimization/89550
1294 * semantics.c (maybe_convert_cond): Only set TREE_NO_WARNING if
1295 warning_at returned true.
1296 * decl2.c (c_parse_final_cleanups): Likewise.
1297 * typeck.c (convert_for_assignment): Likewise.
1298 * decl.c (finish_function): Likewise.
1299
1300 PR c++/89585
1301 * parser.c (cp_parser_asm_definition): Just warn instead of error
1302 on volatile qualifier outside of function body.
1303
1304 PR c++/89599
1305 * constexpr.c (potential_constant_expression_1): Reject
1306 REINTERPRET_CAST_P NOP_EXPRs.
1307
1308 PR c++/89622
1309 * call.c (joust): Call print_z_candidate only if pedwarn returned
1310 true.
1311
1312 2019-03-07 Jason Merrill <jason@redhat.com>
1313
1314 PR c++/88123 - lambda and using-directive.
1315 * name-lookup.c (op_unqualified_lookup)
1316 (maybe_save_operator_binding, discard_operator_bindings)
1317 (push_operator_bindings): New.
1318 * typeck.c (build_x_binary_op, build_x_unary_op): Call
1319 maybe_save_operator_binding.
1320 * decl.c (start_preparsed_function): Call push_operator_bindings.
1321 * tree.c (cp_free_lang_data): Call discard_operator_bindings.
1322
1323 PR c++/88820 - ICE with CTAD and member template used in DMI.
1324 * pt.c (do_class_deduction): Handle parm used as its own arg.
1325
1326 2019-03-07 Jakub Jelinek <jakub@redhat.com>
1327
1328 PR c++/89585
1329 * parser.c (cp_parser_asm_definition): Parse asm qualifiers even
1330 at toplevel, but diagnose them.
1331
1332 2019-03-06 Jason Merrill <jason@redhat.com>
1333
1334 PR c++/89381 - implicit copy and using-declaration.
1335 * class.c (classtype_has_move_assign_or_move_ctor_p): Don't consider
1336 op= brought in by a using-declaration.
1337
1338 2019-03-06 Jakub Jelinek <jakub@redhat.com>
1339
1340 PR c++/87148
1341 * init.c (build_value_init_noctor): Ignore flexible array members.
1342
1343 2019-03-06 Jason Merrill <jason@redhat.com>
1344
1345 PR c++/89576 - if constexpr of lambda capture.
1346 * semantics.c (maybe_convert_cond): Do convert a non-dependent
1347 condition in a template.
1348 * typeck.c (condition_conversion): Handle being called in a
1349 template.
1350
1351 2019-03-06 Marek Polacek <polacek@redhat.com>
1352
1353 PR c++/87378 - bogus -Wredundant-move warning.
1354 * typeck.c (maybe_warn_pessimizing_move): See if the maybe-rvalue
1355 overload resolution would actually succeed.
1356
1357 2019-03-05 Jason Merrill <jason@redhat.com>
1358
1359 * class.c (is_really_empty_class): Add ignore_vptr parm.
1360 (trivial_default_constructor_is_constexpr): Pass it.
1361 * call.c (build_over_call): Pass it.
1362 * constexpr.c (cxx_eval_constant_expression): Pass it instead of
1363 checking TYPE_POLYMORPHIC_P.
1364 (cxx_eval_component_reference, potential_constant_expression_1):
1365 Pass it.
1366 * cp-gimplify.c (simple_empty_class_p): Pass it.
1367 * init.c (expand_aggr_init_1): Pass it.
1368
1369 2019-03-04 Paolo Carlini <paolo.carlini@oracle.com>
1370
1371 PR c++/84605
1372 * parser.c (cp_parser_class_head): Reject TYPE_BEING_DEFINED too.
1373
1374 2019-03-04 Jakub Jelinek <jakub@redhat.com>
1375
1376 PR c++/71446
1377 * call.c (field_in_pset): New function.
1378 (build_aggr_conv): Handle CONSTRUCTOR_IS_DESIGNATED_INIT correctly.
1379
1380 2019-03-02 Jakub Jelinek <jakub@redhat.com>
1381
1382 PR c++/71446
1383 * cp-tree.h (CONSTRUCTOR_IS_DESIGNATED_INIT): Define.
1384 * parser.c (cp_parser_braced_list): Adjust cp_parser_initializer_list
1385 caller, set CONSTRUCTOR_IS_DESIGNATED_INIT.
1386 (cp_parser_initializer_list): Add designated parameter, set *designated
1387 to a bool whether any designators were parsed.
1388 * decl.c (reshape_init): Copy over CONSTRUCTOR_IS_DESIGNATED_INIT if
1389 needed.
1390 * pt.c (tsubst_copy_and_build): Likewise.
1391 * call.c (implicit_conversion): If CONSTRUCTOR_IS_DESIGNATED_INIT,
1392 don't call build_list_conv, nor build_complex_conv, nor attempt to
1393 convert a single element initializer to scalar.
1394
1395 2019-03-01 Marek Polacek <polacek@redhat.com>
1396
1397 PR c++/89537 - missing location for error with non-static member fn.
1398 * call.c (resolve_args): Use EXPR_LOCATION.
1399 * typeck.c (build_class_member_access_expr): Use input_location.
1400
1401 PR c++/89532 - ICE with incomplete type in decltype.
1402 * semantics.c (finish_compound_literal): Return error_mark_node
1403 if digest_init_flags returns error_mark_node.
1404
1405 2019-03-01 Jakub Jelinek <jakub@redhat.com>
1406
1407 Implement P1002R1, Try-catch blocks in constexpr functions
1408 PR c++/89513
1409 * parser.c (cp_parser_ctor_initializer_opt_and_function_body):
1410 Diagnose constexpr ctor or function with function-try-block with
1411 pedwarn for c++17 and earlier. Formatting fix.
1412 (cp_parser_try_block): Use pedwarn instead of error and only for
1413 c++17 and earlier when try block appears in constexpr function.
1414 * constexpr.c (build_constexpr_constructor_member_initializers):
1415 Handle TRY_BLOCK here instead of erroring on it.
1416
1417 2019-02-28 Jason Merrill <jason@redhat.com>
1418
1419 PR c++/88183 - ICE with .* fold-expression.
1420 * pt.c (fold_expression) [DOTSTAR_EXPR]: Remove special handling.
1421
1422 PR c++/86969 - ICE with constexpr if and recursive generic lambdas.
1423 * class.c, lambda.c, pt.c: Revert earlier change.
1424 * lambda.c (add_capture): Don't special-case capture of dependent
1425 VLA.
1426
1427 * name-lookup.c (print_binding_level): Print this_entity.
1428
1429 2019-02-27 Marek Polacek <polacek@redhat.com>
1430
1431 PR c++/88857 - ICE with value-initialization of argument in template.
1432 * call.c (convert_like_real): Don't call build_value_init in template.
1433
1434 2019-02-27 Jason Merrill <jason@redhat.com>
1435
1436 PR c++/86969 - ICE with constexpr if and recursive generic lambdas.
1437 * semantics.c (process_outer_var_ref): Do capture dependent vars.
1438 * class.c (finish_struct): Only add TAG_DEFN if T is in
1439 current_function_decl.
1440 * lambda.c (vla_capture_type): Force the capture type out into the
1441 lambda's enclosing function.
1442 (add_capture): Pass in the lambda.
1443 * pt.c (tsubst_lambda_expr): complete_type a VLA capture type.
1444
1445 2019-02-27 Marek Polacek <polacek@redhat.com>
1446
1447 PR c++/89511 - ICE with using-declaration and unscoped enumerator.
1448 * parser.c (cp_parser_using_declaration): For an unscoped enum
1449 only use its context if it's not a function declaration.
1450
1451 2019-02-27 Paolo Carlini <paolo.carlini@oracle.com>
1452
1453 PR c++/89488
1454 * method.c (process_subob_fn): When maybe_instantiate_noexcept
1455 returns false don't call merge_exception_specifiers.
1456
1457 2019-02-27 Paolo Carlini <paolo.carlini@oracle.com>
1458
1459 PR c++/88987
1460 * parser.c (cp_parser_noexcept_specification_opt): Return NULL_TREE
1461 for a non-constant parsed expression.
1462
1463 2019-02-26 Jakub Jelinek <jakub@redhat.com>
1464
1465 PR c++/89481
1466 * constexpr.c (cxx_eval_store_expression): When changing active union
1467 member, set no_zero_init.
1468
1469 2019-02-23 Marek Polacek <polacek@redhat.com>
1470
1471 PR c++/88294 - ICE with non-constant noexcept-specifier.
1472 * pt.c (maybe_instantiate_noexcept): Set up the list of local
1473 specializations. Set current_class_{ptr,ref}.
1474
1475 2019-02-22 David Malcolm <dmalcolm@redhat.com>
1476
1477 PR c++/89390
1478 * parser.c (cp_parser_unqualified_id): Capture and use locations
1479 for destructors.
1480
1481 2019-02-22 Marek Polacek <polacek@redhat.com>
1482
1483 PR c++/89420 - ICE with CAST_EXPR in explicit-specifier.
1484 * decl.c (build_explicit_specifier): Don't check
1485 processing_template_decl. Call instantiation_dependent_expression_p
1486 instead of value_dependent_expression_p. Call
1487 instantiate_non_dependent_expr_sfinae before
1488 build_converted_constant_expr instead of calling
1489 instantiate_non_dependent_expr after it. Add
1490 processing_template_decl_sentinel.
1491
1492 2019-02-22 Thomas Schwinge <thomas@codesourcery.com>
1493
1494 * parser.c (cp_parser_oacc_simple_clause): Remove parser formal
1495 parameter, move loc formal parameter to the front. Adjust all
1496 users.
1497 (cp_parser_oacc_shape_clause): Add loc formal parameter. Adjust
1498 all users.
1499
1500 2019-02-21 Jason Merrill <jason@redhat.com>
1501
1502 PR c++/87685 - generic lambda 'this' capture error.
1503 * lambda.c (lambda_expr_this_capture): Change add_capture_p to int.
1504 (maybe_generic_this_capture): Pass -1.
1505
1506 PR c++/88394 - ICE with VLA init-capture.
1507 * lambda.c (is_normal_capture_proxy): Check DECL_CAPTURED_VARIABLE.
1508
1509 PR c++/88869 - C++17 ICE with CTAD and explicit specialization.
1510 * pt.c (do_class_deduction): Don't include explicit specialization
1511 args in outer_args.
1512
1513 PR c++/89422 - ICE with -g and lambda in default arg in template.
1514 * pt.c (tsubst_function_decl): SET_DECL_FRIEND_CONTEXT sooner.
1515
1516 2019-02-21 Jason Merrill <jason@redhat.com>
1517
1518 PR c++/88419 - C++17 ICE with class template arg deduction.
1519 * pt.c (make_template_placeholder): Set TYPE_CANONICAL after
1520 CLASS_PLACEHOLDER_TEMPLATE.
1521
1522 2019-02-21 Jakub Jelinek <jakub@redhat.com>
1523
1524 PR c++/89285
1525 * constexpr.c (struct constexpr_fundef): Add parms and result members.
1526 (retrieve_constexpr_fundef): Adjust for the above change.
1527 (register_constexpr_fundef): Save constexpr body with copy_fn,
1528 temporarily set DECL_CONTEXT on DECL_RESULT before that.
1529 (get_fundef_copy): Change FUN argument to FUNDEF with
1530 constexpr_fundef * type, grab body and parms/result out of
1531 constexpr_fundef struct and temporarily change it for copy_fn calls
1532 too.
1533 (cxx_eval_builtin_function_call): For __builtin_FUNCTION temporarily
1534 adjust current_function_decl from ctx->call context. Test
1535 !potential_constant_expression instead of !is_constant_expression.
1536 (cxx_bind_parameters_in_call): Grab parameters from new_call. Undo
1537 convert_for_arg_passing changes for TREE_ADDRESSABLE type passing.
1538 (cxx_eval_call_expression): Adjust get_fundef_copy caller.
1539 (cxx_eval_conditional_expression): For IF_STMT, allow then or else
1540 operands to be NULL.
1541 (label_matches): Handle BREAK_STMT and CONTINUE_STMT.
1542 (cxx_eval_loop_expr): Add support for FOR_STMT, WHILE_STMT and DO_STMT.
1543 (cxx_eval_switch_expr): Add support for SWITCH_STMT.
1544 (cxx_eval_constant_expression): Handle IF_STMT, FOR_STMT, WHILE_STMT,
1545 DO_STMT, CONTINUE_STMT, SWITCH_STMT, BREAK_STMT and CONTINUE_STMT.
1546 For SIZEOF_EXPR, recurse on the result of fold_sizeof_expr. Ignore
1547 DECL_EXPR with USING_DECL operand.
1548 * lambda.c (maybe_add_lambda_conv_op): Build thisarg using
1549 build_int_cst to make it a valid constant expression.
1550
1551 2019-02-20 Jason Merrill <jason@redhat.com>
1552
1553 PR c++/88690 - C++17 ICE with empty base in aggregate.
1554 * typeck2.c (process_init_constructor_record): Skip trivial
1555 initialization of an empty base.
1556
1557 2019-02-21 Richard Biener <rguenther@suse.de>
1558
1559 PR middle-end/89392
1560 * vtable-class-hierarchy.c (vtv_generate_init_routine): Do not
1561 make symtab process new functions here.
1562
1563 2019-02-20 Jason Merrill <jason@redhat.com>
1564
1565 PR c++/87921 - wrong error with inline static data member.
1566 * decl2.c (finish_static_data_member_decl): Don't set DECL_IN_AGGR_P
1567 for a non-template inline variable. Do nothing for an
1568 already-instantiated variable.
1569 (c_parse_final_cleanups): Check DECL_IN_AGGR_P without
1570 DECL_INLINE_VAR_P.
1571 * decl.c (check_initializer): Likewise.
1572 (make_rtl_for_nonlocal_decl): Likewise.
1573 * pt.c (instantiate_decl): Likewise.
1574 * typeck2.c (store_init_value): Likewise.
1575
1576 2019-02-20 Jakub Jelinek <jakub@redhat.com>
1577
1578 PR c++/89403
1579 * decl2.c (c_parse_final_cleanups): Move TREE_ASM_WRITTEN setting
1580 for flag_syntax_only from here...
1581 * semantics.c (expand_or_defer_fn_1): ... here.
1582
1583 PR c++/89405
1584 * decl.c (maybe_commonize_var): When clearing TREE_PUBLIC and
1585 DECL_COMMON, set DECL_INTERFACE_KNOWN.
1586
1587 PR c++/89336
1588 * constexpr.c (cxx_eval_store_expression): Diagnose changing of active
1589 union member for -std=c++17 and earlier.
1590
1591 2019-02-19 Jason Merrill <jason@redhat.com>
1592
1593 PR c++/87513 - 'sorry' mangling PMF template-id.
1594 * mangle.c (write_expression): Handle SCOPE_REF to BASELINK.
1595
1596 2019-02-19 Jason Merrill <jason@redhat.com>
1597
1598 PR c++/88380 - wrong-code with flexible array and NSDMI.
1599 * typeck2.c (process_init_constructor_record): Skip flexarrays.
1600
1601 2019-02-20 will wray <wjwray@gmail.com>
1602
1603 PR c++/88572 - wrong handling of braces on scalar init.
1604 * decl.c (reshape_init_r): Allow braces around scalar initializer
1605 within aggregate init. Reject double braced-init of scalar
1606 variable.
1607
1608 2019-02-20 Paolo Carlini <paolo.carlini@oracle.com>
1609
1610 PR c++/84536
1611 * pt.c (tsubst_init): Diagnose an initializer expanding to an
1612 empty list of expressions; tweak wrt dependent types.
1613 (regenerate_decl_from_template): For VAR_DECLs call tsubst_init
1614 instead of tsubst_expr.
1615
1616 2019-02-19 Jason Merrill <jason@redhat.com>
1617
1618 PR c++/88368 - wrong 'use of deleted function'
1619 * method.c (walk_field_subobs): Remember errors from get_nsdmi.
1620 (get_defaulted_eh_spec): Call push_tinst_level.
1621 * pt.c (maybe_instantiate_noexcept): Keep error_mark_node.
1622 * typeck2.c (merge_exception_specifiers): Handle error_mark_node.
1623
1624 2019-02-19 Chung-Lin Tang <cltang@codesourcery.com>
1625
1626 PR c/87924
1627 * parser.c (cp_parser_oacc_clause_wait): Add representation of wait
1628 clause without argument as 'wait (GOMP_ASYNC_NOVAL)', adjust comments.
1629
1630 2019-02-19 Jakub Jelinek <jakub@redhat.com>
1631
1632 PR c++/89387
1633 * lambda.c (maybe_generic_this_capture): Don't check
1634 DECL_NONSTATIC_MEMBER_FUNCTION_P on USING_DECLs.
1635
1636 PR c++/89391
1637 * typeck.c (build_reinterpret_cast_1): Don't handle void to
1638 && conversion go through build_target_expr_with_type.
1639
1640 PR c++/89390
1641 * error.c (qualified_name_lookup_error): Only call
1642 suggest_alternative_in_scoped_enum if name is IDENTIFIER_NODE.
1643
1644 2019-02-19 Tom Honermann <tom@honermann.net>
1645
1646 * name-lookup.c (get_std_name_hint): Added u8string as a name hint.
1647
1648 2019-02-18 Jason Merrill <jason@redhat.com>
1649
1650 PR c++/89336 - multiple stores in constexpr stmt.
1651 * constexpr.c (cxx_eval_store_expression): Preevaluate scalar or
1652 assigned value.
1653
1654 * pt.c (check_explicit_specialization): If the declarator is a
1655 template-id, only check whether the arguments are dependent.
1656
1657 Improve duplicate [[likely]] diagnostic.
1658 * parser.c (cp_parser_statement): Make attrs_loc a range. Pass it
1659 to process_stmt_hotness_attribute.
1660 * cp-gimplify.c (process_stmt_hotness_attribute): Take attrs_loc.
1661 (genericize_if_stmt): Use likely/unlikely instead of predictor_name.
1662
1663 2019-02-17 Marek Polacek <polacek@redhat.com>
1664
1665 PR c++/89217 - ICE with list-initialization in range-based for loop.
1666 * constexpr.c (unshare_constructor): No longer static.
1667 * cp-tree.h (unshare_constructor): Declare.
1668 * semantics.c (finish_compound_literal): When dealing with a
1669 non-dependent expression in a template, return the original
1670 expression. Pass LOOKUP_NO_NARROWING to digest_init_flags.
1671
1672 2019-02-13 Marek Polacek <polacek@redhat.com>
1673
1674 PR c++/89297 - ICE with OVERLOAD in template.
1675 * semantics.c (finish_compound_literal): Call
1676 instantiate_non_dependent_expr_sfinae.
1677
1678 2019-02-13 Alexandre Oliva <aoliva@redhat.com>
1679
1680 PR c++/86379
1681 * cp-tree.h (USING_DECL_SCOPE): Use result rather than type.
1682 * name-lookup.c (strip_using_decl): Use USING_DECL_SCOPE.
1683 * search.c (protected_accessible_p): Follow USING_DECL_DECLS.
1684 (shared_member_p): Likewise.
1685 (lookup_member): Likewise.
1686 * decl.c (grok_special_member_properties): Skip USING_DECLs.
1687 * semantics.c (finish_omp_declare_simd_methods): Likewise.
1688 (finish_qualified_id_expr): Do not call shared_member_p with
1689 a dependent expr.
1690
1691 PR c++/87322
1692 * pt.c (tsubst_lambda_expr): Avoid duplicate tsubsting.
1693 Move cp_evaluated resetting before signature tsubsting.
1694 (gen_elem_of_pack_expansion_instantiation): Separate local
1695 specializations per index.
1696
1697 2019-02-13 David Malcolm <dmalcolm@redhat.com>
1698
1699 PR c++/89036
1700 * class.c (add_method): Drop destructor assertion.
1701
1702 2019-02-13 Paolo Carlini <paolo.carlini@oracle.com>
1703
1704 PR c++/88986
1705 * decl.c (make_typename_type): Allow for TYPE_PACK_EXPANSION as
1706 context (the first argument).
1707 * pt.c (tsubst, case TYPENAME_TYPE): Handle TYPE_PACK_EXPANSION
1708 as context.
1709
1710 2019-02-12 Jason Merrill <jason@redhat.com>
1711
1712 PR c++/89144 - link error with constexpr initializer_list.
1713 * call.c (convert_like_real) [ck_list]: Don't allocate a temporary
1714 array for an empty list.
1715 * typeck2.c (store_init_value): Don't use cxx_constant_init in a
1716 template.
1717
1718 2019-02-11 Jason Merrill <jason@redhat.com>
1719
1720 PR c++/89241 - ICE with __func__ in lambda in template.
1721 * pt.c (enclosing_instantiation_of): Also check
1722 instantiated_lambda_fn_p for the template context.
1723
1724 2019-02-11 Marek Polacek <polacek@redhat.com>
1725
1726 PR c++/89212 - ICE converting nullptr to pointer-to-member-function.
1727 * pt.c (tsubst_copy_and_build) <case CONSTRUCTOR>: Return early for
1728 null member pointer value.
1729
1730 2019-02-11 Jakub Jelinek <jakub@redhat.com>
1731
1732 PR c++/88977
1733 * pt.c (convert_nontype_argument): Pass true as manifestly_const_eval
1734 to maybe_constant_value calls.
1735
1736 2019-02-11 Marek Polacek <polacek@redhat.com>
1737
1738 * typeck2.c (digest_init_r): Remove commented code.
1739
1740 2019-02-11 Martin Sebor <msebor@redhat.com>
1741
1742 PR c++/87996
1743 * decl.c (compute_array_index_type_loc): Preserve signed sizes
1744 for diagnostics. Call valid_array_size_p instead of error.
1745 * init.c (build_new_1): Compute size for diagnostic. Call
1746 invalid_array_size_error
1747 (build_new): Call valid_array_size_p instead of error.
1748
1749 2019-02-07 Alexandre Oliva <aoliva@redhat.com>
1750
1751 PR c++/86218
1752 * call.c (compare_ics): Deal with ck_aggr in either cs.
1753
1754 2019-02-06 David Malcolm <dmalcolm@redhat.com>
1755
1756 PR c++/71302
1757 * call.c (get_location_for_expr_unwinding_for_system_header): New
1758 function.
1759 (conversion_null_warnings): Use it when getting locations for
1760 EXPR, effectively adding a call to
1761 get_location_for_expr_unwinding_for_system_header for
1762 -Wconversion-null and making use of EXPR_LOCATION for
1763 -Wzero-as-null-pointer-constant.
1764
1765 2019-02-05 Jakub Jelinek <jakub@redhat.com>
1766
1767 PR c++/89187
1768 * optimize.c (maybe_thunk_body): Clear TREE_ADDRESSABLE on
1769 PARM_DECLs of the thunk.
1770 * lambda.c (maybe_add_lambda_conv_op): Likewise.
1771
1772 2019-02-05 Marek Polacek <polacek@redhat.com>
1773
1774 PR c++/89158 - by-value capture of constexpr variable broken.
1775 * call.c (convert_like_real) <case ck_user>: Call mark_exp_read
1776 instead of mark_rvalue_use.
1777
1778 2019-02-05 Alexandre Oliva <aoliva@redhat.com>
1779
1780 PR c++/87770
1781 * pt.c (instantiates_primary_template_p): New.
1782 (type_dependent_expression_p): Use it.
1783
1784 2019-02-01 Jason Merrill <jason@redhat.com>
1785
1786 PR c++/88761 - ICE with reference capture of constant.
1787 * lambda.c (mark_const_cap_r): Do walk subtrees of DECL_EXPR for
1788 non-proxy decls.
1789
1790 2019-02-01 Marek Polacek <polacek@redhat.com>
1791
1792 PR c++/88325 - ICE with invalid out-of-line template member definition.
1793 * parser.c (cp_parser_class_name): Don't call make_typename_type
1794 for overloads.
1795
1796 2019-02-01 Jakub Jelinek <jakub@redhat.com>
1797
1798 PR c++/87175
1799 * parser.c (cp_parser_gnu_attributes_opt): Set ok to false
1800 if require_open failed.
1801
1802 2019-01-31 Marek Polacek <polacek@redhat.com>
1803
1804 PR c++/89083, c++/80864 - ICE with list initialization in template.
1805 * constexpr.c (adjust_temp_type): Use copy_node and change the type
1806 instead of using build_constructor.
1807 * decl.c (reshape_init_r): Don't reshape a digested initializer.
1808 Return the initializer for COMPOUND_LITERAL_P.
1809
1810 PR c++/88983 - ICE with switch in constexpr function.
1811 * constexpr.c (cxx_eval_switch_expr): Use SWITCH_COND and SWITCH_BODY.
1812 (cxx_eval_constant_expression) <case COND_EXPR>: Don't look for the
1813 label in the else branch if we found it in the then branch.
1814
1815 2019-01-30 Jason Merrill <jason@redhat.com>
1816
1817 PR c++/88752 - ICE with lambda and constexpr if.
1818 * cp-tree.h (LAMBDA_EXPR_INSTANTIATED): New.
1819 * pt.c (tsubst_lambda_expr): Set it.
1820 (instantiated_lambda_fn_p): Check it.
1821 (enclosing_instantiation_of): Use it.
1822
1823 2019-01-31 Jakub Jelinek <jakub@redhat.com>
1824
1825 PR libstdc++/88170
1826 * cxx-pretty-print.c (pp_cxx_enumeration_constant): Print always as
1827 a C cast in pp_c_flag_gnu_v3 mode.
1828
1829 2019-01-30 Jakub Jelinek <jakub@redhat.com>
1830
1831 PR c++/88988
1832 * lambda.c (is_capture_proxy): Don't return true for
1833 DECL_OMP_PRIVATIZED_MEMBER artificial vars.
1834
1835 2019-01-30 Marek Polacek <polacek@redhat.com>
1836
1837 PR c++/89119 - ICE with value-initialization in template.
1838 * pt.c (tsubst_copy_and_build): Handle RANGE_EXPR.
1839
1840 2019-01-29 Jason Merrill <jason@redhat.com>
1841
1842 PR c++/86943 - wrong code converting lambda to function pointer.
1843 * lambda.c (maybe_add_lambda_conv_op): Use a template-id in the
1844 call. Only forward parms for decltype.
1845 * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Handle CALL_FROM_THUNK_P
1846 specially.
1847 * typeck.c (check_return_expr): Don't mess with a thunk call.
1848
1849 2019-01-28 Jason Merrill <jason@redhat.com>
1850
1851 PR c++/89089 - ICE with [[no_unique_address]].
1852 PR c++/88865 - wrong layout with [[no_unique_address]].
1853 * class.c (check_field_decls): A potentially-overlapping field makes
1854 the class non-layout-POD, but not non-empty.
1855 (end_of_class): Always consider empty data members.
1856 (layout_class_type): Set DECL_SIZE for empty fields.
1857
1858 2019-01-28 Marek Polacek <polacek@redhat.com>
1859
1860 PR c++/88358 - name wrongly treated as type.
1861 * parser.c (cp_parser_direct_declarator): Don't assume a qualified-id
1862 in parameter-list is a type if the function's declarator-id is not
1863 qualified.
1864
1865 2019-01-27 Marek Polacek <polacek@redhat.com>
1866
1867 PR c++/88815 - narrowing conversion lost in decltype.
1868 PR c++/78244 - narrowing conversion in template not detected.
1869 * cp-tree.h (CONSTRUCTOR_IS_DEPENDENT): New.
1870 * pt.c (instantiation_dependent_r): Consider a CONSTRUCTOR with
1871 CONSTRUCTOR_IS_DEPENDENT instantiation-dependent.
1872 * semantics.c (finish_compound_literal): When the compound literal
1873 isn't instantiation-dependent and the type isn't type-dependent,
1874 fall back to the normal processing. Set CONSTRUCTOR_IS_DEPENDENT.
1875
1876 PR c++/89024 - ICE with incomplete enum type.
1877 * call.c (standard_conversion): When converting an
1878 ARITHMETIC_TYPE_P to an incomplete type, return NULL.
1879
1880 2019-01-25 Paolo Carlini <paolo.carlini@oracle.com>
1881
1882 PR c++/88969
1883 * call.c (build_op_delete_call): Implement 7.6.2.5/(10.1).
1884 * decl2.c (coerce_delete_type): Use build_pointer_type instead
1885 of TYPE_POINTER_TO.
1886
1887 2019-01-24 Jason Merrill <jason@redhat.com>
1888
1889 PR c++/89001 - mangling of reference temporaries
1890 * cp-tree.h (struct saved_scope): Add ref_temp_count.
1891 (current_ref_temp_count): New macro.
1892 * mangle.c (mangle_ref_init_variable): Use it.
1893 * typeck2.c (store_init_value): Clear it.
1894 * call.c (make_temporary_var_for_ref_to_temp): Copy public and
1895 comdat.
1896
1897 2019-01-24 Jakub Jelinek <jakub@redhat.com>
1898
1899 PR c++/88976
1900 * semantics.c (finish_omp_cancel): Diagnose more than one if
1901 on #pragma omp cancel with different modifiers. Use
1902 maybe_convert_cond when not in template or build_x_binary_op
1903 otherwise.
1904
1905 2019-01-23 Marek Polacek <polacek@redhat.com>
1906
1907 PR c++/88757 - qualified name treated wrongly as type.
1908 * parser.c (cp_parser_direct_declarator): Don't treat qualified-ids
1909 in parameter-list as types if name lookup for declarator-id didn't
1910 find one or more function templates.
1911
1912 2019-01-23 Jakub Jelinek <jakub@redhat.com>
1913
1914 PR c/44715
1915 * cp-gimplify.c (genericize_cp_loop): Call begin_bc_block only
1916 after genericizing cond and incr expressions.
1917
1918 PR c++/88984
1919 * cp-gimplify.c (genericize_switch_stmt): Move cond genericization
1920 before the begin_bc_block call.
1921
1922 2019-01-21 Jason Merrill <jason@redhat.com>
1923
1924 PR c++/87893 - constexpr ctor ICE on ARM.
1925 PR c++/88293 - ICE with comma expression.
1926 * constexpr.c (initialized_type): Don't shortcut non-void type.
1927 Handle COMPOUND_EXPR.
1928 (cxx_eval_outermost_constant_expr): Return early for void type.
1929
1930 2019-01-21 Jakub Jelinek <jakub@redhat.com>
1931
1932 PR c++/88949
1933 * optimize.c (cxx_copy_decl): New function.
1934 (clone_body): Use it instead of copy_decl_no_change.
1935
1936 PR sanitizer/88901
1937 * typeck.c (cp_build_binary_op): Don't instrument
1938 SANITIZE_POINTER_COMPARE if processing_template_decl.
1939 (pointer_diff): Similarly for SANITIZE_POINTER_SUBTRACT.
1940
1941 2019-01-18 Jason Merrill <jason@redhat.com>
1942
1943 PR c++/88875 - error with explicit list constructor.
1944 * call.c (reference_binding): Don't modify EXPR. Set
1945 need_temporary_p on the ck_user conversion for a temporary.
1946 (convert_like_real): Check it.
1947
1948 2019-01-18 H.J. Lu <hongjiu.lu@intel.com>
1949
1950 PR c/51628
1951 PR c/88664
1952 * call.c (convert_for_arg_passing): Upate the
1953 warn_for_address_or_pointer_of_packed_member call.
1954 * typeck.c (convert_for_assignment): Likewise.
1955
1956 2019-01-17 Jason Merrill <jason@redhat.com>
1957
1958 PR c++/86205 - ICE with ?: of throw and template-id.
1959 * pt.c (resolve_nondeduced_context_or_error): Split out from...
1960 * typeck.c (decay_conversion): ...here.
1961 * call.c (build_conditional_expr_1): Use it.
1962
1963 PR c++/86740, ICE with constexpr if and nested generic lambdas.
1964 * tree.c (cp_walk_subtrees): Handle LAMBDA_EXPR.
1965
1966 2019-01-17 Paolo Carlini <paolo.carlini@oracle.com>
1967
1968 * decl.c (grokdeclarator): Use typespec_loc in error messages
1969 about 'auto' and trailing return type.
1970
1971 2019-01-17 David Malcolm <dmalcolm@redhat.com>
1972
1973 PR c++/88699
1974 * class.c (add_method): Don't use DECL_DESTRUCTOR_P on
1975 USING_DECLs.
1976
1977 2019-01-17 Nathan Sidwell <nathan@acm.org>
1978
1979 PR c++/86610
1980 * semantics.c (process_outer_var_ref): Only skip dependent types
1981 in templates.
1982
1983 2019-01-17 Alexandre Oliva <aoliva@redhat.com>
1984
1985 PR c++/87768
1986 * cp-tree.h (saved_scope): Add suppress_location_wrappers.
1987 * name-lookup.c (do_push_to_top_level): Save and reset it.
1988 (do_pop_from_top_level): Restore it.
1989
1990 PR c++/86648
1991 * pt.c (make_template_placeholder): Use auto_identifier.
1992 (is_auto): Drop CLASS_PLACEHOLDER_TEMPLATE test.
1993 * error.c (dump_type): Handle template placeholders.
1994 * cxx-pretty-print.c (pp_cx_unqualified_id): Likewise.
1995
1996 PR c++/88146
1997 * cvt.c (convert_to_void): Handle all cdtor calls as if
1998 returning void.
1999
2000 2019-01-16 Paolo Carlini <paolo.carlini@oracle.com>
2001
2002 * decl.c (grokdeclarator): Use locations[ds_storage_class] in
2003 error messages about ill-formed uses of mutable.
2004
2005 2019-01-16 Marek Polacek <polacek@redhat.com>
2006
2007 PR c++/78244 - narrowing conversion in template not detected.
2008 * call.c (perform_implicit_conversion_flags): Set
2009 IMPLICIT_CONV_EXPR_BRACED_INIT.
2010 * cp-tree.h (IMPLICIT_CONV_EXPR_BRACED_INIT): New.
2011 * pt.c (tsubst_copy_and_build): Use it.
2012
2013 2019-01-15 David Malcolm <dmalcolm@redhat.com>
2014
2015 PR c++/88795
2016 * pt.c (build_deduction_guide): Bail out if tsubst_arg_types
2017 fails.
2018
2019 2019-01-15 Paolo Carlini <paolo.carlini@oracle.com>
2020
2021 * decl.c (start_decl): Improve error location.
2022 * decl2.c (grokfield): Likewise.
2023
2024 2019-01-15 Paolo Carlini <paolo.carlini@oracle.com>
2025
2026 * decl.c (grokdeclarator): Move further up the location_t loc
2027 declaration and use the location when building a TYPE_DECL for
2028 a typedef name.
2029 * decl2.c (grokbitfield): Use DECL_SOURCE_LOCATION in the error
2030 about an ill-formed bit-field as typedef.
2031
2032 2019-01-14 Marek Polacek <polacek@redhat.com>
2033
2034 PR c++/88830 - ICE with abstract class.
2035 * decl2.c (maybe_emit_vtables): Check CLASSTYPE_LAZY_DESTRUCTOR.
2036 Fix formatting.
2037
2038 PR c++/88825 - ICE with bogus function return type deduction.
2039 * typeck.c (can_do_nrvo_p): Check error_mark_node.
2040
2041 2019-01-14 Tom Honermann <tom@honermann.net>
2042
2043 Implement P0482R5, char8_t: A type for UTF-8 characters and strings
2044 * cvt.c (type_promotes_to): Handle char8_t promotion.
2045 * decl.c (grokdeclarator): Handle invalid type specifier
2046 combinations involving char8_t.
2047 * lex.c (init_reswords): Add char8_t as a reserved word.
2048 * mangle.c (write_builtin_type): Add name mangling for char8_t (Du).
2049 * parser.c (cp_keyword_starts_decl_specifier_p)
2050 (cp_parser_simple_type_specifier): Recognize char8_t as a simple
2051 type specifier.
2052 (cp_parser_string_literal): Use char8_array_type_node for the type
2053 of CPP_UTF8STRING.
2054 (cp_parser_set_decl_spec_type): Tolerate char8_t typedefs in system
2055 headers.
2056 * rtti.c (emit_support_tinfos): type_info support for char8_t.
2057 * tree.c (char_type_p): Recognize char8_t as a character type.
2058 * typeck.c (string_conv_p): Handle conversions of u8 string
2059 literals of char8_t type.
2060 (check_literal_operator_args): Handle UDLs with u8 string literals
2061 of char8_t type.
2062 * typeck2.c (ordinary_char_type_p): New.
2063 (digest_init_r): Disallow initializing a char array with a u8 string
2064 literal.
2065
2066 2019-01-14 Martin Liska <mliska@suse.cz>
2067
2068 PR gcov-profile/88263
2069 * decl2.c (get_tls_wrapper_fn): Use DECL_SOURCE_LOCATION
2070 as location of the TLS wrapper.
2071
2072 2019-01-12 Paolo Carlini <paolo.carlini@oracle.com>
2073
2074 * decl.c (cp_finish_decl): Improve error location.
2075 * decl2.c (grokfield): Likewise, improve two locations.
2076
2077 2019-01-11 Marek Polacek <polacek@redhat.com>
2078
2079 PR c++/88692, c++/87882 - -Wredundant-move false positive with *this.
2080 * typeck.c (maybe_warn_pessimizing_move): Return if ARG isn't
2081 ADDR_EXPR.
2082
2083 2019-01-11 Jason Merrill <jason@redhat.com>
2084
2085 PR c++/88312 - pack expansion of decltype.
2086 * pt.c (instantiation_dependent_r): A template non-type parameter
2087 pack is instantiation-dependent.
2088
2089 2019-01-11 Jason Merrill <jason@redhat.com>
2090
2091 PR c++/88613 - ICE with use of const var in lambda.
2092 * expr.c (mark_use): Fix location wrapper handling.
2093 * cp-gimplify.c (cp_fold_maybe_rvalue): Call mark_rvalue_use.
2094
2095 2019-01-11 Tobias Burnus <burnus@net-b.de>
2096
2097 PR C++/88114
2098 * decl2.c (maybe_emit_vtables): If needed, generate code for
2099 the destructor of an abstract class.
2100 (mark_used): Update comment for older function-name change.
2101
2102 2019-01-11 Paolo Carlini <paolo.carlini@oracle.com>
2103
2104 * decl.c (start_decl): Improve error location.
2105 (grokdeclarator): Likewise, improve two locations.
2106
2107 2019-01-09 Sandra Loosemore <sandra@codesourcery.com>
2108
2109 PR other/16615
2110
2111 * cp-tree.h: Mechanically replace "can not" with "cannot".
2112 * parser.c: Likewise.
2113 * pt.c: Likewise.
2114
2115 2019-01-08 Paolo Carlini <paolo.carlini@oracle.com>
2116
2117 * decl.c (grok_reference_init): Improve error location.
2118 (grokdeclarator): Likewise, improve two locations.
2119
2120 2019-01-08 Marek Polacek <polacek@redhat.com>
2121
2122 PR c++/88538 - braced-init-list in template-argument-list.
2123 * parser.c (cp_parser_template_argument): Handle braced-init-list when
2124 in C++20.
2125
2126 PR c++/88548 - this accepted in static member functions.
2127 * parser.c (cp_debug_parser): Adjust printing of
2128 local_variables_forbidden_p.
2129 (cp_parser_new): Set local_variables_forbidden_p to 0 rather than false.
2130 (cp_parser_primary_expression): When checking
2131 local_variables_forbidden_p, use THIS_FORBIDDEN or
2132 LOCAL_VARS_FORBIDDEN.
2133 (cp_parser_lambda_body): Update the type of
2134 local_variables_forbidden_p. Set it to 0 rather than false.
2135 (cp_parser_condition): Adjust call to cp_parser_declarator.
2136 (cp_parser_explicit_instantiation): Likewise.
2137 (cp_parser_init_declarator): Likewise.
2138 (cp_parser_declarator): New parameter. Use it.
2139 (cp_parser_direct_declarator): New parameter. Use it to set
2140 local_variables_forbidden_p. Adjust call to cp_parser_declarator.
2141 (cp_parser_type_id_1): Adjust call to cp_parser_declarator.
2142 (cp_parser_parameter_declaration): Likewise.
2143 (cp_parser_default_argument): Update the type of
2144 local_variables_forbidden_p. Set it to LOCAL_VARS_AND_THIS_FORBIDDEN
2145 rather than true.
2146 (cp_parser_member_declaration): Tell cp_parser_declarator if we saw
2147 'static' or 'friend'.
2148 (cp_parser_exception_declaration): Adjust call to cp_parser_declarator.
2149 (cp_parser_late_parsing_default_args): Update the type of
2150 local_variables_forbidden_p. Set it to LOCAL_VARS_AND_THIS_FORBIDDEN
2151 rather than true.
2152 (cp_parser_cache_defarg): Adjust call to cp_parser_declarator.
2153 (cp_parser_objc_class_ivars): Likewise.
2154 (cp_parser_objc_struct_declaration): Likewise.
2155 (cp_parser_omp_for_loop_init): Likewise.
2156 * parser.h (cp_parser): Change the type of local_variables_forbidden_p
2157 to unsigned char.
2158 (LOCAL_VARS_FORBIDDEN, LOCAL_VARS_AND_THIS_FORBIDDEN, THIS_FORBIDDEN):
2159 Define.
2160
2161 2019-01-08 Paolo Carlini <paolo.carlini@oracle.com>
2162
2163 * decl.c (start_decl): Improve permerror location.
2164
2165 2019-01-08 Jonathan Wakely <jwakely@redhat.com>
2166 Jakub Jelinek <jakub@redhat.com>
2167
2168 PR c++/88554
2169 * decl.c (finish_function): For -Wreturn-type don't add a return *this;
2170 fixit hint if current_class_ref is NULL. Use a single if instead of
2171 two nested ones.
2172
2173 2019-01-07 Paolo Carlini <paolo.carlini@oracle.com>
2174
2175 * decl.c (start_decl): Improve two error_at locations.
2176 (expand_static_init): Likewise.
2177
2178 2019-01-07 Marek Polacek <polacek@redhat.com>
2179
2180 PR c++/88741 - wrong error with initializer-string.
2181 * decl.c (cp_complete_array_type): Strip any location wrappers.
2182
2183 2019-01-07 Bernd Edlinger <bernd.edlinger@hotmail.de>
2184
2185 PR c++/88261
2186 PR c++/69338
2187 PR c++/69696
2188 PR c++/69697
2189 * cp-tree.h (LOOKUP_ALLOW_FLEXARRAY_INIT): New flag value.
2190 * typeck2.c (digest_init_r): Raise an error for non-static
2191 initialization of a flexible array member.
2192 (process_init_constructor, massage_init_elt,
2193 process_init_constructor_array, process_init_constructor_record,
2194 process_init_constructor_union, process_init_constructor): Add the
2195 flags parameter and pass it thru.
2196 (store_init_value): Pass LOOKUP_ALLOW_FLEXARRAY_INIT parameter to
2197 digest_init_flags for static decls.
2198
2199 2019-01-07 Jakub Jelinek <jakub@redhat.com>
2200
2201 PR c++/85052
2202 * cp-tree.h (cp_build_vec_convert): Declare.
2203 * parser.c (cp_parser_postfix_expression): Parse
2204 __builtin_convertvector.
2205 * constexpr.c: Include fold-const-call.h.
2206 (cxx_eval_internal_function): Handle IFN_VEC_CONVERT.
2207 (potential_constant_expression_1): Likewise.
2208 * semantics.c (cp_build_vec_convert): New function.
2209 * pt.c (tsubst_copy_and_build): Handle CALL_EXPR to
2210 IFN_VEC_CONVERT.
2211
2212 2019-01-03 Jakub Jelinek <jakub@redhat.com>
2213
2214 PR c++/88636
2215 * decl.c (builtin_function_1): Return result of pushdecl_top_level
2216 or pushdecl rather than decl.
2217
2218 2019-01-03 Paolo Carlini <paolo.carlini@oracle.com>
2219
2220 * tree.c (handle_nodiscard_attribute): Improve warning location.
2221
2222 2019-01-02 Marek Polacek <polacek@redhat.com>
2223
2224 PR c++/88612 - ICE with -Waddress-of-packed-member.
2225 * call.c (convert_for_arg_passing): Only give warnings with tf_warning.
2226 * typeck.c (convert_for_assignment): Likewise.
2227
2228 PR c++/88631 - CTAD failing for value-initialization.
2229 * typeck2.c (build_functional_cast): Try deducing the template
2230 arguments even if there are no arguments to deduce from.
2231
2232 2019-01-01 Jakub Jelinek <jakub@redhat.com>
2233
2234 Update copyright years.
2235 \f
2236 Copyright (C) 2019 Free Software Foundation, Inc.
2237
2238 Copying and distribution of this file, with or without modification,
2239 are permitted in any medium without royalty provided the copyright
2240 notice and this notice are preserved.