1 2007-07-28 Kazu Hirata <kazu@codesourcery.com>
3 * pt.c, tree.c, typeck2.c: Fix comment typos.
5 2007-07-28 Simon Martin <simartin@users.sourceforge.net>
6 Mark Mitchell <mark@codesourcery.com>
9 * name-lookup.c (lookup_name_real): Non namespace-scope bindings can be
10 hidden due to friend declarations in local classes.
12 2007-07-27 Douglas Gregor <doug.gregor@gmail.com>
14 * typeck.c (structural_comptypes): Compare DECLTYPE_TYPE nodes.
15 * cp-tree.def (DECLTYPE_TYPE): New.
16 * error.c (dump_type): Dump DECLTYPE_TYPE nodes.
17 (dump_type_prefix): Ditto.
18 (dump_type_suffix): Ditto.
19 * tree.c (DECLTYPE_TYPE): Walk DECLTYPE_TYPE nodes.
20 * mangle.c (write_type): Handle DECLTYPE_TYPE.
21 * cp-tree.h (IS_AGGR_TYPE): DECLTYPE_TYPE nodes can be aggregate
23 (DECLTYPE_TYPE_EXPR): New.
24 (DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P): New.
25 (finish_declared_type): Declare.
26 * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Print
28 (pp_cxx_type_id): Ditto.
29 * pt.c (for_each_template_parm_r): Walk DECLTYPE_TYPE children.
30 (tsubst): Substitute into a DECLTYPE_TYPE node.
32 (unify): Cannot deduce anything from TYPEOF_TYPE or DECLTYPE_TYPE
34 (dependent_type_p_r): DECLTYPE_TYPE types are always dependent.
35 * semantics.c (finish_typeof): TYPEOF_TYPE types need to use
36 structural equality (because we can't hash the expressions).
37 (finish_declared_type): New.
38 * lex.c (reswords): Add "decltype" keyword.
39 * parser.c cp_lexer_next_token_is_decl_specifier_keyword
40 (cp_parser_postfix_expression): Add member_access_only_p to
41 restrict postfix expression to member access expressions.
42 (cp_parser_unary_expression): Update call to
43 cp_parser_postfix_expression to reflect new parameter.
44 (cp_parser_declared_type): New.
45 (cp_parser_simple_type_specifier): Parse decltype types.
47 2007-07-27 Mark Mitchell <mark@codesourcery.com>
50 * call.c (convert_for_arg_passing): Only widen bitfields to their
51 declared types if necessary.
53 2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
55 * parser.c (cp_parser_string_literal, cp_parser_sizeof_operand):
58 2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
60 * decl.c (typename_hash, typename_compare): Constify.
61 * mangle.c (hash_type, compare_type): Likewise.
62 * pt.c (eq_local_specializations, hash_local_specialization):
64 * tree.c (cplus_array_hash, cplus_array_compare, list_hash_eq,
66 * typeck2.c (pat_compare): Likewise.
68 2007-07-24 Nathan Sidwell <nathan@codesourcery.com>
70 * method.c (implicitly_declare_fn): Increase alignment if member
71 function pointer format requires it.
73 2007-07-24 Paolo Carlini <pcarlini@suse.de>
76 * typeck.c (check_return_expr): Do not pass a null argument
79 2007-07-24 Paolo Carlini <pcarlini@suse.de>
82 * decl.c (redeclaration_error_message): Call DECL_ANON_UNION_VAR_P
85 2007-07-22 Nathan Sidwell <nathan@codesourcery.com>
88 * typeck.c (convert_arguments): Only use default args if we have
92 * typeck.c (structural_comptypes): No need to check
93 resolve_typename_type return value here.
94 * cp-tree.h (TYPENAME_IS_RESOLVING_P): New.
95 * pt.c (resolve_typename_type): Follow typename typedefs. Return
96 original type rather than error_mark_node in case of failure.
97 * parser.c (cp_parser_nested_name_specifier_opt): Adjust
98 resolve_typename_type result check.
99 (cp_parser_direct_declarator, cp_parser_head,
100 cp_parser_constructor_declarator_p): Likewise.
102 2007-07-12 Kazu Hirata <kazu@codesourcery.com>
104 * pt.c (template_parms_variadic_p): Remove.
105 * cp-tree.h: Remove the prototype for template_parms_variadic_p.
107 2007-07-12 Jakub Jelinek <jakub@redhat.com>
110 * error.c (dump_expr) <case AGGR_INIT_EXPR>: Pass true as last
111 argument to dump_aggr_init_expr_args instead of false.
113 2007-07-11 Douglas Gregor <doug.gregor@gmail.com>
115 * typeck.c (comptypes): When USE_CANONICAL_TYPES, use the
116 canonical types; otherwise, fall back to structural type
117 comparisons. If ENABLE_CHECKING and USE_CANONICAL_TYPES, give an
118 internal compiler error if the canonical types are wrong.
120 2007-07-11 Paolo Carlini <pcarlini@suse.de>
123 * parser.c (cp_parser_make_indirect_declarator): When the
124 the code argument is ERROR_MARK return cp_error_declarator.
126 2007-07-09 Geoffrey Keating <geoffk@apple.com>
129 * decl.c (cxx_init_decl_processing): Don't set
130 force_align_functions_log.
131 (grokfndecl): Honour ptrmemfunc_vbit_in_pfn.
132 * typeck.c (cxx_alignof_expr): When alignof is used on a plain
133 FUNCTION_DECL, return its alignment.
135 2007-07-09 Richard Guenther <rguenther@suse.de>
137 * decl.c (start_preparsed_function): Do not promote return type.
139 2007-07-08 Paolo Carlini <pcarlini@suse.de>
142 * pt.c (unify): Never pass error_mark_node to template_decl_level.
144 2007-07-07 Mark Mitchell <mark@codesourcery.com>
147 * pt.c (resolve_overloaded_unification): Robustify. Return a
149 (type_unification_real): Adjust accordingly.
151 2007-07-06 Richard Guenther <rguenther@suse.de>
153 * init.c (build_new_1): Use the correct pointer type.
154 * typeck2.c (build_m_component_ref): Likewise.
156 2007-07-05 Mark Mitchell <mark@codesourcery.com>
159 * init.c (build_zero_init): Always build an initializer for
161 * typeck2.c (build_functional_cast): Use build_zero_init.
164 * init.c (build_new_1): Always pass the allocation function to
165 build_op_delete_call.
166 * call.c (build_op_delete_call): Handle operator delete with a
167 variable-argument list. Do not issue an error when no matching
168 deallocation function is available for a new operator.
171 * cp-tree.h (any_value_dependent_elements_p): Declare it.
172 * decl.c (value_dependent_init_p): New function.
173 (cp_finish_decl): Use it.
174 * pt.c (value_dependent_expression_p): Use
175 any_value_dependent_elements_p.
176 * parser.c (cp_parser_primary_expression): Add comment about
177 treating dependent qualified names as integral
178 constant-expressions.
180 2007-07-04 Douglas Gregor <doug.gregor@gmail.com>
182 * decl.c (build_ptrmemfunc_type): Always use structural equality
183 tests when comparing pointer-to-member-function types, because the
184 handling of TYPE_GET_PTRMEMFUNC_TYPE currently defeats canonical
187 2007-07-03 Mark Mitchell <mark@codesourcery.com>
189 * init.c (build_new): Tweak comment.
191 2007-06-29 Dave Brolley <brolley@redhat.com>
194 * parser.c (cp_parser_new_type_id): Don't reduce a named array
195 type to its base type and number of elements here.
196 * init.c (build_new): Call complete_type_or_else to ensure that the
197 type is complete and to issue a diagnostic if it is not.
198 (build_new_1): Don't call complete_type_or_else here.
200 2007-07-03 Richard Guenther <rguenther@suse.de>
203 * class.c (fixed_type_or_null): Re-lookup the hashtable slot
206 2007-07-02 Simon Baldwin <simonb@google.com>
208 * parser.c (cp_parser_elaborated_type_specifier): Added a warning
209 for inner-style nested forward declarations that don't declare
212 2007-07-02 Jakub Jelinek <jakub@redhat.com>
215 * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
216 DECL_P in not a variable and appears more than once error messages.
218 2007-07-01 Ollie Wild <aaw@google.com>
220 * name-lookup.c (ambiguous_decl): Fix case when new->value is hidden.
221 (select_decl): Remove function.
222 (unqualified_namespace_lookup): Populate binding by calling
223 ambiguous_decl. Remove select_decl call.
224 (lookup_qualified_name): Remove select_decl call.
225 * decl.c (lookup_and_check_tag): Check for ambiguous references.
226 * parser.c (cp_parser_elaborated_type_specifier): Skip redundant error
227 generation when name lookup is ambiguous.
229 2007-06-29 Douglas Gregor <doug.gregor@gmail.com>
232 * init.c (build_new_1): Use structural equality on the copy of the
235 2007-06-28 Geoffrey Keating <geoffk@apple.com>
237 * decl2.c (determine_visibility): Implement
238 flag_visibility_ms_compat effect on type info.
239 * decl.c (cxx_init_decl_processing): Implement
240 global effect of flag_visibility_ms_compat.
242 2007-06-28 Geoffrey Keating <geoffk@apple.com>
244 * decl2.c (start_objects): Mark constructor-running function
247 2007-06-26 Simon Martin <simartin@users.sourceforge.net>
250 * decl.c (grokdeclarator): Reset friendp for member functions declared
251 friend of their own class.
253 2007-06-23 Mark Mitchell <mark@codesourcery.com>
255 * decl2.c (determine_visibility): Don't look for dllexport here.
256 (determine_visibility_from_class): Tidy.
258 2007-06-18 Simon Baldwin <simonb@google.com>
261 * parser.c (cp_parser_single_declaration): Added check for storage
262 class other than sc_none in parsed declaration, and a flag to indicate
263 if the call is part of an explicit template specialization parse.
264 * (cp_parser_explicit_specialization): Specialization check flag added
265 to call to cp_parser_single_declaration(), set true.
266 * (cp_parser_template_declaration_after_export): Specialization check
267 flag added to call to cp_parser_single_declaration(), set false.
268 * pt.c (check_explicit_specialization): Added code to copy visiblity
269 and linkage from the templated function to the explicit specialization.
271 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
273 * typeck.c (build_binary_op): For templates build the
274 expression in pieces to avoid the assert in build2_stat.
275 (get_member_function_from_ptrfunc):
276 Change over to using POINTER_PLUS_EXPR and convert
277 the second operand to sizetype.
278 * typeck2.c (build_m_component_ref): Likewise.
279 * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR
280 instead of PLUS_EXPR for pointers.
281 (build_new_1): Likewise.
282 (build_vec_delete_1): Likewise.
283 (build_vec_delete): Likewise.
284 * class.c (build_base_path): Likewise.
285 (build_base_path): Likewise.
286 (convert_to_base_statically): Likewise.
287 (fixed_type_or_null): Handle POINTER_PLUS_EXPR.
288 (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR
289 instead of PLUS_EXPR.
290 (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR
291 instead of PLUS_EXPR for pointers.
292 * call.c (build_special_member_call): Likewise.
293 * rtti.c (build_headof): Likewise.
294 Use sizetype instead of ptrdiff_type_node.
295 (tinfo_base_init): Create a POINTER_PLUS_EXPR
296 instead of PLUS_EXPR for pointers.
297 * except.c (expand_start_catch_block): Do a
298 NEGATIVE and then a POINTER_PLUS_EXPR instead
300 * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert
301 PLUS_EXPR on pointer types over to use
302 POINTER_PLUS_EXPR and remove the conversion
303 to the pointer types.
304 * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for
305 adding to a pointer type. Use size_int instead of
306 ssize_int. Convert the index to sizetype before
307 adding it to the pointer.
309 2007-06-15 Mark Mitchell <mark@codesourcery.com>
311 * cp-tree.h (DECL_VAR_MARKED_P): Remove.
312 (DECL_ANON_UNION_VAR_P): New macro.
313 * class.c (fixed_type_or_null): Tidy. Use a hash table, rather
314 than DECL_VAR_MARKED_P, to keep track of which variables we have
316 * decl.c (redeclaration_error_message): Complain about redeclaring
317 anonymous union members at namespace scope.
318 * decl2.c (build_anon_union_vars): Set DECL_ANON_UNION_VAR_P.
320 2007-06-14 Geoff Keating <geoffk@apple.com>
322 * decl2.c (determine_visibility): Ensure that functions with
323 hidden types as parameters are hidden.
326 * decl2.c (determine_visibility): Remove duplicate code for
329 2007-06-12 Ian Lance Taylor <iant@google.com>
332 * init.c (avoid_placement_new_aliasing): New static function.
333 (build_new_1): Call it.
335 2007-06-11 Rafael Avila de Espindola <espindola@google.com>
337 * cp-objcp-common.h (LANG_HOOKS_SIGNED_TYPE): Remove.
338 (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove.
340 2007-06-08 Jakub Jelinek <jakub@redhat.com>
343 * semantics.c (finish_omp_for): Call fold_build_cleanup_point_expr
344 on init, the non-decl cond operand and increment value.
346 2007-06-07 Simon Martin <simartin@users.sourceforge.net>
349 * decl.c (check_initializer): Report an error when a brace enclosed
350 initializer is used for a non-aggregate type in C++98.
351 (redeclaration_error_message): Rewrote flag_cpp0x in terms of
353 (grokdeclarator): Likewise.
354 (move_fn_p): Likewise.
355 * typeck.c (check_return_expr): Likewise.
356 * call.c (reference_binding): Likewise.
357 * error.c (cp_cpp_error): Likewise.
358 * pt.c (check_default_tmpl_args): Likewise.
360 * lex.c (init_reswords): Likewise.
361 * parser.c (p_parser_primary_expression): Likewise.
362 (TOKEN_PRECEDENCE): Likewise.
363 (cp_parser_init_declarator): Likewise.
364 (cp_parser_ptr_operator): Likewise.
365 (cp_parser_parameter_declaration): Likewise.
366 (cp_parser_enclosed_template_argument_list): Likewise.
367 (cp_parser_skip_to_end_of_template_parameter_list): Likewise.
368 (cp_parser_next_token_ends_template_argument_p): Likewise.
370 2007-06-04 Simon Baldwin <simonb@google.com>
372 * decl.c (grokdeclarator): Readability change. Moved case labels
373 into direct switch statement scope.
375 2007-06-04 Paolo Carlini <pcarlini@suse.de>
377 * call.c (convert_like_real): Remove pointless code.
379 2007-05-31 Mark Mitchell <mark@codesourcery.com>
381 * decl.c (get_atexit_fn_ptr_type): New function.
382 (get_atexit_node): Use it.
383 (start_cleanup_fn): Likewise.
384 (register_dtor_fn): Use the object's destructor, instead of a
385 separate cleanup function, where possible.
386 * cp-tree.h (CPTI_ATEXIT_FN_PTR_TYPE): New enumerator.
387 (atexit_fn_ptr_type_node): New macro.
388 * decl2.c (build_cleanup): Use build_address.
390 2007-05-31 Daniel Berlin <dberlin@dberlin.org>
392 * typeck.c (build_binary_op): Include types in error.
394 2007-05-31 Jakub Jelinek <jakub@redhat.com>
397 * decl.c (cp_finish_decl): Also clear was_readonly if a static var
398 needs runtime initialization.
400 2007-05-31 Paolo Carlini <pcarlini@suse.de>
403 * semantics.c (finish_trait_expr): Complete the types.
405 2007-05-30 Russell Yanofsky <russ@yanofsky.org>
406 Douglas Gregor <doug.gregor@gmail.com>
407 Pedro Lamarao <pedro.lamarao@mndfck.org>
408 Howard Hinnant <howard.hinnant@gmail.com>
412 * typeck.c (comptypes): Don't consider rvalue and lvalue
413 reference types to be equivalent.
414 (check_return_expr): Move from certain lvalues when returning
416 * decl.c (grokdeclarator): Implement reference collapsing.
417 (copy_fn_p): Don't consider constructors taking rvalue references
418 to be copy constructors.
420 * call.c (conversion): New "rvaluedness_matches_p" member.
421 (convert_class_to_reference): Require reference type as first
422 parameter instead of base type.
423 (reference_binding): Add logic to handle rvalue references.
424 (implicit_conversion): Update inaccurate comment.
425 (convert_like_real): Disable creation of temporaries that are
426 impossible to initialize for types with move constructors.
427 (build_over_call): Elide move constructors when possible.
428 (maybe_handle_implicit_object): Set "rvaluedness_matches_p".
429 (maybe_handle_ref_bind): Return conversion instead of type node.
430 (compare_ics): Add logic to use "rvaluedness_matches_p" values to
431 determine preferred conversion sequences.
432 * cp-tree.h (TYPE_REF_IS_RVALUE): New.
433 (LOOKUP_PREFER_RVALUE): New.
434 (DECL_MOVE_CONSTRUCTOR_P): New.
435 (struct cp_declarator): Add "reference" member for reference
436 types, with new "rvalue_ref" flag.
437 (cp_build_reference_type): Declare.
438 (move_fn_p): Declare.
439 * error.c (dump_type_prefix): Format rvalue reference types
440 correctly in error messages.
441 * except.c (build_throw): Move from certain lvalues when
443 * mangle.c (write_type): Mangle rvalue references differently
444 than regular references.
445 * parser.c (make_reference_declarator): Add boolean parameter for
447 (cp_parser_make_indirect_declarator): New.
448 (cp_parser_new_declarator_opt): Call
449 cp_parser_make_indirect_declarator.
450 (cp_parser_conversion_declarator_opt): Ditto.
451 (cp_parser_declarator): Ditto.
452 (cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference
454 * pt.c (tsubst): Implement reference collapsing.
455 (maybe_adjust_types_for_deduction): Implement special template
456 parameter deduction rule for rvalue references.
457 (type_unification_real): Update calls to
458 maybe_adjust_types_for_deduction.
459 (try_one_overload): Ditto.
460 (unify_pack_expansion): Ditto.
461 * tree.c (lvalue_p_1): Handle rvalue reference types.
462 (cp_build_reference_type): New.
464 2007-05-30 Jakub Jelinek <jakub@redhat.com>
467 * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC
468 variables that need runtime initialization.
470 2007-05-28 Andrew Pinski <Andrew_pinski@playstation.sony.com>
473 * typeck.c (build_unary_op <case PREINCREMENT_EXPR,
474 case POSTINCREMENT_EXPR, case PREDECREMENT_EXPR,
475 case POSTDECREMENT_EXPR>): Return the error_mark_node
476 if either the real or imaginary parts would an
479 2007-05-25 Simon Martin <simartin@users.sourceforge.net>
480 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
483 * parser.c (cp_parser_skip_to_closing_brace): Return true if the next
484 token is a closing brace, false if there are no tokens left.
485 (cp_parser_namespace_alias_definition): Only consume the next token if
486 it is a closing brace.
488 * parser.c (cp_parser_class_specifier): Likewise.
490 2007-05-25 H.J. Lu <hongjiu.lu@intel.com>
492 * semantics.c (finish_member_declaration): Fix a typo in the
495 2007-05-25 Douglas Gregor <doug.gregor@gmail.com>
507 * error.c (dump_type): Dump TYPE_ARGUMENT_PACK nodes.
508 * cp-tree.h (check_for_bare_parameter_packs): Returns bool.
509 * pt.c (check_for_bare_parameter_packs): Return bool indicated
510 whether everything was okay. Fix indentation.
511 (push_template_decl_real): Check for bare parameter packs in
512 function parameters; where errors occur, mark the parameter types
513 with ERROR_MARK_NODEs to avert ICEs.
514 (coerce_template_parameter_pack): New.
515 (coerce_template_parms): Moved parameter pack coercion into
516 coerce_template_parameter_pack, and permit it anywhere in the
517 template parameter list (not just at the end). Parameter and
518 argument indices can vary (somewhat) separately now, so add
519 PARM_IDX and ARG_IDX.
520 (fn_type_unification): Don't set an argument pack as incomplete if
521 no argument pack was deduced.
522 (type_unification_real): If a type parameter is a parameter pack
523 and has not otherwise been deduced, it will be deduced to an empty
525 (more_specialized_fn): Use the actual lengths of the argument
526 lists when comparing against expansions.
527 * semantics.c (finish_member_declaration): If a field's type has
528 bare parameter packs, error and set its type to ERROR_MARK_NODE.
530 2007-05-24 Danny Smith <dannysmith@users.sourceforge.net>
533 * mangle.c (mangle_decl): Call targetm.mangle_decl_assembler_name.
535 2007-05-22 Ollie Wild <aaw@google.com>
537 * name-lookup.c (ambiguous_decl): Adds check for hidden types.
538 (unqualified_namespace_lookup): Adds check for hidden types.
540 2007-05-22 Ollie Wild <aaw@google.com>
542 * decl.c (duplicate_decls): Verify namespace names are unique.
544 2007-05-21 Mark Mitchell <mark@codesourcery.com>
546 * decl.c (cxx_maybe_build_cleanup): Handle
547 __attribute__((cleanup)).
549 2007-05-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
551 * cvt.c (cp_convert_and_check): Don't check warnings if the
554 2007-05-18 Geoffrey Keating <geoffk@apple.com>
556 * mangle.c (write_real_cst): Use 'unsigned long' for %lx.
558 2007-05-14 Paolo Carlini <pcarlini@suse.de>
561 * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the
562 type only if is a class type (5.2.8/4).
564 2007-05-14 Rafael Avila de Espindola <espindola@google.com>
566 * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
567 * decl.c (grokdeclarator): Use unsigned_type_for instead of
568 c_common_unsigned_type.
570 2007-05-11 Silvius Rus <rus@google.com>
572 * cp/typeck.c (build_indirect_ref): Add call to
573 strict_aliasing_warning.
574 (build_reinterpret_cast_1): Condition call to
575 strict_aliasing_warning.
577 2007-05-11 Jan Hubicka <jh@suse.cz>
579 * semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
580 * decl2.c (start_objects): ctors and dtors are no longer public.
581 (cp_write_global_declarations): Do not call c_build_cdtor_fns.
583 2007-05-07 Andrew Pinski <andrew_pinski@playstation.sony.com>
585 * typeck.c (build_unary_op): Remove code that used to
586 handle non lvalue increments/decrements.
588 2007-05-07 Mike Stump <mrs@apple.com>
590 * parser.c (check_empty_body): Add.
591 (cp_parser_iteration_statement): Add call to check_empty_body.
593 2007-05-05 Geoffrey Keating <geoffk@apple.com>
596 * mangle.c (write_mangled_name): Mangle static variable names.
597 (write_unqualified_name): Use local-source-name for
598 namespace-scope static variables.
600 2007-05-04 Dirk Mueller <dmueller@suse.de>
602 * cp-tree.h (DECL_MAIN_P): only if -ffreestanding is
605 2007-05-02 Seongbae Park <seongbae.park@gmail.com>
608 * decl2.c (constrain_class_visibility):
609 Use strip_pointer_or_array_types instead of strip_array_types.
611 2007-04-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
614 * decl.c (reshape_init_r): Don't reshape the first element if it
615 is a pointer to member function.
617 2007-04-27 Simon Baldwin <simonb@google.com>
619 * decl.c (grokparms): Changed message format from %qD to %qE.
621 2007-04-27 Douglas Gregor <doug.gregor@gmail.com>
623 * error.c (maybe_warn_variadic_templates): Variadic templates are
624 now in C++0x, so only warn about them in C++98 mode.
626 2007-04-26 Andrew Pinski <andrew_pinski@playstation.sony.com>
629 * typeck.c (build_reinterpret_cast_1): Only allow conversion to
630 integeral types from vectors types.
632 2007-04-26 Jakub Jelinek <jakub@redhat.com>
635 * semantics.c (finish_omp_clauses): Don't create CP_OMP_CLAUSE_INFO
636 for type dependent OMP_CLAUSE_DECLs.
638 2007-04-24 Mark Mitchell <mark@codesourcery.com>
641 * cp-tree.h (ARITHMETIC_TYPE): Include COMPLEX_TYPE.
642 * typeck.c (type_after_usual_arithmetic_conversions): Adjust, as
643 COMPLEX_TYPE is now an ARITHMETIC_TYPE.
644 * init.c (build_zero_init): Adjust, as
645 COMPLEX_TYPE is now a SCALAR_TYPE.
646 * typeck2.c (digest_init): Allow brace-enclosed initializers for
647 COMPLEX_TYPE, even though that is now a SCALAR_TYPE.
649 2007-04-25 Paolo Carlini <pcarlini@suse.de>
651 * semantics.c (classtype_has_nothrow_copy_or_assign_p): Adjust
652 per N2255; rename as classtype_has_nothrow_assign_or_copy_p.
653 (trait_expr_value): Adjust.
655 2007-04-23 Simon Baldwin <simonb@google.com>
657 * decl.c (grokparms): Added new error for duplicate function
658 parameters names in function prototypes, to match gcc behavior.
660 2007-04-23 Jan Hubicka <jh@suse.cz>
662 * cp/decl2.c (finish_objects): Do not call target constructor/destructor
665 2007-04-21 Andrew Pinski <andrew_pinski@playstation.sony.com>
667 * cp-tree.h (lang_tree_node): Use GENERIC_NEXT
668 instead of checking GIMPLE_STMT_P in chain_next.
670 2007-04-17 Mark Mitchell <mark@codesourcery.com>
673 * call.c (convert_for_arg_passing): Convert bitfields to their
676 2007-04-17 Simon Martin <simartin@users.sourceforge.net>
679 * pt.c (value_dependent_expression_p): Handle MODOP_EXPRs.
681 2007-04-16 Seongbae Park <seongbae.park@gmail.com>
685 * cp/decl2.c (constrain_class_visibility):
686 Do not warn about the use of anonymous namespace in the main input file.
688 2007-04-15 Mark Mitchell <mark@codesourcery.com>
690 * cp-tree.h (current_template_parms): Fix typo in comment.
692 2007-04-15 Kazu Hirata <kazu@codesourcery.com>
694 * cp-tree.h, error.c: Fix comment typos.
696 2007-04-13 Jason Merrill <jason@redhat.com>
699 * call.c (reference_binding): Add c_cast_p parm. If true,
700 add quals to TO as needed to make it reference-compatible.
702 2007-04-11 Jan Hubicka <jh@suse.cz>
704 * cp/class.c (convert_to_base_statically): Fold produced tree; verify
705 that we are not processing template_decl.
707 2007-04-09 Mark Mitchell <mark@codesourcery.com>
710 * class.c (build_base_path): Ensure that the converted pointer has
711 the same cv-qualification as the input.
713 2007-04-09 Paolo Carlini <pcarlini@suse.de>
715 * tree.c (cp_tree_equal): Deal with TRAIT_EXPR.
717 2007-04-08 Steven Bosscher <steven@gcc.gnu.org>
719 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS):
721 (LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P): Do not set it.
722 * tree.c (cp_add_pending_fn_decls): Remove.
723 * cp-tree.h (cp_add_pending_fn_decls): Remove prototype.
725 2007-04-07 Daniel Berlin <dberlin@dberlin.org>
727 Revert change removing staticp.
729 2007-04-06 Daniel Berlin <dberlin@dberlin.org>
731 * cp-objcp-common.c (cxx_staticp): Remove.
732 * cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
733 * cp-tree.h (cxx_staticp):
735 2007-04-04 Danny Smith <dannysmith.users.sourceforge.net>
737 * class.c (check_for_override): Don't remove dllmport attribute
740 2007-04-03 Jakub Jelinek <jakub@redhat.com>
743 * typeck.c (build_modify_expr): For COND_EXPR on LHS, if RHS has void
744 type issue error and return early.
746 2007-03-30 Jason Merrill <jason@redhat.com>
749 * typeck.c (cp_type_readonly): New fn.
750 * cp-tree.h: Declare it.
751 * decl.c (start_decl): Set implicit DECL_THIS_STATIC here.
752 (cp_finish_decl): Not here.
754 2007-03-31 Richard Guenther <rguenther@suse.de>
756 * optimize.c (maybe_clone_body): Replace splay-tree usage by
759 2007-03-31 Douglas Gregor <doug.gregor@gmail.com>
764 * parser.c (declarator_can_be_parameter_pack): New.
765 (cp_parser_template_parameter): Only parse the `...' if the
766 declarator can be a parameter pack.
767 (cp_parser_parameter_declaration): Ditto. Also, handle when TYPE
769 * pt.c (find_parameter_packs_r): Look into the bounds on integer
770 types (they could be used as array bounds).
771 (check_for_bare_parameter_packs): Deal with TEMPLATE_PARM_INDEX.
772 (tsubst_pack_expansion): Handle failure to expand parameter
775 2007-03-30 Paolo Carlini <pcarlini@suse.de>
778 * cp-tree.h (enum cp_trait_kind, struct tree_trait_expr,
779 TRAIT_EXPR_TYPE1, TRAIT_EXPR_TYPE2, TRAIT_EXPR_KIND): Add.
780 (enum cp_tree_node_structure_enum, union lang_tree_node): Update.
781 (CLASS_TYPE_NON_UNION_P): Add.
782 (struct lang_type_class): Add has_complex_dflt.
783 (TYPE_HAS_COMPLEX_DFLT, TYPE_HAS_TRIVIAL_DFLT): Add.
784 (locate_copy, locate_ctor, locate_dtor, finish_trait_expr): Declare.
785 * cp-tree.def: Add TRAIT_EXPR.
786 * cp-objcp-common.c (cp_tree_size): Add TRAIT_EXPR case.
787 * lex.c (struct resword): Add __has_nothrow_assign,
788 __has_nothrow_constructor, __has_nothrow_copy, __has_trivial_assign,
789 __has_trivial_constructor, __has_trivial_copy,
790 __has_trivial_destructor, __has_virtual_destructor, __is_abstract,
791 __is_base_of, __is_class, __is_convertible_to, __is_empty, __is_enum,
792 __is_pod, __is_polymorphic, __is_union.
793 * parser.c (cp_parser_primary_expression): Deal with the new RIDs.
794 (cp_parser_trait_expr): New.
795 * semantics.c (finish_trait_expr, trait_expr_value
796 classtype_has_nothrow_copy_or_assign_p): New.
797 * method.c (locate_copy, locate_ctor, locate_dtor): Do not define
799 * decl.c (cp_tree_node_structure): Add TRAIT_EXPR.
800 * class.c (check_bases, check_field_decl, check_bases_and_members):
801 Deal with TYPE_HAS_COMPLEX_DFLT (t) too.
802 * pt.c (uses_template_parms, tsubst_copy_and_build,
803 value_dependent_expression_p, type_dependent_expression_p): Deal with
805 * tree.c (cp_walk_subtrees): Deal with TRAIT_EXPR.
807 2007-03-29 Richard Guenther <rguenther@suse.de>
809 * tree.c (cp_walk_subtrees): Do not set input_location.
811 2007-03-28 Simon Martin <simartin@users.sourceforge.net>
814 * decl.c (grokfndecl): Properly setup decl if it is a constructor or a
817 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
819 * parser.c (struct cp_parser): Update comment for
820 greater_than_is_operator_p.
821 (cp_parser_primary_expression): In C++0x mode, a cast operator can
822 be terminated with a `>>' token when !GREATER_THAN_IS_OPERATOR_P.
823 (TOKEN_PRECEDENCE): In C++0x mode, `>>' is treated like `>' when
824 !GREATER_THAN_IS_OPERATOR_P.
825 (cp_parser_binary_expression): When -Wc++0x-compat, warn about
826 `>>' operators that will become two `>' tokens in C++0x.
827 (cp_parser_parameter_declaration): Treat `>>' like `>' in C++0x
828 mode, allowing it to terminate default arguments.
829 (cp_parser_enclosed_template_argument_list): In C++0x mode, treat
830 `>>' like two consecutive `>' tokens.
831 (cp_parser_skip_to_end_of_template_parameter_list): Ditto.
832 (cp_parser_next_token_ends_template_argument_p): In C++0x, `>>'
833 ends a template argument.
835 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
837 * decl.c (redeclaration_error_message): Complain when redeclaring
838 a friend function with default template arguments (C++0x mode only).
839 * cp-tree.h (check_default_tmpl_args): Declare.
840 * pt.c (check_default_tmpl_args): In C++0x mode, permit default
841 template arguments in function templates. Add support for checking
842 the default template arguments of friend templates.
843 (push_template_decl_real): Fix call to check_default_tmpl_args.
844 (type_unification_real): If a template parameter has not been
845 deduced but provides a default template argument, substitute into
846 that default template argument.
847 * parser.c (cp_parser_init_declarator): When declaring (but not
848 defining!) a function template in C++0x mode, check for default
851 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
854 * decl.c (grokdeclarator): Deal with cv-qualified function type
855 typedefs in the same way for member and non-member functions.
857 2007-03-26 Dirk Mueller <dmueller@suse.de>
859 * parser.c (cp_parser_member_declaration): Pedwarn
860 about stray semicolons after member declarations.
862 2007-03-26 Paolo Carlini <pcarlini@suse.de>
865 * pt.c (instantiate_decl): Set in_system_header.
867 2007-03-22 Mark Mitchell <mark@codesourcery.com>
869 * cp-tree.h (current_tempalte_parms): Improve documentation.
870 * pt.c (current_template_args): Likewise.
873 * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Do
874 not consume tokens when failing.
876 2007-03-22 Jim Wilson <wilson@specifix.com>
877 Mark Mitchell <mark@codesourcery.com>
880 * call.c (standard_conversion): Use type_decays_to. Keep FCODE
881 consistent with FROM.
883 2007-03-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
885 * error.c (dump_expr): Handle dependent names that designate types.
886 * cxx-pretty-print.c (pp_cxx_unqualified_id): Handle TYPENAME_TYPE.
888 2007-03-17 Kazu Hirata <kazu@codesourcery.com>
890 * cp-tree.def, parser.c, pt.c: Fix comment typos.
892 2007-03-16 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
894 * cvt.c (cp_convert_and_check) : Define.
895 * cp-tree.h (cp_convert_and_check): Declare.
896 * call.c (convert_conversion_warnings): Rename to
897 conversion_null_warnings. The warning for floating-point to
898 integer is handled by convert_and_check in convert_like_real.
899 (convert_like_real): convert_conversion_warnings was renamed as
900 conversion_null_warnings.
901 * typeck.c (build_binary_op): Use cp_convert_and_check to warn for
902 overflow and changes of value during conversion.
904 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
907 * parser.c (cp_parser_statement): If 'namespace' is found, this
908 only can be a namespace alias definition, so parse it now.
909 (cp_parser_namespace_alias_definition): if we find an open brace
910 instead of '=', then this is actually a misplaced namespace
913 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
916 * decl.c (cxx_init_decl_processing): Move command-line options
917 processing to c-opts.c.
919 2007-03-15 Douglas Gregor <doug.gregor@gmail.com>
921 * ptree.c (cxx_print_type): Use formatting markup for integers
922 when printing template parameter index/level/orig level.
923 (cxx_print_xnode): Ditto.
924 * cp-tree.h (TEMPLATE_PARM_PARAMETER_PACK): Use TREE_LANG_FLAG_0.
925 (struct template_parm_index_s): Remove the PARAMETER_PACK member.
926 Make INDEX, LEVEL, and ORIG_LEVEL integers instead of
928 (struct saved_scope): Make X_PROCESSING_TEMPLATE_DECL an int,
929 rather than a HOST_WIDE_INT.
930 Turn X_PROCESSING_EXPLICIT_INSTANTIATION, SKIP_EVALUATION, and
931 NEED_POP_FUNCTION_CONTEXT into bool bitfields; reorder fields for
933 (struct language_function): Make RETURNS_VALUE, RETURNS_NULL,
934 RETURNS_ABNORMALLY, IN_FUNCTION_TRY_HANDLER, and
935 IN_BASE_INITIALIZER bool bitfields.
936 (struct cp_declarator): Make KIND a 4-bit field. Make
937 PARAMETER_PACK_P a bool bitfield just after KIND.
938 * pt.c (uses_parameter_packs): Destroy the pointer set.
939 (make_pack_expansion): Ditto.
940 (check_for_bare_parameter_packs): Ditto.
941 * name-lookup.c (push_to_top_level): Make need_pop a bool value.
943 2007-03-14 Andrew Pinski <andrew_pinski@playstation.sony.com>
946 * call.c (convert_default_arg): Instead of copying the node,
949 2007-03-15 Dirk Mueller <dmueller@suse.de>
952 * call.c (convert_conversion_warnings): New..
953 (convert_like_real): .. factored out from here.
954 (convert_conversion_warnings): Add warning about
955 false being converted to NULL in argument passing.
957 2007-03-14 Dirk Mueller <dmueller@suse.de>
959 * cp/semantics.c (c_finish_if_stmt): Call empty_if_body_warning.
960 (finish_do_body): Warn about empty body in do/while statement.
962 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
964 * class.c (warn_hidden): Add OPT_Woverloaded_virtual to warning.
966 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
969 * typeck.c (build_binary_op): Call warn_for_div_zero instead of
972 2007-03-13 Alexandre Oliva <aoliva@redhat.com>
974 * cp/repo.c (init_repo): Initialize random_seed saved options.
975 (finish_repo): Adjust.
977 2007-03-13 Mark Mitchell <mark@codesourcery.com>
980 * Make-lang.in (doc/g++.1): Use $< to specify the location from
983 2007-03-12 Seongbae Park <seongbae.park@gmail.com>
985 * decl.c (compute_array_index_type): New warning flag warn_vla.
987 2007-03-12 Mark Mitchell <mark@codesourcery.com>
990 * call.c (convert_default_arg): Copy non-constant arguments.
992 2007-03-11 Mark Mitchell <mark@codesourcery.com>
995 * parser.c (cp_parser_postfix_expression): Disallow compound
996 literals in constant expressions.
999 * semantics.c (finish_typeof): Use unlowered_expr_type.
1001 2007-03-10 Mark Mitchell <mark@codesourcery.com>
1004 * cp-tree.h (unlowered_expr_type): New function.
1005 * typeck.c (is_bitfield_expr_with_lowered_type): Handle
1006 COMPOUND_EXPR, MODIFY_EXPR, and SAVE_EXPR.
1007 (unlowered_expr_type): New function.
1008 (build_unary_op): Disallow predecrements of bool bitfields.
1009 * call.c (build_conditional_expr): Use unlowered_expr_type.
1010 * pt.c (type_unification_real): Likewise.
1012 2007-03-09 Douglas Gregor <doug.gregor@gmail.com>
1015 * typeck.c (check_return_expr): Check for bare parameter packs.
1016 (comptypes): Compare template parameter packs and
1017 type pack expansions.
1018 * decl.c (grokdeclarator): Deal with the declaration of function
1020 (grokparms): Verify that the (optional) function parameter pack is
1021 at the end of the parameter list.
1022 (xref_basetypes): Handle pack expansions in the base class.
1023 (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT.
1024 * cp-tree.def (TYPE_ARGUMENT_PACK): New.
1025 (NONTYPE_ARGUMENT_PACK): New.
1026 (TYPE_PACK_EXPANSION): New.
1027 (EXPR_PACK_EXPANSION): New.
1028 (ARGUMENT_PACK_SELECT): New.
1029 * cp-objcp-common.c (cp_tree_size): Compute size of
1030 (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and
1031 ARGUMENT_PACK_SELECT.
1032 * error.c (dump_template_argument): Print template argument packs.
1033 (dump_template_argument_list): Ditto.
1034 (dump_template_parameter): Dump `...' for template type parameter
1036 (dump_type): Dump TYPE_PACK_EXPANSION nodes.
1037 (dump_parameters): Print function parameter packs.
1038 (dump_template_parms): Print template argument packs.
1039 (dump_expr): Dump EXPR_PACK_EXPANSION nodes.
1040 (maybe_warn_variadic_templates): New.
1041 * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION.
1042 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
1043 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
1045 * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION.
1046 (write_template_arg): Write argument packs as separate arguments.
1047 * cp-tree.h (struct template_parm_index_s): Add flag that
1048 indicates that the template parameter is actually a parameter
1050 (struct tree_argument_pack_select): New.
1051 (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT.
1052 (union lang_tree_node): Add argument_pack_select.
1053 (FUNCTION_PARAMETER_PACK_P): New.
1054 (PACK_EXPANSION_P): New.
1055 (PACK_EXPANSION_PATTERN): New.
1056 (SET_PACK_EXPANSION_PATTERN): New.
1057 (PACK_EXPANSION_PARAMETER_PACKS): New.
1058 (ARGUMENT_PACK_P): New.
1059 (ARGUMENT_PACK_ARGS): New.
1060 (SET_ARGUMENT_PACK_ARGS): New.
1061 (ARGUMENT_PACK_INCOMPLETE_P): New.
1062 (ARGUMENT_PACK_EXPLICIT_ARGS): New.
1063 (TEMPLATE_PARM_PARAMETER_PACK): New.
1064 (TEMPLATE_TYPE_PARAMETER_PACK): New.
1065 (ARGUMENT_PACK_SELECT_FROM_PACK): New.
1066 (ARGUMENT_PACK_SELECT_INDEX): New.
1067 (ARGUMENT_PACK_SELECT_ARG): New.
1068 (struct cp_declarator): Add parameter_pack_p flag.
1069 (maybe_warn_variadic_templates): Declare.
1070 (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to
1071 indicate a template parameter pack.
1072 (uses_parameter_packs): Declare.
1073 (template_parameter_pack_p): Declare.
1074 (template_parms_variadic_p): Declare.
1075 (make_pack_expansion): Declare.
1076 (check_for_bare_parameter_packs): Declare.
1077 * cxx-pretty-print.c (pp_cxx_unary_expression): Print
1078 sizeof... expressions.
1079 (pp_cxx_expression): Print pack expansions and non-type argument
1081 (pp_cxx_exception_specification): Print pack expansions.
1082 (pp_cxx_direct_declarator): Print ellipsis for parameter packs.
1083 (pp_cxx_ctor_initializer): Print pack expansions.
1084 (pp_cxx_type_id): Print pack expansions.
1085 (pp_cxx_template_argument_list): Print argument packs.
1086 (pp_cxx_template_parameter): Print ellipsis for template parameter
1088 * pt.c (comp_template_parms): Compare template parameter packs.
1089 (template_parameter_pack_p): New.
1090 (template_parms_variadic_p): New.
1091 (template_args_variadic_p): New.
1092 (make_ith_pack_parameter_name): New.
1093 (struct find_parameter_pack_data): New.
1094 (find_parameter_packs_r): New.
1095 (uses_parameter_packs): New.
1096 (make_pack_expansion): New.
1097 (check_for_bare_parameter_packs): New.
1098 (expand_template_argument_pack): New.
1099 (reduce_template_parm_level): Propagate parameter pack flag.
1100 (process_template_parm): Add is_parameter_pack parameter to state
1101 when the parameter is actually a parameter pack. Create template
1102 parameter packs when is_parameter_pack is true.
1103 (current_template_args): The argument for a template parameter
1104 pack is an argument pack containing a single pack expansion.
1105 (process_partial_specialization): When checking that non-type
1106 argument expressions do not involve template parameters, loop over
1107 the arguments in argument packs separately.
1108 (push_template_decl_real): Check that the type of the declaration
1109 does not have any bare parameter packs. Check that primary
1110 templates have no more than one parameter pack, and that it comes
1111 at the end of the template parameter list.
1112 (convert_template_argument): Handle coercions for pack expansion
1113 expressions by coercing the pattern then rebuilding the expansion.
1114 (coerce_template_parms): When coercing the arguments for a
1115 variadic template, pack "extra" arguments into an argument pack.
1116 (coerce_template_template_parms): Cannot coerce between parameter
1117 packs and non-pack parameters.
1118 (template_args_equal): Compare PACK_EXPANSION_P expressions.
1119 (comp_template_args): Expand all template arguments packs before
1120 comparing template argument lists.
1121 (mangle_class_name_for_template): Make argument packs as separate
1123 (for_each_template_parm_r): No need to handle BASELINK.
1124 (instantiate_class_template): Handle pack expansions in the base
1126 (tsubst_pack_expansion): New.
1127 (tsubst_template_args): Handle substitutions of argument packs and
1128 pack expansion into template argument lists.
1129 (tsubst_decl): Expand function parameter packs into separate
1130 function parameters.
1131 (tsubst_arg_types): Expand a type pack expansion into separate
1133 (tsubst_exception_specification): Handle pack expansions in
1134 exception specifiers.
1135 (tsubst): See through ARGUMENT_PACK_SELECT arguments when
1136 replacing a template parameter with its argument. If we encounter
1137 a substitution for an argument pack, just return the parameter
1139 (tsubst_copy): sizeof(X...) returns the number of elements in
1140 parameter pack X. See through ARGUMENT_PACK_SELECT when the
1141 PARM_DECL is a parameter pack.
1142 (tsubst_expr): Expression pack expansions and argument packs
1143 cannot show up here; they will all be handled through function
1144 calls, sizeof, and template argument lists.
1145 (tsubst_copy_and_build): sizeof(X...) returns the number of
1146 elements in parameter pack X. Handle pack expansions in TREE_LIST
1147 and CONSTRUCTOR nodes.
1148 (fn_type_unification): Handle "incomplete" explicit template
1149 argument lists that specify some of the arguments for a template
1151 (type_unification_real): Unify arguments against pack expansions.
1152 (template_parm_level_and_index): New, helper function.
1153 (unify_pack_expansion): New.
1154 (unify): Unify argument packs on an argument-by-argument basis,
1155 handling variadic argument packs as well.
1156 (more_specialized_fn): Handle unification of function parameter
1157 packs. All things being equal, prefer non-variadic function
1158 templates to variadic function templates.
1159 (more_specialized_class): Prefer the variadic class template
1160 partial specialization that binds fewer arguments to a parameter
1162 (regenerate_decl_from_template): Expand function parameter packs
1163 into separate parameters.
1164 (instantiate_decl): Ditto.
1165 (tsubst_initializer_list): Handle pack expansions for base-class
1167 (dependent_type_p_r): Determine dependent types in argument packs
1168 and pack expansions.
1169 (value_dependent_expression_p): Determine value-dependence of
1170 non-type argument packs.
1171 (dependent_template_arg_p): Handle argument packs.
1172 * semantics.c (finish_cond): Check for bare parameter packs.
1173 (finish_expr_stmt): Ditto.
1174 (finish_for_expr): Ditto.
1175 (finish_switch_cond): Ditto.
1176 (finish_mem_initializers): Ditto.
1177 * name-lookup.c (arg_assoc_type): Handle pack expansions and
1179 * decl2.c (cp_build_parm_decl): Mark function parameter packs.
1180 * parser.c (make_declarator): Declarator is not an expansion.
1181 (make_pointer_declarator): Transfer parameter pack flag to outer
1183 (make_reference_declarator): Ditto.
1184 (make_ptrmem_declarator): Ditto.
1185 (make_call_declarator): Ditto.
1186 (make_array_declarator): Ditto.
1187 (cp_parser_postfix_expression): Allow pack expansion expressions
1188 in the argument list for a call expression.
1189 (cp_parser_parenthesized_expression_list): Add new parameter
1190 ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand
1191 into separate arguments."
1192 (cp_parser_new_placement): Allow pack expansion expressions.
1193 (cp_parser_new_initializer): Ditto.
1194 (cp_parser_mem_initializer_list): Allow ellipsis to create a
1195 base-class initializer expansion.
1196 (cp_parser_mem_initializer): Ditto.
1197 (cp_parser_template_parameter_list): Keep track of whether the
1198 template parameter is a template parameter pack.
1199 (cp_parser_template_parameter): Parse the ellipsis to indicate a
1200 template parameter pack.
1201 (cp_parser_type_parameter): Ditto.
1202 (cp_parser_template_argument_list): Parse the ellipsis to indicate
1204 (cp_parser_direct_declarator): Parse the ellipsis to indicate that
1205 this declarator is a parameter pack.
1206 (cp_parser_parameter_declaration): The ellipsis does not end the
1207 parameter declaration, because it might be a parameter pack. Parse
1208 the ellipsis to indicate a parameter pack.
1209 (cp_parser_initializer): Allow pack expansions.
1210 (cp_parser_initializer_list): Allow ellipsis to create an
1211 initializer expansion.
1212 (cp_parser_base_clause): Allow ellipsis to create a base specifier
1214 (cp_parser_type_id_list): Allow ellipsis to create an exception
1215 specifier expansion.
1216 (cp_parser_attribute_list): Don't allow pack expansions.
1217 (cp_parser_functional_cast): Allow pack expansions.
1218 (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to
1219 compute the length of a parameter pack.
1220 (cp_parser_next_token_ends_template_argument_p): An ellipsis can
1221 end a template argument.
1222 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
1223 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
1226 2007-03-09 Dirk Mueller <dmueller@suse.de>
1228 * cp/call.c (build_new_op): Call warn_logical_operator.
1230 2007-03-08 Volker Reichelt <reichelt@netcologne.de>
1233 * semantics.c (finish_offsetof): Handle COMPOUND_EXPR.
1236 * pt.c (any_template_arguments_need_structural_equality_p):
1239 2007-03-08 Alexandre Oliva <aoliva@redhat.com>
1241 * decl.c (grokdeclarator): Disable warnings for anonymous
1244 2007-03-05 Volker Reichelt <reichelt@netcologne.de>
1246 * typeck2.c (readonly_error): Always emit a hard error.
1247 Remove last argument.
1248 * cp-tree.h (readonly_error): Adjust prototype.
1249 * semantics.c (finish_asm_stmt): Adjust call to readonly_error.
1250 * typeck.c (build_unary_op): Likewise.
1251 (build_modify_expr): Likewise.
1253 2007-03-04 Simon Martin <simartin@users.sourceforge.net>
1256 * tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees.
1258 2007-03-03 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1261 * parser.c (struct cp_parser): New IN_IF_STMT.
1262 (cp_parser_statement_seq_opt): Handle an unexpected 'else',
1263 returning if parsing the body of an 'if' statement or issuing an
1264 error and continuing.
1265 (cp_parser_selection_statement): Set IN_IF_STMT bit when parsing
1267 (cp_parser_jump_statement): Mask new IN_IF_STMT bit.
1269 2007-03-02 Simon Martin <simartin@users.sourceforge.net>
1272 * class.c (update_vtable_entry_for_fn): Properly handle invalid overriders
1275 2007-03-02 Geoffrey Keating <geoffk@apple.com>
1277 * g++spec.c (lang_specific_driver): Add -lstdc++ when compiling
1278 Objective-C++. Don't exit early if -shared-libgcc needs to be
1281 2007-03-02 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1283 * typeck.c (common_base_type): Delete unused function.
1285 2007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
1287 * Make-lang.in: Add dummy lang.install-pdf target.
1289 2007-03-01 Simon Baldwin <simonb@google.com>
1292 * decl.c (check_tag_decl): Added new warning for typedef ignored
1293 when it precedes an otherwise valid non-typedef declaration.
1295 2007-02-28 Sandra Loosemore <sandra@codesourcery.com>
1297 * typeck.c (build_function_call): Store converted arguments
1298 in a stack-allocated array instead of building a list.
1299 (convert_arguments): Store arguments in the array passed in as an
1300 argument, and return the actual number of arguments.
1301 * call.c (build_call): Delete, and replace with...
1302 (build_call_n, build_call_a): New.
1303 (build_op_delete_call): Rewrite to avoid constructing argument lists.
1304 (build_over_call): Store converted arguments in a stack-allocated
1305 array instead of building a list.
1306 (build_cxx_call): Pass arguments in an array instead of as a list.
1307 (build_java_interface_fn_ref): Rewrite to avoid constructing
1309 * tree.h: Update declarations to reflect above changes.
1310 * method.c (use_thunk): Use a stack-allocated array to hold
1311 the arguments instead of a list.
1312 * rtti.c (throw_bad_cast): Update call to cxx_call.
1313 (throw_bad_typeid): Likewise.
1314 (build_dynamic_cast_1): Likewise.
1315 * init.c (build_builtin_delete_call): Use build_call_n.
1316 * decl.c (expand_static_init): Likewise.
1317 * except.c (cp_protect_cleanup_actions): Likewise.
1318 * cp-gimplify.c (genericize_eh_spec_block): Likewise.
1319 (gimplify_must_not_throw_expr): Likewise.
1320 (cxx_omp_apply_fn): Use build_call_a.
1322 2007-02-26 Mark Mitchell <mark@codesourcery.com>
1324 * semantics.c (expand_or_defer_fn): Call c_record_cdtor_fn.
1325 * decl2.c (cp_write_gloabl_declarations): Call c_build_cdtor_fns.
1327 2007-02-25 Mark Mitchell <mark@codesourcery.com>
1329 * cp-tree.h (static_ctors): Remove.
1330 * cp-tree.h (static_dtors): Likewise.
1331 * cp-objcp-common.c (decl_shadowed_for_var_lookup): Adjust for
1332 refactoring of tree_map hierarchy.
1333 (decl_shadowed_for_var_insert): Likewise.
1334 * semantics.c (expand_body): Use c_expand_body.
1335 (expand_or_defer_fn): Don't update static_ctors or static_dtors.
1336 * decl2.c (static_ctors): Remove.
1337 (static_dtors): Likewise.
1338 (generate_ctor_or_dtor_function): Pass NULL_TREE to
1339 objc_generate_static_init_call. Do not call static_[cd]tors.
1340 (generate_ctor_and_dtor_functions_for_priority): Do not check for
1342 (cp_write_global_declarations): Likewise.
1344 2007-02-23 Richard Guenther <rguenther@suse.de>
1346 * class.c (note_name_declared_in_class): Make declaration
1347 changes meaning a pedwarn.
1349 2007-02-22 Michael Matz <matz@suse.de>
1352 * cp-tree.h (TFF_UNQUALIFIED_NAME): New formatting flag.
1353 * error.c (dump_aggr_type, dump_simple_decl, dump_decl,
1354 dump_function_decl): Guard emitting outer scopes by new flag.
1355 * cp-lang.c (cxx_dwarf_name): New function.
1356 (LANG_HOOKS_DWARF_NAME): Define to cxx_dwarf_name.
1357 * pt.c (classtype_mangled_name, mangle_class_name_for_template):
1359 (push_template_decl_real, lookup_template_class): Remove calls
1362 2007-02-19 Mark Mitchell <mark@codesourcery.com>
1364 * call.c (build_new_method_call): Ensure that explicit calls of
1365 destructors have type "void".
1367 2007-02-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1369 * typeck.c (build_binary_op): Replace -Wstring-literal-comparison
1370 and -Walways-true with -Waddress.
1371 * cvt.c (convert_to_void): Replace unconditional warning with
1374 2007-02-18 Kazu Hirata <kazu@codesourcery.com>
1376 * decl.c, tree.c: Fix comment typos.
1378 2007-02-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
1381 * semantics.c (finish_stmt_expr_expr): Set TREE_TYPE of the
1382 statement expression if we had an error mark node.
1384 2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
1385 Brooks Moses <brooks.moses@codesourcery.com>
1386 Lee Millward <lee.millward@codesourcery.com>
1388 * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
1389 Change class to tcc_vl_exp.
1391 * call.c (build_call): Use build_call_list instead
1393 (build_over_call): Likewise.
1394 (build_new_method_call): Use build_min_non_dep_call_list
1395 instead of build_min_non_dep.
1397 * error.c (dump_call_expr_args): New function.
1398 (dump_aggr_init_expr_args): New function.
1399 (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them.
1400 Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
1402 * cvt.c (convert_to_void): Use build_call_array instead
1403 of build3; use new AGGR_INIT_EXPR accessor macros.
1405 * mangle.c (write_expression): Use TREE_OPERAND_LENGTH
1406 instead of TREE_CODE_LENGTH.
1408 * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
1409 AGGR_INIT_EXPR accessor macros.
1411 * cp-gimplify.c (cp_gimplify_init_expr): Use
1412 AGGR_INIT_EXPR_SLOT to set the slot operand.
1414 * cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
1415 (AGGR_INIT_EXPR_SLOT): New macro.
1416 (AGGR_INIT_EXPR_ARG): New macro.
1417 (aggr_init_expr_nargs): New macro.
1418 (AGGR_INIT_EXPR_ARGP): New macro.
1419 (aggr_init_expr_arg_iterator): New.
1420 (init_aggr_init_expr_arg_iterator): New.
1421 (next_aggr_init_expr_arg): New.
1422 (first_aggr_init_expr_arg): New.
1423 (more_aggr_init_expr_args_p): New.
1424 (FOR_EACH_AGGR_INIT_EXPR_ARG): New.
1425 (stabilize_aggr_init): New declaration.
1426 (build_min_non_dep_call_list): Likewise.
1428 * tree.c (process_aggr_init_operands): New function.
1429 (build_aggr_init_array) New function.
1430 (build_cplus_new): Update to use new CALL_EXPR and
1431 AGGR_INIT_EXPR accessor macros. Replace use of build3 with
1432 build_aggr_init_array.
1433 (build_min_non_dep_call_list) New function.
1434 (build_min_nt): Assert input code parameter is not a variable
1435 length expression class.
1436 (build_min, build_min_non_dep): Likewise.
1437 (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
1438 to check for equality instead of recursing. Handle tcc_vl_exp
1440 (stabilize_call): Update to only handle CALL_EXPRs, not
1441 AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
1442 (stabilize_aggr_init): New function.
1443 (stabilize_init): Use it.
1445 * cxx-pretty-print.c (pp_cxx_postfix_expression)
1446 <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
1447 AGGR_INIT_EXPR accessor macros and argument iterators.
1449 * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
1450 build_vl_exp. Iterate through the operands, recursively
1451 processing each one.
1452 (tsubst_copy_and_build) <CALL_EXPR>: Update to use new
1453 CALL_EXPR accessor macros.
1454 (value_dependent_expression_p) <default>: Handle tcc_vl_exp
1455 tree code classes. Use TREE_OPERAND_LENGTH instead of
1458 * semantics.c (finish_call_expr): Use build_nt_call_list
1459 instead of build_nt.
1460 (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR
1461 accessor macros. Use build_call_array to construct the
1462 CALL_EXPR node instead of build3
1464 * decl2.c (build_offset_ref_call_from_tree): Use
1465 build_nt_call_list and build_min_non_dep_call_list instead
1466 of build_min_nt and build_min_non_dep.
1468 * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
1469 Use build_nt_call_list instead of build_min_nt.
1471 2007-02-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1474 * call.c (build_conditional_expr): Improve error message.
1476 2007-02-13 Dirk Mueller <dmueller@suse.de>
1478 * friend.c (do_friend): Annotate warning about friend
1479 declarations in templates with OPT_Wnon_template_friend.
1480 Convert informal message from warning() to inform().
1482 2007-02-12 Simon Martin <simartin@users.sourceforge.net>
1483 Mark Mitchell <mark@codesourcery.com>
1486 * pt.c (do_decl_instantiation): Detect type mismatches in explicit
1487 instantiations for variables.
1489 2007-02-12 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1492 * cp-gimplify.c (gimplify_expr_stmt): Don't check extra_warnings.
1493 Check warn_unused_value just once.
1495 2007-02-11 Mark Mitchell <mark@codesourcery.com>
1498 * pt.c (determine_specialization): Use skip_artificial_parms_for.
1499 (fn_type_unificiation): Likewise.
1500 (get_bindings): Likewise.
1502 o2007-02-06 Mark Mitchell <mark@codesourcery.com>
1505 * decl.c (finish_function): Use DECL_REPLACEABLE.
1506 * tree.c (cp_cannot_inline_tree_fn): Likewise.
1508 2007-02-10 Gabriel Dos Reis <gdr@integrable-solutions.net>
1510 * parser.c (cp_parser_primary_expression): Reformat overly long lines.
1512 2007-02-10 Richard Henderson <rth@redhat.com>, Jakub Jelinek <jakub@redhat.com>
1514 * decl.c (grokvardecl): Don't error if !have_tls.
1515 (grokdeclarator): Likewise.
1516 * parser.c (cp_parser_omp_threadprivate): Likewise.
1518 2007-02-07 Jakub Jelinek <jakub@redhat.com>
1521 * cp-gimplify.c (cp_genericize_r): Don't dereference invisiref
1522 parameters and result decls in omp clauses.
1523 (cxx_omp_privatize_by_reference): Pass also invisiref PARM_DECLs
1526 2007-02-05 Dirk Mueller <dmueller@suse.de>
1529 * parser.c (cp_parser_class_specifier): Always initialize bases.
1531 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
1533 * cp-tree.h (OMP_ATOMIC_CODE): Delete.
1534 (OMP_ATOMIC_DEPENDENT_P): Rewrite.
1535 * pt.c (tsubst_expr): Adjust for new format of dependent OMP_ATOMIC
1537 * semantics.c (finish_omp_atomic): Store a whole expression node
1538 in operand 1, and integer_zero_node in operand 0, for dependent
1539 OMP_ATOMIC. Rewrite to make flow easier to understand.
1541 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
1543 * decl.c (grokdeclarator): Use OPT_Wreturn_type instead of 0.
1545 2007-02-04 Kazu Hirata <kazu@codesourcery.com>
1547 * class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
1548 parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
1550 2007-02-03 Douglas Gregor <doug.gregor@gmail.com>
1552 * parser.c (cp_lexer_get_preprocessor_token): Attach the C++0x
1553 keyword warning to -Wc++0x-compat.
1555 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
1557 * decl.c (grokdeclarator): Update documentation.
1559 2007-02-02 Jakub Jelinek <jakub@redhat.com>
1562 * decl.c (grokdeclarator): If __thread is used together with
1563 a storage class other than extern and static, clear thread_p
1564 after issuing diagnostics and fall through to checking the
1567 2007-01-30 Roger Sayle <roger@eyesopen.com>
1569 * error.c (dump_type_suffix): Avoid use of cp_build_binary_op when
1570 calculating the size of an array (to avoid recursive errors).
1572 2007-01-30 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1575 * typeck.c (build_binary_op): Fix logic for warning. Move warning
1577 * call.c (convert_like_real): Don't warn when converting to
1580 2007-01-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1582 * decl.c (pop_label): Replace warning with call to
1583 warn_for_unused_label.
1585 2007-01-28 Andrew Pinski <pinskia@gmail.com>
1588 * semantics.c (finish_pseudo_destructor_expr): Check the
1589 destrutor name by calling check_dtor_name.
1591 2007-01-24 Douglas Gregor <dgregor@osl.iu.edu>
1593 * lex.c (D_CPP0X): Rename.
1595 (reswords): D_CPP0X -> D_CXX0X.
1596 (init_reswords): Ditto.
1597 * parser.c (cp_lexer_get_preprocessor_token): Warn about the use
1598 of C++0x keywords as identifiers.
1600 2007-01-23 Simon Martin <simartin@users.sourceforge.net>
1603 * decl.c (duplicate_decls): Don't reset DECL_INVALID_OVERRIDER_P for
1606 2007-01-23 Ian Lance Taylor <iant@google.com>
1608 * typeck.c (convert_for_assignment): Only warn about a = b = c
1609 when converting to bool.
1611 2007-01-23 Roger Sayle <roger@eyesopen.com>
1613 * call.c (null_ptr_cst_p): Replace use of TREE_CONSTANT_OVERFLOW with
1615 * typeck.c (ignore_overflows): Remove the remaining uses of
1616 TREE_CONSTANT_OVERFLOW.
1618 2007-01-20 Jan Hubicka <jh@suse.cz>
1620 * decl2.c (start_objects, start_static_storage_duration_function):
1621 Do not make the functions uninlinable.
1623 2007-01-17 Ian Lance Taylor <iant@google.com>
1625 * class.c (add_method): Call VEC_reserve_exact rather than passing
1626 a negative size to VEC_reserve.
1628 2007-01-11 Simon Martin <simartin@users.sourceforge.net>
1631 * tree.c (cp_tree_equal): Properly handle MODOP_EXPR trees.
1633 2007-01-10 Mark Mitchell <mark@codesourcery.com>
1636 * decl.c (make_typename_type): If the qualified name is not a
1637 type, issue an error.
1638 * parser.c (cp_parser_elaborated_type_specifier): Fix comment
1641 2007-01-08 Geoffrey Keating <geoffk@apple.com>
1643 * rtti.c: Include target.h.
1644 (emit_support_tinfos): If ! targetm.cxx.library_rtti_comdat (),
1645 don't emit typeinfo for fundamental types as weak.
1646 * Make-lang.in (cp/rtti.o): Update and correct dependencies.
1648 2007-01-08 Richard Guenther <rguenther@suse.de>
1650 * cvt.c (cp_convert_to_pointer): Use build_int_cst_type.
1652 2007-01-08 Mark Shinwell <shinwell@codesourcery.com>
1654 * call.c (standard_conversion): Pass flag to
1655 vector_types_convertible_p to disallow emission of note.
1656 * typeck.c (convert_for_assignment): Pass flag to
1657 vector_types_convertible_p to allow emission of note.
1658 (ptr_reasonably_similar): Pass flag to vector_types_convertible_p
1659 to disallow emission of note.
1661 2007-01-07 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1664 * typeck.c (build_binary_op): Call overflow_warning if
1665 TREE_OVERFLOW_P is true for the result and not for any of the
1668 2007-01-06 Lee Millward <lee.millward@codesourcery.com>
1671 * class.c (add_method): Don't wait until template
1672 instantiation time to complain about duplicate methods.
1674 2007-01-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1677 * semantics.c (finish_unary_op_expr): Warn only if result
1678 overflowed and operands did not.
1680 2007-01-05 Ian Lance Taylor <iant@google.com>
1682 * typeck.c (build_binary_op): Warn about comparing a non-weak
1685 2007-01-05 Douglas Gregor <doug.gregor@gmail.com>
1687 * pt.c (tsubst): Propagate the need for structural equality checks
1688 when reducing the level of template parameters.
1690 2007-01-03 Kazu Hirata <kazu@codesourcery.com>
1692 * pt.c: Fix a comment typo.
1694 2007-01-02 Ian Lance Taylor <iant@google.com>
1696 * semantics.c (maybe_convert_cond): Optionally warn when using an
1697 assignment as a condition.
1698 * typeck.c (convert_for_assignment): Optionally warn about
1699 assigning the result of an assignment to a bool.
1701 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
1703 * pt.c (canonical_template_parms): Correct typo in comment.
1705 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
1707 * typeck.c (structural_comptypes): Renamed from "comptypes".
1708 (comptypes): Use canonical type information to perform fast type
1709 comparison. When VERIFY_CANONICAL_TYPES, verify that the
1710 canonical type comparison returns the same results as we would see
1711 from the current, structural check. Support COMPARE_STRUCTURAL
1712 when we need structural checks.
1713 * decl.c (typename_compare): Fix comment.
1714 (build_typename_type): TYPENAME_TYPE nodes require structural
1715 equality checks, because they resolve different based on the
1717 (make_unbound_class_template): UNBOUND_CLASS_TEMPLATE nodes
1718 require structural equality checks (for now).
1719 (build_ptrmemfunc_type): Build the canonical pointer to member
1721 (compute_array_index_type): Whenever we build a new index type
1722 to represent the size of an array in a template, we need to mark
1723 this index type as requiring structural equality. This goes for
1724 arrays with value-dependent sizes with the current ABI, or all
1726 * tree.c (cplus_array_hash): New.
1727 (struct cplus_array_info): New.
1728 (cplus_array_compare): New.
1729 (cplus_array_htab): New.
1730 (build_cplus_array_type_1): Use a hash table to cache the array
1731 types we build. Build the canonical array type for each array
1733 (cp_build_qualified_type_real): When building a cv-qualified array
1734 type, use the hash table of array types and build canonical array
1736 (bind_template_template_parm): BOUND_TEMPLATE_TEMPLATE_PARM nodes
1737 use structural equality (for now).
1738 * cp-tree.h (COMPARE_STRUCTURAL): New.
1739 * pt.c (canonical_template_parms): New.
1740 (canonical_type_parameter): New.
1741 (process_template_parm): Find the canonical type parameter.
1742 (lookup_template_class): When we have named the primary template
1743 type, set the canonical type for our template class to the primary
1744 template type. If any of the template arguments need structural
1745 equality checks, the template class needs structural equality
1747 (tsubst): When reducing the level of a template template
1748 parameter, we require structural equality tests for the resulting
1749 parameter because its template parameters have not had their types
1750 canonicalized. When reducing a template type parameter, find the
1751 canonical reduced type parameter.
1752 (any_template_arguments_need_structural_equality_p): New.