1 2012-12-06 Jason Merrill <jason@redhat.com>
4 * parser.c (cp_parser_class_head): A partial specialization scope
6 * pt.c (tsubst_template_parms): Handle template template parm parms.
7 (tsubst_decl) [TEMPLATE_DECL]: Handle getting a template template
11 * pt.c (unify) [ARRAY_TYPE]: Unify the element type before the bounds.
13 2012-12-03 Paolo Carlini <paolo.carlini@oracle.com>
16 * cvt.c (cp_convert_to_pointer): Don't discard side-effects from
17 expressions of nullptr_t.
18 * typeck.c (build_ptrmemfunc): Likewise.
20 2012-12-01 Jakub Jelinek <jakub@redhat.com>
23 * pt.c (make_ith_pack_parameter_name): Return NULL if
25 (tsubst_decl): Call make_ith_pack_parameter_name even if
28 2012-11-29 Jason Merrill <jason@redhat.com>
31 * pt.c (tsubst_expr) [DECL_EXPR]: Set LAMBDA_EXPR_THIS_CAPTURE here.
32 (tsubst_copy_and_build) [LAMBDA_EXPR]: And clear it here.
33 (instantiate_class_template_1): Not here.
35 2012-11-29 Marc Glisse <marc.glisse@inria.fr>
38 * cvt.c (ocp_convert): Call convert_to_vector.
40 2012-11-29 Kai Tietz <ktietz@redhat.com>
43 * class.c (dump_class_hierarchy_r): Cast from pointer via uintptr_t.
44 (dump_vtable): Likewise.
46 2012-11-29 Ed Smith-Rowland <3dw4rd@verizon.net>
49 * parser.c (cp_parser_string_literal): Add overflow_type arg.
50 (cp_parser_userdef_numeric_literal): Warn on numeric overflow.
52 2012-11-28 Andrew Pinski <apinski@cavium.com>
55 * Make-lang.in (g++$(exeext)): Rename to
56 (xg++$(exeext)): This.
57 (g++-cross$(exeext)): Use xg++$(exeext) instead of g++$(exeext).
58 (c++.start.encap): Likewise.
59 (c++.install-common): Likewise.
61 2012-11-24 Paolo Carlini <paolo.carlini@oracle.com>
64 * init.c (build_vec_init): Do not early return error_mark_mode
65 when integer_all_onesp (maxindex).
67 2012-11-23 Jakub Jelinek <jakub@redhat.com>
70 * cp-objcp-common.h (LANG_HOOKS_BLOCK_MAY_FALLTHRU): Redefine.
71 * cp-objcp-common.c (cxx_block_may_fallthru): New function.
72 * cp-tree.h (cxx_block_may_fallthru): New prototype.
74 2012-11-23 Markus Trippelsdorf <markus@trippelsdorf.de>
77 * method.c (implicitly_declare_fn): Properly initialize trivial_p.
79 2012-11-22 Jason Merrill <jason@redhat.com>
82 * semantics.c (verify_constant): Track overflow separately.
83 (reduced_constant_expression_p): Don't check it here.
84 (cxx_eval_constant_expression): Check it on CSTs.
85 (cxx_eval_outermost_constant_expr): Treat overflows as non-constant
86 at this point, but still return the folded version.
87 (potential_constant_expression_1): Don't check overflow.
89 * call.c (extend_ref_init_temps_1): Recompute TREE_CONSTANT for
92 2012-11-20 Diego Novillo <dnovillo@google.com>
93 Jakub Jelinek <jakub@redhat.com>
95 * name-lookup.c: Replace all vec<T, A>() initializers
97 * semantics.c: Likewise.
99 2012-11-19 Paolo Carlini <paolo.carlini@oracle.com>
102 * parser.c (cp_parser_member_declaration): Emit an error in case
103 of stray comma at end of member declaration.
105 2012-11-19 Jason Merrill <jason@redhat.com>
107 * class.c (one_inheriting_sig): Don't inherit base copy ctors.
110 * method.c (implicitly_declare_fn): Set DECL_PARM_INDEX on
111 the parms of an inheriting ctor.
114 * class.c (add_implicitly_declared_members): Use
115 lookup_fnfields_slot to get the base constructors.
117 2012-11-19 Jakub Jelinek <jakub@redhat.com>
120 * class.c (fixed_type_or_null_ref_ht): New variable.
121 (fixed_type_or_null): Use it instead of local static ht.
123 2012-11-17 Diego Novillo <dnovillo@google.com>
125 Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec)
127 * Make-lang.in: Remove dependencies on vecir.h and vecprim.h everywhere.
128 * call.c: Use new vec API in vec.h.
130 * cp-gimplify.c: Likewise.
131 * cp-tree.h: Likewise.
136 * except.c: Likewise.
138 * mangle.c: Likewise.
139 * method.c: Likewise.
140 * name-lookup.c: Likewise.
141 * name-lookup.h: Likewise.
142 * parser.c: Likewise.
143 * parser.h: Likewise.
147 * search.c: Likewise.
148 * semantics.c: Likewise.
150 * typeck.c: Likewise.
151 * typeck2.c: Likewise.
153 2012-11-17 Gabriel Dos Reis <gdr@integrable-solutions.net>
155 * semantics.c (finish_id_expression): Tidy diagnostic message.
157 2012-11-16 Dodji Seketeli <dodji@redhat.com>
160 * pt.c (lookup_template_class_1): Look at the type of the
161 potential member enum of class template to determine if we are
162 actually substituting into a member enum of class template.
164 2012-11-16 Jakub Jelinek <jakub@redhat.com>
167 * tree.c (cp_tree_equal) <case ALIGNOF_EXPR>: Use SIZEOF_EXPR_TYPE_P
170 2012-11-14 Jason Merrill <jason@redhat.com>
173 * decl2.c (mark_used): Don't complain about auto in templates.
176 * decl.c (decls_match): Remove #ifdef around earlier fix.
178 2012-11-13 Jason Merrill <jason@redhat.com>
180 * class.c (finish_struct_1): Check virtual functions
181 for missing ABI tags.
184 * pt.c (maybe_process_partial_specialization): Update
185 DECL_SOURCE_LOCATION for new specializations.
187 2012-11-14 Paolo Carlini <paolo.carlini@oracle.com>
190 * init.c (emit_mem_initializers): Skip arguments == error_mark_node.
192 2012-11-14 Fabien ChĂȘne <fabien@gcc.gnu.org>
195 * call.c (build_new_method_call_1): Check that the instance type
196 and the function context are the same before setting the flag
199 2012-11-13 Sriraman Tallam <tmsriram@google.com>
201 * class.c (mark_versions_used): Remove.
202 (resolve_address_of_overloaded_function): Call target hook
203 for versioned functions. Refactor to call
204 get_function_versions_dispatcher.
205 * decl.c (duplicate_decls): Add comments.
206 * cp/call.c (get_function_version_dispatcher): Expose function.
207 (mark_versions_used): Expose function.
208 * cp/cp-tree.h (mark_versions_used): New declaration.
209 (get_function_version_dispatcher): Ditto.
211 2012-11-13 Dodji Seketeli <dodji@redhat.com>
214 * pt.c (lookup_template_class_1): TYPE_STUB_DECL should be
215 accessed on the main variant of the type.
217 2012-11-12 Ed Smith-Rowland <3dw4rd@verizon.net>
219 * parser.c (cp_parser_objc_class_ivars):
220 Index declspecs.locations by ds_typedef rather than ds_thread.
222 2012-11-09 Ed Smith-Rowland <3dw4rd@verizon.net>
225 * decl.c (grokfndecl): Adjust calls to interpret_x_suffix.
227 2012-11-09 Jason Merrill <jason@redhat.com>
230 * pt.c (check_instantiated_arg): Don't complain about dependent args.
232 * tree.c (cxx_attribute_table): Add abi_tag attribute.
233 (check_abi_tag_redeclaration, handle_abi_tag_attribute): New.
234 * class.c (find_abi_tags_r, check_abi_tags): New.
235 (check_bases, check_field_decl): Call check_abi_tags.
236 * decl.c (redeclaration_error_message): Call
237 check_abi_tag_redeclaration.
238 * mangle.c (tree_string_cmp, write_abi_tags): New.
239 (write_unqualified_name): Call write_abi_tags.
241 2012-11-07 Paolo Carlini <paolo.carlini@oracle.com>
245 2012-10-23 Paolo Carlini <paolo.carlini@oracle.com>
248 * semantics.c (cx_check_missing_mem_inits): Handle anonymous union
251 2012-11-07 Florian Weimer <fweimer@redhat.com>
253 * init.c (build_new_1): Do not check for arithmetic overflow if
254 inner array size is 1.
256 2012-11-05 Sriraman Tallam <tmsriram@google.com>
258 * class.c (add_method): Change assembler names of function versions.
259 (mark_versions_used): New static function.
260 (resolve_address_of_overloaded_function): Create dispatcher decl and
261 return address of dispatcher instead.
262 * decl.c (decls_match): Make decls unmatched for versioned
264 (duplicate_decls): Remove ambiguity for versioned functions.
265 Delete versioned function data for merged decls.
266 * decl2.c (check_classfn): Check attributes of versioned functions
268 * call.c (get_function_version_dispatcher): New function.
269 (mark_versions_used): New static function.
270 (build_over_call): Make calls to multiversioned functions
271 to call the dispatcher.
272 (joust): For calls to multi-versioned functions, make the most
273 specialized function version win.
275 2012-10-31 Lawrence Crowl <crowl@google.com>
277 * decl2.c (var_finalized_p): Rename varpool_node to
278 varpool_node_for_decl.
279 (maybe_emit_vtables): Likewise.
281 2012-10-31 Paolo Carlini <paolo.carlini@oracle.com>
284 * tree.c (build_cplus_array_type): Set TREE_NO_WARNING on the
287 2012-10-31 Dodji Seketeli <dodji@redhat.com>
290 * parser.c (cp_nth_tokens_can_be_std_attribute_p): Recognize the
291 'Alignas' keyword as the beginning of a c++11 attribute specifier.
292 Update the comment of the function.
293 (cp_next_tokens_can_be_gnu_attribute_p): Update the comment of the
296 2012-10-29 Jonathan Wakely <jwakely.gcc@gmail.com>
299 * typeck.c (maybe_warn_about_returning_address_of_local): Use
300 OPT_Wreturn_local_addr.
302 2012-10-26 Jakub Jelinek <jakub@redhat.com>
305 * typeck2.c (store_init_value): Call fold_non_dependent_expr
306 and maybe_constant_init even for C++98.
308 2012-10-26 Paolo Carlini <paolo.carlini@oracle.com>
311 * init.c (build_new): Don't turn a null *init into a pointer to
312 empty vector orig_init.
314 2012-10-25 Paolo Carlini <paolo.carlini@oracle.com>
317 * class.c (finish_struct_1): Reject aggregates decorated with
318 __transparent_union__ which cannot be made transparent because
319 the type of the first field has a different ABI from the class
322 2012-10-25 Jason Merrill <jason@redhat.com>
325 * call.c (joust): An implicitly deleted move function is
326 worse than any non-deleted function.
327 * method.c (process_subob_fn): No special rules for move.
328 (synthesized_method_walk, implicitly_declare_fn): Likewise.
329 Warn about virtual base with non-trivial move assignment.
330 * cp-tree.h (struct lang_decl_fn): Remove suppress_implicit_decl.
331 (FNDECL_SUPPRESS_IMPLICIT_DECL): Remove.
333 * semantics.c (finish_omp_threadprivate): Call complete_type.
335 * class.c (one_inherited_ctor): Warn about variadic inherited ctor.
337 2012-10-25 Marc Glisse <marc.glisse@inria.fr>
340 * typeck.c (build_x_conditional_expr): Handle VEC_COND_EXPR.
341 * call.c (build_conditional_expr_1): Likewise.
343 2012-10-25 Paolo Carlini <paolo.carlini@oracle.com>
346 * parser.c (cp_parser_template_parameter): When
347 cp_parser_parameter_declaration parsed a default argument don't
348 see if *is_parameter_pack needs setting.
350 2012-10-23 Paolo Carlini <paolo.carlini@oracle.com>
353 * semantics.c (cx_check_missing_mem_inits): Handle anonymous union
356 2012-10-23 Jakub Jelinek <jakub@redhat.com>
359 * pt.c (tsubst_copy, tsubst_copy_and_build) <case SIZEOF_EXPR>: Use
360 tsubst instead of tsubst_copy* on types.
363 * decl2.c (cplus_decl_attributes): Don't return early
364 if attributes is NULL.
366 2012-10-18 Paolo Carlini <paolo.carlini@oracle.com>
369 * decl.c (reshape_init_array_1): Avoid infinite loops.
371 2012-10-15 Alexandre Oliva <aoliva@redhat.com>
372 Paolo Carlini <paolo.carlini@oracle.com>
375 * call.c (build_new_op_1): Filter out operator functions that don't
376 satisfy enum-conversion match requirements.
378 2012-10-15 Paolo Carlini <paolo.carlini@oracle.com>
381 * parser.c (cp_parser_optional_template_keyword): When -pedantic
382 and C++98 mode restore pre-Core/468 behavior.
384 2012-10-15 Paolo Carlini <paolo.carlini@oracle.com>
387 * parser.c (cp_parser_optional_template_keyword): Implement
388 Core/468, allow outside template.
390 2012-10-14 Jason Merrill <jason@redhat.com>
391 Ville Voutilainen <ville.voutilainen@gmail.com>
393 Implement C++11 inheriting constructors.
394 * cp-tree.h (cpp0x_warn_str): Add CPP0X_INHERITING_CTORS.
395 (DECL_INHERITED_CTOR_BASE, SET_DECL_INHERITED_CTOR_BASE): New.
396 (special_function_kind): Add sfk_inheriting_constructor.
397 * class.c (add_method): An inheriting ctor is hidden by a
399 (one_inheriting_sig, one_inherited_ctor): New.
400 (add_implicitly_declared_members): Handle inheriting ctors.
401 * error.c (maybe_warn_cpp0x): Handle CPP0X_INHERITING_CTORS.
402 * init.c (emit_mem_initializers): Don't set LOOKUP_DEFAULTED
403 for an inheriting constructor.
404 * method.c (type_has_trivial_fn): Handle sfk_inheriting_constructor.
405 (type_set_nontrivial_flag): Likewise.
406 (add_one_base_init): Split out from...
407 (do_build_copy_constructor): ...here. Handle inheriting constructors.
408 (locate_fn_flags): Handle a list of arg types.
409 (synthesized_method_walk): Handle inheriting constructors.
410 (maybe_explain_implicit_delete): Likewise.
411 (deduce_inheriting_ctor): New.
412 (implicitly_declare_fn): Handle inheriting constructors.
413 * name-lookup.c (push_class_level_binding_1): An inheriting constructor
414 does not declare the base's name.
415 (do_class_using_decl): Allow inheriting constructors.
416 * pt.c (template_parms_to_args): Split from current_template_args.
417 (add_inherited_template_parms): New.
418 (tsubst_decl): Handle inheriting constructors.
419 * tree.c (special_function_p): Handle inheriting constructors.
421 2012-10-12 Jakub Jelinek <jakub@redhat.com>
424 * semantics.c (finish_call_expr): Pass array of 3 sizeof_arg
425 trees and locs (corresponding to first 3 arguments) to
426 sizeof_pointer_memaccess_warning.
428 2012-10-12 Paolo Carlini <paolo.carlini@oracle.com>
431 * decl.c (grokfndecl): When checking for ::main declarations
432 use PROCESSING_REAL_TEMPLATE_DECL_P().
434 2012-10-12 Marc Glisse <marc.glisse@inria.fr>
437 * call.c (build_new_op_1): Pass RO_ARROW_STAR to cp_build_indirect_ref.
438 * typeck.c (cp_build_indirect_ref): Handle RO_ARROW_STAR.
440 2012-10-11 Jason Merrill <jason@redhat.com>
442 * cp-tree.h (DECL_THUNKS): NULL_TREE for non-virtual functions.
443 (SET_DECL_THUNKS): New.
444 * decl.c (duplicate_decls): Adjust.
445 * method.c (make_thunk): Adjust.
447 * decl.c (grokdeclarator): Set DECL_GNU_TLS_P for static data
450 2012-10-09 Dodji Seketeli <dodji@redhat.com>
452 PR c++/53540 - using fails to be equivalent to typedef
453 * cp-tree.h (TYPE_TEMPLATE_INFO): For an alias that is not an
454 instance of alias template, don't look for its TEMPLATE_INFO in
456 (alias_template_specialization_p): Take const_tree.
457 * pt.c (alias_template_specialization_p): Take a const_tree.
458 Don't call primary_template_instantiation_p.
459 (primary_template_instantiation_p): Call
460 alias_template_specialization_p.
462 2012-10-10 Dodji Seketeli <dodji@redhat.com>
464 * parser (cp_parser_statement): Parse c++11 attributes
466 (cp_parser_std_attribute_spec_seq): Do not warn too early about
467 using c++11 attributes in non c++11 mode.
469 2012-10-10 Dehao Chen <dehao@google.com>
471 * cp-gimplify.c (cp_genericize_r): Set location for TRY expr.
473 2012-10-09 Lawrence Crowl <crowl@google.com>
475 * Make-lang.in (class.o): Add dependence on hash-table.h.
477 (semantics.o): Likewise.
478 * class.c (fixed_type_or_null): Change to new type-safe hash table.
479 * tree.c (verify_stmt_tree): Likewise.
480 (verify_stmt_tree_r): Likewise.
481 * semantics.c (struct nrv_data): Likewise.
483 2012-10-09 Paolo Carlini <paolo.carlini@oracle.com>
486 * typeck.c (build_x_binary_op): Update warn_about_parentheses call.
487 * parser.c (cp_parser_binary_expression): Use SET_EXPR_LOCATION
490 2012-10-09 Marc Glisse <marc.glisse@inria.fr>
493 * typeck.c (cp_build_binary_op): Handle mixed scalar-vector
495 [LSHIFT_EXPR, RSHIFT_EXPR]: Likewise.
497 2012-10-08 Jakub Jelinek <jakub@redhat.com>
500 * tree.c (cp_tree_equal): Handle FIELD_DECL.
502 2012-10-08 Jason Merrill <jason@redhat.com>
504 Allow dynamic initialization of thread_locals.
505 * decl.c: Define tls_aggregates.
506 (expand_static_init): Remove sorry. Add to tls_aggregates.
507 * cp-tree.h: Declare tls_aggregates.
508 * call.c (set_up_extended_ref_temp): Add to tls_aggregates.
509 * decl2.c (var_needs_tls_wrapper): New.
510 (var_defined_without_dynamic_init): New.
511 (get_tls_init_fn, get_tls_wrapper_fn): New.
512 (generate_tls_wrapper, handle_tls_init): New.
513 (cp_write_global_declarations): Call handle_tls_init and
515 * mangle.c (write_guarded_var_name): Split out from..
516 (mangle_guard_variable): ...here.
517 (mangle_tls_init_fn, mangle_tls_wrapper_fn): Use it.
518 (decl_tls_wrapper_p): New.
519 * semantics.c (finish_id_expression): Replace use of thread_local
520 variable with a call to its wrapper.
522 * decl.c (get_thread_atexit_node): New.
523 (register_dtor_fn): Use it for TLS.
525 Partial implementation of C++11 thread_local.
526 * decl.c (cp_finish_decl): Remove errors about non-trivial
527 initialization and destruction of TLS variables.
528 (register_dtor_fn): Add sorry about TLS variables.
529 (expand_static_init): Add sorry about non-local TLS variables,
530 or error with __thread.
531 Don't emit thread-safety guards for local TLS variables.
532 (grokdeclarator): thread_local in a function implies static.
533 * decl.h: Adjust prototype.
534 * decl2.c (get_guard): Copy DECL_TLS_MODEL.
535 * parser.c (cp_parser_set_storage_class, cp_parser_set_decl_spec_type)
536 (set_and_check_decl_spec_loc): Take the token rather than the location.
537 Distinguish between __thread and thread_local.
538 (cp_parser_set_storage_class): Don't complain about thread_local before
540 (token_is__thread): New.
541 * call.c (make_temporary_var_for_ref_to_temp): Handle TLS.
542 * cp-tree.h (DECL_GNU_TLS_P): New.
543 (cp_decl_specifier_seq): Add gnu_thread_keyword_p.
545 2012-10-08 Dodji Seketeli <dodji@redhat.com>
547 PR c++/53528 C++11 attribute support
548 * cp-tree.h (enum cpp0x_warn_str::CPP0X_ATTRIBUTES): New member.
549 (enum cp_decl_spec::ds_std_attribute): New enumerator.
550 (struct cp_decl_specifier_seq::std_attributes): New field.
551 (cxx_alignas_expr, warn_misplaced_attr_for_class_type): Declare
553 (check_tag_decl): Take an extra parameter for explicit
555 * decl.c (warn_misplaced_attr_for_class_type): Extract from ...
556 (check_tag_decl): ... here. Add check for c++11 attributes being
557 applied to an explicit instantiation. Take an extra parameter for
558 explicit instantiations.
559 (grokdeclarator): Make sure a c++11 attribute after an array
560 declarator appertains to the array, an attribute after a function
561 declarator appertains to the function type, an attribute after a
562 declarator-id appertains to the entity being declared, and an
563 attribute after a pointer declarator appertain to the pointer.
564 * decl2.c (is_late_template_attribute): Use get_attribute_name.
565 * error.c (maybe_warn_cpp0x): Support
566 CPP0X_GENERALIZED_ATTRIBUTES.
567 * parser.c (cp_next_tokens_can_be_attribute_p)
568 (cp_next_tokens_can_be_gnu_attribute_p)
569 (cp_next_tokens_can_be_std_attribute_p)
570 (cp_nth_tokens_can_be_attribute_p)
571 (cp_nth_tokens_can_be_gnu_attribute_p)
572 (cp_nth_tokens_can_be_std_attribute_p)
573 (cp_parser_gnu_attribute_list, cp_parser_std_attribute)
574 (cp_parser_std_attribute_spec, cp_parser_std_attribute_spec_seq)
575 (cp_parser_attributes_opt, cp_parser_std_attribute_list): New
577 (cp_parser_gnu_attributes_opt): Replace cp_parser_attributes_opt.
578 (cp_parser_gnu_attribute_list): Replace cp_parser_attribute_list.
579 (cp_parser_postfix_expression): Disallow "[[" tokens here.
580 (cp_parser_label_for_labeled_statement): Use take an extra
581 parameter for attributes.
582 (cp_parser_block_declaration): Use
583 cp_nth_tokens_can_be_std_attribute_p here.
584 (cp_parser_decl_specifier_seq): Likewise. Store C++11 attributes
585 that appears in in decl specifiers in cp_decl_specifier_seq::std_attributes.
586 declaration. Emit proper warning about misplaced c++11 attributes
588 (cp_parser_explicit_instantiation): Adjust call to check_tag_decl.
589 (cp_parser_init_declarator): Parsing attributes here is no more a
590 GNU extension in c++-11.
591 (cp_parser_type_specifier_seq): Use
592 cp_next_tokens_can_be_attribute_p.
593 (cp_parser_direct_declarator): Likewise. Hang c++11 attributes
594 following the declarator to its syntactic construct. It'll later
595 be applied to the proper appertaining entity by grokdeclarator.
596 (cp_parser_ptr_operator): Likewise.
597 (make_declarator): Initialize cp_declarator::std_attribute.
598 (make_pointer_declarator, make_reference_declarator)
599 (make_ptrmem_declarator, cp_parser_make_indirect_declarator): Take
600 attributes that appertain to the pointer/reference in argument.
601 (cp_parser_ptr_operator): Take an out parameter for c++11
602 attributes. Update comments.
603 (cp_parser_new_declarator_opt)
604 (cp_parser_conversion_declarator_opt): Adjust.
605 (cp_parser_declarator): Likewise. Handle C++11 attributes.
606 Rename attributes to gnu_attribute for better legibility.
607 (cp_parser_simple_declaration): Update comment.
608 (cp_parser_class_specifier_1): Parse GNU attributes specifically
609 (cp_parser_enum_specifier): Accept only gnu attributes after the
611 (cp_parser_member_declaration): Don't clear attributes -- intended
612 for the entity being declared -- too early because check_tag_decl
614 (cp_parser_statement): Update comment. Parse optional c++11
615 attributes at the beginning of the relevant kind of statements and
616 ignore them, for now, unless when calling
617 cp_parser_label_for_labeled_statement.
618 (cp_parser_label_for_labeled_statement): Take c++11 attributes
620 * semantics.c (potential_constant_expression_1): Likewise.
621 * typeck.c (fundamental_alignment_p, cxx_alignas_expr): New public
624 2012-10-07 Paolo Carlini <paolo.carlini@oracle.com>
626 * pt.c (fold_non_dependent_expr_sfinae): Remove static specifier.
627 (tsubst_copy_and_build): Use get_target_expr_sfinae.
628 * call.c (build_conditional_expr_1, convert_like_real): Likewise.
629 * cvt.c (build_up_reference): Likewise.
630 (ocp_convert): Use abstract_virtuals_error_sfinae.
631 (build_up_reference): Propagate complain to cp_build_addr_expr.
632 * decl.c (compute_array_index_type): Use fold_non_dependent_expr_sfinae.
633 * cp-tree.h: Update declarations.
635 * cvt.c (build_expr_type_conversion): Tidy.
637 * tree.c (stabilize_aggr_init): Change to static.
639 2012-10-07 Paolo Carlini <paolo.carlini@oracle.com>
642 * semantics.c (is_normal_capture_proxy): Return true for
643 error_mark_node as DECL_VALUE_EXPR.
645 2012-10-05 Jakub Jelinek <jakub@redhat.com>
647 * cp-tree.h (SIZEOF_EXPR_TYPE_P): Define.
648 * tree.c (cp_tree_equal): Handle SIZEOF_EXPR with
650 * mangle.c (write_expression): Likewise.
651 * cxx-pretty-print.c (pp_cxx_unary_expression): Likewise.
652 * error.c (dump_expr): Likewise.
653 * parser.c (cp_parser_unary_expression): For sizeof call
654 cxx_sizeof_or_alignof_{type,expr} just for diagnostics and
655 return SIZEOF_EXPR with the operand.
656 * pt.c (tsubst_copy, tsubst_copy_and_build): For SIZEOF_EXPR,
657 call cxx_sizeof_or_alignof_{type,expr} for diagnostics, but
658 return SIZEOF_EXPR with tsubsted operand.
659 (value_dependent_expression_p): Handle SIZEOF_EXPR with
661 (instantiation_dependent_r): Likewise.
662 * call.c (null_ptr_cst_p): Call maybe_constant_value for C++98.
663 * semantics.c (finish_call_expr): Call
664 sizeof_pointer_memaccess_warning if needed.
665 (cxx_eval_constant_expression): Handle SIZEOF_EXPR.
666 (potential_constant_expression_1): Remove early exit for
667 C++98. Handle PROPERTY_REF.
668 * decl.c (duplicate_decls): When redeclaring a builtin function,
669 keep the merged decl builtin also if newdecl is a gnu_inline
671 (fold_sizeof_expr_r): New function.
672 (compute_array_index_type): Fold SIZEOF_EXPRs in itype.
673 * cp-gimplify.c (cp_genericize_r): Fold SIZEOF_EXPR.
674 * typeck.c (cp_build_binary_op): For warn_for_sign_compare
675 try harder using maybe_constant_value to get INTEGER_CSTs.
677 * decl.c (stabilize_vla_size): Call pointer_set_destroy
680 2012-10-04 Arnaud Charlet <charlet@adacore.com>
682 * decl2.c (cp_write_global_declarations): Fix handling of
685 2012-10-03 Jakub Jelinek <jakub@redhat.com>
688 * semantics.c (cxx_eval_constant_expression) <case COMPOUND_EXPR>: If
689 not ignoring the second operand, pass the original second operand
690 and not one with stripped nops to cxx_eval_constant_expression.
692 2012-10-01 Jason Merrill <jason@redhat.com>
694 * decl.c (check_initializer): Set DECL_NONTRIVIALLY_INITIALIZED_P
695 for a constructor call.
696 (decl_jump_unsafe): So don't bother checking
697 type_has_nontrivial_default_init.
698 * call.c (set_up_extended_ref_temp): Set
699 DECL_NONTRIVIALLY_INITIALIZED_P.
701 * cp-tree.h (TYPE_FUNCTION_OR_TEMPLATE_DECL_CHECK): New.
702 (DECL_FRIEND_P, DECL_ANTICIPATED): Use it.
703 (TYPE_FUNCTION_OR_TEMPLATE_DECL_P): New.
704 * name-lookup.c (hidden_name_p): Use it.
706 * cp-tree.h (DECL_PRETTY_FUNCTION_P): Just look at the name.
707 * decl.c (cp_make_fname_decl): Adjust.
709 2012-09-30 Sharad Singhai <singhai@google.com>
711 * decl2.c (cp_write_global_declarations): Use a different method
712 to determine if the dump has ben initialized.
714 2012-09-29 Paolo Carlini <paolo.carlini@oracle.com>
717 * decl2.c (build_offset_ref_call_from_tree): Add tsubst_flags_t
719 * pt.c (tsubst_copy_and_build): Adjust.
720 * parser.c (cp_parser_postfix_expression): Likewise.
721 * cp-tree.h: Adjust declaration.
723 2012-09-28 Dodji Seketeli <dodji@redhat.com>
725 PR c++/54372 - unused attribute inactive on dependant entities
726 * decl2.c (is_late_template_attribute): "unused" attribute is to
727 be applied at compile time.
729 2012-09-25 Dodji Seketeli <dodji@redhat.com>
731 PR c++/29028 - Missed unused warning on using declaration
732 * decl.c (poplevel<warn_unused*>): Do not forget that some local
733 bindings are represented by a TREE_LIST.
735 2012-09-25 Dodji Seketeli <dodji@redhat.com>
737 PR c++/53551 - -Wunused-local-typedefs misses uses
738 * decl.c (make_typename_type): Record the use of typedefs.
740 2012-09-27 Jakub Jelinek <jakub@redhat.com>
742 * init.c (build_new_1): Don't test TREE_CONSTANT
745 2012-09-25 Paolo Carlini <paolo.carlini@oracle.com>
748 * parser.c (cp_parser_template_id): In C++11 mode simply accept
751 2012-09-25 Zhenqiang Chen <zhenqiang.chen@linaro.org>
754 * typeck.c (cp_build_binary_op): Check side effects before generating
755 pfn and delta related expressions.
757 2012-09-24 Lawrence Crowl <crowl@google.com>
759 * init.c (build_new_1): Change to new double_int API.
760 * decl.c (build_enumerator): Likewise.
761 * typeck2.c (process_init_constructor_array): Likewise.
762 * mangle.c (write_array_type): Likewise.
764 2012-09-24 Paolo Carlini <paolo.carlini@oracle.com>
767 * error.c (dump_function_decl): Strip TFF_TEMPLATE_NAME from flags
770 2012-09-24 Jason Merrill <jason@redhat.com>
772 * decl.c (get_atexit_node): Remove dead code.
774 * Make-lang.in (cp/parser.o): Depend on decl.h.
776 2012-09-20 Paolo Carlini <paolo.carlini@oracle.com>
779 * pt.c (tsubst_copy_and_build): If tf_error is not set in the complain
780 argument don't call unqualified_name_lookup_error.
782 2012-09-19 Marc Glisse <marc.glisse@inria.fr>
785 * semantics.c (finish_decltype_type): Make vectors not opaque.
787 2012-09-17 Jason Merrill <jason@redhat.com>
790 * pt.c (instantiate_alias_template): New.
792 (push_access_scope): Allow TYPE_DECL.
794 2012-09-14 Jason Merrill <jason@redhat.com>
797 * typeck2.c (check_narrowing): Avoid false positives on conversion
800 2012-09-14 Marc Glisse <marc.glisse@inria.fr>
803 * typeck.c (cp_build_binary_op) [LSHIFT_EXPR, RSHIFT_EXPR, EQ_EXPR,
804 NE_EXPR, LE_EXPR, GE_EXPR, LT_EXPR, GT_EXPR]: Handle VECTOR_TYPE.
806 2012-09-14 Paolo Carlini <paolo.carlini@oracle.com>
808 * decl.c (make_typename_type): Only error out if tf_error is set
811 2012-09-13 Paolo Carlini <paolo.carlini@oracle.com>
812 Manuel López-Ibåñez <manu@gcc.gnu.org>
815 * init.c (perform_member_init): Use OPT_Winit_self instead of
818 2012-09-13 Paolo Carlini <paolo.carlini@oracle.com>
820 * typeck.c (build_indirect_ref, build_function_call,
821 build_function_call_vec, build_binary_op, build_unary_op,
822 build_compound_expr, build_c_cast, build_modify_expr): Remove
823 uses of ATTRIBUTE_UNUSED on the parameters.
824 * class.c (set_linkage_according_to_type, resort_type_method_vec,
825 dfs_find_final_overrider_post, empty_base_at_nonzero_offset_p):
827 * decl.c (local_variable_p_walkfn): Likewise.
828 * except.c (wrap_cleanups_r, check_noexcept_r): Likewise.
829 * error.c (find_typenames_r): Likewise.
830 * tree.c (verify_stmt_tree_r, bot_replace,
831 handle_java_interface_attribute, handle_com_interface_attribute,
832 handle_init_priority_attribute, c_register_addr_space): Likewise.
833 * cp-gimplify.c (cxx_omp_clause_default_ctor): Likewise.
834 * cp-lang.c (objcp_tsubst_copy_and_build): Likewise.
835 * pt.c (unify_success, unify_invalid, instantiation_dependent_r):
837 * semantics.c (dfs_calculate_bases_pre): Likewise.
838 * decl2.c (fix_temporary_vars_context_r, clear_decl_external):
840 * parser.c (cp_lexer_token_at, cp_parser_omp_clause_mergeable,
841 cp_parser_omp_clause_nowait, cp_parser_omp_clause_ordered,
842 cp_parser_omp_clause_untied): Likewise.
843 * mangle.c (write_unnamed_type_name,
844 discriminator_for_string_literal): Likewise.
845 * search.c (dfs_accessible_post, dfs_debug_mark): Likewise.
846 * lex.c (handle_pragma_vtable, handle_pragma_unit,
847 handle_pragma_interface, handle_pragma_implementation,
848 handle_pragma_java_exceptions): Likewise.
850 2012-09-13 Jason Merrill <jason@redhat.com>
853 * semantics.c (cxx_eval_indirect_ref): If we aren't looking for an
854 address, make sure the value is constant.
857 * pt.c (tsubst_decl) [VAR_DECL]: Handle DECL_ANON_UNION_VAR_P.
860 * pt.c (value_dependent_expression_p): A TREE_LIST initializer must
863 2012-09-10 Paolo Carlini <paolo.carlini@oracle.com>
867 * call.c (build_cxx_call): Add tsubst_flags_t parameter, use
868 require_complete_type_sfinae.
869 (build_op_delete_call, build_over_call): Adjust.
870 * typeck.c (build_x_compound_expr_from_vec): Add tsubst_flags_t
872 (cp_build_function_call_vec): Adjust.
873 * init.c (build_new_1): Likewise.
874 * rtti.c (throw_bad_cast, throw_bad_typeid, build_dynamic_cast_1):
876 * optimize.c (build_delete_destructor_body): Likewise.
877 * cp-tree.h: Adjust declarations.
879 * call.c (convert_arg_to_ellipsis): Use require_complete_type_sfinae.
881 2012-09-10 Jason Merrill <jason@redhat.com>
885 * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Go back to using RECUR
886 for LAMBDA_EXPR_EXTRA_SCOPE except for function scope.
889 * decl.c (move_signature_fn_p): Split out from move_fn_p.
890 * method.c (process_subob_fn): Use it.
891 * cp-tree.h: Declare it.
893 2012-09-07 Jason Merrill <jason@redhat.com>
895 * semantics.c (sort_constexpr_mem_initializers): Tweak.
897 2012-09-09 Mark Kettenis <kettenis@openbsd.org>
899 * decl.c (reshape_init_class): Avoid dereferencing a
900 past-the-end pointer.
902 2012-09-07 Paolo Carlini <paolo.carlini@oracle.com>
904 * pt.c (num_template_headers_for_class): Rework per the code
905 inline in cp_parser_check_declarator_template_parameters.
906 * parser.c (cp_parser_check_declarator_template_parameters):
907 Use num_template_headers_for_class.
909 2012-09-06 Jason Merrill <jason@redhat.com>
913 * semantics.c (sort_constexpr_mem_initializers): New.
914 (build_constexpr_constructor_member_initializers): Use it.
915 (cx_check_missing_mem_inits): Skip artificial fields.
916 * init.c (expand_aggr_init_1): Don't zero out a class
919 2012-09-05 Paolo Carlini <paolo.carlini@oracle.com>
922 * search.c (lookup_base): Add tsubst_flags_t parameter.
923 (adjust_result_of_qualified_name_lookup, check_final_overrider):
925 * name-lookup.c (do_class_using_decl): Adjust.
926 * typeck2.c (binfo_or_else, build_scoped_ref, build_m_component_ref):
928 * cvt.c (cp_convert_to_pointer, convert_to_pointer_force,
929 build_up_reference): Likewise.
930 * rtti.c (build_dynamic_cast_1): Likewise.
931 * tree.c (maybe_dummy_object): Likewise.
932 * call.c (build_conditional_expr_1, build_over_call): Likewise.
933 * cp-tree.h (UNIQUELY_DERIVED_FROM_P, PUBLICLY_UNIQUELY_DERIVED_P):
935 (enum base_access_flags, ba_quiet): Remove.
936 (uniquely_derived_from_p, publicly_uniquely_derived_p): Declare.
937 * except.c (can_convert_eh): Adjust.
938 * decl.c (grokdeclarator): Likewise.
939 * typeck.c (comp_except_types, build_class_member_access_expr,
940 finish_class_member_access_expr, get_member_function_from_ptrfunc,
941 build_static_cast_1, get_delta_difference_1): Likewise.
942 * class.c (build_base_path, convert_to_base, build_vtbl_ref_1,
943 warn_about_ambiguous_bases): Likewise.
944 (uniquely_derived_from_p, publicly_uniquely_derived_p): Define.
946 2012-09-04 Jason Merrill <jason@redhat.com>
949 * decl.c (reshape_init_class): Handle invalid initializer for
950 0-length array member.
952 * error.c (dump_type_suffix): Correct handling of 0-length arrays.
955 * cp-tree.h (LAMBDANAME_P): Remove.
956 (LAMBDA_TYPE_P): Check CLASSTYPE_LAMBDA_EXPR instead.
957 * cp-lang.c (cxx_dwarf_name): Likewise.
958 * error.c (dump_aggr_type): Likewise.
959 * semantics.c (begin_lambda_type): Set CLASSTYPE_LAMBDA_EXPR sooner.
962 * decl.c (check_default_argument): Set cp_unevaluated_operand
963 around call to perform_implicit_conversion_flags.
967 * pt.c (fn_type_unification): Call coerce_template_parms before
968 entering substitution context.
970 2012-08-31 Paolo Carlini <paolo.carlini@oracle.com>
971 Jason Merrill <jason@redhat.com>
974 * pt.c (check_template_variable): New.
975 (num_template_headers_for_class): Split out...
976 * decl.c (grokdeclarator): ...from here.
977 (start_decl): Remove redundant diagnostic.
978 * cp-tree.h: Declare them
979 * parser.c (cp_parser_single_declaration): Call check_template_variable.
981 2012-08-31 Ollie Wild <aaw@google.com>
984 * call.c (extend_ref_init_temps_1): Handle COMPOUND_EXPR trees.
986 2012-08-30 Jason Merrill <jason@redhat.com>
990 * pt.c (instantiation_dependent_r): New.
991 (instantiation_dependent_expression_p): New.
992 (value_dependent_expression_p): Use it. SCOPE_REF is always dependent.
993 * semantics.c (finish_decltype_type): Use it.
994 * cp-tree.h: Declare it.
996 * semantics.c (finish_qualified_id_expr): Handle building up a
997 non-dependent SCOPE_REF here.
998 (finish_id_expression): Not here.
999 * error.c (dump_decl) [SCOPE_REF]: Only pass TFF_UNQUALIFIED_NAME.
1001 * friend.c (make_friend_class): Handle template template parameters.
1002 * parser.c (cp_parser_template_declaration_after_export): Likewise.
1003 * pt.c (tsubst_friend_class): Likewise.
1004 (instantiate_class_template_1): Likewise
1005 * decl.c (check_elaborated_type_specifier): Likewise.
1006 (lookup_and_check_tag): Likewise.
1008 * pt.c (get_class_bindings): Call coerce_template_parms. Add
1009 main_tmpl parameter.
1010 (more_specialized_class): Add main_tmpl parameter.
1011 (most_specialized_class): Adjust calls.
1013 * decl.c (cp_finish_decl): Check for invalid multiple initializers
1014 even if the initializer is dependent.
1016 * pt.c (instantiate_template_1): Keep processing_template_decl set
1017 if there are dependent args.
1019 2012-08-25 Paolo Carlini <paolo.carlini@oracle.com>
1022 * decl2.c (mark_used): Consistently return false after errors
1023 about uses before deduction of auto.
1024 * semantics.c (finish_id_expression): Check mark_used return
1025 value and return error_mark_node in case of failure.
1027 2012-08-24 Jason Merrill <jason@redhat.com>
1029 PR c++/51213 (again)
1030 * pt.c (deduction_tsubst_fntype): Remove.
1031 (fn_type_unification): Check deduction depth and call
1032 instantiate_template here. Handle default argument access checks.
1033 (determine_specialization): Suppress access control.
1034 (tsubst_decl): Check for excessive deduction depth.
1035 (recheck_decl_substitution): Make sure access control is on.
1036 (type_unification_real): Don't mess with access deferring here.
1037 (get_bindings): Adjust for fn_type_unification return type.
1038 * call.c (enum rejection_reason_code): Drop rr_template_instantiation.
1039 (template_instantiation_rejection): Remove.
1040 (struct rejection_reason): Change targs to num_targs.
1041 (template_unification_rejection, print_z_candidate): Adjust.
1042 (add_template_candidate_real): Adjust for fn_type_unification change.
1043 * class.c (resolve_address_of_overloaded_function): Likewise.
1044 * cp-tree.h: Adjust declaration.
1046 * pt.c (tsubst_default_argument): Indicate where the default
1047 argument is being instantiated for.
1048 (tsubst_expr): Restore previous location.
1049 (tsubst_copy_and_build): Set and restore location.
1050 * call.c (build_new_method_call_1): Remember location of call.
1051 * semantics.c (finish_call_expr): Here too.
1052 * parser.c (cp_parser_omp_for_loop): Remember the location of the
1053 increment expression.
1055 * pt.c (resolve_overloaded_unification): Use coerce_template_parms
1056 instead of get_bindings.
1057 (resolve_nondeduced_context): Likewise.
1059 * pt.c (register_specialization): Correct argument to
1060 check_specialization_namespace.
1061 (determine_specialization): Don't consider members of
1062 unspecialized types.
1064 2012-08-23 Jason Merrill <jason@redhat.com>
1066 * decl.c (compute_array_index_type): Use type_dependent_expression_p.
1068 2012-08-23 Paolo Carlini <paolo.carlini@oracle.com>
1071 * name-lookup.c (supplement_binding_1): Handle specially enums
1072 only in class templates.
1073 (validate_nonmember_using_decl): Enforce 7.3.3/10 about duplicate
1074 using declarations at function scope.
1076 2012-08-21 Richard Guenther <rguenther@suse.de>
1078 * cp-tree.h (TREE_INDIRECT_USING): Use TREE_LANG_FLAG_0 accessor.
1079 (ATTR_IS_DEPENDENT): Likewise.
1080 (ARGUMENT_PACK_INCOMPLETE_P): Use TREE_ADDRESSABLE instead of
1081 TREE_LANG_FLAG_0 on TREE_VECs.
1083 2012-08-20 Florian Weimer <fweimer@redhat.com>
1086 * call.c (build_operator_new_call): Add size_check argument and
1088 * cp-tree.h (build_operator_new_call): Adjust declaration.
1089 * init.c (build_new_1): Compute array size check and apply it.
1091 2012-08-20 Paolo Carlini <paolo.carlini@oracle.com>
1094 * decl.c (poplevel): Check TYPE_HAS_NONTRIVIAL_DESTRUCTOR for
1095 Wunused_variable too.
1097 2012-08-20 Diego Novillo <dnovillo@google.com>
1099 * decl.c (poplevel): Start TV_NAME_LOOKUP conditionally.
1101 2012-08-20 Richard Guenther <rguenther@suse.de>
1103 * name-lookup.c (store_binding_p): New predicate, split out from ...
1104 (store_binding): ... here. Always store binding and require
1105 target vector with enough space.
1106 (store_bindings): Collect to store bindings and reserve space
1107 for them, then store them.
1108 (store_class_bindings): Likewise.
1110 2012-08-19 Mikael Morin <mikael@gcc.gnu.org>
1112 * Make-lang.in: Fix typo.
1114 2012-08-17 Jakub Jelinek <jakub@redhat.com>
1116 * cp-tree.def (SIZEOF_EXPR): Move to c-common.def.
1118 2012-08-14 Diego Novillo <dnovillo@google.com>
1120 Merge from cxx-conversion branch. Re-write VEC in C++.
1122 * call.c (add_function_candidate): Remove const qualifier
1123 from call to VEC_index.
1125 2012-08-10 Richard Guenther <rguenther@suse.de>
1127 * error.c (dump_expr): Handle anonymous SSA names.
1129 2012-08-07 Steven Bosscher <steven@gcc.gnu.org>
1131 * error.c (print_instantiation_context): Pretty-print a newline before
1132 diagnostic_flush_buffer.
1133 * cxx-pretty-print.c (pp_cxx_function_definition): Use
1134 pp_newline_and_flush instead of separate pp_newline and pp_flush.
1136 2012-08-06 Dodji Seketeli <dodji@redhat.com>
1138 Avoid crashing on erroneous static_assert usage
1139 * semantics.c (finish_static_assert): Don't crash on erroneous
1140 message or condition.
1142 2012-08-06 Marc Glisse <marc.glisse@inria.fr>
1143 Paolo Carlini <paolo.carlini@oracle.com>
1146 * typeck.c (build_static_cast_1): Move the conversion to void case
1147 before the perform_direct_initialization_if_possible call.
1149 2012-08-03 Marc Glisse <marc.glisse@inria.fr>
1151 * pt.c (tsubst_copy_and_build): Handle VECTOR_TYPE like scalars.
1152 * cp-tree.h (scalarish_type_p): Declare.
1153 * tree.c (scalarish_type_p): Make non-static.
1155 2012-08-02 Jason Merrill <jason@redhat.com>
1156 Paolo Carlini <paolo.carlini@oracle.com>
1158 PR c++/51213 (again)
1159 * pt.c (type_unification_real): Call push_deferring_access_checks /
1160 pop_deferring_access_checks around the substitution of default
1162 (instantiate_template_1): When the specialization returned by
1163 retrieve_specialization has FNDECL_HAS_ACCESS_ERRORS set and we
1164 are in a SFINAE context, simply return error_mark_node.
1165 * cp-tree.h (FNDECL_RECHECK_ACCESS_P): Rename FNDECL_HAS_ACCESS_ERRORS.
1167 2012-07-31 Paolo Carlini <paolo.carlini@oracle.com>
1169 * pt.c (check_default_tmpl_args): Change is_primary and is_partial
1170 parameters to bool type, adjust.
1171 (push_template_decl_real): Tidy.
1172 * parser.c (cp_parser_init_declarator): Adjust.
1173 * decl.c (redeclaration_error_message): Likewise.
1174 * cp-tree.h (check_default_tmpl_args): Update prototype.
1176 2012-07-31 Paolo Carlini <paolo.carlini@oracle.com>
1179 * pt.c (check_default_tmpl_args): Don't check local types.
1181 2012-07-25 Sandra Loosemore <sandra@codesourcery.com>
1182 Paul Brook <paul@codesourcery.com>
1185 * decl.c (finish_function): Check targetm.warn_func_return.
1187 2012-07-25 Jason Merrill <jason@redhat.com>
1190 * decl.c (grokdeclarator): Allow const and constexpr together.
1193 * semantics.c (potential_constant_expression_1) [COND_EXPR]: Call
1194 maybe_constant_value.
1196 * cp-tree.h (tsubst_flags): Remove tf_no_access_control.
1197 * call.c (standard_conversion): Don't set it.
1198 * class.c (resolve_address_of_overloaded_function): Don't check it.
1199 * decl.c (check_default_argument): Call
1200 perform_implicit_conversion_flags.
1202 * pt.c (print_candidates_1): Use inform instead of error.
1204 2012-07-24 Paolo Carlini <paolo.carlini@oracle.com>
1206 * pt.c (convert_template_argument, tsubst): Simplify fourth argument
1207 to make_typename_type (complain & tf_error -> complain).
1209 2012-07-24 Steven Bosscher <steven@gcc.gnu.org>
1211 * class.c (n_vtables, n_vtable_entries, n_vtable_searches,
1212 n_vtable_elems, n_convert_harshness, n_compute_conversion_costs,
1213 n_inner_fields_searched): Always define.
1214 (build_primary_vtable): Convert #ifdef GATHER_STATISTICS to if-code.
1215 (print_class_statistics): Convert #ifdef GATHER_STATISTICS to if-code.
1216 * tree.c (depth_reached): Always define global.
1217 (cxx_print_statistics): Convert #ifdef GATHER_STATISTICS to if-code.
1218 * pt.c (depth_reached): Always define.
1219 (push_tinst_level): Convert #ifdef GATHER_STATISTICS to if-code.
1220 * search.c (n_fields_searched, n_calls_lookup_field,
1221 n_calls_lookup_field_1, n_calls_lookup_fnfields,
1222 n_calls_lookup_fnfields_1, n_calls_get_base_type,
1223 n_outer_fields_searched, n_contexts_saved): Always define.
1224 (lookup_field_1): Convert #ifdef GATHER_STATISTICS to if-code.
1225 (lookup_member): Likewise.
1226 (lookup_fnfields_idx_nolazy): Likewise.
1227 (print_search_statistics): Likewise.
1228 (reinit_search_statistics): Unconditionally re-set counters.
1229 * lex.c (retrofit_lang_decl): Convert #ifdef GATHER_STATISTICS
1231 (cxx_dup_lang_specific_decl): Likewise.
1232 (copy_lang_type): Likewise.
1233 (cxx_make_type): Likewise.
1235 2012-07-20 Jason Merrill <jason@redhat.com>
1238 * tree.c (build_cplus_array_type): Use build_cplus_array_type to build
1239 canonical array type rather than mess with its TYPE_*_VARIANT.
1241 2012-07-19 Jason Merrill <jason@redhat.com>
1244 * typeck.c (cp_apply_type_quals_to_decl): Check COMPLETE_TYPE_P.
1247 * call.c (build_cxx_call): Set optimize when folding
1248 __builtin_constant_p in a constexpr function.
1250 2012-07-18 Jason Merrill <jason@redhat.com>
1252 * pt.c (instantiate_decl): Don't recheck substitutions.
1254 2012-07-18 Paolo Carlini <paolo.carlini@oracle.com>
1255 Jason Merrill <jason@redhat.com>
1259 * semantics.c (perform_access_checks): Add complain parm, return bool.
1260 (perform_deferred_access_checks): Likewise.
1261 (perform_or_defer_access_check): Likewise.
1262 (speculative_access_check): Remove.
1263 * call.c (enforce_access): Add complain parm, return bool.
1264 * decl.c, friend.c, class.c, init.c, parser.c: Adjust callers.
1265 * search.c: Adjust callers.
1266 * cp-tree.h (TINFO_RECHECK_ACCESS_P): New macro.
1267 (FNDECL_RECHECK_ACCESS_P): New macro.
1268 * method.c (synthesized_method_walk): Stop deferring access checks.
1269 * pt.c (recheck_decl_substitution): New.
1270 (instantiate_template_1): Set and check FNDECL_RECHECK_ACCESS_P.
1272 2012-07-18 Jason Merrill <jason@redhat.com>
1274 * method.c (process_subob_fn): Make sure no_implicit_p is non-null
1275 before trying to store through it.
1277 2012-07-17 Jason Merrill <jason@redhat.com>
1280 * decl.c (finish_enum_value_list): Only call
1281 insert_late_enum_def_into_classtype_sorted_fields in class scope.
1284 * tree.c (build_cplus_array_type): Also add TYPE_CANONICAL
1285 to the list of variants.
1287 * decl.c (xref_basetypes): Complain about incomplete template base.
1288 * class.c (finish_struct): Adjust variants in templates, too.
1291 * parser.c (cp_parser_class_head): Call xref_basetypes here.
1292 (cp_parser_class_specifier_1): Not here.
1293 * pt.c (tsubst_decl) [USING_DECL]: Check uses_template_parms
1294 as well as DECL_DEPENDENT_P.
1296 2012-07-16 Jason Merrill <jason@redhat.com>
1298 * cp-tree.h (struct deferred_access_check): Add location.
1299 * semantics.c (perform_access_checks): Use it.
1300 (perform_or_defer_access_check): Store it.
1302 2012-07-16 Steven Bosscher <steven@gcc.gnu.org>
1304 * dump.c (dump_stmt): Moved here from c-dump.c.
1305 * optimize.c: Include dumpfile.h instead of tree-dump.h.
1306 * class.c: Likewise.
1307 * decl2.c: Likewise.
1308 * Make-lang.in: Fix dependencies.
1310 2012-07-13 Jason Merrill <jason@redhat.com>
1313 * method.c (synthesized_method_walk): Initialize no_implicit_p sooner.
1315 2012-07-12 Jason Merrill <jason@redhat.com>
1317 * pt.c (instantiate_decl): Check typedefs access here.
1318 (instantiate_template_1): Not here.
1320 * pt.c (deduction_tsubst_fntype): Just suppress access checking.
1321 (instantiate_template_1): Set DECL_TI_TEMPLATE before access checking.
1322 (push_deduction_access_scope, pop_deduction_access_scope): Remove.
1324 2012-07-11 Jason Merrill <jason@redhat.com>
1327 * method.c (synthesized_method_walk): Replace uses of msg with diag.
1328 Correct handling of virtual bases with move operations.
1329 (process_subob_fn, walk_field_subobs): Replace uses of msg with diag.
1331 2012-07-11 Steven Bosscher <steven@gcc.gnu.org>
1333 * method.c: Do not include tree-pass.h.
1335 2012-07-10 Jason Merrill <jason@redhat.com>
1339 * cp-tree.h (FNDECL_SUPPRESS_IMPLICIT_DECL): New.
1340 (struct lang_decl_fn): Add suppress_implicit_decl field.
1341 * method.c (implicitly_declare_fn): Check it.
1342 (process_subob_fn): Add no_implicit_p parm.
1343 (walk_field_subobs, synthesized_method_walk): Likewise.
1344 (maybe_explain_implicit_delete): Adjust.
1345 (explain_implicit_non_constexpr): Adjust.
1347 * method.c (synthesized_method_walk): Avoid changing
1348 EH spec based on cleanups in other places, too.
1350 2012-07-09 Sterling Augustine <saugustine@google.com>
1352 * error.c (lang_decl_name): Use TFF_UNQUALIFIED_NAME flag.
1354 2012-07-08 Steven Bosscher <steven@gcc.gnu.org>
1356 * decl.c (cp_finish_decl): Add FIXME at add_local_decl call site.
1358 2012-07-06 Jason Merrill <jason@redhat.com>
1361 * pt.c (tsubst_arg_types): Add "end" parameter.
1362 (check_undeduced_parms): Use it.
1364 * cp-tree.h (DECL_DECLARES_TYPE_P): Check DECL_TYPE_TEMPLATE_P.
1367 * name-lookup.c (ambiguous_decl): Use DECL_TYPE_TEMPLATE_P.
1369 2012-07-05 Jason Merrill <jason@redhat.com>
1372 * pt.c (arg_from_parm_pack_p): Go back to using same_type_p or
1375 * cp-tree.h (TEMPLATE_PARM_NUM_SIBLINGS): Remove.
1376 (struct template_parm_index_s): Remove num_siblings.
1377 * pt.c (fixup_template_parms, fixup_template_parm_index): Remove.
1378 (fixup_template_type_parm_type): Remove.
1379 (build_template_parm_index): Remove num_siblings parm.
1380 (process_template_parm): Likewise.
1381 * parser.c (cp_parser_template_parameter_list): Adjust.
1382 * tree.c (cp_tree_equal): Don't compare num_siblings.
1383 * typeck.c (comp_template_parms_position): Likewise.
1387 * tree.c (strip_typedefs_expr): New.
1388 * cp-tree.h: Declare it.
1389 * pt.c (convert_template_argument, unify): Use it.
1390 * parser.c (cp_parser_template_declaration_after_export): Don't call
1391 fixup_template_parms.
1393 2012-07-04 Jason Merrill <jason@redhat.com>
1397 * decl.c (build_enumerator): Don't use build_lang_decl_loc.
1399 2012-07-03 Jakub Jelinek <jakub@redhat.com>
1402 * semantics.c (finish_goto_stmt): Surround computed goto argument
1403 with CLEANUP_POINT_EXPR if needed.
1405 2012-07-02 Jason Merrill <jason@redhat.com>
1408 * pt.c (in_template_function): New.
1409 * cp-tree.h: Declare it.
1410 * class.c (build_base_path, resolves_to_fixed_type_p): Use it.
1413 * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Use tsubst
1414 for LAMBDA_EXPR_EXTRA_SCOPE.
1417 * pt.c (build_non_dependent_expr): Don't wrap a dummy object.
1420 * class.c (resolves_to_fixed_type_p): Check uses_template_parms
1421 (current_function_decl) instead of processing_template_decl.
1424 * semantics.c (maybe_add_lambda_conv_op): Don't set
1425 DECL_INTERFACE_KNOWN.
1428 * call.c (build_conditional_expr_1): Don't warn about comparison of
1429 two enumerators before their enumeration is complete.
1430 (build_new_op_1): Call decay_conversion before warn_logical_operator.
1431 * decl.c (build_enumerator): Set DECL_CONTEXT of an enumerator to
1433 * decl2.c (mark_used): Call used_types_insert for enums.
1434 * semantics.c (finish_id_expression): Don't decay CONST_DECL.
1435 (finish_member_declaration): Don't change DECL_CONTEXT of enumerators.
1436 * class.c (check_field_decls): Don't change DECL_CONTEXT of enums.
1437 * typeck.c (convert_for_assignment): Don't decay CONST_DECL.
1438 (build_class_member_access_expr): Look through unscoped enums.
1439 * search.c (context_for_name_lookup): Look through unscoped enums.
1440 * pt.c (tsubst_copy_and_build): Don't decay CONST_DECL.
1441 (tsubst_copy): Use DECL_CONTEXT to find the enumeration.
1442 * tree.c (decl_linkage): Likewise.
1443 * cvt.c (ocp_convert): Check decayed expr for enum range warning.
1445 2012-06-29 Steven Bosscher <steven@gcc.gnu.org>
1447 * Make-lang.in: Remove tree-mudflap.o from CXX_AND_OBJCXX_OBJS.
1449 2012-06-27 Jason Merrill <jason@redhat.com>
1451 * parser.c (cp_parser_check_for_invalid_template_id): tag_type parm.
1452 (cp_parser_simple_type_specifier, cp_parser_class_head): Adjust.
1453 (cp_parser_elaborated_type_specifier): Adjust.
1454 * decl.c (duplicate_decls): Return error_mark_node on template
1458 * parser.c (cp_parser_template_id): Add tag_type parm.
1459 (cp_parser_template_name): Likewise.
1460 (cp_parser_id_expression, cp_parser_unqualified_id): Adjust.
1461 (cp_parser_pseudo_destructor_name, cp_parser_type_name): Adjust.
1462 (cp_parser_simple_type_specifier, cp_parser_class_name): Adjust.
1463 (cp_parser_elaborated_type_specifier, cp_parser_class_head): Adjust.
1465 2012-06-27 Ramana Radhakrishnan <ramana.radhakrishnan@linaro.org>
1468 * semantics.c (constexpr_call): Fix typo in comment.
1469 (cxx_eval_vec_perm_expr): New.
1470 (cxx_eval_constant_expression): Fold VEC_PERM_EXPRs.
1472 2012-06-26 Richard Guenther <rguenther@suse.de>
1475 * mangle.c (write_array_type): Truncate the number-of-elements
1478 2012-06-25 Jason Merrill <jason@redhat.com>
1482 * pt.c (tsubst_decl) [PARM_DECL]: Don't recurse into DECL_CHAIN
1483 if cp_unevaluated_operand is set.
1484 (tsubst_copy) [PARM_DECL]: Don't copy before tsubsting.
1487 * typeck.c (decay_conversion): Don't discard side-effects from
1488 expressions of nullptr_t.
1490 2012-06-25 Florian Weimer <fweimer@redhat.com>
1492 * init.c (build_new_1): Warn about (T[N]) for variable N, and
1495 * parser.c (cp_parser_direct_new_declarator): Accept non-constant
1496 expressions. Handled now in build_new_1.
1498 2012-06-25 Jason Merrill <jason@redhat.com>
1501 * semantics.c (build_data_member_initialization): Always keep
1502 initializer for empty base.
1503 (cxx_eval_bare_aggregate): Discard it here.
1506 * pt.c (tsubst_omp_for_iterator): Simplify DECL_EXPR handling.
1507 (tsubst_expr) [OMP_FOR]: Here, too.
1509 2012-06-25 Jakub Jelinek <jakub@redhat.com>
1512 * class.c (check_bases_and_members): Avoid -Wuninitialized
1513 diagnostics for non-static const members or references if they
1516 2012-06-16 Ville Voutilainen <ville.voutilainen@gmail.com>
1518 * parser.c (cp_parser_direct_declarator): Move virt-specifier
1519 parsing after late-specified return type parsing.
1521 2012-06-14 Jason Merrill <jason@redhat.com>
1524 * name-lookup.c (constructor_name_p): Don't try to look at the
1525 name of a DECLTYPE_TYPE.
1527 2012-06-18 Lawrence Crowl <crowl@google.com>
1529 * decl2.c (cp_write_global_declarations): Rename use of TV_PHASE_CGRAPH
1530 to TV_PHASE_OPT_GEN.
1532 2012-06-18 Steven Bosscher <steven@gcc.gnu.org>
1534 * decl.c (finish_function): Remove code conditional on VMS_TARGET.
1536 2012-06-15 Marc Glisse <marc.glisse@inria.fr>
1539 * semantics.c (literal_type_p): Handle VECTOR_TYPE.
1540 (potential_constant_expression_1): Handle VEC_PERM_EXPR.
1541 * parser.c (cp_parser_postfix_expression): Handle RID_BUILTIN_SHUFFLE.
1543 2012-06-09 Jason Merrill <jason@redhat.com>
1545 * pt.c (tsubst_expr) [TAG_DEFN]: Instantiate local class.
1546 * class.c (finish_struct): Don't add a TAG_DEFN for a lambda.
1547 * decl2.c (finish_static_data_member_decl): Avoid redundant error.
1550 * name-lookup.c (pushtag_1): Add a DECL_EXPR for a local class.
1551 * semantics.c (finish_cond): Build a COMPOUND_EXPR.
1552 * pt.c (tsubst_expr) [COMPOUND_EXPR]: Handle.
1553 [DECL_EXPR]: Don't call cp_finish_decl for an implicit typedef.
1554 Don't return the decl.
1556 2012-06-11 Richard Guenther <rguenther@suse.de>
1559 * mangle.c (write_array_type): Use double-ints for array domain
1562 2012-06-07 Fabien ChĂȘne <fabien@gcc.gnu.org>
1565 * cp-tree.h (insert_late_enum_def_into_classtype_sorted_fields):
1567 * class.c (insert_into_classtype_sorted_fields): New.
1568 (add_enum_fields_to_record_type): New.
1569 (count_fields): Adjust the comment.
1570 (add_fields_to_record_type): Likewise.
1571 (finish_struct_1): Move the code that inserts the fields for the
1572 sorted case, into insert_into_classtype_sorted_fields, and call
1574 (insert_late_enum_def_into_classtype_sorted_fields): Define.
1575 * decl.c (finish_enum_value_list): Call
1576 insert_late_enum_def_into_classtype_sorted_fields if a late enum
1577 definition is encountered.
1579 2012-06-06 Paolo Carlini <paolo.carlini@oracle.com>
1582 * typeck.c (cp_perform_integral_promotions): New, like
1583 perform_integral_promotions but also takes a tsubst_flags_t parameter.
1584 (pointer_diff): Add tsubst_flags_t parameter.
1585 (decay_conversion, cp_default_conversion, cp_build_array_ref,
1586 cp_build_binary_op, cp_build_unary_op, build_static_cast_1,
1587 build_reinterpret_cast_1, cp_build_modify_expr,
1588 convert_for_assignment): Adjust.
1589 * optimize.c (build_delete_destructor_body): Adjust.
1590 * init.c (expand_virtual_init, expand_default_init, build_new_1,
1591 build_new, build_vec_delete_1, build_vec_init, build_delete): Adjust.
1592 (construct_virtual_base): Adjust LOOKUP_COMPLAIN -> 0.
1593 * class.c (build_base_path): Adjust.
1594 * decl.c (compute_array_index_type, finish_destructor_body): Likewise.
1595 * method.c (synthesized_method_walk): Adjust flag and complain.
1596 * rtti.c (ifnonnull): Add tsubst_flags_t parameter.
1597 (build_typeid, build_dynamic_cast_1): Adjust.
1598 * except.c (initialize_handler_parm): Likewise.
1599 * typeck2.c (process_init_constructor_record): Likewise.
1600 * pt.c (tsubst_friend_class): Don't change flags.
1601 * semantics.c (finish_goto_stmt, handle_omp_for_class_iterator,
1602 finish_static_assert): Likewise.
1603 * parser.c (cp_parser_lookup_name): Just pass 0 as flags to
1605 * call.c (build_op_delete_call): Add tsubst_flags_t parameter.
1606 (convert_like_real, convert_arg_to_ellipsis, convert_for_arg_passing):
1608 (standard_conversion): Adjust LOOKUP_COMPLAIN -> 0.
1609 (implicit_conversion): Mask out tf_error with a FIXME.
1610 (build_user_type_conversion_1, build_new_op_1, build_over_call): Use
1611 complain & tf_error instead of flags & LOOKUP_COMPLAIN.
1612 * cvt.c (cp_convert_to_pointer, convert_to_pointer_force,
1613 build_up_reference, convert_to_reference, cp_convert,
1614 cp_convert_and_check, ocp_convert, convert_force): Add tsubst_flags_t
1616 (convert_to_reference, ocp_convert): Use complain & tf_error instead
1617 of flags & LOOKUP_COMPLAIN.
1618 (convert_force): Adjust LOOKUP_COMPLAIN -> 0.
1619 * name-lookup.c (identifier_type_value_1, lookup_qualified_name,
1620 lookup_name_real, lookup_function_nonclass, lookup_name,
1621 lookup_name_prefer_type): Adjust LOOKUP_COMPLAIN -> 0.
1622 * cp-tree.h: Adjust prototypes; remove LOOKUP_COMPLAIN.
1624 2012-06-06 Steven Bosscher <steven@gcc.gnu.org>
1626 * decl.c: Do not include output.h.
1627 (start_decl): Remove code for flag_conserve_space.
1629 2012-06-06 Fabien ChĂȘne <fabien@gcc.gnu.org>
1632 * parser.c (cp_parser_alias_declaration): Return earlier
1633 if an error occured.
1635 2012-06-04 Paolo Carlini <paolo.carlini@oracle.com>
1638 * call.c (build_conditional_expr_1): Use OPT_Wenum_compare
1639 to control enumeral mismatch in conditional expression too.
1641 2012-06-04 Sterling Augustine <saugustine@google.com>
1643 * cp-tree.h: Declare decl_as_dwarf_string, lang_decl_dwarf_name.
1644 * cp-lang.c (cxx_dwarf_name): Call them.
1646 2012-06-04 Steven Bosscher <steven@gcc.gnu.org>
1648 * semantics.c: Do not include output.h.
1649 * decl2.c: Likewise.
1650 * friend.c: Likewise.
1651 * typeck.c: Likewise.
1652 * typeck2.c: Likewise.
1653 * Make-lang.in: Fix dependencies.
1655 2012-06-01 Jason Merrill <jason@redhat.com>
1658 * parser.c (cp_parser_class_head): Apply attributes here.
1659 * semantics.c (begin_class_definition): Not here.
1660 * cp-tree.h: Adjust.
1663 * parser.c (cp_parser_binary_expression): Bail early if we're parsing
1664 tentatively and the LHS has a parse error.
1667 * pt.c (instantiate_class_template_1): Set LAMBDA_EXPR_THIS_CAPTURE.
1668 (instantiate_decl): Don't push_to_top_level for local class methods.
1669 (instantiate_class_template_1): Or for local classes.
1672 * pt.c (do_auto_deduction): Don't try to deduce from a
1673 type-dependent initializer.
1675 2012-06-01 Paolo Carlini <paolo.carlini@oracle.com>
1678 * name-lookup.c (push_namespace): When error recovery is
1679 impossible just error out in duplicate_decls.
1681 2012-05-31 Steven Bosscher <steven@gcc.gnu.org>
1683 * call.c: Do not include output.h.
1684 * class.c: Likewise.
1685 * except.c: Likewise.
1686 * friend.c: Likewise.
1689 * method.c: Likewise.
1690 * parser.c: Likewise.
1693 * search.c: Likewise.
1695 2012-05-30 Jason Merrill <jason@redhat.com>
1698 * tree.c (stabilize_init): Handle stabilizing a TARGET_EXPR
1699 representing a bitwise copy of a glvalue.
1701 * tree.c (stabilize_expr): Tweak logic.
1704 * tree.c (stabilize_init): Side effects make the init unstable.
1706 2012-05-28 Paolo Carlini <paolo.carlini@oracle.com>
1709 * semantics.c (potential_constant_expression_1): Handle LTGT_EXPR.
1711 2012-05-26 Paolo Carlini <paolo.carlini@oracle.com>
1714 * tree.c (stabilize_expr): Handle exp of void type.
1716 2012-05-26 Jason Merrill <jason@redhat.com>
1719 * call.c (convert_like_real) [ck_list]: Take array address directly.
1720 * typeck.c (decay_conversion): Reject decay of an array compound
1723 2012-05-25 Paolo Carlini <paolo.carlini@oracle.com>
1726 * parser.c (cp_parser_member_declaration): A storage class is not
1727 allowed in a declaration of an anonymous aggregate in a class scope.
1729 2012-05-24 Uros Bizjak <ubizjak@gmail.com>
1732 * decl.c (grokdeclarator): Check that current_class_type is non-NULL
1733 before calling constructor_name_p.
1735 2012-05-24 Paolo Carlini <paolo.carlini@oracle.com>
1738 * parser.c (cp_parser_ctor_initializer_opt_and_function_body,
1739 cp_parser_function_body): Add a bool parameter, true when parsing
1740 a function-try-block.
1741 (cp_parser_function_try_block): Pass true to the above.
1742 (cp_parser_function_definition_after_declarator,
1743 cp_parser_function_transaction): Adjust.
1745 2012-05-23 Paolo Carlini <paolo.carlini@oracle.com>
1748 * decl2.c (delete_sanity): Extend 'deleting array' warning to
1751 2012-05-21 Paolo Carlini <paolo.carlini@oracle.com>
1754 * decl.c (grokdeclarator): Diagnose functions returning abstract
1755 class types as TYPENAME.
1756 * cp-tree.h (ABSTRACT_CLASS_TYPE_P): Add.
1757 * except.c (is_admissible_throw_operand_or_catch_parameter): Use it.
1758 * pt.c (tsubst): Likewise.
1759 * semantics.c (trait_expr_value): Likewise.
1761 2012-05-21 Paolo Carlini <paolo.carlini@oracle.com>
1764 * parser.c (cp_parser_attributes_opt): Enforce error checking of
1765 unbalanced parentheses in the presence of tentative parsing.
1767 2012-05-17 Paolo Carlini <paolo.carlini@oracle.com>
1770 * parser.c (cp_parser_new_type_id): Early return error_mark_node
1771 if the cp_parser_type_specifier_seq call has type_specifier_seq.type
1772 error_mark_node; tidy.
1773 (cp_parser_new_expression): Always initialize nelts to NULL_TREE to
1774 avoid uninitialized warnings.
1775 (cp_parser_init_declarator, cp_parser_late_parse_one_default_arg):
1776 Call cp_parser_skip_to_end_of_statement if cp_parser_initializer
1777 returns error_mark_node.
1779 2012-05-17 Paolo Carlini <paolo.carlini@oracle.com>
1782 * except.c (is_admissible_throw_operand): Rename to
1783 is_admissible_throw_operand_or_catch_parameter and handle
1784 catch parameter too.
1785 (expand_start_catch_block): Use it.
1786 (build_throw): Adjust.
1788 2012-05-17 Paolo Carlini <paolo.carlini@oracle.com>
1791 * typeck.c (build_x_array_ref, build_x_conditional_expr,
1792 build_x_compound_expr, build_x_modify_expr): Add location_t parameter.
1793 (finish_class_member_access_expr, build_x_indirect_ref,
1794 build_x_binary_op, build_x_compound_expr_from_list,
1795 build_x_compound_expr_from_vec): Adjust callers.
1796 * tree.c (build_min_nt_loc): New.
1797 (build_min_nt): Remove.
1798 * typeck2.c (build_x_arrow): Adjust callers.
1799 * pt.c (tsubst_qualified_id, tsubst_omp_for_iterator,
1800 tsubst_copy_and_build): Likewise.
1801 * semantics.c (finish_mem_initializers, handle_omp_for_class_iterator,
1802 finish_omp_atomic): Likewise.
1803 * decl2.c (grok_array_decl, build_anon_union_vars): Adjust.
1804 * parser.c (cp_parser_question_colon_clause,
1805 cp_parser_assignment_expression, cp_parser_expression,
1806 cp_parser_template_id, cp_parser_omp_for_loop): Likewise.
1807 * cp-tree.h: Update.
1809 2012-05-16 Dodji Seketeli <dodji@redhat.com>
1811 PR preprocessor/7263
1812 * cp-tree.h (enum cp_decl_spec): Add new enumerators to cover all
1813 the possible declarator specifiers so far.
1814 (struct cp_decl_specifier_seq::locations): Declare new member.
1815 (cp_decl_specifier_seq::{specs, type_location}): Remove.
1816 (decl_spec_seq_has_spec_p): Declare new function.
1817 * parser.c (cp_parser_check_decl_spec): Remove.
1818 (set_and_check_decl_spec_loc): Define new static function.
1819 (decl_spec_seq_has_spec_p): Define new public function.
1820 (cp_parser_decl_specifier_seq, cp_parser_function_specifier_opt)
1821 (cp_parser_type_specifier, cp_parser_simple_type_specifier)
1822 (cp_parser_set_storage_class, cp_parser_set_decl_spec_type)
1823 (cp_parser_alias_declaration): Set the locations for each
1824 declspec, using set_and_check_decl_spec_loc.
1825 (cp_parser_explicit_instantiation, cp_parser_init_declarator)
1826 (cp_parser_member_declaration, cp_parser_init_declarator): Use the
1827 new declspec location for specifiers. Use the new
1828 decl_spec_seq_has_spec_p.
1829 (cp_parser_type_specifier_seq): Use the new
1830 set_and_check_decl_spec_loc. Stop using
1831 cp_parser_check_decl_spec. Use the new decl_spec_seq_has_spec_p.
1832 (, cp_parser_init_declarator): Use the new
1833 set_and_check_decl_spec_loc.
1834 (cp_parser_single_declaration, cp_parser_friend_p)
1835 (cp_parser_objc_class_ivars, cp_parser_objc_struct_declaration):
1836 Use the new decl_spec_seq_has_spec_p.
1837 * decl.c (check_tag_decl): Use new decl_spec_seq_has_spec_p. Use
1838 the more precise ds_redefined_builtin_type_spec location for
1839 diagnostics about re-declaring C++ built-in types.
1840 (start_decl, grokvardecl, grokdeclarator): Use the new
1841 decl_spec_seq_has_spec_p.
1843 2012-05-15 Paolo Carlini <paolo.carlini@oracle.com>
1846 * pt.c (tsubst_copy_and_build): Increase / decrease
1847 c_inhibit_evaluation_warnings around build_x_binary_op call.
1849 2012-05-12 Paolo Carlini <paolo.carlini@oracle.com>
1851 * cp-tree.h (TYPE_PTRMEM_P): Rename to TYPE_PTRDATAMEM_P.
1852 (TYPE_PTR_TO_MEMBER_P): Rename to TYPE_PTRMEM_P.
1853 (TYPE_PTR_OR_PTRMEM_P): Add.
1854 * typeck.c (composite_pointer_type_r, composite_pointer_type,
1855 common_pointer_type, cp_build_indirect_ref, cp_build_binary_op,
1856 cp_truthvalue_conversion, convert_ptrmem, build_static_cast_1,
1857 build_reinterpret_cast_1, build_const_cast_1, comp_ptr_ttypes_real,
1858 casts_away_constness_r, casts_away_constness): Adjust.
1859 * init.c (build_zero_init_1): Adjust.
1860 * class.c (check_field_decls): Likewise.
1861 * decl.c (check_default_argument): Likewise.
1862 * rtti.c (target_incomplete_p): Likewise.
1863 * tree.c (zero_init_p): Likewise.
1864 * cxx-pretty-print.c (pp_cxx_ptr_operator,
1865 pp_cxx_abstract_declarator): Likewise.
1866 * typeck2.c (build_m_component_ref): Likewise.
1867 * pt.c (convert_nontype_argument, invalid_nontype_parm_type_p,
1868 dependent_type_p_r): Likewise.
1869 * call.c (null_member_pointer_value_p, standard_conversion,
1870 add_builtin_candidate, build_conditional_expr_1, compare_ics):
1872 * cp-objcp-common.c (cp_var_mod_type_p): Likewise.
1873 * cvt.c (cp_convert_to_pointer, ocp_convert,
1874 perform_qualification_conversions): Likewise.
1875 * mangle.c (write_type): Likewise.
1876 * name-lookup.c (arg_assoc_type): Likewise.
1878 2012-05-12 Paolo Carlini <paolo.carlini@oracle.com>
1880 * parser.c (struct cp_parser_expression_stack_entry): Add location_t
1882 (cp_parser_binary_expression): Rework to always update at the same
1883 time tree_type and loc.
1884 * call.c (print_z_candidate): Add location_t parameter.
1885 (print_z_candidates, convert_like_real, joust): Adjust.
1887 2012-05-11 Alexandre Oliva <aoliva@redhat.com>
1890 * pt.c (tsubst_decl): Bail out if argvec is error_mark_node.
1892 2012-05-11 Paolo Carlini <paolo.carlini@oracle.com>
1895 * pt.c (tsubst_copy: case PARM_DECL): Return error_mark_node if
1896 tsubst_decl returns NULL_TREE.
1897 * cxx-pretty-print.c (pp_cxx_simple_type_specifier): Handle
1898 BOUND_TEMPLATE_TEMPLATE_PARM.
1900 2012-05-10 Paolo Carlini <paolo.carlini@oracle.com>
1903 * cvt.c (ocp_convert): Error out early for void -> bool conversions.
1904 * typeck.c (decay_conversion): Use error_at.
1905 * call.c (build_integral_nontype_arg_conv, convert_like_real,
1906 convert_arg_to_ellipsis, perform_implicit_conversion_flags,
1907 initialize_reference): Likewise.
1908 * cvt.c (warn_ref_binding): Add location_t parameter.
1909 (cp_convert_to_pointer, convert_to_reference, ocp_convert,
1910 convert_to_void, ): Use error_at and warning_at.
1912 2012-05-10 Paolo Carlini <paolo.carlini@oracle.com>
1915 * decl.c (check_default_argument): Fix typo (POINTER_TYPE_P
1916 instead of TYPE_PTR_P) in zero-as-null-pointer-constant warning.
1918 2012-05-06 Paolo Carlini <paolo.carlini@oracle.com>
1921 * call.c (op_error, build_new_op_1, build_new_op): Add location_t
1923 (build_conditional_expr_1): Adjust.
1924 * typeck.c (build_x_indirect_ref, build_x_binary_op,
1925 build_x_unary_op): Add location_t parameter.
1926 (rationalize_conditional_expr, build_x_array_ref,
1927 build_x_compound_expr, cp_build_modify_expr, build_x_modify_expr):
1929 * typeck2.c (build_x_arrow): Add location_t parameter.
1930 * semantics.c (finish_unary_op_expr): Likewise.
1931 (finish_increment_expr, handle_omp_for_class_iterator): Adjust.
1932 * decl2.c (grok_array_decl): Add location_t parameter.
1933 * parser.c (cp_parser_postfix_open_square_expression,
1934 cp_parser_postfix_dot_deref_expression, cp_parser_unary_expression,
1935 cp_parser_binary_expression, cp_parser_builtin_offsetof,
1936 do_range_for_auto_deduction, cp_convert_range_for,
1937 cp_parser_template_argument, cp_parser_omp_for_cond): Pass the
1939 * pt.c (tsubst_copy_and_build): Adjust.
1940 * tree.c (maybe_dummy_object): Likewise.
1941 * cp-tree.h: Update declarations.
1943 2012-05-04 Paolo Carlini <paolo.carlini@oracle.com>
1945 * semantics.c (cxx_eval_constant_expression, case CONVERT_EXPR): Tidy.
1947 2012-05-04 Paolo Carlini <paolo.carlini@oracle.com>
1950 * pt.c (instantiate_class_template_1): Increase / decrease
1951 c_inhibit_evaluation_warnings around the tsubst_expr call
1952 for STATIC_ASSERT_CONDITION.
1953 (tsubst_expr, case STATIC_ASSERT): Likewise.
1954 * typeck.c (cp_build_binary_op, case EQ_EXPR/NE_EXPR): Check
1955 c_inhibit_evaluation_warnings in the OPT_Waddress warnings.
1957 2012-05-03 Paolo Carlini <paolo.carlini@oracle.com>
1960 * call.c (build_over_call): Handle final member functions
1962 (build_new_method_call_1): Do not handle here.
1964 2012-05-02 Richard Guenther <rguenther@suse.de>
1966 * decl.c (grokdeclarator): Properly check for sizes that
1967 cover more than half of the address-space.
1969 2012-04-30 Marc Glisse <marc.glisse@inria.fr>
1972 * typeck.c (cp_build_array_ref): Handle VECTOR_TYPE.
1973 * decl2.c (grok_array_decl): Likewise.
1976 * parser.c (cp_parser_sizeof_operand): Require parentheses for
1979 2012-04-30 Dodji Seketeli <dodji@redhat.com>
1981 Fix location for static class members
1982 * decl.c (grokdeclarator): Use the location carried by the
1983 declarator for the DECL of the static class member.
1985 Fix va_arg type location
1986 * cp-tree.h (build_x_va_arg): Take an additional location
1988 * call.c (build_x_va_arg): Take a loc parameter for the location
1989 of the type of the va_arg expression.
1990 * parser.c (cp_parser_primary_expression): Pass the type of the
1991 type in the va_arg expression to build_x_va_arg.
1992 * pt.c (tsubst_copy): Adjust calls to build_x_va_arg.
1994 Make conversion warnings work on NULL with -ftrack-macro-expansion
1995 * call.c (conversion_null_warnings): Use the new
1996 expansion_point_location_if_in_system_header.
1997 * cvt.c (build_expr_type_conversion): Likewise.
1998 * typeck.c (cp_build_binary_op): Likewise.
2000 2012-04-30 Manuel López-Ibåñez <manu@gcc.gnu.org>
2002 * typeck.c (convert_for_assignment): Replace
2003 Wmissing-format-attribute with Wsuggest-attribute=format.
2004 * call.c (convert_for_arg_passing): Likewise.
2006 2012-04-26 Paolo Carlini <paolo.carlini@oracle.com>
2009 * class.c (check_bases_and_members): Implement core/1333, do not
2010 disallow defaulted in the class body non-const ref special members.
2012 2012-04-24 Paolo Carlini <paolo.carlini@oracle.com>
2015 * call.c (tourney, perform_overload_resolution,
2016 build_operator_new_call, build_user_type_conversion_1,
2017 build_user_type_conversion, perform_overload_resolution,
2018 add_template_candidate, add_template_candidate_real,
2019 add_template_conv_candidate, add_builtin_candidates,
2020 add_builtin_candidate, build_builtin_candidate,
2021 add_conv_candidate, add_function_candidate, implicit_conversion,
2022 reference_binding, build_list_conv, conditional_conversion,
2023 add_candidates, can_convert_array, build_aggr_conv,
2024 build_array_conv, build_complex_conv, conditional_conversion):
2025 Add tsubst_flags_t parameter.
2026 (joust): Likewise, use it to handle SFINAE as if pedantic.
2027 (add_list_candidates, build_integral_nontype_arg_conv,
2028 perform_overload_resolution, build_new_function_call,
2029 build_operator_new_call, build_op_call_1,
2030 build_conditional_expr_1, build_new_op_1, convert_like_real,
2031 convert_arg_to_ellipsis, convert_default_arg,
2032 convert_for_arg_passing, build_over_call,
2033 build_new_method_call_1, can_convert_arg, can_convert_arg_bad,
2034 perform_implicit_conversion_flags,
2035 perform_direct_initialization_if_possible,
2036 initialize_reference): Adjust.
2037 * typeck.c (casts_away_constness, casts_away_constness_r):
2038 Add tsubst_flags_t parameter.
2039 (convert_arguments, check_for_casting_away_constness,
2040 build_static_cast_1, build_ptrmemfunc, convert_for_assignment):
2042 * decl.c (reshape_init_r, check_default_argument): Likewise.
2043 * cp-gimplify.c (cxx_omp_clause_apply_fn): Likewise.
2044 * pt.c (convert_nontype_argument, check_non_deducible_conversion):
2046 * init.c (build_new_1): Likewise.
2047 * cvt.c (convert_to_reference, ocp_convert, build_type_conversion,
2048 build_expr_type_conversion, ): Likewise.
2049 * search.c (check_final_overrider): Likewise.
2050 * cp-tree.h (build_user_type_conversion,
2051 build_operator_new_call, can_convert, can_convert_arg,
2052 can_convert_arg_bad, convert_default_arg,
2053 convert_arg_to_ellipsis, convert_for_arg_passing):
2056 2012-04-22 Jan Hubicka <jh@suse.cz>
2058 * decl2.c (maybe_make_one_only): Mark keyed COMDATs as USED so they
2061 2012-04-22 Manuel López-Ibåñez <manu@gcc.gnu.org>
2064 * typeck.c (composite_pointer_type): Likewise.
2065 (cxx_sizeof_or_alignof_type): Likewise.
2066 (cp_build_array_ref): Likewise.
2067 (cp_build_function_call_vec): Likewise.
2068 (cp_build_addr_expr_1): Likewise.
2069 (convert_member_func_to_ptr): Likewise.
2070 * decl.c (check_tag_decl): Likewise.
2071 (check_static_variable_definition): Likewise.
2072 (compute_array_index_type): Likewise.
2073 (create_array_type_for_decl): Likewise.
2074 (grokdeclarator): Likewise.
2075 (grok_op_properties): Likewise.
2076 * error.c (maybe_warn_cpp0x): Likewise.
2077 * pt.c (maybe_process_partial_specialization): Likewise.
2078 (convert_template_argument): Likewise.
2079 (do_decl_instantiation): Likewise.
2080 (do_type_instantiation): Likewise.
2081 * parser.c (cp_parser_primary_expression): Likewise.
2082 (cp_parser_postfix_expression): Likewise.
2083 (cp_parser_unary_expression): Likewise.
2084 (cp_parser_question_colon_clause): Likewise.
2085 (cp_parser_lambda_introducer): Likewise.
2086 (cp_parser_lambda_declarator_opt): Likewise.
2087 (cp_parser_compound_statement): Likewise.
2088 (cp_parser_jump_statement): Likewise.
2089 (cp_parser_declaration_seq_opt): Likewise.
2090 (cp_parser_enum_specifier): Likewise.
2091 (cp_parser_enumerator_list): Likewise.
2092 (cp_parser_initializer_list): Likewise.
2093 (cp_parser_member_declaration): Likewise.
2094 * call.c (build_conditional_expr_1): Likewise.
2095 * friend.c (make_friend_class): Likewise.
2096 * name-lookup.c (pushdecl_maybe_friend_1): Likewise.
2098 2012-04-21 Jan Hubicka <jh@suse.cz>
2100 * method.c (make_alias_for): Do not set TREE_SYMBOL_REFERENCED.
2101 * decl2.c (mark_needed): Likewise.
2102 (decl_needed_p): Do not test TREE_SYMBOL_REFERENCED.
2104 * decl2.c (cxx_callgraph_analyze_expr): Remove.
2105 * cp-objcp-common.h (LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR): Remove.
2106 * cp-tree.h (cxx_callgraph_analyze_expr): Remove.
2108 2012-04-21 Manuel López-Ibåñez <manu@gcc.gnu.org>
2111 * typeck.c (cp_build_function_call_vec): Do not pretty-print
2112 expressions when caret is enabled.
2114 2012-04-20 Jan Hubicka <jh@suse.cz>
2117 * decl2.c (maybe_emit_vtables): Do not initialize same_comdat_group
2118 list when target has no support for it.
2120 2012-04-20 Michael Matz <matz@suse.de>
2122 * error.c (pedwarn_cxx98): Move va_end call after user
2125 2012-04-18 Paolo Carlini <paolo.carlini@oracle.com>
2128 * cp-tree.h (build_addr_func, decay_conversion,
2129 get_member_function_from_ptrfunc,
2130 build_m_component_ref, convert_member_func_to_ptr):
2131 Add tsubst_flags_t parameter.
2132 * typeck.c (cp_default_conversion): Add.
2133 (decay_conversion, default_conversion,
2134 get_member_function_from_ptrfunc, convert_member_func_to_ptr):
2135 Add tsubst_flags_t parameter and use it throughout.
2136 (cp_build_indirect_ref, cp_build_array_ref,
2137 cp_build_function_call_vec, convert_arguments, build_x_binary_op,
2138 cp_build_binary_op, cp_build_unary_op, build_reinterpret_cast_1,
2139 build_const_cast_1, expand_ptrmemfunc_cst,
2140 convert_for_initialization): Adjust.
2141 * init.c (build_vec_init): Adjust.
2142 * decl.c (grok_reference_init, get_atexit_node): Likewise.
2143 * rtti.c (build_dynamic_cast_1, tinfo_base_init): Likewise.
2144 * except.c (build_throw): Likewise.
2145 * typeck2.c (build_x_arrow): Likewise.
2146 (build_m_component_ref): Add tsubst_flags_t parameter and
2148 * pt.c (convert_nontype_argument): Adjust.
2149 * semantics.c (finish_asm_stmt, maybe_add_lambda_conv_op): Likewise.
2150 * decl2.c (build_offset_ref_call_from_tree): Likewise.
2151 * call.c (build_addr_func): Add tsubst_flags_t parameter and
2153 (build_call_a, build_conditional_expr_1, build_new_op_1,
2154 convert_like_real, convert_arg_to_ellipsis, build_over_call,
2155 build_special_member_call): Adjust.
2156 * cvt.c (cp_convert_to_pointer, force_rvalue,
2157 build_expr_type_conversion): Likewise.
2159 2012-04-17 Tom de Vries <tom@codesourcery.com>
2161 * cp-gimplify.c (begin_bc_block): Add location parameter and use as
2162 location argument to create_artificial_label.
2163 (finish_bc_block): Change return type to void. Remove body_seq
2164 parameter, and add block parameter. Append label to STMT_LIST and
2166 (gimplify_cp_loop, gimplify_for_stmt, gimplify_while_stmt)
2167 (gimplify_do_stmt, gimplify_switch_stmt): Remove function.
2168 (genericize_cp_loop, genericize_for_stmt, genericize_while_stmt)
2169 (genericize_do_stmt, genericize_switch_stmt, genericize_continue_stmt)
2170 (genericize_break_stmt, genericize_omp_for_stmt): New function.
2171 (cp_gimplify_omp_for): Remove bc_continue processing.
2172 (cp_gimplify_expr): Genericize VEC_INIT_EXPR.
2173 (cp_gimplify_expr): Mark FOR_STMT, WHILE_STMT, DO_STMT, SWITCH_STMT,
2174 CONTINUE_STMT, and BREAK_STMT as unreachable.
2175 (cp_genericize_r): Genericize FOR_STMT, WHILE_STMT, DO_STMT,
2176 SWITCH_STMT, CONTINUE_STMT, BREAK_STMT and OMP_FOR.
2177 (cp_genericize_tree): New function, factored out of ...
2178 (cp_genericize): ... this function.
2180 2012-04-17 Paolo Carlini <paolo.carlini@oracle.com>
2183 * semantics.c (build_constexpr_constructor_member_initializers):
2184 Check for function-try-block as function-body.
2186 2012-04-17 Paolo Carlini <paolo.carlini@oracle.com>
2189 * parser.c (cp_parser_member_declaration): Check that
2190 initializer_token_start is non null before dereferencing it.
2192 2012-04-16 Jason Merrill <jason@redhat.com>
2195 * pt.c (determine_specialization): Instead of comparing the number
2196 of parms, check that tsubst gives the right answer.
2199 * pt.c (process_partial_specialization): Complain about a partial
2200 specialization with fewer args than primary template parms.
2203 * pt.c (convert_template_argument): Handle template template
2207 * pt.c (tsubst_pack_expansion): Use tsubst_expr for template
2208 template parameters.
2210 2012-04-16 Paolo Carlini <paolo.carlini@oracle.com>
2213 * call.c (op_error): Print types; when flag_diagnostics_show_caret
2214 is false print expressions too.
2215 (op_error_string): Add.
2217 2012-04-16 Jason Merrill <jason@redhat.com>
2220 * friend.c (make_friend_class): Call check_for_bare_parameter_packs.
2222 2012-04-16 Jan Hubicka <jh@suse.cz>
2224 * decl2.c (collect_candidates_for_java_method_alias): Use FOR_EACH
2225 walkers to walk cgraph and varpool.
2227 2012-04-15 Jason Merrill <jason@redhat.com>
2230 * pt.c (coerce_template_parameter_pack): Check for error_mark_node.
2234 * pt.c (coerce_template_parms): Even if we aren't converting we
2235 want to expand argument packs.
2238 * mangle.c (write_type): nullptr_t is a builtin type.
2240 2012-04-14 Jan Hubicka <jh@suse.cz>
2242 * tree.c: Update field referenced for new cgraph/varpool layout.
2243 * decl2.c: Likewise.
2245 2012-04-13 Jason Merrill <jason@redhat.com>
2248 * pt.c (any_pack_expanson_args_p): New.
2249 (coerce_template_parms): Use it.
2252 * call.c (joust): Handle comparing list and non-list ctors.
2255 * decl2.c (finish_anon_union): Use cp_finish_decl.
2256 * error.c (dump_function_name): Avoid showing anonymous "name".
2258 2012-04-11 Fabien ChĂȘne <fabien@gcc.gnu.org>
2261 * parser.c (cp_parser_class_name): Call strip_using_decl and
2262 return the target decl.
2263 * name-lookup.c (strip_using_decl): Returns NULL_TREE if the decl
2264 to be stripped is NULL_TREE.
2265 (qualify_lookup): Call strip_using_decl and perform some checks on
2268 2012-04-11 Jason Merrill <jason@redhat.com>
2271 * decl.c (grokdeclarator): Strip the injected-class-name typedef
2272 if we are building a declaration or compound type.
2275 * decl.c (check_tag_decl): Don't complain about attributes if we
2276 don't even have a type.
2278 2012-04-10 Manuel López-Ibåñez <manu@gcc.gnu.org>
2280 * cvt.c (convert_to_void): Update comment.
2282 2012-04-05 Jason Merrill <jason@redhat.com>
2285 * semantics.c (finish_non_static_data_member): In templates, pass
2286 the decl to build_qualified_name.
2287 * tree.c (lvalue_kind) [SCOPE_REF]: Handle FIELD_DECL.
2289 2012-04-04 Jason Merrill <jason@redhat.com>
2292 * decl.c (finish_function): Update fntype after deducing return type.
2294 2012-04-03 Jason Merrill <jason@redhat.com>
2297 * pt.c (tsubst_initializer_list): A pack expansion with no elements
2298 means value-initialization.
2300 2012-04-01 Paolo Carlini <paolo.carlini@oracle.com>
2303 * class.c (deduce_noexcept_on_destructor,
2304 deduce_noexcept_on_destructors): New.
2305 (check_bases_and_members): Call the latter.
2306 * decl.c (grokfndecl): Call the former.
2307 * method.c (implicitly_declare_fn): Not static.
2308 * cp-tree.h (deduce_noexcept_on_destructor, implicitly_declare_fn):
2311 2012-03-29 Paolo Carlini <paolo.carlini@oracle.com>
2314 * decl.c (check_default_argument): With -Wzero-as-null-pointer-constant
2315 warn for a zero as null pointer constant default argument.
2317 2012-03-29 Jason Merrill <jason@redhat.com>
2320 * tree.c (copy_binfo): Handle BINFO_DEPENDENT_BASE_P.
2322 2012-03-29 Jakub Jelinek <jakub@redhat.com>
2325 * decl.c (start_decl): Don't call maybe_apply_pragma_weak
2326 if processing_template_decl.
2328 2012-03-29 Jason Merrill <jason@redhat.com>
2331 * call.c (compare_ics): Handle ck_aggr like ck_list.
2333 2012-03-28 Jason Merrill <jason@redhat.com>
2336 * typeck.c (lookup_destructor): Clear BASELINK_QUALIFIED_P if
2337 we didn't get an explicit scope.
2338 * pt.c (tsubst_baselink): Likewise.
2340 2012-03-28 Richard Guenther <rguenther@suse.de>
2342 * typeck2.c (process_init_constructor_array): Use the proper
2343 type for computing the array length.
2345 2012-03-27 Meador Inge <meadori@codesourcery.com>
2348 * semantics.c (cxx_fold_indirect_ref): Don't attempt to fold
2349 stripped child trees that are not pointer types.
2351 2012-03-21 Jason Merrill <jason@redhat.com>
2353 Implement return type deduction for normal functions with -std=c++1y.
2354 * cp-tree.h (FNDECL_USED_AUTO): New macro.
2355 (LAMBDA_EXPR_DEDUCE_RETURN_TYPE_P): Remove.
2356 (dependent_lambda_return_type_node): Remove.
2357 (CPTI_DEPENDENT_LAMBDA_RETURN_TYPE): Remove.
2358 (struct language_function): Add x_auto_return_pattern field.
2359 (current_function_auto_return_pattern): New.
2360 (enum tsubst_flags): Add tf_partial.
2361 * decl.c (decls_match): Handle auto return comparison.
2362 (duplicate_decls): Adjust error message for auto return.
2363 (cxx_init_decl_processing): Remove dependent_lambda_return_type_node.
2364 (cp_finish_decl): Don't do auto deduction for functions.
2365 (grokdeclarator): Allow auto return without trailing return type in
2367 (check_function_type): Defer checking of deduced return type.
2368 (start_preparsed_function): Set current_function_auto_return_pattern.
2369 (finish_function): Set deduced return type to void if not previously
2371 * decl2.c (change_return_type): Handle error_mark_node.
2372 (mark_used): Always instantiate functions with deduced return type.
2373 Complain about use if deduction isn't done.
2374 * parser.c (cp_parser_lambda_declarator_opt): Use 'auto' for
2375 initial return type.
2376 (cp_parser_lambda_body): Don't deduce return type in a template.
2377 (cp_parser_conversion_type_id): Allow auto in C++1y.
2378 * pt.c (instantiate_class_template_1): Don't mess with
2379 LAMBDA_EXPR_DEDUCE_RETURN_TYPE_P.
2380 (tsubst_copy_and_build): Likewise.
2381 (fn_type_unification, tsubst): Don't reduce the template parm level
2382 of 'auto' during deduction.
2383 (unify): Compare 'auto' specially.
2384 (get_bindings): Change test.
2385 (always_instantiate_p): Always instantiate functions with deduced
2387 (do_auto_deduction): Handle error_mark_node and lambda context.
2388 Don't check for use in initializer.
2389 (contains_auto_r): Remove.
2390 * search.c (lookup_conversions_r): Handle auto conversion function.
2391 * semantics.c (lambda_return_type): Handle null return. Don't mess
2392 with dependent_lambda_return_type_node.
2393 (apply_deduced_return_type): Rename from apply_lambda_return_type.
2394 * typeck.c (merge_types): Handle auto.
2395 (check_return_expr): Do auto deduction.
2396 * typeck2.c (add_exception_specifier): Fix complain check.
2398 2012-03-22 Paolo Carlini <paolo.carlini@oracle.com>
2401 * class.c (check_field_decls): Call literal_type_p only
2404 2012-03-22 Jakub Jelinek <jakub@redhat.com>
2407 * decl.c (check_tag_decl): Only use CLASSTYPE_TEMPLATE_INSTANTIATION
2408 on CLASS_TYPE_P types.
2410 2012-03-20 Jason Merrill <jason@redhat.com>
2412 * lex.c (init_reswords): Use >= for cxx_dialect test.
2413 * parser.c (cp_parser_exception_specification_opt): Likewise.
2415 * mangle.c (write_type): Handle 'auto'.
2416 * init.c (build_new): Don't do auto deduction where it might
2417 affect template mangling.
2420 * decl.c (reshape_init_class): Handle repeated reshaping.
2421 * search.c (lookup_field_1): Add sanity check.
2423 2012-03-19 Paolo Carlini <paolo.carlini@oracle.com>
2426 * cp-tree.h (xvalue_p, maybe_warn_about_useless_cast): Declare.
2427 * tree.c (xvalue_p): Define.
2428 * typeck.c (maybe_warn_about_useless_cast): Define.
2429 (build_reinterpret_cast, build_const_cast,
2430 build_static_cast, cp_build_c_cast): Use maybe_warn_about_useless_cast.
2431 * rtti.c (build_dynamic_cast): Likewise.
2432 * pt.c (tsubst_copy_and_build, case CAST_EXPR): Increment/decrement
2433 c_inhibit_evaluation_warnings before/after the build_* calls.
2435 2012-03-15 Jason Merrill <jason@redhat.com>
2438 * method.c (implicitly_declare_fn): Set DECL_EXTERNAL.
2440 2012-03-15 Manuel López-Ibåñez <manu@gcc.gnu.org>
2443 * error.c (print_instantiation_partial_context): Use
2444 template_backtrace_limit.
2446 2012-03-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2448 * Make-lang.in (doc/g++.1): Remove IRIX 6.5 reference.
2450 2012-03-14 Jakub Jelinek <jakub@redhat.com>
2453 * parser.c (lookup_literal_operator): Return fn only if
2454 processed all arguments from args vector and argtypes is
2457 2012-01-30 Dodji Seketeli <dodji@redhat.com>
2460 * cp-tree.h (template_type_parameter_p): Declare new function.
2461 (parameter_of_template_p): Remove.
2462 * pt.c (template_type_parameter_p): Define new function.
2463 (parameter_of_template_p): Remove.
2464 * name-lookup.c (binding_to_template_parms_of_scope_p): Don't rely
2465 on parameter_of_template_p anymore. Compare the level of the
2466 template parameter to the depth of the template.
2468 2011-12-15 Dodji Seketeli <dodji@redhat.com>
2470 * call.c (standard_conversion, build_integral_nontype_arg_conv)
2471 (build_new_op_1, convert_like_real, is_subseq)
2472 (maybe_handle_implicit_object, maybe_handle_ref_bind, compare_ics)
2473 (joust): Use next_conversion instead of accessing fields of struct
2474 conversion directly.
2476 2012-03-12 Paolo Carlini <paolo.carlini@oracle.com>
2479 * pt.c (tsubst_copy_and_build, case COND_EXPR): Avoid bogus
2480 division by zero warnings.
2482 2012-03-08 Paolo Carlini <paolo.carlini@oracle.com>
2484 * typeck.c (build_array_ref, cp_build_addr_expr_1, convert_ptrmem,
2485 build_ptrmemfunc): Consistently forward the tsubst_flags_t
2487 * call.c (resolve_args): Likewise.
2489 2012-03-07 Jason Merrill <jason@redhat.com>
2492 * mangle.c (write_literal_operator_name): The length comes after the
2495 2012-03-05 Jakub Jelinek <jakub@redhat.com>
2497 * pt.c (local_specializations): Change from htab_t into
2498 struct pointer_map_t *.
2499 (retrieve_local_specializations, register_local_specialization,
2500 tsubst_pack_expansion, instantiate_decl): Adjust users.
2501 (eq_local_specializations, hash_local_specialization): Remove.
2503 2012-03-05 Jason Merrill <jason@redhat.com>
2506 * decl2.c (determine_visibility): Correct calculation of class
2508 * decl.c (check_tag_decl): Adjust warning.
2510 * method.c (synthesized_method_walk): Cleanups don't affect the EH
2513 2012-03-03 Jason Merrill <jason@redhat.com>
2515 * init.c (perform_member_init): Cope with uninstantiated NSDMI.
2518 * call.c (build_aggr_conv): Call reshape_init.
2519 (convert_like_real): Likewise.
2520 * typeck2.c (process_init_constructor): Clear TREE_CONSTANT if
2523 * mangle.c (write_nested_name): Use decl_mangling_context.
2524 (write_prefix, write_template_prefix): Likewise.
2527 * mangle.c (write_expression): Improve diagnostic for TRAIT_EXPR.
2529 * class.c (add_method): Always build an OVERLOAD for using-decls.
2530 * search.c (lookup_member): Handle getting an OVERLOAD for a
2533 2012-03-02 Paolo Carlini <paolo.carlini@oracle.com>
2536 * typeck2.c (build_x_arrow): Take a tsubst_flags_t argument and
2538 * cp-tree.h (build_x_arrow): Adjust prototype.
2539 * pt.c (tsubst_copy_and_build): Adjust call.
2540 * parser.c (cp_parser_postfix_dot_deref_expression): Likewise.
2542 2012-03-02 Paolo Carlini <paolo.carlini@oracle.com>
2544 * name-lookup.c (binding_to_template_parms_of_scope_p): Clean up.
2546 2012-02-29 Jason Merrill <jason@redhat.com>
2549 * decl.c (check_tag_decl): Move warning for misplaced attributes here.
2550 (shadow_tag): From here.
2551 * parser.c (cp_parser_explicit_instantiation): Don't warn here.
2553 2012-02-21 Jakub Jelinek <jakub@redhat.com>
2556 * typeck.c (check_literal_operator_args): Initialize *long_double_p
2557 and *long_long_unsigned_p even if processing_template_decl.
2559 2012-02-16 Jason Merrill <jason@redhat.com>
2562 * decl.c (define_label): Use timevar_cond_start/stop.
2564 2012-02-16 Fabien ChĂȘne <fabien@gcc.gnu.org>
2567 * decl.c (xref_basetypes): call dependent_scope_p instead of
2570 2012-02-16 Jason Merrill <jason@redhat.com>
2573 * error.c (dump_expr): Handle lambda closures specifically.
2575 2012-02-14 Jason Merrill <jason@redhat.com>
2577 * parser.c (cp_parser_explicit_instantiation): Give a warning
2578 for ignored attributes on explicit class instantiation.
2580 2012-02-14 Jakub Jelinek <jakub@redhat.com>
2583 * pt.c (tsubst_copy_asm_operands): For LABEL_DECL values call
2584 lookup_label on label's name and set TREE_USED.
2586 2012-02-14 Jason Merrill <jason@redhat.com>
2589 * decl.c (local_variable_p_walkfn): Don't check DECL_ARTIFICIAL.
2591 2012-02-14 Jakub Jelinek <jakub@redhat.com>
2594 * decl.c (duplicate_decls): If olddecl has bigger DECL_ALIGN than
2595 newdecl, copy DECL_ALIGN to newdecl and or DECL_USER_ALIGN bits.
2597 2012-02-07 Jason Merrill <jason@redhat.com>
2600 * semantics.c (cx_check_missing_mem_inits): Handle unions.
2601 Fix constexpr default constructor logic.
2604 * pt.c (tsubst): Strip uninstantiated typedef.
2606 2012-02-06 Jason Merrill <jason@redhat.com>
2609 * cvt.c (build_expr_type_conversion): Check for template conversion.
2611 2012-01-31 Jason Merrill <jason@redhat.com>
2614 * cp-tree.h (PACK_EXPANSION_LOCAL_P): New.
2615 * pt.c (make_pack_expansion, tsubst_initializer_list): Set it.
2616 (tsubst_pack_expansion): Check it.
2618 2012-01-29 Paolo Carlini <paolo.carlini@oracle.com>
2621 * class.c (explain_non_literal_class): Correctly handle implicitly
2622 deleted constructors.
2624 2012-01-27 Jakub Jelinek <jakub@redhat.com>
2627 * pt.c (tsubst_pack_expansion): Delete and restore
2628 local_specialization whenever need_local_specialization, not just
2629 when saved_local_specializations is non-NULL.
2631 2012-01-26 Paolo Carlini <paolo.carlini@oracle.com>
2634 * error.c (dump_decl, [TEMPLATE_ID_EXPR]): Handle error_mark_node
2635 as TREE_OPERAND (t, 1).
2637 2012-01-24 Jason Merrill <jason@redhat.com>
2640 * decl.c (xref_basetypes): Check VEC_length instead of VEC_space.
2643 * tree.c (called_fns_equal): Check template args.
2644 (cp_tree_equal): Call it.
2646 2012-01-24 Aldy Hernandez <aldyh@redhat.com>
2647 Patrick Marlier <patrick.marlier@gmail.com>
2650 * class.c (set_method_tm_attributes): Use TARGET_THUNK instead of
2651 thunk for set_one_vmethod_tm_attributes.
2653 2012-01-24 Paolo Carlini <paolo.carlini@oracle.com>
2656 * call.c (build_over_call): Check for error_mark_node as
2657 TREE_VALUE when default arguments are processed.
2659 2012-01-23 Jason Merrill <jason@redhat.com>
2662 * decl2.c (determine_visibility): Check for visibility attribute
2663 on template specialization.
2665 2012-01-23 Paolo Carlini <paolo.carlini@oracle.com>
2668 * pt.c (parameter_of_template_p): Skip error_mark_node parameters.
2670 2012-01-23 Jason Merrill <jason@redhat.com>
2673 * class.c (add_method): Set OVL_USED for using-decls.
2674 * tree.c (ovl_scope): New.
2675 * cp-tree.h: Declare it.
2676 * parser.c (cp_parser_template_name): Use it.
2677 * semantics.c (baselink_for_fns): Likewise.
2678 * name-lookup.c (set_inherited_value_binding_p): Likewise.
2680 2012-01-20 Paolo Carlini <paolo.carlini@oracle.com>
2683 * pt.c (lookup_template_class_1): Check context returned by
2684 tsubst for error_mark_node.
2686 2012-01-19 Kai Tietz <ktietz@redhat.com>
2689 * decl2.c (save_template_attributes): Use merge_attributes
2690 instead of chaining up via TREE_CHAIN.
2692 2012-01-19 Jason Merrill <jason@redhat.com>
2695 * class.c (finish_struct): Call add_method here for function usings.
2696 * semantics.c (finish_member_declaration): Not here.
2698 2012-01-18 Paolo Carlini <paolo.carlini@oracle.com>
2701 * typeck2.c (store_init_value): Within a template guard
2702 cxx_constant_value with require_potential_constant_expression.
2703 * pt.c (convert_nontype_argument): Likewise.
2705 2012-01-16 Jakub Jelinek <jakub@redhat.com>
2708 * mangle.c (write_template_arg_literal): Handle complex.
2710 2012-01-16 Jason Merrill <jason@redhat.com>
2713 * mangle.c (mangle_decl): Don't mangle uninstantiated templates.
2716 * typeck.c (build_static_cast_1): Handle bit-fields properly.
2718 2012-01-13 Ian Lance Taylor <iant@google.com>
2721 * typeck.c (enum_cast_to_int): New static function.
2722 (cp_build_binary_op): When handling warn_sign_compare, don't test
2723 for TREE_NO_WARNING. Do call enum_cast_to_int.
2724 * call.c (avoid_sign_compare_warnings): Remove static function.
2725 (build_new_op_1): Don't call avoid_sign_compare_warnings.
2727 2012-01-13 Steven Bosscher <steven@gcc.gnu.org>
2729 * decl2.c: Do not include tree-mudflap.h
2730 * semantics.c: Likewise.
2732 2012-01-13 Jason Merrill <jason@redhat.com>
2735 * semantics.c (finish_break_stmt): Avoid adding an unreachable
2739 * decl2.c (constrain_visibility): Clear DECL_VISIBILITY_SPECIFIED
2740 when reducing the visibility.
2743 * class.c (build_vtbl_initializer): Use __cxa_deleted_virtual.
2745 2012-01-12 Jason Merrill <jason@redhat.com>
2748 * pt.c (value_dependent_expression_p): Treat STMT_EXPR as
2751 2012-01-13 Dodji Seketeli <dodji@redhat.com>
2754 * semantics.c (cp_parser_ctor_initializer_opt_and_function_body):
2755 Set the pointer to the last block of the constructor to the
2757 (build_constexpr_constructor_member_initializers): Get
2758 build_data_member_initialization a chance to deal with more
2759 statements before we choke.
2761 2012-01-12 Jason Merrill <jason@redhat.com>
2764 * mangle.c (write_expression): Mangle BASELINK scope if
2765 BASELINK_QUALIFIED_P.
2766 * search.c (adjust_result_of_qualified_name_lookup): Set
2767 BASELINK_QUALIFIED_P.
2768 * tree.c (cp_tree_equal) [BASELINK]: Compare BASELINK_QUALIFIED_P.
2769 * parser.c (cp_parser_postfix_dot_deref_expression): Don't call
2770 adjust_result_of_qualified_name_lookup for non-qualified names.
2773 * pt.c (unify): Handle error_mark_node.
2775 2012-01-11 Jason Merrill <jason@redhat.com>
2778 * call.c (standard_conversion): For ptrmemfuncs, compare the
2782 * mangle.c (find_substitution): A type is only a substitution
2783 match if we're looking for a type.
2784 (write_nested_name): Use decl_mangling_context.
2786 * decl.c (decls_match): Assert that the arguments are decls.
2789 * pt.c (resolve_overloaded_unification): Compare types with
2790 same_type_p, not decls_match.
2792 2012-01-10 Jason Merrill <jason@redhat.com>
2795 * class.c (build_base_path): Diagnose ambiguous base.
2798 * semantics.c (cxx_eval_call_expression): Always retry previously
2799 non-constant expressions.
2801 2012-01-06 Jason Merrill <jason@redhat.com>
2805 * parser.c (cp_parser_new_expression): Set
2806 type_definition_forbidden_message.
2812 * mangle.c (write_expression): Support NEW_EXPR, DELETE_EXPR,
2813 THROW_EXPR, CONSTRUCTOR, OVERLOAD. Fix PREINCREMENT_EXPR and
2815 (write_template_arg): Fix mangling of class-scope functions and
2817 (mangle_decl): Update suggested -fabi-version argument.
2818 * operators.def: Add DOTSTAR_EXPR, REINTERPRET_CAST_EXPR,
2819 DYNAMIC_CAST_EXPR; correct CONST_CAST_EXPR, STATIC_CAST_EXPR.
2820 * tree.c (dependent_name): No longer static.
2821 * cp-tree.h: Declare it.
2822 * pt.c (unify): Defer handling of unconverted functions.
2824 * mangle.c (mangle_decl): Don't generate mangling aliases
2825 for maybe-in-charge [cd]tors.
2827 * error.c (dump_expr): Print type of CONSTRUCTOR.
2829 2012-01-05 Dodji Seketeli <dodji@redhat.com>
2832 * parser.c (cp_parser_alias_declaration): Get out early upon
2833 errors in the identifier or the attributes.
2835 2012-01-04 Paolo Carlini <paolo.carlini@oracle.com>
2838 * pt.c (tsubst_copy_and_build): Maybe set TREE_NO_WARNING on
2839 the tree returned by build_x_binary_op.
2841 2012-01-03 Paolo Carlini <paolo.carlini@oracle.com>
2844 * parser.c (cp_parser_postfix_open_square_expression): Handle
2845 postfix-expression [ braced-init-list ].
2847 2012-01-03 Paolo Carlini <paolo.carlini@oracle.com>
2850 * rtti.c (build_dynamic_cast_1): In case of T a pointer type,
2851 call decay_conversion on v.
2853 2012-01-03 Paolo Carlini <paolo.carlini@oracle.com>
2856 * decl.c (duplicate_decls): With -Wredundant-decls don't warn for
2857 declaration followed by specialization.
2859 2012-01-03 Jakub Jelinek <jakub@redhat.com>
2862 * semantics.c (finish_omp_clauses): Call fold_build_cleanup_point_expr
2863 on OMP_CLAUSE_{IF,FINAL,NUM_THREADS,SCHEDULE_CHUNK}_EXPR.
2865 2012-01-02 Jason Merrill <jason@redhat.com>
2869 * method.c (walk_field_subobs): Don't check for uninitialized
2871 (synthesized_method_walk): Check here.
2875 * parser.c (cp_parser_cache_defarg): Split out...
2876 (cp_parser_parameter_declaration): ...from here.
2877 (cp_parser_save_nsdmi): Use it.
2878 (cp_parser_cache_group): Remove CPP_COMMA support.
2880 2012-01-02 Dodji Seketeli <dodji@redhat.com>
2883 * semantics.c (cx_check_missing_mem_inits): Don't assert in case
2886 2012-01-02 Paolo Carlini <paolo.carlini@oracle.com>
2889 * typeck2.c (digest_init_r): Use copy_init when initializing
2892 2012-01-01 Paolo Carlini <paolo.carlini@oracle.com>
2895 * decl.c (build_enumerator): Don't call perform_integral_promotions
2898 2012-01-01 Paolo Carlini <paolo.carlini@oracle.com>
2901 * typeck.c (build_reinterpret_cast_1): Implement resolution of
2904 2012-01-01 Fabien ChĂȘne <fabien@gcc.gnu.org>
2906 * parser.c (cp_parser_using_declaration): Add a warning about
2907 deprecated access declarations when no errors were encountered
2908 while parsing the access declaration. Save the first token in
2909 order to emit the warning at the right place.
2911 Copyright (C) 2012 Free Software Foundation, Inc.
2913 Copying and distribution of this file, with or without modification,
2914 are permitted in any medium without royalty provided the copyright
2915 notice and this notice are preserved.