re PR c++/77638 (ICE on x86_64-linux-gnu (internal compiler error: tree check: expect...
[gcc.git] / gcc / cp / ChangeLog
1 2016-09-20 Jakub Jelinek <jakub@redhat.com>
2
3 PR c++/77638
4 * parser.c (cp_parser_template_declaration_after_parameter): For 2
5 argument operator"" template set ok to false for
6 parm == error_mark_node.
7
8 PR c++/77637
9 * parser.c (cp_parser_std_attribute_list): Reject ... without
10 preceding attribute.
11
12 2016-09-19 Bernd Edlinger <bernd.edlinger@hotmail.de>
13
14 PR c++/77434
15 * cvt.c (cp_convert_and_check): Suppress Wint-in-bool-context here.
16
17 2016-09-16 Patrick Palka <ppalka@gcc.gnu.org>
18
19 PR c++/77639
20 * parser.c (cp_parser_class_head): When
21 processing_template_parmlist, don't assume that the
22 class-head may start an explicit specialization.
23
24 2016-09-16 Jakub Jelinek <jakub@redhat.com>
25
26 PR c++/77482
27 * error.c (dump_simple_decl): Only check DECL_DECLARED_CONCEPT_P
28 if DECL_LANG_SPECIFIC is non-NULL. Fix up formatting.
29
30 PR c++/77338
31 * constexpr.c (cxx_eval_constant_expression) <case PARM_DECL>: Only
32 call is_really_empty_class on complete types.
33
34 PR c++/77375
35 * class.c (check_bases): Set CLASSTYPE_HAS_MUTABLE if any
36 TYPE_HAS_MUTABLE_P for any bases.
37
38 2016-09-16 Jason Merrill <jason@redhat.com>
39
40 * class.c (check_bases, set_one_vmethod_tm_attributes): Use
41 least_bit_hwi.
42 * decl.c (cxx_init_decl_processing): Use pow2p_hwi.
43 * parser.c (cp_parser_cilk_simd_vectorlength): Use pow2p_hwi.
44
45 2016-09-14 Jakub Jelinek <jakub@redhat.com>
46
47 PR c++/77549
48 * name-lookup.c (consider_binding_level): Look through TREE_LIST
49 and OVERLOAD.
50
51 2016-09-14 Marek Polacek <polacek@redhat.com>
52
53 * typeck.c (cp_build_unary_op): Diagnose incrementing boolean
54 expressions. Tweak an error message.
55
56 2016-09-14 Marek Polacek <polacek@redhat.com>
57
58 * cp-tree.h (cp_build_unary_op): Change nonconvert parameter type to
59 bool.
60 * decl2.c (one_static_initialization_or_destruction): Use true instead
61 of 1.
62 * init.c (build_vec_init): Use false instead of 0.
63 * pt.c (tsubst_copy_and_build): Likewise.
64 * semantics.c (simplify_loop_decl_cond): Likewise.
65 * typeck.c (rationalize_conditional_expr): Likewise.
66 (cp_build_binary_op): Use true instead of 1.
67 (cp_build_unary_op): Change nonconvert parameter type to bool. Use true
68 instead of 1.
69 (build_unary_op): Change nonconvert parameter type to bool.
70 (unary_complex_lvalue): Use false instead of 0.
71
72 2016-09-13 Jakub Jelinek <jakub@redhat.com>
73
74 Implement P0028R4, C++17 using attribute namespaces without repetition
75 * parser.c (cp_parser_std_attribute): Add ATTR_NS argument. Diagnose
76 non-NULL ATTR_NS with scoped attribute token. Handle non-NULL
77 ATTR_NS with non-scoped attribute tokens. Allow named ops in
78 identifier after ::.
79 (cp_parser_std_attribute_list): Add ATTR_NS argument, pass it down
80 to cp_parser_std_attribute calls.
81 (cp_parser_std_attribute_spec): Parse optional C++17
82 attribute-using-prefix, adjust grammar in function comment.
83
84 PR c++/77553
85 * constexpr.c (cxx_fold_pointer_plus_expression): New function.
86 (cxx_eval_binary_expression): Use it for POINTER_PLUS_EXPR.
87 (cxx_eval_pointer_plus_expression): Remove.
88 (cxx_eval_constant_expression) <case POINTER_PLUS_EXPR>: Don't
89 call cxx_eval_pointer_plus_expression.
90
91 2016-09-13 David Malcolm <dmalcolm@redhat.com>
92
93 * parser.c (cp_parser_class_specifier_1): Update for renaming of
94 add_fixit_insert to add_fixit_insert_before.
95 (cp_parser_class_head): Likewise.
96
97 2016-09-12 Bernd Edlinger <bernd.edlinger@hotmail.de>
98
99 PR c++/77496
100 * call.c (build_conditional_expr_1): Call warn_for_omitted_condop.
101 * class.c (instantiate_type): Look through the SAVE_EXPR.
102
103 2016-09-09 Jason Merrill <jason@redhat.com>
104
105 Implement P0035R4, C++17 new of over-aligned types.
106 * cp-tree.h (enum cp_tree_index): Add CPTI_ALIGN_TYPE.
107 (align_type_node): New macro.
108 * call.c (build_operator_new_call): Handle C++17 aligned new.
109 (second_parm_is_size_t, build_op_delete_call): Likewise.
110 (non_placement_deallocation_fn_p): Likewise. Rename to
111 usual_deallocation_fn_p.
112 (aligned_allocation_fn_p, aligned_deallocation_fn_p): New.
113 * decl.c (cxx_init_decl_processing): Add aligned new support.
114 * init.c (type_has_new_extended_alignment): New.
115 (build_new_1): Handle aligned new.
116 * tree.c (vec_copy_and_insert): New.
117
118 2016-09-02 Jakub Jelinek <jakub@redhat.com>
119
120 PR sanitizer/77396
121 * decl2.c (do_static_initialization_or_destruction): Only
122 call asan_dynamic_init_call if INITP is true.
123
124 2016-09-01 Martin Sebor <msebor@redhat.com>
125
126 * mangle.c: Increase buffer size to guarantee it fits the output
127 of the formatted function regardless of its arguments.
128
129 2016-09-01 Marek Polacek <polacek@redhat.com>
130
131 PR c/7652
132 * error.c (dump_type): Fix falls through comment.
133 (dump_decl): Likewise.
134 (dump_expr): Likewise.
135
136 2016-08-30 David Malcolm <dmalcolm@redhat.com>
137
138 * parser.c (cp_parser_enclosed_template_argument_list): Add fix-it
139 hint to ">>" within nested template argument list error.
140
141 2016-08-30 David Malcolm <dmalcolm@redhat.com>
142
143 * name-lookup.c (suggest_alternatives_for): Use add_fixit_replace
144 rather than add_fixit_misspelled_id.
145 * parser.c (cp_parser_diagnose_invalid_type_name): Likewise.
146
147 2016-08-29 Jason Merrill <jason@redhat.com>
148
149 PR c++/77379
150 * mangle.c (maybe_check_abi_tags): Add version parm, handle thunks.
151 (mangle_thunk): Add thunk parameter.
152 * method.c (finish_thunk): Pass it.
153 * cp-tree.h: Declare it.
154
155 2016-08-15 Jason Merrill <jason@redhat.com>
156
157 Avoid calling a trivial default constructor.
158 * class.c (default_ctor_p): New.
159 (in_class_defaulted_default_constructor): Use it.
160 (type_has_non_user_provided_default_constructor): Use it.
161 * call.c (build_over_call): Handle trivial default constructor.
162 * cp-tree.h: Declare default_ctor_p.
163
164 PR c++/57728
165 * pt.c (do_type_instantiation): Don't mess with non-user-provided
166 member functions.
167
168 2016-08-25 Marek Polacek <polacek@redhat.com>
169
170 * parser.c (cp_parser_binary_expression): Pass LHS to
171 warn_logical_not_parentheses.
172
173 2016-08-18 Marek Polacek <polacek@redhat.com>
174
175 PR c/7652
176 * call.c (add_builtin_candidate): Add gcc_fallthrough.
177 * cxx-pretty-print.c (pp_cxx_unqualified_id): Likewise.
178 * parser.c (cp_parser_skip_to_end_of_statement): Likewise.
179 (cp_parser_cache_defarg): Likewise.
180
181 2016-08-12 Marek Polacek <polacek@redhat.com>
182
183 PR c/7652
184 * call.c (add_builtin_candidate): Add FALLTHRU.
185 (build_integral_nontype_arg_conv): Adjust fall through comment.
186 (build_new_op_1): Add FALLTHRU.
187 (convert_like_real): Adjust fall through comment.
188 * class.c (fixed_type_or_null): Likewise.
189 * constexpr.c (cxx_eval_constant_expression): Likewise.
190 (potential_constant_expression_1): Likewise. Add FALLTHRU.
191 * cp-gimplify.c (cp_gimplify_expr): Adjust fall through comment.
192 (cp_fold): Add FALLTHRU.
193 * cvt.c (build_expr_type_conversion): Adjust fall through comment.
194 * cxx-pretty-print.c (pp_cxx_unqualified_id): Add FALLTHRU.
195 (pp_cxx_qualified_id): Likewise.
196 (cxx_pretty_printer::constant): Adjust fall through comment.
197 (cxx_pretty_printer::primary_expression): Add FALLTHRU.
198 (pp_cxx_pm_expression): Adjust fall through comment.
199 (cxx_pretty_printer::expression): Add FALLTHRU.
200 (cxx_pretty_printer::declaration_specifiers): Reformat code.
201 (pp_cxx_type_specifier_seq): Adjust fall through comment.
202 (pp_cxx_ptr_operator): Likewise. Add FALLTHRU.
203 * error.c (dump_type): Adjust fall through comment.
204 (dump_decl): Likewise.
205 * mangle.c (write_type): Likewise.
206 * method.c (synthesized_method_walk): Add FALLTHRU.
207 * name-lookup.c (arg_assoc_type): Likewise.
208 * parser.c (cp_lexer_print_token): Adjust fall through comment.
209 (cp_parser_primary_expression): Add FALLTHRU.
210 (cp_parser_operator): Likewise.
211 * pt.c (find_parameter_packs_r): Likewise.
212 (tsubst_aggr_type): Adjust fall through comment.
213 * semantics.c (finish_omp_clauses): Add FALLTHRU.
214 * tree.c (lvalue_kind): Likewise.
215
216 2016-08-12 Alexandre Oliva <aoliva@redhat.com>
217
218 PR debug/63240
219 * cp-objcp-common.c (cp_function_decl_defaulted): New.
220 (cp_function_decl_explicit_p): Const_tree-ify.
221 (cp_function_decl_deleted_p): Likewise.
222 * cp-objcp-common.h (cp_function_decl_defaulted): Declare.
223 (cp_function_decl_explicit_p): Const_tree-ify.
224 (cp_function_decl_deleted_p): Likewise.
225 (LANG_HOOKS_FUNCTION_DECL_DEFAULTED): Redefine.
226
227 2016-08-11 Jakub Jelinek <jakub@redhat.com>
228
229 PR c++/72868
230 * constexpr.c (label_matches): Handle case range expressions.
231
232 2016-08-11 Jason Merrill <jason@redhat.com>
233
234 PR c++/73456
235 * logic.cc (non_atomic_constraint_p): Handle EXPR_PACK_EXPANSION.
236
237 2016-08-10 Jason Merrill <jason@redhat.com>
238
239 Implement C++17 constexpr if.
240 * cp-tree.h (IF_STMT_CONSTEXPR_P): New.
241 * name-lookup.c (push_to_top_level, pop_from_top_level_1): Handle it.
242 * parser.h (struct cp_parser): Add in_discarded_stmt field.
243 * parser.c (cp_parser_selection_statement): Handle 'if constexpr'.
244 (cp_parser_jump_statement): Avoid deducing from a discarded return.
245 * pt.c (tsubst_expr): Only instantiate taken branch of constexpr if.
246 * semantics.c (begin_if_stmt): Set the binding level this_entity.
247 (finish_if_stmt_cond): Require the condition of a
248 constexpr if to be constant.
249 * decl.c (level_for_constexpr_if): New.
250 (named_label_entry): Add in_constexpr_if field.
251 (poplevel_named_label_1): Set it.
252 (check_goto): Check it.
253 (check_previous_goto_1): Check level_for_constexpr_if.
254
255 2016-08-09 Jason Merrill <jason@redhat.com>
256
257 PR c++/68703
258 * decl2.c (any_dependent_type_attributes_p): New.
259 * pt.c (dependent_type_p_r, type_dependent_expression_p): Check it.
260 * semantics.c (finish_id_expression): Check it.
261 * typeck.c (finish_class_member_access_expr): Check it.
262
263 PR c++/71712
264 * class.c (check_abi_tags): Don't duplicate tags for conversion ops.
265
266 Adjust mangling of ABI tags on class template member functions.
267 * class.c (missing_abi_tags): New.
268 (check_abi_tags): Don't check template. Add just_checking mode.
269 * mangle.c (abi_flag_at_least, any_abi_below, equal_abi_tags): New.
270 (sorted_abi_tags): Split out from write_abi_tags.
271 (struct releasing_vec): New.
272 (write_unqualified_name): Only look for the primary
273 template for types. Implement backward compatibility.
274
275 PR c++/72849
276 * constexpr.c (cxx_eval_constant_expression): Check
277 COMPLETE_TYPE_P before calling is_really_empty_class.
278 * class.c (is_really_empty_class): Don't call complete_type.
279
280 PR c++/56701
281 * typeck.c (cp_build_addr_expr_1): Remove special *this handling.
282
283 2016-08-09 Jakub Jelinek <jakub@redhat.com>
284
285 PR c++/72809
286 * rtti.c (get_pseudo_ti_index): Return TK_CLASS_TYPE for
287 builtin aggregate types without TYPE_BINFO.
288
289 2016-08-08 Jason Merrill <jason@redhat.com>
290
291 Implement C++17 constexpr lambda.
292 * class.c (finalize_literal_type_property): Handle lambdas.
293 * constexpr.c (is_valid_constexpr_fn): Likewise. No longer static.
294 (explain_invalid_constexpr_fn, cxx_eval_call_expression): Handle
295 lambdas.
296 (cxx_eval_constant_expression): Handle capture proxy.
297 (var_in_constexpr_fn): Don't check for C++14.
298 (var_in_maybe_constexpr_fn): New.
299 (potential_constant_expression_1): Use it. Check DECL_EXPR for
300 declarations not allowed in constexpr function. Handle
301 STATIC_ASSERT, RANGE_FOR_STMT.
302 * decl.c (make_rtl_for_nonlocal_decl): Use var_in_maybe_constexpr_fn.
303 (finish_function): Set DECL_DECLARED_CONSTEXPR_P on lambda members.
304 * lambda.c (begin_lambda_type): Set CLASSTYPE_LITERAL_P.
305 (maybe_add_lambda_conv_op): Clear thunk CALL_EXPR location.
306 (lambda_static_thunk_p): New.
307 * parser.c (cp_keyword_starts_decl_specifier_p): Add RID_CONSTEXPR.
308 (CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR): New enumerator.
309 (cp_parser_decl_specifier_seq): Handle it.
310 (cp_parser_lambda_declarator_opt): Use cp_parser_decl_specifier_seq.
311 * pt.c (instantiate_class_template_1): Set CLASSTYPE_LITERAL_P.
312 (tsubst_copy_and_build) [CALL_EXPR]: Propagate CALL_FROM_THUNK_P.
313 * error.c (dump_function_decl): Check TFF_NO_TEMPLATE_BINDINGS.
314 (dump_expr) [FUNCTION_DECL]: Pass it.
315
316 2016-08-08 Jason Merrill <jason@redhat.com>
317
318 PR c++/67131
319 * class.c (is_really_empty_class): Call complete_type.
320 * constexpr.c (cxx_eval_constant_expression): Check
321 is_really_empty_class.
322 (potential_constant_expression_1): Likewise. Check for error type.
323
324 2016-08-08 Jakub Jelinek <jakub@redhat.com>
325
326 PR c++/58706
327 * parser.c: Include tree-iterator.h.
328 (cp_parser_omp_for_loop_init): Move lambda DECL_EXPRs from init
329 to FOR_BLOCK.
330 (cp_parser_omp_for_loop): Handle non-STATEMENT_LIST FOR_BLOCK
331 entries.
332
333 2016-08-06 Jonathan Wakely <jwakely@redhat.com>
334
335 * call.c (convert_like_real): Harmonize diagnostics for invalid
336 reference binding.
337
338 2016-08-05 Martin Sebor <msebor@redhat.com>
339
340 * constexpr.c (cxx_eval_store_expression): Remove hyphen from
341 the spelling of "constant-expression" in diagnostic messages
342 for consistency.
343 (cxx_eval_constant_expression): Same.
344 (cxx_eval_outermost_constant_expr): Same.
345 (potential_constant_expression_1): Same.
346
347 2016-08-05 Nathan Sidwell <nathan@acm.org>
348
349 PR c++/68724
350 * pt.c (unify): TRAIT_EXPR is an expr.
351
352 2016-08-04 Paolo Carlini <paolo.carlini@oracle.com>
353
354 PR c++/72800
355 * lambda.c (add_capture): Check lambda_capture_field_type return
356 value for error_mark_node.
357
358 2016-08-04 Patrick Palka <ppalka@gcc.gnu.org>
359
360 PR c++/72759
361 * pt.c (tsubst_qualified_id): Return error_mark_node if
362 template_args is error_mark_node.
363
364 2016-08-04 Jason Merrill <jason@redhat.com>
365
366 PR c++/72415
367 * pt.c (tsubst_pack_expansion): Pull a single pack expansion out
368 of the TREE_VEC.
369
370 * cp-tree.h (TYPE_UNNAMED_P): Rename from TYPE_ANONYMOUS_P.
371 (TYPE_WAS_UNNAMED): Rename from TYPE_WAS_ANONYMOUS.
372 * class.c, decl.c, decl2.c, error.c, lambda.c, mangle.c,
373 name-lookup.c, parser.c, pt.c, semantics.c, tree.c: Adjust.
374
375 PR c++/72796
376 * typeck.c (finish_class_member_access_expr): Avoid stripping
377 SCOPE_REF to dependent base.
378
379 2016-08-04 Thomas Schwinge <thomas@codesourcery.com>
380
381 * parser.c (cp_ensure_no_oacc_routine): Improve diagnostics.
382 (cp_parser_late_parsing_cilk_simd_fn_info): Fix diagnostics.
383 (cp_parser_late_parsing_oacc_routine, cp_finalize_oacc_routine):
384 Simplify code, and improve diagnostics.
385 (cp_parser_oacc_routine): Likewise. Move pragma context
386 checking...
387 (cp_parser_pragma): ... here.
388
389 * parser.h (struct cp_omp_declare_simd_data): New.
390 (struct cp_parser): Use it for oacc_routine member.
391 * parser.c (cp_ensure_no_oacc_routine, cp_parser_oacc_routine)
392 (cp_parser_late_parsing_oacc_routine, cp_finalize_oacc_routine):
393 Use it. Simplify code.
394 (cp_parser_new): Initialize all members pointing to special
395 parsing data structures.
396 (cp_parser_cilk_simd_fn_vector_attrs): Initialize
397 parser->cilk_simd_fn_info->clauses.
398 (cp_parser_omp_declare_simd): Initialize
399 parser->omp_declare_simd->clauses.
400 (cp_parser_late_parsing_omp_declare_simd): Simplify code.
401
402 2016-08-04 Marek Polacek <polacek@redhat.com>
403
404 PR c++/70229
405 * constexpr.c (check_constexpr_ctor_body_1): Allow typedef
406 declarations.
407
408 2016-08-01 Jason Merrill <jason@redhat.com>
409
410 * mangle.c (mangle_decl): Warn about mangled name change even if
411 DECL_REALLY_EXTERN.
412
413 * mangle.c (get_abi_tags): New.
414 (find_substitution, write_unqualified_name, write_abi_tags)
415 (maybe_check_abi_tags): Use it.
416
417 * mangle.c (mangle_decl): Fix mangled name change warning.
418
419 PR c++/72766
420 * constexpr.c (cxx_eval_pointer_plus_expression): Check constancy
421 of nelts.
422 * cp-gimplify.c (cp_fully_fold): Only maybe_constant_value in
423 C++11 and up.
424
425 2016-07-30 Martin Sebor <msebor@redhat.com>
426
427 PR c++/60760
428 PR c++/71091
429 * constexpr.c (cxx_eval_binary_expression): Reject invalid expressions
430 involving null pointers.
431 (cxx_eval_component_reference): Reject null pointer dereferences.
432 (cxx_eval_indirect_ref): Reject indirecting through null pointers.
433 (cxx_eval_constant_expression): Reject invalid expressions involving
434 null pointers.
435
436 2016-07-29 Marek Polacek <polacek@redhat.com>
437
438 PR c/71926
439 * semantics.c (maybe_convert_cond): Use the location of COND for the
440 parentheses warning.
441
442 2016-07-29 Jason Merrill <jason@redhat.com>
443
444 * decl.c (build_enumerator): Tweak diagnostic.
445
446 PR c++/72457
447 * init.c (expand_aggr_init_1): Only handle value-init of bases.
448 * constexpr.c (build_data_member_initialization): Handle multiple
449 initializers for the same field.
450
451 2016-07-28 Paolo Carlini <paolo.carlini@oracle.com>
452
453 PR c++/71665
454 * decl.c (build_enumerator): Check the type of the enumerator before
455 calling cxx_constant_value.
456
457 2016-07-27 Jason Merrill <jason@redhat.com>
458
459 PR c++/71747
460 * pt.c (get_partial_spec_bindings): Replace tparms and spec_args
461 parameters with spec_tmpl. Call push_tinst_level.
462 (most_specialized_partial_spec): Adjust.
463 (more_specialized_partial_spec): Adjust.
464
465 2016-07-25 Jason Merrill <jason@redhat.com>
466
467 PR c++/65970
468 * cp-gimplify.c (genericize_cp_loop): Revert location change.
469
470 PR c++/71837
471 * lambda.c (add_capture): Leave a pack expansion in a TREE_LIST.
472 (build_lambda_object): Call build_x_compound_expr_from_list.
473 * pt.c (tsubst) [DECLTYPE_TYPE]: Likewise.
474
475 PR c++/71833
476 PR c++/54440
477 * pt.c (coerce_template_parameter_pack): Fix logic for
478 pack index.
479
480 PR c++/65970
481 * constexpr.c (cxx_eval_loop_expr): Count iterations.
482 * cp-gimplify.c (genericize_cp_loop): Use start_locus even for
483 infinite loops.
484
485 PR c++/71972
486 * constexpr.c (cxx_eval_array_reference): Handle looking for the
487 value of an element we're currently modifying.
488
489 2016-07-24 Jason Merrill <jason@redhat.com>
490
491 PR c++/71515
492 * pt.c (resolve_typename_type): Try to avoid calling
493 currently_open_class.
494
495 2016-07-23 Jason Merrill <jason@redhat.com>
496
497 PR c++/66617
498 * call.c (add_list_candidates): Handle VTT parm.
499 (build_new_method_call_1): Likewise.
500
501 PR c++/55922
502 PR c++/63151
503 * init.c (expand_aggr_init_1): Handle list-initialization from {}.
504
505 PR c++/70709
506 * class.c (walk_subobject_offsets): Handle 0-length array.
507
508 PR c++/70778
509 * pt.c (tsubst): Also substitute into the template of a
510 BOUND_TEMPLATE_TEMPLATE_PARM.
511
512 PR c++/71738
513 * pt.c (lookup_template_class_1): Handle getting template from tsubst.
514
515 PR c++/71350
516 * decl.c (reshape_init_r): Check complain for missing braces warning.
517
518 2016-07-22 Jason Merrill <jason@redhat.com>
519
520 PR c++/71576
521 * call.c (convert_like_real): Use lvalue_kind.
522
523 PR c++/71748
524 PR c++/52746
525 * pt.c (tsubst_baselink): Call
526 adjust_result_of_qualified_name_lookup for unqualified
527 destructors.
528
529 2016-07-21 Jason Merrill <jason@redhat.com>
530
531 PR c++/69223
532 * semantics.c (apply_deduced_return_type): Call
533 complete_type_or_else before building the new RESULT_DECL.
534
535 PR c++/71274
536 * decl2.c (maybe_instantiate_decl): Split out from mark_used.
537 (decl_constant_var_p): Use it instead.
538
539 PR c++/71630
540 * pt.c (instantiate_decl): Fix pattern_defined for namespace scope
541 variable templates.
542
543 PR c++/71913
544 * call.c (unsafe_copy_elision_p): It's OK to elide when
545 initializing an unknown object.
546
547 * call.c (build_over_call): Check unsafe_copy_elision_p even for
548 trivial constructors.
549 * method.c (do_build_copy_constructor): Don't copy tail padding
550 even in a trivial constructor.
551
552 2016-07-21 Jakub Jelinek <jakub@redhat.com>
553
554 PR c++/71728
555 * constexpr.c (potential_constant_expression_1) <case GOTO_EXPR>:
556 Replace assert with test, return false if the goto isn't break
557 or continue. Formatting fix.
558
559 2016-07-21 Richard Biener <rguenther@suse.de>
560
561 * vtable-class-hierarchy.c (vtv_generate_init_routine): Set
562 DECL_IGNORED_P.
563
564 2016-07-21 Jakub Jelinek <jakub@redhat.com>
565
566 PR c++/71941
567 * cp-gimplify.c (cp_genericize): For nested cp_genericize calls
568 save/restore bc_label array.
569
570 2016-07-21 Jason Merrill <jason@redhat.com>
571
572 PR c++/70781
573 * parser.c (cp_parser_lambda_expression): Unset OK if there was an
574 error parsing the lambda-declarator.
575
576 PR c++/71896
577 * constexpr.c (cxx_eval_binary_expression): Handle comparison
578 between lowered and unlowered PTRMEM_CST.
579
580 PR c++/65168
581 * typeck.c (cp_truthvalue_conversion): Compare pointers to nullptr.
582 Don't set c_inhibit_evaluation_warnings.
583
584 PR c++/71121
585 * cp-gimplify.c (cp_fully_fold): First call maybe_constant_value.
586
587 2016-07-21 Andrew Sutton <andrew.n.sutton@gmail.com>
588 Jason Merrill <jason@redhat.com>
589
590 Improving concepts performance and diagnostics.
591 PR c++/67565
592 PR c++/67579
593 PR c++/71843
594 * cp-tree.def (CHECK_CONSTR): New.
595 * cp-tree.h (CHECK_CONSTR_CONCEPT): New.
596 (CHECK_CONSTR_ARGS): New.
597 * constraint.cc (make_predicate_constraint): Remove in favor of
598 normalize_expression.
599 (resolve_constraint_check): Actually return error_mark_node when
600 resolution fails.
601 (resolve_variable_concept_check): Perform coercion as if processing
602 a template. Also return errors on resolution failure.
603 (lift_*): Remove all of these functions. Don't unnecessarily inline
604 concepts.
605 (learn_*): Add facilities to memoize implications for subsumption
606 during normalization.
607 (expanding_concept): New.
608 (expand_concept): New. Return the inlined and normalized definition
609 of a concept when needed.
610 (transform_*, xform_*): Rename to normalize_* to better reflect the
611 responsibility of those functions.
612 (normalize_template_id_expression): Check for non-boolean operands
613 when possible. Generate check constraints instead of normal variable
614 references.
615 (normalize_call_expression): Report errors when resolution fails.
616 (check_for_logical_overloads): Rewrite this check to more accurately
617 report the error.
618 (normalize_atom): Check for overloaded calls and invalid types before
619 determining if the expression refers to a concept.
620 (build_constraints): Don't cache normalized constraints or decomposed
621 assumptions.
622 (finish_shorthand_constraint): Return a normalized expression instead
623 of a predicate constraint.
624 (finish_template_introduction): Same.
625 (placeholder_extract_concept_and_args): Rewrite this since we only
626 ever get check constraints here.
627 (equivalent_placeholder_constraints): Rewrite in terms of check
628 constraints, and handle error_mark_nodes correctly.
629 (tsubst_check_constraint, tsubst_expr_constr, tsubst_type_constr)
630 (tsubst_implicit_conversion_constr)
631 (tsubst_argument_deduction_constr, tsubst_exception_constr)
632 (tsubst_parameterized_constraint, tsubst_constraint): New.
633 (tsbust_conjunection): Replace with tsubst_logical_operator and
634 actually generate the right kind of constraint.
635 (tsubst_requirement_body): Reverse the order of substituted arguments
636 so that they appear in the order written (helps diagnostics).
637 (satisfy_check_constraint): New.
638 (satisfy_conjunction): Simplify.
639 (satisfy_disjunction): Same.
640 (satisfy_constraint_1): Handle check constraints.
641 (eval_constr): New (private) global state.
642 (evaluating_constraints_sentinel): New. Manages eval_constr.
643 (satisfy_constraint): Add timing variables.
644 (satisfy_associated_constraints): Add hooks for memoization.
645 (evaluate_function_concept): Build a check constraint instead of
646 normalizing its definition.
647 (evaluate_variable_concept): Same.
648 (evaluate_constraint_expression): Normalize, but in the current
649 declaration processing context.
650 (evaluating_constraints_p): New.
651 (elide_constraint_failure_p): Actually emit constraint_thresh errors.
652 (diagnose_*): Remove artificial indentation. Add a new parameter to
653 each that tracks the current (complete) constraint prior to any
654 substitutions.
655 (diagnose_expression): Removed.
656 (diagnose_call_expression): Same.
657 (diagnose_template_id): Same.
658 (diagnose_template_id): New.
659 (diagnose_logical_constraint): New.
660 (diagnose_expression_constraint): Show the original expression.
661 (diagnose_type_constraint): Show the original type.
662 (diagnose_implicit_conversion_constraint): Be specific about
663 failures, don't re-diagnose a known-to-be-failed substitutions,
664 and manage elisions properly.
665 (diagnose_argument_deduction_constraint): Same.
666 (diagnose_exception_constraint): Same.
667 (diagnose_parameterized_constraint): Same.
668 (constraint_p): Allow EXPR_PACK_EXPANSION.
669 * logic.cc (next_by_distance): Removed. No longer used.
670 (any_p): Renamed from any_of.
671 (term_entry, term_hasher): New.
672 (term_list): Rewrite to include a hash table for quick lookup.
673 Also, make less stateful.
674 (proof_state): Extend to allow goals to be discharged once
675 satisfied.
676 (non_atomic_constraint_p): New.
677 (any_non_atomic_constraints_p): New.
678 (...rest...): Previous implementation completely replaced with an
679 iterative algorithm that opportunistically prunes the search space
680 before committing to using more memory.
681 * parser.c: (cp_parser_type_parameter): Normalize constraints.
682 (cp_parser_explicit_template_declaration): Same.
683 * pt.c: (finish_template_variable): Be less redundant with this error
684 message.
685 (template_args_equal): No longer static.
686 (tsubst_decl): Don't try to find specializations of variables that
687 have already been instantiated.
688 (build_non_dependent_expr): Avoid infinite recursion during concept
689 expansion.
690 (make_constrained_auto): Normalize constraints.
691 (do_auto_deduction): When doing auto deduction from a
692 partial-concept-id, be sure to include the explicit args checking
693 the constraints.
694 (constraint_sat_*): New. Memoize satisfied constraints.
695 (concept_spec_*): New. Memoize expressions associated with a concept
696 specialization.
697 (constraint_memos, concept_memos): New.
698 (lookup_constraint_satisfaction, memoize_constraint_satisfaction): New.
699 (lookup_concept_satisfaction, memoize_concept_satisfaction): New.
700 (get_concept_expansion, save_concept_expansion): New.
701 (hash_subsumption_args): New.
702 (comp_subsumption_args): New.
703 (subsumption_*): New. Memoize parts of the subsumption relation.
704 (lookup_subsumption_result, save_subsumption_result): New.
705 (init_constraint_processing): Initialize memo tables.
706 (get_constraints): Shortcut if !flag_concepts.
707 * decl.c (grokfndecl): Normalize constraints.
708 * error.c (dump_simple_decl): Print "concept" when appropriate.
709 (dump_function_decl): Same.
710 (dump_template_decl): Don't write requirements when we're not
711 printing the header.
712 (dump_expr): Handle fold expressions.
713 * cxx-pretty-print.c (cxx_pretty_printer::expression): Handle
714 fold expressions.
715 (get_fold_operator): New.
716 (pp_cxx_unary_left_fold_expression): New.
717 (pp_cxx_unary_right_fold_expression): New.
718 (pp_cxx_binary_fold_expression): New.
719 (pp_cxx_check_constraint): New.
720 (pp_cxx_*_constraint): Rewrite the grammar of internal constraints
721 to make them easier to read when debugging.
722 * search.c (accessible_p): Don't shortcut when evaluating constraints.
723 * tree.c (cp_tree_equal): Handle CHECK_CONSTR.
724
725 2016-07-20 David Malcolm <dmalcolm@redhat.com>
726
727 PR c/70339
728 PR c/71858
729 * name-lookup.c: Include gcc-rich-location.h, spellcheck-tree.h,
730 and parser.h.
731 (suggest_alternatives_for): If no candidates are found, try
732 lookup_name_fuzzy and report if if finds a suggestion.
733 (consider_binding_level): New function.
734 (lookup_name_fuzzy) New function.
735 * parser.c: Include gcc-rich-location.h.
736 (cp_lexer_next_token_is_decl_specifier_keyword): Move most of
737 logic into...
738 (cp_keyword_starts_decl_specifier_p): ...this new function.
739 (cp_parser_diagnose_invalid_type_name): When issuing
740 "does not name a type" errors, attempt to make a suggestion using
741 lookup_name_fuzzy.
742 * parser.h (cp_keyword_starts_decl_specifier_p): New prototype.
743 * search.c (lookup_field_fuzzy_info::fuzzy_lookup_field): Reject
744 types that are not CLASS_TYPE_P, rather than rejecting individual
745 tree codes.
746
747 2016-07-20 Jakub Jelinek <jakub@redhat.com>
748
749 PR c++/71909
750 * parser.c (cp_parser_save_member_function_body): Consume
751 __transaction_relaxed or __transaction_atomic with optional
752 attribute. Only skip catch with block if try keyword is seen.
753
754 PR c++/50060
755 * constexpr.c (cxx_eval_builtin_function_call): Pass false as lval
756 when evaluating call arguments. Use fold_builtin_call_array instead
757 of fold_build_call_array_loc, return t if it returns NULL. Otherwise
758 check the result with potential_constant_expression and call
759 cxx_eval_constant_expression on it.
760
761 2016-07-19 Jason Merrill <jason@redhat.com>
762
763 PR c++/67164
764 * pt.c (iterative_hash_template_arg, template_args_equal): Don't
765 handle ARGUMENT_PACK_SELECT.
766
767 2016-07-18 Jakub Jelinek <jakub@redhat.com>
768
769 PR c++/70869
770 PR c++/71054
771 * cp-gimplify.c (cp_genericize_r): Revert the 2016-07-07 change.
772 * tree.c (cp_walk_subtrees): For DECL_EXPR on DECL_ARTIFICIAL
773 non-static VAR_DECL, walk the decl's DECL_INITIAL, DECL_SIZE and
774 DECL_SIZE_UNIT.
775
776 PR c++/71835
777 * call.c (build_op_call_1): Use convert_like_with_context only
778 if cand->fn is a decl.
779
780 PR c++/71828
781 * constexpr.c (cxx_eval_constant_expression) <case REALPART_EXPR>:
782 For lval don't use cxx_eval_unary_expression and instead recurse
783 and if needed rebuild the reference.
784
785 PR c++/71826
786 * pt.c (tsubst_baselink): Only set BASELINK_OPTYPE for BASELINK_P.
787
788 PR c++/71822
789 * cp-gimplify.c (cp_gimplify_expr) <case VEC_INIT_EXPR>: Recursively
790 fold *expr_p before genericizing it.
791
792 PR c++/71871
793 * typeck.c (build_x_conditional_expr): Revert the 2012-10-25 change.
794
795 2016-07-15 Jason Merrill <jason@redhat.com>
796
797 PR c++/71495
798 * call.c (convert_like_real): Mask complain.
799 * semantics.c (perform_koenig_lookup): Likewise.
800
801 PR c++/71092
802 * constexpr.c (cxx_eval_call_expression): Fail quietly when cgraph
803 threw away DECL_SAVED_TREE.
804
805 PR c++/71117
806 Core 2189
807 * call.c (add_template_conv_candidate): Disable if there are
808 viable candidates.
809
810 PR c++/71511
811 * typeck2.c (cxx_incomplete_type_diagnostic): Handle DECLTYPE_TYPE.
812
813 PR c++/71513
814 * pt.c (tsubst_attributes): Fix loop logic.
815
816 PR c++/71604
817 PR c++/54430
818 * parser.c (cp_parser_range_for): Modify IDENTIFIER_BINDING directly.
819 (cp_parser_simple_declaration): Diagnose type definition in
820 for-range-declaration.
821
822 PR c++/71711
823 * operators.def: Add *_FOLD_EXPR.
824 * cp-tree.h (FOLD_EXPR_P): Parenthesize.
825 * mangle.c (write_expression): Handle fold-expressions.
826 * pt.c (tsubst_unary_left_fold, tsubst_binary_left_fold)
827 (tsubst_unary_right_fold, tsubst_binary_right_fold): Handle
828 partial instantiation.
829
830 PR c++/71814
831 * mangle.c (write_expression): Handle sizeof... an argument pack.
832
833 PR c++/71718
834 * pt.c (push_tinst_level_loc): Set at_eof before fatal_error.
835
836 PR c++/70824
837 * init.c (constant_value_1): Don't instantiated DECL_INITIAL of
838 artificial variables.
839
840 2016-07-15 Cesar Philippidis <cesar@codesourcery.com>
841
842 * parser.c (cp_parser_oacc_declare): Don't scan for
843 GOMP_MAP_POINTER.
844 * semantics.c (handle_omp_array_sections): Mark data clauses with
845 GOMP_MAP_FORCE_{PRESENT,TO,FROM,TOFROM} as potentially having
846 zero-length subarrays.
847
848 2016-07-11 Jason Merrill <jason@redhat.com>
849
850 * decl.c (store_parm_decls): Remove check for void parm.
851
852 2016-07-08 Jason Merrill <jason@redhat.com>
853
854 * cp-tree.h: Unpoison lvalue_p.
855 * call.c, class.c, constexpr.c, cvt.c, init.c, lambda.c, pt.c,
856 tree.c, typeck.c, typeck2.c: Use lvalue_p instead of
857 real_lvalue_p.
858
859 * tree.c (obvalue_p): Rename from lvalue_p.
860 (lvalue_p): Define for c-common.
861 * call.c, cp-tree.h, cvt.c, init.c: Adjust.
862 * typeck.c: Adjust.
863 (cp_build_addr_expr_1): Remove obsolete code.
864
865 * tree.c (glvalue_p): Rename from lvalue_or_rvalue_with_address_p.
866 * call.c, cp-tree.h, typeck.c: Adjust.
867
868 * lambda.c (maybe_add_lambda_conv_op): Fix null object argument.
869
870 P0145R2: Refining Expression Order for C++.
871 * cp-gimplify.c (lvalue_has_side_effects): New.
872 (cp_gimplify_expr): Implement assignment ordering.
873 * call.c (op_is_ordered, build_over_call): Adjust for
874 -fargs-in-order renaming to -fstrong-eval-order.
875 * cp-gimplify.c (cp_gimplify_expr): Likewise.
876
877 2016-07-07 Jakub Jelinek <jakub@redhat.com>
878 Kai Tietz <ktietz70@googlemail.com>
879
880 PR c++/70869
881 PR c++/71054
882 * cp-gimplify.c (cp_genericize_r): For DECL_EXPR for non-static
883 artificial vars, genericize their initializers.
884
885 2016-07-05 David Malcolm <dmalcolm@redhat.com>
886
887 PR c++/62314
888 * parser.c (cp_parser_class_specifier_1): When reporting
889 missing semicolons, use a fixit-hint to suggest insertion
890 of a semicolon immediately after the closing brace,
891 offsetting the reported column accordingly.
892
893 2016-07-04 Jan Beulich <jbeulich@suse.com>
894
895 * lang-specs.h ("@c++-header"): Conditionalize "-o".
896
897 2016-06-29 Thomas Schwinge <thomas@codesourcery.com>
898
899 * parser.c (cp_parser_pragma) <PRAGMA_OMP_CANCELLATION_POINT>:
900 Move pragma context checking into...
901 (cp_parser_omp_cancellation_point): ... here, and improve
902 diagnostic messages.
903 * semantics.c (finish_omp_cancel, finish_omp_cancellation_point):
904 Improve diagnostic messages.
905
906 2016-06-28 Jakub Jelinek <jakub@redhat.com>
907
908 * Make-lang.in: Don't cat ../stage_current if it does not exist.
909
910 2016-06-24 Jason Merrill <jason@redhat.com>
911
912 P0145R2: Refining Expression Order for C++.
913 * typeck.c (cp_build_modify_expr): Leave COMPOUND_EXPR on LHS.
914
915 * tree.c (get_target_expr_sfinae): Handle bit-fields.
916 (build_target_expr): Call mark_rvalue_use.
917
918 2016-06-24 Jakub Jelinek <jakub@redhat.com>
919
920 * call.c (magic_varargs_p): Return 3 for __builtin_*_overflow_p.
921 (build_over_call): For magic == 3, do no conversion only on 3rd
922 argument.
923
924 2016-06-23 Andi Kleen <ak@linux.intel.com>
925
926 * Make-lang.in: Add support for autofdo.
927
928 2016-06-21 Jason Merrill <jason@redhat.com>
929
930 * constraint.cc (constraints_satisfied_p): Keep as many levels of
931 args as our template has levels of parms.
932
933 * pt.c (template_parm_outer_level, uses_outer_template_parms): New.
934 (type_dependent_expression_p): Use uses_outer_template_parms.
935
936 2016-06-20 David Malcolm <dmalcolm@redhat.com>
937
938 * parser.c (cp_parser_string_literal): Convert non-standard
939 concatenation error to directly use a rich_location, and
940 use that to add the location of the first literal to the
941 diagnostic.
942
943 2016-06-17 Paolo Carlini <paolo.carlini@oracle.com>
944
945 * decl.c (validate_constexpr_redeclaration): Change pair of errors
946 to error + inform.
947 * error.c (dump_function_decl): Save the constexpr specifier too.
948
949 2016-06-17 Jakub Jelinek <jakub@redhat.com>
950
951 * tree.c (builtin_valid_in_constant_expr_p): Test for
952 DECL_BUILT_IN_CLASS equal to BUILT_IN_NORMAL instead of just
953 DECL_BUILT_IN.
954 (bot_manip): Likewise.
955 * call.c (magic_varargs_p): Likewise.
956
957 2016-06-17 Paolo Carlini <paolo.carlini@oracle.com>
958
959 * decl.c (grokfndecl): Change pair of errors to error + inform.
960
961 2016-06-17 Jason Merrill <jason@redhat.com>
962
963 PR c++/71209
964 * typeck.c (finish_class_member_access_expr): Avoid "not a base"
965 warning when there are dependent bases.
966
967 2016-06-17 Jakub Jelinek <jakub@redhat.com>
968
969 * semantics.c (handle_omp_array_sections_1): Don't ICE when
970 processing_template_decl when checking for bitfields and unions.
971 Look through REFERENCE_REF_P as base of COMPONENT_REF.
972 (finish_omp_clauses): Look through REFERENCE_REF_P even for
973 array sections with COMPONENT_REF bases.
974
975 2016-06-16 Jakub Jelinek <jakub@redhat.com>
976
977 * parser.c (cp_parser_omp_var_list_no_open): Call
978 convert_from_reference before cp_parser_postfix_dot_deref_expression.
979 * semantics.c (finish_omp_clauses): Don't ICE when
980 processing_template_decl when checking for bitfields and unions.
981 Look through REFERENCE_REF_P as base of COMPONENT_REF.
982
983 2016-06-15 Paolo Carlini <paolo.carlini@oracle.com>
984
985 * decl.c (wrapup_globals_for_namespace): Use DECL_SOURCE_LOCATION and
986 "%qF" in warning_at instead of "%q+F" in warning.
987 (check_redeclaration_exception_specification): Likewise in pedwarn
988 (and error, inform, for consistency).
989 * call.c (joust): Likewise.
990
991 2016-06-15 Paolo Carlini <paolo.carlini@oracle.com>
992
993 PR c++/70202
994 * decl.c (xref_basetypes): Revert r117839 changes; add fix-up
995 code at the end of the for loop; also revert r159637 changes,
996 add back the gcc_assert.
997 * cp-tree.h (xref_basetypes): Adjust declaration.
998 * parser.c (cp_parser_class_head): Adjust xref_basetypes call.
999
1000 2016-06-14 David Malcolm <dmalcolm@redhat.com>
1001
1002 * search.c: Include spellcheck-tree.h rather than spellcheck.h.
1003
1004 2016-06-14 David Malcolm <dmalcolm@redhat.com>
1005
1006 * typeck.c: Include "gcc-rich-location.h".
1007 (finish_class_member_access_expr): Simplify fixit code by
1008 using gcc_rich_location::add_fixit_misspelled_id.
1009
1010 2016-06-14 Jason Merrill <jason@redhat.com>
1011
1012 P0145R2: Refining Expression Order for C++.
1013 * cp-tree.h (CALL_EXPR_OPERATOR_SYNTAX, CALL_EXPR_ORDERED_ARGS)
1014 (CALL_EXPR_REVERSE_ARGS): New.
1015 * call.c (build_new_op_1): Set them.
1016 (extract_call_expr, op_is_ordered): New.
1017 (build_over_call): Set CALL_EXPR_ORDERED_ARGS.
1018 * cp-gimplify.c (cp_gimplify_expr) [CALL_EXPR]: Handle new flags.
1019 * pt.c (tsubst_copy_and_build): Copy new flags.
1020 * semantics.c (simplify_aggr_init_expr): Likewise.
1021 * tree.c (build_aggr_init_expr): Likewise.
1022 (build_min_non_dep_op_overload): Likewise.
1023
1024 2016-06-14 Jakub Jelinek <jakub@redhat.com>
1025
1026 PR c++/71528
1027 * decl.c (duplicate_decls): For DECL_INITIALIZED_P non-external
1028 olddecl vars, preserve their TREE_READONLY bit.
1029
1030 PR c++/71516
1031 * decl.c (complete_vars): Handle gracefully type == error_mark_node.
1032
1033 2016-06-14 Paolo Carlini <paolo.carlini@oracle.com>
1034
1035 * typeck2.c (digest_init_r): Use EXPR_LOC_OR_LOC on init.
1036
1037 2016-06-13 Paolo Carlini <paolo.carlini@oracle.com>
1038
1039 * decl.c (grokdeclarator): Fix typo in pedwarn text.
1040
1041 2016-06-10 Thomas Schwinge <thomas@codesourcery.com>
1042
1043 PR c/71381
1044 * parser.c (cp_parser_omp_var_list_no_open) <OMP_CLAUSE__CACHE_>:
1045 Loosen checking.
1046
1047 2016-06-09 Paolo Carlini <paolo.carlini@oracle.com>
1048
1049 PR c++/71465
1050 Revert:
1051 2016-06-04 Paolo Carlini <paolo.carlini@oracle.com>
1052
1053 PR c++/70202
1054 * parser.c (cp_parser_class_head): When xref_basetypes fails and
1055 emits an error do not zero the type.
1056
1057 2016-06-08 Paolo Carlini <paolo.carlini@oracle.com>
1058
1059 * decl.c (maybe_deduce_size_from_array_init): Use
1060 DECL_SOURCE_LOCATION in error_at.
1061 (layout_var_decl): Likewise.
1062 (check_array_initializer): Likewise.
1063 (check_initializer): Likewise.
1064 (duplicate_decls, check_elaborated_type_specifier): Tidy.
1065
1066 2016-06-08 Martin Sebor <msebor@redhat.com>
1067 Jakub Jelinek <jakub@redhat.com>
1068
1069 PR c++/70507
1070 PR c/68120
1071 * constexpr.c: Include gimple-fold.h.
1072 (cxx_eval_internal_function): New function.
1073 (cxx_eval_call_expression): Call it.
1074 (potential_constant_expression_1): Handle integer arithmetic
1075 overflow built-ins.
1076 * tree.c (builtin_valid_in_constant_expr_p): Handle
1077 BUILT_IN_{ADD,SUB,MUL}_OVERFLOW_P.
1078
1079 2016-06-08 Paolo Carlini <paolo.carlini@oracle.com>
1080
1081 * pt.c (tsubst, case TYPENAME_TYPE): Don't delay checking the
1082 return value of tsubst_aggr_type for error_mark_node.
1083
1084 2016-06-08 Jakub Jelinek <jakub@redhat.com>
1085
1086 PR c++/71442
1087 * pt.c (tsubst_copy): Only set TREE_USED on DECLs.
1088
1089 2016-06-06 Jakub Jelinek <jakub@redhat.com>
1090 Patrick Palka <ppalka@gcc.gnu.org>
1091
1092 PR c++/70847
1093 PR c++/71330
1094 PR c++/71393
1095 * cp-gimplify.c (cp_fold_r): Set *walk_subtrees = 0 and return NULL
1096 right after cp_fold call if cp_fold has returned the same stmt
1097 already in some earlier cp_fold_r call.
1098 (cp_fold_function): Add pset automatic variable, pass its address
1099 to cp_walk_tree.
1100
1101 2016-06-04 Paolo Carlini <paolo.carlini@oracle.com>
1102
1103 PR c++/70202
1104 * parser.c (cp_parser_class_head): When xref_basetypes fails and
1105 emits an error do not zero the type.
1106
1107 2016-06-03 Patrick Palka <ppalka@gcc.gnu.org>
1108
1109 PR c++/27100
1110 * decl.c (duplicate_decls): Properly copy the
1111 DECL_PENDING_INLINE_P, DECL_PENDING_INLINE_INFO and
1112 DECL_SAVED_FUNCTION_DATA fields from OLDDECL to NEWDECL.
1113
1114 2016-06-03 Chung-Lin Tang <cltang@codesourcery.com>
1115
1116 * semantics.c (finish_omp_clauses): Mark OpenACC reduction
1117 arguments as addressable when async clause exists.
1118
1119 2016-06-02 Jan Hubicka <jh@suse.cz>
1120
1121 * cp-gimplify.c (genericize_continue_stmt): Force addition of
1122 predict stmt.
1123
1124 2016-06-02 Paolo Carlini <paolo.carlini@oracle.com>
1125
1126 * decl.c (xref_tag_1): Change pairs of errors to error + inform.
1127 (start_enum): Likewise.
1128 * parser.c (cp_parser_class_head): Likewise.
1129
1130 2016-06-02 Jakub Jelinek <jakub@redhat.com>
1131
1132 PR c++/71372
1133 * cp-gimplify.c (cp_fold): For INDIRECT_REF, if the folded expression
1134 is INDIRECT_REF or MEM_REF, copy over TREE_READONLY, TREE_SIDE_EFFECTS
1135 and TREE_THIS_VOLATILE flags. For ARRAY_REF and ARRAY_RANGE_REF, copy
1136 over TREE_READONLY, TREE_SIDE_EFFECTS and TREE_THIS_VOLATILE flags
1137 to the newly built tree.
1138
1139 2016-05-31 Jason Merrill <jason@redhat.com>
1140
1141 * pt.c (instantiate_decl): Avoid recalculation.
1142
1143 PR c++/60095
1144 PR c++/69515
1145 PR c++/69009
1146 * pt.c (instantiate_template_1): Don't put the partial
1147 specialization in DECL_TI_TEMPLATE.
1148 (partial_specialization_p, impartial_args): Remove.
1149 (regenerate_decl_from_template): Add args parm.
1150 (instantiate_decl): Look up the partial specialization again.
1151
1152 PR c++/71227
1153 * pt.c (check_explicit_specialization): Give better diagnostic about
1154 specializing a hidden friend.
1155
1156 2016-05-31 Paolo Carlini <paolo.carlini@oracle.com>
1157
1158 PR c++/71248
1159 * decl.c (check_static_variable_definition): Use DECL_SOURCE_LOCATION
1160 to obtain correct locations; avoid redundant diagnostics on
1161 out-of-class definitions.
1162
1163 2016-05-30 Martin Sebor <msebor@redhat.com>
1164
1165 PR c++/71306
1166 * init.c (warn_placement_new_too_small): Handle placement new arguments
1167 that are elements of arrays more carefully. Remove a pointless loop.
1168
1169 2016-05-30 Jakub Jelinek <jakub@redhat.com>
1170
1171 PR c++/71349
1172 * parser.c (cp_parser_omp_for): Don't disallow nowait clause
1173 when combined with target construct.
1174 (cp_parser_omp_parallel): Pass cclauses == NULL as last argument
1175 to cp_parser_omp_all_clauses.
1176
1177 2016-05-30 Paolo Carlini <paolo.carlini@oracle.com>
1178
1179 PR c++/71238
1180 * lex.c (unqualified_name_lookup_error): Take a location too.
1181 (unqualified_fn_lookup_error): Take a cp_expr.
1182 * cp-tree.h (unqualified_name_lookup_error,
1183 unqualified_fn_lookup_error): Adjust declarations.
1184 * semantics.c (perform_koenig_lookup): Adjust
1185 unqualified_fn_lookup_error call, pass the location of
1186 the identifier too as part of a cp_expr.
1187
1188 2016-05-30 Paolo Carlini <paolo.carlini@oracle.com>
1189
1190 PR c++/71099
1191 * parser.c (cp_parser_function_specifier_opt): Use current_class_type
1192 to improve the diagnostic about wrong uses of 'virtual'.
1193
1194 2016-05-29 Paolo Carlini <paolo.carlini@oracle.com>
1195
1196 PR c++/71105
1197 * lambda.c (maybe_add_lambda_conv_op): Early return also when
1198 LAMBDA_EXPR_DEFAULT_CAPTURE_MODE != CPLD_NONE.
1199
1200 2016-05-28 Ville Voutilainen <ville.voutilainen@gmail.com>
1201
1202 Revert:
1203 PR c++/69855
1204 * name-lookup.c (pushdecl_maybe_friend_1): Push local function
1205 decls into the global scope after stripping template bits
1206 and setting DECL_ANTICIPATED.
1207
1208 2016-05-27 Paolo Carlini <paolo.carlini@oracle.com>
1209
1210 PR c++/60385
1211 * name-lookup.c (push_namespace): Return bool, false when pushdecl
1212 fails.
1213 * name-lookup.h (push_namespace): Adjust declaration.
1214 * parser.c (cp_parser_namespace_definition): Check push_namespace
1215 return value.
1216
1217 2016-05-27 Ville Voutilainen <ville.voutilainen@gmail.com>
1218
1219 PR c++/69855
1220 * name-lookup.c (pushdecl_maybe_friend_1): Push local function
1221 decls into the global scope after stripping template bits
1222 and setting DECL_ANTICIPATED.
1223
1224 2016-05-26 Jakub Jelinek <jakub@redhat.com>
1225
1226 * semantics.c (finish_omp_clauses) <case OMP_CLAUSE_SCHEDULE>: Warn
1227 if OMP_CLAUSE_SCHEDULE_CHUNK_EXPR is known not to be positive.
1228
1229 2016-05-26 Patrick Palka <ppalka@gcc.gnu.org>
1230
1231 PR c++/70822
1232 PR c++/70106
1233 * cp-tree.h (REF_PARENTHESIZED_P): Make this flag apply to
1234 SCOPE_REFs too.
1235 * pt.c (tsubst_qualified_id): If REF_PARENTHESIZED_P is set
1236 on the qualified_id then propagate it to the resulting
1237 expression.
1238 (do_auto_deduction): Check REF_PARENTHESIZED_P on SCOPE_REFs
1239 too.
1240 * semantics.c (force_paren_expr): If given a SCOPE_REF, just set
1241 its REF_PARENTHESIZED_P flag.
1242
1243 2016-05-25 Jason Merrill <jason@redhat.com>
1244
1245 PR c++/71173
1246 PR c++/70522
1247 * cp-tree.h (enum tag_types): Add scope_type.
1248 * parser.c (cp_parser_class_name): Use scope_type.
1249 (prefer_type_arg): Handle scope_type.
1250 (cp_parser_lookup_name): Use prefer_type_arg.
1251 * name-lookup.c (lookup_qualified_name): Change bool is_type_p to
1252 int prefer_type, use lookup_flags.
1253 * name-lookup.h: Adjust.
1254
1255 2016-05-24 Cesar Philippidis <cesar@codesourcery.com>
1256
1257 * parser.c (cp_parser_oacc_declare): Add support for
1258 GOMP_MAP_FIRSTPRIVATE_POINTER.
1259 * semantics.c (handle_omp_array_sections_1): Replace bool is_omp
1260 argument with enum c_omp_region_type ort. Don't privatize OpenACC
1261 non-static members.
1262 (handle_omp_array_sections): Replace bool is_omp argument with enum
1263 c_omp_region_type ort. Update call to handle_omp_array_sections_1.
1264 (finish_omp_clauses): Add specific errors and warning messages for
1265 OpenACC. Use firsrtprivate pointers for OpenACC subarrays. Update
1266 call to handle_omp_array_sections.
1267
1268 2016-05-24 Jason Merrill <jason@redhat.com>
1269
1270 PR c++/70584
1271 * cp-gimplify.c (cp_fold_maybe_rvalue): Loop in case cp_fold
1272 returns a decl.
1273 (cp_fold) [INDIRECT_REF]: Don't fold to an rvalue.
1274
1275 2016-05-24 Martin Sebor <msebor@redhat.com>
1276
1277 PR c++/71147
1278 * decl.c (layout_var_decl, grokdeclarator): Use complete_or_array_type_p.
1279 * pt.c (instantiate_class_template_1): Try to complete the element
1280 type of a flexible array member.
1281 (can_complete_type_without_circularity): Handle arrays of unknown bound.
1282 * typeck.c (complete_type): Also complete the type of the elements of
1283 arrays with an unspecified bound.
1284
1285 2016-05-24 Paolo Carlini <paolo.carlini@oracle.com>
1286
1287 PR c++/69872
1288 * typeck2.c (check_narrowing): Check pedwarn return value.
1289
1290 2016-05-24 Jakub Jelinek <jakub@redhat.com>
1291
1292 PR c++/71257
1293 * semantics.c (finish_omp_clauses) <case OMP_CLAUSE_LINEAR>:
1294 For OMP_CLAUSE_LINEAR_REF don't require type to be
1295 integral or pointer.
1296
1297 2016-05-24 Richard Biener <rguenther@suse.de>
1298
1299 PR middle-end/70434
1300 PR c/69504
1301 * expr.c (mark_exp_read): Handle VIEW_CONVERT_EXPR.
1302 * constexpr.c (cxx_eval_array_reference): Handle indexed
1303 vectors.
1304 * typeck.c (cp_build_array_ref): Adjust.
1305
1306 2016-05-23 Jason Merrill <jason@redhat.com>
1307
1308 PR c++/70344
1309 * constexpr.c (cxx_eval_call_expression): Check for
1310 fun == current_function_decl again.
1311
1312 PR c++/70584
1313 * cp-gimplify.c (cp_fold) [INDIRECT_REF]: Call
1314 maybe_undo_parenthesized_ref.
1315
1316 PR c++/70735
1317 * pt.c (tsubst_copy): Just return a local variable from
1318 non-template context. Don't call rest_of_decl_compilation for
1319 duplicated static locals.
1320 (tsubst_decl): Set DECL_CONTEXT of local static from another
1321 function.
1322
1323 2016-05-23 Paolo Carlini <paolo.carlini@oracle.com>
1324
1325 PR c++/70972
1326 * method.c (forward_parm): Use cp_build_reference_type.
1327
1328 2016-05-23 Paolo Carlini <paolo.carlini@oracle.com>
1329
1330 PR c++/69095
1331 * parser.c (cp_parser_initializer): Use check_for_bare_parameter_packs.
1332
1333 2016-05-23 Paolo Carlini <paolo.carlini@oracle.com>
1334
1335 * pt.c (check_for_bare_parameter_packs): Improve error message
1336 location for expressions.
1337
1338 2016-05-20 Nathan Sidwell <nathan@acm.org>
1339
1340 * constexpr.c (cxx_bind_parameters_in_call): Avoid gratuitous if
1341 ... goto.
1342 (cxx_eval_call_expression): Fix comment grammar.
1343
1344 2016-05-20 Paolo Carlini <paolo.carlini@oracle.com>
1345
1346 PR c++/70572
1347 * decl.c (cp_finish_decl): Check do_auto_deduction return value
1348 and return immediately in case of erroneous code.
1349
1350 2016-05-19 Marek Polacek <polacek@redhat.com>
1351
1352 PR c++/71075
1353 * pt.c (unify_template_argument_mismatch): Use %qE instead of %qD.
1354
1355 2016-05-19 Jason Merrill <jason@redhat.com>
1356
1357 PR c++/10200
1358 * pt.c (fn_type_unification): Add outer template args if needed.
1359 (type_unification_real): Handle getting full args.
1360
1361 2016-05-19 David Malcolm <dmalcolm@redhat.com>
1362
1363 PR c++/71184
1364 * parser.c (cp_parser_operator): For array new/delete, check that
1365 cp_parser_require returned a non-NULL token before dereferencing
1366 it.
1367
1368 2016-05-19 Bernd Edlinger <bernd.edlinger@hotmail.de>
1369
1370 * decl.c (finish_enum_value_list): Use the specified mode.
1371
1372 2016-05-18 Jason Merrill <jason@redhat.com>
1373
1374 * pt.c (value_dependent_expression_p): Tweak new cases to better
1375 match the wording in the standard.
1376
1377 2016-05-18 Paolo Carlini <paolo.carlini@oracle.com>
1378
1379 PR c++/69793
1380 * parser.c (cp_parser_template_id): Don't call cp_lexer_peek_nth_token
1381 when the previous cp_lexer_peek_token returns CPP_EOF.
1382
1383 2016-05-18 Paolo Carlini <paolo.carlini@oracle.com>
1384
1385 PR c++/70466
1386 * call.c (convert_like_real): Check that we are actually converting
1387 from an init list.
1388
1389 2016-05-16 Matthew Wahab <matthew.wahab@arm.com>
1390
1391 * decl.c (grokdeclarator): Remove errmsg and use of
1392 targetm.invalid_return_type.
1393 (grokparms): Remove errmsg and use of
1394 targetm.invalid_parameter_type.
1395
1396 2016-05-13 Jason Merrill <jason@redhat.com>
1397
1398 PR c++/10200
1399 PR c++/69753
1400 * pt.c (tsubst_decl): Use uses_template_parms.
1401 (instantiate_template_1): Handle non-dependent calls in templates.
1402 (value_dependent_expression_p): Handle BASELINK, FUNCTION_DECL.
1403 (type_dependent_expression_p): Only consider innermost template args.
1404 (dependent_template_arg_p): Check enclosing class of a template here.
1405 (dependent_template_p): Not here.
1406 (type_dependent_object_expression_p): New.
1407 * typeck.c (finish_class_member_access_expr): Use it.
1408 * parser.c (cp_parser_postfix_expression): Use it.
1409 (cp_parser_postfix_dot_deref_expression): Use it. Use comptypes
1410 to detect the current instantiation.
1411 (cp_parser_lookup_name): Really implement DR 141.
1412 * search.c (lookup_field_r): Prefer a dependent using-declaration.
1413 (any_dependent_bases_p): Split out from...
1414 * name-lookup.c (do_class_using_decl): ...here.
1415 * call.c (build_new_method_call_1): Use it.
1416 * semantics.c (finish_call_expr): 'this' doesn't make a call dependent.
1417 * tree.c (non_static_member_function_p): Remove.
1418 * typeck2.c (build_x_arrow): Use dependent_scope_p.
1419
1420 * parser.c (cp_parser_postfix_dot_deref_expression): Use
1421 complete_type_or_else for unknown_type_node, too.
1422
1423 2016-05-12 Marek Polacek <polacek@redhat.com>
1424
1425 PR c/70756
1426 * call.c (build_new_op_1): Pass LOC to cp_build_modify_expr.
1427 * cp-tree.h (cp_build_modify_expr): Update declaration.
1428 (cxx_incomplete_type_error, cxx_incomplete_type_diagnostic): New inline
1429 overloads.
1430 * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs): Pass INPUT_LOCATION to
1431 cp_build_modify_expr.
1432 * decl2.c (set_guard): Likewise.
1433 (handle_tls_init): Likewise.
1434 * init.c (perform_member_init): Likewise.
1435 (expand_virtual_init): Likewise.
1436 (build_new_1): Likewise.
1437 (build_vec_delete_1): Likewise.
1438 (get_temp_regvar): Likewise.
1439 (build_vec_init): Likewise.
1440 * method.c (do_build_copy_assign): Likewise.
1441 (assignable_expr): Likewise.
1442 * semantics.c (finish_omp_for): Likewise.
1443 * typeck.c (cp_build_binary_op): Pass LOCATION to pointer_diff and
1444 cp_pointer_int_sum.
1445 (cp_pointer_int_sum): Add location parameter. Pass it down to
1446 pointer_int_sum.
1447 (pointer_diff): Add location parameter. Use it.
1448 (build_modify_expr): Pass location down to cp_build_modify_expr.
1449 (cp_build_modify_expr): Add location parameter. Use it.
1450 (build_x_modify_expr): Pass location down to cp_build_modify_expr.
1451 * typeck2.c (cxx_incomplete_type_diagnostic,
1452 cxx_incomplete_type_error): Add location parameter.
1453
1454 2016-05-11 Marek Polacek <polacek@redhat.com>
1455
1456 PR c++/71024
1457 * decl.c (duplicate_decls): Call diagnose_mismatched_decls.
1458
1459 2016-05-05 Jakub Jelinek <jakub@redhat.com>
1460
1461 * parser.c (cp_parser_selection_statement): For RID_SWITCH,
1462 pass if_p instead of NULL to cp_parser_implicitly_scoped_statement.
1463
1464 2016-05-04 Marek Polacek <polacek@redhat.com>
1465
1466 * parser.c (cp_parser_selection_statement): Replace OPT_Wparentheses
1467 with OPT_Wdangling_else.
1468
1469 2016-05-03 Martin Sebor <msebor@redhat.com>
1470
1471 PR c++/66561
1472 * tree.c (builtin_valid_in_constant_expr_p): Treat BUILT_IN_FILE,
1473 BUILT_IN_FUNCTION, and BUILT_IN_LINE as constant expressions.
1474
1475 2016-05-03 Marek Polacek <polacek@redhat.com>
1476
1477 PR c/70859
1478 * call.c (build_cxx_call): Pass location and vNULL down to
1479 check_builtin_function_arguments.
1480
1481 2016-05-03 Richard Biener <rguenther@suse.de>
1482
1483 * Make-lang.in (cc1plus-checksum.c): For stage-final re-use
1484 the checksum from the previous stage.
1485
1486 2016-05-02 David Malcolm <dmalcolm@redhat.com>
1487
1488 PR c++/62314
1489 * typeck.c (finish_class_member_access_expr): When
1490 giving a hint about a possibly-misspelled member name,
1491 add a fix-it replacement hint.
1492
1493 2016-05-02 Cesar Philippidis <cesar@codesourcery.com>
1494
1495 * cp-tree.h (finish_omp_clauses): Update prototype.
1496 * parser.c (cp_parser_oacc_all_clauses): Update call to
1497 finish_omp_clauses.
1498 (cp_parser_omp_all_clauses): Likewise.
1499 (cp_parser_omp_for_loop): Likewise.
1500 (cp_omp_split_clauses): Likewise.
1501 (cp_parser_oacc_cache): Likewise.
1502 (cp_parser_oacc_loop): Likewise.
1503 (cp_parser_omp_declare_target):
1504 (cp_parser_cilk_simd_all_clauses): Likewise.
1505 (cp_parser_cilk_for): Likewise.
1506 * pt.c (tsubst_omp_clauses): Replace allow_fields and declare_simd
1507 arguments with enum c_omp_region_type ort.
1508 (tsubst_omp_clauses): Update calls to finish_omp_clauses.
1509 (tsubst_omp_attribute): Update calls to tsubst_omp_clauses.
1510 (tsubst_omp_for_iterator): Update calls to finish_omp_clauses.
1511 (tsubst_expr): Update calls to tsubst_omp_clauses.
1512 * semantics.c (finish_omp_clauses): Replace bool arguments
1513 allow_fields, declare_simd, and is_cilk with bitmask ort.
1514 (finish_omp_for): Update call to finish_omp_clauses.
1515
1516 2016-05-02 David Malcolm <dmalcolm@redhat.com>
1517
1518 PR c++/62314
1519 * parser.c (cp_parser_class_head): Capture the start location;
1520 use it to emit a fix-it insertion hint when complaining
1521 about missing "template <> " in explicit specializations.
1522
1523 2016-05-02 Richard Sandiford <richard.sandiford@arm.com>
1524
1525 * init.c (build_new_1): Use shift operators instead of wi:: shifts.
1526
1527 2016-05-02 Richard Biener <rguenther@suse.de>
1528
1529 * decl.c (grokdeclarator): Properly insert a DECL_EXPR for
1530 anonymous VLAs.
1531
1532 2016-04-29 Paolo Carlini <paolo.carlini@oracle.com>
1533
1534 PR c++/66644
1535 * class.c (check_field_decl): Remove final int* parameter, change
1536 the return type to bool; fix logic in order not to reject multiple
1537 initialized fields in anonymous struct.
1538 (check_field_decls): Adjust call.
1539
1540 2016-04-29 Cesar Philippidis <cesar@codesourcery.com>
1541
1542 PR middle-end/70626
1543 * parser.c (cp_parser_oacc_loop): Don't augment mask with
1544 OACC_LOOP_CLAUSE_MASK.
1545 (cp_parser_oacc_kernels_parallel): Update call to
1546 c_oacc_split_loop_clauses.
1547
1548 2016-04-28 Jason Merrill <jason@redhat.com>
1549
1550 Implement C++17 [[nodiscard]] attribute.
1551 PR c++/38172
1552 PR c++/54379
1553 * parser.c (cp_parser_std_attribute): Handle [[nodiscard]].
1554 * tree.c (handle_nodiscard_attribute): New.
1555 (cxx_attribute_table): Add [[nodiscard]].
1556 * cvt.c (cp_get_fndecl_from_callee, cp_get_callee_fndecl): New.
1557 (maybe_warn_nodiscard): New.
1558 (convert_to_void): Call it.
1559
1560 * cvt.c (cp_get_callee): New.
1561 * constexpr.c (get_function_named_in_call): Use it.
1562 * cxx-pretty-print.c (postfix_expression): Use it.
1563 * except.c (check_noexcept_r): Use it.
1564 * method.c (check_nontriv): Use it.
1565 * tree.c (build_aggr_init_expr): Use it.
1566 * cp-tree.h: Declare it.
1567
1568 2015-04-27 Ryan Burn <contact@rnburn.com>
1569 Jeff Law <law@redhat.com>
1570
1571 PR c++/69024
1572 PR c++/68997
1573 * cp-gimplify.c (cp_gimplify_expr): Call cilk_cp_detect_spawn_and_unwrap
1574 instead of cilk_detect_spawn_and_unwrap.
1575 * cp-cilkplus.c (is_conversion_operator_function_decl_p): New.
1576 (find_spawn): New.
1577 (cilk_cp_detect_spawn_and_unwrap): New.
1578 * lambda.c: Include cp-cilkplus.h.
1579 * parser.c: Include cp-cilkplus.h.
1580 * cp-tree.h (cpp_validate_cilk_plus_loop): Move prototype into...
1581 * cp-cilkpus.h: New file.
1582
1583 2016-04-27 Nathan Sidwell <nathan@acm.org>
1584
1585 * constexpr.c (get_fundef_copy): Use the original function for
1586 non-recursive evaluations.
1587 (save_fundef_copy): Always expect a slot to be available.
1588
1589 2016-04-27 Bernd Schmidt <bschmidt@redhat.com>
1590
1591 * parser.c (cp_parser_postfix_expression): Call
1592 warn_for_memset instead of warning directly here.
1593
1594 2016-04-26 Patrick Palka <ppalka@gcc.gnu.org>
1595
1596 PR c++/70241
1597 * decl.c (build_enumerator): Set current_access_specifier when
1598 declaring an enumerator belonging to an in-class enumeration.
1599 * parser.c (cp_parser_check_access_in_redecleration): Also
1600 consider in-class enumerations.
1601
1602 2016-04-26 Marek Polacek <polacek@redhat.com>
1603
1604 PR c++/70744
1605 * call.c (build_conditional_expr_1): Call cp_stabilize_reference
1606 instead of stabilize_reference.
1607 (build_over_call): Likewise.
1608 * cp-tree.h (cp_stabilize_reference): Declare.
1609 * tree.c (cp_stabilize_reference): New function.
1610 * typeck.c (cp_build_unary_op): Call cp_stabilize_reference instead of
1611 stabilize_reference.
1612 (unary_complex_lvalue): Likewise.
1613 (cp_build_modify_expr): Likewise.
1614
1615 2016-04-26 Jakub Jelinek <jakub@redhat.com>
1616
1617 PR bootstrap/70704
1618 * pt.c (build_non_dependent_expr): Use flag_checking > 1 instead of
1619 just flag_checking.
1620
1621 2016-04-25 Jason Merrill <jason@redhat.com>
1622
1623 * tree.c (std_attribute_table): New.
1624 (init_tree): Register it.
1625
1626 2016-04-22 Jason Merrill <jason@redhat.com>
1627
1628 * parser.c (cp_parser_perform_range_for_lookup): Decay the array.
1629
1630 2016-04-21 Patrick Palka <ppalka@gcc.gnu.org>
1631
1632 * name-lookup.c (free_saved_scope): New free list of saved_scope
1633 structures.
1634 (push_to_top_level): Attempt to reuse a saved_scope struct
1635 from free_saved_scope instead of allocating a new one each time.
1636 (pop_from_top_level_1): Chain the now-unused saved_scope structure
1637 onto free_saved_scope.
1638
1639 2016-04-21 Paolo Carlini <paolo.carlini@oracle.com>
1640
1641 PR c++/70540
1642 * semantics.c (process_outer_var_ref): Unconditionally return
1643 error_mark_node when mark_used returns false.
1644
1645 2016-04-21 Marek Polacek <polacek@redhat.com>
1646
1647 PR c++/70513
1648 * parser.c (cp_parser_enum_specifier): Check and possibly error for
1649 extra qualification.
1650
1651 2016-04-20 Nathan Sidwell <nathan@acm.org>
1652
1653 PR c++/55635
1654 * init.c (build_vec_delete_1): Protect operator delete call in try
1655 finally.
1656 (build_delete): Likewise.
1657 * optimize.c (build_delete_destructor_body): Likewise.
1658
1659 2016-04-20 Ilya Verbin <ilya.verbin@intel.com>
1660
1661 PR c++/69363
1662 * cp-tree.h (finish_omp_clauses): Add new default argument.
1663 * parser.c (cp_parser_cilk_simd_all_clauses): Use finish_omp_clauses
1664 instead of c_finish_cilk_clauses.
1665 * semantics.c (finish_omp_clauses): Add new argument. Allow
1666 floating-point variables in the linear clause for Cilk Plus.
1667
1668 2016-04-20 Nathan Sidwell <nathan@acm.org>
1669
1670 * semantics.c (finish_compound_lteral): Don't wrap VECTOR_TYPEs in a
1671 TARGET_EXPR.
1672
1673 2016-04-19 Jason Merrill <jason@redhat.com>
1674
1675 PR c++/66543
1676 * expr.c (mark_exp_read): Handle NON_DEPENDENT_EXPR.
1677 * pt.c (make_pack_expansion): Call mark_exp_read.
1678 * semantics.c (finish_id_expression): Call mark_type_use in
1679 unevaluated context.
1680
1681 DR 2137
1682 * call.c (implicit_conversion): If we choose a copy constructor
1683 for list-initialization from the same type, the conversion is an
1684 exact match.
1685
1686 * constexpr.c (breaks): Handle EXIT_EXPR.
1687 (cxx_eval_loop_expr): Handle COMPOUND_EXPR body.
1688 (cxx_eval_constant_expression): Handle EXIT_EXPR, improve handling
1689 of COMPOUND_EXPR.
1690
1691 PR c++/68206
1692 PR c++/68530
1693 * constexpr.c (potential_constant_expression_1): Handle LOOP_EXPR
1694 and GOTO_EXPR.
1695
1696 * pt.c (tsubst_expr): Remove shadowing declaration.
1697 (tsubst_pack_expansion): Add assert.
1698
1699 * semantics.c (add_decl_expr): Use DECL_SOURCE_LOCATION.
1700
1701 PR c++/70522
1702 * name-lookup.c (qualified_lookup_using_namespace): Look through
1703 hidden names.
1704
1705 2016-04-18 Michael Matz <matz@suse.de>
1706
1707 * class.c (build_vtable): Use SET_DECL_ALIGN and SET_TYPE_ALIGN.
1708 (layout_class_type): Ditto.
1709 (build_base_field): Use SET_DECL_ALIGN.
1710 (fixup_attribute_variants): Use SET_TYPE_ALIGN.
1711 * decl.c (duplicate_decls): Use SET_DECL_ALIGN.
1712 (record_unknown_type): Use SET_TYPE_ALIGN.
1713 (cxx_init_decl_processing): Ditto.
1714 (copy_type_enum): Ditto.
1715 (grokfndecl): Use SET_DECL_ALIGN.
1716 (copy_type_enum): Use SET_TYPE_ALIGN.
1717 * pt.c (instantiate_class_template_1): Use SET_TYPE_ALIGN.
1718 (tsubst): Ditto.
1719 * tree.c (cp_build_qualified_type_real): Use SET_TYPE_ALIGN.
1720 * lambda.c (maybe_add_lambda_conv_op): Use SET_DECL_ALIGN.
1721 * method.c (implicitly_declare_fn): Use SET_DECL_ALIGN.
1722 * rtti.c (emit_tinfo_decl): Ditto.
1723
1724 2016-04-18 Jason Merrill <jason@redhat.com>
1725
1726 PR c++/70690
1727 PR c++/70528
1728 * class.c (type_maybe_constexpr_default_constructor): New.
1729 (type_has_constexpr_default_constructor): Revert.
1730
1731 2016-04-16 Sandra Loosemore <sandra@codesourcery.com>
1732
1733 PR target/1078
1734
1735 * tree.c (cxx_attribute_table): Remove "com_interface" entry.
1736 (handle_com_interface_attribute): Delete.
1737
1738 2016-04-15 Jason Merrill <jason@redhat.com>
1739
1740 PR c++/70685
1741 * constexpr.c (get_fundef_copy): Handle null *slot.
1742
1743 PR c++/70505
1744 * pt.c (tsubst_baselink): Give the new TEMPLATE_ID_EXPR
1745 unknown_type_node, too.
1746
1747 2016-04-15 Jason Merrill <jason@redhat.com>
1748 Nathan Sidwell <nathan@acm.org>
1749
1750 PR c++/70594
1751 * constexpr.c (constexpr_call_table): Preserve in GC.
1752 (struct fundef_copy, struct fundef_copies_table_t): Delete.
1753 (fundef_copies_table): Preserve in GC. Change to pointer to
1754 tree->tree hash.
1755 (maybe_initialize_fundef_copies_table): Adjust.
1756 (get_fundef_copy): Return a TREE_LIST. Use non-inserting search.
1757 (save_fundef_copy): Adjust for a TREE_LIST.
1758 (cxx_eval_call_expression): Adjust for a fundef_copy TREE_LIST.
1759 (fini_constexpr): New.
1760 * cp-tree.h (fini_constexpr): Declare.
1761 * decl2.c (c_parse_final_cleanups): Call fini_constexpr.
1762
1763 2016-04-15 Jakub Jelinek <jakub@redhat.com>
1764
1765 PR c/70436
1766 * parser.c (cp_parser_pragma): Add IF_P argument, pass it down
1767 where needed.
1768 (cp_parser_declaration_seq_opt, cp_parser_member_specification_opt,
1769 cp_parser_objc_interstitial_code, cp_parser_omp_declare_simd,
1770 cp_parser_oacc_routine): Adjust cp_parser_pragma callers.
1771 (cp_parser_statement): Likewise. Adjust cp_parser_cilk_for caller.
1772 (cp_parser_omp_structured_block): Add IF_P argument, pass it down to
1773 cp_parser_statement.
1774 (cp_parser_oacc_data, cp_parser_oacc_host_data, cp_parser_oacc_loop,
1775 cp_parser_oacc_kernels_parallel, cp_parser_omp_critical,
1776 cp_parser_omp_simd, cp_parser_omp_for, cp_parser_omp_master,
1777 cp_parser_omp_ordered, cp_parser_omp_parallel, cp_parser_omp_single,
1778 cp_parser_omp_task, cp_parser_omp_taskgroup, cp_parser_omp_distribute,
1779 cp_parser_omp_teams, cp_parser_omp_target_data, cp_parser_omp_target,
1780 cp_parser_omp_taskloop, cp_parser_omp_construct,
1781 cp_parser_cilk_grainsize, cp_parser_cilk_simd, cp_parser_cilk_for):
1782 Add IF_P argument, pass it down where needed.
1783 (cp_parser_omp_for_loop): Likewise. Clear IF_P if nbraces.
1784 (cp_parser_omp_sections_scope): Adjust cp_parser_omp_structured_block
1785 calls.
1786
1787 2016-04-14 Jason Merrill <jason@redhat.com>
1788
1789 PR c++/70494
1790 * decl.c (cxx_maybe_build_cleanup): Handle non-decls.
1791 * typeck2.c (split_nonconstant_init_1): Use it.
1792
1793 PR c++/70528
1794 * class.c (type_has_constexpr_default_constructor): Return true
1795 for an implicitly declared constructor.
1796
1797 PR c++/70622
1798 * parser.c (cp_parser_init_declarator): Add auto_result parm.
1799 (cp_parser_simple_declaration): Pass it.
1800 (strip_declarator_types): New.
1801
1802 PR c++/70543
1803 * pt.c (value_dependent_expression_p) [VAR_DECL]: A type-dependent
1804 initializer also makes the variable value-dependent.
1805
1806 PR c++/70648
1807 * constexpr.c (cxx_eval_store_expression): Also copy
1808 CONSTRUCTOR_NO_IMPLICIT_ZERO.
1809
1810 2016-04-14 Martin Sebor <msebor@redhat.com>
1811
1812 PR c++/69517
1813 PR c++/70019
1814 PR c++/70588
1815 * cp-tree.h, decl.c, init.c, typeck2.c: Revert.
1816
1817 2016-04-14 Jason Merrill <jason@redhat.com>
1818
1819 * call.c, decl.c, error.c, cp-tree.h, decl.c: Revert empty
1820 parameter ABI change.
1821
1822 2016-04-13 Martin Sebor <msebor@redhat.com>
1823
1824 PR c++/69517
1825 PR c++/70019
1826 PR c++/70588
1827 * cp-tree.h (throw_bad_array_length, build_vla_check): Declare new
1828 functions.
1829 * decl.c (check_initializer, cp_finish_decl): Call them.
1830 (reshape_init_r): Reject incompletely braced intializer-lists
1831 for VLAs.
1832 * init.c (throw_bad_array_length, build_vla_check)
1833 (build_vla_size_check, build_vla_init_check): Define new functions.
1834 * typeck2.c (split_nonconstant_init_1): Use variably_modified_type_p()
1835 to detect a VLA.
1836 (store_init_value): Same.
1837
1838 2016-04-13 Jason Merrill <jason@redhat.com>
1839
1840 Warn about empty parameter ABI with -Wabi=9.
1841 * call.c (empty_class_msg, mark_for_abi_warning)
1842 (warn_empty_class_abi): New.
1843 (build_call_a): Use them.
1844 * decl.c (store_parm_decls): Use mark_for_abi_warning.
1845 * error.c (pp_format_to_string): New.
1846
1847 Pass empty class parameters like C.
1848 * call.c (pass_as_empty_struct, empty_class_arg): New.
1849 (type_passed_as, build_x_va_arg): Use pass_as_empty_struct.
1850 (build_call_a): Use empty_class_arg.
1851 * cp-tree.h (CPTI_EMPTY_STRUCT, empty_struct_type): New.
1852 * decl.c (cxx_init_decl_processing): Create empty_struct_type.
1853
1854 2016-04-13 Jason Merrill <jason@redhat.com>
1855
1856 PR c++/70627
1857 * decl.c (start_enum): Don't change an existing ENUM_UNDERLYING_TYPE.
1858
1859 2016-04-13 Paolo Carlini <paolo.carlini@oracle.com>
1860
1861 PR c++/70635
1862 * pt.c (resolve_typename_type): Fix typos in infinite recursion
1863 avoidance mechanism.
1864
1865 2016-04-13 Jason Merrill <jason@redhat.com>
1866
1867 PR c++/70634
1868 * pt.c (instantiation_dependent_uneval_expression_p): Split out
1869 from instantiation_dependent_expression_p.
1870 (value_dependent_expression_p): Use it for unevaluated operands.
1871 (instantiation_dependent_r): Don't check value-dependence.
1872 (instantiation_dependent_expression_p): Check
1873 value-dependence of the expression as a whole.
1874 * cp-tree.h: Declare instantiation_dependent_uneval_expression_p.
1875 * semantics.c (finish_decltype_type): Use it.
1876
1877 * constexpr.c (potential_nondependent_constant_expression): New.
1878 (potential_nondependent_static_init_expression): New.
1879 (maybe_constant_value_1, fold_non_dependent_expr)
1880 (maybe_constant_init): Use them.
1881 * pt.c (instantiate_non_dependent_expr_sfinae)
1882 (instantiate_non_dependent_or_null, convert_nontype_argument): Use
1883 them.
1884 * cp-tree.h: Declare them.
1885
1886 2016-04-13 Jakub Jelinek <jakub@redhat.com>
1887
1888 PR c++/70594
1889 * decl.c (pop_labels_1): Removed.
1890 (note_label, sort_labels): New functions.
1891 (pop_labels): During named_labels traversal, just push the slot
1892 pointers into a vector, then qsort it by DECL_UID and only then
1893 call pop_label and chain it into BLOCK_VARS.
1894
1895 2016-04-13 Jason Merrill <jason@redhat.com>
1896
1897 PR c++/70615
1898 * cp-gimplify.c (cp_genericize_r): Expand PTRMEM_CST here.
1899 (cp_gimplify_expr): Not here.
1900
1901 2016-04-12 Patrick Palka <ppalka@gcc.gnu.org>
1902
1903 PR c++/70610
1904 * tree.c (lvalue_kind) [NON_DEPENDENT_EXPR]: Unconditionally
1905 recurse into it.
1906 * typeck.c (build_x_conditional_expr): Unconditionally remember
1907 that the result is an lvalue or xvalue.
1908
1909 2016-04-12 Jason Merrill <jason@redhat.com>
1910
1911 * class.c (is_really_empty_class): A zero-length array is empty.
1912 An unnamed bit-field doesn't make a class non-empty.
1913
1914 2016-04-12 Paolo Carlini <paolo.carlini@oracle.com>
1915
1916 PR c++/68722
1917 * parser.c (cp_parser_cache_defarg): When file ends in default
1918 argument simply return error_mark_node.
1919
1920 2016-04-12 Nathan Sidwell <nathan@acm.org>
1921
1922 PR c++/70501
1923 * constexpr.c (cxx_eval_bare_aggregate): Handle VECTOR_TYPE
1924 similarly to PMF.
1925
1926 2016-04-11 Jason Merrill <jason@redhat.com>
1927
1928 * mangle.c (decl_is_template_id): The template itself counts as a
1929 template-id.
1930
1931 2016-04-08 Patrick Palka <ppalka@gcc.gnu.org>
1932
1933 PR c++/70590
1934 PR c++/70452
1935 * constexpr.c (cxx_eval_outermost_expression): Call unshare_expr
1936 on the result if it's not a CONSTRUCTOR.
1937
1938 2016-04-07 Patrick Palka <ppalka@gcc.gnu.org>
1939
1940 PR c++/70452
1941 * constexpr.c (find_constructor): New function.
1942 (unshare_constructor): New function.
1943 (cxx_eval_call_expression): Use unshare_constructor instead of
1944 unshare_expr.
1945 (find_array_ctor_elt): Likewise.
1946 (cxx_eval_vec_init_1): Likewise.
1947 (cxx_eval_store_expression): Likewise.
1948 (cxx_eval_constant_expression): Likewise.
1949
1950 2016-04-06 Patrick Palka <ppalka@gcc.gnu.org>
1951
1952 PR c/70436
1953 * cp-tree.h (FOR_EACH_CLONE): Restructure macro to avoid
1954 potentially generating a future -Wparentheses warning in its
1955 callers.
1956
1957 2016-04-06 Jason Merrill <jason@redhat.com>
1958
1959 * class.c (check_abi_tags): Fix function template handling.
1960
1961 2016-04-05 Nathan Sidwell <nathan@acm.org>
1962
1963 PR c++/70512
1964 * class.c (fixup_may_alias): New.
1965 (fixup_attribute_variants): Call it.
1966
1967 2016-04-05 Patrick Palka <ppalka@gcc.gnu.org>
1968
1969 PR c++/70452
1970 * constexpr.c (struct fundef_copy): New struct.
1971 (struct fundef_copies_table_t): New struct.
1972 (fundef_copies_table): New static variable.
1973 (maybe_initialize_fundef_copies_table): New static function.
1974 (get_fundef_copy): New static function.
1975 (save_fundef_copy): New static function.
1976 (cxx_eval_call_expression): Use get_fundef_copy, and
1977 save_fundef_copy.
1978 (constexpr_call_table): Add "deletable" GTY marker.
1979
1980 2016-04-05 Patrick Palka <ppalka@gcc.gnu.org>
1981
1982 PR c++/70452
1983 * cp-tree.h (class cache_map): Remove.
1984 * constexpr.c (cv_cache): Change type to
1985 GTY((deletable)) hash_map<tree, tree> *.
1986 (maybe_constant_value): Adjust following the change to cv_cache.
1987 (clear_cv_cache): New static function.
1988 (clear_cv_and_fold_caches): Use it.
1989 * cp-gimplify.c (fold_cache): Change type to
1990 GTY((deletable)) hash_map<tree, tree> *.
1991 (clear_fold_cache): Adjust following the change to fold_cache.
1992 (cp_fold): Likewise.
1993
1994 2016-04-02 Martin Sebor <msebor@redhat.com>
1995
1996 PR c++/67376
1997 PR c++/70170
1998 PR c++/70172
1999 PR c++/70228
2000 * constexpr.c (diag_array_subscript): New function.
2001 (cxx_eval_array_reference): Detect out of bounds array indices.
2002
2003 2016-04-01 Jason Merrill <jason@redhat.com>
2004
2005 PR c++/70449
2006 PR c++/70344
2007 * pt.c (instantiate_decl): A function isn't fully defined if
2008 DECL_INITIAL is error_mark_node.
2009 * constexpr.c (cxx_eval_call_expression): Likewise.
2010
2011 2016-04-01 Jakub Jelinek <jakub@redhat.com>
2012 Marek Polacek <polacek@redhat.com>
2013
2014 PR c++/70488
2015 * init.c (warn_placement_new_too_small): Test whether
2016 DECL_SIZE_UNIT or TYPE_SIZE_UNIT are integers that fit into uhwi.
2017
2018 2016-04-01 Nathan Sidwell <nathan@acm.org>
2019
2020 PR c++/68475
2021 * decl.c (check_redeclaration_exception_specification): Check
2022 regardless of -fno-exceptions.
2023 * typeck2.c (merge_exception_specifiers): Relax assert by checking
2024 flag_exceptions too.
2025
2026 2016-03-31 Nathan Sidwell <nathan@acm.org>
2027
2028 * decl.c (start_preparsed_function): Remove unnecessary bracing.
2029 (finish_destructor_body): Don't emit operator delete here.
2030
2031 2016-03-31 Nathan Sidwell <nathan@acm.org>
2032
2033 PR c++/70393
2034 * constexpr.c (cxx_eval_store_expression): Keep CONSTRUCTOR
2035 elements in field order.
2036
2037 2016-03-31 Marek Polacek <polacek@redhat.com>
2038
2039 PR c/70297
2040 * decl.c (duplicate_decls): Also set TYPE_ALIGN and TYPE_USER_ALIGN.
2041
2042 2016-03-31 Richard Biener <rguenther@suse.de>
2043
2044 PR c++/70430
2045 * typeck.c (cp_build_binary_op): Fix operand order of vector
2046 conditional in truth op handling.
2047
2048 2016-03-29 Jason Merrill <jason@redhat.com>
2049
2050 PR c++/70353
2051 * decl.c (make_rtl_for_nonlocal_decl): Don't defer local statics
2052 in constexpr functions.
2053
2054 2016-03-28 Jason Merrill <jason@redhat.com>
2055
2056 PR c++/70422
2057 PR c++/64266
2058 PR c++/70353
2059 * decl.c, pt.c, constexpr.c: Revert last patch.
2060
2061 2016-03-25 Jason Merrill <jason@redhat.com>
2062 Martin Liška <mliska@suse.cz>
2063
2064 PR c++/64266
2065 PR c++/70353
2066 Core issue 1962
2067 * decl.c (cp_fname_init): Decay the initializer to pointer.
2068 (cp_make_fname_decl): Set DECL_DECLARED_CONSTEXPR_P,
2069 DECL_VALUE_EXPR, DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
2070 Don't call cp_finish_decl.
2071 * pt.c (tsubst_expr) [DECL_EXPR]: Set DECL_VALUE_EXPR,
2072 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P. Don't call cp_finish_decl.
2073 * constexpr.c (cxx_eval_constant_expression) [VAR_DECL]:
2074 Handle DECL_VALUE_EXPR.
2075
2076 2016-03-24 Jason Merrill <jason@redhat.com>
2077
2078 PR c++/70386
2079 * constexpr.c (cxx_eval_bare_aggregate): Handle PMFs.
2080
2081 PR c++/70323
2082 * constexpr.c (cxx_eval_call_expression): Don't cache result if
2083 *overflow_p.
2084
2085 2016-03-24 Patrick Palka <ppalka@gcc.gnu.org>
2086
2087 PR c++/62212
2088 * tree.c (build_cplus_array_type): Determine type-dependentess
2089 with uses_template_parms instead of with dependent_type_p.
2090
2091 2016-03-23 Patrick Palka <ppalka@gcc.gnu.org>
2092
2093 PR c++/70347
2094 * typeck.c (process_init_constructor_union): If the initializer
2095 is empty, use the union's NSDMI if it has one.
2096
2097 2016-03-23 Patrick Palka <ppalka@gcc.gnu.org>
2098
2099 PR c++/70332
2100 * pt.c (tsubst_copy) [PARM_DECL]: Handle the use of 'this' in an
2101 NSDMI that's part of an aggregrate initialization.
2102
2103 2016-03-23 Jakub Jelinek <jakub@redhat.com>
2104
2105 PR c++/70001
2106 * constexpr.c (cxx_eval_vec_init_1): Reuse CONSTRUCTOR initializers
2107 for 1..max even for multi-dimensional arrays. Call unshare_expr
2108 on it.
2109
2110 PR c++/70323
2111 * constexpr.c (cxx_eval_constant_expression): Diagnose overflow
2112 on TREE_OVERFLOW constants.
2113
2114 PR c++/70376
2115 * cp-gimplify.c (genericize_omp_for_stmt): Don't walk OMP_FOR_CLAUSES
2116 for OMP_TASKLOOP here.
2117 (cp_genericize_r): Handle OMP_TASKLOOP like OMP_TASK, except do call
2118 genericize_omp_for_stmt instead of cp_walk_tree on OMP_BODY.
2119
2120 2016-03-23 Alexandre Oliva <aoliva@redhat.com>
2121 Jason Merrill <jason@redhat.com>
2122 Jakub Jelinek <jakub@redhat.com>
2123
2124 PR c++/69315
2125 * cp-tree.h (defer_mark_used_calls, deferred_mark_used_calls): Remove.
2126 * decl.c (defer_mark_used_calls, deferred_mark_used_calls): Remove.
2127 (finish_function): Don't set or test them.
2128 * decl2.c (mark_used): Don't handle defer_mark_used_calls.
2129
2130 2016-03-23 Jason Merrill <jason@redhat.com>
2131
2132 PR c++/70344
2133 * constexpr.c (cxx_eval_call_expression): Catch invalid recursion.
2134
2135 2016-03-23 Marek Polacek <polacek@redhat.com>
2136
2137 PR c++/69884
2138 * pt.c (canonicalize_type_argument): Use OPT_Wignored_attributes.
2139
2140 2016-03-22 Ilya Enkovich <enkovich.gnu@gmail.com>
2141
2142 * call.c (build_conditional_expr_1): Always use original
2143 condition type for vector type checks and build.
2144
2145 2016-03-22 Patrick Palka <ppalka@gcc.gnu.org>
2146
2147 PR c++/70096
2148 * pt.c (tsubst_decl): Clear the DECL_MODE of the new decl.
2149
2150 2016-03-22 Patrick Palka <ppalka@gcc.gnu.org>
2151
2152 PR c++/70204
2153 * constexpr.c (non_const_var_error): Check
2154 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
2155
2156 2016-03-21 Richard Henderson <rth@redhat.com>
2157
2158 PR c++/70273
2159 * decl.c (notice_forced_label_r): New.
2160 (cp_finish_decl): Use it.
2161
2162 2016-03-21 Jason Merrill <jason@redhat.com>
2163
2164 PR c++/70285
2165 * cp-gimplify.c (cp_fold) [COND_EXPR]: Handle bit-fields.
2166
2167 2016-03-18 Jason Merrill <jason@redhat.com>
2168
2169 PR c++/70139
2170 * constexpr.c (cxx_eval_call_expression): Fix trivial copy.
2171
2172 PR c++/70147
2173 * class.c (vptr_via_virtual_p): New.
2174 (most_primary_binfo): Factor out of build_rtti_vtbl_entries.
2175 * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs): Don't clear
2176 a vptr from any virtual base in a not-in-charge 'structor.
2177
2178 * decl.c (build_clobber_this): Factor out of
2179 start_preparsed_function and begin_destructor_body. Handle
2180 virtual bases better.
2181
2182 * class.c (build_if_in_charge): Split out from build_base_path.
2183 * init.c (expand_virtual_init, expand_default_init): Use it.
2184 * call.c (build_special_member_call): Use it.
2185
2186 2016-03-18 Jakub Jelinek <jakub@redhat.com>
2187
2188 PR c++/70267
2189 * init.c (build_new_1): Complain and return error_mark_node
2190 if alloc_fn is not _Jv_AllocObject function returning pointer.
2191
2192 2016-03-18 Patrick Palka <ppalka@gcc.gnu.org>
2193
2194 PR c++/70205
2195 * search.c (adjust_result_of_qualified_name_lookup): Don't
2196 update the BASELINK_BINFO of DECL if the second call
2197 to lookup_base fails.
2198
2199 2016-03-18 Patrick Palka <ppalka@gcc.gnu.org>
2200
2201 PR c++/70218
2202 * parser.c (cp_parser_lambda_expression): Move call to
2203 pop_deferring_access_checks ahead of the call to
2204 cp_parser_end_tentative_firewall.
2205
2206 2016-03-17 Jakub Jelinek <jakub@redhat.com>
2207
2208 PR c++/70144
2209 * cp-tree.h (magic_varargs_p): Return int instead of bool.
2210 * call.c (magic_varargs_p): Return int instead of bool, return 2 for
2211 Cilk+ reductions, otherwise 1 for magic varargs and 0 for normal
2212 varargs.
2213 (build_over_call): If magic_varargs_p == 2, call reject_gcc_builtin,
2214 if magic_varargs_p == 1, call decay_conversion
2215 instead of mark_type_use. Don't store error_mark_node arguments to
2216 argarray, instead return error_mark_node.
2217
2218 PR c++/70272
2219 * decl.c (begin_destructor_body): Don't insert clobber if
2220 is_empty_class (current_class_type).
2221
2222 2016-03-17 Marek Polacek <polacek@redhat.com>
2223
2224 PR c++/70194
2225 * typeck.c (warn_for_null_address): New function.
2226 (cp_build_binary_op): Call it.
2227
2228 2016-03-16 Jason Merrill <jason@redhat.com>
2229
2230 PR c++/70259
2231 * decl.c (start_preparsed_function): Don't clobber an empty base.
2232
2233 2016-03-16 Jakub Jelinek <jakub@redhat.com>
2234
2235 PR c++/70147
2236 * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs): Conditionalize
2237 BINFO_VIRTUAL_P vtable clearing on current_in_charge_parm.
2238
2239 PR c++/70147
2240 * cp-ubsan.c (cp_ubsan_maybe_initialize_vtbl_ptrs): Temporarily
2241 set in_base_initializer.
2242
2243 2016-03-15 Marek Polacek <polacek@redhat.com>
2244
2245 PR c++/70209
2246 * tree.c (strip_typedefs): Call strip_typedefs again on the
2247 DECL_ORIGINAL_TYPE result.
2248
2249 2016-03-15 Jason Merrill <jason@redhat.com>
2250
2251 PR c++/70095
2252 * pt.c (instantiate_decl): Fix call to variable_template_p.
2253
2254 PR c++/70141
2255 * pt.c (for_each_template_parm_r): Always walk into TYPENAME_TYPE.
2256
2257 2016-03-14 Casey Carter <casey@carter.net>
2258 Jason Merrill <jason@redhat.com>
2259
2260 P0184R0: Generalizing the Range-Based For Loop
2261 * parser.c (cp_convert_range_for): Set the type of __end separately.
2262 (cp_parser_perform_range_for_lookup): Allow different begin/end
2263 types if they are comparable.
2264
2265 2016-03-12 Patrick Palka <ppalka@gcc.gnu.org>
2266
2267 PR c++/70106
2268 * semantics.c (force_paren_expr): Just build a PAREN_EXPR when
2269 processing_template_decl and EXPR is a SCOPE_REF.
2270
2271 2016-03-10 Patrick Palka <ppalka@gcc.gnu.org>
2272 Jakub Jelinek <jakub@redhat.com>
2273
2274 PR c++/70001
2275 * constexpr.c (cxx_eval_vec_init_1): For pre_init case, reuse
2276 return value from cxx_eval_constant_expression from earlier
2277 elements if it is valid constant initializer requiring no
2278 relocations.
2279
2280 2016-03-10 Marek Polacek <polacek@redhat.com>
2281
2282 PR c++/70153
2283 * cp-gimplify.c (cp_fold): Handle UNARY_PLUS_EXPR.
2284
2285 2016-03-09 Cesar Philippidis <cesar@codesourcery.com>
2286
2287 * parser.c (cp_parser_oacc_loop): Update cclauses and clauses
2288 when calling c_finish_omp_clauses.
2289
2290 2016-03-08 Jason Merrill <jason@redhat.com>
2291
2292 * parser.c (cp_parser_diagnose_invalid_type_name): Give helpful
2293 diagnostic for use of "concept".
2294 (cp_parser_requires_clause_opt): And "requires".
2295 (cp_parser_type_parameter, cp_parser_late_return_type_opt)
2296 (cp_parser_explicit_template_declaration): Adjust.
2297 * Make-lang.in (check-c++-all): Add "concepts" to std list.
2298
2299 P0036R0: Unary Folds and Empty Parameter Packs
2300 * pt.c (expand_empty_fold): Remove special cases for *,+,&,|.
2301
2302 2016-03-08 Jakub Jelinek <jakub@redhat.com>
2303
2304 PR c++/70135
2305 * constexpr.c (cxx_eval_loop_expr): Forget saved values of SAVE_EXPRs
2306 even after the last iteration of the loop.
2307
2308 * decl.c (duplicate_decls): Fix spelling - becuase -> because.
2309
2310 2016-03-07 Patrick Palka <ppalka@gcc.gnu.org>
2311
2312 PR c++/66786
2313 * pt.c (get_template_info): Handle PARM_DECL.
2314 (template_class_depth): Check DECL_P instead of
2315 VAR_OR_FUNCTION_DECL_P.
2316
2317 2016-03-05 Jason Merrill <jason@redhat.com>
2318
2319 PR c++/67364
2320 * constexpr.c (cxx_eval_store_expression): Replace
2321 CONSTRUCTOR_ELTS in nested CONSTRUCTORs, too.
2322
2323 2016-03-05 Patrick Palka <ppalka@gcc.gnu.org>
2324
2325 PR c++/66786
2326 * pt.c (template_class_depth): Given a lambda type, iterate
2327 into its LAMBDA_TYPE_EXTRA_SCOPE field instead of its
2328 TYPE_CONTEXT. Given a VAR_DECL, iterate into its
2329 CP_DECL_CONTEXT.
2330
2331 2016-03-04 Jason Merrill <jason@redhat.com>
2332
2333 PR c++/69203
2334 * cp-tree.h (COND_EXPR_IS_VEC_DELETE): New.
2335 * init.c (build_vec_delete_1): Set it.
2336 * constexpr.c (potential_constant_expression_1) [COND_EXPR]: Check it.
2337
2338 2016-03-04 Jakub Jelinek <jakub@redhat.com>
2339
2340 * decl.c (start_preparsed_function): Don't emit start clobber at the
2341 start of constructor clones.
2342
2343 PR c++/70035
2344 * cp-tree.h (cp_ubsan_maybe_initialize_vtbl_ptrs): New prototype.
2345 * decl.c (start_preparsed_function): Call
2346 cp_ubsan_maybe_initialize_vtbl_ptrs if needed.
2347 * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs,
2348 cp_ubsan_maybe_initialize_vtbl_ptrs): New functions.
2349
2350 2016-03-04 Jason Merrill <jason@redhat.com>
2351
2352 PR c++/67364
2353 * constexpr.c (cxx_eval_component_reference): Further tweak.
2354
2355 * constexpr.c (struct constexpr_ctx): Add save_exprs field.
2356 (cxx_eval_loop_expr): Discard SAVE_EXPR values before looping.
2357 (cxx_eval_constant_expression) [SAVE_EXPR]: Add it to the set.
2358 (cxx_eval_outermost_constant_expr, is_sub_constant_expr): Initialize.
2359
2360 PR c++/70067
2361 * tree.c (strip_typedefs): Handle TYPENAME_TYPE lookup finding the
2362 same type.
2363
2364 2016-03-03 Jason Merrill <jason@redhat.com>
2365
2366 * method.c (synthesized_method_walk): operator= can also be constexpr.
2367
2368 * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Get
2369 LAMBDA_EXPR_RETURN_TYPE from the instantiated closure.
2370
2371 PR c++/67164
2372 * pt.c (copy_template_args): New.
2373 (tsubst_pack_expansion): Use it.
2374
2375 * call.c (build_aggr_conv): Use get_nsdmi.
2376
2377 PR c++/51406
2378 * typeck.c (build_static_cast_1): Avoid folding back to lvalue.
2379
2380 PR c++/67364
2381 * constexpr.c (cxx_eval_component_reference): Just return an empty
2382 CONSTRUCTOR for an empty class.
2383
2384 2016-03-01 Jason Merrill <jason@redhat.com>
2385
2386 PR c++/70036
2387 * parser.c (cp_parser_requires_clause): Call
2388 check_for_bare_parameter_packs.
2389
2390 PR c++/51489
2391 * constexpr.c (cxx_eval_binary_expression): Don't VERIFY_CONSTANT
2392 the operands.
2393
2394 PR c++/69995
2395 * constexpr.c (cxx_eval_call_expression): Unshare arg.
2396 (cxx_eval_constant_expression) [DECL_EXPR]: Unshare init.
2397 [TARGET_EXPR]: Unshare init.
2398
2399 2016-03-01 Patrick Palka <ppalka@gcc.gnu.org>
2400
2401 PR c++/68948
2402 PR c++/69961
2403 * pt.c (tsubst_baselink): Reinstate the check for an invalid
2404 constructor call.
2405
2406 2016-02-28 Jason Merrill <jason@redhat.com>
2407
2408 PR c++/69995
2409 * constexpr.c (cxx_eval_store_expression): Unshare init.
2410
2411 2016-02-26 Jason Merrill <jason@redhat.com>
2412
2413 PR c++/69958
2414 * pt.c (make_argument_pack): New.
2415 (tsubst_copy) [SIZEOF_EXPR]: Handle partial expansion.
2416 (tsubst_copy_and_build): Likewise.
2417
2418 2016-02-25 Jason Merrill <jason@redhat.com>
2419
2420 PR c++/69889
2421 * cp-tree.h (AGGR_INIT_FROM_THUNK_P): New.
2422 * tree.c (build_aggr_init_expr): Set it.
2423 * semantics.c (simplify_aggr_init_expr): Check it.
2424 * cp-gimplify.c (cp_genericize_r): Don't walk into
2425 a call/aggr_init from a thunk.
2426
2427 PR c++/69842
2428 * method.c (forward_parm): Handle parameter packs.
2429 * lambda.c (maybe_add_lambda_conv_op): Use it for them.
2430
2431 PR c++/67364
2432 * constexpr.c (cxx_eval_component_reference): Don't complain about
2433 unevaluated empty classes.
2434
2435 PR c++/68049
2436 * tree.c (strip_typedefs): Use DECL_ORIGINAL_TYPE.
2437
2438 2016-02-25 Patrick Palka <ppalka@gcc.gnu.org>
2439
2440 PR c++/69736
2441 * cp-tree.h (REF_PARENTHESIZED_P): Adjust documentation.
2442 (maybe_undo_parenthesized_ref): Declare.
2443 * semantics.c (maybe_undo_parenthesized_ref): Split out from
2444 check_return_expr.
2445 (finish_call_expr): Use it.
2446 * typeck.c (check_return_expr): Use it.
2447 * pt.c (tsubst_copy_and_build) [INDIRECT_REF]: Retain the
2448 REF_PARENTHESIZED_P flag.
2449
2450 2016-02-24 Jakub Jelinek <jakub@redhat.com>
2451
2452 PR c++/69922
2453 * class.c (build_base_path): Set TREE_NO_WARNING on the null_test.
2454 Avoid folding it.
2455 * init.c (build_vec_delete_1, build_delete): Don't fold the non-NULL
2456 tests.
2457 * cp-gimplify.c (cp_fold): For TREE_NO_WARNING comparisons with NULL,
2458 unless they are folded into INTEGER_CST, error_mark_node or some
2459 comparison with NULL, avoid folding them and use either the original
2460 comparison or non-folded comparison of folded arguments.
2461 * cp-ubsan.c (cp_ubsan_instrument_vptr): Set TREE_NO_WARNING on the
2462 comparison, don't fold the comparison right away.
2463
2464 2016-02-24 Jason Merrill <jason@redhat.com>
2465
2466 PR c++/69323
2467 * friend.c (make_friend_class): Likewise.
2468 * decl.c (lookup_and_check_tag): Diagnose invalid dependent friend.
2469
2470 2016-02-24 Jason Merrill <jason@redhat.com>
2471
2472 PR c++/69323
2473 * pt.c (instantiate_class_template_1): Set
2474 processing_template_decl before substituting friend_type.
2475
2476 016-02-24 Martin Sebor <msebor@redhat.com>
2477
2478 PR c++/69912
2479 * tree.c (build_ctor_subob_ref): Compare types' main variants
2480 instead of the types as they are.
2481
2482 2016-02-24 Jason Merrill <jason@redhat.com>
2483
2484 * decl.c (start_preparsed_function): Condition ctor clobber on
2485 flag_lifetime_dse > 1.
2486
2487 * cp-gimplify.c (cp_fold): Don't fold constexpr calls if -fno-inline.
2488
2489 2016-02-19 Jason Merrill <jason@redhat.com>
2490
2491 PR c++/69743
2492 * call.c (remaining_arguments): No longer static.
2493 * cp-tree.h: Declare it.
2494 * pt.c (more_specialized_fn): Use it.
2495
2496 2016-02-19 Jakub Jelinek <jakub@redhat.com>
2497 Bernd Edlinger <bernd.edlinger@hotmail.de>
2498
2499 * Make-lang.in: Invoke gperf with -L C++.
2500 * cfns.gperf: Remove prototypes for hash and libc_name_p
2501 inlines.
2502 * cfns.h: Regenerated.
2503 * except.c (nothrow_libfn_p): Adjust.
2504
2505 2016-02-19 Jakub Jelinek <jakub@redhat.com>
2506
2507 PR c++/69850
2508 * rtti.c (ifnonnull): Set TREE_NO_WARNING on the condition, use
2509 NE_EXPR instead of EQ_EXPR and swap last two arguments on COND_EXPR.
2510
2511 2016-02-19 Patrick Palka <ppalka@gcc.gnu.org>
2512
2513 PR c++/68948
2514 * pt.c (tsubst_baselink): Don't diagnose an invalid constructor
2515 call here.
2516 * semantics.c (finish_call_expr): Don't assume a constructor
2517 call is dependent if only the "this" pointer is dependent. When
2518 building a constructor call, always use a dummy object.
2519
2520 2016-02-19 Jakub Jelinek <jakub@redhat.com>
2521
2522 PR c++/69850
2523 * init.c (build_vec_delete_1): Set TREE_NO_WARNING on the NE_EXPR
2524 condition.
2525 * cp-gimplify.c (cp_fold): Propagate TREE_NO_WARNING from binary
2526 operators if folding preserved the binop, just with different
2527 arguments.
2528
2529 PR c++/67767
2530 * parser.c (cp_parser_std_attribute_spec_seq): Don't assume
2531 attr_spec is always single element chain, chain all the attributes
2532 properly together in the right order.
2533
2534 2016-02-18 Jason Merrill <jason@redhat.com>
2535
2536 * mangle.c (maybe_check_abi_tags): Add for_decl parm. Call
2537 mangle_decl.
2538 (mangle_decl): Call maybe_check_abi_tags for function scope.
2539 (mangle_guard_variable): Call maybe_check_abi_tags here.
2540 (write_guarded_var_name): Not here.
2541
2542 2016-02-17 Jason Merrill <jason@redhat.com>
2543
2544 PR c++/65985
2545 * constexpr.c (build_constexpr_constructor_member_initializers):
2546 Handle an additional STATEMENT_LIST.
2547
2548 PR c++/68585
2549 * constexpr.c (cxx_eval_bare_aggregate): Fix 'changed' detection.
2550
2551 PR c++/68679
2552 * decl2.c (reset_type_linkage_2): Look through member templates.
2553
2554 2016-02-17 Jakub Jelinek <jakub@redhat.com>
2555
2556 PR c++/69850
2557 * init.c (build_delete): Set TREE_NO_WARNING on ifexp.
2558
2559 2016-02-17 Jason Merrill <jason@redhat.com>
2560
2561 PR c++/69842
2562 * method.c (forward_parm): Split out from...
2563 (add_one_base_init): ...here.
2564 * lambda.c (maybe_add_lambda_conv_op): Use it.
2565
2566 2016-02-16 Jason Merrill <jason@redhat.com>
2567
2568 PR c++/10200
2569 PR c++/69753
2570 * call.c, cp-tree.h, name-lookup.c, pt.c, search.c, semantics.c,
2571 tree.c, typeck2.c: Revert earlier changes.
2572 * parser.c (cp_parser_lookup_name): Ignore namespace-scope
2573 non-type templates after -> or .
2574
2575 2016-02-16 Jakub Jelinek <jakub@redhat.com>
2576
2577 PR c/69835
2578 * typeck.c (cp_build_binary_op): Revert 2015-09-09 change.
2579
2580 2016-02-16 Jason Merrill <jason@redhat.com>
2581
2582 PR c++/69657
2583 * name-lookup.c (lookup_qualified_name): Add find_hidden parm.
2584 (set_decl_namespace): Pass it. Complain about finding a hidden friend.
2585 * name-lookup.h: Adjust.
2586
2587 2016-02-16 James Norris <jnorris@codesourcery.com>
2588
2589 * parser.c (cp_parser_oacc_data_clause_deviceptr): Remove checking.
2590 * semantics.c (finish_omp_clauses): Add deviceptr checking.
2591
2592 2016-02-15 Jakub Jelinek <jakub@redhat.com>
2593
2594 PR c++/69658
2595 * init.c (expand_default_init): Only call reshape_init
2596 in the direct-initialization from an initializer list case.
2597
2598 2016-02-15 Jason Merrill <jason@redhat.com>
2599
2600 PR c++/69753
2601 * semantics.c (finish_call_expr): Implicit 'this' does not make
2602 the call dependent.
2603 * search.c (any_dependent_bases_p): Split out...
2604 * name-lookup.c (do_class_using_decl): ...from here.
2605 * call.c (build_new_method_call_1): Don't complain about missing object
2606 if there are dependent bases. Tweak error.
2607 * tree.c (non_static_member_function_p): Remove.
2608 * pt.c (type_dependent_expression_p): A member template of a
2609 dependent type is dependent.
2610 * cp-tree.h: Adjust.
2611
2612 PR c++/68890
2613 * constexpr.c (verify_ctor_sanity): Remove CONSTRUCTOR_NELTS check.
2614
2615 2016-02-12 Patrick Palka <ppalka@gcc.gnu.org>
2616
2617 PR c++/69098
2618 * pt.c (lookup_and_finish_template_variable): New function,
2619 extracted from ...
2620 (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: ... here. Use it.
2621 (tsubst_qualified_id): Consider that EXPR might be a variable
2622 template.
2623 * typeck.c (check_template_keyword): Don't emit an error
2624 if DECL is a variable template.
2625
2626 2016-02-12 Jakub Jelinek <jakub@redhat.com>
2627
2628 * error.c: Spelling fixes - behaviour -> behavior and
2629 neighbour -> neighbor.
2630 * decl.c: Likewise.
2631 * typeck.c (cp_build_binary_op): Fix up behavior spelling in
2632 diagnostics.
2633 * init.c (build_delete): Likewise.
2634
2635 2016-02-11 Jakub Jelinek <jakub@redhat.com>
2636
2637 PR c/69768
2638 * typeck.c (cp_build_binary_op): cp_fully_fold integer_zerop
2639 arguments for -Waddress warning. Fix up formatting.
2640
2641 2016-02-11 Paolo Carlini <paolo.carlini@oracle.com>
2642
2643 PR c++/68726
2644 * pt.c (lookup_template_class_1): Check tsubst return value for
2645 error_mark_node.
2646
2647 2016-02-10 Jason Merrill <jason@redhat.com>
2648
2649 PR c++/68926
2650 * pt.c (resolve_nondeduced_context): Add complain parm.
2651 (do_auto_deduction): Pass it.
2652 * cvt.c (convert_to_void): Likewise.
2653 * decl.c (cp_finish_decl): Likewise.
2654 * init.c (build_new): Likewise.
2655 * rtti.c (get_tinfo_decl_dynamic): Likewise.
2656 * semantics.c (finish_decltype_type): Likewise.
2657 * typeck.c (decay_conversion): Likewise.
2658 * cp-tree.h: Adjust declaration.
2659 * call.c (standard_conversion): Add complain parm, pass it along.
2660 (implicit_conversion): Pass it.
2661
2662 PR c++/69657
2663 * name-lookup.c (ambiguous_decl): Call remove_hidden_names.
2664 (lookup_name_real_1): Likewise.
2665 (remove_hidden_names): Handle non-functions too.
2666
2667 PR c++/10200
2668 * parser.c (cp_parser_lookup_name): When looking for a template
2669 after . or ->, only consider class templates.
2670 (cp_parser_postfix_dot_deref_expression): Handle the current
2671 instantiation. Remember a dependent object expression.
2672 * typeck2.c (build_x_arrow): Handle the current instantiation.
2673
2674 * ptree.c (debug_tree): Implement for cp_expr.
2675
2676 2016-02-08 Patrick Palka <ppalka@gcc.gnu.org>
2677
2678 PR c++/69139
2679 * parser.c (cp_parser_simple_type_specifier): Make the check
2680 for disambiguating between an 'auto' placeholder and an implicit
2681 template parameter more robust.
2682
2683 2016-02-08 Patrick Palka <ppalka@gcc.gnu.org>
2684
2685 PR c++/69283
2686 PR c++/67835
2687 * decl2.c (mark_used): When given a TEMPLATE_DECL, return after
2688 setting its TREE_USED flag.
2689
2690 2016-02-08 Jason Merrill <jason@redhat.com>
2691
2692 PR c++/69657
2693 * name-lookup.c (do_nonmember_using_decl): Leave anticipated
2694 built-ins alone.
2695
2696 2016-02-08 Jakub Jelinek <jakub@redhat.com>
2697
2698 PR c++/59627
2699 * parser.c (cp_parser_omp_declare_reduction): Set assembler name
2700 of the DECL_OMP_DECLARE_REDUCTION_P decls.
2701
2702 2016-02-08 Marek Polacek <polacek@redhat.com>
2703
2704 PR c++/69688
2705 * constexpr.c (clear_cv_and_fold_caches): Renamed from clear_cv_cache.
2706 Call clear_fold_cache.
2707 * cp-tree.h: Adjust declaration.
2708 * decl.c (finish_enum_value_list): Call clear_cv_and_fold_caches
2709 rather than clear_cv_cache and clear_fold_cache.
2710 * typeck2.c (store_init_value): Call clear_cv_and_fold_caches.
2711
2712 2016-02-08 Jason Merrill <jason@redhat.com>
2713
2714 * cp-tree.h (CONV_FOLD, CONV_BACKEND_CONVERT): New.
2715 * cvt.c (convert): Pass CONV_BACKEND_CONVERT.
2716 (ocp_convert): Use *_maybe_fold.
2717 (cp_convert_to_pointer): Add dofold parameter.
2718 * cp-gimplify.c (cp_fold) [CONVERT_EXPR]: Call convert.
2719
2720 2016-02-05 Martin Sebor <msebor@redhat.com>
2721
2722 PR c++/69662
2723 * init.c (find_field_init): New function.
2724 (warn_placement_new_too_small): Call it. Handle one-element arrays
2725 at ends of structures special.
2726
2727 2016-02-05 Jason Merrill <jason@redhat.com>
2728
2729 PR c++/68948
2730 * semantics.c (finish_expr_stmt): If expr is error_mark_node,
2731 make sure we've seen_error().
2732
2733 2016-02-05 Patrick Palka <ppalka@gcc.gnu.org>
2734
2735 PR c++/68948
2736 * pt.c (tsubst_baselink): Diagnose an invalid constructor call
2737 if lookup_fnfields returns NULL_TREE and the name being looked
2738 up has the form A::A.
2739
2740 2016-02-04 Patrick Palka <ppalka@gcc.gnu.org>
2741
2742 * constexpr.c (cxx_eval_binary_expression): Fold equality
2743 comparisons involving PTRMEM_CSTs.
2744
2745 2016-02-04 Jakub Jelinek <jakub@redhat.com>
2746
2747 * class.c (find_flexarrays): Don't declare dom variable.
2748 (diagnose_flexarray): Likewise.
2749
2750 2016-02-02 Martain Sebor <msebor@redhat.com>
2751
2752 PR c++/69251
2753 PR c++/69253
2754 PR c++/69290
2755 PR c++/69277
2756 PR c++/69349
2757 * class.c (walk_subobject_offsets): Avoid testing the upper bound
2758 of a flexible array member for equality to null.
2759 (find_flexarrays): Remove spurious whitespace introduced in r231665.
2760 (diagnose_flexarrays): Avoid checking the upper bound of arrays.
2761 (check_flexarrays): Same.
2762 * decl.c (compute_array_index_type): Avoid special case for flexible
2763 array members.
2764 (grokdeclarator): Avoid calling compute_array_index_type for flexible
2765 array members.
2766 * error.c (dump_type_suffix): Revert changes introduced in r231665
2767 and rendered unnecessary by the changes above.
2768 * pt.c (tsubst): Same.
2769 * tree.c (build_ctor_subob_ref): Handle flexible array members.
2770 * typeck2.c (digest_init_r): Revert changes introduced in r231665.
2771 (process_init_constructor_array): Same.
2772 (process_init_constructor_record): Same.
2773
2774 2016-02-03 Patrick Palka <ppalka@gcc.gnu.org>
2775
2776 PR c++/69056
2777 * pt.c (try_one_overload): Handle comparing argument packs so
2778 that there is no conflict if we deduced more arguments of an
2779 argument pack than were explicitly specified.
2780
2781 2016-01-31 Jakub Jelinek <jakub@redhat.com>
2782 Jason Merrill <jason@redhat.com>
2783
2784 PR c++/68763
2785 * tree.c (strip_typedefs) [FUNCTION_TYPE]: Avoid building a new
2786 function type if nothing is changing.
2787
2788 2016-01-31 Jason Merrill <jason@redhat.com>
2789
2790 PR c++/69009
2791 * pt.c (partial_specialization_p, impartial_args): New.
2792 (instantiate_decl): Call impartial_args.
2793
2794 * mangle.c (maybe_check_abi_tags): New.
2795 (write_guarded_var_name): Call it.
2796 (mangle_ref_init_variable): Call check_abi_tags.
2797
2798 * pt.c (lookup_template_class_1): Don't share TYPE_ATTRIBUTES
2799 between template and instantiation.
2800
2801 2016-01-29 Jakub Jelinek <jakub@redhat.com>
2802
2803 PR debug/66869
2804 * decl.c (wrapup_globals_for_namespace): Warn about unused static
2805 function declarations.
2806
2807 2016-01-29 Marek Polacek <polacek@redhat.com>
2808
2809 PR c++/69509
2810 PR c++/69516
2811 * constexpr.c (cxx_eval_array_reference): Give the "array subscript
2812 out of bound" error earlier.
2813 * init.c (build_vec_init): Change NE_EXPR into GT_EXPR. Update the
2814 commentary.
2815
2816 2016-01-29 Patrick Palka <ppalka@gcc.gnu.org>
2817
2818 * name-lookup.c (begin_scope): After reusing a cp_binding_level
2819 structure, update free_binding_level before the structure's
2820 level_chain field gets cleared, not after.
2821
2822 2016-01-28 Jason Merrill <jason@redhat.com>
2823
2824 PR c++/67407
2825 * search.c (dfs_walk_once, dfs_walk_once_r)
2826 (dfs_walk_once_accessible_r, dfs_walk_once_accessible): Use
2827 hash_set instead of BINFO_MARKED.
2828 (dfs_unmark_r): Remove.
2829
2830 2016-01-28 Patrick Palka <ppalka@gcc.gnu.org>
2831
2832 PR c++/24208
2833 * parser.c (LEXER_DEBUGGING_ENABLED_P): New macro.
2834 (cp_lexer_debugging_p): Use it.
2835 (cp_lexer_start_debugging): Likewise.
2836 (cp_lexer_stop_debugging): Likewise.
2837
2838 2016-01-27 Marek Polacek <polacek@redhat.com>
2839
2840 PR c/68062
2841 * typeck.c (cp_build_binary_op): Promote operand to unsigned, if
2842 needed. Add -Wsign-compare warning.
2843
2844 2016-01-27 Ryan Burn <contact@rnburn.com>
2845
2846 PR cilkplus/69267
2847 * cp-gimplify.c (cilk_cp_gimplify_call_params_in_spawned_fn): Removed
2848 superfluous post_p argument in call to
2849 cilk_gimplify_call_params_in_spawned_fn.
2850
2851 2016-01-27 Marek Polacek <polacek@redhat.com>
2852
2853 PR c++/69379
2854 * constexpr.c (cxx_eval_constant_expression): Handle PTRMEM_CSTs
2855 wrapped in NOP_EXPRs.
2856
2857 2016-01-27 Martin Sebor <msebor@redhat.com>
2858
2859 PR c++/69317
2860 * mangle.c (mangle_decl): Reference the correct (saved) version
2861 of the ABI in -Wabi diagnostics.
2862
2863 2016-01-27 Marek Polacek <polacek@redhat.com>
2864
2865 PR c++/69496
2866 * constexpr.c (cxx_eval_array_reference): Evaluate the number of
2867 elements of the array.
2868
2869 2016-01-26 Jason Merrill <jason@redhat.com>
2870
2871 PR c++/68949
2872 * constexpr.c (register_constexpr_fundef): Keep the un-massaged body.
2873 (cxx_eval_call_expression): Don't look through clones.
2874 * optimize.c (maybe_clone_body): Clear DECL_SAVED_TREE of the alias.
2875 * semantics.c (expand_or_defer_fn_1): Keep DECL_SAVED_TREE of
2876 maybe-in-charge *tor.
2877
2878 2016-01-26 Jason Merrill <jason@redhat.com>
2879
2880 PR c++/68782
2881 * constexpr.c (cxx_eval_bare_aggregate): Update TREE_CONSTANT
2882 and TREE_SIDE_EFFECTS.
2883 (cxx_eval_constant_expression) [CONSTRUCTOR]: Call
2884 verify_constructor_flags.
2885
2886 2016-01-26 Jakub Jelinek <jakub@redhat.com>
2887
2888 PR c++/68357
2889 * cp-gimplify.c (cp_fold): If some operand folds to error_mark_node,
2890 return error_mark_node instead of building trees with error_mark_node
2891 operands.
2892
2893 2016-01-26 David Malcolm <dmalcolm@redhat.com>
2894
2895 PR other/69006
2896 * error.c (print_instantiation_partial_context_line): Add missing
2897 newlines from output for the t == NULL case.
2898 (print_instantiation_partial_context): Remove call to pp_newline.
2899
2900 2016-01-24 Patrick Palka <ppalka@gcc.gnu.org>
2901
2902 Revert:
2903 2016-01-18 Patrick Palka <ppalka@gcc.gnu.org>
2904
2905 PR c++/11858
2906 PR c++/24663
2907 PR c++/24664
2908 * decl.c (grokdeclarator): Don't decay array parameter type to
2909 a pointer type if it's dependent.
2910 (grokparms): Invoke strip_top_quals instead of directly invoking
2911 cp_build_qualified_type.
2912 * pt.c (decay_dependent_array_parm_type): New static function.
2913 (type_unification_real): Call decay_dependent_array_parm_type
2914 to decay a dependent array parameter type to its corresponding
2915 pointer type before unification.
2916 (more_specialized_fn): Likewise.
2917 (get_bindings): Likewise.
2918 * tree.c (cp_build_qualified_type): Trivial typofix in
2919 documentation.
2920
2921 2016-01-23 Martin Sebor <msebor@redhat.com>
2922
2923 PR c++/58109
2924 PR c++/69022
2925 * decl2.c (is_late_template_attribute): Handle dependent argument
2926 to attribute align and attribute vector_size.
2927
2928 2016-01-21 Jason Merrill <jason@redhat.com>
2929
2930 PR c++/69392
2931 * lambda.c (lambda_capture_field_type): Handle 'this' specially
2932 for init-capture, too.
2933
2934 PR c++/65687
2935 * decl.c (type_is_deprecated): Don't look into a typedef.
2936
2937 PR c++/40751
2938 PR c++/64987
2939 * decl.c (copy_type_enum): Respect TYPE_USER_ALIGN.
2940
2941 PR c++/43407
2942 * decl.c (start_enum): Add attributes parameter.
2943 * parser.c (cp_parser_enum_specifier): Pass it.
2944 * pt.c (lookup_template_class_1): Pass it.
2945 * cp-tree.h: Adjust.
2946
2947 2016-01-19 Jason Merrill <jason@redhat.com>
2948
2949 PR c++/59759
2950 * pt.c (convert_template_argument): Handle VAR_DECL properly.
2951
2952 2016-01-19 Marek Polacek <polacek@redhat.com>
2953
2954 PR c++/68586
2955 * constexpr.c (clear_cv_cache): New.
2956 * cp-gimplify.c (clear_fold_cache): New.
2957 * cp-tree.h (clear_cv_cache, clear_fold_cache): Declare.
2958 * decl.c (finish_enum_value_list): Call them.
2959
2960 PR c++/68965
2961 * pt.c (tsubst_copy): Mark elements in expanded vector as used.
2962
2963 2016-01-18 Patrick Palka <ppalka@gcc.gnu.org>
2964
2965 PR c++/11858
2966 PR c++/24663
2967 PR c++/24664
2968 * decl.c (grokdeclarator): Don't decay array parameter type to
2969 a pointer type if it's dependent.
2970 (grokparms): Invoke strip_top_quals instead of directly invoking
2971 cp_build_qualified_type.
2972 * pt.c (decay_dependent_array_parm_type): New static function.
2973 (type_unification_real): Call decay_dependent_array_parm_type
2974 to decay a dependent array parameter type to its corresponding
2975 pointer type before unification.
2976 (more_specialized_fn): Likewise.
2977 (get_bindings): Likewise.
2978 * tree.c (cp_build_qualified_type): Trivial typofix in
2979 documentation.
2980
2981 2016-01-18 Jason Merrill <jason@redhat.com>
2982
2983 * cp-gimplify.c (cp_fold) [CONSTRUCTOR]: Don't clobber the input.
2984
2985 * cp-gimplify.c (cp_fold): Remove unnecessary special cases.
2986
2987 PR c++/68767
2988 * cp-gimplify.c (cp_fold) [COND_EXPR]: Simplify. Do fold COND_EXPR.
2989 (contains_label_1, contains_label_p): Remove.
2990
2991 2016-01-16 Patrick Palka <ppalka@gcc.gnu.org>
2992
2993 PR c++/69091
2994 * pt.c (type_dependent_expression_p): For a function template
2995 specialization, a type is dependent iff any of its template
2996 arguments are.
2997
2998 2016-01-16 Patrick Palka <ppalka@gcc.gnu.org>
2999
3000 * cp-array-notation.c (cp_expand_cond_array_notations): Return
3001 error_mark_node only if find_rank failed, not if it was
3002 successful.
3003
3004 2016-01-16 Patrick Palka <ppalka@gcc.gnu.org>
3005
3006 PR c++/68936
3007 * tree.c (build_min_non_dep_call_vec): Don't retain the
3008 KOENIG_LOOKUP_P flag of the non-dependent expression that's
3009 been built.
3010 (build_min_non_dep_op_overload): Instead, do it here.
3011
3012 2016-01-15 Jakub Jelinek <jakub@redhat.com>
3013
3014 PR bootstrap/68271
3015 * parser.h (cp_token): Remove pragma_kind field. Add comment
3016 with number of unused bits.
3017 * parser.c (eof_token): Remove pragma_kind field initializer.
3018 (cp_lexer_get_preprocessor_token): Don't set pragma_kind
3019 field, don't clear CPP_PRAGMA u.value.
3020 (cp_parser_pragma_kind): New function.
3021 (cp_parser_omp_sections_scope, cp_parser_oacc_kernels_parallel,
3022 cp_parser_omp_construct, cp_parser_initial_pragma,
3023 cp_parser_pragma): Use cp_parser_pragma_kind instead of accessing
3024 pragma_kind field.
3025
3026 2016-01-15 Jason Merrill <jason@redhat.com>
3027
3028 PR c++/68847
3029 * call.c (build_cxx_call): Use fold_non_dependent_expr.
3030
3031 * typeck2.c (cxx_incomplete_type_diagnostic): Use the location of
3032 value.
3033
3034 PR c++/69257
3035 * typeck.c (decay_conversion): Don't call mark_rvalue_use for
3036 array/function-to-pointer conversion. Call
3037 complete_type_or_maybe_complain for lvalue-to-rvalue conversion.
3038 * call.c (convert_like_real): Print call context if
3039 decay_conversion errors.
3040
3041 2016-01-14 Tom de Vries <tom@codesourcery.com>
3042
3043 PR tree-optimization/68773
3044 * parser.c (cp_parser_oacc_declare, cp_parser_omp_declare_target): Don't
3045 set force_output.
3046
3047 2016-01-14 Jason Merrill <jason@redhat.com>
3048
3049 PR c++/69261
3050 * constexpr.c (find_array_ctor_elt): Handle splitting RANGE_EXPR.
3051
3052 2016-01-12 Marek Polacek <polacek@redhat.com>
3053
3054 PR c++/68979
3055 * constexpr.c (cxx_eval_check_shift_p): Use permerror rather than
3056 error_at and adjust the return value.
3057
3058 2016-01-12 Jakub Jelinek <jakub@redhat.com>
3059
3060 PR objc++/68511
3061 PR c++/69213
3062 * cp-gimplify.c (cp_gimplify_expr) <case INIT_EXPR>: Don't return
3063 GS_ERROR whenever seen_error (), only if *expr_p contains
3064 cilk spawn stmt, but cilk_detect_spawn_and_unwrap failed.
3065
3066 PR c++/66808
3067 PR c++/69000
3068 * pt.c (tsubst_decl): If not local_p, clear DECL_TEMPLATE_INFO.
3069
3070 2016-01-11 Jason Merrill <jason@redhat.com>
3071
3072 PR c++/69131
3073 * method.c (walk_field_subobs): Add dtor_from_ctor parm.
3074 (process_subob_fn): Likewise. Don't consider triviality if true.
3075 (synthesize_method_walk): Pass it.
3076
3077 2016-01-11 David Malcolm <dmalcolm@redhat.com>
3078
3079 PR c++/68795
3080 * parser.c (cp_parser_postfix_expression): Initialize
3081 close_paren_loc to UNKNOWN_LOCATION; only use it if
3082 it has been written to by
3083 cp_parser_parenthesized_expression_list.
3084 (cp_parser_parenthesized_expression_list): Document the behavior
3085 with respect to the CLOSE_PAREN_LOC param.
3086
3087 2016-01-11 Jakub Jelinek <jakub@redhat.com>
3088
3089 PR c++/69211
3090 * cp-gimplify.c (cp_fold): If COMPOUND_EXPR or MODIFY_EXPR
3091 folded operands have side-effects, but folding changed any of them,
3092 build a new tree with the folded operands instead of returning the
3093 unfolded tree.
3094
3095 2016-01-09 Marek Polacek <polacek@redhat.com>
3096
3097 PR c++/69113
3098 * decl2.c (comdat_linkage): Only set DECL_COMDAT if TREE_PUBLIC is set.
3099
3100 2016-01-09 Jakub Jelinek <jakub@redhat.com>
3101
3102 PR c++/69164
3103 * class.c (layout_class_type): Use copy_node to copy FIELD_DECLs.
3104
3105 2016-01-08 Jason Merrill <jason@redhat.com>
3106
3107 PR c++/69158
3108 * constexpr.c (cxx_fold_indirect_ref): Handle array type differing
3109 in completion.
3110
3111 2016-01-08 Marek Polacek <polacek@redhat.com>
3112
3113 PR c++/68449
3114 * constexpr.c (cxx_eval_constant_expression): Handle NULL initializer.
3115
3116 2016-01-08 Jason Merrill <jason@redhat.com>
3117
3118 * constexpr.c (cxx_eval_call_expression): Remove convert_to_void
3119 workaround.
3120
3121 PR c++/68983
3122 PR c++/67557
3123 * cvt.c (convert_to_void): Don't strip a TARGET_EXPR of
3124 TREE_ADDRESSABLE type.
3125
3126 PR c++/68983
3127 PR c++/67557
3128 * call.c (unsafe_copy_elision_p): Look through COMPOUND_EXPR.
3129
3130 2016-01-05 Nathan Sidwell <nathan@acm.org>
3131
3132 PR c++/58583
3133 * pt.c (build_non_dependent_expr): Don't try a checking fold when
3134 parsing an nsdmi.
3135
3136 2016-01-04 Jakub Jelinek <jakub@redhat.com>
3137
3138 Update copyright years.
3139 \f
3140 Copyright (C) 2016 Free Software Foundation, Inc.
3141
3142 Copying and distribution of this file, with or without modification,
3143 are permitted in any medium without royalty provided the copyright
3144 notice and this notice are preserved.