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