1 2014-06-04 Jason Merrill <jason@redhat.com>
3 * parser.c (cp_parser_diagnose_invalid_type_name): Give helpful note
4 for noexcept and thread_local, too.
7 * decl.c (check_initializer): Maybe clear
8 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
10 2014-06-05 Richard Biener <rguenther@suse.de>
13 * typeck.c (cp_build_indirect_ref): Do not emit strict-aliasing
14 warnings for accessing empty classes.
16 2014-06-05 Marek Polacek <polacek@redhat.com>
19 * parser.c (cp_parser_binary_expression): Warn when logical not is
20 used on the left hand side operand of a comparison.
22 2014-06-04 Paolo Carlini <paolo.carlini@oracle.com>
25 * typeck.c (cp_build_modify_expr): Handle array of characters
26 initialized by a string literal.
27 * decl.c (check_initializer): Handle parenthesized string literal
29 * typeck2.c (store_init_value): Remove redundant check.
31 2014-06-04 Jason Merrill <jason@redhat.com>
35 * cp-gimplify.c (cp_gimplify_expr): Handle CALL_EXPR_LIST_INIT_P here.
36 * semantics.c (simplify_aggr_init_expr): Not here, just copy it.
38 2014-06-04 Igor Zamyatin <igor.zamyatin@intel.com>
41 * cp-array-notation.c (expand_sec_reduce_builtin): Handle the case
44 2014-06-03 Paolo Carlini <paolo.carlini@oracle.com>
48 * call.c (standard_conversion): Convert nullptr to bool only
49 in case of direct-initialization.
50 (convert_like_real): Provide informative error message.
52 2014-06-03 Marek Polacek <polacek@redhat.com>
55 * semantics.c (finish_switch_cond): Warn if switch condition has
58 2014-06-03 Jason Merrill <jason@redhat.com>
61 * pt.c (tsubst_copy) [VAR_DECL]: Try lookup first. Add a new
62 variable to local_specializations.
65 * call.c (is_std_init_list): Check CLASSTYPE_TEMPLATE_INFO.
67 2014-06-02 Jason Merrill <jason@redhat.com>
70 * decl.c (reshape_init_class): Handle un-folded
74 * pt.c (pack_deducible_p): Handle canonicalization.
76 2014-06-02 Paolo Carlini <paolo.carlini@oracle.com>
78 * pt.c (tsubst_function_type): Initialize arg_types.
80 2014-06-02 Siva Chandra Reddy <sivachandra@google.com>
83 * class.c (handle_using_decl): Pass the correct scope to
84 cp_emit_debug_info_for_using.
86 2014-06-02 Ville Voutilainen <ville.voutilainen@gmail.com>
90 * search.c (accessible_p): Use current_nonlambda_class_type.
91 * semantics.c (check_accessibility_of_qualified_id): Likewise.
93 2014-06-02 Andrew MacLeod <amacleod@redhat.com>
95 * decl.c: Include builtins.h.
96 * semantics.c: Likewise.
98 2014-05-31 Paolo Carlini <paolo.carlini@oracle.com>
102 * cp-tree.h (TYPE_HAS_LATE_RETURN_TYPE): Add.
103 * pt.c (tsubst_function_type): Inject the this parameter; do the
104 substitutions in the order mandated by the DR.
105 (copy_default_args_to_explicit_spec): Copy TYPE_HAS_LATE_RETURN_TYPE.
106 * decl.c (grokdeclarator): Maybe set TYPE_HAS_LATE_RETURN_TYPE.
107 (static_fn_type): Copy it.
108 * decl2.c (build_memfn_type, change_return_type,
109 cp_reconstruct_complex_type): Likewise.
110 * parser.c (cp_parser_lambda_declarator_opt): Likewise.
111 * tree.c (strip_typedefs): Likewise.
112 * typeck.c (merge_types): Likewise.
114 2014-05-30 Jason Merrill <jason@redhat.com>
117 * pt.c (instantiate_decl): Check that defer_ok is not set for
121 * pt.c (tsubst_init): Split out from...
122 (tsubst_expr) [DECL_EXPR]: Here.
123 (tsubst_copy) [VAR_DECL]: Use it.
124 * semantics.c (finish_id_expression): Return the decl for static/const.
126 2014-05-28 Jason Merrill <jason@redhat.com>
129 * decl.c (cxx_comdat_group): Return a decl.
130 * optimize.c (cdtor_comdat_group): Get its DECL_ASSEMBLER_NAME.
132 * pt.c (tsubst) [ARRAY_TYPE]: Check for array of array of unknown
136 * call.c (build_aggr_conv): Ignore passed in flags.
137 (build_array_conv, build_complex_conv): Likewise.
139 2014-05-23 Jan Hubicka <hubicka@ucw.cz>
141 * optimize.c (maybe_thunk_body): Use set_comdat_group.
142 (maybe_clone_body): Likewise.
143 * decl.c (duplicate_decls): Update code duplicating comdat group;
144 do not copy symtab pointer; before freeing newdecl remove it
146 * decl2.c (constrain_visibility): Use set_comdat_group.
148 2014-05-23 Jan Hubicka <hubicka@ucw.cz>
150 * rtti.c: Include tm_p.h
151 (emit_tinfo_decl): Force RTTI data to be aligned to required
154 2014-05-23 Jan Hubicka <hubicka@ucw.cz>
156 * class.c (build_vtable): Align vtables to TARGET_VTABLE_ENTRY_ALIGN
157 ignoring other target adjustments.
159 2014-05-23 Thomas Schwinge <thomas@codesourcery.com>
161 * semantics.c (finish_omp_clauses): Remove duplicated variable
164 * parser.c (cp_parser_omp_target): Return bool values.
166 2014-05-22 Paolo Carlini <paolo.carlini@oracle.com>
169 * lambda.c (add_capture): Enforce that capture by value requires
171 * typeck2.c (cxx_incomplete_type_inform): Early return if
172 TYPE_MAIN_DECL is null.
174 2014-05-21 Jonathan Wakely <jwakely@redhat.com>
177 * cp-array-notation.c (cilkplus_an_triplet_types_ok_p): Fix condition.
179 2014-05-21 Ville Voutilainen <ville.voutilainen@gmail.com>
182 * lambda.c (build_capture_proxy, add_capture): Treat normal
183 captures and init-captures identically.
185 2014-05-21 Mark Wielaard <mjw@redhat.com>
188 * cp-lang.c (cxx_enum_underlying_base_type): New function.
189 (LANG_HOOKS_ENUM_UNDERLYING_BASE_TYPE): Define.
191 2014-05-21 Richard Sandiford <rsandifo@linux.vnet.ibm.com>
193 * cvt.c (convert_to_void): Use void_node instead of void_zero_node.
194 * cp-array-notation.c (replace_invariant_exprs): Likewise.
195 (expand_array_notation): Handle VOID_CST.
196 * error.c (dump_expr): Likewise.
197 * cxx-pretty-print.c (cxx_pretty_printer::primary_expression)
198 (cxx_pretty_printer::expression): Likewise.
199 (pp_cxx_new_expression): Use void_node instead of void_zero_node.
200 * decl.c (register_dtor_fn): Likewise.
201 * init.c (build_raw_new_expr, build_new_1, build_vec_init)
202 (build_delete, push_base_cleanups): Likewise.
203 * mangle.c (write_expression): Likewise.
204 * semantics.c (finish_break_stmt, empty_expr_stmt_p): Likewise.
205 * pt.c (tsubst_decl, tsubst_copy_and_build): Likewise.
206 (tsubst, tsubst_copy, build_non_dependent_expr): Handle VOID_CST.
207 * tree.c (cp_tree_equal): Likewise.
208 (build_dummy_object, is_dummy_object, stabilize_expr): Use void_node
209 instead of void_zero_node.
210 * typeck.c (check_return_expr): Likewise.
211 * typeck2.c (build_functional_cast): Likewise.
213 2014-05-21 Igor Zamyatin <igor.zamyatin@intel.com>
216 * parser.c (cp_parser_postfix_expression): Move handling of cilk_sync
218 (cp_parser_statement): ...here. Make sure only semicolon can go after
221 2014-05-20 Paolo Carlini <paolo.carlini@oracle.com>
226 * typeck2.c (digest_nsdmi_init): New.
227 * parser.c (cp_parser_late_parse_one_default_arg): Use it.
228 * init.c (get_nsdmi): Likewise.
229 * cp-tree.h (digest_nsdmi_init): Declare.
231 2014-05-20 Jason Merrill <jason@redhat.com>
233 * typeck.c (get_member_function_from_ptrfunc): Don't try to look
234 up a virtual function in a dummy object.
236 2014-05-20 Paolo Carlini <paolo.carlini@oracle.com>
239 * decl.c (duplicate_decls): Replace pair of warning_at with
241 (maybe_commonize_var): Likewise.
243 2014-05-20 Richard Sandiford <rsandifo@linux.vnet.ibm.com>
246 * pt.c (tsubst_copy, tsubst_omp_for_iterator, tsubst_expr)
247 (tsubst_copy_and_build): Perform recursive substitutions in a
250 2014-05-20 Paolo Carlini <paolo.carlini@oracle.com>
253 * typeck2.c (cxx_incomplete_type_inform): New.
254 (cxx_incomplete_type_diagnostic): Use it.
255 * decl.c (grokdeclarator): Check the element type of an
256 incomplete array type; call the above.
257 * cp-tree.h (cxx_incomplete_type_inform): Declare.
259 2014-05-19 Jason Merrill <jason@redhat.com>
262 * pt.c (tsubst_copy): Don't check at_function_scope_p.
263 (instantiate_class_template_1): Don't push_to_top_level in an nsdmi.
265 2014-05-19 Paolo Carlini <paolo.carlini@oracle.com>
267 * typeck2.c (cxx_incomplete_type_diagnostic): Use inform.
268 * parser.c (cp_parser_enum_specifier): Likewise.
270 2014-05-17 Trevor Saunders <tsaunders@mozilla.com>
272 * class.c (sorted_fields_type_new): Adjust.
273 * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Likewise.
274 * cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise.
275 * cp-tree.h: Remove usage of variable_size gty attribute.
276 * decl.c (make_label_decl): Adjust.
277 (check_goto): Likewise.
278 (start_preparsed_function): Likewise.
279 (save_function_data): Likewise.
280 * lex.c (init_reswords): Likewise.
281 (retrofit_lang_decl): Likewise.
282 (cxx_dup_lang_specific_decl): Likewise.
283 (copy_lang_type): Likewise.
284 (cxx_make_type): Likewise.
285 * name-lookup.c (binding_entry_make): Likewise.
286 (binding_table_construct): Likewise.
287 (binding_table_new): Likewise.
288 (cxx_binding_make): Likewise.
289 (pushdecl_maybe_friend_1): Likewise.
290 (begin_scope): Likewise.
291 (push_to_top_level): Likewise.
292 * parser.c (cp_lexer_alloc): Likewise.
293 (cp_lexer_new_from_tokens): Likewise.
294 (cp_token_cache_new): Likewise.
295 (cp_parser_context_new): Likewise.
296 (cp_parser_new): Likewise.
297 (cp_parser_nested_name_specifier_opt): Likewise.
298 (cp_parser_template_id): Likewise.
299 * pt.c (maybe_process_partial_specialization): Likewise.
300 (register_specialization): Likewise.
301 (add_pending_template): Likewise.
302 (lookup_template_class_1): Likewise.
303 (push_tinst_level): Likewise.
304 * semantics.c (register_constexpr_fundef): Likewise.
305 (cxx_eval_call_expression): Likewise.
306 * typeck2.c (abstract_virtuals_error_sfinae): Likewise.
308 2014-05-16 Paolo Carlini <paolo.carlini@oracle.com>
311 * parser.c (cp_parser_diagnose_invalid_type_name): Early return
312 when cp_parser_lookup_name sets ambiguous_decls.
314 2014-05-15 Jason Merrill <jason@redhat.com>
316 * call.c (print_conversion_rejection): Use loc consistently.
318 2014-05-14 Paolo Carlini <paolo.carlini@oracle.com>
320 * cp-tree.h (DIRECT_LIST_INIT_P): Add.
321 * call.c (convert_like_real, build_new_method_call_1): Use it.
322 * decl2.c (grokfield): Likewise.
323 * init.c (perform_member_init, build_aggr_init, expand_default_init,
324 build_new_1): Likewise.
325 * mangle.c (write_expression): Likewise.
326 * parser.c (cp_parser_late_parse_one_default_arg): Likewise.
328 2014-05-14 Jason Merrill <jason@redhat.com>
332 * call.c (reference_binding): Treat lvalue/rvalue mismatch and
333 dropped cv-quals as a bad conversion.
334 (convert_like_real) [ck_ref_bind]: Explain them.
335 (compare_ics): Check badness before stripping reference
336 bindings. Handle comparing bad reference bindings.
337 * typeck.c (comp_cv_qualification): Add overload that just takes
339 * cp-tree.h: Declare it.
341 * call.c (struct conversion_info): Rename 'from_type' to 'from'.
342 (arg_conversion_rejection, bad_arg_conversion_rejection)
343 (explicit_conversion_rejection, template_conversion_rejection): Adjust.
344 (add_function_candidate): Pass actual argument, rather than type, to
345 bad_arg_conversion_rejection.
346 (print_conversion_rejection): Explain what's wrong with the conversion.
347 (print_z_candidates): Say "candidate:" before each candidate.
348 (splice_viable): Be strict if we see a viable or template candidate.
349 (build_user_type_conversion_1): Pass false to strict parameter.
350 (perform_overload_resolution, build_conditional_expr_1): Likewise.
351 (build_new_op_1, build_new_method_call_1): Likewise.
352 (build_op_call_1): Pass true to strict parameter.
354 2014-05-13 Jason Merrill <jason@redhat.com>
356 * call.c (print_error_for_call_failure): Say "no match" rather
357 than "ambiguous" if there were no strict matches.
358 (build_new_method_call_1): Likewise.
361 * semantics.c (is_this_parameter): Allow capture proxies too.
363 2014-05-12 Jason Merrill <jason@redhat.com>
365 * call.c (maybe_print_user_conv_context): New.
366 (convert_like_real): Use it. Print call context for bad
367 user-defined conversion.
368 (build_over_call): Print call context for bad 'this' conversion.
370 * call.c (convert_like_real): Use inform for identifying the
373 2014-05-12 Paolo Carlini <paolo.carlini@oracle.com>
375 * cvt.c (cp_convert_to_pointer): Don't call error_at if
376 complain & tf_error is false.
378 * decl.c (make_unbound_class_template): Prefer inform for
379 "declared here"-type message.
381 2014-05-09 Momchil Velikov <momchil.velikov@gmail.com>
385 * lambda.c (lambda_expr_this_capture): Add new parameter
386 add_capture_p controlling whether the functions will try to
387 capture 'this' via the default capture.
388 (maybe_resolve_dummy): Likewise.
389 * cp-tree.h: Adjust prototypes.
390 * call.c, semantics.c: Change callers of these functions.
391 * call.c (build_new_method_call_1): Use the actual 'this' that
392 would be potentially captured for the overload resolution, instead
395 2014-05-09 Paolo Carlini <paolo.carlini@oracle.com>
397 * pt.c (convert_nontype_argument_function): Add tsubst_flags_t
399 (convert_nontype_argument): Adjust calls.
400 (coerce_template_parameter_pack): Add missing complain & tf_error
403 2014-05-09 Jason Merrill <jason@redhat.com>
407 * call.c (build_conditional_expr_1, conditional_conversion): Handle
408 non-class lvalues and xvalues that differ only in cv-qualifiers.
412 * call.c (build_user_type_conversion_1): The copy-init temporary
416 * tree.c (stabilize_expr): A stabilized prvalue is an xvalue.
419 * call.c (build_conditional_expr_1): If overload resolution finds
420 no match, just say "different types".
423 * call.c (build_conditional_expr_1): Improve ambiguity diagnostic.
426 * call.c (build_conditional_expr_1): Don't try to pool cv-quals
427 if we didn't find a conversion.
428 Don't accept a bad conversion too early.
430 2014-05-08 Paolo Carlini <paolo.carlini@oracle.com>
433 * typeck.c (convert_for_assignment): Provide an inform for pointers
434 to incomplete class types.
436 2014-05-07 Paolo Carlini <paolo.carlini@oracle.com>
439 * pt.c (convert_nontype_argument): Protect all the error calls
440 with complain & tf_error.
442 2014-05-07 Paolo Carlini <paolo.carlini@oracle.com>
445 * pt.c (instantiate_decl): Avoid generating the body of a
448 2014-05-06 Paolo Carlini <paolo.carlini@oracle.com>
451 * pt.c (maybe_begin_member_template_processing): Use
454 2014-05-06 Kenneth Zadeck <zadeck@naturalbridge.com>
455 Mike Stump <mikestump@comcast.net>
456 Richard Sandiford <rdsandiford@googlemail.com>
458 * call.c: Include wide-int.h.
459 (type_passed_as): Use tree_int_cst_lt instead of INT_CST_LT_UNSIGNED.
460 (convert_for_arg_passing): Likewise.
461 * class.c: Include wide-int.h.
462 (walk_subobject_offsets): Use tree_int_cst_lt instead of INT_CST_LT.
463 (end_of_class): Use tree_int_cst_lt instead of INT_CST_LT_UNSIGNED.
464 (include_empty_classes): Likewise
465 (layout_class_type): Use tree_int_cst_lt instead of INT_CST_LT.
466 * cvt.c: Include wide-int.h.
467 (ignore_overflows): Use wide_int_to_tree.
468 * decl.c: Include wide-int.h.
469 (check_array_designated_initializer): Use wide-int interfaces.
470 (compute_array_index_type): Use tree_int_cst_lt instead of INT_CST_LT.
471 (finish_enum_value_list): Use signop.
472 (build_enumerator): Use wide-int interfaces.
473 * init.c: Include wide-int.h.
474 (build_new_1): Use wide-int interfaces.
475 * mangle.c: Include wide-int.h.
476 (write_integer_cst): Use wide-int interfaces.
477 (write_array_type): Likewise.
478 * tree.c: Include wide-int.h.
479 (cp_tree_equal): Use tree_int_cst_equal.
480 * typeck2.c: Include wide-int.h.
481 (process_init_constructor_array): Use wide-int interfaces.
483 2014-05-03 Paolo Carlini <paolo.carlini@oracle.com>
486 * decl.c (grokfndecl): Check duplicate_decls return value for
488 * pt.c (instantiate_decl): A deleted function is defined.
490 2014-05-02 Jason Merrill <jason@redhat.com>
492 * decl2.c (vague_linkage_p): Local statics have vague linkage.
495 * lambda.c (lambda_capture_field_type): Wrap anything dependent
497 (add_capture): Check for VLA before calling it.
498 * semantics.c (is_this_parameter): Accept any 'this' parameter, not
499 just the current one. Make non-static.
500 * cp-tree.h: Declare it.
501 * pt.c (tsubst_copy) [VAR_DECL]: Also build a new VAR_DECL if
502 the operand was static or constant.
504 2014-05-02 Marek Polacek <polacek@redhat.com>
506 * typeck.c (maybe_warn_about_returning_address_of_local): Separate
509 2014-05-01 Marek Polacek <polacek@redhat.com>
512 * typeck.c (maybe_warn_about_returning_address_of_local): Distinguish
513 between label and variable when warning about returning local address.
515 2014-04-30 Jason Merrill <jason@redhat.com>
518 * init.c (build_value_init): Don't try to call an array constructor.
521 * typeck2.c (massage_init_elt): Use maybe_constant_init.
523 2014-04-30 Marek Polacek <polacek@redhat.com>
525 * typeck.c (cp_build_binary_op): Call ubsan_instrument_division
526 even when SANITIZE_FLOAT_DIVIDE is on. Set doing_div_or_mod even
527 for non-integer types.
529 2014-04-29 Jason Merrill <jason@redhat.com>
532 Represent the unevaluated exception specification of an implicitly
533 declared or deleted function with a simple placeholder, not a list
535 * cp-tree.h (UNEVALUATED_NOEXCEPT_SPEC_P): New.
536 * except.c (unevaluated_noexcept_spec): New.
537 * class.c (deduce_noexcept_on_destructor): Use it.
538 * decl.c (check_redeclaration_exception_specification): Call
539 maybe_instantiate_noexcept.
540 (duplicate_decls): Call it before merge_types.
541 (start_preparsed_function): Call maybe_instantiate_noexcept.
542 * decl2.c (mark_used): Call maybe_instantiate_noexcept earlier.
543 * init.c (get_nsdmi): Factor out of perform_member_init.
544 * method.c (process_subob_fn): Call maybe_instantiate_noexcept.
545 (walk_field_subobs): Consider NSDMI for EH spec.
546 (get_defaulted_eh_spec): New.
547 (implicitly_declare_fn): Use unevaluated_noexcept_spec.
548 (defaulted_late_check): Defer EH checking in non-template classes.
549 (after_nsdmi_defaulted_late_checks): New.
550 * parser.c (cp_parser_class_specifier_1): Use it.
551 (unparsed_classes): New macro.
552 * parser.h (cp_unparsed_functions_entry_d): Add classes field.
553 * pt.c (maybe_instantiate_noexcept): Use get_defaulted_eh_spec.
554 Remove list-of-functions handling.
555 * typeck2.c (merge_exception_specifiers): Remove list-of-functions
556 handling and FN parameter.
557 * typeck.c (merge_types): Adjust.
559 2014-04-28 Paolo Carlini <paolo.carlini@oracle.com>
562 * parser.c (cp_parser_alias_declaration): Check return value of
565 2014-04-24 Jakub Jelinek <jakub@redhat.com>
567 * parser.c (cp_parser_omp_atomic): Allow seq_cst before
568 atomic-clause, allow comma in between atomic-clause and
571 2014-04-24 Marc Glisse <marc.glisse@inria.fr>
574 * rtti.c (emit_support_tinfos): Do not iterate on
575 registered_builtin_types (partial revert).
577 2014-04-23 Dinar Temirbulatov <dtemirbulatov@gmail.com>
580 * semantics.c (apply_deduced_return_type): Complete non-void type
581 before estimating whether the type is aggregate.
583 2014-04-22 Marc Glisse <marc.glisse@inria.fr>
586 * rtti.c (emit_support_tinfo_1): New function, extracted from
588 (emit_support_tinfos): Call it and iterate on registered_builtin_types.
590 2014-04-22 Jakub Jelinek <jakub@redhat.com>
593 * parser.c (cp_parser_omp_parallel): If cp_parser_omp_for
594 fails, don't set OM_PARALLEL_COMBINED and return NULL.
596 2014-04-18 Jason Merrill <jason@redhat.com>
599 * call.c (reference_binding): Recurse on user-defined conversion.
602 * call.c (standard_conversion): Don't try to apply restrict to void.
604 2014-04-16 Marc Glisse <marc.glisse@inria.fr>
606 * decl.c (reshape_init_r): Handle a single element of vector type.
608 2014-04-16 Patrick Palka <patrick@parcs.ath.cx>
611 * decl2.c (cplus_decl_attributes): Handle
612 pointer-to-member-function declarations.
614 2014-04-16 Patrick Palka <patrick@parcs.ath.cx>
617 * call.c (build_user_type_coversion): Use build_dummy_object
618 to create the placeholder object for a constructor method call.
619 (build_special_member_call): Likewise.
620 (build_over_call): Check for the placeholder object with
622 (build_new_method_call_1): Likewise. Don't attempt to resolve
623 a dummy object for a constructor method call.
625 2014-04-16 Paul Pluzhnikov <ppluzhnikov@google.com>
628 * friend.c (add_friend, make_friend_class): Move repeated friend
629 warning under Wredundant_decls.
631 2014-04-15 Paolo Carlini <paolo.carlini@oracle.com>
633 * decl.c (duplicate_decls): Remove redundant TYPE_NAME use.
634 * name-lookup.c (pushdecl_maybe_friend_1): Likewise.
635 (do_class_using_decl): Likewise.
636 * mangle.c (dump_substitution_candidates): Use TYPE_NAME_STRING.
638 2014-04-15 Jakub Jelinek <jakub@redhat.com>
641 * Make-lang.h (CP_PLUGIN_HEADERS): Add type-utils.h.
643 2014-04-14 Paolo Carlini <paolo.carlini@oracle.com>
645 * cp-tree.h (TYPE_IDENTIFIER): Remove declaration.
647 2014-04-14 Paolo Carlini <paolo.carlini@oracle.com>
649 * pt.c (mark_template_parm): Use template_parm_level_and_index.
651 2014-04-11 Jason Merrill <jason@redhat.com>
653 * parser.h (struct cp_token): Rename ambiguous_p to error_reported.
655 (cp_lexer_get_preprocessor_token): Always clear it.
656 (cp_parser_lambda_expression): Use it to avoid duplicate diagnostics.
660 * decl.c (reshape_init_r): Handle a single element of class type.
663 * decl.c (cxx_init_decl_processing): Set DECL_IS_MALLOC on
664 built-in operator new.
666 2014-04-11 Paolo Carlini <paolo.carlini@oracle.com>
669 * name-lookup.c (parse_using_directive): Return early if the
670 attribs argument is error_mark_node; use get_attribute_name.
672 2014-04-11 Jason Merrill <jason@redhat.com>
676 * cp-tree.h (CALL_EXPR_LIST_INIT_P): New.
677 * call.c (struct z_candidate): Add flags field.
678 (add_candidate): Add flags parm.
679 (add_function_candidate, add_conv_candidate, build_builtin_candidate)
680 (add_template_candidate_real): Pass it.
681 (build_over_call): Set CALL_EXPR_LIST_INIT_P.
682 * tree.c (build_aggr_init_expr): Copy it.
683 * semantics.c (simplify_aggr_init_expr): Preevaluate args if it's set.
685 2014-04-10 Richard Biener <rguenther@suse.de>
686 Jakub Jelinek <jakub@redhat.com>
689 * error.c (dump_decl) <case FUNCTION_DECL>: If
690 DECL_LANG_SPECIFIC is NULL, but DECL_ABSTRACT_ORIGIN is not,
691 recurse on DECL_ABSTRACT_ORIGIN instead of printing
694 2014-04-09 Fabien Chêne <fabien@gcc.gnu.org>
696 * pt.c (check_template_variable): Check for the return of pedwarn
697 before emitting a note.
698 * parser.c (cp_parser_lambda_introducer): Likewise.
700 2014-04-08 Paolo Carlini <paolo.carlini@oracle.com>
703 * pt.c (process_template_parm): For an invalid non-type parameter
704 only set TREE_TYPE to error_mark_node.
705 (push_inline_template_parms_recursive, comp_template_parms,
706 redeclare_class_template, coerce_template_template_parm,
707 coerce_template_template_parms, unify): Use error_operand_p.
709 2014-04-08 Nathan Sidwell <nathan@codesourcery.com>
711 * class.c (check_bases_and_members): Warn about non-virtual dtors
712 in public bases only. Check warn_ecpp before complaining about
713 non-polymorphic bases.
715 2014-04-04 Fabien Chêne <fabien@gcc.gnu.org>
717 * decl.c (duplicate_decls): Check for the return of warning_at
718 before emitting a note.
719 (warn_misplaced_attr_for_class_type): Likewise.
720 (check_tag_decl): Likewise.
722 2014-04-04 Paolo Carlini <paolo.carlini@oracle.com>
725 * semantics.c (sort_constexpr_mem_initializers): Robustify loop.
727 2014-04-04 Patrick Palka <patrick@parcs.ath.cx>
730 * semantics.c (add_stmt): Set STATEMENT_LIST_HAS_LABEL.
731 * decl.c (cp_finish_decl): Create a new BIND_EXPR before
732 instantiating a variable-sized type.
735 * decl.c (decl_jump_unsafe): Consider variably-modified decls.
737 2014-04-04 Fabien Chêne <fabien@gcc.gnu.org>
739 * class.c (find_abi_tags_r): Check for the return of warning
740 before emitting a note.
741 (one_inherited_ctor): Likewise.
743 2014-04-04 Fabien Chêne <fabien@gcc.gnu.org>
745 * decl.c (duplicate_decls): Check for the return of permerror
746 before emitting a note.
748 2014-04-03 Nathan Sidwell <nathan@codesourcery.com>
750 * class.c (accessible_nvdtor_p): New.
751 (check_bases): Don't check base destructor here ...
752 (check_bases_and_members): ... check them here. Trigger on
753 Wnon-virtual-dtor flag.
754 (finish_struct_1): Use accessible_nvdtor_p.
756 2014-04-01 Jason Merrill <jason@redhat.com>
758 * pt.c (process_partial_specialization): Say "not deducible"
759 rather than "not used". Use inform.
762 * pt.c (coerce_template_parms): Check that the pack expansion
763 pattern works with the first matching parameter.
765 2014-04-01 Fabien Chêne <fabien@gcc.gnu.org>
767 * init.c (perform_member_init): Homogenize uninitialized
770 2014-04-01 Jason Merrill <jason@redhat.com>
773 * call.c (build_array_conv): Call complete_type.
776 * typeck2.c (PICFLAG_SIDE_EFFECTS): New.
777 (picflag_from_initializer): Return it.
778 (process_init_constructor): Handle it.
781 * decl2.c (is_late_template_attribute): Don't defer abi_tag.
782 * mangle.c (write_unqualified_name): Fix abi_tag on templates.
783 * pt.c (get_template_info): Handle NAMESPACE_DECL.
784 (most_general_template): Handle more kinds of template.
785 * tree.c (handle_abi_tag_attribute): Ignore abi_tag on template
786 instantiations and specializations.
788 2014-03-31 Patrick Palka <patrick@parcs.ath.cx>
791 * typeck.c (maybe_warn_about_returning_address_of_local): Unwrap
792 COMPONENT_REFs and ARRAY_REFs sooner.
794 2014-03-29 Adam Butcher <adam@jessamine.co.uk>
797 * parser.c (cp_parser_init_declarator): Handle erroneous generic type
798 usage in non-functions with pushed scope.
800 2014-03-28 Adam Butcher <adam@jessamine.co.uk>
803 * name-lookup.h (cp_binding_level): New transient field defining_class_p
804 to indicate whether a scope is in the process of defining a class.
805 * semantics.c (begin_class_definition): Set defining_class_p.
806 * name-lookup.c (leave_scope): Reset defining_class_p.
807 * parser.c (synthesize_implicit_template_parm): Use cp_binding_level::
808 defining_class_p rather than TYPE_BEING_DEFINED as the predicate for
809 unwinding to class-defining scope to handle the erroneous definition of
810 a generic function of an arbitrarily nested class within an enclosing
813 2014-03-26 Fabien Chêne <fabien@gcc.gnu.org>
816 * method.c (walk_field_subobs): Improve the diagnostic
817 locations for both REFERENCE_TYPEs and non-static const members.
818 * init.c (diagnose_uninitialized_cst_or_ref_member): Use %q#D
819 instead of %qD to be consistent with the c++11 diagnostic.
821 2014-03-25 Jason Merrill <jason@redhat.com>
825 * class.c (build_vtbl_initializer): Handle abstract dtors here.
826 * search.c (get_pure_virtuals): Not here.
829 * parser.c (cp_parser_lambda_expression): Don't parse the body of
830 a lambda in unevaluated context.
833 * decl.c (create_array_type_for_decl): Complain about array of auto.
835 2014-03-25 Jakub Jelinek <jakub@redhat.com>
838 * semantics.c (potential_constant_expression_1): Handle
841 2014-03-24 Adam Butcher <adam@jessamine.co.uk>
844 * parser.c (cp_parser_parameter_declaration_clause): Prevent 'auto' from
845 introducing an implicit function template parameter within an explicit
848 2014-03-22 Jason Merrill <jason@redhat.com>
851 * decl.c (grokdeclarator): Change permerror about 'virtual auto'
854 2014-03-21 Paolo Carlini <paolo.carlini@oracle.com>
857 * name-lookup.c (push_class_level_binding_1): Check identifier_p
858 on the name argument.
860 2014-03-20 Jakub Jelinek <jakub@redhat.com>
863 * init.c (build_zero_init_1): Ignore fields with error_mark_node
866 2014-03-19 Paolo Carlini <paolo.carlini@oracle.com>
869 * call.c (build_new_method_call_1): Handle pure virtuals called by
872 2014-03-17 Adam Butcher <adam@jessamine.co.uk>
875 * parser.c (cp_parser_member_declaration): Don't allow
876 finish_fully_implicit_template to consider friend declarations to be
877 class member templates.
878 (synthesize_implicit_template_parm): Handling winding back through class
879 scope to the class being defined in order to inject a template argument
883 * parser.c (cp_parser_skip_to_end_of_block_or_statement): Unwind generic
884 function scope as per cp_parser_skip_to_end_of_statement.
886 2014-03-17 Paolo Carlini <paolo.carlini@oracle.com>
889 * typeck2.c (check_narrowing): Use fold_non_dependent_expr_sfinae.
891 2014-03-14 Jason Merrill <jason@redhat.com>
895 * search.c (get_pure_virtuals): Handle abstract dtor here.
896 (dfs_get_pure_virtuals): Not here.
899 * search.c (dfs_get_pure_virtuals): Treat the destructor of an
900 abstract class as pure.
902 2014-03-13 Paolo Carlini <paolo.carlini@oracle.com>
905 * pt.c (maybe_process_partial_specialization): Check return value
906 of check_specialization_namespace.
908 2014-03-13 Paolo Carlini <paolo.carlini@oracle.com>
911 * semantics.c (finish_static_assert): Call cxx_constant_value only
912 if require_potential_rvalue_constant_expression returns true.
914 2014-03-11 Paolo Carlini <paolo.carlini@oracle.com>
917 * method.c (get_inherited_ctor): New.
918 * cp-tree.h (get_inherited_ctor): Declare it.
919 * semantics.c (is_valid_constexpr_fn): Use it.
921 2014-03-10 Jason Merrill <jason@redhat.com>
924 * call.c (convert_default_arg): Remove special handling for
928 * parser.c (cp_parser_class_head): Also check PRIMARY_TEMPLATE_P
929 when deciding whether to call push_template_decl for a member class.
930 * pt.c (push_template_decl_real): Return after wrong levels error.
932 2014-03-08 Adam Butcher <adam@jessamine.co.uk>
935 * pt.c (tsubst_copy): When retrieving a capture pack from a generic
936 lambda, remove the lambda's own template argument list prior to fetching
940 * parser.c (cp_parser_parameter_declaration_clause): Move generic
941 function template unwinding on error into a more general location, ...
942 (cp_parser_skip_to_end_of_statement): ... here.
944 2014-03-07 Jason Merrill <jason@redhat.com>
946 * Make-lang.in (check_g++_parallelize): Split dg.exp.
948 * parser.c (cp_parser_type_id_1): Only allow 'auto' in C++1y if
949 we're in a trailing return type.
951 * typeck.c (comp_template_parms_position): 'auto' and
952 'decltype(auto)' are different from real template parms.
954 * parser.c (cp_parser_using_declaration): Consume the semicolon
955 after bare parameter pack error.
957 * cp-tree.h (REF_PARENTHESIZED_P): New.
958 * semantics.c (force_paren_expr): Set it.
959 * pt.c (do_auto_deduction): Check it.
960 (tsubst) [COMPONENT_REF]: Copy it.
961 * typeck.c (maybe_warn_about_useless_cast): Don't strip dereference.
963 * decl.c (create_array_type_for_decl): Only warn about invalid
964 C++1y VLA if flag_iso or warn_vla>0.
965 (grokdeclarator): Likewise.
966 * pt.c (tsubst): Likewise.
967 * semantics.c (finish_decltype_type): Likewise.
968 * typeck.c (cxx_sizeof_or_alignof_type): Likewise.
969 (cp_build_addr_expr_1): Likewise.
970 * init.c (build_new_1): Improve diagnostics.
972 2014-03-07 Paolo Carlini <paolo.carlini@oracle.com>
975 * decl.c (check_initializer): Return NULL_TREE after error;
976 consistently use inform.
978 2014-03-07 Paolo Carlini <paolo.carlini@oracle.com>
980 * decl.c (check_initializer): Remove dead code.
982 2014-03-06 Marek Polacek <polacek@redhat.com>
985 * typeck.c (check_return_expr): Call contains_cilk_spawn_stmt instead
986 of checking tree code.
988 2014-03-06 Paolo Carlini <paolo.carlini@oracle.com>
990 * parser.c (cp_lexer_set_source_position): New.
991 (cp_parser_mem_initializer): Use it.
992 (cp_parser_postfix_open_square_expression): Likewise.
993 (cp_parser_parenthesized_expression_list): Likewise.
994 (cp_parser_new_initializer): Likewise.
995 (cp_parser_jump_statement): Likewise.
996 (cp_parser_initializer): Likewise.
997 (cp_parser_functional_cast): Likewise.
999 2014-03-05 Jason Merrill <jason@redhat.com>
1002 * semantics.c (force_paren_expr): Only add a PAREN_EXPR to a
1003 dependent expression.
1006 * parser.c (cp_parser_template_id): Don't set up a CPP_TEMPLATE_ID
1007 if re-parsing might succeed.
1008 * semantics.c (finish_id_expression): Use of a parameter outside
1009 the function body is a parse error.
1011 * parser.c (cp_parser_mem_initializer): Set input_location
1012 properly for init-list warning.
1013 (cp_parser_postfix_open_square_expression): Likewise.
1014 (cp_parser_parenthesized_expression_list): Likewise.
1015 (cp_parser_new_initializer): Likewise.
1016 (cp_parser_jump_statement): Likewise.
1017 (cp_parser_initializer): Likewise.
1018 (cp_parser_functional_cast): Likewise.
1020 2014-03-04 Jason Merrill <jason@redhat.com>
1023 * typeck2.c (process_init_constructor_record): Set
1024 CONSTRUCTOR_IS_DIRECT_INIT on {} for omitted initializers.
1028 * parser.c (cp_parser_direct_declarator): Set declarator to
1029 cp_error_declarator on invalid qualified-id.
1031 2014-03-04 Paolo Carlini <paolo.carlini@oracle.com>
1034 * parser.c (cp_parser_using_declaration): Early return when
1035 cp_parser_nested_name_specifier errors out.
1037 2014-03-01 Adam Butcher <adam@jessamine.co.uk>
1040 * parser.c (cp_parser_parameter_declaration_clause): Unwind generic
1041 function scope on parse error in function parameter list.
1043 2014-03-01 Paolo Carlini <paolo.carlini@oracle.com>
1045 * method.c (implicitly_declare_fn): Remove redundant
1046 DECL_TEMPLATE_RESULT and STRIP_TEMPLATE uses.
1047 * semantics.c (is_instantiation_of_constexpr): Likewise.
1048 * error.c (dump_function_decl): Likewise.
1050 2014-03-01 Jason Merrill <jason@redhat.com>
1053 * semantics.c (begin_maybe_infinite_loop): Use
1054 fold_non_dependent_expr_sfinae.
1056 2014-02-28 Jason Merrill <jason@redhat.com>
1059 * typeck.c (cp_build_binary_op): Sorry on vector&&vector.
1061 2014-02-28 Paolo Carlini <paolo.carlini@oracle.com>
1064 * cp-tree.h (DECL_DELETED_FN): Use LANG_DECL_FN_CHECK.
1065 * call.c (print_z_candidate): Remove STRIP_TEMPLATE use.
1066 * lambda.c (maybe_add_lambda_conv_op): Likewise.
1068 2014-02-27 Paolo Carlini <paolo.carlini@oracle.com>
1071 * call.c (convert_arg_to_ellipsis): Return error_mark_node after
1074 2014-02-27 Jason Merrill <jason@redhat.com>
1078 * decl2.c (tentative_decl_linkage): Don't mess with functions that
1079 are not yet defined.
1081 2014-02-26 Jason Merrill <jason@redhat.com>
1085 * class.c (clone_function_decl): Don't note_vague_linkage_fn.
1086 * init.c (build_vtbl_address): Do it here.
1092 * pt.c (struct warning_sentinel): New.
1093 (tsubst_copy_and_build): Use it instead of
1094 c_inhibit_evaluation_warnings.
1095 * typeck.c (maybe_warn_about_useless_cast): Remove
1096 c_inhibit_evaluation_warnings check.
1099 * pt.c (get_template_parm_index): New.
1100 (fixed_parameter_pack_p_1, fixed_parameter_pack_p): New.
1101 (process_template_parm): Allow bare packs in template template
1102 parm template parms.
1103 (coerce_template_parameter_pack): Handle fixed template template
1104 parm packs and fixed packs not at the end of the parm list.
1105 (coerce_template_parms): Handle template parm packs not at the end
1107 (gen_elem_of_pack_expansion_instantiation): Handle a decl expansion.
1110 * pt.c (unify): Ignore alias templates when deducing a template
1116 * call.c (reference_binding): Recurse on user-defined conversion.
1117 (convert_like_real) [ck_ref_bind]: Explain cv-qual mismatch.
1119 2014-02-25 Jason Merrill <jason@redhat.com>
1122 * call.c (reference_binding): Recurse on user-defined conversion.
1123 (convert_like_real) [ck_ref_bind]: Explain cv-qual mismatch.
1125 * call.c (print_conversion_rejection): Handle n_arg of -2.
1126 (build_user_type_conversion_1): Pass it.
1129 * decl2.c (no_linkage_error): Handle C++98 semantics.
1130 (reset_type_linkage): Move from decl.c.
1131 (reset_type_linkage_1, reset_type_linkage_2, bt_reset_linkage_1)
1132 (bt_reset_linkage_2, reset_decl_linkage): New.
1133 (tentative_decl_linkage): Factor out of expand_or_defer_fn_1.
1134 (cp_write_global_declarations): Move condition into no_linkage_error.
1135 * decl.c (grokfndecl, grokvardecl): Use no_linkage_error.
1136 * semantics.c (expand_or_defer_fn_1): Factor out
1137 tentative_decl_linkage.
1138 * cp-tree.h: Adjust.
1140 * decl2.c (finish_static_data_member_decl): Diagnose static data
1141 member in unnamed class.
1142 * class.c (finish_struct_anon_r): Avoid redundant diagnostic.
1145 * class.c (clone_function_decl): Call note_vague_linkage_fn for
1146 defaulted virtual dtor.
1150 * pt.c (get_underlying_template): Fix equivalence calculation.
1152 2014-02-25 Adam Butcher <adam@jessamine.co.uk>
1155 * parser.c (function_being_declared_is_template_p): Return false when
1156 processing a template parameter list.
1157 (cp_parser_parameter_declaration_clause): Don't set
1158 auto_is_implicit_function_template_parm_p when processing a
1159 template parameter list.
1161 * parser.c (synthesize_implicit_template_parm): Inject new template
1162 argument list appropriately when a generic member function
1163 of a class template is declared out-of-line.
1166 * parser.c (cp_parser_direct_declarator): Don't save and
1167 restore num_template_parameter_lists around call to
1168 cp_parser_parameter_declaration_list.
1169 (function_being_declared_is_template_p): New predicate.
1170 (cp_parser_parameter_declaration_list): Use
1171 function_being_declared_is_template_p as predicate for
1172 inspecting current function template parameter list length
1173 rather than num_template_parameter_lists.
1175 2014-02-24 Jason Merrill <jason@redhat.com>
1178 * pt.c (tsubst_omp_for_iterator): Don't let substitution of the
1179 DECL_EXPR initialize a non-class iterator.
1182 * parser.c (cp_parser_template_type_arg): Check for invalid 'auto'.
1184 2014-02-21 Jason Merrill <jason@redhat.com>
1187 * parser.c (cp_parser_type_name): Always check dependency.
1188 (cp_parser_type_specifier_seq): Call
1189 cp_parser_parse_and_diagnose_invalid_type_name.
1192 * semantics.c (expand_or_defer_fn_1): Check DECL_DEFAULTED_FN.
1195 * parser.c (cp_parser_default_argument): Clear
1196 current_class_ptr/current_class_ref like tsubst_default_argument.
1199 * lambda.c (maybe_resolve_dummy): Check lambda_function rather
1200 than current_binding_level.
1203 * typeck2.c (massage_init_elt): Call fold_non_dependent_expr_sfinae.
1206 * parser.c (cp_parser_enum_specifier): Call
1207 check_for_bare_parameter_packs.
1210 * pt.c (tsubst_decl) [TYPE_DECL]: Don't try to instantiate an
1214 * pt.c (lookup_template_class_1): Update DECL_TEMPLATE_INSTANTIATIONS
1215 of the partial instantiation, not the most general template.
1216 (maybe_process_partial_specialization): Reassign everything on
1220 * pt.c (register_specialization): Copy DECL_DELETED_FN to clones.
1221 (check_explicit_specialization): Don't clone.
1224 * pt.c (coerce_template_parms): Bail if argument packing fails.
1227 * decl.c (cp_complete_array_type, maybe_deduce_size_from_array_init):
1228 Don't get confused by a CONSTRUCTOR that already has a type.
1231 * call.c (build_array_conv): Don't crash on VLA.
1234 * mangle.c (mangle_decl): Don't make an alias for a TYPE_DECL.
1237 * lambda.c (maybe_resolve_dummy): Don't try to capture this
1238 in declaration context.
1242 * pt.c (unify): Only unify if deducible. Handle 0-length list.
1245 * parser.c (cp_parser_direct_declarator): Don't wrap a
1246 type-dependent expression in a NOP_EXPR.
1249 * lambda.c (is_normal_capture_proxy): Handle VLA capture.
1254 * parser.c (cp_parser_template_argument): Restore dereference.
1255 * pt.c (template_parm_to_arg): Dereference non-pack expansions too.
1256 (process_partial_specialization): Handle deref.
1259 2014-02-21 Adam Butcher <adam@jessamine.co.uk>
1263 * parser.c (cp_parser_parameter_declaration_list): Correctly reset
1264 implicit_template_scope upon leaving an out-of-line generic member
1265 function definition.
1267 2014-02-20 Kai Tietz <ktietz@redhat.com>
1270 * parser.c (cp_parser_functional_cast): Treat NULL_TREE
1271 valued type argument as error_mark_node.
1274 * semantics.c (finish_fname): Handle error_mark_node.
1276 2014-02-19 Jason Merrill <jason@redhat.com>
1279 * pt.c (maybe_instantiate_noexcept): Don't instantiate exception
1280 spec from template context.
1282 2014-02-19 Jakub Jelinek <jakub@redhat.com>
1285 * cp-objcp-common.c (cp_function_decl_explicit_p): Remove
1286 FUNCTION_FIRST_USER_PARMTYPE (decl) != void_list_node check.
1289 * pt.c (tsubst_expr): Handle ANNOTATE_EXPR.
1291 2014-02-18 Paolo Carlini <paolo.carlini@oracle.com>
1294 * semantics.c (ensure_literal_type_for_constexpr_object): Use
1297 2014-02-18 Paolo Carlini <paolo.carlini@oracle.com>
1300 * semantics.c (cxx_eval_constant_expression, [COMPONENT_REF]):
1301 During error recovery allow_non_constant may be false.
1303 2014-02-18 Adam Butcher <adam@jessamine.co.uk>
1306 * parser.c (cp_parser_lambda_declarator_opt): Pop template parameter
1307 scope whenever a template parameter list has been started, independent
1308 of whether the function call operator was well-formed or not.
1311 * parser.c (cp_parser_member_declaration): Pop fully implicit template
1312 scope for generic friend declarations as well as for non-friends.
1314 2014-02-12 Paolo Carlini <paolo.carlini@oracle.com>
1317 * method.c (implicitly_declare_fn): A constructor of a class with
1318 virtual base classes isn't constexpr (7.1.5p4).
1320 2014-02-05 Jan Hubicka <hubicka@ucw.cz
1322 * parser.c (synthesize_implicit_template_parm): Use grow_tree_vec.
1324 2014-02-05 Jakub Jelinek <jakub@redhat.com>
1327 * parser.c (cp_parser_omp_declare_reduction): Save and free
1330 2014-02-03 Marc Glisse <marc.glisse@inria.fr>
1334 * tree.c (handle_init_priority_attribute): Call default_conversion on
1335 the attribute argument.
1337 2014-02-03 Paolo Carlini <paolo.carlini@oracle.com>
1340 * method.c (synthesized_method_walk): If vbases is non-null but
1341 is_empty is true, likewise don't worry about the virtual bases.
1343 2014-02-01 Paolo Carlini <paolo.carlini@oracle.com>
1346 * typeck2.c (process_init_constructor_record): Just skip unnamed
1349 2014-01-31 Jason Merrill <jason@redhat.com>
1352 * pt.c (mark_decl_instantiated): Call mark_needed.
1355 * decl2.c (handle_tls_init): Handle null init fn.
1358 * decl2.c (get_tls_init_fn): Copy DECL_EXTERNAL from the variable.
1360 2014-01-31 Paolo Carlini <paolo.carlini@oracle.com>
1363 * class.c (build_vfield_ref): Early return error_mark_node if
1364 TYPE_VFIELD (type) is null.
1365 (build_base_path): Check return value of build_vfield_ref.
1367 2014-01-31 Jason Merrill <jason@redhat.com>
1370 * call.c (convert_like_real) [ck_aggr]: Set TARGET_EXPR_LIST_INIT_P.
1371 [ck_list]: Check for error_mark_node.
1372 (build_aggr_conv): Set LOOKUP_NO_NARROWING and check_narrowing.
1375 * pt.c (fn_type_unification): Don't do DEDUCE_EXACT check
1376 during partial ordering.
1378 2014-01-31 Marek Polacek <polacek@redhat.com>
1381 * typeck.c (build_function_call_vec): Add dummy arg_loc parameter.
1383 2014-01-30 Jason Merrill <jason@redhat.com>
1386 * cp-tree.h (struct saved_scope): Add x_local_specializations.
1387 (local_specializations): New macro.
1388 * pt.c (local_specializations): Remove variable.
1390 2014-01-30 Richard Sandiford <rdsandiford@googlemail.com>
1393 * parser.c (make_string_pack): Use double_int::from_buffer.
1395 2014-01-30 Marek Polacek <polacek@redhat.com>
1398 * typeck.c (build_ptrmemfunc1): Call convert_and_check with
1400 * cvt.c (cp_convert_and_check): Call warnings_for_convert_and_check
1401 with input_location.
1402 * call.c (build_conditional_expr_1): Call unsafe_conversion_p with
1405 2014-01-30 Paolo Carlini <paolo.carlini@oracle.com>
1408 * typeck.c (lookup_destructor): Check dtor_type for error_mark_node.
1410 2014-01-30 Paolo Carlini <paolo.carlini@oracle.com>
1413 * pt.c (lookup_template_class_1): Check start_enum return value
1414 for error_mark_node.
1416 2014-01-30 Paolo Carlini <paolo.carlini@oracle.com>
1418 * decl.c (duplicate_decls, typename_hash, typename_compare):
1419 Use TYPE_IDENTIFIER.
1420 * error.c (dump_type): Likewise.
1421 * mangle.c (dump_substitution_candidates): Likewise.
1423 2014-01-30 Jason Merrill <jason@redhat.com>
1426 * decl2.c (attributes_naming_typedef_ok): New.
1427 * cp-tree.h: Declare it.
1428 * decl.c (grokdeclarator): Check it.
1429 * tree.c (no_linkage_check): Handle VECTOR_TYPE.
1431 2014-01-29 Jason Merrill <jason@redhat.com>
1434 * call.c (add_builtin_candidate): Catch dependent types.
1437 * pt.c (expand_template_argument_pack): Correct
1438 non_default_args_count calculation.
1441 * pt.c (unify_pack_expansion): Call expand_template_argument_pack.
1444 * friend.c (do_friend): Pass the TEMPLATE_DECL to add_friend if we
1445 have a friend template in a class template.
1446 * pt.c (tsubst_friend_function): Look through it.
1447 (push_template_decl_real): A friend member template is
1450 2014-01-29 Paolo Carlini <paolo.carlini@oracle.com>
1453 * decl.c (get_dso_handle_node): Don't crash if dso_handle_node
1456 2014-01-29 Paolo Carlini <paolo.carlini@oracle.com>
1459 * pt.c (instantiate_template_1): Check for error_mark_node the second
1462 2014-01-29 Jason Merrill <jason@redhat.com>
1465 * optimize.c (maybe_thunk_body): Build a RETURN_EXPR for
1466 cdtor_returns_this case.
1469 * decl.c (cxx_maybe_build_cleanup): Call mark_used.
1471 2014-01-29 Paolo Carlini <paolo.carlini@oracle.com>
1474 * semantics.c (finish_omp_reduction_clause): Check type for
1477 2014-01-28 Jason Merrill <jason@redhat.com>
1480 * pt.c (tsubst_decl) [VAR_DECL]: Allow in unevaluated context.
1481 (tsubst_copy): Use it if lookup fails.
1484 * pt.c (tsubst_function_type): Make sure we keep the same function
1488 * semantics.c (build_anon_member_initialization): Stop walking
1489 when we run out of COMPONENT_REFs.
1492 * decl.c (lookup_and_check_tag): Ignore template parameters if
1493 scope == ts_current.
1494 * pt.c (check_template_shadow): Don't complain about the injected
1497 * decl.c (duplicate_decls): Tweak.
1500 * mangle.c (write_unqualified_name): Handle operator auto.
1502 2014-01-27 Jason Merrill <jason@redhat.com>
1506 * call.c (reference_binding): Pass LOOKUP_NO_TEMP_BIND for
1507 list-initialization. A conversion to rvalue ref that involves
1508 an lvalue-rvalue conversion is bad.
1509 (convert_like_real): Give helpful error message.
1512 * decl.c (duplicate_decls): Always use oldtype for TYPE_DECL.
1515 * pt.c (tsubst_copy_and_build) [TRAIT_EXPR]: Use tsubst for
1519 * pt.c (template_parm_to_arg): Call convert_from_reference.
1520 (tsubst_template_arg): Don't strip reference refs.
1523 * call.c (build_aggr_conv): Reject value-initialization of reference.
1527 * call.c (convert_like_real): Give helpful error about excess braces
1528 for ck_rvalue of scalar type.
1531 * call.c (reference_binding): Only elide braces if the single
1532 element is reference-related.
1535 * typeck.c (cp_build_modify_expr): Make the RHS an rvalue before
1539 * typeck.c (cp_truthvalue_conversion): Use explicit comparison for
1543 * decl.c (compute_array_index_type): Don't call
1544 maybe_constant_value for a non-integral expression.
1546 2014-01-24 Balaji V. Iyer <balaji.v.iyer@intel.com>
1548 * call.c (magic_varargs_p): Replaced flag_enable_cilkplus with
1550 * cp-gimplify.c (cp_genericize): Likewise.
1551 * decl.c (grokfndecl): Likewise.
1552 * parser.c (cp_parser_postfix_expression): Likewise.
1553 (cp_parser_postfix_open_square_expression): Likewise.
1554 (cp_parser_direct_declarator): Likewise.
1555 (is_cilkplus_vector_p): Likewise.
1556 (cp_parser_omp_clause_name): Likewise.
1557 (cp_parser_omp_all_clauses): Likewise.
1558 * pt.c (apply_late_template_attributes): Likewise.
1559 * typeck.c (cp_build_array_ref): Likewise.
1560 (cp_build_compound_expr): Likewise.
1561 (check_return_expr): Likewise.
1563 2014-01-24 Jason Merrill <jason@redhat.com>
1566 * decl.c (grokdeclarator): Turn pedwarn about auto return type in
1571 * typeck2.c (process_init_constructor_array): Don't create
1574 2014-01-24 Jakub Jelinek <jakub@redhat.com>
1576 * typeck2.c (split_nonconstant_init_1): Fix num_split_elts
1577 handling for RANGE_ARRAY case.
1579 2014-01-24 Paolo Carlini <paolo.carlini@oracle.com>
1582 * name-lookup.c (push_using_directive): Use timevar_cond_start.
1584 2014-01-23 Marek Polacek <polacek@redhat.com>
1587 * typeck.c (cp_build_binary_op): Pass location to shorten_compare.
1589 2014-01-23 Marek Polacek <polacek@redhat.com>
1592 * typeck.c (pointer_diff): Give an error on arithmetic on pointer to
1595 2014-01-23 Jason Merrill <jason@redhat.com>
1598 * cp-tree.h (struct language_function): Add infinite_loop and
1600 (current_function_infinite_loop): New.
1601 * semantics.c (begin_maybe_infinite_loop, end_maybe_infinite_loop)
1602 (break_maybe_infinite_loop): New.
1603 (finish_while_stmt_cond, finish_while_stmt, begin_do_stmt)
1604 (finish_do_stmt, finish_for_cond, finish_for_stmt)
1605 (begin_range_for_stmt): Use them.
1606 * decl.c (finish_function): Don't warn about missing return
1607 if current_function_infinite_loop.
1608 * pt.c (instantiate_decl): Copy current_function_infinite_loop.
1609 * parser.c (cp_parser_jump_statement): Call break_maybe_infinite_loop.
1611 * call.c (build_op_delete_call): Use make_tree_vector and
1612 release_tree_vector.
1614 2014-01-23 Paolo Carlini <paolo.carlini@oracle.com>
1617 * parser.c (cp_parser_enum_specifier): Handle TYPENAME_TYPE as
1618 nested_name_specifier.
1620 2014-01-23 Balaji V. Iyer <balaji.v.iyer@intel.com>
1622 * parser.c (cp_parser_direct_declarator): When Cilk Plus is enabled
1623 see if there is an attribute after function decl. If so, then
1625 (cp_parser_late_return_type_opt): Handle parsing of Cilk Plus SIMD
1626 enabled function late parsing.
1627 (cp_parser_gnu_attribute_list): Parse all the tokens for the vector
1628 attribute for a SIMD-enabled function.
1629 (cp_parser_omp_all_clauses): Skip parsing to the end of pragma when
1630 the function is used by SIMD-enabled function (indicated by NULL
1631 pragma token). Added 3 new clauses: PRAGMA_CILK_CLAUSE_MASK,
1632 PRAGMA_CILK_CLAUSE_NOMASK and PRAGMA_CILK_CLAUSE_VECTORLENGTH
1633 (cp_parser_cilk_simd_vectorlength): Modified this function to handle
1634 vectorlength clause in SIMD-enabled function and #pragma SIMD's
1635 vectorlength clause. Added a new bool parameter to differentiate
1637 (cp_parser_cilk_simd_fn_vector_attrs): New function.
1638 (is_cilkplus_vector_p): Likewise.
1639 (cp_parser_late_parsing_elem_fn_info): Likewise.
1640 (cp_parser_omp_clause_name): Added a check for "mask", "nomask"
1641 and "vectorlength" clauses when Cilk Plus is enabled.
1642 (cp_parser_omp_clause_linear): Added a new parameter of type bool
1643 and emit a sorry message when step size is a parameter.
1644 * parser.h (cp_parser::cilk_simd_fn_info): New field.
1645 * decl.c (grokfndecl): Added flag_enable_cilkplus along with
1647 * pt.c (apply_late_template_attributes): Likewise.
1649 2014-01-23 Jakub Jelinek <jakub@redhat.com>
1652 * semantics.c (finish_omp_reduction_clause): Reject
1653 BIT_AND_EXPR, BIT_IOR_EXPR and BIT_XOR_EXPR on COMPLEX_TYPEs.
1655 2014-01-22 Ville Voutilainen <ville.voutilainen@gmail.com>
1658 * parser.c (cp_parser_class_head): Push the class before parsing
1659 the base-clause, pop after it.
1661 2014-01-20 Eric Botcazou <ebotcazou@adacore.com>
1663 * decl2.c (cpp_check): Revert prototype change.
1665 2014-01-17 Paolo Carlini <paolo.carlini@oracle.com>
1669 * init.c (build_value_init_noctor): Don't pass error_mark_node to
1672 2014-01-17 Paolo Carlini <paolo.carlini@oracle.com>
1675 * init.c (build_value_init_noctor): Assert !TYPE_HAS_COMPLEX_DFLT
1676 only when errorcount == 0.
1678 2014-01-17 Marek Polacek <polacek@redhat.com>
1681 * cvt.c (ocp_convert): Don't segfault on non-existing
1682 ENUM_UNDERLYING_TYPE.
1684 2014-01-16 Jason Merrill <jason@redhat.com>
1687 * tree.c (bot_manip): Update the location of builtin_LINE and
1690 2014-01-14 Jason Merrill <jason@redhat.com>
1693 * typeck2.c (massage_init_elt): New.
1694 (process_init_constructor_record)
1695 (process_init_constructor_union): Use it.
1696 (process_init_constructor_array): Use it. Use RANGE_EXPR.
1697 (split_nonconstant_init_1): Handle it.
1698 * semantics.c (cxx_eval_vec_init_1): Use force_rvalue.
1700 2014-01-09 Balaji V. Iyer <balaji.v.iyer@intel.com>
1703 * parser.c (cp_parser_postfix_expression): Added a new if-statement
1704 and replaced an existing if-statement with else-if statement.
1705 Changed an existing error message wording to match the one from the C
1708 2014-01-08 Jason Merrill <jason@redhat.com>
1711 * class.c (abi_tag_data): Add tags field.
1712 (check_abi_tags): Initialize it.
1713 (find_abi_tags_r): Support collecting missing tags.
1714 (mark_type_abi_tags): Don't look at template args.
1715 (inherit_targ_abi_tags): New.
1716 (check_bases_and_members): Use it.
1717 * cp-tree.h (ABI_TAG_IMPLICIT): New.
1718 * mangle.c (write_abi_tags): Check it.
1720 2014-01-07 Jason Merrill <jason@redhat.com>
1723 * pt.c (num_innermost_template_parms): New.
1724 (get_underlying_template): Use it.
1727 * mangle.c (write_guarded_var_name): Handle null DECL_NAME.
1729 2014-01-07 Paolo Carlini <paolo.carlini@oracle.com>
1731 * semantics.c (trait_expr_value, [CPTK_IS_BASE_OF]): Implement
1732 the letter of 20.11.6 about Base and Derived naming the same
1733 class type modulo cv-qualifiers.
1735 2014-01-06 Adam Butcher <adam@jessamine.co.uk>
1738 * lambda.c (maybe_add_lambda_conv_op): Handle marking conversion
1739 function as unimplemented for generic lambdas with varargs.
1742 * parser.c (cp_parser_template_parameter): Early out with
1743 error_mark_node if parameter declaration was not parsed.
1746 * parser.c (cp_parser_lambda_expression): Save/reset/restore
1747 auto_is_implicit_function_template_parm_p around lambda body.
1750 * parser.c (cp_parser_init_declarator): Undo fully implicit
1751 template parameter list when declarator is not a function.
1753 2014-01-03 Marc Glisse <marc.glisse@inria.fr>
1756 * cvt.c (convert_to_void): Handle VEC_PERM_EXPR and VEC_COND_EXPR.
1758 2014-01-03 Tobias Burnus <burnus@net-b.de>
1761 * pt.c (tsubst_omp_for_iterator): Early return for error_mark_node.
1763 2014-01-03 Paolo Carlini <paolo.carlini@oracle.com>
1767 * parser.c (cp_parser_perform_range_for_lookup): Don't pass true
1768 as include_std to perform_koenig_lookup.
1769 (cp_parser_postfix_expression): Adjust.
1770 * pt.c (tsubst_copy_and_build): Likewise.
1771 * semantics.c (perform_koenig_lookup): Remove bool parameter.
1772 (omp_reduction_lookup): Adjust.
1773 * name-lookup.c (lookup_arg_dependent_1): Remove bool parameter.
1774 (lookup_arg_dependent): Likewise.
1775 (lookup_function_nonclass): Adjust.
1776 * name-lookup.h: Adjust declaration.
1777 * cp-tree.h: Likewise.
1779 2014-01-02 Marc Glisse <marc.glisse@inria.fr>
1782 * parser.c (cp_parser_userdef_numeric_literal): Mention
1783 -fext-numeric-literals in the message.
1785 2014-01-02 Marc Glisse <marc.glisse@inria.fr>
1788 * call.c (build_conditional_expr_1): Check the return value of
1791 2014-01-02 Marc Glisse <marc.glisse@inria.fr>
1793 * call.c (convert_like_real): Check complain.
1795 2014-01-02 Marc Glisse <marc.glisse@inria.fr>
1798 * typeck.c (build_x_vec_perm_expr): Handle non-dependent arguments
1801 2014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
1803 Update copyright years
1805 2014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
1807 * cp-array-notation.c, cp-cilkplus.c, vtable-class-hierarchy.c: Use
1808 the standard form for the copyright notice.
1810 Copyright (C) 2014 Free Software Foundation, Inc.
1812 Copying and distribution of this file, with or without modification,
1813 are permitted in any medium without royalty provided the copyright
1814 notice and this notice are preserved.