Various small C++ changes.
[gcc.git] / gcc / cp / ChangeLog
1 2019-11-04 Jason Merrill <jason@redhat.com>
2
3 * constexpr.c (explain_invalid_constexpr_fn): Show location of fn.
4
5 * pt.c (maybe_instantiate_noexcept): Only update clones if we
6 instantiated.
7
8 * typeck.c (contextual_conv_bool): New.
9
10 * name-lookup.c (lookup_qualified_name): Add wrapper overload taking
11 C string rather than identifier.
12 * parser.c (cp_parser_userdef_numeric_literal): Use it.
13 * rtti.c (emit_support_tinfos): Use it.
14 * cp-tree.h (ovl_op_identifier): Change to inline functions.
15 (build_x_binary_op): Add wrapper with fewer parms.
16
17 2019-11-05 Jason Merrill <jason@redhat.com>
18
19 * decl2.c (mark_used): Diagnose use of a function with unsatisfied
20 constraints here.
21 * typeck.c (cp_build_function_call_vec): Not here.
22
23 2019-11-05 Nathan Sidwell <nathan@acm.org>
24
25 PR c++/92370
26 * parser.c (cp_parser_error_1): Check EOF and UNKNOWN_LOCATION
27 when skipping over version control marker.
28
29 2019-11-05 Jakub Jelinek <jakub@redhat.com>
30
31 PR c++/92343
32 * constexpr.c (potential_constant_expression_1): Return true rather
33 than false for PREDICT_EXPR.
34
35 * decl.c (omp_declare_variant_finalize_one): Call
36 declare_simd_adjust_this not just on the context, but also on the
37 variant-id expression for methods. Don't call
38 cp_get_callee_fndecl_nofold, call cp_get_callee and only if it is
39 safe cp_get_fndecl_from_callee. Don't try to print as %qD
40 NULL in diagnostics.
41 * pt.c (tsubst_attribute): Handle "omp declare variant base"
42 attribute.
43 (tsubst_function_decl): Call omp_declare_variant_finalize
44 if there are any "omp declare variant base" attributes left.
45
46 2019-11-04 Kamlesh Kumar <kamleshbhalui@gmail.com>
47
48 PR c++/91979 - mangling nullptr expression
49 * mangle.c (write_template_arg_literal): Handle nullptr
50 mangling.
51
52 2019-11-04 Jason Merrill <jason@redhat.com>
53
54 * typeck.c (check_return_expr): Avoid redundant error.
55
56 2019-11-02 Paolo Carlini <paolo.carlini@oracle.com>
57
58 * typeck.c (composite_pointer_type): Add a const op_location_t&
59 parameter and use it in diagnostics.
60 (composite_pointer_error): Likewise.
61 (composite_pointer_type_r): Add a const op_location_t&
62 parameter and forward it.
63 (cp_build_binary_op): Adjust calls.
64 (common_pointer_type): Likewise.
65 * call.c (add_builtin_candidate): Likewise.
66 (build_conditional_expr_1): Likewise.
67 * cp-tree.h (composite_pointer_type): Update declaration.
68
69 * typeck.c (cxx_sizeof_expr): Use cp_expr_loc_or_input_loc
70 in permerror.
71 (cxx_alignof_expr): Likewise.
72 (lvalue_or_else): Likewise.
73
74 2019-11-02 Jakub Jelinek <jakub@redhat.com>
75
76 * decl.c (omp_declare_variant_finalize_one): Use
77 omp_get_context_selector instead of c_omp_get_context_selector.
78
79 PR c++/89640
80 * parser.c (cp_parser_decl_specifier_seq): Don't parse attributes
81 if CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR.
82
83 PR c++/88335 - Implement P1073R3: Immediate functions
84 * cp-tree.h (struct lang_decl_fn): Add immediate_fn_p bit.
85 (DECL_IMMEDIATE_FUNCTION_P, SET_DECL_IMMEDIATE_FUNCTION_P): Define.
86 (enum cp_decl_spec): Add ds_consteval.
87 (fold_non_dependent_expr): Add another tree argument defaulted to
88 NULL_TREE.
89 * name-lookup.h (struct cp_binding_level): Add immediate_fn_ctx_p
90 member.
91 * parser.c (cp_keyword_starts_decl_specifier_p): Adjust comments
92 for C++11 and C++20 specifiers. Handle RID_CONSTEVAL.
93 (CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR): Adjust comment.
94 (CP_PARSER_FLAGS_CONSTEVAL): New.
95 (cp_parser_skip_balanced_tokens): New forward declaration.
96 (cp_parser_lambda_declarator_opt): Handle ds_consteval. Set
97 current_binding_level->immediate_fn_ctx_p before parsing parameter
98 list if decl-specifier-seq contains consteval specifier.
99 (cp_parser_decl_specifier_seq): Handle RID_CONSTEVAL.
100 (cp_parser_explicit_instantiation): Diagnose explicit instantiation
101 with consteval specifier.
102 (cp_parser_init_declarator): For consteval or into flags
103 CP_PARSER_FLAGS_CONSTEVAL.
104 (cp_parser_direct_declarator): If CP_PARSER_FLAGS_CONSTEVAL, set
105 current_binding_level->immediate_fn_ctx_p in the sk_function_parms
106 scope.
107 (set_and_check_decl_spec_loc): Add consteval entry, formatting fix.
108 * call.c (build_addr_func): For direct calls to immediate functions
109 use build_address rather than decay_conversion.
110 (build_over_call): Evaluate immediate function invocations.
111 * error.c (dump_function_decl): Handle DECL_IMMEDIATE_FUNCTION_P.
112 * semantics.c (expand_or_defer_fn_1): Use tentative linkage and don't
113 call mark_needed for immediate functions.
114 * typeck.c (cxx_sizeof_or_alignof_expr): Likewise. Formatting fix.
115 (cp_build_addr_expr_1): Reject taking address of immediate function
116 outside of immediate function.
117 * decl.c (validate_constexpr_redeclaration): Diagnose consteval
118 vs. non-consteval or vice versa redeclaration. Use
119 SET_DECL_IMMEDIATE_FUNCTION_P if new_decl is immediate function.
120 (check_tag_decl): Use %qs with keyword string to simplify translation.
121 Handle ds_consteval.
122 (start_decl): Adjust diagnostics for static or thread_local variables
123 in immediate functions.
124 (grokfndecl): Call sorry_at on virtual consteval. Use %qs with keyword
125 to string to simplify translation. Diagnose consteval main. Use
126 SET_DECL_IMMEDIATE_FUNCTION_P for consteval.
127 (grokdeclarator): Handle consteval. Use %qs with keyword strings to
128 simplify translation. Use separate ifs instead of chained else if
129 for invalid specifiers. For constinit clear constinit_p rather than
130 constexpr_p.
131 * constexpr.c (find_immediate_fndecl): New function.
132 (cxx_eval_outermost_constant_expr): Allow consteval calls returning
133 void. Diagnose returning address of immediate function from consteval
134 evaluation.
135 (fold_non_dependent_expr_template): Add OBJECT argument, pass it
136 through to cxx_eval_outermost_constant_expr.
137 (fold_non_dependent_expr): Add OBJECT argument, pass it through to
138 fold_non_dependent_expr_template.
139 (fold_non_dependent_init): Adjust fold_non_dependent_expr_template
140 caller.
141 * method.c (defaulted_late_check): Adjust diagnostics for consteval.
142 * lambda.c (maybe_add_lambda_conv_op): Copy over
143 DECL_DECLARED_CONSTEXPR_P and DECL_IMMEDIATE_FUNCTION_P bits from
144 callop to both artificial functions.
145 * init.c (build_value_init): Don't do further processing if
146 build_special_member_call returned a TREE_CONSTANT. Formatting fix.
147
148 PR c++/91369 - Implement P0784R7: constexpr new
149 * cp-tree.h (CALL_FROM_NEW_OR_DELETE_P): Define.
150 * init.c (build_new_1, build_vec_delete_1, build_delete): Set
151 CALL_FROM_NEW_OR_DELETE_P on the CALL_EXPR to allocator functions.
152 * constexpr.c (is_std_allocator_allocate): Only allow
153 global replaceable allocator functions if CALL_FROM_NEW_OR_DELETE_P
154 or in std::allocate<T>::{,de}allocate.
155 (potential_constant_expression_1): Likewise.
156
157 2019-11-01 Nathan Sidwell <nathan@acm.org>
158
159 * class.c (check_field_decls): Refactor.
160
161 2019-10-31 Jakub Jelinek <jakub@redhat.com>
162
163 PR c++/90947
164 * cp-tree.h (type_initializer_zero_p): Declare.
165 * decl.c (reshape_init_array_1): Formatting fix.
166 * tree.c (type_initializer_zero_p): New function. Moved from
167 ../tree.c, use next_initializable_field, formatting fix. Return
168 false for TYPE_NON_AGGREGATE_CLASS types.
169
170 2019-10-30 Jason Merrill <jason@redhat.com>
171
172 PR c++/92268 - hard error satisfying return-type-requirement
173 * constraint.cc (type_deducible_p): Check for substitution failure.
174 (diagnose_compound_requirement): Adjust diagnostic.
175 * pt.c (do_auto_deduction): Don't pass cargs to
176 constraints_satisfied_p.
177
178 2019-10-30 Jakub Jelinek <jakub@redhat.com>
179
180 PR c++/91369 - Implement P0784R7: constexpr new
181 * constexpr.c (cxx_replaceable_global_alloc_fn): Don't return true
182 for placement new.
183 (cxx_placement_new_fn, is_std_construct_at): New functions.
184 (cxx_eval_call_expression): Allow placement new in std::construct_at.
185 (potential_constant_expression_1): Likewise.
186
187 * typeck.c (decl_in_std_namespace_p): Return true also for decls
188 in inline namespaces inside of std namespace.
189
190 2019-10-30 Bernd Edlinger <bernd.edlinger@hotmail.de>
191
192 PR c++/92024
193 * name-lookup.c (check_local_shadow): Shadowing TYPE_DECLs
194 is always a -Wshadow=compatible-local warning, unless
195 -Wshadow is used.
196
197 2019-10-30 Jason Merrill <jason@redhat.com>
198
199 * cxx-pretty-print.c (get_fold_operator): Use OVL_OP_INFO.
200
201 2019-10-30 Marek Polacek <polacek@redhat.com>
202
203 PR c++/92134 - constinit malfunction in static data member.
204 * decl2.c (grokfield): Set LOOKUP_CONSTINIT.
205
206 2019-10-30 Jakub Jelinek <jakub@redhat.com>
207
208 * cp-tree.h (omp_declare_variant_finalize, build_local_temp): Declare.
209 * decl.c: Include omp-general.h.
210 (declare_simd_adjust_this): Add forward declaration.
211 (omp_declare_variant_finalize_one, omp_declare_variant_finalize): New
212 function.
213 (cp_finish_decl, finish_function): Call omp_declare_variant_finalize.
214 * parser.c (cp_finish_omp_declare_variant): Adjust parsing of the
215 variant id-expression and propagate enough information to
216 omp_declare_variant_finalize_one in the attribute so that it can
217 finalize it.
218 * class.c (finish_struct): Call omp_declare_variant_finalize.
219 * tree.c (build_local_temp): No longer static, remove forward
220 declaration.
221
222 2019-10-30 Paolo Carlini <paolo.carlini@oracle.com>
223
224 * typeck.c (cp_build_modify_expr): Prefer error + inform to
225 error + error in one place.
226 (get_delta_difference_1): Likewise.
227 (get_delta_difference): Likewise, in two places.
228
229 2019-10-29 Paolo Carlini <paolo.carlini@oracle.com>
230
231 * typeck.c (build_x_unary_op): Use the location_t argument in
232 three error_at.
233
234 2019-10-29 Marek Polacek <polacek@redhat.com>
235
236 PR c++/90998 - ICE with copy elision in init by ctor and -Wconversion.
237 * call.c (joust): Don't attempt to warn if ->second_conv is null.
238
239 2019-10-29 Jakub Jelinek <jakub@redhat.com>
240
241 PR c++/92201
242 * cp-gimplify.c (cp_gimplify_expr): If gimplify_to_rvalue changes the
243 function pointer type, re-add cast to the original one.
244
245 2019-10-29 Marek Polacek <polacek@redhat.com>
246
247 PR c++/91548 - fix detecting modifying const objects for ARRAY_REF.
248 * constexpr.c (cxx_eval_store_expression): Don't call
249 modifying_const_object_p for ARRAY_REF.
250
251 2019-10-29 Richard Sandiford <richard.sandiford@arm.com>
252
253 * cp-objcp-common.h (cxx_simulate_enum_decl): Declare.
254 (LANG_HOOKS_SIMULATE_ENUM_DECL): Define to the above.
255 * decl.c (cxx_simulate_enum_decl): New function.
256
257 2019-10-29 Richard Sandiford <richard.sandiford@arm.com>
258
259 * cp-tree.h (cxx_simulate_builtin_function_decl): Declare.
260 * decl.c (cxx_simulate_builtin_function_decl): New function.
261 * cp-objcp-common.h (LANG_HOOKS_SIMULATE_BUILTIN_FUNCTION_DECL):
262 Define to the above.
263
264 2019-10-28 Martin Sebor <msebor@redhat.com>
265
266 PR c/66970
267 * cp-objcp-common.c (names_builtin_p): Define new function.
268
269 2019-10-28 Nathan Sidwell <nathan@acm.org>
270
271 * parser.h (struct cp_token): Drop {ENUM,BOOL}_BITFIELD C-ism.
272 Add tree_check_p flag, use as nested union discriminator.
273 (struct cp_lexer): Add saved_type & saved_keyword fields.
274 * parser.c (eof_token): Delete.
275 (cp_lexer_new_main): Always init last_token to last token of
276 buffer.
277 (cp_lexer_new_from_tokens): Overlay EOF token at end of range.
278 (cp_lexer_destroy): Restore token under the EOF.
279 (cp_lexer_previous_token_position): No check for eof_token here.
280 (cp_lexer_get_preprocessor_token): Clear tree_check_p.
281 (cp_lexer_peek_nth_token): Check CPP_EOF not eof_token.
282 (cp_lexer_consume_token): Assert not CPP_EOF, no check for
283 eof_token.
284 (cp_lexer_purge_token): Likewise.
285 (cp_lexer_purge_tokens_after): No check for EOF token.
286 (cp_parser_nested_name_specifier, cp_parser_decltype)
287 (cp_parser_template_id): Set tree_check_p.
288
289 2019-10-24 Jakub Jelinek <jakub@redhat.com>
290
291 * decl2.c (cplus_decl_attributes): Add "omp declare target block"
292 attribute in between declare target and end declare target
293 pragmas.
294
295 * call.c (convert_arg_to_ellipsis): Add missing space in string
296 literal.
297
298 2019-10-24 Marek Polacek <polacek@redhat.com>
299
300 * decl.c (reshape_init_r): Add missing space.
301
302 2019-10-24 Nathan Sidwell <nathan@acm.org>
303
304 * pt.c (reduce_template_parm_level): Attach the new TPI to the new
305 DECL.
306 (convert_generic_types_to_packs): Pass the copied type to
307 reduce_templatE_parm_level.
308
309 2019-10-23 Nathan Sidwell <nathan@acm.org>
310
311 * cp-tree.c (CPTI_STD_IDENTIFIER): Delete.
312 (std_identifier): Delete.
313 (DECL_NAME_SPACE_STD_P): Compare against std_node.
314 * decl.c (initialize_predefined_identifiers): 'std' is not needed.
315 (cxx_init_decl_processing): Adjust creation of ::std. Use
316 {push,pop}_nested_namespace.
317 (cxx_builtin_function): Use {push,pop}_nested_namespace.
318 * except.c (init_exception_processing): Likewise.
319 * rtti.c (init_rtti_processing): Likewise.
320
321 2019-10-23 Jason Merrill <jason@redhat.com>
322
323 Implement P1286R2, Contra CWG1778
324 * method.c (defaulted_late_check): Don't check explicit
325 exception-specification on defaulted function.
326 (after_nsdmi_defaulted_late_checks): Remove.
327 * parser.h (struct cp_unparsed_functions_entry): Remove classes.
328 * parser.c (unparsed_classes): Remove.
329 (push_unparsed_function_queues, cp_parser_class_specifier_1):
330 Adjust.
331
332 2019-10-23 Jakub Jelinek <jakub@redhat.com>
333
334 * constexpr.c (cxx_eval_constant_expression) <case CLEANUP_STMT>:
335 Temporarily change input_location to CLEANUP_STMT location.
336
337 2019-10-22 Jakub Jelinek <jakub@redhat.com>
338
339 PR tree-optimization/85887
340 * decl.c (expand_static_init): Drop ECF_LEAF from __cxa_guard_acquire
341 and __cxa_guard_release.
342
343 2019-10-22 Marc Glisse <marc.glisse@inria.fr>
344
345 PR c++/85746
346 * constexpr.c (cxx_eval_builtin_function_call): Only set
347 force_folding_builtin_constant_p if manifestly_const_eval.
348
349 2019-10-22 Richard Sandiford <richard.sandiford@arm.com>
350
351 * cp-tree.h (STF_USER_VISIBLE): New constant.
352 (strip_typedefs, strip_typedefs_expr): Take a flags argument.
353 * tree.c (strip_typedefs, strip_typedefs_expr): Likewise,
354 updating mutual calls accordingly. When STF_USER_VISIBLE is true,
355 only look through typedefs if user_facing_original_type_p.
356 * error.c (dump_template_bindings, type_to_string): Pass
357 STF_USER_VISIBLE to strip_typedefs.
358 (dump_type): Likewise, unless pp_c_flag_gnu_v3 is set.
359
360 2019-10-21 Kamlesh Kumar <kamleshbhalui@gmail.com>
361 Jason Merrill <jason@redhat.com>
362
363 PR c++/83534 - typeinfo of noexcept function
364 * rtti.c (get_tinfo_decl_dynamic): Do not call
365 TYPE_MAIN_VARIANT for function.
366 (get_typeid): Likewise.
367
368 2019-10-21 Paolo Carlini <paolo.carlini@oracle.com>
369
370 * parser.c (cp_parser_class_head): Improve error recovery upon
371 extra qualification error.
372
373 2019-10-21 Jakub Jelinek <jakub@redhat.com>
374
375 PR c++/92015
376 * constexpr.c (cxx_eval_component_reference, cxx_eval_bit_field_ref):
377 Use STRIP_ANY_LOCATION_WRAPPER on CONSTRUCTOR elts.
378
379 2019-10-21 Marek Polacek <polacek@redhat.com>
380
381 PR c++/92062 - ODR-use ignored for static member of class template.
382 * pt.c (has_value_dependent_address): Strip location wrappers.
383
384 2019-10-21 Marek Polacek <polacek@redhat.com>
385
386 PR c++/92106 - ICE with structured bindings and -Wreturn-local-addr.
387 * typeck.c (maybe_warn_about_returning_address_of_local): Avoid
388 recursing on null initializer and return false instead.
389
390 2019-10-17 JeanHeyd Meneide <phdofthehouse@gmail.com>
391
392 Implement p1301 [[nodiscard("should have a reason")]] + p1771 DR
393 * tree.c (handle_nodiscard_attribute): Handle C++2a nodiscard
394 string message.
395 (std_attribute_table) Increase nodiscard argument handling
396 max_length from 0 to 1.
397 * parser.c (cp_parser_check_std_attribute): Add requirement
398 that nodiscard only be seen once in attribute-list.
399 (cp_parser_std_attribute): Check that empty parenthesis lists are
400 not specified for attributes that have max_length > 0 (e.g.
401 [[attr()]]).
402 * cvt.c (maybe_warn_nodiscard): Add nodiscard message to
403 output, if applicable.
404 (convert_to_void): Allow constructors to be nodiscard-able (P1771).
405
406 2019-10-18 Nathan Sidwell <nathan@acm.org>
407
408 * cp-tree.h (struct lang_type): Remove was_anonymous.
409 (TYPE_WAS_UNNAMED): Implement by checking TYPE_DECL &
410 TYPE_STUB_DECL.
411 * decl.c (name_unnamed_type): Don't set TYPE_WAS_UNNAMED.
412
413 2019-10-17 Paolo Carlini <paolo.carlini@oracle.com>
414
415 * decl.c (grokfndecl): Remove redundant use of in_system_header_at.
416 (compute_array_index_type_loc): Likewise.
417 (grokdeclarator): Likewise.
418 * error.c (cp_printer): Likewise.
419 * lambda.c (add_default_capture): Likewise.
420 * parser.c (cp_parser_primary_expression): Likewise.
421 (cp_parser_selection_statement): Likewise.
422 (cp_parser_toplevel_declaration): Likewise.
423 (cp_parser_enumerator_list): Likewise.
424 (cp_parser_using_declaration): Likewise.
425 (cp_parser_member_declaration): Likewise.
426 (cp_parser_exception_specification_opt): Likewise.
427 (cp_parser_std_attribute_spec): Likewise.
428 * pt.c (do_decl_instantiation): Likewise.
429 (do_type_instantiation): Likewise.
430 * typeck.c (cp_build_unary_op): Likewise.
431
432 * decl.c (check_tag_decl): Pass to in_system_header_at the same
433 location used for the permerror.
434 (grokdeclarator): Likewise.
435
436 * decl.c (check_tag_decl): Use locations[ds_typedef] in error_at.
437
438 2019-10-17 Jason Merrill <jason@redhat.com>
439
440 * cp-gimplify.c (cp_gimplify_expr): Use get_initialized_tmp_var.
441 (gimplify_to_rvalue): Remove default NULL argument.
442
443 2019-10-17 Nathan Sidwell <nathan@acm.org>
444
445 * decl.c (builtin_function_1): Merge into ...
446 (cxx_builtin_function): ... here. Nadger the decl before maybe
447 copying it. Set the context.
448 (cxx_builtin_function_ext_scope): Push to top level, then call
449 cxx_builtin_function.
450
451 2019-10-16 Luis Machado <luis.machado@linaro.org>
452
453 * cp-gimplify.c: Fix reference to non-existing tree-gimple.c file.
454
455 2019-10-16 Jakub Jelinek <jakub@redhat.com>
456
457 * decl.c (cxx_maybe_build_cleanup): When clearing location of cleanup,
458 if cleanup is a nop, clear location of its operand too.
459
460 2019-10-15 Andrew Sutton <asutton@lock3software.com>
461
462 Finish moving constraint and logic functionality of out pt.c.
463 Reimplement and re-enable subsumption caching.
464
465 * config-lang.in (gtfiles): Add logic.cc.
466 * constraint.cc (atomic_constraints_identical_p): Add assertions.
467 (hash_atomic_constraint): Likewise.
468 (constraints_equivalent_p): New.
469 (inchash::add_constraint): New.
470 (iterative_hash_constraint): New.
471 (decl_constraints): Moved from pt.c.
472 (get_constraints): Likewise.
473 (set_constraints): Likewise.
474 (remove_constraints): Likewise.
475 * cp-tree.h (CONSTR_P): New.
476 (init_constraint_processing): Remove.
477 (constraints_equivalent_p, iterative_hash_constraint): Declare.
478 * decl.c (cxx_init_decl_processing): Don't initialize constraints.
479 * logic.cc (subsumption_entry): Moved from pt.c.
480 (subsumption_hasher): Likewise.
481 (subsumption_cache): Likewise.
482 (lookup_subsumption): Likewise.
483 (save_subsumption): Likewise.
484 (subsumes_constraints_nonnull): Use subsumption cache.
485 * pt.c: Move aforementioned declarations out of this file.
486 (init_constraint_processing): Remove.
487
488 2019-10-15 Andrew Sutton <asutton@lock3software.com>
489
490 * parser.c (cp_parser_constructor_declarator_p): Pass an empty
491 decl-specifier-seq to make sure we parse type constraints as part
492 of a type-specifier.
493
494 2019-10-15 Nathan Sidwell <nathan@acm.org>
495
496 * class.c (build_clones): Break out of clone_function_decl. Just
497 build the clones.
498 (clone_function_decl): Call build_clones, then maybe add them to
499 the method vector.
500
501 * class.c (build_clone): Refactor to clarify recursiveness.
502
503 2019-10-14 Jason Merrill <jason@redhat.com>
504
505 PR c++/91930 - ICE with constrained inherited default ctor.
506 * name-lookup.c (do_class_using_decl): Set TYPE_HAS_USER_CONSTRUCTOR
507 for inherited constructor.
508
509 2019-10-14 Paolo Carlini <paolo.carlini@oracle.com>
510
511 * decl.c (check_tag_decl): Use DECL_SOURCE_LOCATION.
512
513 2019-10-14 Jakub Jelinek <jakub@redhat.com>
514
515 PR c++/92084
516 * semantics.c (handle_omp_array_sections_1): Temporarily disable
517 -fstrong-eval-order also for in_reduction and task_reduction clauses.
518
519 * parser.c (cp_parser_omp_all_clauses): Change bool NESTED_P argument
520 into int NESTED, if it is 2, diagnose missing commas in between
521 clauses.
522 (cp_parser_omp_context_selector): Pass 2 as last argument to
523 cp_parser_omp_all_clauses.
524
525 2019-10-12 Jakub Jelinek <jakub@redhat.com>
526
527 * parser.c (cp_parser_omp_context_selector): Improve error recovery.
528 For simd properties, put them directly into TREE_VALUE.
529 (cp_finish_omp_declare_variant): Add "omp declare variant base"
530 attribute rather than "omp declare variant".
531
532 2019-10-11 Marek Polacek <polacek@redhat.com>
533
534 PR c++/92049 - extra error with -fchecking=2.
535 * pt.c (build_non_dependent_expr): Call fold_non_dependent_expr
536 with tf_none.
537
538 2019-10-11 Paolo Carlini <paolo.carlini@oracle.com>
539
540 * typeck.c (cp_build_binary_op): Do not handle RROTATE_EXPR and
541 LROTATE_EXPR.
542 * constexpr.c (cxx_eval_constant_expression): Likewise.
543 (potential_constant_expression_1): Likewise.
544 * pt.c (tsubst_copy): Likewise.
545
546 2019-10-11 Jason Merrill <jason@redhat.com>
547
548 * decl2.c (mark_used): Don't clobber DECL_SOURCE_LOCATION on
549 explicitly defaulted functions.
550 * method.c (synthesize_method): Likewise.
551
552 2019-10-11 Jakub Jelinek <jakub@redhat.com>
553
554 PR c++/91987
555 * decl2.c (grok_array_decl): For -fstrong-eval-order, when array ref
556 operands have been swapped and at least one operand has side-effects,
557 revert the swapping before calling build_array_ref.
558 * typeck.c (cp_build_array_ref): For non-ARRAY_TYPE array ref with
559 side-effects on the index operand, if -fstrong-eval-order use
560 save_expr around the array operand.
561 (cp_build_binary_op): For shifts with side-effects in the second
562 operand, wrap first operand into SAVE_EXPR and evaluate it before
563 the shift.
564 * semantics.c (handle_omp_array_sections_1): Temporarily disable
565 flag_strong_eval_order during OMP_CLAUSE_REDUCTION array section
566 processing.
567 * cp-gimplify.c (gimplify_to_rvalue): New function.
568 (cp_gimplify_expr): Use it.
569
570 2019-10-10 Marek Polacek <polacek@redhat.com>
571
572 * typeck.c (comp_ptr_ttypes_real): Change the return type to bool.
573 Use false instead of 0.
574
575 2019-10-10 Jakub Jelinek <jakub@redhat.com>
576
577 * parser.h (struct cp_omp_declare_simd_data): Add variant_p member.
578 * parser.c (cp_ensure_no_omp_declare_simd): Handle both declare simd
579 and declare variant.
580 (cp_parser_oacc_all_clauses): Formatting fix.
581 (cp_parser_omp_all_clauses): Add NESTED_P argument, if true, terminate
582 processing on closing paren and don't skip to end of pragma line.
583 (cp_parser_omp_declare_simd): Add VARIANT_P argument. Handle also
584 declare variant.
585 (omp_construct_selectors, omp_device_selectors,
586 omp_implementation_selectors, omp_user_selectors): New variables.
587 (cp_parser_omp_context_selector,
588 cp_parser_omp_context_selector_specification,
589 cp_finish_omp_declare_variant): New functions.
590 (cp_parser_late_parsing_omp_declare_simd): Handle also declare variant.
591 (cp_parser_omp_declare): Handle declare variant.
592
593 2019-10-09 Jason Merrill <jason@redhat.com>
594
595 * cp-tree.h (template_info_decl_check): Check ENABLE_TREE_CHECKING.
596
597 2019-10-09 Marek Polacek <polacek@redhat.com>
598
599 PR c++/91364 - P0388R4: Permit conversions to arrays of unknown bound.
600 PR c++/69531 - DR 1307: Differently bounded array parameters.
601 PR c++/88128 - DR 330: Qual convs and pointers to arrays of pointers.
602 * call.c (build_array_conv): Build ck_identity at the beginning
603 of the conversion.
604 (standard_conversion): Pass bounds_none to comp_ptr_ttypes_const.
605 (maybe_warn_array_conv): New.
606 (convert_like_real): Call it. Add an error message about converting
607 from arrays of unknown bounds.
608 (conv_get_original_expr): New.
609 (nelts_initialized_by_list_init): New.
610 (conv_binds_to_array_of_unknown_bound): New.
611 (compare_ics): Implement list-initialization ranking based on
612 array sizes, as specified in DR 1307 and P0388R.
613 * cp-tree.h (comp_ptr_ttypes_const): Adjust declaration.
614 (compare_bounds_t): New enum.
615 * typeck.c (comp_array_types): New bool and compare_bounds_t
616 parameters. Use them.
617 (structural_comptypes): Adjust the call to comp_array_types.
618 (similar_type_p): Handle ARRAY_TYPE.
619 (build_const_cast_1): Pass bounds_none to comp_ptr_ttypes_const.
620 (comp_ptr_ttypes_real): Don't check cv-quals of ARRAY_TYPEs. Use
621 comp_array_types to compare array types. Look through arrays as per
622 DR 330.
623 (comp_ptr_ttypes_const): Use comp_array_types to compare array types.
624 Look through arrays as per DR 330.
625
626 2019-10-09 Marek Polacek <polacek@redhat.com>
627
628 PR c++/92032 - DR 1601: Promotion of enum with fixed underlying type.
629 * call.c (standard_conversion): When converting an enumeration with
630 a fixed underlying type to the underlying type, give it the cr_promotion
631 rank.
632 (compare_ics): Implement a tiebreaker as per CWG 1601.
633
634 2019-10-08 Andrew Sutton <asutton@lock3software.com>
635 Jason Merrill <jason@redhat.com>
636
637 Update the concepts implementation to conform to the C++20
638 specification, improve compile times, and generally clean up
639 the implementation.
640 * call.c (build_new_function_call): Don't evaluate concepts here.
641 (constraint_failure): Don't record the template.
642 (print_z_candidate): Don't extract the template.
643 * class.c (add_method): When overloading, hide ineligible special
644 member fns.
645 (check_methods): Set TYPE_HAS_COMPLEX_* here.
646 * constexpr.c (cxx_eval_constant_expression): Evaluate concepts.
647 (maybe_initialize_fundef_copies_table): Remove.
648 (get_fundef_copy): Use hash_map_safe_get_or_insert.
649 (clear_cv_and_fold_caches): Clear the satisfaction cache.
650 * constraint.cc (known_non_bool_p): New.
651 (parsing_constraint_expression_sentinel): Renamed from
652 expanding_constraint_sentinel.
653 (check_constraint_operands): New.
654 (check_constraint_atom): New.
655 (finish_constraint_binary_op): New.
656 (finish_constraint_or_expr): Likewise.
657 (finish_constraint_and_expr): Likewise.
658 (finish_constraint_primary_expr): Likewise.
659 (combine_constraint_expressions): New.
660 (finish_requires_expr): Add location parm.
661 (get_concept_definition): Return the initializer of concept definitions.
662 (get_template_head_requirements): New.
663 (get_trailing_function_requirements): New.
664 (deduce_constrained_parameter): Check if the identifier or template-id
665 is a concept definition.
666 (resolve_concept_definition_check): Removed.
667 (resolve_variable_concept_check): Removed.
668 (resolve_concept_check): New.
669 (resolve_constraint_check): Handle concept definitions.
670 converting arguments.
671 (function_concept_check_p): Removed.
672 (variable_concept_check_p): Removed.
673 (unpack_concept_check): New.
674 (get_concept_check_template): New.
675 (build_call_check): Moved and renamed to build_function_check.
676 (build_concept_check_arguments): make static.
677 (build_function_check): Always do overload resolution
678 in order to force conversion of template arguments (i.e., actually
679 check that the use of a concept is valid).
680 (build_standard_check): Renamed from build_real_concept_check.
681 (build_real_concept_check): Build checks for C++2a concepts by
682 (build_wildcard_concept_check): New.
683 (build_concept_check): Use build_real_concept_check. New overload.
684 (build_constraints): Save expressions, not normalized constraints.
685 (build_concept_id): New. Pass tf_warning_or_error.
686 (build_type_constraint): New.
687 (finish_type_constraints): New.
688 (associate_classtype_constraints): Also add constraints to union
689 types. Note the original declaration in errors. Don't return
690 error_mark_node in order to avoid an assertion later.
691 (push_down_pack_expansion): Remove.
692 (finish_shorthand_constraint): Make fold expressions, not naked
693 parameter packs. Always apply the constraint to each template argument.
694 (check_introduction_list): New. Fail if not enough
695 names are introduced.
696 (finish_template_introduction): Don't normalize constraints. Pass
697 tsubst flags. Check for insufficient introductions.
698 (placeholder_extract_concept_and_args): Handle the template-id case.
699 Unpack function concept checks correctly.
700 (tsubst_simple_requirement): Return errors if they occur. Don't
701 process as a template.
702 (tsubst_type_requirement): Likewise.
703 (type_deducible_p): New. Wrap the input expression in parens for the
704 purpose of deduction.
705 (expression_convertible_t): New.
706 (tsubst_compound_requirement): Use new deduction, conversion predicates.
707 (tsubst_nested_requirement): Return errors if they occur. Don't
708 process as a template. Instantiate and evaluate the nested requirement.
709 (tsubst_valid_expression_requirement): New.
710 (tsubst_simple_requirement): Use tsubst_valid_expression_requirement.
711 (tsubst_compound_requirement): Use tsubst_valid_expression_requirement.
712 (check_constaint_variables): New.
713 (tsubst_constraint_variables): Check that type substitutions are valid.
714 (tsubst_requires_expr): Likewise. Produce new requires-exprs during
715 template substitution. Copy the previous local specialization stack,
716 so references to non-local parameters can be found. Use cp_unevaluated.
717 (tsubst_constraint): New. Don't evaluate concept checks.
718 (subst_info): New.
719 (norm_info): New. Used to build a normalization tree for concept check
720 diagnostics.
721 (debug_parameter_mapping): New.
722 (debug_argument_list): New.
723 (expand_concept): Removed.
724 (normalize_logical_operation): Pass subst_info through call.
725 (normalize_pack_expansion): Remove.
726 (normalize_simple_requirement): Removed
727 (normalize_type_requirement): Removed
728 (normalize_compound_requirement): Removed
729 (normalize_nested_requirement): Removed
730 (normalize_requirement): Removed
731 (normalize_requirements): Removed
732 (normalize_requires_expression): Removed
733 (normalize_variable_concept_check): Removed.
734 (normalize_function_concept_check): Removed.
735 (normalize_concept_check): Merged all normalize_*_check here.
736 Substitute through written template arguments before normalizing the
737 definition. Only substitute the innermost template arguments.
738 (check_for_logical_overloads): Delete.
739 (map_arguments): New. Associate template parameters with arguments.
740 (build_parameter_mapping): New. Extract used parameters.
741 (normalize_expression): Rewrite.
742 (normalize_conjunction): Removed
743 (normalize_disjunction): Removed
744 (normalize_predicate_constraint): Removed
745 (normalize_parameterized_constraint): Removed
746 (normalized_map): New variable.
747 (get_normalized_constraints): New entry point for normalization.
748 Establishes a timer.
749 (get_normalized_constraints_from_info): New.
750 (get_normalized_constraints_from_decl): New. Turn on template processing
751 prior to normalization. Handle inheriting ctors. Build the
752 normalization arguments from the full set of template parameters of the
753 most general template. This guarantees that we have no concrete arguments
754 in the parameter mapping (e.g., from template members of class
755 templates). Cache normalizations.
756 (normalize_concept_definition): New. Cache normalizations.
757 (normalize_template_requirements): New.
758 (normalize_nontemplate_requirements): New.
759 (normalize_constraint_expression): New.
760 (tsubst_parameter_mapping): New.
761 (get_mapped_args): New.
762 (parameter_mapping_equivalent_p): New. Use template_args_equal.
763 (atomic_constraints_identical_p): New.
764 (hash_atomic_constraint): New.
765 (satisfying_constraint_p): New. Guard against recursive evaluation of
766 constraints during satisfaction.
767 (satisfy_conjunction): New.
768 (satisfy_disjunction): New.
769 (sat_entry): New class for hashing satisfaction results.
770 (sat_hasher): New hash traits.
771 (sat_cache): New.
772 (get_satisfaction): New. Returns cached satisfaction result.
773 (save_satisfaction): New. Caches a satisfaction result.
774 (clear_satisfaction_cache): New.
775 (satisfaction_cache): New. Helps manage satisfaction cache requests.
776 (decl_satisfied_cache): New.
777 (satisfy_atom): New.
778 (satisfy_constraint_r): New.
779 (satisfy_constraint): Use new satisfaction algorithm.
780 (evaluate_concept_check): New.
781 (evaluate_concept): Removed.
782 (evaluate_function_concept): Removed.
783 (evaluate_variable_concept): Removed.
784 (satisfy_constraint_expression): New.
785 (constraint_expression_satisfied_p): New.
786 (constraints_satisfied_p): Use strip_inheriting_ctors. Use
787 push_/pop_access_scope.
788 (more_constrained): Normalize before calling out to subsumption. Allow
789 classes as arguments.
790 (strictly_subsumes): Allow non-templates as arguments. Accept a new
791 template argument.
792 (weakly_subsumes): New.
793 (at_least_as_constrained): Removed.
794 (diagnose_other_expression): Removed.
795 (diagnose_predicate_constraint): Removed.
796 (diagnose_pack_expansion): Removed.
797 (diagnose_check_constraint): Removed.
798 (diagnose_logical_constraint): Removed.
799 (diagnose_expression_constraint): Removed.
800 (diagnose_type_constraint): Removed.
801 (diagnose_implicit_conversion_constraint): Removed.
802 (diagnose_argument_deduction_constraint): Removed.
803 (diagnose_exception_constraint): Removed.
804 (diagnose_parameterized_constraint): Removed.
805 (diagnose_argument_deduction_constraint): Removed.
806 (diagnose_argument_deduction_constraint): Removed.
807 (diagnose_argument_deduction_constraint): Removed.
808 (diagnose_trait_expr): New.
809 (diagnose_requires_expr): New.
810 (diagnose_atomic_constraint): New.
811 (diagnose_valid_expression) Stop wrongly diagnosing valid expressions.
812 Don't substitute as if in template decls. This causes substitution
813 to generate expressions that aren't suitable for use with the noexcept
814 routines.
815 (diagnose_valid_type) Likewise.
816 (diagnose_compound_requirement) Actually emit diagnostics for
817 the causes of errors.Call force_paren_expr_uneval.
818 (diagnose_declaration_constraints): Turn on template processing to
819 suppress certain analyses.
820 * cp-objcp-common.c (cp_common_init_ts): Make concepts typed.
821 (cp_get_debug_type): Use hash_map_safe_*.
822 * cp-tree.h: New function declarations for semantic actions, other
823 facilities. Remove declaration no longer used or needed. Remove
824 unused _CONSTR macros.
825 (LANG_DECL_HAS_MIN): Add CONCEPT_DECL.
826 (template_info_decl_check): Factor macro check into an inline function.
827 (DECL_TEMPLATE_INFO): Use new check facility.
828 (finish_concept_definition): New. Don't invalid concept declarations
829 with invalid initializers.
830 (find_template_parameters): New.
831 (concept_definition_p): New.
832 (concept_check_p): New.
833 (variable_concept_check_p): New.
834 (force_paren_expr_uneval): New.
835 (ovl_iterator::using_p): A USING_DECL by itself was also
836 introduced by a using-declaration.
837 (struct tree_template_info): Use tree_base instead of
838 tree_common. Add tmpl and args fields.
839 (TI_TEMPLATE, TI_ARGS): Adjust.
840 (DECLTYPE_FOR_INIT_CAPTURE): Remove.
841 (CONSTR_CHECK, CONSTR_INFO, CONSTR_EXPR, CONSTR_CONTEXT): New.
842 (ATOMIC_CONSTR_MAP, TRAIT_EXPR_LOCATION): New.
843 (struct tree_trait_expr): Add locus field.
844 (enum tsubst_flags): Add tf_norm as a hint to generate normalization
845 context when diagnosing constraint failure.
846 * cp-tree.def: Remove unused _CONSTR nodes and rename PRED_CONSTR
847 to ATOMIC_CONSTR.
848 (CONCEPT_DECL): New.
849 * cxx-pretty-print.c: Remove constraint printing code.
850 (pp_cxx_concept_definition): New.
851 (pp_cxx_template_declaration): Print concept definitions.
852 (pp_cxx_check_constraint): Update printing for concept definitions.
853 (pp_cxx_nested_name_specifier): Fix a weird
854 case where we're printing '::::' for concepts.
855 (simple_type_specifier): Print requirements for placeholder types.
856 (pp_cxx_constrained_type_spec): Print the associated requirements of
857 a placeholder type.
858 (pp_cxx_compound_requirement): Add space before the '->'.
859 (pp_cxx_parameter_mapping): Print the parameter mapping.
860 (pp_cxx_atomic_constraint): Use the function above.
861 * decl.c (redeclaration_error_message): New error for concepts.
862 (grokdeclarator): Check for and disallow decltype(auto) in parameter
863 declarations.
864 (grokfndecl): Don't normalize constraints. Add check for constraints
865 on declaration.
866 (grokvardecl): Don't normalize constraints.
867 (grok_special_member_properties): Don't set TYPE_HAS_COMPLEX_*.
868 (function_requirements_equivalent_p): New. Compare trailing
869 requires clauses. Compare combined constraints in pre-C++20 mode.
870 (decls_match): Compare trailing requires clauses. Compare template
871 heads for function templates. Remove old constraint comparison.
872 Simplify comparison of functions, function templates.
873 (duplicate_function_template_decls): New. Refactor a nasty if
874 condition into a single predicate.
875 (require_deduced_type): Don't complain if we already complained about
876 deduction failure.
877 (finish_function): Perform auto deduction to ensure that constraints
878 are checked even when functions contain no return statements. Only do
879 auto deduction if we haven't previously seen any return statements.
880 This prevents multiple diagnostics of the same error.
881 (store_decomp_type): Remove.
882 (cp_finish_decomp): Use hash_map_safe_put.
883 * error.c: Remove constraint printing code.
884 (dump_decl): Dump concept definitions. Handle wildcard declarations.
885 (dump_template_decl): Likewise.
886 (dump_type): Print associated requirements for placeholder
887 types.
888 (rebuild_concept_check): New.
889 (maybe_print_single_constraint_context): New.
890 (maybe_print_constraint_context): Recursively print nested contexts.
891 * init.c (get_nsdmi): Use hash_map_safe_*.
892 * lambda.c (maybe_add_lambda_conv_op): Bail if deduction failed.
893 (add_capture): Copy parameter packs from init.
894 (lambda_capture_field_type): Always use auto for init-capture.
895 * logic.cc: Completely rewrite.
896 (constraint_hash): New.
897 (clause/ctor): Save atoms in the hash table.
898 (replace): Save atoms during replacement.
899 (insert): Save atoms during insertion.
900 (contains): Only search the hash table for containment.
901 (clause): Keep a hash of atomic constraints.
902 (clause::clause): Explicitly copy the hash table when copying.
903 (disjunction_p, conjunction_p, atomic_p, dnf_size, cnf_size): New.
904 (diagnose_constraint_size): New.
905 (subsumes_constraints_nonnull): Compare the sizes of normalized formula
906 to determine the cheapest decomposition.
907 * name-lookup.c (diagnose_name_conflict): Diagnose name issues with
908 concepts.
909 (matching_fn_p): Check constraints.
910 (push_class_level_binding_1): Move overloaded functions case down,
911 accept FUNCTION_DECL as target_decl.
912 * parser.c (enum required_token): New required token for auto.
913 (make_location): Add overload taking lexer as last parm.
914 (cp_parser_required_error): Diagnose missing auto.
915 (cp_parser_diagnose_ungrouped_constraint_plain): New.
916 (cp_parser_diagnose_ungrouped_constraint_plain): New.
917 (cp_parser_constraint_primary_expression): New. Tentatively parse the
918 primary expression. If that fails tentatively parse a lower
919 precedence expression in order to diagnose the error.
920 (cp_parser_check_non_logical_constraint): New. Performs a trial
921 parse of the right-hand-side of non-logical operators in order to
922 generate good diagnostics.
923 (cp_parser_constraint_logical_and_expression): New.
924 (cp_parser_constraint_logical_or_expression): New.
925 (cp_parser_requires_clause_expression): New.
926 (cp_parser_requires_clause): Renamed to cp_parser_constraint_expression.
927 (cp_parser_requires_clause_opt): Parse the requires-clause differently
928 in -fconcepts and -std=c++2a modes.
929 (cp_parser_requirement_list): Rename to cp_parser_requirement_seq.
930 Rewrite so that semicolons are parsed
931 along with requirements, not the sequence.
932 (cp_parser_simple_requirement): Expect a semicolon at end.
933 (cp_parser_compound_requirement): Expect a semicolon at end. Only
934 allow trailing-return-type with -fconcepts-ts.
935 (cp_parser_nested_requirement): Expect a semicolon at end. Parse
936 constraint-expressions.
937 (cp_parser_concept_definition): New. Don't fail parsing the concept
938 definition if the initializer is ill-formed. Don't declare the concept
939 before parsing the initializer.
940 (cp_parser_constraint_expression): Declare earlier.
941 (cp_parser_type_requirement): Current scope is not valid.
942 (cp_parser_requires_expression): Commit to the tentative parse.
943 (cp_parser_decl_specifier_seq): Warn when concept appears to be used
944 as a decl-specifier.
945 (cp_parser_template_declaration_after_parameters): Parse concept
946 definitions.
947 (cp_parser_template_id): Don't try to resolve a concept template-id yet.
948 (cp_parser_template_id_expr): Resolve it as a concept check.
949 (cp_parser_decl_specifier_seq): Warn on 'concept bool'.
950 (cp_parser_type_parameter): Combine expressions not
951 constraints.
952 (cp_parser_explicit_template_declaration): Combine expressions not
953 constraints.
954 (cp_parser_maybe_concept_name): Removed.
955 (cp_parser_simple_type_specifier): Handle an error condition of
956 a bad constrained type specifier. Expect auto or decltype after
957 a concept name. Also handle the case where we have a template-id
958 as a concept check.
959 (cp_parser_template_introduction): Diagnose errors on invalid
960 introductions. Give up if it doesn't start with a concept name.
961 Pedwarn if not -fconcepts-ts.
962 (synthesize_implicit_template_parm): Don't do consistent binding.
963 Use a new flag for constrained parameters. Combine expressions,
964 not constraints. Fail if we get a placeholder in block scope.
965 Placeholders that do not constrain types are not allowed in parameter
966 declarations, so don't handle them.
967 (cp_parser_placeholder_type_specifier): New. Implement parsing of
968 placeholder type specifiers following a concept name or partial
969 concept check. Disallow decltype(auto) parameters.
970 (cp_parser_nested_name_specifier_opt): If the token is already
971 CPP_NESTED_NAME_SPECIFIER, leave it alone.
972 (cp_parser_id_expression, cp_parser_unqualified_id): Call
973 cp_parser_template_id_expr.
974 (cp_parser_placeholder_type_specifier): Add tentative parm. Don't
975 expect a WILDCARD_DECL.
976 (cp_parser_trait_expr): Pass trait_loc down.
977 (cp_parser_postfix_expression): Do set location of dependent member
978 call.
979 * pt.c (finish_concept_definition): New.
980 (push_template_decl_real): Handle concept definitions.
981 (start_concept_definition): Let push_template_decl_real handle the
982 creation of the template.
983 (get_constraints): Return null if the table hasn't been initialized.
984 (tsubst_copy_and_build): Build template-id expressions for concept
985 checks.
986 [TRAIT_EXPR]: Pass trait_loc down.
987 (lookup_template_class_1): Add the template name to the constraint
988 failure diagnostic.
989 (lookup_and_finish_template_variable): Build concept checks
990 with the correct arguments.
991 (tsubst_function_decl): Don't substitute through constraints.
992 Always associate constraints with functions.
993 (template_parm_level_and_index): Make non-static.
994 (for_each_template_parm_r): Handle requires expressions.
995 (keep_template_parm): New.
996 (find_template_parameters): New.
997 (more_specialized_fn): Change how winners and losers are chosen.
998 (make_constrained_auto): Don't normalize constraints.
999 (template_parameters_equivalent_p): New. Compare template
1000 parameters. Add a comparison for implicitly vs. explicitly declared
1001 parameters.
1002 (template_parameter_lists_equivalent_p): New. Compare template
1003 parameter lists.
1004 (template_requirements_equivalent_p): New.
1005 (template_heads_equivalent_p): New. Compare template heads.
1006 (template_parameter_constraints_equivalent_p): New.
1007 (is_compatible_template_arg): Use weakly_subsumes.
1008 (maybe_new_partial_specialization): Use new constraint comparison
1009 for finding specializations.
1010 (process_partial_specialization): Pass main template as argument.
1011 (more_specialized_partial_spec): Don't immediately return when
1012 detecting a winner.
1013 (make_constrained_auto): Handle concept definitions.
1014 (do_auto_deduction): Update auto deduction for new concept model.
1015 Extract the function concept correctly; rename constr to check to
1016 reflect the kind of node.
1017 (tsubst): Adjust wildcard argument during substitution.
1018 [DECLTYPE_TYPE]: Remove init-capture handling.
1019 (tsubst_copy_and_build): Build concept checks, not template ids.
1020 Defer checks of function concepts. Handle concepts before variable
1021 templates. Handle calls to function concepts explicitly.
1022 (coerce_template_parms): Use concept_definition_p. Handle a deduction
1023 error where a potentially empty pack can be supplied after the last
1024 parameter of a concept.
1025 (finish_template_variable): Don't process concepts here.
1026 (instantiation_dependent_r): Use concept_check_p.
1027 (tsubst_template_args): Make non-static.
1028 (make_constrained_placeholder_type): New. Refactored from
1029 make_constrained_auto.
1030 (make_constrained_auto) Use make_constrained_placeholder_type.
1031 (make_constrained_decltype_auto) New.
1032 (tsubst_function_parms): New.
1033 (value_dependent_expression_p) [TEMPLATE_ID_EXPR]: Use
1034 concept_definition_p.
1035 (push_access_scope, pop_access_scope): No longer static.
1036 (tsubst_template_parm): Substitute TEMPLATE_PARM_CONSTRAINTS.
1037 (tsubst_friend_function): Use tsubst_constraint. Use generic_targs_for.
1038 (get_underlying_template) Use generic_targs_for.
1039 (uses_parameter_packs): Return tree.
1040 (gen_elem_of_pack_expansion_instantiation): Don't push
1041 local_specialization_stack.
1042 (prepend_one_capture): New.
1043 (tsubst_lambda_expr): Use prepend_one_capture. Don't touch
1044 local_specializations.
1045 (template_parms_level_to_args): No longer static.
1046 (add_outermost_template_args): Likewise.
1047 (find_template_parameter_info): New. Provide context for finding
1048 template parameters.
1049 (keep_template_parm): Don't keep parameters declared at depth levels
1050 greater than those of the template parameters of the source declaration.
1051 Don't propagate cv-qualified types. Return 0, so we find all template
1052 parameters, not the just first.
1053 (any_template_parm_r): New. Handle cases that are mishandled by
1054 for_each_template_parm_r.
1055 (generic_targs_for): Factor out of coerce_template_args_for_ttp.
1056 (tsubst_argument_pack): Factor out of tsubst_template_args.
1057 (constraint_sat_entry): Removed.
1058 (constraint_sat_hasher): Removed.
1059 (concept_spec_entry): Removed.
1060 (concept_spec_hasher): Removed.
1061 (constraint_memos): Removed.
1062 (concept_memos): Removed.
1063 (lookup_constraint_satisfaction): Removed.
1064 (memoize_constraint_satisfaction): Removed.
1065 (lookup_concept_satisfaction): Removed.
1066 (memoize_concept_satisfaction): Removed.
1067 (concept_expansions): Removed.
1068 (get_concept_expansion): Removed.
1069 (save_concept_expansion): Removed.
1070 (init_constraint_processing): Remove initialization of non-existing
1071 resources.
1072 (find_template_requirement): New. Search for the sub-requirement
1073 within the associated constraints.
1074 (convert_generic_types_to_packs): Also transform the associated
1075 constraint and update the current template requirements.
1076 (store_defaulted_ttp, lookup_defaulted_ttp): Remove.
1077 (add_defaults_to_ttp): Use hash_map_safe_*.
1078 * semantics.c (finish_call_expr): Diagnose calls to concepts.
1079 Handle concept checks explicitly.
1080 (finish_id_expression): Evaluate variable concepts as part of
1081 id-expression processing. Don't treat variable concepts as variables,
1082 and don't process function concepts as plain id-expressions.
1083 (force_paren_expr): Add even_uneval parm.
1084 (finish_trait_expr): Add location parm.
1085 * tree.c (special_memfn_p): New.
1086 (cp_expr_location): Handle TRAIT_EXPR.
1087 * typeck.c (check_return_expr): Actually use the diagnostic kind
1088 when performing return-type deduction.
1089 * typeck2.c (build_functional_cast): Don't rely on the location of
1090 'auto'.
1091
1092 2019-10-09 Paolo Carlini <paolo.carlini@oracle.com>
1093
1094 * decl.c (grok_ctor_properties): Use DECL_SOURCE_LOCATION.
1095 * typeck.c (cp_build_binary_op): Use the op_location_t argument
1096 in many error messages.
1097
1098 2019-10-08 Martin Sebor <msebor@redhat.com>
1099
1100 PR c++/92001
1101 * call.c (maybe_warn_class_memaccess): Handle arrays.
1102
1103 2019-10-07 Paolo Carlini <paolo.carlini@oracle.com>
1104
1105 * call.c (resolve_args): Use cp_expr_loc_or_input_loc in one place.
1106 * decl.c (grokdeclarator): Use id_loc in one place.
1107 * decl2.c (build_anon_union_vars): Use DECL_SOURCE_LOCATION.
1108 * parser.c (cp_parser_delete_expression): Fix the location of the
1109 returned expression.
1110 (cp_parser_throw_expression): Likewise.
1111 * pt.c (determine_specialization): Use DECL_SOURCE_LOCATION.
1112
1113 2019-10-05 Jakub Jelinek <jakub@redhat.com>
1114
1115 PR c++/91369 - Implement P0784R7: constexpr new
1116 * cp-tree.h (enum cp_tree_index): Add CPTI_HEAP_UNINIT_IDENTIFIER,
1117 CPTI_HEAP_IDENTIFIER and CPTI_HEAP_DELETED_IDENTIFIER.
1118 (heap_uninit_identifier, heap_identifier, heap_deleted_identifier):
1119 Define.
1120 (type_has_constexpr_destructor, build_new_constexpr_heap_type,
1121 cxx_constant_dtor): Declare.
1122 * class.c (type_maybe_constexpr_default_constructor): Make static.
1123 (type_maybe_constexpr_destructor, type_has_constexpr_destructor): New
1124 functions.
1125 (finalize_literal_type_property): For c++2a, don't clear
1126 CLASSTYPE_LITERAL_P for types without trivial destructors unless they
1127 have non-constexpr destructors.
1128 (explain_non_literal_class): For c++2a, complain about non-constexpr
1129 destructors rather than about non-trivial destructors.
1130 * constexpr.c: Include stor-layout.h.
1131 (struct constexpr_global_ctx): New type.
1132 (struct constexpr_ctx): Add global field, remove values and
1133 constexpr_ops_count.
1134 (cxx_replaceable_global_alloc_fn): New inline function.
1135 (cxx_eval_call_expression): For c++2a allow calls to replaceable
1136 global allocation functions, for new return address of a heap uninit
1137 var, for delete record its deletion. Change ctx->values->{get,put} to
1138 ctx->global->values.{get,put}.
1139 (non_const_var_error): Add auto_diagnostic_group sentinel. Emit
1140 special diagnostics for heap variables.
1141 (cxx_eval_store_expression): Change ctx->values->{get,put} to
1142 ctx->global->values.{get,put}.
1143 (cxx_eval_loop_expr): Initialize jump_target if NULL. Change
1144 new_ctx.values->remove to ctx->global->values.remove.
1145 (cxx_eval_constant_expression): Change *ctx->constexpr_ops_count
1146 to ctx->global->constexpr_ops_count. Change ctx->values->{get,put} to
1147 ctx->global->values.{get,put}.
1148 <case NOP_EXPR>: Formatting fix. On cast of replaceable global
1149 allocation function to some pointer type, adjust the type of
1150 the heap variable and change name from heap_uninit_identifier
1151 to heap_identifier.
1152 (find_heap_var_refs): New function.
1153 (cxx_eval_outermost_constant_expr): Add constexpr_dtor argument,
1154 handle evaluation of constexpr dtors and add tracking of heap
1155 variables. Use tf_no_cleanup for get_target_expr_with_sfinae.
1156 (cxx_constant_value): Adjust cxx_eval_outermost_constant_expr caller.
1157 (cxx_constant_dtor): New function.
1158 (maybe_constant_value, fold_non_dependent_expr_template,
1159 maybe_constant_init_1): Adjust cxx_eval_outermost_constant_expr
1160 callers.
1161 (potential_constant_expression_1): Ignore clobbers. Allow
1162 COND_EXPR_IS_VEC_DELETE for c++2a.
1163 * decl.c (initialize_predefined_identifiers): Add heap identifiers.
1164 (decl_maybe_constant_destruction): New function.
1165 (cp_finish_decl): Don't clear TREE_READONLY for constexpr variables
1166 with non-trivial, but constexpr destructors.
1167 (register_dtor_fn): For constexpr variables with constexpr non-trivial
1168 destructors call cxx_maybe_build_cleanup instead of adding destructor
1169 calls at runtime.
1170 (expand_static_init): For constexpr variables with constexpr
1171 non-trivial destructors call cxx_maybe_build_cleanup.
1172 (grokdeclarator): Allow constexpr destructors for c++2a. Formatting
1173 fix.
1174 (cxx_maybe_build_cleanup): For constexpr variables with constexpr
1175 non-trivial destructors call cxx_constant_dtor instead of adding
1176 destructor calls at runtime.
1177 * init.c: Include stor-layout.h.
1178 (build_new_constexpr_heap_type, maybe_wrap_new_for_constexpr): New
1179 functions.
1180 (build_new_1): For c++2a and new[], add cast around the alloc call
1181 to help constexpr evaluation figure out the type of the heap storage.
1182 (build_vec_delete_1): Set DECL_INITIAL of tbase and emit a DECL_EXPR
1183 for it instead of initializing an uninitialized variable.
1184 * method.c: Include intl.h.
1185 (SFK_CTOR_P, SFK_DTOR_P, SFK_ASSIGN_P, SFK_COPY_P, SFK_MOVE_P): Move
1186 definitions earlier.
1187 (process_subob_fn): Add sfk argument, adjust non-constexpr call
1188 diagnostics based on it.
1189 (walk_field_subobs): Formatting fixes. Adjust process_subob_fn caller.
1190 (synthesized_method_base_walk): Likewise.
1191 (synthesized_method_walk): Set *constexpr_p to true for dtors in c++2a.
1192 Fix up DR number in comment.
1193 (implicitly_declare_fn): Formatting fix.
1194 * typeck2.c (store_init_value): Don't call cp_fully_fold_init on
1195 initializers of automatic non-constexpr variables in constexpr
1196 functions.
1197
1198 2019-10-04 Jakub Jelinek <jakub@redhat.com>
1199
1200 PR c++/71504
1201 * constexpr.c (cxx_fold_indirect_ref_1): New function.
1202 (cxx_fold_indirect_ref): Use it.
1203
1204 PR c++/91974
1205 * cp-gimplify.c (cp_gimplify_expr) <case CALL_EXPR>: For
1206 -fstrong-eval-order ensure CALL_EXPR_FN side-effects are evaluated
1207 before any arguments. Additionally, ensure CALL_EXPR_FN that isn't
1208 invariant nor OBJ_TYPE_REF nor SSA_NAME is forced into a temporary.
1209
1210 2019-10-03 Paolo Carlini <paolo.carlini@oracle.com>
1211
1212 * init.c (build_new): Use cp_expr_loc_or_input_loc in two places.
1213 * name-lookup.c (do_pushdecl): Use DECL_SOURCE_LOCATION.
1214 (push_class_level_binding_1): Likewise.
1215 (set_decl_namespace): Likewise.
1216
1217 2019-10-03 Jakub Jelinek <jakub@redhat.com>
1218
1219 * constexpr.c (cxx_eval_constant_expression) <case CLEANUP_STMT>: If
1220 not skipping upon entry to body, run cleanup with the same *jump_target
1221 as it started to run the cleanup even if the body returns, breaks or
1222 continues.
1223 (potential_constant_expression_1): Allow CLEANUP_STMT.
1224
1225 * constexpr.c (cxx_eval_store_expression): Formatting fix. Handle
1226 const_object_being_modified with array type.
1227
1228 2019-10-02 Jason Merrill <jason@redhat.com>
1229
1230 * typeck2.c (store_init_value): Only clear_cv_and_fold_caches if the
1231 value is constant.
1232
1233 2019-09-30 Jason Merrill <jason@redhat.com>
1234
1235 Use hash_map_safe_* functions.
1236 * constexpr.c (maybe_initialize_fundef_copies_table): Remove.
1237 (get_fundef_copy): Use hash_map_safe_get_or_insert.
1238 * cp-objcp-common.c (cp_get_debug_type): Use hash_map_safe_*.
1239 * decl.c (store_decomp_type): Remove.
1240 (cp_finish_decomp): Use hash_map_safe_put.
1241 * init.c (get_nsdmi): Use hash_map_safe_*.
1242 * pt.c (store_defaulted_ttp, lookup_defaulted_ttp): Remove.
1243 (add_defaults_to_ttp): Use hash_map_safe_*.
1244
1245 2019-10-02 Richard Biener <rguenther@suse.de>
1246
1247 PR c++/91606
1248 * decl.c (build_ptrmemfunc_type): Mark pointer-to-member
1249 fat pointer structure members as DECL_NONADDRESSABLE_P.
1250
1251 2019-09-28 Marek Polacek <polacek@redhat.com>
1252
1253 PR c++/91889 - follow-up fix for DR 2352.
1254 * call.c (involves_qualification_conversion_p): New function.
1255 (direct_reference_binding): Build a ck_qual if the conversion
1256 would involve a qualification conversion.
1257 (convert_like_real): Strip the conversion created by the ck_qual
1258 in direct_reference_binding.
1259
1260 PR c++/91921 - stray warning with -Woverloaded-virtual.
1261 * class.c (warn_hidden): Only emit the second part of
1262 -Woverloaded-virtual if the first part was issued. Use inform instead
1263 warning_at.
1264
1265 PR c++/91923 - failure-to-SFINAE with class type NTTP in C++17.
1266 * pt.c (invalid_nontype_parm_type_p): Only emit errors when
1267 tf_error.
1268
1269 2019-09-27 Jakub Jelinek <jakub@redhat.com>
1270
1271 PR c++/88203
1272 * parser.c (cp_parser_omp_var_list_no_open): Parse predefined
1273 variables.
1274 * semantics.c (finish_omp_clauses): Allow predefined variables in
1275 shared and firstprivate clauses, even when they are predetermined
1276 shared.
1277 * cp-gimplify.c (cxx_omp_predetermined_sharing_1): Return
1278 OMP_CLAUSE_DEFAULT_SHARED for predefined variables.
1279
1280 2019-09-27 Jason Merrill <jason@redhat.com>
1281
1282 * constexpr.c (cxx_fold_indirect_ref): Use similar_type_p.
1283 (cxx_eval_indirect_ref): Likewise. Improve error location.
1284
1285 * cp-tree.h (class iloc_sentinel): New.
1286 * decl.c (grokdeclarator, finish_enum_value_list): Use it.
1287 * mangle.c (mangle_decl_string): Use it.
1288 * pt.c (perform_typedefs_access_check): Use it.
1289
1290 2019-09-27 Richard Sandiford <richard.sandiford@arm.com>
1291
1292 * cp-tree.h (build_cxx_call): Take the original function decl
1293 as an optional final parameter.
1294 (cp_build_function_call_vec): Likewise.
1295 * call.c (build_cxx_call): Likewise. Pass all built-in calls to
1296 check_builtin_function_arguments.
1297 * typeck.c (build_function_call_vec): Take the original function
1298 decl as an optional final parameter and pass it to
1299 cp_build_function_call_vec.
1300 (cp_build_function_call_vec): Take the original function
1301 decl as an optional final parameter and pass it to build_cxx_call.
1302
1303 2019-09-25 Marek Polacek <polacek@redhat.com>
1304
1305 PR c++/91877 - ICE with converting member of packed struct.
1306 * call.c (convert_like_real): Use similar_type_p in an assert.
1307
1308 2019-09-25 Paolo Carlini <paolo.carlini@oracle.com>
1309
1310 * name-lookup.c (check_extern_c_conflict): Use DECL_SOURCE_LOCATION.
1311 (check_local_shadow): Use it in three additional places.
1312
1313 2019-09-24 Jason Merrill <jason@redhat.com>
1314
1315 * parser.c (cp_parser_postfix_expression): Do set location of
1316 dependent member call.
1317
1318 2019-09-24 Marek Polacek <polacek@redhat.com>
1319
1320 PR c++/91868 - improve -Wshadow location.
1321 * name-lookup.c (check_local_shadow): Use DECL_SOURCE_LOCATION
1322 instead of input_location.
1323
1324 PR c++/91845 - ICE with invalid pointer-to-member.
1325 * expr.c (mark_use): Use error_operand_p.
1326 * typeck2.c (build_m_component_ref): Check error_operand_p after
1327 calling mark_[lr]value_use.
1328
1329 2019-09-23 Paolo Carlini <paolo.carlini@oracle.com>
1330
1331 * pt.c (check_explicit_specialization): Use cp_expr_loc_or_input_loc.
1332 (process_partial_specialization): Likewise.
1333 (convert_nontype_argument_function): Likewise.
1334 (invalid_tparm_referent_p): Likewise.
1335 (convert_template_argument): Likewise.
1336 (check_valid_ptrmem_cst_expr): Tidy.
1337
1338 2019-09-23 Jason Merrill <jason@redhat.com>
1339
1340 PR c++/91809 - bit-field and ellipsis.
1341 * call.c (convert_arg_to_ellipsis): Don't call decay_conversion for
1342 arithmetic arguments.
1343
1344 2019-09-23 Marek Polacek <polacek@redhat.com>
1345
1346 PR c++/91844 - Implement CWG 2352, Similar types and reference binding.
1347 * call.c (reference_related_p): Use similar_type_p instead of
1348 same_type_p.
1349 (reference_compatible_p): Update implementation to match CWG 2352.
1350 * cp-tree.h (similar_type_p): Declare.
1351 * typeck.c (similar_type_p): New.
1352
1353 2019-09-22 Marek Polacek <polacek@redhat.com>
1354
1355 PR c++/91819 - ICE with operator++ and enum.
1356 * call.c (build_new_op_1): Set arg2_type.
1357
1358 2019-09-17 Jason Merrill <jason@redhat.com>
1359
1360 * parser.c (cp_parser_statement): Handle [[likely]] on
1361 compound-statement.
1362
1363 2019-09-19 Jason Merrill <jason@redhat.com>
1364
1365 Revert:
1366 * call.c (build_new_op_1): Don't apply any standard conversions to
1367 the operands of a built-in operator. Don't suppress conversions in
1368 cp_build_unary_op.
1369 * typeck.c (cp_build_unary_op): Do integral promotions for enums.
1370
1371 2019-09-16 Paolo Carlini <paolo.carlini@oracle.com>
1372
1373 * decl.c (grokdeclarator): Use declspecs->locations and
1374 declarator->id_loc in a few error messages.
1375 * pt.c (finish_member_template_decl): Use DECL_SOURCE_LOCATION.
1376 (push_template_decl_real): Likewise.
1377
1378 2019-09-15 Jason Merrill <jason@redhat.com>
1379
1380 PR c++/30277 - int-width bit-field promotion.
1381 PR c++/33819 - long bit-field promotion.
1382 * typeck.c (cp_perform_integral_promotions): Handle large bit-fields
1383 properly. Handle 32-bit non-int bit-fields properly.
1384 (is_bitfield_expr_with_lowered_type): Don't look through NOP_EXPR.
1385
1386 PR c++/82165 - enum bitfields and operator overloading.
1387 * call.c (build_new_op_1): Use unlowered_expr_type.
1388
1389 * call.c (build_new_op_1): Don't apply any standard conversions to
1390 the operands of a built-in operator. Don't suppress conversions in
1391 cp_build_unary_op.
1392 * typeck.c (cp_build_unary_op): Do integral promotions for enums.
1393
1394 2019-09-15 Marek Polacek <polacek@redhat.com>
1395
1396 PR c++/91740 - ICE with constexpr call and ?: in ARRAY_REF.
1397 * pt.c (build_non_dependent_expr): Call build_non_dependent_expr for
1398 the first operand.
1399
1400 2019-09-15 Nathan Sidwell <nathan@acm.org>
1401
1402 * cp-tree.h (DECL_CLONED_FUNCTION_P): Reimplement using
1403 IDENTIFIER_CDTOR_P, correct documentation.
1404 (DECL_CLONED_FUNCTION): Directly access field.
1405 (decl_cloned_function_p): Delete.
1406 * class.c (decl_cloned_function_p): Delete.
1407 * pt.c (instantiate_template_1): Check DECL_CHAIN is a decl.
1408
1409 2019-09-11 Nathan Sidwell <nathan@acm.org>
1410
1411 * c-objcp-common.c (cp-objcp-common.c): Alphababetize and
1412 correctly mark all C++ nodes.
1413 * decl.c (cp_tree_node_structure): Alphabetize.
1414
1415 2019-09-10 Marek Polacek <polacek@redhat.com>
1416
1417 PR c++/91673 - ICE with noexcept in alias-declaration.
1418 * parser.c (CP_PARSER_FLAGS_DELAY_NOEXCEPT): New parser flag.
1419 (cp_parser_lambda_declarator_opt): Pass CP_PARSER_FLAGS_NONE to
1420 cp_parser_exception_specification_opt.
1421 (cp_parser_direct_declarator): Adjust a call to
1422 cp_parser_exception_specification_opt.
1423 (cp_parser_member_declaration): Pass CP_PARSER_FLAGS_DELAY_NOEXCEPT
1424 to cp_parser_declarator if not processing a friend or typedef
1425 declaration.
1426 (cp_parser_late_noexcept_specifier): Adjust a call to
1427 cp_parser_noexcept_specification_opt.
1428 (cp_parser_noexcept_specification_opt): New parameter for parser flags,
1429 drop the FRIEND_P parameter. Use the new parameter.
1430 (cp_parser_exception_specification_opt): Likewise.
1431 (cp_parser_transaction): Adjust a call to
1432 cp_parser_noexcept_specification_opt.
1433 (cp_parser_transaction_expression): Likewise.
1434
1435 2019-09-10 Marek Polacek <polacek@redhat.com>
1436
1437 PR c++/91705 - constexpr evaluation rejects ++/-- on floats.
1438 * constexpr.c (cxx_eval_increment_expression): Call fold_simple on
1439 the offset.
1440
1441 2019-09-10 Paolo Carlini <paolo.carlini@oracle.com>
1442
1443 * decl.c (has_designator_problem): Use cp_expr_loc_or_input_loc
1444 in error_at.
1445 (build_enumerator): Likewise.
1446 (cp_finish_decl): Use DECL_SOURCE_LOCATION.
1447 (grokdeclarator): Use id_loc in two error_at; change errror
1448 message about constinit together constexpr to use two ranges.
1449
1450 2019-09-09 Marek Polacek <polacek@redhat.com>
1451
1452 PR c++/84374 - diagnose invalid uses of decltype(auto).
1453 * decl.c (grokdeclarator): Diagnose wrong usage of decltype(auto) in
1454 a function declaration.
1455
1456 2019-09-06 Nathan Sidwell <nathan@acm.org>
1457
1458 PR c++/91125
1459 * cp-tree.h (IDENTIFIER_REPO_CHOSEN, DECL_REPO_AVAILABLE_P): Delete.
1460 (struct lang_decl_base): Remove repo_available_p.
1461 * decl.c (duplicate_decls): Don't copy DECL_REPO_AVAILABLE_P.
1462
1463 (Reserve TREE_LANG_FLAG_3 for modules.
1464 * cp-tree.h (DECL_CONSTRUCTION_VTABLE_P): Delete.
1465 (DECL_NON_TRIVIALLY_INITIALIZED_P): Move to TREE_LANG_FLAG_6.
1466 * class.c (build_ctor_vtbl_group): Don't set
1467 DECL_CONSTRUCTION_VTABLE_P.
1468 * decl2.c (determine_visibility_from_class): Don't check
1469 DECL_CONSTRUCTION_VTABLE_P anymore.
1470
1471 2019-09-06 Martin Liska <mliska@suse.cz>
1472
1473 PR c++/91125
1474 * Make-lang.in: Remove repo.o.
1475 * config-lang.in: Likewise.
1476 * cp-tree.h (init_repo): Remove declarations
1477 of repo-related functions.
1478 (repo_emit_p): Likewise.
1479 (repo_export_class_p): Likewise.
1480 (finish_repo): Likewise.
1481 * decl2.c (import_export_class): Always
1482 set -1 value/
1483 (mark_needed): Remove -frepo from comment.
1484 (import_export_decl): Similarly here.
1485 (c_parse_final_cleanups): Remove call of finish_repo.
1486 * lex.c (cxx_init): Remove call to init_repo.
1487 * optimize.c (can_alias_cdtor): Remove dead condition.
1488 * pt.c (push_template_decl_real): Update comment.
1489 (instantiate_decl): Remove dead code used for -frepo.
1490 * repo.c: Remove.
1491
1492 2019-09-05 Marek Polacek <polacek@redhat.com>
1493
1494 PR c++/91644 - ICE with constinit in function template.
1495 * decl.c (start_decl): Call retrofit_lang_decl for constinit variables.
1496 * pt.c (tsubst_expr): Pass LOOKUP_CONSTINIT down to cp_finish_decl for
1497 constinit variables.
1498
1499 2019-09-05 Nathan Sidwell <nathan@acm.org>
1500
1501 * cp-tree.h (DECL_VTABLE_OR_VTT_P): Forward to DECL_VIRTUAL_P.
1502
1503 2019-09-04 Marek Polacek <polacek@redhat.com>
1504
1505 * call.c (build_over_call): Remove -fdeduce-init-list implementation.
1506 * pt.c (unify): Likewise.
1507
1508 2019-09-01 Marek Polacek <polacek@redhat.com>
1509
1510 PR c++/91129 - wrong error with binary op in template argument.
1511 * typeck.c (warn_for_null_address): Use fold_for_warn instead of
1512 fold_non_dependent_expr.
1513 (cp_build_binary_op): Likewise.
1514
1515 2019-08-30 Jason Merrill <jason@redhat.com>
1516
1517 Add source location to TRAIT_EXPR.
1518 * cp-tree.h (TRAIT_EXPR_LOCATION): New.
1519 (struct tree_trait_expr): Add locus field.
1520 * parser.c (cp_parser_trait_expr): Pass trait_loc down.
1521 * pt.c (tsubst_copy_and_build) [TRAIT_EXPR]: Likewise.
1522 * semantics.c (finish_trait_expr): Add location parm.
1523 * tree.c (cp_expr_location): Handle TRAIT_EXPR.
1524
1525 2019-08-29 Paolo Carlini <paolo.carlini@oracle.com>
1526
1527 * decl.c (check_var_type): Add location_t parameter and use it.
1528 (grokdeclarator): Adjust call.
1529 * pt.c (tsubst_decl): Likewise.
1530 * cp-tree.h: Adjust declaration.
1531
1532 2019-08-28 Marek Polacek <polacek@redhat.com>
1533
1534 Implement P1152R4: Deprecating some uses of volatile.
1535 PR c++/91361
1536 * cp-gimplify.c (cp_fold): Set TREE_THIS_VOLATILE.
1537 * decl.c (grokdeclarator): Warn about a volatile-qualified structured
1538 binding and return type.
1539 (grokparms): Warn about a volatile-qualified function parameter.
1540 * expr.c (mark_use) <case MODIFY_EXPR>: Emit a -Wvolatile warning.
1541 * typeck.c (cp_build_unary_op): Emit a -Wvolatile warning for pre and
1542 post ++/-- on a volatile operand.
1543 (genericize_compound_lvalue): Use a better location. Don't lose
1544 TREE_THIS_VOLATILE.
1545 (cp_build_modify_expr): Emit a -Wvolatile warning for a compound
1546 assignment whose LHS is volatile-qualified. Build the assignment with
1547 a more precise location.
1548
1549 2019-08-28 Marek Polacek <polacek@redhat.com>
1550
1551 PR c++/91360 - Implement C++20 P1143R2: constinit.
1552 * cp-tree.h (TINFO_VAR_DECLARED_CONSTINIT): Define.
1553 (LOOKUP_CONSTINIT): Define.
1554 (enum cp_decl_spec): Add ds_constinit.
1555 * decl.c (check_tag_decl): Give an error for constinit in type
1556 declarations.
1557 (check_initializer): Also check LOOKUP_CONSTINIT.
1558 (cp_finish_decl): Add checking for a constinit declaration. Set
1559 TINFO_VAR_DECLARED_CONSTINIT.
1560 (grokdeclarator): Add checking for a declaration with the constinit
1561 specifier.
1562 * lex.c (init_reswords): Handle D_CXX20.
1563 * parser.c (cp_lexer_get_preprocessor_token): Pass a better location
1564 to warning_at. Warn about C++20 keywords.
1565 (cp_keyword_starts_decl_specifier_p): Handle RID_CONSTINIT.
1566 (cp_parser_diagnose_invalid_type_name): Add an inform about constinit.
1567 (cp_parser_decomposition_declaration): Maybe pass LOOKUP_CONSTINIT to
1568 cp_finish_decl.
1569 (cp_parser_decl_specifier_seq): Handle RID_CONSTINIT.
1570 (cp_parser_init_declarator): Maybe pass LOOKUP_CONSTINIT to
1571 cp_finish_decl.
1572 (set_and_check_decl_spec_loc): Add "constinit".
1573 * pt.c (tsubst_decl): Set TINFO_VAR_DECLARED_CONSTINIT.
1574 (instantiate_decl): Maybe pass LOOKUP_CONSTINIT to cp_finish_decl.
1575 * typeck2.c (store_init_value): If a constinit variable wasn't
1576 initialized using a constant initializer, give an error.
1577
1578 2019-08-28 Nathan Sidwell <nathan@acm.org>
1579
1580 PR c++/90613
1581 * name-lookup.c (cp_emit_debug_info): Check for builtins during
1582 overload iteration.
1583
1584 2019-08-27 Marek Polacek <polacek@redhat.com>
1585
1586 PR c++/81676 - bogus -Wunused warnings in constexpr if.
1587 * semantics.c (maybe_mark_exp_read_r): New function.
1588 (finish_if_stmt): Call it on THEN_CLAUSE and ELSE_CLAUSE.
1589
1590 PR c++/91428 - warn about std::is_constant_evaluated in if constexpr.
1591 * cp-tree.h (decl_in_std_namespace_p): Declare.
1592 * semantics.c (is_std_constant_evaluated_p): New.
1593 (finish_if_stmt_cond): Warn about "std::is_constant_evaluated ()" in
1594 an if-constexpr.
1595 * typeck.c (decl_in_std_namespace_p): No longer static.
1596
1597 2019-08-26 Jason Merrill <jason@redhat.com>
1598
1599 * decl.c (duplicate_decls): Always merge DECL_DECLARED_CONSTEXPR_P.
1600
1601 2019-08-26 Marek Polacek <polacek@redhat.com>
1602
1603 PR c++/91545 - ICE in constexpr store evaluation.
1604 * constexpr.c (cxx_eval_store_expression): Check FIELD_DECL instead
1605 of DECL_P.
1606
1607 2019-08-24 Nathan Sidwell <nathan@acm.org>
1608
1609 * class.c (check_for_overrides): Conversion operators need
1610 checking too.
1611
1612 2019-08-24 Paolo Carlini <paolo.carlini@oracle.com>
1613
1614 * semantics.c (finish_switch_cond): Improve error message location.
1615
1616 2019-08-23 Jason Merrill <jason@redhat.com>
1617
1618 * decl2.c (decl_dependent_p): New.
1619 (mark_used): Check it instead of just processing_template_decl.
1620
1621 2019-08-23 Jason Merrill <jason@redhat.com>
1622
1623 * parser.c (cp_parser_nested_name_specifier_opt): Avoid redundant
1624 error.
1625
1626 2019-08-23 Marek Polacek <polacek@redhat.com>
1627
1628 PR c++/91521 - wrong error with operator->.
1629 * decl.c (grokdeclarator): Return error_mark_node for an invalid
1630 trailing return type.
1631
1632 PR c++/79817 - attribute deprecated on namespace.
1633 * cp-tree.h (cp_warn_deprecated_use_scopes): Declare.
1634 * decl.c (grokdeclarator): Call cp_warn_deprecated_use_scopes.
1635 (type_is_deprecated): Likewise.
1636 * decl2.c (cp_warn_deprecated_use_scopes): New function.
1637 * name-lookup.c (handle_namespace_attrs): Handle attribute deprecated.
1638 * parser.c (cp_parser_namespace_alias_definition): Call
1639 cp_warn_deprecated_use_scopes.
1640 (cp_parser_using_declaration): Likewise.
1641 (cp_parser_using_directive): Likewise.
1642 * semantics.c (finish_id_expression_1): Likewise.
1643
1644 2019-08-23 Nathan Sidwell <nathan@acm.org>
1645
1646 * class.c (check_for_override): Checking IDENTIFIER_VIRTUAL_P is
1647 sufficient, reorder DECL_OVERRIDE_P check.
1648
1649 2019-08-23 Iain Sandoe <iain@sandoe.co.uk>
1650
1651 PR pch/61250
1652 * parser.c (cp_parser_initial_pragma): Call c_common_no_more_pch ()
1653 after determining that the first token is not
1654 PRAGMA_GCC_PCH_PREPROCESS.
1655
1656 2019-08-22 Marek Polacek <polacek@redhat.com>
1657
1658 PR c++/91304 - prefix attributes ignored in condition.
1659 * parser.c (cp_parser_condition): Handle prefix attributes.
1660
1661 2019-08-21 Richard Sandiford <richard.sandiford@arm.com>
1662
1663 PR c++/91505
1664 * decl.c (duplicate_decls): Call copy_attributes_to_builtin inside
1665 the BUILT_IN_NORMAL block rather than afterward.
1666
1667 2019-08-19 Marek Polacek <polacek@redhat.com>
1668
1669 PR c++/91264 - detect modifying const objects in constexpr.
1670 * constexpr.c (modifying_const_object_error): New function.
1671 (cxx_eval_call_expression): Set TREE_READONLY on a CONSTRUCTOR of
1672 a const-qualified object after it's been fully constructed.
1673 (modifying_const_object_p): New function.
1674 (cxx_eval_store_expression): Detect modifying a const object
1675 during constant expression evaluation.
1676 (cxx_eval_increment_expression): Use a better location when building
1677 up the store.
1678 (cxx_eval_constant_expression) <case DECL_EXPR>: Mark a constant
1679 object's constructor TREE_READONLY.
1680
1681 2019-08-15 Jason Merrill <jason@redhat.com>
1682
1683 PR c++/90393 - ICE with thow in ?:
1684
1685 PR c++/64372, DR 1560 - Gratuitous lvalue-to-rvalue conversion in ?:
1686 * tree.c (lvalue_kind): Handle throw in one arm.
1687 * typeck.c (rationalize_conditional_expr): Likewise.
1688 (cp_build_modify_expr): Likewise.
1689
1690 2019-08-14 Jason Merrill <jason@redhat.com>
1691
1692 Implement P0848R3, Conditionally Trivial Special Member Functions.
1693 * tree.c (special_memfn_p): New.
1694 * class.c (add_method): When overloading, hide ineligible special
1695 member fns.
1696 (check_methods): Set TYPE_HAS_COMPLEX_* here.
1697 * decl.c (grok_special_member_properties): Not here.
1698 * name-lookup.c (push_class_level_binding_1): Move overloaded
1699 functions case down, accept FUNCTION_DECL as target_decl.
1700
1701 2019-08-14 Jonathan Wakely <jwakely@redhat.com>
1702
1703 PR c++/91436
1704 * name-lookup.c (get_std_name_hint): Fix min_dialect field for
1705 complex_literals and make_unique entries.
1706
1707 2019-08-14 Jakub Jelinek <jakub@redhat.com>
1708 Marek Polacek <polacek@redhat.com>
1709
1710 PR c++/91391 - bogus -Wcomma-subscript warning.
1711 * parser.c (cp_parser_postfix_open_square_expression): Don't warn about
1712 a deprecated comma here. Pass warn_comma_subscript down to
1713 cp_parser_expression.
1714 (cp_parser_expression): New bool parameter. Warn about uses of a comma
1715 operator within a subscripting expression.
1716 (cp_parser_skip_to_closing_square_bracket): Revert to pre-r274121 state.
1717 (cp_parser_skip_to_closing_square_bracket_1): Remove.
1718
1719 2019-08-14 Jonathan Wakely <jwakely@redhat.com>
1720
1721 * name-lookup.c (get_std_name_hint): Add more entries.
1722
1723 2019-08-14 Paolo Carlini <paolo.carlini@oracle.com>
1724
1725 * decl2.c (grok_array_decl): Use the location of the open square
1726 bracket in error message about invalid types.
1727
1728 2019-08-14 Paolo Carlini <paolo.carlini@oracle.com>
1729
1730 * decl.c (grokdeclarator): Check here for typedef a function
1731 definition or a member function definition.
1732 (start_function): Adjust.
1733 (grokmethod): Likewise.
1734
1735 2019-08-13 Richard Sandiford <richard.sandiford@arm.com>
1736
1737 PR middle-end/91421
1738 * decl.c (duplicate_decls): Use copy_decl_built_in_function.
1739 * pt.c (declare_integer_pack): Use set_decl_built_in_function.
1740
1741 2019-08-13 Marek Polacek <polacek@redhat.com>
1742
1743 PR c++/90473 - wrong code with nullptr in default argument.
1744 * call.c (null_ptr_cst_p): Update quote from the standard.
1745 * decl.c (check_default_argument): Don't return nullptr when the arg
1746 has side-effects.
1747
1748 2019-08-13 Marek Polacek <polacek@redhat.com>
1749
1750 * cp-tree.h (DECL_MUTABLE_P): Use FIELD_DECL_CHECK.
1751
1752 2019-08-10 Jakub Jelinek <jakub@redhat.com>
1753
1754 * parser.c (cp_parser_omp_clause_name): Parse device_type.
1755 (cp_parser_omp_clause_device_type): New function.
1756 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_DEVICE_TYPE.
1757 (OMP_DECLARE_TARGET_CLAUSE_MASK): Add PRAGMA_OMP_CLAUSE_DEVICE_TYPE.
1758 (cp_parser_omp_declare_target): Handle device_type clauses. Remove
1759 diagnostics for declare target with clauses nested in clause-less
1760 declare target declaration-definition-seq.
1761 * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_DEVICE_TYPE.
1762
1763 2019-08-09 Jakub Jelinek <jakub@redhat.com>
1764
1765 * parser.c (check_no_duplicate_clause): Simplify using
1766 omp_find_clause.
1767 (cp_parser_omp_clause_if): Fix up printing of target {enter,exit} data
1768 directive name modifiers.
1769
1770 PR c/91401
1771 * parser.c (cp_parser_omp_clause_dist_schedule): Comment out the
1772 check_no_duplicate_clause call, instead emit a warning for duplicate
1773 dist_schedule clauses.
1774
1775 2019-08-08 Paolo Carlini <paolo.carlini@oracle.com>
1776
1777 * decl.c (grokdeclarator): Use id_loc and EXPR_LOCATION in
1778 a few error messages.
1779
1780 2019-08-08 Marek Polacek <polacek@redhat.com>
1781
1782 PR c++/87519 - bogus warning with -Wsign-conversion.
1783 * typeck.c (cp_build_binary_op): Use same_type_p instead of comparing
1784 the types directly.
1785
1786 * constexpr.c (inline_asm_in_constexpr_error): New.
1787 (cxx_eval_constant_expression) <case ASM_EXPR>: Call it.
1788 (potential_constant_expression_1) <case ASM_EXPR>: Likewise.
1789
1790 2019-08-08 Jakub Jelinek <jakub@redhat.com>
1791
1792 * semantics.c (finish_omp_clauses): For C_ORT_OMP
1793 OMP_CLAUSE_USE_DEVICE_* clauses use oacc_reduction_head bitmap
1794 instead of generic_head to track duplicates.
1795
1796 2019-08-07 Marek Polacek <polacek@redhat.com>
1797
1798 PR c++/81429 - wrong parsing of constructor with C++11 attribute.
1799 * parser.c (cp_parser_constructor_declarator_p): Handle the scenario
1800 when a parameter declaration begins with [[attribute]].
1801
1802 2019-08-07 Marek Polacek <polacek@redhat.com>
1803
1804 PR c++/91346 - Implement P1668R1, allow unevaluated asm in constexpr.
1805 * constexpr.c (cxx_eval_constant_expression): Handle ASM_EXPR.
1806 (potential_constant_expression_1) <case ASM_EXPR>: Allow.
1807 * cp-tree.h (finish_asm_stmt): Adjust.
1808 * parser.c (cp_parser_asm_definition): Grab the locaion of "asm" and
1809 use it. Change an error to a pedwarn. Allow asm in C++2a, warn
1810 otherwise.
1811 * pt.c (tsubst_expr): Pass a location down to finish_asm_stmt.
1812 * semantics.c (finish_asm_stmt): New location_t parameter. Use it.
1813
1814 2019-08-07 Jakub Jelinek <jakub@redhat.com>
1815
1816 * parser.c (cp_parser_omp_clause_name): Parse use_device_addr clause.
1817 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_USE_DEVICE_ADDR.
1818 (OMP_TARGET_DATA_CLAUSE_MASK): Add PRAGMA_OMP_CLAUSE_USE_DEVICE_ADDR.
1819 (cp_parser_omp_target_data): Handle PRAGMA_OMP_CLAUSE_USE_DEVICE_ADDR
1820 like PRAGMA_OMP_CLAUSE_USE_DEVICE_PTR, adjust diagnostics about no
1821 map or use_device_* clauses.
1822 * semantics.c (finish_omp_clauses): For OMP_CLAUSE_USE_DEVICE_PTR
1823 in OpenMP, require pointer or reference to pointer type rather than
1824 pointer or array or reference to pointer or array type. Handle
1825 OMP_CLAUSE_USE_DEVICE_ADDR.
1826 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_USE_DEVICE_ADDR.
1827
1828 2019-08-06 Jason Merrill <jason@redhat.com>
1829
1830 PR c++/91378 - ICE with noexcept and auto return type.
1831 * pt.c (maybe_instantiate_noexcept): push_to_top_level.
1832
1833 2019-08-06 Paolo Carlini <paolo.carlini@oracle.com>
1834
1835 * decl.c (check_array_designated_initializer): Use
1836 cp_expr_loc_or_input_loc in one place.
1837
1838 2019-08-06 Jakub Jelinek <jakub@redhat.com>
1839
1840 * parser.c (cp_parser_omp_for_loop): For OMP_LOOP, ignore parallel
1841 clauses and predetermine iterator as lastprivate.
1842 * semantics.c (handle_omp_for_class_iterator): Use
1843 OMP_CLAUSE_LASTPRIVATE_LOOP_IV instead of
1844 OMP_CLAUSE_LASTPRIVATE_TASKLOOP_IV, set it for lastprivate also
1845 on OMP_LOOP construct. If a clause is missing for class iterator
1846 on OMP_LOOP, add firstprivate clause, and if there is private
1847 clause, turn it into firstprivate too.
1848 (finish_omp_for): Formatting fix. For OMP_LOOP, adjust
1849 OMP_CLAUSE_LASTPRIVATE_LOOP_IV clause CP_CLAUSE_INFO, so that it
1850 uses copy ctor instead of default ctor.
1851 * cp-gimplify.c (cp_gimplify_expr): Handle OMP_LOOP like
1852 OMP_DISTRIBUTE etc.
1853 (cp_fold_r): Likewise.
1854 (cp_genericize_r): Likewise.
1855 (cxx_omp_finish_clause): Also finish lastprivate clause with
1856 OMP_CLAUSE_LASTPRIVATE_LOOP_IV flag.
1857 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_BIND.
1858 (tsubst_omp_for_iterator): For OMP_LOOP, ignore parallel
1859 clauses and predetermine iterator as lastprivate.
1860 * constexpr.c (potential_constant_expression_1): Handle OMP_LOOP
1861 like OMP_DISTRIBUTE etc.
1862
1863 2019-08-05 Marek Polacek <polacek@redhat.com>
1864
1865 DR 2413 - typename in conversion-function-ids.
1866 * parser.c (cp_parser_conversion_type_id): Call
1867 cp_parser_type_specifier_seq with CP_PARSER_FLAGS_TYPENAME_OPTIONAL
1868 instead of CP_PARSER_FLAGS_NONE.
1869
1870 2019-08-05 Paolo Carlini <paolo.carlini@oracle.com>
1871
1872 * cp-tree.h (cp_expr_loc_or_input_loc): New.
1873 (cxx_incomplete_type_diagnostic): Use it.
1874 * call.c (build_converted_constant_expr_internal, convert_like_real,
1875 convert_arg_to_ellipsis, convert_for_arg_passing, build_over_call,
1876 build_cxx_call, perform_implicit_conversion_flags,
1877 initialize_reference): Likewise.
1878 * constexpr.c (cxx_eval_internal_function, cxx_eval_call_expression,
1879 eval_and_check_array_index, cxx_eval_store_expression,
1880 cxx_eval_statement_list, cxx_eval_loop_expr,
1881 cxx_eval_constant_expression, potential_constant_expression_1):
1882 Likewise.
1883 * constraint.cc (check_for_logical_overloads,
1884 satisfy_predicate_constraint): Likewise.
1885 * cp-gimplify.c (cp_gimplify_expr): Likewise.
1886 * cvt.c (cp_convert_to_pointer, convert_to_reference,
1887 cp_convert_and_check, ocp_convert, maybe_warn_nodiscard): Likewise.
1888 * decl.c (pop_switch): Likewise.
1889 * decl2.c (delete_sanity): Likewise.
1890 * error.c (location_of): Likewise.
1891 * init.c (maybe_warn_list_ctor, build_aggr_init,
1892 warn_placement_new_too_small, build_new_1, build_vec_init): Likewise.
1893 * lex.c (unqualified_name_lookup_error): Likewise.
1894 * parser.c (cp_parser_initializer_list, cp_parser_omp_for_cond):
1895 Likewise.
1896 * pt.c (check_for_bare_parameter_packs, check_valid_ptrmem_cst_expr,
1897 unify_arg_conversion, convert_nontype_argument,
1898 tsubst_copy_and_build, resolve_typename_type): Likewise.
1899 * semantics.c (maybe_convert_cond, finish_call_expr,
1900 cp_build_vec_convert): Likewise.
1901 * typeck.c (decay_conversion, rationalize_conditional_expr,
1902 cp_build_unary_op, build_x_compound_expr_from_list,
1903 maybe_warn_about_returning_address_of_local,
1904 maybe_warn_pessimizing_move): Likewise.
1905 * typeck2.c (check_narrowing, digest_init_r,
1906 process_init_constructor_array): Likewise.
1907
1908 2019-08-05 Tom Honermann <tom@honermann.net>
1909
1910 * parser.c (cp_parser_template_declaration_after_parameters): Enable
1911 class template argument deduction for non-type template parameters
1912 in literal operator templates.
1913
1914 2019-08-05 Marek Polacek <polacek@redhat.com>
1915
1916 PR c++/91338 - Implement P1161R3: Deprecate a[b,c].
1917 * parser.c (cp_parser_postfix_open_square_expression): Warn about uses
1918 of a comma operator within a subscripting expression.
1919 (cp_parser_skip_to_closing_square_bracket_1): New function, made out
1920 of...
1921 (cp_parser_skip_to_closing_square_bracket): ...this.
1922
1923 2019-08-05 Jason Merrill <jason@redhat.com>
1924
1925 * semantics.c (force_paren_expr): Preserve location.
1926
1927 2019-08-02 Marek Polacek <polacek@redhat.com>
1928
1929 PR c++/91230 - wrong error with __PRETTY_FUNCTION__ and generic lambda.
1930 * pt.c (value_dependent_expression_p): Consider __PRETTY_FUNCTION__
1931 inside a template function value-dependent.
1932
1933 2019-08-02 Paolo Carlini <paolo.carlini@oracle.com>
1934
1935 * tree.c (handle_nodiscard_attribute): Do not warn about nodiscard
1936 applied to a constructor.
1937
1938 2019-08-02 Martin Liska <mliska@suse.cz>
1939
1940 * decl.c (grok_op_properties):
1941 Mark DECL_SET_IS_OPERATOR_DELETE for user-provided delete operators.
1942
1943 2019-08-01 Martin Sebor <msebor@redhat.com>
1944
1945 PR c++/90947
1946 * decl.c (reshape_init_array_1): Avoid truncating initializer
1947 lists containing string literals.
1948
1949 2019-08-01 Marek Polacek <polacek@redhat.com>
1950
1951 PR c++/90805 - detect narrowing in case values.
1952 * decl.c (case_conversion): Detect narrowing in case values.
1953
1954 2019-07-31 Paolo Carlini <paolo.carlini@oracle.com>
1955
1956 * decl2.c (delete_sanity): Improve diagnostic locations, use
1957 cp_expr_loc_or_loc in four places.
1958
1959 2019-07-31 Jason Merrill <jason@redhat.com>
1960
1961 PR c++/90538 - multiple expansions of capture packs
1962 * cp-tree.h (DECLTYPE_FOR_INIT_CAPTURE): Remove.
1963 * lambda.c (add_capture): Copy parameter packs from init.
1964 (lambda_capture_field_type): Always use auto for init-capture.
1965 * pt.c (uses_parameter_packs): Return tree.
1966 (tsubst) [DECLTYPE_TYPE]: Remove init-capture handling.
1967 (gen_elem_of_pack_expansion_instantiation): Don't push
1968 local_specialization_stack.
1969 (prepend_one_capture): New.
1970 (tsubst_lambda_expr): Use it. Don't touch local_specializations.
1971 (do_auto_deduction): Avoid redundant error.
1972
1973 Fix copy_node of TEMPLATE_INFO.
1974 * cp-tree.h (struct tree_template_info): Use tree_base instead of
1975 tree_common. Add tmpl and args fields.
1976 (TI_TEMPLATE, TI_ARGS): Adjust.
1977
1978 2019-07-30 Martin Liska <mliska@suse.cz>
1979
1980 PR tree-optimization/91270
1981 * tree-ssa-dce.c (propagate_necessity): Mark 2nd argument
1982 of delete operator as needed.
1983
1984 2019-07-25 Martin Liska <mliska@suse.cz>
1985 Dominik Infuhr <dominik.infuehr@theobroma-systems.com>
1986
1987 PR c++/23383
1988 * decl.c (cxx_init_decl_processing): Mark delete operators
1989 with DECL_SET_IS_OPERATOR_DELETE.
1990
1991 2019-07-25 Martin Liska <mliska@suse.cz>
1992
1993 * decl.c (duplicate_decls): Use new macros
1994 (e.g. DECL_SET_LAMBDA_FUNCTION and DECL_LAMBDA_FUNCTION_P).
1995 (cxx_init_decl_processing): Likewise.
1996 (grok_op_properties): Likewise.
1997 * parser.c (cp_parser_lambda_declarator_opt): Likewise.
1998
1999 2019-07-24 Martin Sebor <msebor@redhat.com>
2000
2001 PR driver/80545
2002 * decl.c (finish_function): Use lang_mask.
2003
2004 2019-07-20 Jason Merrill <jason@redhat.com>
2005
2006 * cp-tree.h (ovl_iterator::using_p): A USING_DECL by itself was also
2007 introduced by a using-declaration.
2008
2009 2019-07-20 Jason Merrill <jason@redhat.com>
2010
2011 Reduce memory consumption for push/pop_access_scope.
2012 * name-lookup.c (leave_scope): Do add class levels other than
2013 previous_class_level to free_binding_level.
2014 (invalidate_class_lookup_cache): Move from class.c, add to
2015 free_binding_level.
2016 * pt.c (saved_access_scope): Change from list to vec.
2017
2018 2019-07-20 Jakub Jelinek <jakub@redhat.com>
2019
2020 * cp-tree.h (OMP_FOR_GIMPLIFYING_P): Use OMP_LOOPING_CHECK
2021 instead of OMP_LOOP_CHECK.
2022 * parser.c (cp_parser_omp_clause_name): Handle bind clause.
2023 (cp_parser_omp_clause_bind): New function.
2024 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_BIND.
2025 (OMP_LOOP_CLAUSE_MASK): Define.
2026 (cp_parser_omp_loop): New function.
2027 (cp_parser_omp_parallel, cp_parser_omp_teams): Handle parsing of
2028 loop combined with parallel or teams.
2029 (cp_parser_omp_construct): Handle PRAGMA_OMP_LOOP.
2030 (cp_parser_pragma): Likewise.
2031 * pt.c (tsubst_expr): Handle OMP_LOOP.
2032 * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_BIND.
2033
2034 2019-07-19 Jason Merrill <jason@redhat.com>
2035
2036 PR c++/90101 - dependent class non-type parameter.
2037 * pt.c (invalid_nontype_parm_type_p): Check for dependent class type.
2038
2039 2019-07-18 Jason Merrill <jason@redhat.com>
2040
2041 PR c++/90098 - partial specialization and class non-type parms.
2042 PR c++/90099
2043 PR c++/90101
2044 * call.c (build_converted_constant_expr_internal): Don't copy.
2045 * pt.c (process_partial_specialization): Allow VIEW_CONVERT_EXPR
2046 around class non-type parameter.
2047 (unify) [TEMPLATE_PARM_INDEX]: Ignore cv-quals.
2048
2049 2019-07-16 Jason Merrill <jason@redhat.com>
2050
2051 * parser.c (make_location): Add overload taking cp_lexer* as last
2052 parameter.
2053
2054 * parser.c (cp_parser_simple_type_specifier): Separate tentative
2055 parses for optional type-spec and CTAD.
2056
2057 * parser.c (cp_parser_nested_name_specifier_opt): If the token is
2058 already CPP_NESTED_NAME_SPECIFIER, leave it alone.
2059
2060 2019-07-12 Jakub Jelinek <jakub@redhat.com>
2061
2062 * parser.c (cp_parser_omp_clause_name): Handle order clause.
2063 (cp_parser_omp_clause_order): New function.
2064 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_ORDER.
2065 (OMP_SIMD_CLAUSE_MASK, OMP_FOR_CLAUSE_MASK): Add
2066 PRAGMA_OMP_CLAUSE_ORDER.
2067 * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_ORDER.
2068 * pt.c (tsubst_omp_clauses): Likewise.
2069
2070 2019-07-10 Paolo Carlini <paolo.carlini@oracle.com>
2071
2072 * decl.c (get_type_quals,
2073 smallest_type_location (const cp_decl_specifier_seq*)): New.
2074 (check_tag_decl): Use smallest_type_location in error_at about
2075 multiple types in one declaration.
2076 (grokdeclarator): Use locations[ds_complex] in error_at about
2077 complex invalid; use locations[ds_storage_class] in error_at
2078 about static cdtor; use id_loc in error_at about flexible
2079 array member in union; use get_type_quals.
2080
2081 2019-07-09 Martin Sebor <msebor@redhat.com>
2082
2083 PR c++/61339
2084 * cp-tree.h: Change class-key of PODs to struct and others to class.
2085 * search.c: Same.
2086 * semantics.c (finalize_nrv_r): Same.
2087
2088 2019-07-09 Martin Sebor <msebor@redhat.com>
2089
2090 PR c++/61339
2091 * constexpr.c (cxx_eval_call_expression): Change class-key from class
2092 to struct and vice versa to match convention and avoid -Wclass-is-pod
2093 and -Wstruct-no-pod.
2094 * constraint.cc (get_concept_definition): Same.
2095 * cp-tree.h: Same.
2096 * cxx-pretty-print.h: Same.
2097 * error.c: Same.
2098 * logic.cc (term_list::replace): Same.
2099 * name-lookup.c (find_local_binding): Same.
2100 * pt.c (tsubst_binary_right_fold): Same.
2101 * search.c (field_accessor_p): Same.
2102 * semantics.c (expand_or_defer_fn): Same.
2103
2104 2019-07-08 Jakub Jelinek <jakub@redhat.com>
2105
2106 PR c++/91110
2107 * decl2.c (cp_omp_mappable_type_1): Don't emit any note for
2108 error_mark_node type.
2109
2110 2019-07-05 Jakub Jelinek <jakub@redhat.com>
2111
2112 PR c++/67184
2113 PR c++/69445
2114 * call.c (build_new_method_call_1): Remove set but not used variable
2115 binfo.
2116
2117 2019-07-05 Paolo Carlini <paolo.carlini@oracle.com>
2118
2119 PR c++/67184 (again)
2120 PR c++/69445
2121 * call.c (build_over_call): Devirtualize user-defined operators
2122 coming from a base too.
2123 (build_new_method_call_1): Do not devirtualize here.
2124
2125 2019-07-04 Marek Polacek <polacek@redhat.com>
2126
2127 DR 1813
2128 PR c++/83374 - __is_standard_layout wrong for a class with repeated
2129 bases.
2130 * class.c (check_bases): Set CLASSTYPE_NON_STD_LAYOUT for a class if
2131 CLASSTYPE_REPEATED_BASE_P is true.
2132
2133 2019-07-04 Andrew Stubbs <ams@codesourcery.com>
2134
2135 * cp-tree.h (cp_omp_emit_unmappable_type_notes): New prototype.
2136 * decl.c (cp_finish_decl): Call cp_omp_emit_unmappable_type_notes.
2137 * decl2.c (cp_omp_mappable_type): Move contents to ...
2138 (cp_omp_mappable_type_1): ... here and add note output.
2139 (cp_omp_emit_unmappable_type_notes): New function.
2140 * semantics.c (finish_omp_clauses): Call
2141 cp_omp_emit_unmappable_type_notes in four places.
2142
2143 2019-07-03 Martin Liska <mliska@suse.cz>
2144
2145 * call.c (build_new_op_1): Remove dead assignemts.
2146 * typeck.c (cp_build_binary_op): Likewise.
2147
2148 2019-06-27 Jason Merrill <jason@redhat.com>
2149
2150 PR c++/55442 - memory-hog with highly recursive constexpr.
2151 * constexpr.c (push_cx_call_context): Return depth.
2152 (cxx_eval_call_expression): Don't cache past constexpr_cache_depth.
2153
2154 2019-06-27 Jan Hubicka <jh@suse.cz>
2155
2156 * class.c (layout_class_type): Set TYPE_CXX_ODR_P for as-base
2157 type copy.
2158
2159 2019-06-27 Martin Liska <mliska@suse.cz>
2160
2161 * class.c (adjust_clone_args): Remove obviously
2162 dead assignments.
2163 (dump_class_hierarchy_r): Likewise.
2164 * decl.c (check_initializer): Likewise.
2165 * parser.c (cp_parser_lambda_expression): Likewise.
2166 * pt.c (unify_bound_ttp_args): Likewise.
2167 (convert_template_argument): Likewise.
2168 * rtti.c (build_headof): Likewise.
2169 * typeck.c (convert_for_initialization): Likewise.
2170
2171 2019-06-25 Jason Merrill <jason@redhat.com>
2172
2173 PR c++/70462 - unnecessary base ctor variant with final.
2174 * optimize.c (populate_clone_array): Skip base variant if
2175 CLASSTYPE_FINAL.
2176 (maybe_clone_body): We don't need an alias if we are only defining
2177 one clone.
2178
2179 * class.c (resolves_to_fixed_type_p): Check CLASSTYPE_FINAL.
2180
2181 2019-06-25 Jakub Jelinek <jakub@redhat.com>
2182
2183 PR c++/90969
2184 * constexpr.c (cxx_eval_array_reference): Don't look through VCE from
2185 vector type if lval.
2186
2187 2019-06-25 Jozef Lawrynowicz <jozef.l@mittosystems.com>
2188
2189 * lex.c (init_reswords): Create keyword for "__intN__" type.
2190 * cp-tree.h (cp_decl_specifier_seq): New bitfield "int_n_alt".
2191 * decl.c (grokdeclarator): Don't pedwarn about "__intN" ISO
2192 C incompatibility if alternate "__intN__" form is used.
2193 * parser.c (cp_parser_simple_type_specifier): Set
2194 decl_specs->int_n_alt if "__intN__" form is used.
2195
2196 2019-06-24 Jan Hubicka <jh@suse.cz>
2197
2198 * lex.c (cxx_make_type): Set TYPE_CXX_ODR_P.
2199
2200 2019-06-24 Jason Merrill <jason@redhat.com>
2201
2202 * class.c (layout_class_type): Don't use a separate
2203 CLASSTYPE_AS_BASE if it's the same size.
2204
2205 2019-06-23 Marek Polacek <polacek@redhat.com>
2206
2207 * call.c (convert_default_arg): Use DEFERRED_PARSE instead of
2208 DEFAULT_ARG.
2209 * cp-objcp-common.c (cp_tree_size): Likewise. Use tree_deferred_parse
2210 instead of tree_default_arg.
2211 * cp-tree.def: Rename DEFAULT_ARG to DEFERRED_PARSE.
2212 * cp-tree.h: Rename DEFARG_TOKENS to DEFPARSE_TOKENS. Rename
2213 DEFARG_INSTANTIATIONS to DEFPARSE_INSTANTIATIONS. Rename
2214 tree_default_arg to tree_deferred_parse.
2215 (UNPARSED_NOEXCEPT_SPEC_P): Use DEFERRED_PARSE instead of DEFAULT_ARG.
2216 (cp_tree_node_structure_enum): Rename TS_CP_DEFAULT_ARG to
2217 TS_CP_DEFERRED_PARSE.
2218 (lang_tree_node): Rename tree_default_arg to tree_deferred_parse.
2219 Rename default_arg to deferred_parse. Use TS_CP_DEFERRED_PARSE instead
2220 of TS_CP_DEFAULT_ARG.
2221 (defarg_location): Remove declaration.
2222 (defparse_location): Add declaration.
2223 * decl.c (grokfndecl): Use DEFERRED_PARSE instead of DEFAULT_ARG.
2224 Call defparse_location instead of defarg_location.
2225 (check_default_argument): Use DEFERRED_PARSE instead of DEFAULT_ARG.
2226 (cp_tree_node_structure): Likewise. Use TS_CP_DEFERRED_PARSE instead
2227 of TS_CP_DEFAULT_ARG.
2228 * decl2.c (grokfield): Use DEFERRED_PARSE instead of DEFAULT_ARG.
2229 * error.c (dump_expr): Likewise.
2230 (location_of): Likewise.
2231 * init.c (get_nsdmi): Likewise.
2232 * parser.c (cp_parser_save_noexcept): Likewise. Use DEFPARSE_TOKENS
2233 instead of DEFARG_TOKENS.
2234 (cp_parser_late_noexcept_specifier): Likewise.
2235 (cp_parser_late_parse_one_default_arg): Use DEFPARSE_TOKENS instead
2236 of DEFARG_TOKENS.
2237 (cp_parser_late_parsing_default_args): Use DEFERRED_PARSE instead of
2238 DEFAULT_ARG. Use DEFPARSE_INSTANTIATIONS instead of
2239 DEFARG_INSTANTIATIONS.
2240 (cp_parser_cache_defarg): Use DEFERRED_PARSE instead of DEFAULT_ARG.
2241 Use DEFPARSE_TOKENS instead of DEFARG_TOKENS. Use
2242 DEFPARSE_INSTANTIATIONS instead of DEFARG_INSTANTIATIONS.
2243 (defparse_location): Renamed from defarg_location.
2244 * pt.c (tsubst_default_argument): Use DEFERRED_PARSE instead of
2245 DEFAULT_ARG.
2246 (tsubst_arg_types): Likewise.
2247 (dependent_type_p_r): Likewise.
2248 * tree.c (cp_tree_equal): Likewise.
2249 (cp_walk_subtrees): Likewise.
2250 * typeck.c (convert_arguments): Likewise.
2251
2252 2019-06-22 Marek Polacek <polacek@redhat.com>
2253
2254 PR c++/86476 - noexcept-specifier is a complete-class context.
2255 PR c++/52869
2256 * cp-tree.def (DEFAULT_ARG): Update commentary.
2257 * cp-tree.h (UNPARSED_NOEXCEPT_SPEC_P): New macro.
2258 (tree_default_arg): Use tree_base instead of tree_common.
2259 (do_push_parm_decls, maybe_check_overriding_exception_spec): Declare.
2260 * decl.c (do_push_parm_decls): New function, broken out of...
2261 (store_parm_decls): ...here. Call it.
2262 * except.c (nothrow_spec_p): Accept DEFAULT_ARG in the assert.
2263 * parser.c (cp_parser_noexcept_specification_opt,
2264 cp_parser_late_noexcept_specifier, noexcept_override_late_checks):
2265 Forward-declare.
2266 (unparsed_noexcepts): New macro.
2267 (push_unparsed_function_queues): Update initializer.
2268 (cp_parser_direct_declarator): Pass FRIEND_P to
2269 cp_parser_exception_specification_opt.
2270 (inject_parm_decls): New.
2271 (pop_injected_parms): New.
2272 (cp_parser_class_specifier_1): Implement delayed parsing of
2273 noexcept-specifiers.
2274 (cp_parser_save_noexcept): New.
2275 (cp_parser_late_noexcept_specifier): New.
2276 (noexcept_override_late_checks): New.
2277 (cp_parser_noexcept_specification_opt): Add FRIEND_P parameter. Call
2278 cp_parser_save_noexcept instead of the normal processing if needed.
2279 (cp_parser_exception_specification_opt): Add FRIEND_P parameter and
2280 pass it to cp_parser_noexcept_specification_opt.
2281 (cp_parser_save_member_function_body): Fix comment.
2282 (cp_parser_save_default_args): Maybe save the noexcept-specifier to
2283 post process.
2284 (cp_parser_transaction): Update call to
2285 cp_parser_noexcept_specification_opt.
2286 (cp_parser_transaction_expression): Likewise.
2287 * parser.h (cp_unparsed_functions_entry): Add new field to carry
2288 a noexcept-specifier.
2289 * pt.c (dependent_type_p_r): Handle unparsed noexcept expression.
2290 * search.c (maybe_check_overriding_exception_spec): New function, broken
2291 out of...
2292 (check_final_overrider): ...here. Call
2293 maybe_check_overriding_exception_spec.
2294 * tree.c (canonical_eh_spec): Handle UNPARSED_NOEXCEPT_SPEC_P.
2295 (cp_tree_equal): Handle DEFAULT_ARG.
2296
2297 PR c++/90881 - bogus -Wunused-value in unevaluated context.
2298 * cvt.c (convert_to_void): Don't emit unused warnings in
2299 an unevaluated context.
2300
2301 2019-06-22 Paolo Carlini <paolo.carlini@oracle.com>
2302
2303 * decl.c (grokdeclarator): Use id_loc, typespec_loc, and
2304 locations[ds_storage_class] in a few additional places.
2305
2306 2019-06-21 Paolo Carlini <paolo.carlini@oracle.com>
2307
2308 PR c++/90909
2309 Revert:
2310 2019-05-21 Paolo Carlini <paolo.carlini@oracle.com>
2311
2312 PR c++/67184
2313 PR c++/69445
2314 * call.c (build_over_call): Devirtualize when the final overrider
2315 comes from the base.
2316
2317 2019-06-21 Marek Polacek <polacek@redhat.com>
2318
2319 PR c++/61490 - qualified-id in friend function definition.
2320 * decl.c (grokdeclarator): Diagnose qualified-id in friend function
2321 definition. Improve location for diagnostics of friend functions.
2322
2323 PR c++/60223 - ICE with T{} in non-deduced context.
2324 * pt.c (unify): Allow COMPOUND_LITERAL_P in a non-deduced context.
2325
2326 PR c++/64235 - missing syntax error with invalid alignas.
2327 * parser.c (cp_parser_std_attribute_spec): Commit to tentative parse
2328 if there's a missing close paren.
2329
2330 PR c++/90490 - fix decltype issues in noexcept-specifier.
2331 * except.c (build_noexcept_spec): Call
2332 instantiate_non_dependent_expr_sfinae before
2333 build_converted_constant_expr instead of calling
2334 instantiate_non_dependent_expr after it. Add
2335 processing_template_decl_sentinel.
2336
2337 2019-06-21 Jakub Jelinek <jakub@redhat.com>
2338
2339 PR c++/90950
2340 * semantics.c (finish_omp_clauses): Don't reject references to
2341 incomplete types if processing_template_decl.
2342
2343 2019-06-19 Marek Polacek <polacek@redhat.com>
2344
2345 PR c++/60364 - noreturn after first decl not diagnosed.
2346 * decl.c (duplicate_decls): Give an error when a function is
2347 declared [[noreturn]] after its first declaration.
2348 * parser.c (cp_parser_std_attribute): Don't treat C++11 noreturn
2349 attribute as equivalent to GNU's.
2350 * tree.c (std_attribute_table): Add noreturn.
2351
2352 2019-06-19 Jakub Jelinek <jakub@redhat.com>
2353
2354 * cp-gimplify.c (cp_genericize_r): Handle OMP_CLAUSE_{IN,EX}CLUSIVE
2355 like OMP_CLAUSE_SHARED.
2356
2357 2019-06-18 Jason Merrill <jason@redhat.com>
2358
2359 * constexpr.c (cxx_eval_store_expression): Delay target evaluation.
2360
2361 2019-06-18 Jason Merrill <jason@redhat.com>
2362
2363 * constexpr.c (eval_and_check_array_index): Split out from...
2364 (cxx_eval_array_reference): ...here.
2365 (cxx_eval_store_expression): Use it here, too.
2366 (diag_array_subscript): Take location. Strip location wrapper.
2367
2368 2019-06-18 Jason Merrill <jason@redhat.com>
2369
2370 * constexpr.c (cxx_eval_constant_expression): Handle conversion from
2371 and then to the same type.
2372
2373 2019-06-18 Jason Merrill <jason@redhat.com>
2374
2375 * constexpr.c (unshare_constructor): Add MEM_STAT_DECL.
2376
2377 2019-06-17 Jakub Jelinek <jakub@redhat.com>
2378
2379 * semantics.c (finish_omp_clauses): For OMP_CLAUSE_REDUCTION_INSCAN
2380 set need_copy_assignment.
2381
2382 2019-06-17 Marek Polacek <polacek@redhat.com>
2383
2384 PR c++/83820 - excessive attribute arguments not detected.
2385 * parser.c (cp_parser_std_attribute): Detect excessive arguments.
2386
2387 2019-06-17 Nathan Sidwell <nathan@acm.org>
2388
2389 PR c++/90754
2390 * name-lookup.c (lookup_type_scope_1): Calll qualify_lookup before
2391 checking context.
2392
2393 2019-06-14 Marek Polacek <polacek@redhat.com>
2394
2395 PR c++/90884 - stray note with -Wctor-dtor-privacy.
2396 * class.c (maybe_warn_about_overly_private_class): Guard the call to
2397 inform.
2398
2399 2019-06-12 Jason Merrill <jason@redhat.com>
2400
2401 PR c++/85552 - wrong instantiation of dtor for DMI.
2402 * typeck2.c (digest_nsdmi_init): Set tf_no_cleanup for direct-init.
2403
2404 2019-06-13 Paolo Carlini <paolo.carlini@oracle.com>
2405
2406 * decl.c (grokdeclarator): Use id_loc in five additional places
2407 in the last part of the function.
2408
2409 2019-06-13 Paolo Carlini <paolo.carlini@oracle.com>
2410
2411 * decl.c (grokdeclarator): Move further up the declaration of
2412 id_loc, use it immediately, update its value after the loop
2413 over declarator, use it again in the final part of function;
2414 improve locations of error messages about multiple data types
2415 and conflicting specifiers.
2416
2417 2019-06-13 Richard Biener <rguenther@suse.de>
2418
2419 PR c++/90801
2420 * typeck2.c (split_nonconstant_init_1): Properly count
2421 num_split_elts, optimize single constructor elt removal.
2422
2423 2019-06-12 Marek Polacek <polacek@redhat.com>
2424
2425 PR c++/66999 - 'this' captured by reference.
2426 * parser.c (cp_parser_lambda_introducer): Reject `&this'. Use
2427 cp_lexer_nth_token_is instead of cp_lexer_peek_nth_token.
2428
2429 PR c++/90825 - endless recursion when evaluating sizeof.
2430 PR c++/90832 - endless recursion when evaluating sizeof.
2431 * constexpr.c (cxx_eval_constant_expression): Don't recurse on the
2432 result of fold_sizeof_expr if is returns a SIZEOF_EXPR.
2433 * typeck.c (cxx_sizeof_expr): Only return a SIZEOF_EXPR if the operand
2434 is instantiation-dependent.
2435
2436 PR c++/90736 - bogus error with alignof.
2437 * constexpr.c (adjust_temp_type): Use cv_unqualified type.
2438
2439 2019-06-11 Matthew Beliveau <mbelivea@redhat.com>
2440
2441 PR c++/90449 - add -Winaccessible-base option.
2442 * class.c (warn_about_ambiguous_bases): Changed name to:
2443 maybe_warn_about_inaccessible_bases.
2444 (maybe_warn_about_inaccessible_bases): Implemented new
2445 Winaccessible-base warning option for both direct and virtual
2446 base warnings.
2447 (layout_class_type): Call to warn_about_ambiguous_bases changed to fit
2448 new name.
2449
2450 2019-06-11 Richard Biener <rguenther@suse.de>
2451
2452 PR c++/90801
2453 * typeck2.c (split_nonconstant_init_1): Avoid ordered remove
2454 from CONSTRUCTOR by marking to remove elements and doing all
2455 of them in a O(n) scan.
2456
2457 2019-06-11 Jakub Jelinek <jakub@redhat.com>
2458
2459 PR c++/90810
2460 * init.c (constant_value_1): Handle VECTOR_CST DECL_INITIAL for
2461 !DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P decls like CONSTRUCTOR.
2462
2463 2019-06-11 Martin Liska <mliska@suse.cz>
2464
2465 PR c++/87847
2466 * pt.c (init_template_processing): Disable hash table
2467 sanitization for decl_specializations and type_specializations.
2468
2469 2019-06-10 Jason Merrill <jason@redhat.com>
2470
2471 * constexpr.c (free_constructor): New.
2472 (cxx_eval_call_expression): Free parameter value CONSTRUCTORs.
2473
2474 * constexpr.c (unshare_constructor): Only unshare if T is itself a
2475 CONSTRUCTOR.
2476 (cxx_eval_call_expression): Don't call it on the result here.
2477
2478 Reduce constexpr_call memory consumption.
2479 * constexpr.c (cxx_bind_parameters_in_call): Use TREE_VEC rather
2480 than TREE_LIST.
2481 (constexpr_call_hasher::equal, cxx_bind_parameters_in_call)
2482 (cxx_eval_call_expression): Adjust.
2483
2484 2019-06-10 Jakub Jelinek <jakub@redhat.com>
2485
2486 * parser.c (cp_parser_omp_clause_reduction): Don't sorry_at on inscan
2487 reductions.
2488 (cp_parser_omp_scan_loop_body): New function.
2489 (cp_parser_omp_for_loop): Call cp_parser_omp_scan_loop_body if there
2490 are inscan reduction clauses.
2491 (cp_parser_pragma): Reject PRAGMA_OMP_SCAN.
2492 * semantics.c (finish_omp_clauses): Reject mixing inscan with
2493 non-inscan reductions on the same construct, or inscan reductions with
2494 ordered or schedule clauses, or inscan array reductions.
2495 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_{IN,EX}CLUSIVE.
2496 (tsubst_expr): Handle OMP_SCAN.
2497
2498 2019-06-07 Jason Merrill <jason@redhat.com>
2499
2500 * constexpr.c (cxx_eval_constant_expression): Call
2501 STRIP_ANY_LOCATION_WRAPPER early.
2502 [CONVERT_EXPR]: Don't build anything for conversion to void.
2503 [ADDR_EXPR]: ggc_free unused ADDR_EXPR.
2504
2505 2019-06-05 Martin Sebor <msebor@redhat.com>
2506
2507 PR c/90737
2508 * typeck.c (maybe_warn_about_returning_address_of_local): Only
2509 consider functions returning pointers as candidates for
2510 -Wreturn-local-addr.
2511
2512 2019-06-05 Paolo Carlini <paolo.carlini@oracle.com>
2513
2514 * decl.c (smallest_type_location): New.
2515 (check_special_function_return_type): Use it.
2516 (grokdeclarator): Lkewise.
2517
2518 2019-06-05 Paolo Carlini <paolo.carlini@oracle.com>
2519
2520 * decl.c (grokdeclarator): Use locations[ds_friend]
2521 in one place.
2522
2523 2019-06-05 Martin Sebor <msebor@redhat.com>
2524
2525 * call.c (build_conditional_expr_1): Adjust quoting and hyphenation.
2526 (convert_like_real): Same.
2527 (convert_arg_to_ellipsis): Same.
2528 * constexpr.c (diag_array_subscript): Same.
2529 * constraint.cc (diagnose_trait_expression): Same.
2530 * cvt.c (ocp_convert): Same.
2531 * decl.c (start_decl): Same.
2532 (check_for_uninitialized_const_var): Same.
2533 (grokfndecl): Same.
2534 (check_special_function_return_type): Same.
2535 (finish_enum_value_list): Same.
2536 (start_preparsed_function): Same.
2537 * parser.c (cp_parser_decl_specifier_seq): Same.
2538 * typeck.c (cp_build_binary_op): Same.
2539 (build_static_cast_1): Same.
2540
2541 2019-06-04 Nina Dinka Ranns <dinka.ranns@gmail.com>
2542
2543 PR c++/63149 - Wrong auto deduction from braced-init-list.
2544 * pt.c (listify_autos): use non cv qualified auto_node in
2545 std::initializer_list<auto>.
2546
2547 2019-06-04 Paolo Carlini <paolo.carlini@oracle.com>
2548
2549 * decl.c (grokdeclarator): Use declarator->id_loc in two
2550 additional places.
2551
2552 2019-06-04 Nathan Sidwell <nathan@acm.org>
2553
2554 * name-lookup.c (lookup_type_scope_1): Reimplement, handle local
2555 and namespace scopes separately.
2556
2557 2019-06-04 Harald van Dijk <harald@gigawatt.nl>
2558
2559 PR c++/60531 - Wrong error about unresolved overloaded function
2560 * typeck.c (cp_build_binary_op): See if overload can be resolved.
2561 (cp_build_unary_op): Ditto.
2562
2563 2019-06-04 Jason Merrill <jason@redhat.com>
2564
2565 Reduce accumulated garbage in constexpr evaluation.
2566 * constexpr.c (cxx_eval_call_expression): ggc_free any bindings we
2567 don't save.
2568 (cxx_eval_increment_expression): ggc_free the MODIFY_EXPR after
2569 evaluating it.
2570
2571 2019-06-04 Jakub Jelinek <jakub@redhat.com>
2572
2573 * cp-tree.h (CP_OMP_CLAUSE_INFO): Allow for any clauses up to _condvar_
2574 instead of only up to linear.
2575
2576 2019-06-03 Paolo Carlini <paolo.carlini@oracle.com>
2577
2578 * parser.c (cp_parser_unqualified_id): Use build_min_nt_loc in
2579 five places.
2580
2581 2019-06-01 Ville Voutilainen <ville.voutilainen@gmail.com>
2582
2583 PR c++/85254
2584 * class.c (fixup_type_variants): Handle CLASSTYPE_FINAL.
2585
2586 2019-05-31 Nathan Sidwell <nathan@acm.org>
2587
2588 * cp-tree.h (IDENTIFIER_LAMBDA_P): New.
2589 (TYPE_ANON_P): New.
2590 (LAMBDA_TYPE_P, TYPE_UNNAMED_P): Likewise.
2591 (LAMBDANAME_PREFIX, LAMBDANAME_FORMAT): Delete.
2592 (make_lambda_name): Don't declare.
2593 * error.c (dump_aggr_type): Check for lambdas before other
2594 anonymous names.
2595 * lambda.c (begin_lambda_type): Use make_anon_name.
2596 * cp-lang.c (cxx_dwarf_name): Lambda names smell anonymous.
2597 * mangle.c (write_local_name): Likewise.
2598 * name-lookup.c (lambda_cnt, make_lambda_name): Delete.
2599
2600 2019-05-30 Marek Polacek <polacek@redhat.com>
2601
2602 * cp-tree.h (TYPE_HAS_NONTRIVIAL_DESTRUCTOR): Fix a typo.
2603
2604 2019-05-31 Paolo Carlini <paolo.carlini@oracle.com>
2605
2606 * decl.c (grokdeclarator): Use declarator->id_loc in five
2607 error_at calls.
2608
2609 2019-05-29 Jakub Jelinek <jakub@redhat.com>
2610
2611 PR c++/90598
2612 * tree.c (lvalue_kind): Return clk_none for expressions with
2613 with VOID_TYPE_P.
2614
2615 2019-05-29 Paolo Carlini <paolo.carlini@oracle.com>
2616
2617 PR c++/89875
2618 * parser.c (cp_parser_sizeof_operand): When the type-id production
2619 did not work out commit to the tentative parse.
2620
2621 2019-05-29 Jakub Jelinek <jakub@redhat.com>
2622
2623 P1091R3 - Extending structured bindings to be more like var decls
2624 P1381R1 - Reference capture of structured bindings
2625 * decl.c (cp_maybe_mangle_decomp): Handle TREE_STATIC decls even at
2626 function scope.
2627 (cp_finish_decomp): Copy over various decl properties from decl to
2628 v[i] in the tuple case.
2629 (grokdeclarator): Allow static, thread_local and __thread for C++2a
2630 and use pedwarn instead of error for older standard revisions.
2631 Make other structured binding diagnostic messages more i18n friendly.
2632
2633 2019-05-28 Nathan Sidwell <nathan@acm.org>
2634
2635 * decl.c (duplicate_decls): Assert a template newdecl has no
2636 specializations.
2637
2638 2019-05-28 Marek Polacek <polacek@redhat.com>
2639
2640 PR c++/90548 - ICE with generic lambda and empty pack.
2641 * pt.c (tsubst_copy_and_build): Handle pack expansion properly.
2642
2643 2019-05-28 Nathan Sidwell <nathan@acm.org>
2644
2645 * cp-tree.h (make_anon_name): Drop declaration.
2646 (TYPE_UNNAMED_P): Use IDENTIFIER_ANON_P.
2647 * cp-lang.c (cxx_dwarf_name): Likewise.
2648 * class.c (find_flexarrays): Likewise.
2649 * decl.c (name_unnamed_type, xref_tag_1): Likewise.
2650 * error.c (dump_aggr_type): Likewise.
2651 * pt.c (push_template_decl_real): Likewise.
2652 * name-lookup.c (consider_binding_level): Likewise.
2653 (anon_cnt, make_anon_name): Delete.
2654
2655 2019-05-25 Marek Polacek <polacek@redhat.com>
2656
2657 PR c++/90572 - wrong disambiguation in friend declaration.
2658 * parser.c (cp_parser_constructor_declarator_p): Don't allow missing
2659 typename for friend declarations.
2660
2661 2019-05-23 Jonathan Wakely <jwakely@redhat.com>
2662
2663 * cp-tree.h (CP_AGGREGATE_TYPE_P): Fix whitespace.
2664
2665 * init.c (std_placement_new_fn_p): Remove outdated TODO comment that
2666 was resolved by r254694.
2667
2668 2019-05-22 Jason Merrill <jason@redhat.com>
2669
2670 PR c++/20408 - unnecessary code for empty struct.
2671 * call.c (build_call_a): Use simple_empty_class_p.
2672
2673 PR c++/86485 - -Wmaybe-unused with empty class ?:
2674 * cp-gimplify.c (simple_empty_class_p): Also true for MODIFY_EXPR.
2675
2676 2019-05-21 Paolo Carlini <paolo.carlini@oracle.com>
2677
2678 * parser.c (cp_parser_template_declaration_after_parameters): Use
2679 DECL_SOURCE_LOCATION in literal operator template errors.
2680
2681 2019-05-21 Paolo Carlini <paolo.carlini@oracle.com>
2682
2683 PR c++/67184
2684 PR c++/69445
2685 * call.c (build_over_call): Devirtualize when the final overrider
2686 comes from the base.
2687
2688 2019-05-21 Nathan Sidwell <nathan@acm.org>
2689
2690 * name-lookup.c (do_nonmember_using_decl): Drop INSERT_P
2691 parameter. Document.
2692 (finish_nonmember_using_decl): Adjust do_nonmember_using_decl
2693 calls. Remove stray FIXME comment.
2694
2695 * name-lookup.h (struct cp_binding_level): Drop usings field.
2696 (finish_namespace_using_decl, finish_local_using_decl): Replace with ...
2697 (finish_nonmember_using_decl): ... this.
2698 * name-lookup.c (push_using_decl_1, push_using_decl):
2699 (do_nonmember_using_decl): ... here. Add INSERT_P arg. Reimplement.
2700 (validate_nonmember_using_decl, finish_namespace_using_decl)
2701 (finish_local_using_decl): Replace with ...
2702 (finish_nonmember_using_decl): ... this. Drop DECL parm.
2703 * parser.c (cp_parser_using_declaration): Don't do lookup here.
2704 * pt.c (tsubst_expr): Do not do using decl lookup here.
2705
2706 2019-05-21 Eric Botcazou <ebotcazou@adacore.com>
2707
2708 * decl2.c (cpp_check) <IS_ASSIGNMENT_OPERATOR>: New case.
2709
2710 2019-05-20 Marek Polacek <polacek@redhat.com>
2711
2712 CWG 2094 - volatile scalars are trivially copyable.
2713 PR c++/85679
2714 * tree.c (trivially_copyable_p): Don't check CP_TYPE_VOLATILE_P for
2715 scalar types.
2716
2717 2019-05-20 Marek Polacek <polacek@redhat.com>
2718
2719 * pt.c (convert_template_argument): Add a diagnostic for the
2720 [temp.arg]/2 ambiguity case.
2721
2722 * name-lookup.c (finish_using_directive): Don't issue inform() if the
2723 warning didn't trigger. Add quoting. Tweak the inform message.
2724
2725 2019-05-20 Paolo Carlini <paolo.carlini@oracle.com>
2726
2727 * cp-tree.h: Remove remnants of CONV_NONCONVERTING.
2728
2729 2019-05-20 Nathan Sidwell <nathan@acm.org>
2730
2731 * name-lookup.c (finish_namespace_using_directive)
2732 (finish_local_using_directive): Merge to ...
2733 (finish_using_directive): ... here. Handle both contexts.
2734 * name-lookup.h (finish_namespace_using_directive)
2735 (finish_local_using_directive): Replace with ...
2736 (finish_using_directive): ... this.
2737 * parser.c (cp_parser_using_directive): Adjust.
2738 * pt.c (tsubst_expr): Likewise.
2739
2740 * cp-tree.h (struct lang_decl_ns): Remove usings field.
2741 (DECL_NAMESPACE_USING): Delete.
2742 * name-lookup.c (name_lookup::search_usings): Use namespace's
2743 binding scope.
2744 (name_lookup::queue_namespae): Likewise.
2745 (finish_namespace_using_directive, push_namespace): Likewise.
2746 (has_using_namespace_std_directive): Just search the entire
2747 binding stack.
2748
2749 2019-05-20 Jonathan Wakely <jwakely@redhat.com>
2750
2751 PR c++/90532 Ensure __is_constructible(T[]) is false
2752 * method.c (is_xible_helper): Return error_mark_node for construction
2753 of an array of unknown bound.
2754
2755 2019-05-17 Thomas Schwinge <thomas@codesourcery.com>
2756
2757 PR c++/89433
2758 * parser.c (cp_finalize_oacc_routine): Rework checking if already
2759 marked with an OpenACC 'routine' directive.
2760
2761 PR c++/89433
2762 * parser.c (cp_parser_oacc_routine)
2763 (cp_parser_late_parsing_oacc_routine): Normalize order of clauses.
2764 (cp_finalize_oacc_routine): Call oacc_verify_routine_clauses.
2765
2766 PR c++/89433
2767 * parser.c (cp_finalize_oacc_routine): Refer to OpenACC 'routine'
2768 clauses from "omp declare target" attribute.
2769
2770 2019-05-16 Martin Sebor <msebor@redhat.com>
2771
2772 * call.c (print_z_candidate): Wrap diagnostic text in a gettext
2773 macro. Adjust.
2774 (print_z_candidates): Same.
2775 (build_conditional_expr_1): Quote keywords, operators, and types
2776 in diagnostics.
2777 (build_op_delete_call): Same.
2778 (maybe_print_user_conv_context): Wrap diagnostic text in a gettext
2779 macro.
2780 (convert_like_real): Same.
2781 (convert_arg_to_ellipsis): Quote keywords, operators, and types
2782 in diagnostics.
2783 (build_over_call): Same.
2784 (joust): Break up an overlong line. Wrap diagnostic text in a gettext
2785 macro.
2786 * constexpr.c (cxx_eval_check_shift_p): Spell out >= in English.
2787 (cxx_eval_constant_expression): Quote keywords, operators, and types
2788 in diagnostics.
2789 (potential_constant_expression_1): Same.
2790 * cp-gimplify.c (cp_genericize_r): Same.
2791 * cvt.c (maybe_warn_nodiscard): Quote keywords, operators, and types
2792 in diagnostics.
2793 (type_promotes_to): Same.
2794 * decl.c (check_previous_goto_1): Same.
2795 (check_goto): Same.
2796 (start_decl): Same.
2797 (cp_finish_decl): Avoid parenthesizing a sentence for consistency.
2798 (grok_op_properties): Quote keywords, operators, and types
2799 in diagnostics.
2800 * decl2.c (grokfield): Same.
2801 (coerce_delete_type): Same.
2802 * except.c (is_admissible_throw_operand_or_catch_parameter): Same.
2803 * friend.c (do_friend): Quote C++ tokens.
2804 * init.c (build_new_1): Quote keywords, operators, and types
2805 in diagnostics.
2806 (build_vec_delete_1): Same.
2807 (build_delete): Same.
2808 * lex.c (parse_strconst_pragma): Same.
2809 (handle_pragma_implementation): Same.
2810 (unqualified_fn_lookup_error): Same.
2811 * mangle.c (write_type): Same.
2812 * method.c (defaulted_late_check): Avoid two consecutive punctuators.
2813 * name-lookup.c (cp_binding_level_debug): Remove a trailing newline.
2814 (pop_everything): Same.
2815 * parser.c (cp_lexer_start_debugging): Quote a macro name.
2816 in a diagnostic
2817 (cp_lexer_stop_debugging): Same.
2818 (cp_parser_userdef_numeric_literal): Quote a C++ header name
2819 in a diagnostic.
2820 (cp_parser_nested_name_specifier_opt): Quote keywords, operators,
2821 and types in diagnostics.
2822 (cp_parser_question_colon_clause): Same.
2823 (cp_parser_asm_definition): Same.
2824 (cp_parser_init_declarator): Same.
2825 (cp_parser_template_declaration_after_parameters): Avoid capitalizing
2826 a sentence in a diagnostic.
2827 (cp_parser_omp_declare_reduction): Quote keywords, operators, and types
2828 in diagnostics.
2829 (cp_parser_transaction): Same.
2830 * pt.c (maybe_process_partial_specialization): Replace second call
2831 to permerror with inform for consistency with other uses.
2832 (expand_integer_pack): Quote keywords, operators, and types
2833 in diagnostics.
2834 * rtti.c (get_typeid): Quote keywords, operators, and types
2835 in diagnostics.
2836 (build_dynamic_cast_1): Same.
2837 * semantics.c (finish_asm_stmt): Same.
2838 (finish_label_decl): Same.
2839 (finish_bases): Same.
2840 (finish_offsetof): Same.
2841 (cp_check_omp_declare_reduction): Same.
2842 (finish_decltype_type): Same.
2843 * tree.c (handle_init_priority_attribute): Same. Add detail
2844 to diagnostics.
2845 (maybe_warn_zero_as_null_pointer_constant): Same.
2846 * typeck.c (cp_build_binary_op): Quote keywords, operators, and types
2847 in diagnostics.
2848 (cp_build_unary_op): Same.
2849 (check_for_casting_away_constness): Same.
2850 (build_static_cast): Same.
2851 (build_const_cast_1): Same.
2852 (maybe_warn_about_returning_address_of_local): Same.
2853 (check_return_expr): Same.
2854 * typeck2.c (abstract_virtuals_error_sfinae): Same.
2855 (digest_init_r): Replace a tab with spaces in a diagnostic.
2856 (build_functional_cast): Quote keywords, operators, and types
2857 in diagnostics.
2858
2859 2019-05-15 Jakub Jelinek <jakub@redhat.com>
2860
2861 PR debug/90197
2862 * cp-gimplify.c (genericize_cp_loop): Emit a DEBUG_BEGIN_STMT
2863 before the condition (or if missing or constant non-zero at the end
2864 of the loop. Emit a DEBUG_BEGIN_STMT before the increment expression
2865 if any. Don't call protected_set_expr_location on incr if it already
2866 has a location.
2867
2868 2019-05-15 Marek Polacek <polacek@redhat.com>
2869
2870 CWG 2096 - constraints on literal unions.
2871 * class.c (check_field_decls): Initialize booleans directly. A union
2872 is literal if at least one of its non-static data members is of
2873 non-volatile literal type.
2874
2875 2019-05-15 Paolo Carlini <paolo.carlini@oracle.com>
2876
2877 * cp-tree.h (REFERENCE_VLA_OK): Remove.
2878 * lambda.c (build_capture_proxy): Remove use of the above.
2879
2880 2019-05-15 Paolo Carlini <paolo.carlini@oracle.com>
2881
2882 * call.c (perform_overload_resolution, build_new_method_call_1):
2883 Use OVL_P; remove redundant TEMPLATE_DECL checks.
2884 * decl.c (grokfndecl): Likewise.
2885 * mangle.c (write_expression): Likewise.
2886 * parser.c (cp_parser_template_id): Likewise.
2887 * pt.c (resolve_overloaded_unification, type_dependent_expression_p):
2888 Likewise.
2889 * search.c (build_baselink): Likewise.
2890 * tree.c (is_overloaded_fn, dependent_name, maybe_get_fns): Likewise.
2891
2892 2019-05-14 Paolo Carlini <paolo.carlini@oracle.com>
2893
2894 PR preprocessor/90382
2895 * decl.c (grokdeclarator): Fix value assigned to typespec_loc, use
2896 min_location.
2897
2898 2019-05-13 Jason Merrill <jason@redhat.com>
2899
2900 Use releasing_vec more broadly.
2901 * cp-tree.h (struct releasing_vec): Replace get_ref method with
2902 operator&.
2903 (vec_safe_push, vec_safe_reserve, vec_safe_length, vec_safe_splice):
2904 Forwarding functions for releasing_vec.
2905 (release_tree_vector): Declare but don't define.
2906 * call.c (build_op_delete_call, build_temp, call_copy_ctor)
2907 (perform_direct_initialization_if_possible): Use releasing_vec.
2908 * constexpr.c (cxx_eval_vec_init_1, cxx_eval_store_expression):
2909 Likewise.
2910 * cp-gimplify.c (cp_fold): Likewise.
2911 * cvt.c (force_rvalue, ocp_convert): Likewise.
2912 * decl.c (get_tuple_decomp_init): Likewise.
2913 * except.c (build_throw): Likewise.
2914 * init.c (perform_member_init, expand_default_init): Likewise.
2915 * method.c (do_build_copy_assign, locate_fn_flags): Likewise.
2916 * parser.c (cp_parser_userdef_char_literal)
2917 (cp_parser_userdef_numeric_literal)
2918 (cp_parser_userdef_string_literal)
2919 (cp_parser_perform_range_for_lookup)
2920 (cp_parser_range_for_member_function, cp_parser_omp_for_loop)
2921 (cp_parser_omp_for_loop_init): Likewise.
2922 * pt.c (tsubst_copy_and_build, do_class_deduction): Likewise.
2923 * semantics.c (calculate_direct_bases, calculate_bases)
2924 (finish_omp_barrier, finish_omp_flush, finish_omp_taskwait)
2925 (finish_omp_taskyield, finish_omp_cancel)
2926 (finish_omp_cancellation_point): Likewise.
2927 * tree.c (build_vec_init_elt, strip_typedefs, strip_typedefs_expr)
2928 (build_min_non_dep_op_overload): Likewise.
2929 * typeck.c (build_function_call_vec, cp_build_function_call_nary)
2930 (cp_build_modify_expr): Likewise.
2931 * typeck2.c (build_functional_cast): Likewise.
2932
2933 2019-05-11 Paolo Carlini <paolo.carlini@oracle.com>
2934
2935 * typeck.c (cp_build_function_call_vec): When mark_used fails
2936 unconditionally return error_mark_node.
2937
2938 2019-05-10 Paolo Carlini <paolo.carlini@oracle.com>
2939
2940 * decl.c (grokvardecl): Use an accurate location in error message
2941 about main as a global variable.
2942
2943 2019-05-10 Paolo Carlini <paolo.carlini@oracle.com>
2944
2945 * call.c (build_call_a): Use FUNC_OR_METHOD_TYPE_P.
2946 * cp-gimplify.c (cp_fold): Likewise.
2947 * cp-objcp-common.c (cp_type_dwarf_attribute): Likewise.
2948 * cp-tree.h (TYPE_OBJ_P, TYPE_PTROBV_P): Likewise.
2949 * cvt.c (perform_qualification_conversions): Likewise.
2950 * decl.c (grokdeclarator): Likewise.
2951 * decl2.c (build_memfn_type): Likewise.
2952 * mangle.c (canonicalize_for_substitution, write_type): Likewise.
2953 * parser.c (cp_parser_omp_declare_reduction): Likewise.
2954 * pt.c (check_explicit_specialization, uses_deducible_template_parms,
2955 check_cv_quals_for_unify, dependent_type_p_r): Likewise.
2956 * rtti.c (ptr_initializer): Likewise.
2957 * semantics.c (finish_asm_stmt, finish_offsetof,
2958 cp_check_omp_declare_reduction): Likewise.
2959 * tree.c (cp_build_qualified_type_real,
2960 cp_build_type_attribute_variant, cxx_type_hash_eq,
2961 cxx_copy_lang_qualifiers, cp_free_lang_data): Likewise.
2962 * typeck.c (structural_comptypes, convert_arguments,
2963 cp_build_addr_expr_1, unary_complex_lvalue, cp_build_c_cast,
2964 cp_build_modify_expr, comp_ptr_ttypes_real, type_memfn_rqual):
2965 Likewise.
2966
2967 2019-05-10 Marek Polacek <polacek@redhat.com>
2968
2969 PR c++/78010 - bogus -Wsuggest-override warning on final function.
2970 * class.c (check_for_override): Don't warn for final functions.
2971
2972 2019-05-10 Jakub Jelinek <jakub@redhat.com>
2973
2974 PR pch/90326
2975 * config-lang.in (gtfiles): Remove c-family/c-lex.c, add
2976 c-family/c-cppbuiltin.c.
2977
2978 2019-05-09 Paolo Carlini <paolo.carlini@oracle.com>
2979
2980 PR c++/90382
2981 Revert:
2982 2018-04-26 Paolo Carlini <paolo.carlini@oracle.com>
2983
2984 * decl.c (grokdeclarator): Fix value assigned to typespec_loc, use
2985 min_location.
2986
2987 2019-05-08 Nathan Sidwell <nathan@acm.org>
2988
2989 Kill DECL_SAVED_FUNCTION_DATA .
2990 * cp-tree.h (language_function): Remove x_auto_return_pattern.
2991 (current_function_auto_return_pattern): Delete.
2992 (lang_decl_fn): Replace saved_language_function with
2993 saved_auto_return type.
2994 (DECL_SAVED_FUNCTION_DATA): Delete.
2995 (DECL_SAVED_AUTO_RETURN_TYPE): New.
2996 (FNDECL_USED_AUTO): Correct documentation.
2997 * decl.c (duplicate_decls): Adjust AUTO return handling.
2998 (start_preparsed_function): Replace
2999 current_function_auto_return_pattern with
3000 DECL_SAVED_AUTO_RETURN_TYPE. Remove DECL_SAVED_FUNCTION_DATA
3001 zapping.
3002 (finish_function): Likewise.
3003 (save_function_data): Delete.
3004 (fndecl_declared_return_type): Reimplement.
3005 * mangle.c (write_unqualified_name): Use DECL_SAVED_AUTO_RETURN_TYPE.
3006 * method.c (make_thunk, make_alias_for): Likewise.
3007 * parser.c (cp_parser_jump_statement): Likewise.
3008 * pt.c (do_auto_deduction): Likewise.
3009 * typeck.c (check_return_expr): Likewise.
3010
3011 2019-05-06 Jason Merrill <jason@redhat.com>
3012
3013 PR c++/90171 - reorganize usual_deallocation_fn_p
3014 * call.c (struct dealloc_info): New.
3015 (usual_deallocation_fn_p): Take a dealloc_info*.
3016 (aligned_deallocation_fn_p, sized_deallocation_fn_p): Remove.
3017 (build_op_delete_call): Adjust.
3018
3019 2019-05-07 Jason Merrill <jason@redhat.com>
3020
3021 PR c++/86485 - -Wmaybe-unused with empty class ?:
3022 * typeck.c (build_static_cast_1): Use cp_build_addr_expr.
3023
3024 * pt.c (type_dependent_expression_p): A non-type template parm with
3025 a placeholder type is type-dependent.
3026
3027 2019-05-06 Marek Polacek <polacek@redhat.com>
3028
3029 PR c++/90265 - ICE with generic lambda.
3030 * pt.c (tsubst_copy_and_build): Use a dedicated variable for the last
3031 element in the vector.
3032
3033 2019-05-03 Martin Liska <mliska@suse.cz>
3034
3035 * call.c (build_aggr_conv): Use is_empty instead of
3036 elements () == 0 (and similar usages).
3037 * parser.c (cp_parser_lambda_introducer): Likewise.
3038
3039 2019-05-02 Nathan Sidwell <nathan@acm.org>
3040
3041 * semantics.c (finish_id_expression_1): Remove unreachable code.
3042
3043 2019-05-01 Nathan Sidwell <nathan@acm.org>
3044
3045 * name-lookup.h (get_class_binding_direct): Change final arg to
3046 bool.
3047 (get_class_binding): Likewise.
3048 * name-lookup.c (get_class_binding_direct): Replace TYPE_OR_FNS
3049 arg with WANT_TYPE bool. Simplify.
3050 (get_class_binding): Adjust final arg.
3051 * decl.c (reshape_init_class): Adjust get_class_binding calls.
3052
3053 2019-04-30 Nathan Sidwell <nathan@acm.org>
3054
3055 * cp-objcp-common.c (cp_common_init_ts): Use MARK_TS_EXP for _EXPR
3056 nodes. Call c_common_init_ts.
3057
3058 2019-04-29 Nathan Sidwell <nathan@acm.org>
3059
3060 * decl.c (duplicate_decls): Add whitespace, move comments into
3061 conditional blocks.
3062 * method.c (explain_implicit_non_constexpr): Refactor.
3063 * pt.c (check_explicit_specialization): Fix indentation.
3064 * semantics.c (process_outer_var_ref): Reformat.
3065 (finish_id_expression_1): Use STRIP_TEMPLATE.
3066
3067 2019-04-26 Jonathan Wakely <jwakely@redhat.com>
3068
3069 PR c++/90243 - orphaned note in uninstantiated constexpr function
3070 * decl.c (check_for_uninitialized_const_var): Suppress notes if no
3071 error was shown.
3072
3073 2019-04-26 Paolo Carlini <paolo.carlini@oracle.com>
3074
3075 PR c++/90173
3076 * decl.c (grokdeclarator): Set type to error_mark_node
3077 upon error about template placeholder type non followed
3078 by a simple declarator-id.
3079
3080 2019-04-26 Paolo Carlini <paolo.carlini@oracle.com>
3081
3082 * decl.c (grokdeclarator): Fix value assigned to typespec_loc, use
3083 min_location.
3084
3085 2019-04-24 Jason Merrill <jason@redhat.com>
3086
3087 PR c++/90227 - error with template parameter packs.
3088 * pt.c (coerce_template_parms): Do add empty pack when
3089 require_all_args.
3090
3091 2019-04-24 Richard Biener <rguenther@suse.de>
3092
3093 * call.c (null_ptr_cst_p): Order checks according to expensiveness.
3094 (conversion_null_warnings): Likewise.
3095 * typeck.c (same_type_ignoring_top_level_qualifiers_p): Return
3096 early if type1 == type2.
3097
3098 2019-04-22 Jason Merrill <jason@redhat.com>
3099
3100 PR c++/87366 - wrong error with alias template.
3101 * typeck.c (structural_comptypes): When comparing_specializations,
3102 aliases are unequal.
3103 (comptypes): When comparing_specializations, do structural
3104 comparison.
3105
3106 2019-04-19 Jason Merrill <jason@redhat.com>
3107
3108 PR c++/90190 - CTAD with list-constructor.
3109 * pt.c (do_class_deduction): Don't try the single element deduction
3110 if the single element is also a braced list.
3111
3112 PR c++/90171 - ICE with destroying delete with size_t parm.
3113 * call.c (sized_deallocation_fn_p): New. Use it instead of
3114 second_parm_is_size_t in most cases.
3115 (second_parm_is_size_t): Don't check for aligned.
3116
3117 2019-04-19 Paolo Carlini <paolo.carlini@oracle.com>
3118
3119 PR c++/89900
3120 * pt.c (fn_type_unification): When handling null explicit
3121 arguments do not special case non-parameter packs.
3122
3123 2019-04-19 Jakub Jelinek <jakub@redhat.com>
3124
3125 PR c++/90138
3126 * pt.c (process_template_parm): Set decl to pushdecl result. If
3127 !is_non_type, also set parm to that.
3128
3129 PR c/89888
3130 * decl.c (struct cp_switch): Remove outside_range_p member.
3131 (push_switch): Don't clear it.
3132 (pop_switch): Adjust c_do_switch_warnings caller.
3133 (finish_case_label): Adjust c_add_case_label caller.
3134
3135 PR c++/90108
3136 * decl.c (duplicate_decls): If remove is main variant and
3137 DECL_ORIGINAL_TYPE is some other type, remove a DECL_ORIGINAL_TYPE
3138 variant that has newdecl as TYPE_NAME if any.
3139
3140 2019-04-18 Jason Merrill <jason@redhat.com>
3141
3142 PR c++/87554 - ICE with extern template and reference member.
3143 * decl.c (cp_finish_decl): Don't set DECL_INITIAL of external vars.
3144
3145 2019-04-17 Jason Merrill <jason@redhat.com>
3146
3147 PR c++/90047 - ICE with enable_if alias template.
3148 * pt.c (tsubst_decl) [TYPE_DECL]: Don't put an erroneous decl in the
3149 hash table when we're in SFINAE context.
3150
3151 2019-04-17 Marek Polacek <polacek@redhat.com>
3152
3153 PR c++/90124 - bogus error with incomplete type in decltype.
3154 * typeck.c (build_class_member_access_expr): Check
3155 cp_unevaluated_operand.
3156
3157 2019-04-12 Jakub Jelinek <jakub@redhat.com>
3158
3159 PR c/89933
3160 * decl.c (duplicate_decls): When newdecl's type is its main variant,
3161 don't try to remove it from the variant list, but instead assert
3162 it has no variants.
3163
3164 2019-04-12 Martin Sebor <msebor@redhat.com>
3165
3166 PR c/88383
3167 PR c/89288
3168 * parser.c (cp_parser_has_attribute_expression): Handle assignment
3169 expressions.
3170
3171 2019-04-12 Jason Merrill <jason@redhat.com>
3172
3173 * call.c (null_member_pointer_value_p): Handle an empty CONSTRUCTOR
3174 of PMF type.
3175
3176 2019-04-12 Marek Polacek <polacek@redhat.com>
3177
3178 * except.c (build_noexcept_spec): Use build_converted_constant_bool_expr
3179 instead of perform_implicit_conversion_flags.
3180
3181 PR c++/87603 - constexpr functions are no longer noexcept.
3182 * constexpr.c (is_sub_constant_expr): Remove unused function.
3183 * cp-tree.h (is_sub_constant_expr): Remove declaration.
3184 * except.c (check_noexcept_r): Don't consider a call to a constexpr
3185 function noexcept.
3186
3187 2019-04-11 Jakub Jelinek <jakub@redhat.com>
3188
3189 PR translation/90035
3190 * parser.h (struct cp_parser): Add
3191 type_definition_forbidden_message_arg member.
3192 * parser.c (cp_debug_parser): Print it.
3193 (cp_parser_check_type_definition): Pass
3194 parser->type_definition_forbidden_message_arg as second argument to
3195 error.
3196 (cp_parser_has_attribute_expression, cp_parser_sizeof_operand): Set
3197 parser->type_definition_forbidden_message_arg and use G_() with
3198 %qs for parser->type_definition_forbidden_message instead of
3199 building untranslatable message using concat.
3200
3201 2019-04-09 Jakub Jelinek <jakub@redhat.com>
3202
3203 PR translation/90011
3204 * typeck2.c (check_narrowing): Remove trailing space from diagnostics.
3205
3206 2019-04-08 Marek Polacek <polacek@redhat.com>
3207
3208 * typeck2.c (digest_init_r): Don't condition the object slicing warning
3209 on flag_checking.
3210
3211 2019-04-08 Paolo Carlini <paolo.carlini@oracle.com>
3212
3213 PR c++/89914
3214 * semantics.c (trait_expr_value): Don't use TYPE_NOTHROW_P
3215 when maybe_instantiate_noexcept fails.
3216 (classtype_has_nothrow_assign_or_copy_p): Likewise.
3217 * method.c (implicitly_declare_fn): Avoid passing error_mark_node
3218 to build_exception_variant.
3219
3220 2019-04-05 Marek Polacek <polacek@redhat.com>
3221
3222 PR c++/87145 - bogus error converting class type in template arg list.
3223 * pt.c (convert_nontype_argument): Don't call
3224 build_converted_constant_expr if it could involve calling a conversion
3225 function with a instantiation-dependent constructor as its argument.
3226
3227 2019-04-05 Martin Sebor <msebor@redhat.com>
3228
3229 PR bootstrap/89980
3230 * decl.c (reshape_init_array_1): Avoid treating empty strings
3231 as zeros in array initializers.
3232 Use trivial_type_p () instead of TYPE_HAS_TRIVIAL_DFLT().
3233
3234 2019-04-04 Jason Merrill <jason@redhat.com>
3235
3236 PR c++/89948 - ICE with break in statement-expr.
3237 * constexpr.c (cxx_eval_statement_list): Jumping out of a
3238 statement-expr is non-constant.
3239
3240 2019-04-04 Jason Merrill <jason@redhat.com>
3241
3242 PR c++/89966 - error with non-type auto tparm.
3243 * pt.c (do_auto_deduction): Clear tf_partial.
3244
3245 2019-04-04 Jason Merrill <jason@redhat.com>
3246
3247 PR c++/86986 - ICE with TTP with parameter pack.
3248 * pt.c (coerce_template_parameter_pack): Only look at the type of a
3249 non-type parameter pack.
3250 (fixed_parameter_pack_p_1): Don't recurse into the type of a
3251 non-type parameter pack.
3252 (coerce_template_template_parms): Call add_outermost_template_args.
3253
3254 2019-04-04 Martin Sebor <msebor@redhat.com>
3255
3256 PR c++/89974
3257 PR c++/89878
3258 PR c++/89833
3259 PR c++/47488
3260 * decl.c (reshape_init_array_1): Strip trailing zero-initializers
3261 from arrays of trivial type and known size.
3262 * mangle.c (write_expression): Convert braced initializer lists
3263 to STRING_CSTs.
3264 (write_expression): Trim trailing zero-initializers from arrays
3265 of trivial type.
3266 (write_template_arg_literal): Mangle strings the same as braced
3267 initializer lists.
3268
3269 2019-04-03 Jason Merrill <jason@redhat.com>
3270
3271 PR c++/81866 - ICE with member template and default targ.
3272 * pt.c (tsubst_template_decl): Handle getting a type from
3273 retrieve_specialization.
3274
3275 PR c++/86586 - -fcompare-debug=-Wsign-compare.
3276 * typeck.c (cp_build_binary_op): Don't fold for -Wsign-compare.
3277
3278 PR c++/89331 - ICE with offsetof in incomplete class.
3279 * semantics.c (finish_offsetof): Handle error_mark_node.
3280 * typeck.c (build_class_member_access_expr): Call
3281 complete_type_or_maybe_complain before converting to base.
3282
3283 PR c++/89917 - ICE with lambda in variadic mem-init.
3284 * pt.c (make_pack_expansion): Change type_pack_expansion_p to false.
3285
3286 2019-04-01 Jason Merrill <jason@redhat.com>
3287
3288 PR c++/86946 - ICE with function call in template argument.
3289 DR 1321
3290 * pt.c (iterative_hash_template_arg) [CALL_EXPR]: Use
3291 dependent_name.
3292
3293 2019-04-01 Paolo Carlini <paolo.carlini@oracle.com>
3294
3295 PR c++/62207
3296 * pt.c (tsubst_copy): Deal with lookup_name not returing a variable.
3297
3298 2019-03-31 Marek Polacek <polacek@redhat.com>
3299
3300 PR c++/89852 - ICE with C++11 functional cast with { }.
3301 * constexpr.c (fold_non_dependent_expr_template): New static function
3302 broken out of...
3303 (fold_non_dependent_expr): ...here.
3304 (fold_non_dependent_init): New function.
3305 * cp-tree.h (fold_non_dependent_init): Declare.
3306 * typeck2.c (massage_init_elt): Call fold_non_dependent_init instead
3307 of fold_non_dependent_expr. Don't call maybe_constant_init.
3308
3309 2019-03-30 Jason Merrill <jason@redhat.com>
3310
3311 PR c++/89744 - ICE with specialization of member class template.
3312 * pt.c (lookup_template_class_1): If the partial instantiation is
3313 explicitly specialized, adjust.
3314 (maybe_process_partial_specialization): Also adjust
3315 CLASSTYPE_TI_ARGS.
3316
3317 2019-03-29 Jakub Jelinek <jakub@redhat.com>
3318
3319 PR sanitizer/89869
3320 * typeck.c: Include gimplify.h.
3321 (cp_build_modify_expr) <case COND_EXPR>: Unshare rhs before using it
3322 for second time. Formatting fixes.
3323
3324 2019-03-29 Marek Polacek <polacek@redhat.com>
3325
3326 PR c++/89876 - ICE with deprecated conversion.
3327 * call.c (convert_like_real): Only give warnings with tf_warning.
3328
3329 2019-03-28 Marek Polacek <polacek@redhat.com>
3330
3331 PR c++/89612 - ICE with member friend template with noexcept.
3332 * pt.c (maybe_instantiate_noexcept): For function templates, use their
3333 template result (function decl). Don't set up local specializations.
3334 Temporarily turn on processing_template_decl. Update the template type
3335 too.
3336
3337 PR c++/89836 - bool constant expression and explicit conversions.
3338 * call.c (build_converted_constant_expr_internal): New function,
3339 renamed from...
3340 (build_converted_constant_expr): ...this. New.
3341 (build_converted_constant_bool_expr): New.
3342 * cp-tree.h (build_converted_constant_bool_expr): Declare.
3343 * decl.c (build_explicit_specifier): Call
3344 build_converted_constant_bool_expr.
3345
3346 2019-03-28 Jakub Jelinek <jakub@redhat.com>
3347
3348 PR c++/89785
3349 * constexpr.c (struct check_for_return_continue_data): New type.
3350 (check_for_return_continue): New function.
3351 (potential_constant_expression_1) <case SWITCH_STMT>: Walk
3352 SWITCH_STMT_BODY to find RETURN_EXPRs or CONTINUE_STMTs not nested
3353 in loop bodies and set *jump_target to that if found.
3354
3355 2019-03-27 Jason Merrill <jason@redhat.com>
3356
3357 PR c++/89831 - error with qualified-id in const member function.
3358 * semantics.c (finish_non_static_data_member): Use object cv-quals
3359 in scoped case, too.
3360
3361 PR c++/89421 - ICE with lambda in template parameter list.
3362 * parser.c (cp_parser_lambda_expression): Also reject a lambda in a
3363 template parameter list before C++20.
3364 * pt.c (type_dependent_expression_p): True for LAMBDA_EXPR.
3365 * semantics.c (begin_class_definition): Restore error about defining
3366 non-lambda class in template parm list.
3367
3368 2019-03-26 Jason Merrill <jason@redhat.com>
3369
3370 PR c++/86932 - missed SFINAE with empty pack.
3371 * pt.c (coerce_template_parms): Don't add an empty pack if
3372 tf_partial.
3373 (fn_type_unification): Pass tf_partial to coerce_template_parms.
3374
3375 PR c++/86429 - constexpr variable in lambda.
3376 PR c++/82643
3377 PR c++/87327
3378 * constexpr.c (cxx_eval_constant_expression): In a lambda function,
3379 try evaluating the captured variable directly.
3380
3381 2019-03-26 Jakub Jelinek <jakub@redhat.com>
3382
3383 PR c++/89796
3384 * semantics.c (finish_omp_atomic): Add warning_sentinel for
3385 -Wunused-value around finish_expr_stmt call.
3386
3387 2019-03-25 Paolo Carlini <paolo.carlini@oracle.com>
3388
3389 PR c++/84661
3390 PR c++/85013
3391 * parser.c (cp_parser_binary_expression): Don't call cp_fully_fold
3392 to undo the disabling of warnings.
3393
3394 2019-03-25 Jason Merrill <jason@redhat.com>
3395
3396 PR c++/87748 - substitution failure error with decltype.
3397 * pt.c (most_specialized_partial_spec): Clear
3398 processing_template_decl.
3399
3400 2019-03-25 Marek Polacek <polacek@redhat.com>
3401
3402 PR c++/89214 - ICE when initializing aggregates with bases.
3403 * typeck2.c (digest_init_r): Warn about object slicing instead of
3404 crashing.
3405
3406 PR c++/89705 - ICE with reference binding with conversion function.
3407 * call.c (reference_binding): If the result of the conversion function
3408 is a prvalue of non-class type, use the cv-unqualified type.
3409
3410 2019-03-25 Nathan Sidwell <nathan@acm.org>
3411
3412 * lambda.c (maybe_add_lambda_conv_op): Don't add to comdat group.
3413
3414 2019-03-22 Jakub Jelinek <jakub@redhat.com>
3415
3416 PR c++/60702
3417 * cp-tree.h (get_tls_wrapper_fn): Remove declaration.
3418 (maybe_get_tls_wrapper_call): Declare.
3419 * decl2.c (get_tls_wrapper_fn): Make static.
3420 (maybe_get_tls_wrapper_call): New function.
3421 * typeck.c (build_class_member_access_expr): Handle accesses to TLS
3422 variables.
3423 * semantics.c (finish_qualified_id_expr): Likewise.
3424 (finish_id_expression_1): Use maybe_get_tls_wrapper_call.
3425 * pt.c (tsubst_copy_and_build): Likewise.
3426
3427 PR c++/87481
3428 * constexpr.c (struct constexpr_ctx): Add constexpr_ops_count member.
3429 (cxx_eval_constant_expression): When not skipping, not constant class
3430 or location wrapper, increment *ctx->constexpr_ops_count and if it is
3431 above constexpr_loop_nest_limit, diagnose failure.
3432 (cxx_eval_outermost_constant_expr): Add constexpr_ops_count and
3433 initialize ctx.constexpr_ops_count to its address.
3434 (is_sub_constant_expr): Likewise.
3435
3436 2019-03-21 Jakub Jelinek <jakub@redhat.com>
3437
3438 PR c++/71446
3439 * call.c (filed_in_pset): Change pset from hash_set<tree> * to
3440 hash_set<tree, true> &, adjust uses accordingly.
3441 (build_aggr_conv): Change pset from hash_set<tree> *
3442 to hash_set<tree, true>. Replace goto fail; with return NULL;,
3443 adjust pset uses.
3444
3445 PR c++/89767
3446 * parser.c (cp_parser_lambda_introducer): Add ids and first_capture_id
3447 variables, check for duplicates in this function.
3448 * lambda.c (add_capture): Don't check for duplicates nor use
3449 IDENTIFIER_MARKED.
3450 (register_capture_members): Don't clear IDENTIFIER_MARKED here.
3451
3452 2019-03-21 Paolo Carlini <paolo.carlini@oracle.com>
3453
3454 PR c++/89571
3455 * method.c (after_nsdmi_defaulted_late_checks): Avoid passing
3456 error_mark_node to comp_except_specs.
3457
3458 2019-03-20 Jason Merrill <jason@redhat.com>
3459
3460 PR c++/87480 - decltype of member access in default template arg
3461 * pt.c (type_unification_real): Accept a dependent result in
3462 template context.
3463
3464 2019-03-19 Martin Sebor <msebor@redhat.com>
3465
3466 PR tree-optimization/89688
3467 * typeck2.c (store_init_value): Call braced_lists_to_string for more
3468 kinds of initializers.
3469
3470 2019-03-18 Jason Merrill <jason@redhat.com>
3471
3472 PR c++/89630 - ICE with dependent using-decl as template arg.
3473 * tree.c (cp_tree_equal): Always return false for USING_DECL.
3474
3475 PR c++/89761 - ICE with sizeof... in pack expansion.
3476 * pt.c (argument_pack_element_is_expansion_p): Handle
3477 ARGUMENT_PACK_SELECT.
3478
3479 PR c++/89640 - GNU attributes on lambda.
3480 * parser.c (cp_parser_lambda_declarator_opt): Allow GNU attributes.
3481
3482 PR c++/89682 - wrong access error in default argument.
3483 * pt.c (tsubst_default_argument): Don't defer access checks.
3484
3485 2019-03-18 Paolo Carlini <paolo.carlini@oracle.com>
3486
3487 PR c++/85014
3488 * semantics.c (finish_non_static_data_member): Check return value
3489 of context_for_name_lookup and immediately return error_mark_node
3490 if isn't a type.
3491
3492 2019-03-17 Jason Merrill <jason@redhat.com>
3493
3494 PR c++/89571 - ICE with ill-formed noexcept on constructor.
3495 * pt.c (maybe_instantiate_noexcept): Only return false if defaulted.
3496 (regenerate_decl_from_template): Use it for noexcept-specs.
3497
3498 2019-03-14 Jason Merrill <jason@redhat.com>
3499
3500 * parser.c (cp_parser_decl_specifier_seq): Support C++20
3501 concept-definition syntax without 'bool'.
3502
3503 2019-03-14 Jakub Jelinek <jakub@redhat.com>
3504
3505 PR c++/89512
3506 * semantics.c (finish_qualified_id_expr): Reject variable templates.
3507
3508 PR c++/89652
3509 * constexpr.c (struct constexpr_ctx): Change save_exprs type from
3510 hash_set<tree> to vec<tree>.
3511 (cxx_eval_call_expression): Adjust for save_exprs being a vec instead
3512 of hash_set.
3513 (cxx_eval_loop_expr): Likewise. Truncate the vector after each
3514 removal of SAVE_EXPRs from values.
3515 (cxx_eval_constant_expression) <case SAVE_EXPR>: Call safe_push
3516 method on save_exprs instead of add.
3517
3518 2019-03-13 Jason Merrill <jason@redhat.com>
3519
3520 PR c++/86521 - C++17 copy elision in initialization by constructor.
3521 * call.c (joust_maybe_elide_copy): New.
3522 (joust): Call it.
3523
3524 2019-03-13 Marek Polacek <polacek@redhat.com>
3525
3526 PR c++/88979 - further P0634 fix for constructors.
3527 * parser.c (cp_parser_decl_specifier_seq): Pass flags to
3528 cp_parser_constructor_declarator_p.
3529 (cp_parser_direct_declarator): Allow missing typename for constructor
3530 parameters.
3531 (cp_parser_constructor_declarator_p): Add FLAGS parameter. Pass it to
3532 cp_parser_type_specifier.
3533
3534 PR c++/89686 - mixing init-capture and simple-capture in lambda.
3535 * parser.c (cp_parser_lambda_introducer): Give error when combining
3536 init-capture and simple-capture.
3537
3538 PR c++/89660 - bogus error with -Wredundant-move.
3539 * typeck.c (maybe_warn_pessimizing_move): Only accept (T &) &arg
3540 as the std::move's argument. Don't call convert_for_initialization
3541 when warn_redundant_move isn't on.
3542
3543 2019-03-11 Jason Merrill <jason@redhat.com>
3544
3545 PR c++/86521 - wrong overload resolution with ref-qualifiers.
3546 * call.c (build_user_type_conversion_1): Don't use a conversion to a
3547 reference of the wrong rvalueness for direct binding.
3548
3549 2019-03-11 Martin Liska <mliska@suse.cz>
3550
3551 * cvt.c (build_expr_type_conversion): Wrap apostrophes
3552 in gcc internal format with %'.
3553 * decl.c (check_no_redeclaration_friend_default_args): Likewise.
3554 (grokfndecl): Likewise.
3555 * name-lookup.c (do_pushtag): Likewise.
3556 * pt.c (unify_parameter_deduction_failure): Likewise.
3557 (unify_template_deduction_failure): Likewise.
3558
3559 2019-03-11 Martin Liska <mliska@suse.cz>
3560
3561 * call.c (convert_arg_to_ellipsis): Wrap an option name
3562 in a string format message and fix GNU coding style.
3563 (build_over_call): Likewise.
3564 * class.c (check_field_decl): Likewise.
3565 (layout_nonempty_base_or_field): Likewise.
3566 * constexpr.c (cxx_eval_loop_expr): Likewise.
3567 * cvt.c (type_promotes_to): Likewise.
3568 * decl.c (cxx_init_decl_processing): Likewise.
3569 (mark_inline_variable): Likewise.
3570 (grokdeclarator): Likewise.
3571 * decl2.c (record_mangling): Likewise.
3572 * error.c (maybe_warn_cpp0x): Likewise.
3573 * except.c (doing_eh): Likewise.
3574 * mangle.c (maybe_check_abi_tags): Likewise.
3575 * parser.c (cp_parser_diagnose_invalid_type_name): Likewise.
3576 (cp_parser_userdef_numeric_literal): Likewise.
3577 (cp_parser_primary_expression): Likewise.
3578 (cp_parser_unqualified_id): Likewise.
3579 (cp_parser_pseudo_destructor_name): Likewise.
3580 (cp_parser_builtin_offsetof): Likewise.
3581 (cp_parser_lambda_expression): Likewise.
3582 (cp_parser_lambda_introducer): Likewise.
3583 (cp_parser_lambda_declarator_opt): Likewise.
3584 (cp_parser_selection_statement): Likewise.
3585 (cp_parser_init_statement): Likewise.
3586 (cp_parser_decomposition_declaration): Likewise.
3587 (cp_parser_function_specifier_opt): Likewise.
3588 (cp_parser_static_assert): Likewise.
3589 (cp_parser_simple_type_specifier): Likewise.
3590 (cp_parser_namespace_definition): Likewise.
3591 (cp_parser_using_declaration): Likewise.
3592 (cp_parser_ctor_initializer_opt_and_function_body): Likewise.
3593 (cp_parser_initializer_list): Likewise.
3594 (cp_parser_type_parameter_key): Likewise.
3595 (cp_parser_member_declaration): Likewise.
3596 (cp_parser_try_block): Likewise.
3597 (cp_parser_std_attribute_spec): Likewise.
3598 (cp_parser_requires_clause_opt): Likewise.
3599 * pt.c (check_template_variable): Likewise.
3600 (check_default_tmpl_args): Likewise.
3601 (push_tinst_level_loc): Likewise.
3602 (instantiate_pending_templates): Likewise.
3603 (invalid_nontype_parm_type_p): Likewise.
3604 * repo.c (get_base_filename): Likewise.
3605 * rtti.c (typeid_ok_p): Likewise.
3606 (build_dynamic_cast_1): Likewise.
3607 * tree.c (maybe_warn_parm_abi): Likewise.
3608
3609 2019-03-08 Jakub Jelinek <jakub@redhat.com>
3610
3611 PR other/80058
3612 * parser.c (cp_parser_template_declaration_after_parameters): Avoid
3613 one space before " at the end of line and another after " on another
3614 line in a string literal.
3615
3616 PR tree-optimization/89550
3617 * semantics.c (maybe_convert_cond): Only set TREE_NO_WARNING if
3618 warning_at returned true.
3619 * decl2.c (c_parse_final_cleanups): Likewise.
3620 * typeck.c (convert_for_assignment): Likewise.
3621 * decl.c (finish_function): Likewise.
3622
3623 PR c++/89585
3624 * parser.c (cp_parser_asm_definition): Just warn instead of error
3625 on volatile qualifier outside of function body.
3626
3627 PR c++/89599
3628 * constexpr.c (potential_constant_expression_1): Reject
3629 REINTERPRET_CAST_P NOP_EXPRs.
3630
3631 PR c++/89622
3632 * call.c (joust): Call print_z_candidate only if pedwarn returned
3633 true.
3634
3635 2019-03-07 Jason Merrill <jason@redhat.com>
3636
3637 PR c++/88123 - lambda and using-directive.
3638 * name-lookup.c (op_unqualified_lookup)
3639 (maybe_save_operator_binding, discard_operator_bindings)
3640 (push_operator_bindings): New.
3641 * typeck.c (build_x_binary_op, build_x_unary_op): Call
3642 maybe_save_operator_binding.
3643 * decl.c (start_preparsed_function): Call push_operator_bindings.
3644 * tree.c (cp_free_lang_data): Call discard_operator_bindings.
3645
3646 PR c++/88820 - ICE with CTAD and member template used in DMI.
3647 * pt.c (do_class_deduction): Handle parm used as its own arg.
3648
3649 2019-03-07 Jakub Jelinek <jakub@redhat.com>
3650
3651 PR c++/89585
3652 * parser.c (cp_parser_asm_definition): Parse asm qualifiers even
3653 at toplevel, but diagnose them.
3654
3655 2019-03-06 Jason Merrill <jason@redhat.com>
3656
3657 PR c++/89381 - implicit copy and using-declaration.
3658 * class.c (classtype_has_move_assign_or_move_ctor_p): Don't consider
3659 op= brought in by a using-declaration.
3660
3661 2019-03-06 Jakub Jelinek <jakub@redhat.com>
3662
3663 PR c++/87148
3664 * init.c (build_value_init_noctor): Ignore flexible array members.
3665
3666 2019-03-06 Jason Merrill <jason@redhat.com>
3667
3668 PR c++/89576 - if constexpr of lambda capture.
3669 * semantics.c (maybe_convert_cond): Do convert a non-dependent
3670 condition in a template.
3671 * typeck.c (condition_conversion): Handle being called in a
3672 template.
3673
3674 2019-03-06 Marek Polacek <polacek@redhat.com>
3675
3676 PR c++/87378 - bogus -Wredundant-move warning.
3677 * typeck.c (maybe_warn_pessimizing_move): See if the maybe-rvalue
3678 overload resolution would actually succeed.
3679
3680 2019-03-05 Jason Merrill <jason@redhat.com>
3681
3682 * class.c (is_really_empty_class): Add ignore_vptr parm.
3683 (trivial_default_constructor_is_constexpr): Pass it.
3684 * call.c (build_over_call): Pass it.
3685 * constexpr.c (cxx_eval_constant_expression): Pass it instead of
3686 checking TYPE_POLYMORPHIC_P.
3687 (cxx_eval_component_reference, potential_constant_expression_1):
3688 Pass it.
3689 * cp-gimplify.c (simple_empty_class_p): Pass it.
3690 * init.c (expand_aggr_init_1): Pass it.
3691
3692 2019-03-04 Paolo Carlini <paolo.carlini@oracle.com>
3693
3694 PR c++/84605
3695 * parser.c (cp_parser_class_head): Reject TYPE_BEING_DEFINED too.
3696
3697 2019-03-04 Jakub Jelinek <jakub@redhat.com>
3698
3699 PR c++/71446
3700 * call.c (field_in_pset): New function.
3701 (build_aggr_conv): Handle CONSTRUCTOR_IS_DESIGNATED_INIT correctly.
3702
3703 2019-03-02 Jakub Jelinek <jakub@redhat.com>
3704
3705 PR c++/71446
3706 * cp-tree.h (CONSTRUCTOR_IS_DESIGNATED_INIT): Define.
3707 * parser.c (cp_parser_braced_list): Adjust cp_parser_initializer_list
3708 caller, set CONSTRUCTOR_IS_DESIGNATED_INIT.
3709 (cp_parser_initializer_list): Add designated parameter, set *designated
3710 to a bool whether any designators were parsed.
3711 * decl.c (reshape_init): Copy over CONSTRUCTOR_IS_DESIGNATED_INIT if
3712 needed.
3713 * pt.c (tsubst_copy_and_build): Likewise.
3714 * call.c (implicit_conversion): If CONSTRUCTOR_IS_DESIGNATED_INIT,
3715 don't call build_list_conv, nor build_complex_conv, nor attempt to
3716 convert a single element initializer to scalar.
3717
3718 2019-03-01 Marek Polacek <polacek@redhat.com>
3719
3720 PR c++/89537 - missing location for error with non-static member fn.
3721 * call.c (resolve_args): Use EXPR_LOCATION.
3722 * typeck.c (build_class_member_access_expr): Use input_location.
3723
3724 PR c++/89532 - ICE with incomplete type in decltype.
3725 * semantics.c (finish_compound_literal): Return error_mark_node
3726 if digest_init_flags returns error_mark_node.
3727
3728 2019-03-01 Jakub Jelinek <jakub@redhat.com>
3729
3730 Implement P1002R1, Try-catch blocks in constexpr functions
3731 PR c++/89513
3732 * parser.c (cp_parser_ctor_initializer_opt_and_function_body):
3733 Diagnose constexpr ctor or function with function-try-block with
3734 pedwarn for c++17 and earlier. Formatting fix.
3735 (cp_parser_try_block): Use pedwarn instead of error and only for
3736 c++17 and earlier when try block appears in constexpr function.
3737 * constexpr.c (build_constexpr_constructor_member_initializers):
3738 Handle TRY_BLOCK here instead of erroring on it.
3739
3740 2019-02-28 Jason Merrill <jason@redhat.com>
3741
3742 PR c++/88183 - ICE with .* fold-expression.
3743 * pt.c (fold_expression) [DOTSTAR_EXPR]: Remove special handling.
3744
3745 PR c++/86969 - ICE with constexpr if and recursive generic lambdas.
3746 * class.c, lambda.c, pt.c: Revert earlier change.
3747 * lambda.c (add_capture): Don't special-case capture of dependent
3748 VLA.
3749
3750 * name-lookup.c (print_binding_level): Print this_entity.
3751
3752 2019-02-27 Marek Polacek <polacek@redhat.com>
3753
3754 PR c++/88857 - ICE with value-initialization of argument in template.
3755 * call.c (convert_like_real): Don't call build_value_init in template.
3756
3757 2019-02-27 Jason Merrill <jason@redhat.com>
3758
3759 PR c++/86969 - ICE with constexpr if and recursive generic lambdas.
3760 * semantics.c (process_outer_var_ref): Do capture dependent vars.
3761 * class.c (finish_struct): Only add TAG_DEFN if T is in
3762 current_function_decl.
3763 * lambda.c (vla_capture_type): Force the capture type out into the
3764 lambda's enclosing function.
3765 (add_capture): Pass in the lambda.
3766 * pt.c (tsubst_lambda_expr): complete_type a VLA capture type.
3767
3768 2019-02-27 Marek Polacek <polacek@redhat.com>
3769
3770 PR c++/89511 - ICE with using-declaration and unscoped enumerator.
3771 * parser.c (cp_parser_using_declaration): For an unscoped enum
3772 only use its context if it's not a function declaration.
3773
3774 2019-02-27 Paolo Carlini <paolo.carlini@oracle.com>
3775
3776 PR c++/89488
3777 * method.c (process_subob_fn): When maybe_instantiate_noexcept
3778 returns false don't call merge_exception_specifiers.
3779
3780 2019-02-27 Paolo Carlini <paolo.carlini@oracle.com>
3781
3782 PR c++/88987
3783 * parser.c (cp_parser_noexcept_specification_opt): Return NULL_TREE
3784 for a non-constant parsed expression.
3785
3786 2019-02-26 Jakub Jelinek <jakub@redhat.com>
3787
3788 PR c++/89481
3789 * constexpr.c (cxx_eval_store_expression): When changing active union
3790 member, set no_zero_init.
3791
3792 2019-02-23 Marek Polacek <polacek@redhat.com>
3793
3794 PR c++/88294 - ICE with non-constant noexcept-specifier.
3795 * pt.c (maybe_instantiate_noexcept): Set up the list of local
3796 specializations. Set current_class_{ptr,ref}.
3797
3798 2019-02-22 David Malcolm <dmalcolm@redhat.com>
3799
3800 PR c++/89390
3801 * parser.c (cp_parser_unqualified_id): Capture and use locations
3802 for destructors.
3803
3804 2019-02-22 Marek Polacek <polacek@redhat.com>
3805
3806 PR c++/89420 - ICE with CAST_EXPR in explicit-specifier.
3807 * decl.c (build_explicit_specifier): Don't check
3808 processing_template_decl. Call instantiation_dependent_expression_p
3809 instead of value_dependent_expression_p. Call
3810 instantiate_non_dependent_expr_sfinae before
3811 build_converted_constant_expr instead of calling
3812 instantiate_non_dependent_expr after it. Add
3813 processing_template_decl_sentinel.
3814
3815 2019-02-22 Thomas Schwinge <thomas@codesourcery.com>
3816
3817 * parser.c (cp_parser_oacc_simple_clause): Remove parser formal
3818 parameter, move loc formal parameter to the front. Adjust all
3819 users.
3820 (cp_parser_oacc_shape_clause): Add loc formal parameter. Adjust
3821 all users.
3822
3823 2019-02-21 Jason Merrill <jason@redhat.com>
3824
3825 PR c++/87685 - generic lambda 'this' capture error.
3826 * lambda.c (lambda_expr_this_capture): Change add_capture_p to int.
3827 (maybe_generic_this_capture): Pass -1.
3828
3829 PR c++/88394 - ICE with VLA init-capture.
3830 * lambda.c (is_normal_capture_proxy): Check DECL_CAPTURED_VARIABLE.
3831
3832 PR c++/88869 - C++17 ICE with CTAD and explicit specialization.
3833 * pt.c (do_class_deduction): Don't include explicit specialization
3834 args in outer_args.
3835
3836 PR c++/89422 - ICE with -g and lambda in default arg in template.
3837 * pt.c (tsubst_function_decl): SET_DECL_FRIEND_CONTEXT sooner.
3838
3839 2019-02-21 Jason Merrill <jason@redhat.com>
3840
3841 PR c++/88419 - C++17 ICE with class template arg deduction.
3842 * pt.c (make_template_placeholder): Set TYPE_CANONICAL after
3843 CLASS_PLACEHOLDER_TEMPLATE.
3844
3845 2019-02-21 Jakub Jelinek <jakub@redhat.com>
3846
3847 PR c++/89285
3848 * constexpr.c (struct constexpr_fundef): Add parms and result members.
3849 (retrieve_constexpr_fundef): Adjust for the above change.
3850 (register_constexpr_fundef): Save constexpr body with copy_fn,
3851 temporarily set DECL_CONTEXT on DECL_RESULT before that.
3852 (get_fundef_copy): Change FUN argument to FUNDEF with
3853 constexpr_fundef * type, grab body and parms/result out of
3854 constexpr_fundef struct and temporarily change it for copy_fn calls
3855 too.
3856 (cxx_eval_builtin_function_call): For __builtin_FUNCTION temporarily
3857 adjust current_function_decl from ctx->call context. Test
3858 !potential_constant_expression instead of !is_constant_expression.
3859 (cxx_bind_parameters_in_call): Grab parameters from new_call. Undo
3860 convert_for_arg_passing changes for TREE_ADDRESSABLE type passing.
3861 (cxx_eval_call_expression): Adjust get_fundef_copy caller.
3862 (cxx_eval_conditional_expression): For IF_STMT, allow then or else
3863 operands to be NULL.
3864 (label_matches): Handle BREAK_STMT and CONTINUE_STMT.
3865 (cxx_eval_loop_expr): Add support for FOR_STMT, WHILE_STMT and DO_STMT.
3866 (cxx_eval_switch_expr): Add support for SWITCH_STMT.
3867 (cxx_eval_constant_expression): Handle IF_STMT, FOR_STMT, WHILE_STMT,
3868 DO_STMT, CONTINUE_STMT, SWITCH_STMT, BREAK_STMT and CONTINUE_STMT.
3869 For SIZEOF_EXPR, recurse on the result of fold_sizeof_expr. Ignore
3870 DECL_EXPR with USING_DECL operand.
3871 * lambda.c (maybe_add_lambda_conv_op): Build thisarg using
3872 build_int_cst to make it a valid constant expression.
3873
3874 2019-02-20 Jason Merrill <jason@redhat.com>
3875
3876 PR c++/88690 - C++17 ICE with empty base in aggregate.
3877 * typeck2.c (process_init_constructor_record): Skip trivial
3878 initialization of an empty base.
3879
3880 2019-02-21 Richard Biener <rguenther@suse.de>
3881
3882 PR middle-end/89392
3883 * vtable-class-hierarchy.c (vtv_generate_init_routine): Do not
3884 make symtab process new functions here.
3885
3886 2019-02-20 Jason Merrill <jason@redhat.com>
3887
3888 PR c++/87921 - wrong error with inline static data member.
3889 * decl2.c (finish_static_data_member_decl): Don't set DECL_IN_AGGR_P
3890 for a non-template inline variable. Do nothing for an
3891 already-instantiated variable.
3892 (c_parse_final_cleanups): Check DECL_IN_AGGR_P without
3893 DECL_INLINE_VAR_P.
3894 * decl.c (check_initializer): Likewise.
3895 (make_rtl_for_nonlocal_decl): Likewise.
3896 * pt.c (instantiate_decl): Likewise.
3897 * typeck2.c (store_init_value): Likewise.
3898
3899 2019-02-20 Jakub Jelinek <jakub@redhat.com>
3900
3901 PR c++/89403
3902 * decl2.c (c_parse_final_cleanups): Move TREE_ASM_WRITTEN setting
3903 for flag_syntax_only from here...
3904 * semantics.c (expand_or_defer_fn_1): ... here.
3905
3906 PR c++/89405
3907 * decl.c (maybe_commonize_var): When clearing TREE_PUBLIC and
3908 DECL_COMMON, set DECL_INTERFACE_KNOWN.
3909
3910 PR c++/89336
3911 * constexpr.c (cxx_eval_store_expression): Diagnose changing of active
3912 union member for -std=c++17 and earlier.
3913
3914 2019-02-19 Jason Merrill <jason@redhat.com>
3915
3916 PR c++/87513 - 'sorry' mangling PMF template-id.
3917 * mangle.c (write_expression): Handle SCOPE_REF to BASELINK.
3918
3919 2019-02-19 Jason Merrill <jason@redhat.com>
3920
3921 PR c++/88380 - wrong-code with flexible array and NSDMI.
3922 * typeck2.c (process_init_constructor_record): Skip flexarrays.
3923
3924 2019-02-20 will wray <wjwray@gmail.com>
3925
3926 PR c++/88572 - wrong handling of braces on scalar init.
3927 * decl.c (reshape_init_r): Allow braces around scalar initializer
3928 within aggregate init. Reject double braced-init of scalar
3929 variable.
3930
3931 2019-02-20 Paolo Carlini <paolo.carlini@oracle.com>
3932
3933 PR c++/84536
3934 * pt.c (tsubst_init): Diagnose an initializer expanding to an
3935 empty list of expressions; tweak wrt dependent types.
3936 (regenerate_decl_from_template): For VAR_DECLs call tsubst_init
3937 instead of tsubst_expr.
3938
3939 2019-02-19 Jason Merrill <jason@redhat.com>
3940
3941 PR c++/88368 - wrong 'use of deleted function'
3942 * method.c (walk_field_subobs): Remember errors from get_nsdmi.
3943 (get_defaulted_eh_spec): Call push_tinst_level.
3944 * pt.c (maybe_instantiate_noexcept): Keep error_mark_node.
3945 * typeck2.c (merge_exception_specifiers): Handle error_mark_node.
3946
3947 2019-02-19 Chung-Lin Tang <cltang@codesourcery.com>
3948
3949 PR c/87924
3950 * parser.c (cp_parser_oacc_clause_wait): Add representation of wait
3951 clause without argument as 'wait (GOMP_ASYNC_NOVAL)', adjust comments.
3952
3953 2019-02-19 Jakub Jelinek <jakub@redhat.com>
3954
3955 PR c++/89387
3956 * lambda.c (maybe_generic_this_capture): Don't check
3957 DECL_NONSTATIC_MEMBER_FUNCTION_P on USING_DECLs.
3958
3959 PR c++/89391
3960 * typeck.c (build_reinterpret_cast_1): Don't handle void to
3961 && conversion go through build_target_expr_with_type.
3962
3963 PR c++/89390
3964 * error.c (qualified_name_lookup_error): Only call
3965 suggest_alternative_in_scoped_enum if name is IDENTIFIER_NODE.
3966
3967 2019-02-19 Tom Honermann <tom@honermann.net>
3968
3969 * name-lookup.c (get_std_name_hint): Added u8string as a name hint.
3970
3971 2019-02-18 Jason Merrill <jason@redhat.com>
3972
3973 PR c++/89336 - multiple stores in constexpr stmt.
3974 * constexpr.c (cxx_eval_store_expression): Preevaluate scalar or
3975 assigned value.
3976
3977 * pt.c (check_explicit_specialization): If the declarator is a
3978 template-id, only check whether the arguments are dependent.
3979
3980 Improve duplicate [[likely]] diagnostic.
3981 * parser.c (cp_parser_statement): Make attrs_loc a range. Pass it
3982 to process_stmt_hotness_attribute.
3983 * cp-gimplify.c (process_stmt_hotness_attribute): Take attrs_loc.
3984 (genericize_if_stmt): Use likely/unlikely instead of predictor_name.
3985
3986 2019-02-17 Marek Polacek <polacek@redhat.com>
3987
3988 PR c++/89217 - ICE with list-initialization in range-based for loop.
3989 * constexpr.c (unshare_constructor): No longer static.
3990 * cp-tree.h (unshare_constructor): Declare.
3991 * semantics.c (finish_compound_literal): When dealing with a
3992 non-dependent expression in a template, return the original
3993 expression. Pass LOOKUP_NO_NARROWING to digest_init_flags.
3994
3995 2019-02-13 Marek Polacek <polacek@redhat.com>
3996
3997 PR c++/89297 - ICE with OVERLOAD in template.
3998 * semantics.c (finish_compound_literal): Call
3999 instantiate_non_dependent_expr_sfinae.
4000
4001 2019-02-13 Alexandre Oliva <aoliva@redhat.com>
4002
4003 PR c++/86379
4004 * cp-tree.h (USING_DECL_SCOPE): Use result rather than type.
4005 * name-lookup.c (strip_using_decl): Use USING_DECL_SCOPE.
4006 * search.c (protected_accessible_p): Follow USING_DECL_DECLS.
4007 (shared_member_p): Likewise.
4008 (lookup_member): Likewise.
4009 * decl.c (grok_special_member_properties): Skip USING_DECLs.
4010 * semantics.c (finish_omp_declare_simd_methods): Likewise.
4011 (finish_qualified_id_expr): Do not call shared_member_p with
4012 a dependent expr.
4013
4014 PR c++/87322
4015 * pt.c (tsubst_lambda_expr): Avoid duplicate tsubsting.
4016 Move cp_evaluated resetting before signature tsubsting.
4017 (gen_elem_of_pack_expansion_instantiation): Separate local
4018 specializations per index.
4019
4020 2019-02-13 David Malcolm <dmalcolm@redhat.com>
4021
4022 PR c++/89036
4023 * class.c (add_method): Drop destructor assertion.
4024
4025 2019-02-13 Paolo Carlini <paolo.carlini@oracle.com>
4026
4027 PR c++/88986
4028 * decl.c (make_typename_type): Allow for TYPE_PACK_EXPANSION as
4029 context (the first argument).
4030 * pt.c (tsubst, case TYPENAME_TYPE): Handle TYPE_PACK_EXPANSION
4031 as context.
4032
4033 2019-02-12 Jason Merrill <jason@redhat.com>
4034
4035 PR c++/89144 - link error with constexpr initializer_list.
4036 * call.c (convert_like_real) [ck_list]: Don't allocate a temporary
4037 array for an empty list.
4038 * typeck2.c (store_init_value): Don't use cxx_constant_init in a
4039 template.
4040
4041 2019-02-11 Jason Merrill <jason@redhat.com>
4042
4043 PR c++/89241 - ICE with __func__ in lambda in template.
4044 * pt.c (enclosing_instantiation_of): Also check
4045 instantiated_lambda_fn_p for the template context.
4046
4047 2019-02-11 Marek Polacek <polacek@redhat.com>
4048
4049 PR c++/89212 - ICE converting nullptr to pointer-to-member-function.
4050 * pt.c (tsubst_copy_and_build) <case CONSTRUCTOR>: Return early for
4051 null member pointer value.
4052
4053 2019-02-11 Jakub Jelinek <jakub@redhat.com>
4054
4055 PR c++/88977
4056 * pt.c (convert_nontype_argument): Pass true as manifestly_const_eval
4057 to maybe_constant_value calls.
4058
4059 2019-02-11 Marek Polacek <polacek@redhat.com>
4060
4061 * typeck2.c (digest_init_r): Remove commented code.
4062
4063 2019-02-11 Martin Sebor <msebor@redhat.com>
4064
4065 PR c++/87996
4066 * decl.c (compute_array_index_type_loc): Preserve signed sizes
4067 for diagnostics. Call valid_array_size_p instead of error.
4068 * init.c (build_new_1): Compute size for diagnostic. Call
4069 invalid_array_size_error
4070 (build_new): Call valid_array_size_p instead of error.
4071
4072 2019-02-07 Alexandre Oliva <aoliva@redhat.com>
4073
4074 PR c++/86218
4075 * call.c (compare_ics): Deal with ck_aggr in either cs.
4076
4077 2019-02-06 David Malcolm <dmalcolm@redhat.com>
4078
4079 PR c++/71302
4080 * call.c (get_location_for_expr_unwinding_for_system_header): New
4081 function.
4082 (conversion_null_warnings): Use it when getting locations for
4083 EXPR, effectively adding a call to
4084 get_location_for_expr_unwinding_for_system_header for
4085 -Wconversion-null and making use of EXPR_LOCATION for
4086 -Wzero-as-null-pointer-constant.
4087
4088 2019-02-05 Jakub Jelinek <jakub@redhat.com>
4089
4090 PR c++/89187
4091 * optimize.c (maybe_thunk_body): Clear TREE_ADDRESSABLE on
4092 PARM_DECLs of the thunk.
4093 * lambda.c (maybe_add_lambda_conv_op): Likewise.
4094
4095 2019-02-05 Marek Polacek <polacek@redhat.com>
4096
4097 PR c++/89158 - by-value capture of constexpr variable broken.
4098 * call.c (convert_like_real) <case ck_user>: Call mark_exp_read
4099 instead of mark_rvalue_use.
4100
4101 2019-02-05 Alexandre Oliva <aoliva@redhat.com>
4102
4103 PR c++/87770
4104 * pt.c (instantiates_primary_template_p): New.
4105 (type_dependent_expression_p): Use it.
4106
4107 2019-02-01 Jason Merrill <jason@redhat.com>
4108
4109 PR c++/88761 - ICE with reference capture of constant.
4110 * lambda.c (mark_const_cap_r): Do walk subtrees of DECL_EXPR for
4111 non-proxy decls.
4112
4113 2019-02-01 Marek Polacek <polacek@redhat.com>
4114
4115 PR c++/88325 - ICE with invalid out-of-line template member definition.
4116 * parser.c (cp_parser_class_name): Don't call make_typename_type
4117 for overloads.
4118
4119 2019-02-01 Jakub Jelinek <jakub@redhat.com>
4120
4121 PR c++/87175
4122 * parser.c (cp_parser_gnu_attributes_opt): Set ok to false
4123 if require_open failed.
4124
4125 2019-01-31 Marek Polacek <polacek@redhat.com>
4126
4127 PR c++/89083, c++/80864 - ICE with list initialization in template.
4128 * constexpr.c (adjust_temp_type): Use copy_node and change the type
4129 instead of using build_constructor.
4130 * decl.c (reshape_init_r): Don't reshape a digested initializer.
4131 Return the initializer for COMPOUND_LITERAL_P.
4132
4133 PR c++/88983 - ICE with switch in constexpr function.
4134 * constexpr.c (cxx_eval_switch_expr): Use SWITCH_COND and SWITCH_BODY.
4135 (cxx_eval_constant_expression) <case COND_EXPR>: Don't look for the
4136 label in the else branch if we found it in the then branch.
4137
4138 2019-01-30 Jason Merrill <jason@redhat.com>
4139
4140 PR c++/88752 - ICE with lambda and constexpr if.
4141 * cp-tree.h (LAMBDA_EXPR_INSTANTIATED): New.
4142 * pt.c (tsubst_lambda_expr): Set it.
4143 (instantiated_lambda_fn_p): Check it.
4144 (enclosing_instantiation_of): Use it.
4145
4146 2019-01-31 Jakub Jelinek <jakub@redhat.com>
4147
4148 PR libstdc++/88170
4149 * cxx-pretty-print.c (pp_cxx_enumeration_constant): Print always as
4150 a C cast in pp_c_flag_gnu_v3 mode.
4151
4152 2019-01-30 Jakub Jelinek <jakub@redhat.com>
4153
4154 PR c++/88988
4155 * lambda.c (is_capture_proxy): Don't return true for
4156 DECL_OMP_PRIVATIZED_MEMBER artificial vars.
4157
4158 2019-01-30 Marek Polacek <polacek@redhat.com>
4159
4160 PR c++/89119 - ICE with value-initialization in template.
4161 * pt.c (tsubst_copy_and_build): Handle RANGE_EXPR.
4162
4163 2019-01-29 Jason Merrill <jason@redhat.com>
4164
4165 PR c++/86943 - wrong code converting lambda to function pointer.
4166 * lambda.c (maybe_add_lambda_conv_op): Use a template-id in the
4167 call. Only forward parms for decltype.
4168 * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Handle CALL_FROM_THUNK_P
4169 specially.
4170 * typeck.c (check_return_expr): Don't mess with a thunk call.
4171
4172 2019-01-28 Jason Merrill <jason@redhat.com>
4173
4174 PR c++/89089 - ICE with [[no_unique_address]].
4175 PR c++/88865 - wrong layout with [[no_unique_address]].
4176 * class.c (check_field_decls): A potentially-overlapping field makes
4177 the class non-layout-POD, but not non-empty.
4178 (end_of_class): Always consider empty data members.
4179 (layout_class_type): Set DECL_SIZE for empty fields.
4180
4181 2019-01-28 Marek Polacek <polacek@redhat.com>
4182
4183 PR c++/88358 - name wrongly treated as type.
4184 * parser.c (cp_parser_direct_declarator): Don't assume a qualified-id
4185 in parameter-list is a type if the function's declarator-id is not
4186 qualified.
4187
4188 2019-01-27 Marek Polacek <polacek@redhat.com>
4189
4190 PR c++/88815 - narrowing conversion lost in decltype.
4191 PR c++/78244 - narrowing conversion in template not detected.
4192 * cp-tree.h (CONSTRUCTOR_IS_DEPENDENT): New.
4193 * pt.c (instantiation_dependent_r): Consider a CONSTRUCTOR with
4194 CONSTRUCTOR_IS_DEPENDENT instantiation-dependent.
4195 * semantics.c (finish_compound_literal): When the compound literal
4196 isn't instantiation-dependent and the type isn't type-dependent,
4197 fall back to the normal processing. Set CONSTRUCTOR_IS_DEPENDENT.
4198
4199 PR c++/89024 - ICE with incomplete enum type.
4200 * call.c (standard_conversion): When converting an
4201 ARITHMETIC_TYPE_P to an incomplete type, return NULL.
4202
4203 2019-01-25 Paolo Carlini <paolo.carlini@oracle.com>
4204
4205 PR c++/88969
4206 * call.c (build_op_delete_call): Implement 7.6.2.5/(10.1).
4207 * decl2.c (coerce_delete_type): Use build_pointer_type instead
4208 of TYPE_POINTER_TO.
4209
4210 2019-01-24 Jason Merrill <jason@redhat.com>
4211
4212 PR c++/89001 - mangling of reference temporaries
4213 * cp-tree.h (struct saved_scope): Add ref_temp_count.
4214 (current_ref_temp_count): New macro.
4215 * mangle.c (mangle_ref_init_variable): Use it.
4216 * typeck2.c (store_init_value): Clear it.
4217 * call.c (make_temporary_var_for_ref_to_temp): Copy public and
4218 comdat.
4219
4220 2019-01-24 Jakub Jelinek <jakub@redhat.com>
4221
4222 PR c++/88976
4223 * semantics.c (finish_omp_cancel): Diagnose more than one if
4224 on #pragma omp cancel with different modifiers. Use
4225 maybe_convert_cond when not in template or build_x_binary_op
4226 otherwise.
4227
4228 2019-01-23 Marek Polacek <polacek@redhat.com>
4229
4230 PR c++/88757 - qualified name treated wrongly as type.
4231 * parser.c (cp_parser_direct_declarator): Don't treat qualified-ids
4232 in parameter-list as types if name lookup for declarator-id didn't
4233 find one or more function templates.
4234
4235 2019-01-23 Jakub Jelinek <jakub@redhat.com>
4236
4237 PR c/44715
4238 * cp-gimplify.c (genericize_cp_loop): Call begin_bc_block only
4239 after genericizing cond and incr expressions.
4240
4241 PR c++/88984
4242 * cp-gimplify.c (genericize_switch_stmt): Move cond genericization
4243 before the begin_bc_block call.
4244
4245 2019-01-21 Jason Merrill <jason@redhat.com>
4246
4247 PR c++/87893 - constexpr ctor ICE on ARM.
4248 PR c++/88293 - ICE with comma expression.
4249 * constexpr.c (initialized_type): Don't shortcut non-void type.
4250 Handle COMPOUND_EXPR.
4251 (cxx_eval_outermost_constant_expr): Return early for void type.
4252
4253 2019-01-21 Jakub Jelinek <jakub@redhat.com>
4254
4255 PR c++/88949
4256 * optimize.c (cxx_copy_decl): New function.
4257 (clone_body): Use it instead of copy_decl_no_change.
4258
4259 PR sanitizer/88901
4260 * typeck.c (cp_build_binary_op): Don't instrument
4261 SANITIZE_POINTER_COMPARE if processing_template_decl.
4262 (pointer_diff): Similarly for SANITIZE_POINTER_SUBTRACT.
4263
4264 2019-01-18 Jason Merrill <jason@redhat.com>
4265
4266 PR c++/88875 - error with explicit list constructor.
4267 * call.c (reference_binding): Don't modify EXPR. Set
4268 need_temporary_p on the ck_user conversion for a temporary.
4269 (convert_like_real): Check it.
4270
4271 2019-01-18 H.J. Lu <hongjiu.lu@intel.com>
4272
4273 PR c/51628
4274 PR c/88664
4275 * call.c (convert_for_arg_passing): Upate the
4276 warn_for_address_or_pointer_of_packed_member call.
4277 * typeck.c (convert_for_assignment): Likewise.
4278
4279 2019-01-17 Jason Merrill <jason@redhat.com>
4280
4281 PR c++/86205 - ICE with ?: of throw and template-id.
4282 * pt.c (resolve_nondeduced_context_or_error): Split out from...
4283 * typeck.c (decay_conversion): ...here.
4284 * call.c (build_conditional_expr_1): Use it.
4285
4286 PR c++/86740, ICE with constexpr if and nested generic lambdas.
4287 * tree.c (cp_walk_subtrees): Handle LAMBDA_EXPR.
4288
4289 2019-01-17 Paolo Carlini <paolo.carlini@oracle.com>
4290
4291 * decl.c (grokdeclarator): Use typespec_loc in error messages
4292 about 'auto' and trailing return type.
4293
4294 2019-01-17 David Malcolm <dmalcolm@redhat.com>
4295
4296 PR c++/88699
4297 * class.c (add_method): Don't use DECL_DESTRUCTOR_P on
4298 USING_DECLs.
4299
4300 2019-01-17 Nathan Sidwell <nathan@acm.org>
4301
4302 PR c++/86610
4303 * semantics.c (process_outer_var_ref): Only skip dependent types
4304 in templates.
4305
4306 2019-01-17 Alexandre Oliva <aoliva@redhat.com>
4307
4308 PR c++/87768
4309 * cp-tree.h (saved_scope): Add suppress_location_wrappers.
4310 * name-lookup.c (do_push_to_top_level): Save and reset it.
4311 (do_pop_from_top_level): Restore it.
4312
4313 PR c++/86648
4314 * pt.c (make_template_placeholder): Use auto_identifier.
4315 (is_auto): Drop CLASS_PLACEHOLDER_TEMPLATE test.
4316 * error.c (dump_type): Handle template placeholders.
4317 * cxx-pretty-print.c (pp_cx_unqualified_id): Likewise.
4318
4319 PR c++/88146
4320 * cvt.c (convert_to_void): Handle all cdtor calls as if
4321 returning void.
4322
4323 2019-01-16 Paolo Carlini <paolo.carlini@oracle.com>
4324
4325 * decl.c (grokdeclarator): Use locations[ds_storage_class] in
4326 error messages about ill-formed uses of mutable.
4327
4328 2019-01-16 Marek Polacek <polacek@redhat.com>
4329
4330 PR c++/78244 - narrowing conversion in template not detected.
4331 * call.c (perform_implicit_conversion_flags): Set
4332 IMPLICIT_CONV_EXPR_BRACED_INIT.
4333 * cp-tree.h (IMPLICIT_CONV_EXPR_BRACED_INIT): New.
4334 * pt.c (tsubst_copy_and_build): Use it.
4335
4336 2019-01-15 David Malcolm <dmalcolm@redhat.com>
4337
4338 PR c++/88795
4339 * pt.c (build_deduction_guide): Bail out if tsubst_arg_types
4340 fails.
4341
4342 2019-01-15 Paolo Carlini <paolo.carlini@oracle.com>
4343
4344 * decl.c (start_decl): Improve error location.
4345 * decl2.c (grokfield): Likewise.
4346
4347 2019-01-15 Paolo Carlini <paolo.carlini@oracle.com>
4348
4349 * decl.c (grokdeclarator): Move further up the location_t loc
4350 declaration and use the location when building a TYPE_DECL for
4351 a typedef name.
4352 * decl2.c (grokbitfield): Use DECL_SOURCE_LOCATION in the error
4353 about an ill-formed bit-field as typedef.
4354
4355 2019-01-14 Marek Polacek <polacek@redhat.com>
4356
4357 PR c++/88830 - ICE with abstract class.
4358 * decl2.c (maybe_emit_vtables): Check CLASSTYPE_LAZY_DESTRUCTOR.
4359 Fix formatting.
4360
4361 PR c++/88825 - ICE with bogus function return type deduction.
4362 * typeck.c (can_do_nrvo_p): Check error_mark_node.
4363
4364 2019-01-14 Tom Honermann <tom@honermann.net>
4365
4366 Implement P0482R5, char8_t: A type for UTF-8 characters and strings
4367 * cvt.c (type_promotes_to): Handle char8_t promotion.
4368 * decl.c (grokdeclarator): Handle invalid type specifier
4369 combinations involving char8_t.
4370 * lex.c (init_reswords): Add char8_t as a reserved word.
4371 * mangle.c (write_builtin_type): Add name mangling for char8_t (Du).
4372 * parser.c (cp_keyword_starts_decl_specifier_p)
4373 (cp_parser_simple_type_specifier): Recognize char8_t as a simple
4374 type specifier.
4375 (cp_parser_string_literal): Use char8_array_type_node for the type
4376 of CPP_UTF8STRING.
4377 (cp_parser_set_decl_spec_type): Tolerate char8_t typedefs in system
4378 headers.
4379 * rtti.c (emit_support_tinfos): type_info support for char8_t.
4380 * tree.c (char_type_p): Recognize char8_t as a character type.
4381 * typeck.c (string_conv_p): Handle conversions of u8 string
4382 literals of char8_t type.
4383 (check_literal_operator_args): Handle UDLs with u8 string literals
4384 of char8_t type.
4385 * typeck2.c (ordinary_char_type_p): New.
4386 (digest_init_r): Disallow initializing a char array with a u8 string
4387 literal.
4388
4389 2019-01-14 Martin Liska <mliska@suse.cz>
4390
4391 PR gcov-profile/88263
4392 * decl2.c (get_tls_wrapper_fn): Use DECL_SOURCE_LOCATION
4393 as location of the TLS wrapper.
4394
4395 2019-01-12 Paolo Carlini <paolo.carlini@oracle.com>
4396
4397 * decl.c (cp_finish_decl): Improve error location.
4398 * decl2.c (grokfield): Likewise, improve two locations.
4399
4400 2019-01-11 Marek Polacek <polacek@redhat.com>
4401
4402 PR c++/88692, c++/87882 - -Wredundant-move false positive with *this.
4403 * typeck.c (maybe_warn_pessimizing_move): Return if ARG isn't
4404 ADDR_EXPR.
4405
4406 2019-01-11 Jason Merrill <jason@redhat.com>
4407
4408 PR c++/88312 - pack expansion of decltype.
4409 * pt.c (instantiation_dependent_r): A template non-type parameter
4410 pack is instantiation-dependent.
4411
4412 2019-01-11 Jason Merrill <jason@redhat.com>
4413
4414 PR c++/88613 - ICE with use of const var in lambda.
4415 * expr.c (mark_use): Fix location wrapper handling.
4416 * cp-gimplify.c (cp_fold_maybe_rvalue): Call mark_rvalue_use.
4417
4418 2019-01-11 Tobias Burnus <burnus@net-b.de>
4419
4420 PR C++/88114
4421 * decl2.c (maybe_emit_vtables): If needed, generate code for
4422 the destructor of an abstract class.
4423 (mark_used): Update comment for older function-name change.
4424
4425 2019-01-11 Paolo Carlini <paolo.carlini@oracle.com>
4426
4427 * decl.c (start_decl): Improve error location.
4428 (grokdeclarator): Likewise, improve two locations.
4429
4430 2019-01-09 Sandra Loosemore <sandra@codesourcery.com>
4431
4432 PR other/16615
4433
4434 * cp-tree.h: Mechanically replace "can not" with "cannot".
4435 * parser.c: Likewise.
4436 * pt.c: Likewise.
4437
4438 2019-01-08 Paolo Carlini <paolo.carlini@oracle.com>
4439
4440 * decl.c (grok_reference_init): Improve error location.
4441 (grokdeclarator): Likewise, improve two locations.
4442
4443 2019-01-08 Marek Polacek <polacek@redhat.com>
4444
4445 PR c++/88538 - braced-init-list in template-argument-list.
4446 * parser.c (cp_parser_template_argument): Handle braced-init-list when
4447 in C++20.
4448
4449 PR c++/88548 - this accepted in static member functions.
4450 * parser.c (cp_debug_parser): Adjust printing of
4451 local_variables_forbidden_p.
4452 (cp_parser_new): Set local_variables_forbidden_p to 0 rather than false.
4453 (cp_parser_primary_expression): When checking
4454 local_variables_forbidden_p, use THIS_FORBIDDEN or
4455 LOCAL_VARS_FORBIDDEN.
4456 (cp_parser_lambda_body): Update the type of
4457 local_variables_forbidden_p. Set it to 0 rather than false.
4458 (cp_parser_condition): Adjust call to cp_parser_declarator.
4459 (cp_parser_explicit_instantiation): Likewise.
4460 (cp_parser_init_declarator): Likewise.
4461 (cp_parser_declarator): New parameter. Use it.
4462 (cp_parser_direct_declarator): New parameter. Use it to set
4463 local_variables_forbidden_p. Adjust call to cp_parser_declarator.
4464 (cp_parser_type_id_1): Adjust call to cp_parser_declarator.
4465 (cp_parser_parameter_declaration): Likewise.
4466 (cp_parser_default_argument): Update the type of
4467 local_variables_forbidden_p. Set it to LOCAL_VARS_AND_THIS_FORBIDDEN
4468 rather than true.
4469 (cp_parser_member_declaration): Tell cp_parser_declarator if we saw
4470 'static' or 'friend'.
4471 (cp_parser_exception_declaration): Adjust call to cp_parser_declarator.
4472 (cp_parser_late_parsing_default_args): Update the type of
4473 local_variables_forbidden_p. Set it to LOCAL_VARS_AND_THIS_FORBIDDEN
4474 rather than true.
4475 (cp_parser_cache_defarg): Adjust call to cp_parser_declarator.
4476 (cp_parser_objc_class_ivars): Likewise.
4477 (cp_parser_objc_struct_declaration): Likewise.
4478 (cp_parser_omp_for_loop_init): Likewise.
4479 * parser.h (cp_parser): Change the type of local_variables_forbidden_p
4480 to unsigned char.
4481 (LOCAL_VARS_FORBIDDEN, LOCAL_VARS_AND_THIS_FORBIDDEN, THIS_FORBIDDEN):
4482 Define.
4483
4484 2019-01-08 Paolo Carlini <paolo.carlini@oracle.com>
4485
4486 * decl.c (start_decl): Improve permerror location.
4487
4488 2019-01-08 Jonathan Wakely <jwakely@redhat.com>
4489 Jakub Jelinek <jakub@redhat.com>
4490
4491 PR c++/88554
4492 * decl.c (finish_function): For -Wreturn-type don't add a return *this;
4493 fixit hint if current_class_ref is NULL. Use a single if instead of
4494 two nested ones.
4495
4496 2019-01-07 Paolo Carlini <paolo.carlini@oracle.com>
4497
4498 * decl.c (start_decl): Improve two error_at locations.
4499 (expand_static_init): Likewise.
4500
4501 2019-01-07 Marek Polacek <polacek@redhat.com>
4502
4503 PR c++/88741 - wrong error with initializer-string.
4504 * decl.c (cp_complete_array_type): Strip any location wrappers.
4505
4506 2019-01-07 Bernd Edlinger <bernd.edlinger@hotmail.de>
4507
4508 PR c++/88261
4509 PR c++/69338
4510 PR c++/69696
4511 PR c++/69697
4512 * cp-tree.h (LOOKUP_ALLOW_FLEXARRAY_INIT): New flag value.
4513 * typeck2.c (digest_init_r): Raise an error for non-static
4514 initialization of a flexible array member.
4515 (process_init_constructor, massage_init_elt,
4516 process_init_constructor_array, process_init_constructor_record,
4517 process_init_constructor_union, process_init_constructor): Add the
4518 flags parameter and pass it thru.
4519 (store_init_value): Pass LOOKUP_ALLOW_FLEXARRAY_INIT parameter to
4520 digest_init_flags for static decls.
4521
4522 2019-01-07 Jakub Jelinek <jakub@redhat.com>
4523
4524 PR c++/85052
4525 * cp-tree.h (cp_build_vec_convert): Declare.
4526 * parser.c (cp_parser_postfix_expression): Parse
4527 __builtin_convertvector.
4528 * constexpr.c: Include fold-const-call.h.
4529 (cxx_eval_internal_function): Handle IFN_VEC_CONVERT.
4530 (potential_constant_expression_1): Likewise.
4531 * semantics.c (cp_build_vec_convert): New function.
4532 * pt.c (tsubst_copy_and_build): Handle CALL_EXPR to
4533 IFN_VEC_CONVERT.
4534
4535 2019-01-03 Jakub Jelinek <jakub@redhat.com>
4536
4537 PR c++/88636
4538 * decl.c (builtin_function_1): Return result of pushdecl_top_level
4539 or pushdecl rather than decl.
4540
4541 2019-01-03 Paolo Carlini <paolo.carlini@oracle.com>
4542
4543 * tree.c (handle_nodiscard_attribute): Improve warning location.
4544
4545 2019-01-02 Marek Polacek <polacek@redhat.com>
4546
4547 PR c++/88612 - ICE with -Waddress-of-packed-member.
4548 * call.c (convert_for_arg_passing): Only give warnings with tf_warning.
4549 * typeck.c (convert_for_assignment): Likewise.
4550
4551 PR c++/88631 - CTAD failing for value-initialization.
4552 * typeck2.c (build_functional_cast): Try deducing the template
4553 arguments even if there are no arguments to deduce from.
4554
4555 2019-01-01 Jakub Jelinek <jakub@redhat.com>
4556
4557 Update copyright years.
4558 \f
4559 Copyright (C) 2019 Free Software Foundation, Inc.
4560
4561 Copying and distribution of this file, with or without modification,
4562 are permitted in any medium without royalty provided the copyright
4563 notice and this notice are preserved.