1 2016-03-14 Casey Carter <casey@carter.net>
2 Jason Merrill <jason@redhat.com>
4 P0184R0: Generalizing the Range-Based For Loop
5 * parser.c (cp_convert_range_for): Set the type of __end separately.
6 (cp_parser_perform_range_for_lookup): Allow different begin/end
7 types if they are comparable.
9 2016-03-12 Patrick Palka <ppalka@gcc.gnu.org>
12 * semantics.c (force_paren_expr): Just build a PAREN_EXPR when
13 processing_template_decl and EXPR is a SCOPE_REF.
15 2016-03-10 Patrick Palka <ppalka@gcc.gnu.org>
16 Jakub Jelinek <jakub@redhat.com>
19 * constexpr.c (cxx_eval_vec_init_1): For pre_init case, reuse
20 return value from cxx_eval_constant_expression from earlier
21 elements if it is valid constant initializer requiring no
24 2016-03-10 Marek Polacek <polacek@redhat.com>
27 * cp-gimplify.c (cp_fold): Handle UNARY_PLUS_EXPR.
29 2016-03-09 Cesar Philippidis <cesar@codesourcery.com>
31 * parser.c (cp_parser_oacc_loop): Update cclauses and clauses
32 when calling c_finish_omp_clauses.
34 2016-03-08 Jason Merrill <jason@redhat.com>
36 * parser.c (cp_parser_diagnose_invalid_type_name): Give helpful
37 diagnostic for use of "concept".
38 (cp_parser_requires_clause_opt): And "requires".
39 (cp_parser_type_parameter, cp_parser_late_return_type_opt)
40 (cp_parser_explicit_template_declaration): Adjust.
41 * Make-lang.in (check-c++-all): Add "concepts" to std list.
43 P0036R0: Unary Folds and Empty Parameter Packs
44 * pt.c (expand_empty_fold): Remove special cases for *,+,&,|.
46 2016-03-08 Jakub Jelinek <jakub@redhat.com>
49 * constexpr.c (cxx_eval_loop_expr): Forget saved values of SAVE_EXPRs
50 even after the last iteration of the loop.
52 * decl.c (duplicate_decls): Fix spelling - becuase -> because.
54 2016-03-07 Patrick Palka <ppalka@gcc.gnu.org>
57 * pt.c (get_template_info): Handle PARM_DECL.
58 (template_class_depth): Check DECL_P instead of
59 VAR_OR_FUNCTION_DECL_P.
61 2016-03-05 Jason Merrill <jason@redhat.com>
64 * constexpr.c (cxx_eval_store_expression): Replace
65 CONSTRUCTOR_ELTS in nested CONSTRUCTORs, too.
67 2016-03-05 Patrick Palka <ppalka@gcc.gnu.org>
70 * pt.c (template_class_depth): Given a lambda type, iterate
71 into its LAMBDA_TYPE_EXTRA_SCOPE field instead of its
72 TYPE_CONTEXT. Given a VAR_DECL, iterate into its
75 2016-03-04 Jason Merrill <jason@redhat.com>
78 * cp-tree.h (COND_EXPR_IS_VEC_DELETE): New.
79 * init.c (build_vec_delete_1): Set it.
80 * constexpr.c (potential_constant_expression_1) [COND_EXPR]: Check it.
82 2016-03-04 Jakub Jelinek <jakub@redhat.com>
84 * decl.c (start_preparsed_function): Don't emit start clobber at the
85 start of constructor clones.
88 * cp-tree.h (cp_ubsan_maybe_initialize_vtbl_ptrs): New prototype.
89 * decl.c (start_preparsed_function): Call
90 cp_ubsan_maybe_initialize_vtbl_ptrs if needed.
91 * cp-ubsan.c (cp_ubsan_dfs_initialize_vtbl_ptrs,
92 cp_ubsan_maybe_initialize_vtbl_ptrs): New functions.
94 2016-03-04 Jason Merrill <jason@redhat.com>
97 * constexpr.c (cxx_eval_component_reference): Further tweak.
99 * constexpr.c (struct constexpr_ctx): Add save_exprs field.
100 (cxx_eval_loop_expr): Discard SAVE_EXPR values before looping.
101 (cxx_eval_constant_expression) [SAVE_EXPR]: Add it to the set.
102 (cxx_eval_outermost_constant_expr, is_sub_constant_expr): Initialize.
105 * tree.c (strip_typedefs): Handle TYPENAME_TYPE lookup finding the
108 2016-03-03 Jason Merrill <jason@redhat.com>
110 * method.c (synthesized_method_walk): operator= can also be constexpr.
112 * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Get
113 LAMBDA_EXPR_RETURN_TYPE from the instantiated closure.
116 * pt.c (copy_template_args): New.
117 (tsubst_pack_expansion): Use it.
119 * call.c (build_aggr_conv): Use get_nsdmi.
122 * typeck.c (build_static_cast_1): Avoid folding back to lvalue.
125 * constexpr.c (cxx_eval_component_reference): Just return an empty
126 CONSTRUCTOR for an empty class.
128 2016-03-01 Jason Merrill <jason@redhat.com>
131 * parser.c (cp_parser_requires_clause): Call
132 check_for_bare_parameter_packs.
135 * constexpr.c (cxx_eval_binary_expression): Don't VERIFY_CONSTANT
139 * constexpr.c (cxx_eval_call_expression): Unshare arg.
140 (cxx_eval_constant_expression) [DECL_EXPR]: Unshare init.
141 [TARGET_EXPR]: Unshare init.
143 2016-03-01 Patrick Palka <ppalka@gcc.gnu.org>
147 * pt.c (tsubst_baselink): Reinstate the check for an invalid
150 2016-02-28 Jason Merrill <jason@redhat.com>
153 * constexpr.c (cxx_eval_store_expression): Unshare init.
155 2016-02-26 Jason Merrill <jason@redhat.com>
158 * pt.c (make_argument_pack): New.
159 (tsubst_copy) [SIZEOF_EXPR]: Handle partial expansion.
160 (tsubst_copy_and_build): Likewise.
162 2016-02-25 Jason Merrill <jason@redhat.com>
165 * cp-tree.h (AGGR_INIT_FROM_THUNK_P): New.
166 * tree.c (build_aggr_init_expr): Set it.
167 * semantics.c (simplify_aggr_init_expr): Check it.
168 * cp-gimplify.c (cp_genericize_r): Don't walk into
169 a call/aggr_init from a thunk.
172 * method.c (forward_parm): Handle parameter packs.
173 * lambda.c (maybe_add_lambda_conv_op): Use it for them.
176 * constexpr.c (cxx_eval_component_reference): Don't complain about
177 unevaluated empty classes.
180 * tree.c (strip_typedefs): Use DECL_ORIGINAL_TYPE.
182 2016-02-25 Patrick Palka <ppalka@gcc.gnu.org>
185 * cp-tree.h (REF_PARENTHESIZED_P): Adjust documentation.
186 (maybe_undo_parenthesized_ref): Declare.
187 * semantics.c (maybe_undo_parenthesized_ref): Split out from
189 (finish_call_expr): Use it.
190 * typeck.c (check_return_expr): Use it.
191 * pt.c (tsubst_copy_and_build) [INDIRECT_REF]: Retain the
192 REF_PARENTHESIZED_P flag.
194 2016-02-24 Jakub Jelinek <jakub@redhat.com>
197 * class.c (build_base_path): Set TREE_NO_WARNING on the null_test.
199 * init.c (build_vec_delete_1, build_delete): Don't fold the non-NULL
201 * cp-gimplify.c (cp_fold): For TREE_NO_WARNING comparisons with NULL,
202 unless they are folded into INTEGER_CST, error_mark_node or some
203 comparison with NULL, avoid folding them and use either the original
204 comparison or non-folded comparison of folded arguments.
205 * cp-ubsan.c (cp_ubsan_instrument_vptr): Set TREE_NO_WARNING on the
206 comparison, don't fold the comparison right away.
208 2016-02-24 Jason Merrill <jason@redhat.com>
211 * friend.c (make_friend_class): Likewise.
212 * decl.c (lookup_and_check_tag): Diagnose invalid dependent friend.
214 2016-02-24 Jason Merrill <jason@redhat.com>
217 * pt.c (instantiate_class_template_1): Set
218 processing_template_decl before substituting friend_type.
220 016-02-24 Martin Sebor <msebor@redhat.com>
223 * tree.c (build_ctor_subob_ref): Compare types' main variants
224 instead of the types as they are.
226 2016-02-24 Jason Merrill <jason@redhat.com>
228 * decl.c (start_preparsed_function): Condition ctor clobber on
229 flag_lifetime_dse > 1.
231 * cp-gimplify.c (cp_fold): Don't fold constexpr calls if -fno-inline.
233 2016-02-19 Jason Merrill <jason@redhat.com>
236 * call.c (remaining_arguments): No longer static.
237 * cp-tree.h: Declare it.
238 * pt.c (more_specialized_fn): Use it.
240 2016-02-19 Jakub Jelinek <jakub@redhat.com>
241 Bernd Edlinger <bernd.edlinger@hotmail.de>
243 * Make-lang.in: Invoke gperf with -L C++.
244 * cfns.gperf: Remove prototypes for hash and libc_name_p
246 * cfns.h: Regenerated.
247 * except.c (nothrow_libfn_p): Adjust.
249 2016-02-19 Jakub Jelinek <jakub@redhat.com>
252 * rtti.c (ifnonnull): Set TREE_NO_WARNING on the condition, use
253 NE_EXPR instead of EQ_EXPR and swap last two arguments on COND_EXPR.
255 2016-02-19 Patrick Palka <ppalka@gcc.gnu.org>
258 * pt.c (tsubst_baselink): Don't diagnose an invalid constructor
260 * semantics.c (finish_call_expr): Don't assume a constructor
261 call is dependent if only the "this" pointer is dependent. When
262 building a constructor call, always use a dummy object.
264 2016-02-19 Jakub Jelinek <jakub@redhat.com>
267 * init.c (build_vec_delete_1): Set TREE_NO_WARNING on the NE_EXPR
269 * cp-gimplify.c (cp_fold): Propagate TREE_NO_WARNING from binary
270 operators if folding preserved the binop, just with different
274 * parser.c (cp_parser_std_attribute_spec_seq): Don't assume
275 attr_spec is always single element chain, chain all the attributes
276 properly together in the right order.
278 2016-02-18 Jason Merrill <jason@redhat.com>
280 * mangle.c (maybe_check_abi_tags): Add for_decl parm. Call
282 (mangle_decl): Call maybe_check_abi_tags for function scope.
283 (mangle_guard_variable): Call maybe_check_abi_tags here.
284 (write_guarded_var_name): Not here.
286 2016-02-17 Jason Merrill <jason@redhat.com>
289 * constexpr.c (build_constexpr_constructor_member_initializers):
290 Handle an additional STATEMENT_LIST.
293 * constexpr.c (cxx_eval_bare_aggregate): Fix 'changed' detection.
296 * decl2.c (reset_type_linkage_2): Look through member templates.
298 2016-02-17 Jakub Jelinek <jakub@redhat.com>
301 * init.c (build_delete): Set TREE_NO_WARNING on ifexp.
303 2016-02-17 Jason Merrill <jason@redhat.com>
306 * method.c (forward_parm): Split out from...
307 (add_one_base_init): ...here.
308 * lambda.c (maybe_add_lambda_conv_op): Use it.
310 2016-02-16 Jason Merrill <jason@redhat.com>
314 * call.c, cp-tree.h, name-lookup.c, pt.c, search.c, semantics.c,
315 tree.c, typeck2.c: Revert earlier changes.
316 * parser.c (cp_parser_lookup_name): Ignore namespace-scope
317 non-type templates after -> or .
319 2016-02-16 Jakub Jelinek <jakub@redhat.com>
322 * typeck.c (cp_build_binary_op): Revert 2015-09-09 change.
324 2016-02-16 Jason Merrill <jason@redhat.com>
327 * name-lookup.c (lookup_qualified_name): Add find_hidden parm.
328 (set_decl_namespace): Pass it. Complain about finding a hidden friend.
329 * name-lookup.h: Adjust.
331 2016-02-16 James Norris <jnorris@codesourcery.com>
333 * parser.c (cp_parser_oacc_data_clause_deviceptr): Remove checking.
334 * semantics.c (finish_omp_clauses): Add deviceptr checking.
336 2016-02-15 Jakub Jelinek <jakub@redhat.com>
339 * init.c (expand_default_init): Only call reshape_init
340 in the direct-initialization from an initializer list case.
342 2016-02-15 Jason Merrill <jason@redhat.com>
345 * semantics.c (finish_call_expr): Implicit 'this' does not make
347 * search.c (any_dependent_bases_p): Split out...
348 * name-lookup.c (do_class_using_decl): ...from here.
349 * call.c (build_new_method_call_1): Don't complain about missing object
350 if there are dependent bases. Tweak error.
351 * tree.c (non_static_member_function_p): Remove.
352 * pt.c (type_dependent_expression_p): A member template of a
353 dependent type is dependent.
357 * constexpr.c (verify_ctor_sanity): Remove CONSTRUCTOR_NELTS check.
359 2016-02-12 Patrick Palka <ppalka@gcc.gnu.org>
362 * pt.c (lookup_and_finish_template_variable): New function,
364 (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: ... here. Use it.
365 (tsubst_qualified_id): Consider that EXPR might be a variable
367 * typeck.c (check_template_keyword): Don't emit an error
368 if DECL is a variable template.
370 2016-02-12 Jakub Jelinek <jakub@redhat.com>
372 * error.c: Spelling fixes - behaviour -> behavior and
373 neighbour -> neighbor.
375 * typeck.c (cp_build_binary_op): Fix up behavior spelling in
377 * init.c (build_delete): Likewise.
379 2016-02-11 Jakub Jelinek <jakub@redhat.com>
382 * typeck.c (cp_build_binary_op): cp_fully_fold integer_zerop
383 arguments for -Waddress warning. Fix up formatting.
385 2016-02-11 Paolo Carlini <paolo.carlini@oracle.com>
388 * pt.c (lookup_template_class_1): Check tsubst return value for
391 2016-02-10 Jason Merrill <jason@redhat.com>
394 * pt.c (resolve_nondeduced_context): Add complain parm.
395 (do_auto_deduction): Pass it.
396 * cvt.c (convert_to_void): Likewise.
397 * decl.c (cp_finish_decl): Likewise.
398 * init.c (build_new): Likewise.
399 * rtti.c (get_tinfo_decl_dynamic): Likewise.
400 * semantics.c (finish_decltype_type): Likewise.
401 * typeck.c (decay_conversion): Likewise.
402 * cp-tree.h: Adjust declaration.
403 * call.c (standard_conversion): Add complain parm, pass it along.
404 (implicit_conversion): Pass it.
407 * name-lookup.c (ambiguous_decl): Call remove_hidden_names.
408 (lookup_name_real_1): Likewise.
409 (remove_hidden_names): Handle non-functions too.
412 * parser.c (cp_parser_lookup_name): When looking for a template
413 after . or ->, only consider class templates.
414 (cp_parser_postfix_dot_deref_expression): Handle the current
415 instantiation. Remember a dependent object expression.
416 * typeck2.c (build_x_arrow): Handle the current instantiation.
418 * ptree.c (debug_tree): Implement for cp_expr.
420 2016-02-08 Patrick Palka <ppalka@gcc.gnu.org>
423 * parser.c (cp_parser_simple_type_specifier): Make the check
424 for disambiguating between an 'auto' placeholder and an implicit
425 template parameter more robust.
427 2016-02-08 Patrick Palka <ppalka@gcc.gnu.org>
431 * decl2.c (mark_used): When given a TEMPLATE_DECL, return after
432 setting its TREE_USED flag.
434 2016-02-08 Jason Merrill <jason@redhat.com>
437 * name-lookup.c (do_nonmember_using_decl): Leave anticipated
440 2016-02-08 Jakub Jelinek <jakub@redhat.com>
443 * parser.c (cp_parser_omp_declare_reduction): Set assembler name
444 of the DECL_OMP_DECLARE_REDUCTION_P decls.
446 2016-02-08 Marek Polacek <polacek@redhat.com>
449 * constexpr.c (clear_cv_and_fold_caches): Renamed from clear_cv_cache.
450 Call clear_fold_cache.
451 * cp-tree.h: Adjust declaration.
452 * decl.c (finish_enum_value_list): Call clear_cv_and_fold_caches
453 rather than clear_cv_cache and clear_fold_cache.
454 * typeck2.c (store_init_value): Call clear_cv_and_fold_caches.
456 2016-02-08 Jason Merrill <jason@redhat.com>
458 * cp-tree.h (CONV_FOLD, CONV_BACKEND_CONVERT): New.
459 * cvt.c (convert): Pass CONV_BACKEND_CONVERT.
460 (ocp_convert): Use *_maybe_fold.
461 (cp_convert_to_pointer): Add dofold parameter.
462 * cp-gimplify.c (cp_fold) [CONVERT_EXPR]: Call convert.
464 2016-02-05 Martin Sebor <msebor@redhat.com>
467 * init.c (find_field_init): New function.
468 (warn_placement_new_too_small): Call it. Handle one-element arrays
469 at ends of structures special.
471 2016-02-05 Jason Merrill <jason@redhat.com>
474 * semantics.c (finish_expr_stmt): If expr is error_mark_node,
475 make sure we've seen_error().
477 2016-02-05 Patrick Palka <ppalka@gcc.gnu.org>
480 * pt.c (tsubst_baselink): Diagnose an invalid constructor call
481 if lookup_fnfields returns NULL_TREE and the name being looked
482 up has the form A::A.
484 2016-02-04 Patrick Palka <ppalka@gcc.gnu.org>
486 * constexpr.c (cxx_eval_binary_expression): Fold equality
487 comparisons involving PTRMEM_CSTs.
489 2016-02-04 Jakub Jelinek <jakub@redhat.com>
491 * class.c (find_flexarrays): Don't declare dom variable.
492 (diagnose_flexarray): Likewise.
494 2016-02-02 Martain Sebor <msebor@redhat.com>
501 * class.c (walk_subobject_offsets): Avoid testing the upper bound
502 of a flexible array member for equality to null.
503 (find_flexarrays): Remove spurious whitespace introduced in r231665.
504 (diagnose_flexarrays): Avoid checking the upper bound of arrays.
505 (check_flexarrays): Same.
506 * decl.c (compute_array_index_type): Avoid special case for flexible
508 (grokdeclarator): Avoid calling compute_array_index_type for flexible
510 * error.c (dump_type_suffix): Revert changes introduced in r231665
511 and rendered unnecessary by the changes above.
512 * pt.c (tsubst): Same.
513 * tree.c (build_ctor_subob_ref): Handle flexible array members.
514 * typeck2.c (digest_init_r): Revert changes introduced in r231665.
515 (process_init_constructor_array): Same.
516 (process_init_constructor_record): Same.
518 2016-02-03 Patrick Palka <ppalka@gcc.gnu.org>
521 * pt.c (try_one_overload): Handle comparing argument packs so
522 that there is no conflict if we deduced more arguments of an
523 argument pack than were explicitly specified.
525 2016-01-31 Jakub Jelinek <jakub@redhat.com>
526 Jason Merrill <jason@redhat.com>
529 * tree.c (strip_typedefs) [FUNCTION_TYPE]: Avoid building a new
530 function type if nothing is changing.
532 2016-01-31 Jason Merrill <jason@redhat.com>
535 * pt.c (partial_specialization_p, impartial_args): New.
536 (instantiate_decl): Call impartial_args.
538 * mangle.c (maybe_check_abi_tags): New.
539 (write_guarded_var_name): Call it.
540 (mangle_ref_init_variable): Call check_abi_tags.
542 * pt.c (lookup_template_class_1): Don't share TYPE_ATTRIBUTES
543 between template and instantiation.
545 2016-01-29 Jakub Jelinek <jakub@redhat.com>
548 * decl.c (wrapup_globals_for_namespace): Warn about unused static
549 function declarations.
551 2016-01-29 Marek Polacek <polacek@redhat.com>
555 * constexpr.c (cxx_eval_array_reference): Give the "array subscript
556 out of bound" error earlier.
557 * init.c (build_vec_init): Change NE_EXPR into GT_EXPR. Update the
560 2016-01-29 Patrick Palka <ppalka@gcc.gnu.org>
562 * name-lookup.c (begin_scope): After reusing a cp_binding_level
563 structure, update free_binding_level before the structure's
564 level_chain field gets cleared, not after.
566 2016-01-28 Jason Merrill <jason@redhat.com>
569 * search.c (dfs_walk_once, dfs_walk_once_r)
570 (dfs_walk_once_accessible_r, dfs_walk_once_accessible): Use
571 hash_set instead of BINFO_MARKED.
572 (dfs_unmark_r): Remove.
574 2016-01-28 Patrick Palka <ppalka@gcc.gnu.org>
577 * parser.c (LEXER_DEBUGGING_ENABLED_P): New macro.
578 (cp_lexer_debugging_p): Use it.
579 (cp_lexer_start_debugging): Likewise.
580 (cp_lexer_stop_debugging): Likewise.
582 2016-01-27 Marek Polacek <polacek@redhat.com>
585 * typeck.c (cp_build_binary_op): Promote operand to unsigned, if
586 needed. Add -Wsign-compare warning.
588 2016-01-27 Ryan Burn <contact@rnburn.com>
591 * cp-gimplify.c (cilk_cp_gimplify_call_params_in_spawned_fn): Removed
592 superfluous post_p argument in call to
593 cilk_gimplify_call_params_in_spawned_fn.
595 2016-01-27 Marek Polacek <polacek@redhat.com>
598 * constexpr.c (cxx_eval_constant_expression): Handle PTRMEM_CSTs
599 wrapped in NOP_EXPRs.
601 2016-01-27 Martin Sebor <msebor@redhat.com>
604 * mangle.c (mangle_decl): Reference the correct (saved) version
605 of the ABI in -Wabi diagnostics.
607 2016-01-27 Marek Polacek <polacek@redhat.com>
610 * constexpr.c (cxx_eval_array_reference): Evaluate the number of
611 elements of the array.
613 2016-01-26 Jason Merrill <jason@redhat.com>
616 * constexpr.c (register_constexpr_fundef): Keep the un-massaged body.
617 (cxx_eval_call_expression): Don't look through clones.
618 * optimize.c (maybe_clone_body): Clear DECL_SAVED_TREE of the alias.
619 * semantics.c (expand_or_defer_fn_1): Keep DECL_SAVED_TREE of
620 maybe-in-charge *tor.
622 2016-01-26 Jason Merrill <jason@redhat.com>
625 * constexpr.c (cxx_eval_bare_aggregate): Update TREE_CONSTANT
626 and TREE_SIDE_EFFECTS.
627 (cxx_eval_constant_expression) [CONSTRUCTOR]: Call
628 verify_constructor_flags.
630 2016-01-26 Jakub Jelinek <jakub@redhat.com>
633 * cp-gimplify.c (cp_fold): If some operand folds to error_mark_node,
634 return error_mark_node instead of building trees with error_mark_node
637 2016-01-26 David Malcolm <dmalcolm@redhat.com>
640 * error.c (print_instantiation_partial_context_line): Add missing
641 newlines from output for the t == NULL case.
642 (print_instantiation_partial_context): Remove call to pp_newline.
644 2016-01-24 Patrick Palka <ppalka@gcc.gnu.org>
647 2016-01-18 Patrick Palka <ppalka@gcc.gnu.org>
652 * decl.c (grokdeclarator): Don't decay array parameter type to
653 a pointer type if it's dependent.
654 (grokparms): Invoke strip_top_quals instead of directly invoking
655 cp_build_qualified_type.
656 * pt.c (decay_dependent_array_parm_type): New static function.
657 (type_unification_real): Call decay_dependent_array_parm_type
658 to decay a dependent array parameter type to its corresponding
659 pointer type before unification.
660 (more_specialized_fn): Likewise.
661 (get_bindings): Likewise.
662 * tree.c (cp_build_qualified_type): Trivial typofix in
665 2016-01-23 Martin Sebor <msebor@redhat.com>
669 * decl2.c (is_late_template_attribute): Handle dependent argument
670 to attribute align and attribute vector_size.
672 2016-01-21 Jason Merrill <jason@redhat.com>
675 * lambda.c (lambda_capture_field_type): Handle 'this' specially
676 for init-capture, too.
679 * decl.c (type_is_deprecated): Don't look into a typedef.
683 * decl.c (copy_type_enum): Respect TYPE_USER_ALIGN.
686 * decl.c (start_enum): Add attributes parameter.
687 * parser.c (cp_parser_enum_specifier): Pass it.
688 * pt.c (lookup_template_class_1): Pass it.
691 2016-01-19 Jason Merrill <jason@redhat.com>
694 * pt.c (convert_template_argument): Handle VAR_DECL properly.
696 2016-01-19 Marek Polacek <polacek@redhat.com>
699 * constexpr.c (clear_cv_cache): New.
700 * cp-gimplify.c (clear_fold_cache): New.
701 * cp-tree.h (clear_cv_cache, clear_fold_cache): Declare.
702 * decl.c (finish_enum_value_list): Call them.
705 * pt.c (tsubst_copy): Mark elements in expanded vector as used.
707 2016-01-18 Patrick Palka <ppalka@gcc.gnu.org>
712 * decl.c (grokdeclarator): Don't decay array parameter type to
713 a pointer type if it's dependent.
714 (grokparms): Invoke strip_top_quals instead of directly invoking
715 cp_build_qualified_type.
716 * pt.c (decay_dependent_array_parm_type): New static function.
717 (type_unification_real): Call decay_dependent_array_parm_type
718 to decay a dependent array parameter type to its corresponding
719 pointer type before unification.
720 (more_specialized_fn): Likewise.
721 (get_bindings): Likewise.
722 * tree.c (cp_build_qualified_type): Trivial typofix in
725 2016-01-18 Jason Merrill <jason@redhat.com>
727 * cp-gimplify.c (cp_fold) [CONSTRUCTOR]: Don't clobber the input.
729 * cp-gimplify.c (cp_fold): Remove unnecessary special cases.
732 * cp-gimplify.c (cp_fold) [COND_EXPR]: Simplify. Do fold COND_EXPR.
733 (contains_label_1, contains_label_p): Remove.
735 2016-01-16 Patrick Palka <ppalka@gcc.gnu.org>
738 * pt.c (type_dependent_expression_p): For a function template
739 specialization, a type is dependent iff any of its template
742 2016-01-16 Patrick Palka <ppalka@gcc.gnu.org>
744 * cp-array-notation.c (cp_expand_cond_array_notations): Return
745 error_mark_node only if find_rank failed, not if it was
748 2016-01-16 Patrick Palka <ppalka@gcc.gnu.org>
751 * tree.c (build_min_non_dep_call_vec): Don't retain the
752 KOENIG_LOOKUP_P flag of the non-dependent expression that's
754 (build_min_non_dep_op_overload): Instead, do it here.
756 2016-01-15 Jakub Jelinek <jakub@redhat.com>
759 * parser.h (cp_token): Remove pragma_kind field. Add comment
760 with number of unused bits.
761 * parser.c (eof_token): Remove pragma_kind field initializer.
762 (cp_lexer_get_preprocessor_token): Don't set pragma_kind
763 field, don't clear CPP_PRAGMA u.value.
764 (cp_parser_pragma_kind): New function.
765 (cp_parser_omp_sections_scope, cp_parser_oacc_kernels_parallel,
766 cp_parser_omp_construct, cp_parser_initial_pragma,
767 cp_parser_pragma): Use cp_parser_pragma_kind instead of accessing
770 2016-01-15 Jason Merrill <jason@redhat.com>
773 * call.c (build_cxx_call): Use fold_non_dependent_expr.
775 * typeck2.c (cxx_incomplete_type_diagnostic): Use the location of
779 * typeck.c (decay_conversion): Don't call mark_rvalue_use for
780 array/function-to-pointer conversion. Call
781 complete_type_or_maybe_complain for lvalue-to-rvalue conversion.
782 * call.c (convert_like_real): Print call context if
783 decay_conversion errors.
785 2016-01-14 Tom de Vries <tom@codesourcery.com>
787 PR tree-optimization/68773
788 * parser.c (cp_parser_oacc_declare, cp_parser_omp_declare_target): Don't
791 2016-01-14 Jason Merrill <jason@redhat.com>
794 * constexpr.c (find_array_ctor_elt): Handle splitting RANGE_EXPR.
796 2016-01-12 Marek Polacek <polacek@redhat.com>
799 * constexpr.c (cxx_eval_check_shift_p): Use permerror rather than
800 error_at and adjust the return value.
802 2016-01-12 Jakub Jelinek <jakub@redhat.com>
806 * cp-gimplify.c (cp_gimplify_expr) <case INIT_EXPR>: Don't return
807 GS_ERROR whenever seen_error (), only if *expr_p contains
808 cilk spawn stmt, but cilk_detect_spawn_and_unwrap failed.
812 * pt.c (tsubst_decl): If not local_p, clear DECL_TEMPLATE_INFO.
814 2016-01-11 Jason Merrill <jason@redhat.com>
817 * method.c (walk_field_subobs): Add dtor_from_ctor parm.
818 (process_subob_fn): Likewise. Don't consider triviality if true.
819 (synthesize_method_walk): Pass it.
821 2016-01-11 David Malcolm <dmalcolm@redhat.com>
824 * parser.c (cp_parser_postfix_expression): Initialize
825 close_paren_loc to UNKNOWN_LOCATION; only use it if
826 it has been written to by
827 cp_parser_parenthesized_expression_list.
828 (cp_parser_parenthesized_expression_list): Document the behavior
829 with respect to the CLOSE_PAREN_LOC param.
831 2016-01-11 Jakub Jelinek <jakub@redhat.com>
834 * cp-gimplify.c (cp_fold): If COMPOUND_EXPR or MODIFY_EXPR
835 folded operands have side-effects, but folding changed any of them,
836 build a new tree with the folded operands instead of returning the
839 2016-01-09 Marek Polacek <polacek@redhat.com>
842 * decl2.c (comdat_linkage): Only set DECL_COMDAT if TREE_PUBLIC is set.
844 2016-01-09 Jakub Jelinek <jakub@redhat.com>
847 * class.c (layout_class_type): Use copy_node to copy FIELD_DECLs.
849 2016-01-08 Jason Merrill <jason@redhat.com>
852 * constexpr.c (cxx_fold_indirect_ref): Handle array type differing
855 2016-01-08 Marek Polacek <polacek@redhat.com>
858 * constexpr.c (cxx_eval_constant_expression): Handle NULL initializer.
860 2016-01-08 Jason Merrill <jason@redhat.com>
862 * constexpr.c (cxx_eval_call_expression): Remove convert_to_void
867 * cvt.c (convert_to_void): Don't strip a TARGET_EXPR of
868 TREE_ADDRESSABLE type.
872 * call.c (unsafe_copy_elision_p): Look through COMPOUND_EXPR.
874 2016-01-05 Nathan Sidwell <nathan@acm.org>
877 * pt.c (build_non_dependent_expr): Don't try a checking fold when
880 2016-01-04 Jakub Jelinek <jakub@redhat.com>
882 Update copyright years.
884 Copyright (C) 2016 Free Software Foundation, Inc.
886 Copying and distribution of this file, with or without modification,
887 are permitted in any medium without royalty provided the copyright
888 notice and this notice are preserved.