1 2012-11-24 Paolo Carlini <paolo.carlini@oracle.com>
4 * init.c (build_vec_init): Do not early return error_mark_mode
5 when integer_all_onesp (maxindex).
7 2012-11-23 Jakub Jelinek <jakub@redhat.com>
10 * cp-objcp-common.h (LANG_HOOKS_BLOCK_MAY_FALLTHRU): Redefine.
11 * cp-objcp-common.c (cxx_block_may_fallthru): New function.
12 * cp-tree.h (cxx_block_may_fallthru): New prototype.
14 2012-11-23 Markus Trippelsdorf <markus@trippelsdorf.de>
17 * method.c (implicitly_declare_fn): Properly initialize trivial_p.
19 2012-11-22 Jason Merrill <jason@redhat.com>
22 * semantics.c (verify_constant): Track overflow separately.
23 (reduced_constant_expression_p): Don't check it here.
24 (cxx_eval_constant_expression): Check it on CSTs.
25 (cxx_eval_outermost_constant_expr): Treat overflows as non-constant
26 at this point, but still return the folded version.
27 (potential_constant_expression_1): Don't check overflow.
29 * call.c (extend_ref_init_temps_1): Recompute TREE_CONSTANT for
32 2012-11-20 Diego Novillo <dnovillo@google.com>
33 Jakub Jelinek <jakub@redhat.com>
35 * name-lookup.c: Replace all vec<T, A>() initializers
37 * semantics.c: Likewise.
39 2012-11-19 Paolo Carlini <paolo.carlini@oracle.com>
42 * parser.c (cp_parser_member_declaration): Emit an error in case
43 of stray comma at end of member declaration.
45 2012-11-19 Jason Merrill <jason@redhat.com>
47 * class.c (one_inheriting_sig): Don't inherit base copy ctors.
50 * method.c (implicitly_declare_fn): Set DECL_PARM_INDEX on
51 the parms of an inheriting ctor.
54 * class.c (add_implicitly_declared_members): Use
55 lookup_fnfields_slot to get the base constructors.
57 2012-11-19 Jakub Jelinek <jakub@redhat.com>
60 * class.c (fixed_type_or_null_ref_ht): New variable.
61 (fixed_type_or_null): Use it instead of local static ht.
63 2012-11-17 Diego Novillo <dnovillo@google.com>
65 Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec)
67 * Make-lang.in: Remove dependencies on vecir.h and vecprim.h everywhere.
68 * call.c: Use new vec API in vec.h.
70 * cp-gimplify.c: Likewise.
71 * cp-tree.h: Likewise.
80 * name-lookup.c: Likewise.
81 * name-lookup.h: Likewise.
88 * semantics.c: Likewise.
91 * typeck2.c: Likewise.
93 2012-11-17 Gabriel Dos Reis <gdr@integrable-solutions.net>
95 * semantics.c (finish_id_expression): Tidy diagnostic message.
97 2012-11-16 Dodji Seketeli <dodji@redhat.com>
100 * pt.c (lookup_template_class_1): Look at the type of the
101 potential member enum of class template to determine if we are
102 actually substituting into a member enum of class template.
104 2012-11-16 Jakub Jelinek <jakub@redhat.com>
107 * tree.c (cp_tree_equal) <case ALIGNOF_EXPR>: Use SIZEOF_EXPR_TYPE_P
110 2012-11-14 Jason Merrill <jason@redhat.com>
113 * decl2.c (mark_used): Don't complain about auto in templates.
116 * decl.c (decls_match): Remove #ifdef around earlier fix.
118 2012-11-13 Jason Merrill <jason@redhat.com>
120 * class.c (finish_struct_1): Check virtual functions
121 for missing ABI tags.
124 * pt.c (maybe_process_partial_specialization): Update
125 DECL_SOURCE_LOCATION for new specializations.
127 2012-11-14 Paolo Carlini <paolo.carlini@oracle.com>
130 * init.c (emit_mem_initializers): Skip arguments == error_mark_node.
132 2012-11-14 Fabien ChĂȘne <fabien@gcc.gnu.org>
135 * call.c (build_new_method_call_1): Check that the instance type
136 and the function context are the same before setting the flag
139 2012-11-13 Sriraman Tallam <tmsriram@google.com>
141 * class.c (mark_versions_used): Remove.
142 (resolve_address_of_overloaded_function): Call target hook
143 for versioned functions. Refactor to call
144 get_function_versions_dispatcher.
145 * decl.c (duplicate_decls): Add comments.
146 * cp/call.c (get_function_version_dispatcher): Expose function.
147 (mark_versions_used): Expose function.
148 * cp/cp-tree.h (mark_versions_used): New declaration.
149 (get_function_version_dispatcher): Ditto.
151 2012-11-13 Dodji Seketeli <dodji@redhat.com>
154 * pt.c (lookup_template_class_1): TYPE_STUB_DECL should be
155 accessed on the main variant of the type.
157 2012-11-12 Ed Smith-Rowland <3dw4rd@verizon.net>
159 * parser.c (cp_parser_objc_class_ivars):
160 Index declspecs.locations by ds_typedef rather than ds_thread.
162 2012-11-09 Ed Smith-Rowland <3dw4rd@verizon.net>
165 * decl.c (grokfndecl): Adjust calls to interpret_x_suffix.
167 2012-11-09 Jason Merrill <jason@redhat.com>
170 * pt.c (check_instantiated_arg): Don't complain about dependent args.
172 * tree.c (cxx_attribute_table): Add abi_tag attribute.
173 (check_abi_tag_redeclaration, handle_abi_tag_attribute): New.
174 * class.c (find_abi_tags_r, check_abi_tags): New.
175 (check_bases, check_field_decl): Call check_abi_tags.
176 * decl.c (redeclaration_error_message): Call
177 check_abi_tag_redeclaration.
178 * mangle.c (tree_string_cmp, write_abi_tags): New.
179 (write_unqualified_name): Call write_abi_tags.
181 2012-11-07 Paolo Carlini <paolo.carlini@oracle.com>
185 2012-10-23 Paolo Carlini <paolo.carlini@oracle.com>
188 * semantics.c (cx_check_missing_mem_inits): Handle anonymous union
191 2012-11-07 Florian Weimer <fweimer@redhat.com>
193 * init.c (build_new_1): Do not check for arithmetic overflow if
194 inner array size is 1.
196 2012-11-05 Sriraman Tallam <tmsriram@google.com>
198 * class.c (add_method): Change assembler names of function versions.
199 (mark_versions_used): New static function.
200 (resolve_address_of_overloaded_function): Create dispatcher decl and
201 return address of dispatcher instead.
202 * decl.c (decls_match): Make decls unmatched for versioned
204 (duplicate_decls): Remove ambiguity for versioned functions.
205 Delete versioned function data for merged decls.
206 * decl2.c (check_classfn): Check attributes of versioned functions
208 * call.c (get_function_version_dispatcher): New function.
209 (mark_versions_used): New static function.
210 (build_over_call): Make calls to multiversioned functions
211 to call the dispatcher.
212 (joust): For calls to multi-versioned functions, make the most
213 specialized function version win.
215 2012-10-31 Lawrence Crowl <crowl@google.com>
217 * decl2.c (var_finalized_p): Rename varpool_node to
218 varpool_node_for_decl.
219 (maybe_emit_vtables): Likewise.
221 2012-10-31 Paolo Carlini <paolo.carlini@oracle.com>
224 * tree.c (build_cplus_array_type): Set TREE_NO_WARNING on the
227 2012-10-31 Dodji Seketeli <dodji@redhat.com>
230 * parser.c (cp_nth_tokens_can_be_std_attribute_p): Recognize the
231 'Alignas' keyword as the beginning of a c++11 attribute specifier.
232 Update the comment of the function.
233 (cp_next_tokens_can_be_gnu_attribute_p): Update the comment of the
236 2012-10-29 Jonathan Wakely <jwakely.gcc@gmail.com>
239 * typeck.c (maybe_warn_about_returning_address_of_local): Use
240 OPT_Wreturn_local_addr.
242 2012-10-26 Jakub Jelinek <jakub@redhat.com>
245 * typeck2.c (store_init_value): Call fold_non_dependent_expr
246 and maybe_constant_init even for C++98.
248 2012-10-26 Paolo Carlini <paolo.carlini@oracle.com>
251 * init.c (build_new): Don't turn a null *init into a pointer to
252 empty vector orig_init.
254 2012-10-25 Paolo Carlini <paolo.carlini@oracle.com>
257 * class.c (finish_struct_1): Reject aggregates decorated with
258 __transparent_union__ which cannot be made transparent because
259 the type of the first field has a different ABI from the class
262 2012-10-25 Jason Merrill <jason@redhat.com>
265 * call.c (joust): An implicitly deleted move function is
266 worse than any non-deleted function.
267 * method.c (process_subob_fn): No special rules for move.
268 (synthesized_method_walk, implicitly_declare_fn): Likewise.
269 Warn about virtual base with non-trivial move assignment.
270 * cp-tree.h (struct lang_decl_fn): Remove suppress_implicit_decl.
271 (FNDECL_SUPPRESS_IMPLICIT_DECL): Remove.
273 * semantics.c (finish_omp_threadprivate): Call complete_type.
275 * class.c (one_inherited_ctor): Warn about variadic inherited ctor.
277 2012-10-25 Marc Glisse <marc.glisse@inria.fr>
280 * typeck.c (build_x_conditional_expr): Handle VEC_COND_EXPR.
281 * call.c (build_conditional_expr_1): Likewise.
283 2012-10-25 Paolo Carlini <paolo.carlini@oracle.com>
286 * parser.c (cp_parser_template_parameter): When
287 cp_parser_parameter_declaration parsed a default argument don't
288 see if *is_parameter_pack needs setting.
290 2012-10-23 Paolo Carlini <paolo.carlini@oracle.com>
293 * semantics.c (cx_check_missing_mem_inits): Handle anonymous union
296 2012-10-23 Jakub Jelinek <jakub@redhat.com>
299 * pt.c (tsubst_copy, tsubst_copy_and_build) <case SIZEOF_EXPR>: Use
300 tsubst instead of tsubst_copy* on types.
303 * decl2.c (cplus_decl_attributes): Don't return early
304 if attributes is NULL.
306 2012-10-18 Paolo Carlini <paolo.carlini@oracle.com>
309 * decl.c (reshape_init_array_1): Avoid infinite loops.
311 2012-10-15 Alexandre Oliva <aoliva@redhat.com>
312 Paolo Carlini <paolo.carlini@oracle.com>
315 * call.c (build_new_op_1): Filter out operator functions that don't
316 satisfy enum-conversion match requirements.
318 2012-10-15 Paolo Carlini <paolo.carlini@oracle.com>
321 * parser.c (cp_parser_optional_template_keyword): When -pedantic
322 and C++98 mode restore pre-Core/468 behavior.
324 2012-10-15 Paolo Carlini <paolo.carlini@oracle.com>
327 * parser.c (cp_parser_optional_template_keyword): Implement
328 Core/468, allow outside template.
330 2012-10-14 Jason Merrill <jason@redhat.com>
331 Ville Voutilainen <ville.voutilainen@gmail.com>
333 Implement C++11 inheriting constructors.
334 * cp-tree.h (cpp0x_warn_str): Add CPP0X_INHERITING_CTORS.
335 (DECL_INHERITED_CTOR_BASE, SET_DECL_INHERITED_CTOR_BASE): New.
336 (special_function_kind): Add sfk_inheriting_constructor.
337 * class.c (add_method): An inheriting ctor is hidden by a
339 (one_inheriting_sig, one_inherited_ctor): New.
340 (add_implicitly_declared_members): Handle inheriting ctors.
341 * error.c (maybe_warn_cpp0x): Handle CPP0X_INHERITING_CTORS.
342 * init.c (emit_mem_initializers): Don't set LOOKUP_DEFAULTED
343 for an inheriting constructor.
344 * method.c (type_has_trivial_fn): Handle sfk_inheriting_constructor.
345 (type_set_nontrivial_flag): Likewise.
346 (add_one_base_init): Split out from...
347 (do_build_copy_constructor): ...here. Handle inheriting constructors.
348 (locate_fn_flags): Handle a list of arg types.
349 (synthesized_method_walk): Handle inheriting constructors.
350 (maybe_explain_implicit_delete): Likewise.
351 (deduce_inheriting_ctor): New.
352 (implicitly_declare_fn): Handle inheriting constructors.
353 * name-lookup.c (push_class_level_binding_1): An inheriting constructor
354 does not declare the base's name.
355 (do_class_using_decl): Allow inheriting constructors.
356 * pt.c (template_parms_to_args): Split from current_template_args.
357 (add_inherited_template_parms): New.
358 (tsubst_decl): Handle inheriting constructors.
359 * tree.c (special_function_p): Handle inheriting constructors.
361 2012-10-12 Jakub Jelinek <jakub@redhat.com>
364 * semantics.c (finish_call_expr): Pass array of 3 sizeof_arg
365 trees and locs (corresponding to first 3 arguments) to
366 sizeof_pointer_memaccess_warning.
368 2012-10-12 Paolo Carlini <paolo.carlini@oracle.com>
371 * decl.c (grokfndecl): When checking for ::main declarations
372 use PROCESSING_REAL_TEMPLATE_DECL_P().
374 2012-10-12 Marc Glisse <marc.glisse@inria.fr>
377 * call.c (build_new_op_1): Pass RO_ARROW_STAR to cp_build_indirect_ref.
378 * typeck.c (cp_build_indirect_ref): Handle RO_ARROW_STAR.
380 2012-10-11 Jason Merrill <jason@redhat.com>
382 * cp-tree.h (DECL_THUNKS): NULL_TREE for non-virtual functions.
383 (SET_DECL_THUNKS): New.
384 * decl.c (duplicate_decls): Adjust.
385 * method.c (make_thunk): Adjust.
387 * decl.c (grokdeclarator): Set DECL_GNU_TLS_P for static data
390 2012-10-09 Dodji Seketeli <dodji@redhat.com>
392 PR c++/53540 - using fails to be equivalent to typedef
393 * cp-tree.h (TYPE_TEMPLATE_INFO): For an alias that is not an
394 instance of alias template, don't look for its TEMPLATE_INFO in
396 (alias_template_specialization_p): Take const_tree.
397 * pt.c (alias_template_specialization_p): Take a const_tree.
398 Don't call primary_template_instantiation_p.
399 (primary_template_instantiation_p): Call
400 alias_template_specialization_p.
402 2012-10-10 Dodji Seketeli <dodji@redhat.com>
404 * parser (cp_parser_statement): Parse c++11 attributes
406 (cp_parser_std_attribute_spec_seq): Do not warn too early about
407 using c++11 attributes in non c++11 mode.
409 2012-10-10 Dehao Chen <dehao@google.com>
411 * cp-gimplify.c (cp_genericize_r): Set location for TRY expr.
413 2012-10-09 Lawrence Crowl <crowl@google.com>
415 * Make-lang.in (class.o): Add dependence on hash-table.h.
417 (semantics.o): Likewise.
418 * class.c (fixed_type_or_null): Change to new type-safe hash table.
419 * tree.c (verify_stmt_tree): Likewise.
420 (verify_stmt_tree_r): Likewise.
421 * semantics.c (struct nrv_data): Likewise.
423 2012-10-09 Paolo Carlini <paolo.carlini@oracle.com>
426 * typeck.c (build_x_binary_op): Update warn_about_parentheses call.
427 * parser.c (cp_parser_binary_expression): Use SET_EXPR_LOCATION
430 2012-10-09 Marc Glisse <marc.glisse@inria.fr>
433 * typeck.c (cp_build_binary_op): Handle mixed scalar-vector
435 [LSHIFT_EXPR, RSHIFT_EXPR]: Likewise.
437 2012-10-08 Jakub Jelinek <jakub@redhat.com>
440 * tree.c (cp_tree_equal): Handle FIELD_DECL.
442 2012-10-08 Jason Merrill <jason@redhat.com>
444 Allow dynamic initialization of thread_locals.
445 * decl.c: Define tls_aggregates.
446 (expand_static_init): Remove sorry. Add to tls_aggregates.
447 * cp-tree.h: Declare tls_aggregates.
448 * call.c (set_up_extended_ref_temp): Add to tls_aggregates.
449 * decl2.c (var_needs_tls_wrapper): New.
450 (var_defined_without_dynamic_init): New.
451 (get_tls_init_fn, get_tls_wrapper_fn): New.
452 (generate_tls_wrapper, handle_tls_init): New.
453 (cp_write_global_declarations): Call handle_tls_init and
455 * mangle.c (write_guarded_var_name): Split out from..
456 (mangle_guard_variable): ...here.
457 (mangle_tls_init_fn, mangle_tls_wrapper_fn): Use it.
458 (decl_tls_wrapper_p): New.
459 * semantics.c (finish_id_expression): Replace use of thread_local
460 variable with a call to its wrapper.
462 * decl.c (get_thread_atexit_node): New.
463 (register_dtor_fn): Use it for TLS.
465 Partial implementation of C++11 thread_local.
466 * decl.c (cp_finish_decl): Remove errors about non-trivial
467 initialization and destruction of TLS variables.
468 (register_dtor_fn): Add sorry about TLS variables.
469 (expand_static_init): Add sorry about non-local TLS variables,
470 or error with __thread.
471 Don't emit thread-safety guards for local TLS variables.
472 (grokdeclarator): thread_local in a function implies static.
473 * decl.h: Adjust prototype.
474 * decl2.c (get_guard): Copy DECL_TLS_MODEL.
475 * parser.c (cp_parser_set_storage_class, cp_parser_set_decl_spec_type)
476 (set_and_check_decl_spec_loc): Take the token rather than the location.
477 Distinguish between __thread and thread_local.
478 (cp_parser_set_storage_class): Don't complain about thread_local before
480 (token_is__thread): New.
481 * call.c (make_temporary_var_for_ref_to_temp): Handle TLS.
482 * cp-tree.h (DECL_GNU_TLS_P): New.
483 (cp_decl_specifier_seq): Add gnu_thread_keyword_p.
485 2012-10-08 Dodji Seketeli <dodji@redhat.com>
487 PR c++/53528 C++11 attribute support
488 * cp-tree.h (enum cpp0x_warn_str::CPP0X_ATTRIBUTES): New member.
489 (enum cp_decl_spec::ds_std_attribute): New enumerator.
490 (struct cp_decl_specifier_seq::std_attributes): New field.
491 (cxx_alignas_expr, warn_misplaced_attr_for_class_type): Declare
493 (check_tag_decl): Take an extra parameter for explicit
495 * decl.c (warn_misplaced_attr_for_class_type): Extract from ...
496 (check_tag_decl): ... here. Add check for c++11 attributes being
497 applied to an explicit instantiation. Take an extra parameter for
498 explicit instantiations.
499 (grokdeclarator): Make sure a c++11 attribute after an array
500 declarator appertains to the array, an attribute after a function
501 declarator appertains to the function type, an attribute after a
502 declarator-id appertains to the entity being declared, and an
503 attribute after a pointer declarator appertain to the pointer.
504 * decl2.c (is_late_template_attribute): Use get_attribute_name.
505 * error.c (maybe_warn_cpp0x): Support
506 CPP0X_GENERALIZED_ATTRIBUTES.
507 * parser.c (cp_next_tokens_can_be_attribute_p)
508 (cp_next_tokens_can_be_gnu_attribute_p)
509 (cp_next_tokens_can_be_std_attribute_p)
510 (cp_nth_tokens_can_be_attribute_p)
511 (cp_nth_tokens_can_be_gnu_attribute_p)
512 (cp_nth_tokens_can_be_std_attribute_p)
513 (cp_parser_gnu_attribute_list, cp_parser_std_attribute)
514 (cp_parser_std_attribute_spec, cp_parser_std_attribute_spec_seq)
515 (cp_parser_attributes_opt, cp_parser_std_attribute_list): New
517 (cp_parser_gnu_attributes_opt): Replace cp_parser_attributes_opt.
518 (cp_parser_gnu_attribute_list): Replace cp_parser_attribute_list.
519 (cp_parser_postfix_expression): Disallow "[[" tokens here.
520 (cp_parser_label_for_labeled_statement): Use take an extra
521 parameter for attributes.
522 (cp_parser_block_declaration): Use
523 cp_nth_tokens_can_be_std_attribute_p here.
524 (cp_parser_decl_specifier_seq): Likewise. Store C++11 attributes
525 that appears in in decl specifiers in cp_decl_specifier_seq::std_attributes.
526 declaration. Emit proper warning about misplaced c++11 attributes
528 (cp_parser_explicit_instantiation): Adjust call to check_tag_decl.
529 (cp_parser_init_declarator): Parsing attributes here is no more a
530 GNU extension in c++-11.
531 (cp_parser_type_specifier_seq): Use
532 cp_next_tokens_can_be_attribute_p.
533 (cp_parser_direct_declarator): Likewise. Hang c++11 attributes
534 following the declarator to its syntactic construct. It'll later
535 be applied to the proper appertaining entity by grokdeclarator.
536 (cp_parser_ptr_operator): Likewise.
537 (make_declarator): Initialize cp_declarator::std_attribute.
538 (make_pointer_declarator, make_reference_declarator)
539 (make_ptrmem_declarator, cp_parser_make_indirect_declarator): Take
540 attributes that appertain to the pointer/reference in argument.
541 (cp_parser_ptr_operator): Take an out parameter for c++11
542 attributes. Update comments.
543 (cp_parser_new_declarator_opt)
544 (cp_parser_conversion_declarator_opt): Adjust.
545 (cp_parser_declarator): Likewise. Handle C++11 attributes.
546 Rename attributes to gnu_attribute for better legibility.
547 (cp_parser_simple_declaration): Update comment.
548 (cp_parser_class_specifier_1): Parse GNU attributes specifically
549 (cp_parser_enum_specifier): Accept only gnu attributes after the
551 (cp_parser_member_declaration): Don't clear attributes -- intended
552 for the entity being declared -- too early because check_tag_decl
554 (cp_parser_statement): Update comment. Parse optional c++11
555 attributes at the beginning of the relevant kind of statements and
556 ignore them, for now, unless when calling
557 cp_parser_label_for_labeled_statement.
558 (cp_parser_label_for_labeled_statement): Take c++11 attributes
560 * semantics.c (potential_constant_expression_1): Likewise.
561 * typeck.c (fundamental_alignment_p, cxx_alignas_expr): New public
564 2012-10-07 Paolo Carlini <paolo.carlini@oracle.com>
566 * pt.c (fold_non_dependent_expr_sfinae): Remove static specifier.
567 (tsubst_copy_and_build): Use get_target_expr_sfinae.
568 * call.c (build_conditional_expr_1, convert_like_real): Likewise.
569 * cvt.c (build_up_reference): Likewise.
570 (ocp_convert): Use abstract_virtuals_error_sfinae.
571 (build_up_reference): Propagate complain to cp_build_addr_expr.
572 * decl.c (compute_array_index_type): Use fold_non_dependent_expr_sfinae.
573 * cp-tree.h: Update declarations.
575 * cvt.c (build_expr_type_conversion): Tidy.
577 * tree.c (stabilize_aggr_init): Change to static.
579 2012-10-07 Paolo Carlini <paolo.carlini@oracle.com>
582 * semantics.c (is_normal_capture_proxy): Return true for
583 error_mark_node as DECL_VALUE_EXPR.
585 2012-10-05 Jakub Jelinek <jakub@redhat.com>
587 * cp-tree.h (SIZEOF_EXPR_TYPE_P): Define.
588 * tree.c (cp_tree_equal): Handle SIZEOF_EXPR with
590 * mangle.c (write_expression): Likewise.
591 * cxx-pretty-print.c (pp_cxx_unary_expression): Likewise.
592 * error.c (dump_expr): Likewise.
593 * parser.c (cp_parser_unary_expression): For sizeof call
594 cxx_sizeof_or_alignof_{type,expr} just for diagnostics and
595 return SIZEOF_EXPR with the operand.
596 * pt.c (tsubst_copy, tsubst_copy_and_build): For SIZEOF_EXPR,
597 call cxx_sizeof_or_alignof_{type,expr} for diagnostics, but
598 return SIZEOF_EXPR with tsubsted operand.
599 (value_dependent_expression_p): Handle SIZEOF_EXPR with
601 (instantiation_dependent_r): Likewise.
602 * call.c (null_ptr_cst_p): Call maybe_constant_value for C++98.
603 * semantics.c (finish_call_expr): Call
604 sizeof_pointer_memaccess_warning if needed.
605 (cxx_eval_constant_expression): Handle SIZEOF_EXPR.
606 (potential_constant_expression_1): Remove early exit for
607 C++98. Handle PROPERTY_REF.
608 * decl.c (duplicate_decls): When redeclaring a builtin function,
609 keep the merged decl builtin also if newdecl is a gnu_inline
611 (fold_sizeof_expr_r): New function.
612 (compute_array_index_type): Fold SIZEOF_EXPRs in itype.
613 * cp-gimplify.c (cp_genericize_r): Fold SIZEOF_EXPR.
614 * typeck.c (cp_build_binary_op): For warn_for_sign_compare
615 try harder using maybe_constant_value to get INTEGER_CSTs.
617 * decl.c (stabilize_vla_size): Call pointer_set_destroy
620 2012-10-04 Arnaud Charlet <charlet@adacore.com>
622 * decl2.c (cp_write_global_declarations): Fix handling of
625 2012-10-03 Jakub Jelinek <jakub@redhat.com>
628 * semantics.c (cxx_eval_constant_expression) <case COMPOUND_EXPR>: If
629 not ignoring the second operand, pass the original second operand
630 and not one with stripped nops to cxx_eval_constant_expression.
632 2012-10-01 Jason Merrill <jason@redhat.com>
634 * decl.c (check_initializer): Set DECL_NONTRIVIALLY_INITIALIZED_P
635 for a constructor call.
636 (decl_jump_unsafe): So don't bother checking
637 type_has_nontrivial_default_init.
638 * call.c (set_up_extended_ref_temp): Set
639 DECL_NONTRIVIALLY_INITIALIZED_P.
641 * cp-tree.h (TYPE_FUNCTION_OR_TEMPLATE_DECL_CHECK): New.
642 (DECL_FRIEND_P, DECL_ANTICIPATED): Use it.
643 (TYPE_FUNCTION_OR_TEMPLATE_DECL_P): New.
644 * name-lookup.c (hidden_name_p): Use it.
646 * cp-tree.h (DECL_PRETTY_FUNCTION_P): Just look at the name.
647 * decl.c (cp_make_fname_decl): Adjust.
649 2012-09-30 Sharad Singhai <singhai@google.com>
651 * decl2.c (cp_write_global_declarations): Use a different method
652 to determine if the dump has ben initialized.
654 2012-09-29 Paolo Carlini <paolo.carlini@oracle.com>
657 * decl2.c (build_offset_ref_call_from_tree): Add tsubst_flags_t
659 * pt.c (tsubst_copy_and_build): Adjust.
660 * parser.c (cp_parser_postfix_expression): Likewise.
661 * cp-tree.h: Adjust declaration.
663 2012-09-28 Dodji Seketeli <dodji@redhat.com>
665 PR c++/54372 - unused attribute inactive on dependant entities
666 * decl2.c (is_late_template_attribute): "unused" attribute is to
667 be applied at compile time.
669 2012-09-25 Dodji Seketeli <dodji@redhat.com>
671 PR c++/29028 - Missed unused warning on using declaration
672 * decl.c (poplevel<warn_unused*>): Do not forget that some local
673 bindings are represented by a TREE_LIST.
675 2012-09-25 Dodji Seketeli <dodji@redhat.com>
677 PR c++/53551 - -Wunused-local-typedefs misses uses
678 * decl.c (make_typename_type): Record the use of typedefs.
680 2012-09-27 Jakub Jelinek <jakub@redhat.com>
682 * init.c (build_new_1): Don't test TREE_CONSTANT
685 2012-09-25 Paolo Carlini <paolo.carlini@oracle.com>
688 * parser.c (cp_parser_template_id): In C++11 mode simply accept
691 2012-09-25 Zhenqiang Chen <zhenqiang.chen@linaro.org>
694 * typeck.c (cp_build_binary_op): Check side effects before generating
695 pfn and delta related expressions.
697 2012-09-24 Lawrence Crowl <crowl@google.com>
699 * init.c (build_new_1): Change to new double_int API.
700 * decl.c (build_enumerator): Likewise.
701 * typeck2.c (process_init_constructor_array): Likewise.
702 * mangle.c (write_array_type): Likewise.
704 2012-09-24 Paolo Carlini <paolo.carlini@oracle.com>
707 * error.c (dump_function_decl): Strip TFF_TEMPLATE_NAME from flags
710 2012-09-24 Jason Merrill <jason@redhat.com>
712 * decl.c (get_atexit_node): Remove dead code.
714 * Make-lang.in (cp/parser.o): Depend on decl.h.
716 2012-09-20 Paolo Carlini <paolo.carlini@oracle.com>
719 * pt.c (tsubst_copy_and_build): If tf_error is not set in the complain
720 argument don't call unqualified_name_lookup_error.
722 2012-09-19 Marc Glisse <marc.glisse@inria.fr>
725 * semantics.c (finish_decltype_type): Make vectors not opaque.
727 2012-09-17 Jason Merrill <jason@redhat.com>
730 * pt.c (instantiate_alias_template): New.
732 (push_access_scope): Allow TYPE_DECL.
734 2012-09-14 Jason Merrill <jason@redhat.com>
737 * typeck2.c (check_narrowing): Avoid false positives on conversion
740 2012-09-14 Marc Glisse <marc.glisse@inria.fr>
743 * typeck.c (cp_build_binary_op) [LSHIFT_EXPR, RSHIFT_EXPR, EQ_EXPR,
744 NE_EXPR, LE_EXPR, GE_EXPR, LT_EXPR, GT_EXPR]: Handle VECTOR_TYPE.
746 2012-09-14 Paolo Carlini <paolo.carlini@oracle.com>
748 * decl.c (make_typename_type): Only error out if tf_error is set
751 2012-09-13 Paolo Carlini <paolo.carlini@oracle.com>
752 Manuel López-Ibåñez <manu@gcc.gnu.org>
755 * init.c (perform_member_init): Use OPT_Winit_self instead of
758 2012-09-13 Paolo Carlini <paolo.carlini@oracle.com>
760 * typeck.c (build_indirect_ref, build_function_call,
761 build_function_call_vec, build_binary_op, build_unary_op,
762 build_compound_expr, build_c_cast, build_modify_expr): Remove
763 uses of ATTRIBUTE_UNUSED on the parameters.
764 * class.c (set_linkage_according_to_type, resort_type_method_vec,
765 dfs_find_final_overrider_post, empty_base_at_nonzero_offset_p):
767 * decl.c (local_variable_p_walkfn): Likewise.
768 * except.c (wrap_cleanups_r, check_noexcept_r): Likewise.
769 * error.c (find_typenames_r): Likewise.
770 * tree.c (verify_stmt_tree_r, bot_replace,
771 handle_java_interface_attribute, handle_com_interface_attribute,
772 handle_init_priority_attribute, c_register_addr_space): Likewise.
773 * cp-gimplify.c (cxx_omp_clause_default_ctor): Likewise.
774 * cp-lang.c (objcp_tsubst_copy_and_build): Likewise.
775 * pt.c (unify_success, unify_invalid, instantiation_dependent_r):
777 * semantics.c (dfs_calculate_bases_pre): Likewise.
778 * decl2.c (fix_temporary_vars_context_r, clear_decl_external):
780 * parser.c (cp_lexer_token_at, cp_parser_omp_clause_mergeable,
781 cp_parser_omp_clause_nowait, cp_parser_omp_clause_ordered,
782 cp_parser_omp_clause_untied): Likewise.
783 * mangle.c (write_unnamed_type_name,
784 discriminator_for_string_literal): Likewise.
785 * search.c (dfs_accessible_post, dfs_debug_mark): Likewise.
786 * lex.c (handle_pragma_vtable, handle_pragma_unit,
787 handle_pragma_interface, handle_pragma_implementation,
788 handle_pragma_java_exceptions): Likewise.
790 2012-09-13 Jason Merrill <jason@redhat.com>
793 * semantics.c (cxx_eval_indirect_ref): If we aren't looking for an
794 address, make sure the value is constant.
797 * pt.c (tsubst_decl) [VAR_DECL]: Handle DECL_ANON_UNION_VAR_P.
800 * pt.c (value_dependent_expression_p): A TREE_LIST initializer must
803 2012-09-10 Paolo Carlini <paolo.carlini@oracle.com>
807 * call.c (build_cxx_call): Add tsubst_flags_t parameter, use
808 require_complete_type_sfinae.
809 (build_op_delete_call, build_over_call): Adjust.
810 * typeck.c (build_x_compound_expr_from_vec): Add tsubst_flags_t
812 (cp_build_function_call_vec): Adjust.
813 * init.c (build_new_1): Likewise.
814 * rtti.c (throw_bad_cast, throw_bad_typeid, build_dynamic_cast_1):
816 * optimize.c (build_delete_destructor_body): Likewise.
817 * cp-tree.h: Adjust declarations.
819 * call.c (convert_arg_to_ellipsis): Use require_complete_type_sfinae.
821 2012-09-10 Jason Merrill <jason@redhat.com>
825 * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Go back to using RECUR
826 for LAMBDA_EXPR_EXTRA_SCOPE except for function scope.
829 * decl.c (move_signature_fn_p): Split out from move_fn_p.
830 * method.c (process_subob_fn): Use it.
831 * cp-tree.h: Declare it.
833 2012-09-07 Jason Merrill <jason@redhat.com>
835 * semantics.c (sort_constexpr_mem_initializers): Tweak.
837 2012-09-09 Mark Kettenis <kettenis@openbsd.org>
839 * decl.c (reshape_init_class): Avoid dereferencing a
840 past-the-end pointer.
842 2012-09-07 Paolo Carlini <paolo.carlini@oracle.com>
844 * pt.c (num_template_headers_for_class): Rework per the code
845 inline in cp_parser_check_declarator_template_parameters.
846 * parser.c (cp_parser_check_declarator_template_parameters):
847 Use num_template_headers_for_class.
849 2012-09-06 Jason Merrill <jason@redhat.com>
853 * semantics.c (sort_constexpr_mem_initializers): New.
854 (build_constexpr_constructor_member_initializers): Use it.
855 (cx_check_missing_mem_inits): Skip artificial fields.
856 * init.c (expand_aggr_init_1): Don't zero out a class
859 2012-09-05 Paolo Carlini <paolo.carlini@oracle.com>
862 * search.c (lookup_base): Add tsubst_flags_t parameter.
863 (adjust_result_of_qualified_name_lookup, check_final_overrider):
865 * name-lookup.c (do_class_using_decl): Adjust.
866 * typeck2.c (binfo_or_else, build_scoped_ref, build_m_component_ref):
868 * cvt.c (cp_convert_to_pointer, convert_to_pointer_force,
869 build_up_reference): Likewise.
870 * rtti.c (build_dynamic_cast_1): Likewise.
871 * tree.c (maybe_dummy_object): Likewise.
872 * call.c (build_conditional_expr_1, build_over_call): Likewise.
873 * cp-tree.h (UNIQUELY_DERIVED_FROM_P, PUBLICLY_UNIQUELY_DERIVED_P):
875 (enum base_access_flags, ba_quiet): Remove.
876 (uniquely_derived_from_p, publicly_uniquely_derived_p): Declare.
877 * except.c (can_convert_eh): Adjust.
878 * decl.c (grokdeclarator): Likewise.
879 * typeck.c (comp_except_types, build_class_member_access_expr,
880 finish_class_member_access_expr, get_member_function_from_ptrfunc,
881 build_static_cast_1, get_delta_difference_1): Likewise.
882 * class.c (build_base_path, convert_to_base, build_vtbl_ref_1,
883 warn_about_ambiguous_bases): Likewise.
884 (uniquely_derived_from_p, publicly_uniquely_derived_p): Define.
886 2012-09-04 Jason Merrill <jason@redhat.com>
889 * decl.c (reshape_init_class): Handle invalid initializer for
890 0-length array member.
892 * error.c (dump_type_suffix): Correct handling of 0-length arrays.
895 * cp-tree.h (LAMBDANAME_P): Remove.
896 (LAMBDA_TYPE_P): Check CLASSTYPE_LAMBDA_EXPR instead.
897 * cp-lang.c (cxx_dwarf_name): Likewise.
898 * error.c (dump_aggr_type): Likewise.
899 * semantics.c (begin_lambda_type): Set CLASSTYPE_LAMBDA_EXPR sooner.
902 * decl.c (check_default_argument): Set cp_unevaluated_operand
903 around call to perform_implicit_conversion_flags.
907 * pt.c (fn_type_unification): Call coerce_template_parms before
908 entering substitution context.
910 2012-08-31 Paolo Carlini <paolo.carlini@oracle.com>
911 Jason Merrill <jason@redhat.com>
914 * pt.c (check_template_variable): New.
915 (num_template_headers_for_class): Split out...
916 * decl.c (grokdeclarator): ...from here.
917 (start_decl): Remove redundant diagnostic.
918 * cp-tree.h: Declare them
919 * parser.c (cp_parser_single_declaration): Call check_template_variable.
921 2012-08-31 Ollie Wild <aaw@google.com>
924 * call.c (extend_ref_init_temps_1): Handle COMPOUND_EXPR trees.
926 2012-08-30 Jason Merrill <jason@redhat.com>
930 * pt.c (instantiation_dependent_r): New.
931 (instantiation_dependent_expression_p): New.
932 (value_dependent_expression_p): Use it. SCOPE_REF is always dependent.
933 * semantics.c (finish_decltype_type): Use it.
934 * cp-tree.h: Declare it.
936 * semantics.c (finish_qualified_id_expr): Handle building up a
937 non-dependent SCOPE_REF here.
938 (finish_id_expression): Not here.
939 * error.c (dump_decl) [SCOPE_REF]: Only pass TFF_UNQUALIFIED_NAME.
941 * friend.c (make_friend_class): Handle template template parameters.
942 * parser.c (cp_parser_template_declaration_after_export): Likewise.
943 * pt.c (tsubst_friend_class): Likewise.
944 (instantiate_class_template_1): Likewise
945 * decl.c (check_elaborated_type_specifier): Likewise.
946 (lookup_and_check_tag): Likewise.
948 * pt.c (get_class_bindings): Call coerce_template_parms. Add
950 (more_specialized_class): Add main_tmpl parameter.
951 (most_specialized_class): Adjust calls.
953 * decl.c (cp_finish_decl): Check for invalid multiple initializers
954 even if the initializer is dependent.
956 * pt.c (instantiate_template_1): Keep processing_template_decl set
957 if there are dependent args.
959 2012-08-25 Paolo Carlini <paolo.carlini@oracle.com>
962 * decl2.c (mark_used): Consistently return false after errors
963 about uses before deduction of auto.
964 * semantics.c (finish_id_expression): Check mark_used return
965 value and return error_mark_node in case of failure.
967 2012-08-24 Jason Merrill <jason@redhat.com>
970 * pt.c (deduction_tsubst_fntype): Remove.
971 (fn_type_unification): Check deduction depth and call
972 instantiate_template here. Handle default argument access checks.
973 (determine_specialization): Suppress access control.
974 (tsubst_decl): Check for excessive deduction depth.
975 (recheck_decl_substitution): Make sure access control is on.
976 (type_unification_real): Don't mess with access deferring here.
977 (get_bindings): Adjust for fn_type_unification return type.
978 * call.c (enum rejection_reason_code): Drop rr_template_instantiation.
979 (template_instantiation_rejection): Remove.
980 (struct rejection_reason): Change targs to num_targs.
981 (template_unification_rejection, print_z_candidate): Adjust.
982 (add_template_candidate_real): Adjust for fn_type_unification change.
983 * class.c (resolve_address_of_overloaded_function): Likewise.
984 * cp-tree.h: Adjust declaration.
986 * pt.c (tsubst_default_argument): Indicate where the default
987 argument is being instantiated for.
988 (tsubst_expr): Restore previous location.
989 (tsubst_copy_and_build): Set and restore location.
990 * call.c (build_new_method_call_1): Remember location of call.
991 * semantics.c (finish_call_expr): Here too.
992 * parser.c (cp_parser_omp_for_loop): Remember the location of the
993 increment expression.
995 * pt.c (resolve_overloaded_unification): Use coerce_template_parms
996 instead of get_bindings.
997 (resolve_nondeduced_context): Likewise.
999 * pt.c (register_specialization): Correct argument to
1000 check_specialization_namespace.
1001 (determine_specialization): Don't consider members of
1002 unspecialized types.
1004 2012-08-23 Jason Merrill <jason@redhat.com>
1006 * decl.c (compute_array_index_type): Use type_dependent_expression_p.
1008 2012-08-23 Paolo Carlini <paolo.carlini@oracle.com>
1011 * name-lookup.c (supplement_binding_1): Handle specially enums
1012 only in class templates.
1013 (validate_nonmember_using_decl): Enforce 7.3.3/10 about duplicate
1014 using declarations at function scope.
1016 2012-08-21 Richard Guenther <rguenther@suse.de>
1018 * cp-tree.h (TREE_INDIRECT_USING): Use TREE_LANG_FLAG_0 accessor.
1019 (ATTR_IS_DEPENDENT): Likewise.
1020 (ARGUMENT_PACK_INCOMPLETE_P): Use TREE_ADDRESSABLE instead of
1021 TREE_LANG_FLAG_0 on TREE_VECs.
1023 2012-08-20 Florian Weimer <fweimer@redhat.com>
1026 * call.c (build_operator_new_call): Add size_check argument and
1028 * cp-tree.h (build_operator_new_call): Adjust declaration.
1029 * init.c (build_new_1): Compute array size check and apply it.
1031 2012-08-20 Paolo Carlini <paolo.carlini@oracle.com>
1034 * decl.c (poplevel): Check TYPE_HAS_NONTRIVIAL_DESTRUCTOR for
1035 Wunused_variable too.
1037 2012-08-20 Diego Novillo <dnovillo@google.com>
1039 * decl.c (poplevel): Start TV_NAME_LOOKUP conditionally.
1041 2012-08-20 Richard Guenther <rguenther@suse.de>
1043 * name-lookup.c (store_binding_p): New predicate, split out from ...
1044 (store_binding): ... here. Always store binding and require
1045 target vector with enough space.
1046 (store_bindings): Collect to store bindings and reserve space
1047 for them, then store them.
1048 (store_class_bindings): Likewise.
1050 2012-08-19 Mikael Morin <mikael@gcc.gnu.org>
1052 * Make-lang.in: Fix typo.
1054 2012-08-17 Jakub Jelinek <jakub@redhat.com>
1056 * cp-tree.def (SIZEOF_EXPR): Move to c-common.def.
1058 2012-08-14 Diego Novillo <dnovillo@google.com>
1060 Merge from cxx-conversion branch. Re-write VEC in C++.
1062 * call.c (add_function_candidate): Remove const qualifier
1063 from call to VEC_index.
1065 2012-08-10 Richard Guenther <rguenther@suse.de>
1067 * error.c (dump_expr): Handle anonymous SSA names.
1069 2012-08-07 Steven Bosscher <steven@gcc.gnu.org>
1071 * error.c (print_instantiation_context): Pretty-print a newline before
1072 diagnostic_flush_buffer.
1073 * cxx-pretty-print.c (pp_cxx_function_definition): Use
1074 pp_newline_and_flush instead of separate pp_newline and pp_flush.
1076 2012-08-06 Dodji Seketeli <dodji@redhat.com>
1078 Avoid crashing on erroneous static_assert usage
1079 * semantics.c (finish_static_assert): Don't crash on erroneous
1080 message or condition.
1082 2012-08-06 Marc Glisse <marc.glisse@inria.fr>
1083 Paolo Carlini <paolo.carlini@oracle.com>
1086 * typeck.c (build_static_cast_1): Move the conversion to void case
1087 before the perform_direct_initialization_if_possible call.
1089 2012-08-03 Marc Glisse <marc.glisse@inria.fr>
1091 * pt.c (tsubst_copy_and_build): Handle VECTOR_TYPE like scalars.
1092 * cp-tree.h (scalarish_type_p): Declare.
1093 * tree.c (scalarish_type_p): Make non-static.
1095 2012-08-02 Jason Merrill <jason@redhat.com>
1096 Paolo Carlini <paolo.carlini@oracle.com>
1098 PR c++/51213 (again)
1099 * pt.c (type_unification_real): Call push_deferring_access_checks /
1100 pop_deferring_access_checks around the substitution of default
1102 (instantiate_template_1): When the specialization returned by
1103 retrieve_specialization has FNDECL_HAS_ACCESS_ERRORS set and we
1104 are in a SFINAE context, simply return error_mark_node.
1105 * cp-tree.h (FNDECL_RECHECK_ACCESS_P): Rename FNDECL_HAS_ACCESS_ERRORS.
1107 2012-07-31 Paolo Carlini <paolo.carlini@oracle.com>
1109 * pt.c (check_default_tmpl_args): Change is_primary and is_partial
1110 parameters to bool type, adjust.
1111 (push_template_decl_real): Tidy.
1112 * parser.c (cp_parser_init_declarator): Adjust.
1113 * decl.c (redeclaration_error_message): Likewise.
1114 * cp-tree.h (check_default_tmpl_args): Update prototype.
1116 2012-07-31 Paolo Carlini <paolo.carlini@oracle.com>
1119 * pt.c (check_default_tmpl_args): Don't check local types.
1121 2012-07-25 Sandra Loosemore <sandra@codesourcery.com>
1122 Paul Brook <paul@codesourcery.com>
1125 * decl.c (finish_function): Check targetm.warn_func_return.
1127 2012-07-25 Jason Merrill <jason@redhat.com>
1130 * decl.c (grokdeclarator): Allow const and constexpr together.
1133 * semantics.c (potential_constant_expression_1) [COND_EXPR]: Call
1134 maybe_constant_value.
1136 * cp-tree.h (tsubst_flags): Remove tf_no_access_control.
1137 * call.c (standard_conversion): Don't set it.
1138 * class.c (resolve_address_of_overloaded_function): Don't check it.
1139 * decl.c (check_default_argument): Call
1140 perform_implicit_conversion_flags.
1142 * pt.c (print_candidates_1): Use inform instead of error.
1144 2012-07-24 Paolo Carlini <paolo.carlini@oracle.com>
1146 * pt.c (convert_template_argument, tsubst): Simplify fourth argument
1147 to make_typename_type (complain & tf_error -> complain).
1149 2012-07-24 Steven Bosscher <steven@gcc.gnu.org>
1151 * class.c (n_vtables, n_vtable_entries, n_vtable_searches,
1152 n_vtable_elems, n_convert_harshness, n_compute_conversion_costs,
1153 n_inner_fields_searched): Always define.
1154 (build_primary_vtable): Convert #ifdef GATHER_STATISTICS to if-code.
1155 (print_class_statistics): Convert #ifdef GATHER_STATISTICS to if-code.
1156 * tree.c (depth_reached): Always define global.
1157 (cxx_print_statistics): Convert #ifdef GATHER_STATISTICS to if-code.
1158 * pt.c (depth_reached): Always define.
1159 (push_tinst_level): Convert #ifdef GATHER_STATISTICS to if-code.
1160 * search.c (n_fields_searched, n_calls_lookup_field,
1161 n_calls_lookup_field_1, n_calls_lookup_fnfields,
1162 n_calls_lookup_fnfields_1, n_calls_get_base_type,
1163 n_outer_fields_searched, n_contexts_saved): Always define.
1164 (lookup_field_1): Convert #ifdef GATHER_STATISTICS to if-code.
1165 (lookup_member): Likewise.
1166 (lookup_fnfields_idx_nolazy): Likewise.
1167 (print_search_statistics): Likewise.
1168 (reinit_search_statistics): Unconditionally re-set counters.
1169 * lex.c (retrofit_lang_decl): Convert #ifdef GATHER_STATISTICS
1171 (cxx_dup_lang_specific_decl): Likewise.
1172 (copy_lang_type): Likewise.
1173 (cxx_make_type): Likewise.
1175 2012-07-20 Jason Merrill <jason@redhat.com>
1178 * tree.c (build_cplus_array_type): Use build_cplus_array_type to build
1179 canonical array type rather than mess with its TYPE_*_VARIANT.
1181 2012-07-19 Jason Merrill <jason@redhat.com>
1184 * typeck.c (cp_apply_type_quals_to_decl): Check COMPLETE_TYPE_P.
1187 * call.c (build_cxx_call): Set optimize when folding
1188 __builtin_constant_p in a constexpr function.
1190 2012-07-18 Jason Merrill <jason@redhat.com>
1192 * pt.c (instantiate_decl): Don't recheck substitutions.
1194 2012-07-18 Paolo Carlini <paolo.carlini@oracle.com>
1195 Jason Merrill <jason@redhat.com>
1199 * semantics.c (perform_access_checks): Add complain parm, return bool.
1200 (perform_deferred_access_checks): Likewise.
1201 (perform_or_defer_access_check): Likewise.
1202 (speculative_access_check): Remove.
1203 * call.c (enforce_access): Add complain parm, return bool.
1204 * decl.c, friend.c, class.c, init.c, parser.c: Adjust callers.
1205 * search.c: Adjust callers.
1206 * cp-tree.h (TINFO_RECHECK_ACCESS_P): New macro.
1207 (FNDECL_RECHECK_ACCESS_P): New macro.
1208 * method.c (synthesized_method_walk): Stop deferring access checks.
1209 * pt.c (recheck_decl_substitution): New.
1210 (instantiate_template_1): Set and check FNDECL_RECHECK_ACCESS_P.
1212 2012-07-18 Jason Merrill <jason@redhat.com>
1214 * method.c (process_subob_fn): Make sure no_implicit_p is non-null
1215 before trying to store through it.
1217 2012-07-17 Jason Merrill <jason@redhat.com>
1220 * decl.c (finish_enum_value_list): Only call
1221 insert_late_enum_def_into_classtype_sorted_fields in class scope.
1224 * tree.c (build_cplus_array_type): Also add TYPE_CANONICAL
1225 to the list of variants.
1227 * decl.c (xref_basetypes): Complain about incomplete template base.
1228 * class.c (finish_struct): Adjust variants in templates, too.
1231 * parser.c (cp_parser_class_head): Call xref_basetypes here.
1232 (cp_parser_class_specifier_1): Not here.
1233 * pt.c (tsubst_decl) [USING_DECL]: Check uses_template_parms
1234 as well as DECL_DEPENDENT_P.
1236 2012-07-16 Jason Merrill <jason@redhat.com>
1238 * cp-tree.h (struct deferred_access_check): Add location.
1239 * semantics.c (perform_access_checks): Use it.
1240 (perform_or_defer_access_check): Store it.
1242 2012-07-16 Steven Bosscher <steven@gcc.gnu.org>
1244 * dump.c (dump_stmt): Moved here from c-dump.c.
1245 * optimize.c: Include dumpfile.h instead of tree-dump.h.
1246 * class.c: Likewise.
1247 * decl2.c: Likewise.
1248 * Make-lang.in: Fix dependencies.
1250 2012-07-13 Jason Merrill <jason@redhat.com>
1253 * method.c (synthesized_method_walk): Initialize no_implicit_p sooner.
1255 2012-07-12 Jason Merrill <jason@redhat.com>
1257 * pt.c (instantiate_decl): Check typedefs access here.
1258 (instantiate_template_1): Not here.
1260 * pt.c (deduction_tsubst_fntype): Just suppress access checking.
1261 (instantiate_template_1): Set DECL_TI_TEMPLATE before access checking.
1262 (push_deduction_access_scope, pop_deduction_access_scope): Remove.
1264 2012-07-11 Jason Merrill <jason@redhat.com>
1267 * method.c (synthesized_method_walk): Replace uses of msg with diag.
1268 Correct handling of virtual bases with move operations.
1269 (process_subob_fn, walk_field_subobs): Replace uses of msg with diag.
1271 2012-07-11 Steven Bosscher <steven@gcc.gnu.org>
1273 * method.c: Do not include tree-pass.h.
1275 2012-07-10 Jason Merrill <jason@redhat.com>
1279 * cp-tree.h (FNDECL_SUPPRESS_IMPLICIT_DECL): New.
1280 (struct lang_decl_fn): Add suppress_implicit_decl field.
1281 * method.c (implicitly_declare_fn): Check it.
1282 (process_subob_fn): Add no_implicit_p parm.
1283 (walk_field_subobs, synthesized_method_walk): Likewise.
1284 (maybe_explain_implicit_delete): Adjust.
1285 (explain_implicit_non_constexpr): Adjust.
1287 * method.c (synthesized_method_walk): Avoid changing
1288 EH spec based on cleanups in other places, too.
1290 2012-07-09 Sterling Augustine <saugustine@google.com>
1292 * error.c (lang_decl_name): Use TFF_UNQUALIFIED_NAME flag.
1294 2012-07-08 Steven Bosscher <steven@gcc.gnu.org>
1296 * decl.c (cp_finish_decl): Add FIXME at add_local_decl call site.
1298 2012-07-06 Jason Merrill <jason@redhat.com>
1301 * pt.c (tsubst_arg_types): Add "end" parameter.
1302 (check_undeduced_parms): Use it.
1304 * cp-tree.h (DECL_DECLARES_TYPE_P): Check DECL_TYPE_TEMPLATE_P.
1307 * name-lookup.c (ambiguous_decl): Use DECL_TYPE_TEMPLATE_P.
1309 2012-07-05 Jason Merrill <jason@redhat.com>
1312 * pt.c (arg_from_parm_pack_p): Go back to using same_type_p or
1315 * cp-tree.h (TEMPLATE_PARM_NUM_SIBLINGS): Remove.
1316 (struct template_parm_index_s): Remove num_siblings.
1317 * pt.c (fixup_template_parms, fixup_template_parm_index): Remove.
1318 (fixup_template_type_parm_type): Remove.
1319 (build_template_parm_index): Remove num_siblings parm.
1320 (process_template_parm): Likewise.
1321 * parser.c (cp_parser_template_parameter_list): Adjust.
1322 * tree.c (cp_tree_equal): Don't compare num_siblings.
1323 * typeck.c (comp_template_parms_position): Likewise.
1327 * tree.c (strip_typedefs_expr): New.
1328 * cp-tree.h: Declare it.
1329 * pt.c (convert_template_argument, unify): Use it.
1330 * parser.c (cp_parser_template_declaration_after_export): Don't call
1331 fixup_template_parms.
1333 2012-07-04 Jason Merrill <jason@redhat.com>
1337 * decl.c (build_enumerator): Don't use build_lang_decl_loc.
1339 2012-07-03 Jakub Jelinek <jakub@redhat.com>
1342 * semantics.c (finish_goto_stmt): Surround computed goto argument
1343 with CLEANUP_POINT_EXPR if needed.
1345 2012-07-02 Jason Merrill <jason@redhat.com>
1348 * pt.c (in_template_function): New.
1349 * cp-tree.h: Declare it.
1350 * class.c (build_base_path, resolves_to_fixed_type_p): Use it.
1353 * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Use tsubst
1354 for LAMBDA_EXPR_EXTRA_SCOPE.
1357 * pt.c (build_non_dependent_expr): Don't wrap a dummy object.
1360 * class.c (resolves_to_fixed_type_p): Check uses_template_parms
1361 (current_function_decl) instead of processing_template_decl.
1364 * semantics.c (maybe_add_lambda_conv_op): Don't set
1365 DECL_INTERFACE_KNOWN.
1368 * call.c (build_conditional_expr_1): Don't warn about comparison of
1369 two enumerators before their enumeration is complete.
1370 (build_new_op_1): Call decay_conversion before warn_logical_operator.
1371 * decl.c (build_enumerator): Set DECL_CONTEXT of an enumerator to
1373 * decl2.c (mark_used): Call used_types_insert for enums.
1374 * semantics.c (finish_id_expression): Don't decay CONST_DECL.
1375 (finish_member_declaration): Don't change DECL_CONTEXT of enumerators.
1376 * class.c (check_field_decls): Don't change DECL_CONTEXT of enums.
1377 * typeck.c (convert_for_assignment): Don't decay CONST_DECL.
1378 (build_class_member_access_expr): Look through unscoped enums.
1379 * search.c (context_for_name_lookup): Look through unscoped enums.
1380 * pt.c (tsubst_copy_and_build): Don't decay CONST_DECL.
1381 (tsubst_copy): Use DECL_CONTEXT to find the enumeration.
1382 * tree.c (decl_linkage): Likewise.
1383 * cvt.c (ocp_convert): Check decayed expr for enum range warning.
1385 2012-06-29 Steven Bosscher <steven@gcc.gnu.org>
1387 * Make-lang.in: Remove tree-mudflap.o from CXX_AND_OBJCXX_OBJS.
1389 2012-06-27 Jason Merrill <jason@redhat.com>
1391 * parser.c (cp_parser_check_for_invalid_template_id): tag_type parm.
1392 (cp_parser_simple_type_specifier, cp_parser_class_head): Adjust.
1393 (cp_parser_elaborated_type_specifier): Adjust.
1394 * decl.c (duplicate_decls): Return error_mark_node on template
1398 * parser.c (cp_parser_template_id): Add tag_type parm.
1399 (cp_parser_template_name): Likewise.
1400 (cp_parser_id_expression, cp_parser_unqualified_id): Adjust.
1401 (cp_parser_pseudo_destructor_name, cp_parser_type_name): Adjust.
1402 (cp_parser_simple_type_specifier, cp_parser_class_name): Adjust.
1403 (cp_parser_elaborated_type_specifier, cp_parser_class_head): Adjust.
1405 2012-06-27 Ramana Radhakrishnan <ramana.radhakrishnan@linaro.org>
1408 * semantics.c (constexpr_call): Fix typo in comment.
1409 (cxx_eval_vec_perm_expr): New.
1410 (cxx_eval_constant_expression): Fold VEC_PERM_EXPRs.
1412 2012-06-26 Richard Guenther <rguenther@suse.de>
1415 * mangle.c (write_array_type): Truncate the number-of-elements
1418 2012-06-25 Jason Merrill <jason@redhat.com>
1422 * pt.c (tsubst_decl) [PARM_DECL]: Don't recurse into DECL_CHAIN
1423 if cp_unevaluated_operand is set.
1424 (tsubst_copy) [PARM_DECL]: Don't copy before tsubsting.
1427 * typeck.c (decay_conversion): Don't discard side-effects from
1428 expressions of nullptr_t.
1430 2012-06-25 Florian Weimer <fweimer@redhat.com>
1432 * init.c (build_new_1): Warn about (T[N]) for variable N, and
1435 * parser.c (cp_parser_direct_new_declarator): Accept non-constant
1436 expressions. Handled now in build_new_1.
1438 2012-06-25 Jason Merrill <jason@redhat.com>
1441 * semantics.c (build_data_member_initialization): Always keep
1442 initializer for empty base.
1443 (cxx_eval_bare_aggregate): Discard it here.
1446 * pt.c (tsubst_omp_for_iterator): Simplify DECL_EXPR handling.
1447 (tsubst_expr) [OMP_FOR]: Here, too.
1449 2012-06-25 Jakub Jelinek <jakub@redhat.com>
1452 * class.c (check_bases_and_members): Avoid -Wuninitialized
1453 diagnostics for non-static const members or references if they
1456 2012-06-16 Ville Voutilainen <ville.voutilainen@gmail.com>
1458 * parser.c (cp_parser_direct_declarator): Move virt-specifier
1459 parsing after late-specified return type parsing.
1461 2012-06-14 Jason Merrill <jason@redhat.com>
1464 * name-lookup.c (constructor_name_p): Don't try to look at the
1465 name of a DECLTYPE_TYPE.
1467 2012-06-18 Lawrence Crowl <crowl@google.com>
1469 * decl2.c (cp_write_global_declarations): Rename use of TV_PHASE_CGRAPH
1470 to TV_PHASE_OPT_GEN.
1472 2012-06-18 Steven Bosscher <steven@gcc.gnu.org>
1474 * decl.c (finish_function): Remove code conditional on VMS_TARGET.
1476 2012-06-15 Marc Glisse <marc.glisse@inria.fr>
1479 * semantics.c (literal_type_p): Handle VECTOR_TYPE.
1480 (potential_constant_expression_1): Handle VEC_PERM_EXPR.
1481 * parser.c (cp_parser_postfix_expression): Handle RID_BUILTIN_SHUFFLE.
1483 2012-06-09 Jason Merrill <jason@redhat.com>
1485 * pt.c (tsubst_expr) [TAG_DEFN]: Instantiate local class.
1486 * class.c (finish_struct): Don't add a TAG_DEFN for a lambda.
1487 * decl2.c (finish_static_data_member_decl): Avoid redundant error.
1490 * name-lookup.c (pushtag_1): Add a DECL_EXPR for a local class.
1491 * semantics.c (finish_cond): Build a COMPOUND_EXPR.
1492 * pt.c (tsubst_expr) [COMPOUND_EXPR]: Handle.
1493 [DECL_EXPR]: Don't call cp_finish_decl for an implicit typedef.
1494 Don't return the decl.
1496 2012-06-11 Richard Guenther <rguenther@suse.de>
1499 * mangle.c (write_array_type): Use double-ints for array domain
1502 2012-06-07 Fabien ChĂȘne <fabien@gcc.gnu.org>
1505 * cp-tree.h (insert_late_enum_def_into_classtype_sorted_fields):
1507 * class.c (insert_into_classtype_sorted_fields): New.
1508 (add_enum_fields_to_record_type): New.
1509 (count_fields): Adjust the comment.
1510 (add_fields_to_record_type): Likewise.
1511 (finish_struct_1): Move the code that inserts the fields for the
1512 sorted case, into insert_into_classtype_sorted_fields, and call
1514 (insert_late_enum_def_into_classtype_sorted_fields): Define.
1515 * decl.c (finish_enum_value_list): Call
1516 insert_late_enum_def_into_classtype_sorted_fields if a late enum
1517 definition is encountered.
1519 2012-06-06 Paolo Carlini <paolo.carlini@oracle.com>
1522 * typeck.c (cp_perform_integral_promotions): New, like
1523 perform_integral_promotions but also takes a tsubst_flags_t parameter.
1524 (pointer_diff): Add tsubst_flags_t parameter.
1525 (decay_conversion, cp_default_conversion, cp_build_array_ref,
1526 cp_build_binary_op, cp_build_unary_op, build_static_cast_1,
1527 build_reinterpret_cast_1, cp_build_modify_expr,
1528 convert_for_assignment): Adjust.
1529 * optimize.c (build_delete_destructor_body): Adjust.
1530 * init.c (expand_virtual_init, expand_default_init, build_new_1,
1531 build_new, build_vec_delete_1, build_vec_init, build_delete): Adjust.
1532 (construct_virtual_base): Adjust LOOKUP_COMPLAIN -> 0.
1533 * class.c (build_base_path): Adjust.
1534 * decl.c (compute_array_index_type, finish_destructor_body): Likewise.
1535 * method.c (synthesized_method_walk): Adjust flag and complain.
1536 * rtti.c (ifnonnull): Add tsubst_flags_t parameter.
1537 (build_typeid, build_dynamic_cast_1): Adjust.
1538 * except.c (initialize_handler_parm): Likewise.
1539 * typeck2.c (process_init_constructor_record): Likewise.
1540 * pt.c (tsubst_friend_class): Don't change flags.
1541 * semantics.c (finish_goto_stmt, handle_omp_for_class_iterator,
1542 finish_static_assert): Likewise.
1543 * parser.c (cp_parser_lookup_name): Just pass 0 as flags to
1545 * call.c (build_op_delete_call): Add tsubst_flags_t parameter.
1546 (convert_like_real, convert_arg_to_ellipsis, convert_for_arg_passing):
1548 (standard_conversion): Adjust LOOKUP_COMPLAIN -> 0.
1549 (implicit_conversion): Mask out tf_error with a FIXME.
1550 (build_user_type_conversion_1, build_new_op_1, build_over_call): Use
1551 complain & tf_error instead of flags & LOOKUP_COMPLAIN.
1552 * cvt.c (cp_convert_to_pointer, convert_to_pointer_force,
1553 build_up_reference, convert_to_reference, cp_convert,
1554 cp_convert_and_check, ocp_convert, convert_force): Add tsubst_flags_t
1556 (convert_to_reference, ocp_convert): Use complain & tf_error instead
1557 of flags & LOOKUP_COMPLAIN.
1558 (convert_force): Adjust LOOKUP_COMPLAIN -> 0.
1559 * name-lookup.c (identifier_type_value_1, lookup_qualified_name,
1560 lookup_name_real, lookup_function_nonclass, lookup_name,
1561 lookup_name_prefer_type): Adjust LOOKUP_COMPLAIN -> 0.
1562 * cp-tree.h: Adjust prototypes; remove LOOKUP_COMPLAIN.
1564 2012-06-06 Steven Bosscher <steven@gcc.gnu.org>
1566 * decl.c: Do not include output.h.
1567 (start_decl): Remove code for flag_conserve_space.
1569 2012-06-06 Fabien ChĂȘne <fabien@gcc.gnu.org>
1572 * parser.c (cp_parser_alias_declaration): Return earlier
1573 if an error occured.
1575 2012-06-04 Paolo Carlini <paolo.carlini@oracle.com>
1578 * call.c (build_conditional_expr_1): Use OPT_Wenum_compare
1579 to control enumeral mismatch in conditional expression too.
1581 2012-06-04 Sterling Augustine <saugustine@google.com>
1583 * cp-tree.h: Declare decl_as_dwarf_string, lang_decl_dwarf_name.
1584 * cp-lang.c (cxx_dwarf_name): Call them.
1586 2012-06-04 Steven Bosscher <steven@gcc.gnu.org>
1588 * semantics.c: Do not include output.h.
1589 * decl2.c: Likewise.
1590 * friend.c: Likewise.
1591 * typeck.c: Likewise.
1592 * typeck2.c: Likewise.
1593 * Make-lang.in: Fix dependencies.
1595 2012-06-01 Jason Merrill <jason@redhat.com>
1598 * parser.c (cp_parser_class_head): Apply attributes here.
1599 * semantics.c (begin_class_definition): Not here.
1600 * cp-tree.h: Adjust.
1603 * parser.c (cp_parser_binary_expression): Bail early if we're parsing
1604 tentatively and the LHS has a parse error.
1607 * pt.c (instantiate_class_template_1): Set LAMBDA_EXPR_THIS_CAPTURE.
1608 (instantiate_decl): Don't push_to_top_level for local class methods.
1609 (instantiate_class_template_1): Or for local classes.
1612 * pt.c (do_auto_deduction): Don't try to deduce from a
1613 type-dependent initializer.
1615 2012-06-01 Paolo Carlini <paolo.carlini@oracle.com>
1618 * name-lookup.c (push_namespace): When error recovery is
1619 impossible just error out in duplicate_decls.
1621 2012-05-31 Steven Bosscher <steven@gcc.gnu.org>
1623 * call.c: Do not include output.h.
1624 * class.c: Likewise.
1625 * except.c: Likewise.
1626 * friend.c: Likewise.
1629 * method.c: Likewise.
1630 * parser.c: Likewise.
1633 * search.c: Likewise.
1635 2012-05-30 Jason Merrill <jason@redhat.com>
1638 * tree.c (stabilize_init): Handle stabilizing a TARGET_EXPR
1639 representing a bitwise copy of a glvalue.
1641 * tree.c (stabilize_expr): Tweak logic.
1644 * tree.c (stabilize_init): Side effects make the init unstable.
1646 2012-05-28 Paolo Carlini <paolo.carlini@oracle.com>
1649 * semantics.c (potential_constant_expression_1): Handle LTGT_EXPR.
1651 2012-05-26 Paolo Carlini <paolo.carlini@oracle.com>
1654 * tree.c (stabilize_expr): Handle exp of void type.
1656 2012-05-26 Jason Merrill <jason@redhat.com>
1659 * call.c (convert_like_real) [ck_list]: Take array address directly.
1660 * typeck.c (decay_conversion): Reject decay of an array compound
1663 2012-05-25 Paolo Carlini <paolo.carlini@oracle.com>
1666 * parser.c (cp_parser_member_declaration): A storage class is not
1667 allowed in a declaration of an anonymous aggregate in a class scope.
1669 2012-05-24 Uros Bizjak <ubizjak@gmail.com>
1672 * decl.c (grokdeclarator): Check that current_class_type is non-NULL
1673 before calling constructor_name_p.
1675 2012-05-24 Paolo Carlini <paolo.carlini@oracle.com>
1678 * parser.c (cp_parser_ctor_initializer_opt_and_function_body,
1679 cp_parser_function_body): Add a bool parameter, true when parsing
1680 a function-try-block.
1681 (cp_parser_function_try_block): Pass true to the above.
1682 (cp_parser_function_definition_after_declarator,
1683 cp_parser_function_transaction): Adjust.
1685 2012-05-23 Paolo Carlini <paolo.carlini@oracle.com>
1688 * decl2.c (delete_sanity): Extend 'deleting array' warning to
1691 2012-05-21 Paolo Carlini <paolo.carlini@oracle.com>
1694 * decl.c (grokdeclarator): Diagnose functions returning abstract
1695 class types as TYPENAME.
1696 * cp-tree.h (ABSTRACT_CLASS_TYPE_P): Add.
1697 * except.c (is_admissible_throw_operand_or_catch_parameter): Use it.
1698 * pt.c (tsubst): Likewise.
1699 * semantics.c (trait_expr_value): Likewise.
1701 2012-05-21 Paolo Carlini <paolo.carlini@oracle.com>
1704 * parser.c (cp_parser_attributes_opt): Enforce error checking of
1705 unbalanced parentheses in the presence of tentative parsing.
1707 2012-05-17 Paolo Carlini <paolo.carlini@oracle.com>
1710 * parser.c (cp_parser_new_type_id): Early return error_mark_node
1711 if the cp_parser_type_specifier_seq call has type_specifier_seq.type
1712 error_mark_node; tidy.
1713 (cp_parser_new_expression): Always initialize nelts to NULL_TREE to
1714 avoid uninitialized warnings.
1715 (cp_parser_init_declarator, cp_parser_late_parse_one_default_arg):
1716 Call cp_parser_skip_to_end_of_statement if cp_parser_initializer
1717 returns error_mark_node.
1719 2012-05-17 Paolo Carlini <paolo.carlini@oracle.com>
1722 * except.c (is_admissible_throw_operand): Rename to
1723 is_admissible_throw_operand_or_catch_parameter and handle
1724 catch parameter too.
1725 (expand_start_catch_block): Use it.
1726 (build_throw): Adjust.
1728 2012-05-17 Paolo Carlini <paolo.carlini@oracle.com>
1731 * typeck.c (build_x_array_ref, build_x_conditional_expr,
1732 build_x_compound_expr, build_x_modify_expr): Add location_t parameter.
1733 (finish_class_member_access_expr, build_x_indirect_ref,
1734 build_x_binary_op, build_x_compound_expr_from_list,
1735 build_x_compound_expr_from_vec): Adjust callers.
1736 * tree.c (build_min_nt_loc): New.
1737 (build_min_nt): Remove.
1738 * typeck2.c (build_x_arrow): Adjust callers.
1739 * pt.c (tsubst_qualified_id, tsubst_omp_for_iterator,
1740 tsubst_copy_and_build): Likewise.
1741 * semantics.c (finish_mem_initializers, handle_omp_for_class_iterator,
1742 finish_omp_atomic): Likewise.
1743 * decl2.c (grok_array_decl, build_anon_union_vars): Adjust.
1744 * parser.c (cp_parser_question_colon_clause,
1745 cp_parser_assignment_expression, cp_parser_expression,
1746 cp_parser_template_id, cp_parser_omp_for_loop): Likewise.
1747 * cp-tree.h: Update.
1749 2012-05-16 Dodji Seketeli <dodji@redhat.com>
1751 PR preprocessor/7263
1752 * cp-tree.h (enum cp_decl_spec): Add new enumerators to cover all
1753 the possible declarator specifiers so far.
1754 (struct cp_decl_specifier_seq::locations): Declare new member.
1755 (cp_decl_specifier_seq::{specs, type_location}): Remove.
1756 (decl_spec_seq_has_spec_p): Declare new function.
1757 * parser.c (cp_parser_check_decl_spec): Remove.
1758 (set_and_check_decl_spec_loc): Define new static function.
1759 (decl_spec_seq_has_spec_p): Define new public function.
1760 (cp_parser_decl_specifier_seq, cp_parser_function_specifier_opt)
1761 (cp_parser_type_specifier, cp_parser_simple_type_specifier)
1762 (cp_parser_set_storage_class, cp_parser_set_decl_spec_type)
1763 (cp_parser_alias_declaration): Set the locations for each
1764 declspec, using set_and_check_decl_spec_loc.
1765 (cp_parser_explicit_instantiation, cp_parser_init_declarator)
1766 (cp_parser_member_declaration, cp_parser_init_declarator): Use the
1767 new declspec location for specifiers. Use the new
1768 decl_spec_seq_has_spec_p.
1769 (cp_parser_type_specifier_seq): Use the new
1770 set_and_check_decl_spec_loc. Stop using
1771 cp_parser_check_decl_spec. Use the new decl_spec_seq_has_spec_p.
1772 (, cp_parser_init_declarator): Use the new
1773 set_and_check_decl_spec_loc.
1774 (cp_parser_single_declaration, cp_parser_friend_p)
1775 (cp_parser_objc_class_ivars, cp_parser_objc_struct_declaration):
1776 Use the new decl_spec_seq_has_spec_p.
1777 * decl.c (check_tag_decl): Use new decl_spec_seq_has_spec_p. Use
1778 the more precise ds_redefined_builtin_type_spec location for
1779 diagnostics about re-declaring C++ built-in types.
1780 (start_decl, grokvardecl, grokdeclarator): Use the new
1781 decl_spec_seq_has_spec_p.
1783 2012-05-15 Paolo Carlini <paolo.carlini@oracle.com>
1786 * pt.c (tsubst_copy_and_build): Increase / decrease
1787 c_inhibit_evaluation_warnings around build_x_binary_op call.
1789 2012-05-12 Paolo Carlini <paolo.carlini@oracle.com>
1791 * cp-tree.h (TYPE_PTRMEM_P): Rename to TYPE_PTRDATAMEM_P.
1792 (TYPE_PTR_TO_MEMBER_P): Rename to TYPE_PTRMEM_P.
1793 (TYPE_PTR_OR_PTRMEM_P): Add.
1794 * typeck.c (composite_pointer_type_r, composite_pointer_type,
1795 common_pointer_type, cp_build_indirect_ref, cp_build_binary_op,
1796 cp_truthvalue_conversion, convert_ptrmem, build_static_cast_1,
1797 build_reinterpret_cast_1, build_const_cast_1, comp_ptr_ttypes_real,
1798 casts_away_constness_r, casts_away_constness): Adjust.
1799 * init.c (build_zero_init_1): Adjust.
1800 * class.c (check_field_decls): Likewise.
1801 * decl.c (check_default_argument): Likewise.
1802 * rtti.c (target_incomplete_p): Likewise.
1803 * tree.c (zero_init_p): Likewise.
1804 * cxx-pretty-print.c (pp_cxx_ptr_operator,
1805 pp_cxx_abstract_declarator): Likewise.
1806 * typeck2.c (build_m_component_ref): Likewise.
1807 * pt.c (convert_nontype_argument, invalid_nontype_parm_type_p,
1808 dependent_type_p_r): Likewise.
1809 * call.c (null_member_pointer_value_p, standard_conversion,
1810 add_builtin_candidate, build_conditional_expr_1, compare_ics):
1812 * cp-objcp-common.c (cp_var_mod_type_p): Likewise.
1813 * cvt.c (cp_convert_to_pointer, ocp_convert,
1814 perform_qualification_conversions): Likewise.
1815 * mangle.c (write_type): Likewise.
1816 * name-lookup.c (arg_assoc_type): Likewise.
1818 2012-05-12 Paolo Carlini <paolo.carlini@oracle.com>
1820 * parser.c (struct cp_parser_expression_stack_entry): Add location_t
1822 (cp_parser_binary_expression): Rework to always update at the same
1823 time tree_type and loc.
1824 * call.c (print_z_candidate): Add location_t parameter.
1825 (print_z_candidates, convert_like_real, joust): Adjust.
1827 2012-05-11 Alexandre Oliva <aoliva@redhat.com>
1830 * pt.c (tsubst_decl): Bail out if argvec is error_mark_node.
1832 2012-05-11 Paolo Carlini <paolo.carlini@oracle.com>
1835 * pt.c (tsubst_copy: case PARM_DECL): Return error_mark_node if
1836 tsubst_decl returns NULL_TREE.
1837 * cxx-pretty-print.c (pp_cxx_simple_type_specifier): Handle
1838 BOUND_TEMPLATE_TEMPLATE_PARM.
1840 2012-05-10 Paolo Carlini <paolo.carlini@oracle.com>
1843 * cvt.c (ocp_convert): Error out early for void -> bool conversions.
1844 * typeck.c (decay_conversion): Use error_at.
1845 * call.c (build_integral_nontype_arg_conv, convert_like_real,
1846 convert_arg_to_ellipsis, perform_implicit_conversion_flags,
1847 initialize_reference): Likewise.
1848 * cvt.c (warn_ref_binding): Add location_t parameter.
1849 (cp_convert_to_pointer, convert_to_reference, ocp_convert,
1850 convert_to_void, ): Use error_at and warning_at.
1852 2012-05-10 Paolo Carlini <paolo.carlini@oracle.com>
1855 * decl.c (check_default_argument): Fix typo (POINTER_TYPE_P
1856 instead of TYPE_PTR_P) in zero-as-null-pointer-constant warning.
1858 2012-05-06 Paolo Carlini <paolo.carlini@oracle.com>
1861 * call.c (op_error, build_new_op_1, build_new_op): Add location_t
1863 (build_conditional_expr_1): Adjust.
1864 * typeck.c (build_x_indirect_ref, build_x_binary_op,
1865 build_x_unary_op): Add location_t parameter.
1866 (rationalize_conditional_expr, build_x_array_ref,
1867 build_x_compound_expr, cp_build_modify_expr, build_x_modify_expr):
1869 * typeck2.c (build_x_arrow): Add location_t parameter.
1870 * semantics.c (finish_unary_op_expr): Likewise.
1871 (finish_increment_expr, handle_omp_for_class_iterator): Adjust.
1872 * decl2.c (grok_array_decl): Add location_t parameter.
1873 * parser.c (cp_parser_postfix_open_square_expression,
1874 cp_parser_postfix_dot_deref_expression, cp_parser_unary_expression,
1875 cp_parser_binary_expression, cp_parser_builtin_offsetof,
1876 do_range_for_auto_deduction, cp_convert_range_for,
1877 cp_parser_template_argument, cp_parser_omp_for_cond): Pass the
1879 * pt.c (tsubst_copy_and_build): Adjust.
1880 * tree.c (maybe_dummy_object): Likewise.
1881 * cp-tree.h: Update declarations.
1883 2012-05-04 Paolo Carlini <paolo.carlini@oracle.com>
1885 * semantics.c (cxx_eval_constant_expression, case CONVERT_EXPR): Tidy.
1887 2012-05-04 Paolo Carlini <paolo.carlini@oracle.com>
1890 * pt.c (instantiate_class_template_1): Increase / decrease
1891 c_inhibit_evaluation_warnings around the tsubst_expr call
1892 for STATIC_ASSERT_CONDITION.
1893 (tsubst_expr, case STATIC_ASSERT): Likewise.
1894 * typeck.c (cp_build_binary_op, case EQ_EXPR/NE_EXPR): Check
1895 c_inhibit_evaluation_warnings in the OPT_Waddress warnings.
1897 2012-05-03 Paolo Carlini <paolo.carlini@oracle.com>
1900 * call.c (build_over_call): Handle final member functions
1902 (build_new_method_call_1): Do not handle here.
1904 2012-05-02 Richard Guenther <rguenther@suse.de>
1906 * decl.c (grokdeclarator): Properly check for sizes that
1907 cover more than half of the address-space.
1909 2012-04-30 Marc Glisse <marc.glisse@inria.fr>
1912 * typeck.c (cp_build_array_ref): Handle VECTOR_TYPE.
1913 * decl2.c (grok_array_decl): Likewise.
1916 * parser.c (cp_parser_sizeof_operand): Require parentheses for
1919 2012-04-30 Dodji Seketeli <dodji@redhat.com>
1921 Fix location for static class members
1922 * decl.c (grokdeclarator): Use the location carried by the
1923 declarator for the DECL of the static class member.
1925 Fix va_arg type location
1926 * cp-tree.h (build_x_va_arg): Take an additional location
1928 * call.c (build_x_va_arg): Take a loc parameter for the location
1929 of the type of the va_arg expression.
1930 * parser.c (cp_parser_primary_expression): Pass the type of the
1931 type in the va_arg expression to build_x_va_arg.
1932 * pt.c (tsubst_copy): Adjust calls to build_x_va_arg.
1934 Make conversion warnings work on NULL with -ftrack-macro-expansion
1935 * call.c (conversion_null_warnings): Use the new
1936 expansion_point_location_if_in_system_header.
1937 * cvt.c (build_expr_type_conversion): Likewise.
1938 * typeck.c (cp_build_binary_op): Likewise.
1940 2012-04-30 Manuel López-Ibåñez <manu@gcc.gnu.org>
1942 * typeck.c (convert_for_assignment): Replace
1943 Wmissing-format-attribute with Wsuggest-attribute=format.
1944 * call.c (convert_for_arg_passing): Likewise.
1946 2012-04-26 Paolo Carlini <paolo.carlini@oracle.com>
1949 * class.c (check_bases_and_members): Implement core/1333, do not
1950 disallow defaulted in the class body non-const ref special members.
1952 2012-04-24 Paolo Carlini <paolo.carlini@oracle.com>
1955 * call.c (tourney, perform_overload_resolution,
1956 build_operator_new_call, build_user_type_conversion_1,
1957 build_user_type_conversion, perform_overload_resolution,
1958 add_template_candidate, add_template_candidate_real,
1959 add_template_conv_candidate, add_builtin_candidates,
1960 add_builtin_candidate, build_builtin_candidate,
1961 add_conv_candidate, add_function_candidate, implicit_conversion,
1962 reference_binding, build_list_conv, conditional_conversion,
1963 add_candidates, can_convert_array, build_aggr_conv,
1964 build_array_conv, build_complex_conv, conditional_conversion):
1965 Add tsubst_flags_t parameter.
1966 (joust): Likewise, use it to handle SFINAE as if pedantic.
1967 (add_list_candidates, build_integral_nontype_arg_conv,
1968 perform_overload_resolution, build_new_function_call,
1969 build_operator_new_call, build_op_call_1,
1970 build_conditional_expr_1, build_new_op_1, convert_like_real,
1971 convert_arg_to_ellipsis, convert_default_arg,
1972 convert_for_arg_passing, build_over_call,
1973 build_new_method_call_1, can_convert_arg, can_convert_arg_bad,
1974 perform_implicit_conversion_flags,
1975 perform_direct_initialization_if_possible,
1976 initialize_reference): Adjust.
1977 * typeck.c (casts_away_constness, casts_away_constness_r):
1978 Add tsubst_flags_t parameter.
1979 (convert_arguments, check_for_casting_away_constness,
1980 build_static_cast_1, build_ptrmemfunc, convert_for_assignment):
1982 * decl.c (reshape_init_r, check_default_argument): Likewise.
1983 * cp-gimplify.c (cxx_omp_clause_apply_fn): Likewise.
1984 * pt.c (convert_nontype_argument, check_non_deducible_conversion):
1986 * init.c (build_new_1): Likewise.
1987 * cvt.c (convert_to_reference, ocp_convert, build_type_conversion,
1988 build_expr_type_conversion, ): Likewise.
1989 * search.c (check_final_overrider): Likewise.
1990 * cp-tree.h (build_user_type_conversion,
1991 build_operator_new_call, can_convert, can_convert_arg,
1992 can_convert_arg_bad, convert_default_arg,
1993 convert_arg_to_ellipsis, convert_for_arg_passing):
1996 2012-04-22 Jan Hubicka <jh@suse.cz>
1998 * decl2.c (maybe_make_one_only): Mark keyed COMDATs as USED so they
2001 2012-04-22 Manuel López-Ibåñez <manu@gcc.gnu.org>
2004 * typeck.c (composite_pointer_type): Likewise.
2005 (cxx_sizeof_or_alignof_type): Likewise.
2006 (cp_build_array_ref): Likewise.
2007 (cp_build_function_call_vec): Likewise.
2008 (cp_build_addr_expr_1): Likewise.
2009 (convert_member_func_to_ptr): Likewise.
2010 * decl.c (check_tag_decl): Likewise.
2011 (check_static_variable_definition): Likewise.
2012 (compute_array_index_type): Likewise.
2013 (create_array_type_for_decl): Likewise.
2014 (grokdeclarator): Likewise.
2015 (grok_op_properties): Likewise.
2016 * error.c (maybe_warn_cpp0x): Likewise.
2017 * pt.c (maybe_process_partial_specialization): Likewise.
2018 (convert_template_argument): Likewise.
2019 (do_decl_instantiation): Likewise.
2020 (do_type_instantiation): Likewise.
2021 * parser.c (cp_parser_primary_expression): Likewise.
2022 (cp_parser_postfix_expression): Likewise.
2023 (cp_parser_unary_expression): Likewise.
2024 (cp_parser_question_colon_clause): Likewise.
2025 (cp_parser_lambda_introducer): Likewise.
2026 (cp_parser_lambda_declarator_opt): Likewise.
2027 (cp_parser_compound_statement): Likewise.
2028 (cp_parser_jump_statement): Likewise.
2029 (cp_parser_declaration_seq_opt): Likewise.
2030 (cp_parser_enum_specifier): Likewise.
2031 (cp_parser_enumerator_list): Likewise.
2032 (cp_parser_initializer_list): Likewise.
2033 (cp_parser_member_declaration): Likewise.
2034 * call.c (build_conditional_expr_1): Likewise.
2035 * friend.c (make_friend_class): Likewise.
2036 * name-lookup.c (pushdecl_maybe_friend_1): Likewise.
2038 2012-04-21 Jan Hubicka <jh@suse.cz>
2040 * method.c (make_alias_for): Do not set TREE_SYMBOL_REFERENCED.
2041 * decl2.c (mark_needed): Likewise.
2042 (decl_needed_p): Do not test TREE_SYMBOL_REFERENCED.
2044 * decl2.c (cxx_callgraph_analyze_expr): Remove.
2045 * cp-objcp-common.h (LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR): Remove.
2046 * cp-tree.h (cxx_callgraph_analyze_expr): Remove.
2048 2012-04-21 Manuel López-Ibåñez <manu@gcc.gnu.org>
2051 * typeck.c (cp_build_function_call_vec): Do not pretty-print
2052 expressions when caret is enabled.
2054 2012-04-20 Jan Hubicka <jh@suse.cz>
2057 * decl2.c (maybe_emit_vtables): Do not initialize same_comdat_group
2058 list when target has no support for it.
2060 2012-04-20 Michael Matz <matz@suse.de>
2062 * error.c (pedwarn_cxx98): Move va_end call after user
2065 2012-04-18 Paolo Carlini <paolo.carlini@oracle.com>
2068 * cp-tree.h (build_addr_func, decay_conversion,
2069 get_member_function_from_ptrfunc,
2070 build_m_component_ref, convert_member_func_to_ptr):
2071 Add tsubst_flags_t parameter.
2072 * typeck.c (cp_default_conversion): Add.
2073 (decay_conversion, default_conversion,
2074 get_member_function_from_ptrfunc, convert_member_func_to_ptr):
2075 Add tsubst_flags_t parameter and use it throughout.
2076 (cp_build_indirect_ref, cp_build_array_ref,
2077 cp_build_function_call_vec, convert_arguments, build_x_binary_op,
2078 cp_build_binary_op, cp_build_unary_op, build_reinterpret_cast_1,
2079 build_const_cast_1, expand_ptrmemfunc_cst,
2080 convert_for_initialization): Adjust.
2081 * init.c (build_vec_init): Adjust.
2082 * decl.c (grok_reference_init, get_atexit_node): Likewise.
2083 * rtti.c (build_dynamic_cast_1, tinfo_base_init): Likewise.
2084 * except.c (build_throw): Likewise.
2085 * typeck2.c (build_x_arrow): Likewise.
2086 (build_m_component_ref): Add tsubst_flags_t parameter and
2088 * pt.c (convert_nontype_argument): Adjust.
2089 * semantics.c (finish_asm_stmt, maybe_add_lambda_conv_op): Likewise.
2090 * decl2.c (build_offset_ref_call_from_tree): Likewise.
2091 * call.c (build_addr_func): Add tsubst_flags_t parameter and
2093 (build_call_a, build_conditional_expr_1, build_new_op_1,
2094 convert_like_real, convert_arg_to_ellipsis, build_over_call,
2095 build_special_member_call): Adjust.
2096 * cvt.c (cp_convert_to_pointer, force_rvalue,
2097 build_expr_type_conversion): Likewise.
2099 2012-04-17 Tom de Vries <tom@codesourcery.com>
2101 * cp-gimplify.c (begin_bc_block): Add location parameter and use as
2102 location argument to create_artificial_label.
2103 (finish_bc_block): Change return type to void. Remove body_seq
2104 parameter, and add block parameter. Append label to STMT_LIST and
2106 (gimplify_cp_loop, gimplify_for_stmt, gimplify_while_stmt)
2107 (gimplify_do_stmt, gimplify_switch_stmt): Remove function.
2108 (genericize_cp_loop, genericize_for_stmt, genericize_while_stmt)
2109 (genericize_do_stmt, genericize_switch_stmt, genericize_continue_stmt)
2110 (genericize_break_stmt, genericize_omp_for_stmt): New function.
2111 (cp_gimplify_omp_for): Remove bc_continue processing.
2112 (cp_gimplify_expr): Genericize VEC_INIT_EXPR.
2113 (cp_gimplify_expr): Mark FOR_STMT, WHILE_STMT, DO_STMT, SWITCH_STMT,
2114 CONTINUE_STMT, and BREAK_STMT as unreachable.
2115 (cp_genericize_r): Genericize FOR_STMT, WHILE_STMT, DO_STMT,
2116 SWITCH_STMT, CONTINUE_STMT, BREAK_STMT and OMP_FOR.
2117 (cp_genericize_tree): New function, factored out of ...
2118 (cp_genericize): ... this function.
2120 2012-04-17 Paolo Carlini <paolo.carlini@oracle.com>
2123 * semantics.c (build_constexpr_constructor_member_initializers):
2124 Check for function-try-block as function-body.
2126 2012-04-17 Paolo Carlini <paolo.carlini@oracle.com>
2129 * parser.c (cp_parser_member_declaration): Check that
2130 initializer_token_start is non null before dereferencing it.
2132 2012-04-16 Jason Merrill <jason@redhat.com>
2135 * pt.c (determine_specialization): Instead of comparing the number
2136 of parms, check that tsubst gives the right answer.
2139 * pt.c (process_partial_specialization): Complain about a partial
2140 specialization with fewer args than primary template parms.
2143 * pt.c (convert_template_argument): Handle template template
2147 * pt.c (tsubst_pack_expansion): Use tsubst_expr for template
2148 template parameters.
2150 2012-04-16 Paolo Carlini <paolo.carlini@oracle.com>
2153 * call.c (op_error): Print types; when flag_diagnostics_show_caret
2154 is false print expressions too.
2155 (op_error_string): Add.
2157 2012-04-16 Jason Merrill <jason@redhat.com>
2160 * friend.c (make_friend_class): Call check_for_bare_parameter_packs.
2162 2012-04-16 Jan Hubicka <jh@suse.cz>
2164 * decl2.c (collect_candidates_for_java_method_alias): Use FOR_EACH
2165 walkers to walk cgraph and varpool.
2167 2012-04-15 Jason Merrill <jason@redhat.com>
2170 * pt.c (coerce_template_parameter_pack): Check for error_mark_node.
2174 * pt.c (coerce_template_parms): Even if we aren't converting we
2175 want to expand argument packs.
2178 * mangle.c (write_type): nullptr_t is a builtin type.
2180 2012-04-14 Jan Hubicka <jh@suse.cz>
2182 * tree.c: Update field referenced for new cgraph/varpool layout.
2183 * decl2.c: Likewise.
2185 2012-04-13 Jason Merrill <jason@redhat.com>
2188 * pt.c (any_pack_expanson_args_p): New.
2189 (coerce_template_parms): Use it.
2192 * call.c (joust): Handle comparing list and non-list ctors.
2195 * decl2.c (finish_anon_union): Use cp_finish_decl.
2196 * error.c (dump_function_name): Avoid showing anonymous "name".
2198 2012-04-11 Fabien ChĂȘne <fabien@gcc.gnu.org>
2201 * parser.c (cp_parser_class_name): Call strip_using_decl and
2202 return the target decl.
2203 * name-lookup.c (strip_using_decl): Returns NULL_TREE if the decl
2204 to be stripped is NULL_TREE.
2205 (qualify_lookup): Call strip_using_decl and perform some checks on
2208 2012-04-11 Jason Merrill <jason@redhat.com>
2211 * decl.c (grokdeclarator): Strip the injected-class-name typedef
2212 if we are building a declaration or compound type.
2215 * decl.c (check_tag_decl): Don't complain about attributes if we
2216 don't even have a type.
2218 2012-04-10 Manuel López-Ibåñez <manu@gcc.gnu.org>
2220 * cvt.c (convert_to_void): Update comment.
2222 2012-04-05 Jason Merrill <jason@redhat.com>
2225 * semantics.c (finish_non_static_data_member): In templates, pass
2226 the decl to build_qualified_name.
2227 * tree.c (lvalue_kind) [SCOPE_REF]: Handle FIELD_DECL.
2229 2012-04-04 Jason Merrill <jason@redhat.com>
2232 * decl.c (finish_function): Update fntype after deducing return type.
2234 2012-04-03 Jason Merrill <jason@redhat.com>
2237 * pt.c (tsubst_initializer_list): A pack expansion with no elements
2238 means value-initialization.
2240 2012-04-01 Paolo Carlini <paolo.carlini@oracle.com>
2243 * class.c (deduce_noexcept_on_destructor,
2244 deduce_noexcept_on_destructors): New.
2245 (check_bases_and_members): Call the latter.
2246 * decl.c (grokfndecl): Call the former.
2247 * method.c (implicitly_declare_fn): Not static.
2248 * cp-tree.h (deduce_noexcept_on_destructor, implicitly_declare_fn):
2251 2012-03-29 Paolo Carlini <paolo.carlini@oracle.com>
2254 * decl.c (check_default_argument): With -Wzero-as-null-pointer-constant
2255 warn for a zero as null pointer constant default argument.
2257 2012-03-29 Jason Merrill <jason@redhat.com>
2260 * tree.c (copy_binfo): Handle BINFO_DEPENDENT_BASE_P.
2262 2012-03-29 Jakub Jelinek <jakub@redhat.com>
2265 * decl.c (start_decl): Don't call maybe_apply_pragma_weak
2266 if processing_template_decl.
2268 2012-03-29 Jason Merrill <jason@redhat.com>
2271 * call.c (compare_ics): Handle ck_aggr like ck_list.
2273 2012-03-28 Jason Merrill <jason@redhat.com>
2276 * typeck.c (lookup_destructor): Clear BASELINK_QUALIFIED_P if
2277 we didn't get an explicit scope.
2278 * pt.c (tsubst_baselink): Likewise.
2280 2012-03-28 Richard Guenther <rguenther@suse.de>
2282 * typeck2.c (process_init_constructor_array): Use the proper
2283 type for computing the array length.
2285 2012-03-27 Meador Inge <meadori@codesourcery.com>
2288 * semantics.c (cxx_fold_indirect_ref): Don't attempt to fold
2289 stripped child trees that are not pointer types.
2291 2012-03-21 Jason Merrill <jason@redhat.com>
2293 Implement return type deduction for normal functions with -std=c++1y.
2294 * cp-tree.h (FNDECL_USED_AUTO): New macro.
2295 (LAMBDA_EXPR_DEDUCE_RETURN_TYPE_P): Remove.
2296 (dependent_lambda_return_type_node): Remove.
2297 (CPTI_DEPENDENT_LAMBDA_RETURN_TYPE): Remove.
2298 (struct language_function): Add x_auto_return_pattern field.
2299 (current_function_auto_return_pattern): New.
2300 (enum tsubst_flags): Add tf_partial.
2301 * decl.c (decls_match): Handle auto return comparison.
2302 (duplicate_decls): Adjust error message for auto return.
2303 (cxx_init_decl_processing): Remove dependent_lambda_return_type_node.
2304 (cp_finish_decl): Don't do auto deduction for functions.
2305 (grokdeclarator): Allow auto return without trailing return type in
2307 (check_function_type): Defer checking of deduced return type.
2308 (start_preparsed_function): Set current_function_auto_return_pattern.
2309 (finish_function): Set deduced return type to void if not previously
2311 * decl2.c (change_return_type): Handle error_mark_node.
2312 (mark_used): Always instantiate functions with deduced return type.
2313 Complain about use if deduction isn't done.
2314 * parser.c (cp_parser_lambda_declarator_opt): Use 'auto' for
2315 initial return type.
2316 (cp_parser_lambda_body): Don't deduce return type in a template.
2317 (cp_parser_conversion_type_id): Allow auto in C++1y.
2318 * pt.c (instantiate_class_template_1): Don't mess with
2319 LAMBDA_EXPR_DEDUCE_RETURN_TYPE_P.
2320 (tsubst_copy_and_build): Likewise.
2321 (fn_type_unification, tsubst): Don't reduce the template parm level
2322 of 'auto' during deduction.
2323 (unify): Compare 'auto' specially.
2324 (get_bindings): Change test.
2325 (always_instantiate_p): Always instantiate functions with deduced
2327 (do_auto_deduction): Handle error_mark_node and lambda context.
2328 Don't check for use in initializer.
2329 (contains_auto_r): Remove.
2330 * search.c (lookup_conversions_r): Handle auto conversion function.
2331 * semantics.c (lambda_return_type): Handle null return. Don't mess
2332 with dependent_lambda_return_type_node.
2333 (apply_deduced_return_type): Rename from apply_lambda_return_type.
2334 * typeck.c (merge_types): Handle auto.
2335 (check_return_expr): Do auto deduction.
2336 * typeck2.c (add_exception_specifier): Fix complain check.
2338 2012-03-22 Paolo Carlini <paolo.carlini@oracle.com>
2341 * class.c (check_field_decls): Call literal_type_p only
2344 2012-03-22 Jakub Jelinek <jakub@redhat.com>
2347 * decl.c (check_tag_decl): Only use CLASSTYPE_TEMPLATE_INSTANTIATION
2348 on CLASS_TYPE_P types.
2350 2012-03-20 Jason Merrill <jason@redhat.com>
2352 * lex.c (init_reswords): Use >= for cxx_dialect test.
2353 * parser.c (cp_parser_exception_specification_opt): Likewise.
2355 * mangle.c (write_type): Handle 'auto'.
2356 * init.c (build_new): Don't do auto deduction where it might
2357 affect template mangling.
2360 * decl.c (reshape_init_class): Handle repeated reshaping.
2361 * search.c (lookup_field_1): Add sanity check.
2363 2012-03-19 Paolo Carlini <paolo.carlini@oracle.com>
2366 * cp-tree.h (xvalue_p, maybe_warn_about_useless_cast): Declare.
2367 * tree.c (xvalue_p): Define.
2368 * typeck.c (maybe_warn_about_useless_cast): Define.
2369 (build_reinterpret_cast, build_const_cast,
2370 build_static_cast, cp_build_c_cast): Use maybe_warn_about_useless_cast.
2371 * rtti.c (build_dynamic_cast): Likewise.
2372 * pt.c (tsubst_copy_and_build, case CAST_EXPR): Increment/decrement
2373 c_inhibit_evaluation_warnings before/after the build_* calls.
2375 2012-03-15 Jason Merrill <jason@redhat.com>
2378 * method.c (implicitly_declare_fn): Set DECL_EXTERNAL.
2380 2012-03-15 Manuel López-Ibåñez <manu@gcc.gnu.org>
2383 * error.c (print_instantiation_partial_context): Use
2384 template_backtrace_limit.
2386 2012-03-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2388 * Make-lang.in (doc/g++.1): Remove IRIX 6.5 reference.
2390 2012-03-14 Jakub Jelinek <jakub@redhat.com>
2393 * parser.c (lookup_literal_operator): Return fn only if
2394 processed all arguments from args vector and argtypes is
2397 2012-01-30 Dodji Seketeli <dodji@redhat.com>
2400 * cp-tree.h (template_type_parameter_p): Declare new function.
2401 (parameter_of_template_p): Remove.
2402 * pt.c (template_type_parameter_p): Define new function.
2403 (parameter_of_template_p): Remove.
2404 * name-lookup.c (binding_to_template_parms_of_scope_p): Don't rely
2405 on parameter_of_template_p anymore. Compare the level of the
2406 template parameter to the depth of the template.
2408 2011-12-15 Dodji Seketeli <dodji@redhat.com>
2410 * call.c (standard_conversion, build_integral_nontype_arg_conv)
2411 (build_new_op_1, convert_like_real, is_subseq)
2412 (maybe_handle_implicit_object, maybe_handle_ref_bind, compare_ics)
2413 (joust): Use next_conversion instead of accessing fields of struct
2414 conversion directly.
2416 2012-03-12 Paolo Carlini <paolo.carlini@oracle.com>
2419 * pt.c (tsubst_copy_and_build, case COND_EXPR): Avoid bogus
2420 division by zero warnings.
2422 2012-03-08 Paolo Carlini <paolo.carlini@oracle.com>
2424 * typeck.c (build_array_ref, cp_build_addr_expr_1, convert_ptrmem,
2425 build_ptrmemfunc): Consistently forward the tsubst_flags_t
2427 * call.c (resolve_args): Likewise.
2429 2012-03-07 Jason Merrill <jason@redhat.com>
2432 * mangle.c (write_literal_operator_name): The length comes after the
2435 2012-03-05 Jakub Jelinek <jakub@redhat.com>
2437 * pt.c (local_specializations): Change from htab_t into
2438 struct pointer_map_t *.
2439 (retrieve_local_specializations, register_local_specialization,
2440 tsubst_pack_expansion, instantiate_decl): Adjust users.
2441 (eq_local_specializations, hash_local_specialization): Remove.
2443 2012-03-05 Jason Merrill <jason@redhat.com>
2446 * decl2.c (determine_visibility): Correct calculation of class
2448 * decl.c (check_tag_decl): Adjust warning.
2450 * method.c (synthesized_method_walk): Cleanups don't affect the EH
2453 2012-03-03 Jason Merrill <jason@redhat.com>
2455 * init.c (perform_member_init): Cope with uninstantiated NSDMI.
2458 * call.c (build_aggr_conv): Call reshape_init.
2459 (convert_like_real): Likewise.
2460 * typeck2.c (process_init_constructor): Clear TREE_CONSTANT if
2463 * mangle.c (write_nested_name): Use decl_mangling_context.
2464 (write_prefix, write_template_prefix): Likewise.
2467 * mangle.c (write_expression): Improve diagnostic for TRAIT_EXPR.
2469 * class.c (add_method): Always build an OVERLOAD for using-decls.
2470 * search.c (lookup_member): Handle getting an OVERLOAD for a
2473 2012-03-02 Paolo Carlini <paolo.carlini@oracle.com>
2476 * typeck2.c (build_x_arrow): Take a tsubst_flags_t argument and
2478 * cp-tree.h (build_x_arrow): Adjust prototype.
2479 * pt.c (tsubst_copy_and_build): Adjust call.
2480 * parser.c (cp_parser_postfix_dot_deref_expression): Likewise.
2482 2012-03-02 Paolo Carlini <paolo.carlini@oracle.com>
2484 * name-lookup.c (binding_to_template_parms_of_scope_p): Clean up.
2486 2012-02-29 Jason Merrill <jason@redhat.com>
2489 * decl.c (check_tag_decl): Move warning for misplaced attributes here.
2490 (shadow_tag): From here.
2491 * parser.c (cp_parser_explicit_instantiation): Don't warn here.
2493 2012-02-21 Jakub Jelinek <jakub@redhat.com>
2496 * typeck.c (check_literal_operator_args): Initialize *long_double_p
2497 and *long_long_unsigned_p even if processing_template_decl.
2499 2012-02-16 Jason Merrill <jason@redhat.com>
2502 * decl.c (define_label): Use timevar_cond_start/stop.
2504 2012-02-16 Fabien ChĂȘne <fabien@gcc.gnu.org>
2507 * decl.c (xref_basetypes): call dependent_scope_p instead of
2510 2012-02-16 Jason Merrill <jason@redhat.com>
2513 * error.c (dump_expr): Handle lambda closures specifically.
2515 2012-02-14 Jason Merrill <jason@redhat.com>
2517 * parser.c (cp_parser_explicit_instantiation): Give a warning
2518 for ignored attributes on explicit class instantiation.
2520 2012-02-14 Jakub Jelinek <jakub@redhat.com>
2523 * pt.c (tsubst_copy_asm_operands): For LABEL_DECL values call
2524 lookup_label on label's name and set TREE_USED.
2526 2012-02-14 Jason Merrill <jason@redhat.com>
2529 * decl.c (local_variable_p_walkfn): Don't check DECL_ARTIFICIAL.
2531 2012-02-14 Jakub Jelinek <jakub@redhat.com>
2534 * decl.c (duplicate_decls): If olddecl has bigger DECL_ALIGN than
2535 newdecl, copy DECL_ALIGN to newdecl and or DECL_USER_ALIGN bits.
2537 2012-02-07 Jason Merrill <jason@redhat.com>
2540 * semantics.c (cx_check_missing_mem_inits): Handle unions.
2541 Fix constexpr default constructor logic.
2544 * pt.c (tsubst): Strip uninstantiated typedef.
2546 2012-02-06 Jason Merrill <jason@redhat.com>
2549 * cvt.c (build_expr_type_conversion): Check for template conversion.
2551 2012-01-31 Jason Merrill <jason@redhat.com>
2554 * cp-tree.h (PACK_EXPANSION_LOCAL_P): New.
2555 * pt.c (make_pack_expansion, tsubst_initializer_list): Set it.
2556 (tsubst_pack_expansion): Check it.
2558 2012-01-29 Paolo Carlini <paolo.carlini@oracle.com>
2561 * class.c (explain_non_literal_class): Correctly handle implicitly
2562 deleted constructors.
2564 2012-01-27 Jakub Jelinek <jakub@redhat.com>
2567 * pt.c (tsubst_pack_expansion): Delete and restore
2568 local_specialization whenever need_local_specialization, not just
2569 when saved_local_specializations is non-NULL.
2571 2012-01-26 Paolo Carlini <paolo.carlini@oracle.com>
2574 * error.c (dump_decl, [TEMPLATE_ID_EXPR]): Handle error_mark_node
2575 as TREE_OPERAND (t, 1).
2577 2012-01-24 Jason Merrill <jason@redhat.com>
2580 * decl.c (xref_basetypes): Check VEC_length instead of VEC_space.
2583 * tree.c (called_fns_equal): Check template args.
2584 (cp_tree_equal): Call it.
2586 2012-01-24 Aldy Hernandez <aldyh@redhat.com>
2587 Patrick Marlier <patrick.marlier@gmail.com>
2590 * class.c (set_method_tm_attributes): Use TARGET_THUNK instead of
2591 thunk for set_one_vmethod_tm_attributes.
2593 2012-01-24 Paolo Carlini <paolo.carlini@oracle.com>
2596 * call.c (build_over_call): Check for error_mark_node as
2597 TREE_VALUE when default arguments are processed.
2599 2012-01-23 Jason Merrill <jason@redhat.com>
2602 * decl2.c (determine_visibility): Check for visibility attribute
2603 on template specialization.
2605 2012-01-23 Paolo Carlini <paolo.carlini@oracle.com>
2608 * pt.c (parameter_of_template_p): Skip error_mark_node parameters.
2610 2012-01-23 Jason Merrill <jason@redhat.com>
2613 * class.c (add_method): Set OVL_USED for using-decls.
2614 * tree.c (ovl_scope): New.
2615 * cp-tree.h: Declare it.
2616 * parser.c (cp_parser_template_name): Use it.
2617 * semantics.c (baselink_for_fns): Likewise.
2618 * name-lookup.c (set_inherited_value_binding_p): Likewise.
2620 2012-01-20 Paolo Carlini <paolo.carlini@oracle.com>
2623 * pt.c (lookup_template_class_1): Check context returned by
2624 tsubst for error_mark_node.
2626 2012-01-19 Kai Tietz <ktietz@redhat.com>
2629 * decl2.c (save_template_attributes): Use merge_attributes
2630 instead of chaining up via TREE_CHAIN.
2632 2012-01-19 Jason Merrill <jason@redhat.com>
2635 * class.c (finish_struct): Call add_method here for function usings.
2636 * semantics.c (finish_member_declaration): Not here.
2638 2012-01-18 Paolo Carlini <paolo.carlini@oracle.com>
2641 * typeck2.c (store_init_value): Within a template guard
2642 cxx_constant_value with require_potential_constant_expression.
2643 * pt.c (convert_nontype_argument): Likewise.
2645 2012-01-16 Jakub Jelinek <jakub@redhat.com>
2648 * mangle.c (write_template_arg_literal): Handle complex.
2650 2012-01-16 Jason Merrill <jason@redhat.com>
2653 * mangle.c (mangle_decl): Don't mangle uninstantiated templates.
2656 * typeck.c (build_static_cast_1): Handle bit-fields properly.
2658 2012-01-13 Ian Lance Taylor <iant@google.com>
2661 * typeck.c (enum_cast_to_int): New static function.
2662 (cp_build_binary_op): When handling warn_sign_compare, don't test
2663 for TREE_NO_WARNING. Do call enum_cast_to_int.
2664 * call.c (avoid_sign_compare_warnings): Remove static function.
2665 (build_new_op_1): Don't call avoid_sign_compare_warnings.
2667 2012-01-13 Steven Bosscher <steven@gcc.gnu.org>
2669 * decl2.c: Do not include tree-mudflap.h
2670 * semantics.c: Likewise.
2672 2012-01-13 Jason Merrill <jason@redhat.com>
2675 * semantics.c (finish_break_stmt): Avoid adding an unreachable
2679 * decl2.c (constrain_visibility): Clear DECL_VISIBILITY_SPECIFIED
2680 when reducing the visibility.
2683 * class.c (build_vtbl_initializer): Use __cxa_deleted_virtual.
2685 2012-01-12 Jason Merrill <jason@redhat.com>
2688 * pt.c (value_dependent_expression_p): Treat STMT_EXPR as
2691 2012-01-13 Dodji Seketeli <dodji@redhat.com>
2694 * semantics.c (cp_parser_ctor_initializer_opt_and_function_body):
2695 Set the pointer to the last block of the constructor to the
2697 (build_constexpr_constructor_member_initializers): Get
2698 build_data_member_initialization a chance to deal with more
2699 statements before we choke.
2701 2012-01-12 Jason Merrill <jason@redhat.com>
2704 * mangle.c (write_expression): Mangle BASELINK scope if
2705 BASELINK_QUALIFIED_P.
2706 * search.c (adjust_result_of_qualified_name_lookup): Set
2707 BASELINK_QUALIFIED_P.
2708 * tree.c (cp_tree_equal) [BASELINK]: Compare BASELINK_QUALIFIED_P.
2709 * parser.c (cp_parser_postfix_dot_deref_expression): Don't call
2710 adjust_result_of_qualified_name_lookup for non-qualified names.
2713 * pt.c (unify): Handle error_mark_node.
2715 2012-01-11 Jason Merrill <jason@redhat.com>
2718 * call.c (standard_conversion): For ptrmemfuncs, compare the
2722 * mangle.c (find_substitution): A type is only a substitution
2723 match if we're looking for a type.
2724 (write_nested_name): Use decl_mangling_context.
2726 * decl.c (decls_match): Assert that the arguments are decls.
2729 * pt.c (resolve_overloaded_unification): Compare types with
2730 same_type_p, not decls_match.
2732 2012-01-10 Jason Merrill <jason@redhat.com>
2735 * class.c (build_base_path): Diagnose ambiguous base.
2738 * semantics.c (cxx_eval_call_expression): Always retry previously
2739 non-constant expressions.
2741 2012-01-06 Jason Merrill <jason@redhat.com>
2745 * parser.c (cp_parser_new_expression): Set
2746 type_definition_forbidden_message.
2752 * mangle.c (write_expression): Support NEW_EXPR, DELETE_EXPR,
2753 THROW_EXPR, CONSTRUCTOR, OVERLOAD. Fix PREINCREMENT_EXPR and
2755 (write_template_arg): Fix mangling of class-scope functions and
2757 (mangle_decl): Update suggested -fabi-version argument.
2758 * operators.def: Add DOTSTAR_EXPR, REINTERPRET_CAST_EXPR,
2759 DYNAMIC_CAST_EXPR; correct CONST_CAST_EXPR, STATIC_CAST_EXPR.
2760 * tree.c (dependent_name): No longer static.
2761 * cp-tree.h: Declare it.
2762 * pt.c (unify): Defer handling of unconverted functions.
2764 * mangle.c (mangle_decl): Don't generate mangling aliases
2765 for maybe-in-charge [cd]tors.
2767 * error.c (dump_expr): Print type of CONSTRUCTOR.
2769 2012-01-05 Dodji Seketeli <dodji@redhat.com>
2772 * parser.c (cp_parser_alias_declaration): Get out early upon
2773 errors in the identifier or the attributes.
2775 2012-01-04 Paolo Carlini <paolo.carlini@oracle.com>
2778 * pt.c (tsubst_copy_and_build): Maybe set TREE_NO_WARNING on
2779 the tree returned by build_x_binary_op.
2781 2012-01-03 Paolo Carlini <paolo.carlini@oracle.com>
2784 * parser.c (cp_parser_postfix_open_square_expression): Handle
2785 postfix-expression [ braced-init-list ].
2787 2012-01-03 Paolo Carlini <paolo.carlini@oracle.com>
2790 * rtti.c (build_dynamic_cast_1): In case of T a pointer type,
2791 call decay_conversion on v.
2793 2012-01-03 Paolo Carlini <paolo.carlini@oracle.com>
2796 * decl.c (duplicate_decls): With -Wredundant-decls don't warn for
2797 declaration followed by specialization.
2799 2012-01-03 Jakub Jelinek <jakub@redhat.com>
2802 * semantics.c (finish_omp_clauses): Call fold_build_cleanup_point_expr
2803 on OMP_CLAUSE_{IF,FINAL,NUM_THREADS,SCHEDULE_CHUNK}_EXPR.
2805 2012-01-02 Jason Merrill <jason@redhat.com>
2809 * method.c (walk_field_subobs): Don't check for uninitialized
2811 (synthesized_method_walk): Check here.
2815 * parser.c (cp_parser_cache_defarg): Split out...
2816 (cp_parser_parameter_declaration): ...from here.
2817 (cp_parser_save_nsdmi): Use it.
2818 (cp_parser_cache_group): Remove CPP_COMMA support.
2820 2012-01-02 Dodji Seketeli <dodji@redhat.com>
2823 * semantics.c (cx_check_missing_mem_inits): Don't assert in case
2826 2012-01-02 Paolo Carlini <paolo.carlini@oracle.com>
2829 * typeck2.c (digest_init_r): Use copy_init when initializing
2832 2012-01-01 Paolo Carlini <paolo.carlini@oracle.com>
2835 * decl.c (build_enumerator): Don't call perform_integral_promotions
2838 2012-01-01 Paolo Carlini <paolo.carlini@oracle.com>
2841 * typeck.c (build_reinterpret_cast_1): Implement resolution of
2844 2012-01-01 Fabien ChĂȘne <fabien@gcc.gnu.org>
2846 * parser.c (cp_parser_using_declaration): Add a warning about
2847 deprecated access declarations when no errors were encountered
2848 while parsing the access declaration. Save the first token in
2849 order to emit the warning at the right place.
2851 Copyright (C) 2012 Free Software Foundation, Inc.
2853 Copying and distribution of this file, with or without modification,
2854 are permitted in any medium without royalty provided the copyright
2855 notice and this notice are preserved.