]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/cp/ChangeLog
tree-core.h (struct attribute_spec): Swap affects_type_identity and handler fields.
[thirdparty/gcc.git] / gcc / cp / ChangeLog
CommitLineData
4849deb1
JJ
12017-12-15 Jakub Jelinek <jakub@redhat.com>
2
3 * tree.c (cxx_attribute_table, std_attribute_table): Swap
4 affects_type_identity and handler fields, adjust comments.
5
0cf4820d
NS
62017-12-15 Nathan Sidwell <nathan@acm.org>
7
8 PR c++/59930
9 * decl.c (xref_tag_1): Correct comments about template friends and
10 default args.
11 * friend.c (make_friend_class): Move comments concerning
12 self-friendliness to code dealing with such.
13 * pt.c (check_default_tmpl_args): Deal with template friend
14 classes too.
15 (push_template_decl_real): Check default args for non-function
16 template friends.
17
c65e18d3
BE
182017-12-14 Bernd Edlinger <bernd.edlinger@hotmail.de>
19
20 * decl2.c (start_static_storage_duration_function): Avoid warning.
21 * typeck.c (cxx_safe_arg_type_equiv_p,
22 cxx_safe_function_type_cast_p): New function.
23 (build_reinterpret_cast_1): Implement -Wcast-function-type.
24
9096c2c5
JJ
252017-12-14 Jakub Jelinek <jakub@redhat.com>
26
27 PR c++/79650
28 * pt.c (convert_nontype_argument): Diagnose
29 reduced_constant_expression_p expressions that aren't INTEGER_CST.
30
ae51fb47
PC
312017-12-13 Paolo Carlini <paolo.carlini@oracle.com>
32
33 PR c++/81061
34 * typeck.c (cp_build_modify_expr): Upon cxx_readonly_error
35 immediately return error_mark_node.
36
2b031ef4
NS
372017-12-13 Nathan Sidwell <nathan@acm.org>
38
39 PR c++/15272
40 * pt.c (tsubst_baselink): Don't repeat the lookup for
41 non-dependent baselinks.
42
5eb63cfd
JM
432017-12-12 Jason Merrill <jason@redhat.com>
44
48f43f95
JM
45 * decl.c (value_dependent_init_p): Check the type of a CONSTRUCTOR.
46 (type_dependent_init_p): Remove.
47
5eb63cfd
JM
48 PR c++/82115 - ICE with variable initialized with its own address.
49 * cp-tree.h (struct lang_decl_base): Add dependent_init_p.
50 (DECL_DEPENDENT_INIT_P, SET_DECL_DEPENDENT_INIT_P): New.
51 * decl.c (cp_finish_decl): Set it.
52 (duplicate_decls): Copy it.
53 * pt.c (tsubst_decl): Clear it.
54 (value_dependent_expression_p): Revert earlier change. Check it.
55
96a95ac1
AO
562017-12-12 Alexandre Oliva <aoliva@redhat.com>
57
58 * constexpr.c (check_constexpr_ctor_body_1): Skip begin stmt
59 markers.
60 (constexpr_fn_retval): Likewise.
61 (potential_constant_expression_1): Likewise.
62 (cxx_eval_statement_list): Check that a begin stmt marker is
63 not used as the value of a statement list.
64 (cxx_eval_constant_expression): Return begin stmt markers
65 unchanged.
66 * cp-array-notation.c (stmt_location): New.
67 (cp_expand_cond_array_notations): Use it.
68 * cp-objcp-common.h (LANG_HOOKS_EMITS_BEGIN_STMT): Redefine as true.
69 * parser.c (add_debug_begin_stmt): New.
70 (cp_parser_statement): Call it.
71 * pt.c (tsubst_copy): Handle begin stmt markers.
72
5d9ae53d
MS
732017-12-07 Martin Sebor <msebor@redhat.com>
74
75 PR c/81544
76 * cp-tree.h (decls_match): Add default argument.
77 * decl.c (decls_match): Avoid calling into the target back end
78 and triggering an error.
79 * decl2.c (cplus_decl_attributes): Look up existing declaration and
80 pass it to decl_attributes.
81 * tree.c (cxx_attribute_table): Initialize new member of struct
82 attribute_spec.
83
91c95da8
JJ
842017-12-06 Jakub Jelinek <jakub@redhat.com>
85
86 PR c++/80259
87 * decl2.c (grokfield): Diagnose = delete redefinition of a friend.
88
c965919a
JM
892017-12-06 Jason Merrill <jason@redhat.com>
90
c25ac927
JM
91 * call.c (convert_for_arg_passing): Pass NULL_TREE to
92 targetm.calls.promote_prototypes.
93 (type_passed_as): Likewise.
94
c965919a
JM
95 PR c++/82115 - ICE with variable initialized with its own address.
96 * pt.c (value_dependent_expression_p): Add lval parameter. Don't
97 consider DECL_INITIAL if it's true.
98
c79144f8
DM
992017-12-06 David Malcolm <dmalcolm@redhat.com>
100
101 PR c/83236
102 * name-lookup.c (consider_binding_level): Don't suggest names that
103 are reserved for use by the implementation.
104
613bc14f
DM
1052017-12-06 David Malcolm <dmalcolm@redhat.com>
106
107 * name-lookup.c: Include "c-family/c-spellcheck.h".
108
53943619
JM
1092017-12-05 Jason Merrill <jason@redhat.com>
110
111 PR c++/82331 - ICE with variadic partial specialization of auto
112 * pt.c (unify) [TEMPLATE_PARM_INDEX]: Set processing_template_decl
113 around call to tsubst.
114
ea9e71de
NS
1152017-12-05 Nathan Sidwell <nathan@acm.org>
116
117 PR c++/83287
118 * tree.c (build_min): Check CAST_EXPR arg for OVERLOADs.
119
05abad4c
ML
1202017-12-05 Martin Liska <mliska@suse.cz>
121 Jakub Jelinek <jakub@redhat.com>
122
123 * typeck.c (pointer_diff): Add new argument and instrument
124 pointer subtraction.
125 (cp_build_binary_op): Create compound expression if doing an
126 instrumentation.
127
81e4859a
JJ
1282017-12-05 Jakub Jelinek <jakub@redhat.com>
129
130 * cp-gimplify.c (cp_maybe_instrument_return): Don't add
131 __builtin_unreachable if -O0 or if -fsanitize=unreachable.
132
899ac3b8
JM
1332017-12-04 Jason Merrill <jason@redhat.com>
134
135 PR c++/83273 - constexpr if allows non-constant condition
136 * semantics.c (finish_if_stmt_cond): Use require_constant_expression
137 rather than is_constant_expression.
138 * constexpr.c (potential_constant_expression_1) [LAMBDA_EXPR]: Allow
139 in C++17.
140
f2b8b8ad
JM
1412017-12-01 Jason Merrill <jason@redhat.com>
142
b3e862e0
JM
143 Give #include hints for <complex>.
144 * name-lookup.c (get_std_name_hint): Add <complex>.
145 * parser.c (cp_parser_diagnose_invalid_type_name): Call
146 suggest_alternative_in_explicit_scope.
147 (cp_parser_namespace_name): Likewise.
148
f2b8b8ad
JM
149 PR c++/79228 - extensions hide C++14 complex literal operators
150 * parser.c (cp_parser_userdef_numeric_literal): Be helpful about
151 'i' in C++14 and up.
152
65791f42
JJ
1532017-12-01 Jakub Jelinek <jakub@redhat.com>
154
e76c7157
JJ
155 * parser.c (cp_parser_new): Don't clear cilk_simd_fn_info.
156 (parsing_nsdmi): Adjust comment.
157 (cp_parser_omp_for_loop_init): Likewise.
158 * parser.h (struct cp_omp_declare_simd_data): Adjust comment.
159 (struct cp_parser): Remove cilk_simd_fn_info field.
160 * cp-tree.h (cilk_valid_spawn): Remove.
161
65791f42
JJ
162 PR c/79153
163 * cp-gimplify.c (genericize_switch_stmt): Emit LABEL_EXPR for the
164 break label into SWITCH_BODY instead of after it and set
165 SWITCH_BREAK_LABEL_P on it.
166 * parser.c (cp_parser_objc_expression): Add FALLTHRU comment to avoid
167 -Wimplicit-fallthrough warning.
168
2d11897a
JM
1692017-11-30 Jason Merrill <jason@redhat.com>
170
171 PR c++/82219 - bogus -Wignored-qualifiers with template
172 * pt.c (tsubst_copy_and_build) [STATIC_CAST_EXPR]: Suppress
173 -Wignored-qualifiers.
174
591996ba
DM
1752017-11-29 David Malcolm <dmalcolm@redhat.com>
176
177 * parser.c (cp_parser_unary_expression): Generate a location for
178 "noexcept".
179 (cp_parser_trait_expr): Generate and return a location_t,
180 converting the return type from tree to cp_expr.
181 (cp_parser_static_assert): Pass location of the condition to
182 finish_static_assert, rather than that of the "static_assert"
183 token, where available.
184
cc6fe784
PC
1852017-11-29 Paolo Carlini <paolo.carlini@oracle.com>
186
187 PR c++/82293
188 * lambda.c (nonlambda_method_basetype): Don't use LAMBDA_TYPE_P
189 on a null type.
190
e3704417
JM
1912017-11-29 Jason Merrill <jason@redhat.com>
192
193 PR c++/82760 - memory corruption with aligned new.
194 * call.c (build_operator_new_call): Update *args if we add the
195 align_arg.
196
1a2e9708
JJ
1972017-11-28 Jakub Jelinek <jakub@redhat.com>
198
199 PR sanitizer/81275
200 * cp-tree.h (SWITCH_STMT_ALL_CASES_P): Define.
201 (SWITCH_STMT_NO_BREAK_P): Define.
202 (note_break_stmt, note_iteration_stmt_body_start,
203 note_iteration_stmt_body_end): Declare.
204 * decl.c (struct cp_switch): Add has_default_p, break_stmt_seen_p
cc6fe784 205 and in_loop_body_p fields.
1a2e9708
JJ
206 (push_switch): Clear them.
207 (pop_switch): Set SWITCH_STMT_CANNOT_FALLTHRU_P if has_default_p
208 and !break_stmt_seen_p. Assert in_loop_body_p is false.
209 (note_break_stmt, note_iteration_stmt_body_start,
210 note_iteration_stmt_body_end): New functions.
211 (finish_case_label): Set has_default_p when both low and high
212 are NULL_TREE.
213 * parser.c (cp_parser_iteration_statement): Use
214 note_iteration_stmt_body_start and note_iteration_stmt_body_end
215 around parsing iteration body.
216 * pt.c (tsubst_expr): Likewise.
217 * cp-objcp-common.c (cxx_block_may_fallthru): Return false for
218 SWITCH_STMT which contains no BREAK_STMTs, contains a default:
219 CASE_LABEL_EXPR and where SWITCH_STMT_BODY isn't empty and
220 can't fallthru.
221 * semantics.c (finish_break_stmt): Call note_break_stmt.
222 * cp-gimplify.c (genericize_switch_stmt): Copy SWITCH_STMT_ALL_CASES_P
223 bit to SWITCH_ALL_CASES_P. Assert that if SWITCH_STMT_NO_BREAK_P then
224 the break label is not TREE_USED.
225
5e9d6aa4
JK
2262017-11-28 Julia Koval <julia.koval@intel.com>
227 Sebastian Peryt <sebastian.peryt@intel.com>
228
229 * Make-lang.in (cp/cp-array-notation.o, cp/cp-cilkplus.o): Delete.
230 * call.c (convert_for_arg_passing, build_cxx_call): Remove cilkplus.
231 * constexpr.c (potential_constant_expression_1): Ditto.
232 * cp-array-notation.c: Delete.
233 * cp-cilkplus.c: Ditto.
234 * cp-cilkplus.h: Ditto.
235 * cp-gimplify.c (cp_gimplify_expr, cp_fold_r, cp_genericize): Remove
236 cilkplus condition.
237 * cp-objcp-common.c (ARRAY_NOTATION_REF): Delete.
238 * cp-tree.h (cilkplus_an_triplet_types_ok_p): Delete.
239 * decl.c (grokfndecl, finish_function): Remove cilkplus condition.
240 * error.c (dump_decl, dump_expr): Remove ARRAY_NOTATION_REF condition.
241 * lambda.c (cp-cilkplus.h): Remove.
242 * parser.c (cp_parser_cilk_simd, cp_parser_cilk_for,
243 cp_parser_cilk_simd_vectorlength): Delete.
244 (cp_debug_parser, cp_parser_ctor_initializer_opt_and_function_body,
245 cp_parser_postfix_expression,
246 cp_parser_postfix_open_square_expression,
247 cp_parser_statement, cp_parser_jump_statement,
248 cp_parser_direct_declarator,
249 cp_parser_late_return_type_opt, cp_parser_gnu_attribute_list,
250 cp_parser_omp_clause_name, cp_parser_omp_clause_aligned,
251 cp_parser_omp_clause_linear, cp_parser_omp_all_clauses,
252 cp_parser_omp_flush,
253 cp_parser_omp_for_cond, cp_parser_omp_for_incr,
254 cp_parser_omp_for_loop_init,
255 cp_parser_omp_for_loop,
256 cp_parser_omp_declare_simd): Remove cilkplus support.
257 (CILK_SIMD_FN_CLAUSE_MASK, cp_parser_late_parsing_cilk_simd_fn_info,
258 cp_parser_cilk_grainsize): Remove.
259 (cp_parser_pragma, c_parse_file): Remove cilkplus support.
260 (cp_parser_cilk_simd_vectorlength, cp_parser_cilk_simd_linear,
261 cp_parser_cilk_simd_clause_name, cp_parser_cilk_simd_all_clauses,
262 cp_parser_cilk_simd, cp_parser_cilk_for): Remove.
263 * parser.h (IN_CILK_SIMD_FOR, IN_CILK_SPAWN): Remove.
264 * pt.c (tsubst_attribute, tsubst_expr, tsubst_copy_and_build): Remove
265 cilkplus support.
266 * semantics.c (finish_goto_stmt, begin_while_stmt, finish_do_body,
267 finish_init_stmt, finish_switch_cond, simplify_aggr_init_expr,
268 finish_omp_clauses, finish_omp_clauses, finish_omp_for): Remove
269 cilkplus
270 support.
271 * tree.c (lvalue_kind): Remove ARRAY_NOTATION_REF conditon.
272 * typeck.c (cp_build_array_ref, cp_build_compound_expr,
273 check_return_expr): Remove cilkplus support.
274
9e851845
JJ
2752017-11-28 Jakub Jelinek <jakub@redhat.com>
276
277 * cp-gimplify.c (genericize_switch_stmt): Build SWITCH_EXPR using
278 build2_loc instead of build3_loc.
279
9ca1eaac
MS
2802017-11-27 Martin Sebor <msebor@redhat.com>
281
282 PR c++/83058
283 * init.c (warn_placement_new_too_small): Use offset_int instead of
284 HOST_WIDE_INT.
285
de3d4fd0
JJ
2862017-11-27 Jakub Jelinek <jakub@redhat.com>
287
288 PR c++/81888
289 * parser.c (cp_parser_decomposition_declaration): Reject just
290 BRACE_ENCLOSED_INITIALIZER_P initializers with nelts != 1 rather
291 than all such CONSTRUCTORs, and only if is_direct_init is true.
292
528c7559
JM
2932017-11-27 Jason Merrill <jason@redhat.com>
294
295 * pt.c (primary_template_specialization_p): Rename from
296 primary_template_instantiation_p. Don't check
297 DECL_TEMPLATE_INSTANTIATION.
298 * call.c, cp-tree.h, decl2.c: Adjust.
299
cb358080
JJ
3002017-11-27 Jakub Jelinek <jakub@redhat.com>
301
302 PR c++/81675
303 * cp-gimplify.c (cp_fold) <case COND_EXPR>: Don't return immediately
304 for VOID_TYPE_P COND_EXPRs, instead fold the operands and if op0 is
305 INTEGER_CST, ensure that both op1 and op2 are non-NULL and fall
306 through into normal folding, otherwise just rebuild x if any op
307 changed.
308
cb358080 3092017-11-14 Boris Kolpackov <boris@codesynthesis.com>
8c7dbea9
BK
310
311 * Make-lang.in (c++.install-plugin): Install backend import library.
312
9c378aa9
JJ
3132017-11-23 Jakub Jelinek <jakub@redhat.com>
314
315 * parser.c (cp_parser_omp_declare): Change return type to bool from
316 void, return true for declare simd.
317 (cp_parser_pragma): Return cp_parser_omp_declare returned value
318 rather than always false.
319
ac9effed
EB
3202017-11-23 Mike Stump <mikestump@comcast.net>
321 Eric Botcazou <ebotcazou@adacore.com>
322
323 * pt.c (tsubst_expr) <ANNOTATE_EXPR>: Recurse on 3rd operand.
324 * semantics.c (finish_while_stmt_cond): Pass 3rd operand to
325 ANNOTATE_EXPR.
326 (finish_do_stmt): Likewise.
327 (finish_for_cond): Likewise.
328
6c19e703
JJ
3292017-11-22 Jakub Jelinek <jakub@redhat.com>
330
331 PR c++/82401
332 * name-lookup.c (member_name_cmp): Return 0 if a == b.
333
ce95abc4
DM
3342017-11-22 David Malcolm <dmalcolm@redhat.com>
335
336 PR c++/62170
337 * error.c (type_to_string): Add leading comment. Add params
338 "postprocessed", "quote", and "show_color", using them to fix
339 quoting of the "aka" for types involving typedefs.
340 (arg_to_string): Update for new params to type_to_string.
341 (cxx_format_postprocessor::handle): Likewise.
342 (cp_printer): Convert penultimate param from bool to bool *.
343 Update call to type_to_string and calls to
344 defer_phase_2_of_type_diff.
345
974aedcc
MP
3462017-11-22 Marek Polacek <polacek@redhat.com>
347
348 PR c++/60336
349 PR middle-end/67239
350 PR target/68355
351 * class.c (layout_class_type): Set DECL_PADDING_P on padding.
352 * decl.c (cxx_init_decl_processing): Set TRANSLATION_UNIT_WARN_EMPTY_P.
353 (grokdeclarator): Set DECL_PADDING_P on unnamed bit-fields.
354
84fa214d
ML
3552017-11-21 Martin Liska <mliska@suse.cz>
356
357 * class.c (finalize_literal_type_property): Add quotes for
358 constexpr keyword.
359 (explain_non_literal_class): Likewise.
360 * constexpr.c (ensure_literal_type_for_constexpr_object): Likewise.
361 (is_valid_constexpr_fn): Likewise.
362 (check_constexpr_ctor_body): Likewise.
363 (register_constexpr_fundef): Likewise.
364 (explain_invalid_constexpr_fn): Likewise.
365 (cxx_eval_builtin_function_call): Likewise.
366 (cxx_eval_call_expression): Likewise.
367 (cxx_eval_loop_expr): Likewise.
368 (potential_constant_expression_1): Likewise.
369 * decl.c (check_previous_goto_1): Likewise.
370 (check_goto): Likewise.
371 (grokfndecl): Likewise.
372 (grokdeclarator): Likewise.
373 * error.c (maybe_print_constexpr_context): Likewise.
374 * method.c (process_subob_fn): Likewise.
375 (defaulted_late_check): Likewise.
376 * parser.c (cp_parser_compound_statement): Likewise.
377
1af4ebf5
MG
3782017-11-21 Marc Glisse <marc.glisse@inria.fr>
379
380 * constexpr.c (cxx_eval_constant_expression,
381 potential_constant_expression_1): Handle POINTER_DIFF_EXPR.
382 * cp-gimplify.c (cp_fold): Likewise.
383 * error.c (dump_expr): Likewise.
384 * typeck.c (pointer_diff): Use POINTER_DIFF_EXPR.
385
7768f20b
JJ
3862017-11-21 Jakub Jelinek <jakub@redhat.com>
387
388 P0428R2 - familiar template syntax for generic lambdas
389 * parser.c (cp_parser_lambda_declarator_opt): Don't pedwarn
390 for cxx2a and above, reword pedwarn for C++14/C++17.
391
26edace6
DM
3922017-11-20 David Malcolm <dmalcolm@redhat.com>
393
394 PR c/81404
395 * name-lookup.c: Include "c-family/known-headers.h"
396 (lookup_name_fuzzy): Call get_cp_stdlib_header_for_name and
397 potentially return a new suggest_missing_header hint.
398
01ada121
DM
3992017-11-20 David Malcolm <dmalcolm@redhat.com>
400
401 PR c++/72786
402 * name-lookup.c (class macro_use_before_def): New class.
403 (lookup_name_fuzzy): Detect macro that were used before being
404 defined, and report them as such.
405
753c2e69
JM
4062017-11-20 Jason Merrill <jason@redhat.com>
407
408 * decl2.c (constrain_class_visibility): Don't warn about artificial
409 fields.
410
d68ddd2b
JJ
4112017-11-20 Jakub Jelinek <jakub@redhat.com>
412
413 P0329R4: Designated Initialization
414 * parser.c (cp_parser_initializer_clause): List in comment grammar
415 designated-initializer-list.
416 (cp_parser_initializer_list): Allow .identifier = without pedwarn for
417 C++2A, parse .identifier { ... }. Improve location_t argument to
418 pedwarn. Add pedwarn for [cst] = designators. Diagnose ... in
419 designated initializer list. Diagnose mixing designated and
420 non-designated initializer clauses for C++2A. Diagnose duplicated
421 identifiers in designators.
422 * name-lookup.h (search_anon_aggr): New declaration.
423 * name-lookup.c (fields_linear_search): Use search_anon_aggr.
424 (search_anon_aggr): New function.
425 * typeck2.c (process_init_constructor_record): Allow designator
426 to skip over some non-static data members. Handle anonymous
427 aggregates. Add diagnostics for designator order not matching
428 member declaration order.
429
6c7a259b
DM
4302017-11-20 David Malcolm <dmalcolm@redhat.com>
431
432 * name-lookup.c: Define INCLUDE_UNIQUE_PTR before including system.h.
433 Include "c-family/name-hint.h"
434 (suggest_alternatives_for): Convert "fuzzy_name" from const char *
435 to name_hint, and rename to "hint". Pass location to
436 lookup_name_fuzzy.
437 (lookup_name_fuzzy): Convert return type from const char *
438 to name_hint. Add location_t param.
439 * parser.c: Define INCLUDE_UNIQUE_PTR before including system.h.
440 Include "c-family/name-hint.h"
441 (cp_parser_diagnose_invalid_type_name): Convert
442 "suggestion" from const char * to name_hint, and rename to "hint".
443 Pass location to lookup_name_fuzzy.
444
6aa80414
NS
4452017-11-20 Nathan Sidwell <nathan@acm.org>
446
447 PR c++/82878
448 PR c++/78495
449 * call.c (build_call_a): Don't set CALL_FROM_THUNK_P for inherited
450 ctor.
451 * cp-gimplify.c (cp_genericize_r): Restore THUNK dereference
452 inhibibition check removed in previous c++/78495 change.
453
f370e36d
JJ
4542017-11-20 Jakub Jelinek <jakub@redhat.com>
455
456 PR c++/82781
457 * constexpr.c (cxx_eval_vector_conditional_expression): New function.
458 (cxx_eval_constant_expression) <case VEC_COND_EXPR>: Use it instead
459 of cxx_eval_conditional_expression.
460
f9c59f7e
JJ
4612017-11-19 Jakub Jelinek <jakub@redhat.com>
462
463 PR c/66618
464 PR c/69960
465 * cp-gimplify.c (c_fully_fold): Add LVAL argument, call
466 cp_fold_maybe_rvalue instead of cp_fold_rvalue and pass it !LVAL.
467
6296cf8e
JM
4682017-11-16 Jason Merrill <jason@redhat.com>
469
470 PR c++/79092 - non-type args of different types are different
471 * tree.c (cp_tree_equal): Check the type of constants.
472 * pt.c (unify) [TEMPLATE_PARM_INDEX]: Handle UNIFY_ALLOW_INTEGER
473 when comparing to previously deduced argument.
474 (maybe_convert_nontype_argument): New.
475 (convert_nontype_argument): Call it.
476 (tsubst_copy_and_build): Handle partial instantiation of
477 IMPLICIT_CONV_EXPR.
478 (unify): Ignore type when deducing from array bound.
479 (dependent_type_p_r): Handle DEFERRED_NOEXCEPT.
480 (value_dependent_expression_p): Any type-dependent expression is
481 value-dependent. Handle IMPLICIT_CONV_EXPR.
482 * cp-tree.h (IMPLICIT_CONV_EXPR_NONTYPE_ARG): New.
483 * mangle.c (write_template_arg): Strip IMPLICIT_CONV_EXPR.
484
c757ad4c
NS
4852017-11-16 Nathan Sidwell <nathan@acm.org>
486
5f3682ff
NS
487 PR c++/82836
488 PR c++/82737
489 * cp-objcp-common.h (LANG_HOOKS_OVERWRITE_DECL_ASSEMBLER_NAME):
490 Override.
491 * cp-tree.h (overwrite_mangling): Declare.
492 * decl2.c (struct mangled_decl_hash): Entries are deletable.
493 (overwrite_mangling): New.
494
c757ad4c
NS
495 PR c++/81060
496 * decl.c (xref_tag_1): Push lambda into current scope.
497 * name-lookup.c (do_pushtag): Don't deal with ts_lambda here.
498
03ab2eb7
NS
4992017-11-15 Nathan Sidwell <nathan@acm.org>
500
501 PR c++/81574
502 * lambda.c (lambda_capture_field_type): Function references are
503 always catured by reference.
504
86a9e738
ML
5052017-11-15 Martin Liska <mliska@suse.cz>
506
507 * decl.c (begin_destructor_body): Use cp_build_fold_indirect_ref
508 instead of cp_build_indirect_ref.
509
896f6b3d
ML
5102017-11-15 Martin Liska <mliska@suse.cz>
511
512 * decl.c (begin_destructor_body): In case of VPTR sanitization
513 (with disabled recovery), zero vptr in order to catch virtual calls
514 after lifetime of an object.
515
21faa101
JM
5162017-11-14 Jason Merrill <jason@redhat.com>
517
518 Use GTY((cache)) on some hash tables.
519 * decl.c (decomp_type_table): Use tree_cache_map.
520 * init.c (nsdmi_inst): Likewise.
521 * pt.c (defarg_ints): Likewise.
522 * cp-objcp-common.c (cp_get_debug_type): Likewise.
523
c360a668
JM
5242017-11-13 Jason Merrill <jason@redhat.com>
525
c1051bf7
JM
526 Capture adjustments for P0588R1.
527 * semantics.c (process_outer_var_ref): Capture variables when
528 they are named; complain about non-capture uses when odr-used.
529 * expr.c (mark_use): Rvalue use looks through capture proxy.
530 * constexpr.c (potential_constant_expression_1): Improve error about
531 use of captured variable.
532 * lambda.c (need_generic_capture, dependent_capture_r)
533 (do_dependent_capture, processing_nonlambda_template): Remove.
534 * call.c (build_this): Remove uses of the above.
535 * decl.c (cp_finish_decl): Likewise.
536 * semantics.c (maybe_cleanup_point_expr)
537 (maybe_cleanup_point_expr_void, finish_goto_stmt)
538 (maybe_convert_cond): Likewise.
539 * typeck.c (check_return_expr): Likewise.
540
04757a2a
JM
541 Defer folding of *&.
542 * typeck.c (cp_build_fold_indirect_ref): New.
543 (cp_build_indirect_ref_1): Split out from cp_build_indirect_ref.
544 Add 'fold' parameter.
545 * cp-tree.h: Declare cp_build_fold_indirect_ref.
546 * call.c, class.c, cp-ubsan.c, decl.c, except.c, init.c, lambda.c,
547 parser.c, rtti.c, tree.c, typeck.c, typeck2.c: Use it.
548 * parser.c (do_range_for_auto_deduction): Use RO_UNARY_STAR.
549 (cp_convert_range_for): Likewise.
550 * typeck2.c (build_x_arrow): Use RO_ARROW.
551
cd920e13
JM
552 * cp-ubsan.c (cp_ubsan_check_member_access_r): Fix handling of
553 INDIRECT_REF of ADDR_EXPR.
554
c360a668
JM
555 PR c++/82360 - ICE with static_cast in template.
556 * call.c (perform_direct_initialization_if_possible): Check
557 processing_template_decl.
558 * typeck.c (build_static_cast_1): Likewise.
559
8f2b097e
VV
5602017-11-13 Ville Voutilainen <ville.voutilainen@gmail.com>
561
562 Remove the null check from placement new in all modes
563 * init.c (build_new_1): Don't do a null check for
564 a namespace-scope non-replaceable placement new
565 in any mode unless -fcheck-new is provided.
566
5666f12b
BK
5672017-11-07 Boris Kolpackov <boris@codesynthesis.com>
568
569 * Make-lang.in (CP_PLUGIN_HEADERS): Add operators.def since included
570 in cp-tree.h.
571
4dbeb716
JJ
5722017-11-07 Jakub Jelinek <jakub@redhat.com>
573
574 PR c++/82835
575 * cp-gimplify.c (cxx_omp_clause_apply_fn): For methods pass i - 1 to
576 convert_default_arg instead of i.
577
96d155c6
JM
5782017-11-06 Jason Merrill <jason@redhat.com>
579
580 P0704R1 - fixing const-qualified pointers to members
581 * typeck2.c (build_m_component_ref): Also accept in lower stds with
582 a pedwarn.
583
65371a7e
PC
5842017-11-06 Paolo Carlini <paolo.carlini@oracle.com>
585
586 PR c++/65579
587 * decl2.c (finish_static_data_member_decl): If there's an initializer,
588 complete the type and re-apply the quals.
589
1b6fa695
ML
5902017-11-06 Martin Liska <mliska@suse.cz>
591
592 PR middle-end/82404
593 * constexpr.c (cxx_eval_builtin_function_call): Handle
594 __builtin_unreachable call.
595 (get_function_named_in_call): Declare function earlier.
596 (constexpr_fn_retval): Skip __builtin_unreachable.
597 * cp-gimplify.c (cp_ubsan_maybe_instrument_return): Rename to
598 ...
599 (cp_maybe_instrument_return): ... this.
600 (cp_genericize): Call the function unconditionally.
601
a93ee058
NS
6022017-11-03 Nathan Sidwell <nathan@acm.org>
603
604 PR c++/82710
605 * decl.c (grokdeclarator): Protect MAYBE_CLASS things from paren
606 warning too.
607
d5f0b3f0
PC
6082017-11-02 Paolo Carlini <paolo.carlini@oracle.com>
609
610 PR c++/81957
611 * pt.c (make_pack_expansion): Add tsubst_flags_t parameter.
612 (expand_integer_pack, convert_template_argument, coerce_template_parms,
613 gen_elem_of_pack_expansion_instantiation, tsubst_pack_expansion,
614 unify): Adjust calls.
615 * tree.c (cp_build_qualified_type_real): Likewise.
616 * cp-tree.h (make_pack_expansion): Adjust declaration.
617
dfa65d3f
NS
6182017-11-02 Nathan Sidwell <nathan@acm.org>
619
9918e796
NS
620 * cp-tree.h (IDENTIFIER_NEWDEL_OP_P): Restore, adjust.
621 (IDENTIFIER_NEW_OP_P): New.
622 * decl.c (grokdeclarator): Restore IDENTIFIER_NEWDEL_OP_P use.
623 * pt.c (push_template_decl_real): Likewise.
624 * typeck.c (check_return_expr): Use IDENTIFIER_NEW_OP_P.
625
dfa65d3f
NS
626 PR c++/82710
627 * decl.c (grokdeclarator): Don't warn when parens protect a return
628 type from a qualified name.
629
d6dd9d7f
NS
6302017-11-01 Nathan Sidwell <nathan@acm.org>
631
183e687a
NS
632 * cp-tree.h (enum cp_identifier_kind): Delete cik_newdel_op.
633 Renumber and reserve udlit value.
9918e796
NS
634 (IDENTIFIER_NEWDEL_OP_P): Delete.
635 (IDENTIFIER_OVL_OP_P): New.
636 (IDENTIFIER_ASSIGN_OP_P): Adjust.
637 (IDENTIFIER_CONV_OP_P): Adjust.
183e687a
NS
638 (IDENTIFIER_OVL_OP_INFO): Adjust.
639 (IDENTIFIER_OVL_OP_FLAGS): New.
640 * decl.c (grokdeclarator): Use IDENTIFIER_OVL_OP_FLAGS.
641 * lex.c (get_identifier_kind_name): Adjust.
642 (init_operators): Don't special case new/delete ops.
9918e796 643 * mangle.c (write_unqualified_id): Use IDENTIFIER_OVL_OP_P.
183e687a
NS
644 * pt.c (push_template_decl_real): Use IDENTIFIER_OVL_OP_FLAGS.
645 * typeck.c (check_return_expr): Likewise.
646
ce121158
NS
647 * cp-tree.h (assign_op_identifier, call_op_identifier): Use
648 compressed code.
649 (struct lang_decl_fn): Use compressed operator code.
650 (DECL_OVERLOADED_OPERATOR_CODE): Replace with ...
651 (DECL_OVERLOADED_OPERATOR_CODE_RAW): ... this.
652 (DECL_OVERLOADED_OPERATOR_CODE_IS): Use it.
653 * decl.c (duplicate_decls): Use DECL_OVERLOADED_OPERATOR_CODE_RAW.
654 (build_library_fn): Likewise.
655 (grok_op_properties): Likewise.
656 * mangle.c (write_unqualified_name): Likewise.
657 * method.c (implicitly_declare_fn): Likewise.
658 * typeck.c (check_return_expr): Use DECL_OVERLOADED_OPERATOR_IS.
659
d6dd9d7f
NS
660 * cp-tree.h (IDENTIFIER_CP_INDEX): Define.
661 (enum ovl_op_flags): Add OVL_OP_FLAG_AMBIARY.
662 (enum ovl_op_code): New.
663 (struct ovl_op_info): Add ovl_op_code field.
664 (ovl_op_info): Size by OVL_OP_MAX.
665 (ovl_op_mapping, ovl_op_alternate): Declare.
666 (OVL_OP_INFO): Adjust for mapping array.
667 (IDENTIFIER_OVL_OP_INFO): New.
668 * decl.c (ambi_op_p, unary_op_p): Delete.
669 (grok_op_properties): Use IDENTIFIER_OVL_OP_INFO and
670 ovl_op_alternate.
671 * lex.c (ovl_op_info): Adjust and static initialize.
672 (ovl_op_mappings, ovl_op_alternate): Define.
673 (init_operators): Iterate over ovl_op_info array and init mappings
674 & alternate arrays.
675 * mangle.c (write_unqualified_id): Use IDENTIFIER_OVL_OP_INFO.
676 * operators.def (DEF_OPERATOR): Remove KIND parm.
677 (DEF_SIMPLE_OPERATOR): Delete.
678 (OPERATOR_TRANSITION): Expand if defined.
679
84ffba12
DM
6802017-10-31 David Malcolm <dmalcolm@redhat.com>
681
682 * pt.c (listify): Use %< and %> for description of #include.
683
64a5912c
DM
6842017-10-31 David Malcolm <dmalcolm@redhat.com>
685
686 * class.c (explain_non_literal_class): Use UNKNOWN_LOCATION rather
687 than 0.
688 * name-lookup.c (suggest_alternatives_for): Update for renaming of
689 inform_at_rich_loc.
690 (maybe_suggest_missing_header): Likewise.
691 (suggest_alternative_in_explicit_scope): Likewise.
692 * parser.c (cp_parser_diagnose_invalid_type_name): Likewise for
693 renaming of error_at_rich_loc.
694 (cp_parser_string_literal): Likewise.
695 (cp_parser_nested_name_specifier_opt): Likewise.
696 (cp_parser_cast_expression): Likewise for renaming of
697 warning_at_rich_loc.
698 (cp_parser_decl_specifier_seq): Likewise for renaming of
699 error_at_rich_loc and warning_at_rich_loc.
700 (cp_parser_elaborated_type_specifier): Likewise for renaming of
701 pedwarn_at_rich_loc.
702 (cp_parser_cv_qualifier_seq_opt): Likewise for renaming of
703 error_at_rich_loc.
704 (cp_parser_virt_specifier_seq_opt): Likewise.
705 (cp_parser_class_specifier_1): Likewise.
706 (cp_parser_class_head): Likewise.
707 (cp_parser_member_declaration): Likewise for renaming of
708 pedwarn_at_rich_loc, warning_at_rich_loc, and error_at_rich_loc.
709 (cp_parser_enclosed_template_argument_list): Likewise for renaming
710 of error_at_rich_loc.
711 (set_and_check_decl_spec_loc): Likewise.
712 * pt.c (listify): Likewise.
713 * rtti.c (typeid_ok_p): Likewise.
714 * semantics.c (process_outer_var_ref): Use UNKNOWN_LOCATION rather
715 than 0.
716 * typeck.c (access_failure_info::maybe_suggest_accessor): Update
717 for renaming of inform_at_rich_loc.
718 (finish_class_member_access_expr): Likewise for renaming of
719 error_at_rich_loc.
720
137073d3
NS
7212017-10-31 Nathan Sidwell <nathan@acm.org>
722
881c969c
NS
723 * cp-tree.h (struct operator_name_info_t): Rename to ...
724 (struct ovl_op_info_t): ... here. Add tree_code field.
725 (operator_name_info, assignment_operator_name_info): Delete.
726 (ovl_op_info): Declare.
727 (OVL_OP_INFO): Adjust.
728 * decl.c (grok_op_properties): Use ovl_op_flags.
729 * lex.c (operator_name_info, assignment_operator_name_info):
730 Delete.
731 (ovl_op_info): Define.
732 (set_operator_ident): Adjust.
733 (init_operators): Set tree_code.
734 * mangle.c (write_unqualified_id): Adjust operator array scan.
735
6ff16d19
NS
736 * lex.c (init_operators): Allow NULL operator name. Don't add
737 special cases.
738 * operators.def: Use NULL for mangling only operators. Move to
739 after regular operators but move assignment operators last.
740
f26881e3
NS
741 * cp-tree.h (enum ovl_op_flags): New.
742 (struct operator_name_info_t): Rename arity to flags.
743 * lex.c (set_operator_ident): New.
744 (init_operators): Use it. Adjust for flags.
745 * mangle.c (write_unqualified_id): Adjust for flags.
746 * operators.def: Replace arity with flags.
747
88a819be
NS
748 * cp-tree.h (ovl_op_identifier): New.
749 (assign_op_identifier, call_op_identifier): Adjust.
750 (cp_operator_id, cp_assignment_operator_ide): Delete.
751 (SET_OVERLOADED_OPERATOR_CODE): Delete.
752 (OVL_OP_INFO): New.
753 * call.c (op_error): Use OVL_OP_INFO.
754 (build_conditional_expr_1): Use ovl_op_identifier.
755 (build_new_op_1): Use OVL_OP_INFO & ovl_op_identifier.
756 (build_op_delete_call): Likewise.
757 * class.c (type_requires_array_cookie): Use ovl_op_identifier.
758 * decl.c (duplicate_decls): Directly copy operator code.
759 (builtin_function_1): Do not set operator code.
760 (build_library_fn): Directly set operator code.
761 (push_cp_library_fn): Use ovl_op_identifier.
762 (grok_op_properties): Directly set operator code.
763 * decl2.c (maybe_warn_sized_delete): Use ovl_op_identifier.
764 * error.c (dump_expr): Use OVL_OP_INFO.
765 (op_to_string): Add assop arg. Use OVL_OP_INFO.
766 (assop_to_string): Delete.
767 (args_to_string): Adjust.
768 * init.c (build_new_1): Use ovl_op_identifier.
769 * mangle.c (write_unqualified_name): Use OVL_OP_INFO.
770 (write_expression): Likewise.
771 * method.c (synthesized_method_walk): Use ovl_op_identifier.
772 (implicitly_declare_fn): Use assign_op_identifier. Directly set
773 operator code.
774 * name-lookup.c (get_class_binding): Use assign_op_identifier.
775 * parser.c (cp_parser_operator): Use ovl_op_identifier.
776 (cp_parser_omp_clause_reduction): Likewise.
777 * semantics.c (omp_reduction_id): Likewise.
778 * typeck.c (cxx_sizeof_or_alignof_type): Use OVL_OP_INFO.
779
137073d3
NS
780 * cp-tree.h (assign_op_identifier, call_op_identifier): Define.
781 (LAMBDA_FUNCTION_P): Use DECL_OVERLOADED_OPERATOR_IS.
782 (DECL_OVERLOADED_OPERATOR_P): Just retuurn true/false.
783 (DECL_OVERLOADED_OPERATOR_CODE, DECL_OVERLOADED_OPERATOR_IS): Define.
784 * call.c (add_function_candidate): Use
785 DECL_OVERLOADED_OPERATOR_IS.
786 (build_op_call_1): Use call_op_identifier &
787 DECL_OVERLOADED_OPERATOR_IS.
788 (build_over_call): Likewise.
789 (has_trivial_copy_assign_p): Use assign_op_identifier.
790 (build_special_member_call): Likewise.
791 * class.c (dfs_declare_virt_assop_and_dtor): Likewise.
792 (vbase_has_user_provided_move_assign,
793 classtype_has_move_assign_or_move_ctor_p): Likewise.
794 * decl.c (duplicate_decls): Use DECL_OVERLOADED_OPERATOR_CODE.
795 (grok_special_member_properties): Use assign_op_identifier.
796 (start_preparsed_function): Use DECL_OVERLOADED_OPERATOR_IS.
797 * decl2.c (mark_used): Use DECL_CONV_FN_P.
798 * dump.c (dump_access): Delete prototype.
799 (dump_op): Delete.
800 (cp_dump_tree): Don't call it.
801 * lambda.c (lambda_function): Use call_op_identifier.
802 (maybe_add_lambda_conv_op): Not an overloaded operator. Remove
803 unneeded braces.
804 * mangle.c (write_unqualified_name): Use DECL_OVERLOADED_OPERTOR_CODE.
805 * method.c (do_build_copy_assign): Use assign_op_identifier.
806 (synthesize_method): Use DECL_OVERLOADED_OPERATOR_IS.
807 (get_copy_assign): Use assign_op_identifier.
808 (synthesized_method_walk): Likewise.
809 (defaultable_fn_check): Use DECL_OVERLOADED_OPERATOR_IS.
810 * parser.c (cp_parser_lambda_declarator_opt): Use
811 call_op_identifier.
812 * semanitics.c (classtype_has_nothrow_assign_or_copy_p): Use
813 assign_op_identifier.
814 * tree.c (special_function_p): Use DECL_OVERLOADED_OPERATOR_IS.
815 * typeck.c (check_return_expr): Use DECL_OVERLOADED_OPERATOR_CODE.
816 (check_return_expr): Use assign_op_identifier.
817
bae0ffb5
PC
8182017-10-30 Paolo Carlini <paolo.carlini@oracle.com>
819
820 PR c++/82085
821 * pt.c (tsubst_copy_and_build, [INDIRECT_REF]): For a REFERENCE_REF_P,
822 unconditionally call convert_from_reference.
823
ff630487
NS
8242017-10-30 Nathan Sidwell <nathan@acm.org>
825
826 * call.c (build_op_call_1): Test for FUNCTION_DECL in same manner
827 as a few lines earlier.
828 * cp-tree.h (PACK_EXPANSION_PATTERN): Fix white space.
829 * decl.c (grokfndecl): Fix indentation.
830 (compute_array_index_type): Use processing_template_decl_sentinel.
831 (grok_op_properties): Move warnings to end. Reorder other checks
832 to group similar entities. Tweak diagnostics.
833 * lex.c (unqualified_name_lookup_error): No need to check name is
834 not ERROR_MARK operator.
835 * parser.c (cp_parser_operator): Select operator code before
836 looking it up.
837 * typeck.c (check_return_expr): Fix indentation and line wrapping.
838
ba05366b
PC
8392017-10-27 Paolo Carlini <paolo.carlini@oracle.com>
840
841 * pt.c (invalid_nontype_parm_type_p): Return a bool instead of an int.
842
75bafecb
NS
8432017-10-26 Nathan Sidwell <nathan@acm.org>
844
845 * decl.c (sort_labels): Restore function.
846 (pop_labels): Sort labels
847 (identify_goto): Add translation markup.
848
733ba9b9
NS
8492017-10-25 Nathan Sidwell <nathan@acm.org>
850
a2af967e
NS
851 Kill IDENTIFIER_LABEL_VALUE.
852 * cp-tree.h (lang_identifier): Delete label_value slot.
853 (IDENTIFIER_LABEL_VALUE, SET_IDENTIFIER_LABEL_VALUE): Delete.
854 (struct named_label_hasher): Rename to ...
855 (struct named_label_hash): ... here. Reimplement.
856 (struct language_function): Adjust x_named_labels.
857 * name-lookup.h (struct cp_label_binding): Delete.
858 (struct cp_binding_level): Delete shadowed_labels slot.
859 * decl.c (struct named_label_entry): Add name and outer slots.
860 (pop_label): Rename to ...
861 (check_label_used): ... here. Don't pop.
862 (note_label, sort_labels): Delete.
863 (pop_labels, pop_local_label): Reimplement.
864 (poplevel): Pop local labels as any other decl. Remove
865 shadowed_labels handling.
866 (named_label_hash::hash, named_label_hash::equal): New.
867 (make_label_decl): Absorb into ...
868 (lookup_label_1): ... here. Add making_local_p arg, reimplement.
869 (lookup_label, declare_local_label): Adjust.
870 (check_goto, define_label): Adjust.
871 * lex.c (make_conv_op_name): Don't clear IDENTIFIER_LABEL_VALUE.
872 * ptree.c (cxx_print_identifier): Don't print identifier binding.
873
733ba9b9
NS
874 * decl.c (identifier_goto): Reduce duplication.
875 (check_previous_goto_1): Likewise.
876 (check_goto): Move var decls to initialization.
877 (check_omp_return, define_label_1, define_label): Likewise.
878
bc1a75dd
JJ
8792017-10-25 Jakub Jelinek <jakub@redhat.com>
880
881 PR libstdc++/81706
882 * decl.c (duplicate_decls): Copy "omp declare simd" attributes from
883 newdecl to corresponding __builtin_ if any.
884
ff1ff960
PC
8852017-10-24 Paolo Carlini <paolo.carlini@oracle.com>
886
887 PR c++/82466
888 * decl.c (duplicate_decls): Warn for built-in functions declared as
889 non-function, use OPT_Wbuiltin_declaration_mismatch.
890
891 * decl.c (duplicate_decls): Avoid redundant '+' in warning_at.
892
02b0c08c
PC
8932017-10-24 Paolo Carlini <paolo.carlini@oracle.com>
894
895 PR c++/80991
896 * pt.c (value_dependent_expression_p, [TRAIT_EXPR]): Handle
897 a TREE_LIST as TRAIT_EXPR_TYPE2.
898
eab01c18
MK
8992017-10-24 Mukesh Kapoor <mukesh.kapoor@oracle.com>
900 Paolo Carlini <paolo.carlini@oracle.com>
901
902 PR c++/82307
903 * cvt.c (type_promotes_to): Implement C++17, 7.6/4, about unscoped
904 enumeration type whose underlying type is fixed.
905
403226f0
PC
9062017-10-23 Paolo Carlini <paolo.carlini@oracle.com>
907
908 PR c++/80449
909 * semantics.c (finish_compound_literal): Check do_auto_deduction
910 return value for error_mark_node.
911
802561b2
JM
9122017-10-23 Jason Merrill <jason@redhat.com>
913
914 PR c++/77369 - wrong noexcept handling in C++14 and below
915 * tree.c (strip_typedefs): Canonicalize TYPE_RAISES_EXCEPTIONS.
916
9401eb07
NS
9172017-10-20 Nathan Sidwell <nathan@acm.org>
918
919 * class.c (layout_class_type): Cleanup as-base creation, determine
920 mode here.
921 (finish_struct_1): ... not here.
922
d9697837
JJ
9232017-10-19 Jakub Jelinek <jakub@redhat.com>
924
925 PR c++/82600
926 * typeck.c (check_return_expr): Don't call
927 maybe_warn_about_returning_address_of_local in templates.
928
f419fd1f
NS
9292017-10-17 Nathan Sidwell <nathan@acm.org>
930
5a201862
NS
931 PR c++/82560
932 * call.c (build_over_call): Don't pass tf_no_cleanup to nested
933 calls.
934
f419fd1f
NS
935 PR middle-end/82546
936 * cp-objcp-common.c (cp_tree_size): Reformat. Adjust returns size
937 of TYPE nodes.
938
5c9c546b
JM
9392017-10-13 Jason Merrill <jason@redhat.com>
940
941 PR c++/82357 - bit-field in template
942 * tree.c (cp_stabilize_reference): Just return a NON_DEPENDENT_EXPR.
943
15f7a469
DM
9442017-10-13 David Malcolm <dmalcolm@redhat.com>
945
946 * cp-tree.h (maybe_show_extern_c_location): New decl.
947 * decl.c (grokfndecl): When complaining about literal operators
948 with C linkage, issue a note giving the location of the
949 extern "C".
950 * parser.c (cp_parser_new): Initialize new field
951 "innermost_linkage_specification_location".
952 (cp_parser_linkage_specification): Store the location
953 of the linkage specification within the cp_parser.
954 (cp_parser_explicit_specialization): When complaining about
955 template specializations with C linkage, issue a note giving the
956 location of the extern "C".
957 (cp_parser_explicit_template_declaration): Likewise for templates.
958 (maybe_show_extern_c_location): New function.
959 * parser.h (struct cp_parser): New field
960 "innermost_linkage_specification_location".
961
d89dac36
NS
9622017-10-12 Nathan Sidwell <nathan@acm.org>
963
964 * cp-tree.h (cp_expr): Add const operator * and operator->
965 accessors.
966 (cp_tree_node_structure_enum): Delete TS_CP_BINDING,
967 TS_CP_WRAPPER, LAST_TS_CP_ENUM.
968
62e1c678
DM
9692017-10-12 David Malcolm <dmalcolm@redhat.com>
970
971 * parser.c (get_required_cpp_ttype): New function.
972 (cp_parser_error_1): Call it, using the result to call
973 maybe_suggest_missing_token_insertion.
974
e95c9129
DM
9752017-10-12 David Malcolm <dmalcolm@redhat.com>
976
977 * parser.c (get_matching_symbol): Move to before...
978 (cp_parser_error): Split out into...
979 (cp_parser_error_1): ...this new function, merging in content
980 from...
981 (cp_parser_required_error): ...here. Eliminate partial duplicate
982 of body of cp_parser_error in favor of a call to the new
983 cp_parser_error_1 helper function.
984
4e7d0260
NS
9852017-10-11 Nathan Sidwell <nathan@acm.org>
986
987 * decl2.c (struct mangled_decl_hash): Use DECL_ASSEMBLER_NAME_RAW.
988 (record_mangling): Likewise.
989
eead34af
NS
9902017-10-10 Nathan Sidwell <nathan@acm.org>
991
7cd6ea64
NS
992 * name-lookup.c (extern_c_fns): Rename to ...
993 (extern_c_decls): ... here.
994 (check_extern_c_conflict, extern_c_linkage_bindings): Update.
995 (do_pushdecl): Check extern-c fns and vars.
996
d6b605f6
NS
997 * cp-tree.h (default_hash_traits <lang_identifier *>): Delete
998 specialization.
999
eead34af
NS
1000 * decl2.c (struct mangled_decl_hash): New hash traits.
1001 (mangled_decls): Make hash_table<mangled_decl_hash>.
1002 (generate_mangling_alias, record_mangling): Adjust.
1003
4d612bfd
JM
10042017-10-10 Jason Merrill <jason@redhat.com>
1005
84dd815f
JM
1006 More delayed lambda capture fixes.
1007 * call.c (add_function_candidate): Use build_address.
1008 (build_op_call_1): Call mark_lvalue_use early.
1009 (build_over_call): Handle error from build_this.
1010 * constexpr.c (cxx_bind_parameters_in_call): Use build_address.
1011 (cxx_eval_increment_expression): Don't use rvalue().
1012 * cvt.c (convert_to_void): Use mark_discarded_use.
1013 * expr.c (mark_use): Handle PARM_DECL, NON_DEPENDENT_EXPR. Fix
1014 reference handling. Don't copy the expression.
1015 (mark_discarded_use): New.
1016 * lambda.c (insert_capture_proxy): Add some sanity checking.
1017 (maybe_add_lambda_conv_op): Set cp_unevaluated_operand.
1018 * pt.c (register_local_specialization): Add sanity check.
1019 * semantics.c (process_outer_var_ref): Fix check for existing proxy.
1020 * typeck.c (cp_build_addr_expr_1): Handle error from
1021 mark_lvalue_use.
1022 (cp_build_modify_expr): Call mark_lvalue_use_nonread, handle error
1023 from rvalue.
1024
1025 Handle generic lambda capture in dependent expressions.
1026 * lambda.c (need_generic_capture, dependent_capture_r)
1027 (do_dependent_capture): New.
1028 * pt.c (processing_nonlambda_template): Use need_generic_capture.
1029 * semantics.c (maybe_cleanup_point_expr)
1030 (maybe_cleanup_point_expr_void, finish_goto_stmt)
1031 (maybe_convert_cond): Call do_dependent_capture.
1032 * typeck.c (build_static_cast): Remove dependent capture handling.
1033
e1bea341
JM
1034 * typeck.c (condition_conversion): Assert !processing_template_decl.
1035 * semantics.c (finish_omp_clauses): Don't
1036 fold_build_cleanup_point_expr if processing_template_decl.
1037 (outer_var_p): A temporary can't be from an outer scope.
1038 * pt.c (type_dependent_expression_p): Fix dependency checking of
1039 functions without DECL_TEMPLATE_INFO.
1040 (instantiate_decl): Use lss_copy.
1041 * constexpr.c (is_valid_constexpr_fn): Fix lambdas before C++17.
1042
4d612bfd
JM
1043 * typeck.c (check_return_expr): Check non-dependent conversion in
1044 templates.
1045 * constraint.cc (check_function_concept): Don't complain about an
1046 empty concept if seen_error.
1047
8e6cdc90
RS
10482017-10-10 Richard Sandiford <richard.sandiford@linaro.org>
1049
1050 * cvt.c (ignore_overflows): Use wi::to_wide when
1051 operating on trees as wide_ints.
1052 * decl.c (check_array_designated_initializer): Likewise.
1053 * mangle.c (write_integer_cst): Likewise.
1054 * semantics.c (cp_finish_omp_clause_depend_sink): Likewise.
1055
a6a5091a
NS
10562017-10-10 Nathan Sidwell <nathan@acm.org>
1057
1058 * name-lookup.c (set_global_binding): Don't deal with STAT_HACK.
1059
df780484 10602017-10-06 Paolo Carlini <paolo.carlini@oracle.com>
90e3c064
PC
1061
1062 PR c++/47791
1063 * decl.c (finish_function): Take a bool intead of an int; adjust.
1064 * cp-tree.h (finish_function): Adjust declaration.
1065 * decl2.c (generate_tls_wrapper, finish_objects,
1066 finish_static_storage_duration_function): Adjust calls.
1067 * lambda.c (maybe_add_lambda_conv_op, finish_lambda_function):
1068 Likewise.
1069 * method.c (synthesize_method): Likewise.
1070 * optimize.c (maybe_thunk_body, maybe_clone_body): Likewise.
1071 * pt.c (instantiate_decl): Likewise.
1072 * parser.c (cp_parser_function_definition_after_declarator,
1073 cp_parser_late_parsing_for_member, cp_parser_omp_declare_reduction):
1074 Likewise.
1075 (cp_parser_ctor_initializer_opt,
1076 cp_parser_ctor_initializer_opt_and_function_body,
1077 cp_parser_function_try_block,
1078 cp_parser_function_definition_after_declarator,
1079 cp_parser_function_transaction): Return void; adjust declarations.
1080
9db84ece
NS
10812017-10-06 Nathan Sidwell <nathan@acm.org>
1082
1083 PR c++/82424
1084 * name-lookup.c (check_local_shadow): Don't try and convert
1085 dependent types.
1086
681f18d1
JJ
10872017-10-06 Jakub Jelinek <jakub@redhat.com>
1088
7260f6f7
JJ
1089 PR c++/82299
1090 * decl.c (reshape_init): Suppress warn_useless_cast for direct enum
1091 init.
1092 * typeck.c (convert_for_assignment): Likewise.
1093
681f18d1
JJ
1094 P0704R1 - fixing const-qualified pointers to members
1095 * typeck2.c (build_m_component_ref): For -std=c++2a allow
1096 pointer to const & qualified method on rvalue.
1097
e833f686
NS
10982017-10-06 Nathan Sidwell <nathan@acm.org>
1099
9bc3f420
NS
1100 Use hash_table for extern "C" names
1101 * name-lookup.c (extern_c_fns): Use hash_table.
1102 (check_extern_c_conflict): Adjust.
1103 (c_linkage_bindings): Adjust.
1104
e833f686
NS
1105 Use hash_table for namespace bindings
1106 * cp-tree.h (struct named_decl_hash): New.
1107 (lang_decl_ns): Change type of bindings field.
1108 * lex.c (maybe_add_lang_decl_raw): Adjust.
1109 * name-lookup.c (find_namespace_slot): Adjust.
1110 (do_pushdecl): Push NULL-named namespace.
1111 (do_push_nested_namespace): Adjust.
1112 (push_namespace): Push anonymous namespace as NULL name.
1113
b9760b03
JM
11142017-10-05 Jason Merrill <jason@redhat.com>
1115
e833f686 1116 Pass variadic class objects exactly like named by-value args.
b9760b03
JM
1117 * call.c (convert_arg_to_ellipsis): Use the result of force_rvalue.
1118
7a852b59
NS
11192017-10-05 Nathan Sidwell <nathan@acm.org>
1120
807e3be2
NS
1121 Warn on MVP declarations
1122 * cp-tree.h (struct cp_declarator): Add parenthesized field.
1123 * decl.c (grokdeclarator): Warn about unnecessary parens.
1124 * parser.c (make_declarator): Init parenthesized field.
1125 (cp_parser_direct_declarator): Set parenthesized field.
1126
87e3d7cf
NS
1127 Kill IDENTIFIER_GLOBAL_VALUE, SET_IDENTIFIER_GLOBAL_VALUE
1128 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
1129 SET_IDENTIFIER_GLOBAL_VALUE): Delete.
1130 * name-lookup.h (set_global_binding): Remove NAME parm.
1131 (get_global_binding): New inline fn.
1132 * name-lookup.c (set_global_binding): Remove NAME parm. Adjust.
1133 (identifier_global_value): Move to ...
1134 * cp-objcp-common.c (identifier_global_value): ... here.
1135 * class.c (build_ctor_vtbl_group, build_vtbl_initializer): Adjust.
1136 * decl.c (record_builtin_type, expand_static_init,
1137 grokdeclarator): Adjust.
1138 * decl2.c (get_guard, get_local_tls_init_fn, get_tls_init_fn,
1139 get_tls_wrapper_fn, maybe_warn_sized_delete): Adjust.
1140 * except.c (declare_library_fn, build_throw): Adjust.
1141 * init.c (throw_bad_array_length): Adjust.
1142 * rtti.c (throw_bad_cast, throw_bad_typeid, get_tinfo_decl): Adjust.
1143
7a852b59
NS
1144 * decl2.c (record_mangling): Fix spello and formatting from
1145 previous patch.
1146
e07b8366
NS
11472017-10-04 Nathan Sidwell <nathan@acm.org>
1148
1149 Give builtin types the correct name.
1150 * name-lookup.c (set_global_binding): Assert name is DECL_NAME.
1151 * decl.c (record_builtin_type): Reimplement, use new TYPE_DECL for
1152 rname.
1153
fb4ccfed
PC
11542017-10-04 Paolo Carlini <paolo.carlini@oracle.com>
1155 Andrew Pinski <apinski@cavium.com>
1156
1157 PR c++/71946
1158 * parser.c (cp_parser_lambda_body): Set parser->in_function_body.
1159
b419102c
NS
11602017-10-04 Nathan Sidwell <nathan@acm.org>
1161
1162 Move mangling aliases out of global namespace.
1163 * cp-tree.h (record_mangling): New.
1164 (maybe_remove_implicit_alias): Delete.
1165 * decl2.c (mangled_decls): New hash map.
1166 (generate_mangling_alias): Reimplement using mangled_decls.
1167 (record_mangling): New.
1168 * mangle.c (decl_implicit_alias_p,
1169 maybe_remove_implicit_alias): Delete.
1170 (mangle_decl): Use record_mangling.
1171 * name-lookup.c (supplement_binding_1): Remove
1172 maybe_remove_implicit_alias check.
1173
420db574
JJ
11742017-10-04 Jakub Jelinek <jakub@redhat.com>
1175
1176 PR c++/82373
1177 * error.c (dump_function_decl): If show_return, call dump_type_suffix
1178 on the same return type dump_type_prefix has been called on.
1179
6411847f
JM
11802017-10-04 Jason Merrill <jason@redhat.com>
1181
1182 PR c++/81525 - broken handling of auto in generic lambda.
1183 * pt.c (tsubst_decl) [VAR_DECL]: Use strip_innermost_template_args.
1184
bed8a1e4
NS
11852017-10-04 Nathan Sidwell <nathan@acm.org>
1186
1187 * call.c (convert_arg_to_ellipsis): Correct comment about passing
1188 by reference.
1189
a1488398
RS
11902017-10-02 Richard Sandiford <richard.sandiford@linaro.org>
1191
1192 * constexpr.c (cxx_eval_store_expression): Use wi::to_widest
1193 when comparing the array bounds with an ARRAY_REF index.
1194
333cb612
PC
11952017-09-30 Paolo Carlini <paolo.carlini@oracle.com>
1196
1197 PR c++/68754
1198 * method.c (defaulted_late_check): Early return if the defaulted
1199 declaration does not match the expected signature.
1200
9db33c9f
JJ
12012017-09-29 Jakub Jelinek <jakub@redhat.com>
1202
603be022
JJ
1203 P0683R1 - default member initializers for bit-fields
1204 * cp-tree.h (grokbitfield): Add INIT parameter.
1205 * parser.c (cp_parser_constant_expression): Add STRICT_P argument,
1206 if true, parse a conditional-expression rather than
1207 assignment-expression.
1208 (cp_parser_member_declaration): For C++11 and later pass true
1209 as STRICT_P to cp_parser_constant_expression. Parse C++2A bitfield
1210 NSDMIs. Adjust grokbitfield caller. Handle DECL_INITIAL also for
1211 DECL_C_BIT_FIELDs.
1212 (cp_parser_objc_class_ivars): Adjust grokbitfield caller.
1213 * class.c (check_field_decl): Recurse even for DECL_C_BIT_FIELDs.
1214 (check_field_decls): Call check_field_decl even for DECL_C_BIT_FIELDs.
1215 * decl2.c (grokbitfield): Add INIT parameter, pass it to
1216 cp_finish_decl.
1217 * pt.c (tsubst_decl): Handle DECL_INITIAL for all FIELD_DECLs, not
1218 just non-bitfields.
1219
7d386d45
JJ
1220 * class.c (check_bitfield_decl): Retrieve and clear width from
1221 DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL.
1222 (check_field_decls): Test DECL_BIT_FIELD_REPRESENTATIVE rather than
1223 DECL_INITIAL.
1224 (remove_zero_width_bit_fields): Adjust comment.
1225 * decl2.c (grokbitfield): Stash width into
1226 DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL.
1227 * pt.c (tsubst_decl): For DECL_C_BIT_FIELD, tsubst_expr
1228 DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL for width.
1229
27746ca9
JJ
1230 * parser.c (cp_parser_member_declaration): Parse attributes before
1231 colon of a bitfield in addition to after colon.
1232
9db33c9f
JJ
1233 * Make-lang.in (check-c++-all): Test also c++2a.
1234
697a7a57
JM
12352017-09-28 Jason Merrill <jason@redhat.com>
1236
281e6c1d
JM
1237 PR c++/56973, DR 696 - capture constant variables only as needed.
1238 * expr.c (mark_use): Split out from mark_rvalue_use and
1239 mark_lvalue_use. Handle lambda capture of constant variables.
1240 (mark_lvalue_use_nonread): New.
1241 * semantics.c (process_outer_var_ref): Don't capture a constant
1242 variable until forced.
1243 * pt.c (processing_nonlambda_template): New.
1244 * call.c (build_this): Check it.
1245 * decl2.c (grok_array_decl): Call mark_rvalue_use and
1246 mark_lvalue_use_nonread.
1247 * init.c (constant_value_1): Don't call mark_rvalue_use.
1248 * typeck.c (build_static_cast): Handle lambda capture.
1249
5c263e84
JM
1250 Use local_specializations to find capture proxies.
1251 * cp-tree.h (DECL_CAPTURED_VARIABLE): New.
1252 * lambda.c (build_capture_proxy): Set it.
1253 (add_capture): Pass initializer to build_capture_proxy.
1254 (start_lambda_function): Likewise.
1255 (insert_capture_proxy): Use register_local_specialization.
1256 (is_lambda_ignored_entity): Always ignore proxies.
1257 * name-lookup.c (qualify_lookup): Don't check
1258 is_lambda_ignored_entity if LOOKUP_HIDDEN is set.
1259 * semantics.c (process_outer_var_ref): Use
1260 retrieve_local_specialization.
1261 * parser.c (cp_parser_lambda_body): Push local_specializations.
1262 * pt.c (tsubst_expr): Pass LOOKUP_HIDDEN when looking for a proxy.
1263 (tsubst_lambda_expr): Push local_specializations sooner.
1264 (tsubst_copy_and_build): Don't register_local_specialization.
1265
697a7a57
JM
1266 * call.c (build_special_member_call): Use the return value of
1267 mark_lvalue_use.
1268 * decl.c (compute_array_index_type): Likewise.
1269 * parser.c (cp_parser_oacc_wait_list): Likewise.
1270 * lambda.c (is_normal_capture_proxy): Handle *this capture.
1271 (add_capture): Clarify internal_error message.
1272
d68d0df6
EB
12732017-09-22 Eric Botcazou <ebotcazou@adacore.com>
1274
1275 PR bootstrap/81926
1276 * cp-objcp-common.c (cp_get_debug_type): Do only one lookup.
1277
2dc589be
JJ
12782017-09-22 Jakub Jelinek <jakub@redhat.com>
1279
1280 PR sanitizer/81929
1281 * tree.c (struct replace_placeholders_t): Add pset field.
1282 (replace_placeholders_r): Call cp_walk_tree with d->pset as
1283 last argument instead of NULL. Formatting fix.
1284 (replace_placeholders): Add pset variable, add its address
1285 into data. Pass &pset instead of NULL to cp_walk_tree.
1286
9003adc7
DM
12872017-09-22 David Malcolm <dmalcolm@redhat.com>
1288
1289 * call.c (get_fndecl_argument_location): New function.
1290 (convert_like_real): Use it when complaining about argument type
1291 mismatches.
1292 * cp-tree.h (struct cp_parameter_declarator): Add "loc" field.
1293 * parser.c (make_parameter_declarator): Add "loc" param and use
1294 it to initialize the new field.
1295 (cp_parser_translation_unit): Add UNKNOWN_LOCATION for "loc" of
1296 the "no_parameters" parameter.
1297 (cp_parser_parameter_declaration_list): Set the location of the
1298 result of grokdeclarator to be the parameter's loc, assuming no
1299 errors.
1300 (cp_parser_parameter_declaration): Generate a location for the
1301 parameter and pass to make_parameter_declarator.
1302
12f71313
NS
13032017-09-20 Nathan Sidwell <nathan@acm.org>
1304
1305 * name-lookup.c (member_name_cmp): Use DECL_UID for final
1306 ordering.
1307
2ffb5745
JJ
13082017-09-20 Jakub Jelinek <jakub@redhat.com>
1309
1310 P0409R2 - allow lambda capture [=, this]
1311 * parser.c (cp_parser_lambda_introducer): For cxx2a don't pedwarn on
1312 redundant [=, this].
1313
04dcd570
JM
13142017-09-18 Jason Merrill <jason@redhat.com>
1315
1316 PR c++/82069 - ICE with lambda in template
1317 * semantics.c (process_outer_var_ref): Check uses_template_parms
1318 instead of any_dependent_template_arguments_p.
1319
c01df3c8
MLI
13202017-09-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1321 Paolo Carlini <paolo.carlini@oracle.com>
1322
1323 PR c++/64644
1324 * decl2.c (finish_anon_union): Complain about "anonymous union with
1325 no members" with a pedwarn.
1326
1d933576
BE
13272017-09-15 Bernd Edlinger <bernd.edlinger@hotmail.de>
1328
1329 * typeck.c (build_reinterpret_cast_1,
1330 build_const_cast_1): Implement -Wcast-align=strict.
1331
7b936140
JJ
13322017-09-15 Jakub Jelinek <jakub@redhat.com>
1333
1334 * decl.c (redeclaration_error_message): Use cxx17 instead of cxx1z,
1335 adjust diagnostics refering to C++1z or -std=gnu++1z or -std=c++1z
1336 to C++17 or -std=gnu++17 or -std=c++17. Adjust comments.
1337 (cxx_init_decl_processing, next_initializable_field,
1338 is_direct_enum_init, check_initializer, cp_finish_decl,
1339 mark_inline_variable, grokdeclarator, grokparms, xref_basetypes,
1340 finish_function): Likewise.
1341 * cp-tree.h (DECL_INLINE_VAR_P): Likewise.
1342 * pt.c (mark_template_parm, convert_nontype_argument,
1343 instantiate_class_template_1, type_unification_real, unify,
1344 get_partial_spec_bindings, dependent_type_p_r): Likewise.
1345 * typeck.c (cp_build_unary_op): Likewise.
1346 * constexpr.c (var_in_maybe_constexpr_fn): Likewise.
1347 * call.c (build_user_type_conversion_1, build_over_call,
1348 build_special_member_call): Likewise.
1349 * lambda.c (begin_lambda_type): Likewise.
1350 * typeck2.c (process_init_constructor_record): Likewise.
1351 * class.c (build_base_field, finalize_literal_type_property,
1352 explain_non_literal_class): Likewise.
1353 * parser.c (cp_parser_diagnose_invalid_type_name,
1354 cp_parser_primary_expression, cp_parser_lambda_introducer,
1355 cp_parser_lambda_declarator_opt, cp_parser_selection_statement,
1356 cp_convert_range_for, cp_parser_perform_range_for_lookup,
1357 cp_parser_decomposition_declaration, cp_parser_linkage_specification,
1358 cp_parser_static_assert, cp_parser_simple_type_specifier,
1359 cp_parser_namespace_definition, cp_parser_using_declaration,
1360 cp_parser_init_declarator, cp_parser_type_parameter_key,
1361 cp_parser_exception_specification_opt, cp_parser_std_attribute_spec,
1362 cp_parser_constructor_declarator_p): Likewise.
1363 * mangle.c (struct globals): Rename need_cxx1z_warning to
1364 need_cxx17_warning.
1365 (write_exception_spec, start_mangling, mangle_decl): Likewise.
1366 * Make-lang.in (check-c++1z): Rename to check-c++17, depend on
1367 it.
1368 (check-c++17): New goal. Use 17 instead of 1z.
1369 (check-c++-all): Use 17 instead of 1z.
1370
8b586510
JJ
13712017-09-14 Jakub Jelinek <jakub@redhat.com>
1372
1373 PR c++/81314
1374 * cp-gimplify.c (omp_var_to_track): Look through references.
1375 (omp_cxx_notice_variable): Likewise.
1376
783dc739
NS
13772017-09-13 Nathan Sidwell <nathan@acm.org>
1378
f216550d
NS
1379 Conv-op identifers not in identifier hash table
1380 * lex.c (conv_type_hasher): Make member fns inline.
1381 (make_conv_op_name): Directly clone conv_op_identifier.
1382
783dc739
NS
1383 Rename CLASSTYPE_METHOD_VEC to CLASSTYPE_MEMBER_VEC.
1384 * cp-tree.h (struct lang_type): Rename methods to members.
1385 (CLASSTYPE_METHOD_VEC): Rename to ...
1386 (CLASSTYPE_MEMBER_VEC): ... this.
1387 * name-lookup.h (get_method_slot): Rename to ...
1388 (get_member_slot): ... this.
1389 (resort_type_method_vec): Rename to ...
1390 (resort_type_member_vec): ... this.
1391 * class.c (add_method, warn_hidden): Adjust.
1392 * search.c (dfs_locate_field_accessor_pre): Adjust.
1393 * name-lookup.c (method_vec_binary_search): Rename to ...
1394 (member_vec_binary_search): ... this and adjust.
1395 (method_vec_linear_search): Rename to ...
1396 (member_vec_linear_search): ... this and adjust.
1397 (fields_linear_search, get_class_binding_direct): Adjust.
1398 (get_method_slot): Rename to ...
1399 (get_member_slot): ... this and adjust.
1400 (method_name_slot): Rename to ...
1401 (member_name_slot): ... this and adjust.
1402 (resort_type_method_vec): Rename to ...
1403 (resort_type_member_vec): ... this and adjust.
1404 (method_vec_append_class_fields): Rename to ...
1405 (member_vec_append_class_fields): ... this and adjust.
1406 (method_vec_append_enum_values): Rename to ...
1407 (member_vec_append_enum_values): ... this and adjust.
1408 (method_vec_dedup): Rename to ...
1409 (member_vec_dedup): ... this and adjust.
1410 (set_class_bindings, insert_late_enum_def_bindings): Adjust.
1411
741bbaab
PC
14122017-09-12 Paolo Carlini <paolo.carlini@oracle.com>
1413
1414 PR c++/70621
1415 * decl.c (start_decl): Early return error_mark_node if duplicate_decls
1416 returns it; avoid misleading error message.
1417
20614c86
NS
14182017-09-12 Nathan Sidwell <nathan@acm.org>
1419
45e3a33d
NS
1420 Kill CLASSTYPE_SORTED_FIELDS.
1421 * cp-tree.h (struct lang_type): Lose sorted_fields member.
1422 (CLASSTYPE_SORTED_FIELDS): Delete.
1423 * name-lookup.h (set_class_bindings): Add EXTRA arg.
1424 * name-lookup.c (fields_linear_search): New, broken out of ...
1425 (lookup_field_1): ... here. Delete remainder of function.
1426 (get_class_binding_direct): Reimplement without sorted_fields.
1427 (get_class_binding): Rename TYPE arg to KLASS, for consistency.
1428 (get_method_slot): Call set_class_binding when creating method_vec
1429 on complete type.
1430 (method_name_cmp): Order identically named slots.
1431 (sorted_fields_type_new): Delete.
1432 (field_vc_append_class_fields): Rename to ...
1433 (method_vec_append_class_fields): ... here. Adjust.
1434 (field_vec_append_enum_values): Renme to ...
1435 (method_vec_append_enum_values): ... here. Adjust.
1436 (method_vec_dedup): New.
1437 (set_class_bindings): Reimplement.
1438 (insert_late_enum_def_bindings): Reimplement.
1439
20614c86
NS
1440 * name-lookup.c (get_class_binding): Rename TYPE arg to KLASS for
1441 consistency.
1442 (restort_data): Move later.
1443 (method_name_cmp, resort_method_name_cmp): Simplify.
1444 (resort_type_method_vec): Reformat.
1445
7368cfa4
JM
14462017-09-09 Jason Merrill <jason@redhat.com>
1447
1448 * constexpr.c (reduced_constant_expression_p): If
1449 CONSTRUCTOR_NO_IMPLICIT_ZERO, check that all fields are initialized.
1450
a49bf6f0
EB
14512017-09-09 Eric Botcazou <ebotcazou@adacore.com>
1452
1453 PR bootstrap/81926
1454 * cp-objcp-common.c (struct debug_type_hasher): New class.
1455 (debug_type_hash): New variable.
1456 (cp_get_debug_type): Associate the OFFSET_TYPEs with the types.
1457
27c825c5
JM
14582017-09-08 Jason Merrill <jason@redhat.com>
1459
1460 PR c++/70029 - ICE with ref-qualifier and -flto
1461 * tree.c (cxx_copy_lang_qualifiers): New.
1462 * cp-tree.h: Declare it.
1463 * cp-objcp-common.h: Define LANG_HOOKS_COPY_LANG_QUALIFIERS.
1464
7ab50e17
JM
14652017-09-06 Jason Merrill <jason@redhat.com>
1466
e76b2472
JM
1467 PR c++/82053 - ICE with default argument in lambda in template
1468 * pt.c (tsubst_arg_types): Substitute default arguments for lambdas
1469 in templates.
1470 (retrieve_specialization): Use lambda_fn_in_template_p.
1471 * cp-tree.h: Declare it.
1472
7ab50e17
JM
1473 PR c++/82070 - error with nested lambda capture
1474 * pt.c (tsubst_expr) [DECL_EXPR]: Register capture proxies with
1475 register_local_specialization.
1476
527b7b19
NS
14772017-09-06 Nathan Sidwell <nathan@acm.org>
1478
b991151b
NS
1479 * name-lookup.h (lookup_field_1): Delete.
1480 (get_class_binding_direct, get_class_binding): Add type_or_fns arg.
1481 * name-lookup.c (lookup_field_1): make static
1482 (method_vec_binary_search, method_vec_linear_search): New. Broken
1483 out of ...
1484 (get_class_binding_direct): ... here. Add TYPE_OR_FNS argument.
1485 Do complete search of this level.
1486 (get_class_binding): Adjust.
1487 * decl.c (reshape_init_class): Call get_class_binding.
1488 * search.c (lookup_field_r): Move field searching into
1489 get_class_binding_direct.
1490
940ab2e0
NS
1491 * class.c (warn_hidden): Don't barf on non-functions.
1492 * decl2.c (check_classfn): Likewise. Check template match earlier.
1493
1887fb46
NS
1494 * name-lookup.c (count_fields): Rename to ...
1495 (count_class_fields): ... here. Take a class, don't count
1496 NULL-named fields.
1497 (add_fields_to_record_type): Rename to ...
1498 (field_vec_append_class_fields): ... here. Take a class, don't
1499 add NULL-named fields.
1500 (add_enum_fields_to_record_type): Rename to ...
1501 (field_vec_append_enum_values): ... here.
1502 (set_class_bindings): Adjust, assert we added expected number.
1503 (insert_late_enum_def_bindings): Reimplement. Create vector if
1504 there are now sufficient entries.
1505
527b7b19
NS
1506 * name-lookup.h (lookup_fnfields_slot_nolazy,
1507 lookup_fnfields_slot): Rename to ...
1508 (get_class_binding_direct, get_class_binding): ... here.
1509 * name-lookup.c (lookup_fnfields_slot_nolazy,
1510 lookup_fnfields_slot): Rename to ...
1511 (get_class_binding_direct, get_class_binding): ... here.
1512 * cp-tree.h (CLASSTYPE_CONSTRUCTORS, CLASSTYPE_DESTRUCTOR): Adjust.
1513 * call.c (build_user_type_conversion_1): Adjust.
1514 (has_trivial_copy_assign_p): Adjust.
1515 (has_trivial_copy_p): Adjust.
1516 * class.c (get_basefndecls) Adjust.
1517 (vbase_has_user_provided_move_assign) Adjust.
1518 (classtype_has_move_assign_or_move_ctor_p): Adjust.
1519 (type_build_ctor_call, type_build_dtor_call): Adjust.
1520 * decl.c (register_dtor_fn): Adjust.
1521 * decl2.c (check_classfn): Adjust.
1522 * pt.c (retrieve_specialization): Adjust.
1523 (check_explicit_specialization): Adjust.
1524 (do_class_deduction): Adjust.
1525 * search.c (lookup_field_r): Adjust.
1526 (look_for_overrides_here, lookup_conversions_r): Adjust.
1527 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Adjust.
1528 * tree.c (type_has_nontrivial_copy_init): Adjust.
1529 * method.c (lazily_declare_fn): Adjust comment.
1530
36560e9e
NS
15312017-09-05 Nathan Sidwell <nathan@acm.org>
1532
0c29f2a2
NS
1533 * name-lookup.c (do_class_using_decl): Elide read-once temps.
1534 Move declarations to initializations.
1535
fcaf3065
NS
1536 * class.c (add_method): Move slot search and insertion to ...
1537 * name-lookup.c (get_method_slot): ... this new function.
1538 (lookup_fnfields_slot_nolazy): Cope with NULL slot.
1539 * name-lookup.h (get_method_slot): Declare.
1540 * decl.c (cxx_init_decl_processinng): Give conv_op_marker a more
1541 realistic type.
1542 (grok_special_member_properties): Set
1543 TYPE_HAS_CONVERSION. Expicitly look at DECL_NAME for specialness.
1544 Improve TYPE_HAS_CONSTEXPR_CTOR setting.
1545
40300fa4
NS
1546 * cp-tree.h (lang_decl_base): Rename template_conv_p to
1547 unknown_bound_p.
1548 (DECL_CONV_FN_P): Don't check NULL DECL_NAME.
1549 (DECL_CONV_FN_TYPE): FN must be conv op.
1550 (DECL_TEMPLATE_CONV_FN_P): Delete.
1551 (VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): Adjust.
1552 * pt.c (push_template_decl_real): Delete DECL_TEMPLATE_CONV_FN_P
1553 setting.
1554
36560e9e
NS
1555 * class.c (unreverse_member_declarations): Remove extraneous if.
1556 * pt.c (push_template_decl_real): Use string concatenation, not
1557 \<newline>. Add %<..%>.
1558
d49318d9
PC
15592017-09-05 Paolo Carlini <paolo.carlini@oracle.com>
1560
1561 PR c++/81942
1562 * cp-tree.h (LABEL_DECL_CDTOR): Add and document.
1563 * decl.c (start_preparsed_function): Set LABEL_DECL_CDTOR when
1564 creating cdtor_label.
1565 * constexpr.c (returns): Add the case of a constructor/destructor
1566 returning via a LABEL_DECL_CDTOR label.
1567 (cxx_eval_constant_expression, case [GOTO_EXPR]): Likewise.
1568
18a01e85
NS
15692017-09-01 Nathan Sidwell <nathan@acm.org>
1570
fe920c2d
NS
1571 * cp-tree.h (resort_type_method_vec): Move declaration to ...
1572 * name-lookup.h (resort_type_method_vec): ... here.
1573 (set_class_bindings): Lose 2nd arg.
1574 * class.c (finish_struct_1, finish_struct): Adjust
1575 set_class_bindings call. Don't call finish_struct_methods.
1576 (resort_data, method_name_cmp, resort_method_name_cmp,
1577 resort_type_method_vec, finish_struct_methods): Move to ...
1578 * name-lookup.c (resort_data, method_name_cmp,
1579 resort_method_name_cmp, resort_type_method_vec): ... here.
1580 (set_class_bindings): Lose fields arg. Swallow finish_struct_methods.
1581
61abf964
NS
1582 * class.c (finish_struct): Call set_class_bindings for the
1583 template case too.
1584
1585 * class.c (finish_struct_methods): Dont clear DECL_IN_AGGR_P here.
beb8b5c1
NS
1586 Don't call maybe_warn_about_overly_private_class here.
1587 (warn_hidden): Cleanup declarations and comments.
1588 (type_has_user_provided_constructor): No need to check
1589 CLASSTYPE_METHOD_VEC.
1590 (type_has_user_provided_or_explicit_constructor): Likewise.
1591 (classtype_has_move_assign_or_move_ctor_p): Likewise.
1592 (check_bases_and_members): Don't call finish_struct_methods here.
1593 (finish_struct_1): Call finish_struct_methods and
1594 set_class_bindings immediately after layout. Clear DECL_IN_AGGR_P
1595 here.
1596 (finish_struct): For templates process USING_DECLS and clear
1597 DECL_IN_AGGR_P before calling finish_struct_methods. Call
1598 maybe_warn_about_overly_private_class here.
1599
18a01e85
NS
1600 Revert 2017-08-28 Nathan Sidwell <nathan@acm.org>
1601 Restore sorted_fields vector.
1602 * cp-tree.h (lang_type): Restore sorted_fields vector.
1603 (CLASSTYPE_SORTED_FIELDS): Restore.
1604 (CLASSTYPE_BINDINGS): Delete.
1605 * name-lookup.c (lookup_field_1): Restore binary search.
1606 (sorted_fields_type_new, count_fields,
1607 add_fields_to_record_type, add_enum_fields_to_record_type): Restore
1608 (set_class_bindings): Revert.
1609 (insert_late_enum_def_binding): Restore field_vec insertion.
1610
d2e05fcb
JJ
16112017-09-01 Jakub Jelinek <jakub@redhat.com>
1612
1613 PR c/81887
1614 * parser.c (cp_parser_omp_ordered): Handle -fopenmp-simd.
1615
8dc9277a
MP
16162017-09-01 Marek Polacek <polacek@redhat.com>
1617
1618 PR c++/82040
1619 * typeck.c (cp_build_unary_op): Avoid re-entering reporting routines.
1620
3f0973e5
JM
16212017-08-30 Jason Merrill <jason@redhat.com>
1622
b54d4018
JM
1623 PR c++/82029 - __PRETTY_FUNCTION__ in lambda in template
1624 * pt.c (enclosing_instantiation_of, lambda_fn_in_template_p)
1625 (regenerated_lambda_fn_p): New.
1626 (tsubst_decl) [VAR_DECL]: Use enclosing_instantiation_of.
1627 (tsubst_copy) [VAR_DECL]: Likewise.
1628
3f0973e5
JM
1629 PR c++/82030 - ICE inheriting from multiple lambdas
1630 PR c++/80767
1631 * call.c (compare_ics): Handle null candidate.
1632
18cb045d
VV
16332017-08-30 Ville Voutilainen <ville.voutilainen@gmail.com>
1634
1635 Make taking the address of an overloaded function a non-deduced context
1636
1637 * pt.c (unify_overload_resolution_failure): Remove.
1638 (unify_one_argument): Adjust.
1639
b397965c
RS
16402017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
1641 Alan Hayward <alan.hayward@arm.com>
1642 David Sherwood <david.sherwood@arm.com>
1643
1644 * typeck.c (cp_build_binary_op): Use SCALAR_TYPE_MODE.
1645
7a504f33
RS
16462017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
1647 Alan Hayward <alan.hayward@arm.com>
1648 David Sherwood <david.sherwood@arm.com>
1649
1650 * cvt.c (cp_convert_to_pointer): Use SCALAR_INT_TYPE_MODE.
1651
b5f2d801
RS
16522017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
1653 Alan Hayward <alan.hayward@arm.com>
1654 David Sherwood <david.sherwood@arm.com>
1655
1656 * mangle.c (write_real_cst): Use SCALAR_FLOAT_TYPE_MODE
1657 instead of TYPE_MODE.
1658
e2d59a13 16592017-08-29 Jason Merrill <jason@redhat.com>
f44a8dd5 1660
88b811bd
JM
1661 PR c++/81236 - ICE with template-id in generic lambda
1662 * semantics.c (finish_id_expression): Remove special dependent case.
1663 Avoid some later pieces when dependent.
1664 (finish_qualified_id_expr): Do normal BASELINK handling in a
1665 template. Always build a SCOPE_REF for a destructor BIT_NOT_EXPR.
1666 (parsing_default_capturing_generic_lambda_in_template): Remove.
1667 * parser.c (cp_parser_postfix_dot_deref_expression): Always give an
1668 error for types that will never be complete.
1669 * mangle.c (write_expression): Add sanity check.
1670 * tree.c (build_qualified_name): Add sanity check.
1671 (cp_walk_subtrees): Walk into the class context of a BASELINK.
1672 * lambda.c (add_capture): Improve diagnostic for generic lambda
1673 capture failure.
1674 * call.c (build_new_method_call_1): Print the right constructor
1675 name.
1676
f44a8dd5
JM
1677 Reimplement handling of lambdas in templates.
1678 * cp-tree.h (LAMBDA_FUNCTION_P): Check DECL_DECLARES_FUNCTION_P.
1679 * decl.c (start_preparsed_function): Call start_lambda_scope.
1680 (finish_function): Call finish_lambda_scope.
1681 * init.c (get_nsdmi): Call start/finish_lambda_scope.
1682 * lambda.c (start_lambda_scope): Only ignore VAR_DECL in a function.
1683 * parser.c (cp_parser_function_definition_after_declarator): Don't
1684 call start/finish_lambda_scope.
1685 * pt.c (retrieve_specialization): Ignore lambda functions in
1686 templates.
1687 (find_parameter_packs_r): Ignore capture proxies. Look into
1688 lambdas.
1689 (check_for_bare_parameter_packs): Allow bare packs in lambdas.
1690 (tsubst_default_argument): Call start/finish_lambda_scope.
1691 (tsubst_function_decl): Handle lambda functions differently.
1692 (tsubst_template_decl): Likewise.
1693 (tsubst_expr) [DECL_EXPR]: Skip closure declarations and capture
1694 proxies.
1695 (tsubst_lambda_expr): Create a new closure rather than instantiate
1696 the one from the template.
1697 (tsubst_copy_and_build): Don't register a specialization of a pack.
1698 (regenerate_decl_from_template): Call start/finish_lambda_scope.
1699 (instantiate_decl): Remove special lambda function handling.
1700 * semantics.c (process_outer_var_ref): Remove special generic lambda
1701 handling. Don't implicitly capture in a lambda in a template. Look
1702 for an existing proxy.
1703 * class.c (current_nonlambda_class_type): Use decl_type_context.
1704
9925f216
JM
1705 * cp-tree.h (LAMBDA_EXPR_CLOSURE): Use TREE_TYPE.
1706 (LAMBDA_EXPR_RETURN_TYPE): Remove.
1707 (struct tree_lambda_expr): Remove closure and return_type fields.
1708 * lambda.c (build_lambda_expr): Don't set LAMBDA_EXPR_RETURN_TYPE.
1709 * pt.c (tsubst_copy_and_build): Likewise.
1710 * parser.c (cp_parser_lambda_declarator_opt): Track return type.
1711 (cp_parser_lambda_body): Adjust unspecified return type check.
1712 * ptree.c (cxx_print_lambda_node): Don't print closure or
1713 return type.
5d4e573b
JM
1714
1715 PR c++/80935 - wrong C++17 error with lambda
1716 * decl.c (check_for_uninitialized_const_var): Check
1717 is_instantiation_of_constexpr.
1718 * constexpr.c (ensure_literal_type_for_constexpr_object): Check
1719 is_instantiation_of_constexpr.
1720 (potential_constant_expression_1): Check var_in_maybe_constexpr_fn.
1721
11399477
JM
1722 * lambda.c (build_lambda_object): Check for error_mark_node.
1723 * pt.c (make_pack_expansion): Set PACK_EXPANSION_LOCAL_P on the type
1724 pack as well.
1725 (tsubst_decl) [FUNCTION_DECL]: Set DECL_CONTEXT on the parameters.
1726 (tsubst) [TEMPLATE_PARM_INDEX]: Check for error_mark_node.
1727
1a9de5b6
JM
1728 PR c++/80767 - unnecessary instantiation of generic lambda
1729 * call.c (convert_like_real): Call build_user_type_conversion_1 if
1730 cand is null.
1731 (add_conv_candidate): Build a ck_user conversion with no candidate.
1732
b3eae0dd
JM
1733 Fix lambdas in template default argument of inherited ctor.
1734 * method.c (synthesized_method_base_walk): Replace an inherited
1735 template with its specialization.
1736 (synthesized_method_walk): Make inheriting_ctor a pointer.
1737 (maybe_explain_implicit_delete, explain_implicit_non_constexpr)
1738 (deduce_inheriting_ctor, implicitly_declare_fn): Adjust.
1739
4cc20315
JM
1740 * pt.c (build_deduction_guide): Set DECL_ABSTRACT_ORIGIN on the
1741 template, not the function.
1742 (template_guide_p): Adjust.
1743
82b0ce2e
JM
1744 Support copying local_specializations.
1745 * cp-tree.h (enum lss_policy): New.
1746 (local_specialization_stack): Add policy parameter to default ctor.
1747 * pt.c (local_specialization_stack): Copy local_specializations if
1748 lss_copy.
1749
a0ab7ccd
JM
1750 * constexpr.c (potential_constant_expression_1): Add "now" parm.
1751 (is_constant_expression, require_constant_expression): New.
1752 (is_static_init_expression, is_nondependent_constant_expression)
1753 (is_nondependent_static_init_expression): Drop "potential".
1754 * except.c (build_must_not_throw_expr): Do type conversion on
1755 value-dependent argument.
1756 * pt.c, semantics.c, typeck2.c: Use variants without "potential".
1757
12659e10
JM
1758 Instantiate default arguments/member initializers once.
1759 * init.c (get_nsdmi): Remember NSDMI instantiations.
1760 * parser.c (inject_this_parameter): Be more picky about
1761 current_class_ptr.
1762 * pt.c (tsubst_copy): Simplify 'this' handling.
1763 (tsubst_default_argument): Remember default argument
1764 instantiations. Take parameter number.
1765 (tsubst_default_arguments): Pass it.
1766 * call.c (convert_default_arg): Likewise.
1767
1aeafba2
JM
1768 Fix default argument conversion failure and SFINAE.
1769 * call.c (build_over_call): Check convert_default_arg result for
1770 error_mark_node.
1771 * parser.c (cp_parser_late_parsing_default_args): Remember
1772 error_mark_node.
1773
41970ff1
NS
17742017-08-28 Nathan Sidwell <nathan@acm.org>
1775
d876eb05
NS
1776 * cp-tree.h (lang_type): Replace sorted_fields vector with
1777 bindings map.
1778 (CLASSTYPE_SORTED_FIELDS): Delete.
1779 (CLASSTYPE_BINDINGS): New.
1780 * decl.c (finish_enum_value_list): Swap args of
1781 insert_late_enum_def_bindings.
1782 * name-lookup.c (lookup_field_1): Replace binary search of sorted
1783 fields with map->get.
1784 (sorted_fields_type_new, count_fields,
1785 add_fields_to_record_type, add_enum_fields_to_record_type): Delete.
1786 (add_class_member, add_class_members): New.
1787 (set_class_bindings): Create map and insert.
1788 (insert_late_enum_def_binding): Swap parms. Use add_clasS_member.
1789 * ptree.c (cxx_print_type): Delete sorted fields printing.
1790
41970ff1
NS
1791 * cp-tree.h (insert_late_enum_def_into_classtype_sorted_fields):
1792 Delete.
1793 * name-lookup.h (set_class_bindings,
1794 insert_late_enum_def_bindings): Declare.
1795 * decl.c (finish_enum_value_list): Adjust for
1796 insert_late_enum_def_bindings name change.
1797 * class.c (finish_struct_1): Call set_class_bindings.
1798 (count_fields, add_fields_to_record_type,
1799 add_enum_fields_to_record_type, sorted_fields_type_new,
1800 insert_into_classtype_sorted_fields,
1801 insert_late_enum_def_into_classtype_sorted_fields): Move to ...
1802 * name-lookup.h (count_fields, add_fields_to_record_type,
1803 add_enum_fields_to_record_type, sorted_fields_type_new,
1804 set_class_bindings, insert_late_enum_def_bindings): ... here.
1805
bff8b385
NS
18062017-08-25 Nathan Sidwell <nathan@acm.org>
1807
41970ff1 1808 * class.c (method_name_cmp, resort_method_name_cmp): Methods
bb5d50b5
NS
1809 can never be NULL.
1810
bff8b385
NS
1811 Conversion operators have a special name
1812 * cp-tree.h (CPTI_CONV_OP_MARKER, CPTI_CONV_OP_IDENTIFIER): New.
1813 (conv_op_marker, conv_op_identifier): New.
1814 (CLASSTYPE_FIRST_CONVERSION_SLOT): Delete.
1815 * decl.c (initialize_predefined_identifiers): Add
1816 conv_op_identifier.
1817 (cxx_init_decl_processing): Create conv_op_marker.
1818 * decl2.c (check_classfn): Lookup conv-ops by name.
1819 * class.c (add_method): Use conv_op_identifier & conv_op_marker.
1820 (resort_type_method_vec): Don't skip conv-ops.
1821 (finish_struct_methods, warn_hidden): Likewise.
1822 * name-lookup.h (lookup_all_conversions): Delete.
1823 * name-lookup.c (lookup_conversion_operator): Replace with ...
1824 (extract_conversion_operator): ... this.
1825 (lookup_fnfields_slot_nolazy): Find conv-ops by name.
1826 (lookup_all_conversions): Delete.
1827 * pt.c (check_explicit_specialization): Find conv-ops by name.
1828 * search.c (lookup_conversions_r): Likewise.
1829
2e12a855
NS
18302017-08-24 Nathan Sidwell <nathan@acm.org>
1831
1832 Conversion operators kept on single overload set
1833 * class.c (add_method): Keep all conv-ops on one slot.
1834 * name-lookup.c (lookup_conversion_operator): Pull the desired
1835 conv op out of overload set.
1836 * search.c (lookup_conversions_r): Lose template/non-template
1837 distinction.
1838 (lookup_conversions): Likewise.
1839
84ac4dfc
NS
18402017-08-23 Nathan Sidwell <nathan@acm.org>
1841
9e931c2a
NS
1842 * cp-tree.h (lookup_field_1, lookup_fnfields_slot,
1843 lookup_fnfields_slot_nolazy, lookup_all_conversions): Move
1844 declatations to ...
1845 * name-lookup.h (lookup_field_1, lookup_fnfields_slot,
1846 lookup_fnfields_slot_nolazy, lookup_all_conversions): ... here.
1847 * search.c (lookup_conversion_operator,
1848 lookup_fnfields_slot_nolazy, lookup_field_1, lookup_fnfields_slot,
1849 lookup_all_conversions): Move to ...
1850 * name-lookup.c (lookup_conversion_operator,
1851 lookup_fnfields_slot_nolazy, lookup_field_1, lookup_fnfields_slot,
1852 lookup_all_conversions): ... here.
1853
3928bd5f
NS
1854 * semantics.c (finish_member_declaration): Move USING_DECL check
1855 earlier. Always set C++ linkage. Commonize TYPE_FIELD and
1856 template decl list insertion.
1857
25d203fb
NS
1858 * cp-tree.h (maybe_version_functions): Declare.
1859 * decl.c (decls_match): Break function versioning check to
1860 separate function. Call it.
1861 (maybe_version_functions): Broken out of decls_match.
1862 * class.c (add_method): Use maybe_version_functions.
1863
84ac4dfc
NS
1864 * cp-tree.h (print_search_statistics,
1865 reinit_search_statistics): Don't declare.
1866 * search.c (n_fields_searched, n_calls_lookup_field,
1867 n_calls_lookup_field_1, n_calls_lookup_fnfields,
1868 n_calls_lookup_fnfields_1, n_calls_get_base_type,
1869 n_outer_fields_searched, n_contexts_saved): Delete.
1870 (lookup_field_1, lookup_member,
1871 lookup_fnfields_slot_nolazy): Remove stat gathering.
1872 (print_search_statistics, reinit_search_statistics): Delete.
1873 * tree.c (cxx_print_statistics): Don't print search stats.
1874
8e063904
NS
18752017-08-21 Nathan Sidwell <nathan@acm.org>
1876
3d9850f4
NS
1877 * search.c (lookup_field_r): Remove obsolete code for type-named
1878 field in PoD.
1879
8e063904
NS
1880 * search.c (lookup_field_1): Assert TYPE is a class and VFIELD
1881 isn't special.
1882 (lookup_field_fuzzy_info::fuzzy_lookup_fnfields): Delete.
1883 (lookup_field_fuzzy_r): Adjust.
1884
2f687306
DM
18852017-08-21 David Malcolm <dmalcolm@redhat.com>
1886
1887 * call.c (build_over_call): Pass NULL for new parameter to
1888 check_function_arguments.
1889 * typeck.c (cp_build_function_call_vec): Likewise.
1890
5ec1701e
NS
18912017-08-21 Nathan Sidwell <nathan@acm.org>
1892
1893 PR c++/81899
1894 * pt.c (instantiate_class_template_1):
1895 BOUND_TEMPLATE_TEMPLATE_PARM is never friend-injected.
1896
f661e57e
DM
18972017-08-18 David Malcolm <dmalcolm@redhat.com>
1898
1899 PR c++/81514
1900 * name-lookup.c (maybe_suggest_missing_header): Convert return
1901 type from void to bool; return true iff a suggestion was offered.
1902 (suggest_alternative_in_explicit_scope): Move call to
1903 maybe_suggest_missing_header to before use of best_match, and
1904 return true if the former offers a suggestion.
1905
00aa1fa2
L
19062017-08-18 H.J. Lu <hongjiu.lu@intel.com>
1907
1908 PR c/53037
1909 * decl.c (duplicate_decls): Also merge DECL_WARN_IF_NOT_ALIGN.
1910 * decl2.c (grokbitfield): Don't allow bit-field with
1911 warn_if_not_aligned type.
1912
0fc81d78
NS
19132017-08-17 Nathan Sidwell <nathan@acm.org>
1914
1f81b321
NS
1915 * cp-tree.def (TEMPLATE_TEMPLATE_PARM): Remove stale comment.
1916 * cp-tree.h (ENUM_TEMPLATE_INFO): Delete.
1917 (TYPE_TEMPLATE_INFO): Simplify.
1918 (SET_TYPE_TEMPLATE_INFO): Simplify.
1919
776ff3ef
NS
1920 * lex.c (maybe_add_lang_type_raw): BOUND_TEMPLATE_TEMPLATE_PARMs
1921 don't need lang_type.
1922 (cxx_make_type): Use maybe_add_lang_type_raw return value.
1923 * mangle.c (CLASSTYPE_TEMPLATE_ID_P): Don't rely on
1924 TYPE_LANG_SPECIFIC.
1925
0fc81d78
NS
1926 * cp-tree.h (struct lang_type): Remove template_info field.
1927 (CLASSTYPE_TEMPLATE_INFO): Use TYPE_LANG_SLOT_1.
1928 (TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO): Likewise.
1929
da67acb9
MS
19302017-08-14 Martin Sebor <msebor@redhat.com>
1931
1932 PR c/81117
1933 * error.c (cp_printer): Handle 'G'.
1934
a8b522b4
ML
19352017-08-11 Martin Liska <mliska@suse.cz>
1936
1937 * decl2.c (get_tls_init_fn): Replace ASM_OUTPUT_DEF with
1938 TARGET_SUPPORTS_ALIASES.
1939 (handle_tls_init): Likewise.
1940 (note_mangling_alias): Likewise. Remove ATTRIBUTE_UNUSED for
1941 both arguments.
1942 * optimize.c (can_alias_cdtor): Likewise.
1943
5675808f
JM
19442017-08-11 Jason Merrill <jason@redhat.com>
1945
1946 PR c++/81671 - nullptr_t template parameter
1947 * pt.c (convert_nontype_argument): Fix nullptr_t check.
1948
4ce8c5de
JM
19492017-08-10 Jason Merrill <jason@redhat.com>
1950
339922f4
JM
1951 PR c++/81359 - Unparsed NSDMI error from SFINAE context.
1952 * method.c (synthesized_method_walk): Don't diagnose lack of
1953 operator delete.
1954
4ce8c5de
JM
1955 PR c++/80452 - Core 1579, implicit move semantics on return/throw
1956 * cp-tree.h (LOOKUP_PREFER_RVALUE): Now means that we've already
1957 tentatively changed the lvalue to an rvalue.
1958 * call.c (reference_binding): Remove LOOKUP_PREFER_RVALUE handling.
1959 (build_over_call): If LOOKUP_PREFER_RVALUE, check that the first
1960 parameter is an rvalue reference.
1961 * except.c (build_throw): Do maybe-rvalue overload resolution twice.
1962 * typeck.c (check_return_expr): Likewise.
1963
32129a17
DM
19642017-08-10 David Malcolm <dmalcolm@redhat.com>
1965
1966 * parser.c (cp_parser_error): Update for new param to
1967 c_parse_error.
1968 (class token_pair): New class.
1969 (struct matching_paren_traits): New struct.
1970 (matching_parens): New typedef.
1971 (struct matching_brace_traits): New struct.
1972 (matching_braces): New typedef.
1973 (cp_parser_statement_expr): Convert explicit parsing of
1974 CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use of
1975 class matching_parens, so that the pertinent open parenthesis is
1976 highlighted when there are problems locating the close
1977 parenthesis.
1978 (cp_parser_primary_expression): Likewise.
1979 (cp_parser_compound_literal_p): Remove consumption of opening
1980 paren.
1981 (cp_parser_postfix_expression): Convert explicit parsing of
1982 CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use matching parens, as
1983 above. Use it to consume the opening paren previously consumed by
1984 cp_parser_compound_literal_p.
1985 (cp_parser_parenthesized_expression_list): Likewise.
1986 (cp_parser_unary_expression): Likewise.
1987 (cp_parser_new_expression): Likewise.
1988 (cp_parser_cast_expression): Likewise.
1989 (cp_parser_builtin_offsetof): Likewise.
1990 (cp_parser_trait_expr): Likewise.
1991 (cp_parser_lambda_declarator_opt): Likewise.
1992 (cp_parser_lambda_body): Likewise, for matching_braces.
1993 (cp_parser_compound_statement): Likewise.
1994 (cp_parser_selection_statement): Likewise, for matching_parens.
1995 (cp_parser_iteration_statement): Likewise.
1996 (cp_parser_already_scoped_statement): Likewise, for
1997 matching_braces.
1998 (cp_parser_linkage_specification): Likewise.
1999 (cp_parser_static_assert): Likewise, for matching_parens.
2000 (cp_parser_decltype): Likewise.
2001 (cp_parser_operator): Likewise.
2002 (cp_parser_enum_specifier): Likewise.
2003 (cp_parser_namespace_definition): Likewise.
2004 (cp_parser_direct_declarator): Likewise.
2005 (cp_parser_braced_list): Likewise.
2006 (cp_parser_class_specifier_1): Likewise, for matching_braces.
2007 (cp_parser_constant_initializer): Likewise.
2008 (cp_parser_noexcept_specification_opt): Likewise, for
2009 matching_parens.
2010 (cp_parser_exception_specification_opt): Likewise.
2011 (cp_parser_handler): Likewise.
2012 (cp_parser_asm_specification_opt): Likewise.
2013 (cp_parser_asm_operand_list): Likewise.
2014 (cp_parser_gnu_attributes_opt): Likewise.
2015 (cp_parser_std_attribute_spec): Likewise.
2016 (cp_parser_requirement_parameter_list): Likewise.
2017 (cp_parser_requirement_body): Likewise, for matching_braces.
2018 (cp_parser_compound_requirement): Likewise.
2019 (cp_parser_template_introduction): Likewise.
2020 (cp_parser_sizeof_pack): Likewise, for matching_parens.
2021 (cp_parser_sizeof_operand): Likewise; use it to consume the
2022 opening paren previously consumed by cp_parser_compound_literal_p.
2023 (get_matching_symbol): New function.
2024 (cp_parser_required_error): Add param "matching_location". Remove
2025 calls to cp_parser_error, instead setting a non-NULL gmsgid, and
2026 handling it if set by calling c_parse_error, potentially with a
2027 secondary location if matching_location was set.
2028 (cp_parser_require): Add param "matching_location", with a default
2029 value of UNKNOWN_LOCATION.
2030 (cp_parser_require_keyword): Update for new param of
2031 cp_parser_required_error.
2032 (cp_parser_objc_encode_expression): Update to class matching_parens
2033 as above.
2034 (cp_parser_objc_defs_expression): Likewise.
2035 (cp_parser_objc_protocol_expression): Likewise.
2036 (cp_parser_objc_selector_expression): Likewise.
2037 (cp_parser_objc_typename): Likewise.
2038 (cp_parser_objc_superclass_or_category): Likewise.
2039 (cp_parser_objc_try_catch_finally_statement): Likewise.
2040 (cp_parser_objc_synchronized_statement): Likewise.
2041 (cp_parser_objc_at_property_declaration): Likewise.
2042 (cp_parser_oacc_single_int_clause): Likewise.
2043 (cp_parser_oacc_shape_clause): Likewise.
2044 (cp_parser_omp_clause_collapse): Likewise.
2045 (cp_parser_omp_clause_default): Likewise.
2046 (cp_parser_omp_clause_final): Likewise.
2047 (cp_parser_omp_clause_if): Likewise.
2048 (cp_parser_omp_clause_num_threads): Likewise.
2049 (cp_parser_omp_clause_num_tasks): Likewise.
2050 (cp_parser_omp_clause_grainsize): Likewise.
2051 (cp_parser_omp_clause_priority): Likewise.
2052 (cp_parser_omp_clause_hint): Likewise.
2053 (cp_parser_omp_clause_defaultmap): Likewise.
2054 (cp_parser_omp_clause_ordered): Likewise.
2055 (cp_parser_omp_clause_schedule): Likewise.
2056 (cp_parser_omp_clause_num_teams): Likewise.
2057 (cp_parser_omp_clause_thread_limit): Likewise.
2058 (cp_parser_omp_clause_aligned): Likewise.
2059 (cp_parser_omp_clause_linear): Likewise.
2060 (cp_parser_omp_clause_safelen): Likewise.
2061 (cp_parser_omp_clause_simdlen): Likewise.
2062 (cp_parser_omp_clause_depend): Likewise.
2063 (cp_parser_omp_clause_device): Likewise.
2064 (cp_parser_omp_clause_dist_schedule): Likewise.
2065 (cp_parser_oacc_clause_async): Likewise.
2066 (cp_parser_omp_critical): Likewise.
2067 (cp_parser_omp_for_loop): Likewise.
2068 (cp_parser_omp_sections_scope): Likewise.
2069 (cp_parser_omp_declare_reduction_exprs): Likewise.
2070 Update for new param to cp_parser_required_error.
2071 (cp_parser_oacc_routine): Likewise.
2072 (cp_parser_transaction_expression): Likewise.
2073 (cp_parser_cilk_simd_vectorlength): Likewise.
2074
9fb82e65
JM
20752017-08-09 Jason Merrill <jason@redhat.com>
2076
233608bd
JM
2077 PR c++/81525 - wrong constant value with generic lambda
2078 * pt.c (tsubst_decl) [VAR_DECL]: Avoid clobbering auto.
2079 (tsubst_copy) [VAR_DECL]: Handle auto.
2080
9fb82e65
JM
2081 PR c++/81359 - Unparsed NSDMI error from SFINAE context.
2082 * init.c (get_nsdmi): Add complain parm.
2083 * typeck2.c (digest_nsdmi_init): Add complain parm.
2084 (process_init_constructor_record): Pass complain to get_nsdmi.
2085 * pt.c (maybe_instantiate_noexcept): Add complain parm, return bool.
2086 * method.c (get_defaulted_eh_spec): Add complain parm. Pass it into
2087 synthesized_method_walk.
2088 (synthesized_method_walk): Adjust.
2089 (walk_field_subobs): Pass complain to get_nsdmi.
2090 (defaulted_late_check): Skip other checks if deleted.
2091 * decl2.c (mark_used): Pass complain to maybe_instantiate_noexcept.
2092 * call.c (build_aggr_conv): Pass complain to get_nsdmi.
2093 * parser.c (defarg_location): New.
2094 * error.c (location_of): Use it.
2095
30af3a2b
MP
20962017-08-09 Marek Polacek <polacek@redhat.com>
2097
2098 * parser.c (cp_parser_perform_range_for_lookup): Use false instead of 0.
2099 * typeck.c (build_binary_op): Change the type of a parameter to bool.
2100 (cp_truthvalue_conversion): Use true instead of 1.
2101
a5afbdd6
MP
21022017-08-08 Marek Polacek <polacek@redhat.com>
2103
2104 PR c++/81607
2105 * cp-gimplify.c (cp_fold): If folding exposed a branch of
2106 a COND_EXPR, convert it to the original type of the COND_EXPR, if
2107 they differ.
2108
314e6352
ML
21092017-08-08 Martin Liska <mliska@suse.cz>
2110
2111 * call.c: Include header files.
2112 * cp-gimplify.c: Likewise.
2113 * cp-ubsan.c: Likewise.
2114 * cvt.c: Likewise.
2115 * init.c: Likewise.
2116 * search.c: Likewise.
2117 * semantics.c: Likewise.
2118 * typeck.c: Likewise.
2119
577eec56
ML
21202017-08-07 Martin Liska <mliska@suse.cz>
2121
2122 * parser.c (cp_parser_gnu_attribute_list): Canonicalize name of an
2123 attribute.
2124 (cp_parser_std_attribute): Likewise.
2125 * tree.c: Add new include.
2126
67695c07
PC
21272017-08-04 Paolo Carlini <paolo.carlini@oracle.com>
2128
2129 PR c++/79790
2130 * pt.c (do_class_deduction): Handle the case of no viable implicit
2131 deduction guides; simplify the code generating implicit deduction
2132 guides.
2133
e5e691a5
PC
21342017-08-03 Paolo Carlini <paolo.carlini@oracle.com>
2135
2136 PR c++/71440
2137 * typeck.c (build_x_unary_op): Avoid pretty-printing constructor /
2138 destructor as expressions.
2139
e4f0733a
JJ
21402017-08-02 Jakub Jelinek <jakub@redhat.com>
2141
2142 PR c++/81640
2143 * call.c (build_user_type_conversion_1): Only call
2144 lookup_fnfields_slot if totype is CLASS_TYPE_P.
2145
32341663
JM
21462017-07-31 Jason Merrill <jason@redhat.com>
2147
2148 * decl.c (declare_global_var): Set DECL_CONTEXT.
2149
7fef86d3
JH
21502017-07-31 Jan Hubicka <hubicka@ucw.cz>
2151 Martin Liska <mliska@suse.cz>
2152
2153 * pt.c (tsubst_copy): Copy PREDICT_EXPR.
2154 * semantics.c (finish_goto_stmt): Build gimple predict
2155 stament.
2156 * constexpr.c (potential_constant_expression_1): Handle
2157 PREDICT_EXPR.
2158
f34ebeb2
ML
21592017-07-31 Martin Liska <mliska@suse.cz>
2160
2161 PR sanitize/81530
2162 * cp-gimplify.c (cp_genericize): Guard condition with flag_sanitize_p
2163 also with current_function_decl non-null equality.
2164 * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
2165 * decl.c (compute_array_index_type): Likewise.
2166 * init.c (finish_length_check): Likewise.
2167 * typeck.c (cp_build_binary_op): Likewise.
2168
e071b767
JJ
21692017-07-29 Jakub Jelinek <jakub@redhat.com>
2170
2171 * cp-objcp-common.c (cp_decl_dwarf_attribute): Handle
2172 DW_AT_export_symbols.
2173 * name-lookup.c (emit_debug_info_using_namespace): Add IMPLICIT
2174 argument, pass it through to the debug hook.
2175 (finish_namespace_using_directive): Adjust
2176 emit_debug_info_using_namespace caller.
2177 (push_namespace): Likewise. Call it after setting
2178 DECL_NAMESPACE_INLINE_P.
2179 (cp_emit_debug_info_for_using): Pass false as new argument to
2180 the imported_module_or_decl debug hook.
2181
39d970d7
TS
21822017-07-28 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
2183
2184 * lex.c (copy_decl): Adjust.
2185 (copy_type): Likewise.
2186
eb086562
PC
21872017-07-26 Paolo Carlini <paolo.carlini@oracle.com>
2188
2189 PR c++/71570
2190 * lambda.c (add_capture): Early return if we cannot capture by
2191 reference.
2192
6cad8c86
JM
21932017-07-26 Jason Merrill <jason@redhat.com>
2194
2195 P0702R1 - List deduction of vector.
2196 * pt.c (do_class_deduction): Special-case deduction from a single
2197 element of related type.
2198
80e7cb2d
LK
21992017-07-26 Leonid Koppel <lkoppel@uwaterloo.ca>
2200
2201 PR c++/67054 - Inherited ctor with non-default-constructible members
2202 * method.c (walk_field_subobs) Consider member initializers (NSDMIs)
2203 when deducing an inheriting constructor.
2204
60f80e65
NS
22052017-07-21 Nathan Sidwell <nathan@acm.org>
2206
d5c125ca
NS
2207 * search.c (lookup_conversion_operator): Return overloads.
2208 (lookup_fnfields_idx_nolazy): Absorb into ...
2209 (lookup_fnfields_slot_nolaxy): ... here.
2210 (lookup_fnfields_1): Absorb into ...
2211 (lookup_fnfields_slot): ... here.
2212
2401ffc3
NS
2213 Remove special CDtor METHOD_VEC slots.
2214 * cp-tree.h (CLASSTYPE_CONSTRUCTOR_SLOT,
2215 CLASSTYPE_DESTRUCTOR_SLOT): Delete.
2216 (CLASSTYPE_CONSTRUCTORS): Use lookup_fnfields_slot_nolazy.
2217 (CLASSTYPE_DESTRUCTOR): Likewise.
2218 * class (add_method): Don't use special cdtor slots.
2219 * search.c (lookup_fnfields_idx_nolazy): Likewise.
2220 (look_for_overrides_here): Use lookup_fnfields_slot.
2221 * semantics (classtype_has_nothrow_assign_or_copy_p): Likewise.
2222
60f80e65
NS
2223 * call.c (add_candidates): Move decls to initialization. Don't
2224 use !!.
2225
5aaa8fb4
NS
22262017-07-20 Nathan Sidwell <nathan@acm.org>
2227
2228 Remove TYPE_METHODS.
2229 * class.c (maybe_warn_about_overly_private_class,
2230 finish_struct_methods, one_inheriting_sig, count_fields,
2231 add_fields_to_record_type, check_field_decls, check_methods,
2232 clone_function_decl, set_method_tm_attributes,
2233 finalize_literal_type_property, check_bases_and_members,
2234 create_vtable_ptr, determine_key_method,
2235 unreverse_member_declarations, finish_struct,
2236 add_vcall_offset_vtbl_entries_1): Member fns are on TYPE_FIELDS.
2237 * decl.c (fixup_anonymous_aggr): Likewise.
2238 * decl2.c (reset_type_linkage_2): Likewise.
2239 * method.c (after_nsdmi_defaulted_late_checks,
2240 lazily_declare_fn): Likewise.
2241 * optimize.c (maybe_thunk_body, maybe_clone_body): Likewise.
2242 * pt.c (instantiate_class_template_1, tsubst_expr,
2243 do_type_instantiation, instantiate_pending_templates): Likewise.
2244 * search.c (lookup_field_1): Likewise.
2245 * semantics.c (finish_member_declaration,
2246 finish_omp_declare_simd_methods): Likewise.
2247
20deef65
NS
22482017-07-19 Nathan Sidwell <nathan@acm.org>
2249
4a18c066
NS
2250 * class.c (add_implicitly_declared_members): Use
2251 classtype_has_move_assign_or_move_ctor_p.
2252 (classtype_has_move_assign_or_move_ctor,
2253 classtype_has_user_move_assign_or_move_ctor_p): Merge into ...
2254 (classtype_has_move_assign_or_move_ctor_p): ... this new function.
2255 * cp-tree.h (classtype_has_user_move_assign_or_move_ctor_p):
2256 Replace with ...
2257 (classtype_has_move_assign_or_move_ctor_p): ... this.
2258 * method.c (maybe_explain_implicit_delete, lazily_declare_fn): Adjust.
2259 * tree.c (type_has_nontrivial_copy_init): Adjust.
2260
20deef65
NS
2261 * cp-tree.h (PACK_EXPANSION_PARAMETER_PACKS,
2262 PACK_EXPANSION_EXTRA_ARGS): Use TYPE_{MIN,MAX}_VALUE_RAW.
2263
6b8e738e
NS
22642017-07-18 Nathan Sidwell <nathan@acm.org>
2265
ff22eb12
NS
2266 * cp-array-notation.c (build_array_notation_ref): Use
2267 TYPE_{MIN,MAX}_VALUE.
2268
6b8e738e
NS
2269 * class.c (classtype_has_move_assign_or_move_ctor): Declare.
2270 (add_implicitly_declared_members): Use it.
2271 (type_has_move_constructor, type_has_move_assign): Merge into ...
2272 (classtype_has_move_assign_or_move_ctor): ... this new function.
2273 * cp-tree.h (type_has_move_constructor, type_has_move_assign): Delete.
2274
dbc4ecfc
VR
22752017-07-17 Volker Reichelt <v.reichelt@netcologne.de>
2276
2277 * parser.c (cp_parser_decl_specifier_seq): Add fix-it hints for
2278 friend outside class and obsolete auto as storage-class-specifier.
2279
5337720c
NS
22802017-07-17 Nathan Sidwell <nathan@acm.org>
2281
a64559a5
NS
2282 * class.c (maybe_warn_about_overly_private_class): Ignore public
2283 copy ctors.
2284
619018d4
NS
2285 * class.c (type_has_user_declared_move_constructor,
2286 type_has_user_declared_move_assign): Combine into ...
2287 (classtype_has_user_move_assign_or_move_ctor_p): ... this new function.
2288 * cp-tree.h (type_has_user_declared_move_constructor,
2289 type_has_user_declared_move_assign): Combine into ...
2290 (classtype_has_user_move_assign_or_move_ctor_p): ... this. Declare.
2291 * method.c (maybe_explain_implicit_delete): Use it.
2292 (lazily_declare_fn): Use it.
2293 * tree.c (type_has_nontrivial_copy_init): Use it.
2294
5337720c
NS
2295 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Clarify
2296 semantics, simplify implementation.
2297
00aeee56
VR
22982017-07-16 Volker Reichelt <v.reichelt@netcologne.de>
2299
2300 * parser.c (cp_parser_cast_expression): Use %q#T instead of %qT
2301 in old-style cast diagnostic.
2302 * typeck.c (maybe_warn_about_useless_cast): Use %q#T instead of %qT
2303 in useless cast diagnostic.
2304 * error.c (type_to_string): Remove enum special handling.
2305
eea77d1f
DM
23062017-07-14 David Malcolm <dmalcolm@redhat.com>
2307
2308 * name-lookup.c (get_std_name_hint): Add '<' and '>' around
2309 the header names.
2310 (maybe_suggest_missing_header): Update for addition of '<' and '>'
2311 to above. Provide a fix-it hint.
2312 * pt.c: Include "gcc-rich-location.h"
2313 (listify): Attempt to add fix-it hint for missing
2314 #include <initializer_list>.
2315 * rtti.c: Include "gcc-rich-location.h".
2316 (typeid_ok_p): Attempt to add fix-it hint for missing
2317 #include <typeinfo>.
2318
f914a1e2
JM
23192017-07-12 Jason Merrill <jason@redhat.com>
2320
2321 P0512R0 - Deduction from an initializer list.
2322 * pt.c (do_class_deduction): Do list deduction in two phases.
2323
3da3dcdb
NS
23242017-07-12 Nathan Sidwell <nathan@acm.org>
2325
2326 * cp-tree.h (DECL_CONSTRUCTOR_P, DECL_MAYBE_IN_CHARGE_CONSTRUCTOR,
2327 DECL_DESTRUCTOR_P, DECL_MAYBE_IN_CHARGE_DESTRCTOR): Look at
2328 identifier flags.
2329 * decl.c (grokfndecl): Set DECL_CXX_CONSTRUCTOR and
2330 DECL_CXX_DESTRUCTOR explicitly.
2331 * decl2.c (grokclassfn): Likewise.
2332 * friend.c (do_friend): Likewise.
2333 * method.c (make_thunk, make_alias_for,
2334 implicitly_declare_fn): Likewise.
2335
19cf5a70
JM
23362017-07-11 Jason Merrill <jason@redhat.com>
2337
2338 Core DR 393
2339 * decl.c (grokparms): Downgrade error about array of unknown bound
2340 to pedwarn and disable it for C++17.
2341
d988b35c
NS
23422017-07-11 Nathan Sidwell <nathan@acm.org>
2343
2344 * decl2.c (reset_type_linkage_2): Dont't change ctor name.
2345
b2221d2b
MS
23462017-07-10 Martin Sebor <msebor@redhat.com>
2347
2348 * cp-tree.h (cp_operator_id, cp_assignment_operator_id): Document.
2349
9ddfe5f4
JM
23502017-07-06 Jason Merrill <jason@redhat.com>
2351
2352 PR c++/81204 - parse error with dependent template-name
2353 * parser.c (cp_parser_lookup_name): Revert previous change.
2354
b6f43128
DM
23552017-07-06 David Malcolm <dmalcolm@redhat.com>
2356
2357 * cp-lang.c (LANG_HOOKS_RUN_LANG_SELFTESTS): Define as
2358 selftest::run_cp_tests.
2359 (selftest::run_cp_tests): New function.
2360 * cp-tree.h (selftest::run_cp_tests): New decl.
2361
9fc1fed4
JJ
23622017-07-04 Jakub Jelinek <jakub@redhat.com>
2363
8e3b9bbf
JJ
2364 * parser.c (cp_parser_decomposition_declaration): Replace
2365 decomposition declaration with structured binding in diagnostics.
2366 * decl.c (cp_finish_decomp): Likewise.
2367 (grokdeclarator): Likewise.
2368
9fc1fed4
JJ
2369 PR c++/81258
2370 * parser.c (cp_parser_decomposition_declaration): Diagnose invalid
2371 forms of structured binding initializers.
2372
17c18221
PC
23732017-07-03 Paolo Carlini <paolo.carlini@oracle.com>
2374
2375 PR c++/65775
2376 * decl.c (grokdeclarator): Move checks on function return type after
2377 the splice_late_return_type call; if declspecs->locations[ds_type_spec]
2378 is UNKNOWN_LOCATION fall back to input_location.
2379
4ab42f46
DM
23802017-07-03 David Malcolm <dmalcolm@redhat.com>
2381
2382 * parser.c (enum required_token): Fix spelling of
2383 RT_INTERATION to RT_ITERATION.
2384 (cp_parser_iteration_statement): Likewise.
2385 (cp_parser_required_error): Likewise.
2386
3d4de231
JM
23872017-06-30 Jason Merrill <jason@redhat.com>
2388
2389 PR c++/81257 - ICE with invalid ::template.
2390 PR c++/54769 - wrong lookup of dependent template-name.
2391 * parser.c (cp_parser_template_name): Revert part of last change.
2392
08fb1316
NS
23932017-06-30 Nathan Sidwell <nathan@acm.org>
2394
2395 * config-lang.in (gtfiles): Add cp/lex.c.
2396 * cp-tree.h (mangle_convop_name_for_type): Rename ...
2397 (make_conv_op_name): ... here. Move to lex.
2398 * lambda.c (maybe_add_lambda_conv_op): Update.
2399 * parser.c (cp_parser_conversion_function_id): Update.
2400 * pt.c (tsubst_decl, tsubst_baselink, tsubst_copy,
2401 tsubst_copy_and_build): Update.
2402 * semantics.c (apply_deduced_return_type): Update.
2403 * mangle.c (conv_type_hasher, conv_type_names,
2404 mangle_conv_op_name_for_type): Move to ...
2405 * lex.c (conv_type_hasher, conv_type_names, make_convop_name):
2406 ... here. Rename.
2407
e59e8b5a
DM
24082017-06-30 David Malcolm <dmalcolm@redhat.com>
2409
2410 PR c++/80014
2411 * parser.c (cp_parser_postfix_expression): Construct a location
2412 for typeid expressions.
2413
274c1516
NS
24142017-06-30 Nathan Sidwell <nathan@acm.org>
2415
fe32bb1b
NS
2416 * cp-tree.h (lookup_fnfields_1, class_method_index_for_fn): Don't
2417 declare.
2418 (lookup_all_conversions): Declare.
2419 * class.c (get_basefndecls): Use lookup_fnfields_slot.
2420 * decl.c (register_dtor_fn): Use lookup_fnfields_slot.
2421 * decl2.c (check_class_fn): Use lookup_fnfields_slot. Rework
2422 diagnostics.
2423 * pt.c (retrieve_specialization): Use lookup_fnfields_slot.
2424 (check_explicit_specialization): Use lookup_fnfields_slot_nolazy,
2425 lookup_all_conversions.
2426 * search.c (lookup_fnfields_1): Make static.
2427 (lookup_all_conversions): New.
2428 (class_method_index_for_fn): Delete.
2429 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Use
2430 lookup_fnfields_slot.
2431
3b5c768c
NS
2432 * call.c (build_new_method_call_1): Use constructo_name to get
2433 ctor name. Move argument processing earlier to merge cdtor
2434 handling blocks.
2435 * decl.c (grokfndecl): Cdtors have special names.
2436 * method.c (implicitly_declare_fn): Likewise. Simplify flag setting.
2437 * pt.c (check_explicit_specialization): Cdtor name is already
2438 special.
2439 * search.c (class_method_index_for_fn): Likewise.
2440
274c1516
NS
2441 PR c++/81229
2442 * name-lookup.c (do_pushdecl): Reset IDENTIFIER_TYPE when finding
2443 a matching TYPE_DECL.
2444
8e09cb8b
PC
24452017-06-29 Paolo Carlini <paolo.carlini@oracle.com>
2446
2447 * class.c (add_method): Change pair of errors to error + inform.
2448 (handle_using_decl): Likewise.
2449
5497bd2b
JM
24502017-06-29 Jason Merrill <jason@redhat.com>
2451
0395a464
JM
2452 * constexpr.c, error.c, tree.c: Remove WITH_CLEANUP_EXPR handling.
2453
47304c6a
JM
2454 PR c++/81180 - ICE with C++17 deduction of member class template.
2455 * pt.c (build_deduction_guide): Correct member template handling.
2456
5497bd2b
JM
2457 PR c++/81188 - matching decltype of member function call.
2458 * tree.c (cp_tree_equal): Remove COMPONENT_REF special case.
2459
be3b7dcf
NS
24602017-06-29 Nathan Sidwell <nathan@acm.org>
2461
2462 PR c++/81247
2463 * parser.c (cp_parser_namespace_definition): Immediately close the
2464 namespace if there's no open-brace.
2465 * name-lookup.c (do_pushdecl): Reset OLD when pushing into new
2466 namespace.
2467
84eb0f1a
JM
24682017-06-29 Jason Merrill <jason@redhat.com>
2469
2470 PR c++/81164 - ICE with invalid inherited constructor.
2471 * search.c (binfo_direct_p): New.
2472 * name-lookup.c (do_class_using_decl): Use it.
2473
e9888922
NS
24742017-06-29 Nathan Sidwell <nathan@acm.org>
2475
e3e6cc26
NS
2476 * cp-tree.h (THIS_NAME, IN_CHARGE_NAME, VTBL_PTR_TYPE,
2477 VTABLE_DELTA_NAME, VTABLE_PFN_NAME): Delete.
2478 * decl.c (initialize_predefined_identifiers): Name cdtor special
2479 names consistently. Use literals for above deleted defines.
2480 (cxx_init_decl_processing): Use literal for vtbl_ptr_type name,
2481
2de0ccc8
NS
2482 * lex.c (maybe_add_lang_type_raw): Exit early, rather than use a
2483 flag.
2484
56b2a94b
NS
2485 * call.c (check_dtor_name): Use constructor_name for enums too.
2486 (build_new_method_call_1): Use constructor_name for cdtors and
2487 show ~ for dtor.
2488 * class.c (build_self_reference): Use TYPE_NAME to get name of
2489 self reference.
2490 * name-lookup (constructor_name): Use DECL_NAME directly.
2491 (constructor_name_p): Reimplement.
2492 (push_class_level_binding_1): Use TYPE_NAME directly.
2493
79a2e690
NS
2494 * class.c (finish_struct): Use OVL_P.
2495 (get_vfield_name): Measure constructor_name length.
2496 * cp-tree.h (SET_CLASS_TYPE_P): Add RECORD_OR_UNION_CHECK.
2497 (NON_UNION_CLASS_TYPE_P): Check RECORD_TYPE up front.
2498 * cxx-pretty-print.c (is_destructor_name): Delete.
2499 (pp_cxx_unqualified_id): Remove bogus destructor name checking.
2500 * decl.c (grokfndecl): Move cheap checks first when looking for
2501 implicit extern cness.
2502
9a82bd05
NS
2503 * parser.c (cp_parser_direct_declarator): Reorder if to avoid
2504 indentation. Remove unnecessary assignment of constructor name.
2505
e9888922
NS
2506 Whitespace cleanups.
2507 * call.c (name_as_c_string): Move CONST_CAST to return.
2508 (build_new_method_call_1): Remove unneeded bracing.
2509 * class.c (include_empty_classes): Unbreak line.
2510 * constraint.cc (tsubst_check_constraint): Add space.
2511 * cp-tree.h (lang_decl_ns): Add comment.
2512 (PTRMEM_CST_MEMBER): Break line.
2513 * decl.c (grokfndecl): Add blank lines. Unbreak some others.
2514 (grokdeclarator): Remove lines, move declaration to first use.
2515 * decl2.c (decl_needed_p): Fix indentation.
2516 (c_parse_final_cleanups): Remove blank line.
2517 * method.c (implicitly_declare_fn): Move declaration to first use.
2518 * search.c (current_scope): Add blank lines.
2519
2a4754f5
JM
25202017-06-28 Jason Merrill <jason@redhat.com>
2521
cffc4a68
JM
2522 PR c++/72764 - ICE with invalid template typename.
2523 * decl.c (build_typename_type): No longer static.
2524 * tree.c (strip_typedefs): Use it instead of make_typename_type.
2525
38a79c5a
JM
2526 PR c++/69300 - ICE with self-referential noexcept
2527 * pt.c (maybe_instantiate_noexcept): Check for recursion.
2528
7e61b3d4
JM
2529 PR c++/61022 - error with variadic template template parm
2530 * pt.c (convert_template_argument): Keep the TYPE_PACK_EXPANSION.
2531
d778c637
JM
2532 PR c++/72801 - ICE with variadic partial specialization
2533 * pt.c (unify_pack_expansion): Use PACK_EXPANSION_EXTRA_ARGS.
2534
4516a545
JM
2535 PR c++/55639 - partial specialization with ::template
2536 * parser.c (cp_parser_class_head): Handle ::template.
2537
36f48ebd
JM
2538 PR c++/45976 - error with ::template in declarator.
2539 * pt.c (resolve_typename_type): Fix TEMPLATE_ID_EXPR handling.
2540
1e5f79b6
JM
2541 PR c++/54769 - wrong lookup of dependent template-name.
2542 * parser.c (cp_parser_template_name): Handle dependent object type.
2543 (cp_parser_nested_name_specifier_opt): Make template_keyword_p a
2544 parameter.
2545 (cp_parser_id_expression): Pass it.
2546 (cp_parser_diagnose_invalid_type_name): Handle TEMPLATE_ID_EXPR.
2547
dc3b932e
JM
2548 * parser.c (cp_parser_template_id): Use the range location on the
2549 TEMPLATE_ID_EXPR.
2550
2a4754f5
JM
2551 PR c++/81204 - parse error with dependent template-name
2552 * parser.c (cp_parser_lookup_name): Disqualify function templates
2553 after lookup.
2554
5fee5eca
NS
25552017-06-27 Nathan Sidwell <nathan@acm.org>
2556
acea808a
NS
2557 * pt.c (tsubst_decl <FUNCTION_DECL>): Move var decls to
2558 initialization point. Don't unnecessarily check for ctor name.
2559
b2cf76f3
NS
2560 * cp-tree.h (CLASSTYPE_DESTRUCTORS): Rename to ...
2561 (CLASSTYPE_DESTRUCTOR): ... this.
2562 * class.c (accessible_nvdtor_p,
2563 maybe_warn_about_overly_private_class,
2564 add_implicitly_declared_members,
2565 clone_constructors_and_destructors, type_has_virtual_destructor):
2566 Adjust for CLASSTYPE_DESTRUCTOR.
2567 (deduce_noexcept_on_destructors): Absorb into ...
2568 (check_bases_and_members): ... here.
2569 * except.c (dtor_nothrow): Adjust for CLASSTYPE_DESTRUCTOR.
2570 * init.c (build_delete): Likewise.
2571 * parser.c (cp_parser_lookup_name): Likewise.
2572 * pt.c (check_explicit_specialization): Likewise.
2573 * rtti.c (emit_support_tinfos): Likewise.
2574 * search.c (lookup_fnfields_idx_nolazy): Likewise.
2575
5fee5eca
NS
2576 Kill IDENTIFIER_TEMPLATE.
2577 * cp-tree.h (lang_identifier): Remove class_template_info field.
2578 (IDENTIFIER_TEMPLATE): Delete.
2579 * name-lookup.c (constructor_name_full): Subsume into ...
2580 (constructor_name): ... here. Don't check IDENTIFIER_TEMPLATE.
2581 (constructor_name_p): Likewise.
2582 * mangle.c (write_source_name): Likewise.
2583 * ptree.c (cxx_print_identifier): Likewise.
2584
0c418630
MP
25852017-06-27 Marek Polacek <polacek@redhat.com>
2586
2587 PR bootstrap/81216
2588 * parser.c (cp_parser_already_scoped_statement): Initialize
2589 LOC_AFTER_LABELS.
2590
b0d1023d
JM
25912017-06-26 Jason Merrill <jason@redhat.com>
2592
2593 PR c++/81215 - deduction failure with variadic TTP.
2594 * pt.c (unify_bound_ttp_args): Restore old logic for C++14 and down.
2595
4b377e01
MS
25962017-06-26 Martin Sebor <msebor@redhat.com>
2597
2598 PR c++/81169
2599 * call.c (maybe_warn_class_memaccess): Preserve explicit conversions
2600 to detect casting away cv-qualifiers.
2601
d6ef53f2
NS
26022017-06-26 Nathan Sidwell <nathan@acm.org>
2603
2604 * cp-tree.h (lang_decl_fn): Remove assignment_operator_p field.
2605 (DECL_COMPLETE_CONSTRUCTOR_P): Directly compare
2606 identifier.
2607 (DECL_BASE_CONSTRUCTOR_P, DECL_COMPLETE_DESTRUCTOR_P,
2608 DECL_BASE_DESTRUCTOR_P, DECL_DELETING_DESTRUCTOR_P): Likewise.
2609 (DECL_ASSIGNMENT_OPERATOR_P): Use IDENTIFIER_ASSIGN_OP_P.
2610 * decl.c (grok_op_properties): Adjust identifier checking.
2611 * init.c (expand_default_init): Adjust identifier descision.
2612 * method.c (implicitly_declare_fn): Don't use
2613 DECL_ASSIGNMENT_OPERATOR_P.
2614 * search.c (lookup_fnfields_1): Use IDENTIFIER_CTOR_P,
2615 IDENTIFIER_DTOR_P.
2616 * call.c (in_charge_arg_for_name): Reimplement.
2617 (build_special_member_call): Use IDENTIFIER_CDTOR_P,
2618 IDENTIFIER_DTOR_P.
2619
3e2becc4
MP
26202017-06-26 Marek Polacek <polacek@redhat.com>
2621
2622 PR c/80116
2623 * parser.c (cp_parser_statement): Add a default argument. Save the
2624 location of the expression-statement after labels have been parsed.
2625 (cp_parser_implicitly_scoped_statement): Set the location of the
2626 body of the conditional after parsing all the labels. Call
2627 warn_for_multistatement_macros.
2628 (cp_parser_already_scoped_statement): Likewise.
2629
22235619
PC
26302017-06-24 Paolo Carlini <paolo.carlini@oracle.com>
2631
2632 PR c++/62315
2633 * parser.c (cp_parser_diagnose_invalid_type_name): Don't print
2634 'typename' in error messages about missing 'typename'.
2635
e2e80f2f
JM
26362017-06-23 Jason Merrill <jason@redhat.com>
2637
2638 PR c++/79056 - C++17 ICE with invalid template syntax.
2639 * parser.c (cp_parser_simple_type_specifier): Don't assume that type
2640 is a TYPE_DECL.
2641 (cp_parser_check_for_invalid_template_id): Handle TYPE_DECL.
2642 * pt.c (template_placeholder_p): New.
2643 * cp-tree.h: Declare it.
2644
2db9b7cd
MG
26452017-06-23 Marc Glisse <marc.glisse@inria.fr>
2646
2647 * decl.c (duplicate_decls): Use builtin_structptr_types.
2648
84c0088f
NS
26492017-06-22 Nathan Sidwell <nathan@acm.org>
2650
2651 Reorder IDENTIFIER flags
2652 gcc/cp/
2653 * cp-tree.h (enum cp_identifier_kind): New.
2654 (IDENTIFIER_KIND_BIT_0, IDENTIFIER_KIND_BIT_1,
2655 IDENTIFIER_KIND_BIT_2): New.
2656 (IDENTIFIER_MARKED): Move to TREE_LANG_FLAG_4.
2657 (IDENTIFIER_VIRTUAL_P, IDENTIFIER_REPO_CHOSEN): Add IDENTIFIER_CHECK.
2658 (C_IS_RESERVED_WORD): Replace with ...
2659 (IDENTIFIER_KEYWORD_P): ... this.
2660 (IDENTIFIER_CTOR_OR_DTOR_P): Replace with ...
2661 (IDENTIFIER_CDTOR_P): ... this.
2662 (IDENTIFIER_CTOR_P, IDENTIFIER_DTOR_P): New.
2663 (IDENTIFIER_OPNAME_P): Replace with ...
2664 (IDENTIFIER_ANY_OP_P): ... this.
2665 (IDENTIFIER_ASSIGN_OP_P): New.
2666 (IDENTIFIER_TYPENAME_P): Replace with ...
2667 (IDENTIFIER_CONV_OP_P): ... this.
2668 (NEW_DELETE_OPNAME_P): Replace with ...
2669 (IDENTIFIER_NEWDEL_OP_P): ... this.
2670 (DECL_CONV_FN_P, DECL_OVERLOADED_OPERATOR_P): Adjust.
2671 (get_identifier_kind_name, set_identifier_kind): Declare.
2672 * lex.c (get_identifier_kind_name, set_identifier_kind): New.
2673 (init_operators): Adjust to avoid keywords, use
2674 set_identifier_kind. Copy TYPE_EXPR slot.
2675 (init_reswords): Call set_identifier_kind.
2676 (unqualified_name_lookup_error): Adjust.
2677 * operators.def (TYPE_EXPR): Remove.
2678 * decl.c (struct predefined_identifier): Move into ...
2679 (initialize_predefined_identifiers): ... here. Call
2680 set_identifier_kind.
2681 (grokfndecl, check_var_type, grokdeclarator): Adjust.
2682 (grok_op_properties): Use IDENTIFIER_ANY_ASSIGN_OP to halve search
2683 space. Adjust.
2684 * call.c (name_as_c_string): Adjust.
2685 (build_new_method_call_1): Likewise.
2686 * cp-cilkplus.c (is_conversion_operator_function_decl_p): Likewise.
2687 * cxx-pretty-print.c (pp_cxx_unqualified_id): Adjust.
2688 * dump.c (cp_dump_tree): Adjust.
2689 * error.c (dump_decl_name): Adjust.
2690 * mangle.c (write_unqualified_id, write_member_name,
2691 write_expression): Adjust.
2692 (mangle_conv_op_name_for_type): Use set_identifier_kind.
2693 * name-lookup.c (do_class_using_decl): Adjust.
2694 (lookup_name_fuzzy, lookup_name_real_1): Likewise.
2695 * parser.c (cp_lexer_get_preprocessor_token,
2696 cp_parser_direct_declarator): Likewise.
2697 * pt.c (push_template_decl_real, tsubst_decl, tsubst_baselink,
2698 tsubst_copy, tsubst_copy_and_build): Adjust.
2699 * ptree.c (cxx_print_identifier): Print identifier kind.
2700 * search.c (lookup_field_r, lookup_member,
2701 lookup_fnfields_idx_nolazy): Adjust.
2702 * semantics.c (finish_id_expression): Adjust..
2703 * typeck.c (cp_build_addr_expr_1): Adjust.
2704
cb8d1b01
JJ
27052017-06-21 Jakub Jelinek <jakub@redhat.com>
2706
2707 PR c++/81154
2708 * semantics.c (handle_omp_array_sections_1, finish_omp_clauses):
2709 Complain about t not being a variable if t is OVERLOAD even
2710 when processing_template_decl.
2711
113459fa
DM
27122017-06-21 David Malcolm <dmalcolm@redhat.com>
2713
2714 * parser.c (get_cast_suggestion): New function.
2715 (maybe_add_cast_fixit): New function.
2716 (cp_parser_cast_expression): Capture the location of the closing
2717 parenthesis. Call maybe_add_cast_fixit when emitting warnings
2718 about old-style casts.
2719
d276da0c
JM
27202017-06-20 Jason Merrill <jason@redhat.com>
2721
2722 PR c++/80972 - C++17 ICE with attribute packed.
2723 * call.c (build_over_call): Allow a TARGET_EXPR from reference
2724 binding.
2725
71bbbd13
NS
27262017-06-20 Nathan Sidwell <nathan@acm.org>
2727
1e5d2102
NS
2728 * cp-tree.h (CPTI_NELTS_IDENTIFIER): Delete.
2729 (nelts_identifier): Delete.
2730 * decl.c (initialize_predefined_identifiers): Remove nelts.
2731
71bbbd13
NS
2732 PR c++/67074 - namespace aliases
2733 * decl.c (duplicate_decls): Don't error here on mismatched
2734 namespace alias.
2735 * name-lookup.c (name_lookup::add_value): Matching namespaces are
2736 not ambiguous.
2737 (diagnose_name_conflict): Namespaces are never redeclarations.
2738 (update_binding): An alias can match a real namespace.
2739
ecc57615
JM
27402017-06-19 Jason Merrill <jason@redhat.com>
2741
66d052d5
JM
2742 PR c++/80562 - ICE with constexpr if.
2743 * semantics.c (finish_if_stmt_cond): Call
2744 instantiate_non_dependent_expr.
2745
ecc57615
JM
2746 PR c++/80829 - ICE with constexpr copy of base subobject.
2747 * constexpr.c (clear_no_implicit_zero): New.
2748 (cxx_eval_call_expression): Call it.
2749
5ec046c0
NS
27502017-06-19 Nathan Sidwell <nathan@acm.org>
2751
2752 PR c++/81124
2753 PR c++/79766
2754 * name-lookup.c (set_decl_namespace): Don't follow using
2755 directives and ignore using decls. Only check overly-explicit
2756 scope after discovering decl.
2757
4b691b13
JM
27582017-06-19 Jason Merrill <jason@redhat.com>
2759
2760 PR c++/81073 - constexpr and static var in statement-expression.
2761 * typeck2.c (store_init_value): Always call
2762 require_potential_constant_expression.
2763 * pt.c (convert_nontype_argument): Likewise.
2764 * constexpr.c (potential_constant_expression_1): Adjust message.
2765 Use decl_maybe_constant_var_p instead of decl_constant_var_p.
2766 * decl2.c (decl_maybe_constant_var_p): Consider initializer.
2767
c14c0b15
NS
27682017-06-19 Nathan Sidwell <nathan@acm.org>
2769
74e56995
NS
2770 * pt.c (coerce_template_parms): Fix indentation.
2771 (tsubst_decl): Remove repeated SET_DECL_RTL. Move VAR_P handling
2772 in to single block.
2773
c14c0b15
NS
2774 PR c++/81119
2775 * name-lookup.c (update_binding): Only warn about constructors
2776 hidden by functions.
2777
5ebcc547
JM
27782017-06-17 Jason Merrill <jason@redhat.com>
2779
20ef9df1
JM
2780 PR c++/60063 - -Wunused-local-typedefs and templates.
2781 * decl2.c (is_late_template_attribute): Return false for "used".
2782
5ebcc547
JM
2783 PR c++/70844 - -Wuseless-cast and inheriting constructor.
2784 * method.c (forward_parm): Suppress warn_useless_cast.
2785
b126bff4
JM
27862017-06-16 Jason Merrill <jason@redhat.com>
2787
ccb7042d
JM
2788 PR c++/81045 - Wrong type-dependence with auto return type.
2789 * pt.c (type_dependent_expression_p): An undeduced auto outside the
2790 template isn't dependent.
2791 * call.c (build_over_call): Instantiate undeduced auto even in a
2792 template.
2793
d4b1d43c
JM
2794 PR c++/80465 - ICE with generic lambda with noexcept-specifier.
2795 * lambda.c (maybe_add_lambda_conv_op): Keep processing_template_decl
2796 set longer for a generic lambda.
2797
cc14602e
JM
2798 PR c++/80614 - Wrong mangling for C++17 noexcept type
2799 * mangle.c (write_type): Put the eh spec back on the function type.
2800
3da557ec
JM
2801 PR c++/81102 - Wrong error with partial specialization.
2802 * pt.c (unify) [TEMPLATE_PARM_INDEX]: Strip reference when comparing
2803 types. Do type deduction later.
2804
e8cc8c92 2805 PR c++/81074 - ICE with partial specialization of member template.
157420b4
JM
2806 PR c++/71747
2807 * pt.c (get_partial_spec_bindings): Only coerce innermost args.
2808
3eec359d
JM
2809 PR c++/80831 - ICE with -fsyntax-only.
2810 * decl2.c (c_parse_final_cleanups): Use cgraph_node::get_create.
2811
b126bff4
JM
2812 PR c++/80639 - ICE with invalid PMF initialization.
2813 PR c++/80043 - ICE with -fpermissive
2814 * typeck.c (convert_for_assignment): Recurse when instantiate_type
2815 returns without an error.
2816
ac9a1c7e
NS
28172017-06-16 Nathan Sidwell <nathan@acm.org>
2818
4086ef7d
NS
2819 * pt.c (tsubst_baselink): Fix & clarify formatting.
2820
e249fcad
NS
2821 * cp-tree.h (build_this_parm, cp_build_parm_decl,
2822 build_artificial_parm): Add FN parm.
2823 * decl.c (start_cleanup_fn): Adjust.
2824 (build_this_parm): Add FN parm, pass it through.
2825 (grokfndecl): Adjust parm building.
2826 * decl2.c (cp_build_parm_decl): Add FN parm, set context.
2827 (build_artificial_parm): Add FN parm, pass through.
2828 (maybe_retrofit_in_chrg): Adjust parm building.
2829 (start_static_storage_duration_function): Likwise.
2830 * lambda.c (maybe_aadd_lambda_conv_op): Likewise.
2831 * method.c (implicitly_declare_fn): Likewise.
2832 * parser.c (inject_this_parameter): Likewise.
2833
d7b11178
NS
2834 Symbol tables are insert only.
2835 * cp-tree.h (default_hash_traits <lang_identifier *>): Don't
2836 derive from pointer_hash. Make undeletable.
2837
ba27a39d
NS
2838 * class.c (resort_type_method_vec): Avoid potential unsigned
2839 overflow.
2840
0d1dc586
NS
2841 Don't defer noexcept_deferred_spec.
2842 * cp-tree.h (unevaluated_noexcept_spec): Don't declare.
2843 * decl.c (cxx_init_decl_processing): Initialize
2844 noexcept_deferred_spec.
2845 * except.c (unevaluated_noexcept_spec): Delete.
2846 * class.c (deduce_noexcept_on_destructor): Use
2847 noexcept_deferred_spec directly.
2848 * method.c (implicitly_declare_fn): Likewise.
2849
2850 Make keyed_classes a vector.
2851 * cp-tree.h (CPTI_KEYED_CLASSES, keyed_classes): Delete.
2852 (keyed_classes): Declare as vector.
2853 * decl.c (keyed_classes): Define.
2854 (cxx_init_decl_processing): Allocate it.
2855 (record_key_method_defined): Use vec_safe_push.
2856 * class.c (finish_struct_1): Likewise.
2857 * pt.c (instantiate_class_template_1): Likewise.
2858 * decl2.c (c_parse_final_cleanups): Reverse iterate keyed_classes.
2859
ac9a1c7e
NS
2860 Make rtti lazier
2861 * rtti.c (enum tinfo_kind): Add TK_DERIVED_TYPES,
2862 TK_VMI_CLASS_TYPES, TK_MAX. Delete TK_FIXED.
2863 (tinfo_names): New.
2864 (typeid_ok_p): Add quotes to error messages. Use get_tinfo_desc.
2865 (get_tinfo_decl): Use get_tinfo_desc.
2866 (get_pseudo_ti_init): Likewise. Adjust VMI construction.
2867 (create_pseudo_type_info): Delete.
2868 (get_pseudo_ti_index): Just determine the index.
2869 (get_tinfo_desc): New. Create all types lazily.
2870 (create_tinfo_types): Just allocate the descriptor array.
2871 (emit_support_tinfos): Use non-inserting type lookup. Set builtin
2872 location.
2873
c3684b7b
MS
28742017-06-15 Martin Sebor <msebor@redhat.com>
2875
2876 PR c++/80560
2877 * call.c (first_non_public_field, maybe_warn_class_memaccess): New
2878 functions.
2879 (has_trivial_copy_assign_p, has_trivial_copy_p): Ditto.
2880 (build_cxx_call): Call maybe_warn_class_memaccess.
2881
c74985e3
JJ
28822017-06-14 Jakub Jelinek <jakub@redhat.com>
2883
2884 * cp-gimplify.c (cp_genericize_r): Turn most of the function
2885 into a switch (TREE_CODE (stmt)) statement from long else if
2886 sequence.
2887
c60dc053
JJ
28882017-06-13 Jakub Jelinek <jakub@redhat.com>
2889
f31a8339
JJ
2890 PR c++/80973
2891 * cp-gimplify.c (cp_genericize_r): Don't instrument MEM_REF second
2892 argument even if it has REFERENCE_TYPE.
2893
c60dc053
JJ
2894 PR c++/80984
2895 * cp-gimplify.c (cp_genericize): Only look for VAR_DECLs in
2896 BLOCK_VARS (outer) chain.
2897 (cxx_omp_const_qual_no_mutable): Likewise.
2898
45b2222a
ML
28992017-06-13 Martin Liska <mliska@suse.cz>
2900
2901 PR sanitize/78204
2902 * class.c (build_base_path): Use sanitize_flags_p.
2903 * cp-gimplify.c (cp_genericize_r): Likewise.
2904 (cp_genericize_tree): Likewise.
2905 (cp_genericize): Likewise.
2906 * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise.
2907 * decl.c (compute_array_index_type): Likewise.
2908 (start_preparsed_function): Likewise.
2909 * decl2.c (one_static_initialization_or_destruction): Likewise.
2910 * init.c (finish_length_check): Likewise.
2911 * lambda.c (maybe_add_lambda_conv_op): Likewise.
2912 * typeck.c (cp_build_binary_op): Likewise.
2913 (build_static_cast_1): Likewise.
2914
a01f151f
JM
29152017-06-11 Jason Merrill <jason@redhat.com>
2916
c3b0f4c6
JM
2917 * error.c (dump_expr): Use is_this_parameter.
2918
a01f151f
JM
2919 * cp-tree.h, decl2.c, mangle.c, parser.c, pt.c, semantics.c: Use
2920 id_equal.
2921
948d0d91
JM
29222017-06-09 Jason Merrill <jason@redhat.com>
2923
e6d7d618
JM
2924 Missing bits from N4268, constant evaluation for all non-type args.
2925 * call.c (build_converted_constant_expr): Rename from
2926 build_integral_nontype_arg_conv, handle all types.
2927 * pt.c (convert_nontype_argument): In C++17 call it for all types.
2928 Move NOP stripping inside pointer case, don't strip ADDR_EXPR.
2929 * cvt.c (strip_fnptr_conv): Also strip conversions to the same type.
2930
8b8b203a
JM
2931 Overhaul pointer-to-member conversion and template argument handling.
2932 * call.c (standard_conversion): Avoid creating ck_pmem when the
2933 class type is the same.
2934 * cvt.c (can_convert_qual): Split from
2935 perform_qualification_conversions.
2936 * constexpr.c (cxx_eval_constant_expression): Check it.
2937 * typeck.c (convert_ptrmem): Only cplus_expand_constant if
2938 adjustment is necessary.
2939 * pt.c (check_valid_ptrmem_cst_expr): Compare class types.
2940 (convert_nontype_argument): Avoid redundant error.
2941
bf31620c
JM
2942 * call.c (convert_like_real): Remove "inner" parameter.
2943 Don't replace a constant with its value.
2944 * cp-gimplify.c (cp_fully_fold): Use cp_fold_rvalue.
2945
c5d6c6d9
JM
2946 * pt.c (convert_nontype_argument): Check NULLPTR_TYPE_P rather than
2947 nullptr_node.
2948
3d2e25a2
JM
2949 * parser.c (cp_parser_constant_expression): Check
2950 potential_rvalue_constant_expression after decay_conversion.
2951 * pt.c (convert_nontype_argument): Don't require linkage in C++17.
2952
55c5c0ad
JM
2953 PR c++/80384 - ICE with dependent noexcept-specifier
2954 * pt.c (dependent_type_p_r) [FUNCTION_TYPE]: Check for dependent
2955 noexcept-specifier.
2956
948d0d91
JM
2957 * constexpr.c (potential_constant_expression_1): Allow 'this' capture.
2958
cb59f689
JH
29592017-06-09 Jan Hubicka <hubicka@ucw.cz>
2960
2961 * class.c (build_vtbl_initializer): Mark dvirt_fn as cold.
2962 * decl.c (cxx_init_decl_processing, push_throw_library_fn): Likewise.
2963 (excpet.c): Mark terminate as cold.
2964
34361776
JJ
29652017-06-08 Jakub Jelinek <jakub@redhat.com>
2966
8ab7005b
JJ
2967 PR c/81006
2968 * semantics.c (handle_omp_array_sections_1): Convert TYPE_MAX_VALUE
2969 to sizetype before size_binop.
2970
34361776
JJ
2971 PR c++/81011
2972 * cp-gimplify.c (cxx_omp_finish_clause): When changing clause
2973 to OMP_CLAUSE_SHARED, also clear OMP_CLAUSE_SHARED_FIRSTPRIVATE
2974 and OMP_CLAUSE_SHARED_READONLY flags.
2975
e6026dc0
JH
29762017-06-08 Jan Hubicka <hubicka@ucw.cz>
2977
2978 * cp-tree.h (lang_check_failed): Annotate by ATTRIBUTE_COLD.
2979
a6d31e84
NS
29802017-06-07 Nathan Sidwell <nathan@acm.org>
2981
2982 * class.c (layout_class_type): Restructure overlong-bitfield tpe
2983 search.
2984
83059741
JW
29852017-06-07 Jonathan Wakely <jwakely@redhat.com>
2986
2987 PR c++/80990
2988 * pt.c (do_class_deduction): Build qualified type.
2989
25d446fd
NS
29902017-06-06 Nathan Sidwell <nathan@acm.org>
2991
25396db9
NS
2992 * name-lookup.c (suggest_alternatives_for): Use qualified lookup
2993 sans using directives. Don't walk into inline namespaces.
2994
25d446fd
NS
2995 PR c++/80979
2996 * name-lookup.c (adl_class_only): Don't add visible friends.
2997
2f20e7db
VR
29982017-06-05 Volker Reichelt <v.reichelt@netcologne.de>
2999
3000 * parser.c (cp_parser_base_specifier): Fix typos in error messages.
3001
c957e9c0
NS
30022017-06-02 Nathan Sidwell <nathan@acm.org>
3003
fb3a2657
NS
3004 Remove lang_type_ptrmem.
3005 * cp-tree.h (lang_type_header): Remove is_lang_type_class. Move
3006 into ...
3007 (lang_type_class): ... this. Reorder bitfields. Rename to ...
3008 (lang_type): ... this. Delete old definition.
3009 (lang_type_ptrmem): Delete.
3010 (LANG_TYPE_CLASS_CHECK): Simply get TYPE_LANG_SPECIFIC. Adjust uses.
3011 (LANG_TYPE_PTRMEM_CHECK): Delete.
3012 (TYPE_GET_PTRMEMFUNC_TYPE, TYPE_SET_PTRMEMFUNC_TYPE): Delete.
3013 (TYPE_PTRMEMFUNC_TYPE): New. Use TYPE_LANG_SLOT_1.
3014 * decl.c (build_ptrmemfunc_type): Adjust.
3015 * lex.c (copy_lang_type): Remove lang_type_ptrmem handling.
3016 (maybe_add_lang_type_raw): Don't set u.c.h.is_lang_type_class.
3017
3018 * class.c (check_bases_and_members): Adjust vec_new_uses_cookie
3019 setting.
3020
3021 Remove cp_binding_level::namespaces
c957e9c0
NS
3022 * name-lookup.h (cp_binding_level): Lose namespaces field.
3023 * name-lookup.c (add_decl_to_level): Chain namespaces on the names
3024 list.
3025 (suggest_alternatives_for): Adjust for namespace list. Do
3026 breadth-first search.
3027 * decl2.c (collect_source_refs): Namespaces are on the regulr
3028 list.
3029 (collect_ada_namespace): Likewise.
3030
40ffd95f
BE
30312017-06-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
3032
3033 * typeck.c (cp_build_binary_op): Implement the -Wsizeof_pointer_div
3034 warning.
3035
e257141f
VV
30362017-06-01 Ville Voutilainen <ville.voutilainen@gmail.com>
3037
3038 PR c++/80812
3039 * method.c (constructible_expr): Strip array types before calling
3040 build_value_init.
3041
ac853c90
PC
30422017-06-01 Paolo Carlini <paolo.carlini@oracle.com>
3043
3044 PR c++/80896
3045 * cvt.c (convert_to_void): Possibly call maybe_warn_nodiscard
3046 for case INDIRECT_REF too in the main switch.
3047
049a5d31
JM
30482017-05-31 Jason Merrill <jason@redhat.com>
3049
3050 PR c++/80840 - ICE with constexpr and reference
3051 * pt.c (convert_nontype_argument): Don't test whether a decl is
3052 value-dependent when binding to a reference.
3053
91e920c9
NS
30542017-05-31 Nathan Sidwell <nathan@acm.org>
3055
3056 * cp-tree.h (lang_decl_slector): New enum.
3057 (lang_decl_base): Make selector an enum. Drop decomposition_p
3058 field.
3059 (lang_decl): Use enum for discrimination.
3060 (LANG_DECL_FN_CHECK, LANG_DECL_NS_CHECK, LANG_DECL_PARM_CHECK,
3061 LANG_DECL_DEOMP_CHECK): Use enum.
3062 (DECL_DECOMPOSITION_P): Use selector value.
3063 (SET_DECL_DECOMPOSITION_P): Delete.
3064 (retrofit_lang_decl): Lose SEL parm.
3065 (fit_decomposition_lang_decl): Declare.
3066 * decl.c (cp_finish_decomp, grokdeclarator): Use
3067 fit_decomposition_lang_decl.
3068 * lex.c (maybe_add_lang_decl_raw): New. Broken out of
3069 retrofit_lang_decl.
3070 (set_decl_linkage): New. Broken out of retrofit_lang_decl. Use enum.
3071 (fit_decomposition_lang_decl): Likewise.
3072 (retrofit_lang_decl): Use worker functions.
3073 (cxx_dup_lang_specific_decl): Use selector enum.
3074 (maybe_add_lang_type_raw): New. Broken out of ...
3075 (cxx_make_type_name): ... here. Call it.
3076
3c1f5a3a
JM
30772017-05-30 Jason Merrill <jason@redhat.com>
3078
3079 PR c++/80856 - ICE with local extern in template
3080 * semantics.c (finish_call_expr): Replace a local extern overload
3081 set in a template with the IDENTIFIER_NODE.
3082
f012c8ef
DM
30832017-05-30 David Malcolm <dmalcolm@redhat.com>
3084
3085 * call.c (perform_implicit_conversion_flags): Convert
3086 "from %qT to %qT" to "from %qH to %qI" in diagnostic.
3087 (print_conversion_rejection): Replace pairs of %qT with
3088 %qH and %qI in various places.
3089 (build_user_type_conversion_1): Likewise.
3090 (build_integral_nontype_arg_conv): Likewise.
3091 (build_conditional_expr_1): Likewise.
3092 (convert_like_real): Likewise.
3093 (convert_arg_to_ellipsis): Likewise.
3094 (joust): Likewise.
3095 (initialize_reference): Likewise.
3096 * cvt.c (cp_convert_to_pointer): Likewise.
3097 (cp_convert_to_pointer): Likewise.
3098 (convert_to_reference): Likewise.
3099 (ocp_convert): Likewise.
3100 * error.c (cp_printer): Gain bool and const char ** parameters.
3101 (struct deferred_printed_type): New struct.
3102 (class cxx_format_postprocessor): New class.
3103 (cxx_initialize_diagnostics): Wire up a cxx_format_postprocessor
3104 to pp->m_format_postprocessor.
3105 (comparable_template_types_p): New function.
3106 (newline_and_indent): New function.
3107 (arg_to_string): New function.
3108 (print_nonequal_arg): New function.
3109 (print_template_differences): New function.
3110 (type_to_string_with_compare): New function.
3111 (print_template_tree_comparison): New function.
3112 (append_formatted_chunk): New function.
3113 (add_quotes): New function.
3114 (cxx_format_postprocessor::handle): New function.
3115 (defer_phase_2_of_type_diff): New function.
3116 (cp_printer): Add "quoted" and "buffer_ptr" params. Implement
3117 %H and %I.
3118 * typeck.c (cp_build_binary_op): Replace pairs of %qT with
3119 %qH and %qI in various places.
3120 (convert_member_func_to_ptr): Likewise.
3121 (build_reinterpret_cast_1): Likewise.
3122 (convert_for_assignment): Likewise.
3123 * typeck2.c (check_narrowing): Likewise.
3124
e2f35333
NS
31252017-05-30 Nathan Sidwell <nathan@acm.org>
3126
98c28dd4
NS
3127 Kill IDENTIFIER_NAMESPACE_BINDINGS
3128 * cp-tree.h (lang_identifier): Delete namespace_bindings.
3129 (IDENTIFIER_NAMESPACE_BINDINGS): Delete.
3130 (lang_decl_ns): Add bindings.
3131 (DECL_NAMESPACE_BINDINGS): New.
3132 * lex.c (retrofit_lang_decl): Create namespace hash table.
3133 * name-lookup.c (find_namespace_slot): Change to use hash-map.
3134 * ptree.c (cxx_print_binding): Delete.
3135 (cxx_print_identifier): Remove NAMESPACE_BINDING printing.
3136
5256a7f5
NS
3137 * cp-tree.def (OVERLOAD): Fix comment.
3138 * cp-tree.h: Fix comments and whitespace.
3139 * error.c (dump_decl): Use pp_cxx_colon_colon, ovl_scope.
3140 * name-lookup.c (add_decl_to_level): Assert not class.
3141 (check_local_shadow): Use OVL_P.
3142 (pushdecl_with_scope_1): Rename to ...
3143 (do_pushdecl_with_Scope): ... here.
3144 (do_nonmember_using_decl): Use qualified_namespace_lookup return
3145 value.
3146 (push_class_level_binding_1): Use OVL_P.
3147 (pushdecl_namespace_level): Use do_pushdecl_with_scope.
3148 (pushtag_1): Rename to ...
3149 (do_pushtag): ... here. Adjust do_pushdecl_with_scope call.
3150 (pushtag): Adjust.
3151 (store_class_bindings): Do not time here.
3152 * name-lookup.h (pushdecl_outermost_localscope): Reorder.
3153 * pt.c (listify): Declare argvec at point of initialization.
3154
e2f35333
NS
3155 PR c++/80913
3156 * name-lookup.c (add_decl_to_level): Assert not making a circular
3157 chain.
3158 (update_binding): Don't prematurely slide artificial decl.
3159
b904faa0
AO
31602017-05-29 Alexandre Oliva <aoliva@redhat.com>
3161
3162 * cp-tree.h (lang_identifier): Drop oracle_looked_up, unused.
3163
58dec010
NS
31642017-05-29 Nathan Sidwell <nathan@acm.org>
3165
3d7ff728
NS
3166 PR c++/80891 (#1,#5)
3167 * cp-tree.h (lookup_maybe_add): Add DEDUPING argument.
3168 * name-lookup.c (name_lookup): Add deduping field.
3169 (name_lookup::preserve_state, name_lookup::restore_state): Deal
3170 with deduping.
3171 (name_lookup::add_overload): New.
3172 (name_lookup::add_value, name_lookup::add_fns): Call add_overload.
3173 (name_lookup::search_adl): Set deduping. Don't unmark here.
3174 * pt.c (most_specialized_instantiation): Revert previous change,
3175 Assert not given duplicates.
3176 * tree.c (lookup_mark): Just mark the underlying decls.
3177 (lookup_maybe_add): Dedup using marked decls.
3178
a5cfa13a
NS
3179 PR c++/80891 (#4)
3180 * ptree.c (cxx_print_xnode): Show internal OVERLOAD structure.
3181 * tree.c (ovl_insert, ovl_iterator_remove_node): Fix copying assert.
3182
3c9cca88
NS
3183 Stat hack representation
3184 * name-lookup.c (STAT_HACK_P, STAT_TYPE, STAT_DECL,
3185 MAYBE_STAT_DECL, MAYBE_STAT_TYPE): New.
3186 (stat_hack): New.
3187 (find_namespace_binding): Replace with ...
3188 (find_namespace_slot): ... this.
3189 (find_namespace_value): New.
3190 (name_lookup::search_namespace_only,
3191 name_lookup::adl_namespace_only): Adjust.
3192 (update_binding): Add SLOT parameter, adjust.
3193 (check_local_shadow): Use find_namespace_value.
3194 (set_local_extern_decl_linkage): Likewise.
3195 (do_pushdecl): Adjust for namespace slot.
3196 (push_local_binding): Assert not a namespace binding.
3197 (check_for_out_of_scope_variable): Use find_namespace_value.
3198 (set_identifier_type_value_with_scope): Likewise.
3199 (get_namespace_binding): Likewise.
3200 (set_namespace_binding): Delete.
3201 (set_global_binding): Directly update the binding.
3202 (finish_namespace_using_decl): Likewise.
3203 (lookup_type_scope_1): Use find_namespace_slot and update.
3204 (do_push_nested_namespace): Use find_namespace_value.
3205
e514ab0c
NS
3206 PR c++/80891 (#1)
3207 * pt.c (most_specialized_instantiation): Cope with duplicate
3208 instantiations.
3209
58dec010
NS
3210 PR c++/80891 (#3)
3211 * cp-tree.h (build_min_nt_call_vec): Declare.
3212 * decl.c (build_offset_ref_call_from_tree): Call it.
3213 * parser.c (cp_parser_postfix_expression): Likewise.
3214 * pt.c (tsubst_copy_and_build): Likewise.
3215 * semantics.c (finish_call_expr): Likewise.
3216 * tree.c (build_min_nt_loc): Keep unresolved lookups.
3217 (build_min): Likewise.
3218 (build_min_non_dep): Likewise.
3219 (build_min_non_dep_call_vec): Likewise.
3220 (build_min_nt_call_vec): New.
b67b23f0 3221
724e517a
NS
3222 PR c++/80891 (#2)
3223 * tree.c (ovl_copy): Adjust assert, copy OVL_LOOKUP.
3224 (ovl_used): New.
3225 (lookup_keep): Call it.
3226
58dec010
NS
32272017-05-26 Nathan Sidwell <nathan@acm.org>
3228
945bf9e1
NS
3229 Implement DR2061
3230 * name-lookup.c (push_inline_namespaces): New.
3231 (push_namespace): Look inside inline namespaces.
3232
3c9feefc
NS
3233 Inline and using namespace representation change.
3234 * cp-tree.h (struct lang_decl_ns): Delete ns_using. Add usings,
3235 inlinees as vector.
3236 (DECL_NAMESPACE_USING): Adjust.
3237 (DECL_NAMESPACE_INLINEES): New.
3238 * name-lookup.h (struct cp_binding_level): Change usings
3239 representation.
3240 * name-lookup.c (name_lookup::do_queue_usings,
3241 name_lookup::queue_usings): Adjust.
3242 (name_lookup::search_namespace, name_lookup::search_usings,
3243 name_lookup::queue_namespace): Adjust.
3244 (name_lookup::adl_namespace_only): Adjust.
3245 (add_using_namespace, push_namespace): Push onto vector.
3246 (pop_namespace): Add timing logic.
3247
e1cad930
NS
3248 * call.c (build_operator_new_call): Do namelookup and ADL here.
3249 (build_new_op_1): Likewise.
3250 * name-lookup.h (lookup_function_nonclass): Delete declaration.
3251 (do_using_directive): Likewise.
3252 * name-lookup.c (set_namespace_binding, push_local_binding): Don't
3253 declare early.
3254 (struct scope_binding): Delete.
3255 (EMPTY_SCOPE_BINDING): Delete.
3256 (set_decl_namespace): Use OVL_P.
3257 (finish_local_using_decl): Lose unnecesary checks.
3258 (lookup_function_nonclass): Delete.
3259 (cp_emit_debug_info_for_using): Use MAYBE_BASELINK_P.
3260
32196b87
NS
3261 * cp-tree.h (OVL_CHAIN): Check looking at OVERLOAD.
3262 (ovl_iterator): Add allow_inner field. Adjust ctor. Make
3263 unduplicatable.
3264 (ovl_iterator::maybe_push, ovl_iterator::pop): New.
3265 (lkp_iterator): Add outer field. Adjust ctor.
3266 (lkp_iterator::operator++): New.
3267 (lookup_mark, lookup_maybe_add): Declare.
3268 * name-lookup.c (name_lookup): Delete fn_set member.
3269 (name_lookup::preserve_state, name_lookup::restore_state): Unmark
3270 and mark lookup.
3271 (name_lookup::add_value): Use lookup_add directly.
3272 (name_lookup::add_fns: Use lookup_maybe_add.
3273 (name_lookup::search_adl): Mark and unmark fns.
3274 (pushdecl): Adjust.
3275 * pt.c (check_explicit_specialization): Use lookup_add directly.
3276 * ptree.c (cxx_print_xnode): Show complete overload structure.
3277 * tree.c (lookup_mark, lookup_maybe_add): New.
3278
b67b23f0
NS
3279 * name-lookup.c (name_lookup::search_adl): ADL OMP UDR type args.
3280
6fc9f7aa
JJ
32812017-05-26 Jakub Jelinek <jakub@redhat.com>
3282
3283 * cp-tree.h (struct lang_decl_decomp): New type.
3284 (struct lang_decl): Add u.decomp.
3285 (LANG_DECL_DECOMP_CHECK): Define.
3286 (DECL_DECOMPOSITION_P): Note it is set also on the vars
3287 for user identifiers.
3288 (DECL_DECOMP_BASE): Define.
3289 (retrofit_lang_decl): Add extra int = 0 argument.
3290 * lex.c (retrofit_lang_decl): Add SEL argument, if non-zero
3291 use it to influence the selector choices and for selector
3292 0 to non-zero transition copy old content.
3293 (cxx_dup_lang_specific_decl): Handle DECL_DECOMPOSITION_P.
3294 * decl.c (poplevel): For DECL_DECOMPOSITION_P, check
3295 !DECL_DECOMP_BASE instead of !DECL_VALUE_EXPR. Adjust warning
3296 wording if decl is a structured binding.
3297 (cp_finish_decomp): Pass 4 as the new argument to retrofit_lang_decl.
3298 Set DECL_DECOMP_BASE. Ignore DECL_READ_P sets from initialization
3299 of individual variables for tuple structured bindings.
3300 (grokdeclarator): Pass 4 as the new argument to retrofit_lang_decl.
3301 Clear DECL_DECOMP_BASE.
3302 * decl2.c (mark_used): Mark DECL_DECOMP_BASE TREE_USED as well.
3303 * pt.c (tsubst_decomp_names): Assert DECL_DECOMP_BASE matches what
3304 is expected.
3305 * expr.c (mark_exp_read): Recurse on DECL_DECOMP_BASE instead of
3306 DECL_VALUE_EXPR.
3307
0fa367aa
JM
33082017-05-25 Jason Merrill <jason@redhat.com>
3309
3310 PR c++/80605 - __is_standard_layout and zero-length array
3311 * class.c (check_bases): Use DECL_FIELD_IS_BASE.
3312
44e00a7a
NS
33132017-05-25 Nathan Sidwell <nathan@acm.org>
3314
87c976ae
NS
3315 Kill OVL_CURRENT, OVL_NEXT.
3316 * cp-tree.h (OVL_CURRENT, OVL_NEXT): Delete.
3317 * name-lookup.c (set_decl_namespace): Use ovl_iterator.
3318 (consider_binding_level): Use OVL_FIRST.
3319 (cp_emit_debug_info_for_using): Use lkp_iterator.
3320 * pt.c (check_explicit_specialization): Use ovl_iterator.
3321
44e00a7a
NS
3322 Kill DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS.
3323 * cp-tree.h (lang_decl_ns): Remove ns_users field.
3324 (DECL_NAMESPACE_USERS, DECL_NAMESPACE_ASSOCIATIONS): Delete.
3325 (TREE_INDIRECT_USING): Delete.
3326 * name-lookup.h (is_associated_namespace): Delete.
3327 * name-lookup.c (name_lookup::search_usings,
3328 name_lookup::do_queue_usings): Usings are always direct.
3329 (is_associated_namespace): Delete.
3330 (handle_namespace_attrs): Use DECL_NAMESPACE_INLINE_P.
3331 (namespace_ancestor_1, namespace_ancestor): Delete.
3332 (push_using_directive_1, push_using_directive): Delete.
3333 (add_using_namespace_1): Delete.
3334 (add_using_namespace): Reimplement.
3335 (emit_debug_info_using_namespace): New.
3336 (finish_namespace_using_directive, finish_local_using_directive,
3337 push_namespace): Adjust.
3338 * tree.c (cp_free_lang_data): Remove DECL_NAMESPACE_USERS handling.
3339
63dbcd13
VR
33402017-05-25 Volker Reichelt <v.reichelt@netcologne.de>
3341
3342 * semantics.c (finish_handler_parms): Warn about non-reference type
3343 catch handlers.
3344
f35a733d
NS
33452017-05-25 Nathan Sidwell <nathan@acm.org>
3346
932f48ac
NS
3347 Reimplement unqualified namespace lookup.
3348 * name-lookup.c (name_lookup::using_pair,
3349 name_lookup::using_queue): New typedefs.
3350 (name_lookup::queue_namespace, name_lookup::do_queue_usings,
3351 name_lookup::queue_usings): New.
3352 (name_lookup::search_unqualified): New.
3353 (merge_functions, same_entity_p, ambiguous_decl,
3354 unqualified_namespace_lookup_1, unqualified_namespace_lookup,
3355 lookup_using_namespace): Delete.
3356 (lookup_name_real_1): Adjust.
3357
9dda0ace
NS
3358 Reimplement qualified namespace lookup.
3359 * name-lookup.c (name_lookup::flags): New member. Adjust ctor.
3360 (name_lookup::ambiguous, name_lookup::add_value,
3361 name_lookup::add_type, name_lookup::process_binding): New.
3362 (name_lookup::search_namespace_only,
3363 name_lookup::search_namespace, name_lookup::search_usings): New.
3364 (name_lookup::search_qualified): New.
3365 (do_nonmember_using_decl, suggest_alternatives_for,
3366 lookup_qualified_name): Adjust.
3367 (tree_vec_contains): Delete.
3368 (qualified_lookup_using_namespace): Rename to ...
3369 (qualified_namespace_lookup): ... here. Reimplement.
3370
3371 Reimplement ADL.
f35a733d
NS
3372 * cp-tree.h (LOOKUP_SEEN_P, LOOKUP_FOUND_P): New.
3373 * name-lookup.h (lookup_arg_dependent): Return plain tree.
3374 * name-lookup.c (arg_lookup, arg_assoc, arg_assoc_args,
3375 arg_assoc_args_vec, arg_assoc_type, add_function,
3376 arg_assoc_namespace, arg_assoc_class_only, arg_assoc_bases,
3377 arg_assoc_class, arg_assoc_template_arg, arg_assoc,
3378 lookup_arg_dependent_1): Delete.
3379 (name_lookup): New lookup object.
3380 (name_lookup::preserve_state, name_lookup::restore_state,
3381 name_lookup::mark_seen, name_lookup::find_and_mark,
3382 name_lookup::add_fns, name_lookup::adl_namespace_only,
3383 name_lookup::adl_namespace, name_lookup::adl_class_only,
3384 name_lookup::adl_bases, name_lookup::adl_class,
3385 name_lookup::adl_expr, name_lookup::adl_type,
3386 name_lookup::adl_template_arg, name_lookup::search_adl): New.
3387 (lookup_arg_dependent): Return a plain tree. Adjust.
3388 (is_associated_namespace): Move later.
3389
d48b9bbe
NS
33902017-05-24 Nathan Sidwell <nathan@acm.org>
3391
5ad4f1c8
NS
3392 * friend.c (do_friend): Remove check for existing decl.
3393 * name-lookup.h (lookup_name_innermost_nonclass_level): Delete.
3394 * name-lookup.c (push_local_binding): Directly look for binding.
3395 (lookup_name_innermost_nonclass_level_1): Delete.
3396 (lookup_name_innermost_nonclass_level): Delete.
3397
6cdb26f2
NS
3398 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Alphabetize.
3399
d48b9bbe
NS
3400 * cp-tree.h (cp_free_lang_data): Add extern.
3401 (ovl_skip_hidden, is_overloaded_fn, really_overloaded_fn): Add
3402 ATTRIBUTE_PURE.
3403 (type_unknown_p): Return bool, make inline, lose TREE_LIST check.
3404 * typeck.c (type_unknown_p): Delete.
3405 * tree.c (is_overloaded_fn): Use MAYBE_BASELINE_FUNCTIONS, adjust
3406 overload management.
3407 (dependent_name): Likewise.
3408 (decl_anon_ns_mem_p): Simplify.
3409
d4a760d8
JW
34102017-05-24 Jonathan Wakely <jwakely@redhat.com>
3411
3412 PR c++/80544
3413 * tree.c (reshape_init): Use unqualified type for direct enum init.
3414 * typeck.c (maybe_warn_about_cast_ignoring_quals): New.
3415 (build_static_cast_1, build_reinterpret_cast_1): Strip cv-quals from
3416 non-class destination types.
3417 (build_const_cast_1): Strip cv-quals from destination types.
3418 (build_static_cast, build_reinterpret_cast, build_const_cast)
3419 (cp_build_c_cast): Add calls to maybe_warn_about_cast_ignoring_quals.
3420
3cd211af
MS
34212017-05-24 Martin Sebor <msebor@redhat.com>
3422
3423 PR c/80731
3424 * call.c (fully_fold_internal): Adjust.
3425
ef4c5e78
NS
34262017-05-24 Nathan Sidwell <nathan@acm.org>
3427
c0edbb32
NS
3428 * cp-tree.h (ovl_skip_hidden): Declare.
3429 * tree.c (ovl_skip_hidden): New.
3430 * name-lookup.c (arg_assoc_namespace): Call ovl_skip_hidden.
3431 (lookup_arg_dependent_1): Likewise.
3432 (ambiguous_decl): Use DECL_HIDDEN_P, ovl_skip_hidden.
3433 (hidden_name_p, remove_hidden_names): Delete.
3434 (lookup_name_real_1): Do not strip hidden names.
3435 * name-lookup.h (hidden_name_p, remove_hidden_names): Delete.
3436
ef4c5e78
NS
3437 * cp-tree.h (OVL_HIDDEN_P): New.
3438 (ovl_iterator::hidden_p, ovl_iterator::reveal_node): New.
3439 (ovl_iterator::reveal_node): Declare.
3440 * tree.c (ovl_copy): Copy OVL_HIDDEN_P.
3441 (ovl_insert): Order on hiddenness.
3442 (ovl_iterator::reveal_node): New.
3443 * name-lookup.c (anticipated_builtin_p): New.
3444 (supplement_binding_1): Use it.
3445 (set_local_extern_decl_linkage): Use hidden_p.
3446 (do_pushdecl): Deal with unhiding a hidden decl, use
3447 anticipated_builtin_p.
3448 (do_nonmember_using_decl): Use anticipated_decl_p.
3449 (lookup_name_real_1): Use DECL_HIDDEN_P.
3450
5726acd7
JM
34512017-05-23 Jason Merrill <jason@redhat.com>
3452
3453 -Wunused and C++17 structured bindings
3454 * decl.c (poplevel): Don't warn about unused structured bindings,
3455 only real variables.
3456 * error.c (dump_simple_decl): Handle structured bindings.
3457 * expr.c (mark_exp_read): Look through DECL_VALUE_EXPR.
3458
3a9cc685
NS
34592017-05-23 Nathan Sidwell <nathan@acm.org>
3460
3461 * cp-tree.h (PUSH_GLOBAL, PUSH_LOCAL, PUSH_USING): Delete.
3462 * name-lookup.c (create_local_binding): New.
3463 (update_binding): New.
3464 (pushdecl_maybe_friend_1): Rename to ...
3465 (do_pushdecl): ... this. Reimplement.
3466 (pushdecl): Adjust.
3467 (push_overloaded_decl_1, push_overloaded_decl): Delete.
3468
f0c1ade4
JM
34692017-05-23 Jason Merrill <jason@redhat.com>
3470
3471 PR c++/80396 - built-in for make_integer_sequence.
3472 * pt.c (builtin_pack_fn_p, builtin_pack_call_p)
3473 (expand_integer_pack, expand_builtin_pack_call): New.
3474 (find_parameter_packs_r): Check builtin_pack_call_p.
3475 (check_for_bare_parameter_packs): Handle it.
3476 (tsubst_pack_expansion): Call expand_builtin_pack_call.
3477 (declare_integer_pack): New.
3478 (init_template_processing): Call it.
3479 * decl2.c (mark_used): Check builtin_pack_fn_p.
3480
e4ea7a4c
NS
34812017-05-23 Nathan Sidwell <nathan@acm.org>
3482
aa7bda5f
NS
3483 * name-lookup.c (find_namespace_binding): New.
3484 (pushdecl_maybe_friend_1): Use CP_DECL_CONTEXT.
3485 (set_identifier_type_value_with_scope): Use find_namespace_binding.
3486 (find_binding, cp_binding_level_find_binding_for_name,
3487 binding_for_name, namespace_binding_1): Delete.
3488 (push_overloaded_decl_1): Use CP_DECL_CONTEXT.
3489 (get_namespace_binding, set_namespace_binding,
3490 finish_namespace_using_decl, unqualified_namespace_lookup_1,
3491 qualified_lookup_using_namespace, lookup_type_scope_1,
3492 lookup_name_innermost_nonclass_level_1): Use find_namespace_binding.
3493
6131102c
NS
3494 PR c++/80866
3495 * parser.c (cp_parser_template_id): Keep the lookup when stashing
3496 the template_id.
3497
e4ea7a4c
NS
3498 * cp-tree.h (DECL_HIDDEN_P): New.
3499 * name-lookup.c (set_decl_context,
3500 set_local_extern_decl_linkage): New, broken out of ...
3501 (pushdecl_maybe_friend_1): ... here. Call them.
3502
fd71a9a2
TS
35032017-05-23 Thomas Schwinge <thomas@codesourcery.com>
3504
3505 * parser.c (OACC_KERNELS_CLAUSE_MASK): Add
3506 "PRAGMA_OACC_CLAUSE_NUM_GANGS", "PRAGMA_OACC_CLAUSE_NUM_WORKERS",
3507 "VECTOR_LENGTH".
3508
9d029ddf
NS
35092017-05-23 Nathan Sidwell <nathan@acm.org>
3510
3511 * cp-tree.h (OVL_P): New.
3512 * name-lookup.h (push_local_binding): Delete.
3513 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
3514 (finish_namespace_using_decl, finish_local_using_decl): ... here
3515 * name-lookup.c (add_decl_to_level): Swap args.
3516 (pop_bindings_and_leave_scope): Look inside TREE_LIST.
3517 (diagnose_name_conflict): Check contexts are same for redecl.
3518 (update_local_overload): New.
3519 (compparms_for_decl_and_using): Rename to ...
3520 (matching_fn_p): ... here.
3521 (pushdecl_maybe_friend_1): Adjust add_decl_to_level,
3522 push_local_bindings call.
3523 (push_local_binding): Make static, replace FLAGS arg with
3524 IS_USING.
3525 (validate_nonmember_using_decl): Use OVL_FIRST.
3526 (do_nonmember_using_decl): Use in/out parameters. Use
3527 lkp_iterator and simplify.
3528 (do_toplevel_using_decl, do_local_using_decl): Rename to ...
3529 (finish_namespace_using_decl, finish_local_using_decl): ... here.
3530 Adjust.
3531 (lookup_type_current_level): Delete.
3532 * parser.c (cp_parser_using_declaration): Adjust.
3533 * pt.c (tsubst_expr): Adjust.
3534
c405923d
NS
35352017-05-22 Nathan Sidwell <nathan@acm.org>
3536
65cc1407
NS
3537 * name-lookup.h (parse_using_directive): Replace with ...
3538 (finish_namespace_using_directive): ... this and ...
3539 (finish_local_using_directive): ... this.
3540 * name-lookup.c (add_using_namespace_1): Move later.
3541 (add_using_namespace): Move later, add namespace_p arg, remove
3542 indirect arg.
3543 (push_using_directive_1): Directly recurse.
3544 (do_using_directive, parse_using_directive): Delete, split into ...
3545 (finish_namespace_using_directive): ... this and ...
3546 (finish_local_using_directive): ... this.
3547 (push_namespace): Use add_using_namespace.
3548 * parser.c (cp_parser_using_directive): Call
3549 finish_namespace_using_directive or finish_local_using_directive.
3550 * pt.c (tsubst_expr): Call finish_local_using_directive.
3551
58aca9d9
NS
3552 * cp-objcp-common.c (cp_register_dumps): Register raw dumper.
3553 * cp-tree.h (raw_dump_id): Declare.
3554 * decl2.c (raw_dump_id): Define.
3555 (dump_tu): Use raw_dump_id.
3556
3b205ea1
NS
3557 * config-lang.in (gtfiles): Sort list, break lines.
3558
1a66d857
NS
3559 * cp-tree.h (CPTI_TERMINATE, CPTI_CALL_UNEXPECTED): Rename to ...
3560 (CPTI_TERMINATE_FN, CPTI_CALL_UNEXPECTED_FN): ... here.
3561 ( CPTI_GET_EXCEPTION_PTR_FN, CPTI_BEGIN_CATCH_FN, CPTI_END_CATCH_FN,
3562 CPTI_ALLOCATE_EXCEPTION_FN, CPTI_FREE_EXCEPTION_FN, CPTI_THROW_FN,
3563 CPTI_RETHROW_FN): New.
3564 (noexcept_deferred_spec): New.
3565 (terminate_node, call_unexpected_node): Rename to ...
3566 (terminate_fn, call_unexpected_fn): ... here.
3567 (get_exception_ptr_fn, begin_catch_fn, end_catch_fn,
3568 allocate_exception_fn, free_exception_fn, throw_fn, rethrow_fn): New.
3569 * except.c (fn1..fn5, throw_fn, rethrow_rn, spec): Delete.
3570 (init_exception_processing): Adjust.
3571 (declare_library_fn): Create and push the fns here.
3572 (do_get_exception_ptr, do_begin_catch, do_end_catch,
3573 do_allocate_exception_ptr, do_free_exception_ptr): Adjust
3574 declare_library_fn use.
3575 (unevaluated_noexcept_spec): Adjust.
3576 * cp-gimplify.c (genericize_eh_spec_block,
3577 gimplify_most_not_throw_expr): Adjust.
3578
c405923d
NS
3579 * name-lookup.c (pushdecl_top_level,
3580 pushdecl_top_level_and_finish): Move after namespace pushing and
3581 popping functions.
3582 (push_to_top_level): Rename to ...
3583 (do_push_to_top_level): ... here. Remove timing code.
3584 (pop_from_top_level_1): Rename to ...
3585 (do_pop_from_top_level): ... here.
3586 (do_push_nested_namespace, do_pop_nested_namespace)
3587 (push_to_top_level): New wrapper for do_push_to_top_level.
3588 (pop_from_top_level): Adjust.
3589 (push_nested_namepace, pop_nested_namespace): Wrappers for workers.
3590
ff502317
BE
35912017-05-19 Bernd Edlinger <bernd.edlinger@hotmail.de>
3592
3593 * config-lang.in (gtfiles): Add c-family/c-format.c,
3594 except.c, init.c, lambda.c and friend.c.
3595 * class.c (dvirt_fn): Move out of function scope,
3596 add GTY attribute.
3597 * except.c (fn1-5, throw_fn, rethrow_fn, spec): Likewise.
3598 * init.c (fn): Likewise.
3599 * lambda.c (ptr_id, max_id): Likewise.
3600 * friend.c (global_friend): Add GTY attribute.
3601
6f2f4050
NS
36022017-05-19 Nathan Sidwell <nathan@acm.org>
3603
3604 * call.c (add_list_candidates): Use OVL_FIRST.
3605 (build_new_method_call_1): Likewise.
3606 * cp-tree.h (OVL_SINGLE_P): New.
3607 (TYPE_HIDDEN_P): New.
3608 * decl.c (xref_tag_1): Use TYPE_HIDDEN_P.
3609 * dump.c (cp_tump_tree): Adjust overload dumping.
3610 * error.c (dump_decl): Use OVL_SINGLE_P, simplify context
3611 printing.
3612 * method.c (lazily_declare_fn): Assert we added it.
3613 * parser.c (cp_parser_nested_name_specifier): Use OVL_SINGLE_P,
3614 OVL_FIRST.
3615 (cp_parser_template_name): Use lkp_iterator.
3616 * pt.c (begin_template_parm_list): Fixup comment.
3617 (instantiate_class_template_1): Use TYPE_HIDDEN_P.
3618 * tree.c (ovl_iterator::remove_node): Cope with inherited ctors.
3619 (ovl_scope): Use lkp_iterator.
3620
9740ed54
TS
36212017-05-19 Thomas Schwinge <thomas@codesourcery.com>
3622
7fd549d2
TS
3623 * parser.c (cp_parser_omp_clause_default): Handle
3624 "OMP_CLAUSE_DEFAULT_PRESENT".
3625
9740ed54
TS
3626 * parser.c (cp_parser_omp_clause_default): Avoid printing more
3627 than one syntax error message.
3628
2a8a8d7b
NS
36292017-05-19 Nathan Sidwell <nathan@acm.org>
3630
3631 * class.c (class_dump_id): Define.
3632 (dump_class_hierarchy, dump_vtable, dump_vtt): Use it.
3633 * cp-objcp-common.c (cp_register_dumps): New.
3634 * cp-objcp-common.h (cp_register_dumps): Declare.
3635 (LANG_HOOKS_REGISTER_DUMPS): Override.
3636 * cp-tree.h (class_dump_id): Declare.
3637
59a4ede9
NS
36382017-05-18 Nathan Sidwell <nathan@acm.org>
3639
1bf07cc3
NS
3640 * cp-tree.h (OVL_ARG_DEPENDENT): Delete.
3641 (OVL_USED_P): New.
3642 (lookup_keep): Declare.
3643 * name-lookup.c (add_function): Don't set OVL_ARG_DEPENDENT.
3644 * pt.c (tsubst_copy): Assert lookup is persistent.
3645 * semantics.c (finish_call_expr): Use lkp_iterator, call
3646 lookup_keep.
3647 * tree.c (ovl_copy): New.
3648 (ovl_insert, ovl_iterator::remove_node): Copy immutable nodes.
3649 (lookup_keep): New.
3650
2063b07f
NS
3651 * cp-tree.h (OVL_USED): Replace with ...
3652 (OVL_USING_P): ... this.
3653 (ovl_iterator::using_p): Adjust.
3654 * name-lookup.c (push_overloaded_decl_1,
3655 do_nonmember_using_decl): Adjust.
3656 * search.c (lookup_field_r): Adjust.
3657 * tree.c (ovl_insert, ovl_scope): Adjust.
3658
31ab89c1
NS
3659 * cp-tree.h (lookup_add): Swap args.
3660 (ovl_cons, build_overload): Delete.
3661 * name-lookup.c (add_function, push_overloaded_decl_1,
3662 do_nonmember_using_decl, merge_functions, remove_hidden_names):
3663 Use lookup_add, ovl_insert.
3664 * pt.c (check_explicit_specialization): Use lookup_add.
3665 (do_class_deduction): Likewise. Refactor if.
3666 * tree.c (lookup_add): Swap args.
3667 (ovl_cons, build_overload): Delete.
3668
59a4ede9
NS
3669 * name-lookup.c (find_local_binding): New, broken out of ...
3670 (lookup_name_innermost_nonclass_level_1): ... here. Call it.
3671 (set_namespace_binding): Swap scope & name args.
3672 (namespace_binding_1): Likewise.
3673 (pushdecl_maybe_friend_1): Adjust set_namespace_binding call.
3674 (push_overloaded_decl_1): Likewise.
3675 (set_global_binding): Likewise.
3676 (get_namespace_binding): Adjust namespace_binding_1 call.
3677
539f481a
NS
36782017-05-17 Nathan Sidwell <nathan@acm.org>
3679
3680 * cp-tree.h (default_hash_traits <lang_identifier *>): New
3681 specialization.
3682 * name-lookup.c (lookup_extern_c_fun_in_all_ns): Delete.
3683 (extern_c_fns): New hash table.
3684 (check_extern_c_conflict): New, broken out of ...
3685 (pushdecl_maybe_friend_1): ... here. Call it.
3686 (c_linkage_bindings): Just look in hash table.
3687
b42cc3ca
VV
36882017-05-17 Ville Voutilainen <ville.voutilainen@gmail.com>
3689
3690 PR c++/80654
3691 PR c++/80682
3692 Implement new C++ intrinsics __is_assignable and __is_constructible.
3693 * cp-tree.h (CPTK_IS_ASSIGNABLE, CPTK_IS_CONSTRUCTIBLE): New.
3694 (is_xible): New.
3695 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
3696 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
3697 * method.c (constructible_expr): Set cp_unevaluated.
3698 (is_xible_helper): New.
3699 (is_trivially_xible): Adjust.
3700 (is_xible): New.
3701 * parser.c (cp_parser_primary_expression): Handle
3702 RID_IS_ASSIGNABLE and RID_IS_CONSTRUCTIBLE.
3703 (cp_parser_trait_expr): Likewise.
3704 * semantics.c (trait_expr_value): Handle
3705 CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
3706
19b476fb
NS
37072017-05-17 Nathan Sidwell <nathan@acm.org>
3708
36f4bc9c
NS
3709 * cp-tree.h (ovl_iterator::using_p): New predicate.
3710 (ovl_iterator::remove_node): New worker.
3711 (ovl_insert): Declare.
3712 * tree.c (ovl_insert): New.
3713 (ovl_iterator::remove_node): New.
3714 * class.c (add_method): Use ovl_iterator, ovl_insert.
3715 (clone_function_decl): Fix description.
3716 (clone_constructors_and_destructors): Use ovl_iterator.
3717
19b476fb
NS
3718 * class.c (handle_using_decl): Use OVL_FIRST, ovl_iterator.
3719 (maybe_warn_about_overly_private_class): Use ovl_iterator.
3720 (method_name_cmp, resort_method_name_cmp): Use OVL_NAME.
3721 (resort_type_method_vec, finish_struct_methods): Use OVL_FIRST.
3722 (get_base_fndecls): Use ovl_iterator.
3723 (warn_hidden): Use OVL_NAME, ovl_iterator.
3724 (add_implicitly_declared_members): Use ovl_iterator.
3725 * constraint.cc (normalize_template_id_expression): Use OVL_FIRST,
3726 flatten nested if.
3727 (finish_shorthand_constraint): Simplify, use ovl_make.
3728 * pt.c (make_constrained_auto): Simplify. Use ovl_make.
3729 * search.c (shared_member_p): Use ovl_iterator.
3730 (lookup_field_fuzzy_info::fuzzy_lookup_fn): Use OVL_NAME.
3731 (lookup_conversion_operator): Use OVL_FIRST.
3732 (lookup_fnfiels_idx_nolazy): Use OVL_FIRST, OVL_NAME.
3733 (look_for_overrides_here): Use ovl_iterator.
3734 (lookup_conversions_r): Use OVL_FIRST, OVL_NAME, ovl_iterator.
3735 * typeck.c (build_x_unary_op): Use ovl_make.
3736
1a817418
ML
37372017-05-17 Martin Liska <mliska@suse.cz>
3738
3739 * class.c (dump_class_hierarchy): Introduce dump_flags_t type and
3740 use it instead of int type.
3741 (dump_vtable): Likewise.
3742 (dump_vtt): Likewise.
3743 * decl2.c (dump_tu): Likewise.
3744
10791753
DM
37452017-05-16 David Malcolm <dmalcolm@redhat.com>
3746
3747 * call.c (enforce_access): Add access_failure_info * param and use
3748 it to record access failures.
3749 * cp-tree.h (class access_failure_info): New class.
3750 (enforce_access): Add access_failure_info * param, defaulting to
3751 NULL.
3752 (lookup_member): Likewise.
3753 (locate_field_accessor): New function decl.
3754 (perform_or_defer_access_check): Add access_failure_info * param,
3755 defaulting to NULL.
3756 * search.c (lookup_member): Add access_failure_info * param and
3757 pass it on to call to perform_or_defer_access_check.
3758 (matches_code_and_type_p): New function.
3759 (field_access_p): New function.
3760 (direct_accessor_p): New function.
3761 (reference_accessor_p): New function.
3762 (field_accessor_p): New function.
3763 (struct locate_field_data): New struct.
3764 (dfs_locate_field_accessor_pre): New function.
3765 (locate_field_accessor): New function.
3766 * semantics.c (perform_or_defer_access_check): Add
3767 access_failure_info * param, and pass it on to call to
3768 enforce_access.
3769 * typeck.c (access_failure_info::record_access_failure): New method.
3770 (access_failure_info::maybe_suggest_accessor): New method.
3771 (finish_class_member_access_expr): Pass an access_failure_info
3772 instance to the lookup_member call, and call its
3773 maybe_suggest_accessor method afterwards.
3774
6b6ae9eb
MP
37752017-05-16 Marek Polacek <polacek@redhat.com>
3776
3777 PR sanitizer/80536
3778 PR sanitizer/80386
3779 * cp-gimplify.c (cp_fold): Handle SAVE_EXPR.
3780
c20c3b42
NS
37812017-05-16 Nathan Sidwell <nathan@acm.org>
3782
c0c24822
NS
3783 * name-lookup.c (check_local_shadow): New, broke out of ...
3784 (pushdecl_maybe_friend_1): ... here. Call it.
3785
e09ae857
NS
3786 * cp-tree.h (OVL_NESTED_P, OVL_LOOKUP_P): New.
3787 (ovl_first): Move inline definition to end of file.
3788 (ovl_make, lookup_add): Declare.
3789 (get_fns, get_first_fn): Make pure.
3790 * tree.c (ovl_cache): New.
3791 (ovl_make, lookup_add): New.
3792 * pt.c (do_class_deduction): Don't add candidates that will be
3793 elided.
3794
a736411a 3795 * call.c (build_user_type_conversion_1): Use OVL_FIRST.
e09ae857 3796 (print_error_for_call_failure): Use OVL_NAME.
a736411a
NS
3797 (build_op_call_1): Use ovl_iterator.
3798 (add_candidates): Use OVL_FIRST & lkp_iterator.
3799 (build_op_delete_call): Use MAYBE_BASELINK_FUNCTIONS &
3800 lkp_iterator.
3801 * class.c (deduce_noexcept_on_destructors): Use ovl_iterator.
3802 (type_has_user_nondefault_constructor,
3803 in_class_defaulted_default_constructor,
3804 type_has_user_provided_constructor,
3805 type_has_user_provided_or_explicit_constructor,
3806 type_has_non_user_provided_default_constructor,
3807 vbase_has_user_provided_move_assign,
3808 type_has_move_constructor, type_has_move_assign,
3809 type_has_user_declared_move_constructor,
3810 type_has_user_declared_move_assign,
3811 type_build_ctor_call, type_build_dtor_call,
3812 type_requires_array_cookie, explain_non_literal_class): Likewise.
3813 (finish_struct): Use lkp_iterator.
3814 (resolve_address_of_overloaded_function): Use OVL_NAME, lkp_iterator.
3815 (note_name_declared_in_class): Use OVL_NAME.
3816 * cxx-pretty-print.c (pp_cxx_unqualified_id): Use OVL_FIRST.
3817 (pp_cxx_qualified_id, cxx_pretty_printer::id_expression,
3818 cxx_pretty_printer::expression): Likewise.
3819 * decl2.c (check_classfn): Use ovl_iterator.
3820 * pt.c (retrieve_specialization): Use ovl_iterator.
3821 * tree.c (cp_tree_equal): Use lkp_iterator.
3822 (type_has_nontrivial_copy_init): Use ovl_iterator.
3823
c20c3b42
NS
3824 * typeck2.c (cxx_incomplete_type_diagnostic): Revert change and
3825 check is_overloaded_fn.
3826
ef6cb4c7
ML
38272017-05-16 Martin Liska <mliska@suse.cz>
3828
3829 * parser.c (cp_lexer_print_token): Add default value for flags
3830 argument of print_gimple_stmt, print_gimple_expr,
3831 print_generic_stmt and print_generic_expr.
3832
322763f5
NS
38332017-05-16 Nathan Sidwell <nathan@acm.org>
3834
3f267553
NS
3835 * cp-tree.h (class ovl_iterator, class lkp_iterator): New OVERLOAD
3836 iterators.
3837 (MAYBE_BASELINK_FUNCTIONS): New.
3838 * constraint.cc (resolve_constraint_check): Use lkp_iterator.
3839 * decl2.c (maybe_warn_sized_delete): Use ovl_iterator.
3840 * lambda.c (maybe_generic_this_capture): Use lkp_iterator.
3841 * method.c (inherited_ctor_binfo): Use ovl_iterator.
3842 (binfo_inherited_from): Likewise.
3843 * parser.c (lookup_literal_operator): Use lkp_iterator.
3844 * pt.c (iterative_hash_template_arg): Use lkp_iterator.
3845 (print_candidates_1): Likewise.
3846 (determine_specialization): Likewise.
3847 (resolve_overloaded_unification): Likewise.
3848 (resolve_nondeduced_context): Likewise.
3849 (type_dependent_expression_p): Likewise.
3850 (dependent_template_p): Likewise.
3851 * ptree.c (cxx_print_xnode): Likewise.
3852 * semantics.c (omp_reduction_lookup): Use lkp_iterator.
3853 (classtype_has_nothrow_assign_or_copy_p): Use ovl_iterator.
3854 * typeck.c (check_template_keyword): Use lkp_iterator.
3855
848bf88d
NS
3856 * cp-tree.h (OVL_FIRST, OVL_NAME): New.
3857 (ovl_first): New.
3858 * constexpr.c (function_concept_check): Use OVL_FIRST.
3859 * cvt.c (build_expr_type_conversion): Likewise.
3860 * decl.c (poplevel, grokdeclarator): Use OVL_NAME.
3861 * decl2.c (mark_used): Use OVL_FIRST.
3862 * error.c (dump_decl): Use OVL_FIRST, OVL_NAME.
3863 (dump_expr, location_of): Use OVL_FIRST.
3864 * friend.c (do_friend): Use OVL_NAME.
3865 * init.c (build_offset_ref): Use OVL_FIRST.
3866 * mangle.c (write_member_name): Likewise.
3867 (write_expression): Use OVL_NAME.
3868 * method.c (strip_inheriting_ctors): Use OVL_FIRST.
3869 * name-lookup.c (pushdecl_class_level): Use OVL_NAME.
3870 * pt.c (check_explicit_specialization): Use OVL_FIRST.
3871 (check_template_shadow): Likewise.
3872 (tsubst_template_args): Use OVL_NAME.
3873 (tsubst_baselink): Use OVL_FIRST.
3874 * semantics.c (perform_koenig_lookup): Use OVL_NAME.
3875 * tree.c (get_first_fn): Use OVL_FIRST.
3876 * typeck.c (finish_class_member_access_expr): Use OVL_NAME.
3877 (cp_build_addr_expr_1): Use OVL_FIRST.
3878
1f0ed17c
NS
3879 * pt.c (tsubst_copy_and_build): Remove unnecessary COMPONENT_REF
3880 peeking.
3881 * semantics.c (finish_id_expression): Directly init local var.
3882 (finish_omp_reduction_clause): Use really_overloaded_fn.
3883 * tree.c (get_fns): Document. Assert we got an overload.
3884 (get_first_fn) Document.
3885 * typeck.c (cp_build_addr_expr_1): Pass arg directly to
3886 really_overloaded_fn.
c20c3b42 3887 * typeck2.c (cxx_incomplete_type_diagnostic): Use get_first_fn directly.
1f0ed17c 3888
322763f5
NS
3889 * cp-tree.h (SCOPE_DEPTH): New.
3890 * name-lookup.h (is_nested_namespace): Declare.
3891 * name-lookup.c (is_nested_namespace): New.
3892 (is_ancestor): Use it.
3893 (set_decl_namespace): Likewise.
3894 (push_namespace): Set SCOPE_DEPTH.
3895 * pt.c (check_specialization_namespace): Use is_nested_namespace.
3896 (check_unqualigied_spec_or_inst): Likewise.
3897
3a77e7cc
NS
38982017-05-15 Nathan Sidwell <nathan@acm.org>
3899
3900 PR c++/79369
3901 * cp-tree.h (DECL_NAMESPACE_INLINE_P): New.
3902 * name-lookup.h (push_namespace): Return int, add make_inline arg.
3903 * name-lookup.c (push_namespace): Deal with inline directly.
3904 Return pushed count.
3905 * parser.c (cp_parser_namespace_definition): Adjust for
3906 push_namespace change.
3907
9c82d7b6
NS
39082017-05-11 Nathan Sidwell <nathan@acm.org>
3909
505dd180
NS
3910 * cp-lang.c (get_global_decls, cxx_pushdecl, LANG_HOOK_GETDECLS,
3911 LANG_HOOKS_PUSHDECL): Move to ...
3912 * cp-objcp-common.c (cp_get_global_decls, cp_pushdec,
3913 LANG_HOOK_DECLS, LANG_HOOKS_PUSHDECL): ... here.
3914 * cp-objcp-common.h (cp_get_global_decls, cp_pushdecl): Declare.
3915
4f15a5da
NS
3916 * name-lookup.h (pushdecl): Add default friend parm.
3917 (pushdecl_maybe_friend): Delete.
3918 (pushdecl_top_level): Add default friend parm.
3919 (pushdecl_top_level_maybe_friend): Delete.
3920 * name-lookup.c (pushdecl_maybe_friend): Delete.
3921 (pushdecl): Add is_friend parm.
3922 (pushdecl_top_level): Add is friend_parm.
3923 (pushdecl_top_level_maybe_friend, pushdecl_top_level_1): Delete.
3924 (pushdecl_top_level_and_finish): Do pushing and finishing directly.
3925 * friend.c (do_friend): Adjust.
3926 * pt.c (tsubst_friend_class): Adjust.
3927
2e3757e7
NS
3928 Revert pushdecl_top_level_and_finish name change.
3929 * name-lookup.h (pushdecl_top_level_and_finish): Resurrect old name.
3930 * name-lookup.c (pushdecl_top_level_and_finish): Likewise.
3931 * decl.c (cp_make_fname_decl): Adjust.
3932 * decl2.c (get_guard, handle_tls_init): Adjust.
3933 * rtti.c (get_tinfo_decl, tinfo_base_init): Adjust.
3934
c8634a1a
NS
3935 * name-lookup.c (pushdecl_outermost_localscope): Always
3936 conditionally stop timer.
3937
c443f3d5
NS
3938 * decl.c (xref_tag_1): Don't frob ts_lambda scope here.
3939 * name-lookup.c (pushtag_1): Deal with ts_lambda scope.
3940
056a17ee
NS
3941 * cp-tree.h (pushdecl, pushdecl_maybe_friend, pushtag,
3942 pushtag_top_level_maybe_friend,
3943 pushdecl_top_level_and_finish): Move declarations to ...
3944 * name-lookup.h: ... here. Group pushdecl variants.
3945 (pushdecl_top_level_and_finish): Rename to ...
3946 (pushdecl_top_level_with_init): ... here.
3947 * decl.c (cp_make_fname_decl): Use pushdecl_top_level_with_init.
3948 * decl2.c (get_guard, handle_tls_init): Likewise.
3949 * rtti.c (get_tinfo_decl, tinfo_base_init): Likewise.
3950 * lambda.c (maybe_add_lambda_conv_op): Use namespace_bindings_p.
3951 * method.c (implicitly_declare_fn): Likewise.
3952 * searchc (node_debug_info_needed): Likewise.
3953 * name-lookup.c (pushdecl_top_level_and_finish): Rename to ...
3954 (pushdecl_top_level_with_init): ... here.
3955 (pop_everything): Use namespace_bindings_p.
3956
9c82d7b6
NS
3957 * name-lookup.h (pop_binding): Rename to pop_local_binding.
3958 (getdecls): Rename to get_local_decls.
3959 * name-lookup.c (pop_binding): Rename to ...
3960 (pop_local_binding): ... here.
3961 (pop_bindings_and_leave_scope): Adjust.
3962 (getdecls): Rename to ...
3963 (get_local_decls): ... here. Assert local scope.
3964 * decl.c (poplevel): Assert not namespace. Adjust and simplify
3965 logic.
3966 (store_parm_decls): Adjust get_local_decls call.
3967 (parser.c (synthesize_implicit_template_parm): Likewise.
3968
e81c8328
VV
39692017-05-11 Ville Voutilainen <ville.voutilainen@gmail.com>
3970
3971 PR c++/80682
3972 * method.c (is_trivially_xible): Reject void types.
3973
268de039
NS
39742017-05-10 Nathan Sidwell <nathan@acm.org>
3975
3aa0a770
NS
3976 * class.c (handle_using_decl): Always use OVL_CURRENT.
3977 (resolve_address_of_overloaded_function): Move iterator decl into
3978 for scope. Don't strip anticipated decls here.
3979
3dd83617
NS
3980 * pt.c (print_candidates_1): Separate TREE_LIST and OVERLOAD
3981 printing.
3982 (print_candidates): Adjust.
3983
268de039
NS
3984 * cp-tree.h (build_new_function_call): Lose koenig_p arg. Fix
3985 line breaking.
3986 * call.c (build_new_function_call): Lose koenig_p arg. Remove
3987 koenig_p handling here.
3988 * pt.c (push_template_decl_real): Unconditionally retrofit_lang_decl.
3989 (tsubst_omp_clauses): Likewise.
3990 (do_class_deduction): Adjust buld_new_function_call calls.
3991 * semantics.c (finish_call_expr): Likewise.
3992
0ea37ae1
JM
39932017-05-10 Jason Merrill <jason@redhat.com>
3994
dd54ca56
JM
3995 * pt.c (unify_parameter_deduction_failure, unify_cv_qual_mismatch)
3996 (unify_type_mismatch, unify_parameter_pack_mismatch)
3997 (unify_ptrmem_cst_mismatch, unify_expression_unequal)
3998 (unify_parameter_pack_inconsistent, unify_inconsistency)
3999 (unify_vla_arg, unify_method_type_error, unify_arity)
4000 (unify_arg_conversion, unify_no_common_base)
4001 (unify_inconsistent_template_template_parameters)
4002 (unify_template_deduction_failure)
4003 (unify_template_argument_mismatch)
4004 (unify_overload_resolution_failure): Call unify_invalid.
4005
00e08b0f
JM
4006 CWG 1847 - Clarifying compatibility during partial ordering
4007 * pt.c (more_specialized_fn): No order between two non-deducible
4008 parameters.
4009
415dcf96
JM
4010 * pt.c (dependent_type_p): Make sure we aren't called with
4011 global_type_node.
4012
0ea37ae1
JM
4013 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
4014 * pt.c (convert_template_argument): Just return an argument pack.
4015 (coerce_template_parameter_pack, template_parm_to_arg)
4016 (extract_fnparm_pack, make_argument_pack, tsubst_template_args)
4017 (tsubst_decl, tsubst, type_unification_real, unify_pack_expansion):
4018 Don't set the type of a NONTYPE_ARGUMENT_PACK.
4019 * parser.c (make_char_string_pack, make_string_pack): Likewise.
4020
d5a2f455
NS
40212017-05-10 Nathan Sidwell <nathan@acm.org>
4022
4023 * cp-tree.h (add_method, clone_function_decl): Change last arg to
4024 bool.
4025 * class.c (add_method): Change third arg to bool. Adjust.
4026 (one_inheriting_sig, one_inherited_ctor): Adjust.
4027 (clone_function_decl): Change 2nd arg to bool. Adjust.
4028 (clone_constructors_and_destructors): Adjust.
4029 * lambda.c (maybe_add_lambda_conv_op): Adjust.
4030 * method.c (lazily_declare_fn): Adjust.
4031 * pt.c (tsubst_decl, instantiate_template_1): Adjust.
4032 * semantics.c (finish_member_declaration): Adjust.
4033
f00b411f
PC
40342017-05-10 Paolo Carlini <paolo.carlini@oracle.com>
4035
4036 PR c++/80145
4037 * decl.c (finish_function): To improve error recovery, change the
4038 logic for calling apply_deduced_return_type.
4039
54069e59
JM
40402017-05-09 Jason Merrill <jason@redhat.com>
4041
0fa367aa 4042 PR c++/80605 - __is_standard_layout and empty base
c0aad677
JM
4043 * class.c (check_bases): Ignore empty bases.
4044
65d7adba
JM
4045 PR c++/70979 - literal class and closure types
4046 * class.c (finalize_literal_type_property): Handle closures
4047 specifically.
4048 (explain_non_literal_class): Likewise.
4049
54069e59
JM
4050 PR c++/66297, DR 1684 - literal class and constexpr member fns
4051 * constexpr.c (is_valid_constexpr_fn): Only complain about
4052 non-literal enclosing class in C++11.
4053 * class.c (finalize_literal_type_property): Likewise.
4054
cc49d15a
PC
40552017-05-09 Paolo Carlini <paolo.carlini@oracle.com>
4056
4057 PR c++/80186
4058 * pt.c (tsubst_decl): Early return error_mark_node if
4059 grok_ctor_properties returns false.
4060
60648580
JM
40612017-05-09 Jason Merrill <jason@redhat.com>
4062
4063 PR c++/70167 - array prvalue treated as lvalue
4064 * cp-tree.h (CONSTRUCTOR_C99_COMPOUND_LITERAL): New.
4065 (enum fcl_t): New.
4066 * semantics.c (finish_compound_literal): Add fcl_context parameter.
4067 Only make a static variable for C99 syntax.
4068 * parser.c (cp_parser_postfix_expression): Pass it.
4069 * pt.c (tsubst_copy_and_build): Likewise.
4070 * call.c (extend_ref_init_temps): Set
4071 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
4072
641da50a
NS
40732017-05-09 Nathan Sidwell <nathan@acm.org>
4074
4075 * cp-lang.c (get_global_decls, cxx_pushdecl): New.
4076 (LANG_HOOKS_GETDECLS, LANG_HOOKS_PUSHDECL): Override.
4077 * name-lookup.h (pushdecl_top_level): Declare.
4078
f3ec182d
JM
40792017-05-08 Jason Merrill <jason@redhat.com>
4080
4081 PR c++/80178 - parameter passing for uncopyable classes
4082 * tree.c (type_has_nontrivial_copy_init): True for classes with only
4083 deleted copy/move ctors.
4084 (remember_deleted_copy, maybe_warn_parm_abi): New.
4085 * decl.c (require_complete_types_for_parms, check_function_type):
4086 Call maybe_warn_parm_abi.
4087 * call.c (convert_for_arg_passing, build_cxx_call): Likewise.
4088
06aa5490
NS
40892017-05-08 Nathan Sidwell <nathan@acm.org>
4090
641da50a 4091 * decl.c (builtin_function_1): Set DECL_ANTICIPATED before pushing.
507e429b
NS
4092 (start_preparsed_function): Do decl pushing before setting
4093 current_funciton_decl and announcing it.
4094
d16d5eac
NS
4095 * name-lookup.h (pushdecl_with_scope): Replace with ...
4096 (pushdecl_outermost_localscope): ... this.
4097 * name-lookup.c (pushdecl_with_scope): Replace with ...
4098 (pushdecl_outermost_localscope): ... this.
4099 (pushdecl_namespace_level): Adjust.
4100 * decl.c (cp_make_fname_decl): Use pushdecl_outermost_localscope.
4101 * lambda.c (insert_capture_proxy): Likewise.
4102
7574e458
NS
4103 * class.c (build_vtbl_initializer): Don't shadow outer variable
4104 with static var.
4105
06aa5490
NS
4106 Revert _binding -> _value change.
4107 * name-lookup.h (get_namespace_value, set_global_value): Rename to ...
4108 (get_namespace_binding, set_global_binding): ... these.
4109 * name-lookup.c (get_namespace_value, set_global_value): Rename to ...
4110 (get_namespace_binding, set_global_binding): ... these.
4111 (arg_assoc_namespace, pushdecl_maybe_friend_1,
4112 check_for_out_of_scope_variable, push_overloaded_decl_1,
4113 lookup_name_innermost_nonclass_level, push_namespace): Adjust.
4114 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
4115 SET_IDENTIFIER_GLOBAL_VALUE): Adjust.
4116 * decl.c (poplevel): Adjust.
4117 * pt.c (make_constrained_auto): Likewise.
4118
d4a5c4eb
VR
41192017-05-07 Volker Reichelt <v.reichelt@netcologne.de>
4120
4121 PR translation/80280
4122 * call.c (print_z_candidate): Fix quoting.
4123
56d35585
DM
41242017-05-05 David Malcolm <dmalcolm@redhat.com>
4125
4126 * error.c (pedwarn_cxx98): Replace report_diagnostic
4127 with diagnostic_report_diagnostic.
4128
30318029
NS
41292017-05-05 Nathan Sidwell <nathan@acm.org>
4130
4b4b2e58
NS
4131 * cp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value.
4132 (SET_IDENTIFIER_GLOBAL_VALUE): Use set_global_value.
4133 (IDENTIFIER_NAMESPACE_VALUE): Delete.
4134 * name-lookup.h (namespace_binding, set_namespace_binding): Replace
4135 with ...
4136 (get_namespace_value, set_global_value): ... these.
4137 (get_global_value_if_present, is_typename_at_global_scope): Delete.
4138 * decl.c (poplevel): Use get_namespace_value.
4139 (grokdeclarator): Use IDENTIFIER_GLOBAL_VALUE.
4140 * class.c (build_vtbl_initializer): Stash library decl in
4141 static var. Use IDENTIFIER_GLOBAL_VALUE.
4142 * except.c (do_get_exception_ptr, do_begin_catch, do_end_catch,
4143 do_allocate_exception, do_free_exception, build_throw): Likewise.
4144 * init.c (throw_bad_array_new_length): Likewise.
4145 * rtti.c (throw_bad_cast, throw_bad_typeid): Likewise.
4146 * name-lookup.c (arg_assoc_namespace, pushdecl_maybe_friend_1,
4147 check_for_our_of_scope_variable, push_overloaded_decl_1): Use
4148 get_namespace_value.
4149 (set_namespace_binding_1): Rename to
4150 (set_namespace_binding): ... here.
4151 (set_global_value): New.
4152 (lookup_name_innermost_nonclass_level_1, push_namespace): Use
4153 get_namespace_value.
4154 * pt.c (listify): Use get_namespace_value.
4155
77fa3ec1
NS
4156 * call.c (make_temporary_var_for_ref_to_temp): Push decl into
4157 current scope.
4158 * lex.c (unqualified_name_lookup_error): Likewise.
4159
7187a6c8
NS
4160 * class.c (alter_class): Use retrofit_lang_decl directly.
4161 * decl.c (push_local_name, dupliate_decls): Likewise.
4162 * semantics.c (omp_privatize_field): Likewise.
4163
b6263c5d
NS
4164 Kill walk_namespaces.
4165 * cp-tree.h (walk_namespaces_fn, walk_namespaces): Delete.
4166 * decl.c (walk_namespaces_r, walk_namespaces): Delete.
4167
30318029
NS
4168 Kill per-namespace static_decls.
4169 * cp-tree.h (static_decls): Declare.
4170 (wrapup_globals_for_namespace,
4171 diagnose_inline_vars_for_namespace): Replace with ...
4172 (wrapup_namespace_globals): ... this.
4173 * decl.c (static_decls): Define.
4174 (wrapup_globals_for_namespace,
4175 diagnose_inline_vars_for_namespace): Replace with ...
4176 (wrapup_namespace_globals): ... this.
4177 (cxx_init_decl_processing): Initialize static_decls.
4178 * decl2.c (c_parse_final_cleanups): Adjust.
4179 * name-lookup.h (cp_binding_level): Remove static_decls member.
4180 * name-lookup.c (add_decl_to_level): Adjust.
4181 (begin_scope): Adjust.
4182
dfae9048
PC
41832017-05-05 Paolo Carlini <paolo.carlini@oracle.com>
4184
4185 PR c++/71577
4186 * decl.c (reshape_init): Unconditionally return error_mark_node
4187 upon error about too many initializers.
4188
0f05d905
NS
41892017-05-04 Nathan Sidwell <nathan@acm.org>
4190
4191 * constraint.cc (diagnose_check_constraint): Fix %E thinko.
4192
0f2c4a8f
MS
41932017-05-04 Martin Sebor <msebor@redhat.com>
4194
4195 PR translation/80280
4196 * call.c (print_z_candidate): Add missing quoting to %D and other
4197 like directives.
4198 (build_op_call_1): Same.
4199 * constraint.cc (diagnose_check_constraint): Same.
4200 * mangle.c (mangle_decl): Same.
4201 * name-lookup.c (cp_binding_level_debug): Same.
4202 (set_decl_namespace): Same.
4203 * parser.c (cp_parser_tx_qualifier_opt): Same.
4204 * pt.c (print_candidates_1): Same.
4205 (check_template_variable): Same.
4206 (tsubst_default_argument): Same.
4207 (most_specialized_partial_spec): Same.
4208 * semantics.c (omp_reduction_lookup): Same.
4209 * tree.c (check_abi_tag_redeclaration): Same.
4210 * typeck.c (comptypes): Same.
4211 * typeck2.c (abstract_virtuals_error_sfinae): Same.
4212
b655c310
NS
42132017-05-04 Nathan Sidwell <nathan@acm.org>
4214
ad9870f2
NS
4215 More global trees.
4216 * cp-tree.h (enum cp_tree_index): Add CPTI_GLOBAL,
4217 CPTI_GLOBAL_TYPE, CPTI_GLOBAL_IDENTIFIER, CPTI_ANON_IDENTIFIER,
4218 CPTI_INIT_LIST_IDENTIFIER.
4219 (global_namespace, global_type_node, global_identifier,
4220 anon_identifier, init_list_identifier): New.
4221 * decl.c (global_type_node, global_scope_name): Delete.
4222 (initialize_predefined_identifiers): Add new identifiers.
4223 (cxx_init_decl_processing): Adjust.
4224 * name-lookup.h (global_namespace, global_type_node): Delete.
4225 * name-lookup.c (global_namespace, anonymous_namespace_name,
4226 get_anonymous_namespace_name): Delete.
4227 (namespace_scope_ht_size, begin_scope, pushtag_1,
4228 push_namespace): Adjust,
4229 * call.c (type_has_extended_temps): Use init_list_identifier.
4230 * pt.c (listify): Likewise.
4231
b655c310
NS
4232 * name-lookup.c: Reorder functions to make merging from modules
4233 branch simpler.
4234
8108ea30
JM
42352017-05-03 Jason Merrill <jason@redhat.com>
4236
4237 * constexpr.c (cxx_eval_outermost_constant_expr): Use TV_CONSTEXPR.
4238
5bb64c41
NS
42392017-05-03 Nathan Sidwell <nathan@acm.org>
4240
4241 * cp-tree.h (enum cp_tree_index, cp_global_trees): Move earlier,
4242 along with #defines, to before name-lookup include.
4243
c3b73151
PC
42442017-05-02 Paolo Carlini <paolo.carlini@oracle.com>
4245
4246 * pt.c (is_auto_or_concept): Remove.
4247 (type_uses_auto_or_concept): Remove, unused.
4248 (find_parameter_packs_r, extract_autos_r, is_auto_r): Adjust.
4249 * parser.c (tree_type_is_auto_or_concept): Remove, unused.
4250 * cp-tree.h (is_auto_or_concept): Remove.
4251
815d9cc6
XR
42522017-05-01 Xi Ruoyao <ryxi@stu.xidian.edu.cn>
4253
4254 PR c++/80038
4255 * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Don't
4256 add pedigree operation and detach call here.
4257 * cp-gimplify.c (cp_gimplify_expr): Remove the calls to
4258 cilk_cp_gimplify_call_params_in_spawned_fn.
4259 (cilk_cp_gimplify_call_params_in_spawned_fn): Remove function.
4260 * semantics.c (simplify_aggr_init_expr): Copy EXPR_CILK_SPAWN.
4261
6bbb3a69
VR
42622017-04-29 Volker Reichelt <v.reichelt@netcologne.de>
4263
4264 * parser.c (cp_parser_member_declaration): Add fix-it hints for
4265 stray comma and missing semicolon at end of member declaration.
4266
8211c4a2
VR
42672017-04-27 Volker Reichelt <v.reichelt@netcologne.de>
4268
4269 * parser.c (cp_parser_cast_expression): Add target type of cast to
4270 diagnostic.
4271 * error.c (type_to_string): Add '{enum}' suffix to enumeration types.
4272
c8040757
PC
42732017-04-26 Paolo Carlini <paolo.carlini@oracle.com>
4274
4275 * decl.c (grok_ctor_properties, ambi_op_p, unary_op_p): Change
4276 return type to bool.
4277 * cp-tree.h (grok_ctor_properties): Update.
4278
a480422d
VR
42792017-04-26 Volker Reichelt <v.reichelt@netcologne.de>
4280
4281 * parser.c (cp_parser_nested_name_specifier_opt): Add fix-it
4282 information to diagnostic of invalid colon in nested-name-specifier.
4283
70caf430
VR
42842017-04-25 Volker Reichelt <v.reichelt@netcologne.de>
4285
4286 * parser.c (cp_parser_elaborated_type_specifier): Add fix-it to
4287 diagnostic of invalid class/struct keyword after enum.
4288
fbe91804
DM
42892017-04-25 David Malcolm <dmalcolm@redhat.com>
4290
4291 * parser.c (cp_parser_member_declaration): Add fix-it hint
4292 for removing stray semicolons.
4293
5ca28c1d
DM
42942017-04-25 David Malcolm <dmalcolm@redhat.com>
4295
4296 * name-lookup.c (get_std_name_hint): New function.
4297 (maybe_suggest_missing_header): New function.
4298 (suggest_alternative_in_explicit_scope): Call
4299 maybe_suggest_missing_header.
4300
7d5dbb22
DM
43012017-04-25 David Malcolm <dmalcolm@redhat.com>
4302
4303 PR c++/80177
4304 * name-lookup.c (suggest_alternative_in_explicit_scope): Convert
4305 candidate type of bm from tree to const char *.
4306 (consider_binding_level): Likewise.
4307 (lookup_name_fuzzy): Likewise, using this to merge the best
4308 result from the preprocessor into bm, rather than immediately
4309 returning, so that better matches from reserved words can "win".
4310 Guard the rejection of keywords that don't start decl-specifiers
4311 so it only happens for FUZZY_LOOKUP_TYPENAME.
4312
761ad35c
VR
43132017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
4314
4315 * decl.c (grokdeclarator): Use %qT instead of %<%T%> in diagnostics.
4316 (start_enum): Likewise.
4317 (build_enumerator): Likewise. Use %qE instead of plain %E.
4318 * parser.c (cp_parser_mem_initializer_list): Use %qD instead of
4319 %<%D%> in diagnostics.
4320 (cp_parser_elaborated_type_specifier): Likewise.
4321 * pt.c (make_pack_expansion): Use %qT and %qE instead of
4322 %<%T%> and %<%E%> in diagnostics.
4323 (tsubst_pack_expansion): Likewise.
4324
412f61f0
DM
43252017-04-24 David Malcolm <dmalcolm@redhat.com>
4326
4327 PR c++/80016
4328 * parser.c (cp_parser_unary_expression): Generate a location
4329 range for alignof and sizeof expressions.
4330
ec856f5f
VR
43312017-04-24 Volker Reichelt <v.reichelt@netcologne.de>
4332
4333 * parser.c (cp_parser_cv_qualifier_seq_opt): Add fix-it info to
4334 error message.
4335 (cp_parser_virt_specifier_seq_opt): Likewise.
4336 (set_and_check_decl_spec_loc): Likewise twice.
4337
176e79b5
JM
43382017-04-21 Jason Merrill <jason@redhat.com>
4339
4340 PR c++/80179 - ICE with initialized flexible array member.
4341 * constexpr.c (verify_ctor_sanity): Handle flexible array members.
4342
ad32f067
RB
43432017-04-21 Richard Biener <rguenther@suse.de>
4344
4345 * cp-tree.h (copy_decl): Annotate with CXX_MEM_STAT_INFO.
4346 (copy_type): Likewise.
4347 * lex.c (copy_decl): Pass down mem-stat info.
4348 (copy_type): Likewise.
4349
34d57a10
JW
43502017-04-20 Jonathan Wakely <jwakely@redhat.com>
4351
4352 PR c++/80473
4353 * init.c (build_new_1): Suppress notes about over-aligned new when
4354 the warning is suppressed.
4355
c3cbcd45
VR
43562017-04-20 Volker Reichelt <v.reichelt@netcologne.de>
4357
4358 * parser.c (cp_parser_member_declaration): Add warning with fixit
4359 information for extra semicolon after in-class function definition.
4360
8a59d466
JJ
43612017-04-20 Jakub Jelinek <jakub@redhat.com>
4362
4363 PR middle-end/80423
4364 * tree.c (build_cplus_array_type): Call build_array_type
4365 with the intended TYPE_TYPELESS_STORAGE flag value, instead
4366 of calling build_array_type and modifying later TYPE_TYPELESS_STORAGE
4367 on the shared type.
4368
be7c73ae
MP
43692017-04-18 Marek Polacek <polacek@redhat.com>
4370
4371 PR c++/80244 - ICE with attribute in template alias.
4372 * tree.c (strip_typedefs): Handle UNDERLYING_TYPE.
4373
d6e3e8a5
MP
4374 PR c++/80241 - ICE with alignas pack expansion.
4375 * error.c (dump_expr): Handle TREE_LIST.
4376 * parser.c (cp_parser_std_attribute_list): Return error_mark if
4377 make_pack_expansion returns an error.
4378
1adb82e1
BE
43792017-04-17 Bernd Edlinger <bernd.edlinger@hotmail.de>
4380
4381 PR c++/80287
4382 * class.c (fixup_may_alias): Fix all type variants.
4383
6864d849
JM
43842017-04-17 Jason Merrill <jason@redhat.com>
4385
d478f1e4
JM
4386 PR c++/80415 - wrong error with default arg and array reference.
4387 * tree.c (lvalue_kind): Return clk_class for an array prvalue.
4388
6864d849
JM
4389 * pt.c (tsubst_init): Set TARGET_EXPR_DIRECT_INIT_P.
4390
e072b0c4
AO
43912017-04-15 Alexandre Oliva <aoliva@redhat.com>
4392
4393 * decl.c (name_unnamed_type): Split out of...
4394 (grokdeclarator): ... this.
4395 * decl.h (name_unnamed_type): Declare.
4396
350792ff
RB
43972017-04-12 Richard Biener <rguenther@suse.de>
4398 Bernd Edlinger <bernd.edlinger@hotmail.de>
4399
4400 PR middle-end/79671
4401 * tree.c (build_cplus_array_type): Set TYPE_TYPELESS_STORAGE
4402 for arrays of character or std::byte type.
4403
125db6a1
JM
44042017-04-11 Jason Merrill <jason@redhat.com>
4405
4406 PR c++/80294 - ICE with constexpr and inheritance.
4407 * constexpr.c (reduced_constant_expression_p):
4408 A null constructor element is non-constant.
4409 (cxx_eval_indirect_ref): Don't VERIFY_CONSTANT before
4410 returning an empty base.
4411
347e1f77
JJ
44122017-04-11 Jakub Jelinek <jakub@redhat.com>
4413
4414 PR c++/80370
4415 * decl.c (cp_finish_decomp): If processing_template_decl on
4416 non-dependent decl, only set TREE_TYPE on the v[i] decls, but don't
4417 change their DECL_VALUE_EXPR nor cp_finish_decl them. Instead make
4418 sure DECL_VALUE_EXPR is the canonical NULL type ARRAY_REF for tsubst
4419 processing.
4420 * pt.c (value_dependent_expression_p) <case VAR_DECL>: For variables
4421 with DECL_VALUE_EXPR, return true if DECL_VALUE_EXPR is type
4422 dependent.
4423
82665822
JJ
44242017-04-11 Jakub Jelinek <jakub@redhat.com>
4425
4426 PR c++/80363
4427 * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR.
4428
b447b28c
JJ
44292017-04-10 Jakub Jelinek <jakub@redhat.com>
4430
4431 PR c++/80176
4432 * tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
4433 operand, if it is a static member function, recurse on the
4434 BASELINK.
4435
98a7a34e
MP
44362017-04-10 Marek Polacek <polacek@redhat.com>
4437
4438 PR sanitizer/80348
4439 * typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL. Set
4440 ORIG_TYPE earlier and not only when shortening.
4441
c60faeee
JM
44422017-04-07 Jason Merrill <jason@redhat.com>
4443
3f4334cb
JM
4444 PR c++/80356 - ICE with reference to function template argument.
4445 PR c++/79294
4446 * pt.c (convert_nontype_argument_function): Adjust type even with a
4447 value-dependent argument.
4448
c60faeee
JM
4449 PR c++/80267 - ICE with nested capture of reference
4450 PR c++/60992
4451 * pt.c (tsubst_copy): Handle lookup finding a capture proxy.
4452
1ef532f4
MP
44532017-04-07 Marek Polacek <polacek@redhat.com>
4454
4455 PR sanitizer/80348
4456 * typeck.c (cp_build_binary_op): Convert COP[01] to ORIG_TYPE.
4457
2166aeb3
MP
4458 PR c++/80095
4459 * call.c (build_over_call): Don't check cxx_dialect.
4460 * cp-gimplify.c (cp_gimplify_init_expr): Don't check cxx_dialect nor
4461 whether SUB is a CONSTRUCTOR.
4462 * init.c (build_new_1): Don't check cxx_dialect.
4463 * tree.c (replace_placeholders): Add a function comment. Return if
4464 not in C++14, or if the object isn't a (member of a) class.
4465 * typeck2.c (store_init_value): Don't check cxx_dialect nor whether
4466 TYPE is CLASS_TYPE_P.
4467
98568e03
JJ
44682017-04-05 Jakub Jelinek <jakub@redhat.com>
4469
4470 PR c++/80309
4471 * pt.c (canonical_type_parameter): Use vec_safe_grow_cleared instead
4472 of a loop doing vec_safe_push of NULL. Formatting fixes.
4473 (rewrite_template_parm): Copy TEMPLATE_PARM_PARAMETER_PACK from oldidx
4474 to newidx before calling canonical_type_parameter on newtype.
4475
c0ea338b
VR
44762017-04-04 Volker Reichelt <v.reichelt@netcologne.de>
4477
4478 PR c++/80296
4479 * cxx-pretty-print.c (cxx_pretty_printer::expression): Add
4480 UNARY_PLUS_EXPR case.
4481
e4307389
JM
44822017-04-03 Jason Merrill <jason@redhat.com>
4483
4484 * semantics.c (finish_template_type): Check CLASSTYPE_TEMPLATE_INFO.
4485
5764ee3c
JW
44862017-04-03 Jonathan Wakely <jwakely@redhat.com>
4487
4488 * class.c (update_vtable_entry_for_fn): Fix typo in comment.
4489 * decl2.c (one_static_initialization_or_destruction): Likewise.
4490 * name-lookup.c (store_bindings): Likewise.
4491 * parser.c (make_call_declarator): Likewise.
4492 * pt.c (check_explicit_specialization): Likewise.
4493
5a68fae7
JM
44942017-04-03 Jason Merrill <jason@redhat.com>
4495
4496 PR sanitizer/79993 - ICE with VLA initialization from string
4497 PR c++/69487 - wrong VLA initialization from string
4498 * init.c (finish_length_check): Split out from build_vec_init.
4499 (build_vec_init): Handle STRING_CST.
4500 * typeck2.c (split_nonconstant_init): Handle STRING_CST.
4501 (digest_init_r): Don't give a STRING_CST VLA type.
4502
af88f557
JJ
45032017-03-31 Jakub Jelinek <jakub@redhat.com>
4504
6f3af356
JJ
4505 PR c++/79572
4506 * cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
4507 REFERENCE_TYPE. Adjust ubsan_maybe_instrument_reference caller
4508 for NOP_EXPR to REFERENCE_TYPE.
4509
af88f557
JJ
4510 PR libstdc++/80251
4511 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_AGGREGATE.
4512 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle
4513 CPTK_IS_AGGREGATE.
4514 * semantics.c (trait_expr_value): Handle CPTK_IS_AGGREGATE.
4515 Remove extraneous parens.
4516 (finish_trait_expr): Handle CPTK_IS_AGGREGATE.
4517 * parser.c (cp_parser_primary_expression): Handle RID_IS_AGGREGATE.
4518 (cp_parser_trait_expr): Likewise.
4519
a9e4a1a5
JJ
45202017-03-27 Jakub Jelinek <jakub@redhat.com>
4521
4522 PR middle-end/80162
4523 * cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
4524 * typeck.c (cxx_mark_addressable): Likewise. Look through
4525 VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
4526 to ARRAY_TYPE.
4527 (cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
4528
90471a3d
JM
45292017-03-24 Jason Merrill <jason@redhat.com>
4530
4531 PR c++/77339 - ICE with invalid use of alias template.
4532 * pt.c (lookup_template_class_1): Don't try to enter the scope of an
4533 alias template.
4534
c8b1fbc1
MP
45352017-03-24 Marek Polacek <polacek@redhat.com>
4536
4537 PR c++/80119
4538 * cp-gimplify.c (cp_fold): Strip CLEANUP_POINT_EXPR if the expression
4539 doesn't have side effects.
4540
16e9eaa6
JM
45412017-03-23 Jason Merrill <jason@redhat.com>
4542
842562b4
JM
4543 PR c++/80150 - ICE with overloaded variadic deduction.
4544 * pt.c (try_one_overload): Remove asserts.
4545
16e9eaa6
JM
4546 PR c++/77563 - missing ambiguous conversion error.
4547 * call.c (convert_like_real): Use LOOKUP_IMPLICIT.
4548
ee3ff394
MP
45492017-03-23 Marek Polacek <polacek@redhat.com>
4550
4551 * cp-tree.h: Remove a C_RID_YYCODE reference.
4552
f13e9cd5
JJ
45532017-03-22 Jakub Jelinek <jakub@redhat.com>
4554
4555 PR c++/80141
4556 * semantics.c (finish_omp_clause) <case OMP_CLAUSE_SIMDLEN,
4557 case OMP_CLAUSE_ALIGNED>: Call maybe_constant_value only when not
4558 processing_template_decl.
4559
d3e19c2c
PC
45602017-03-21 Paolo Carlini <paolo.carlini@oracle.com>
4561
4562 PR c++/77752
4563 * name-lookup.c (pushtag_1): Add check for bogus, non template,
4564 std::initializer_list.
4565
8bee092e
JJ
45662017-03-21 Jakub Jelinek <jakub@redhat.com>
4567
4568 PR c++/35878
4569 * init.c (std_placement_new_fn_p, build_new_1): Formatting fixes.
4570
ece3b7e6
VV
45712017-03-21 Ville Voutilainen <ville.voutilainen@gmail.com>
4572
4573 PR c++/35878
8bee092e 4574 * init.c (std_placement_new_fn_p): New.
ece3b7e6
VV
4575 (build_new_1): Call it.
4576
8afd9c45
JM
45772017-03-20 Jason Merrill <jason@redhat.com>
4578
55b11c60
JM
4579 PR c++/80096 - ICE with C++17 non-type auto.
4580 * pt.c (tsubst): Delay tsubst of type of template non-type
4581 parameter.
4582
18f73c5f
JM
4583 PR c++/79519 - ICE with deleted template friend.
4584 * decl.c (grokdeclarator): Complain about misplaced function
4585 definition using =, as well.
4586
8afd9c45
JM
4587 PR c++/79640 - infinite recursion with generic lambda.
4588 * pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
4589 before substituting its initializer.
4590
92377255
MP
45912017-03-20 Marek Polacek <polacek@redhat.com>
4592 Paolo Carlini <paolo.carlini@oracle.com>
4593
4594 PR c++/80059 - ICE with noexcept and __transaction_atomic
4595 * except.c (build_must_not_throw_expr): Call
9da12bea 4596 instantiate_non_dependent_expr.
92377255 4597
c8816908
JM
45982017-03-19 Jason Merrill <jason@redhat.com>
4599
a4dfaae1
JM
4600 PR c++/80084 - wrong C++17 decomposition by reference of parameter.
4601 * decl.c (cp_finish_decomp): Don't pull out the DECL_INITIAL of a
4602 reference decomposition.
4603
c8816908
JM
4604 PR c++/80077 - error with constexpr and -fno-elide-constructors.
4605 * constexpr.c (cxx_eval_call_expression): Set ctx->call while
4606 expanding trivial constructor.
4607
c7ec585d
JM
46082017-03-17 Jason Merrill <jason@redhat.com>
4609
d1a73b0b
JM
4610 PR c++/78345 - ICE initializing array from lambda.
4611 * init.c (build_aggr_init): Check array initializer.
4612 (build_vec_init): Check the type of a CONSTRUCTOR.
4613
c7ec585d
JM
4614 PR c++/80073 - C++17 ICE with virtual base.
4615 * decl.c (xref_basetypes): Also check for indirect vbases.
4616
fbd603c4
JM
46172017-03-16 Jason Merrill <jason@redhat.com>
4618
2e92d7ad
JM
4619 * decl.c (start_enum): std::byte aliases anything.
4620
fbd603c4
JM
4621 PR c++/79797
4622 * constexpr.c (lookup_placeholder): Tweak.
4623
559a77e1
JM
46242017-03-15 Jason Merrill <jason@redhat.com>
4625
4626 PR c++/80043 - ICE with -fpermissive
4627 * typeck.c (convert_for_assignment): Handle instantiate_type
4628 not giving an error.
4629
9b74f933
NS
46302017-03-14 Nathan Sidwell <nathan@acm.org>
4631
4632 PR c++/79393 DR 1658 workaround
4633 * method.c (synthesized_method_base_walk): Inihibit abstract class
4634 virtual base access check here.
4635 (synthesized_method_walk): Not here.
4636
16e93e4b
NS
46372017-03-13 Nathan Sidwell <nathan@acm.org>
4638
4639 PR c++/79393 DR 1658 workaround
4640 * method.c (synthesized_method_walk): Check vbases of abstract
4641 classes for dtor walk.
4642
2f6f187a
DM
46432017-03-10 David Malcolm <dmalcolm@redhat.com>
4644
4645 PR translation/79848
4646 * decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs".
4647
0c942f3e
JM
46482017-03-10 Jason Merrill <jason@redhat.com>
4649
4650 PR c++/79960 - alias templates and partial ordering
4651 * pt.c (comp_template_args): Add partial_order parm.
4652 (template_args_equal): Likewise.
4653 (comp_template_args_porder): New.
4654 (get_partial_spec_bindings): Use it.
4655
455d833c
MP
46562017-03-10 Marek Polacek <polacek@redhat.com>
4657
4658 PR c++/79967
4659 * decl.c (grokdeclarator): Check ATTRLIST before dereferencing it.
4660
cdd669f9
JJ
46612017-03-10 Jakub Jelinek <jakub@redhat.com>
4662
e260b0a7
JJ
4663 PR c++/79899
4664 * optimize.c (maybe_thunk_body): Don't ICE if fns[0] is NULL.
4665 Use XALLOCAVEC macro.
4666
cdd669f9
JJ
4667 PR c++/79896
4668 * decl.c (finish_enum_value_list): If value is error_mark_node,
4669 don't copy it and change its type.
4670 * init.c (constant_value_1): Return error_mark_node if DECL_INITIAL
4671 of CONST_DECL is error_mark_node.
4672
423aec8b
MP
46732017-03-09 Marek Polacek <polacek@redhat.com>
4674
4675 PR c++/79900 - ICE in strip_typedefs
4676 * tree.c (strip_typedefs): Skip the attribute handling if T is
4677 a variant type which hasn't been updated yet.
4678
6443c7c0
MP
4679 PR c++/79687 - wrong code with pointer-to-member
4680 * init.c (constant_value_1): Break if the variable has a dynamic
4681 initializer.
4682
89262ec6
JM
46832017-03-08 Jason Merrill <jason@redhat.com>
4684
4685 PR c++/79797 - ICE with self-reference in array DMI.
4686 * constexpr.c (lookup_placeholder): Split out...
4687 (cxx_eval_constant_expression): ...from here.
4688
a71dbc63
JJ
46892017-03-07 Jakub Jelinek <jakub@redhat.com>
4690
4691 PR c/79834
4692 * parser.c (cp_parser_omp_cancellation_point,
4693 cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data,
4694 cp_parser_omp_target_update): Change "may only be used in compound
4695 statements" diagnostics, such that the same translatable string is
4696 used for all pragmas.
4697 (cp_parser_pragma): Likewise. Use error_at instead of
4698 cp_parser_error for that diagnostics.
4699
bdbbf28d
MP
47002017-03-06 Marek Polacek <polacek@redhat.com>
4701
4702 PR c++/79796 - ICE with NSDMI and this pointer
4703 * call.c (build_over_call): Handle NSDMI with a 'this' by calling
4704 replace_placeholders.
4705
345edb37
JJ
47062017-03-06 Jakub Jelinek <jakub@redhat.com>
4707
4708 PR c++/79822
4709 * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
4710 ({ (void) 0; }).
4711
90d9a8e6
JM
47122017-03-06 Jason Merrill <jason@redhat.com>
4713
4714 Revert "Allow deduction guides to look into primary template."
4715 * cp-tree.h, parser.c, pt.c, search.c: Revert.
4716
d8b4baeb
PC
47172017-03-05 Paolo Carlini <paolo.carlini@oracle.com>
4718
4719 PR c++/70266
4720 * except.c (build_must_not_throw_expr): Perform the implicit
4721 conversions on the condition.
4722
4cdeb234
JM
47232017-03-03 Jason Merrill <jason@redhat.com>
4724
108154ff
JM
4725 * mangle.c (mangle_decl): Check -Wnoexcept-type instead of
4726 -Wc++1z-compat.
4727
4cdeb234
JM
4728 Core issues 2273 and 2277
4729 * call.c (joust): Adjust using-declaration tiebreaker to handle
4730 the intermediate base case.
4731 * method.c (strip_inheriting_ctors): Just return the argument if
4732 !flag_new_inheriting_ctors.
4733
30d309aa
RB
47342017-03-03 Richard Biener <rguenther@suse.de>
4735
4736 PR c++/79825
4737 * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
4738
7278b0a2
MP
47392017-03-03 Marek Polacek <polacek@redhat.com>
4740
4741 PR c++/79791
4742 * typeck.c (string_conv_p): In C++11, always call pedwarn with
4743 OPT_Wwrite_strings.
4744
de35db42
JM
47452017-03-02 Jason Merrill <jason@redhat.com>
4746
fb5ce608
JM
4747 Update overload resolution with deduction guides.
4748 * pt.c (do_class_deduction): Always build the copy guide.
4749 (copy_guide_p, template_guide_p): New.
4750 (build_deduction_guide): Remember the original constructor.
4751 * call.c (joust): Prefer the copy guide and non-template guides.
4752
de35db42
JM
4753 Allow deduction guides to look into primary template.
4754 * cp-tree.h (struct saved_scope): Add deduction_guide_type.
4755 (struct cp_decl_specifier_seq): Add constructor_p.
4756 * parser.c (cp_parser_decl_specifier_seq): Set constructor_p.
4757 (cp_parser_init_declarator): Check it. Set ctor_dtor_or_conv_p.
4758 Clear deduction_guide_type. Don't handle deduction guide names.
4759 (cp_parser_declarator): Don't clear ctor_dtor_or_conv_p.
4760 (cp_parser_direct_declarator): Likewise. Handle deduction guides.
4761 (cp_parser_member_declaration, cp_parser_cache_defarg)
4762 (cp_parser_objc_class_ivars): Set ctor_dtor_or_conv_p.
4763 * pt.c (tsubst_copy, tsubst_copy_and_build): Revert last change.
4764 (build_deduction_guide): Set deduction_guide_type.
4765 (dependent_scope_p): Check deduction_guide_type.
4766 * search.c (lookup_member): Likewise.
4767
50bea0c5
JJ
47682017-03-02 Jakub Jelinek <jakub@redhat.com>
4769
4770 PR c++/79782
4771 * init.c (mark_exp_read_r): New function.
4772 (emit_mem_initializers): Use cp_walk_tree with mark_exp_read_r on
4773 whole arguments instead of plain mark_exp_read on TREE_LIST values.
4774
9a642cca
JM
47752017-03-01 Jason Merrill <jason@redhat.com>
4776
4777 Class template argument deduction in new-expression
4778 * init.c (build_new): Handle deduction from no initializer.
4779 * parser.c (cp_parser_new_expression): Don't require a single
4780 expression for class template deduction.
4781 * typeck2.c (cxx_incomplete_type_diagnostic): Fix diagnostic for
4782 class template placeholder.
4783 * pt.c (tsubst_copy) [TEMPLATE_DECL]: Handle dependent context.
4784 (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Handle SCOPE_REF.
4785 (redeclare_class_template): Set TEMPLATE_TYPE_PARM_FOR_CLASS.
4786
e3e9e8ca
JJ
47872017-03-01 Jakub Jelinek <jakub@redhat.com>
4788
4789 PR c++/79746
4790 * init.c (emit_mem_initializers): When not constructing vbases of
4791 abstract classes, mark arguments as read for
4792 -Wunused-but-set-parameter.
4793
853ef4e5
JM
47942017-02-28 Jason Merrill <jason@redhat.com>
4795
4796 Class template argument deduction refinements
4797 * call.c (joust): Move deduction guide tiebreaker down.
4798 * decl.c (start_decl_1, cp_finish_decl, grokdeclarator): Allow class
4799 deduction with no initializer.
4800 * pt.c (build_deduction_guide): Handle implicit default/copy ctor.
4801 (do_class_deduction): Use that rather than special case.
4802 (do_auto_deduction): Handle null initializer.
4803
324ff1a0
JJ
48042017-02-28 Jakub Jelinek <jakub@redhat.com>
4805
4806 * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...")
4807 instead of just cond ? "..." : "...".
4808 (grokdeclarator): Likewise.
4809 (build_enumerator): Likewise.
4810 * init.c (build_new_1): Likewise.
4811 * call.c (build_new_method_call_1): Likewise.
4812 * parser.c: Include intl.h.
4813 (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for
4814 "enter"/"exit" keyword.
4815 (cp_finalize_oacc_routine): Don't use %s to supply portions of the
4816 message.
4817
080384d6
JM
48182017-02-27 Jason Merrill <jason@redhat.com>
4819
4820 PR c++/71568 - SFINAE forming pointer to member function
4821 * init.c (build_offset_ref): Check the return value of
4822 perform_or_defer_access_check.
4823
d66d4590
MP
48242017-02-27 Marek Polacek <polacek@redhat.com>
4825
4826 * decl.c (expand_static_init): Add missing } in a comment.
4827
24f12823
VR
48282017-02-27 Volker Reichelt <v.reichelt@netcologne.de>
4829
4830 * init.c: Include intl.h.
4831 (build_new_1): Move message strings into pedwarn to make them
4832 -Wformat-security friendly. Mark string for translation.
4833 * pt.c (tsubst_copy_and_build): Mark string for translation.
4834 Make the pointer const.
4835 * semantics.c (finish_id_expression): Mark strings for translation.
4836
9d975cb6
JJ
48372017-02-25 Jakub Jelinek <jakub@redhat.com>
4838
4839 * call.c (build_op_delete_call): Make msg1 and msg2 const.
4840
4227c9ad
JJ
48412017-02-24 Jakub Jelinek <jakub@redhat.com>
4842
4843 PR c++/79588
4844 * call.c (build_over_call): Call check_function_arguments even for
4845 -Wrestrict, adjust check_function_arguments caller.
4846 * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict
4847 here.
4848 * typeck.c (cp_build_function_call_vec): Adjust
4849 check_function_arguments caller.
4850
5713d448
MP
48512017-02-24 Marek Polacek <polacek@redhat.com>
4852
4853 PR translation/79705
4854 * decl.c (check_redeclaration_exception_specification): Mark a string
4855 for translation. Make the pointer const.
4856
e3beb191
PC
48572017-02-23 Paolo Carlini <paolo.carlini@oracle.com>
4858
4859 PR c++/79361
4860 * pt.c (register_specialization): Check duplicate_decls return value
4861 for error_mark_node and pass it back.
4862
349c6351
JM
48632017-02-22 Jason Merrill <jason@redhat.com>
4864
680ed106
JM
4865 PR c++/79679 - missing destructor for argument
4866 * call.c (build_over_call): Don't pass tf_no_cleanup to argument
4867 conversions.
4868
349c6351
JM
4869 * pt.c (do_class_deduction): Handle 0 argument case.
4870
e40b6fc7
JJ
48712017-02-22 Jakub Jelinek <jakub@redhat.com>
4872
4873 PR c++/79664
4874 * parser.c (cp_parser_omp_teams, cp_parser_omp_target): Use
4875 SET_EXPR_LOCATION on OMP_TARGET/OMP_TEAMS tree.
4876 * constexpr.c (potential_constant_expression_1): Handle
4877 OMP_*, OACC_* and CILK_* trees. Use error_at with
4878 EXPR_LOC_OR_LOC (t, input_location) computed early
4879 instead of error, or error_at with location_of (t).
4880
78af14ae
MP
48812017-02-22 Marek Polacek <polacek@redhat.com>
4882
4883 PR c++/79653
4884 * parser.c (cp_parser_std_attribute_spec): Don't build the attribute
4885 if the alignas expression is erroneous.
4886 * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return
4887 error_mark_node.
4888
8fdddd3d
MP
4889 PR c++/79657
4890 * semantics.c (finish_underlying_type): Bail out for incomplete enums.
4891
46b48ef5
JM
48922017-02-21 Jason Merrill <jason@redhat.com>
4893
626aeaa7
JM
4894 PR c++/50308 - wrong deprecated warning with ADL
4895 PR c++/17729 - duplicate deprecated warning
4896 * semantics.c (finish_id_expression): Only call mark_used on a
4897 function if we aren't building a call.
4898
46b48ef5
JM
4899 PR c++/41727 - ICE with partial spec of partial instantiation
4900 * pt.c (process_partial_specialization): For now, don't check more
4901 specialized if there is more than one level of args.
4902
a232a1cb
MP
49032017-02-21 Marek Polacek <polacek@redhat.com>
4904
4905 PR c++/79535
4906 * cp-tree.h (maybe_reject_flexarray_init): Declare.
4907 * init.c (maybe_reject_flexarray_init): No longer static.
4908 Add check for current_function_decl.
4909 * parser.c (cp_parser_late_parse_one_default_arg): Reject
4910 a default mem-initializer for a flexible array.
4911
b7280ac2
JJ
49122017-02-21 Jakub Jelinek <jakub@redhat.com>
4913 Paolo Carlini <paolo.carlini@oracle.com>
4914
4915 PR c++/79654
4916 * decl.c (cp_finish_decomp): Don't set decl's type to error_mark_node
4917 on error.
4918 * pt.c (tsubst_decomp_names): Return error_mark_node if the first
4919 decl after the decomposition artificial decl has error_mark_node.
4920 * decl2.c (prune_vars_needing_no_initialization): Use error_operand_p
4921 instead of just == error_mark_node comparison.
4922
664beaf2
JJ
49232017-02-21 Jakub Jelinek <jakub@redhat.com>
4924
5c3f1d7b
JJ
4925 PR sanitizer/79589
4926 * decl.c: Include gimplify.h.
4927 (cp_finish_decomp): Make sure there is no sharing of trees
4928 in between DECL_VALUE_EXPR of decomposition decls.
4929
3bb43119
JJ
4930 PR c++/79655
4931 * constexpr.c (cxx_eval_array_reference): Diagnose negative subscript.
4932
664beaf2
JJ
4933 PR c++/79639
4934 * constexpr.c (cxx_eval_store_expression): If *valp is a PTRMEM_CST,
4935 call cplus_expand_constant on it first.
4936
b80dfe44
JM
49372017-02-19 Jason Merrill <jason@redhat.com>
4938
0e53a276
JM
4939 PR c++/78139 - destructor needed by new-expression
4940 * call.c (build_special_member_call): Use tf_no_cleanup.
4941
8f712b76
JM
4942 PR c++/78282 - auto template and pack expansion
4943 * pt.c (find_parameter_packs_r): Don't walk into the type of
4944 templates other than template template-parameters.
4945
bcbdfa4c
JM
4946 PR c++/79606 - ICE with this->base_member in NSDMI
4947 * class.c (build_base_path): Check processing_template_decl.
4948
736a933c
JM
4949 PR c++/79607 - ICE with T{} initializer
4950 * decl.c (type_dependent_init_p): Check the type of a CONSTRUCTOR.
4951
7950124e
JM
4952 PR c++/79566 - elaborated-type-specifier in range for
4953 * parser.c (cp_parser_simple_declaration): Fix check for type
4954 definition.
4955
bea40d11
JM
4956 PR c++/79400 - confusing suggestion of 'noexcept'
4957 * parser.c (cp_parser_exception_specification_opt): Remove
4958 suggestion for deprecated dynamic exception-specification.
4959
4cd15931
JM
4960 PR c++/79470 - partial ordering with reference parameters
4961 * pt.c (unify) [INDIRECT_REF]: Handle pack expansions.
4962
cfb82564
JM
4963 PR c++/79500 - ICE with non-template deduction guide
4964 * pt.c (do_class_deduction): Use STRIP_TEMPLATE rather than
4965 DECL_TEMPLATE_RESULT.
4966
de59c92b
JM
4967 PR c++/79580 - ICE with compound literal
4968 * parser.c (cp_parser_class_head): If we're in the middle of an
4969 expression, use ts_within_enclosing_non_class.
4970
b80dfe44
JM
4971 PR c++/79503 - inherited ctor taking base class
4972 * call.c (add_function_candidate): Also check that
4973 DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
4974
f46e2bc9
PC
49752017-02-19 Paolo Carlini <paolo.carlini@oracle.com>
4976
4977 PR c++/79380
4978 * typeck.c (cxx_alignas_expr): Reject a non-integral alignas
4979 argument.
4980
7dfa657b
JW
49812017-02-19 Eric Fiselier <eric@efcs.ca>
4982 Jonathan Wakely <jwakely@redhat.com>
4983
4984 PR c++/69523
4985 * parser.c (cp_parser_unqualified_id): Use OPT_Wliteral_suffix to
4986 control warning about literal suffix identifiers without a leading
4987 underscore.
4988
1ee26047
JM
49892017-02-17 Jason Merrill <jason@redhat.com>
4990
cb94c700
JM
4991 PR c++/79508 - lookup error with member template
4992 * parser.c (cp_parser_template_name): Clear
4993 parser->context->object_type if we aren't doing lookup.
4994
7c586749
JM
4995 PR c++/78690 - ICE with using and global type with same name
4996 * pt.c (type_dependent_object_expression_p): True for
4997 IDENTIFIER_NODE.
4998
edf1849a
JM
4999 PR c++/79549 - C++17 ICE with non-type auto template parameter pack
5000 * pt.c (convert_template_argument): Just return an auto arg pack.
5001 (tsubst_template_args): Don't tsubst an auto pack type.
5002
b10c7cd7
JM
5003 PR c++/79556 - C++17 ICE with non-type auto
5004 * pt.c (do_auto_deduction): Don't try to deduce from null type.
5005
1ee26047
JM
5006 PR c++/79533 - C++17 ICE with temporary cast to reference
5007 * call.c (build_over_call): Conversion to a reference prevents copy
5008 elision.
5009
790ecf85
JJ
50102017-02-16 Jakub Jelinek <jakub@redhat.com>
5011 Jason Merrill <jason@redhat.com>
5012
5013 PR c++/79502 - lost nodiscard attribute
5014 * pt.c (apply_late_template_attributes): Do apply non-dependent
5015 attributes to types.
5016
61cee260
JM
50172017-02-16 Jason Merrill <jason@redhat.com>
5018
1e163090
JM
5019 PR c++/78572 - ICE with self-modifying array initializer
5020 * constexpr.c (cxx_eval_store_expression): The object we're
5021 initializing is outside the constant-expression.
5022 (cxx_eval_call_expression): Set ctx->call.
5023
61cee260
JM
5024 PR c++/79050 - ICE with undeduced auto and LTO
5025 * decl.c (poplevel): Remove undeduced auto decls.
5026
bcac0b4d
JJ
50272017-02-16 Jakub Jelinek <jakub@redhat.com>
5028
5029 PR c++/79512
5030 * parser.c (cp_parser_omp_target): For -fopenmp-simd
5031 ignore #pragma omp target even when not followed by identifier.
5032
19e8a45f
JM
50332017-02-15 Jason Merrill <jason@redhat.com>
5034 Jakub Jelinek <jakub@redhat.com>
5035
5036 PR c++/79464 - ICE in IPA with omitted constructor parms
5037 * class.c (build_clone): Also omit parms from TYPE_ARG_TYPES.
5038 (adjust_clone_args): Adjust.
5039 (add_method): Remember omitted parms.
5040 * call.c (add_function_candidate): Likewise.
5041 * mangle.c (write_method_parms): Likewise.
5042 * method.c (ctor_omit_inherited_parms): Return false if there are no
5043 parms to omit.
5044
945c17d8
MS
50452017-02-15 Martin Sebor <msebor@redhat.com>
5046
5047 PR c++/79363
5048 * init.c (maybe_reject_flexarray_init): New function.
5049 (perform_member_init): Call it.
5050
4f5e5fcb
JJ
50512017-02-15 Jakub Jelinek <jakub@redhat.com>
5052
e7202857
JJ
5053 PR c++/79301
5054 * parser.c (cp_parser_std_attribute): Don't pedwarn about
5055 [[deprecated]] with -std=c++11 and [[fallthrough]] with
5056 -std=c++11 and -std=c++14.
5057
4f5e5fcb
JJ
5058 PR c++/79288
5059 * decl.c (grokdeclarator): For static data members, handle thread_p
5060 only after handling inline.
5061
6f207d58
MP
50622017-02-14 Marek Polacek <polacek@redhat.com>
5063
5064 PR c++/79420
5065 PR c++/79463
5066 * parser.c (cp_parser_postfix_dot_deref_expression): Avoid
5067 clobbering if the postfix expression isn't an EXPR_P.
5068
8cb7aaa1
JM
50692017-02-13 Jason Merrill <jason@redhat.com>
5070
5071 PR c++/79461 - ICE with lambda in constexpr constructor
5072 * constexpr.c (build_data_member_initialization): Ignore
5073 initialization of a local variable.
5074
b84702c0
JJ
50752017-02-13 Jakub Jelinek <jakub@redhat.com>
5076
5995f597
JJ
5077 * init.c (warn_placement_new_too_small): Add missing space in
5078 diagnostics.
5079 * parser.c (cp_parser_oacc_declare): Likewise.
5080 * mangle.c (maybe_check_abi_tags): Likewise.
5081
b84702c0
JJ
5082 PR c++/79232
5083 * typeck.c (cp_build_modify_expr): Handle properly COMPOUND_EXPRs
5084 on lhs that have {PRE{DEC,INC}REMENT,MODIFY,MIN,MAX,COND}_EXPR
5085 in the rightmost operand.
5086
b9a161ff
NS
50872017-02-13 Nathan Sidwell <nathan@acm.org>
5088
5089 PR c++/79296 - ICE mangling localized template instantiation
5090 * decl2.c (determine_visibility): Use template fn context for
5091 local class instantiations.
5092
bc61048a
JM
50932017-02-11 Jason Merrill <jason@redhat.com>
5094
817a77e4
JM
5095 PR c++/77659 - ICE with new and C++14 aggregate NSDMI
5096 * init.c (build_new): Make backups of any CONSTRUCTORs in init.
5097 (build_new_1): Use replace_placeholders.
5098 * tree.c (replace_placeholders_t): Also track whether we've seen a
5099 placeholder.
5100 (replace_placeholders, replace_placeholders_r): Adjust.
5101 * cp-tree.h: Adjust.
5102
bc61048a
JM
5103 PR c++/77790 - ICE with auto function in C++11 mode
5104 * decl.c (undeduced_auto_decl): Remove C++14 limitation.
5105 (require_deduced_type): Add complain parm, return bool.
5106 * cp-tree.h: Adjust.
5107 * decl2.c (mark_used): Use require_deduced_type.
5108
c16b872c
JM
51092017-02-10 Jason Merrill <jason@redhat.com>
5110
6a2cc46b
JM
5111 PR c++/78908 - template ops and bitfields
5112 * tree.c (build_min_non_dep): Use unlowered_expr_type.
5113
5c97093b
JM
5114 PR c++/78897 - constexpr union
5115 * constexpr.c (cxx_eval_store_expression): A store to a union member
5116 erases a previous store to another member.
5117
f494ac0e
JM
5118 PR c++/71285 - member of fold-expression
5119 * semantics.c (finish_unary_fold_expr)
5120 (finish_binary_fold_expr): Use null type for fold-expressions.
5121
c16b872c
JM
5122 PR c++/79401 - protected inherited constructor
5123 * call.c (enforce_access): For inheriting constructor, find a base
5124 binfo in the path we already have.
5125
6f4f30bf
MP
51262017-02-10 Marek Polacek <polacek@redhat.com>
5127
5128 PR c++/79435
5129 * pt.c (type_dependent_expression_p): Check if the expression type
5130 is null.
5131
3799a5b8
MP
5132 PR c++/79184
5133 * cvt.c (ocp_convert): Add a sentinel against -Wint-in-bool-context
5134 if warnings shouldn't be given.
5135
a7c8ed0c
PC
51362017-02-10 Paolo Carlini <paolo.carlini@oracle.com>
5137
5138 PR c++/71737
5139 * pt.c (tsubst_decl): Don't try to preserve a typedef that names
5140 an error_mark_node as type.
5141
9bfc55d0
JJ
51422017-02-09 Jakub Jelinek <jakub@redhat.com>
5143 Jason Merrill <jason@redhat.com>
5144
5145 PR c++/79143
5146 * pt.c (instantiate_class_template_1): Copy CLASSTYPE_NON_AGGREGATE
5147 from pattern to type.
5148
a56c0ac0
JM
51492017-02-09 Jason Merrill <jason@redhat.com>
5150
5151 PR c++/79316 - default argument in deduction guide
5152 PR c++/79350 - explicit deduction guide
5153 * parser.c (cp_parser_constructor_declarator_p)
5154 (cp_parser_direct_declarator): Parse deduction guides more like
5155 constructors.
5156 * cp-tree.h (enum special_function_kind): Add sfk_deduction_guide.
5157 * tree.c (special_function_p): Return it.
5158 * decl.c (check_special_function_return_type): Handle it.
5159 (grokdeclarator, grokfndecl): Adjust.
5160 (cp_finish_decl): Pass flags to do_auto_deduction.
5161 * error.c (dump_decl_name): Use TFF_UNQUALIFIED_NAME.
5162 * pt.c (dguide_name_p): Take a const_tree.
5163 (do_class_deduction): Handle explicit.
5164 (do_auto_deduction): Pass flags through.
5165 (build_deduction_guide): Copy explicit flag.
5166
56f71478
JJ
51672017-02-09 Jakub Jelinek <jakub@redhat.com>
5168
f08683a1
JJ
5169 PR c++/79429
5170 * parser.c (cp_parser_omp_ordered): Don't check for non-pragma_stmt
5171 non-pragma_compound context here.
5172 (cp_parser_omp_target): Likewise.
5173 (cp_parser_pragma): Don't call push_omp_privatization_clauses and
5174 parsing for ordered and target omp pragmas in non-pragma_stmt
5175 non-pragma_compound contexts.
5176
56f71478
JJ
5177 PR c/79431
5178 * parser.c (cp_parser_oacc_declare): Formatting fix.
5179 (cp_parser_omp_declare_target): Don't invoke symtab_node::get on
5180 automatic variables.
5181
02889d23
CLT
51822016-02-09 Nathan Sidwell <nathan@codesourcery.com>
5183 Chung-Lin Tang <cltang@codesourcery.com>
5184
5185 * parser.c (cp_parser_oacc_clause_tile): Disallow collapse. Fix
5186 parsing. Parse constant expression. Remove semantic checking.
5187 (cp_parser_omp_clause_collapse): Disallow tile.
5188 (cp_parser_omp_for_loop): Deal with tile clause. Don't emit a parse
5189 error about missing for after already emitting one. Use more
5190 conventional for idiom for unbounded loop.
5191 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_TILE.
5192 * semantics.c (finish_omp_clauses): Correct TILE semantic check.
5193 (finish_omp_for): Deal with tile clause.
5194
8e956c22
NS
51952017-02-07 Nathan Sidwell <nathan@acm.org>
5196
5197 * method.c (synthesized_method_base_walk): New. Broken out of ...
5198 (synthesized_method_walk): ... here. Call it. Cleanup
5199 initializations.
5200
bb7d75ff
PP
52012017-02-07 Patrick Palka <ppalka@gcc.gnu.org>
5202
5203 PR c++/79360
5204 * typeck2.c (process_init_constructor_union): Consider only
5205 FIELD_DECLs when looking for an NSDMI.
5206
44a6da7b
JM
52072017-02-06 Jason Merrill <jason@redhat.com>
5208
5209 PR c++/71193 - incomplete types in templates
5210 * parser.c (cp_parser_postfix_dot_deref_expression): In a template
5211 handle incomplete type by pedwarning and then treating as dependent.
5212
a5e8cbd1
JJ
52132017-02-06 Jakub Jelinek <jakub@redhat.com>
5214
98e09245
JJ
5215 PR c++/79379
5216 * constexpr.c (cxx_eval_constant_expression): Handle ANNOTATE_EXPR.
5217 (potential_constant_expression_1): Likewise.
5218
e8b0383c
JJ
5219 PR c++/79377
5220 * tree.c (build_min_non_dep_op_overload): For POST{INC,DEC}REMENT_EXPR
5221 allow one fewer than expected arguments if flag_permissive.
5222
a5e8cbd1
JJ
5223 PR c++/79372
5224 * decl.c (cp_finish_decomp): On error set decl type to error_mark_node.
5225 * pt.c (tsubst_expr): Don't call tsubst_decomp_names on decompositions
5226 with error_mark_node type.
5227
99be38ec
JM
52282017-02-03 Jason Merrill <jason@redhat.com>
5229
77095a6a
JM
5230 PR c++/78689 - ICE on constructor with label
5231 * optimize.c (maybe_clone_body): Replace omitted parameters with
5232 null lvalues.
5233 * class.c (build_clone): Fix logic for omitting inherited parms.
5234
8a87daca
JM
5235 PR c++/12245 - excessive memory use
5236 * constexpr.c (maybe_constant_value): Fold maybe_constant_value_1
5237 back in. Don't cache constants.
5238 (maybe_constant_init): Don't cache constants.
5239
99be38ec
JM
5240 PR c++/79294 - ICE with invalid template argument
5241 * pt.c (convert_nontype_argument_function): Check value-dependence.
5242 (convert_nontype_argument): Don't check it here for function ptrs.
5243
27de0fab
RB
52442017-02-02 Richard Biener <rguenther@suse.de>
5245
5246 PR cp/14179
5247 * cp-gimplify.c (cp_fold): When folding a CONSTRUCTOR copy
5248 it lazily on the first changed element only and copy it
5249 fully upfront, only storing changed elements.
5250
d8d58893
PC
52512017-02-02 Paolo Carlini <paolo.carlini@oracle.com>
5252
5253 PR c++/69637
5254 * decl2.c (grokbitfield): In case of error don't set-up DECL_INITIAL
5255 to the width.
5256
19bdccb4
JJ
52572017-01-31 Jakub Jelinek <jakub@redhat.com>
5258
5259 PR c++/79304
5260 * error.c (dump_expr) <case COMPONENT_REF>: Don't print .
5261 after ARROW_EXPR.
5262
fcb2cdfc
DM
52632017-01-31 David Malcolm <dmalcolm@redhat.com>
5264
5265 PR c++/79298
5266 * name-lookup.c (suggest_alternative_in_explicit_scope): Resolve
5267 any namespace aliases.
5268
7f357c61
NS
52692017-01-31 Nathan Sidwell <nathan@acm.org>
5270
5ae37bdf
NS
5271 PR c++/79290
5272 * typeck.c (build_ptrmemfunc_access_expr): Set TREE_NO_WARNING.
5273
de3fbef6
NS
5274 PR c++/67273
5275 PR c++/79253
5276 * pt.c: (instantiate_decl): Push to top level when current
5277 function scope doesn't match. Only push lmabda scope stack when
5278 pushing to top.
5279
1a5bac38
NS
5280 * cp-tree.h (instantiate_decl): Make defer_ok bool.
5281 * pt.c: Fix instantiate_decl calls to pass true/false not 0/1
5282 (instantiate_decl): Simplify and reorder state saving and restoration.
5283
7f357c61
NS
5284 PR c++/79264
5285 * lambda.c (maybe_generic_this_capture): Deal with template-id-exprs.
5286 * semantics.c (finish_member_declaration): Assert class is being
5287 defined.
5288
8db29d88
AO
52892017-01-30 Alexandre Oliva <aoliva@redhat.com>
5290
5291 Introduce C++ support in libcc1.
5292 * cp-tree.h (struct lang_identifier): Add oracle_looked_up.
5293 (ansi_opname): Rename to...
5294 (cp_operator_id): ... this. Adjust all callers.
5295 (ansi_assopname): Rename to...
5296 (cp_assignment_operator_id): ... this. Adjust all callers.
5297 (cp_literal_operator_id): Declare.
5298 (set_global_friend): Declare.
5299 (is_global_friend): Declare.
5300 (enum cp_oracle_request): New type.
5301 (cp_binding_oracle_function): New type.
5302 (cp_binding_oracle): Declare.
5303 (cp_finish_injected_record_type): Declare.
5304 * friend.c (global_friend): New var.
5305 (set_global_friend): New fn.
5306 (is_global_friend): New fn.
5307 (is_friend): Call is_global_friend.
5308 * name-lookup.c (cp_binding_oracle): New var.
5309 (query_oracle): New fn.
5310 (qualified_lookup_using_namespace): Call query_oracle.
5311 (lookup_name_real_1): Likewise.
5312 * parser.c (cp_literal_operator_id): Drop static.
5313 * search.c (friend_accessible_p): Call is_global_friend.
5314 * semantics.c (is_this_parameter): Accept a variable if the
5315 binding oracle is enabled.
5316
20f058d0
JM
53172017-01-27 Jason Merrill <jason@redhat.com>
5318
5319 PR c++/78771 - ICE with inherited constructor.
5320 * call.c (build_over_call): Call deduce_inheriting_ctor here.
5321 * pt.c (tsubst_decl): Not here.
5322 * class.c (add_method): Or here.
5323 * method.c (deduce_inheriting_ctor): Handle clones.
5324 (implicitly_declare_fn): Don't deduce inheriting ctors yet.
5325
bb6a6ee9
AB
53262017-01-27 Adam Butcher <adam@jessamine.co.uk>
5327
5328 PR c++/64382
5329 * cp/parser.c (parsing_default_capturing_generic_lambda_in_template):
5330 New function.
5331 * cp/cp-tree.h: Declare it.
5332 * cp/semantics.c (finish_id_expression): Resolve names within a default
5333 capturing generic lambda defined within a template prior to
5334 instantiation to allow for captures to be added to the closure type.
5335
905d2812
JJ
53362017-01-26 Jakub Jelinek <jakub@redhat.com>
5337
5338 PR c++/68727
5339 * cp-tree.def (OFFSETOF_EXPR): Bump number of operands to 2.
5340 * cp-tree.h (finish_offsetof): Add OBJECT_PTR argument.
5341 * parser.c (cp_parser_builtin_offsetof): Pass result of
5342 build_static_cast of null_pointer_node to finish_offsetof.
5343 * semantics.c (finish_offsetof): Add OBJECT_PTR argument, use
5344 it for -Winvalid-offsetof pedwarn instead of trying to guess
5345 original offsetof type from EXPR. Save OBJECT_PTR as a new
5346 second operand to OFFSETOF_EXPR.
5347 * pt.c (tsubst_copy_and_build) <case OFFSETOF_EXPR>: Adjust
5348 finish_offsetof caller, pass the second operand of OFFSETOF_EXPR
5349 as OBJECT_PTR.
5350
effdaefe
JM
53512017-01-26 Jason Merrill <jason@redhat.com>
5352
5668970a
JM
5353 * name-lookup.c (parse_using_directive): Deprecate strong using.
5354
effdaefe
JM
5355 PR c++/79176 - lambda ICE with -flto -Os
5356 * decl2.c (vague_linkage_p): Handle decloned 'tors.
5357 * tree.c (decl_linkage): Likewise.
5358
58feaa5f
MS
53592017-01-25 Martin Sebor <msebor@redhat.com>
5360
9f35c953 5361 * decl.c (grokdeclarator): Fix a typo in a comment.
58feaa5f 5362
0e343868
JJ
53632017-01-25 Jakub Jelinek <jakub@redhat.com>
5364
a25608aa
JJ
5365 PR c++/78896
5366 * decl.c (cp_finish_decomp): Disallow memberwise decomposition of
5367 lambda expressions.
5368
0e343868
JJ
5369 PR c++/77914
5370 * parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
5371 OPT_Wpedantic on lambda templates for -std=c++14 and higher.
5372
e5e391d6
MO
53732017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
5374
5375 PR lto/79061
5376 * decl.c (cxx_init_decl_processing): Pass main_input_filename
5377 to build_translation_unit_decl.
5378
7cfd79d6
JJ
53792017-01-24 Jakub Jelinek <jakub@redhat.com>
5380
5381 PR c++/79205
5382 * cp-gimplify.c (cp_genericize_r): Add result of
5383 convert_from_reference on invisiref parm to p_set.
5384
3e4b91f2
NS
53852017-01-24 Nathan Sidwell <nathan@acm.org>
5386
1d7bc790
NS
5387 PR c++/78469 - defaulted ctor and inaccessible dtor
5388 * cp-tree.h (tsubst_flags): Add tf_no_cleanup.
5389 * init.c (build_new_1): Pass tf_no_cleanup to build_value_init.
5390 * tree.c (build_target_expr): Check tf_no_cleanup.
5391
3e4b91f2
NS
5392 PR c++/79118 - anon-members and constexpr
5393 * constexpr.c (cx_check_missing_mem_inits): Caller passes type not
5394 ctor decl. Recursively check anonymous members.
5395 (register_constexpr_fundef): Adjust cx_check_missing_mem_inits
5396 call.
5397 (explain_invalid_constexpr_fn): Likewise.
5398
e6b8075c
NS
53992017-01-23 Nathan Sidwell <nathan@acm.org>
5400
fc7612fd
NS
5401 PR c++/71710 - template using directive of field
5402 * pt.c (tsubst_copy_and_build [COMPONENT_REF]): Move FIELD_DECL
5403 check earlier.
5404
e6b8075c
NS
5405 PR c++/71406 - ICE with scope-ref'd template id exprs
5406 PR c++/77508
5407 * typeck.c (finish_class_member_access_expr): Break up SCOPE_REF
5408 before breaking up TEMPLATE_ID_EXPR.
5409
4b9f2115
NS
54102017-01-20 Nathan Sidwell <nathan@acm.org>
5411
5412 PR c++/78495 - wrong code inherited ctor and invisi-ref parm
5413 * cp-gimplify.c (cp_generize_r): Don't skip thunks.
5414
ebed7175
DM
54152017-01-20 David Malcolm <dmalcolm@redhat.com>
5416
5417 PR c++/77829
5418 PR c++/78656
5419 * cp-tree.h (suggest_alternatives_for): Add bool param.
5420 (suggest_alternative_in_explicit_scope): New decl.
5421 * error.c (qualified_name_lookup_error): When SCOPE is a namespace
5422 that isn't the global one, call new function
5423 suggest_alternative_in_explicit_scope, only calling
5424 suggest_alternatives_for if it fails, and disabling near match
5425 searches fort that case. When SCOPE is the global namespace,
5426 pass true for new param to suggest_alternatives_for to allow for
5427 fuzzy name lookups.
5428 * lex.c (unqualified_name_lookup_error): Pass true for new param
5429 to suggest_alternatives_for.
5430 * name-lookup.c (consider_binding_level): Add forward decl.
5431 (suggest_alternatives_for): Add "suggest_misspellings" param,
5432 using it to conditionalize the fuzzy name-lookup code.
5433 (suggest_alternative_in_explicit_scope): New function.
5434 * parser.c (cp_parser_primary_expression): When calling
5435 finish_id_expression, pass location of id_expression rather
5436 than that of id_expr_token.
5437 (cp_parser_id_expression): Convert local "unqualified_id" from
5438 tree to cp_expr to avoid implicitly dropping location information.
5439
2ebd93e1
MP
54402017-01-20 Marek Polacek <polacek@redhat.com>
5441
5442 PR c/64279
5443 * call.c (build_conditional_expr_1): Warn about duplicated branches.
5444 * semantics.c (finish_expr_stmt): Build statement using the proper
5445 location.
5446
0655c6d5
JM
54472017-01-19 Jason Merrill <jason@redhat.com>
5448
b2c06d05
JM
5449 US 20 - forwarding references and class template argument deduction
5450 * cp-tree.h (TEMPLATE_TYPE_PARM_FOR_CLASS): New.
5451 * pt.c (push_template_decl_real): Set it.
5452 (maybe_adjust_types_for_deduction): Check it.
5453 (rewrite_template_parm): Copy it.
5454
689f867c
JM
5455 US 19 - deduction guides and constructors
5456 * call.c (joust): Prefer deduction guides to constructors.
5457 * pt.c (build_deduction_guide): Set DECL_ARTIFICIAL.
5458 (deduction_guide_p): Check DECL_P.
5459
a0889599
JM
5460 * decl.c (check_initializer): Always use build_aggr_init for array
5461 decomposition.
5462
0655c6d5
JM
5463 PR c++/79130 - decomposition and direct-initialization
5464 * init.c (build_aggr_init): Communicate direct-initialization to
5465 build_vec_init.
5466 (build_vec_init): Check for array copy sooner.
5467 * parser.c (cp_parser_decomposition_declaration): Remove call to
5468 build_x_compound_expr_from_list.
5469
8b1346a8
JM
54702017-01-18 Jason Merrill <jason@redhat.com>
5471
5472 PR c++/68666 - member variable template-id
5473 * typeck.c (finish_class_member_access_expr): Handle variable
5474 template-id.
5475 * pt.c (lookup_and_finish_template_variable): No longer static.
5476 * cp-tree.h: Declare it.
5477
c484627c
NS
54782017-01-18 Nathan Sidwell <nathan@acm.org>
5479
5480 PR c++/78488
5481 * call.c (build_over_call): When checking ellipsis conversions for
5482 an inherited ctor, make sure there is at least one conversion.
5483
46c4e8a1 54842017-01-18 Jason Merrill <jason@redhat.com>
e3aeb9d3
JM
5485
5486 PR c++/78894 - ICE with class deduction and default arg
5487 * pt.c (build_deduction_guide): Set DECL_PRIMARY_TEMPLATE.
5488
0c6299bb
MT
54892017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
5490
5491 PR c++/77489
5492 * mangle.c (write_discriminator): Reorganize abi warning check.
5493
2c65d990
NS
54942017-01-18 Nathan Sidwell <nathan@acm.org>
5495
96176bb3
NS
5496 * cp-tree.h: Clarify exception spec node comment.
5497 * except.c (nothrow_spec_p): Simplify by checking node-equality.
5498
2c65d990
NS
5499 PR c++/79091
5500 * mangle.c (write_exception_spec): Check nothrow explicitly.
5501 (write_encoding): Don't increment processing_template_decl around
5502 encoding.
5503
4bbc35f3
MT
55042017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
5505
5506 PR c++/70182
5507 * mangle.c (write_template_args): Add "on" for operator names.
5508
f6efea51
MT
55092017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
5510
5511 PR c++/77489
5512 * mangle.c (write_discriminator): Handle discriminator >= 10.
5513
8ddfdbc2
NS
55142017-01-17 Nathan Sidwell <nathan@acm.org>
5515
5516 PR c++/61636
5517 * cp-tree.h (maybe_generic_this_capture): Declare.
5518 * lambda.c (resolvable_dummy_lambda): New, broken out of ...
5519 (maybe_resolve_dummy): ... here. Call it.
5520 (maybe_generic_this_capture): New.
5521 * parser.c (cp_parser_postfix_expression): Speculatively capture
5522 this in generic lambda in unresolved member function call.
5523 * pt.c (tsubst_copy_and_build): Force hard error from failed
5524 member function lookup in generic lambda.
5525
893ffa2c
AH
55262017-01-17 Aldy Hernandez <aldyh@redhat.com>
5527
5528 PR c++/70565
5529 * cp-array-notation.c (expand_array_notation_exprs): Handle
5530 OMP_PARALLEL.
5531
91d01bf4
JM
55322017-01-11 Jason Merrill <jason@redhat.com>
5533
5534 PR c++/78337 - ICE on invalid with generic lambda
5535 * semantics.c (process_outer_var_ref): Check if containing_function
5536 is null. Move inform call under complain test.
5537
01bfd257
NS
55382017-01-11 Nathan Sidwell <nathan@acm.org>
5539
5540 PR c++/77812
5541 * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
5542 is a new overload.
5543
5b33cc83
NS
55442017-01-11 Nathan Sidwell <nathan@acm.org>
5545
5546 * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
5547
6b5b4e9c
JJ
55482017-01-11 Jakub Jelinek <jakub@redhat.com>
5549
1f258a55
JJ
5550 PR c++/78341
5551 * parser.c (cp_parser_std_attribute_spec): Remove over-eager
5552 assertion. Formatting fix.
5553
6b5b4e9c
JJ
5554 PR c++/72813
5555 * decl2.c (c_parse_final_cleanups): Set flag_syntax_only to 1 after
5556 writing PCH file.
5557
b9f4757f
DM
55582017-01-10 David Malcolm <dmalcolm@redhat.com>
5559
5560 PR c++/77949
5561 * parser.c (cp_parser_class_specifier_1): Only suggest inserting
5562 a missing semicolon if we have a valid insertion location for
5563 the fix-it hint.
5564
2af5cb50
JM
55652017-01-10 Jason Merrill <jason@redhat.com>
5566
5567 FI 20, decomposition declaration with parenthesized initializer.
5568 * parser.c (cp_parser_decomposition_declaration): Use
5569 cp_parser_initializer.
5570
f4da28a0
JM
55712017-01-09 Jason Merrill <jason@redhat.com>
5572
5573 Implement P0195R2, C++17 variadic using.
5574 * parser.c (cp_parser_using_declaration): Handle ellipsis and comma.
5575 * pt.c (tsubst_decl): Handle pack expansion in USING_DECL_SCOPE.
5576 * error.c (dump_decl): Likewise.
5577
bd2c6270
JJ
55782017-01-09 Jakub Jelinek <jakub@redhat.com>
5579
5580 PR translation/79019
5581 PR translation/79020
5582 * semantics.c (finish_omp_clauses): Add missing whitespace to
5583 translatable strings.
5584 * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Fix comment typo.
5585
38285dd7
JM
55862017-01-07 Jason Merrill <jason@redhat.com>
5587
5588 PR c++/78948 - instantiation from discarded statement
5589 * parser.h (struct cp_parser): Remove in_discarded_stmt field.
5590 * cp-tree.h (in_discarded_stmt): Declare it.
5591 (struct saved_scope): Add discarded_stmt bitfield.
5592 (in_discarded_stmt): New macro.
5593 * decl2.c (mark_used): Check it.
5594 * parser.c (cp_parser_selection_statement): Adjust.
5595 (cp_parser_jump_statement): Adjust.
5596
962c5679
JJ
55972017-01-05 Jakub Jelinek <jakub@redhat.com>
5598
26f20371
JJ
5599 PR c++/78931
5600 * decl.c (cp_finish_decomp): Remove probe variable, if tt is
5601 REFERENCE_REF_P, set tt to its operand.
5602
962c5679
JJ
5603 PR c++/78890
5604 * class.c (check_field_decls): Diagnose REFERENCE_TYPE fields in
5605 unions even for C++11 and later.
5606
dc7650cc
NS
56072017-01-05 Nathan Sidwell <nathan@acm.org>
5608
5609 PR c++/78765
5610 * pt.c (convert_nontype_argument): Don't try and see if integral
5611 or enum expressions are constants prematurely.
5612
a9342885
MP
56132017-01-04 Marek Polacek <polacek@redhat.com>
5614
5615 PR c++/64767
5616 * typeck.c (cp_build_binary_op): Warn when a pointer is compared with
5617 a zero character literal.
5618
066435fe
JJ
56192017-01-04 Jakub Jelinek <jakub@redhat.com>
5620
abec4284
JJ
5621 PR c++/78949
5622 * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
5623 vector type.
5624
26c43e27
JJ
5625 PR c++/78693
5626 * parser.c (cp_parser_simple_declaration): Only complain about
5627 inconsistent auto deduction if auto_result doesn't use auto.
5628
c9cf3863
JJ
5629 * parser.c (cp_parser_simple_declaration): Diagnose function
5630 declaration among more than one init-declarators with auto
5631 specifier.
5632
066435fe
JJ
5633 PR c++/71182
5634 * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
5635 assertion, as lexer->buffer may be NULL.
5636
baf9ebc8
MP
56372017-01-04 Marek Polacek <polacek@redhat.com>
5638
5639 PR c++/77545
5640 PR c++/77284
5641 * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
5642
4bf07f3f
NS
56432017-01-04 Nathan Sidwell <nathan@acm.org>
5644
5645 PR c++/66735
5646 * cp-tree.h (DECLTYPE_FOR_REF_CAPTURE): New.
5647 (lambda_capture_field_type): Update prototype.
5648 * lambda.c (lambda_capture_field_type): Add is_reference parm.
5649 Add referenceness here.
5650 (add_capture): Adjust lambda_capture_field_type call, refactor
5651 error checking.
5652 * pt.c (tsubst): Adjust lambda_capture_field_type call.
5653
cbe34bb5 56542017-01-01 Jakub Jelinek <jakub@redhat.com>
5624e564
JJ
5655
5656 Update copyright years.
ad41bd84 5657\f
cbe34bb5 5658Copyright (C) 2017 Free Software Foundation, Inc.
ad41bd84
JM
5659
5660Copying and distribution of this file, with or without modification,
5661are permitted in any medium without royalty provided the copyright
5662notice and this notice are preserved.