1 2016-02-19 Jakub Jelinek <jakub@redhat.com>
4 * parser.c (cp_parser_std_attribute_spec_seq): Don't assume
5 attr_spec is always single element chain, chain all the attributes
6 properly together in the right order.
8 2016-02-18 Jason Merrill <jason@redhat.com>
10 * mangle.c (maybe_check_abi_tags): Add for_decl parm. Call
12 (mangle_decl): Call maybe_check_abi_tags for function scope.
13 (mangle_guard_variable): Call maybe_check_abi_tags here.
14 (write_guarded_var_name): Not here.
16 2016-02-17 Jason Merrill <jason@redhat.com>
19 * constexpr.c (build_constexpr_constructor_member_initializers):
20 Handle an additional STATEMENT_LIST.
23 * constexpr.c (cxx_eval_bare_aggregate): Fix 'changed' detection.
26 * decl2.c (reset_type_linkage_2): Look through member templates.
28 2016-02-17 Jakub Jelinek <jakub@redhat.com>
31 * init.c (build_delete): Set TREE_NO_WARNING on ifexp.
33 2016-02-17 Jason Merrill <jason@redhat.com>
36 * method.c (forward_parm): Split out from...
37 (add_one_base_init): ...here.
38 * lambda.c (maybe_add_lambda_conv_op): Use it.
40 2016-02-16 Jason Merrill <jason@redhat.com>
44 * call.c, cp-tree.h, name-lookup.c, pt.c, search.c, semantics.c,
45 tree.c, typeck2.c: Revert earlier changes.
46 * parser.c (cp_parser_lookup_name): Ignore namespace-scope
47 non-type templates after -> or .
49 2016-02-16 Jakub Jelinek <jakub@redhat.com>
52 * typeck.c (cp_build_binary_op): Revert 2015-09-09 change.
54 2016-02-16 Jason Merrill <jason@redhat.com>
57 * name-lookup.c (lookup_qualified_name): Add find_hidden parm.
58 (set_decl_namespace): Pass it. Complain about finding a hidden friend.
59 * name-lookup.h: Adjust.
61 2016-02-16 James Norris <jnorris@codesourcery.com>
63 * parser.c (cp_parser_oacc_data_clause_deviceptr): Remove checking.
64 * semantics.c (finish_omp_clauses): Add deviceptr checking.
66 2016-02-15 Jakub Jelinek <jakub@redhat.com>
69 * init.c (expand_default_init): Only call reshape_init
70 in the direct-initialization from an initializer list case.
72 2016-02-15 Jason Merrill <jason@redhat.com>
75 * semantics.c (finish_call_expr): Implicit 'this' does not make
77 * search.c (any_dependent_bases_p): Split out...
78 * name-lookup.c (do_class_using_decl): ...from here.
79 * call.c (build_new_method_call_1): Don't complain about missing object
80 if there are dependent bases. Tweak error.
81 * tree.c (non_static_member_function_p): Remove.
82 * pt.c (type_dependent_expression_p): A member template of a
83 dependent type is dependent.
87 * constexpr.c (verify_ctor_sanity): Remove CONSTRUCTOR_NELTS check.
89 2016-02-12 Patrick Palka <ppalka@gcc.gnu.org>
92 * pt.c (lookup_and_finish_template_variable): New function,
94 (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: ... here. Use it.
95 (tsubst_qualified_id): Consider that EXPR might be a variable
97 * typeck.c (check_template_keyword): Don't emit an error
98 if DECL is a variable template.
100 2016-02-12 Jakub Jelinek <jakub@redhat.com>
102 * error.c: Spelling fixes - behaviour -> behavior and
103 neighbour -> neighbor.
105 * typeck.c (cp_build_binary_op): Fix up behavior spelling in
107 * init.c (build_delete): Likewise.
109 2016-02-11 Jakub Jelinek <jakub@redhat.com>
112 * typeck.c (cp_build_binary_op): cp_fully_fold integer_zerop
113 arguments for -Waddress warning. Fix up formatting.
115 2016-02-11 Paolo Carlini <paolo.carlini@oracle.com>
118 * pt.c (lookup_template_class_1): Check tsubst return value for
121 2016-02-10 Jason Merrill <jason@redhat.com>
124 * pt.c (resolve_nondeduced_context): Add complain parm.
125 (do_auto_deduction): Pass it.
126 * cvt.c (convert_to_void): Likewise.
127 * decl.c (cp_finish_decl): Likewise.
128 * init.c (build_new): Likewise.
129 * rtti.c (get_tinfo_decl_dynamic): Likewise.
130 * semantics.c (finish_decltype_type): Likewise.
131 * typeck.c (decay_conversion): Likewise.
132 * cp-tree.h: Adjust declaration.
133 * call.c (standard_conversion): Add complain parm, pass it along.
134 (implicit_conversion): Pass it.
137 * name-lookup.c (ambiguous_decl): Call remove_hidden_names.
138 (lookup_name_real_1): Likewise.
139 (remove_hidden_names): Handle non-functions too.
142 * parser.c (cp_parser_lookup_name): When looking for a template
143 after . or ->, only consider class templates.
144 (cp_parser_postfix_dot_deref_expression): Handle the current
145 instantiation. Remember a dependent object expression.
146 * typeck2.c (build_x_arrow): Handle the current instantiation.
148 * ptree.c (debug_tree): Implement for cp_expr.
150 2016-02-08 Patrick Palka <ppalka@gcc.gnu.org>
153 * parser.c (cp_parser_simple_type_specifier): Make the check
154 for disambiguating between an 'auto' placeholder and an implicit
155 template parameter more robust.
157 2016-02-08 Patrick Palka <ppalka@gcc.gnu.org>
161 * decl2.c (mark_used): When given a TEMPLATE_DECL, return after
162 setting its TREE_USED flag.
164 2016-02-08 Jason Merrill <jason@redhat.com>
167 * name-lookup.c (do_nonmember_using_decl): Leave anticipated
170 2016-02-08 Jakub Jelinek <jakub@redhat.com>
173 * parser.c (cp_parser_omp_declare_reduction): Set assembler name
174 of the DECL_OMP_DECLARE_REDUCTION_P decls.
176 2016-02-08 Marek Polacek <polacek@redhat.com>
179 * constexpr.c (clear_cv_and_fold_caches): Renamed from clear_cv_cache.
180 Call clear_fold_cache.
181 * cp-tree.h: Adjust declaration.
182 * decl.c (finish_enum_value_list): Call clear_cv_and_fold_caches
183 rather than clear_cv_cache and clear_fold_cache.
184 * typeck2.c (store_init_value): Call clear_cv_and_fold_caches.
186 2016-02-08 Jason Merrill <jason@redhat.com>
188 * cp-tree.h (CONV_FOLD, CONV_BACKEND_CONVERT): New.
189 * cvt.c (convert): Pass CONV_BACKEND_CONVERT.
190 (ocp_convert): Use *_maybe_fold.
191 (cp_convert_to_pointer): Add dofold parameter.
192 * cp-gimplify.c (cp_fold) [CONVERT_EXPR]: Call convert.
194 2016-02-05 Martin Sebor <msebor@redhat.com>
197 * init.c (find_field_init): New function.
198 (warn_placement_new_too_small): Call it. Handle one-element arrays
199 at ends of structures special.
201 2016-02-05 Jason Merrill <jason@redhat.com>
204 * semantics.c (finish_expr_stmt): If expr is error_mark_node,
205 make sure we've seen_error().
207 2016-02-05 Patrick Palka <ppalka@gcc.gnu.org>
210 * pt.c (tsubst_baselink): Diagnose an invalid constructor call
211 if lookup_fnfields returns NULL_TREE and the name being looked
212 up has the form A::A.
214 2016-02-04 Patrick Palka <ppalka@gcc.gnu.org>
216 * constexpr.c (cxx_eval_binary_expression): Fold equality
217 comparisons involving PTRMEM_CSTs.
219 2016-02-04 Jakub Jelinek <jakub@redhat.com>
221 * class.c (find_flexarrays): Don't declare dom variable.
222 (diagnose_flexarray): Likewise.
224 2016-02-02 Martain Sebor <msebor@redhat.com>
231 * class.c (walk_subobject_offsets): Avoid testing the upper bound
232 of a flexible array member for equality to null.
233 (find_flexarrays): Remove spurious whitespace introduced in r231665.
234 (diagnose_flexarrays): Avoid checking the upper bound of arrays.
235 (check_flexarrays): Same.
236 * decl.c (compute_array_index_type): Avoid special case for flexible
238 (grokdeclarator): Avoid calling compute_array_index_type for flexible
240 * error.c (dump_type_suffix): Revert changes introduced in r231665
241 and rendered unnecessary by the changes above.
242 * pt.c (tsubst): Same.
243 * tree.c (build_ctor_subob_ref): Handle flexible array members.
244 * typeck2.c (digest_init_r): Revert changes introduced in r231665.
245 (process_init_constructor_array): Same.
246 (process_init_constructor_record): Same.
248 2016-02-03 Patrick Palka <ppalka@gcc.gnu.org>
251 * pt.c (try_one_overload): Handle comparing argument packs so
252 that there is no conflict if we deduced more arguments of an
253 argument pack than were explicitly specified.
255 2016-01-31 Jakub Jelinek <jakub@redhat.com>
256 Jason Merrill <jason@redhat.com>
259 * tree.c (strip_typedefs) [FUNCTION_TYPE]: Avoid building a new
260 function type if nothing is changing.
262 2016-01-31 Jason Merrill <jason@redhat.com>
265 * pt.c (partial_specialization_p, impartial_args): New.
266 (instantiate_decl): Call impartial_args.
268 * mangle.c (maybe_check_abi_tags): New.
269 (write_guarded_var_name): Call it.
270 (mangle_ref_init_variable): Call check_abi_tags.
272 * pt.c (lookup_template_class_1): Don't share TYPE_ATTRIBUTES
273 between template and instantiation.
275 2016-01-29 Jakub Jelinek <jakub@redhat.com>
278 * decl.c (wrapup_globals_for_namespace): Warn about unused static
279 function declarations.
281 2016-01-29 Marek Polacek <polacek@redhat.com>
285 * constexpr.c (cxx_eval_array_reference): Give the "array subscript
286 out of bound" error earlier.
287 * init.c (build_vec_init): Change NE_EXPR into GT_EXPR. Update the
290 2016-01-29 Patrick Palka <ppalka@gcc.gnu.org>
292 * name-lookup.c (begin_scope): After reusing a cp_binding_level
293 structure, update free_binding_level before the structure's
294 level_chain field gets cleared, not after.
296 2016-01-28 Jason Merrill <jason@redhat.com>
299 * search.c (dfs_walk_once, dfs_walk_once_r)
300 (dfs_walk_once_accessible_r, dfs_walk_once_accessible): Use
301 hash_set instead of BINFO_MARKED.
302 (dfs_unmark_r): Remove.
304 2016-01-28 Patrick Palka <ppalka@gcc.gnu.org>
307 * parser.c (LEXER_DEBUGGING_ENABLED_P): New macro.
308 (cp_lexer_debugging_p): Use it.
309 (cp_lexer_start_debugging): Likewise.
310 (cp_lexer_stop_debugging): Likewise.
312 2016-01-27 Marek Polacek <polacek@redhat.com>
315 * typeck.c (cp_build_binary_op): Promote operand to unsigned, if
316 needed. Add -Wsign-compare warning.
318 2016-01-27 Ryan Burn <contact@rnburn.com>
321 * cp-gimplify.c (cilk_cp_gimplify_call_params_in_spawned_fn): Removed
322 superfluous post_p argument in call to
323 cilk_gimplify_call_params_in_spawned_fn.
325 2016-01-27 Marek Polacek <polacek@redhat.com>
328 * constexpr.c (cxx_eval_constant_expression): Handle PTRMEM_CSTs
329 wrapped in NOP_EXPRs.
331 2016-01-27 Martin Sebor <msebor@redhat.com>
334 * mangle.c (mangle_decl): Reference the correct (saved) version
335 of the ABI in -Wabi diagnostics.
337 2016-01-27 Marek Polacek <polacek@redhat.com>
340 * constexpr.c (cxx_eval_array_reference): Evaluate the number of
341 elements of the array.
343 2016-01-26 Jason Merrill <jason@redhat.com>
346 * constexpr.c (register_constexpr_fundef): Keep the un-massaged body.
347 (cxx_eval_call_expression): Don't look through clones.
348 * optimize.c (maybe_clone_body): Clear DECL_SAVED_TREE of the alias.
349 * semantics.c (expand_or_defer_fn_1): Keep DECL_SAVED_TREE of
350 maybe-in-charge *tor.
352 2016-01-26 Jason Merrill <jason@redhat.com>
355 * constexpr.c (cxx_eval_bare_aggregate): Update TREE_CONSTANT
356 and TREE_SIDE_EFFECTS.
357 (cxx_eval_constant_expression) [CONSTRUCTOR]: Call
358 verify_constructor_flags.
360 2016-01-26 Jakub Jelinek <jakub@redhat.com>
363 * cp-gimplify.c (cp_fold): If some operand folds to error_mark_node,
364 return error_mark_node instead of building trees with error_mark_node
367 2016-01-26 David Malcolm <dmalcolm@redhat.com>
370 * error.c (print_instantiation_partial_context_line): Add missing
371 newlines from output for the t == NULL case.
372 (print_instantiation_partial_context): Remove call to pp_newline.
374 2016-01-24 Patrick Palka <ppalka@gcc.gnu.org>
377 2016-01-18 Patrick Palka <ppalka@gcc.gnu.org>
382 * decl.c (grokdeclarator): Don't decay array parameter type to
383 a pointer type if it's dependent.
384 (grokparms): Invoke strip_top_quals instead of directly invoking
385 cp_build_qualified_type.
386 * pt.c (decay_dependent_array_parm_type): New static function.
387 (type_unification_real): Call decay_dependent_array_parm_type
388 to decay a dependent array parameter type to its corresponding
389 pointer type before unification.
390 (more_specialized_fn): Likewise.
391 (get_bindings): Likewise.
392 * tree.c (cp_build_qualified_type): Trivial typofix in
395 2016-01-23 Martin Sebor <msebor@redhat.com>
399 * decl2.c (is_late_template_attribute): Handle dependent argument
400 to attribute align and attribute vector_size.
402 2016-01-21 Jason Merrill <jason@redhat.com>
405 * lambda.c (lambda_capture_field_type): Handle 'this' specially
406 for init-capture, too.
409 * decl.c (type_is_deprecated): Don't look into a typedef.
413 * decl.c (copy_type_enum): Respect TYPE_USER_ALIGN.
416 * decl.c (start_enum): Add attributes parameter.
417 * parser.c (cp_parser_enum_specifier): Pass it.
418 * pt.c (lookup_template_class_1): Pass it.
421 2016-01-19 Jason Merrill <jason@redhat.com>
424 * pt.c (convert_template_argument): Handle VAR_DECL properly.
426 2016-01-19 Marek Polacek <polacek@redhat.com>
429 * constexpr.c (clear_cv_cache): New.
430 * cp-gimplify.c (clear_fold_cache): New.
431 * cp-tree.h (clear_cv_cache, clear_fold_cache): Declare.
432 * decl.c (finish_enum_value_list): Call them.
435 * pt.c (tsubst_copy): Mark elements in expanded vector as used.
437 2016-01-18 Patrick Palka <ppalka@gcc.gnu.org>
442 * decl.c (grokdeclarator): Don't decay array parameter type to
443 a pointer type if it's dependent.
444 (grokparms): Invoke strip_top_quals instead of directly invoking
445 cp_build_qualified_type.
446 * pt.c (decay_dependent_array_parm_type): New static function.
447 (type_unification_real): Call decay_dependent_array_parm_type
448 to decay a dependent array parameter type to its corresponding
449 pointer type before unification.
450 (more_specialized_fn): Likewise.
451 (get_bindings): Likewise.
452 * tree.c (cp_build_qualified_type): Trivial typofix in
455 2016-01-18 Jason Merrill <jason@redhat.com>
457 * cp-gimplify.c (cp_fold) [CONSTRUCTOR]: Don't clobber the input.
459 * cp-gimplify.c (cp_fold): Remove unnecessary special cases.
462 * cp-gimplify.c (cp_fold) [COND_EXPR]: Simplify. Do fold COND_EXPR.
463 (contains_label_1, contains_label_p): Remove.
465 2016-01-16 Patrick Palka <ppalka@gcc.gnu.org>
468 * pt.c (type_dependent_expression_p): For a function template
469 specialization, a type is dependent iff any of its template
472 2016-01-16 Patrick Palka <ppalka@gcc.gnu.org>
474 * cp-array-notation.c (cp_expand_cond_array_notations): Return
475 error_mark_node only if find_rank failed, not if it was
478 2016-01-16 Patrick Palka <ppalka@gcc.gnu.org>
481 * tree.c (build_min_non_dep_call_vec): Don't retain the
482 KOENIG_LOOKUP_P flag of the non-dependent expression that's
484 (build_min_non_dep_op_overload): Instead, do it here.
486 2016-01-15 Jakub Jelinek <jakub@redhat.com>
489 * parser.h (cp_token): Remove pragma_kind field. Add comment
490 with number of unused bits.
491 * parser.c (eof_token): Remove pragma_kind field initializer.
492 (cp_lexer_get_preprocessor_token): Don't set pragma_kind
493 field, don't clear CPP_PRAGMA u.value.
494 (cp_parser_pragma_kind): New function.
495 (cp_parser_omp_sections_scope, cp_parser_oacc_kernels_parallel,
496 cp_parser_omp_construct, cp_parser_initial_pragma,
497 cp_parser_pragma): Use cp_parser_pragma_kind instead of accessing
500 2016-01-15 Jason Merrill <jason@redhat.com>
503 * call.c (build_cxx_call): Use fold_non_dependent_expr.
505 * typeck2.c (cxx_incomplete_type_diagnostic): Use the location of
509 * typeck.c (decay_conversion): Don't call mark_rvalue_use for
510 array/function-to-pointer conversion. Call
511 complete_type_or_maybe_complain for lvalue-to-rvalue conversion.
512 * call.c (convert_like_real): Print call context if
513 decay_conversion errors.
515 2016-01-14 Tom de Vries <tom@codesourcery.com>
517 PR tree-optimization/68773
518 * parser.c (cp_parser_oacc_declare, cp_parser_omp_declare_target): Don't
521 2016-01-14 Jason Merrill <jason@redhat.com>
524 * constexpr.c (find_array_ctor_elt): Handle splitting RANGE_EXPR.
526 2016-01-12 Marek Polacek <polacek@redhat.com>
529 * constexpr.c (cxx_eval_check_shift_p): Use permerror rather than
530 error_at and adjust the return value.
532 2016-01-12 Jakub Jelinek <jakub@redhat.com>
536 * cp-gimplify.c (cp_gimplify_expr) <case INIT_EXPR>: Don't return
537 GS_ERROR whenever seen_error (), only if *expr_p contains
538 cilk spawn stmt, but cilk_detect_spawn_and_unwrap failed.
542 * pt.c (tsubst_decl): If not local_p, clear DECL_TEMPLATE_INFO.
544 2016-01-11 Jason Merrill <jason@redhat.com>
547 * method.c (walk_field_subobs): Add dtor_from_ctor parm.
548 (process_subob_fn): Likewise. Don't consider triviality if true.
549 (synthesize_method_walk): Pass it.
551 2016-01-11 David Malcolm <dmalcolm@redhat.com>
554 * parser.c (cp_parser_postfix_expression): Initialize
555 close_paren_loc to UNKNOWN_LOCATION; only use it if
556 it has been written to by
557 cp_parser_parenthesized_expression_list.
558 (cp_parser_parenthesized_expression_list): Document the behavior
559 with respect to the CLOSE_PAREN_LOC param.
561 2016-01-11 Jakub Jelinek <jakub@redhat.com>
564 * cp-gimplify.c (cp_fold): If COMPOUND_EXPR or MODIFY_EXPR
565 folded operands have side-effects, but folding changed any of them,
566 build a new tree with the folded operands instead of returning the
569 2016-01-09 Marek Polacek <polacek@redhat.com>
572 * decl2.c (comdat_linkage): Only set DECL_COMDAT if TREE_PUBLIC is set.
574 2016-01-09 Jakub Jelinek <jakub@redhat.com>
577 * class.c (layout_class_type): Use copy_node to copy FIELD_DECLs.
579 2016-01-08 Jason Merrill <jason@redhat.com>
582 * constexpr.c (cxx_fold_indirect_ref): Handle array type differing
585 2016-01-08 Marek Polacek <polacek@redhat.com>
588 * constexpr.c (cxx_eval_constant_expression): Handle NULL initializer.
590 2016-01-08 Jason Merrill <jason@redhat.com>
592 * constexpr.c (cxx_eval_call_expression): Remove convert_to_void
597 * cvt.c (convert_to_void): Don't strip a TARGET_EXPR of
598 TREE_ADDRESSABLE type.
602 * call.c (unsafe_copy_elision_p): Look through COMPOUND_EXPR.
604 2016-01-05 Nathan Sidwell <nathan@acm.org>
607 * pt.c (build_non_dependent_expr): Don't try a checking fold when
610 2016-01-04 Jakub Jelinek <jakub@redhat.com>
612 Update copyright years.
614 Copyright (C) 2016 Free Software Foundation, Inc.
616 Copying and distribution of this file, with or without modification,
617 are permitted in any medium without royalty provided the copyright
618 notice and this notice are preserved.