* cp-tree.h (TYPE_HAS_NONTRIVIAL_DESTRUCTOR): Fix a typo.
[official-gcc.git] / gcc / cp / ChangeLog
blobae3db6f046088737bcf2247af4a88c37ce31dc5a
1 2019-05-30  Marek Polacek  <polacek@redhat.com>
3         * cp-tree.h (TYPE_HAS_NONTRIVIAL_DESTRUCTOR): Fix a typo.
5 2019-05-31  Paolo Carlini  <paolo.carlini@oracle.com>
7         * decl.c (grokdeclarator): Use declarator->id_loc in five
8         error_at calls.
10 2019-05-29  Jakub Jelinek  <jakub@redhat.com>
12         PR c++/90598
13         * tree.c (lvalue_kind): Return clk_none for expressions with
14         with VOID_TYPE_P.
16 2019-05-29  Paolo Carlini  <paolo.carlini@oracle.com>
18         PR c++/89875
19         * parser.c (cp_parser_sizeof_operand): When the type-id production
20         did not work out commit to the tentative parse.
22 2019-05-29  Jakub Jelinek  <jakub@redhat.com>
24         P1091R3 - Extending structured bindings to be more like var decls
25         P1381R1 - Reference capture of structured bindings
26         * decl.c (cp_maybe_mangle_decomp): Handle TREE_STATIC decls even at
27         function scope.
28         (cp_finish_decomp): Copy over various decl properties from decl to
29         v[i] in the tuple case.
30         (grokdeclarator): Allow static, thread_local and __thread for C++2a
31         and use pedwarn instead of error for older standard revisions.
32         Make other structured binding diagnostic messages more i18n friendly.
34 2019-05-28  Nathan Sidwell  <nathan@acm.org>
36         * decl.c (duplicate_decls): Assert a template newdecl has no
37         specializations.
39 2019-05-28  Marek Polacek  <polacek@redhat.com>
41         PR c++/90548 - ICE with generic lambda and empty pack.
42         * pt.c (tsubst_copy_and_build): Handle pack expansion properly.
44 2019-05-28  Nathan Sidwell  <nathan@acm.org>
46         * cp-tree.h (make_anon_name): Drop declaration.
47         (TYPE_UNNAMED_P): Use IDENTIFIER_ANON_P.
48         * cp-lang.c (cxx_dwarf_name): Likewise.
49         * class.c (find_flexarrays): Likewise.
50         * decl.c (name_unnamed_type, xref_tag_1): Likewise.
51         * error.c (dump_aggr_type): Likewise.
52         * pt.c (push_template_decl_real): Likewise.
53         * name-lookup.c (consider_binding_level): Likewise.
54         (anon_cnt, make_anon_name): Delete.
56 2019-05-25  Marek Polacek  <polacek@redhat.com>
58         PR c++/90572 - wrong disambiguation in friend declaration.
59         * parser.c (cp_parser_constructor_declarator_p): Don't allow missing
60         typename for friend declarations.
62 2019-05-23  Jonathan Wakely  <jwakely@redhat.com>
64         * cp-tree.h (CP_AGGREGATE_TYPE_P): Fix whitespace.
66         * init.c (std_placement_new_fn_p): Remove outdated TODO comment that
67         was resolved by r254694.
69 2019-05-22  Jason Merrill  <jason@redhat.com>
71         PR c++/20408 - unnecessary code for empty struct.
72         * call.c (build_call_a): Use simple_empty_class_p.
74         PR c++/86485 - -Wmaybe-unused with empty class ?:
75         * cp-gimplify.c (simple_empty_class_p): Also true for MODIFY_EXPR.
77 2019-05-21  Paolo Carlini  <paolo.carlini@oracle.com>
79         * parser.c (cp_parser_template_declaration_after_parameters): Use
80         DECL_SOURCE_LOCATION in literal operator template errors.
82 2019-05-21  Paolo Carlini  <paolo.carlini@oracle.com>
84         PR c++/67184
85         PR c++/69445
86         * call.c (build_over_call): Devirtualize when the final overrider
87         comes from the base.
89 2019-05-21  Nathan Sidwell  <nathan@acm.org>
91         * name-lookup.c (do_nonmember_using_decl): Drop INSERT_P
92         parameter.  Document.
93         (finish_nonmember_using_decl): Adjust do_nonmember_using_decl
94         calls.  Remove stray FIXME comment.
96         * name-lookup.h (struct cp_binding_level): Drop usings field.
97         (finish_namespace_using_decl, finish_local_using_decl): Replace with ...
98         (finish_nonmember_using_decl): ... this.
99         * name-lookup.c (push_using_decl_1, push_using_decl):
100         (do_nonmember_using_decl): ... here.  Add INSERT_P arg.  Reimplement.
101         (validate_nonmember_using_decl, finish_namespace_using_decl)
102         (finish_local_using_decl): Replace with ...
103         (finish_nonmember_using_decl): ... this.  Drop DECL parm.
104         * parser.c (cp_parser_using_declaration): Don't do lookup here.
105         * pt.c (tsubst_expr): Do not do using decl lookup here.
107 2019-05-21  Eric Botcazou  <ebotcazou@adacore.com>
109         * decl2.c (cpp_check) <IS_ASSIGNMENT_OPERATOR>: New case.
111 2019-05-20  Marek Polacek  <polacek@redhat.com>
113         CWG 2094 - volatile scalars are trivially copyable.
114         PR c++/85679
115         * tree.c (trivially_copyable_p): Don't check CP_TYPE_VOLATILE_P for
116         scalar types.
118 2019-05-20  Marek Polacek  <polacek@redhat.com>
120         * pt.c (convert_template_argument): Add a diagnostic for the
121         [temp.arg]/2 ambiguity case.
123         * name-lookup.c (finish_using_directive): Don't issue inform() if the
124         warning didn't trigger.  Add quoting.  Tweak the inform message.
126 2019-05-20  Paolo Carlini  <paolo.carlini@oracle.com>
128         * cp-tree.h: Remove remnants of CONV_NONCONVERTING.
130 2019-05-20  Nathan Sidwell  <nathan@acm.org>
132         * name-lookup.c (finish_namespace_using_directive)
133         (finish_local_using_directive): Merge to ...
134         (finish_using_directive): ... here.  Handle both contexts.
135         * name-lookup.h (finish_namespace_using_directive)
136         (finish_local_using_directive): Replace with ...
137         (finish_using_directive): ... this.
138         * parser.c (cp_parser_using_directive): Adjust.
139         * pt.c (tsubst_expr): Likewise.
141         * cp-tree.h (struct lang_decl_ns): Remove usings field.
142         (DECL_NAMESPACE_USING): Delete.
143         * name-lookup.c (name_lookup::search_usings): Use namespace's
144         binding scope.
145         (name_lookup::queue_namespae): Likewise.
146         (finish_namespace_using_directive, push_namespace): Likewise.
147         (has_using_namespace_std_directive): Just search the entire
148         binding stack.
150 2019-05-20  Jonathan Wakely  <jwakely@redhat.com>
152         PR c++/90532 Ensure __is_constructible(T[]) is false
153         * method.c (is_xible_helper): Return error_mark_node for construction
154         of an array of unknown bound.
156 2019-05-17  Thomas Schwinge  <thomas@codesourcery.com>
158         PR c++/89433
159         * parser.c (cp_finalize_oacc_routine): Rework checking if already
160         marked with an OpenACC 'routine' directive.
162         PR c++/89433
163         * parser.c (cp_parser_oacc_routine)
164         (cp_parser_late_parsing_oacc_routine): Normalize order of clauses.
165         (cp_finalize_oacc_routine): Call oacc_verify_routine_clauses.
167         PR c++/89433
168         * parser.c (cp_finalize_oacc_routine): Refer to OpenACC 'routine'
169         clauses from "omp declare target" attribute.
171 2019-05-16  Martin Sebor  <msebor@redhat.com>
173         * call.c (print_z_candidate): Wrap diagnostic text in a gettext
174         macro.  Adjust.
175         (print_z_candidates): Same.
176         (build_conditional_expr_1): Quote keywords, operators, and types
177         in diagnostics.
178         (build_op_delete_call): Same.
179         (maybe_print_user_conv_context): Wrap diagnostic text in a gettext
180         macro.
181         (convert_like_real): Same.
182         (convert_arg_to_ellipsis): Quote keywords, operators, and types
183         in diagnostics.
184         (build_over_call): Same.
185         (joust): Break up an overlong line.  Wrap diagnostic text in a gettext
186         macro.
187         * constexpr.c (cxx_eval_check_shift_p): Spell out >= in English.
188         (cxx_eval_constant_expression): Quote keywords, operators, and types
189         in diagnostics.
190         (potential_constant_expression_1): Same.
191         * cp-gimplify.c (cp_genericize_r): Same.
192         * cvt.c (maybe_warn_nodiscard): Quote keywords, operators, and types
193         in diagnostics.
194         (type_promotes_to): Same.
195         * decl.c (check_previous_goto_1): Same.
196         (check_goto): Same.
197         (start_decl): Same.
198         (cp_finish_decl): Avoid parenthesizing a sentence for consistency.
199         (grok_op_properties): Quote keywords, operators, and types
200         in diagnostics.
201         * decl2.c (grokfield): Same.
202         (coerce_delete_type): Same.
203         * except.c (is_admissible_throw_operand_or_catch_parameter): Same.
204         * friend.c (do_friend): Quote C++ tokens.
205         * init.c (build_new_1): Quote keywords, operators, and types
206         in diagnostics.
207         (build_vec_delete_1): Same.
208         (build_delete): Same.
209         * lex.c (parse_strconst_pragma): Same.
210         (handle_pragma_implementation): Same.
211         (unqualified_fn_lookup_error): Same.
212         * mangle.c (write_type): Same.
213         * method.c (defaulted_late_check): Avoid two consecutive punctuators.
214         * name-lookup.c (cp_binding_level_debug): Remove a trailing newline.
215         (pop_everything): Same.
216         * parser.c (cp_lexer_start_debugging): Quote a macro name.
217         in a diagnostic
218         (cp_lexer_stop_debugging): Same.
219         (cp_parser_userdef_numeric_literal): Quote a C++ header name
220         in a diagnostic.
221         (cp_parser_nested_name_specifier_opt): Quote keywords, operators,
222         and types in diagnostics.
223         (cp_parser_question_colon_clause): Same.
224         (cp_parser_asm_definition): Same.
225         (cp_parser_init_declarator): Same.
226         (cp_parser_template_declaration_after_parameters): Avoid capitalizing
227         a sentence in a diagnostic.
228         (cp_parser_omp_declare_reduction): Quote keywords, operators, and types
229         in diagnostics.
230         (cp_parser_transaction): Same.
231         * pt.c (maybe_process_partial_specialization): Replace second call
232         to permerror with inform for consistency with other uses.
233         (expand_integer_pack): Quote keywords, operators, and types
234         in diagnostics.
235         * rtti.c (get_typeid): Quote keywords, operators, and types
236         in diagnostics.
237         (build_dynamic_cast_1): Same.
238         * semantics.c (finish_asm_stmt): Same.
239         (finish_label_decl): Same.
240         (finish_bases): Same.
241         (finish_offsetof): Same.
242         (cp_check_omp_declare_reduction): Same.
243         (finish_decltype_type): Same.
244         * tree.c (handle_init_priority_attribute): Same.  Add detail
245         to diagnostics.
246         (maybe_warn_zero_as_null_pointer_constant): Same.
247         * typeck.c (cp_build_binary_op): Quote keywords, operators, and types
248         in diagnostics.
249         (cp_build_unary_op): Same.
250         (check_for_casting_away_constness): Same.
251         (build_static_cast): Same.
252         (build_const_cast_1): Same.
253         (maybe_warn_about_returning_address_of_local): Same.
254         (check_return_expr): Same.
255         * typeck2.c (abstract_virtuals_error_sfinae): Same.
256         (digest_init_r): Replace a tab with spaces in a diagnostic.
257         (build_functional_cast): Quote keywords, operators, and types
258         in diagnostics.
260 2019-05-15  Jakub Jelinek  <jakub@redhat.com>
262         PR debug/90197
263         * cp-gimplify.c (genericize_cp_loop): Emit a DEBUG_BEGIN_STMT
264         before the condition (or if missing or constant non-zero at the end
265         of the loop.  Emit a DEBUG_BEGIN_STMT before the increment expression
266         if any.  Don't call protected_set_expr_location on incr if it already
267         has a location.
269 2019-05-15  Marek Polacek  <polacek@redhat.com>
271         CWG 2096 - constraints on literal unions.
272         * class.c (check_field_decls): Initialize booleans directly.  A union
273         is literal if at least one of its non-static data members is of
274         non-volatile literal type.
276 2019-05-15  Paolo Carlini  <paolo.carlini@oracle.com>
278         * cp-tree.h (REFERENCE_VLA_OK): Remove.
279         * lambda.c (build_capture_proxy): Remove use of the above.
281 2019-05-15  Paolo Carlini  <paolo.carlini@oracle.com>
283         * call.c (perform_overload_resolution, build_new_method_call_1):
284         Use OVL_P; remove redundant TEMPLATE_DECL checks.
285         * decl.c (grokfndecl): Likewise.
286         * mangle.c (write_expression): Likewise.
287         * parser.c (cp_parser_template_id): Likewise.
288         * pt.c (resolve_overloaded_unification, type_dependent_expression_p):
289         Likewise.
290         * search.c (build_baselink): Likewise.
291         * tree.c (is_overloaded_fn, dependent_name, maybe_get_fns): Likewise.
293 2019-05-14  Paolo Carlini  <paolo.carlini@oracle.com>
295         PR preprocessor/90382
296         * decl.c (grokdeclarator): Fix value assigned to typespec_loc, use
297         min_location.
299 2019-05-13  Jason Merrill  <jason@redhat.com>
301         Use releasing_vec more broadly.
302         * cp-tree.h (struct releasing_vec): Replace get_ref method with
303         operator&.
304         (vec_safe_push, vec_safe_reserve, vec_safe_length, vec_safe_splice):
305         Forwarding functions for releasing_vec.
306         (release_tree_vector): Declare but don't define.
307         * call.c (build_op_delete_call, build_temp, call_copy_ctor)
308         (perform_direct_initialization_if_possible): Use releasing_vec.
309         * constexpr.c (cxx_eval_vec_init_1, cxx_eval_store_expression):
310         Likewise.
311         * cp-gimplify.c (cp_fold): Likewise.
312         * cvt.c (force_rvalue, ocp_convert): Likewise.
313         * decl.c (get_tuple_decomp_init): Likewise.
314         * except.c (build_throw): Likewise.
315         * init.c (perform_member_init, expand_default_init): Likewise.
316         * method.c (do_build_copy_assign, locate_fn_flags): Likewise.
317         * parser.c (cp_parser_userdef_char_literal)
318         (cp_parser_userdef_numeric_literal)
319         (cp_parser_userdef_string_literal)
320         (cp_parser_perform_range_for_lookup)
321         (cp_parser_range_for_member_function, cp_parser_omp_for_loop)
322         (cp_parser_omp_for_loop_init): Likewise.
323         * pt.c (tsubst_copy_and_build, do_class_deduction): Likewise.
324         * semantics.c (calculate_direct_bases, calculate_bases)
325         (finish_omp_barrier, finish_omp_flush, finish_omp_taskwait)
326         (finish_omp_taskyield, finish_omp_cancel)
327         (finish_omp_cancellation_point): Likewise.
328         * tree.c (build_vec_init_elt, strip_typedefs, strip_typedefs_expr)
329         (build_min_non_dep_op_overload): Likewise.
330         * typeck.c (build_function_call_vec, cp_build_function_call_nary)
331         (cp_build_modify_expr): Likewise.
332         * typeck2.c (build_functional_cast): Likewise.
334 2019-05-11  Paolo Carlini  <paolo.carlini@oracle.com>
336         * typeck.c (cp_build_function_call_vec): When mark_used fails
337         unconditionally return error_mark_node.
339 2019-05-10  Paolo Carlini  <paolo.carlini@oracle.com>
341         * decl.c (grokvardecl): Use an accurate location in error message
342         about main as a global variable.
344 2019-05-10  Paolo Carlini  <paolo.carlini@oracle.com>
346         * call.c (build_call_a): Use FUNC_OR_METHOD_TYPE_P.
347         * cp-gimplify.c (cp_fold): Likewise.
348         * cp-objcp-common.c (cp_type_dwarf_attribute): Likewise.
349         * cp-tree.h (TYPE_OBJ_P, TYPE_PTROBV_P): Likewise.
350         * cvt.c (perform_qualification_conversions): Likewise.
351         * decl.c (grokdeclarator): Likewise.
352         * decl2.c (build_memfn_type): Likewise.
353         * mangle.c (canonicalize_for_substitution, write_type): Likewise.
354         * parser.c (cp_parser_omp_declare_reduction): Likewise.
355         * pt.c (check_explicit_specialization, uses_deducible_template_parms,
356         check_cv_quals_for_unify, dependent_type_p_r): Likewise.
357         * rtti.c (ptr_initializer): Likewise.
358         * semantics.c (finish_asm_stmt, finish_offsetof,
359         cp_check_omp_declare_reduction): Likewise.
360         * tree.c (cp_build_qualified_type_real,
361         cp_build_type_attribute_variant, cxx_type_hash_eq,
362         cxx_copy_lang_qualifiers, cp_free_lang_data): Likewise.
363         * typeck.c (structural_comptypes, convert_arguments,
364         cp_build_addr_expr_1, unary_complex_lvalue, cp_build_c_cast,
365         cp_build_modify_expr, comp_ptr_ttypes_real, type_memfn_rqual):
366         Likewise.
368 2019-05-10  Marek Polacek  <polacek@redhat.com>
370         PR c++/78010 - bogus -Wsuggest-override warning on final function.
371         * class.c (check_for_override): Don't warn for final functions.
373 2019-05-10  Jakub Jelinek  <jakub@redhat.com>
375         PR pch/90326
376         * config-lang.in (gtfiles): Remove c-family/c-lex.c, add
377         c-family/c-cppbuiltin.c.
379 2019-05-09  Paolo Carlini  <paolo.carlini@oracle.com>
381         PR c++/90382
382         Revert:
383         2018-04-26  Paolo Carlini  <paolo.carlini@oracle.com>
385         * decl.c (grokdeclarator): Fix value assigned to typespec_loc, use
386         min_location.
388 2019-05-08  Nathan Sidwell  <nathan@acm.org>
390         Kill DECL_SAVED_FUNCTION_DATA .
391         * cp-tree.h (language_function): Remove x_auto_return_pattern.
392         (current_function_auto_return_pattern): Delete.
393         (lang_decl_fn): Replace saved_language_function with
394         saved_auto_return type.
395         (DECL_SAVED_FUNCTION_DATA): Delete.
396         (DECL_SAVED_AUTO_RETURN_TYPE): New.
397         (FNDECL_USED_AUTO): Correct documentation.
398         * decl.c (duplicate_decls): Adjust AUTO return handling.
399         (start_preparsed_function): Replace
400         current_function_auto_return_pattern with
401         DECL_SAVED_AUTO_RETURN_TYPE.  Remove DECL_SAVED_FUNCTION_DATA
402         zapping.
403         (finish_function): Likewise.
404         (save_function_data): Delete.
405         (fndecl_declared_return_type): Reimplement.
406         * mangle.c (write_unqualified_name): Use DECL_SAVED_AUTO_RETURN_TYPE.
407         * method.c (make_thunk, make_alias_for): Likewise.
408         * parser.c (cp_parser_jump_statement): Likewise.
409         * pt.c (do_auto_deduction): Likewise.
410         * typeck.c (check_return_expr): Likewise.
412 2019-05-06  Jason Merrill  <jason@redhat.com>
414         PR c++/90171 - reorganize usual_deallocation_fn_p
415         * call.c (struct dealloc_info): New.
416         (usual_deallocation_fn_p): Take a dealloc_info*.
417         (aligned_deallocation_fn_p, sized_deallocation_fn_p): Remove.
418         (build_op_delete_call): Adjust.
420 2019-05-07  Jason Merrill  <jason@redhat.com>
422         PR c++/86485 - -Wmaybe-unused with empty class ?:
423         * typeck.c (build_static_cast_1): Use cp_build_addr_expr.
425         * pt.c (type_dependent_expression_p): A non-type template parm with
426         a placeholder type is type-dependent.
428 2019-05-06  Marek Polacek  <polacek@redhat.com>
430         PR c++/90265 - ICE with generic lambda.
431         * pt.c (tsubst_copy_and_build): Use a dedicated variable for the last
432         element in the vector.
434 2019-05-03  Martin Liska  <mliska@suse.cz>
436         * call.c (build_aggr_conv): Use is_empty instead of
437         elements () == 0 (and similar usages).
438         * parser.c (cp_parser_lambda_introducer): Likewise.
440 2019-05-02  Nathan Sidwell  <nathan@acm.org>
442         * semantics.c (finish_id_expression_1): Remove unreachable code.
444 2019-05-01  Nathan Sidwell  <nathan@acm.org>
446         * name-lookup.h (get_class_binding_direct): Change final arg to
447         bool.
448         (get_class_binding): Likewise.
449         * name-lookup.c (get_class_binding_direct): Replace TYPE_OR_FNS
450         arg with WANT_TYPE bool.  Simplify.
451         (get_class_binding): Adjust final arg.
452         * decl.c (reshape_init_class): Adjust get_class_binding calls.
454 2019-04-30  Nathan Sidwell  <nathan@acm.org>
456         * cp-objcp-common.c (cp_common_init_ts): Use MARK_TS_EXP for _EXPR
457         nodes.  Call c_common_init_ts.
459 2019-04-29  Nathan Sidwell  <nathan@acm.org>
461         * decl.c (duplicate_decls): Add whitespace, move comments into
462         conditional blocks.
463         * method.c (explain_implicit_non_constexpr): Refactor.
464         * pt.c (check_explicit_specialization): Fix indentation.
465         * semantics.c (process_outer_var_ref): Reformat.
466         (finish_id_expression_1): Use STRIP_TEMPLATE.
468 2019-04-26  Jonathan Wakely  <jwakely@redhat.com>
470         PR c++/90243 - orphaned note in uninstantiated constexpr function
471         * decl.c (check_for_uninitialized_const_var): Suppress notes if no
472         error was shown.
474 2019-04-26  Paolo Carlini  <paolo.carlini@oracle.com>
476         PR c++/90173
477         * decl.c (grokdeclarator): Set type to error_mark_node
478         upon error about template placeholder type non followed
479         by a simple declarator-id.
481 2019-04-26  Paolo Carlini  <paolo.carlini@oracle.com>
483         * decl.c (grokdeclarator): Fix value assigned to typespec_loc, use
484         min_location.
486 2019-04-24  Jason Merrill  <jason@redhat.com>
488         PR c++/90227 - error with template parameter packs.
489         * pt.c (coerce_template_parms): Do add empty pack when
490         require_all_args.
492 2019-04-24  Richard Biener  <rguenther@suse.de>
494         * call.c (null_ptr_cst_p): Order checks according to expensiveness.
495         (conversion_null_warnings): Likewise.
496         * typeck.c (same_type_ignoring_top_level_qualifiers_p): Return
497         early if type1 == type2.
499 2019-04-22  Jason Merrill  <jason@redhat.com>
501         PR c++/87366 - wrong error with alias template.
502         * typeck.c (structural_comptypes): When comparing_specializations,
503         aliases are unequal.
504         (comptypes): When comparing_specializations, do structural
505         comparison.
507 2019-04-19  Jason Merrill  <jason@redhat.com>
509         PR c++/90190 - CTAD with list-constructor.
510         * pt.c (do_class_deduction): Don't try the single element deduction
511         if the single element is also a braced list.
513         PR c++/90171 - ICE with destroying delete with size_t parm.
514         * call.c (sized_deallocation_fn_p): New.  Use it instead of
515         second_parm_is_size_t in most cases.
516         (second_parm_is_size_t): Don't check for aligned.
518 2019-04-19  Paolo Carlini  <paolo.carlini@oracle.com>
520         PR c++/89900
521         * pt.c (fn_type_unification): When handling null explicit
522         arguments do not special case non-parameter packs.
524 2019-04-19  Jakub Jelinek  <jakub@redhat.com>
526         PR c++/90138
527         * pt.c (process_template_parm): Set decl to pushdecl result.  If
528         !is_non_type, also set parm to that.
530         PR c/89888
531         * decl.c (struct cp_switch): Remove outside_range_p member.
532         (push_switch): Don't clear it.
533         (pop_switch): Adjust c_do_switch_warnings caller.
534         (finish_case_label): Adjust c_add_case_label caller.
536         PR c++/90108
537         * decl.c (duplicate_decls): If remove is main variant and
538         DECL_ORIGINAL_TYPE is some other type, remove a DECL_ORIGINAL_TYPE
539         variant that has newdecl as TYPE_NAME if any.
541 2019-04-18  Jason Merrill  <jason@redhat.com>
543         PR c++/87554 - ICE with extern template and reference member.
544         * decl.c (cp_finish_decl): Don't set DECL_INITIAL of external vars.
546 2019-04-17  Jason Merrill  <jason@redhat.com>
548         PR c++/90047 - ICE with enable_if alias template.
549         * pt.c (tsubst_decl) [TYPE_DECL]: Don't put an erroneous decl in the
550         hash table when we're in SFINAE context.
552 2019-04-17  Marek Polacek  <polacek@redhat.com>
554         PR c++/90124 - bogus error with incomplete type in decltype.
555         * typeck.c (build_class_member_access_expr): Check
556         cp_unevaluated_operand.
558 2019-04-12  Jakub Jelinek  <jakub@redhat.com>
560         PR c/89933
561         * decl.c (duplicate_decls): When newdecl's type is its main variant,
562         don't try to remove it from the variant list, but instead assert
563         it has no variants.
565 2019-04-12  Martin Sebor  <msebor@redhat.com>
567         PR c/88383
568         PR c/89288
569         * parser.c (cp_parser_has_attribute_expression): Handle assignment
570         expressions.
572 2019-04-12  Jason Merrill  <jason@redhat.com>
574         * call.c (null_member_pointer_value_p): Handle an empty CONSTRUCTOR
575         of PMF type.
577 2019-04-12  Marek Polacek  <polacek@redhat.com>
579         * except.c (build_noexcept_spec): Use build_converted_constant_bool_expr
580         instead of perform_implicit_conversion_flags.
582         PR c++/87603 - constexpr functions are no longer noexcept.
583         * constexpr.c (is_sub_constant_expr): Remove unused function.
584         * cp-tree.h (is_sub_constant_expr): Remove declaration.
585         * except.c (check_noexcept_r): Don't consider a call to a constexpr
586         function noexcept.
588 2019-04-11  Jakub Jelinek  <jakub@redhat.com>
590         PR translation/90035
591         * parser.h (struct cp_parser): Add
592         type_definition_forbidden_message_arg member.
593         * parser.c (cp_debug_parser): Print it.
594         (cp_parser_check_type_definition): Pass
595         parser->type_definition_forbidden_message_arg as second argument to
596         error.
597         (cp_parser_has_attribute_expression, cp_parser_sizeof_operand): Set
598         parser->type_definition_forbidden_message_arg and use G_() with
599         %qs for parser->type_definition_forbidden_message instead of
600         building untranslatable message using concat.
602 2019-04-09  Jakub Jelinek  <jakub@redhat.com>
604         PR translation/90011
605         * typeck2.c (check_narrowing): Remove trailing space from diagnostics.
607 2019-04-08  Marek Polacek  <polacek@redhat.com>
609         * typeck2.c (digest_init_r): Don't condition the object slicing warning
610         on flag_checking.
612 2019-04-08  Paolo Carlini  <paolo.carlini@oracle.com>
614         PR c++/89914
615         * semantics.c (trait_expr_value): Don't use TYPE_NOTHROW_P
616         when maybe_instantiate_noexcept fails.
617         (classtype_has_nothrow_assign_or_copy_p): Likewise.
618         * method.c (implicitly_declare_fn): Avoid passing error_mark_node
619         to build_exception_variant.
621 2019-04-05  Marek Polacek  <polacek@redhat.com>
623         PR c++/87145 - bogus error converting class type in template arg list.
624         * pt.c (convert_nontype_argument): Don't call
625         build_converted_constant_expr if it could involve calling a conversion
626         function with a instantiation-dependent constructor as its argument.
628 2019-04-05  Martin Sebor  <msebor@redhat.com>
630         PR bootstrap/89980
631         * decl.c (reshape_init_array_1): Avoid treating empty strings
632         as zeros in array initializers.
633         Use trivial_type_p () instead of TYPE_HAS_TRIVIAL_DFLT().
635 2019-04-04  Jason Merrill  <jason@redhat.com>
637         PR c++/89948 - ICE with break in statement-expr.
638         * constexpr.c (cxx_eval_statement_list): Jumping out of a
639         statement-expr is non-constant.
641 2019-04-04  Jason Merrill  <jason@redhat.com>
643         PR c++/89966 - error with non-type auto tparm.
644         * pt.c (do_auto_deduction): Clear tf_partial.
646 2019-04-04  Jason Merrill  <jason@redhat.com>
648         PR c++/86986 - ICE with TTP with parameter pack.
649         * pt.c (coerce_template_parameter_pack): Only look at the type of a
650         non-type parameter pack.
651         (fixed_parameter_pack_p_1): Don't recurse into the type of a
652         non-type parameter pack.
653         (coerce_template_template_parms): Call add_outermost_template_args.
655 2019-04-04  Martin Sebor  <msebor@redhat.com>
657         PR c++/89974
658         PR c++/89878
659         PR c++/89833
660         PR c++/47488
661         * decl.c (reshape_init_array_1): Strip trailing zero-initializers
662         from arrays of trivial type and known size.
663         * mangle.c (write_expression): Convert braced initializer lists
664         to STRING_CSTs.
665         (write_expression): Trim trailing zero-initializers from arrays
666         of trivial type.
667         (write_template_arg_literal): Mangle strings the same as braced
668         initializer lists.
670 2019-04-03  Jason Merrill  <jason@redhat.com>
672         PR c++/81866 - ICE with member template and default targ.
673         * pt.c (tsubst_template_decl): Handle getting a type from
674         retrieve_specialization.
676         PR c++/86586 - -fcompare-debug=-Wsign-compare.
677         * typeck.c (cp_build_binary_op): Don't fold for -Wsign-compare.
679         PR c++/89331 - ICE with offsetof in incomplete class.
680         * semantics.c (finish_offsetof): Handle error_mark_node.
681         * typeck.c (build_class_member_access_expr): Call
682         complete_type_or_maybe_complain before converting to base.
684         PR c++/89917 - ICE with lambda in variadic mem-init.
685         * pt.c (make_pack_expansion): Change type_pack_expansion_p to false.
687 2019-04-01  Jason Merrill  <jason@redhat.com>
689         PR c++/86946 - ICE with function call in template argument.
690         DR 1321
691         * pt.c (iterative_hash_template_arg) [CALL_EXPR]: Use
692         dependent_name.
694 2019-04-01  Paolo Carlini  <paolo.carlini@oracle.com>
696         PR c++/62207
697         * pt.c (tsubst_copy): Deal with lookup_name not returing a variable.
699 2019-03-31  Marek Polacek  <polacek@redhat.com>
701         PR c++/89852 - ICE with C++11 functional cast with { }.
702         * constexpr.c (fold_non_dependent_expr_template): New static function
703         broken out of...
704         (fold_non_dependent_expr): ...here.
705         (fold_non_dependent_init): New function.
706         * cp-tree.h (fold_non_dependent_init): Declare.
707         * typeck2.c (massage_init_elt): Call fold_non_dependent_init instead
708         of fold_non_dependent_expr.  Don't call maybe_constant_init.
710 2019-03-30  Jason Merrill  <jason@redhat.com>
712         PR c++/89744 - ICE with specialization of member class template.
713         * pt.c (lookup_template_class_1): If the partial instantiation is
714         explicitly specialized, adjust.
715         (maybe_process_partial_specialization): Also adjust
716         CLASSTYPE_TI_ARGS.
718 2019-03-29  Jakub Jelinek  <jakub@redhat.com>
720         PR sanitizer/89869
721         * typeck.c: Include gimplify.h.
722         (cp_build_modify_expr) <case COND_EXPR>: Unshare rhs before using it
723         for second time.  Formatting fixes.
725 2019-03-29  Marek Polacek  <polacek@redhat.com>
727         PR c++/89876 - ICE with deprecated conversion.
728         * call.c (convert_like_real): Only give warnings with tf_warning.
730 2019-03-28  Marek Polacek  <polacek@redhat.com>
732         PR c++/89612 - ICE with member friend template with noexcept.
733         * pt.c (maybe_instantiate_noexcept): For function templates, use their
734         template result (function decl).  Don't set up local specializations.
735         Temporarily turn on processing_template_decl.  Update the template type
736         too.
738         PR c++/89836 - bool constant expression and explicit conversions.
739         * call.c (build_converted_constant_expr_internal): New function,
740         renamed from...
741         (build_converted_constant_expr): ...this.  New.
742         (build_converted_constant_bool_expr): New.
743         * cp-tree.h (build_converted_constant_bool_expr): Declare.
744         * decl.c (build_explicit_specifier): Call
745         build_converted_constant_bool_expr.
747 2019-03-28  Jakub Jelinek  <jakub@redhat.com>
749         PR c++/89785
750         * constexpr.c (struct check_for_return_continue_data): New type.
751         (check_for_return_continue): New function.
752         (potential_constant_expression_1) <case SWITCH_STMT>: Walk
753         SWITCH_STMT_BODY to find RETURN_EXPRs or CONTINUE_STMTs not nested
754         in loop bodies and set *jump_target to that if found.
756 2019-03-27  Jason Merrill  <jason@redhat.com>
758         PR c++/89831 - error with qualified-id in const member function.
759         * semantics.c (finish_non_static_data_member): Use object cv-quals
760         in scoped case, too.
762         PR c++/89421 - ICE with lambda in template parameter list.
763         * parser.c (cp_parser_lambda_expression): Also reject a lambda in a
764         template parameter list before C++20.
765         * pt.c (type_dependent_expression_p): True for LAMBDA_EXPR.
766         * semantics.c (begin_class_definition): Restore error about defining
767         non-lambda class in template parm list.
769 2019-03-26  Jason Merrill  <jason@redhat.com>
771         PR c++/86932 - missed SFINAE with empty pack.
772         * pt.c (coerce_template_parms): Don't add an empty pack if
773         tf_partial.
774         (fn_type_unification): Pass tf_partial to coerce_template_parms.
776         PR c++/86429 - constexpr variable in lambda.
777         PR c++/82643
778         PR c++/87327
779         * constexpr.c (cxx_eval_constant_expression): In a lambda function,
780         try evaluating the captured variable directly.
782 2019-03-26  Jakub Jelinek  <jakub@redhat.com>
784         PR c++/89796
785         * semantics.c (finish_omp_atomic): Add warning_sentinel for
786         -Wunused-value around finish_expr_stmt call.
788 2019-03-25  Paolo Carlini  <paolo.carlini@oracle.com>
790         PR c++/84661
791         PR c++/85013
792         * parser.c (cp_parser_binary_expression): Don't call cp_fully_fold
793         to undo the disabling of warnings.
795 2019-03-25  Jason Merrill  <jason@redhat.com>
797         PR c++/87748 - substitution failure error with decltype.
798         * pt.c (most_specialized_partial_spec): Clear
799         processing_template_decl.
801 2019-03-25  Marek Polacek  <polacek@redhat.com>
803         PR c++/89214 - ICE when initializing aggregates with bases.
804         * typeck2.c (digest_init_r): Warn about object slicing instead of
805         crashing.
807         PR c++/89705 - ICE with reference binding with conversion function.
808         * call.c (reference_binding): If the result of the conversion function
809         is a prvalue of non-class type, use the cv-unqualified type.
811 2019-03-25  Nathan Sidwell  <nathan@acm.org>
813         * lambda.c (maybe_add_lambda_conv_op): Don't add to comdat group.
815 2019-03-22  Jakub Jelinek  <jakub@redhat.com>
817         PR c++/60702
818         * cp-tree.h (get_tls_wrapper_fn): Remove declaration.
819         (maybe_get_tls_wrapper_call): Declare.
820         * decl2.c (get_tls_wrapper_fn): Make static.
821         (maybe_get_tls_wrapper_call): New function.
822         * typeck.c (build_class_member_access_expr): Handle accesses to TLS
823         variables.
824         * semantics.c (finish_qualified_id_expr): Likewise.
825         (finish_id_expression_1): Use maybe_get_tls_wrapper_call.
826         * pt.c (tsubst_copy_and_build): Likewise.
828         PR c++/87481
829         * constexpr.c (struct constexpr_ctx): Add constexpr_ops_count member.
830         (cxx_eval_constant_expression): When not skipping, not constant class
831         or location wrapper, increment *ctx->constexpr_ops_count and if it is
832         above constexpr_loop_nest_limit, diagnose failure.
833         (cxx_eval_outermost_constant_expr): Add constexpr_ops_count and
834         initialize ctx.constexpr_ops_count to its address.
835         (is_sub_constant_expr): Likewise.
837 2019-03-21  Jakub Jelinek  <jakub@redhat.com>
839         PR c++/71446
840         * call.c (filed_in_pset): Change pset from hash_set<tree> * to
841         hash_set<tree, true> &, adjust uses accordingly.
842         (build_aggr_conv): Change pset from hash_set<tree> *
843         to hash_set<tree, true>.  Replace goto fail; with return NULL;,
844         adjust pset uses.
846         PR c++/89767
847         * parser.c (cp_parser_lambda_introducer): Add ids and first_capture_id
848         variables, check for duplicates in this function.
849         * lambda.c (add_capture): Don't check for duplicates nor use
850         IDENTIFIER_MARKED.
851         (register_capture_members): Don't clear IDENTIFIER_MARKED here.
853 2019-03-21  Paolo Carlini  <paolo.carlini@oracle.com>
855         PR c++/89571
856         * method.c (after_nsdmi_defaulted_late_checks): Avoid passing
857         error_mark_node to comp_except_specs.
859 2019-03-20  Jason Merrill  <jason@redhat.com>
861         PR c++/87480 - decltype of member access in default template arg
862         * pt.c (type_unification_real): Accept a dependent result in
863         template context.
865 2019-03-19  Martin Sebor  <msebor@redhat.com>
867         PR tree-optimization/89688
868         * typeck2.c (store_init_value): Call braced_lists_to_string for more
869         kinds of initializers.
871 2019-03-18  Jason Merrill  <jason@redhat.com>
873         PR c++/89630 - ICE with dependent using-decl as template arg.
874         * tree.c (cp_tree_equal): Always return false for USING_DECL.
876         PR c++/89761 - ICE with sizeof... in pack expansion.
877         * pt.c (argument_pack_element_is_expansion_p): Handle
878         ARGUMENT_PACK_SELECT.
880         PR c++/89640 - GNU attributes on lambda.
881         * parser.c (cp_parser_lambda_declarator_opt): Allow GNU attributes.
883         PR c++/89682 - wrong access error in default argument.
884         * pt.c (tsubst_default_argument): Don't defer access checks.
886 2019-03-18  Paolo Carlini  <paolo.carlini@oracle.com>
888         PR c++/85014
889         * semantics.c (finish_non_static_data_member): Check return value
890         of context_for_name_lookup and immediately return error_mark_node
891         if isn't a type.
893 2019-03-17  Jason Merrill  <jason@redhat.com>
895         PR c++/89571 - ICE with ill-formed noexcept on constructor.
896         * pt.c (maybe_instantiate_noexcept): Only return false if defaulted.
897         (regenerate_decl_from_template): Use it for noexcept-specs.
899 2019-03-14  Jason Merrill  <jason@redhat.com>
901         * parser.c (cp_parser_decl_specifier_seq): Support C++20
902         concept-definition syntax without 'bool'.
904 2019-03-14  Jakub Jelinek  <jakub@redhat.com>
906         PR c++/89512
907         * semantics.c (finish_qualified_id_expr): Reject variable templates.
909         PR c++/89652
910         * constexpr.c (struct constexpr_ctx): Change save_exprs type from
911         hash_set<tree> to vec<tree>.
912         (cxx_eval_call_expression): Adjust for save_exprs being a vec instead
913         of hash_set.
914         (cxx_eval_loop_expr): Likewise.  Truncate the vector after each
915         removal of SAVE_EXPRs from values.
916         (cxx_eval_constant_expression) <case SAVE_EXPR>: Call safe_push
917         method on save_exprs instead of add.
919 2019-03-13  Jason Merrill  <jason@redhat.com>
921         PR c++/86521 - C++17 copy elision in initialization by constructor.
922         * call.c (joust_maybe_elide_copy): New.
923         (joust): Call it.
925 2019-03-13  Marek Polacek  <polacek@redhat.com>
927         PR c++/88979 - further P0634 fix for constructors.
928         * parser.c (cp_parser_decl_specifier_seq): Pass flags to
929         cp_parser_constructor_declarator_p.
930         (cp_parser_direct_declarator): Allow missing typename for constructor
931         parameters.
932         (cp_parser_constructor_declarator_p): Add FLAGS parameter.  Pass it to
933         cp_parser_type_specifier.
935         PR c++/89686 - mixing init-capture and simple-capture in lambda.
936         * parser.c (cp_parser_lambda_introducer): Give error when combining
937         init-capture and simple-capture.
939         PR c++/89660 - bogus error with -Wredundant-move.
940         * typeck.c (maybe_warn_pessimizing_move): Only accept (T &) &arg
941         as the std::move's argument.  Don't call convert_for_initialization
942         when warn_redundant_move isn't on.
944 2019-03-11  Jason Merrill  <jason@redhat.com>
946         PR c++/86521 - wrong overload resolution with ref-qualifiers.
947         * call.c (build_user_type_conversion_1): Don't use a conversion to a
948         reference of the wrong rvalueness for direct binding.
950 2019-03-11  Martin Liska  <mliska@suse.cz>
952         * cvt.c (build_expr_type_conversion): Wrap apostrophes
953         in gcc internal format with %'.
954         * decl.c (check_no_redeclaration_friend_default_args): Likewise.
955         (grokfndecl): Likewise.
956         * name-lookup.c (do_pushtag): Likewise.
957         * pt.c (unify_parameter_deduction_failure): Likewise.
958         (unify_template_deduction_failure): Likewise.
960 2019-03-11  Martin Liska  <mliska@suse.cz>
962         * call.c (convert_arg_to_ellipsis): Wrap an option name
963         in a string format message and fix GNU coding style.
964         (build_over_call): Likewise.
965         * class.c (check_field_decl): Likewise.
966         (layout_nonempty_base_or_field): Likewise.
967         * constexpr.c (cxx_eval_loop_expr): Likewise.
968         * cvt.c (type_promotes_to): Likewise.
969         * decl.c (cxx_init_decl_processing): Likewise.
970         (mark_inline_variable): Likewise.
971         (grokdeclarator): Likewise.
972         * decl2.c (record_mangling): Likewise.
973         * error.c (maybe_warn_cpp0x): Likewise.
974         * except.c (doing_eh): Likewise.
975         * mangle.c (maybe_check_abi_tags): Likewise.
976         * parser.c (cp_parser_diagnose_invalid_type_name): Likewise.
977         (cp_parser_userdef_numeric_literal): Likewise.
978         (cp_parser_primary_expression): Likewise.
979         (cp_parser_unqualified_id): Likewise.
980         (cp_parser_pseudo_destructor_name): Likewise.
981         (cp_parser_builtin_offsetof): Likewise.
982         (cp_parser_lambda_expression): Likewise.
983         (cp_parser_lambda_introducer): Likewise.
984         (cp_parser_lambda_declarator_opt): Likewise.
985         (cp_parser_selection_statement): Likewise.
986         (cp_parser_init_statement): Likewise.
987         (cp_parser_decomposition_declaration): Likewise.
988         (cp_parser_function_specifier_opt): Likewise.
989         (cp_parser_static_assert): Likewise.
990         (cp_parser_simple_type_specifier): Likewise.
991         (cp_parser_namespace_definition): Likewise.
992         (cp_parser_using_declaration): Likewise.
993         (cp_parser_ctor_initializer_opt_and_function_body): Likewise.
994         (cp_parser_initializer_list): Likewise.
995         (cp_parser_type_parameter_key): Likewise.
996         (cp_parser_member_declaration): Likewise.
997         (cp_parser_try_block): Likewise.
998         (cp_parser_std_attribute_spec): Likewise.
999         (cp_parser_requires_clause_opt): Likewise.
1000         * pt.c (check_template_variable): Likewise.
1001         (check_default_tmpl_args): Likewise.
1002         (push_tinst_level_loc): Likewise.
1003         (instantiate_pending_templates): Likewise.
1004         (invalid_nontype_parm_type_p): Likewise.
1005         * repo.c (get_base_filename): Likewise.
1006         * rtti.c (typeid_ok_p): Likewise.
1007         (build_dynamic_cast_1): Likewise.
1008         * tree.c (maybe_warn_parm_abi): Likewise.
1010 2019-03-08  Jakub Jelinek  <jakub@redhat.com>
1012         PR other/80058
1013         * parser.c (cp_parser_template_declaration_after_parameters): Avoid
1014         one space before " at the end of line and another after " on another
1015         line in a string literal.
1017         PR tree-optimization/89550
1018         * semantics.c (maybe_convert_cond): Only set TREE_NO_WARNING if
1019         warning_at returned true.
1020         * decl2.c (c_parse_final_cleanups): Likewise.
1021         * typeck.c (convert_for_assignment): Likewise.
1022         * decl.c (finish_function): Likewise.
1024         PR c++/89585
1025         * parser.c (cp_parser_asm_definition): Just warn instead of error
1026         on volatile qualifier outside of function body.
1028         PR c++/89599
1029         * constexpr.c (potential_constant_expression_1): Reject
1030         REINTERPRET_CAST_P NOP_EXPRs.
1032         PR c++/89622
1033         * call.c (joust): Call print_z_candidate only if pedwarn returned
1034         true.
1036 2019-03-07  Jason Merrill  <jason@redhat.com>
1038         PR c++/88123 - lambda and using-directive.
1039         * name-lookup.c (op_unqualified_lookup)
1040         (maybe_save_operator_binding, discard_operator_bindings)
1041         (push_operator_bindings): New.
1042         * typeck.c (build_x_binary_op, build_x_unary_op): Call
1043         maybe_save_operator_binding.
1044         * decl.c (start_preparsed_function): Call push_operator_bindings.
1045         * tree.c (cp_free_lang_data): Call discard_operator_bindings.
1047         PR c++/88820 - ICE with CTAD and member template used in DMI.
1048         * pt.c (do_class_deduction): Handle parm used as its own arg.
1050 2019-03-07  Jakub Jelinek  <jakub@redhat.com>
1052         PR c++/89585
1053         * parser.c (cp_parser_asm_definition): Parse asm qualifiers even
1054         at toplevel, but diagnose them.
1056 2019-03-06  Jason Merrill  <jason@redhat.com>
1058         PR c++/89381 - implicit copy and using-declaration.
1059         * class.c (classtype_has_move_assign_or_move_ctor_p): Don't consider
1060         op= brought in by a using-declaration.
1062 2019-03-06  Jakub Jelinek  <jakub@redhat.com>
1064         PR c++/87148
1065         * init.c (build_value_init_noctor): Ignore flexible array members.
1067 2019-03-06  Jason Merrill  <jason@redhat.com>
1069         PR c++/89576 - if constexpr of lambda capture.
1070         * semantics.c (maybe_convert_cond): Do convert a non-dependent
1071         condition in a template.
1072         * typeck.c (condition_conversion): Handle being called in a
1073         template.
1075 2019-03-06  Marek Polacek  <polacek@redhat.com>
1077         PR c++/87378 - bogus -Wredundant-move warning.
1078         * typeck.c (maybe_warn_pessimizing_move): See if the maybe-rvalue
1079         overload resolution would actually succeed.
1081 2019-03-05  Jason Merrill  <jason@redhat.com>
1083         * class.c (is_really_empty_class): Add ignore_vptr parm.
1084         (trivial_default_constructor_is_constexpr): Pass it.
1085         * call.c (build_over_call): Pass it.
1086         * constexpr.c (cxx_eval_constant_expression): Pass it instead of
1087         checking TYPE_POLYMORPHIC_P.
1088         (cxx_eval_component_reference, potential_constant_expression_1):
1089         Pass it.
1090         * cp-gimplify.c (simple_empty_class_p): Pass it.
1091         * init.c (expand_aggr_init_1): Pass it.
1093 2019-03-04  Paolo Carlini  <paolo.carlini@oracle.com>
1095         PR c++/84605
1096         * parser.c (cp_parser_class_head): Reject TYPE_BEING_DEFINED too.
1098 2019-03-04  Jakub Jelinek  <jakub@redhat.com>
1100         PR c++/71446
1101         * call.c (field_in_pset): New function.
1102         (build_aggr_conv): Handle CONSTRUCTOR_IS_DESIGNATED_INIT correctly.
1104 2019-03-02  Jakub Jelinek  <jakub@redhat.com>
1106         PR c++/71446
1107         * cp-tree.h (CONSTRUCTOR_IS_DESIGNATED_INIT): Define.
1108         * parser.c (cp_parser_braced_list): Adjust cp_parser_initializer_list
1109         caller, set CONSTRUCTOR_IS_DESIGNATED_INIT.
1110         (cp_parser_initializer_list): Add designated parameter, set *designated
1111         to a bool whether any designators were parsed.
1112         * decl.c (reshape_init): Copy over CONSTRUCTOR_IS_DESIGNATED_INIT if
1113         needed.
1114         * pt.c (tsubst_copy_and_build): Likewise.
1115         * call.c (implicit_conversion): If CONSTRUCTOR_IS_DESIGNATED_INIT,
1116         don't call build_list_conv, nor build_complex_conv, nor attempt to
1117         convert a single element initializer to scalar.
1119 2019-03-01  Marek Polacek  <polacek@redhat.com>
1121         PR c++/89537 - missing location for error with non-static member fn.
1122         * call.c (resolve_args): Use EXPR_LOCATION.
1123         * typeck.c (build_class_member_access_expr): Use input_location.
1125         PR c++/89532 - ICE with incomplete type in decltype.
1126         * semantics.c (finish_compound_literal): Return error_mark_node
1127         if digest_init_flags returns error_mark_node.
1129 2019-03-01  Jakub Jelinek  <jakub@redhat.com>
1131         Implement P1002R1, Try-catch blocks in constexpr functions
1132         PR c++/89513
1133         * parser.c (cp_parser_ctor_initializer_opt_and_function_body):
1134         Diagnose constexpr ctor or function with function-try-block with
1135         pedwarn for c++17 and earlier.  Formatting fix.
1136         (cp_parser_try_block): Use pedwarn instead of error and only for
1137         c++17 and earlier when try block appears in constexpr function.
1138         * constexpr.c (build_constexpr_constructor_member_initializers):
1139         Handle TRY_BLOCK here instead of erroring on it.
1141 2019-02-28  Jason Merrill  <jason@redhat.com>
1143         PR c++/88183 - ICE with .* fold-expression.
1144         * pt.c (fold_expression) [DOTSTAR_EXPR]: Remove special handling.
1146         PR c++/86969 - ICE with constexpr if and recursive generic lambdas.
1147         * class.c, lambda.c, pt.c: Revert earlier change.
1148         * lambda.c (add_capture): Don't special-case capture of dependent
1149         VLA.
1151         * name-lookup.c (print_binding_level): Print this_entity.
1153 2019-02-27  Marek Polacek  <polacek@redhat.com>
1155         PR c++/88857 - ICE with value-initialization of argument in template.
1156         * call.c (convert_like_real): Don't call build_value_init in template.
1158 2019-02-27  Jason Merrill  <jason@redhat.com>
1160         PR c++/86969 - ICE with constexpr if and recursive generic lambdas.
1161         * semantics.c (process_outer_var_ref): Do capture dependent vars.
1162         * class.c (finish_struct): Only add TAG_DEFN if T is in
1163         current_function_decl.
1164         * lambda.c (vla_capture_type): Force the capture type out into the
1165         lambda's enclosing function.
1166         (add_capture): Pass in the lambda.
1167         * pt.c (tsubst_lambda_expr): complete_type a VLA capture type.
1169 2019-02-27  Marek Polacek  <polacek@redhat.com>
1171         PR c++/89511 - ICE with using-declaration and unscoped enumerator.
1172         * parser.c (cp_parser_using_declaration): For an unscoped enum
1173         only use its context if it's not a function declaration.
1175 2019-02-27  Paolo Carlini  <paolo.carlini@oracle.com>
1177         PR c++/89488
1178         * method.c (process_subob_fn): When maybe_instantiate_noexcept
1179         returns false don't call merge_exception_specifiers.
1181 2019-02-27  Paolo Carlini  <paolo.carlini@oracle.com>
1183         PR c++/88987
1184         * parser.c (cp_parser_noexcept_specification_opt): Return NULL_TREE
1185         for a non-constant parsed expression.
1187 2019-02-26  Jakub Jelinek  <jakub@redhat.com>
1189         PR c++/89481
1190         * constexpr.c (cxx_eval_store_expression): When changing active union
1191         member, set no_zero_init.
1193 2019-02-23  Marek Polacek  <polacek@redhat.com>
1195         PR c++/88294 - ICE with non-constant noexcept-specifier.
1196         * pt.c (maybe_instantiate_noexcept): Set up the list of local
1197         specializations.  Set current_class_{ptr,ref}.
1199 2019-02-22  David Malcolm  <dmalcolm@redhat.com>
1201         PR c++/89390
1202         * parser.c (cp_parser_unqualified_id): Capture and use locations
1203         for destructors.
1205 2019-02-22  Marek Polacek  <polacek@redhat.com>
1207         PR c++/89420 - ICE with CAST_EXPR in explicit-specifier.
1208         * decl.c (build_explicit_specifier): Don't check
1209         processing_template_decl.  Call instantiation_dependent_expression_p
1210         instead of value_dependent_expression_p.  Call
1211         instantiate_non_dependent_expr_sfinae before
1212         build_converted_constant_expr instead of calling
1213         instantiate_non_dependent_expr after it.  Add
1214         processing_template_decl_sentinel.
1216 2019-02-22  Thomas Schwinge  <thomas@codesourcery.com>
1218         * parser.c (cp_parser_oacc_simple_clause): Remove parser formal
1219         parameter, move loc formal parameter to the front.  Adjust all
1220         users.
1221         (cp_parser_oacc_shape_clause): Add loc formal parameter.  Adjust
1222         all users.
1224 2019-02-21  Jason Merrill  <jason@redhat.com>
1226         PR c++/87685 - generic lambda 'this' capture error.
1227         * lambda.c (lambda_expr_this_capture): Change add_capture_p to int.
1228         (maybe_generic_this_capture): Pass -1.
1230         PR c++/88394 - ICE with VLA init-capture.
1231         * lambda.c (is_normal_capture_proxy): Check DECL_CAPTURED_VARIABLE.
1233         PR c++/88869 - C++17 ICE with CTAD and explicit specialization.
1234         * pt.c (do_class_deduction): Don't include explicit specialization
1235         args in outer_args.
1237         PR c++/89422 - ICE with -g and lambda in default arg in template.
1238         * pt.c (tsubst_function_decl): SET_DECL_FRIEND_CONTEXT sooner.
1240 2019-02-21  Jason Merrill  <jason@redhat.com>
1242         PR c++/88419 - C++17 ICE with class template arg deduction.
1243         * pt.c (make_template_placeholder): Set TYPE_CANONICAL after
1244         CLASS_PLACEHOLDER_TEMPLATE.
1246 2019-02-21  Jakub Jelinek  <jakub@redhat.com>
1248         PR c++/89285
1249         * constexpr.c (struct constexpr_fundef): Add parms and result members.
1250         (retrieve_constexpr_fundef): Adjust for the above change.
1251         (register_constexpr_fundef): Save constexpr body with copy_fn,
1252         temporarily set DECL_CONTEXT on DECL_RESULT before that.
1253         (get_fundef_copy): Change FUN argument to FUNDEF with
1254         constexpr_fundef * type, grab body and parms/result out of
1255         constexpr_fundef struct and temporarily change it for copy_fn calls
1256         too.
1257         (cxx_eval_builtin_function_call): For __builtin_FUNCTION temporarily
1258         adjust current_function_decl from ctx->call context.  Test
1259         !potential_constant_expression instead of !is_constant_expression.
1260         (cxx_bind_parameters_in_call): Grab parameters from new_call.  Undo
1261         convert_for_arg_passing changes for TREE_ADDRESSABLE type passing.
1262         (cxx_eval_call_expression): Adjust get_fundef_copy caller.
1263         (cxx_eval_conditional_expression): For IF_STMT, allow then or else
1264         operands to be NULL.
1265         (label_matches): Handle BREAK_STMT and CONTINUE_STMT.
1266         (cxx_eval_loop_expr): Add support for FOR_STMT, WHILE_STMT and DO_STMT.
1267         (cxx_eval_switch_expr): Add support for SWITCH_STMT.
1268         (cxx_eval_constant_expression): Handle IF_STMT, FOR_STMT, WHILE_STMT,
1269         DO_STMT, CONTINUE_STMT, SWITCH_STMT, BREAK_STMT and CONTINUE_STMT.
1270         For SIZEOF_EXPR, recurse on the result of fold_sizeof_expr.  Ignore
1271         DECL_EXPR with USING_DECL operand.
1272         * lambda.c (maybe_add_lambda_conv_op): Build thisarg using
1273         build_int_cst to make it a valid constant expression.
1275 2019-02-20  Jason Merrill  <jason@redhat.com>
1277         PR c++/88690 - C++17 ICE with empty base in aggregate.
1278         * typeck2.c (process_init_constructor_record): Skip trivial
1279         initialization of an empty base.
1281 2019-02-21  Richard Biener  <rguenther@suse.de>
1283         PR middle-end/89392
1284         * vtable-class-hierarchy.c (vtv_generate_init_routine): Do not
1285         make symtab process new functions here.
1287 2019-02-20  Jason Merrill  <jason@redhat.com>
1289         PR c++/87921 - wrong error with inline static data member.
1290         * decl2.c (finish_static_data_member_decl): Don't set DECL_IN_AGGR_P
1291         for a non-template inline variable.  Do nothing for an
1292         already-instantiated variable.
1293         (c_parse_final_cleanups): Check DECL_IN_AGGR_P without
1294         DECL_INLINE_VAR_P.
1295         * decl.c (check_initializer): Likewise.
1296         (make_rtl_for_nonlocal_decl): Likewise.
1297         * pt.c (instantiate_decl): Likewise.
1298         * typeck2.c (store_init_value): Likewise.
1300 2019-02-20  Jakub Jelinek  <jakub@redhat.com>
1302         PR c++/89403
1303         * decl2.c (c_parse_final_cleanups): Move TREE_ASM_WRITTEN setting
1304         for flag_syntax_only from here...
1305         * semantics.c (expand_or_defer_fn_1): ... here.
1307         PR c++/89405
1308         * decl.c (maybe_commonize_var): When clearing TREE_PUBLIC and
1309         DECL_COMMON, set DECL_INTERFACE_KNOWN.
1311         PR c++/89336
1312         * constexpr.c (cxx_eval_store_expression): Diagnose changing of active
1313         union member for -std=c++17 and earlier.
1315 2019-02-19  Jason Merrill  <jason@redhat.com>
1317         PR c++/87513 - 'sorry' mangling PMF template-id.
1318         * mangle.c (write_expression): Handle SCOPE_REF to BASELINK.
1320 2019-02-19  Jason Merrill  <jason@redhat.com>
1322         PR c++/88380 - wrong-code with flexible array and NSDMI.
1323         * typeck2.c (process_init_constructor_record): Skip flexarrays.
1325 2019-02-20  will wray  <wjwray@gmail.com>
1327         PR c++/88572 - wrong handling of braces on scalar init.
1328         * decl.c (reshape_init_r): Allow braces around scalar initializer
1329         within aggregate init.  Reject double braced-init of scalar
1330         variable.
1332 2019-02-20  Paolo Carlini  <paolo.carlini@oracle.com>
1334         PR c++/84536
1335         * pt.c (tsubst_init): Diagnose an initializer expanding to an
1336         empty list of expressions; tweak wrt dependent types.
1337         (regenerate_decl_from_template): For VAR_DECLs call tsubst_init
1338         instead of tsubst_expr.
1340 2019-02-19  Jason Merrill  <jason@redhat.com>
1342         PR c++/88368 - wrong 'use of deleted function'
1343         * method.c (walk_field_subobs): Remember errors from get_nsdmi.
1344         (get_defaulted_eh_spec): Call push_tinst_level.
1345         * pt.c (maybe_instantiate_noexcept): Keep error_mark_node.
1346         * typeck2.c (merge_exception_specifiers): Handle error_mark_node.
1348 2019-02-19  Chung-Lin Tang <cltang@codesourcery.com>
1350         PR c/87924
1351         * parser.c (cp_parser_oacc_clause_wait): Add representation of wait
1352         clause without argument as 'wait (GOMP_ASYNC_NOVAL)', adjust comments.
1354 2019-02-19  Jakub Jelinek  <jakub@redhat.com>
1356         PR c++/89387
1357         * lambda.c (maybe_generic_this_capture): Don't check
1358         DECL_NONSTATIC_MEMBER_FUNCTION_P on USING_DECLs.
1360         PR c++/89391
1361         * typeck.c (build_reinterpret_cast_1): Don't handle void to
1362         && conversion go through build_target_expr_with_type.
1364         PR c++/89390
1365         * error.c (qualified_name_lookup_error): Only call
1366         suggest_alternative_in_scoped_enum if name is IDENTIFIER_NODE.
1368 2019-02-19  Tom Honermann  <tom@honermann.net>
1370         * name-lookup.c (get_std_name_hint): Added u8string as a name hint.
1372 2019-02-18  Jason Merrill  <jason@redhat.com>
1374         PR c++/89336 - multiple stores in constexpr stmt.
1375         * constexpr.c (cxx_eval_store_expression): Preevaluate scalar or
1376         assigned value.
1378         * pt.c (check_explicit_specialization): If the declarator is a
1379         template-id, only check whether the arguments are dependent.
1381         Improve duplicate [[likely]] diagnostic.
1382         * parser.c (cp_parser_statement): Make attrs_loc a range.  Pass it
1383         to process_stmt_hotness_attribute.
1384         * cp-gimplify.c (process_stmt_hotness_attribute): Take attrs_loc.
1385         (genericize_if_stmt): Use likely/unlikely instead of predictor_name.
1387 2019-02-17  Marek Polacek  <polacek@redhat.com>
1389         PR c++/89217 - ICE with list-initialization in range-based for loop.
1390         * constexpr.c (unshare_constructor): No longer static.
1391         * cp-tree.h (unshare_constructor): Declare.
1392         * semantics.c (finish_compound_literal): When dealing with a
1393         non-dependent expression in a template, return the original
1394         expression.  Pass LOOKUP_NO_NARROWING to digest_init_flags.
1396 2019-02-13  Marek Polacek  <polacek@redhat.com>
1398         PR c++/89297 - ICE with OVERLOAD in template.
1399         * semantics.c (finish_compound_literal): Call
1400         instantiate_non_dependent_expr_sfinae.
1402 2019-02-13  Alexandre Oliva <aoliva@redhat.com>
1404         PR c++/86379
1405         * cp-tree.h (USING_DECL_SCOPE): Use result rather than type.
1406         * name-lookup.c (strip_using_decl): Use USING_DECL_SCOPE.
1407         * search.c (protected_accessible_p): Follow USING_DECL_DECLS.
1408         (shared_member_p): Likewise.
1409         (lookup_member): Likewise.
1410         * decl.c (grok_special_member_properties): Skip USING_DECLs.
1411         * semantics.c (finish_omp_declare_simd_methods): Likewise.
1412         (finish_qualified_id_expr): Do not call shared_member_p with
1413         a dependent expr.
1415         PR c++/87322
1416         * pt.c (tsubst_lambda_expr): Avoid duplicate tsubsting.
1417         Move cp_evaluated resetting before signature tsubsting.
1418         (gen_elem_of_pack_expansion_instantiation): Separate local
1419         specializations per index.
1421 2019-02-13  David Malcolm  <dmalcolm@redhat.com>
1423         PR c++/89036
1424         * class.c (add_method): Drop destructor assertion.
1426 2019-02-13  Paolo Carlini  <paolo.carlini@oracle.com>
1428         PR c++/88986
1429         * decl.c (make_typename_type): Allow for TYPE_PACK_EXPANSION as
1430         context (the first argument).
1431         * pt.c (tsubst, case TYPENAME_TYPE): Handle TYPE_PACK_EXPANSION
1432         as context.
1434 2019-02-12  Jason Merrill  <jason@redhat.com>
1436         PR c++/89144 - link error with constexpr initializer_list.
1437         * call.c (convert_like_real) [ck_list]: Don't allocate a temporary
1438         array for an empty list.
1439         * typeck2.c (store_init_value): Don't use cxx_constant_init in a
1440         template.
1442 2019-02-11  Jason Merrill  <jason@redhat.com>
1444         PR c++/89241 - ICE with __func__ in lambda in template.
1445         * pt.c (enclosing_instantiation_of): Also check
1446         instantiated_lambda_fn_p for the template context.
1448 2019-02-11  Marek Polacek  <polacek@redhat.com>
1450         PR c++/89212 - ICE converting nullptr to pointer-to-member-function.
1451         * pt.c (tsubst_copy_and_build) <case CONSTRUCTOR>: Return early for
1452         null member pointer value.
1454 2019-02-11  Jakub Jelinek  <jakub@redhat.com>
1456         PR c++/88977
1457         * pt.c (convert_nontype_argument): Pass true as manifestly_const_eval
1458         to maybe_constant_value calls.
1460 2019-02-11  Marek Polacek  <polacek@redhat.com>
1462         * typeck2.c (digest_init_r): Remove commented code.
1464 2019-02-11  Martin Sebor  <msebor@redhat.com>
1466         PR c++/87996
1467         * decl.c (compute_array_index_type_loc): Preserve signed sizes
1468         for diagnostics.  Call valid_array_size_p instead of error.
1469         * init.c (build_new_1): Compute size for diagnostic.  Call
1470         invalid_array_size_error
1471         (build_new): Call valid_array_size_p instead of error.
1473 2019-02-07  Alexandre Oliva <aoliva@redhat.com>
1475         PR c++/86218
1476         * call.c (compare_ics): Deal with ck_aggr in either cs.
1478 2019-02-06  David Malcolm  <dmalcolm@redhat.com>
1480         PR c++/71302
1481         * call.c (get_location_for_expr_unwinding_for_system_header): New
1482         function.
1483         (conversion_null_warnings): Use it when getting locations for
1484         EXPR, effectively adding a call to
1485         get_location_for_expr_unwinding_for_system_header for
1486         -Wconversion-null and making use of EXPR_LOCATION for
1487         -Wzero-as-null-pointer-constant.
1489 2019-02-05  Jakub Jelinek  <jakub@redhat.com>
1491         PR c++/89187
1492         * optimize.c (maybe_thunk_body): Clear TREE_ADDRESSABLE on
1493         PARM_DECLs of the thunk.
1494         * lambda.c (maybe_add_lambda_conv_op): Likewise.
1496 2019-02-05  Marek Polacek  <polacek@redhat.com>
1498         PR c++/89158 - by-value capture of constexpr variable broken.
1499         * call.c (convert_like_real) <case ck_user>: Call mark_exp_read
1500         instead of mark_rvalue_use.
1502 2019-02-05  Alexandre Oliva <aoliva@redhat.com>
1504         PR c++/87770
1505         * pt.c (instantiates_primary_template_p): New.
1506         (type_dependent_expression_p): Use it.
1508 2019-02-01  Jason Merrill  <jason@redhat.com>
1510         PR c++/88761 - ICE with reference capture of constant.
1511         * lambda.c (mark_const_cap_r): Do walk subtrees of DECL_EXPR for
1512         non-proxy decls.
1514 2019-02-01  Marek Polacek  <polacek@redhat.com>
1516         PR c++/88325 - ICE with invalid out-of-line template member definition.
1517         * parser.c (cp_parser_class_name): Don't call make_typename_type
1518         for overloads.
1520 2019-02-01  Jakub Jelinek  <jakub@redhat.com>
1522         PR c++/87175
1523         * parser.c (cp_parser_gnu_attributes_opt): Set ok to false
1524         if require_open failed.
1526 2019-01-31  Marek Polacek  <polacek@redhat.com>
1528         PR c++/89083, c++/80864 - ICE with list initialization in template.
1529         * constexpr.c (adjust_temp_type): Use copy_node and change the type
1530         instead of using build_constructor.
1531         * decl.c (reshape_init_r): Don't reshape a digested initializer.
1532         Return the initializer for COMPOUND_LITERAL_P.
1534         PR c++/88983 - ICE with switch in constexpr function.
1535         * constexpr.c (cxx_eval_switch_expr): Use SWITCH_COND and SWITCH_BODY.
1536         (cxx_eval_constant_expression) <case COND_EXPR>: Don't look for the
1537         label in the else branch if we found it in the then branch.
1539 2019-01-30  Jason Merrill  <jason@redhat.com>
1541         PR c++/88752 - ICE with lambda and constexpr if.
1542         * cp-tree.h (LAMBDA_EXPR_INSTANTIATED): New.
1543         * pt.c (tsubst_lambda_expr): Set it.
1544         (instantiated_lambda_fn_p): Check it.
1545         (enclosing_instantiation_of): Use it.
1547 2019-01-31  Jakub Jelinek  <jakub@redhat.com>
1549         PR libstdc++/88170
1550         * cxx-pretty-print.c (pp_cxx_enumeration_constant): Print always as
1551         a C cast in pp_c_flag_gnu_v3 mode.
1553 2019-01-30  Jakub Jelinek  <jakub@redhat.com>
1555         PR c++/88988
1556         * lambda.c (is_capture_proxy): Don't return true for
1557         DECL_OMP_PRIVATIZED_MEMBER artificial vars.
1559 2019-01-30  Marek Polacek  <polacek@redhat.com>
1561         PR c++/89119 - ICE with value-initialization in template.
1562         * pt.c (tsubst_copy_and_build): Handle RANGE_EXPR.
1564 2019-01-29  Jason Merrill  <jason@redhat.com>
1566         PR c++/86943 - wrong code converting lambda to function pointer.
1567         * lambda.c (maybe_add_lambda_conv_op): Use a template-id in the
1568         call.  Only forward parms for decltype.
1569         * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Handle CALL_FROM_THUNK_P
1570         specially.
1571         * typeck.c (check_return_expr): Don't mess with a thunk call.
1573 2019-01-28  Jason Merrill  <jason@redhat.com>
1575         PR c++/89089 - ICE with [[no_unique_address]].
1576         PR c++/88865 - wrong layout with [[no_unique_address]].
1577         * class.c (check_field_decls): A potentially-overlapping field makes
1578         the class non-layout-POD, but not non-empty.
1579         (end_of_class): Always consider empty data members.
1580         (layout_class_type): Set DECL_SIZE for empty fields.
1582 2019-01-28  Marek Polacek  <polacek@redhat.com>
1584         PR c++/88358 - name wrongly treated as type.
1585         * parser.c (cp_parser_direct_declarator): Don't assume a qualified-id
1586         in parameter-list is a type if the function's declarator-id is not
1587         qualified.
1589 2019-01-27  Marek Polacek  <polacek@redhat.com>
1591         PR c++/88815 - narrowing conversion lost in decltype.
1592         PR c++/78244 - narrowing conversion in template not detected.
1593         * cp-tree.h (CONSTRUCTOR_IS_DEPENDENT): New.
1594         * pt.c (instantiation_dependent_r): Consider a CONSTRUCTOR with
1595         CONSTRUCTOR_IS_DEPENDENT instantiation-dependent.
1596         * semantics.c (finish_compound_literal): When the compound literal
1597         isn't instantiation-dependent and the type isn't type-dependent,
1598         fall back to the normal processing.  Set CONSTRUCTOR_IS_DEPENDENT.
1600         PR c++/89024 - ICE with incomplete enum type.
1601         * call.c (standard_conversion): When converting an
1602         ARITHMETIC_TYPE_P to an incomplete type, return NULL.
1603         
1604 2019-01-25  Paolo Carlini  <paolo.carlini@oracle.com>
1606         PR c++/88969
1607         * call.c (build_op_delete_call): Implement 7.6.2.5/(10.1).
1608         * decl2.c (coerce_delete_type): Use build_pointer_type instead
1609         of TYPE_POINTER_TO.
1611 2019-01-24  Jason Merrill  <jason@redhat.com>
1613         PR c++/89001 - mangling of reference temporaries
1614         * cp-tree.h (struct saved_scope): Add ref_temp_count.
1615         (current_ref_temp_count): New macro.
1616         * mangle.c (mangle_ref_init_variable): Use it.
1617         * typeck2.c (store_init_value): Clear it.
1618         * call.c (make_temporary_var_for_ref_to_temp): Copy public and
1619         comdat.
1621 2019-01-24  Jakub Jelinek  <jakub@redhat.com>
1623         PR c++/88976
1624         * semantics.c (finish_omp_cancel): Diagnose more than one if
1625         on #pragma omp cancel with different modifiers.  Use
1626         maybe_convert_cond when not in template or build_x_binary_op
1627         otherwise.
1629 2019-01-23  Marek Polacek  <polacek@redhat.com>
1631         PR c++/88757 - qualified name treated wrongly as type.
1632         * parser.c (cp_parser_direct_declarator): Don't treat qualified-ids
1633         in parameter-list as types if name lookup for declarator-id didn't
1634         find one or more function templates.
1636 2019-01-23  Jakub Jelinek  <jakub@redhat.com>
1638         PR c/44715
1639         * cp-gimplify.c (genericize_cp_loop): Call begin_bc_block only
1640         after genericizing cond and incr expressions.
1642         PR c++/88984
1643         * cp-gimplify.c (genericize_switch_stmt): Move cond genericization
1644         before the begin_bc_block call.
1646 2019-01-21  Jason Merrill  <jason@redhat.com>
1648         PR c++/87893 - constexpr ctor ICE on ARM.
1649         PR c++/88293 - ICE with comma expression.
1650         * constexpr.c (initialized_type): Don't shortcut non-void type.
1651         Handle COMPOUND_EXPR.
1652         (cxx_eval_outermost_constant_expr): Return early for void type.
1654 2019-01-21  Jakub Jelinek  <jakub@redhat.com>
1656         PR c++/88949
1657         * optimize.c (cxx_copy_decl): New function.
1658         (clone_body): Use it instead of copy_decl_no_change.
1660         PR sanitizer/88901
1661         * typeck.c (cp_build_binary_op): Don't instrument
1662         SANITIZE_POINTER_COMPARE if processing_template_decl.
1663         (pointer_diff): Similarly for SANITIZE_POINTER_SUBTRACT.
1665 2019-01-18  Jason Merrill  <jason@redhat.com>
1667         PR c++/88875 - error with explicit list constructor.
1668         * call.c (reference_binding): Don't modify EXPR.  Set
1669         need_temporary_p on the ck_user conversion for a temporary.
1670         (convert_like_real): Check it.
1672 2019-01-18  H.J. Lu  <hongjiu.lu@intel.com>
1674         PR c/51628
1675         PR c/88664
1676         * call.c (convert_for_arg_passing): Upate the
1677         warn_for_address_or_pointer_of_packed_member call.
1678         * typeck.c (convert_for_assignment): Likewise.
1680 2019-01-17  Jason Merrill  <jason@redhat.com>
1682         PR c++/86205 - ICE with ?: of throw and template-id.
1683         * pt.c (resolve_nondeduced_context_or_error): Split out from...
1684         * typeck.c (decay_conversion): ...here.
1685         * call.c (build_conditional_expr_1): Use it.
1687         PR c++/86740, ICE with constexpr if and nested generic lambdas.
1688         * tree.c (cp_walk_subtrees): Handle LAMBDA_EXPR.
1690 2019-01-17  Paolo Carlini  <paolo.carlini@oracle.com>
1692         * decl.c (grokdeclarator): Use typespec_loc in error messages
1693         about 'auto' and trailing return type.
1695 2019-01-17  David Malcolm  <dmalcolm@redhat.com>
1697         PR c++/88699
1698         * class.c (add_method): Don't use DECL_DESTRUCTOR_P on
1699         USING_DECLs.
1701 2019-01-17  Nathan Sidwell  <nathan@acm.org>
1703         PR c++/86610
1704         * semantics.c (process_outer_var_ref): Only skip dependent types
1705         in templates.
1707 2019-01-17  Alexandre Oliva <aoliva@redhat.com>
1709         PR c++/87768
1710         * cp-tree.h (saved_scope): Add suppress_location_wrappers.
1711         * name-lookup.c (do_push_to_top_level): Save and reset it.
1712         (do_pop_from_top_level): Restore it.
1714         PR c++/86648
1715         * pt.c (make_template_placeholder): Use auto_identifier.
1716         (is_auto): Drop CLASS_PLACEHOLDER_TEMPLATE test.
1717         * error.c (dump_type): Handle template placeholders.
1718         * cxx-pretty-print.c (pp_cx_unqualified_id): Likewise.
1720         PR c++/88146
1721         * cvt.c (convert_to_void): Handle all cdtor calls as if
1722         returning void.
1724 2019-01-16  Paolo Carlini  <paolo.carlini@oracle.com>
1726         * decl.c (grokdeclarator): Use locations[ds_storage_class] in
1727         error messages about ill-formed uses of mutable.
1729 2019-01-16  Marek Polacek  <polacek@redhat.com>
1731         PR c++/78244 - narrowing conversion in template not detected.
1732         * call.c (perform_implicit_conversion_flags): Set
1733         IMPLICIT_CONV_EXPR_BRACED_INIT.
1734         * cp-tree.h (IMPLICIT_CONV_EXPR_BRACED_INIT): New.
1735         * pt.c (tsubst_copy_and_build): Use it.
1737 2019-01-15  David Malcolm  <dmalcolm@redhat.com>
1739         PR c++/88795
1740         * pt.c (build_deduction_guide): Bail out if tsubst_arg_types
1741         fails.
1743 2019-01-15  Paolo Carlini  <paolo.carlini@oracle.com>
1745         * decl.c (start_decl): Improve error location.
1746         * decl2.c (grokfield): Likewise.
1748 2019-01-15  Paolo Carlini  <paolo.carlini@oracle.com>
1750         * decl.c (grokdeclarator): Move further up the location_t loc
1751         declaration and use the location when building a TYPE_DECL for
1752         a typedef name.
1753         * decl2.c (grokbitfield): Use DECL_SOURCE_LOCATION in the error
1754         about an ill-formed bit-field as typedef.
1756 2019-01-14  Marek Polacek  <polacek@redhat.com>
1758         PR c++/88830 - ICE with abstract class.
1759         * decl2.c (maybe_emit_vtables): Check CLASSTYPE_LAZY_DESTRUCTOR.
1760         Fix formatting.
1762         PR c++/88825 - ICE with bogus function return type deduction.
1763         * typeck.c (can_do_nrvo_p): Check error_mark_node.
1765 2019-01-14  Tom Honermann  <tom@honermann.net>
1767         Implement P0482R5, char8_t: A type for UTF-8 characters and strings
1768         * cvt.c (type_promotes_to): Handle char8_t promotion.
1769         * decl.c (grokdeclarator): Handle invalid type specifier
1770         combinations involving char8_t.
1771         * lex.c (init_reswords): Add char8_t as a reserved word.
1772         * mangle.c (write_builtin_type): Add name mangling for char8_t (Du).
1773         * parser.c (cp_keyword_starts_decl_specifier_p)
1774         (cp_parser_simple_type_specifier): Recognize char8_t as a simple
1775         type specifier.
1776         (cp_parser_string_literal): Use char8_array_type_node for the type
1777         of CPP_UTF8STRING.
1778         (cp_parser_set_decl_spec_type): Tolerate char8_t typedefs in system
1779         headers.
1780         * rtti.c (emit_support_tinfos): type_info support for char8_t.
1781         * tree.c (char_type_p): Recognize char8_t as a character type.
1782         * typeck.c (string_conv_p): Handle conversions of u8 string
1783         literals of char8_t type.
1784         (check_literal_operator_args): Handle UDLs with u8 string literals
1785         of char8_t type.
1786         * typeck2.c (ordinary_char_type_p): New.
1787         (digest_init_r): Disallow initializing a char array with a u8 string
1788         literal.
1790 2019-01-14  Martin Liska  <mliska@suse.cz>
1792         PR gcov-profile/88263
1793         * decl2.c (get_tls_wrapper_fn): Use DECL_SOURCE_LOCATION
1794         as location of the TLS wrapper.
1796 2019-01-12  Paolo Carlini  <paolo.carlini@oracle.com>
1798         * decl.c (cp_finish_decl): Improve error location.
1799         * decl2.c (grokfield): Likewise, improve two locations.
1801 2019-01-11  Marek Polacek  <polacek@redhat.com>
1803         PR c++/88692, c++/87882 - -Wredundant-move false positive with *this.
1804         * typeck.c (maybe_warn_pessimizing_move): Return if ARG isn't
1805         ADDR_EXPR.
1807 2019-01-11  Jason Merrill  <jason@redhat.com>
1809         PR c++/88312 - pack expansion of decltype.
1810         * pt.c (instantiation_dependent_r): A template non-type parameter
1811         pack is instantiation-dependent.
1813 2019-01-11  Jason Merrill  <jason@redhat.com>
1815         PR c++/88613 - ICE with use of const var in lambda.
1816         * expr.c (mark_use): Fix location wrapper handling.
1817         * cp-gimplify.c (cp_fold_maybe_rvalue): Call mark_rvalue_use.
1819 2019-01-11  Tobias Burnus  <burnus@net-b.de>
1821         PR C++/88114
1822         * decl2.c (maybe_emit_vtables): If needed, generate code for
1823         the destructor of an abstract class.
1824         (mark_used): Update comment for older function-name change.
1826 2019-01-11  Paolo Carlini  <paolo.carlini@oracle.com>
1828         * decl.c (start_decl): Improve error location.
1829         (grokdeclarator): Likewise, improve two locations.
1831 2019-01-09  Sandra Loosemore  <sandra@codesourcery.com>
1833         PR other/16615
1835         * cp-tree.h: Mechanically replace "can not" with "cannot".
1836         * parser.c: Likewise.
1837         * pt.c: Likewise.
1839 2019-01-08  Paolo Carlini  <paolo.carlini@oracle.com>
1841         * decl.c (grok_reference_init): Improve error location.
1842         (grokdeclarator): Likewise, improve two locations.
1844 2019-01-08  Marek Polacek  <polacek@redhat.com>
1846         PR c++/88538 - braced-init-list in template-argument-list.
1847         * parser.c (cp_parser_template_argument): Handle braced-init-list when
1848         in C++20.
1850         PR c++/88548 - this accepted in static member functions.
1851         * parser.c (cp_debug_parser): Adjust printing of
1852         local_variables_forbidden_p.
1853         (cp_parser_new): Set local_variables_forbidden_p to 0 rather than false.
1854         (cp_parser_primary_expression): When checking
1855         local_variables_forbidden_p, use THIS_FORBIDDEN or
1856         LOCAL_VARS_FORBIDDEN.
1857         (cp_parser_lambda_body): Update the type of
1858         local_variables_forbidden_p.  Set it to 0 rather than false.
1859         (cp_parser_condition): Adjust call to cp_parser_declarator.
1860         (cp_parser_explicit_instantiation): Likewise.
1861         (cp_parser_init_declarator): Likewise.
1862         (cp_parser_declarator): New parameter.  Use it.
1863         (cp_parser_direct_declarator): New parameter.  Use it to set
1864         local_variables_forbidden_p.  Adjust call to cp_parser_declarator.
1865         (cp_parser_type_id_1): Adjust call to cp_parser_declarator.
1866         (cp_parser_parameter_declaration): Likewise.
1867         (cp_parser_default_argument): Update the type of
1868         local_variables_forbidden_p.  Set it to LOCAL_VARS_AND_THIS_FORBIDDEN
1869         rather than true.
1870         (cp_parser_member_declaration): Tell cp_parser_declarator if we saw
1871         'static' or 'friend'.
1872         (cp_parser_exception_declaration): Adjust call to cp_parser_declarator.
1873         (cp_parser_late_parsing_default_args): Update the type of
1874         local_variables_forbidden_p.  Set it to LOCAL_VARS_AND_THIS_FORBIDDEN
1875         rather than true.
1876         (cp_parser_cache_defarg): Adjust call to cp_parser_declarator.
1877         (cp_parser_objc_class_ivars): Likewise.
1878         (cp_parser_objc_struct_declaration): Likewise.
1879         (cp_parser_omp_for_loop_init): Likewise.
1880         * parser.h (cp_parser): Change the type of local_variables_forbidden_p
1881         to unsigned char.
1882         (LOCAL_VARS_FORBIDDEN, LOCAL_VARS_AND_THIS_FORBIDDEN, THIS_FORBIDDEN):
1883         Define.
1885 2019-01-08  Paolo Carlini  <paolo.carlini@oracle.com>
1887         * decl.c (start_decl): Improve permerror location.
1889 2019-01-08  Jonathan Wakely  <jwakely@redhat.com>
1890             Jakub Jelinek  <jakub@redhat.com>
1892         PR c++/88554
1893         * decl.c (finish_function): For -Wreturn-type don't add a return *this;
1894         fixit hint if current_class_ref is NULL.  Use a single if instead of
1895         two nested ones.
1897 2019-01-07  Paolo Carlini  <paolo.carlini@oracle.com>
1899         * decl.c (start_decl): Improve two error_at locations.
1900         (expand_static_init): Likewise.
1902 2019-01-07  Marek Polacek  <polacek@redhat.com>
1904         PR c++/88741 - wrong error with initializer-string.
1905         * decl.c (cp_complete_array_type): Strip any location wrappers.
1907 2019-01-07  Bernd Edlinger  <bernd.edlinger@hotmail.de>
1909         PR c++/88261
1910         PR c++/69338
1911         PR c++/69696
1912         PR c++/69697
1913         * cp-tree.h (LOOKUP_ALLOW_FLEXARRAY_INIT): New flag value.
1914         * typeck2.c (digest_init_r): Raise an error for non-static
1915         initialization of a flexible array member.
1916         (process_init_constructor, massage_init_elt,
1917         process_init_constructor_array, process_init_constructor_record,
1918         process_init_constructor_union, process_init_constructor): Add the
1919         flags parameter and pass it thru.
1920         (store_init_value): Pass LOOKUP_ALLOW_FLEXARRAY_INIT parameter to
1921         digest_init_flags for static decls.
1923 2019-01-07  Jakub Jelinek  <jakub@redhat.com>
1925         PR c++/85052
1926         * cp-tree.h (cp_build_vec_convert): Declare.
1927         * parser.c (cp_parser_postfix_expression): Parse
1928         __builtin_convertvector.
1929         * constexpr.c: Include fold-const-call.h.
1930         (cxx_eval_internal_function): Handle IFN_VEC_CONVERT.
1931         (potential_constant_expression_1): Likewise.
1932         * semantics.c (cp_build_vec_convert): New function.
1933         * pt.c (tsubst_copy_and_build): Handle CALL_EXPR to
1934         IFN_VEC_CONVERT.
1936 2019-01-03  Jakub Jelinek  <jakub@redhat.com>
1938         PR c++/88636
1939         * decl.c (builtin_function_1): Return result of pushdecl_top_level
1940         or pushdecl rather than decl.
1942 2019-01-03  Paolo Carlini  <paolo.carlini@oracle.com>
1944         * tree.c (handle_nodiscard_attribute): Improve warning location.
1946 2019-01-02  Marek Polacek  <polacek@redhat.com>
1948         PR c++/88612 - ICE with -Waddress-of-packed-member.
1949         * call.c (convert_for_arg_passing): Only give warnings with tf_warning.
1950         * typeck.c (convert_for_assignment): Likewise.
1952         PR c++/88631 - CTAD failing for value-initialization.
1953         * typeck2.c (build_functional_cast): Try deducing the template
1954         arguments even if there are no arguments to deduce from.
1956 2019-01-01  Jakub Jelinek  <jakub@redhat.com>
1958         Update copyright years.
1960 Copyright (C) 2019 Free Software Foundation, Inc.
1962 Copying and distribution of this file, with or without modification,
1963 are permitted in any medium without royalty provided the copyright
1964 notice and this notice are preserved.