1 2014-10-03 Jason Merrill <jason@redhat.com>
4 * tree.c (strip_typedefs): Handle TREE_LIST.
6 2014-10-03 Paolo Carlini <paolo.carlini@oracle.com>
8 * parser.c (cp_parser_assignment_expression,
9 cp_parser_constant_expression): Add default arguments.
10 (cp_parser_primary_expression,
11 cp_parser_postfix_open_square_expression,
12 cp_parser_parenthesized_expression_list,
13 cp_parser_question_colon_clause,
14 cp_parser_expression, cp_parser_constant_expression,
15 cp_parser_label_for_labeled_statement, cp_parser_static_assert,
16 cp_parser_template_argument, cp_parser_enumerator_definition,
17 cp_parser_member_declaration, cp_parser_constant_initializer,
18 cp_parser_noexcept_specification_opt, cp_parser_throw_expression,
19 cp_parser_std_attribute_spec, cp_parser_objc_message_args,
20 cp_parser_objc_class_ivars, cp_parser_omp_clause_collapse,
21 cp_parser_omp_clause_aligned, cp_parser_omp_clause_safelen,
22 cp_parser_omp_clause_simdlen, cp_parser_omp_clause_dist_schedule,
23 cp_parser_omp_for_incr, cp_parser_omp_for_loop_init,
24 cp_parser_cilk_simd_vectorlength, cp_parser_cilk_simd_linear): Adjust.
26 2014-10-02 Paolo Carlini <paolo.carlini@oracle.com>
29 * cp-tree.h (struct saved_scope): Add noexcept_operand.
30 (cp_noexcept_operand): Define.
31 * call.c (build_over_call): Use it.
32 * parser.c (cp_parser_unary_expression, [RID_NOEXCEPT]): Likewise.
33 * pt.c (tsubst_copy_and_build, [NOEXCEPT_EXPR]): Likewise.
35 2014-10-01 Jason Merrill <jason@redhat.com>
38 * method.c (constructible_expr): Handle value-init of non-class.
39 * parser.c (cp_parser_trait_expr): Allow pack expansion.
40 * pt.c (tsubst_copy_and_build): Handle pack expansion.
43 * class.c (type_has_non_user_provided_default_constructor): Rename
44 from type_has_user_provided_default_constructor, reverse sense.
45 (default_init_uninitialized_part, explain_non_literal_class): Adjust.
46 (check_bases_and_members): Set TYPE_HAS_COMPLEX_DFLT.
47 * call.c (build_new_method_call_1): Adjust.
49 * decl.c (grok_special_member_properties): Don't set
50 TYPE_HAS_COMPLEX_DFLT.
51 * init.c (build_value_init_noctor): Don't use
52 type_has_user_provided_default_constructor.
54 2014-09-30 Jason Merrill <jason@redhat.com>
56 * cp-tree.h (cp_trait_kind): Add CPTK_IS_TRIVIALLY_ASSIGNABLE and
57 CPTK_IS_TRIVIALLY_CONSTRUCTIBLE.
58 * cxx-pretty-print.c (pp_cxx_trait_expression): Likewise.
59 * parser.c (cp_parser_primary_expression): Likewise.
60 (cp_parser_trait_expr): Likewise. Handle variadic trait.
61 * semantics.c (trait_expr_value): Likewise.
62 (finish_trait_expr): Likewise.
63 (check_trait_type): Handle variadic trait. Return bool.
64 * method.c (build_stub_object): Add rvalue reference here.
65 (locate_fn_flags): Not here.
66 (check_nontriv, assignable_expr, constructible_expr): New.
67 (is_trivially_xible): New.
69 * cp-tree.h (cp_trait_kind): Add CPTK_IS_TRIVIALLY_COPYABLE.
70 * cxx-pretty-print.c (pp_cxx_trait_expression): Likewise.
71 * parser.c (cp_parser_primary_expression): Likewise.
72 (cp_parser_trait_expr): Likewise.
73 * semantics.c (trait_expr_value): Likewise.
74 (finish_trait_expr): Likewise.
76 * method.c (build_stub_object): Use CONVERT_EXPR.
77 * tree.c (build_dummy_object): Likewise.
78 (is_dummy_object): Adjust.
80 * cp-tree.h (cp_trait_kind): Remove CPTK_IS_CONVERTIBLE_TO.
81 * cxx-pretty-print.c (pp_cxx_trait_expression): Likewise.
82 * semantics.c (trait_expr_value): Likewise.
83 (finish_trait_expr): Likewise.
84 * parser.c (cp_parser_primary_expression): Likewise.
85 (cp_parser_trait_expr): Likewise. Remove redundant grokdeclarator.
87 2014-09-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
90 * error.c (print_instantiation_context): Delete.
91 * typeck2.c (build_x_arrow): Record location when pushing
92 template instantiation.
93 * pt.c (push_tinst_level): Make it a wrapper around ...
94 (push_tinst_level_loc): ... this. New function. Make excessive
95 template instantiation depth a fatal error. Record location. Use
97 (instantiate_pending_templates): Make excessive
98 template instantiation depth a fatal error.
99 (problematic_instantiation_changed): Use bool as return type.
100 * cp-tree.h (print_instantiation_context): Delete.
101 (push_tinst_level): Update declaration.
102 (problematic_instantiation_changed): Likewise.
103 (push_tinst_level_loc): New.
105 2014-09-29 Richard Biener <rguenther@suse.de>
107 * typeck.c (enum_cast_to_int): Use CONVERT_EXPR_P to check
110 2014-09-26 Jason Merrill <jason@redhat.com>
112 * mangle.c (find_substitution): Use write_abi_tags.
114 2014-09-25 Marek Polacek <polacek@redhat.com>
117 * class.c (warn_hidden): Check for FUNCTION_DECL.
119 2014-09-25 Jakub Jelinek <jakub@redhat.com>
122 * semantics.c (handle_omp_array_sections_1): Call mark_rvalue_use
123 on low_bound and length.
125 2014-09-24 Aldy Hernandez <aldyh@redhat.com>
127 * class.c, decl.c, optimize.c: Rename all instances of
128 DECL_ABSTRACT to DECL_ABSTRACT_P.
130 2014-09-24 Marek Polacek <polacek@redhat.com>
134 * semantics.c (finish_switch_cond): Call unlowered_expr_type.
135 * tree.c (bot_manip): Add default case.
136 * parser.c (cp_parser_primary_expression): Cast the controlling
137 expression of a switch to an int.
138 (cp_parser_unqualified_id): Likewise.
140 2014-09-23 Paolo Carlini <paolo.carlini@oracle.com>
143 * parser.c (cp_parser_skip_to_closing_square_bracket,
144 cp_parser_array_designator_p): New.
145 (cp_parser_initializer_list): Use the latter.
147 2014-09-22 Jason Merrill <jason@redhat.com>
149 * semantics.c (finish_non_static_data_member): In diagnostic, give
150 error at point of use and note at point of declaration.
155 * lambda.c (maybe_resolve_dummy, lambda_expr_this_capture): Handle
158 2014-09-22 Paolo Carlini <paolo.carlini@oracle.com>
161 * pt.c (check_default_tmpl_args): Check LAMBDA_FUNCTION_P.
163 2014-09-22 Jason Merrill <jason@redhat.com>
165 * decl.c (poplevel): Don't warn about unused vars in template scope.
166 * error.c (dump_decl): Handle variable templates.
168 2014-09-20 Jason Merrill <jason@redhat.com>
171 * decl.c (begin_destructor_body): Only clobber the as-base part of
174 2014-09-19 Jason Merrill <jason@redhat.com>
177 * mangle.c (write_expression): Use unresolved-name mangling for
181 * call.c (convert_like_real) [ck_identity]: Call mark_rvalue_use
182 after pulling out an element from a CONSTRUCTOR.
184 2014-09-18 Jakub Jelinek <jakub@redhat.com>
187 * semantics.c (finish_omp_clauses): Don't call cp_omp_mappable_type
188 on type of type dependent expressions, and don't call it if
189 handle_omp_array_sections has kept TREE_LIST because something
191 * pt.c (tsubst_expr) <case OMP_TARGET, case OMP_TARGET_DATA>:
192 Use keep_next_level, begin_omp_structured_block and
193 finish_omp_structured_block instead of push_stmt_list and
196 2014-09-18 Paolo Carlini <paolo.carlini@oracle.com>
199 * class.c (finish_struct_1): Do not -Wnon-virtual-dtor warn
200 for final class types.
202 2014-09-15 Jason Merrill <jason@redhat.com>
204 * pt.c (lookup_template_class_1): Splice out abi_tag attribute if
205 necessary. Call inherit_targ_abi_tags here.
206 * class.c (check_bases_and_members): Not here.
207 (inherit_targ_abi_tags): Check CLASS_TYPE_P.
208 * cp-tree.h: Declare inherit_targ_abi_tags.
210 2014-09-15 Ville Voutilainen <ville.voutilainen@gmail.com>
212 Do not diagnose lambda default arguments in c++14 modes.
213 * parser.c (cp_parser_lambda_declarator_opt): Make the pedwarn
216 2014-09-15 Jakub Jelinek <jakub@redhat.com>
218 * Make-lang.in (check_g++_parallelize): Change to just an upper bound
221 2014-09-13 Marek Polacek <polacek@redhat.com>
224 * parser.c (cp_parser_postfix_expression) <case CPP_OPEN_PAREN>: Set
225 location of a call expression.
227 2014-09-11 Jason Merrill <jason@redhat.com>
230 * decl.c (start_decl): Handle specialization of member variable
232 * pt.c (check_explicit_specialization): Adjust error.
234 2014-09-11 Paolo Carlini <paolo.carlini@oracle.com>
237 * typeck2.c (process_init_constructor_record): Do not warn about
238 missing field initializer if EMPTY_CONSTRUCTOR_P (init).
240 2014-09-11 Jason Merrill <jason@redhat.com>
243 * pt.c (tsubst_pack_expansion): Simplify substitution into T....
244 (tsubst): Don't throw away PACK_EXPANSION_EXTRA_ARGS.
246 2014-09-10 Jason Merrill <jason@redhat.com>
249 * decl.c (grokfndecl): Don't set DECL_COMDAT on static inlines.
250 (duplicate_decls, start_decl): Likewise.
251 * pt.c (check_explicit_specialization): Likewise.
252 (push_template_decl_real): Or static templates.
254 2014-09-08 Jason Merrill <jason@redhat.com>
256 * typeck.c (build_class_member_access_expr): Move
257 -Winvalid-offsetof code...
258 * semantics.c (finish_offsetof): ...here.
259 * parser.c (cp_parser_builtin_offsetof): Remember the location of
261 * pt.c (tsubst_copy_and_build) [OFFSETOF_EXPR]: Preserve it.
264 * pt.c (instantiate_decl): Handle recursive instantiation of
267 2014-09-05 Jason Merrill <jason@redhat.com>
270 * semantics.c (potential_constant_expression_1): Handle un-folded
271 pointer to member constants.
273 2014-09-04 Markus Trippelsdorf <markus@trippelsdorf.de>
276 * decl.c (duplicate_decls): Check DECL_DECLARED_INLINE_P on
277 newdecl, not olddecl.
279 2014-09-02 Paolo Carlini <paolo.carlini@oracle.com>
282 * class.c (check_field_decls): A class of literal type cannot have
283 volatile non-static data members and base classes.
284 (explain_non_literal_class): Update.
286 2014-09-02 Jakub Jelinek <jakub@redhat.com>
287 Balaji V. Iyer <balaji.v.iyer@intel.com>
288 Igor Zamyatin <igor.zamyatin@intel.com>
290 * cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Loc definition
292 * parser.c (cp_parser_cilk_for): New function.
293 (cp_parser_cilk_grainsize): Likewise.
294 (cp_parser_statement): Added RID_CILK_FOR case.
295 (cp_parser_omp_for_cond): Added CILK_FOR check.
296 (cp_parser_omp_for_loop_init): Change function argument to accept
297 tree_code instead just a bool flag; change the check to use that
298 tree_code; check for initialization declaration in case of Cilk_for.
299 (cp_parser_omp_for_loop): Added checks for CILK_FOR and RID_CILK_FOR;
300 changed call to cp_parser_omp_for_loop_init according new arguments'
302 (cp_parser_pragma): Added PRAGMA_CILK_GRAINSIZE case.
303 * pt.c (tsubst_expr): Added CILK_FOR case.
304 * semantics.c: Include convert.h.
305 (finish_omp_clauses): Properly handle OMP_CLAUSE_SCHEDULE_CILKFOR
306 case; added OMP_CLAUSE__CILK_FOR_COUNT_.
307 (handle_omp_for_class_iterator): New argument lastp and its usage;
309 (finish_omp_for): Changed call to handle_omp_for_class_iterator
310 according new arguments' list; in case of Cilk_for save very first
311 decl and create empty stmt_list block; use block to build correct
314 2014-08-31 Jason Merrill <jason@redhat.com>
317 * optimize.c (cdtor_comdat_group): Just look at the
318 DECL_ASSEMBLER_NAME of the 'tors.
320 2014-08-27 Paolo Carlini <paolo.carlini@oracle.com>
323 * semantics.c (cxx_eval_call_expression): Use STRIP_NOPS on the
324 result of cxx_eval_constant_expression.
326 2014-08-26 Jason Merrill <jason@redhat.com>
329 * pt.c (tsubst_decl) [VAR_DECL]: Copy TLS model.
330 (tsubst_copy_and_build) [VAR_DECL]: Use TLS wrapper.
331 * semantics.c (finish_id_expression): Don't call TLS wrapper in a
334 2014-08-25 Jason Merrill <jason@redhat.com>
336 * pt.c (check_explicit_specialization): Don't complain about
337 non-template variable.
338 (template_for_substitution): Allow variable templates.
339 (check_template_variable): Fix logic for member var template.
340 * decl.c (start_decl): Don't complain about extra template header
343 * decl.c (start_decl): Look through member variable template.
344 * pt.c (tsubst_decl) [VAR_DECL]: Handle member variable templates.
345 * decl2.c (grokfield): Set DECL_CONTEXT earlier on
348 2014-08-25 Paolo Carlini <paolo.carlini@oracle.com>
351 * cp-tree.h (TFF_POINTER): Add.
352 * cxx-pretty-print.h (pp_cxx_cv_qualifiers): Forward the third
354 * error.c (dump_type_suffix): Actually print the const and noreturn
355 attribute when appropriate.
357 2014-08-23 Edward Smith-Rowland <3dw4rd@verizon.net>
359 * decl.c (compute_array_index_type, grokdeclarator,
360 undeduced_auto_decl): Change from cxx1y to cxx14.
361 *lambda.c(add_capture()): Change error message from C++1y to C++14.
362 * parser.c (cp_parser_unqualified_id, cp_parser_pseudo_destructor_name,
363 cp_parser_lambda_introducer, cp_parser_lambda_declarator_opt,
364 cp_parser_decltype, cp_parser_conversion_type_id,
365 cp_parser_simple_type_specifier, cp_parser_type_id_1,
366 cp_parser_template_type_arg, cp_parser_std_attribute,
367 cp_parser_template_declaration_after_export): Ditto.
368 * pt.c (tsubst): Ditto.
369 * semantics.c (force_paren_expr, finish_decltype_type): Ditto.
370 * tree.c: Change comment.
371 * typeck.c (comp_template_parms_position, cxx_sizeof_or_alignof_type,
372 cp_build_addr_expr_1, maybe_warn_about_useless_cast): Ditto.
374 2014-08-23 Jason Merrill <jason@redhat.com>
376 Allow non-constexpr variable templates.
377 * decl2.c (note_variable_template_instantiation): New.
378 * cp-tree.h: Declare it.
379 * pt.c (instantiate_decl): Call it.
380 (push_template_decl_real): Allow non-constexpr variable templates.
381 * semantics.c (finish_id_expression): Mark the variable template
382 instantiation as used.
383 * mangle.c (write_mangled_name): Variable template instantiations
385 * parser.c (cp_parser_init_declarator): Complain about
386 non-function implicit templates.
388 2014-08-22 Marek Polacek <polacek@redhat.com>
391 * parser.c (cp_parser_binary_expression): Check each LHS if it's
392 preceded with logical not. Adjust call to
393 warn_logical_not_parentheses.
395 2014-08-22 Manuel López-Ibáñez <manu@gcc.gnu.org>
398 * name-lookup.c (pushdecl_maybe_friend_1): Do not warn if a
399 declaration shadows a function declaration, unless the former
400 declares a function, pointer to function or pointer to member
401 function, because this is a common and valid case in real-world
403 * cp-tree.h (TYPE_PTRFN_P,TYPE_REFFN_P,TYPE_PTRMEMFUNC_P):
406 2014-08-22 Jason Merrill <jason@redhat.com>
409 * class.c (outermost_open_class): Fix logic.
410 * decl.c (complete_vars): Fix logic.
412 2014-08-22 Jason Merrill <jason@redhat.com>
415 * class.c (outermost_open_class): New.
416 * cp-tree.h: Declare it.
417 * decl.c (maybe_register_incomplete_var): Use it.
418 (complete_vars): Handle any constant variable.
419 * expr.c (cplus_expand_constant): Handle CONSTRUCTOR.
421 2014-08-22 Igor Zamyatin <igor.zamyatin@intel.com>
424 * cp-array-notation.c (build_array_notation_ref): Added correct
425 handling of case with incorrect array.
427 2014-08-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
430 * error.c (cp_diagnostic_finalizer): Delete.
431 (init_error): Do not set diagnostic_finalizer here.
433 2014-08-19 Marek Polacek <polacek@redhat.com>
436 * call.c (build_new_op_1): Remember the type of arguments for
437 a comparison. If either operand of a comparison is a boolean
438 expression, call maybe_warn_bool_compare.
440 2014-08-19 Jason Merrill <jason@redhat.com>
442 PR tree-optimization/62091
443 * decl2.c (decl_needed_p): Return true for virtual functions when
448 * decl.c (maybe_commonize_var): Don't use DECL_COMDAT to trigger
451 2014-08-19 Gerald Pfeifer <gerald@pfeifer.com>
453 * class.c (contains_empty_class_p): Remove.
455 2014-08-18 Paolo Carlini <paolo.carlini@oracle.com>
457 * parser.c (cp_parser_expression): Add default arguments.
458 (cp_parser_primary_expression, cp_parser_postfix_expression,
459 cp_parser_array_notation, cp_parser_postfix_open_square_expression,
460 cp_parser_unary_expression, cp_parser_direct_new_declarator,
461 cp_parser_question_colon_clause, cp_parser_assignment_operator_opt,
462 cp_parser_lambda_body, cp_parser_expression_statement,
463 cp_parser_condition, cp_parser_c_for, cp_parser_range_for,
464 cp_parser_iteration_statement, cp_parser_jump_statement,
465 cp_parser_decltype_expr, cp_parser_noexcept_specification_opt,
466 cp_parser_asm_operand_list, cp_parser_objc_message_receiver,
467 cp_parser_objc_synchronized_statement, cp_parser_objc_throw_statement,
468 cp_parser_omp_var_list_no_open, cp_parser_omp_clause_num_threads,
469 cp_parser_omp_clause_num_teams, cp_parser_omp_clause_thread_limit,
470 cp_parser_omp_clause_linear, cp_parser_omp_clause_device,
471 cp_parser_omp_atomic, cp_parser_omp_for_loop_init,
472 cp_parser_omp_for_loop, cp_parser_omp_declare_reduction_exprs,
473 cp_parser_transaction_expression): Adjust.
475 2014-08-15 Jason Merrill <jason@redhat.com>
478 * pt.c (lookup_template_class_1): Revert recent change.
479 * mangle.c (CLASSTYPE_TEMPLATE_ID_P): Revert recent change.
482 * pt.c (instantiate_class_template_1): Ignore lambda on
484 (push_template_decl_real): A lambda is not primary.
485 (lookup_template_class_1): Don't look for a lambda partial
487 * lambda.c (maybe_add_lambda_conv_op): Distinguish between being
488 currently in a function and the lambda living in a function.
489 * mangle.c (CLASSTYPE_TEMPLATE_ID_P): False for lambda.
491 2014-08-15 Richard Biener <rguenther@suse.de>
492 Jason Merrill <jason@redhat.com>
495 * tree.c (build_min_array_type, set_array_type_canon): Split out...
496 (build_cplus_array_type): ...from here. Only call build_array_type
499 2014-08-15 Paolo Carlini <paolo.carlini@oracle.com>
503 2014-07-09 Paolo Carlini <paolo.carlini@oracle.com>
507 * pt.c (check_cv_quals_for_unify): Implement resolution, disregard
508 cv-qualifiers of function types.
510 2014-08-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
512 * call.c (build_conditional_expr_1): Use OPT_Wextra in warning.
514 2014-08-14 Paolo Carlini <paolo.carlini@oracle.com>
516 * typeck.c (composite_pointer_type, cxx_sizeof_or_alignof_type,
517 cp_build_array_ref, cp_build_function_call_vec): When a
518 pedwarn is suppressed under SFINAE, return error_mark_node.
520 * typeck.c (cxx_sizeof_or_alignof_type): Fix complain &
521 tf_warning_or_error, where complain is a bool, glitch.
523 2014-08-14 Ville Voutilainen <ville.voutilainen@gmail.com>
526 * decl.c (grokdeclarator): Move the check for friend initializers..
527 * decl2.c (grokfield) ..here. Postpone early return for friends
528 until after the initializer check.
530 2014-08-14 Paolo Carlini <paolo.carlini@oracle.com>
533 * pt.c (coerce_template_parms): Improve error message vs default
536 2014-08-14 Paolo Carlini <paolo.carlini@oracle.com>
538 * parser.c (cp_parser_init_declarator): Remove redundant check of
539 decl_specifiers->type.
541 2014-08-13 Jason Merrill <jason@redhat.com>
543 * call.c (build_x_va_arg): Support passing non-POD through ....
544 (convert_arg_to_ellipsis): Likewise.
546 2014-08-13 Andrew Sutton <andrew.n.sutton@gmail.com>
548 * pt.c (lookup_template_variable): Make dependent variable templates
551 2014-08-13 Paolo Carlini <paolo.carlini@oracle.com>
553 * parser.c (cp_parser_elaborated_type_specifier): Handle
554 specially cp_parser_template_id returning a BASELINK.
556 2014-08-13 Paolo Carlini <paolo.carlini@oracle.com>
558 * parser.c (cp_parser_diagnose_invalid_type_name,
559 cp_parser_make_typename_type): Remove scope parameter.
560 (cp_parser_parse_and_diagnose_invalid_type_name,
561 cp_parser_elaborated_type_specifier): Adjust calls.
563 2014-08-12 Ville Voutilainen <ville.voutilainen@gmail.com>
565 Reject virt-specifiers on friends and member templates
566 * friend.c (do_friend): Diagnose virt-specifiers.
567 * pt.c (push_template_decl_real): Diagnose virt-specifiers.
569 2014-08-09 Paolo Carlini <paolo.carlini@oracle.com>
571 * typeck2.c (check_narrowing): Add tsubst_flags_t parameter, change
572 return type to bool; in C++11 for constants give errors, not pedwarns.
573 * cp-tree.h (check_narrowing): Adjust declaration.
574 * call.c (convert_like_real): Update calls.
575 * semantics.c (finish_compound_literal): Likewise.
577 2014-08-08 Jason Merrill <jason@redhat.com>
579 * pt.c (lookup_template_class_1): Copy abi_tag.
581 2014-08-08 Kai Tietz <ktietz@redhat.com>
583 * semantics.c (expand_or_defer_fn_1): Check for keep-inline-dllexport
584 that we operate on a true inline.
586 2014-08-07 Trevor Saunders <tsaunders@mozilla.com>
588 * class.c, cp-gimplify.c, decl.c, decl2.c, error.c, method.c,
589 optimize.c, pt.c, semantics.c: Remove includes of pointer-set.h.
591 2014-08-07 Paolo Carlini <paolo.carlini@oracle.com>
594 * decl.c (build_enumerator): Handle class types with conversion
595 operators via perform_implicit_conversion_flags and
596 build_expr_type_conversion.
598 * cvt.c (build_expr_type_conversion): Replace pair of errors
601 2014-08-07 Jason Merrill <jason@redhat.com>
604 * parser.c (c_parse_file): Change sorry to fatal_error.
607 * semantics.c (cxx_eval_bare_aggregate): Handle POINTER_PLUS_EXPR.
609 2014-08-07 Trevor Saunders <tsaunders@mozilla.com>
611 * cp-tree.h, pt.c: Use hash_map instead of pointer_map.
613 2014-08-06 Jason Merrill <jason@redhat.com>
615 * init.c (build_vec_init): Fix constant initialization of
617 (build_value_init_noctor): Call maybe_constant_init.
618 * semantics.c (maybe_constant_init): See through EXPR_STMT and
622 * init.c (build_vec_init): Reorganize earlier change a bit.
625 * init.c (build_vec_init): Leave atype an ARRAY_TYPE
626 if we're just returning an INIT_EXPR.
628 2014-08-06 Jason Merrill <jason@redhat.com>
629 Braden Obrzut <admin@maniacsvault.net>
631 * pt.c (check_explicit_specialization): Don't test
632 DECL_DECLARED_INLINE_P for a variable template.
634 2014-08-06 Paolo Carlini <paolo.carlini@oracle.com>
637 * typeck.c (cp_build_binary_op): Extend to more cases the
640 2014-08-01 Braden Obrzut <admin@maniacsvault.net>
642 Implement constexpr variable templates
643 * decl.c (grokvardecl): Handle specializations of variable templates.
644 (grokdeclarator): Handle variable template id expressions and NULL_TREE
645 return from grokvardecl.
646 * decl2.c (check_member_template): Allow declaration of template member
648 * parser.c (cp_parser_template_id): Build a TEMPLATE_ID_EXPR for
650 * pt.c (check_template_variable): Accept variable temploids at
652 (push_template_decl_real): The current instantiation of a template
654 (determine_specialization): Accept variable templates.
655 (check_explicit_specialization): Handle and check for malformed
656 variable template specializations.
657 (lookup_template_variable): New.
658 (tsubst_decl): Handle variable template specializations.
659 (do_decl_instantiation): Handle template variables.
660 (instantiate_decl): Handle template variables.
661 * semantics.c (finish_template_variable): New.
662 (finish_id_expression): Instantiate variable templates.
663 * cp-tree.h (variable_template_p): New.
665 2014-08-02 Paolo Carlini <paolo.carlini@oracle.com>
668 * decl.c (check_redeclaration_no_default_args): New.
669 (duplicate_decls): Use it, handle default arguments
670 in redeclarations of function templates.
672 2014-08-02 Trevor Saunders <tsaunders@mozilla.com>
674 * optimize.c, semantics.c: Use hash_map instead of pointer_map.
676 2014-08-02 Trevor Saunders <tsaunders@mozilla.com>
678 * class.c, cp-gimplify.c, cp-tree.h, decl.c, decl2.c, error.c,
679 method.c, name-lookup.c, pt.c, semantics.c, tree.c: Use hash_set
680 instead of pointer_set.
682 2014-08-01 Jason Merrill <jason@redhat.com>
685 * init.c (build_vec_init): Set CONSTRUCTOR_IS_DIRECT_INIT on
686 init-list for trailing elements.
687 * typeck2.c (process_init_constructor_array): Likewise.
689 2014-08-01 Paolo Carlini <paolo.carlini@oracle.com>
692 * decl.c (duplicate_decls): Handle static member functions too.
694 2014-08-01 Igor Zamyatin <igor.zamyatin@intel.com>
696 * cp-array-notation.c (expand_an_in_modify_expr): Fix the misprint
699 2014-08-01 Igor Zamyatin <igor.zamyatin@intel.com>
702 * parser.c (cp_parser_array_notation): Added check for array_type.
704 2014-08-01 Igor Zamyatin <igor.zamyatin@intel.com>
707 * cp-array-notation.c (expand_array_notation_exprs): Handling of
708 DECL_EXPR improved. Changed handling for INIT_EXPR.
710 2014-08-01 Paolo Carlini <paolo.carlini@oracle.com>
712 * pt.c (lookup_template_class_1): Use DECL_TYPE_TEMPLATE_P.
714 2014-08-01 Jakub Jelinek <jakub@redhat.com>
716 * cp-gimplify.c (cp_genericize_r): For -fsanitize=null and/or
717 -fsanitize=alignment call ubsan_maybe_instrument_reference
718 for casts to REFERENCE_TYPE and ubsan_maybe_instrument_member_call
719 for calls to member functions.
721 2014-07-31 Marc Glisse <marc.glisse@inria.fr>
724 * typeck.c (maybe_warn_about_returning_address_of_local): Return
725 whether it is returning the address of a local variable.
726 (check_return_expr): Return 0 instead of the address of a local
729 2014-07-30 Jason Merrill <jason@redhat.com>
733 * pt.c (push_template_decl_real): Don't set DECL_COMDAT on friends.
735 2014-07-30 Paolo Carlini <paolo.carlini@oracle.com>
738 * pt.c (unify_arity): Add boolean parameter.
739 (unify_too_few_arguments): Likewise.
740 (type_unification_real): Diagnose correctly insufficient
741 arguments in the presence of trailing variadic parameters;
742 deducing multiple trailing packs as empty is fine.
744 2014-07-30 Jason Merrill <jason@redhat.com>
749 * decl2.c (mark_all_virtuals): New variable.
750 (maybe_emit_vtables): Check it instead of flag_devirtualize.
751 (cp_write_global_declarations): Set it and give helpful diagnostic
752 if it introduces errors.
753 * class.c (finish_struct_1): Check it.
757 * pt.c (push_template_decl_real): Set DECL_COMDAT on templates.
758 (check_explicit_specialization): Clear it on specializations.
759 * decl.c (duplicate_decls, start_decl): Likewise.
760 (grokmethod, grokfndecl): Set DECL_COMDAT on inlines.
761 * method.c (implicitly_declare_fn): Set DECL_COMDAT. Determine
762 linkage after setting the appropriate flags.
763 * tree.c (decl_linkage): Don't check DECL_COMDAT.
764 * decl2.c (mark_needed): Mark clones.
765 (import_export_decl): Not here.
767 2014-07-25 Edward Smith-Rowland <3dw4rd@verizon.net>
769 Implement N4051 - Allow typename in a template template parameter
770 * parser.c (cp_parser_type_parameter_key): New funtion;
771 (cp_parser_token_is_type_parameter_key): Ditto;
772 (cp_parser_type_parameter): Look for type-parameter-key for all versions
773 but pedwarn for less than cxx1z.
775 2014-07-17 Paolo Carlini <paolo.carlini@oracle.com>
778 * call.c (standard_conversion): Use resolve_nondeduced_context
779 for type_unknown_p (EXPR) && TREE_CODE (TO) == BOOLEAN_TYPE.
781 2014-07-17 Paolo Carlini <paolo.carlini@oracle.com>
784 * parser.c (cp_parser_tokens_start_cast_expression): Return -1
787 2014-07-15 Jason Merrill <jason@redhat.com>
790 * decl2.c (maybe_emit_vtables): Return true for -fuse-all-virtuals.
794 * call.c (is_std_init_list): Don't check CLASSTYPE_TEMPLATE_INFO.
795 * class.c (finish_struct): Reject invalid definition of
796 std::initializer_list.
798 2014-07-15 Paolo Carlini <paolo.carlini@oracle.com>
800 * call.c (convert_like_real): Call print_z_candidate and inform only
801 if permerror returns true.
803 2014-07-14 Jan Hubicka <hubicka@ucw.cz>
805 * class.c (build_clone): Do not clear assembler names of
807 * decl.c (cp_tree_node_structure): Add TEMPLATE_DECL.
808 * cp-objcp-common.c (cp_tree_size): Add TEMPLATE_DECL
809 as a special case return sizeof (struct tree_decl_non_common)
811 (cp_common_init_ts): Do not initialize NAMESPACE_DECL;
812 initialize TEMPLATE_DECL as MARK_TS_DECL_COMMON.
813 * cp/cp-tree.h (tree_template_decl): New structure.
814 (cp_tree_node_structure_enum): Add TS_CP_TEMPLATE_DECL.
815 (union cp_lang_tree_node): Add template_decl.
816 (DECL_TEMPLATE_PARMS, DECL_TEMPLATE_RESULT): Update.
818 2014-07-14 Jason Merrill <jason@redhat.com>
822 * pt.c (instantiate_decl): Don't check defer_ok for local class
825 2014-07-14 Jakub Jelinek <jakub@redhat.com>
828 * cp-tree.h (LITERAL_ZERO_P): Define.
829 * parser.c (cp_parser_parenthesized_expression_list): Add
830 want_literal_zero_p argument, if true, for literal zeros
831 insert INTEGER_CSTs with LITERAL_ZERO_P flag set.
832 (cp_parser_postfix_expression): Adjust
833 cp_parser_parenthesized_expression_list caller, handle
834 -Wmemset-transposed-args.
835 (literal_zeros): New variable.
837 2014-07-13 Jason Merrill <jason@redhat.com>
840 * semantics.c (is_instantiation_of_constexpr): Return true for
841 defaulted functions, too.
842 (explain_invalid_constexpr_fn): Only use
843 explain_implicit_non_constexpr if !DECL_DECLARED_CONSTEXPR_P.
844 * method.c (explain_implicit_non_constexpr): Pass
845 DECL_INHERITED_CTOR_BASE to explain_implicit_non_constexpr.
848 * decl.c (check_initializer): Don't finish_compound_literal
849 on erroneous constexpr init.
852 * tree.c (bot_replace): Only replace a dummy 'this' parm.
855 * decl.c (create_array_type_for_decl): Only check for auto once.
858 * call.c (build_list_conv): Don't try to build a list of references.
860 2014-07-13 Edward Smith-Rowland <3dw4rd@verizon.net>
862 PR C++/60209 - Declaration of user-defined literal operator cause error
863 * parser.c (cp_parser_operator): Fold treatment of strings
864 and user-defined string literals. Use the full string parser.
865 (cp_parser_string_literal): Add flag to not look for literal operator.
867 2014-07-11 Jason Merrill <jason@redhat.com>
871 * call.c (build_conditional_expr_1): Avoid reading freed memory.
873 2014-07-11 Paolo Carlini <paolo.carlini@oracle.com>
876 * call.c (build_user_type_conversion_1): Copy LOOKUP_NO_NARROWING
878 * decl.c (check_initializer): Don't call check_narrowing here,
879 set LOOKUP_NO_NARROWING.
880 * typeck2.c (digest_init_r): Likewise.
882 2014-07-10 Jason Merrill <jason@redhat.com>
885 * semantics.c (reduced_constant_expression_p): Handle CONSTRUCTOR.
889 * decl2.c (mark_all_virtuals): New variable.
890 (maybe_emit_vtables): Check it instead of flag_devirtualize.
891 (cp_write_global_declarations): Set it and give helpful diagnostic
892 if it introduces errors.
893 * class.c (finish_struct_1): Check it.
894 * decl.c (grokdeclarator): Clear virtualp after 'virtual auto' error.
896 2014-07-09 Paolo Carlini <paolo.carlini@oracle.com>
899 * decl.c (grokdeclarator): Adjust error messages about 'explicit'
900 outside class declaration, in friend declaration, and neither on
901 constructor nor conversion operator.
903 2014-07-09 Paolo Carlini <paolo.carlini@oracle.com>
907 * pt.c (check_cv_quals_for_unify): Implement resolution, disregard
908 cv-qualifiers of function types.
910 2014-07-09 Andrew Sutton <andrew.n.sutton@gmail.com>
911 Paolo Carlini <paolo.carlini@oracle.com>
914 * parser.c (cp_parser_tokens_start_cast_expression): Return 0 for
917 2014-07-07 Paolo Carlini <paolo.carlini@oracle.com>
919 * class.c (check_for_override): Wrap the 'final' and 'override'
920 keywords in %< and %>.
922 2014-07-06 Marek Polacek <polacek@redhat.com>
925 * cp-tree.h (DECL_ARRAY_PARAMETER_P): Define.
926 * decl.c (grokdeclarator): Set DECL_ARRAY_PARAMETER_P.
927 * typeck.c (cxx_sizeof_expr): Warn when using sizeof on an array
930 2014-07-02 Paolo Carlini <paolo.carlini@oracle.com>
932 * pt.c (convert_template_argument): Use inform instead of error in
935 2014-06-30 Edward Smith-Rowland <3dw4rd@verizon.net>
940 * parser.c (cp_parser_userdef_string_literal): Take a tree
942 (cp_parser_string_literal): Don't hack the token stream.
944 2014-06-30 Jason Merrill <jason@redhat.com>
948 * decl2.c (maybe_emit_vtables): Mark all vtable entries if
950 * init.c (build_vtbl_address): Don't mark destructor.
951 * class.c (finish_struct_1): Add all classes to keyed_classes
955 * pt.c (type_dependent_expression_p): Check BASELINK_OPTYPE.
958 * mangle.c (decl_mangling_context): Look through a TEMPLATE_DECL.
960 * decl.c (build_ptrmemfunc_type): Don't give a PMF RECORD_TYPE
961 TYPE_BINFO or TYPE_LANG_SPECIFIC.
962 * cp-tree.h (TYPE_PTRMEMFUNC_FLAG): Use TYPE_LANG_FLAG_2.
963 (TYPE_PTRMEMFUNC_P): Don't expect TYPE_LANG_SPECIFIC.
964 * typeck.c (build_ptrmemfunc_access_expr): Don't use lookup_member.
965 * pt.c (unify): Also check whether the argument is a PMF.
967 2014-06-30 Paolo Carlini <paolo.carlini@oracle.com>
970 * parser.c (cp_parser_tokens_start_cast_expression): In C++11
971 a '[' can also start a primary-expression.
972 (cp_parser_cast_expression): Parse a cast-expression only tentatively
973 when cp_parser_tokens_start_cast_expression returns -1.
975 2014-06-30 Jason Merrill <jason@redhat.com>
978 * pt.c (unify_one_argument): Type/expression mismatch just causes
981 * semantics.c (simplify_aggr_init_expr): Remove remnants of
984 2014-06-30 Marek Polacek <polacek@redhat.com>
986 * cp-gimplify.c (cp_genericize): Don't instrument returns if the
987 function has no_sanitize_undefined attribute.
988 * decl.c (compute_array_index_type): Don't instrument VLAs if the
989 function has no_sanitize_undefined attribute.
991 2014-06-30 Igor Zamyatin <igor.zamyatin@intel.com>
994 * cp-array-notation.c (expand_sec_reduce_builtin):
995 Check that bultin argument is correct.
996 * call.c (build_cxx_call): Check for 0 arguments in builtin call.
998 2014-06-28 Jonathan Wakely <jwakely@redhat.com>
1002 * typeck.c (check_return_expr): Lookup as an rvalue even when the
1003 types aren't the same.
1005 2014-06-27 Jason Merrill <jason@redhat.com>
1008 * error.c (dump_template_bindings): Don't tsubst in a clone.
1010 2014-06-27 Paolo Carlini <paolo.carlini@oracle.com>
1013 * semantics.c (finish_compound_literal): Revert r204228.
1015 2014-06-27 Paolo Carlini <paolo.carlini@oracle.com>
1017 * parser.c (cp_parser_compound_literal_p): New.
1018 (cp_parser_postfix_expression, cp_parser_sizeof_operand): Use it.
1020 2014-06-26 Jason Merrill <jason@redhat.com>
1022 * parser.c (cp_parser_for_init_statement): Change range-for error
1025 N3994 Ranged-based for-loops: The Next Generation
1026 * parser.c (cp_lexer_nth_token_is): New.
1027 (cp_parser_for_init_statement): Allow "for (id : init)".
1029 2014-06-26 Teresa Johnson <tejohnson@google.com>
1031 * class.c (dump_class_hierarchy): Use saved dump files.
1032 (dump_vtable): Ditto.
1035 2014-06-26 Adam Butcher <adam@jessamine.co.uk>
1038 * parser.c (cp_parser_elaborated_type_specifier): Only consider template
1039 parameter lists outside of function parameter scope.
1041 2014-06-25 Paolo Carlini <paolo.carlini@oracle.com>
1045 * typeck2.c (process_init_constructor_record): Do not complain about
1046 uninitialized const members, because within aggregate-initialization,
1047 members without explicit initializers are value-initialized.
1049 2014-06-25 Jakub Jelinek <jakub@redhat.com>
1051 * semantics.c (finish_omp_clauses): Make sure
1052 OMP_CLAUSE_LINEAR_STEP has correct type.
1054 2014-06-24 Jan Hubicka <hubicka@ucw.cz>
1056 * class.c (check_methods, create_vtable_ptr, determine_key_method,
1057 add_vcall_offset_vtbl_entries_1): Guard VINDEX checks by
1058 FUNCTION_DECL check.
1059 * cp-tree.h (lang_decl_ns): Add ns_using and ns_users.
1060 (DECL_NAMESPACE_USING, DECL_NAMESPACE_USERS): Use lang_decl_ns.
1061 (DECL_NAMESPACE_ASSOCIATIONS): Use DECL_INITIAL.
1062 (DECL_TEMPLATE_INSTANTIATIONS): Use DECL_SIZE_UNIT.
1064 2014-06-24 Paolo Carlini <paolo.carlini@oracle.com>
1067 * decl.c (grokdeclarator): Do not early check for operator-function-id
1070 2014-06-24 Trevor Saunders <tsaunders@mozilla.com>
1072 * class.c, semantics.c, tree.c, vtable-class-hierarchy.c:
1075 2014-06-24 Jakub Jelinek <jakub@redhat.com>
1077 * parser.c (cp_parser_omp_for_loop): For
1078 #pragma omp parallel for simd move lastprivate clause from parallel
1079 to for rather than simd.
1081 2014-06-23 Paolo Carlini <paolo.carlini@oracle.com>
1085 * decl.c (grokparms): Accept a single parameter of type 'void'.
1087 2014-06-20 Jason Merrill <jason@redhat.com>
1090 * call.c (add_function_candidate): Avoid special 'this' handling
1091 if we have a ref-qualifier.
1094 * call.c (build_over_call): Call build_this in template path.
1096 2014-06-19 Jason Merrill <jason@redhat.com>
1099 * call.c (add_function_candidate): Also set LOOKUP_NO_TEMP_BIND.
1101 2014-06-18 Jason Merrill <jason@redhat.com>
1104 * call.c (add_function_candidate): Set LOOKUP_NO_RVAL_BIND for
1105 ref-qualifier handling.
1108 * pt.c (resolve_overloaded_unification): Preserve
1109 ARGUMENT_PACK_EXPLICIT_ARGS.
1111 2014-06-18 Jakub Jelinek <jakub@redhat.com>
1113 * cp-gimplify.c (cxx_omp_finish_clause): Add a gimple_seq *
1115 * cp-tree.h (cxx_omp_finish_clause): Adjust prototype.
1117 2014-06-17 Jason Merrill <jason@redhat.com>
1120 * pt.c (check_default_tmpl_args): Check DECL_LOCAL_FUNCTION_P.
1122 2014-06-15 Jason Merrill <jason@redhat.com>
1125 * pt.c (check_valid_ptrmem_cst_expr): Fix for template context.
1128 * tree.c (lvalue_kind): Handle MEMBER_REF and DOTSTAR_EXPR.
1130 2014-06-15 Jan Hubicka <hubicka@ucw.cz>
1132 * decl.c (grokvardecl): Fix pasto in previous patch.
1134 2014-06-15 Jan Hubicka <hubicka@ucw.cz>
1136 * decl.c (duplicate_decls): Use set_decl_tls_model.
1137 (grokdeclarator): Likewise.
1138 * semantics.c (finish_id_expression): Check TLS only for
1140 (finish_omp_threadprivate): Use decl_default_tls_model.
1141 * decl2.c (get_guard): Likewise.
1142 * call.c (make_temporary_var_for_ref_to_temp): Likewise.
1144 2014-06-14 Paolo Carlini <paolo.carlini@oracle.com>
1147 * decl.c (grokparms): Improve error message about void parameters.
1148 * error.c (type_to_string): Fix aka cut off code.
1150 2014-06-12 Jason Merrill <jason@redhat.com>
1152 * call.c (convert_arg_to_ellipsis): Use abi_version_crosses.
1153 * cvt.c (type_promotes_to): Likewise.
1154 * mangle.c (write_type, write_expression): Likewise.
1155 (write_name, write_template_arg): Likewise.
1156 (mangle_decl): Make alias based on flag_abi_compat_version.
1157 Emit -Wabi warning here.
1158 (finish_mangling_internal): Not here. Drop warn parm.
1159 (finish_mangling_get_identifier, finish_mangling): Adjust.
1160 (mangle_type_string, mangle_special_for_type): Adjust.
1161 (mangle_ctor_vtbl_for_type, mangle_thunk): Adjust.
1162 (mangle_guard_variable, mangle_tls_init_fn): Adjust.
1163 (mangle_tls_wrapper_fn, mangle_ref_init_variable): Adjust.
1165 * call.c (build_operator_new_call): Remove -fabi-version=1 support.
1166 * class.c (walk_subobject_offsets, include_empty_classes): Likewise.
1167 (layout_nonempty_base_or_field, end_of_class): Likewise.
1168 (layout_empty_base, build_base_field, layout_class_type): Likewise.
1169 (is_empty_class, add_vcall_offset_vtbl_entries_1): Likewise.
1170 (layout_virtual_bases): Likewise.
1171 * decl.c (compute_array_index_type): Likewise.
1172 * mangle.c (write_mangled_name, write_prefix): Likewise.
1173 (write_template_prefix, write_integer_cst, write_expression): Likewise.
1174 (write_template_arg, write_array_type): Likewise.
1175 * method.c (lazily_declare_fn): Likewise.
1176 * rtti.c (get_pseudo_ti_index): Likewise.
1177 * typeck.c (comp_array_types): Likewise.
1179 2014-06-11 Jan Hubicka <hubicka@ucw.cz>
1181 * vtable-class-hierarchy.c: Update handling for section names
1182 that are no longer trees.
1183 * decl.c (duplicate_decls): Likewise.
1185 2014-06-11 Paolo Carlini <paolo.carlini@oracle.com>
1188 * parser.c (cp_parser_init_declarator): Actually pass friend_p
1189 to cp_parser_declarator.
1191 2014-06-11 Paolo Carlini <paolo.carlini@oracle.com>
1194 * parser.c (cp_parser_using_declaration): Handle unscoped enums.
1195 * name-lookup.c (validate_nonmember_using_decl): Adjust error
1198 2014-06-11 Paolo Carlini <paolo.carlini@oracle.com>
1201 * parser.c (cp_parser_declarator): Add bool parameter.
1202 (cp_parser_direct_declarator): Likewise, use it.
1203 (cp_parser_member_declaration): Pass friend_p to cp_parser_declarator.
1204 (cp_parser_condition, cp_parser_explicit_instantiation,
1205 cp_parser_init_declarator, cp_parser_type_id_1,
1206 cp_parser_parameter_declaration, cp_parser_exception_declaration,
1207 cp_parser_cache_defarg, cp_parser_objc_class_ivars,
1208 cp_parser_objc_struct_declaration, cp_parser_omp_for_loop_init):
1210 * decl.c (grokdeclarator): Fix handling of friend declared in
1211 namespace scope (g++.dg/parse/friend10.C).
1213 2014-06-10 Jan Hubicka <hubicka@ucw.cz>
1215 * vtable-class-hierarchy.c: Use symtab_get_node (var_decl)
1217 * optimize.c (cdtor_comdat_group): Fix handling of aliases.
1218 (maybe_clone_body): Move symbol across comdat groups.
1219 * method.c (use_thunk): Copy implicit section flag.
1221 2014-06-09 Paolo Carlini <paolo.carlini@oracle.com>
1224 * name-lookup.c (pushdecl_maybe_friend_1): Use comptypes.
1226 2014-06-07 Jan Hubicka <hubicka@ucw.cz>
1228 * method.c (use_thunk): Use set_decl_section_name.
1229 * optimize.c (maybe_clone_body): Use set_decl_section_name.
1230 * decl.c (duplicate_decls): Likewise.
1231 * vtable-class-hierarchy.c: Likewise.
1233 2014-06-06 Paolo Carlini <paolo.carlini@oracle.com>
1236 * class.c (check_field_decls): In C++11 mode do not reject
1237 static data members and reference-type members in unions.
1239 2014-06-05 Jason Merrill <jason@redhat.com>
1242 * decl.c (check_initializer): Collapse a TREE_LIST here.
1243 * typeck2.c (store_init_value): Not here.
1245 2014-06-05 Richard Biener <rguenther@suse.de>
1246 Paolo Carlini <paolo.carlini@oracle.com>
1249 * cp-gimplify.c (cp_gimplify_expr, [MODIFY_EXPR]): Rework
1250 handling of empty classes.
1252 2014-06-04 Jason Merrill <jason@redhat.com>
1254 * parser.c (cp_parser_diagnose_invalid_type_name): Give helpful note
1255 for noexcept and thread_local, too.
1258 * decl.c (check_initializer): Maybe clear
1259 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
1261 2014-06-05 Richard Biener <rguenther@suse.de>
1264 * typeck.c (cp_build_indirect_ref): Do not emit strict-aliasing
1265 warnings for accessing empty classes.
1267 2014-06-05 Marek Polacek <polacek@redhat.com>
1270 * parser.c (cp_parser_binary_expression): Warn when logical not is
1271 used on the left hand side operand of a comparison.
1273 2014-06-04 Paolo Carlini <paolo.carlini@oracle.com>
1276 * typeck.c (cp_build_modify_expr): Handle array of characters
1277 initialized by a string literal.
1278 * decl.c (check_initializer): Handle parenthesized string literal
1280 * typeck2.c (store_init_value): Remove redundant check.
1282 2014-06-04 Jason Merrill <jason@redhat.com>
1286 * cp-gimplify.c (cp_gimplify_expr): Handle CALL_EXPR_LIST_INIT_P here.
1287 * semantics.c (simplify_aggr_init_expr): Not here, just copy it.
1289 2014-06-04 Igor Zamyatin <igor.zamyatin@intel.com>
1292 * cp-array-notation.c (expand_sec_reduce_builtin): Handle the case
1295 2014-06-03 Paolo Carlini <paolo.carlini@oracle.com>
1299 * call.c (standard_conversion): Convert nullptr to bool only
1300 in case of direct-initialization.
1301 (convert_like_real): Provide informative error message.
1303 2014-06-03 Marek Polacek <polacek@redhat.com>
1306 * semantics.c (finish_switch_cond): Warn if switch condition has
1309 2014-06-03 Jason Merrill <jason@redhat.com>
1312 * pt.c (tsubst_copy) [VAR_DECL]: Try lookup first. Add a new
1313 variable to local_specializations.
1316 * call.c (is_std_init_list): Check CLASSTYPE_TEMPLATE_INFO.
1318 2014-06-02 Jason Merrill <jason@redhat.com>
1321 * decl.c (reshape_init_class): Handle un-folded
1322 constant-expressions.
1325 * pt.c (pack_deducible_p): Handle canonicalization.
1327 2014-06-02 Paolo Carlini <paolo.carlini@oracle.com>
1329 * pt.c (tsubst_function_type): Initialize arg_types.
1331 2014-06-02 Siva Chandra Reddy <sivachandra@google.com>
1334 * class.c (handle_using_decl): Pass the correct scope to
1335 cp_emit_debug_info_for_using.
1337 2014-06-02 Ville Voutilainen <ville.voutilainen@gmail.com>
1341 * search.c (accessible_p): Use current_nonlambda_class_type.
1342 * semantics.c (check_accessibility_of_qualified_id): Likewise.
1344 2014-06-02 Andrew MacLeod <amacleod@redhat.com>
1346 * decl.c: Include builtins.h.
1347 * semantics.c: Likewise.
1349 2014-05-31 Paolo Carlini <paolo.carlini@oracle.com>
1353 * cp-tree.h (TYPE_HAS_LATE_RETURN_TYPE): Add.
1354 * pt.c (tsubst_function_type): Inject the this parameter; do the
1355 substitutions in the order mandated by the DR.
1356 (copy_default_args_to_explicit_spec): Copy TYPE_HAS_LATE_RETURN_TYPE.
1357 * decl.c (grokdeclarator): Maybe set TYPE_HAS_LATE_RETURN_TYPE.
1358 (static_fn_type): Copy it.
1359 * decl2.c (build_memfn_type, change_return_type,
1360 cp_reconstruct_complex_type): Likewise.
1361 * parser.c (cp_parser_lambda_declarator_opt): Likewise.
1362 * tree.c (strip_typedefs): Likewise.
1363 * typeck.c (merge_types): Likewise.
1365 2014-05-30 Jason Merrill <jason@redhat.com>
1368 * pt.c (instantiate_decl): Check that defer_ok is not set for
1369 local class members.
1372 * pt.c (tsubst_init): Split out from...
1373 (tsubst_expr) [DECL_EXPR]: Here.
1374 (tsubst_copy) [VAR_DECL]: Use it.
1375 * semantics.c (finish_id_expression): Return the decl for static/const.
1377 2014-05-28 Jason Merrill <jason@redhat.com>
1380 * decl.c (cxx_comdat_group): Return a decl.
1381 * optimize.c (cdtor_comdat_group): Get its DECL_ASSEMBLER_NAME.
1383 * pt.c (tsubst) [ARRAY_TYPE]: Check for array of array of unknown
1387 * call.c (build_aggr_conv): Ignore passed in flags.
1388 (build_array_conv, build_complex_conv): Likewise.
1390 2014-05-23 Jan Hubicka <hubicka@ucw.cz>
1392 * optimize.c (maybe_thunk_body): Use set_comdat_group.
1393 (maybe_clone_body): Likewise.
1394 * decl.c (duplicate_decls): Update code duplicating comdat group;
1395 do not copy symtab pointer; before freeing newdecl remove it
1397 * decl2.c (constrain_visibility): Use set_comdat_group.
1399 2014-05-23 Jan Hubicka <hubicka@ucw.cz>
1401 * rtti.c: Include tm_p.h
1402 (emit_tinfo_decl): Force RTTI data to be aligned to required
1405 2014-05-23 Jan Hubicka <hubicka@ucw.cz>
1407 * class.c (build_vtable): Align vtables to TARGET_VTABLE_ENTRY_ALIGN
1408 ignoring other target adjustments.
1410 2014-05-23 Thomas Schwinge <thomas@codesourcery.com>
1412 * semantics.c (finish_omp_clauses): Remove duplicated variable
1415 * parser.c (cp_parser_omp_target): Return bool values.
1417 2014-05-22 Paolo Carlini <paolo.carlini@oracle.com>
1420 * lambda.c (add_capture): Enforce that capture by value requires
1422 * typeck2.c (cxx_incomplete_type_inform): Early return if
1423 TYPE_MAIN_DECL is null.
1425 2014-05-21 Jonathan Wakely <jwakely@redhat.com>
1428 * cp-array-notation.c (cilkplus_an_triplet_types_ok_p): Fix condition.
1430 2014-05-21 Ville Voutilainen <ville.voutilainen@gmail.com>
1433 * lambda.c (build_capture_proxy, add_capture): Treat normal
1434 captures and init-captures identically.
1436 2014-05-21 Mark Wielaard <mjw@redhat.com>
1439 * cp-lang.c (cxx_enum_underlying_base_type): New function.
1440 (LANG_HOOKS_ENUM_UNDERLYING_BASE_TYPE): Define.
1442 2014-05-21 Richard Sandiford <rsandifo@linux.vnet.ibm.com>
1444 * cvt.c (convert_to_void): Use void_node instead of void_zero_node.
1445 * cp-array-notation.c (replace_invariant_exprs): Likewise.
1446 (expand_array_notation): Handle VOID_CST.
1447 * error.c (dump_expr): Likewise.
1448 * cxx-pretty-print.c (cxx_pretty_printer::primary_expression)
1449 (cxx_pretty_printer::expression): Likewise.
1450 (pp_cxx_new_expression): Use void_node instead of void_zero_node.
1451 * decl.c (register_dtor_fn): Likewise.
1452 * init.c (build_raw_new_expr, build_new_1, build_vec_init)
1453 (build_delete, push_base_cleanups): Likewise.
1454 * mangle.c (write_expression): Likewise.
1455 * semantics.c (finish_break_stmt, empty_expr_stmt_p): Likewise.
1456 * pt.c (tsubst_decl, tsubst_copy_and_build): Likewise.
1457 (tsubst, tsubst_copy, build_non_dependent_expr): Handle VOID_CST.
1458 * tree.c (cp_tree_equal): Likewise.
1459 (build_dummy_object, is_dummy_object, stabilize_expr): Use void_node
1460 instead of void_zero_node.
1461 * typeck.c (check_return_expr): Likewise.
1462 * typeck2.c (build_functional_cast): Likewise.
1464 2014-05-21 Igor Zamyatin <igor.zamyatin@intel.com>
1467 * parser.c (cp_parser_postfix_expression): Move handling of cilk_sync
1469 (cp_parser_statement): ...here. Make sure only semicolon can go after
1472 2014-05-20 Paolo Carlini <paolo.carlini@oracle.com>
1477 * typeck2.c (digest_nsdmi_init): New.
1478 * parser.c (cp_parser_late_parse_one_default_arg): Use it.
1479 * init.c (get_nsdmi): Likewise.
1480 * cp-tree.h (digest_nsdmi_init): Declare.
1482 2014-05-20 Jason Merrill <jason@redhat.com>
1484 * typeck.c (get_member_function_from_ptrfunc): Don't try to look
1485 up a virtual function in a dummy object.
1487 2014-05-20 Paolo Carlini <paolo.carlini@oracle.com>
1490 * decl.c (duplicate_decls): Replace pair of warning_at with
1491 warning_at + inform.
1492 (maybe_commonize_var): Likewise.
1494 2014-05-20 Richard Sandiford <rsandifo@linux.vnet.ibm.com>
1497 * pt.c (tsubst_copy, tsubst_omp_for_iterator, tsubst_expr)
1498 (tsubst_copy_and_build): Perform recursive substitutions in a
1499 deterministic order.
1501 2014-05-20 Paolo Carlini <paolo.carlini@oracle.com>
1504 * typeck2.c (cxx_incomplete_type_inform): New.
1505 (cxx_incomplete_type_diagnostic): Use it.
1506 * decl.c (grokdeclarator): Check the element type of an
1507 incomplete array type; call the above.
1508 * cp-tree.h (cxx_incomplete_type_inform): Declare.
1510 2014-05-19 Jason Merrill <jason@redhat.com>
1513 * pt.c (tsubst_copy): Don't check at_function_scope_p.
1514 (instantiate_class_template_1): Don't push_to_top_level in an nsdmi.
1516 2014-05-19 Paolo Carlini <paolo.carlini@oracle.com>
1518 * typeck2.c (cxx_incomplete_type_diagnostic): Use inform.
1519 * parser.c (cp_parser_enum_specifier): Likewise.
1521 2014-05-17 Trevor Saunders <tsaunders@mozilla.com>
1523 * class.c (sorted_fields_type_new): Adjust.
1524 * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Likewise.
1525 * cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise.
1526 * cp-tree.h: Remove usage of variable_size gty attribute.
1527 * decl.c (make_label_decl): Adjust.
1528 (check_goto): Likewise.
1529 (start_preparsed_function): Likewise.
1530 (save_function_data): Likewise.
1531 * lex.c (init_reswords): Likewise.
1532 (retrofit_lang_decl): Likewise.
1533 (cxx_dup_lang_specific_decl): Likewise.
1534 (copy_lang_type): Likewise.
1535 (cxx_make_type): Likewise.
1536 * name-lookup.c (binding_entry_make): Likewise.
1537 (binding_table_construct): Likewise.
1538 (binding_table_new): Likewise.
1539 (cxx_binding_make): Likewise.
1540 (pushdecl_maybe_friend_1): Likewise.
1541 (begin_scope): Likewise.
1542 (push_to_top_level): Likewise.
1543 * parser.c (cp_lexer_alloc): Likewise.
1544 (cp_lexer_new_from_tokens): Likewise.
1545 (cp_token_cache_new): Likewise.
1546 (cp_parser_context_new): Likewise.
1547 (cp_parser_new): Likewise.
1548 (cp_parser_nested_name_specifier_opt): Likewise.
1549 (cp_parser_template_id): Likewise.
1550 * pt.c (maybe_process_partial_specialization): Likewise.
1551 (register_specialization): Likewise.
1552 (add_pending_template): Likewise.
1553 (lookup_template_class_1): Likewise.
1554 (push_tinst_level): Likewise.
1555 * semantics.c (register_constexpr_fundef): Likewise.
1556 (cxx_eval_call_expression): Likewise.
1557 * typeck2.c (abstract_virtuals_error_sfinae): Likewise.
1559 2014-05-16 Paolo Carlini <paolo.carlini@oracle.com>
1562 * parser.c (cp_parser_diagnose_invalid_type_name): Early return
1563 when cp_parser_lookup_name sets ambiguous_decls.
1565 2014-05-15 Jason Merrill <jason@redhat.com>
1567 * call.c (print_conversion_rejection): Use loc consistently.
1569 2014-05-14 Paolo Carlini <paolo.carlini@oracle.com>
1571 * cp-tree.h (DIRECT_LIST_INIT_P): Add.
1572 * call.c (convert_like_real, build_new_method_call_1): Use it.
1573 * decl2.c (grokfield): Likewise.
1574 * init.c (perform_member_init, build_aggr_init, expand_default_init,
1575 build_new_1): Likewise.
1576 * mangle.c (write_expression): Likewise.
1577 * parser.c (cp_parser_late_parse_one_default_arg): Likewise.
1579 2014-05-14 Jason Merrill <jason@redhat.com>
1583 * call.c (reference_binding): Treat lvalue/rvalue mismatch and
1584 dropped cv-quals as a bad conversion.
1585 (convert_like_real) [ck_ref_bind]: Explain them.
1586 (compare_ics): Check badness before stripping reference
1587 bindings. Handle comparing bad reference bindings.
1588 * typeck.c (comp_cv_qualification): Add overload that just takes
1590 * cp-tree.h: Declare it.
1592 * call.c (struct conversion_info): Rename 'from_type' to 'from'.
1593 (arg_conversion_rejection, bad_arg_conversion_rejection)
1594 (explicit_conversion_rejection, template_conversion_rejection): Adjust.
1595 (add_function_candidate): Pass actual argument, rather than type, to
1596 bad_arg_conversion_rejection.
1597 (print_conversion_rejection): Explain what's wrong with the conversion.
1598 (print_z_candidates): Say "candidate:" before each candidate.
1599 (splice_viable): Be strict if we see a viable or template candidate.
1600 (build_user_type_conversion_1): Pass false to strict parameter.
1601 (perform_overload_resolution, build_conditional_expr_1): Likewise.
1602 (build_new_op_1, build_new_method_call_1): Likewise.
1603 (build_op_call_1): Pass true to strict parameter.
1605 2014-05-13 Jason Merrill <jason@redhat.com>
1607 * call.c (print_error_for_call_failure): Say "no match" rather
1608 than "ambiguous" if there were no strict matches.
1609 (build_new_method_call_1): Likewise.
1612 * semantics.c (is_this_parameter): Allow capture proxies too.
1614 2014-05-12 Jason Merrill <jason@redhat.com>
1616 * call.c (maybe_print_user_conv_context): New.
1617 (convert_like_real): Use it. Print call context for bad
1618 user-defined conversion.
1619 (build_over_call): Print call context for bad 'this' conversion.
1621 * call.c (convert_like_real): Use inform for identifying the
1624 2014-05-12 Paolo Carlini <paolo.carlini@oracle.com>
1626 * cvt.c (cp_convert_to_pointer): Don't call error_at if
1627 complain & tf_error is false.
1629 * decl.c (make_unbound_class_template): Prefer inform for
1630 "declared here"-type message.
1632 2014-05-09 Momchil Velikov <momchil.velikov@gmail.com>
1636 * lambda.c (lambda_expr_this_capture): Add new parameter
1637 add_capture_p controlling whether the functions will try to
1638 capture 'this' via the default capture.
1639 (maybe_resolve_dummy): Likewise.
1640 * cp-tree.h: Adjust prototypes.
1641 * call.c, semantics.c: Change callers of these functions.
1642 * call.c (build_new_method_call_1): Use the actual 'this' that
1643 would be potentially captured for the overload resolution, instead
1644 of the dummy object.
1646 2014-05-09 Paolo Carlini <paolo.carlini@oracle.com>
1648 * pt.c (convert_nontype_argument_function): Add tsubst_flags_t
1650 (convert_nontype_argument): Adjust calls.
1651 (coerce_template_parameter_pack): Add missing complain & tf_error
1654 2014-05-09 Jason Merrill <jason@redhat.com>
1658 * call.c (build_conditional_expr_1, conditional_conversion): Handle
1659 non-class lvalues and xvalues that differ only in cv-qualifiers.
1663 * call.c (build_user_type_conversion_1): The copy-init temporary
1667 * tree.c (stabilize_expr): A stabilized prvalue is an xvalue.
1670 * call.c (build_conditional_expr_1): If overload resolution finds
1671 no match, just say "different types".
1674 * call.c (build_conditional_expr_1): Improve ambiguity diagnostic.
1677 * call.c (build_conditional_expr_1): Don't try to pool cv-quals
1678 if we didn't find a conversion.
1679 Don't accept a bad conversion too early.
1681 2014-05-08 Paolo Carlini <paolo.carlini@oracle.com>
1684 * typeck.c (convert_for_assignment): Provide an inform for pointers
1685 to incomplete class types.
1687 2014-05-07 Paolo Carlini <paolo.carlini@oracle.com>
1690 * pt.c (convert_nontype_argument): Protect all the error calls
1691 with complain & tf_error.
1693 2014-05-07 Paolo Carlini <paolo.carlini@oracle.com>
1696 * pt.c (instantiate_decl): Avoid generating the body of a
1699 2014-05-06 Paolo Carlini <paolo.carlini@oracle.com>
1702 * pt.c (maybe_begin_member_template_processing): Use
1703 uses_template_parms.
1705 2014-05-06 Kenneth Zadeck <zadeck@naturalbridge.com>
1706 Mike Stump <mikestump@comcast.net>
1707 Richard Sandiford <rdsandiford@googlemail.com>
1709 * call.c: Include wide-int.h.
1710 (type_passed_as): Use tree_int_cst_lt instead of INT_CST_LT_UNSIGNED.
1711 (convert_for_arg_passing): Likewise.
1712 * class.c: Include wide-int.h.
1713 (walk_subobject_offsets): Use tree_int_cst_lt instead of INT_CST_LT.
1714 (end_of_class): Use tree_int_cst_lt instead of INT_CST_LT_UNSIGNED.
1715 (include_empty_classes): Likewise
1716 (layout_class_type): Use tree_int_cst_lt instead of INT_CST_LT.
1717 * cvt.c: Include wide-int.h.
1718 (ignore_overflows): Use wide_int_to_tree.
1719 * decl.c: Include wide-int.h.
1720 (check_array_designated_initializer): Use wide-int interfaces.
1721 (compute_array_index_type): Use tree_int_cst_lt instead of INT_CST_LT.
1722 (finish_enum_value_list): Use signop.
1723 (build_enumerator): Use wide-int interfaces.
1724 * init.c: Include wide-int.h.
1725 (build_new_1): Use wide-int interfaces.
1726 * mangle.c: Include wide-int.h.
1727 (write_integer_cst): Use wide-int interfaces.
1728 (write_array_type): Likewise.
1729 * tree.c: Include wide-int.h.
1730 (cp_tree_equal): Use tree_int_cst_equal.
1731 * typeck2.c: Include wide-int.h.
1732 (process_init_constructor_array): Use wide-int interfaces.
1734 2014-05-03 Paolo Carlini <paolo.carlini@oracle.com>
1737 * decl.c (grokfndecl): Check duplicate_decls return value for
1739 * pt.c (instantiate_decl): A deleted function is defined.
1741 2014-05-02 Jason Merrill <jason@redhat.com>
1743 * decl2.c (vague_linkage_p): Local statics have vague linkage.
1746 * lambda.c (lambda_capture_field_type): Wrap anything dependent
1748 (add_capture): Check for VLA before calling it.
1749 * semantics.c (is_this_parameter): Accept any 'this' parameter, not
1750 just the current one. Make non-static.
1751 * cp-tree.h: Declare it.
1752 * pt.c (tsubst_copy) [VAR_DECL]: Also build a new VAR_DECL if
1753 the operand was static or constant.
1755 2014-05-02 Marek Polacek <polacek@redhat.com>
1757 * typeck.c (maybe_warn_about_returning_address_of_local): Separate
1760 2014-05-01 Marek Polacek <polacek@redhat.com>
1763 * typeck.c (maybe_warn_about_returning_address_of_local): Distinguish
1764 between label and variable when warning about returning local address.
1766 2014-04-30 Jason Merrill <jason@redhat.com>
1769 * init.c (build_value_init): Don't try to call an array constructor.
1772 * typeck2.c (massage_init_elt): Use maybe_constant_init.
1774 2014-04-30 Marek Polacek <polacek@redhat.com>
1776 * typeck.c (cp_build_binary_op): Call ubsan_instrument_division
1777 even when SANITIZE_FLOAT_DIVIDE is on. Set doing_div_or_mod even
1778 for non-integer types.
1780 2014-04-29 Jason Merrill <jason@redhat.com>
1783 Represent the unevaluated exception specification of an implicitly
1784 declared or deleted function with a simple placeholder, not a list
1786 * cp-tree.h (UNEVALUATED_NOEXCEPT_SPEC_P): New.
1787 * except.c (unevaluated_noexcept_spec): New.
1788 * class.c (deduce_noexcept_on_destructor): Use it.
1789 * decl.c (check_redeclaration_exception_specification): Call
1790 maybe_instantiate_noexcept.
1791 (duplicate_decls): Call it before merge_types.
1792 (start_preparsed_function): Call maybe_instantiate_noexcept.
1793 * decl2.c (mark_used): Call maybe_instantiate_noexcept earlier.
1794 * init.c (get_nsdmi): Factor out of perform_member_init.
1795 * method.c (process_subob_fn): Call maybe_instantiate_noexcept.
1796 (walk_field_subobs): Consider NSDMI for EH spec.
1797 (get_defaulted_eh_spec): New.
1798 (implicitly_declare_fn): Use unevaluated_noexcept_spec.
1799 (defaulted_late_check): Defer EH checking in non-template classes.
1800 (after_nsdmi_defaulted_late_checks): New.
1801 * parser.c (cp_parser_class_specifier_1): Use it.
1802 (unparsed_classes): New macro.
1803 * parser.h (cp_unparsed_functions_entry_d): Add classes field.
1804 * pt.c (maybe_instantiate_noexcept): Use get_defaulted_eh_spec.
1805 Remove list-of-functions handling.
1806 * typeck2.c (merge_exception_specifiers): Remove list-of-functions
1807 handling and FN parameter.
1808 * typeck.c (merge_types): Adjust.
1810 2014-04-28 Paolo Carlini <paolo.carlini@oracle.com>
1813 * parser.c (cp_parser_alias_declaration): Check return value of
1816 2014-04-24 Jakub Jelinek <jakub@redhat.com>
1818 * parser.c (cp_parser_omp_atomic): Allow seq_cst before
1819 atomic-clause, allow comma in between atomic-clause and
1822 2014-04-24 Marc Glisse <marc.glisse@inria.fr>
1825 * rtti.c (emit_support_tinfos): Do not iterate on
1826 registered_builtin_types (partial revert).
1828 2014-04-23 Dinar Temirbulatov <dtemirbulatov@gmail.com>
1831 * semantics.c (apply_deduced_return_type): Complete non-void type
1832 before estimating whether the type is aggregate.
1834 2014-04-22 Marc Glisse <marc.glisse@inria.fr>
1837 * rtti.c (emit_support_tinfo_1): New function, extracted from
1838 emit_support_tinfos.
1839 (emit_support_tinfos): Call it and iterate on registered_builtin_types.
1841 2014-04-22 Jakub Jelinek <jakub@redhat.com>
1844 * parser.c (cp_parser_omp_parallel): If cp_parser_omp_for
1845 fails, don't set OM_PARALLEL_COMBINED and return NULL.
1847 2014-04-18 Jason Merrill <jason@redhat.com>
1850 * call.c (reference_binding): Recurse on user-defined conversion.
1853 * call.c (standard_conversion): Don't try to apply restrict to void.
1855 2014-04-16 Marc Glisse <marc.glisse@inria.fr>
1857 * decl.c (reshape_init_r): Handle a single element of vector type.
1859 2014-04-16 Patrick Palka <patrick@parcs.ath.cx>
1862 * decl2.c (cplus_decl_attributes): Handle
1863 pointer-to-member-function declarations.
1865 2014-04-16 Patrick Palka <patrick@parcs.ath.cx>
1868 * call.c (build_user_type_coversion): Use build_dummy_object
1869 to create the placeholder object for a constructor method call.
1870 (build_special_member_call): Likewise.
1871 (build_over_call): Check for the placeholder object with
1873 (build_new_method_call_1): Likewise. Don't attempt to resolve
1874 a dummy object for a constructor method call.
1876 2014-04-16 Paul Pluzhnikov <ppluzhnikov@google.com>
1879 * friend.c (add_friend, make_friend_class): Move repeated friend
1880 warning under Wredundant_decls.
1882 2014-04-15 Paolo Carlini <paolo.carlini@oracle.com>
1884 * decl.c (duplicate_decls): Remove redundant TYPE_NAME use.
1885 * name-lookup.c (pushdecl_maybe_friend_1): Likewise.
1886 (do_class_using_decl): Likewise.
1887 * mangle.c (dump_substitution_candidates): Use TYPE_NAME_STRING.
1889 2014-04-15 Jakub Jelinek <jakub@redhat.com>
1892 * Make-lang.h (CP_PLUGIN_HEADERS): Add type-utils.h.
1894 2014-04-14 Paolo Carlini <paolo.carlini@oracle.com>
1896 * cp-tree.h (TYPE_IDENTIFIER): Remove declaration.
1898 2014-04-14 Paolo Carlini <paolo.carlini@oracle.com>
1900 * pt.c (mark_template_parm): Use template_parm_level_and_index.
1902 2014-04-11 Jason Merrill <jason@redhat.com>
1904 * parser.h (struct cp_token): Rename ambiguous_p to error_reported.
1906 (cp_lexer_get_preprocessor_token): Always clear it.
1907 (cp_parser_lambda_expression): Use it to avoid duplicate diagnostics.
1911 * decl.c (reshape_init_r): Handle a single element of class type.
1914 * decl.c (cxx_init_decl_processing): Set DECL_IS_MALLOC on
1915 built-in operator new.
1917 2014-04-11 Paolo Carlini <paolo.carlini@oracle.com>
1920 * name-lookup.c (parse_using_directive): Return early if the
1921 attribs argument is error_mark_node; use get_attribute_name.
1923 2014-04-11 Jason Merrill <jason@redhat.com>
1927 * cp-tree.h (CALL_EXPR_LIST_INIT_P): New.
1928 * call.c (struct z_candidate): Add flags field.
1929 (add_candidate): Add flags parm.
1930 (add_function_candidate, add_conv_candidate, build_builtin_candidate)
1931 (add_template_candidate_real): Pass it.
1932 (build_over_call): Set CALL_EXPR_LIST_INIT_P.
1933 * tree.c (build_aggr_init_expr): Copy it.
1934 * semantics.c (simplify_aggr_init_expr): Preevaluate args if it's set.
1936 2014-04-10 Richard Biener <rguenther@suse.de>
1937 Jakub Jelinek <jakub@redhat.com>
1940 * error.c (dump_decl) <case FUNCTION_DECL>: If
1941 DECL_LANG_SPECIFIC is NULL, but DECL_ABSTRACT_ORIGIN is not,
1942 recurse on DECL_ABSTRACT_ORIGIN instead of printing
1945 2014-04-09 Fabien Chêne <fabien@gcc.gnu.org>
1947 * pt.c (check_template_variable): Check for the return of pedwarn
1948 before emitting a note.
1949 * parser.c (cp_parser_lambda_introducer): Likewise.
1951 2014-04-08 Paolo Carlini <paolo.carlini@oracle.com>
1954 * pt.c (process_template_parm): For an invalid non-type parameter
1955 only set TREE_TYPE to error_mark_node.
1956 (push_inline_template_parms_recursive, comp_template_parms,
1957 redeclare_class_template, coerce_template_template_parm,
1958 coerce_template_template_parms, unify): Use error_operand_p.
1960 2014-04-08 Nathan Sidwell <nathan@codesourcery.com>
1962 * class.c (check_bases_and_members): Warn about non-virtual dtors
1963 in public bases only. Check warn_ecpp before complaining about
1964 non-polymorphic bases.
1966 2014-04-04 Fabien Chêne <fabien@gcc.gnu.org>
1968 * decl.c (duplicate_decls): Check for the return of warning_at
1969 before emitting a note.
1970 (warn_misplaced_attr_for_class_type): Likewise.
1971 (check_tag_decl): Likewise.
1973 2014-04-04 Paolo Carlini <paolo.carlini@oracle.com>
1976 * semantics.c (sort_constexpr_mem_initializers): Robustify loop.
1978 2014-04-04 Patrick Palka <patrick@parcs.ath.cx>
1981 * semantics.c (add_stmt): Set STATEMENT_LIST_HAS_LABEL.
1982 * decl.c (cp_finish_decl): Create a new BIND_EXPR before
1983 instantiating a variable-sized type.
1986 * decl.c (decl_jump_unsafe): Consider variably-modified decls.
1988 2014-04-04 Fabien Chêne <fabien@gcc.gnu.org>
1990 * class.c (find_abi_tags_r): Check for the return of warning
1991 before emitting a note.
1992 (one_inherited_ctor): Likewise.
1994 2014-04-04 Fabien Chêne <fabien@gcc.gnu.org>
1996 * decl.c (duplicate_decls): Check for the return of permerror
1997 before emitting a note.
1999 2014-04-03 Nathan Sidwell <nathan@codesourcery.com>
2001 * class.c (accessible_nvdtor_p): New.
2002 (check_bases): Don't check base destructor here ...
2003 (check_bases_and_members): ... check them here. Trigger on
2004 Wnon-virtual-dtor flag.
2005 (finish_struct_1): Use accessible_nvdtor_p.
2007 2014-04-01 Jason Merrill <jason@redhat.com>
2009 * pt.c (process_partial_specialization): Say "not deducible"
2010 rather than "not used". Use inform.
2013 * pt.c (coerce_template_parms): Check that the pack expansion
2014 pattern works with the first matching parameter.
2016 2014-04-01 Fabien Chêne <fabien@gcc.gnu.org>
2018 * init.c (perform_member_init): Homogenize uninitialized
2021 2014-04-01 Jason Merrill <jason@redhat.com>
2024 * call.c (build_array_conv): Call complete_type.
2027 * typeck2.c (PICFLAG_SIDE_EFFECTS): New.
2028 (picflag_from_initializer): Return it.
2029 (process_init_constructor): Handle it.
2032 * decl2.c (is_late_template_attribute): Don't defer abi_tag.
2033 * mangle.c (write_unqualified_name): Fix abi_tag on templates.
2034 * pt.c (get_template_info): Handle NAMESPACE_DECL.
2035 (most_general_template): Handle more kinds of template.
2036 * tree.c (handle_abi_tag_attribute): Ignore abi_tag on template
2037 instantiations and specializations.
2039 2014-03-31 Patrick Palka <patrick@parcs.ath.cx>
2042 * typeck.c (maybe_warn_about_returning_address_of_local): Unwrap
2043 COMPONENT_REFs and ARRAY_REFs sooner.
2045 2014-03-29 Adam Butcher <adam@jessamine.co.uk>
2048 * parser.c (cp_parser_init_declarator): Handle erroneous generic type
2049 usage in non-functions with pushed scope.
2051 2014-03-28 Adam Butcher <adam@jessamine.co.uk>
2054 * name-lookup.h (cp_binding_level): New transient field defining_class_p
2055 to indicate whether a scope is in the process of defining a class.
2056 * semantics.c (begin_class_definition): Set defining_class_p.
2057 * name-lookup.c (leave_scope): Reset defining_class_p.
2058 * parser.c (synthesize_implicit_template_parm): Use cp_binding_level::
2059 defining_class_p rather than TYPE_BEING_DEFINED as the predicate for
2060 unwinding to class-defining scope to handle the erroneous definition of
2061 a generic function of an arbitrarily nested class within an enclosing
2064 2014-03-26 Fabien Chêne <fabien@gcc.gnu.org>
2067 * method.c (walk_field_subobs): Improve the diagnostic
2068 locations for both REFERENCE_TYPEs and non-static const members.
2069 * init.c (diagnose_uninitialized_cst_or_ref_member): Use %q#D
2070 instead of %qD to be consistent with the c++11 diagnostic.
2072 2014-03-25 Jason Merrill <jason@redhat.com>
2076 * class.c (build_vtbl_initializer): Handle abstract dtors here.
2077 * search.c (get_pure_virtuals): Not here.
2080 * parser.c (cp_parser_lambda_expression): Don't parse the body of
2081 a lambda in unevaluated context.
2084 * decl.c (create_array_type_for_decl): Complain about array of auto.
2086 2014-03-25 Jakub Jelinek <jakub@redhat.com>
2089 * semantics.c (potential_constant_expression_1): Handle
2092 2014-03-24 Adam Butcher <adam@jessamine.co.uk>
2095 * parser.c (cp_parser_parameter_declaration_clause): Prevent 'auto' from
2096 introducing an implicit function template parameter within an explicit
2099 2014-03-22 Jason Merrill <jason@redhat.com>
2102 * decl.c (grokdeclarator): Change permerror about 'virtual auto'
2105 2014-03-21 Paolo Carlini <paolo.carlini@oracle.com>
2108 * name-lookup.c (push_class_level_binding_1): Check identifier_p
2109 on the name argument.
2111 2014-03-20 Jakub Jelinek <jakub@redhat.com>
2114 * init.c (build_zero_init_1): Ignore fields with error_mark_node
2117 2014-03-19 Paolo Carlini <paolo.carlini@oracle.com>
2120 * call.c (build_new_method_call_1): Handle pure virtuals called by
2123 2014-03-17 Adam Butcher <adam@jessamine.co.uk>
2126 * parser.c (cp_parser_member_declaration): Don't allow
2127 finish_fully_implicit_template to consider friend declarations to be
2128 class member templates.
2129 (synthesize_implicit_template_parm): Handling winding back through class
2130 scope to the class being defined in order to inject a template argument
2134 * parser.c (cp_parser_skip_to_end_of_block_or_statement): Unwind generic
2135 function scope as per cp_parser_skip_to_end_of_statement.
2137 2014-03-17 Paolo Carlini <paolo.carlini@oracle.com>
2140 * typeck2.c (check_narrowing): Use fold_non_dependent_expr_sfinae.
2142 2014-03-14 Jason Merrill <jason@redhat.com>
2146 * search.c (get_pure_virtuals): Handle abstract dtor here.
2147 (dfs_get_pure_virtuals): Not here.
2150 * search.c (dfs_get_pure_virtuals): Treat the destructor of an
2151 abstract class as pure.
2153 2014-03-13 Paolo Carlini <paolo.carlini@oracle.com>
2156 * pt.c (maybe_process_partial_specialization): Check return value
2157 of check_specialization_namespace.
2159 2014-03-13 Paolo Carlini <paolo.carlini@oracle.com>
2162 * semantics.c (finish_static_assert): Call cxx_constant_value only
2163 if require_potential_rvalue_constant_expression returns true.
2165 2014-03-11 Paolo Carlini <paolo.carlini@oracle.com>
2168 * method.c (get_inherited_ctor): New.
2169 * cp-tree.h (get_inherited_ctor): Declare it.
2170 * semantics.c (is_valid_constexpr_fn): Use it.
2172 2014-03-10 Jason Merrill <jason@redhat.com>
2175 * call.c (convert_default_arg): Remove special handling for
2179 * parser.c (cp_parser_class_head): Also check PRIMARY_TEMPLATE_P
2180 when deciding whether to call push_template_decl for a member class.
2181 * pt.c (push_template_decl_real): Return after wrong levels error.
2183 2014-03-08 Adam Butcher <adam@jessamine.co.uk>
2186 * pt.c (tsubst_copy): When retrieving a capture pack from a generic
2187 lambda, remove the lambda's own template argument list prior to fetching
2191 * parser.c (cp_parser_parameter_declaration_clause): Move generic
2192 function template unwinding on error into a more general location, ...
2193 (cp_parser_skip_to_end_of_statement): ... here.
2195 2014-03-07 Jason Merrill <jason@redhat.com>
2197 * Make-lang.in (check_g++_parallelize): Split dg.exp.
2199 * parser.c (cp_parser_type_id_1): Only allow 'auto' in C++1y if
2200 we're in a trailing return type.
2202 * typeck.c (comp_template_parms_position): 'auto' and
2203 'decltype(auto)' are different from real template parms.
2205 * parser.c (cp_parser_using_declaration): Consume the semicolon
2206 after bare parameter pack error.
2208 * cp-tree.h (REF_PARENTHESIZED_P): New.
2209 * semantics.c (force_paren_expr): Set it.
2210 * pt.c (do_auto_deduction): Check it.
2211 (tsubst) [COMPONENT_REF]: Copy it.
2212 * typeck.c (maybe_warn_about_useless_cast): Don't strip dereference.
2214 * decl.c (create_array_type_for_decl): Only warn about invalid
2215 C++1y VLA if flag_iso or warn_vla>0.
2216 (grokdeclarator): Likewise.
2217 * pt.c (tsubst): Likewise.
2218 * semantics.c (finish_decltype_type): Likewise.
2219 * typeck.c (cxx_sizeof_or_alignof_type): Likewise.
2220 (cp_build_addr_expr_1): Likewise.
2221 * init.c (build_new_1): Improve diagnostics.
2223 2014-03-07 Paolo Carlini <paolo.carlini@oracle.com>
2226 * decl.c (check_initializer): Return NULL_TREE after error;
2227 consistently use inform.
2229 2014-03-07 Paolo Carlini <paolo.carlini@oracle.com>
2231 * decl.c (check_initializer): Remove dead code.
2233 2014-03-06 Marek Polacek <polacek@redhat.com>
2236 * typeck.c (check_return_expr): Call contains_cilk_spawn_stmt instead
2237 of checking tree code.
2239 2014-03-06 Paolo Carlini <paolo.carlini@oracle.com>
2241 * parser.c (cp_lexer_set_source_position): New.
2242 (cp_parser_mem_initializer): Use it.
2243 (cp_parser_postfix_open_square_expression): Likewise.
2244 (cp_parser_parenthesized_expression_list): Likewise.
2245 (cp_parser_new_initializer): Likewise.
2246 (cp_parser_jump_statement): Likewise.
2247 (cp_parser_initializer): Likewise.
2248 (cp_parser_functional_cast): Likewise.
2250 2014-03-05 Jason Merrill <jason@redhat.com>
2253 * semantics.c (force_paren_expr): Only add a PAREN_EXPR to a
2254 dependent expression.
2257 * parser.c (cp_parser_template_id): Don't set up a CPP_TEMPLATE_ID
2258 if re-parsing might succeed.
2259 * semantics.c (finish_id_expression): Use of a parameter outside
2260 the function body is a parse error.
2262 * parser.c (cp_parser_mem_initializer): Set input_location
2263 properly for init-list warning.
2264 (cp_parser_postfix_open_square_expression): Likewise.
2265 (cp_parser_parenthesized_expression_list): Likewise.
2266 (cp_parser_new_initializer): Likewise.
2267 (cp_parser_jump_statement): Likewise.
2268 (cp_parser_initializer): Likewise.
2269 (cp_parser_functional_cast): Likewise.
2271 2014-03-04 Jason Merrill <jason@redhat.com>
2274 * typeck2.c (process_init_constructor_record): Set
2275 CONSTRUCTOR_IS_DIRECT_INIT on {} for omitted initializers.
2279 * parser.c (cp_parser_direct_declarator): Set declarator to
2280 cp_error_declarator on invalid qualified-id.
2282 2014-03-04 Paolo Carlini <paolo.carlini@oracle.com>
2285 * parser.c (cp_parser_using_declaration): Early return when
2286 cp_parser_nested_name_specifier errors out.
2288 2014-03-01 Adam Butcher <adam@jessamine.co.uk>
2291 * parser.c (cp_parser_parameter_declaration_clause): Unwind generic
2292 function scope on parse error in function parameter list.
2294 2014-03-01 Paolo Carlini <paolo.carlini@oracle.com>
2296 * method.c (implicitly_declare_fn): Remove redundant
2297 DECL_TEMPLATE_RESULT and STRIP_TEMPLATE uses.
2298 * semantics.c (is_instantiation_of_constexpr): Likewise.
2299 * error.c (dump_function_decl): Likewise.
2301 2014-03-01 Jason Merrill <jason@redhat.com>
2304 * semantics.c (begin_maybe_infinite_loop): Use
2305 fold_non_dependent_expr_sfinae.
2307 2014-02-28 Jason Merrill <jason@redhat.com>
2310 * typeck.c (cp_build_binary_op): Sorry on vector&&vector.
2312 2014-02-28 Paolo Carlini <paolo.carlini@oracle.com>
2315 * cp-tree.h (DECL_DELETED_FN): Use LANG_DECL_FN_CHECK.
2316 * call.c (print_z_candidate): Remove STRIP_TEMPLATE use.
2317 * lambda.c (maybe_add_lambda_conv_op): Likewise.
2319 2014-02-27 Paolo Carlini <paolo.carlini@oracle.com>
2322 * call.c (convert_arg_to_ellipsis): Return error_mark_node after
2325 2014-02-27 Jason Merrill <jason@redhat.com>
2329 * decl2.c (tentative_decl_linkage): Don't mess with functions that
2330 are not yet defined.
2332 2014-02-26 Jason Merrill <jason@redhat.com>
2336 * class.c (clone_function_decl): Don't note_vague_linkage_fn.
2337 * init.c (build_vtbl_address): Do it here.
2343 * pt.c (struct warning_sentinel): New.
2344 (tsubst_copy_and_build): Use it instead of
2345 c_inhibit_evaluation_warnings.
2346 * typeck.c (maybe_warn_about_useless_cast): Remove
2347 c_inhibit_evaluation_warnings check.
2350 * pt.c (get_template_parm_index): New.
2351 (fixed_parameter_pack_p_1, fixed_parameter_pack_p): New.
2352 (process_template_parm): Allow bare packs in template template
2353 parm template parms.
2354 (coerce_template_parameter_pack): Handle fixed template template
2355 parm packs and fixed packs not at the end of the parm list.
2356 (coerce_template_parms): Handle template parm packs not at the end
2358 (gen_elem_of_pack_expansion_instantiation): Handle a decl expansion.
2361 * pt.c (unify): Ignore alias templates when deducing a template
2367 * call.c (reference_binding): Recurse on user-defined conversion.
2368 (convert_like_real) [ck_ref_bind]: Explain cv-qual mismatch.
2370 2014-02-25 Jason Merrill <jason@redhat.com>
2373 * call.c (reference_binding): Recurse on user-defined conversion.
2374 (convert_like_real) [ck_ref_bind]: Explain cv-qual mismatch.
2376 * call.c (print_conversion_rejection): Handle n_arg of -2.
2377 (build_user_type_conversion_1): Pass it.
2380 * decl2.c (no_linkage_error): Handle C++98 semantics.
2381 (reset_type_linkage): Move from decl.c.
2382 (reset_type_linkage_1, reset_type_linkage_2, bt_reset_linkage_1)
2383 (bt_reset_linkage_2, reset_decl_linkage): New.
2384 (tentative_decl_linkage): Factor out of expand_or_defer_fn_1.
2385 (cp_write_global_declarations): Move condition into no_linkage_error.
2386 * decl.c (grokfndecl, grokvardecl): Use no_linkage_error.
2387 * semantics.c (expand_or_defer_fn_1): Factor out
2388 tentative_decl_linkage.
2389 * cp-tree.h: Adjust.
2391 * decl2.c (finish_static_data_member_decl): Diagnose static data
2392 member in unnamed class.
2393 * class.c (finish_struct_anon_r): Avoid redundant diagnostic.
2396 * class.c (clone_function_decl): Call note_vague_linkage_fn for
2397 defaulted virtual dtor.
2401 * pt.c (get_underlying_template): Fix equivalence calculation.
2403 2014-02-25 Adam Butcher <adam@jessamine.co.uk>
2406 * parser.c (function_being_declared_is_template_p): Return false when
2407 processing a template parameter list.
2408 (cp_parser_parameter_declaration_clause): Don't set
2409 auto_is_implicit_function_template_parm_p when processing a
2410 template parameter list.
2412 * parser.c (synthesize_implicit_template_parm): Inject new template
2413 argument list appropriately when a generic member function
2414 of a class template is declared out-of-line.
2417 * parser.c (cp_parser_direct_declarator): Don't save and
2418 restore num_template_parameter_lists around call to
2419 cp_parser_parameter_declaration_list.
2420 (function_being_declared_is_template_p): New predicate.
2421 (cp_parser_parameter_declaration_list): Use
2422 function_being_declared_is_template_p as predicate for
2423 inspecting current function template parameter list length
2424 rather than num_template_parameter_lists.
2426 2014-02-24 Jason Merrill <jason@redhat.com>
2429 * pt.c (tsubst_omp_for_iterator): Don't let substitution of the
2430 DECL_EXPR initialize a non-class iterator.
2433 * parser.c (cp_parser_template_type_arg): Check for invalid 'auto'.
2435 2014-02-21 Jason Merrill <jason@redhat.com>
2438 * parser.c (cp_parser_type_name): Always check dependency.
2439 (cp_parser_type_specifier_seq): Call
2440 cp_parser_parse_and_diagnose_invalid_type_name.
2443 * semantics.c (expand_or_defer_fn_1): Check DECL_DEFAULTED_FN.
2446 * parser.c (cp_parser_default_argument): Clear
2447 current_class_ptr/current_class_ref like tsubst_default_argument.
2450 * lambda.c (maybe_resolve_dummy): Check lambda_function rather
2451 than current_binding_level.
2454 * typeck2.c (massage_init_elt): Call fold_non_dependent_expr_sfinae.
2457 * parser.c (cp_parser_enum_specifier): Call
2458 check_for_bare_parameter_packs.
2461 * pt.c (tsubst_decl) [TYPE_DECL]: Don't try to instantiate an
2465 * pt.c (lookup_template_class_1): Update DECL_TEMPLATE_INSTANTIATIONS
2466 of the partial instantiation, not the most general template.
2467 (maybe_process_partial_specialization): Reassign everything on
2471 * pt.c (register_specialization): Copy DECL_DELETED_FN to clones.
2472 (check_explicit_specialization): Don't clone.
2475 * pt.c (coerce_template_parms): Bail if argument packing fails.
2478 * decl.c (cp_complete_array_type, maybe_deduce_size_from_array_init):
2479 Don't get confused by a CONSTRUCTOR that already has a type.
2482 * call.c (build_array_conv): Don't crash on VLA.
2485 * mangle.c (mangle_decl): Don't make an alias for a TYPE_DECL.
2488 * lambda.c (maybe_resolve_dummy): Don't try to capture this
2489 in declaration context.
2493 * pt.c (unify): Only unify if deducible. Handle 0-length list.
2496 * parser.c (cp_parser_direct_declarator): Don't wrap a
2497 type-dependent expression in a NOP_EXPR.
2500 * lambda.c (is_normal_capture_proxy): Handle VLA capture.
2505 * parser.c (cp_parser_template_argument): Restore dereference.
2506 * pt.c (template_parm_to_arg): Dereference non-pack expansions too.
2507 (process_partial_specialization): Handle deref.
2510 2014-02-21 Adam Butcher <adam@jessamine.co.uk>
2514 * parser.c (cp_parser_parameter_declaration_list): Correctly reset
2515 implicit_template_scope upon leaving an out-of-line generic member
2516 function definition.
2518 2014-02-20 Kai Tietz <ktietz@redhat.com>
2521 * parser.c (cp_parser_functional_cast): Treat NULL_TREE
2522 valued type argument as error_mark_node.
2525 * semantics.c (finish_fname): Handle error_mark_node.
2527 2014-02-19 Jason Merrill <jason@redhat.com>
2530 * pt.c (maybe_instantiate_noexcept): Don't instantiate exception
2531 spec from template context.
2533 2014-02-19 Jakub Jelinek <jakub@redhat.com>
2536 * cp-objcp-common.c (cp_function_decl_explicit_p): Remove
2537 FUNCTION_FIRST_USER_PARMTYPE (decl) != void_list_node check.
2540 * pt.c (tsubst_expr): Handle ANNOTATE_EXPR.
2542 2014-02-18 Paolo Carlini <paolo.carlini@oracle.com>
2545 * semantics.c (ensure_literal_type_for_constexpr_object): Use
2548 2014-02-18 Paolo Carlini <paolo.carlini@oracle.com>
2551 * semantics.c (cxx_eval_constant_expression, [COMPONENT_REF]):
2552 During error recovery allow_non_constant may be false.
2554 2014-02-18 Adam Butcher <adam@jessamine.co.uk>
2557 * parser.c (cp_parser_lambda_declarator_opt): Pop template parameter
2558 scope whenever a template parameter list has been started, independent
2559 of whether the function call operator was well-formed or not.
2562 * parser.c (cp_parser_member_declaration): Pop fully implicit template
2563 scope for generic friend declarations as well as for non-friends.
2565 2014-02-12 Paolo Carlini <paolo.carlini@oracle.com>
2568 * method.c (implicitly_declare_fn): A constructor of a class with
2569 virtual base classes isn't constexpr (7.1.5p4).
2571 2014-02-05 Jan Hubicka <hubicka@ucw.cz
2573 * parser.c (synthesize_implicit_template_parm): Use grow_tree_vec.
2575 2014-02-05 Jakub Jelinek <jakub@redhat.com>
2578 * parser.c (cp_parser_omp_declare_reduction): Save and free
2581 2014-02-03 Marc Glisse <marc.glisse@inria.fr>
2585 * tree.c (handle_init_priority_attribute): Call default_conversion on
2586 the attribute argument.
2588 2014-02-03 Paolo Carlini <paolo.carlini@oracle.com>
2591 * method.c (synthesized_method_walk): If vbases is non-null but
2592 is_empty is true, likewise don't worry about the virtual bases.
2594 2014-02-01 Paolo Carlini <paolo.carlini@oracle.com>
2597 * typeck2.c (process_init_constructor_record): Just skip unnamed
2600 2014-01-31 Jason Merrill <jason@redhat.com>
2603 * pt.c (mark_decl_instantiated): Call mark_needed.
2606 * decl2.c (handle_tls_init): Handle null init fn.
2609 * decl2.c (get_tls_init_fn): Copy DECL_EXTERNAL from the variable.
2611 2014-01-31 Paolo Carlini <paolo.carlini@oracle.com>
2614 * class.c (build_vfield_ref): Early return error_mark_node if
2615 TYPE_VFIELD (type) is null.
2616 (build_base_path): Check return value of build_vfield_ref.
2618 2014-01-31 Jason Merrill <jason@redhat.com>
2621 * call.c (convert_like_real) [ck_aggr]: Set TARGET_EXPR_LIST_INIT_P.
2622 [ck_list]: Check for error_mark_node.
2623 (build_aggr_conv): Set LOOKUP_NO_NARROWING and check_narrowing.
2626 * pt.c (fn_type_unification): Don't do DEDUCE_EXACT check
2627 during partial ordering.
2629 2014-01-31 Marek Polacek <polacek@redhat.com>
2632 * typeck.c (build_function_call_vec): Add dummy arg_loc parameter.
2634 2014-01-30 Jason Merrill <jason@redhat.com>
2637 * cp-tree.h (struct saved_scope): Add x_local_specializations.
2638 (local_specializations): New macro.
2639 * pt.c (local_specializations): Remove variable.
2641 2014-01-30 Richard Sandiford <rdsandiford@googlemail.com>
2644 * parser.c (make_string_pack): Use double_int::from_buffer.
2646 2014-01-30 Marek Polacek <polacek@redhat.com>
2649 * typeck.c (build_ptrmemfunc1): Call convert_and_check with
2651 * cvt.c (cp_convert_and_check): Call warnings_for_convert_and_check
2652 with input_location.
2653 * call.c (build_conditional_expr_1): Call unsafe_conversion_p with
2656 2014-01-30 Paolo Carlini <paolo.carlini@oracle.com>
2659 * typeck.c (lookup_destructor): Check dtor_type for error_mark_node.
2661 2014-01-30 Paolo Carlini <paolo.carlini@oracle.com>
2664 * pt.c (lookup_template_class_1): Check start_enum return value
2665 for error_mark_node.
2667 2014-01-30 Paolo Carlini <paolo.carlini@oracle.com>
2669 * decl.c (duplicate_decls, typename_hash, typename_compare):
2670 Use TYPE_IDENTIFIER.
2671 * error.c (dump_type): Likewise.
2672 * mangle.c (dump_substitution_candidates): Likewise.
2674 2014-01-30 Jason Merrill <jason@redhat.com>
2677 * decl2.c (attributes_naming_typedef_ok): New.
2678 * cp-tree.h: Declare it.
2679 * decl.c (grokdeclarator): Check it.
2680 * tree.c (no_linkage_check): Handle VECTOR_TYPE.
2682 2014-01-29 Jason Merrill <jason@redhat.com>
2685 * call.c (add_builtin_candidate): Catch dependent types.
2688 * pt.c (expand_template_argument_pack): Correct
2689 non_default_args_count calculation.
2692 * pt.c (unify_pack_expansion): Call expand_template_argument_pack.
2695 * friend.c (do_friend): Pass the TEMPLATE_DECL to add_friend if we
2696 have a friend template in a class template.
2697 * pt.c (tsubst_friend_function): Look through it.
2698 (push_template_decl_real): A friend member template is
2701 2014-01-29 Paolo Carlini <paolo.carlini@oracle.com>
2704 * decl.c (get_dso_handle_node): Don't crash if dso_handle_node
2707 2014-01-29 Paolo Carlini <paolo.carlini@oracle.com>
2710 * pt.c (instantiate_template_1): Check for error_mark_node the second
2713 2014-01-29 Jason Merrill <jason@redhat.com>
2716 * optimize.c (maybe_thunk_body): Build a RETURN_EXPR for
2717 cdtor_returns_this case.
2720 * decl.c (cxx_maybe_build_cleanup): Call mark_used.
2722 2014-01-29 Paolo Carlini <paolo.carlini@oracle.com>
2725 * semantics.c (finish_omp_reduction_clause): Check type for
2728 2014-01-28 Jason Merrill <jason@redhat.com>
2731 * pt.c (tsubst_decl) [VAR_DECL]: Allow in unevaluated context.
2732 (tsubst_copy): Use it if lookup fails.
2735 * pt.c (tsubst_function_type): Make sure we keep the same function
2739 * semantics.c (build_anon_member_initialization): Stop walking
2740 when we run out of COMPONENT_REFs.
2743 * decl.c (lookup_and_check_tag): Ignore template parameters if
2744 scope == ts_current.
2745 * pt.c (check_template_shadow): Don't complain about the injected
2748 * decl.c (duplicate_decls): Tweak.
2751 * mangle.c (write_unqualified_name): Handle operator auto.
2753 2014-01-27 Jason Merrill <jason@redhat.com>
2757 * call.c (reference_binding): Pass LOOKUP_NO_TEMP_BIND for
2758 list-initialization. A conversion to rvalue ref that involves
2759 an lvalue-rvalue conversion is bad.
2760 (convert_like_real): Give helpful error message.
2763 * decl.c (duplicate_decls): Always use oldtype for TYPE_DECL.
2766 * pt.c (tsubst_copy_and_build) [TRAIT_EXPR]: Use tsubst for
2770 * pt.c (template_parm_to_arg): Call convert_from_reference.
2771 (tsubst_template_arg): Don't strip reference refs.
2774 * call.c (build_aggr_conv): Reject value-initialization of reference.
2778 * call.c (convert_like_real): Give helpful error about excess braces
2779 for ck_rvalue of scalar type.
2782 * call.c (reference_binding): Only elide braces if the single
2783 element is reference-related.
2786 * typeck.c (cp_build_modify_expr): Make the RHS an rvalue before
2790 * typeck.c (cp_truthvalue_conversion): Use explicit comparison for
2794 * decl.c (compute_array_index_type): Don't call
2795 maybe_constant_value for a non-integral expression.
2797 2014-01-24 Balaji V. Iyer <balaji.v.iyer@intel.com>
2799 * call.c (magic_varargs_p): Replaced flag_enable_cilkplus with
2801 * cp-gimplify.c (cp_genericize): Likewise.
2802 * decl.c (grokfndecl): Likewise.
2803 * parser.c (cp_parser_postfix_expression): Likewise.
2804 (cp_parser_postfix_open_square_expression): Likewise.
2805 (cp_parser_direct_declarator): Likewise.
2806 (is_cilkplus_vector_p): Likewise.
2807 (cp_parser_omp_clause_name): Likewise.
2808 (cp_parser_omp_all_clauses): Likewise.
2809 * pt.c (apply_late_template_attributes): Likewise.
2810 * typeck.c (cp_build_array_ref): Likewise.
2811 (cp_build_compound_expr): Likewise.
2812 (check_return_expr): Likewise.
2814 2014-01-24 Jason Merrill <jason@redhat.com>
2817 * decl.c (grokdeclarator): Turn pedwarn about auto return type in
2822 * typeck2.c (process_init_constructor_array): Don't create
2825 2014-01-24 Jakub Jelinek <jakub@redhat.com>
2827 * typeck2.c (split_nonconstant_init_1): Fix num_split_elts
2828 handling for RANGE_ARRAY case.
2830 2014-01-24 Paolo Carlini <paolo.carlini@oracle.com>
2833 * name-lookup.c (push_using_directive): Use timevar_cond_start.
2835 2014-01-23 Marek Polacek <polacek@redhat.com>
2838 * typeck.c (cp_build_binary_op): Pass location to shorten_compare.
2840 2014-01-23 Marek Polacek <polacek@redhat.com>
2843 * typeck.c (pointer_diff): Give an error on arithmetic on pointer to
2846 2014-01-23 Jason Merrill <jason@redhat.com>
2849 * cp-tree.h (struct language_function): Add infinite_loop and
2851 (current_function_infinite_loop): New.
2852 * semantics.c (begin_maybe_infinite_loop, end_maybe_infinite_loop)
2853 (break_maybe_infinite_loop): New.
2854 (finish_while_stmt_cond, finish_while_stmt, begin_do_stmt)
2855 (finish_do_stmt, finish_for_cond, finish_for_stmt)
2856 (begin_range_for_stmt): Use them.
2857 * decl.c (finish_function): Don't warn about missing return
2858 if current_function_infinite_loop.
2859 * pt.c (instantiate_decl): Copy current_function_infinite_loop.
2860 * parser.c (cp_parser_jump_statement): Call break_maybe_infinite_loop.
2862 * call.c (build_op_delete_call): Use make_tree_vector and
2863 release_tree_vector.
2865 2014-01-23 Paolo Carlini <paolo.carlini@oracle.com>
2868 * parser.c (cp_parser_enum_specifier): Handle TYPENAME_TYPE as
2869 nested_name_specifier.
2871 2014-01-23 Balaji V. Iyer <balaji.v.iyer@intel.com>
2873 * parser.c (cp_parser_direct_declarator): When Cilk Plus is enabled
2874 see if there is an attribute after function decl. If so, then
2876 (cp_parser_late_return_type_opt): Handle parsing of Cilk Plus SIMD
2877 enabled function late parsing.
2878 (cp_parser_gnu_attribute_list): Parse all the tokens for the vector
2879 attribute for a SIMD-enabled function.
2880 (cp_parser_omp_all_clauses): Skip parsing to the end of pragma when
2881 the function is used by SIMD-enabled function (indicated by NULL
2882 pragma token). Added 3 new clauses: PRAGMA_CILK_CLAUSE_MASK,
2883 PRAGMA_CILK_CLAUSE_NOMASK and PRAGMA_CILK_CLAUSE_VECTORLENGTH
2884 (cp_parser_cilk_simd_vectorlength): Modified this function to handle
2885 vectorlength clause in SIMD-enabled function and #pragma SIMD's
2886 vectorlength clause. Added a new bool parameter to differentiate
2888 (cp_parser_cilk_simd_fn_vector_attrs): New function.
2889 (is_cilkplus_vector_p): Likewise.
2890 (cp_parser_late_parsing_elem_fn_info): Likewise.
2891 (cp_parser_omp_clause_name): Added a check for "mask", "nomask"
2892 and "vectorlength" clauses when Cilk Plus is enabled.
2893 (cp_parser_omp_clause_linear): Added a new parameter of type bool
2894 and emit a sorry message when step size is a parameter.
2895 * parser.h (cp_parser::cilk_simd_fn_info): New field.
2896 * decl.c (grokfndecl): Added flag_enable_cilkplus along with
2898 * pt.c (apply_late_template_attributes): Likewise.
2900 2014-01-23 Jakub Jelinek <jakub@redhat.com>
2903 * semantics.c (finish_omp_reduction_clause): Reject
2904 BIT_AND_EXPR, BIT_IOR_EXPR and BIT_XOR_EXPR on COMPLEX_TYPEs.
2906 2014-01-22 Ville Voutilainen <ville.voutilainen@gmail.com>
2909 * parser.c (cp_parser_class_head): Push the class before parsing
2910 the base-clause, pop after it.
2912 2014-01-20 Eric Botcazou <ebotcazou@adacore.com>
2914 * decl2.c (cpp_check): Revert prototype change.
2916 2014-01-17 Paolo Carlini <paolo.carlini@oracle.com>
2920 * init.c (build_value_init_noctor): Don't pass error_mark_node to
2923 2014-01-17 Paolo Carlini <paolo.carlini@oracle.com>
2926 * init.c (build_value_init_noctor): Assert !TYPE_HAS_COMPLEX_DFLT
2927 only when errorcount == 0.
2929 2014-01-17 Marek Polacek <polacek@redhat.com>
2932 * cvt.c (ocp_convert): Don't segfault on non-existing
2933 ENUM_UNDERLYING_TYPE.
2935 2014-01-16 Jason Merrill <jason@redhat.com>
2938 * tree.c (bot_manip): Update the location of builtin_LINE and
2941 2014-01-14 Jason Merrill <jason@redhat.com>
2944 * typeck2.c (massage_init_elt): New.
2945 (process_init_constructor_record)
2946 (process_init_constructor_union): Use it.
2947 (process_init_constructor_array): Use it. Use RANGE_EXPR.
2948 (split_nonconstant_init_1): Handle it.
2949 * semantics.c (cxx_eval_vec_init_1): Use force_rvalue.
2951 2014-01-09 Balaji V. Iyer <balaji.v.iyer@intel.com>
2954 * parser.c (cp_parser_postfix_expression): Added a new if-statement
2955 and replaced an existing if-statement with else-if statement.
2956 Changed an existing error message wording to match the one from the C
2959 2014-01-08 Jason Merrill <jason@redhat.com>
2962 * class.c (abi_tag_data): Add tags field.
2963 (check_abi_tags): Initialize it.
2964 (find_abi_tags_r): Support collecting missing tags.
2965 (mark_type_abi_tags): Don't look at template args.
2966 (inherit_targ_abi_tags): New.
2967 (check_bases_and_members): Use it.
2968 * cp-tree.h (ABI_TAG_IMPLICIT): New.
2969 * mangle.c (write_abi_tags): Check it.
2971 2014-01-07 Jason Merrill <jason@redhat.com>
2974 * pt.c (num_innermost_template_parms): New.
2975 (get_underlying_template): Use it.
2978 * mangle.c (write_guarded_var_name): Handle null DECL_NAME.
2980 2014-01-07 Paolo Carlini <paolo.carlini@oracle.com>
2982 * semantics.c (trait_expr_value, [CPTK_IS_BASE_OF]): Implement
2983 the letter of 20.11.6 about Base and Derived naming the same
2984 class type modulo cv-qualifiers.
2986 2014-01-06 Adam Butcher <adam@jessamine.co.uk>
2989 * lambda.c (maybe_add_lambda_conv_op): Handle marking conversion
2990 function as unimplemented for generic lambdas with varargs.
2993 * parser.c (cp_parser_template_parameter): Early out with
2994 error_mark_node if parameter declaration was not parsed.
2997 * parser.c (cp_parser_lambda_expression): Save/reset/restore
2998 auto_is_implicit_function_template_parm_p around lambda body.
3001 * parser.c (cp_parser_init_declarator): Undo fully implicit
3002 template parameter list when declarator is not a function.
3004 2014-01-03 Marc Glisse <marc.glisse@inria.fr>
3007 * cvt.c (convert_to_void): Handle VEC_PERM_EXPR and VEC_COND_EXPR.
3009 2014-01-03 Tobias Burnus <burnus@net-b.de>
3012 * pt.c (tsubst_omp_for_iterator): Early return for error_mark_node.
3014 2014-01-03 Paolo Carlini <paolo.carlini@oracle.com>
3018 * parser.c (cp_parser_perform_range_for_lookup): Don't pass true
3019 as include_std to perform_koenig_lookup.
3020 (cp_parser_postfix_expression): Adjust.
3021 * pt.c (tsubst_copy_and_build): Likewise.
3022 * semantics.c (perform_koenig_lookup): Remove bool parameter.
3023 (omp_reduction_lookup): Adjust.
3024 * name-lookup.c (lookup_arg_dependent_1): Remove bool parameter.
3025 (lookup_arg_dependent): Likewise.
3026 (lookup_function_nonclass): Adjust.
3027 * name-lookup.h: Adjust declaration.
3028 * cp-tree.h: Likewise.
3030 2014-01-02 Marc Glisse <marc.glisse@inria.fr>
3033 * parser.c (cp_parser_userdef_numeric_literal): Mention
3034 -fext-numeric-literals in the message.
3036 2014-01-02 Marc Glisse <marc.glisse@inria.fr>
3039 * call.c (build_conditional_expr_1): Check the return value of
3042 2014-01-02 Marc Glisse <marc.glisse@inria.fr>
3044 * call.c (convert_like_real): Check complain.
3046 2014-01-02 Marc Glisse <marc.glisse@inria.fr>
3049 * typeck.c (build_x_vec_perm_expr): Handle non-dependent arguments
3052 2014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
3054 Update copyright years
3056 2014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
3058 * cp-array-notation.c, cp-cilkplus.c, vtable-class-hierarchy.c: Use
3059 the standard form for the copyright notice.
3061 Copyright (C) 2014 Free Software Foundation, Inc.
3063 Copying and distribution of this file, with or without modification,
3064 are permitted in any medium without royalty provided the copyright
3065 notice and this notice are preserved.