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