1 2007-11-29 Jakub Jelinek <jakub@redhat.com>
5 * parser.c (cp_parser_decltype): Don't call finish_id_expression
7 * semantics.c (finish_decltype_type): Issue error on types, TYPE_DECLs
10 2007-11-27 Jakub Jelinek <jakub@redhat.com>
12 PR tree-optimization/34181
13 * method.c (use_thunk): Don't inline the call in the thunk.
16 * tree.c (decl_linkage): Static data members and static member
17 functions in anonymous ns classes are lk_external.
19 2007-11-26 Andreas Krebbel <krebbel1@de.ibm.com>
22 * decl.c (start_preparsed_function): Pass
23 processing_template_decl for the new allocate_struct_function
26 2007-11-25 Richard Guenther <rguenther@suse.de>
28 decl.c (poplevel): Use BLOCK_CHAIN.
30 2007-11-24 Ollie Wild <aaw@google.com>
32 * typeck.c (delta_from_ptrmemfunc): New function.
33 (get_member_function_from_ptrfunc): Call delta_from_ptrmemfunc.
34 (build_binary_op): Call delta_from_ptrmemfunc.
36 2007-11-23 Jakub Jelinek <jakub@redhat.com>
40 * decl.c (cp_finish_decl): Disallow variable or field
41 definitions if extern "Java" aggregates.
42 (grokparms): Disallow parameters with extern "Java"
44 (check_function_type): Disallow function return values
45 with extern "Java" aggregates.
46 * init.c (build_new_1): Disallow placement new with
47 extern "Java" aggregates.
49 2007-11-23 Mark Mitchell <mark@codesourcery.com>
50 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
53 * call.c (convert_like_real): Build a zero constant when __null is
54 converted to an integer type.
56 2007-11-22 Jakub Jelinek <jakub@redhat.com>
59 * decl2.c (cp_write_global_declarations): Issue error about static
60 data members in anonymous namespace which are declared and used,
63 2007-11-20 Jakub Jelinek <jakub@redhat.com>
66 * parser.c (cp_parser_class_head): Reject function template ids.
69 * tree.c (build_cplus_array_type_1): Don't pass any VLA types
70 when processing_template_decl to build_array_type.
73 * pt.c (more_specialized_fn): Don't segfault if one or
74 both argument list end with ellipsis.
76 2007-11-18 Jakub Jelinek <jakub@redhat.com>
79 * semantics.c (finish_call_expr): Set
80 current_function_returns_abnormally if fn is noreturn FUNCTION_DECL
81 or OVERLOAD with all noreturn functions.
83 2007-11-16 Jakub Jelinek <jakub@redhat.com>
86 * pt.c (apply_late_template_attributes): Do nothing if decl's type is
89 2007-11-13 Jakub Jelinek <jakub@redhat.com>
96 * pt.c (find_parameter_packs_r): If ppd->set_packs_to_error,
97 set to error_mark_node the outermost POINTER_TYPE to the pack if
98 it is seen in a POINTER_TYPE.
99 (push_template_decl_real): If check_for_bare_parameter_packs
100 fails for function return type, set the return type to
101 integer_type_node. If check_for_bare_parameter_packs failed
102 for non-function, return error_mark_node.
105 * call.c (build_new_op): Call resolve_args before calling
108 2007-11-11 Tom Tromey <tromey@redhat.com>
111 * lex.c (handle_pragma_implementation): Use cpp_included_before.
113 2007-11-12 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
116 * pt.c (redeclare_class_template): Update error message. Use a
117 note to show the previous declaration.
118 (tsubst_friend_class): Use the location of the friend template as
119 the input location before calling redeclare_class_template.
121 2007-11-11 Jakub Jelinek <jakub@redhat.com>
124 * semantics.c (finish_pseudo_destructor_expr): Handle
125 object == error_mark_node.
127 2007-11-10 Jakub Jelinek <jakub@redhat.com>
130 * pt.c (tsubst_copy_and_build) <case COMPONENT_REF>: If object_type
131 is not scalar type, let finish_class_member_access_expr handle
132 diagnostics. Pass BIT_NOT_EXPR argument to
133 finish_pseudo_destructor_expr. Handle SCOPE_REF properly.
135 2007-11-09 Douglas Gregor <doug.gregor@gmail.com>
138 * decl.c (cp_complete_array_type): If any of the initializer
139 elements are pack expansions, don't compute the array size yet.
141 2007-11-08 Andrew Pinski <pinskia@gmail.com>
144 * tree.c (decl_linkage): Fields have no linkage.
146 2007-11-08 Daniel Jacobowitz <dan@codesourcery.com>
148 * class.c (build_ctor_vtbl_group): Lay out the new type and decl.
150 2007-11-07 Douglas Gregor <doug.gregor@gmail.com>
155 * semantics.c (finish_decltype_type): See through INDIRECT_REFs.
156 Be careful with ERROR_MARK_NODEs.
157 * parser.c (cp_parser_check_access_in_redeclaration): Handle NULL
160 2007-11-07 Jakub Jelinek <jakub@redhat.com>
163 * call.c (build_over_call): Don't check TREE_ADDRESSABLE
166 2007-11-06 Douglas Gregor <doug.gregor@gmail.com>
170 * tree.c (c_build_qualified_type): Define bridge to
171 cp_build_qualified_type.
173 2007-11-06 Douglas Gregor <doug.gregor@gmail.com>
184 * typeck.c (check_return_expr): Pass address of retval to
185 check_for_bare_parameter_packs.
186 * class.c (build_base_field): Tolerate bases that have no layout
188 (end_of_base): Ditto.
189 * tree.c (canonical_type_variant): Be careful with
191 * cp-tree.h (check_for_bare_parameter_packs): Now accepts a
193 * pt.c (find_parameter_pack_data): Add set_packs_to_error field,
194 which states whether parameter packs should be replaced with
196 (find_parameter_packs_r): Pass addresses to cp_walk_tree wherever
197 possible. If set_packs_to_error is set true, replace the parameter
198 pack with ERROR_MARK_NODE. Manage our own pointer sets.
199 (uses_parameter_packs): Don't set parameter packs to
201 (check_for_bare_parameter_packs): Now takes a pointer to a tree,
202 which may be modified (if it is a parameter pack). Instructs
203 find_parameter_packs_r to replace parameter packs with
204 ERROR_MARK_NODE (so that they won't cause errors later on).
205 (process_template_parm): Pass pointer to
206 check_for_bare_parameter_packs.
207 (process_partial_specialization): Replace pack expansions before
208 the end of the template argument list with ERROR_MARK_NODE.
209 (push_template_decl_real): Pass pointer to
210 check_for_bare_parameter_packs. Replace parameter packs not at the
211 end of the template parameter list with ERROR_MARK_NODE.
212 (convert_template_argument): Be more careful about using DECL_NAME
213 on only declarations.
214 (unify): Can't unify against ERROR_MARK_NODE.
215 * semantics.c (finish_cond): Pass pointer to
216 check_for_bare_parameter_packs.
217 (finish_expr_stmt): Ditto.
218 (finish_for_expr): Ditto.
219 (finish_switch_cond): Pass pointer to
220 check_for_bare_parameter_packs, and call it before we put the
221 condition into the statement.
222 (finish_mem_initializers): Pass pointer to
223 check_for_bare_parameter_packs.
224 (finish_member_declaration): Ditto.
225 * parser.c (cp_parser_base_clause): Ditto.
227 2007-11-06 Jakub Jelinek <jakub@redhat.com>
230 * decl.c (cp_finish_decl): Call make_rtl_for_nonlocal_decl already
231 with the final TREE_READONLY flag in place. processing_template_decl
232 is known to be 0 in this part of function.
235 * cp-tree.h: Update comment - TYPE_LANG_FLAG_0 is not
236 OMP_ATOMIC_DEPENDENT_P in OMP_ATOMIC.
237 * pt.c (tsubst_expr): Assert OMP_ATOMIC_DEPENDENT_P.
238 * semantics.c (finish_omp_atomic): Revert most of the
239 2007-02-05 changes, just keep the new representation of
240 OMP_ATOMIC_DEPENDENT_P OMP_ATOMIC.
242 2007-11-05 H.J. Lu <hongjiu.lu@intel.com>
245 * decl2.c (constrain_visibility): Clear DECL_ONE_ONLY if marked
248 2007-11-05 Douglas Gregor <doug.gregor@gmail.com>
253 * typeck.c (merge_types): Don't lose rvalue references when
255 * call.c (build_over_call): Don't elide move constructors just
256 because the copy constructor is trivial (!).
257 (compare_ics): If comparing cv-qualifiers fails, we can still order
258 based on binding lvalues vs. rvalues.
260 2007-11-05 Douglas Gregor <doug.gregor@gmail.com>
263 * pt.c (unify_pack_expansion): bring handling of function call
264 arguments into line with type_unification_real.
266 2007-11-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
268 * typeck.c (build_binary_op): Use pedwarn instead of error for
271 2007-11-05 Jakub Jelinek <jakub@redhat.com>
274 * parser.c (cp_parser_unary_expression): For &&label call
275 cp_parser_non_integral_constant_expression and return error_mark_node
279 * decl.c (grokdeclarator): Don't call build_memfn_type if type
280 is neither FUNCTION_TYPE nor METHOD_TYPE.
282 2007-11-02 Jakub Jelinek <jakub@redhat.com>
285 * parser.c (cp_parser_nested_name_specifier_opt): Use
286 TYPE_MAIN_VARIANT (new_scope) as scope if new_scope is an incomplete
287 typedef of currently open class.
289 2007-11-02 Paolo Carlini <pcarlini@suse.de>
292 * error.c (dump_expr): Deal specially with statements.
294 2007-11-01 Jason Merrill <jason@redhat.com>
297 * pt.c (push_template_decl_real): Set DECL_CONTEXT on template
299 (lookup_template_class): Use it to get the outer template args
300 for instantiating one.
303 * pt.c (reduce_template_parm_level): tsubst the parameters
304 of a template template parm.
306 2007-11-01 Douglas Gregor <doug.gregor@gmail.com>
309 * pt.c (find_parameter_packs_r): Handle TYPENAME_TYPE.
311 2007-11-01 Jakub Jelinek <jakub@redhat.com>
314 * parser.c (cp_parser_postfix_dot_deref_expression): If
315 POSTFIX_EXPRESSION is type dependent, try to parse it as pseudo dtor
316 first and if that succeeds and type is SCALAR_TYPE_P, create
320 * rtti.c (enum_tinfo_kind): Fix TK_TYPE_INFO_TYPE comment.
321 (typeid_ok_p): Use the same alias set for abi::__type_info_pseudo
322 as for std::type_info.
324 2007-10-31 Paolo Carlini <pcarlini@suse.de>
327 * cxx-pretty-print.c (pp_cxx_typeid_expression,
328 pp_cxx_delete_expression): Change to static linkage.
329 * cxx-pretty-print.h: Adjust declarations.
330 * error.c (dump_expr, case EXPR_PACK_EXPANSION, TYPEID_EXPR,
331 MEMBER_REF, DOTSTAR_EXPR, DELETE_EXPR, VEC_DELETE_EXPR,
332 MODOP_EXPR): Forward to pp_expression.
334 * cxx-pretty-print.c (pp_cxx_expression, case NON_DEPENDENT_EXPR):
337 2007-10-31 Christian Bruel <christian.bruel@st.com>
338 Mark Mitchell <mark@codesourcery.com>
341 * typeck.c (check_return_expr): Don't set named_return_value_okay_p
342 if retval is volatile.
344 2007-10-30 Jakub Jelinek <jakub@redhat.com>
347 * decl2.c (build_offset_ref_call_from_tree): Call
348 build_non_dependent_expr on object prior to building ADDR_EXPR from it
349 if FN is DOTSTAR_EXPR.
351 2007-10-30 Douglas Gregor <doug.gregor@gmail.com>
355 * pt.c (find_parameter_packs_r): Fix typo in comment.
356 (convert_template_argument): Look at the pattern of a pack
357 expansion to determine what kind of entity we're converting.
358 (coerce_template_parameter_pack): When we have coerced a non-type
359 template parameter pack, substitute into the type of that pack.
360 (tsubst_pack_expansion): When our substitution of a parameter pack
361 is a "trivial" substitution of itself, just substitute into the
362 pack expansion rather than actually expanding.
364 2007-10-29 Jakub Jelinek <jakub@redhat.com>
367 * class.c (check_bitfield_decl): Don't set field's type to error_mark_node
368 for non-integral type bitfields. Return true if bitfield is correct, false
369 error has been diagnosed.
370 (check_field_decls): If check_bitfield_decl returned false, call also
373 2007-10-28 Paolo Carlini <pcarlini@suse.de>
374 Mark Mitchell <mark@codesourcery.com>
377 * pt.c (do_decl_instantiation): If the VAR_DECL is not a
378 class member error out and return.
380 2007-10-27 Jakub Jelinek <jakub@redhat.com>
382 * error.c (reinit_cxx_pp): Initialize cxx_pp->enclosing_scope
383 to current_function_decl rather than 0.
386 * cxx-pretty-print.c (pp_cxx_pm_expression) <case MEMBER_REF>: Print
388 * error.c (dump_expr): Handle MEMBER_REF and DOTSTAR_EXPR.
390 2007-10-27 Jason Merrill <jason@redhat.com>
393 * call.c (convert_default_arg): Detect recursion.
395 2007-10-27 Jakub Jelinek <jakub@redhat.com>
398 * cxx-pretty-print.h (pp_cxx_offsetof_expression): New prototype.
399 * cxx-pretty-print.c (pp_cxx_primary_expression): Handle
401 (pp_cxx_offsetof_expression_1, pp_cxx_offsetof_expression): New
403 * error.c (dump_expr): Handle OFFSETOF_EXPR.
405 2007-10-26 Jason Merrill <jason@redhat.com>
408 * pt.c (get_template_info): New fn.
409 (template_class_depth): Use it.
410 (push_template_decl_real): Check that the template args of the
411 definition match the args of the previous declaration.
413 2007-10-26 Paolo Carlini <pcarlini@suse.de>
416 * decl2.c (coerce_new_type): Do not allow a default argument for
419 2007-10-26 Douglas Gregor <doug.gregor@gmail.com>
422 * parser.c (cp_parser_decltype): Return ERROR_MARK_NODE if we
423 don't see the leading '('. Only lookup names if we get an
426 2007-10-26 Jakub Jelinek <jakub@redhat.com>
429 * parser.c (cp_parser_parenthesized_expression_list): Set
430 greater_than_is_operator_p to true in between the parens.
432 2007-10-26 Paolo Carlini <pcarlini@suse.de>
435 * decl.c (grokdeclarator): In case of conflicting specifiers
436 just return error_mark_node.
438 2007-10-26 Ollie Wild <aaw@google.com>
440 * expr.c (cxx_expand_expr): Removed.
441 * cp-tree.h (exx_expand_expr): Removed.
442 * cp-objcp-common.h (LANK_HOOKS_EXPAND_EXPR): Replace cxx_expand_expr
445 2007-10-25 Paolo Carlini <pcarlini@suse.de>
448 * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with BIT_NOT_EXPR.
450 2007-10-23 Jason Merrill <jason@redhat.com>
452 PR c++/25950 (DR 391)
453 * call.c (struct conversion): Remove check_copy_constructor_p.
454 (reference_binding): Always bind a reference directly to a
455 compatible class rvalue. Pass down LOOKUP_NO_TEMP_BIND during
457 (check_constructor_callable): Remove.
458 (convert_like_real): Don't call it.
459 (initialize_reference): Don't call check_constructor_callable.
460 (standard_conversion): Check LOOKUP_NO_CONVERSION instead of
461 LOOKUP_CONSTRUCTOR_CALLABLE. Don't require a temporary for base
462 conversions if LOOKUP_NO_TEMP_BIND.
463 (implicit_conversion): Pass through LOOKUP_NO_TEMP_BIND.
464 (build_user_type_conversion_1): Pass through LOOKUP_NO_TEMP_BIND for
466 * cp-tree.h (LOOKUP_CONSTRUCTOR_CALLABLE): Remove.
468 2007-10-22 Jakub Jelinek <jakub@redhat.com>
471 * semantics.c (finish_omp_clauses): Check !type_dependent_expression_p
472 before checking if its type is integral.
474 2007-10-22 Jason Merrill <jason@redhat.com>
477 * class.c (finish_struct_bits): Copy TYPE_ATTRIBUTES.
478 * pt.c (apply_late_template_attributes): Splice out dependent
479 attributes from DECL_ATTRIBUTES.
481 * decl.c (cxx_maybe_build_cleanup): Use build_address.
483 2007-10-17 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
485 * typeck.c (build_binary_op) : Use appropriate warning option
486 instead of unnamed warning.
488 2007-10-16 Paolo Carlini <pcarlini@suse.de>
491 * pt.c (current_template_args): Do not change TREE_LIST elements
492 with a TREE_VALUE of error_mark_node.
494 2007-10-16 Mark Mitchell <mark@codesourcery.com>
496 * typeck.c (cp_apply_type_quals_to_decl): Expand documentation.
497 * decl.c (start_decl): Tidy.
498 (start_decl_1): Call cp_apply_type_quals_to_decl after completing
500 (grokdeclarator): Clarify comment.
502 2007-10-14 Andrew Pinski <pinskia@gmail.com>
505 * decl.c (grokfndecl): Return NULL after the "definition of
506 implicitly-declared" error happened.
508 2007-10-12 Simon Martin <simartin@users.sourceforge.net>
511 * call.c (build_user_type_conversion_1): Do not consider conversion
512 functions to convert a (possibly cv-qualified) object to the (possibly
513 cv-qualified) same object type (or a reference to it), to a (possibly
514 cv-qualified) base class of that type (or a reference to it).
516 2007-10-12 Paolo Carlini <pcarlini@suse.de>
518 * pt.c (tsubst): Use template_parm_level_and_index.
520 2007-10-12 Jakub Jelinek <jakub@redhat.com>
523 * parser.c (cp_parser_compound_statement): Handle label-declarations
524 at the beginning of the compound statement.
525 (cp_parser_block_declaration): Issue diagnostics about __label__
526 not at the beginning of a block.
528 2007-10-11 Paolo Carlini <pcarlini@suse.de>
531 * pt.c (coerce_template_parameter_pack): Do not pass error_mark_node
532 to convert_template_argument.
533 (coerce_template_parms): Return error_mark_node after fixed-length
535 (tsubst_decl): Check for error_mark_node the return value of the
536 first tsubst in 'case VAR_DECL'.
538 2007-10-08 Ollie Wild <aaw@google.com>
540 * typeck2.c (digest_init): Call cplus_expand_constant after
541 convert_for_initialization.
542 * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
543 * expr.c (cplus_expand_constant): Updated function description.
545 2007-10-04 Jason Merrill <jason@redhat.com>
548 * call.c (initialize_reference): Handle local static reference
551 2007-10-03 Jason Merrill <jason@redhat.com>
554 * name-lookup.c (push_namespace_with_attrs): Fold back into...
555 (push_namespace): Here.
556 (handle_namespace_attrs): New fn for the attr code.
557 (leave_scope): Don't pop_visibility.
558 * name-lookup.h (struct cp_binding_level): Remove has_visibility.
559 * parser.c (cp_parser_namespace_definition): Call
560 handle_namespace_attrs and pop_visibility as appropriate.
563 * mangle.c (write_type) [TYPEOF_TYPE]: Just sorry.
565 2007-10-03 Alexandre Oliva <aoliva@redhat.com>
567 * decl.c (duplicate_decls): Preserve linkage flags for mere
568 redeclarations of gnu_inline definitions.
570 2007-10-03 Jason Merrill <jason@redhat.com>
573 * decl.c (wrap_cleanups_r): New fn.
574 (wrap_temporary_cleanups): New fn.
575 (initialize_local_var): Call it.
577 2007-09-29 Jason Merrill <jason@redhat.com>
580 * decl.c (make_rtl_for_nonlocal_decl): It's ok for a member
581 constant to not have DECL_EXTERNAL if it's file-local.
583 2007-09-28 Ollie Wild <aaw@google.com>
586 2007-09-27 Ollie Wild <aaw@google.com>
588 * typeck2.c (digest_init): Call cplus_expand_constant after
589 convert_for_initialization.
590 * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
591 * expr.c (cplus_expand_constant): Updated function description.
593 2007-09-28 Jason Merrill <jason@redhat.com>
596 * class.c (layout_empty_base): Take rli parameter, update
597 rli->record_align if empty base has user-specified alignment.
598 (build_base_field): Pass rli to it.
600 2007-09-28 Paolo Carlini <pcarlini@suse.de>
603 * error.c (dump_decl): Deal with TYPE_PACK_EXPANSION.
605 2007-09-28 Paolo Carlini <pcarlini@suse.de>
608 * error.c (dump_expr): Deal with ARGUMENT_PACK_SELECT.
609 (dump_type): Use dump_template_argument for TYPE_ARGUMENT_PACK.
610 (dump_parameters): Just call dump_type for argument packs too.
612 2007-09-28 Jakub Jelinek <jakub@redhat.com>
615 * tree.c (cp_build_qualified_type_real): Handle TYPE_PACK_EXPANSION
616 qualification by creating qualified PACK_EXPANSION_PATTERN and
617 then calling make_pack_expansion on it.
619 2007-09-27 Ollie Wild <aaw@google.com>
621 * typeck2.c (digest_init): Call cplus_expand_constant after
622 convert_for_initialization.
623 * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
624 * expr.c (cplus_expand_constant): Updated function description.
626 2007-09-27 Jason Merrill <jason@redhat.com>
629 * decl2.c (is_late_template_attribute): Don't crash on unknown
632 2007-09-27 Paolo Carlini <pcarlini@suse.de>
635 * error.c (dump_expr): Deal with DELETE_EXPR and VEC_DELETE_EXPR.
636 * cxx-pretty-print.c (pp_cxx_delete_expression): Add missing
637 spaces in the formatting.
638 * cxx-pretty-print.h (pp_cxx_delete_expression): Declare.
640 2007-09-27 Jakub Jelinek <jakub@redhat.com>
642 * error.c (cxx_print_error_function): Add third argument, pass
643 it over to lhd_print_error_function.
644 (cp_print_error_function): If diagnostic->abstract_origin, print
646 * cp-tree.h (struct diagnostic_info): New forward decl.
647 (cxx_print_error_function): Add third argument.
649 2007-09-25 Simon Martin <simartin@users.sourceforge.net>
652 * name-lookup.c (pushtag): Do not create an implicit typedef before
653 the associated type declaration is known to be valid.
655 2007-09-25 Jakub Jelinek <jakub@redhat.com>
657 * tree.c (cxx_printable_name): Compare FUNCTION_DECL uids
658 rather than pointers.
660 2007-09-24 Danny Smith <dannysmith@user.sourceforge.net>
663 * search.c (check_final_overrider): Fail if
664 targetm.comp_type_attributes returns 0.
666 2007-09-24 Jason Merrill <jason@redhat.com>
669 * pt.c (resolve_typename_type): Don't look things up in the original
670 template if it would mean losing template arguments.
672 2007-09-24 Jakub Jelinek <jakub@redhat.com>
675 * cp-tree.h (cxx_type_hash_eq): New prototype.
676 * cp-objcp-common.h (LANG_HOOKS_TYPE_HASH_EQ): Redefine.
677 * tree.c (cxx_type_hash_eq): New function.
679 2007-09-24 Douglas Gregor <doug.gregor@gmail.com>
682 * tree.c (cp_build_qualified_type_real): Build a canonical
683 ARRAY_TYPE if the original ARRAY_TYPE was not a canonical type.
685 2007-09-24 Douglas Gregor <doug.gregor@gmail.com>
689 * tree.c (cplus_array_compare): Compare pointers, not types.
690 (build_cplus_array_type_1): Store new array type into the hash
691 table before building the canonical type; build the canonical type
693 (cp_build_qualified_type_real): Put all of the array types with
694 cv-qualified element types into the C++ array hash table, built as
695 variants of the unqualified versions.
697 2007-09-23 Jason Merrill <jason@redhat.com>
700 * decl.c (grokdeclarator): Look through implicit TYPE_DECLs
701 for deprecation warnings.
703 2007-09-22 Jason Merrill <jason@redhat.com>
706 * call.c (build_over_call): Warn about deprecated virtuals.
709 * cp-tree.h (ATTR_IS_DEPENDENT): New macro.
710 (MAYBE_TAGGED_TYPE_P): Remove.
711 * pt.c (apply_late_template_attributes): Check ATTR_IS_DEPENDENT
712 instead of calling is_late_template_attribute again.
713 (tsubst_decl) [TYPE_DECL]: Just check if the name is the tag.
714 (tsubst): A typedef is a TYPE_NAME != TYPE_MAIN_DECL.
715 Don't crash on typedefs from non-template classes.
716 * decl2.c (grokfield): Don't sorry about attrs on template parms.
717 (is_late_template_attribute): All attributes applied to template
718 parms or typename types are dependent. Static.
719 (splice_template_attributes): Pass decl through.
720 (save_template_attributes): Likewise.
722 2007-09-20 Jakub Jelinek <jakub@redhat.com>
725 * pt.c (tsubst_copy) <case SIZEOF_EXPR>: Handle error_mark_node
726 returned from tsubst_pack_expansion.
727 (tsubst_copy_and_build) <case SIZEOF_EXPR>: Likewise.
728 (tsubst_copy_and_build) <case CONSTRUCTOR>: Likewise.
730 2007-09-20 Paolo Carlini <pcarlini@suse.de>
733 * semantics.c (finish_id_expression): Use consistently
734 context_for_name_lookup.
735 * decl.c (fixup_anonymous_aggr): Fix error message for
736 anonymous struct (vs union).
738 2007-09-19 Jason Merrill <jason@redhat.com>
741 * pt.c (tsubst): Handle typedefs by looking for the specialization.
742 (retrieve_specialization): Only tagged types use
743 DECL_TEMPLATE_INSTANTIATIONS.
744 (instantiate_class_template): Push nested classes too.
745 (tsubst_decl) [TYPE_DECL]: Only check for canonical decl for
747 * cp-tree.h (MAYBE_TAGGED_TYPE_P): New macro.
748 * init.c (is_aggr_type): Remove redundant tests.
749 * class.c (push_nested_class): Use CLASS_TYPE_P.
751 2007-09-20 Paolo Carlini <pcarlini@suse.de>
754 * init.c (build_zero_init): If, recursively, build_zero_init
755 returns a NULL_TREE, do not append it to the VEC of constructors.
757 2007-09-18 Jason Merrill <jason@redhat.com>
760 * pt.c (apply_late_template_attributes): Set processing_template_decl.
761 (tsubst_decl) [TYPE_DECL]: Preserve naming typedef, pass
762 ATTR_FLAG_TYPE_IN_PLACE.
763 (tsubst): Do unqualified lookup to find typedefs from current class.
764 [ARRAY_TYPE]: Propagate alignment info.
765 * decl2.c (is_late_template_attribute): Only defer handling of
766 attribute aligned if the expression is dependent.
767 (save_template_attributes): If we're deferring any attributes,
768 make this a naming typedef.
770 2007-09-18 Paolo Carlini <pcarlini@suse.de>
773 * cxx-pretty-print.c (pp_cxx_va_arg_expression): Print
774 va_arg instead of __builtin_va_arg.
776 2007-09-18 Paolo Carlini <pcarlini@suse.de>
779 * cxx-pretty-print.c (pp_cxx_va_arg_expression): Add.
780 (pp_cxx_primary_expression): Use it.
781 * cxx-pretty-print.h (pp_cxx_va_arg_expression): Declare.
782 * error.c (dump_expr): Use it.
784 2007-09-18 Paolo Carlini <pcarlini@suse.de>
787 * cxx-pretty-print.c (pp_cxx_postfix_expression): Split
788 out case TYPEID_EXPR to...
789 (pp_cxx_typeid_expression): ... here; use pp_cxx_left_paren
790 and pp_cxx_right_paren.
791 * cxx-pretty-print.h (pp_cxx_typeid_expression): Declare.
792 * error.c (dump_expr): Use it.
794 2007-09-18 Paolo Carlini <pcarlini@suse.de>
797 * cxx-pretty-print.c (pp_cxx_trait_expression): Add.
798 (pp_cxx_primary_expression): Use it.
799 * cxx-pretty-print.h (pp_cxx_trait_expression): Declare.
800 * error.c (dump_expr): Use it.
802 2007-09-16 Paolo Carlini <pcarlini@suse.de>
805 * init.c (build_new): Remove warning for zero-element
808 2007-09-16 Nathan Sidwell <nathan@codesourcery.com>
811 * call.c (maybe_handle_implicit_object): Set this_p, clear
812 rvaluedness_matches_p.
813 (compare_ics): Do not compare rvaluedness matching when one of the
814 operands is an implicit object.
816 2007-09-14 Jason Merrill <jason@redhat.com>
818 PR c++/17743, c++/19163
819 * decl2.c (is_late_template_attribute): New fn.
820 (splice_template_attributes, save_template_attributes): New fns.
821 (cplus_decl_attributes): Call save_template_attributes.
822 * pt.c (apply_late_template_attributes): New fn.
823 (instantiate_class_template, tsubst_decl): Use it.
824 * cp-tree.h: Declare is_late_template_attribute.
826 2007-09-13 Tom Tromey <tromey@redhat.com>
828 * parser.c (cp_lexer_new_main): Don't use
829 c_lex_return_raw_strings.
830 (cp_lexer_get_preprocessor_token): Update. Add special case when
833 2007-09-11 Jan Hubicka <jh@suse.cz>
835 * method.c (use_thunk): Use tree_rest_of_compilation
836 * cp-objecp-common.h (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Kill.
837 (LANG_HOOKS_CALLGRAPH_EMIT_ASSOCIATED_THUNKS): Define.
838 * cp-tree.h (expand_body): Kill.
839 (emit_associated_thunks): Declare.
840 * semantics.c (emit_associated_thunks): Export.
843 2007-09-09 David Daney <ddaney@avtrex.com>
846 * init.c (build_new_1): Use POINTER_PLUS_EXPR instead of MINUS_EXPR
847 to calculate cookie_ptr.
849 2007-09-08 Jason Merrill <jason@redhat.com>
852 * pt.c (most_specialized_class): Set processing_template_decl
853 while tsubsting partial spec args.
855 2007-09-06 Jason Merrill <jason@redhat.com>
857 * decl2.c (get_guard): Copy visibility from the guarded variable.
859 2007-09-06 Jan Hubicka <jh@suse.cz>
861 * semantics.c (expand_body): Do not mark arguments of clones used.
863 2007-09-06 Paolo Carlini <pcarlini@suse.de>
866 * decl.c (cp_finish_decl): When processing_template_decl,
867 deal correctly with init as TREE_LIST.
869 2007-09-06 Tom Tromey <tromey@redhat.com>
871 * decl.c (finish_function): Put return's location on line zero of
874 2007-09-05 Jason Merrill <jason@redhat.com>
877 * except.c (prepare_eh_type): Use type_decays_to.
880 * init.c (build_delete): Use build_headof to get the address of the
881 complete object if we aren't using the deleting destructor.
882 * rtti.c (build_headof): No longer static.
883 * cp-tree.h: Declare it.
885 2007-09-06 Jakub Jelinek <jakub@redhat.com>
887 * decl.c (duplicate_decls): Set TREE_NOTHROW on __builtin_XX
888 decl if a prototype for XX is provided with throw().
891 * decl.c (builtin_function_1): Set DECL_ANTICIPATED also
892 on __*_chk non-__builtin_* decls.
894 2007-09-05 Paolo Carlini <pcarlini@suse.de>
897 * semantics.c (finish_id_expression): Use context_for_name_lookup
898 insted of DECL_CONTEXT, to see through anonymous structs and unions.
899 * class.c (finish_struct_anon): Deal correctly with anonymous
900 structs (vs unions, as GNU extension) in error messages.
902 2007-09-05 Jan Hubicka <jh@suse.cz>
904 * cp/sematics.c (expand_body): Remove unnecesary import_export_decl
905 call, DECL_EXTERNAL checks and current_function_decl saving.
907 2007-09-05 Paolo Carlini <pcarlini@suse.de>
910 * parser.c (cp_parser_primary_expression): Return error_mark_node
911 when a statement-expression is found in a template-argument list.
913 2007-09-04 Jason Merrill <jason@redhat.com>
915 * except.c (initialize_handler_parm): Use
916 fold_build_cleanup_point_expr.
919 * call.c (reference_binding): Don't look for user-defined conversions
923 * except.c (initialize_handler_parm): Put a CLEANUP_POINT_EXPR inside
924 the MUST_NOT_THROW_EXPR.
926 2007-09-04 Richard Sandiford <richard@codesourcery.com>
928 * decl.c (cp_finish_decl): Call determine_visibility before
929 make_rtl_for_nonlocal_decl.
931 2007-09-04 Jason Merrill <jason@redhat.com>
934 * pt.c (most_specialized_class): Substitute outer template
935 arguments into the arguments of a member template partial
937 (strip_innermost_template_args): New fn.
939 2007-09-03 Daniel Jacobowitz <dan@codesourcery.com>
941 * Make-lang.in (g++spec.o): Remove SHLIB_MULTILIB.
943 2007-09-03 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
945 * call.c (name_as_c_string): Supply a TYPE for CONST_CAST.
946 * decl.c (cp_make_fname_decl): Likewise,
947 * parser.c (cp_parser_string_literal): Likewise,
948 * tree.c (pod_type_p, zero_init_p): Use CONST_CAST_TREE.
949 * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
952 2007-09-02 Paolo Carlini <pcarlini@suse.de>
955 * typeck.c (build_unary_op): Fix error message for
956 Boolean expression as operand to operator--.
958 2007-09-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
960 * tree.c (pod_type_p, zero_init_p): Use strip_array_types.
961 * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
964 2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
967 * init.c (build_default_init): Make extern.
968 * cp-tree.h (build_default_init): Declare here.
969 * pt.c (tsubst_expr): When the instantiation of the initializer of
970 a variable results in an empty list, default-initialize the
972 (tsubst_copy_and_build): When the instantiation of the initializer
973 in a new expression results in an empty initializer list,
974 default-initialize it.
976 2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
978 * mangle.c (write_type): Change mangling of rvalue reference from
981 2007-08-31 Jakub Jelinek <jakub@redhat.com>
983 * decl.c (duplicate_decls): Remove duplicated line.
985 2007-08-31 Paolo Carlini <pcarlini@suse.de>
988 * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with
989 BOUND_TEMPLATE_TEMPLATE_PARM.
991 2007-08-31 Paolo Carlini <pcarlini@suse.de>
994 * search.c (lookup_member): Check the name argument for
997 2007-08-31 Paolo Carlini <pcarlini@suse.de>
1000 * parser.c (cp_parser_trait_expr): Check rerurn value of
1003 2007-08-30 Ollie Wild <aaw@google.com>
1005 * cvt.c (cp_convert_to_pointer): Remove force parameter. Call
1006 convert_ptrmem for pointer to member conversions.
1007 (convert_to_pointer_force): Update cp_convert_to_pointer call.
1008 (ocp_convert): Update cp_convert_to_pointer call.
1009 * typeck.c (convert_ptrmem): Add conditional for null pointers to
1011 (build_static_cast_1): Check can_convert for conversions in either
1013 (get_delta_difference_1): New function.
1014 (get_delta_difference): Refactor to call get_delta_difference_1.
1016 2007-08-30 Jakub Jelinek <jakub@redhat.com>
1018 * decl.c (start_preparsed_function): Set
1019 DECL_DISREGARD_INLINE_LIMITS for GNU_INLINE_P functions.
1021 2007-08-28 Paolo Carlini <pcarlini@suse.de>
1024 * error.c (dump_expr): Deal with TEMPLATE_TYPE_PARM and
1025 BOUND_TEMPLATE_TEMPLATE_PARM.
1027 2007-08-28 Jakub Jelinek <jakub@redhat.com>
1031 * pt.c (check_explicit_specialization): Set DECL_INTERFACE_KNOWN
1032 and DECL_NOT_REALLY_EXTERN if tmpl_func is not public.
1034 2007-08-27 Jason Merrill <jason@redhat.com>
1037 * pt.c (build_non_dependent_expr, type_dependent_expression_p):
1038 Look inside STMT_EXPR.
1039 * semantics.c (stmt_expr_value_expr): New fn.
1040 * cp-tree.h: Declare it.
1043 * decl.c (groktypename): Ignore attributes applied to class type.
1045 2007-08-28 Richard Guenther <rguenther@suse.de>
1047 * decl.c (duplicate_decls): Merge DECL_DISREGARD_INLINE_LIMITS.
1049 2007-08-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
1051 * error.c (dump_expr): Handle COMPLEX_CST.
1052 * cxx-pretty-print.c (pp_cxx_primary_expression): Likewise.
1053 (pp_cxx_expression): Likewise.
1055 2007-08-27 Alexandre Oliva <aoliva@redhat.com>
1057 * decl.c (GNU_INLINE_P): New.
1058 (duplicate_decls): Handle gnu_inline. Merge attributes and
1059 some flags in overriding definitions.
1060 (redeclaration_error_message): Handle gnu_inline.
1061 (start_preparsed_function): Likewise.
1063 2007-08-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1065 * call.c (sufficient_parms_p): Constify.
1066 * class.c (same_signature_p): Likewise.
1067 * cp-gimplify.c (is_invisiref_parm,
1068 cxx_omp_privatize_by_reference): Likewise.
1069 * cp-objcp-common.c (has_c_linkage): Likewise.
1070 * cp-tree.h (NON_THUNK_FUNCTION_CHECK, THUNK_FUNCTION_CHECK,
1071 sufficient_parms_p, same_signature_p, copy_fn_p, move_fn_p,
1072 grok_ctor_properties, nothrow_libfn_p, skip_artificial_parms_for,
1073 num_artificial_parms_for, comp_template_parms,
1074 template_parameter_pack_p, any_dependent_template_arguments_p,
1075 any_type_dependent_arguments_p, any_value_dependent_elements_p,
1076 repo_export_class_p, cxx_omp_privatize_by_reference, pod_type_p,
1077 zero_init_p, member_p, cp_lvalue_kind,
1078 builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
1079 varargs_function_p, is_dummy_object, special_function_kind,
1080 string_conv_p, type_unknown_p, comp_except_specs, compparms,
1081 comp_cv_qualification, is_bitfield_expr_with_lowered_type,
1082 unlowered_expr_type, ptr_reasonably_similar, cp_type_readonly,
1083 cp_has_mutable_p, at_least_as_qualified_p,
1084 invalid_nonstatic_memfn_p, lvalue_or_else, lvalue_p): Likewise.
1085 * decl.c (copy_fn_p, move_fn_p, grok_ctor_properties): Likewise.
1086 * except.c (nothrow_libfn_p): Likewise.
1087 * method.c (skip_artificial_parms_for, num_artificial_parms_for):
1089 * pt.c (comp_template_parms, template_parameter_pack_p,
1090 any_type_dependent_arguments_p, any_value_dependent_elements_p,
1091 any_dependent_template_arguments_p): Likewise.
1092 * repo.c (repo_export_class_p): Likewise.
1093 * semantics.c (anon_aggr_type_p): Likewise.
1094 * tree.c (lvalue_p_1, real_lvalue_p, lvalue_p,
1095 builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
1096 varargs_function_p, member_p, is_dummy_object, pod_type_p,
1097 zero_init_p, special_function_p): Likewise.
1098 * typeck.c (comp_array_types, type_unknown_p, comp_except_specs,
1099 comp_array_types, at_least_as_qualified_p, comp_cv_qualification,
1100 compparms, invalid_nonstatic_memfn_p,
1101 is_bitfield_expr_with_lowered_type, unlowered_expr_type,
1102 string_conv_p, ptr_reasonably_similar, cp_type_readonly,
1103 cp_has_mutable_p, lvalue_or_else): Likewise.
1105 2007-08-25 Paolo Bonzini <bonzini@gnu.org>
1107 * decl.c (cp_tree_node_structure): Kill TINST_LEVEL case.
1108 * cp-objcp-common.c (cp_tree_size): Ditto.
1109 * tree.c (cp_walk_subtrees): Ditto
1110 * cp-tree.def (TINST_LEVEL): Go away.
1111 * cp-tree.h (struct tinst_level_s): Rename to struct tinst_level,
1112 move together with other non-tree structs.
1113 (enum cp_tree_node_structure_enum): Nuke TS_CP_TINST_LEVEL.
1114 (union lang_tree_node): Eliminate tinst_level field.
1115 (TINST_DECL, TINST_LOCATION, TINST_IN_SYSTEM_HEADER_P): Annihilate.
1116 (current_instantiation, outermost_tinst_level): Return
1117 a "struct tinst_level *".
1119 * error.c (print_instantiation_partial_context): Change second
1120 parameter to a "struct tinst_level *". Replace accessor macros
1122 (print_instantiation_full_context): Likewise.
1123 * lex.c (in_main_input_context): Likewise.
1125 * pt.c (struct pending_templates): New.
1126 (pending_templates, last_pending_template): Use it as a type.
1127 (current_tinst_level): Change typo to "struct tinst_level *"
1128 (reopen_tinst_level): Accept "struct tinst_level *", return decl.
1129 (add_pending_template): Construct a "struct pending_template".
1130 Replace TINST_LEVEL accessor macros with field access.
1131 (push_tinst_level): Likewise, using GGC_NEW instead of make_node.
1132 (pop_tinst_level): Likewise.
1133 (instantiate_pending_templates): Likewise. Factor common code used
1134 when an instantiation has been done.
1135 (outermost_tinst_level): Replace tree_last with loop.
1136 (current_instantiation): Return a "struct tinst_level *".
1138 2007-08-24 Ollie Wild <aaw@google.com>
1140 * name-lookup.c (add_decl_to_level): Remove addition to vtables chain.
1141 * name-lookup.h (cp_binding_level): Remove vtables member.
1143 2007-08-24 Richard Guenther <rguenther@suse.de>
1145 * tree.c (cp_cannot_inline_tree_fn): Remove.
1146 * cp-tree.h (cp_cannot_inline_tree_fn): Likewise.
1147 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN):
1150 2007-08-24 Jakub Jelinek <jakub@redhat.com>
1153 * typeck.c (build_unary_op) <case PREINCREMENT_EXPR>: Return
1154 error_mark_node right away if build_expr_type_conversion
1158 * name-lookup.c (set_decl_namespace): lookup_qualified_name failure
1159 is error_mark_node rather than NULL_TREE.
1160 * pt.c (check_explicit_specialization): Likewise.
1163 * error.c (resolve_virtual_fun_from_obj_type_ref): Handle
1164 TARGET_VTABLE_USES_DESCRIPTORS targets properly.
1166 2007-08-22 Jason Merrill <jason@redhat.com>
1169 * pt.c (outermost_tinst_level): New function.
1170 * lex.c (in_main_input_context): New function.
1171 * cp-tree.h: Declare it.
1172 * decl2.c (constrain_class_visibility): Use it to avoid warning
1173 about uses of the anonymous namespace in the main input file.
1175 2007-08-21 Jakub Jelinek <jakub@redhat.com>
1177 * init.c (build_new_1): Use get_target_expr instead of save_expr.
1179 2007-08-20 Pawel Sikora <pluto@pld-linux.org>
1182 * class.c (finish_struct_1): Warn when a class has virtual
1183 functions and accessible non-virtual destructor.
1185 2007-08-20 Richard Guenther <rguenther@suse.de>
1189 * call.c (build_new_method_call): Convert initializer to
1191 * init.c (build_aggr_init): Do not fiddle with types.
1192 (build_vec_delete_1): Use correct type for POINTER_PLUS_EXPR.
1193 * except.c (build_throw): Do not drop qualifiers for the
1195 * typeck.c (get_member_function_from_ptrfunc): Do not
1196 fiddle with types, instead convert.
1197 (build_ptrmemfunc1): Convert to the target type for
1199 (gfc_trans_allocate): Convert result to target type.
1200 * cp-objcp-common.c (cxx_get_alias_set): Pointers to
1201 pointer-to-member structures shall have alias set zero as well.
1203 2007-08-20 Richard Guenther <rguenther@suse.de>
1205 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P):
1207 * cp-tree.h (cp_auto_var_in_fn_p): Remove.
1208 (nonstatic_local_decl_p): Likewise.
1209 * tree.c (cp_auto_var_in_fn_p): Remove.
1210 * decl.c (nonstatic_local_decl_p): Remove.
1212 2007-08-20 Richard Guenther <rguenther@suse.de>
1214 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_WALK_SUBTREES):
1216 * tree.h (cp_walk_tree): New define to walk_tree_1 with
1217 cp_walk_subtrees lh parameter.
1218 (cp_walk_tree_without_duplicates): New define to
1219 walk_tree_without_duplicates_1 with cp_walk_subtrees lh parameter.
1220 * tree.c (count_trees): Call
1221 cp_walk_tree_without_duplicates.
1222 (verify_stmt_tree): Call cp_walk_tree.
1223 (break_out_target_exprs): Likewise.
1224 (WALK_SUBTREE): Likewise.
1225 * cp-gimplify.c (cp_genericize): Likewise.
1226 * cp-pt.c (find_parameter_packs_r): Likewise.
1227 (uses_parameter_packs): Likewise.
1228 (make_pack_expansion): Likewise.
1229 (check_for_bare_parameter_packs): Likewise.
1230 (for_each_template_parm): Likewise.
1231 * decl.c (check_default_argument): Call
1232 cp_walk_tree_without_duplicates.
1233 * except.c (build_throw): Likewise.
1234 * decl2.c (type_visibility): Likewise.
1235 * semantics.c (expand_or_defer_fn): Likewise.
1236 (finalize_nrv): Call cp_walk_tree.
1238 2007-08-20 Jakub Jelinek <jakub@redhat.com>
1241 * init.c (build_new_1): Rename placement_var variable to placement_expr.
1242 Initialize it with save_expr rather than get_temp_regvar.
1244 2007-08-17 Andrew Pinski <andrew_pinski@playstation.sony.com>
1247 * tree.c (lvalue_p_1 <case SAVE_EXPR>): SAVE_EXPRs are never
1250 2007-08-17 Ollie Wild <aaw@google.com>
1253 * name-lookup.c (do_nonmember_using_decl): Shift implicit type
1254 declarations into appropriate slots for comparison. Fix type
1257 2007-08-17 Paolo Carlini <pcarlini@suse.de>
1260 * error.c (dump_decl): Deal with UNBOUND_CLASS_TEMPLATE.
1261 * cxx-pretty-print.c (pp_cxx_unqualified_id): Likewise.
1263 2007-08-17 Paolo Carlini <pcarlini@suse.de>
1266 * parser.c (cp_parser_class_head): Improve error message.
1268 2007-08-16 Seongbae Park <seongbae.park@gmail.com>
1270 * pt.c (instantiate_decl): Set input_location
1271 for the function end.
1273 2007-08-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1275 * cp-objcp-common.c (cxx_warn_unused_global_decl, cp_expr_size):
1277 * cp-tree.h (local_variable_p, nonstatic_local_decl_p,
1278 class_tmpl_impl_spec_p, cp_auto_var_in_fn_p, cp_type_quals,
1279 cxx_incomplete_type_diagnostic, cxx_incomplete_type_error,
1280 cxx_warn_unused_global_decl, cp_expr_size): Likewise.
1281 * decl.c (local_variable_p, nonstatic_local_decl_p): Likewise.
1282 * tree.c (class_tmpl_impl_spec_p, cp_auto_var_in_fn_p): Likewise.
1283 * typeck.c (cp_type_quals): Likewise.
1284 * typeck2.c (cxx_incomplete_type_diagnostic,
1285 cxx_incomplete_type_error): Likewise.
1287 2007-08-16 Paolo Carlini <pcarlini@suse.de>
1290 * pt.c (tsubst_friend_function): When check_classfn
1291 returns error_mark_node likewise return it.
1293 2007-08-15 Jakub Jelinek <jakub@redhat.com>
1296 * typeck.c (check_return_expr): Don't NRV optimize vars in
1298 * decl.c (finish_function): Comment fix.
1300 2007-08-15 Paolo Carlini <pcarlini@suse.de>
1303 * pt.c (push_template_decl_real): Depending on TYPE_P
1304 use either TYPE_CONTEXT or DECL_CONTEXT.
1306 2007-08-14 Mark Mitchell <mark@codesourcery.com>
1308 * semantics.c (finish_omp_clauses): Strip a NOP_EXPR if
1309 constructors and destructors return this.
1311 2007-08-14 Paolo Carlini <pcarlini@suse.de>
1314 * decl2.c (check_classfn): Return error_mark_node in case of error;
1315 in that case, do not call add_method.
1316 * decl.c (start_decl): Deal with check_classfn returning
1318 (grokfndecl): Likewise.
1319 * pt.c (tsubst_friend_function): Likewise.
1321 2007-08-14 Andrew Pinski <pinskia@gmail.com>
1324 * typeck.c (build_binary_op): Disallow vector float types with
1325 BIT_IOR_EXPR, BIT_AND_EXPR, and BIT_XOR_EXPR.
1327 2007-08-11 Ian Lance Taylor <iant@google.com>
1329 * cp-objcp-common.c (cxx_get_alias_set): Change return type to
1331 * cp/cp-tree.h (cxx_get_alias_set): Update declaration.
1333 2007-08-10 Ollie Wild <aaw@google.com>
1335 * name-lookup.c (do_nonmember_using_decl): Print an error for ambiguous
1337 (ambiguous_decl): Construct tree of ambiguous types. Remove extaneous
1339 (unqualified_namespace_lookup): Fix ambiguous_decl call.
1340 (lookup_using_namespace): Fix ambiguous_decl call.
1341 (qualified_lookup_using_namespace): Fix ambiguous_decl call.
1343 2007-08-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1345 * call.c (name_as_c_string): Use CONST_CAST.
1346 * decl.c (build_decl): Likewise.
1347 * parser.c (cp_parser_string_literal): Likewise.
1349 2007-08-10 Paolo Carlini <pcarlini@suse.de>
1352 * error.c (dump_expr): Consistently use the *_cxx_*
1353 variants of the pretty-print functions.
1355 2007-08-10 Paolo Carlini <pcarlini@suse.de>
1358 * decl.c (check_special_function_return_type): Just error
1359 on return type specified for conversion operator.
1361 2007-08-09 Daniel Berlin <dberlin@dberlin.org>
1363 * typeck2.c (readonly_error): Handle general expressions.
1364 * error.c (dump_expr): Handle POINTER_PLUS_EXPR
1366 2007-08-06 Dan Hipschman <dsh@google.com>
1368 * method.c (use_thunk): Use DECL_NAME instead of DECL_RTL to
1369 access function name.
1371 2007-08-04 Alfred Minarik <a.minarik@aon.at>
1374 * lang-specs.h: Add .hp, .hxx, .hpp, .h, .HPP, .tcc as c++ header.
1375 * g++spec.c (lang_specific_driver): Check them.
1377 2007-08-06 Paolo Carlini <pcarlini@suse.de>
1380 * pt.c (inline_needs_template_parms): Fix comment; change return type
1383 2007-08-05 Volker Reichelt <v.reichelt@netcologne.de>
1386 2007-03-26 Dirk Mueller <dmueller@suse.de>
1388 * parser.c (cp_parser_member_declaration): Pedwarn
1389 about stray semicolons after member declarations.
1391 2007-08-02 Lee Millward <lee.millward@gmail.com>
1396 * parser.c (cp_parser_asm_definition): Detect and discard asm
1397 statements with invalid inputs or outputs.
1398 (cp_parser_asm_operand_list): Return error mark node if any
1399 of the operands are invalid. Adjust documentation.
1401 2007-08-02 Nick Clifton <nickc@redhat.com>
1403 * typeck.c: Change copyright header to refer to version 3 of the
1404 GNU General Public License and to point readers at the COPYING3
1405 file and the FSF's license web page.
1406 * optimize.c, lang-specs.h, init.c, class.c, repo.c, decl.c,
1407 config-lang.in, cp-tree.def, call.c, decl.h, ptree.c,
1408 Make-lang.in, method.c, rtti.c, cp-objcp-common.c, g++spec.c,
1409 cp-objcp-common.h, except.c, error.c, operators.def, cvt.c,
1410 tree.c, mangle.c, cp-tree.h, dump.c, search.c, friend.c, expr.c,
1411 cp-gimplify.c, cxx-pretty-print.c, cp-lang.c, typeck2.c, pt.c,
1412 cxx-pretty-print.h, semantics.c, name-lookup.c, lex.c, decl2.c,
1413 name-lookup.h, parser.c: Likewise.
1415 2007-08-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1418 * call.c (magic_varargs_p): Honor the "type generic" attribute.
1420 2007-07-30 Paolo Carlini <pcarlini@suse.de>
1423 * semantics.c (finish_label_stmt): Reject the __label__
1424 extension outside function scopes.
1426 2007-07-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1428 * parser.c (eof_token): Un-constify.
1429 (cp_lexer_new_main, cp_lexer_new_from_tokens, VEC_alloc,
1430 cp_lexer_consume_token, cp_lexer_purge_token): Remove spurious
1433 2007-07-28 Kazu Hirata <kazu@codesourcery.com>
1435 * pt.c, tree.c, typeck2.c: Fix comment typos.
1437 2007-07-28 Simon Martin <simartin@users.sourceforge.net>
1438 Mark Mitchell <mark@codesourcery.com>
1441 * name-lookup.c (lookup_name_real): Non namespace-scope bindings can be
1442 hidden due to friend declarations in local classes.
1444 2007-07-27 Douglas Gregor <doug.gregor@gmail.com>
1446 * typeck.c (structural_comptypes): Compare DECLTYPE_TYPE nodes.
1447 * cp-tree.def (DECLTYPE_TYPE): New.
1448 * error.c (dump_type): Dump DECLTYPE_TYPE nodes.
1449 (dump_type_prefix): Ditto.
1450 (dump_type_suffix): Ditto.
1451 * tree.c (DECLTYPE_TYPE): Walk DECLTYPE_TYPE nodes.
1452 * mangle.c (write_type): Handle DECLTYPE_TYPE.
1453 * cp-tree.h (IS_AGGR_TYPE): DECLTYPE_TYPE nodes can be aggregate
1455 (DECLTYPE_TYPE_EXPR): New.
1456 (DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P): New.
1457 (finish_declared_type): Declare.
1458 * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Print
1459 DECLTYPE_TYPE nodes.
1460 (pp_cxx_type_id): Ditto.
1461 * pt.c (for_each_template_parm_r): Walk DECLTYPE_TYPE children.
1462 (tsubst): Substitute into a DECLTYPE_TYPE node.
1463 (tsubst_copy): Ditto.
1464 (unify): Cannot deduce anything from TYPEOF_TYPE or DECLTYPE_TYPE
1466 (dependent_type_p_r): DECLTYPE_TYPE types are always dependent.
1467 * semantics.c (finish_typeof): TYPEOF_TYPE types need to use
1468 structural equality (because we can't hash the expressions).
1469 (finish_declared_type): New.
1470 * lex.c (reswords): Add "decltype" keyword.
1471 * parser.c cp_lexer_next_token_is_decl_specifier_keyword
1472 (cp_parser_postfix_expression): Add member_access_only_p to
1473 restrict postfix expression to member access expressions.
1474 (cp_parser_unary_expression): Update call to
1475 cp_parser_postfix_expression to reflect new parameter.
1476 (cp_parser_declared_type): New.
1477 (cp_parser_simple_type_specifier): Parse decltype types.
1479 2007-07-27 Mark Mitchell <mark@codesourcery.com>
1482 * call.c (convert_for_arg_passing): Only widen bitfields to their
1483 declared types if necessary.
1485 2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1487 * parser.c (cp_parser_string_literal, cp_parser_sizeof_operand):
1490 2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1492 * decl.c (typename_hash, typename_compare): Constify.
1493 * mangle.c (hash_type, compare_type): Likewise.
1494 * pt.c (eq_local_specializations, hash_local_specialization):
1496 * tree.c (cplus_array_hash, cplus_array_compare, list_hash_eq,
1497 list_hash): Likewise.
1498 * typeck2.c (pat_compare): Likewise.
1500 2007-07-24 Nathan Sidwell <nathan@codesourcery.com>
1502 * method.c (implicitly_declare_fn): Increase alignment if member
1503 function pointer format requires it.
1505 2007-07-24 Paolo Carlini <pcarlini@suse.de>
1508 * typeck.c (check_return_expr): Do not pass a null argument
1511 2007-07-24 Paolo Carlini <pcarlini@suse.de>
1514 * decl.c (redeclaration_error_message): Call DECL_ANON_UNION_VAR_P
1517 2007-07-22 Nathan Sidwell <nathan@codesourcery.com>
1520 * typeck.c (convert_arguments): Only use default args if we have
1524 * typeck.c (structural_comptypes): No need to check
1525 resolve_typename_type return value here.
1526 * cp-tree.h (TYPENAME_IS_RESOLVING_P): New.
1527 * pt.c (resolve_typename_type): Follow typename typedefs. Return
1528 original type rather than error_mark_node in case of failure.
1529 * parser.c (cp_parser_nested_name_specifier_opt): Adjust
1530 resolve_typename_type result check.
1531 (cp_parser_direct_declarator, cp_parser_head,
1532 cp_parser_constructor_declarator_p): Likewise.
1534 2007-07-12 Kazu Hirata <kazu@codesourcery.com>
1536 * pt.c (template_parms_variadic_p): Remove.
1537 * cp-tree.h: Remove the prototype for template_parms_variadic_p.
1539 2007-07-12 Jakub Jelinek <jakub@redhat.com>
1542 * error.c (dump_expr) <case AGGR_INIT_EXPR>: Pass true as last
1543 argument to dump_aggr_init_expr_args instead of false.
1545 2007-07-11 Douglas Gregor <doug.gregor@gmail.com>
1547 * typeck.c (comptypes): When USE_CANONICAL_TYPES, use the
1548 canonical types; otherwise, fall back to structural type
1549 comparisons. If ENABLE_CHECKING and USE_CANONICAL_TYPES, give an
1550 internal compiler error if the canonical types are wrong.
1552 2007-07-11 Paolo Carlini <pcarlini@suse.de>
1555 * parser.c (cp_parser_make_indirect_declarator): When the
1556 the code argument is ERROR_MARK return cp_error_declarator.
1558 2007-07-09 Geoffrey Keating <geoffk@apple.com>
1561 * decl.c (cxx_init_decl_processing): Don't set
1562 force_align_functions_log.
1563 (grokfndecl): Honour ptrmemfunc_vbit_in_pfn.
1564 * typeck.c (cxx_alignof_expr): When alignof is used on a plain
1565 FUNCTION_DECL, return its alignment.
1567 2007-07-09 Richard Guenther <rguenther@suse.de>
1569 * decl.c (start_preparsed_function): Do not promote return type.
1571 2007-07-08 Paolo Carlini <pcarlini@suse.de>
1574 * pt.c (unify): Never pass error_mark_node to template_decl_level.
1576 2007-07-07 Mark Mitchell <mark@codesourcery.com>
1579 * pt.c (resolve_overloaded_unification): Robustify. Return a
1581 (type_unification_real): Adjust accordingly.
1583 2007-07-06 Richard Guenther <rguenther@suse.de>
1585 * init.c (build_new_1): Use the correct pointer type.
1586 * typeck2.c (build_m_component_ref): Likewise.
1588 2007-07-05 Mark Mitchell <mark@codesourcery.com>
1591 * init.c (build_zero_init): Always build an initializer for
1593 * typeck2.c (build_functional_cast): Use build_zero_init.
1596 * init.c (build_new_1): Always pass the allocation function to
1597 build_op_delete_call.
1598 * call.c (build_op_delete_call): Handle operator delete with a
1599 variable-argument list. Do not issue an error when no matching
1600 deallocation function is available for a new operator.
1603 * cp-tree.h (any_value_dependent_elements_p): Declare it.
1604 * decl.c (value_dependent_init_p): New function.
1605 (cp_finish_decl): Use it.
1606 * pt.c (value_dependent_expression_p): Use
1607 any_value_dependent_elements_p.
1608 * parser.c (cp_parser_primary_expression): Add comment about
1609 treating dependent qualified names as integral
1610 constant-expressions.
1612 2007-07-04 Douglas Gregor <doug.gregor@gmail.com>
1614 * decl.c (build_ptrmemfunc_type): Always use structural equality
1615 tests when comparing pointer-to-member-function types, because the
1616 handling of TYPE_GET_PTRMEMFUNC_TYPE currently defeats canonical
1619 2007-07-03 Mark Mitchell <mark@codesourcery.com>
1621 * init.c (build_new): Tweak comment.
1623 2007-06-29 Dave Brolley <brolley@redhat.com>
1626 * parser.c (cp_parser_new_type_id): Don't reduce a named array
1627 type to its base type and number of elements here.
1628 * init.c (build_new): Call complete_type_or_else to ensure that the
1629 type is complete and to issue a diagnostic if it is not.
1630 (build_new_1): Don't call complete_type_or_else here.
1632 2007-07-03 Richard Guenther <rguenther@suse.de>
1635 * class.c (fixed_type_or_null): Re-lookup the hashtable slot
1638 2007-07-02 Simon Baldwin <simonb@google.com>
1640 * parser.c (cp_parser_elaborated_type_specifier): Added a warning
1641 for inner-style nested forward declarations that don't declare
1644 2007-07-02 Jakub Jelinek <jakub@redhat.com>
1647 * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
1648 DECL_P in not a variable and appears more than once error messages.
1650 2007-07-01 Ollie Wild <aaw@google.com>
1652 * name-lookup.c (ambiguous_decl): Fix case when new->value is hidden.
1653 (select_decl): Remove function.
1654 (unqualified_namespace_lookup): Populate binding by calling
1655 ambiguous_decl. Remove select_decl call.
1656 (lookup_qualified_name): Remove select_decl call.
1657 * decl.c (lookup_and_check_tag): Check for ambiguous references.
1658 * parser.c (cp_parser_elaborated_type_specifier): Skip redundant error
1659 generation when name lookup is ambiguous.
1661 2007-06-29 Douglas Gregor <doug.gregor@gmail.com>
1664 * init.c (build_new_1): Use structural equality on the copy of the
1667 2007-06-28 Geoffrey Keating <geoffk@apple.com>
1669 * decl2.c (determine_visibility): Implement
1670 flag_visibility_ms_compat effect on type info.
1671 * decl.c (cxx_init_decl_processing): Implement
1672 global effect of flag_visibility_ms_compat.
1674 2007-06-28 Geoffrey Keating <geoffk@apple.com>
1676 * decl2.c (start_objects): Mark constructor-running function
1679 2007-06-26 Simon Martin <simartin@users.sourceforge.net>
1682 * decl.c (grokdeclarator): Reset friendp for member functions declared
1683 friend of their own class.
1685 2007-06-23 Mark Mitchell <mark@codesourcery.com>
1687 * decl2.c (determine_visibility): Don't look for dllexport here.
1688 (determine_visibility_from_class): Tidy.
1690 2007-06-18 Simon Baldwin <simonb@google.com>
1693 * parser.c (cp_parser_single_declaration): Added check for storage
1694 class other than sc_none in parsed declaration, and a flag to indicate
1695 if the call is part of an explicit template specialization parse.
1696 * (cp_parser_explicit_specialization): Specialization check flag added
1697 to call to cp_parser_single_declaration(), set true.
1698 * (cp_parser_template_declaration_after_export): Specialization check
1699 flag added to call to cp_parser_single_declaration(), set false.
1700 * pt.c (check_explicit_specialization): Added code to copy visiblity
1701 and linkage from the templated function to the explicit specialization.
1703 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
1705 * typeck.c (build_binary_op): For templates build the
1706 expression in pieces to avoid the assert in build2_stat.
1707 (get_member_function_from_ptrfunc):
1708 Change over to using POINTER_PLUS_EXPR and convert
1709 the second operand to sizetype.
1710 * typeck2.c (build_m_component_ref): Likewise.
1711 * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR
1712 instead of PLUS_EXPR for pointers.
1713 (build_new_1): Likewise.
1714 (build_vec_delete_1): Likewise.
1715 (build_vec_delete): Likewise.
1716 * class.c (build_base_path): Likewise.
1717 (build_base_path): Likewise.
1718 (convert_to_base_statically): Likewise.
1719 (fixed_type_or_null): Handle POINTER_PLUS_EXPR.
1720 (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR
1721 instead of PLUS_EXPR.
1722 (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR
1723 instead of PLUS_EXPR for pointers.
1724 * call.c (build_special_member_call): Likewise.
1725 * rtti.c (build_headof): Likewise.
1726 Use sizetype instead of ptrdiff_type_node.
1727 (tinfo_base_init): Create a POINTER_PLUS_EXPR
1728 instead of PLUS_EXPR for pointers.
1729 * except.c (expand_start_catch_block): Do a
1730 NEGATIVE and then a POINTER_PLUS_EXPR instead
1732 * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert
1733 PLUS_EXPR on pointer types over to use
1734 POINTER_PLUS_EXPR and remove the conversion
1735 to the pointer types.
1736 * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for
1737 adding to a pointer type. Use size_int instead of
1738 ssize_int. Convert the index to sizetype before
1739 adding it to the pointer.
1741 2007-06-15 Mark Mitchell <mark@codesourcery.com>
1743 * cp-tree.h (DECL_VAR_MARKED_P): Remove.
1744 (DECL_ANON_UNION_VAR_P): New macro.
1745 * class.c (fixed_type_or_null): Tidy. Use a hash table, rather
1746 than DECL_VAR_MARKED_P, to keep track of which variables we have
1748 * decl.c (redeclaration_error_message): Complain about redeclaring
1749 anonymous union members at namespace scope.
1750 * decl2.c (build_anon_union_vars): Set DECL_ANON_UNION_VAR_P.
1752 2007-06-14 Geoff Keating <geoffk@apple.com>
1754 * decl2.c (determine_visibility): Ensure that functions with
1755 hidden types as parameters are hidden.
1758 * decl2.c (determine_visibility): Remove duplicate code for
1761 2007-06-12 Ian Lance Taylor <iant@google.com>
1764 * init.c (avoid_placement_new_aliasing): New static function.
1765 (build_new_1): Call it.
1767 2007-06-11 Rafael Avila de Espindola <espindola@google.com>
1769 * cp-objcp-common.h (LANG_HOOKS_SIGNED_TYPE): Remove.
1770 (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove.
1772 2007-06-08 Jakub Jelinek <jakub@redhat.com>
1775 * semantics.c (finish_omp_for): Call fold_build_cleanup_point_expr
1776 on init, the non-decl cond operand and increment value.
1778 2007-06-07 Simon Martin <simartin@users.sourceforge.net>
1781 * decl.c (check_initializer): Report an error when a brace enclosed
1782 initializer is used for a non-aggregate type in C++98.
1783 (redeclaration_error_message): Rewrote flag_cpp0x in terms of
1785 (grokdeclarator): Likewise.
1786 (move_fn_p): Likewise.
1787 * typeck.c (check_return_expr): Likewise.
1788 * call.c (reference_binding): Likewise.
1789 * error.c (cp_cpp_error): Likewise.
1790 * pt.c (check_default_tmpl_args): Likewise.
1792 * lex.c (init_reswords): Likewise.
1793 * parser.c (p_parser_primary_expression): Likewise.
1794 (TOKEN_PRECEDENCE): Likewise.
1795 (cp_parser_init_declarator): Likewise.
1796 (cp_parser_ptr_operator): Likewise.
1797 (cp_parser_parameter_declaration): Likewise.
1798 (cp_parser_enclosed_template_argument_list): Likewise.
1799 (cp_parser_skip_to_end_of_template_parameter_list): Likewise.
1800 (cp_parser_next_token_ends_template_argument_p): Likewise.
1802 2007-06-04 Simon Baldwin <simonb@google.com>
1804 * decl.c (grokdeclarator): Readability change. Moved case labels
1805 into direct switch statement scope.
1807 2007-06-04 Paolo Carlini <pcarlini@suse.de>
1809 * call.c (convert_like_real): Remove pointless code.
1811 2007-05-31 Mark Mitchell <mark@codesourcery.com>
1813 * decl.c (get_atexit_fn_ptr_type): New function.
1814 (get_atexit_node): Use it.
1815 (start_cleanup_fn): Likewise.
1816 (register_dtor_fn): Use the object's destructor, instead of a
1817 separate cleanup function, where possible.
1818 * cp-tree.h (CPTI_ATEXIT_FN_PTR_TYPE): New enumerator.
1819 (atexit_fn_ptr_type_node): New macro.
1820 * decl2.c (build_cleanup): Use build_address.
1822 2007-05-31 Daniel Berlin <dberlin@dberlin.org>
1824 * typeck.c (build_binary_op): Include types in error.
1826 2007-05-31 Jakub Jelinek <jakub@redhat.com>
1829 * decl.c (cp_finish_decl): Also clear was_readonly if a static var
1830 needs runtime initialization.
1832 2007-05-31 Paolo Carlini <pcarlini@suse.de>
1835 * semantics.c (finish_trait_expr): Complete the types.
1837 2007-05-30 Russell Yanofsky <russ@yanofsky.org>
1838 Douglas Gregor <doug.gregor@gmail.com>
1839 Pedro Lamarao <pedro.lamarao@mndfck.org>
1840 Howard Hinnant <howard.hinnant@gmail.com>
1844 * typeck.c (comptypes): Don't consider rvalue and lvalue
1845 reference types to be equivalent.
1846 (check_return_expr): Move from certain lvalues when returning
1848 * decl.c (grokdeclarator): Implement reference collapsing.
1849 (copy_fn_p): Don't consider constructors taking rvalue references
1850 to be copy constructors.
1852 * call.c (conversion): New "rvaluedness_matches_p" member.
1853 (convert_class_to_reference): Require reference type as first
1854 parameter instead of base type.
1855 (reference_binding): Add logic to handle rvalue references.
1856 (implicit_conversion): Update inaccurate comment.
1857 (convert_like_real): Disable creation of temporaries that are
1858 impossible to initialize for types with move constructors.
1859 (build_over_call): Elide move constructors when possible.
1860 (maybe_handle_implicit_object): Set "rvaluedness_matches_p".
1861 (maybe_handle_ref_bind): Return conversion instead of type node.
1862 (compare_ics): Add logic to use "rvaluedness_matches_p" values to
1863 determine preferred conversion sequences.
1864 * cp-tree.h (TYPE_REF_IS_RVALUE): New.
1865 (LOOKUP_PREFER_RVALUE): New.
1866 (DECL_MOVE_CONSTRUCTOR_P): New.
1867 (struct cp_declarator): Add "reference" member for reference
1868 types, with new "rvalue_ref" flag.
1869 (cp_build_reference_type): Declare.
1870 (move_fn_p): Declare.
1871 * error.c (dump_type_prefix): Format rvalue reference types
1872 correctly in error messages.
1873 * except.c (build_throw): Move from certain lvalues when
1875 * mangle.c (write_type): Mangle rvalue references differently
1876 than regular references.
1877 * parser.c (make_reference_declarator): Add boolean parameter for
1879 (cp_parser_make_indirect_declarator): New.
1880 (cp_parser_new_declarator_opt): Call
1881 cp_parser_make_indirect_declarator.
1882 (cp_parser_conversion_declarator_opt): Ditto.
1883 (cp_parser_declarator): Ditto.
1884 (cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference
1886 * pt.c (tsubst): Implement reference collapsing.
1887 (maybe_adjust_types_for_deduction): Implement special template
1888 parameter deduction rule for rvalue references.
1889 (type_unification_real): Update calls to
1890 maybe_adjust_types_for_deduction.
1891 (try_one_overload): Ditto.
1892 (unify_pack_expansion): Ditto.
1893 * tree.c (lvalue_p_1): Handle rvalue reference types.
1894 (cp_build_reference_type): New.
1896 2007-05-30 Jakub Jelinek <jakub@redhat.com>
1899 * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC
1900 variables that need runtime initialization.
1902 2007-05-28 Andrew Pinski <Andrew_pinski@playstation.sony.com>
1905 * typeck.c (build_unary_op <case PREINCREMENT_EXPR,
1906 case POSTINCREMENT_EXPR, case PREDECREMENT_EXPR,
1907 case POSTDECREMENT_EXPR>): Return the error_mark_node
1908 if either the real or imaginary parts would an
1911 2007-05-25 Simon Martin <simartin@users.sourceforge.net>
1912 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1915 * parser.c (cp_parser_skip_to_closing_brace): Return true if the next
1916 token is a closing brace, false if there are no tokens left.
1917 (cp_parser_namespace_alias_definition): Only consume the next token if
1918 it is a closing brace.
1920 * parser.c (cp_parser_class_specifier): Likewise.
1922 2007-05-25 H.J. Lu <hongjiu.lu@intel.com>
1924 * semantics.c (finish_member_declaration): Fix a typo in the
1927 2007-05-25 Douglas Gregor <doug.gregor@gmail.com>
1939 * error.c (dump_type): Dump TYPE_ARGUMENT_PACK nodes.
1940 * cp-tree.h (check_for_bare_parameter_packs): Returns bool.
1941 * pt.c (check_for_bare_parameter_packs): Return bool indicated
1942 whether everything was okay. Fix indentation.
1943 (push_template_decl_real): Check for bare parameter packs in
1944 function parameters; where errors occur, mark the parameter types
1945 with ERROR_MARK_NODEs to avert ICEs.
1946 (coerce_template_parameter_pack): New.
1947 (coerce_template_parms): Moved parameter pack coercion into
1948 coerce_template_parameter_pack, and permit it anywhere in the
1949 template parameter list (not just at the end). Parameter and
1950 argument indices can vary (somewhat) separately now, so add
1951 PARM_IDX and ARG_IDX.
1952 (fn_type_unification): Don't set an argument pack as incomplete if
1953 no argument pack was deduced.
1954 (type_unification_real): If a type parameter is a parameter pack
1955 and has not otherwise been deduced, it will be deduced to an empty
1957 (more_specialized_fn): Use the actual lengths of the argument
1958 lists when comparing against expansions.
1959 * semantics.c (finish_member_declaration): If a field's type has
1960 bare parameter packs, error and set its type to ERROR_MARK_NODE.
1962 2007-05-24 Danny Smith <dannysmith@users.sourceforge.net>
1965 * mangle.c (mangle_decl): Call targetm.mangle_decl_assembler_name.
1967 2007-05-22 Ollie Wild <aaw@google.com>
1969 * name-lookup.c (ambiguous_decl): Adds check for hidden types.
1970 (unqualified_namespace_lookup): Adds check for hidden types.
1972 2007-05-22 Ollie Wild <aaw@google.com>
1974 * decl.c (duplicate_decls): Verify namespace names are unique.
1976 2007-05-21 Mark Mitchell <mark@codesourcery.com>
1978 * decl.c (cxx_maybe_build_cleanup): Handle
1979 __attribute__((cleanup)).
1981 2007-05-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1983 * cvt.c (cp_convert_and_check): Don't check warnings if the
1986 2007-05-18 Geoffrey Keating <geoffk@apple.com>
1988 * mangle.c (write_real_cst): Use 'unsigned long' for %lx.
1990 2007-05-14 Paolo Carlini <pcarlini@suse.de>
1993 * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the
1994 type only if is a class type (5.2.8/4).
1996 2007-05-14 Rafael Avila de Espindola <espindola@google.com>
1998 * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
1999 * decl.c (grokdeclarator): Use unsigned_type_for instead of
2000 c_common_unsigned_type.
2002 2007-05-11 Silvius Rus <rus@google.com>
2004 * cp/typeck.c (build_indirect_ref): Add call to
2005 strict_aliasing_warning.
2006 (build_reinterpret_cast_1): Condition call to
2007 strict_aliasing_warning.
2009 2007-05-11 Jan Hubicka <jh@suse.cz>
2011 * semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
2012 * decl2.c (start_objects): ctors and dtors are no longer public.
2013 (cp_write_global_declarations): Do not call c_build_cdtor_fns.
2015 2007-05-07 Andrew Pinski <andrew_pinski@playstation.sony.com>
2017 * typeck.c (build_unary_op): Remove code that used to
2018 handle non lvalue increments/decrements.
2020 2007-05-07 Mike Stump <mrs@apple.com>
2022 * parser.c (check_empty_body): Add.
2023 (cp_parser_iteration_statement): Add call to check_empty_body.
2025 2007-05-05 Geoffrey Keating <geoffk@apple.com>
2028 * mangle.c (write_mangled_name): Mangle static variable names.
2029 (write_unqualified_name): Use local-source-name for
2030 namespace-scope static variables.
2032 2007-05-04 Dirk Mueller <dmueller@suse.de>
2034 * cp-tree.h (DECL_MAIN_P): only if -ffreestanding is
2037 2007-05-02 Seongbae Park <seongbae.park@gmail.com>
2040 * decl2.c (constrain_class_visibility):
2041 Use strip_pointer_or_array_types instead of strip_array_types.
2043 2007-04-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
2046 * decl.c (reshape_init_r): Don't reshape the first element if it
2047 is a pointer to member function.
2049 2007-04-27 Simon Baldwin <simonb@google.com>
2051 * decl.c (grokparms): Changed message format from %qD to %qE.
2053 2007-04-27 Douglas Gregor <doug.gregor@gmail.com>
2055 * error.c (maybe_warn_variadic_templates): Variadic templates are
2056 now in C++0x, so only warn about them in C++98 mode.
2058 2007-04-26 Andrew Pinski <andrew_pinski@playstation.sony.com>
2061 * typeck.c (build_reinterpret_cast_1): Only allow conversion to
2062 integeral types from vectors types.
2064 2007-04-26 Jakub Jelinek <jakub@redhat.com>
2067 * semantics.c (finish_omp_clauses): Don't create CP_OMP_CLAUSE_INFO
2068 for type dependent OMP_CLAUSE_DECLs.
2070 2007-04-24 Mark Mitchell <mark@codesourcery.com>
2073 * cp-tree.h (ARITHMETIC_TYPE): Include COMPLEX_TYPE.
2074 * typeck.c (type_after_usual_arithmetic_conversions): Adjust, as
2075 COMPLEX_TYPE is now an ARITHMETIC_TYPE.
2076 * init.c (build_zero_init): Adjust, as
2077 COMPLEX_TYPE is now a SCALAR_TYPE.
2078 * typeck2.c (digest_init): Allow brace-enclosed initializers for
2079 COMPLEX_TYPE, even though that is now a SCALAR_TYPE.
2081 2007-04-25 Paolo Carlini <pcarlini@suse.de>
2083 * semantics.c (classtype_has_nothrow_copy_or_assign_p): Adjust
2084 per N2255; rename as classtype_has_nothrow_assign_or_copy_p.
2085 (trait_expr_value): Adjust.
2087 2007-04-23 Simon Baldwin <simonb@google.com>
2089 * decl.c (grokparms): Added new error for duplicate function
2090 parameters names in function prototypes, to match gcc behavior.
2092 2007-04-23 Jan Hubicka <jh@suse.cz>
2094 * cp/decl2.c (finish_objects): Do not call target constructor/destructor
2097 2007-04-21 Andrew Pinski <andrew_pinski@playstation.sony.com>
2099 * cp-tree.h (lang_tree_node): Use GENERIC_NEXT
2100 instead of checking GIMPLE_STMT_P in chain_next.
2102 2007-04-17 Mark Mitchell <mark@codesourcery.com>
2105 * call.c (convert_for_arg_passing): Convert bitfields to their
2108 2007-04-17 Simon Martin <simartin@users.sourceforge.net>
2111 * pt.c (value_dependent_expression_p): Handle MODOP_EXPRs.
2113 2007-04-16 Seongbae Park <seongbae.park@gmail.com>
2116 * cp/decl2.c (constrain_class_visibility):
2117 Do not warn about the use of anonymous namespace in the main input file.
2119 2007-04-15 Mark Mitchell <mark@codesourcery.com>
2121 * cp-tree.h (current_template_parms): Fix typo in comment.
2123 2007-04-15 Kazu Hirata <kazu@codesourcery.com>
2125 * cp-tree.h, error.c: Fix comment typos.
2127 2007-04-13 Jason Merrill <jason@redhat.com>
2130 * call.c (reference_binding): Add c_cast_p parm. If true,
2131 add quals to TO as needed to make it reference-compatible.
2133 2007-04-11 Jan Hubicka <jh@suse.cz>
2135 * cp/class.c (convert_to_base_statically): Fold produced tree; verify
2136 that we are not processing template_decl.
2138 2007-04-09 Mark Mitchell <mark@codesourcery.com>
2141 * class.c (build_base_path): Ensure that the converted pointer has
2142 the same cv-qualification as the input.
2144 2007-04-09 Paolo Carlini <pcarlini@suse.de>
2146 * tree.c (cp_tree_equal): Deal with TRAIT_EXPR.
2148 2007-04-08 Steven Bosscher <steven@gcc.gnu.org>
2150 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS):
2152 (LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P): Do not set it.
2153 * tree.c (cp_add_pending_fn_decls): Remove.
2154 * cp-tree.h (cp_add_pending_fn_decls): Remove prototype.
2156 2007-04-07 Daniel Berlin <dberlin@dberlin.org>
2158 Revert change removing staticp.
2160 2007-04-06 Daniel Berlin <dberlin@dberlin.org>
2162 * cp-objcp-common.c (cxx_staticp): Remove.
2163 * cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
2164 * cp-tree.h (cxx_staticp):
2166 2007-04-04 Danny Smith <dannysmith.users.sourceforge.net>
2168 * class.c (check_for_override): Don't remove dllmport attribute
2171 2007-04-03 Jakub Jelinek <jakub@redhat.com>
2174 * typeck.c (build_modify_expr): For COND_EXPR on LHS, if RHS has void
2175 type issue error and return early.
2177 2007-03-30 Jason Merrill <jason@redhat.com>
2180 * typeck.c (cp_type_readonly): New fn.
2181 * cp-tree.h: Declare it.
2182 * decl.c (start_decl): Set implicit DECL_THIS_STATIC here.
2183 (cp_finish_decl): Not here.
2185 2007-03-31 Richard Guenther <rguenther@suse.de>
2187 * optimize.c (maybe_clone_body): Replace splay-tree usage by
2190 2007-03-31 Douglas Gregor <doug.gregor@gmail.com>
2195 * parser.c (declarator_can_be_parameter_pack): New.
2196 (cp_parser_template_parameter): Only parse the `...' if the
2197 declarator can be a parameter pack.
2198 (cp_parser_parameter_declaration): Ditto. Also, handle when TYPE
2200 * pt.c (find_parameter_packs_r): Look into the bounds on integer
2201 types (they could be used as array bounds).
2202 (check_for_bare_parameter_packs): Deal with TEMPLATE_PARM_INDEX.
2203 (tsubst_pack_expansion): Handle failure to expand parameter
2206 2007-03-30 Paolo Carlini <pcarlini@suse.de>
2209 * cp-tree.h (enum cp_trait_kind, struct tree_trait_expr,
2210 TRAIT_EXPR_TYPE1, TRAIT_EXPR_TYPE2, TRAIT_EXPR_KIND): Add.
2211 (enum cp_tree_node_structure_enum, union lang_tree_node): Update.
2212 (CLASS_TYPE_NON_UNION_P): Add.
2213 (struct lang_type_class): Add has_complex_dflt.
2214 (TYPE_HAS_COMPLEX_DFLT, TYPE_HAS_TRIVIAL_DFLT): Add.
2215 (locate_copy, locate_ctor, locate_dtor, finish_trait_expr): Declare.
2216 * cp-tree.def: Add TRAIT_EXPR.
2217 * cp-objcp-common.c (cp_tree_size): Add TRAIT_EXPR case.
2218 * lex.c (struct resword): Add __has_nothrow_assign,
2219 __has_nothrow_constructor, __has_nothrow_copy, __has_trivial_assign,
2220 __has_trivial_constructor, __has_trivial_copy,
2221 __has_trivial_destructor, __has_virtual_destructor, __is_abstract,
2222 __is_base_of, __is_class, __is_convertible_to, __is_empty, __is_enum,
2223 __is_pod, __is_polymorphic, __is_union.
2224 * parser.c (cp_parser_primary_expression): Deal with the new RIDs.
2225 (cp_parser_trait_expr): New.
2226 * semantics.c (finish_trait_expr, trait_expr_value
2227 classtype_has_nothrow_copy_or_assign_p): New.
2228 * method.c (locate_copy, locate_ctor, locate_dtor): Do not define
2230 * decl.c (cp_tree_node_structure): Add TRAIT_EXPR.
2231 * class.c (check_bases, check_field_decl, check_bases_and_members):
2232 Deal with TYPE_HAS_COMPLEX_DFLT (t) too.
2233 * pt.c (uses_template_parms, tsubst_copy_and_build,
2234 value_dependent_expression_p, type_dependent_expression_p): Deal with
2236 * tree.c (cp_walk_subtrees): Deal with TRAIT_EXPR.
2238 2007-03-29 Richard Guenther <rguenther@suse.de>
2240 * tree.c (cp_walk_subtrees): Do not set input_location.
2242 2007-03-28 Simon Martin <simartin@users.sourceforge.net>
2245 * decl.c (grokfndecl): Properly setup decl if it is a constructor or a
2248 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
2250 * parser.c (struct cp_parser): Update comment for
2251 greater_than_is_operator_p.
2252 (cp_parser_primary_expression): In C++0x mode, a cast operator can
2253 be terminated with a `>>' token when !GREATER_THAN_IS_OPERATOR_P.
2254 (TOKEN_PRECEDENCE): In C++0x mode, `>>' is treated like `>' when
2255 !GREATER_THAN_IS_OPERATOR_P.
2256 (cp_parser_binary_expression): When -Wc++0x-compat, warn about
2257 `>>' operators that will become two `>' tokens in C++0x.
2258 (cp_parser_parameter_declaration): Treat `>>' like `>' in C++0x
2259 mode, allowing it to terminate default arguments.
2260 (cp_parser_enclosed_template_argument_list): In C++0x mode, treat
2261 `>>' like two consecutive `>' tokens.
2262 (cp_parser_skip_to_end_of_template_parameter_list): Ditto.
2263 (cp_parser_next_token_ends_template_argument_p): In C++0x, `>>'
2264 ends a template argument.
2266 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
2268 * decl.c (redeclaration_error_message): Complain when redeclaring
2269 a friend function with default template arguments (C++0x mode only).
2270 * cp-tree.h (check_default_tmpl_args): Declare.
2271 * pt.c (check_default_tmpl_args): In C++0x mode, permit default
2272 template arguments in function templates. Add support for checking
2273 the default template arguments of friend templates.
2274 (push_template_decl_real): Fix call to check_default_tmpl_args.
2275 (type_unification_real): If a template parameter has not been
2276 deduced but provides a default template argument, substitute into
2277 that default template argument.
2278 * parser.c (cp_parser_init_declarator): When declaring (but not
2279 defining!) a function template in C++0x mode, check for default
2282 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
2285 * decl.c (grokdeclarator): Deal with cv-qualified function type
2286 typedefs in the same way for member and non-member functions.
2288 2007-03-26 Dirk Mueller <dmueller@suse.de>
2290 * parser.c (cp_parser_member_declaration): Pedwarn
2291 about stray semicolons after member declarations.
2293 2007-03-26 Paolo Carlini <pcarlini@suse.de>
2296 * pt.c (instantiate_decl): Set in_system_header.
2298 2007-03-22 Mark Mitchell <mark@codesourcery.com>
2300 * cp-tree.h (current_tempalte_parms): Improve documentation.
2301 * pt.c (current_template_args): Likewise.
2304 * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Do
2305 not consume tokens when failing.
2307 2007-03-22 Jim Wilson <wilson@specifix.com>
2308 Mark Mitchell <mark@codesourcery.com>
2311 * call.c (standard_conversion): Use type_decays_to. Keep FCODE
2312 consistent with FROM.
2314 2007-03-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
2316 * error.c (dump_expr): Handle dependent names that designate types.
2317 * cxx-pretty-print.c (pp_cxx_unqualified_id): Handle TYPENAME_TYPE.
2319 2007-03-17 Kazu Hirata <kazu@codesourcery.com>
2321 * cp-tree.def, parser.c, pt.c: Fix comment typos.
2323 2007-03-16 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2325 * cvt.c (cp_convert_and_check) : Define.
2326 * cp-tree.h (cp_convert_and_check): Declare.
2327 * call.c (convert_conversion_warnings): Rename to
2328 conversion_null_warnings. The warning for floating-point to
2329 integer is handled by convert_and_check in convert_like_real.
2330 (convert_like_real): convert_conversion_warnings was renamed as
2331 conversion_null_warnings.
2332 * typeck.c (build_binary_op): Use cp_convert_and_check to warn for
2333 overflow and changes of value during conversion.
2335 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2338 * parser.c (cp_parser_statement): If 'namespace' is found, this
2339 only can be a namespace alias definition, so parse it now.
2340 (cp_parser_namespace_alias_definition): if we find an open brace
2341 instead of '=', then this is actually a misplaced namespace
2344 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2347 * decl.c (cxx_init_decl_processing): Move command-line options
2348 processing to c-opts.c.
2350 2007-03-15 Douglas Gregor <doug.gregor@gmail.com>
2352 * ptree.c (cxx_print_type): Use formatting markup for integers
2353 when printing template parameter index/level/orig level.
2354 (cxx_print_xnode): Ditto.
2355 * cp-tree.h (TEMPLATE_PARM_PARAMETER_PACK): Use TREE_LANG_FLAG_0.
2356 (struct template_parm_index_s): Remove the PARAMETER_PACK member.
2357 Make INDEX, LEVEL, and ORIG_LEVEL integers instead of
2359 (struct saved_scope): Make X_PROCESSING_TEMPLATE_DECL an int,
2360 rather than a HOST_WIDE_INT.
2361 Turn X_PROCESSING_EXPLICIT_INSTANTIATION, SKIP_EVALUATION, and
2362 NEED_POP_FUNCTION_CONTEXT into bool bitfields; reorder fields for
2364 (struct language_function): Make RETURNS_VALUE, RETURNS_NULL,
2365 RETURNS_ABNORMALLY, IN_FUNCTION_TRY_HANDLER, and
2366 IN_BASE_INITIALIZER bool bitfields.
2367 (struct cp_declarator): Make KIND a 4-bit field. Make
2368 PARAMETER_PACK_P a bool bitfield just after KIND.
2369 * pt.c (uses_parameter_packs): Destroy the pointer set.
2370 (make_pack_expansion): Ditto.
2371 (check_for_bare_parameter_packs): Ditto.
2372 * name-lookup.c (push_to_top_level): Make need_pop a bool value.
2374 2007-03-14 Andrew Pinski <andrew_pinski@playstation.sony.com>
2377 * call.c (convert_default_arg): Instead of copying the node,
2380 2007-03-15 Dirk Mueller <dmueller@suse.de>
2383 * call.c (convert_conversion_warnings): New..
2384 (convert_like_real): .. factored out from here.
2385 (convert_conversion_warnings): Add warning about
2386 false being converted to NULL in argument passing.
2388 2007-03-14 Dirk Mueller <dmueller@suse.de>
2390 * cp/semantics.c (c_finish_if_stmt): Call empty_if_body_warning.
2391 (finish_do_body): Warn about empty body in do/while statement.
2393 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2395 * class.c (warn_hidden): Add OPT_Woverloaded_virtual to warning.
2397 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2400 * typeck.c (build_binary_op): Call warn_for_div_zero instead of
2403 2007-03-13 Alexandre Oliva <aoliva@redhat.com>
2405 * cp/repo.c (init_repo): Initialize random_seed saved options.
2406 (finish_repo): Adjust.
2408 2007-03-13 Mark Mitchell <mark@codesourcery.com>
2411 * Make-lang.in (doc/g++.1): Use $< to specify the location from
2414 2007-03-12 Seongbae Park <seongbae.park@gmail.com>
2416 * decl.c (compute_array_index_type): New warning flag warn_vla.
2418 2007-03-12 Mark Mitchell <mark@codesourcery.com>
2421 * call.c (convert_default_arg): Copy non-constant arguments.
2423 2007-03-11 Mark Mitchell <mark@codesourcery.com>
2426 * parser.c (cp_parser_postfix_expression): Disallow compound
2427 literals in constant expressions.
2430 * semantics.c (finish_typeof): Use unlowered_expr_type.
2432 2007-03-10 Mark Mitchell <mark@codesourcery.com>
2435 * cp-tree.h (unlowered_expr_type): New function.
2436 * typeck.c (is_bitfield_expr_with_lowered_type): Handle
2437 COMPOUND_EXPR, MODIFY_EXPR, and SAVE_EXPR.
2438 (unlowered_expr_type): New function.
2439 (build_unary_op): Disallow predecrements of bool bitfields.
2440 * call.c (build_conditional_expr): Use unlowered_expr_type.
2441 * pt.c (type_unification_real): Likewise.
2443 2007-03-09 Douglas Gregor <doug.gregor@gmail.com>
2446 * typeck.c (check_return_expr): Check for bare parameter packs.
2447 (comptypes): Compare template parameter packs and
2448 type pack expansions.
2449 * decl.c (grokdeclarator): Deal with the declaration of function
2451 (grokparms): Verify that the (optional) function parameter pack is
2452 at the end of the parameter list.
2453 (xref_basetypes): Handle pack expansions in the base class.
2454 (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT.
2455 * cp-tree.def (TYPE_ARGUMENT_PACK): New.
2456 (NONTYPE_ARGUMENT_PACK): New.
2457 (TYPE_PACK_EXPANSION): New.
2458 (EXPR_PACK_EXPANSION): New.
2459 (ARGUMENT_PACK_SELECT): New.
2460 * cp-objcp-common.c (cp_tree_size): Compute size of
2461 (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and
2462 ARGUMENT_PACK_SELECT.
2463 * error.c (dump_template_argument): Print template argument packs.
2464 (dump_template_argument_list): Ditto.
2465 (dump_template_parameter): Dump `...' for template type parameter
2467 (dump_type): Dump TYPE_PACK_EXPANSION nodes.
2468 (dump_parameters): Print function parameter packs.
2469 (dump_template_parms): Print template argument packs.
2470 (dump_expr): Dump EXPR_PACK_EXPANSION nodes.
2471 (maybe_warn_variadic_templates): New.
2472 * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION.
2473 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
2474 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
2476 * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION.
2477 (write_template_arg): Write argument packs as separate arguments.
2478 * cp-tree.h (struct template_parm_index_s): Add flag that
2479 indicates that the template parameter is actually a parameter
2481 (struct tree_argument_pack_select): New.
2482 (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT.
2483 (union lang_tree_node): Add argument_pack_select.
2484 (FUNCTION_PARAMETER_PACK_P): New.
2485 (PACK_EXPANSION_P): New.
2486 (PACK_EXPANSION_PATTERN): New.
2487 (SET_PACK_EXPANSION_PATTERN): New.
2488 (PACK_EXPANSION_PARAMETER_PACKS): New.
2489 (ARGUMENT_PACK_P): New.
2490 (ARGUMENT_PACK_ARGS): New.
2491 (SET_ARGUMENT_PACK_ARGS): New.
2492 (ARGUMENT_PACK_INCOMPLETE_P): New.
2493 (ARGUMENT_PACK_EXPLICIT_ARGS): New.
2494 (TEMPLATE_PARM_PARAMETER_PACK): New.
2495 (TEMPLATE_TYPE_PARAMETER_PACK): New.
2496 (ARGUMENT_PACK_SELECT_FROM_PACK): New.
2497 (ARGUMENT_PACK_SELECT_INDEX): New.
2498 (ARGUMENT_PACK_SELECT_ARG): New.
2499 (struct cp_declarator): Add parameter_pack_p flag.
2500 (maybe_warn_variadic_templates): Declare.
2501 (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to
2502 indicate a template parameter pack.
2503 (uses_parameter_packs): Declare.
2504 (template_parameter_pack_p): Declare.
2505 (template_parms_variadic_p): Declare.
2506 (make_pack_expansion): Declare.
2507 (check_for_bare_parameter_packs): Declare.
2508 * cxx-pretty-print.c (pp_cxx_unary_expression): Print
2509 sizeof... expressions.
2510 (pp_cxx_expression): Print pack expansions and non-type argument
2512 (pp_cxx_exception_specification): Print pack expansions.
2513 (pp_cxx_direct_declarator): Print ellipsis for parameter packs.
2514 (pp_cxx_ctor_initializer): Print pack expansions.
2515 (pp_cxx_type_id): Print pack expansions.
2516 (pp_cxx_template_argument_list): Print argument packs.
2517 (pp_cxx_template_parameter): Print ellipsis for template parameter
2519 * pt.c (comp_template_parms): Compare template parameter packs.
2520 (template_parameter_pack_p): New.
2521 (template_parms_variadic_p): New.
2522 (template_args_variadic_p): New.
2523 (make_ith_pack_parameter_name): New.
2524 (struct find_parameter_pack_data): New.
2525 (find_parameter_packs_r): New.
2526 (uses_parameter_packs): New.
2527 (make_pack_expansion): New.
2528 (check_for_bare_parameter_packs): New.
2529 (expand_template_argument_pack): New.
2530 (reduce_template_parm_level): Propagate parameter pack flag.
2531 (process_template_parm): Add is_parameter_pack parameter to state
2532 when the parameter is actually a parameter pack. Create template
2533 parameter packs when is_parameter_pack is true.
2534 (current_template_args): The argument for a template parameter
2535 pack is an argument pack containing a single pack expansion.
2536 (process_partial_specialization): When checking that non-type
2537 argument expressions do not involve template parameters, loop over
2538 the arguments in argument packs separately.
2539 (push_template_decl_real): Check that the type of the declaration
2540 does not have any bare parameter packs. Check that primary
2541 templates have no more than one parameter pack, and that it comes
2542 at the end of the template parameter list.
2543 (convert_template_argument): Handle coercions for pack expansion
2544 expressions by coercing the pattern then rebuilding the expansion.
2545 (coerce_template_parms): When coercing the arguments for a
2546 variadic template, pack "extra" arguments into an argument pack.
2547 (coerce_template_template_parms): Cannot coerce between parameter
2548 packs and non-pack parameters.
2549 (template_args_equal): Compare PACK_EXPANSION_P expressions.
2550 (comp_template_args): Expand all template arguments packs before
2551 comparing template argument lists.
2552 (mangle_class_name_for_template): Make argument packs as separate
2554 (for_each_template_parm_r): No need to handle BASELINK.
2555 (instantiate_class_template): Handle pack expansions in the base
2557 (tsubst_pack_expansion): New.
2558 (tsubst_template_args): Handle substitutions of argument packs and
2559 pack expansion into template argument lists.
2560 (tsubst_decl): Expand function parameter packs into separate
2561 function parameters.
2562 (tsubst_arg_types): Expand a type pack expansion into separate
2564 (tsubst_exception_specification): Handle pack expansions in
2565 exception specifiers.
2566 (tsubst): See through ARGUMENT_PACK_SELECT arguments when
2567 replacing a template parameter with its argument. If we encounter
2568 a substitution for an argument pack, just return the parameter
2570 (tsubst_copy): sizeof(X...) returns the number of elements in
2571 parameter pack X. See through ARGUMENT_PACK_SELECT when the
2572 PARM_DECL is a parameter pack.
2573 (tsubst_expr): Expression pack expansions and argument packs
2574 cannot show up here; they will all be handled through function
2575 calls, sizeof, and template argument lists.
2576 (tsubst_copy_and_build): sizeof(X...) returns the number of
2577 elements in parameter pack X. Handle pack expansions in TREE_LIST
2578 and CONSTRUCTOR nodes.
2579 (fn_type_unification): Handle "incomplete" explicit template
2580 argument lists that specify some of the arguments for a template
2582 (type_unification_real): Unify arguments against pack expansions.
2583 (template_parm_level_and_index): New, helper function.
2584 (unify_pack_expansion): New.
2585 (unify): Unify argument packs on an argument-by-argument basis,
2586 handling variadic argument packs as well.
2587 (more_specialized_fn): Handle unification of function parameter
2588 packs. All things being equal, prefer non-variadic function
2589 templates to variadic function templates.
2590 (more_specialized_class): Prefer the variadic class template
2591 partial specialization that binds fewer arguments to a parameter
2593 (regenerate_decl_from_template): Expand function parameter packs
2594 into separate parameters.
2595 (instantiate_decl): Ditto.
2596 (tsubst_initializer_list): Handle pack expansions for base-class
2598 (dependent_type_p_r): Determine dependent types in argument packs
2599 and pack expansions.
2600 (value_dependent_expression_p): Determine value-dependence of
2601 non-type argument packs.
2602 (dependent_template_arg_p): Handle argument packs.
2603 * semantics.c (finish_cond): Check for bare parameter packs.
2604 (finish_expr_stmt): Ditto.
2605 (finish_for_expr): Ditto.
2606 (finish_switch_cond): Ditto.
2607 (finish_mem_initializers): Ditto.
2608 * name-lookup.c (arg_assoc_type): Handle pack expansions and
2610 * decl2.c (cp_build_parm_decl): Mark function parameter packs.
2611 * parser.c (make_declarator): Declarator is not an expansion.
2612 (make_pointer_declarator): Transfer parameter pack flag to outer
2614 (make_reference_declarator): Ditto.
2615 (make_ptrmem_declarator): Ditto.
2616 (make_call_declarator): Ditto.
2617 (make_array_declarator): Ditto.
2618 (cp_parser_postfix_expression): Allow pack expansion expressions
2619 in the argument list for a call expression.
2620 (cp_parser_parenthesized_expression_list): Add new parameter
2621 ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand
2622 into separate arguments."
2623 (cp_parser_new_placement): Allow pack expansion expressions.
2624 (cp_parser_new_initializer): Ditto.
2625 (cp_parser_mem_initializer_list): Allow ellipsis to create a
2626 base-class initializer expansion.
2627 (cp_parser_mem_initializer): Ditto.
2628 (cp_parser_template_parameter_list): Keep track of whether the
2629 template parameter is a template parameter pack.
2630 (cp_parser_template_parameter): Parse the ellipsis to indicate a
2631 template parameter pack.
2632 (cp_parser_type_parameter): Ditto.
2633 (cp_parser_template_argument_list): Parse the ellipsis to indicate
2635 (cp_parser_direct_declarator): Parse the ellipsis to indicate that
2636 this declarator is a parameter pack.
2637 (cp_parser_parameter_declaration): The ellipsis does not end the
2638 parameter declaration, because it might be a parameter pack. Parse
2639 the ellipsis to indicate a parameter pack.
2640 (cp_parser_initializer): Allow pack expansions.
2641 (cp_parser_initializer_list): Allow ellipsis to create an
2642 initializer expansion.
2643 (cp_parser_base_clause): Allow ellipsis to create a base specifier
2645 (cp_parser_type_id_list): Allow ellipsis to create an exception
2646 specifier expansion.
2647 (cp_parser_attribute_list): Don't allow pack expansions.
2648 (cp_parser_functional_cast): Allow pack expansions.
2649 (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to
2650 compute the length of a parameter pack.
2651 (cp_parser_next_token_ends_template_argument_p): An ellipsis can
2652 end a template argument.
2653 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
2654 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
2657 2007-03-09 Dirk Mueller <dmueller@suse.de>
2659 * cp/call.c (build_new_op): Call warn_logical_operator.
2661 2007-03-08 Volker Reichelt <reichelt@netcologne.de>
2664 * semantics.c (finish_offsetof): Handle COMPOUND_EXPR.
2667 * pt.c (any_template_arguments_need_structural_equality_p):
2670 2007-03-08 Alexandre Oliva <aoliva@redhat.com>
2672 * decl.c (grokdeclarator): Disable warnings for anonymous
2675 2007-03-05 Volker Reichelt <reichelt@netcologne.de>
2677 * typeck2.c (readonly_error): Always emit a hard error.
2678 Remove last argument.
2679 * cp-tree.h (readonly_error): Adjust prototype.
2680 * semantics.c (finish_asm_stmt): Adjust call to readonly_error.
2681 * typeck.c (build_unary_op): Likewise.
2682 (build_modify_expr): Likewise.
2684 2007-03-04 Simon Martin <simartin@users.sourceforge.net>
2687 * tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees.
2689 2007-03-03 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2692 * parser.c (struct cp_parser): New IN_IF_STMT.
2693 (cp_parser_statement_seq_opt): Handle an unexpected 'else',
2694 returning if parsing the body of an 'if' statement or issuing an
2695 error and continuing.
2696 (cp_parser_selection_statement): Set IN_IF_STMT bit when parsing
2698 (cp_parser_jump_statement): Mask new IN_IF_STMT bit.
2700 2007-03-02 Simon Martin <simartin@users.sourceforge.net>
2703 * class.c (update_vtable_entry_for_fn): Properly handle invalid overriders
2706 2007-03-02 Geoffrey Keating <geoffk@apple.com>
2708 * g++spec.c (lang_specific_driver): Add -lstdc++ when compiling
2709 Objective-C++. Don't exit early if -shared-libgcc needs to be
2712 2007-03-02 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2714 * typeck.c (common_base_type): Delete unused function.
2716 2007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
2718 * Make-lang.in: Add dummy lang.install-pdf target.
2720 2007-03-01 Simon Baldwin <simonb@google.com>
2723 * decl.c (check_tag_decl): Added new warning for typedef ignored
2724 when it precedes an otherwise valid non-typedef declaration.
2726 2007-02-28 Sandra Loosemore <sandra@codesourcery.com>
2728 * typeck.c (build_function_call): Store converted arguments
2729 in a stack-allocated array instead of building a list.
2730 (convert_arguments): Store arguments in the array passed in as an
2731 argument, and return the actual number of arguments.
2732 * call.c (build_call): Delete, and replace with...
2733 (build_call_n, build_call_a): New.
2734 (build_op_delete_call): Rewrite to avoid constructing argument lists.
2735 (build_over_call): Store converted arguments in a stack-allocated
2736 array instead of building a list.
2737 (build_cxx_call): Pass arguments in an array instead of as a list.
2738 (build_java_interface_fn_ref): Rewrite to avoid constructing
2740 * tree.h: Update declarations to reflect above changes.
2741 * method.c (use_thunk): Use a stack-allocated array to hold
2742 the arguments instead of a list.
2743 * rtti.c (throw_bad_cast): Update call to cxx_call.
2744 (throw_bad_typeid): Likewise.
2745 (build_dynamic_cast_1): Likewise.
2746 * init.c (build_builtin_delete_call): Use build_call_n.
2747 * decl.c (expand_static_init): Likewise.
2748 * except.c (cp_protect_cleanup_actions): Likewise.
2749 * cp-gimplify.c (genericize_eh_spec_block): Likewise.
2750 (gimplify_must_not_throw_expr): Likewise.
2751 (cxx_omp_apply_fn): Use build_call_a.
2753 2007-02-26 Mark Mitchell <mark@codesourcery.com>
2755 * semantics.c (expand_or_defer_fn): Call c_record_cdtor_fn.
2756 * decl2.c (cp_write_gloabl_declarations): Call c_build_cdtor_fns.
2758 2007-02-25 Mark Mitchell <mark@codesourcery.com>
2760 * cp-tree.h (static_ctors): Remove.
2761 * cp-tree.h (static_dtors): Likewise.
2762 * cp-objcp-common.c (decl_shadowed_for_var_lookup): Adjust for
2763 refactoring of tree_map hierarchy.
2764 (decl_shadowed_for_var_insert): Likewise.
2765 * semantics.c (expand_body): Use c_expand_body.
2766 (expand_or_defer_fn): Don't update static_ctors or static_dtors.
2767 * decl2.c (static_ctors): Remove.
2768 (static_dtors): Likewise.
2769 (generate_ctor_or_dtor_function): Pass NULL_TREE to
2770 objc_generate_static_init_call. Do not call static_[cd]tors.
2771 (generate_ctor_and_dtor_functions_for_priority): Do not check for
2773 (cp_write_global_declarations): Likewise.
2775 2007-02-23 Richard Guenther <rguenther@suse.de>
2777 * class.c (note_name_declared_in_class): Make declaration
2778 changes meaning a pedwarn.
2780 2007-02-22 Michael Matz <matz@suse.de>
2783 * cp-tree.h (TFF_UNQUALIFIED_NAME): New formatting flag.
2784 * error.c (dump_aggr_type, dump_simple_decl, dump_decl,
2785 dump_function_decl): Guard emitting outer scopes by new flag.
2786 * cp-lang.c (cxx_dwarf_name): New function.
2787 (LANG_HOOKS_DWARF_NAME): Define to cxx_dwarf_name.
2788 * pt.c (classtype_mangled_name, mangle_class_name_for_template):
2790 (push_template_decl_real, lookup_template_class): Remove calls
2793 2007-02-19 Mark Mitchell <mark@codesourcery.com>
2795 * call.c (build_new_method_call): Ensure that explicit calls of
2796 destructors have type "void".
2798 2007-02-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2800 * typeck.c (build_binary_op): Replace -Wstring-literal-comparison
2801 and -Walways-true with -Waddress.
2802 * cvt.c (convert_to_void): Replace unconditional warning with
2805 2007-02-18 Kazu Hirata <kazu@codesourcery.com>
2807 * decl.c, tree.c: Fix comment typos.
2809 2007-02-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
2812 * semantics.c (finish_stmt_expr_expr): Set TREE_TYPE of the
2813 statement expression if we had an error mark node.
2815 2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
2816 Brooks Moses <brooks.moses@codesourcery.com>
2817 Lee Millward <lee.millward@codesourcery.com>
2819 * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
2820 Change class to tcc_vl_exp.
2822 * call.c (build_call): Use build_call_list instead
2824 (build_over_call): Likewise.
2825 (build_new_method_call): Use build_min_non_dep_call_list
2826 instead of build_min_non_dep.
2828 * error.c (dump_call_expr_args): New function.
2829 (dump_aggr_init_expr_args): New function.
2830 (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them.
2831 Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
2833 * cvt.c (convert_to_void): Use build_call_array instead
2834 of build3; use new AGGR_INIT_EXPR accessor macros.
2836 * mangle.c (write_expression): Use TREE_OPERAND_LENGTH
2837 instead of TREE_CODE_LENGTH.
2839 * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
2840 AGGR_INIT_EXPR accessor macros.
2842 * cp-gimplify.c (cp_gimplify_init_expr): Use
2843 AGGR_INIT_EXPR_SLOT to set the slot operand.
2845 * cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
2846 (AGGR_INIT_EXPR_SLOT): New macro.
2847 (AGGR_INIT_EXPR_ARG): New macro.
2848 (aggr_init_expr_nargs): New macro.
2849 (AGGR_INIT_EXPR_ARGP): New macro.
2850 (aggr_init_expr_arg_iterator): New.
2851 (init_aggr_init_expr_arg_iterator): New.
2852 (next_aggr_init_expr_arg): New.
2853 (first_aggr_init_expr_arg): New.
2854 (more_aggr_init_expr_args_p): New.
2855 (FOR_EACH_AGGR_INIT_EXPR_ARG): New.
2856 (stabilize_aggr_init): New declaration.
2857 (build_min_non_dep_call_list): Likewise.
2859 * tree.c (process_aggr_init_operands): New function.
2860 (build_aggr_init_array) New function.
2861 (build_cplus_new): Update to use new CALL_EXPR and
2862 AGGR_INIT_EXPR accessor macros. Replace use of build3 with
2863 build_aggr_init_array.
2864 (build_min_non_dep_call_list) New function.
2865 (build_min_nt): Assert input code parameter is not a variable
2866 length expression class.
2867 (build_min, build_min_non_dep): Likewise.
2868 (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
2869 to check for equality instead of recursing. Handle tcc_vl_exp
2871 (stabilize_call): Update to only handle CALL_EXPRs, not
2872 AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
2873 (stabilize_aggr_init): New function.
2874 (stabilize_init): Use it.
2876 * cxx-pretty-print.c (pp_cxx_postfix_expression)
2877 <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
2878 AGGR_INIT_EXPR accessor macros and argument iterators.
2880 * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
2881 build_vl_exp. Iterate through the operands, recursively
2882 processing each one.
2883 (tsubst_copy_and_build) <CALL_EXPR>: Update to use new
2884 CALL_EXPR accessor macros.
2885 (value_dependent_expression_p) <default>: Handle tcc_vl_exp
2886 tree code classes. Use TREE_OPERAND_LENGTH instead of
2889 * semantics.c (finish_call_expr): Use build_nt_call_list
2890 instead of build_nt.
2891 (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR
2892 accessor macros. Use build_call_array to construct the
2893 CALL_EXPR node instead of build3
2895 * decl2.c (build_offset_ref_call_from_tree): Use
2896 build_nt_call_list and build_min_non_dep_call_list instead
2897 of build_min_nt and build_min_non_dep.
2899 * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
2900 Use build_nt_call_list instead of build_min_nt.
2902 2007-02-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2905 * call.c (build_conditional_expr): Improve error message.
2907 2007-02-13 Dirk Mueller <dmueller@suse.de>
2909 * friend.c (do_friend): Annotate warning about friend
2910 declarations in templates with OPT_Wnon_template_friend.
2911 Convert informal message from warning() to inform().
2913 2007-02-12 Simon Martin <simartin@users.sourceforge.net>
2914 Mark Mitchell <mark@codesourcery.com>
2917 * pt.c (do_decl_instantiation): Detect type mismatches in explicit
2918 instantiations for variables.
2920 2007-02-12 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2923 * cp-gimplify.c (gimplify_expr_stmt): Don't check extra_warnings.
2924 Check warn_unused_value just once.
2926 2007-02-11 Mark Mitchell <mark@codesourcery.com>
2929 * pt.c (determine_specialization): Use skip_artificial_parms_for.
2930 (fn_type_unificiation): Likewise.
2931 (get_bindings): Likewise.
2933 o2007-02-06 Mark Mitchell <mark@codesourcery.com>
2936 * decl.c (finish_function): Use DECL_REPLACEABLE.
2937 * tree.c (cp_cannot_inline_tree_fn): Likewise.
2939 2007-02-10 Gabriel Dos Reis <gdr@integrable-solutions.net>
2941 * parser.c (cp_parser_primary_expression): Reformat overly long lines.
2943 2007-02-10 Richard Henderson <rth@redhat.com>, Jakub Jelinek <jakub@redhat.com>
2945 * decl.c (grokvardecl): Don't error if !have_tls.
2946 (grokdeclarator): Likewise.
2947 * parser.c (cp_parser_omp_threadprivate): Likewise.
2949 2007-02-07 Jakub Jelinek <jakub@redhat.com>
2952 * cp-gimplify.c (cp_genericize_r): Don't dereference invisiref
2953 parameters and result decls in omp clauses.
2954 (cxx_omp_privatize_by_reference): Pass also invisiref PARM_DECLs
2957 2007-02-05 Dirk Mueller <dmueller@suse.de>
2960 * parser.c (cp_parser_class_specifier): Always initialize bases.
2962 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
2964 * cp-tree.h (OMP_ATOMIC_CODE): Delete.
2965 (OMP_ATOMIC_DEPENDENT_P): Rewrite.
2966 * pt.c (tsubst_expr): Adjust for new format of dependent OMP_ATOMIC
2968 * semantics.c (finish_omp_atomic): Store a whole expression node
2969 in operand 1, and integer_zero_node in operand 0, for dependent
2970 OMP_ATOMIC. Rewrite to make flow easier to understand.
2972 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
2974 * decl.c (grokdeclarator): Use OPT_Wreturn_type instead of 0.
2976 2007-02-04 Kazu Hirata <kazu@codesourcery.com>
2978 * class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
2979 parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
2981 2007-02-03 Douglas Gregor <doug.gregor@gmail.com>
2983 * parser.c (cp_lexer_get_preprocessor_token): Attach the C++0x
2984 keyword warning to -Wc++0x-compat.
2986 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
2988 * decl.c (grokdeclarator): Update documentation.
2990 2007-02-02 Jakub Jelinek <jakub@redhat.com>
2993 * decl.c (grokdeclarator): If __thread is used together with
2994 a storage class other than extern and static, clear thread_p
2995 after issuing diagnostics and fall through to checking the
2998 2007-01-30 Roger Sayle <roger@eyesopen.com>
3000 * error.c (dump_type_suffix): Avoid use of cp_build_binary_op when
3001 calculating the size of an array (to avoid recursive errors).
3003 2007-01-30 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
3006 * typeck.c (build_binary_op): Fix logic for warning. Move warning
3008 * call.c (convert_like_real): Don't warn when converting to
3011 2007-01-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
3013 * decl.c (pop_label): Replace warning with call to
3014 warn_for_unused_label.
3016 2007-01-28 Andrew Pinski <pinskia@gmail.com>
3019 * semantics.c (finish_pseudo_destructor_expr): Check the
3020 destrutor name by calling check_dtor_name.
3022 2007-01-24 Douglas Gregor <dgregor@osl.iu.edu>
3024 * lex.c (D_CPP0X): Rename.
3026 (reswords): D_CPP0X -> D_CXX0X.
3027 (init_reswords): Ditto.
3028 * parser.c (cp_lexer_get_preprocessor_token): Warn about the use
3029 of C++0x keywords as identifiers.
3031 2007-01-23 Simon Martin <simartin@users.sourceforge.net>
3034 * decl.c (duplicate_decls): Don't reset DECL_INVALID_OVERRIDER_P for
3037 2007-01-23 Ian Lance Taylor <iant@google.com>
3039 * typeck.c (convert_for_assignment): Only warn about a = b = c
3040 when converting to bool.
3042 2007-01-23 Roger Sayle <roger@eyesopen.com>
3044 * call.c (null_ptr_cst_p): Replace use of TREE_CONSTANT_OVERFLOW with
3046 * typeck.c (ignore_overflows): Remove the remaining uses of
3047 TREE_CONSTANT_OVERFLOW.
3049 2007-01-20 Jan Hubicka <jh@suse.cz>
3051 * decl2.c (start_objects, start_static_storage_duration_function):
3052 Do not make the functions uninlinable.
3054 2007-01-17 Ian Lance Taylor <iant@google.com>
3056 * class.c (add_method): Call VEC_reserve_exact rather than passing
3057 a negative size to VEC_reserve.
3059 2007-01-11 Simon Martin <simartin@users.sourceforge.net>
3062 * tree.c (cp_tree_equal): Properly handle MODOP_EXPR trees.
3064 2007-01-10 Mark Mitchell <mark@codesourcery.com>
3067 * decl.c (make_typename_type): If the qualified name is not a
3068 type, issue an error.
3069 * parser.c (cp_parser_elaborated_type_specifier): Fix comment
3072 2007-01-08 Geoffrey Keating <geoffk@apple.com>
3074 * rtti.c: Include target.h.
3075 (emit_support_tinfos): If ! targetm.cxx.library_rtti_comdat (),
3076 don't emit typeinfo for fundamental types as weak.
3077 * Make-lang.in (cp/rtti.o): Update and correct dependencies.
3079 2007-01-08 Richard Guenther <rguenther@suse.de>
3081 * cvt.c (cp_convert_to_pointer): Use build_int_cst_type.
3083 2007-01-08 Mark Shinwell <shinwell@codesourcery.com>
3085 * call.c (standard_conversion): Pass flag to
3086 vector_types_convertible_p to disallow emission of note.
3087 * typeck.c (convert_for_assignment): Pass flag to
3088 vector_types_convertible_p to allow emission of note.
3089 (ptr_reasonably_similar): Pass flag to vector_types_convertible_p
3090 to disallow emission of note.
3092 2007-01-07 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
3095 * typeck.c (build_binary_op): Call overflow_warning if
3096 TREE_OVERFLOW_P is true for the result and not for any of the
3099 2007-01-06 Lee Millward <lee.millward@codesourcery.com>
3102 * class.c (add_method): Don't wait until template
3103 instantiation time to complain about duplicate methods.
3105 2007-01-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
3108 * semantics.c (finish_unary_op_expr): Warn only if result
3109 overflowed and operands did not.
3111 2007-01-05 Ian Lance Taylor <iant@google.com>
3113 * typeck.c (build_binary_op): Warn about comparing a non-weak
3116 2007-01-05 Douglas Gregor <doug.gregor@gmail.com>
3118 * pt.c (tsubst): Propagate the need for structural equality checks
3119 when reducing the level of template parameters.
3121 2007-01-03 Kazu Hirata <kazu@codesourcery.com>
3123 * pt.c: Fix a comment typo.
3125 2007-01-02 Ian Lance Taylor <iant@google.com>
3127 * semantics.c (maybe_convert_cond): Optionally warn when using an
3128 assignment as a condition.
3129 * typeck.c (convert_for_assignment): Optionally warn about
3130 assigning the result of an assignment to a bool.
3132 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
3134 * pt.c (canonical_template_parms): Correct typo in comment.
3136 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
3138 * typeck.c (structural_comptypes): Renamed from "comptypes".
3139 (comptypes): Use canonical type information to perform fast type
3140 comparison. When VERIFY_CANONICAL_TYPES, verify that the
3141 canonical type comparison returns the same results as we would see
3142 from the current, structural check. Support COMPARE_STRUCTURAL
3143 when we need structural checks.
3144 * decl.c (typename_compare): Fix comment.
3145 (build_typename_type): TYPENAME_TYPE nodes require structural
3146 equality checks, because they resolve different based on the
3148 (make_unbound_class_template): UNBOUND_CLASS_TEMPLATE nodes
3149 require structural equality checks (for now).
3150 (build_ptrmemfunc_type): Build the canonical pointer to member
3152 (compute_array_index_type): Whenever we build a new index type
3153 to represent the size of an array in a template, we need to mark
3154 this index type as requiring structural equality. This goes for
3155 arrays with value-dependent sizes with the current ABI, or all
3157 * tree.c (cplus_array_hash): New.
3158 (struct cplus_array_info): New.
3159 (cplus_array_compare): New.
3160 (cplus_array_htab): New.
3161 (build_cplus_array_type_1): Use a hash table to cache the array
3162 types we build. Build the canonical array type for each array
3164 (cp_build_qualified_type_real): When building a cv-qualified array
3165 type, use the hash table of array types and build canonical array
3167 (bind_template_template_parm): BOUND_TEMPLATE_TEMPLATE_PARM nodes
3168 use structural equality (for now).
3169 * cp-tree.h (COMPARE_STRUCTURAL): New.
3170 * pt.c (canonical_template_parms): New.
3171 (canonical_type_parameter): New.
3172 (process_template_parm): Find the canonical type parameter.
3173 (lookup_template_class): When we have named the primary template
3174 type, set the canonical type for our template class to the primary
3175 template type. If any of the template arguments need structural
3176 equality checks, the template class needs structural equality
3178 (tsubst): When reducing the level of a template template
3179 parameter, we require structural equality tests for the resulting
3180 parameter because its template parameters have not had their types
3181 canonicalized. When reducing a template type parameter, find the
3182 canonical reduced type parameter.
3183 (any_template_arguments_need_structural_equality_p): New.