]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/cp/ChangeLog
Kill IDENTIFIER_TEMPLATE.
[thirdparty/gcc.git] / gcc / cp / ChangeLog
CommitLineData
5fee5eca
NS
12017-06-27 Nathan Sidwell <nathan@acm.org>
2
3 Kill IDENTIFIER_TEMPLATE.
4 * cp-tree.h (lang_identifier): Remove class_template_info field.
5 (IDENTIFIER_TEMPLATE): Delete.
6 * name-lookup.c (constructor_name_full): Subsume into ...
7 (constructor_name): ... here. Don't check IDENTIFIER_TEMPLATE.
8 (constructor_name_p): Likewise.
9 * mangle.c (write_source_name): Likewise.
10 * ptree.c (cxx_print_identifier): Likewise.
11
0c418630
MP
122017-06-27 Marek Polacek <polacek@redhat.com>
13
14 PR bootstrap/81216
15 * parser.c (cp_parser_already_scoped_statement): Initialize
16 LOC_AFTER_LABELS.
17
b0d1023d
JM
182017-06-26 Jason Merrill <jason@redhat.com>
19
20 PR c++/81215 - deduction failure with variadic TTP.
21 * pt.c (unify_bound_ttp_args): Restore old logic for C++14 and down.
22
4b377e01
MS
232017-06-26 Martin Sebor <msebor@redhat.com>
24
25 PR c++/81169
26 * call.c (maybe_warn_class_memaccess): Preserve explicit conversions
27 to detect casting away cv-qualifiers.
28
d6ef53f2
NS
292017-06-26 Nathan Sidwell <nathan@acm.org>
30
31 * cp-tree.h (lang_decl_fn): Remove assignment_operator_p field.
32 (DECL_COMPLETE_CONSTRUCTOR_P): Directly compare
33 identifier.
34 (DECL_BASE_CONSTRUCTOR_P, DECL_COMPLETE_DESTRUCTOR_P,
35 DECL_BASE_DESTRUCTOR_P, DECL_DELETING_DESTRUCTOR_P): Likewise.
36 (DECL_ASSIGNMENT_OPERATOR_P): Use IDENTIFIER_ASSIGN_OP_P.
37 * decl.c (grok_op_properties): Adjust identifier checking.
38 * init.c (expand_default_init): Adjust identifier descision.
39 * method.c (implicitly_declare_fn): Don't use
40 DECL_ASSIGNMENT_OPERATOR_P.
41 * search.c (lookup_fnfields_1): Use IDENTIFIER_CTOR_P,
42 IDENTIFIER_DTOR_P.
43 * call.c (in_charge_arg_for_name): Reimplement.
44 (build_special_member_call): Use IDENTIFIER_CDTOR_P,
45 IDENTIFIER_DTOR_P.
46
3e2becc4
MP
472017-06-26 Marek Polacek <polacek@redhat.com>
48
49 PR c/80116
50 * parser.c (cp_parser_statement): Add a default argument. Save the
51 location of the expression-statement after labels have been parsed.
52 (cp_parser_implicitly_scoped_statement): Set the location of the
53 body of the conditional after parsing all the labels. Call
54 warn_for_multistatement_macros.
55 (cp_parser_already_scoped_statement): Likewise.
56
22235619
PC
572017-06-24 Paolo Carlini <paolo.carlini@oracle.com>
58
59 PR c++/62315
60 * parser.c (cp_parser_diagnose_invalid_type_name): Don't print
61 'typename' in error messages about missing 'typename'.
62
e2e80f2f
JM
632017-06-23 Jason Merrill <jason@redhat.com>
64
65 PR c++/79056 - C++17 ICE with invalid template syntax.
66 * parser.c (cp_parser_simple_type_specifier): Don't assume that type
67 is a TYPE_DECL.
68 (cp_parser_check_for_invalid_template_id): Handle TYPE_DECL.
69 * pt.c (template_placeholder_p): New.
70 * cp-tree.h: Declare it.
71
2db9b7cd
MG
722017-06-23 Marc Glisse <marc.glisse@inria.fr>
73
74 * decl.c (duplicate_decls): Use builtin_structptr_types.
75
84c0088f
NS
762017-06-22 Nathan Sidwell <nathan@acm.org>
77
78 Reorder IDENTIFIER flags
79 gcc/cp/
80 * cp-tree.h (enum cp_identifier_kind): New.
81 (IDENTIFIER_KIND_BIT_0, IDENTIFIER_KIND_BIT_1,
82 IDENTIFIER_KIND_BIT_2): New.
83 (IDENTIFIER_MARKED): Move to TREE_LANG_FLAG_4.
84 (IDENTIFIER_VIRTUAL_P, IDENTIFIER_REPO_CHOSEN): Add IDENTIFIER_CHECK.
85 (C_IS_RESERVED_WORD): Replace with ...
86 (IDENTIFIER_KEYWORD_P): ... this.
87 (IDENTIFIER_CTOR_OR_DTOR_P): Replace with ...
88 (IDENTIFIER_CDTOR_P): ... this.
89 (IDENTIFIER_CTOR_P, IDENTIFIER_DTOR_P): New.
90 (IDENTIFIER_OPNAME_P): Replace with ...
91 (IDENTIFIER_ANY_OP_P): ... this.
92 (IDENTIFIER_ASSIGN_OP_P): New.
93 (IDENTIFIER_TYPENAME_P): Replace with ...
94 (IDENTIFIER_CONV_OP_P): ... this.
95 (NEW_DELETE_OPNAME_P): Replace with ...
96 (IDENTIFIER_NEWDEL_OP_P): ... this.
97 (DECL_CONV_FN_P, DECL_OVERLOADED_OPERATOR_P): Adjust.
98 (get_identifier_kind_name, set_identifier_kind): Declare.
99 * lex.c (get_identifier_kind_name, set_identifier_kind): New.
100 (init_operators): Adjust to avoid keywords, use
101 set_identifier_kind. Copy TYPE_EXPR slot.
102 (init_reswords): Call set_identifier_kind.
103 (unqualified_name_lookup_error): Adjust.
104 * operators.def (TYPE_EXPR): Remove.
105 * decl.c (struct predefined_identifier): Move into ...
106 (initialize_predefined_identifiers): ... here. Call
107 set_identifier_kind.
108 (grokfndecl, check_var_type, grokdeclarator): Adjust.
109 (grok_op_properties): Use IDENTIFIER_ANY_ASSIGN_OP to halve search
110 space. Adjust.
111 * call.c (name_as_c_string): Adjust.
112 (build_new_method_call_1): Likewise.
113 * cp-cilkplus.c (is_conversion_operator_function_decl_p): Likewise.
114 * cxx-pretty-print.c (pp_cxx_unqualified_id): Adjust.
115 * dump.c (cp_dump_tree): Adjust.
116 * error.c (dump_decl_name): Adjust.
117 * mangle.c (write_unqualified_id, write_member_name,
118 write_expression): Adjust.
119 (mangle_conv_op_name_for_type): Use set_identifier_kind.
120 * name-lookup.c (do_class_using_decl): Adjust.
121 (lookup_name_fuzzy, lookup_name_real_1): Likewise.
122 * parser.c (cp_lexer_get_preprocessor_token,
123 cp_parser_direct_declarator): Likewise.
124 * pt.c (push_template_decl_real, tsubst_decl, tsubst_baselink,
125 tsubst_copy, tsubst_copy_and_build): Adjust.
126 * ptree.c (cxx_print_identifier): Print identifier kind.
127 * search.c (lookup_field_r, lookup_member,
128 lookup_fnfields_idx_nolazy): Adjust.
129 * semantics.c (finish_id_expression): Adjust..
130 * typeck.c (cp_build_addr_expr_1): Adjust.
131
cb8d1b01
JJ
1322017-06-21 Jakub Jelinek <jakub@redhat.com>
133
134 PR c++/81154
135 * semantics.c (handle_omp_array_sections_1, finish_omp_clauses):
136 Complain about t not being a variable if t is OVERLOAD even
137 when processing_template_decl.
138
113459fa
DM
1392017-06-21 David Malcolm <dmalcolm@redhat.com>
140
141 * parser.c (get_cast_suggestion): New function.
142 (maybe_add_cast_fixit): New function.
143 (cp_parser_cast_expression): Capture the location of the closing
144 parenthesis. Call maybe_add_cast_fixit when emitting warnings
145 about old-style casts.
146
d276da0c
JM
1472017-06-20 Jason Merrill <jason@redhat.com>
148
149 PR c++/80972 - C++17 ICE with attribute packed.
150 * call.c (build_over_call): Allow a TARGET_EXPR from reference
151 binding.
152
71bbbd13
NS
1532017-06-20 Nathan Sidwell <nathan@acm.org>
154
1e5d2102
NS
155 * cp-tree.h (CPTI_NELTS_IDENTIFIER): Delete.
156 (nelts_identifier): Delete.
157 * decl.c (initialize_predefined_identifiers): Remove nelts.
158
71bbbd13
NS
159 PR c++/67074 - namespace aliases
160 * decl.c (duplicate_decls): Don't error here on mismatched
161 namespace alias.
162 * name-lookup.c (name_lookup::add_value): Matching namespaces are
163 not ambiguous.
164 (diagnose_name_conflict): Namespaces are never redeclarations.
165 (update_binding): An alias can match a real namespace.
166
ecc57615
JM
1672017-06-19 Jason Merrill <jason@redhat.com>
168
66d052d5
JM
169 PR c++/80562 - ICE with constexpr if.
170 * semantics.c (finish_if_stmt_cond): Call
171 instantiate_non_dependent_expr.
172
ecc57615
JM
173 PR c++/80829 - ICE with constexpr copy of base subobject.
174 * constexpr.c (clear_no_implicit_zero): New.
175 (cxx_eval_call_expression): Call it.
176
5ec046c0
NS
1772017-06-19 Nathan Sidwell <nathan@acm.org>
178
179 PR c++/81124
180 PR c++/79766
181 * name-lookup.c (set_decl_namespace): Don't follow using
182 directives and ignore using decls. Only check overly-explicit
183 scope after discovering decl.
184
4b691b13
JM
1852017-06-19 Jason Merrill <jason@redhat.com>
186
187 PR c++/81073 - constexpr and static var in statement-expression.
188 * typeck2.c (store_init_value): Always call
189 require_potential_constant_expression.
190 * pt.c (convert_nontype_argument): Likewise.
191 * constexpr.c (potential_constant_expression_1): Adjust message.
192 Use decl_maybe_constant_var_p instead of decl_constant_var_p.
193 * decl2.c (decl_maybe_constant_var_p): Consider initializer.
194
c14c0b15
NS
1952017-06-19 Nathan Sidwell <nathan@acm.org>
196
74e56995
NS
197 * pt.c (coerce_template_parms): Fix indentation.
198 (tsubst_decl): Remove repeated SET_DECL_RTL. Move VAR_P handling
199 in to single block.
200
c14c0b15
NS
201 PR c++/81119
202 * name-lookup.c (update_binding): Only warn about constructors
203 hidden by functions.
204
5ebcc547
JM
2052017-06-17 Jason Merrill <jason@redhat.com>
206
20ef9df1
JM
207 PR c++/60063 - -Wunused-local-typedefs and templates.
208 * decl2.c (is_late_template_attribute): Return false for "used".
209
5ebcc547
JM
210 PR c++/70844 - -Wuseless-cast and inheriting constructor.
211 * method.c (forward_parm): Suppress warn_useless_cast.
212
b126bff4
JM
2132017-06-16 Jason Merrill <jason@redhat.com>
214
ccb7042d
JM
215 PR c++/81045 - Wrong type-dependence with auto return type.
216 * pt.c (type_dependent_expression_p): An undeduced auto outside the
217 template isn't dependent.
218 * call.c (build_over_call): Instantiate undeduced auto even in a
219 template.
220
d4b1d43c
JM
221 PR c++/80465 - ICE with generic lambda with noexcept-specifier.
222 * lambda.c (maybe_add_lambda_conv_op): Keep processing_template_decl
223 set longer for a generic lambda.
224
cc14602e
JM
225 PR c++/80614 - Wrong mangling for C++17 noexcept type
226 * mangle.c (write_type): Put the eh spec back on the function type.
227
3da557ec
JM
228 PR c++/81102 - Wrong error with partial specialization.
229 * pt.c (unify) [TEMPLATE_PARM_INDEX]: Strip reference when comparing
230 types. Do type deduction later.
231
e8cc8c92 232 PR c++/81074 - ICE with partial specialization of member template.
157420b4
JM
233 PR c++/71747
234 * pt.c (get_partial_spec_bindings): Only coerce innermost args.
235
3eec359d
JM
236 PR c++/80831 - ICE with -fsyntax-only.
237 * decl2.c (c_parse_final_cleanups): Use cgraph_node::get_create.
238
b126bff4
JM
239 PR c++/80639 - ICE with invalid PMF initialization.
240 PR c++/80043 - ICE with -fpermissive
241 * typeck.c (convert_for_assignment): Recurse when instantiate_type
242 returns without an error.
243
ac9a1c7e
NS
2442017-06-16 Nathan Sidwell <nathan@acm.org>
245
4086ef7d
NS
246 * pt.c (tsubst_baselink): Fix & clarify formatting.
247
e249fcad
NS
248 * cp-tree.h (build_this_parm, cp_build_parm_decl,
249 build_artificial_parm): Add FN parm.
250 * decl.c (start_cleanup_fn): Adjust.
251 (build_this_parm): Add FN parm, pass it through.
252 (grokfndecl): Adjust parm building.
253 * decl2.c (cp_build_parm_decl): Add FN parm, set context.
254 (build_artificial_parm): Add FN parm, pass through.
255 (maybe_retrofit_in_chrg): Adjust parm building.
256 (start_static_storage_duration_function): Likwise.
257 * lambda.c (maybe_aadd_lambda_conv_op): Likewise.
258 * method.c (implicitly_declare_fn): Likewise.
259 * parser.c (inject_this_parameter): Likewise.
260
d7b11178
NS
261 Symbol tables are insert only.
262 * cp-tree.h (default_hash_traits <lang_identifier *>): Don't
263 derive from pointer_hash. Make undeletable.
264
ba27a39d
NS
265 * class.c (resort_type_method_vec): Avoid potential unsigned
266 overflow.
267
0d1dc586
NS
268 Don't defer noexcept_deferred_spec.
269 * cp-tree.h (unevaluated_noexcept_spec): Don't declare.
270 * decl.c (cxx_init_decl_processing): Initialize
271 noexcept_deferred_spec.
272 * except.c (unevaluated_noexcept_spec): Delete.
273 * class.c (deduce_noexcept_on_destructor): Use
274 noexcept_deferred_spec directly.
275 * method.c (implicitly_declare_fn): Likewise.
276
277 Make keyed_classes a vector.
278 * cp-tree.h (CPTI_KEYED_CLASSES, keyed_classes): Delete.
279 (keyed_classes): Declare as vector.
280 * decl.c (keyed_classes): Define.
281 (cxx_init_decl_processing): Allocate it.
282 (record_key_method_defined): Use vec_safe_push.
283 * class.c (finish_struct_1): Likewise.
284 * pt.c (instantiate_class_template_1): Likewise.
285 * decl2.c (c_parse_final_cleanups): Reverse iterate keyed_classes.
286
ac9a1c7e
NS
287 Make rtti lazier
288 * rtti.c (enum tinfo_kind): Add TK_DERIVED_TYPES,
289 TK_VMI_CLASS_TYPES, TK_MAX. Delete TK_FIXED.
290 (tinfo_names): New.
291 (typeid_ok_p): Add quotes to error messages. Use get_tinfo_desc.
292 (get_tinfo_decl): Use get_tinfo_desc.
293 (get_pseudo_ti_init): Likewise. Adjust VMI construction.
294 (create_pseudo_type_info): Delete.
295 (get_pseudo_ti_index): Just determine the index.
296 (get_tinfo_desc): New. Create all types lazily.
297 (create_tinfo_types): Just allocate the descriptor array.
298 (emit_support_tinfos): Use non-inserting type lookup. Set builtin
299 location.
300
c3684b7b
MS
3012017-06-15 Martin Sebor <msebor@redhat.com>
302
303 PR c++/80560
304 * call.c (first_non_public_field, maybe_warn_class_memaccess): New
305 functions.
306 (has_trivial_copy_assign_p, has_trivial_copy_p): Ditto.
307 (build_cxx_call): Call maybe_warn_class_memaccess.
308
c74985e3
JJ
3092017-06-14 Jakub Jelinek <jakub@redhat.com>
310
311 * cp-gimplify.c (cp_genericize_r): Turn most of the function
312 into a switch (TREE_CODE (stmt)) statement from long else if
313 sequence.
314
c60dc053
JJ
3152017-06-13 Jakub Jelinek <jakub@redhat.com>
316
f31a8339
JJ
317 PR c++/80973
318 * cp-gimplify.c (cp_genericize_r): Don't instrument MEM_REF second
319 argument even if it has REFERENCE_TYPE.
320
c60dc053
JJ
321 PR c++/80984
322 * cp-gimplify.c (cp_genericize): Only look for VAR_DECLs in
323 BLOCK_VARS (outer) chain.
324 (cxx_omp_const_qual_no_mutable): Likewise.
325
45b2222a
ML
3262017-06-13 Martin Liska <mliska@suse.cz>
327
328 PR sanitize/78204
329 * class.c (build_base_path): Use sanitize_flags_p.
330 * cp-gimplify.c (cp_genericize_r): Likewise.
331 (cp_genericize_tree): Likewise.
332 (cp_genericize): Likewise.
333 * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
334 * decl.c (compute_array_index_type): Likewise.
335 (start_preparsed_function): Likewise.
336 * decl2.c (one_static_initialization_or_destruction): Likewise.
337 * init.c (finish_length_check): Likewise.
338 * lambda.c (maybe_add_lambda_conv_op): Likewise.
339 * typeck.c (cp_build_binary_op): Likewise.
340 (build_static_cast_1): Likewise.
341
a01f151f
JM
3422017-06-11 Jason Merrill <jason@redhat.com>
343
c3b0f4c6
JM
344 * error.c (dump_expr): Use is_this_parameter.
345
a01f151f
JM
346 * cp-tree.h, decl2.c, mangle.c, parser.c, pt.c, semantics.c: Use
347 id_equal.
348
948d0d91
JM
3492017-06-09 Jason Merrill <jason@redhat.com>
350
e6d7d618
JM
351 Missing bits from N4268, constant evaluation for all non-type args.
352 * call.c (build_converted_constant_expr): Rename from
353 build_integral_nontype_arg_conv, handle all types.
354 * pt.c (convert_nontype_argument): In C++17 call it for all types.
355 Move NOP stripping inside pointer case, don't strip ADDR_EXPR.
356 * cvt.c (strip_fnptr_conv): Also strip conversions to the same type.
357
8b8b203a
JM
358 Overhaul pointer-to-member conversion and template argument handling.
359 * call.c (standard_conversion): Avoid creating ck_pmem when the
360 class type is the same.
361 * cvt.c (can_convert_qual): Split from
362 perform_qualification_conversions.
363 * constexpr.c (cxx_eval_constant_expression): Check it.
364 * typeck.c (convert_ptrmem): Only cplus_expand_constant if
365 adjustment is necessary.
366 * pt.c (check_valid_ptrmem_cst_expr): Compare class types.
367 (convert_nontype_argument): Avoid redundant error.
368
bf31620c
JM
369 * call.c (convert_like_real): Remove "inner" parameter.
370 Don't replace a constant with its value.
371 * cp-gimplify.c (cp_fully_fold): Use cp_fold_rvalue.
372
c5d6c6d9
JM
373 * pt.c (convert_nontype_argument): Check NULLPTR_TYPE_P rather than
374 nullptr_node.
375
3d2e25a2
JM
376 * parser.c (cp_parser_constant_expression): Check
377 potential_rvalue_constant_expression after decay_conversion.
378 * pt.c (convert_nontype_argument): Don't require linkage in C++17.
379
55c5c0ad
JM
380 PR c++/80384 - ICE with dependent noexcept-specifier
381 * pt.c (dependent_type_p_r) [FUNCTION_TYPE]: Check for dependent
382 noexcept-specifier.
383
948d0d91
JM
384 * constexpr.c (potential_constant_expression_1): Allow 'this' capture.
385
cb59f689
JH
3862017-06-09 Jan Hubicka <hubicka@ucw.cz>
387
388 * class.c (build_vtbl_initializer): Mark dvirt_fn as cold.
389 * decl.c (cxx_init_decl_processing, push_throw_library_fn): Likewise.
390 (excpet.c): Mark terminate as cold.
391
34361776
JJ
3922017-06-08 Jakub Jelinek <jakub@redhat.com>
393
8ab7005b
JJ
394 PR c/81006
395 * semantics.c (handle_omp_array_sections_1): Convert TYPE_MAX_VALUE
396 to sizetype before size_binop.
397
34361776
JJ
398 PR c++/81011
399 * cp-gimplify.c (cxx_omp_finish_clause): When changing clause
400 to OMP_CLAUSE_SHARED, also clear OMP_CLAUSE_SHARED_FIRSTPRIVATE
401 and OMP_CLAUSE_SHARED_READONLY flags.
402
e6026dc0
JH
4032017-06-08 Jan Hubicka <hubicka@ucw.cz>
404
405 * cp-tree.h (lang_check_failed): Annotate by ATTRIBUTE_COLD.
406
a6d31e84
NS
4072017-06-07 Nathan Sidwell <nathan@acm.org>
408
409 * class.c (layout_class_type): Restructure overlong-bitfield tpe
410 search.
411
83059741
JW
4122017-06-07 Jonathan Wakely <jwakely@redhat.com>
413
414 PR c++/80990
415 * pt.c (do_class_deduction): Build qualified type.
416
25d446fd
NS
4172017-06-06 Nathan Sidwell <nathan@acm.org>
418
25396db9
NS
419 * name-lookup.c (suggest_alternatives_for): Use qualified lookup
420 sans using directives. Don't walk into inline namespaces.
421
25d446fd
NS
422 PR c++/80979
423 * name-lookup.c (adl_class_only): Don't add visible friends.
424
2f20e7db
VR
4252017-06-05 Volker Reichelt <v.reichelt@netcologne.de>
426
427 * parser.c (cp_parser_base_specifier): Fix typos in error messages.
428
c957e9c0
NS
4292017-06-02 Nathan Sidwell <nathan@acm.org>
430
fb3a2657
NS
431 Remove lang_type_ptrmem.
432 * cp-tree.h (lang_type_header): Remove is_lang_type_class. Move
433 into ...
434 (lang_type_class): ... this. Reorder bitfields. Rename to ...
435 (lang_type): ... this. Delete old definition.
436 (lang_type_ptrmem): Delete.
437 (LANG_TYPE_CLASS_CHECK): Simply get TYPE_LANG_SPECIFIC. Adjust uses.
438 (LANG_TYPE_PTRMEM_CHECK): Delete.
439 (TYPE_GET_PTRMEMFUNC_TYPE, TYPE_SET_PTRMEMFUNC_TYPE): Delete.
440 (TYPE_PTRMEMFUNC_TYPE): New. Use TYPE_LANG_SLOT_1.
441 * decl.c (build_ptrmemfunc_type): Adjust.
442 * lex.c (copy_lang_type): Remove lang_type_ptrmem handling.
443 (maybe_add_lang_type_raw): Don't set u.c.h.is_lang_type_class.
444
445 * class.c (check_bases_and_members): Adjust vec_new_uses_cookie
446 setting.
447
448 Remove cp_binding_level::namespaces
c957e9c0
NS
449 * name-lookup.h (cp_binding_level): Lose namespaces field.
450 * name-lookup.c (add_decl_to_level): Chain namespaces on the names
451 list.
452 (suggest_alternatives_for): Adjust for namespace list. Do
453 breadth-first search.
454 * decl2.c (collect_source_refs): Namespaces are on the regulr
455 list.
456 (collect_ada_namespace): Likewise.
457
40ffd95f
BE
4582017-06-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
459
460 * typeck.c (cp_build_binary_op): Implement the -Wsizeof_pointer_div
461 warning.
462
e257141f
VV
4632017-06-01 Ville Voutilainen <ville.voutilainen@gmail.com>
464
465 PR c++/80812
466 * method.c (constructible_expr): Strip array types before calling
467 build_value_init.
468
ac853c90
PC
4692017-06-01 Paolo Carlini <paolo.carlini@oracle.com>
470
471 PR c++/80896
472 * cvt.c (convert_to_void): Possibly call maybe_warn_nodiscard
473 for case INDIRECT_REF too in the main switch.
474
049a5d31
JM
4752017-05-31 Jason Merrill <jason@redhat.com>
476
477 PR c++/80840 - ICE with constexpr and reference
478 * pt.c (convert_nontype_argument): Don't test whether a decl is
479 value-dependent when binding to a reference.
480
91e920c9
NS
4812017-05-31 Nathan Sidwell <nathan@acm.org>
482
483 * cp-tree.h (lang_decl_slector): New enum.
484 (lang_decl_base): Make selector an enum. Drop decomposition_p
485 field.
486 (lang_decl): Use enum for discrimination.
487 (LANG_DECL_FN_CHECK, LANG_DECL_NS_CHECK, LANG_DECL_PARM_CHECK,
488 LANG_DECL_DEOMP_CHECK): Use enum.
489 (DECL_DECOMPOSITION_P): Use selector value.
490 (SET_DECL_DECOMPOSITION_P): Delete.
491 (retrofit_lang_decl): Lose SEL parm.
492 (fit_decomposition_lang_decl): Declare.
493 * decl.c (cp_finish_decomp, grokdeclarator): Use
494 fit_decomposition_lang_decl.
495 * lex.c (maybe_add_lang_decl_raw): New. Broken out of
496 retrofit_lang_decl.
497 (set_decl_linkage): New. Broken out of retrofit_lang_decl. Use enum.
498 (fit_decomposition_lang_decl): Likewise.
499 (retrofit_lang_decl): Use worker functions.
500 (cxx_dup_lang_specific_decl): Use selector enum.
501 (maybe_add_lang_type_raw): New. Broken out of ...
502 (cxx_make_type_name): ... here. Call it.
503
3c1f5a3a
JM
5042017-05-30 Jason Merrill <jason@redhat.com>
505
506 PR c++/80856 - ICE with local extern in template
507 * semantics.c (finish_call_expr): Replace a local extern overload
508 set in a template with the IDENTIFIER_NODE.
509
f012c8ef
DM
5102017-05-30 David Malcolm <dmalcolm@redhat.com>
511
512 * call.c (perform_implicit_conversion_flags): Convert
513 "from %qT to %qT" to "from %qH to %qI" in diagnostic.
514 (print_conversion_rejection): Replace pairs of %qT with
515 %qH and %qI in various places.
516 (build_user_type_conversion_1): Likewise.
517 (build_integral_nontype_arg_conv): Likewise.
518 (build_conditional_expr_1): Likewise.
519 (convert_like_real): Likewise.
520 (convert_arg_to_ellipsis): Likewise.
521 (joust): Likewise.
522 (initialize_reference): Likewise.
523 * cvt.c (cp_convert_to_pointer): Likewise.
524 (cp_convert_to_pointer): Likewise.
525 (convert_to_reference): Likewise.
526 (ocp_convert): Likewise.
527 * error.c (cp_printer): Gain bool and const char ** parameters.
528 (struct deferred_printed_type): New struct.
529 (class cxx_format_postprocessor): New class.
530 (cxx_initialize_diagnostics): Wire up a cxx_format_postprocessor
531 to pp->m_format_postprocessor.
532 (comparable_template_types_p): New function.
533 (newline_and_indent): New function.
534 (arg_to_string): New function.
535 (print_nonequal_arg): New function.
536 (print_template_differences): New function.
537 (type_to_string_with_compare): New function.
538 (print_template_tree_comparison): New function.
539 (append_formatted_chunk): New function.
540 (add_quotes): New function.
541 (cxx_format_postprocessor::handle): New function.
542 (defer_phase_2_of_type_diff): New function.
543 (cp_printer): Add "quoted" and "buffer_ptr" params. Implement
544 %H and %I.
545 * typeck.c (cp_build_binary_op): Replace pairs of %qT with
546 %qH and %qI in various places.
547 (convert_member_func_to_ptr): Likewise.
548 (build_reinterpret_cast_1): Likewise.
549 (convert_for_assignment): Likewise.
550 * typeck2.c (check_narrowing): Likewise.
551
e2f35333
NS
5522017-05-30 Nathan Sidwell <nathan@acm.org>
553
98c28dd4
NS
554 Kill IDENTIFIER_NAMESPACE_BINDINGS
555 * cp-tree.h (lang_identifier): Delete namespace_bindings.
556 (IDENTIFIER_NAMESPACE_BINDINGS): Delete.
557 (lang_decl_ns): Add bindings.
558 (DECL_NAMESPACE_BINDINGS): New.
559 * lex.c (retrofit_lang_decl): Create namespace hash table.
560 * name-lookup.c (find_namespace_slot): Change to use hash-map.
561 * ptree.c (cxx_print_binding): Delete.
562 (cxx_print_identifier): Remove NAMESPACE_BINDING printing.
563
5256a7f5
NS
564 * cp-tree.def (OVERLOAD): Fix comment.
565 * cp-tree.h: Fix comments and whitespace.
566 * error.c (dump_decl): Use pp_cxx_colon_colon, ovl_scope.
567 * name-lookup.c (add_decl_to_level): Assert not class.
568 (check_local_shadow): Use OVL_P.
569 (pushdecl_with_scope_1): Rename to ...
570 (do_pushdecl_with_Scope): ... here.
571 (do_nonmember_using_decl): Use qualified_namespace_lookup return
572 value.
573 (push_class_level_binding_1): Use OVL_P.
574 (pushdecl_namespace_level): Use do_pushdecl_with_scope.
575 (pushtag_1): Rename to ...
576 (do_pushtag): ... here. Adjust do_pushdecl_with_scope call.
577 (pushtag): Adjust.
578 (store_class_bindings): Do not time here.
579 * name-lookup.h (pushdecl_outermost_localscope): Reorder.
580 * pt.c (listify): Declare argvec at point of initialization.
581
e2f35333
NS
582 PR c++/80913
583 * name-lookup.c (add_decl_to_level): Assert not making a circular
584 chain.
585 (update_binding): Don't prematurely slide artificial decl.
586
b904faa0
AO
5872017-05-29 Alexandre Oliva <aoliva@redhat.com>
588
589 * cp-tree.h (lang_identifier): Drop oracle_looked_up, unused.
590
58dec010
NS
5912017-05-29 Nathan Sidwell <nathan@acm.org>
592
3d7ff728
NS
593 PR c++/80891 (#1,#5)
594 * cp-tree.h (lookup_maybe_add): Add DEDUPING argument.
595 * name-lookup.c (name_lookup): Add deduping field.
596 (name_lookup::preserve_state, name_lookup::restore_state): Deal
597 with deduping.
598 (name_lookup::add_overload): New.
599 (name_lookup::add_value, name_lookup::add_fns): Call add_overload.
600 (name_lookup::search_adl): Set deduping. Don't unmark here.
601 * pt.c (most_specialized_instantiation): Revert previous change,
602 Assert not given duplicates.
603 * tree.c (lookup_mark): Just mark the underlying decls.
604 (lookup_maybe_add): Dedup using marked decls.
605
a5cfa13a
NS
606 PR c++/80891 (#4)
607 * ptree.c (cxx_print_xnode): Show internal OVERLOAD structure.
608 * tree.c (ovl_insert, ovl_iterator_remove_node): Fix copying assert.
609
3c9cca88
NS
610 Stat hack representation
611 * name-lookup.c (STAT_HACK_P, STAT_TYPE, STAT_DECL,
612 MAYBE_STAT_DECL, MAYBE_STAT_TYPE): New.
613 (stat_hack): New.
614 (find_namespace_binding): Replace with ...
615 (find_namespace_slot): ... this.
616 (find_namespace_value): New.
617 (name_lookup::search_namespace_only,
618 name_lookup::adl_namespace_only): Adjust.
619 (update_binding): Add SLOT parameter, adjust.
620 (check_local_shadow): Use find_namespace_value.
621 (set_local_extern_decl_linkage): Likewise.
622 (do_pushdecl): Adjust for namespace slot.
623 (push_local_binding): Assert not a namespace binding.
624 (check_for_out_of_scope_variable): Use find_namespace_value.
625 (set_identifier_type_value_with_scope): Likewise.
626 (get_namespace_binding): Likewise.
627 (set_namespace_binding): Delete.
628 (set_global_binding): Directly update the binding.
629 (finish_namespace_using_decl): Likewise.
630 (lookup_type_scope_1): Use find_namespace_slot and update.
631 (do_push_nested_namespace): Use find_namespace_value.
632
e514ab0c
NS
633 PR c++/80891 (#1)
634 * pt.c (most_specialized_instantiation): Cope with duplicate
635 instantiations.
636
58dec010
NS
637 PR c++/80891 (#3)
638 * cp-tree.h (build_min_nt_call_vec): Declare.
639 * decl.c (build_offset_ref_call_from_tree): Call it.
640 * parser.c (cp_parser_postfix_expression): Likewise.
641 * pt.c (tsubst_copy_and_build): Likewise.
642 * semantics.c (finish_call_expr): Likewise.
643 * tree.c (build_min_nt_loc): Keep unresolved lookups.
644 (build_min): Likewise.
645 (build_min_non_dep): Likewise.
646 (build_min_non_dep_call_vec): Likewise.
647 (build_min_nt_call_vec): New.
b67b23f0 648
724e517a
NS
649 PR c++/80891 (#2)
650 * tree.c (ovl_copy): Adjust assert, copy OVL_LOOKUP.
651 (ovl_used): New.
652 (lookup_keep): Call it.
653
58dec010
NS
6542017-05-26 Nathan Sidwell <nathan@acm.org>
655
945bf9e1
NS
656 Implement DR2061
657 * name-lookup.c (push_inline_namespaces): New.
658 (push_namespace): Look inside inline namespaces.
659
3c9feefc
NS
660 Inline and using namespace representation change.
661 * cp-tree.h (struct lang_decl_ns): Delete ns_using. Add usings,
662 inlinees as vector.
663 (DECL_NAMESPACE_USING): Adjust.
664 (DECL_NAMESPACE_INLINEES): New.
665 * name-lookup.h (struct cp_binding_level): Change usings
666 representation.
667 * name-lookup.c (name_lookup::do_queue_usings,
668 name_lookup::queue_usings): Adjust.
669 (name_lookup::search_namespace, name_lookup::search_usings,
670 name_lookup::queue_namespace): Adjust.
671 (name_lookup::adl_namespace_only): Adjust.
672 (add_using_namespace, push_namespace): Push onto vector.
673 (pop_namespace): Add timing logic.
674
e1cad930
NS
675 * call.c (build_operator_new_call): Do namelookup and ADL here.
676 (build_new_op_1): Likewise.
677 * name-lookup.h (lookup_function_nonclass): Delete declaration.
678 (do_using_directive): Likewise.
679 * name-lookup.c (set_namespace_binding, push_local_binding): Don't
680 declare early.
681 (struct scope_binding): Delete.
682 (EMPTY_SCOPE_BINDING): Delete.
683 (set_decl_namespace): Use OVL_P.
684 (finish_local_using_decl): Lose unnecesary checks.
685 (lookup_function_nonclass): Delete.
686 (cp_emit_debug_info_for_using): Use MAYBE_BASELINK_P.
687
32196b87
NS
688 * cp-tree.h (OVL_CHAIN): Check looking at OVERLOAD.
689 (ovl_iterator): Add allow_inner field. Adjust ctor. Make
690 unduplicatable.
691 (ovl_iterator::maybe_push, ovl_iterator::pop): New.
692 (lkp_iterator): Add outer field. Adjust ctor.
693 (lkp_iterator::operator++): New.
694 (lookup_mark, lookup_maybe_add): Declare.
695 * name-lookup.c (name_lookup): Delete fn_set member.
696 (name_lookup::preserve_state, name_lookup::restore_state): Unmark
697 and mark lookup.
698 (name_lookup::add_value): Use lookup_add directly.
699 (name_lookup::add_fns: Use lookup_maybe_add.
700 (name_lookup::search_adl): Mark and unmark fns.
701 (pushdecl): Adjust.
702 * pt.c (check_explicit_specialization): Use lookup_add directly.
703 * ptree.c (cxx_print_xnode): Show complete overload structure.
704 * tree.c (lookup_mark, lookup_maybe_add): New.
705
b67b23f0
NS
706 * name-lookup.c (name_lookup::search_adl): ADL OMP UDR type args.
707
6fc9f7aa
JJ
7082017-05-26 Jakub Jelinek <jakub@redhat.com>
709
710 * cp-tree.h (struct lang_decl_decomp): New type.
711 (struct lang_decl): Add u.decomp.
712 (LANG_DECL_DECOMP_CHECK): Define.
713 (DECL_DECOMPOSITION_P): Note it is set also on the vars
714 for user identifiers.
715 (DECL_DECOMP_BASE): Define.
716 (retrofit_lang_decl): Add extra int = 0 argument.
717 * lex.c (retrofit_lang_decl): Add SEL argument, if non-zero
718 use it to influence the selector choices and for selector
719 0 to non-zero transition copy old content.
720 (cxx_dup_lang_specific_decl): Handle DECL_DECOMPOSITION_P.
721 * decl.c (poplevel): For DECL_DECOMPOSITION_P, check
722 !DECL_DECOMP_BASE instead of !DECL_VALUE_EXPR. Adjust warning
723 wording if decl is a structured binding.
724 (cp_finish_decomp): Pass 4 as the new argument to retrofit_lang_decl.
725 Set DECL_DECOMP_BASE. Ignore DECL_READ_P sets from initialization
726 of individual variables for tuple structured bindings.
727 (grokdeclarator): Pass 4 as the new argument to retrofit_lang_decl.
728 Clear DECL_DECOMP_BASE.
729 * decl2.c (mark_used): Mark DECL_DECOMP_BASE TREE_USED as well.
730 * pt.c (tsubst_decomp_names): Assert DECL_DECOMP_BASE matches what
731 is expected.
732 * expr.c (mark_exp_read): Recurse on DECL_DECOMP_BASE instead of
733 DECL_VALUE_EXPR.
734
0fa367aa
JM
7352017-05-25 Jason Merrill <jason@redhat.com>
736
737 PR c++/80605 - __is_standard_layout and zero-length array
738 * class.c (check_bases): Use DECL_FIELD_IS_BASE.
739
44e00a7a
NS
7402017-05-25 Nathan Sidwell <nathan@acm.org>
741
87c976ae
NS
742 Kill OVL_CURRENT, OVL_NEXT.
743 * cp-tree.h (OVL_CURRENT, OVL_NEXT): Delete.
744 * name-lookup.c (set_decl_namespace): Use ovl_iterator.
745 (consider_binding_level): Use OVL_FIRST.
746 (cp_emit_debug_info_for_using): Use lkp_iterator.
747 * pt.c (check_explicit_specialization): Use ovl_iterator.
748
44e00a7a
NS
749 Kill DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS.
750 * cp-tree.h (lang_decl_ns): Remove ns_users field.
751 (DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS): Delete.
752 (TREE_INDIRECT_USING): Delete.
753 * name-lookup.h (is_associated_namespace): Delete.
754 * name-lookup.c (name_lookup::search_usings,
755 name_lookup::do_queue_usings): Usings are always direct.
756 (is_associated_namespace): Delete.
757 (handle_namespace_attrs): Use DECL_NAMESPACE_INLINE_P.
758 (namespace_ancestor_1, namespace_ancestor): Delete.
759 (push_using_directive_1, push_using_directive): Delete.
760 (add_using_namespace_1): Delete.
761 (add_using_namespace): Reimplement.
762 (emit_debug_info_using_namespace): New.
763 (finish_namespace_using_directive, finish_local_using_directive,
764 push_namespace): Adjust.
765 * tree.c (cp_free_lang_data): Remove DECL_NAMESPACE_USERS handling.
766
63dbcd13
VR
7672017-05-25 Volker Reichelt <v.reichelt@netcologne.de>
768
769 * semantics.c (finish_handler_parms): Warn about non-reference type
770 catch handlers.
771
f35a733d
NS
7722017-05-25 Nathan Sidwell <nathan@acm.org>
773
932f48ac
NS
774 Reimplement unqualified namespace lookup.
775 * name-lookup.c (name_lookup::using_pair,
776 name_lookup::using_queue): New typedefs.
777 (name_lookup::queue_namespace, name_lookup::do_queue_usings,
778 name_lookup::queue_usings): New.
779 (name_lookup::search_unqualified): New.
780 (merge_functions, same_entity_p, ambiguous_decl,
781 unqualified_namespace_lookup_1, unqualified_namespace_lookup,
782 lookup_using_namespace): Delete.
783 (lookup_name_real_1): Adjust.
784
9dda0ace
NS
785 Reimplement qualified namespace lookup.
786 * name-lookup.c (name_lookup::flags): New member. Adjust ctor.
787 (name_lookup::ambiguous, name_lookup::add_value,
788 name_lookup::add_type, name_lookup::process_binding): New.
789 (name_lookup::search_namespace_only,
790 name_lookup::search_namespace, name_lookup::search_usings): New.
791 (name_lookup::search_qualified): New.
792 (do_nonmember_using_decl, suggest_alternatives_for,
793 lookup_qualified_name): Adjust.
794 (tree_vec_contains): Delete.
795 (qualified_lookup_using_namespace): Rename to ...
796 (qualified_namespace_lookup): ... here. Reimplement.
797
798 Reimplement ADL.
f35a733d
NS
799 * cp-tree.h (LOOKUP_SEEN_P, LOOKUP_FOUND_P): New.
800 * name-lookup.h (lookup_arg_dependent): Return plain tree.
801 * name-lookup.c (arg_lookup, arg_assoc, arg_assoc_args,
802 arg_assoc_args_vec, arg_assoc_type, add_function,
803 arg_assoc_namespace, arg_assoc_class_only, arg_assoc_bases,
804 arg_assoc_class, arg_assoc_template_arg, arg_assoc,
805 lookup_arg_dependent_1): Delete.
806 (name_lookup): New lookup object.
807 (name_lookup::preserve_state, name_lookup::restore_state,
808 name_lookup::mark_seen, name_lookup::find_and_mark,
809 name_lookup::add_fns, name_lookup::adl_namespace_only,
810 name_lookup::adl_namespace, name_lookup::adl_class_only,
811 name_lookup::adl_bases, name_lookup::adl_class,
812 name_lookup::adl_expr, name_lookup::adl_type,
813 name_lookup::adl_template_arg, name_lookup::search_adl): New.
814 (lookup_arg_dependent): Return a plain tree. Adjust.
815 (is_associated_namespace): Move later.
816
d48b9bbe
NS
8172017-05-24 Nathan Sidwell <nathan@acm.org>
818
5ad4f1c8
NS
819 * friend.c (do_friend): Remove check for existing decl.
820 * name-lookup.h (lookup_name_innermost_nonclass_level): Delete.
821 * name-lookup.c (push_local_binding): Directly look for binding.
822 (lookup_name_innermost_nonclass_level_1): Delete.
823 (lookup_name_innermost_nonclass_level): Delete.
824
6cdb26f2
NS
825 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Alphabetize.
826
d48b9bbe
NS
827 * cp-tree.h (cp_free_lang_data): Add extern.
828 (ovl_skip_hidden, is_overloaded_fn, really_overloaded_fn): Add
829 ATTRIBUTE_PURE.
830 (type_unknown_p): Return bool, make inline, lose TREE_LIST check.
831 * typeck.c (type_unknown_p): Delete.
832 * tree.c (is_overloaded_fn): Use MAYBE_BASELINE_FUNCTIONS, adjust
833 overload management.
834 (dependent_name): Likewise.
835 (decl_anon_ns_mem_p): Simplify.
836
d4a760d8
JW
8372017-05-24 Jonathan Wakely <jwakely@redhat.com>
838
839 PR c++/80544
840 * tree.c (reshape_init): Use unqualified type for direct enum init.
841 * typeck.c (maybe_warn_about_cast_ignoring_quals): New.
842 (build_static_cast_1, build_reinterpret_cast_1): Strip cv-quals from
843 non-class destination types.
844 (build_const_cast_1): Strip cv-quals from destination types.
845 (build_static_cast, build_reinterpret_cast, build_const_cast)
846 (cp_build_c_cast): Add calls to maybe_warn_about_cast_ignoring_quals.
847
3cd211af
MS
8482017-05-24 Martin Sebor <msebor@redhat.com>
849
850 PR c/80731
851 * call.c (fully_fold_internal): Adjust.
852
ef4c5e78
NS
8532017-05-24 Nathan Sidwell <nathan@acm.org>
854
c0edbb32
NS
855 * cp-tree.h (ovl_skip_hidden): Declare.
856 * tree.c (ovl_skip_hidden): New.
857 * name-lookup.c (arg_assoc_namespace): Call ovl_skip_hidden.
858 (lookup_arg_dependent_1): Likewise.
859 (ambiguous_decl): Use DECL_HIDDEN_P, ovl_skip_hidden.
860 (hidden_name_p, remove_hidden_names): Delete.
861 (lookup_name_real_1): Do not strip hidden names.
862 * name-lookup.h (hidden_name_p, remove_hidden_names): Delete.
863
ef4c5e78
NS
864 * cp-tree.h (OVL_HIDDEN_P): New.
865 (ovl_iterator::hidden_p, ovl_iterator::reveal_node): New.
866 (ovl_iterator::reveal_node): Declare.
867 * tree.c (ovl_copy): Copy OVL_HIDDEN_P.
868 (ovl_insert): Order on hiddenness.
869 (ovl_iterator::reveal_node): New.
870 * name-lookup.c (anticipated_builtin_p): New.
871 (supplement_binding_1): Use it.
872 (set_local_extern_decl_linkage): Use hidden_p.
873 (do_pushdecl): Deal with unhiding a hidden decl, use
874 anticipated_builtin_p.
875 (do_nonmember_using_decl): Use anticipated_decl_p.
876 (lookup_name_real_1): Use DECL_HIDDEN_P.
877
5726acd7
JM
8782017-05-23 Jason Merrill <jason@redhat.com>
879
880 -Wunused and C++17 structured bindings
881 * decl.c (poplevel): Don't warn about unused structured bindings,
882 only real variables.
883 * error.c (dump_simple_decl): Handle structured bindings.
884 * expr.c (mark_exp_read): Look through DECL_VALUE_EXPR.
885
3a9cc685
NS
8862017-05-23 Nathan Sidwell <nathan@acm.org>
887
888 * cp-tree.h (PUSH_GLOBAL, PUSH_LOCAL, PUSH_USING): Delete.
889 * name-lookup.c (create_local_binding): New.
890 (update_binding): New.
891 (pushdecl_maybe_friend_1): Rename to ...
892 (do_pushdecl): ... this. Reimplement.
893 (pushdecl): Adjust.
894 (push_overloaded_decl_1, push_overloaded_decl): Delete.
895
f0c1ade4
JM
8962017-05-23 Jason Merrill <jason@redhat.com>
897
898 PR c++/80396 - built-in for make_integer_sequence.
899 * pt.c (builtin_pack_fn_p, builtin_pack_call_p)
900 (expand_integer_pack, expand_builtin_pack_call): New.
901 (find_parameter_packs_r): Check builtin_pack_call_p.
902 (check_for_bare_parameter_packs): Handle it.
903 (tsubst_pack_expansion): Call expand_builtin_pack_call.
904 (declare_integer_pack): New.
905 (init_template_processing): Call it.
906 * decl2.c (mark_used): Check builtin_pack_fn_p.
907
e4ea7a4c
NS
9082017-05-23 Nathan Sidwell <nathan@acm.org>
909
aa7bda5f
NS
910 * name-lookup.c (find_namespace_binding): New.
911 (pushdecl_maybe_friend_1): Use CP_DECL_CONTEXT.
912 (set_identifier_type_value_with_scope): Use find_namespace_binding.
913 (find_binding, cp_binding_level_find_binding_for_name,
914 binding_for_name, namespace_binding_1): Delete.
915 (push_overloaded_decl_1): Use CP_DECL_CONTEXT.
916 (get_namespace_binding, set_namespace_binding,
917 finish_namespace_using_decl, unqualified_namespace_lookup_1,
918 qualified_lookup_using_namespace, lookup_type_scope_1,
919 lookup_name_innermost_nonclass_level_1): Use find_namespace_binding.
920
6131102c
NS
921 PR c++/80866
922 * parser.c (cp_parser_template_id): Keep the lookup when stashing
923 the template_id.
924
e4ea7a4c
NS
925 * cp-tree.h (DECL_HIDDEN_P): New.
926 * name-lookup.c (set_decl_context,
927 set_local_extern_decl_linkage): New, broken out of ...
928 (pushdecl_maybe_friend_1): ... here. Call them.
929
fd71a9a2
TS
9302017-05-23 Thomas Schwinge <thomas@codesourcery.com>
931
932 * parser.c (OACC_KERNELS_CLAUSE_MASK): Add
933 "PRAGMA_OACC_CLAUSE_NUM_GANGS", "PRAGMA_OACC_CLAUSE_NUM_WORKERS",
934 "VECTOR_LENGTH".
935
9d029ddf
NS
9362017-05-23 Nathan Sidwell <nathan@acm.org>
937
938 * cp-tree.h (OVL_P): New.
939 * name-lookup.h (push_local_binding): Delete.
940 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
941 (finish_namespace_using_decl, finish_local_using_decl): ... here
942 * name-lookup.c (add_decl_to_level): Swap args.
943 (pop_bindings_and_leave_scope): Look inside TREE_LIST.
944 (diagnose_name_conflict): Check contexts are same for redecl.
945 (update_local_overload): New.
946 (compparms_for_decl_and_using): Rename to ...
947 (matching_fn_p): ... here.
948 (pushdecl_maybe_friend_1): Adjust add_decl_to_level,
949 push_local_bindings call.
950 (push_local_binding): Make static, replace FLAGS arg with
951 IS_USING.
952 (validate_nonmember_using_decl): Use OVL_FIRST.
953 (do_nonmember_using_decl): Use in/out parameters. Use
954 lkp_iterator and simplify.
955 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
956 (finish_namespace_using_decl, finish_local_using_decl): ... here.
957 Adjust.
958 (lookup_type_current_level): Delete.
959 * parser.c (cp_parser_using_declaration): Adjust.
960 * pt.c (tsubst_expr): Adjust.
961
c405923d
NS
9622017-05-22 Nathan Sidwell <nathan@acm.org>
963
65cc1407
NS
964 * name-lookup.h (parse_using_directive): Replace with ...
965 (finish_namespace_using_directive): ... this and ...
966 (finish_local_using_directive): ... this.
967 * name-lookup.c (add_using_namespace_1): Move later.
968 (add_using_namespace): Move later, add namespace_p arg, remove
969 indirect arg.
970 (push_using_directive_1): Directly recurse.
971 (do_using_directive, parse_using_directive): Delete, split into ...
972 (finish_namespace_using_directive): ... this and ...
973 (finish_local_using_directive): ... this.
974 (push_namespace): Use add_using_namespace.
975 * parser.c (cp_parser_using_directive): Call
976 finish_namespace_using_directive or finish_local_using_directive.
977 * pt.c (tsubst_expr): Call finish_local_using_directive.
978
58aca9d9
NS
979 * cp-objcp-common.c (cp_register_dumps): Register raw dumper.
980 * cp-tree.h (raw_dump_id): Declare.
981 * decl2.c (raw_dump_id): Define.
982 (dump_tu): Use raw_dump_id.
983
3b205ea1
NS
984 * config-lang.in (gtfiles): Sort list, break lines.
985
1a66d857
NS
986 * cp-tree.h (CPTI_TERMINATE, CPTI_CALL_UNEXPECTED): Rename to ...
987 (CPTI_TERMINATE_FN, CPTI_CALL_UNEXPECTED_FN): ... here.
988 ( CPTI_GET_EXCEPTION_PTR_FN, CPTI_BEGIN_CATCH_FN, CPTI_END_CATCH_FN,
989 CPTI_ALLOCATE_EXCEPTION_FN, CPTI_FREE_EXCEPTION_FN, CPTI_THROW_FN,
990 CPTI_RETHROW_FN): New.
991 (noexcept_deferred_spec): New.
992 (terminate_node, call_unexpected_node): Rename to ...
993 (terminate_fn, call_unexpected_fn): ... here.
994 (get_exception_ptr_fn, begin_catch_fn, end_catch_fn,
995 allocate_exception_fn, free_exception_fn, throw_fn, rethrow_fn): New.
996 * except.c (fn1..fn5, throw_fn, rethrow_rn, spec): Delete.
997 (init_exception_processing): Adjust.
998 (declare_library_fn): Create and push the fns here.
999 (do_get_exception_ptr, do_begin_catch, do_end_catch,
1000 do_allocate_exception_ptr, do_free_exception_ptr): Adjust
1001 declare_library_fn use.
1002 (unevaluated_noexcept_spec): Adjust.
1003 * cp-gimplify.c (genericize_eh_spec_block,
1004 gimplify_most_not_throw_expr): Adjust.
1005
c405923d
NS
1006 * name-lookup.c (pushdecl_top_level,
1007 pushdecl_top_level_and_finish): Move after namespace pushing and
1008 popping functions.
1009 (push_to_top_level): Rename to ...
1010 (do_push_to_top_level): ... here. Remove timing code.
1011 (pop_from_top_level_1): Rename to ...
1012 (do_pop_from_top_level): ... here.
1013 (do_push_nested_namespace, do_pop_nested_namespace)
1014 (push_to_top_level): New wrapper for do_push_to_top_level.
1015 (pop_from_top_level): Adjust.
1016 (push_nested_namepace, pop_nested_namespace): Wrappers for workers.
1017
ff502317
BE
10182017-05-19 Bernd Edlinger <bernd.edlinger@hotmail.de>
1019
1020 * config-lang.in (gtfiles): Add c-family/c-format.c,
1021 except.c, init.c, lambda.c and friend.c.
1022 * class.c (dvirt_fn): Move out of function scope,
1023 add GTY attribute.
1024 * except.c (fn1-5, throw_fn, rethrow_fn, spec): Likewise.
1025 * init.c (fn): Likewise.
1026 * lambda.c (ptr_id, max_id): Likewise.
1027 * friend.c (global_friend): Add GTY attribute.
1028
6f2f4050
NS
10292017-05-19 Nathan Sidwell <nathan@acm.org>
1030
1031 * call.c (add_list_candidates): Use OVL_FIRST.
1032 (build_new_method_call_1): Likewise.
1033 * cp-tree.h (OVL_SINGLE_P): New.
1034 (TYPE_HIDDEN_P): New.
1035 * decl.c (xref_tag_1): Use TYPE_HIDDEN_P.
1036 * dump.c (cp_tump_tree): Adjust overload dumping.
1037 * error.c (dump_decl): Use OVL_SINGLE_P, simplify context
1038 printing.
1039 * method.c (lazily_declare_fn): Assert we added it.
1040 * parser.c (cp_parser_nested_name_specifier): Use OVL_SINGLE_P,
1041 OVL_FIRST.
1042 (cp_parser_template_name): Use lkp_iterator.
1043 * pt.c (begin_template_parm_list): Fixup comment.
1044 (instantiate_class_template_1): Use TYPE_HIDDEN_P.
1045 * tree.c (ovl_iterator::remove_node): Cope with inherited ctors.
1046 (ovl_scope): Use lkp_iterator.
1047
9740ed54
TS
10482017-05-19 Thomas Schwinge <thomas@codesourcery.com>
1049
7fd549d2
TS
1050 * parser.c (cp_parser_omp_clause_default): Handle
1051 "OMP_CLAUSE_DEFAULT_PRESENT".
1052
9740ed54
TS
1053 * parser.c (cp_parser_omp_clause_default): Avoid printing more
1054 than one syntax error message.
1055
2a8a8d7b
NS
10562017-05-19 Nathan Sidwell <nathan@acm.org>
1057
1058 * class.c (class_dump_id): Define.
1059 (dump_class_hierarchy, dump_vtable, dump_vtt): Use it.
1060 * cp-objcp-common.c (cp_register_dumps): New.
1061 * cp-objcp-common.h (cp_register_dumps): Declare.
1062 (LANG_HOOKS_REGISTER_DUMPS): Override.
1063 * cp-tree.h (class_dump_id): Declare.
1064
59a4ede9
NS
10652017-05-18 Nathan Sidwell <nathan@acm.org>
1066
1bf07cc3
NS
1067 * cp-tree.h (OVL_ARG_DEPENDENT): Delete.
1068 (OVL_USED_P): New.
1069 (lookup_keep): Declare.
1070 * name-lookup.c (add_function): Don't set OVL_ARG_DEPENDENT.
1071 * pt.c (tsubst_copy): Assert lookup is persistent.
1072 * semantics.c (finish_call_expr): Use lkp_iterator, call
1073 lookup_keep.
1074 * tree.c (ovl_copy): New.
1075 (ovl_insert, ovl_iterator::remove_node): Copy immutable nodes.
1076 (lookup_keep): New.
1077
2063b07f
NS
1078 * cp-tree.h (OVL_USED): Replace with ...
1079 (OVL_USING_P): ... this.
1080 (ovl_iterator::using_p): Adjust.
1081 * name-lookup.c (push_overloaded_decl_1,
1082 do_nonmember_using_decl): Adjust.
1083 * search.c (lookup_field_r): Adjust.
1084 * tree.c (ovl_insert, ovl_scope): Adjust.
1085
31ab89c1
NS
1086 * cp-tree.h (lookup_add): Swap args.
1087 (ovl_cons, build_overload): Delete.
1088 * name-lookup.c (add_function, push_overloaded_decl_1,
1089 do_nonmember_using_decl, merge_functions, remove_hidden_names):
1090 Use lookup_add, ovl_insert.
1091 * pt.c (check_explicit_specialization): Use lookup_add.
1092 (do_class_deduction): Likewise. Refactor if.
1093 * tree.c (lookup_add): Swap args.
1094 (ovl_cons, build_overload): Delete.
1095
59a4ede9
NS
1096 * name-lookup.c (find_local_binding): New, broken out of ...
1097 (lookup_name_innermost_nonclass_level_1): ... here. Call it.
1098 (set_namespace_binding): Swap scope & name args.
1099 (namespace_binding_1): Likewise.
1100 (pushdecl_maybe_friend_1): Adjust set_namespace_binding call.
1101 (push_overloaded_decl_1): Likewise.
1102 (set_global_binding): Likewise.
1103 (get_namespace_binding): Adjust namespace_binding_1 call.
1104
539f481a
NS
11052017-05-17 Nathan Sidwell <nathan@acm.org>
1106
1107 * cp-tree.h (default_hash_traits <lang_identifier *>): New
1108 specialization.
1109 * name-lookup.c (lookup_extern_c_fun_in_all_ns): Delete.
1110 (extern_c_fns): New hash table.
1111 (check_extern_c_conflict): New, broken out of ...
1112 (pushdecl_maybe_friend_1): ... here. Call it.
1113 (c_linkage_bindings): Just look in hash table.
1114
b42cc3ca
VV
11152017-05-17 Ville Voutilainen <ville.voutilainen@gmail.com>
1116
1117 PR c++/80654
1118 PR c++/80682
1119 Implement new C++ intrinsics __is_assignable and __is_constructible.
1120 * cp-tree.h (CPTK_IS_ASSIGNABLE, CPTK_IS_CONSTRUCTIBLE): New.
1121 (is_xible): New.
1122 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
1123 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
1124 * method.c (constructible_expr): Set cp_unevaluated.
1125 (is_xible_helper): New.
1126 (is_trivially_xible): Adjust.
1127 (is_xible): New.
1128 * parser.c (cp_parser_primary_expression): Handle
1129 RID_IS_ASSIGNABLE and RID_IS_CONSTRUCTIBLE.
1130 (cp_parser_trait_expr): Likewise.
1131 * semantics.c (trait_expr_value): Handle
1132 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
1133
19b476fb
NS
11342017-05-17 Nathan Sidwell <nathan@acm.org>
1135
36f4bc9c
NS
1136 * cp-tree.h (ovl_iterator::using_p): New predicate.
1137 (ovl_iterator::remove_node): New worker.
1138 (ovl_insert): Declare.
1139 * tree.c (ovl_insert): New.
1140 (ovl_iterator::remove_node): New.
1141 * class.c (add_method): Use ovl_iterator, ovl_insert.
1142 (clone_function_decl): Fix description.
1143 (clone_constructors_and_destructors): Use ovl_iterator.
1144
19b476fb
NS
1145 * class.c (handle_using_decl): Use OVL_FIRST, ovl_iterator.
1146 (maybe_warn_about_overly_private_class): Use ovl_iterator.
1147 (method_name_cmp, resort_method_name_cmp): Use OVL_NAME.
1148 (resort_type_method_vec, finish_struct_methods): Use OVL_FIRST.
1149 (get_base_fndecls): Use ovl_iterator.
1150 (warn_hidden): Use OVL_NAME, ovl_iterator.
1151 (add_implicitly_declared_members): Use ovl_iterator.
1152 * constraint.cc (normalize_template_id_expression): Use OVL_FIRST,
1153 flatten nested if.
1154 (finish_shorthand_constraint): Simplify, use ovl_make.
1155 * pt.c (make_constrained_auto): Simplify. Use ovl_make.
1156 * search.c (shared_member_p): Use ovl_iterator.
1157 (lookup_field_fuzzy_info::fuzzy_lookup_fn): Use OVL_NAME.
1158 (lookup_conversion_operator): Use OVL_FIRST.
1159 (lookup_fnfiels_idx_nolazy): Use OVL_FIRST, OVL_NAME.
1160 (look_for_overrides_here): Use ovl_iterator.
1161 (lookup_conversions_r): Use OVL_FIRST, OVL_NAME, ovl_iterator.
1162 * typeck.c (build_x_unary_op): Use ovl_make.
1163
1a817418
ML
11642017-05-17 Martin Liska <mliska@suse.cz>
1165
1166 * class.c (dump_class_hierarchy): Introduce dump_flags_t type and
1167 use it instead of int type.
1168 (dump_vtable): Likewise.
1169 (dump_vtt): Likewise.
1170 * decl2.c (dump_tu): Likewise.
1171
10791753
DM
11722017-05-16 David Malcolm <dmalcolm@redhat.com>
1173
1174 * call.c (enforce_access): Add access_failure_info * param and use
1175 it to record access failures.
1176 * cp-tree.h (class access_failure_info): New class.
1177 (enforce_access): Add access_failure_info * param, defaulting to
1178 NULL.
1179 (lookup_member): Likewise.
1180 (locate_field_accessor): New function decl.
1181 (perform_or_defer_access_check): Add access_failure_info * param,
1182 defaulting to NULL.
1183 * search.c (lookup_member): Add access_failure_info * param and
1184 pass it on to call to perform_or_defer_access_check.
1185 (matches_code_and_type_p): New function.
1186 (field_access_p): New function.
1187 (direct_accessor_p): New function.
1188 (reference_accessor_p): New function.
1189 (field_accessor_p): New function.
1190 (struct locate_field_data): New struct.
1191 (dfs_locate_field_accessor_pre): New function.
1192 (locate_field_accessor): New function.
1193 * semantics.c (perform_or_defer_access_check): Add
1194 access_failure_info * param, and pass it on to call to
1195 enforce_access.
1196 * typeck.c (access_failure_info::record_access_failure): New method.
1197 (access_failure_info::maybe_suggest_accessor): New method.
1198 (finish_class_member_access_expr): Pass an access_failure_info
1199 instance to the lookup_member call, and call its
1200 maybe_suggest_accessor method afterwards.
1201
6b6ae9eb
MP
12022017-05-16 Marek Polacek <polacek@redhat.com>
1203
1204 PR sanitizer/80536
1205 PR sanitizer/80386
1206 * cp-gimplify.c (cp_fold): Handle SAVE_EXPR.
1207
c20c3b42
NS
12082017-05-16 Nathan Sidwell <nathan@acm.org>
1209
c0c24822
NS
1210 * name-lookup.c (check_local_shadow): New, broke out of ...
1211 (pushdecl_maybe_friend_1): ... here. Call it.
1212
e09ae857
NS
1213 * cp-tree.h (OVL_NESTED_P, OVL_LOOKUP_P): New.
1214 (ovl_first): Move inline definition to end of file.
1215 (ovl_make, lookup_add): Declare.
1216 (get_fns, get_first_fn): Make pure.
1217 * tree.c (ovl_cache): New.
1218 (ovl_make, lookup_add): New.
1219 * pt.c (do_class_deduction): Don't add candidates that will be
1220 elided.
1221
a736411a 1222 * call.c (build_user_type_conversion_1): Use OVL_FIRST.
e09ae857 1223 (print_error_for_call_failure): Use OVL_NAME.
a736411a
NS
1224 (build_op_call_1): Use ovl_iterator.
1225 (add_candidates): Use OVL_FIRST & lkp_iterator.
1226 (build_op_delete_call): Use MAYBE_BASELINK_FUNCTIONS &
1227 lkp_iterator.
1228 * class.c (deduce_noexcept_on_destructors): Use ovl_iterator.
1229 (type_has_user_nondefault_constructor,
1230 in_class_defaulted_default_constructor,
1231 type_has_user_provided_constructor,
1232 type_has_user_provided_or_explicit_constructor,
1233 type_has_non_user_provided_default_constructor,
1234 vbase_has_user_provided_move_assign,
1235 type_has_move_constructor, type_has_move_assign,
1236 type_has_user_declared_move_constructor,
1237 type_has_user_declared_move_assign,
1238 type_build_ctor_call, type_build_dtor_call,
1239 type_requires_array_cookie, explain_non_literal_class): Likewise.
1240 (finish_struct): Use lkp_iterator.
1241 (resolve_address_of_overloaded_function): Use OVL_NAME, lkp_iterator.
1242 (note_name_declared_in_class): Use OVL_NAME.
1243 * cxx-pretty-print.c (pp_cxx_unqualified_id): Use OVL_FIRST.
1244 (pp_cxx_qualified_id, cxx_pretty_printer::id_expression,
1245 cxx_pretty_printer::expression): Likewise.
1246 * decl2.c (check_classfn): Use ovl_iterator.
1247 * pt.c (retrieve_specialization): Use ovl_iterator.
1248 * tree.c (cp_tree_equal): Use lkp_iterator.
1249 (type_has_nontrivial_copy_init): Use ovl_iterator.
1250
c20c3b42
NS
1251 * typeck2.c (cxx_incomplete_type_diagnostic): Revert change and
1252 check is_overloaded_fn.
1253
ef6cb4c7
ML
12542017-05-16 Martin Liska <mliska@suse.cz>
1255
1256 * parser.c (cp_lexer_print_token): Add default value for flags
1257 argument of print_gimple_stmt, print_gimple_expr,
1258 print_generic_stmt and print_generic_expr.
1259
322763f5
NS
12602017-05-16 Nathan Sidwell <nathan@acm.org>
1261
3f267553
NS
1262 * cp-tree.h (class ovl_iterator, class lkp_iterator): New OVERLOAD
1263 iterators.
1264 (MAYBE_BASELINK_FUNCTIONS): New.
1265 * constraint.cc (resolve_constraint_check): Use lkp_iterator.
1266 * decl2.c (maybe_warn_sized_delete): Use ovl_iterator.
1267 * lambda.c (maybe_generic_this_capture): Use lkp_iterator.
1268 * method.c (inherited_ctor_binfo): Use ovl_iterator.
1269 (binfo_inherited_from): Likewise.
1270 * parser.c (lookup_literal_operator): Use lkp_iterator.
1271 * pt.c (iterative_hash_template_arg): Use lkp_iterator.
1272 (print_candidates_1): Likewise.
1273 (determine_specialization): Likewise.
1274 (resolve_overloaded_unification): Likewise.
1275 (resolve_nondeduced_context): Likewise.
1276 (type_dependent_expression_p): Likewise.
1277 (dependent_template_p): Likewise.
1278 * ptree.c (cxx_print_xnode): Likewise.
1279 * semantics.c (omp_reduction_lookup): Use lkp_iterator.
1280 (classtype_has_nothrow_assign_or_copy_p): Use ovl_iterator.
1281 * typeck.c (check_template_keyword): Use lkp_iterator.
1282
848bf88d
NS
1283 * cp-tree.h (OVL_FIRST, OVL_NAME): New.
1284 (ovl_first): New.
1285 * constexpr.c (function_concept_check): Use OVL_FIRST.
1286 * cvt.c (build_expr_type_conversion): Likewise.
1287 * decl.c (poplevel, grokdeclarator): Use OVL_NAME.
1288 * decl2.c (mark_used): Use OVL_FIRST.
1289 * error.c (dump_decl): Use OVL_FIRST, OVL_NAME.
1290 (dump_expr, location_of): Use OVL_FIRST.
1291 * friend.c (do_friend): Use OVL_NAME.
1292 * init.c (build_offset_ref): Use OVL_FIRST.
1293 * mangle.c (write_member_name): Likewise.
1294 (write_expression): Use OVL_NAME.
1295 * method.c (strip_inheriting_ctors): Use OVL_FIRST.
1296 * name-lookup.c (pushdecl_class_level): Use OVL_NAME.
1297 * pt.c (check_explicit_specialization): Use OVL_FIRST.
1298 (check_template_shadow): Likewise.
1299 (tsubst_template_args): Use OVL_NAME.
1300 (tsubst_baselink): Use OVL_FIRST.
1301 * semantics.c (perform_koenig_lookup): Use OVL_NAME.
1302 * tree.c (get_first_fn): Use OVL_FIRST.
1303 * typeck.c (finish_class_member_access_expr): Use OVL_NAME.
1304 (cp_build_addr_expr_1): Use OVL_FIRST.
1305
1f0ed17c
NS
1306 * pt.c (tsubst_copy_and_build): Remove unnecessary COMPONENT_REF
1307 peeking.
1308 * semantics.c (finish_id_expression): Directly init local var.
1309 (finish_omp_reduction_clause): Use really_overloaded_fn.
1310 * tree.c (get_fns): Document. Assert we got an overload.
1311 (get_first_fn) Document.
1312 * typeck.c (cp_build_addr_expr_1): Pass arg directly to
1313 really_overloaded_fn.
c20c3b42 1314 * typeck2.c (cxx_incomplete_type_diagnostic): Use get_first_fn directly.
1f0ed17c 1315
322763f5
NS
1316 * cp-tree.h (SCOPE_DEPTH): New.
1317 * name-lookup.h (is_nested_namespace): Declare.
1318 * name-lookup.c (is_nested_namespace): New.
1319 (is_ancestor): Use it.
1320 (set_decl_namespace): Likewise.
1321 (push_namespace): Set SCOPE_DEPTH.
1322 * pt.c (check_specialization_namespace): Use is_nested_namespace.
1323 (check_unqualigied_spec_or_inst): Likewise.
1324
3a77e7cc
NS
13252017-05-15 Nathan Sidwell <nathan@acm.org>
1326
1327 PR c++/79369
1328 * cp-tree.h (DECL_NAMESPACE_INLINE_P): New.
1329 * name-lookup.h (push_namespace): Return int, add make_inline arg.
1330 * name-lookup.c (push_namespace): Deal with inline directly.
1331 Return pushed count.
1332 * parser.c (cp_parser_namespace_definition): Adjust for
1333 push_namespace change.
1334
9c82d7b6
NS
13352017-05-11 Nathan Sidwell <nathan@acm.org>
1336
505dd180
NS
1337 * cp-lang.c (get_global_decls, cxx_pushdecl, LANG_HOOK_GETDECLS,
1338 LANG_HOOKS_PUSHDECL): Move to ...
1339 * cp-objcp-common.c (cp_get_global_decls, cp_pushdec,
1340 LANG_HOOK_DECLS, LANG_HOOKS_PUSHDECL): ... here.
1341 * cp-objcp-common.h (cp_get_global_decls, cp_pushdecl): Declare.
1342
4f15a5da
NS
1343 * name-lookup.h (pushdecl): Add default friend parm.
1344 (pushdecl_maybe_friend): Delete.
1345 (pushdecl_top_level): Add default friend parm.
1346 (pushdecl_top_level_maybe_friend): Delete.
1347 * name-lookup.c (pushdecl_maybe_friend): Delete.
1348 (pushdecl): Add is_friend parm.
1349 (pushdecl_top_level): Add is friend_parm.
1350 (pushdecl_top_level_maybe_friend, pushdecl_top_level_1): Delete.
1351 (pushdecl_top_level_and_finish): Do pushing and finishing directly.
1352 * friend.c (do_friend): Adjust.
1353 * pt.c (tsubst_friend_class): Adjust.
1354
2e3757e7
NS
1355 Revert pushdecl_top_level_and_finish name change.
1356 * name-lookup.h (pushdecl_top_level_and_finish): Resurrect old name.
1357 * name-lookup.c (pushdecl_top_level_and_finish): Likewise.
1358 * decl.c (cp_make_fname_decl): Adjust.
1359 * decl2.c (get_guard, handle_tls_init): Adjust.
1360 * rtti.c (get_tinfo_decl, tinfo_base_init): Adjust.
1361
c8634a1a
NS
1362 * name-lookup.c (pushdecl_outermost_localscope): Always
1363 conditionally stop timer.
1364
c443f3d5
NS
1365 * decl.c (xref_tag_1): Don't frob ts_lambda scope here.
1366 * name-lookup.c (pushtag_1): Deal with ts_lambda scope.
1367
056a17ee
NS
1368 * cp-tree.h (pushdecl, pushdecl_maybe_friend, pushtag,
1369 pushtag_top_level_maybe_friend,
1370 pushdecl_top_level_and_finish): Move declarations to ...
1371 * name-lookup.h: ... here. Group pushdecl variants.
1372 (pushdecl_top_level_and_finish): Rename to ...
1373 (pushdecl_top_level_with_init): ... here.
1374 * decl.c (cp_make_fname_decl): Use pushdecl_top_level_with_init.
1375 * decl2.c (get_guard, handle_tls_init): Likewise.
1376 * rtti.c (get_tinfo_decl, tinfo_base_init): Likewise.
1377 * lambda.c (maybe_add_lambda_conv_op): Use namespace_bindings_p.
1378 * method.c (implicitly_declare_fn): Likewise.
1379 * searchc (node_debug_info_needed): Likewise.
1380 * name-lookup.c (pushdecl_top_level_and_finish): Rename to ...
1381 (pushdecl_top_level_with_init): ... here.
1382 (pop_everything): Use namespace_bindings_p.
1383
9c82d7b6
NS
1384 * name-lookup.h (pop_binding): Rename to pop_local_binding.
1385 (getdecls): Rename to get_local_decls.
1386 * name-lookup.c (pop_binding): Rename to ...
1387 (pop_local_binding): ... here.
1388 (pop_bindings_and_leave_scope): Adjust.
1389 (getdecls): Rename to ...
1390 (get_local_decls): ... here. Assert local scope.
1391 * decl.c (poplevel): Assert not namespace. Adjust and simplify
1392 logic.
1393 (store_parm_decls): Adjust get_local_decls call.
1394 (parser.c (synthesize_implicit_template_parm): Likewise.
1395
e81c8328
VV
13962017-05-11 Ville Voutilainen <ville.voutilainen@gmail.com>
1397
1398 PR c++/80682
1399 * method.c (is_trivially_xible): Reject void types.
1400
268de039
NS
14012017-05-10 Nathan Sidwell <nathan@acm.org>
1402
3aa0a770
NS
1403 * class.c (handle_using_decl): Always use OVL_CURRENT.
1404 (resolve_address_of_overloaded_function): Move iterator decl into
1405 for scope. Don't strip anticipated decls here.
1406
3dd83617
NS
1407 * pt.c (print_candidates_1): Separate TREE_LIST and OVERLOAD
1408 printing.
1409 (print_candidates): Adjust.
1410
268de039
NS
1411 * cp-tree.h (build_new_function_call): Lose koenig_p arg. Fix
1412 line breaking.
1413 * call.c (build_new_function_call): Lose koenig_p arg. Remove
1414 koenig_p handling here.
1415 * pt.c (push_template_decl_real): Unconditionally retrofit_lang_decl.
1416 (tsubst_omp_clauses): Likewise.
1417 (do_class_deduction): Adjust buld_new_function_call calls.
1418 * semantics.c (finish_call_expr): Likewise.
1419
0ea37ae1
JM
14202017-05-10 Jason Merrill <jason@redhat.com>
1421
dd54ca56
JM
1422 * pt.c (unify_parameter_deduction_failure, unify_cv_qual_mismatch)
1423 (unify_type_mismatch, unify_parameter_pack_mismatch)
1424 (unify_ptrmem_cst_mismatch, unify_expression_unequal)
1425 (unify_parameter_pack_inconsistent, unify_inconsistency)
1426 (unify_vla_arg, unify_method_type_error, unify_arity)
1427 (unify_arg_conversion, unify_no_common_base)
1428 (unify_inconsistent_template_template_parameters)
1429 (unify_template_deduction_failure)
1430 (unify_template_argument_mismatch)
1431 (unify_overload_resolution_failure): Call unify_invalid.
1432
00e08b0f
JM
1433 CWG 1847 - Clarifying compatibility during partial ordering
1434 * pt.c (more_specialized_fn): No order between two non-deducible
1435 parameters.
1436
415dcf96
JM
1437 * pt.c (dependent_type_p): Make sure we aren't called with
1438 global_type_node.
1439
0ea37ae1
JM
1440 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
1441 * pt.c (convert_template_argument): Just return an argument pack.
1442 (coerce_template_parameter_pack, template_parm_to_arg)
1443 (extract_fnparm_pack, make_argument_pack, tsubst_template_args)
1444 (tsubst_decl, tsubst, type_unification_real, unify_pack_expansion):
1445 Don't set the type of a NONTYPE_ARGUMENT_PACK.
1446 * parser.c (make_char_string_pack, make_string_pack): Likewise.
1447
d5a2f455
NS
14482017-05-10 Nathan Sidwell <nathan@acm.org>
1449
1450 * cp-tree.h (add_method, clone_function_decl): Change last arg to
1451 bool.
1452 * class.c (add_method): Change third arg to bool. Adjust.
1453 (one_inheriting_sig, one_inherited_ctor): Adjust.
1454 (clone_function_decl): Change 2nd arg to bool. Adjust.
1455 (clone_constructors_and_destructors): Adjust.
1456 * lambda.c (maybe_add_lambda_conv_op): Adjust.
1457 * method.c (lazily_declare_fn): Adjust.
1458 * pt.c (tsubst_decl, instantiate_template_1): Adjust.
1459 * semantics.c (finish_member_declaration): Adjust.
1460
f00b411f
PC
14612017-05-10 Paolo Carlini <paolo.carlini@oracle.com>
1462
1463 PR c++/80145
1464 * decl.c (finish_function): To improve error recovery, change the
1465 logic for calling apply_deduced_return_type.
1466
54069e59
JM
14672017-05-09 Jason Merrill <jason@redhat.com>
1468
0fa367aa 1469 PR c++/80605 - __is_standard_layout and empty base
c0aad677
JM
1470 * class.c (check_bases): Ignore empty bases.
1471
65d7adba
JM
1472 PR c++/70979 - literal class and closure types
1473 * class.c (finalize_literal_type_property): Handle closures
1474 specifically.
1475 (explain_non_literal_class): Likewise.
1476
54069e59
JM
1477 PR c++/66297, DR 1684 - literal class and constexpr member fns
1478 * constexpr.c (is_valid_constexpr_fn): Only complain about
1479 non-literal enclosing class in C++11.
1480 * class.c (finalize_literal_type_property): Likewise.
1481
cc49d15a
PC
14822017-05-09 Paolo Carlini <paolo.carlini@oracle.com>
1483
1484 PR c++/80186
1485 * pt.c (tsubst_decl): Early return error_mark_node if
1486 grok_ctor_properties returns false.
1487
60648580
JM
14882017-05-09 Jason Merrill <jason@redhat.com>
1489
1490 PR c++/70167 - array prvalue treated as lvalue
1491 * cp-tree.h (CONSTRUCTOR_C99_COMPOUND_LITERAL): New.
1492 (enum fcl_t): New.
1493 * semantics.c (finish_compound_literal): Add fcl_context parameter.
1494 Only make a static variable for C99 syntax.
1495 * parser.c (cp_parser_postfix_expression): Pass it.
1496 * pt.c (tsubst_copy_and_build): Likewise.
1497 * call.c (extend_ref_init_temps): Set
1498 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
1499
641da50a
NS
15002017-05-09 Nathan Sidwell <nathan@acm.org>
1501
1502 * cp-lang.c (get_global_decls, cxx_pushdecl): New.
1503 (LANG_HOOKS_GETDECLS, LANG_HOOKS_PUSHDECL): Override.
1504 * name-lookup.h (pushdecl_top_level): Declare.
1505
f3ec182d
JM
15062017-05-08 Jason Merrill <jason@redhat.com>
1507
1508 PR c++/80178 - parameter passing for uncopyable classes
1509 * tree.c (type_has_nontrivial_copy_init): True for classes with only
1510 deleted copy/move ctors.
1511 (remember_deleted_copy, maybe_warn_parm_abi): New.
1512 * decl.c (require_complete_types_for_parms, check_function_type):
1513 Call maybe_warn_parm_abi.
1514 * call.c (convert_for_arg_passing, build_cxx_call): Likewise.
1515
06aa5490
NS
15162017-05-08 Nathan Sidwell <nathan@acm.org>
1517
641da50a 1518 * decl.c (builtin_function_1): Set DECL_ANTICIPATED before pushing.
507e429b
NS
1519 (start_preparsed_function): Do decl pushing before setting
1520 current_funciton_decl and announcing it.
1521
d16d5eac
NS
1522 * name-lookup.h (pushdecl_with_scope): Replace with ...
1523 (pushdecl_outermost_localscope): ... this.
1524 * name-lookup.c (pushdecl_with_scope): Replace with ...
1525 (pushdecl_outermost_localscope): ... this.
1526 (pushdecl_namespace_level): Adjust.
1527 * decl.c (cp_make_fname_decl): Use pushdecl_outermost_localscope.
1528 * lambda.c (insert_capture_proxy): Likewise.
1529
7574e458
NS
1530 * class.c (build_vtbl_initializer): Don't shadow outer variable
1531 with static var.
1532
06aa5490
NS
1533 Revert _binding -> _value change.
1534 * name-lookup.h (get_namespace_value, set_global_value): Rename to ...
1535 (get_namespace_binding, set_global_binding): ... these.
1536 * name-lookup.c (get_namespace_value, set_global_value): Rename to ...
1537 (get_namespace_binding, set_global_binding): ... these.
1538 (arg_assoc_namespace, pushdecl_maybe_friend_1,
1539 check_for_out_of_scope_variable, push_overloaded_decl_1,
1540 lookup_name_innermost_nonclass_level, push_namespace): Adjust.
1541 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
1542 SET_IDENTIFIER_GLOBAL_VALUE): Adjust.
1543 * decl.c (poplevel): Adjust.
1544 * pt.c (make_constrained_auto): Likewise.
1545
d4a5c4eb
VR
15462017-05-07 Volker Reichelt <v.reichelt@netcologne.de>
1547
1548 PR translation/80280
1549 * call.c (print_z_candidate): Fix quoting.
1550
56d35585
DM
15512017-05-05 David Malcolm <dmalcolm@redhat.com>
1552
1553 * error.c (pedwarn_cxx98): Replace report_diagnostic
1554 with diagnostic_report_diagnostic.
1555
30318029
NS
15562017-05-05 Nathan Sidwell <nathan@acm.org>
1557
4b4b2e58
NS
1558 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value.
1559 (SET_IDENTIFIER_GLOBAL_VALUE): Use set_global_value.
1560 (IDENTIFIER_NAMESPACE_VALUE): Delete.
1561 * name-lookup.h (namespace_binding, set_namespace_binding): Replace
1562 with ...
1563 (get_namespace_value, set_global_value): ... these.
1564 (get_global_value_if_present, is_typename_at_global_scope): Delete.
1565 * decl.c (poplevel): Use get_namespace_value.
1566 (grokdeclarator): Use IDENTIFIER_GLOBAL_VALUE.
1567 * class.c (build_vtbl_initializer): Stash library decl in
1568 static var. Use IDENTIFIER_GLOBAL_VALUE.
1569 * except.c (do_get_exception_ptr, do_begin_catch, do_end_catch,
1570 do_allocate_exception, do_free_exception, build_throw): Likewise.
1571 * init.c (throw_bad_array_new_length): Likewise.
1572 * rtti.c (throw_bad_cast, throw_bad_typeid): Likewise.
1573 * name-lookup.c (arg_assoc_namespace, pushdecl_maybe_friend_1,
1574 check_for_our_of_scope_variable, push_overloaded_decl_1): Use
1575 get_namespace_value.
1576 (set_namespace_binding_1): Rename to
1577 (set_namespace_binding): ... here.
1578 (set_global_value): New.
1579 (lookup_name_innermost_nonclass_level_1, push_namespace): Use
1580 get_namespace_value.
1581 * pt.c (listify): Use get_namespace_value.
1582
77fa3ec1
NS
1583 * call.c (make_temporary_var_for_ref_to_temp): Push decl into
1584 current scope.
1585 * lex.c (unqualified_name_lookup_error): Likewise.
1586
7187a6c8
NS
1587 * class.c (alter_class): Use retrofit_lang_decl directly.
1588 * decl.c (push_local_name, dupliate_decls): Likewise.
1589 * semantics.c (omp_privatize_field): Likewise.
1590
b6263c5d
NS
1591 Kill walk_namespaces.
1592 * cp-tree.h (walk_namespaces_fn, walk_namespaces): Delete.
1593 * decl.c (walk_namespaces_r, walk_namespaces): Delete.
1594
30318029
NS
1595 Kill per-namespace static_decls.
1596 * cp-tree.h (static_decls): Declare.
1597 (wrapup_globals_for_namespace,
1598 diagnose_inline_vars_for_namespace): Replace with ...
1599 (wrapup_namespace_globals): ... this.
1600 * decl.c (static_decls): Define.
1601 (wrapup_globals_for_namespace,
1602 diagnose_inline_vars_for_namespace): Replace with ...
1603 (wrapup_namespace_globals): ... this.
1604 (cxx_init_decl_processing): Initialize static_decls.
1605 * decl2.c (c_parse_final_cleanups): Adjust.
1606 * name-lookup.h (cp_binding_level): Remove static_decls member.
1607 * name-lookup.c (add_decl_to_level): Adjust.
1608 (begin_scope): Adjust.
1609
dfae9048
PC
16102017-05-05 Paolo Carlini <paolo.carlini@oracle.com>
1611
1612 PR c++/71577
1613 * decl.c (reshape_init): Unconditionally return error_mark_node
1614 upon error about too many initializers.
1615
0f05d905
NS
16162017-05-04 Nathan Sidwell <nathan@acm.org>
1617
1618 * constraint.cc (diagnose_check_constraint): Fix %E thinko.
1619
0f2c4a8f
MS
16202017-05-04 Martin Sebor <msebor@redhat.com>
1621
1622 PR translation/80280
1623 * call.c (print_z_candidate): Add missing quoting to %D and other
1624 like directives.
1625 (build_op_call_1): Same.
1626 * constraint.cc (diagnose_check_constraint): Same.
1627 * mangle.c (mangle_decl): Same.
1628 * name-lookup.c (cp_binding_level_debug): Same.
1629 (set_decl_namespace): Same.
1630 * parser.c (cp_parser_tx_qualifier_opt): Same.
1631 * pt.c (print_candidates_1): Same.
1632 (check_template_variable): Same.
1633 (tsubst_default_argument): Same.
1634 (most_specialized_partial_spec): Same.
1635 * semantics.c (omp_reduction_lookup): Same.
1636 * tree.c (check_abi_tag_redeclaration): Same.
1637 * typeck.c (comptypes): Same.
1638 * typeck2.c (abstract_virtuals_error_sfinae): Same.
1639
b655c310
NS
16402017-05-04 Nathan Sidwell <nathan@acm.org>
1641
ad9870f2
NS
1642 More global trees.
1643 * cp-tree.h (enum cp_tree_index): Add CPTI_GLOBAL,
1644 CPTI_GLOBAL_TYPE, CPTI_GLOBAL_IDENTIFIER, CPTI_ANON_IDENTIFIER,
1645 CPTI_INIT_LIST_IDENTIFIER.
1646 (global_namespace, global_type_node, global_identifier,
1647 anon_identifier, init_list_identifier): New.
1648 * decl.c (global_type_node, global_scope_name): Delete.
1649 (initialize_predefined_identifiers): Add new identifiers.
1650 (cxx_init_decl_processing): Adjust.
1651 * name-lookup.h (global_namespace, global_type_node): Delete.
1652 * name-lookup.c (global_namespace, anonymous_namespace_name,
1653 get_anonymous_namespace_name): Delete.
1654 (namespace_scope_ht_size, begin_scope, pushtag_1,
1655 push_namespace): Adjust,
1656 * call.c (type_has_extended_temps): Use init_list_identifier.
1657 * pt.c (listify): Likewise.
1658
b655c310
NS
1659 * name-lookup.c: Reorder functions to make merging from modules
1660 branch simpler.
1661
8108ea30
JM
16622017-05-03 Jason Merrill <jason@redhat.com>
1663
1664 * constexpr.c (cxx_eval_outermost_constant_expr): Use TV_CONSTEXPR.
1665
5bb64c41
NS
16662017-05-03 Nathan Sidwell <nathan@acm.org>
1667
1668 * cp-tree.h (enum cp_tree_index, cp_global_trees): Move earlier,
1669 along with #defines, to before name-lookup include.
1670
c3b73151
PC
16712017-05-02 Paolo Carlini <paolo.carlini@oracle.com>
1672
1673 * pt.c (is_auto_or_concept): Remove.
1674 (type_uses_auto_or_concept): Remove, unused.
1675 (find_parameter_packs_r, extract_autos_r, is_auto_r): Adjust.
1676 * parser.c (tree_type_is_auto_or_concept): Remove, unused.
1677 * cp-tree.h (is_auto_or_concept): Remove.
1678
815d9cc6
XR
16792017-05-01 Xi Ruoyao <ryxi@stu.xidian.edu.cn>
1680
1681 PR c++/80038
1682 * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Don't
1683 add pedigree operation and detach call here.
1684 * cp-gimplify.c (cp_gimplify_expr): Remove the calls to
1685 cilk_cp_gimplify_call_params_in_spawned_fn.
1686 (cilk_cp_gimplify_call_params_in_spawned_fn): Remove function.
1687 * semantics.c (simplify_aggr_init_expr): Copy EXPR_CILK_SPAWN.
1688
6bbb3a69
VR
16892017-04-29 Volker Reichelt <v.reichelt@netcologne.de>
1690
1691 * parser.c (cp_parser_member_declaration): Add fix-it hints for
1692 stray comma and missing semicolon at end of member declaration.
1693
8211c4a2
VR
16942017-04-27 Volker Reichelt <v.reichelt@netcologne.de>
1695
1696 * parser.c (cp_parser_cast_expression): Add target type of cast to
1697 diagnostic.
1698 * error.c (type_to_string): Add '{enum}' suffix to enumeration types.
1699
c8040757
PC
17002017-04-26 Paolo Carlini <paolo.carlini@oracle.com>
1701
1702 * decl.c (grok_ctor_properties, ambi_op_p, unary_op_p): Change
1703 return type to bool.
1704 * cp-tree.h (grok_ctor_properties): Update.
1705
a480422d
VR
17062017-04-26 Volker Reichelt <v.reichelt@netcologne.de>
1707
1708 * parser.c (cp_parser_nested_name_specifier_opt): Add fix-it
1709 information to diagnostic of invalid colon in nested-name-specifier.
1710
70caf430
VR
17112017-04-25 Volker Reichelt <v.reichelt@netcologne.de>
1712
1713 * parser.c (cp_parser_elaborated_type_specifier): Add fix-it to
1714 diagnostic of invalid class/struct keyword after enum.
1715
fbe91804
DM
17162017-04-25 David Malcolm <dmalcolm@redhat.com>
1717
1718 * parser.c (cp_parser_member_declaration): Add fix-it hint
1719 for removing stray semicolons.
1720
5ca28c1d
DM
17212017-04-25 David Malcolm <dmalcolm@redhat.com>
1722
1723 * name-lookup.c (get_std_name_hint): New function.
1724 (maybe_suggest_missing_header): New function.
1725 (suggest_alternative_in_explicit_scope): Call
1726 maybe_suggest_missing_header.
1727
7d5dbb22
DM
17282017-04-25 David Malcolm <dmalcolm@redhat.com>
1729
1730 PR c++/80177
1731 * name-lookup.c (suggest_alternative_in_explicit_scope): Convert
1732 candidate type of bm from tree to const char *.
1733 (consider_binding_level): Likewise.
1734 (lookup_name_fuzzy): Likewise, using this to merge the best
1735 result from the preprocessor into bm, rather than immediately
1736 returning, so that better matches from reserved words can "win".
1737 Guard the rejection of keywords that don't start decl-specifiers
1738 so it only happens for FUZZY_LOOKUP_TYPENAME.
1739
761ad35c
VR
17402017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
1741
1742 * decl.c (grokdeclarator): Use %qT instead of %<%T%> in diagnostics.
1743 (start_enum): Likewise.
1744 (build_enumerator): Likewise. Use %qE instead of plain %E.
1745 * parser.c (cp_parser_mem_initializer_list): Use %qD instead of
1746 %<%D%> in diagnostics.
1747 (cp_parser_elaborated_type_specifier): Likewise.
1748 * pt.c (make_pack_expansion): Use %qT and %qE instead of
1749 %<%T%> and %<%E%> in diagnostics.
1750 (tsubst_pack_expansion): Likewise.
1751
412f61f0
DM
17522017-04-24 David Malcolm <dmalcolm@redhat.com>
1753
1754 PR c++/80016
1755 * parser.c (cp_parser_unary_expression): Generate a location
1756 range for alignof and sizeof expressions.
1757
ec856f5f
VR
17582017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
1759
1760 * parser.c (cp_parser_cv_qualifier_seq_opt): Add fix-it info to
1761 error message.
1762 (cp_parser_virt_specifier_seq_opt): Likewise.
1763 (set_and_check_decl_spec_loc): Likewise twice.
1764
176e79b5
JM
17652017-04-21 Jason Merrill <jason@redhat.com>
1766
1767 PR c++/80179 - ICE with initialized flexible array member.
1768 * constexpr.c (verify_ctor_sanity): Handle flexible array members.
1769
ad32f067
RB
17702017-04-21 Richard Biener <rguenther@suse.de>
1771
1772 * cp-tree.h (copy_decl): Annotate with CXX_MEM_STAT_INFO.
1773 (copy_type): Likewise.
1774 * lex.c (copy_decl): Pass down mem-stat info.
1775 (copy_type): Likewise.
1776
34d57a10
JW
17772017-04-20 Jonathan Wakely <jwakely@redhat.com>
1778
1779 PR c++/80473
1780 * init.c (build_new_1): Suppress notes about over-aligned new when
1781 the warning is suppressed.
1782
c3cbcd45
VR
17832017-04-20 Volker Reichelt <v.reichelt@netcologne.de>
1784
1785 * parser.c (cp_parser_member_declaration): Add warning with fixit
1786 information for extra semicolon after in-class function definition.
1787
8a59d466
JJ
17882017-04-20 Jakub Jelinek <jakub@redhat.com>
1789
1790 PR middle-end/80423
1791 * tree.c (build_cplus_array_type): Call build_array_type
1792 with the intended TYPE_TYPELESS_STORAGE flag value, instead
1793 of calling build_array_type and modifying later TYPE_TYPELESS_STORAGE
1794 on the shared type.
1795
be7c73ae
MP
17962017-04-18 Marek Polacek <polacek@redhat.com>
1797
1798 PR c++/80244 - ICE with attribute in template alias.
1799 * tree.c (strip_typedefs): Handle UNDERLYING_TYPE.
1800
d6e3e8a5
MP
1801 PR c++/80241 - ICE with alignas pack expansion.
1802 * error.c (dump_expr): Handle TREE_LIST.
1803 * parser.c (cp_parser_std_attribute_list): Return error_mark if
1804 make_pack_expansion returns an error.
1805
1adb82e1
BE
18062017-04-17 Bernd Edlinger <bernd.edlinger@hotmail.de>
1807
1808 PR c++/80287
1809 * class.c (fixup_may_alias): Fix all type variants.
1810
6864d849
JM
18112017-04-17 Jason Merrill <jason@redhat.com>
1812
d478f1e4
JM
1813 PR c++/80415 - wrong error with default arg and array reference.
1814 * tree.c (lvalue_kind): Return clk_class for an array prvalue.
1815
6864d849
JM
1816 * pt.c (tsubst_init): Set TARGET_EXPR_DIRECT_INIT_P.
1817
e072b0c4
AO
18182017-04-15 Alexandre Oliva <aoliva@redhat.com>
1819
1820 * decl.c (name_unnamed_type): Split out of...
1821 (grokdeclarator): ... this.
1822 * decl.h (name_unnamed_type): Declare.
1823
350792ff
RB
18242017-04-12 Richard Biener <rguenther@suse.de>
1825 Bernd Edlinger <bernd.edlinger@hotmail.de>
1826
1827 PR middle-end/79671
1828 * tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
1829 for arrays of character or std::byte type.
1830
125db6a1
JM
18312017-04-11 Jason Merrill <jason@redhat.com>
1832
1833 PR c++/80294 - ICE with constexpr and inheritance.
1834 * constexpr.c (reduced_constant_expression_p):
1835 A null constructor element is non-constant.
1836 (cxx_eval_indirect_ref): Don't VERIFY_CONSTANT before
1837 returning an empty base.
1838
347e1f77
JJ
18392017-04-11 Jakub Jelinek <jakub@redhat.com>
1840
1841 PR c++/80370
1842 * decl.c (cp_finish_decomp): If processing_template_decl on
1843 non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't
1844 change their DECL_VALUE_EXPR nor cp_finish_decl them. Instead make
1845 sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst
1846 processing.
1847 * pt.c (value_dependent_expression_p) <case VAR_DECL>: For variables
1848 with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
1849 dependent.
1850
82665822
JJ
18512017-04-11 Jakub Jelinek <jakub@redhat.com>
1852
1853 PR c++/80363
1854 * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.
1855
b447b28c
JJ
18562017-04-10 Jakub Jelinek <jakub@redhat.com>
1857
1858 PR c++/80176
1859 * tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
1860 operand, if it is a static member function, recurse on the
1861 BASELINK.
1862
98a7a34e
MP
18632017-04-10 Marek Polacek <polacek@redhat.com>
1864
1865 PR sanitizer/80348
1866 * typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL. Set
1867 ORIG_TYPE earlier and not only when shortening.
1868
c60faeee
JM
18692017-04-07 Jason Merrill <jason@redhat.com>
1870
3f4334cb
JM
1871 PR c++/80356 - ICE with reference to function template argument.
1872 PR c++/79294
1873 * pt.c (convert_nontype_argument_function): Adjust type even with a
1874 value-dependent argument.
1875
c60faeee
JM
1876 PR c++/80267 - ICE with nested capture of reference
1877 PR c++/60992
1878 * pt.c (tsubst_copy): Handle lookup finding a capture proxy.
1879
1ef532f4
MP
18802017-04-07 Marek Polacek <polacek@redhat.com>
1881
1882 PR sanitizer/80348
1883 * typeck.c (cp_build_binary_op): Convert COP[01] to ORIG_TYPE.
1884
2166aeb3
MP
1885 PR c++/80095
1886 * call.c (build_over_call): Don't check cxx_dialect.
1887 * cp-gimplify.c (cp_gimplify_init_expr): Don't check cxx_dialect nor
1888 whether SUB is a CONSTRUCTOR.
1889 * init.c (build_new_1): Don't check cxx_dialect.
1890 * tree.c (replace_placeholders): Add a function comment. Return if
1891 not in C++14, or if the object isn't a (member of a) class.
1892 * typeck2.c (store_init_value): Don't check cxx_dialect nor whether
1893 TYPE is CLASS_TYPE_P.
1894
98568e03
JJ
18952017-04-05 Jakub Jelinek <jakub@redhat.com>
1896
1897 PR c++/80309
1898 * pt.c (canonical_type_parameter): Use vec_safe_grow_cleared instead
1899 of a loop doing vec_safe_push of NULL. Formatting fixes.
1900 (rewrite_template_parm): Copy TEMPLATE_PARM_PARAMETER_PACK from oldidx
1901 to newidx before calling canonical_type_parameter on newtype.
1902
c0ea338b
VR
19032017-04-04 Volker Reichelt <v.reichelt@netcologne.de>
1904
1905 PR c++/80296
1906 * cxx-pretty-print.c (cxx_pretty_printer::expression): Add
1907 UNARY_PLUS_EXPR case.
1908
e4307389
JM
19092017-04-03 Jason Merrill <jason@redhat.com>
1910
1911 * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
1912
5764ee3c
JW
19132017-04-03 Jonathan Wakely <jwakely@redhat.com>
1914
1915 * class.c (update_vtable_entry_for_fn): Fix typo in comment.
1916 * decl2.c (one_static_initialization_or_destruction): Likewise.
1917 * name-lookup.c (store_bindings): Likewise.
1918 * parser.c (make_call_declarator): Likewise.
1919 * pt.c (check_explicit_specialization): Likewise.
1920
5a68fae7
JM
19212017-04-03 Jason Merrill <jason@redhat.com>
1922
1923 PR sanitizer/79993 - ICE with VLA initialization from string
1924 PR c++/69487 - wrong VLA initialization from string
1925 * init.c (finish_length_check): Split out from build_vec_init.
1926 (build_vec_init): Handle STRING_CST.
1927 * typeck2.c (split_nonconstant_init): Handle STRING_CST.
1928 (digest_init_r): Don't give a STRING_CST VLA type.
1929
af88f557
JJ
19302017-03-31 Jakub Jelinek <jakub@redhat.com>
1931
6f3af356
JJ
1932 PR c++/79572
1933 * cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
1934 REFERENCE_TYPE. Adjust ubsan_maybe_instrument_reference caller
1935 for NOP_EXPR to REFERENCE_TYPE.
1936
af88f557
JJ
1937 PR libstdc++/80251
1938 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
1939 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
1940 CPTK_IS_AGGREGATE.
1941 * semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
1942 Remove extraneous parens.
1943 (finish_trait_expr): Handle CPTK_IS_AGGREGATE.
1944 * parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
1945 (cp_parser_trait_expr): Likewise.
1946
a9e4a1a5
JJ
19472017-03-27 Jakub Jelinek <jakub@redhat.com>
1948
1949 PR middle-end/80162
1950 * cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
1951 * typeck.c (cxx_mark_addressable): Likewise. Look through
1952 VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
1953 to ARRAY_TYPE.
1954 (cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
1955
90471a3d
JM
19562017-03-24 Jason Merrill <jason@redhat.com>
1957
1958 PR c++/77339 - ICE with invalid use of alias template.
1959 * pt.c (lookup_template_class_1): Don't try to enter the scope of an
1960 alias template.
1961
c8b1fbc1
MP
19622017-03-24 Marek Polacek <polacek@redhat.com>
1963
1964 PR c++/80119
1965 * cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
1966 doesn't have side effects.
1967
16e9eaa6
JM
19682017-03-23 Jason Merrill <jason@redhat.com>
1969
842562b4
JM
1970 PR c++/80150 - ICE with overloaded variadic deduction.
1971 * pt.c (try_one_overload): Remove asserts.
1972
16e9eaa6
JM
1973 PR c++/77563 - missing ambiguous conversion error.
1974 * call.c (convert_like_real): Use LOOKUP_IMPLICIT.
1975
ee3ff394
MP
19762017-03-23 Marek Polacek <polacek@redhat.com>
1977
1978 * cp-tree.h: Remove a C_RID_YYCODE reference.
1979
f13e9cd5
JJ
19802017-03-22 Jakub Jelinek <jakub@redhat.com>
1981
1982 PR c++/80141
1983 * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
1984 case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
1985 processing_template_decl.
1986
d3e19c2c
PC
19872017-03-21 Paolo Carlini <paolo.carlini@oracle.com>
1988
1989 PR c++/77752
1990 * name-lookup.c (pushtag_1): Add check for bogus, non template,
1991 std::initializer_list.
1992
8bee092e
JJ
19932017-03-21 Jakub Jelinek <jakub@redhat.com>
1994
1995 PR c++/35878
1996 * init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.
1997
ece3b7e6
VV
19982017-03-21 Ville Voutilainen <ville.voutilainen@gmail.com>
1999
2000 PR c++/35878
8bee092e 2001 * init.c (std_placement_new_fn_p): New.
ece3b7e6
VV
2002 (build_new_1): Call it.
2003
8afd9c45
JM
20042017-03-20 Jason Merrill <jason@redhat.com>
2005
55b11c60
JM
2006 PR c++/80096 - ICE with C++17 non-type auto.
2007 * pt.c (tsubst): Delay tsubst of type of template non-type
2008 parameter.
2009
18f73c5f
JM
2010 PR c++/79519 - ICE with deleted template friend.
2011 * decl.c (grokdeclarator): Complain about misplaced function
2012 definition using =, as well.
2013
8afd9c45
JM
2014 PR c++/79640 - infinite recursion with generic lambda.
2015 * pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
2016 before substituting its initializer.
2017
92377255
MP
20182017-03-20 Marek Polacek <polacek@redhat.com>
2019 Paolo Carlini <paolo.carlini@oracle.com>
2020
2021 PR c++/80059 - ICE with noexcept and __transaction_atomic
2022 * except.c (build_must_not_throw_expr): Call
9da12bea 2023 instantiate_non_dependent_expr.
92377255 2024
c8816908
JM
20252017-03-19 Jason Merrill <jason@redhat.com>
2026
a4dfaae1
JM
2027 PR c++/80084 - wrong C++17 decomposition by reference of parameter.
2028 * decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
2029 reference decomposition.
2030
c8816908
JM
2031 PR c++/80077 - error with constexpr and -fno-elide-constructors.
2032 * constexpr.c (cxx_eval_call_expression): Set ctx->call while
2033 expanding trivial constructor.
2034
c7ec585d
JM
20352017-03-17 Jason Merrill <jason@redhat.com>
2036
d1a73b0b
JM
2037 PR c++/78345 - ICE initializing array from lambda.
2038 * init.c (build_aggr_init): Check array initializer.
2039 (build_vec_init): Check the type of a CONSTRUCTOR.
2040
c7ec585d
JM
2041 PR c++/80073 - C++17 ICE with virtual base.
2042 * decl.c (xref_basetypes): Also check for indirect vbases.
2043
fbd603c4
JM
20442017-03-16 Jason Merrill <jason@redhat.com>
2045
2e92d7ad
JM
2046 * decl.c (start_enum): std::byte aliases anything.
2047
fbd603c4
JM
2048 PR c++/79797
2049 * constexpr.c (lookup_placeholder): Tweak.
2050
559a77e1
JM
20512017-03-15 Jason Merrill <jason@redhat.com>
2052
2053 PR c++/80043 - ICE with -fpermissive
2054 * typeck.c (convert_for_assignment): Handle instantiate_type
2055 not giving an error.
2056
9b74f933
NS
20572017-03-14 Nathan Sidwell <nathan@acm.org>
2058
2059 PR c++/79393 DR 1658 workaround
2060 * method.c (synthesized_method_base_walk): Inihibit abstract class
2061 virtual base access check here.
2062 (synthesized_method_walk): Not here.
2063
16e93e4b
NS
20642017-03-13 Nathan Sidwell <nathan@acm.org>
2065
2066 PR c++/79393 DR 1658 workaround
2067 * method.c (synthesized_method_walk): Check vbases of abstract
2068 classes for dtor walk.
2069
2f6f187a
DM
20702017-03-10 David Malcolm <dmalcolm@redhat.com>
2071
2072 PR translation/79848
2073 * decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
2074
0c942f3e
JM
20752017-03-10 Jason Merrill <jason@redhat.com>
2076
2077 PR c++/79960 - alias templates and partial ordering
2078 * pt.c (comp_template_args): Add partial_order parm.
2079 (template_args_equal): Likewise.
2080 (comp_template_args_porder): New.
2081 (get_partial_spec_bindings): Use it.
2082
455d833c
MP
20832017-03-10 Marek Polacek <polacek@redhat.com>
2084
2085 PR c++/79967
2086 * decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
2087
cdd669f9
JJ
20882017-03-10 Jakub Jelinek <jakub@redhat.com>
2089
e260b0a7
JJ
2090 PR c++/79899
2091 * optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
2092 Use XALLOCAVEC macro.
2093
cdd669f9
JJ
2094 PR c++/79896
2095 * decl.c (finish_enum_value_list): If value is error_mark_node,
2096 don't copy it and change its type.
2097 * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
2098 of CONST_DECL is error_mark_node.
2099
423aec8b
MP
21002017-03-09 Marek Polacek <polacek@redhat.com>
2101
2102 PR c++/79900 - ICE in strip_typedefs
2103 * tree.c (strip_typedefs): Skip the attribute handling if T is
2104 a variant type which hasn't been updated yet.
2105
6443c7c0
MP
2106 PR c++/79687 - wrong code with pointer-to-member
2107 * init.c (constant_value_1): Break if the variable has a dynamic
2108 initializer.
2109
89262ec6
JM
21102017-03-08 Jason Merrill <jason@redhat.com>
2111
2112 PR c++/79797 - ICE with self-reference in array DMI.
2113 * constexpr.c (lookup_placeholder): Split out...
2114 (cxx_eval_constant_expression): ...from here.
2115
a71dbc63
JJ
21162017-03-07 Jakub Jelinek <jakub@redhat.com>
2117
2118 PR c/79834
2119 * parser.c (cp_parser_omp_cancellation_point,
2120 cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
2121 cp_parser_omp_target_update): Change "may only be used in compound
2122 statements" diagnostics, such that the same translatable string is
2123 used for all pragmas.
2124 (cp_parser_pragma): Likewise. Use error_at instead of
2125 cp_parser_error for that diagnostics.
2126
bdbbf28d
MP
21272017-03-06 Marek Polacek <polacek@redhat.com>
2128
2129 PR c++/79796 - ICE with NSDMI and this pointer
2130 * call.c (build_over_call): Handle NSDMI with a 'this' by calling
2131 replace_placeholders.
2132
345edb37
JJ
21332017-03-06 Jakub Jelinek <jakub@redhat.com>
2134
2135 PR c++/79822
2136 * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
2137 ({ (void) 0; }).
2138
90d9a8e6
JM
21392017-03-06 Jason Merrill <jason@redhat.com>
2140
2141 Revert "Allow deduction guides to look into primary template."
2142 * cp-tree.h, parser.c, pt.c, search.c: Revert.
2143
d8b4baeb
PC
21442017-03-05 Paolo Carlini <paolo.carlini@oracle.com>
2145
2146 PR c++/70266
2147 * except.c (build_must_not_throw_expr): Perform the implicit
2148 conversions on the condition.
2149
4cdeb234
JM
21502017-03-03 Jason Merrill <jason@redhat.com>
2151
108154ff
JM
2152 * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
2153 -Wc++1z-compat.
2154
4cdeb234
JM
2155 Core issues 2273 and 2277
2156 * call.c (joust): Adjust using-declaration tiebreaker to handle
2157 the intermediate base case.
2158 * method.c (strip_inheriting_ctors): Just return the argument if
2159 !flag_new_inheriting_ctors.
2160
30d309aa
RB
21612017-03-03 Richard Biener <rguenther@suse.de>
2162
2163 PR c++/79825
2164 * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
2165
7278b0a2
MP
21662017-03-03 Marek Polacek <polacek@redhat.com>
2167
2168 PR c++/79791
2169 * typeck.c (string_conv_p): In C++11, always call pedwarn with
2170 OPT_Wwrite_strings.
2171
de35db42
JM
21722017-03-02 Jason Merrill <jason@redhat.com>
2173
fb5ce608
JM
2174 Update overload resolution with deduction guides.
2175 * pt.c (do_class_deduction): Always build the copy guide.
2176 (copy_guide_p, template_guide_p): New.
2177 (build_deduction_guide): Remember the original constructor.
2178 * call.c (joust): Prefer the copy guide and non-template guides.
2179
de35db42
JM
2180 Allow deduction guides to look into primary template.
2181 * cp-tree.h (struct saved_scope): Add deduction_guide_type.
2182 (struct cp_decl_specifier_seq): Add constructor_p.
2183 * parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
2184 (cp_parser_init_declarator): Check it. Set ctor_dtor_or_conv_p.
2185 Clear deduction_guide_type. Don't handle deduction guide names.
2186 (cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
2187 (cp_parser_direct_declarator): Likewise. Handle deduction guides.
2188 (cp_parser_member_declaration, cp_parser_cache_defarg)
2189 (cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
2190 * pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
2191 (build_deduction_guide): Set deduction_guide_type.
2192 (dependent_scope_p): Check deduction_guide_type.
2193 * search.c (lookup_member): Likewise.
2194
50bea0c5
JJ
21952017-03-02 Jakub Jelinek <jakub@redhat.com>
2196
2197 PR c++/79782
2198 * init.c (mark_exp_read_r): New function.
2199 (emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
2200 whole arguments instead of plain mark_exp_read on TREE_LIST values.
2201
9a642cca
JM
22022017-03-01 Jason Merrill <jason@redhat.com>
2203
2204 Class template argument deduction in new-expression
2205 * init.c (build_new): Handle deduction from no initializer.
2206 * parser.c (cp_parser_new_expression): Don't require a single
2207 expression for class template deduction.
2208 * typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
2209 class template placeholder.
2210 * pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
2211 (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
2212 (redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
2213
e3e9e8ca
JJ
22142017-03-01 Jakub Jelinek <jakub@redhat.com>
2215
2216 PR c++/79746
2217 * init.c (emit_mem_initializers): When not constructing vbases of
2218 abstract classes, mark arguments as read for
2219 -Wunused-but-set-parameter.
2220
853ef4e5
JM
22212017-02-28 Jason Merrill <jason@redhat.com>
2222
2223 Class template argument deduction refinements
2224 * call.c (joust): Move deduction guide tiebreaker down.
2225 * decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
2226 deduction with no initializer.
2227 * pt.c (build_deduction_guide): Handle implicit default/copy ctor.
2228 (do_class_deduction): Use that rather than special case.
2229 (do_auto_deduction): Handle null initializer.
2230
324ff1a0
JJ
22312017-02-28 Jakub Jelinek <jakub@redhat.com>
2232
2233 * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
2234 instead of just cond ? "..." : "...".
2235 (grokdeclarator): Likewise.
2236 (build_enumerator): Likewise.
2237 * init.c (build_new_1): Likewise.
2238 * call.c (build_new_method_call_1): Likewise.
2239 * parser.c: Include intl.h.
2240 (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
2241 "enter"/"exit" keyword.
2242 (cp_finalize_oacc_routine): Don't use %s to supply portions of the
2243 message.
2244
080384d6
JM
22452017-02-27 Jason Merrill <jason@redhat.com>
2246
2247 PR c++/71568 - SFINAE forming pointer to member function
2248 * init.c (build_offset_ref): Check the return value of
2249 perform_or_defer_access_check.
2250
d66d4590
MP
22512017-02-27 Marek Polacek <polacek@redhat.com>
2252
2253 * decl.c (expand_static_init): Add missing } in a comment.
2254
24f12823
VR
22552017-02-27 Volker Reichelt <v.reichelt@netcologne.de>
2256
2257 * init.c: Include intl.h.
2258 (build_new_1): Move message strings into pedwarn to make them
2259 -Wformat-security friendly. Mark string for translation.
2260 * pt.c (tsubst_copy_and_build): Mark string for translation.
2261 Make the pointer const.
2262 * semantics.c (finish_id_expression): Mark strings for translation.
2263
9d975cb6
JJ
22642017-02-25 Jakub Jelinek <jakub@redhat.com>
2265
2266 * call.c (build_op_delete_call): Make msg1 and msg2 const.
2267
4227c9ad
JJ
22682017-02-24 Jakub Jelinek <jakub@redhat.com>
2269
2270 PR c++/79588
2271 * call.c (build_over_call): Call check_function_arguments even for
2272 -Wrestrict, adjust check_function_arguments caller.
2273 * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
2274 here.
2275 * typeck.c (cp_build_function_call_vec): Adjust
2276 check_function_arguments caller.
2277
5713d448
MP
22782017-02-24 Marek Polacek <polacek@redhat.com>
2279
2280 PR translation/79705
2281 * decl.c (check_redeclaration_exception_specification): Mark a string
2282 for translation. Make the pointer const.
2283
e3beb191
PC
22842017-02-23 Paolo Carlini <paolo.carlini@oracle.com>
2285
2286 PR c++/79361
2287 * pt.c (register_specialization): Check duplicate_decls return value
2288 for error_mark_node and pass it back.
2289
349c6351
JM
22902017-02-22 Jason Merrill <jason@redhat.com>
2291
680ed106
JM
2292 PR c++/79679 - missing destructor for argument
2293 * call.c (build_over_call): Don't pass tf_no_cleanup to argument
2294 conversions.
2295
349c6351
JM
2296 * pt.c (do_class_deduction): Handle 0 argument case.
2297
e40b6fc7
JJ
22982017-02-22 Jakub Jelinek <jakub@redhat.com>
2299
2300 PR c++/79664
2301 * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
2302 SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
2303 * constexpr.c (potential_constant_expression_1): Handle
2304 OMP_*, OACC_* and CILK_* trees. Use error_at with
2305 EXPR_LOC_OR_LOC (t, input_location) computed early
2306 instead of error, or error_at with location_of (t).
2307
78af14ae
MP
23082017-02-22 Marek Polacek <polacek@redhat.com>
2309
2310 PR c++/79653
2311 * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
2312 if the alignas expression is erroneous.
2313 * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
2314 error_mark_node.
2315
8fdddd3d
MP
2316 PR c++/79657
2317 * semantics.c (finish_underlying_type): Bail out for incomplete enums.
2318
46b48ef5
JM
23192017-02-21 Jason Merrill <jason@redhat.com>
2320
626aeaa7
JM
2321 PR c++/50308 - wrong deprecated warning with ADL
2322 PR c++/17729 - duplicate deprecated warning
2323 * semantics.c (finish_id_expression): Only call mark_used on a
2324 function if we aren't building a call.
2325
46b48ef5
JM
2326 PR c++/41727 - ICE with partial spec of partial instantiation
2327 * pt.c (process_partial_specialization): For now, don't check more
2328 specialized if there is more than one level of args.
2329
a232a1cb
MP
23302017-02-21 Marek Polacek <polacek@redhat.com>
2331
2332 PR c++/79535
2333 * cp-tree.h (maybe_reject_flexarray_init): Declare.
2334 * init.c (maybe_reject_flexarray_init): No longer static.
2335 Add check for current_function_decl.
2336 * parser.c (cp_parser_late_parse_one_default_arg): Reject
2337 a default mem-initializer for a flexible array.
2338
b7280ac2
JJ
23392017-02-21 Jakub Jelinek <jakub@redhat.com>
2340 Paolo Carlini <paolo.carlini@oracle.com>
2341
2342 PR c++/79654
2343 * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
2344 on error.
2345 * pt.c (tsubst_decomp_names): Return error_mark_node if the first
2346 decl after the decomposition artificial decl has error_mark_node.
2347 * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
2348 instead of just == error_mark_node comparison.
2349
664beaf2
JJ
23502017-02-21 Jakub Jelinek <jakub@redhat.com>
2351
5c3f1d7b
JJ
2352 PR sanitizer/79589
2353 * decl.c: Include gimplify.h.
2354 (cp_finish_decomp): Make sure there is no sharing of trees
2355 in between DECL_VALUE_EXPR of decomposition decls.
2356
3bb43119
JJ
2357 PR c++/79655
2358 * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
2359
664beaf2
JJ
2360 PR c++/79639
2361 * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
2362 call cplus_expand_constant on it first.
2363
b80dfe44
JM
23642017-02-19 Jason Merrill <jason@redhat.com>
2365
0e53a276
JM
2366 PR c++/78139 - destructor needed by new-expression
2367 * call.c (build_special_member_call): Use tf_no_cleanup.
2368
8f712b76
JM
2369 PR c++/78282 - auto template and pack expansion
2370 * pt.c (find_parameter_packs_r): Don't walk into the type of
2371 templates other than template template-parameters.
2372
bcbdfa4c
JM
2373 PR c++/79606 - ICE with this->base_member in NSDMI
2374 * class.c (build_base_path): Check processing_template_decl.
2375
736a933c
JM
2376 PR c++/79607 - ICE with T{} initializer
2377 * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
2378
7950124e
JM
2379 PR c++/79566 - elaborated-type-specifier in range for
2380 * parser.c (cp_parser_simple_declaration): Fix check for type
2381 definition.
2382
bea40d11
JM
2383 PR c++/79400 - confusing suggestion of 'noexcept'
2384 * parser.c (cp_parser_exception_specification_opt): Remove
2385 suggestion for deprecated dynamic exception-specification.
2386
4cd15931
JM
2387 PR c++/79470 - partial ordering with reference parameters
2388 * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
2389
cfb82564
JM
2390 PR c++/79500 - ICE with non-template deduction guide
2391 * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
2392 DECL_TEMPLATE_RESULT.
2393
de59c92b
JM
2394 PR c++/79580 - ICE with compound literal
2395 * parser.c (cp_parser_class_head): If we're in the middle of an
2396 expression, use ts_within_enclosing_non_class.
2397
b80dfe44
JM
2398 PR c++/79503 - inherited ctor taking base class
2399 * call.c (add_function_candidate): Also check that
2400 DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
2401
f46e2bc9
PC
24022017-02-19 Paolo Carlini <paolo.carlini@oracle.com>
2403
2404 PR c++/79380
2405 * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
2406 argument.
2407
7dfa657b
JW
24082017-02-19 Eric Fiselier <eric@efcs.ca>
2409 Jonathan Wakely <jwakely@redhat.com>
2410
2411 PR c++/69523
2412 * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
2413 control warning about literal suffix identifiers without a leading
2414 underscore.
2415
1ee26047
JM
24162017-02-17 Jason Merrill <jason@redhat.com>
2417
cb94c700
JM
2418 PR c++/79508 - lookup error with member template
2419 * parser.c (cp_parser_template_name): Clear
2420 parser->context->object_type if we aren't doing lookup.
2421
7c586749
JM
2422 PR c++/78690 - ICE with using and global type with same name
2423 * pt.c (type_dependent_object_expression_p): True for
2424 IDENTIFIER_NODE.
2425
edf1849a
JM
2426 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
2427 * pt.c (convert_template_argument): Just return an auto arg pack.
2428 (tsubst_template_args): Don't tsubst an auto pack type.
2429
b10c7cd7
JM
2430 PR c++/79556 - C++17 ICE with non-type auto
2431 * pt.c (do_auto_deduction): Don't try to deduce from null type.
2432
1ee26047
JM
2433 PR c++/79533 - C++17 ICE with temporary cast to reference
2434 * call.c (build_over_call): Conversion to a reference prevents copy
2435 elision.
2436
790ecf85
JJ
24372017-02-16 Jakub Jelinek <jakub@redhat.com>
2438 Jason Merrill <jason@redhat.com>
2439
2440 PR c++/79502 - lost nodiscard attribute
2441 * pt.c (apply_late_template_attributes): Do apply non-dependent
2442 attributes to types.
2443
61cee260
JM
24442017-02-16 Jason Merrill <jason@redhat.com>
2445
1e163090
JM
2446 PR c++/78572 - ICE with self-modifying array initializer
2447 * constexpr.c (cxx_eval_store_expression): The object we're
2448 initializing is outside the constant-expression.
2449 (cxx_eval_call_expression): Set ctx->call.
2450
61cee260
JM
2451 PR c++/79050 - ICE with undeduced auto and LTO
2452 * decl.c (poplevel): Remove undeduced auto decls.
2453
bcac0b4d
JJ
24542017-02-16 Jakub Jelinek <jakub@redhat.com>
2455
2456 PR c++/79512
2457 * parser.c (cp_parser_omp_target): For -fopenmp-simd
2458 ignore #pragma omp target even when not followed by identifier.
2459
19e8a45f
JM
24602017-02-15 Jason Merrill <jason@redhat.com>
2461 Jakub Jelinek <jakub@redhat.com>
2462
2463 PR c++/79464 - ICE in IPA with omitted constructor parms
2464 * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
2465 (adjust_clone_args): Adjust.
2466 (add_method): Remember omitted parms.
2467 * call.c (add_function_candidate): Likewise.
2468 * mangle.c (write_method_parms): Likewise.
2469 * method.c (ctor_omit_inherited_parms): Return false if there are no
2470 parms to omit.
2471
945c17d8
MS
24722017-02-15 Martin Sebor <msebor@redhat.com>
2473
2474 PR c++/79363
2475 * init.c (maybe_reject_flexarray_init): New function.
2476 (perform_member_init): Call it.
2477
4f5e5fcb
JJ
24782017-02-15 Jakub Jelinek <jakub@redhat.com>
2479
e7202857
JJ
2480 PR c++/79301
2481 * parser.c (cp_parser_std_attribute): Don't pedwarn about
2482 [[deprecated]] with -std=c++11 and [[fallthrough]] with
2483 -std=c++11 and -std=c++14.
2484
4f5e5fcb
JJ
2485 PR c++/79288
2486 * decl.c (grokdeclarator): For static data members, handle thread_p
2487 only after handling inline.
2488
6f207d58
MP
24892017-02-14 Marek Polacek <polacek@redhat.com>
2490
2491 PR c++/79420
2492 PR c++/79463
2493 * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
2494 clobbering if the postfix expression isn't an EXPR_P.
2495
8cb7aaa1
JM
24962017-02-13 Jason Merrill <jason@redhat.com>
2497
2498 PR c++/79461 - ICE with lambda in constexpr constructor
2499 * constexpr.c (build_data_member_initialization): Ignore
2500 initialization of a local variable.
2501
b84702c0
JJ
25022017-02-13 Jakub Jelinek <jakub@redhat.com>
2503
5995f597
JJ
2504 * init.c (warn_placement_new_too_small): Add missing space in
2505 diagnostics.
2506 * parser.c (cp_parser_oacc_declare): Likewise.
2507 * mangle.c (maybe_check_abi_tags): Likewise.
2508
b84702c0
JJ
2509 PR c++/79232
2510 * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
2511 on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
2512 in the rightmost operand.
2513
b9a161ff
NS
25142017-02-13 Nathan Sidwell <nathan@acm.org>
2515
2516 PR c++/79296 - ICE mangling localized template instantiation
2517 * decl2.c (determine_visibility): Use template fn context for
2518 local class instantiations.
2519
bc61048a
JM
25202017-02-11 Jason Merrill <jason@redhat.com>
2521
817a77e4
JM
2522 PR c++/77659 - ICE with new and C++14 aggregate NSDMI
2523 * init.c (build_new): Make backups of any CONSTRUCTORs in init.
2524 (build_new_1): Use replace_placeholders.
2525 * tree.c (replace_placeholders_t): Also track whether we've seen a
2526 placeholder.
2527 (replace_placeholders, replace_placeholders_r): Adjust.
2528 * cp-tree.h: Adjust.
2529
bc61048a
JM
2530 PR c++/77790 - ICE with auto function in C++11 mode
2531 * decl.c (undeduced_auto_decl): Remove C++14 limitation.
2532 (require_deduced_type): Add complain parm, return bool.
2533 * cp-tree.h: Adjust.
2534 * decl2.c (mark_used): Use require_deduced_type.
2535
c16b872c
JM
25362017-02-10 Jason Merrill <jason@redhat.com>
2537
6a2cc46b
JM
2538 PR c++/78908 - template ops and bitfields
2539 * tree.c (build_min_non_dep): Use unlowered_expr_type.
2540
5c97093b
JM
2541 PR c++/78897 - constexpr union
2542 * constexpr.c (cxx_eval_store_expression): A store to a union member
2543 erases a previous store to another member.
2544
f494ac0e
JM
2545 PR c++/71285 - member of fold-expression
2546 * semantics.c (finish_unary_fold_expr)
2547 (finish_binary_fold_expr): Use null type for fold-expressions.
2548
c16b872c
JM
2549 PR c++/79401 - protected inherited constructor
2550 * call.c (enforce_access): For inheriting constructor, find a base
2551 binfo in the path we already have.
2552
6f4f30bf
MP
25532017-02-10 Marek Polacek <polacek@redhat.com>
2554
2555 PR c++/79435
2556 * pt.c (type_dependent_expression_p): Check if the expression type
2557 is null.
2558
3799a5b8
MP
2559 PR c++/79184
2560 * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
2561 if warnings shouldn't be given.
2562
a7c8ed0c
PC
25632017-02-10 Paolo Carlini <paolo.carlini@oracle.com>
2564
2565 PR c++/71737
2566 * pt.c (tsubst_decl): Don't try to preserve a typedef that names
2567 an error_mark_node as type.
2568
9bfc55d0
JJ
25692017-02-09 Jakub Jelinek <jakub@redhat.com>
2570 Jason Merrill <jason@redhat.com>
2571
2572 PR c++/79143
2573 * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
2574 from pattern to type.
2575
a56c0ac0
JM
25762017-02-09 Jason Merrill <jason@redhat.com>
2577
2578 PR c++/79316 - default argument in deduction guide
2579 PR c++/79350 - explicit deduction guide
2580 * parser.c (cp_parser_constructor_declarator_p)
2581 (cp_parser_direct_declarator): Parse deduction guides more like
2582 constructors.
2583 * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
2584 * tree.c (special_function_p): Return it.
2585 * decl.c (check_special_function_return_type): Handle it.
2586 (grokdeclarator, grokfndecl): Adjust.
2587 (cp_finish_decl): Pass flags to do_auto_deduction.
2588 * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
2589 * pt.c (dguide_name_p): Take a const_tree.
2590 (do_class_deduction): Handle explicit.
2591 (do_auto_deduction): Pass flags through.
2592 (build_deduction_guide): Copy explicit flag.
2593
56f71478
JJ
25942017-02-09 Jakub Jelinek <jakub@redhat.com>
2595
f08683a1
JJ
2596 PR c++/79429
2597 * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
2598 non-pragma_compound context here.
2599 (cp_parser_omp_target): Likewise.
2600 (cp_parser_pragma): Don't call push_omp_privatization_clauses and
2601 parsing for ordered and target omp pragmas in non-pragma_stmt
2602 non-pragma_compound contexts.
2603
56f71478
JJ
2604 PR c/79431
2605 * parser.c (cp_parser_oacc_declare): Formatting fix.
2606 (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
2607 automatic variables.
2608
02889d23
CLT
26092016-02-09 Nathan Sidwell <nathan@codesourcery.com>
2610 Chung-Lin Tang <cltang@codesourcery.com>
2611
2612 * parser.c (cp_parser_oacc_clause_tile): Disallow collapse. Fix
2613 parsing. Parse constant expression. Remove semantic checking.
2614 (cp_parser_omp_clause_collapse): Disallow tile.
2615 (cp_parser_omp_for_loop): Deal with tile clause. Don't emit a parse
2616 error about missing for after already emitting one. Use more
2617 conventional for idiom for unbounded loop.
2618 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
2619 * semantics.c (finish_omp_clauses): Correct TILE semantic check.
2620 (finish_omp_for): Deal with tile clause.
2621
8e956c22
NS
26222017-02-07 Nathan Sidwell <nathan@acm.org>
2623
2624 * method.c (synthesized_method_base_walk): New. Broken out of ...
2625 (synthesized_method_walk): ... here. Call it. Cleanup
2626 initializations.
2627
bb7d75ff
PP
26282017-02-07 Patrick Palka <ppalka@gcc.gnu.org>
2629
2630 PR c++/79360
2631 * typeck2.c (process_init_constructor_union): Consider only
2632 FIELD_DECLs when looking for an NSDMI.
2633
44a6da7b
JM
26342017-02-06 Jason Merrill <jason@redhat.com>
2635
2636 PR c++/71193 - incomplete types in templates
2637 * parser.c (cp_parser_postfix_dot_deref_expression): In a template
2638 handle incomplete type by pedwarning and then treating as dependent.
2639
a5e8cbd1
JJ
26402017-02-06 Jakub Jelinek <jakub@redhat.com>
2641
98e09245
JJ
2642 PR c++/79379
2643 * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
2644 (potential_constant_expression_1): Likewise.
2645
e8b0383c
JJ
2646 PR c++/79377
2647 * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
2648 allow one fewer than expected arguments if flag_permissive.
2649
a5e8cbd1
JJ
2650 PR c++/79372
2651 * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
2652 * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
2653 with error_mark_node type.
2654
99be38ec
JM
26552017-02-03 Jason Merrill <jason@redhat.com>
2656
77095a6a
JM
2657 PR c++/78689 - ICE on constructor with label
2658 * optimize.c (maybe_clone_body): Replace omitted parameters with
2659 null lvalues.
2660 * class.c (build_clone): Fix logic for omitting inherited parms.
2661
8a87daca
JM
2662 PR c++/12245 - excessive memory use
2663 * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
2664 back in. Don't cache constants.
2665 (maybe_constant_init): Don't cache constants.
2666
99be38ec
JM
2667 PR c++/79294 - ICE with invalid template argument
2668 * pt.c (convert_nontype_argument_function): Check value-dependence.
2669 (convert_nontype_argument): Don't check it here for function ptrs.
2670
27de0fab
RB
26712017-02-02 Richard Biener <rguenther@suse.de>
2672
2673 PR cp/14179
2674 * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
2675 it lazily on the first changed element only and copy it
2676 fully upfront, only storing changed elements.
2677
d8d58893
PC
26782017-02-02 Paolo Carlini <paolo.carlini@oracle.com>
2679
2680 PR c++/69637
2681 * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
2682 to the width.
2683
19bdccb4
JJ
26842017-01-31 Jakub Jelinek <jakub@redhat.com>
2685
2686 PR c++/79304
2687 * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
2688 after ARROW_EXPR.
2689
fcb2cdfc
DM
26902017-01-31 David Malcolm <dmalcolm@redhat.com>
2691
2692 PR c++/79298
2693 * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
2694 any namespace aliases.
2695
7f357c61
NS
26962017-01-31 Nathan Sidwell <nathan@acm.org>
2697
5ae37bdf
NS
2698 PR c++/79290
2699 * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
2700
de3fbef6
NS
2701 PR c++/67273
2702 PR c++/79253
2703 * pt.c: (instantiate_decl): Push to top level when current
2704 function scope doesn't match. Only push lmabda scope stack when
2705 pushing to top.
2706
1a5bac38
NS
2707 * cp-tree.h (instantiate_decl): Make defer_ok bool.
2708 * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
2709 (instantiate_decl): Simplify and reorder state saving and restoration.
2710
7f357c61
NS
2711 PR c++/79264
2712 * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
2713 * semantics.c (finish_member_declaration): Assert class is being
2714 defined.
2715
8db29d88
AO
27162017-01-30 Alexandre Oliva <aoliva@redhat.com>
2717
2718 Introduce C++ support in libcc1.
2719 * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
2720 (ansi_opname): Rename to...
2721 (cp_operator_id): ... this. Adjust all callers.
2722 (ansi_assopname): Rename to...
2723 (cp_assignment_operator_id): ... this. Adjust all callers.
2724 (cp_literal_operator_id): Declare.
2725 (set_global_friend): Declare.
2726 (is_global_friend): Declare.
2727 (enum cp_oracle_request): New type.
2728 (cp_binding_oracle_function): New type.
2729 (cp_binding_oracle): Declare.
2730 (cp_finish_injected_record_type): Declare.
2731 * friend.c (global_friend): New var.
2732 (set_global_friend): New fn.
2733 (is_global_friend): New fn.
2734 (is_friend): Call is_global_friend.
2735 * name-lookup.c (cp_binding_oracle): New var.
2736 (query_oracle): New fn.
2737 (qualified_lookup_using_namespace): Call query_oracle.
2738 (lookup_name_real_1): Likewise.
2739 * parser.c (cp_literal_operator_id): Drop static.
2740 * search.c (friend_accessible_p): Call is_global_friend.
2741 * semantics.c (is_this_parameter): Accept a variable if the
2742 binding oracle is enabled.
2743
20f058d0
JM
27442017-01-27 Jason Merrill <jason@redhat.com>
2745
2746 PR c++/78771 - ICE with inherited constructor.
2747 * call.c (build_over_call): Call deduce_inheriting_ctor here.
2748 * pt.c (tsubst_decl): Not here.
2749 * class.c (add_method): Or here.
2750 * method.c (deduce_inheriting_ctor): Handle clones.
2751 (implicitly_declare_fn): Don't deduce inheriting ctors yet.
2752
bb6a6ee9
AB
27532017-01-27 Adam Butcher <adam@jessamine.co.uk>
2754
2755 PR c++/64382
2756 * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
2757 New function.
2758 * cp/cp-tree.h: Declare it.
2759 * cp/semantics.c (finish_id_expression): Resolve names within a default
2760 capturing generic lambda defined within a template prior to
2761 instantiation to allow for captures to be added to the closure type.
2762
905d2812
JJ
27632017-01-26 Jakub Jelinek <jakub@redhat.com>
2764
2765 PR c++/68727
2766 * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
2767 * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
2768 * parser.c (cp_parser_builtin_offsetof): Pass result of
2769 build_static_cast of null_pointer_node to finish_offsetof.
2770 * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
2771 it for -Winvalid-offsetof pedwarn instead of trying to guess
2772 original offsetof type from EXPR. Save OBJECT_PTR as a new
2773 second operand to OFFSETOF_EXPR.
2774 * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
2775 finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
2776 as OBJECT_PTR.
2777
effdaefe
JM
27782017-01-26 Jason Merrill <jason@redhat.com>
2779
5668970a
JM
2780 * name-lookup.c (parse_using_directive): Deprecate strong using.
2781
effdaefe
JM
2782 PR c++/79176 - lambda ICE with -flto -Os
2783 * decl2.c (vague_linkage_p): Handle decloned 'tors.
2784 * tree.c (decl_linkage): Likewise.
2785
58feaa5f
MS
27862017-01-25 Martin Sebor <msebor@redhat.com>
2787
9f35c953 2788 * decl.c (grokdeclarator): Fix a typo in a comment.
58feaa5f 2789
0e343868
JJ
27902017-01-25 Jakub Jelinek <jakub@redhat.com>
2791
a25608aa
JJ
2792 PR c++/78896
2793 * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
2794 lambda expressions.
2795
0e343868
JJ
2796 PR c++/77914
2797 * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
2798 OPT_Wpedantic on lambda templates for -std=c++14 and higher.
2799
e5e391d6
MO
28002017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
2801
2802 PR lto/79061
2803 * decl.c (cxx_init_decl_processing): Pass main_input_filename
2804 to build_translation_unit_decl.
2805
7cfd79d6
JJ
28062017-01-24 Jakub Jelinek <jakub@redhat.com>
2807
2808 PR c++/79205
2809 * cp-gimplify.c (cp_genericize_r): Add result of
2810 convert_from_reference on invisiref parm to p_set.
2811
3e4b91f2
NS
28122017-01-24 Nathan Sidwell <nathan@acm.org>
2813
1d7bc790
NS
2814 PR c++/78469 - defaulted ctor and inaccessible dtor
2815 * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
2816 * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
2817 * tree.c (build_target_expr): Check tf_no_cleanup.
2818
3e4b91f2
NS
2819 PR c++/79118 - anon-members and constexpr
2820 * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
2821 ctor decl. Recursively check anonymous members.
2822 (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
2823 call.
2824 (explain_invalid_constexpr_fn): Likewise.
2825
e6b8075c
NS
28262017-01-23 Nathan Sidwell <nathan@acm.org>
2827
fc7612fd
NS
2828 PR c++/71710 - template using directive of field
2829 * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
2830 check earlier.
2831
e6b8075c
NS
2832 PR c++/71406 - ICE with scope-ref'd template id exprs
2833 PR c++/77508
2834 * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
2835 before breaking up TEMPLATE_ID_EXPR.
2836
4b9f2115
NS
28372017-01-20 Nathan Sidwell <nathan@acm.org>
2838
2839 PR c++/78495 - wrong code inherited ctor and invisi-ref parm
2840 * cp-gimplify.c (cp_generize_r): Don't skip thunks.
2841
ebed7175
DM
28422017-01-20 David Malcolm <dmalcolm@redhat.com>
2843
2844 PR c++/77829
2845 PR c++/78656
2846 * cp-tree.h (suggest_alternatives_for): Add bool param.
2847 (suggest_alternative_in_explicit_scope): New decl.
2848 * error.c (qualified_name_lookup_error): When SCOPE is a namespace
2849 that isn't the global one, call new function
2850 suggest_alternative_in_explicit_scope, only calling
2851 suggest_alternatives_for if it fails, and disabling near match
2852 searches fort that case. When SCOPE is the global namespace,
2853 pass true for new param to suggest_alternatives_for to allow for
2854 fuzzy name lookups.
2855 * lex.c (unqualified_name_lookup_error): Pass true for new param
2856 to suggest_alternatives_for.
2857 * name-lookup.c (consider_binding_level): Add forward decl.
2858 (suggest_alternatives_for): Add "suggest_misspellings" param,
2859 using it to conditionalize the fuzzy name-lookup code.
2860 (suggest_alternative_in_explicit_scope): New function.
2861 * parser.c (cp_parser_primary_expression): When calling
2862 finish_id_expression, pass location of id_expression rather
2863 than that of id_expr_token.
2864 (cp_parser_id_expression): Convert local "unqualified_id" from
2865 tree to cp_expr to avoid implicitly dropping location information.
2866
2ebd93e1
MP
28672017-01-20 Marek Polacek <polacek@redhat.com>
2868
2869 PR c/64279
2870 * call.c (build_conditional_expr_1): Warn about duplicated branches.
2871 * semantics.c (finish_expr_stmt): Build statement using the proper
2872 location.
2873
0655c6d5
JM
28742017-01-19 Jason Merrill <jason@redhat.com>
2875
b2c06d05
JM
2876 US 20 - forwarding references and class template argument deduction
2877 * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
2878 * pt.c (push_template_decl_real): Set it.
2879 (maybe_adjust_types_for_deduction): Check it.
2880 (rewrite_template_parm): Copy it.
2881
689f867c
JM
2882 US 19 - deduction guides and constructors
2883 * call.c (joust): Prefer deduction guides to constructors.
2884 * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
2885 (deduction_guide_p): Check DECL_P.
2886
a0889599
JM
2887 * decl.c (check_initializer): Always use build_aggr_init for array
2888 decomposition.
2889
0655c6d5
JM
2890 PR c++/79130 - decomposition and direct-initialization
2891 * init.c (build_aggr_init): Communicate direct-initialization to
2892 build_vec_init.
2893 (build_vec_init): Check for array copy sooner.
2894 * parser.c (cp_parser_decomposition_declaration): Remove call to
2895 build_x_compound_expr_from_list.
2896
8b1346a8
JM
28972017-01-18 Jason Merrill <jason@redhat.com>
2898
2899 PR c++/68666 - member variable template-id
2900 * typeck.c (finish_class_member_access_expr): Handle variable
2901 template-id.
2902 * pt.c (lookup_and_finish_template_variable): No longer static.
2903 * cp-tree.h: Declare it.
2904
c484627c
NS
29052017-01-18 Nathan Sidwell <nathan@acm.org>
2906
2907 PR c++/78488
2908 * call.c (build_over_call): When checking ellipsis conversions for
2909 an inherited ctor, make sure there is at least one conversion.
2910
46c4e8a1 29112017-01-18 Jason Merrill <jason@redhat.com>
e3aeb9d3
JM
2912
2913 PR c++/78894 - ICE with class deduction and default arg
2914 * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
2915
0c6299bb
MT
29162017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
2917
2918 PR c++/77489
2919 * mangle.c (write_discriminator): Reorganize abi warning check.
2920
2c65d990
NS
29212017-01-18 Nathan Sidwell <nathan@acm.org>
2922
96176bb3
NS
2923 * cp-tree.h: Clarify exception spec node comment.
2924 * except.c (nothrow_spec_p): Simplify by checking node-equality.
2925
2c65d990
NS
2926 PR c++/79091
2927 * mangle.c (write_exception_spec): Check nothrow explicitly.
2928 (write_encoding): Don't increment processing_template_decl around
2929 encoding.
2930
4bbc35f3
MT
29312017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
2932
2933 PR c++/70182
2934 * mangle.c (write_template_args): Add "on" for operator names.
2935
f6efea51
MT
29362017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
2937
2938 PR c++/77489
2939 * mangle.c (write_discriminator): Handle discriminator >= 10.
2940
8ddfdbc2
NS
29412017-01-17 Nathan Sidwell <nathan@acm.org>
2942
2943 PR c++/61636
2944 * cp-tree.h (maybe_generic_this_capture): Declare.
2945 * lambda.c (resolvable_dummy_lambda): New, broken out of ...
2946 (maybe_resolve_dummy): ... here. Call it.
2947 (maybe_generic_this_capture): New.
2948 * parser.c (cp_parser_postfix_expression): Speculatively capture
2949 this in generic lambda in unresolved member function call.
2950 * pt.c (tsubst_copy_and_build): Force hard error from failed
2951 member function lookup in generic lambda.
2952
893ffa2c
AH
29532017-01-17 Aldy Hernandez <aldyh@redhat.com>
2954
2955 PR c++/70565
2956 * cp-array-notation.c (expand_array_notation_exprs): Handle
2957 OMP_PARALLEL.
2958
91d01bf4
JM
29592017-01-11 Jason Merrill <jason@redhat.com>
2960
2961 PR c++/78337 - ICE on invalid with generic lambda
2962 * semantics.c (process_outer_var_ref): Check if containing_function
2963 is null. Move inform call under complain test.
2964
01bfd257
NS
29652017-01-11 Nathan Sidwell <nathan@acm.org>
2966
2967 PR c++/77812
2968 * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
2969 is a new overload.
2970
5b33cc83
NS
29712017-01-11 Nathan Sidwell <nathan@acm.org>
2972
2973 * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
2974
6b5b4e9c
JJ
29752017-01-11 Jakub Jelinek <jakub@redhat.com>
2976
1f258a55
JJ
2977 PR c++/78341
2978 * parser.c (cp_parser_std_attribute_spec): Remove over-eager
2979 assertion. Formatting fix.
2980
6b5b4e9c
JJ
2981 PR c++/72813
2982 * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
2983 writing PCH file.
2984
b9f4757f
DM
29852017-01-10 David Malcolm <dmalcolm@redhat.com>
2986
2987 PR c++/77949
2988 * parser.c (cp_parser_class_specifier_1): Only suggest inserting
2989 a missing semicolon if we have a valid insertion location for
2990 the fix-it hint.
2991
2af5cb50
JM
29922017-01-10 Jason Merrill <jason@redhat.com>
2993
2994 FI 20, decomposition declaration with parenthesized initializer.
2995 * parser.c (cp_parser_decomposition_declaration): Use
2996 cp_parser_initializer.
2997
f4da28a0
JM
29982017-01-09 Jason Merrill <jason@redhat.com>
2999
3000 Implement P0195R2, C++17 variadic using.
3001 * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
3002 * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
3003 * error.c (dump_decl): Likewise.
3004
bd2c6270
JJ
30052017-01-09 Jakub Jelinek <jakub@redhat.com>
3006
3007 PR translation/79019
3008 PR translation/79020
3009 * semantics.c (finish_omp_clauses): Add missing whitespace to
3010 translatable strings.
3011 * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
3012
38285dd7
JM
30132017-01-07 Jason Merrill <jason@redhat.com>
3014
3015 PR c++/78948 - instantiation from discarded statement
3016 * parser.h (struct cp_parser): Remove in_discarded_stmt field.
3017 * cp-tree.h (in_discarded_stmt): Declare it.
3018 (struct saved_scope): Add discarded_stmt bitfield.
3019 (in_discarded_stmt): New macro.
3020 * decl2.c (mark_used): Check it.
3021 * parser.c (cp_parser_selection_statement): Adjust.
3022 (cp_parser_jump_statement): Adjust.
3023
962c5679
JJ
30242017-01-05 Jakub Jelinek <jakub@redhat.com>
3025
26f20371
JJ
3026 PR c++/78931
3027 * decl.c (cp_finish_decomp): Remove probe variable, if tt is
3028 REFERENCE_REF_P, set tt to its operand.
3029
962c5679
JJ
3030 PR c++/78890
3031 * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
3032 unions even for C++11 and later.
3033
dc7650cc
NS
30342017-01-05 Nathan Sidwell <nathan@acm.org>
3035
3036 PR c++/78765
3037 * pt.c (convert_nontype_argument): Don't try and see if integral
3038 or enum expressions are constants prematurely.
3039
a9342885
MP
30402017-01-04 Marek Polacek <polacek@redhat.com>
3041
3042 PR c++/64767
3043 * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
3044 a zero character literal.
3045
066435fe
JJ
30462017-01-04 Jakub Jelinek <jakub@redhat.com>
3047
abec4284
JJ
3048 PR c++/78949
3049 * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
3050 vector type.
3051
26c43e27
JJ
3052 PR c++/78693
3053 * parser.c (cp_parser_simple_declaration): Only complain about
3054 inconsistent auto deduction if auto_result doesn't use auto.
3055
c9cf3863
JJ
3056 * parser.c (cp_parser_simple_declaration): Diagnose function
3057 declaration among more than one init-declarators with auto
3058 specifier.
3059
066435fe
JJ
3060 PR c++/71182
3061 * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
3062 assertion, as lexer->buffer may be NULL.
3063
baf9ebc8
MP
30642017-01-04 Marek Polacek <polacek@redhat.com>
3065
3066 PR c++/77545
3067 PR c++/77284
3068 * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
3069
4bf07f3f
NS
30702017-01-04 Nathan Sidwell <nathan@acm.org>
3071
3072 PR c++/66735
3073 * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
3074 (lambda_capture_field_type): Update prototype.
3075 * lambda.c (lambda_capture_field_type): Add is_reference parm.
3076 Add referenceness here.
3077 (add_capture): Adjust lambda_capture_field_type call, refactor
3078 error checking.
3079 * pt.c (tsubst): Adjust lambda_capture_field_type call.
3080
cbe34bb5 30812017-01-01 Jakub Jelinek <jakub@redhat.com>
5624e564
JJ
3082
3083 Update copyright years.
ad41bd84 3084\f
cbe34bb5 3085Copyright (C) 2017 Free Software Foundation, Inc.
ad41bd84
JM
3086
3087Copying and distribution of this file, with or without modification,
3088are permitted in any medium without royalty provided the copyright
3089notice and this notice are preserved.