1 2008-12-01 Jakub Jelinek <jakub@redhat.com>
4 * parser.c (cp_parser_omp_for_loop): Handle auto.
5 * pt.c (tsubst_omp_for_iterator): Likewise.
7 2008-11-28 Jason Merrill <jason@redhat.com>
10 * init.c (perform_member_init): Fix value-initialization.
11 (build_value_init_1): Add assert to catch cases that will break
13 (build_default_init): Remove.
14 * cp-tree.h: Remove its prototype.
15 * pt.c (tsubst_expr) [DECL_EXPR]: Use build_value_init for
19 * parser.c (cp_parser_class_name): Only call
20 maybe_note_name_used_in_class if we actually found a class name.
22 2008-11-25 Jason Merrill <jason@redhat.com>
25 * decl2.c (check_classfn): Error rather than abort on parameter
28 2008-11-20 Jason Merrill <jason@redhat.com>
31 * parser.c (cp_parser_class_name): Call maybe_note_name_used_in_class.
34 * call.c (build_over_call): Take the address of the function even
36 (build_new_method_call): Remember the type of the called function
39 2008-11-19 Dodji Seketeli <dodji@redhat.com>
42 * pt.c (coerce_template_template_parm): Use the more robust
43 uses_template_parms instead of dependent_type_p.
45 2008-11-19 Dodji Seketeli <dodji@redhat.com>
48 * pt.c (lookup_template_class): Check pointers before dereferencing
50 * error.c (dump_template_decl): Likewise.
52 2008-11-19 Jason Merrill <jason@redhat.com>
55 * decl2.c (grokfield): Pass ATTR_FLAG_TYPE_IN_PLACE for a typedef
56 that names a class for linkage purposes.
59 * parser.c (cp_parser_pseudo_destructor_name): A pseudo-destructor
60 name is not a declaration.
63 * pt.c (instantiate_decl): Don't require a definition of
64 a template that is explicitly instantiated 'extern'.
66 2008-11-18 Jason Merrill <jason@redhat.com>
67 Jakub Jelinek <jakub@redhat.com>
70 * parser.c (cp_parser_type_id): Complain about auto.
71 * decl.c (grokdeclarator): Complain about parameters and
72 conversion functions declared with auto.
74 * call.c (standard_conversion): Use CLASS_TYPE_P instead of
76 * cp-tree.h (TYPE_NON_AGGREGATE_CLASS): Likewise.
78 2008-11-17 Jakub Jelinek <jakub@redhat.com>
81 * init.c (constant_value_1): Handle TREE_LIST init.
83 2008-11-15 Jakub Jelinek <jakub@redhat.com>
86 * typeck.c (cp_build_unary_op): Don't call get_unwidened. Use
87 argtype instead of result_type.
89 2008-11-14 Jason Merrill <jason@redhat.com>
92 * semantics.c (finish_call_expr): Don't repeat arg-dep lookup
93 for a non-dependent call.
96 * call.c (build_aggr_conv): Increment i.
98 2008-11-13 Jason Merrill <jason@redhat.com>
101 * typeck2.c (process_init_constructor_record): Update bitfield
103 (check_narrowing): Update bitfield handling, print source type.
105 2008-11-12 Jakub Jelinek <jakub@redhat.com>
109 2007-05-07 Mike Stump <mrs@apple.com>
110 * parser.c (check_empty_body): Add.
111 (cp_parser_iteration_statement): Add call to check_empty_body.
113 2008-11-12 Jason Merrill <jason@redhat.com>
116 * typeck.c (cp_build_modify_expr): Update bitfield handling.
118 2008-11-12 Jakub Jelinek <jakub@redhat.com>
121 * parser.c (cp_parser_simple_declaration): Don't commit
122 to tentative parse if parse errors were seen.
125 * error.c (dump_expr): Handle COMPLEX_EXPR.
127 2008-11-10 Jakub Jelinek <jakub@redhat.com>
130 * parser.c (cp_parser_enum_specifier): After parsing :,
131 parse definitely. Don't return early if type specifier
134 2008-11-06 David Edelsohn <edelsohn@gnu.org>
137 * g++spec.c (LIBSTDCXX_STATIC): New.
138 (lang_spec_driver): Use LIBSTDCXX_STATIC when not
141 2008-11-05 Fabien Chene <fabien.chene@gmail.com>
144 * cp-tree.h: Fix DECL_NONSTATIC_MEMBER_P to handle member template
147 2008-11-05 Richard Guenther <rguenther@suse.de>
150 * decl.c (start_preparsed_function): Use the correct type for
151 building the RESULT_DECL.
153 2008-10-31 Jakub Jelinek <jakub@redhat.com>
156 * decl.c (grokdeclarator): Diagnose auto function decl without
157 late return type and late return type function decl where type
161 * decl.c (cp_finish_decl): Diagnose type_uses_auto type with
164 2008-10-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
167 * class.c (check_bitfield_decl): Rename min_precision to
168 tree_int_cst_min_precision.
169 * decl.c (finish_enum): Likewise.
171 2008-10-29 Manuel López-Ibáñez <manu@gcc.gnu.org>
174 * parser.c (cp_parser_token_starts_cast_expression): New.
175 (cp_parser_cast_expression): Peek the next token to decide whether
176 this could be a parenthesized constructor or is definitely an
179 2008-10-24 Manuel López-Ibáñez <manu@gcc.gnu.org>
182 * typeck.c (build_x_binary_op): Update call to
183 warn_about_parentheses.
184 * parser.c (cp_parser_binary_expression): Add note about passing
185 the correct code for unary expressions.
187 2008-10-24 Jakub Jelinek <jakub@redhat.com>
189 * Make-lang.in (check-c++-subtargets): New alias for
190 check-g++-subtargets.
191 (lang_checks_parallelized): Add check-g++.
192 (check_g++_parallelize): New variable.
194 2008-10-21 Richard Guenther <rguenther@suse.de>
196 * semantics.c (simplify_aggr_init_exprs_r): Remove.
197 (expand_or_defer_fn): Do not walk the function body to
198 simplify aggr_init_exprs.
200 2008-10-20 Manuel López-Ibáñez <manu@gcc.gnu.org>
203 * typeck.c (cp_common_type): New. The same as
204 type_after_usual_arithmetic_conversions but without promotions.
205 (type_after_usual_arithmetic_conversions): Do the promotions and
207 (common_type): Make it behave like the C version of this
208 function. Do not handle pointer types.
209 (common_pointer_type): Move handling of pointer types from
211 (cp_build_binary_op): Use common_pointer_type instead of
212 common_type in call to pointer_diff.
213 Use cp_common_type instead of common_type.
214 * cp-tree.h (common_pointer_type): Declare.
216 2008-10-14 Jakub Jelinek <jakub@redhat.com>
219 * cp-gimplify.c (cp_genericize_r): Only fold_convert COND_EXPR
220 arguments if they don't already have COND_EXPR's type.
222 2008-10-14 Paolo Carlini <paolo.carlini@oracle.com>
225 * pt.c (push_template_decl_real): Check that current_template_parms
227 (process_partial_specialization): Assert current_template_parms not
230 2008-10-13 Doug Evans <dje@google.com>
232 * cp-tree.h (DECL_MAIN_P): Fix parentheses around expression.
234 2008-10-10 Jakub Jelinek <jakub@redhat.com>
237 * cp-gimplify.c (cp_genericize_r): Fix up bitfield operands of
240 2008-10-09 Jakub Jelinek <jakub@redhat.com>
243 * semantics.c (finalize_nrv_r): Clear DECL_INITIAL instead of
244 setting it to error_mark_node.
246 2008-10-07 Steve Ellcey <sje@cup.hp.com>
248 * decl.c (start_cleanup_fn): Declare as inline.
250 2008-10-06 Jason Merrill <jason@redhat.com>
252 PR c++/37376, other mangling issues
253 * mangle.c (write_type): Update TYPE_PACK_EXPANSION mangling.
254 (write_member_name): Break out from...
255 (write_expression): ...here. Handle dependent COMPONENT_REF.
256 (write_template_arg): Wrap an argument pack in 'I'/'E'.
257 (write_builtin_type): Update char16/32_t mangling.
258 (write_nested_name, write_prefix): Don't forget template args
260 * operators.def: Add ARROW_EXPR, update COMPONENT_REF and
263 2008-10-06 Aldy Hernandez <aldyh@redhat.com>
265 * typeck.c (build_x_indirect_ref): Add location argument.
266 (cp_build_binary_op): Pass location to warn_for_div_by_zero.
267 (cp_build_unary_op): Add location argument.
268 (cp_build_modify_expr): Same.
269 * class.c (build_base_path): Pass location to build_indirect_ref.
270 * semantics.c (handle_omp_for_class_iterator): Pass elocus to
273 2008-10-05 Dodji Seketeli <dodji@redhat.com>
276 * cp-gimplify.c (cp_gimplify_expr): For each USING_STMT
277 make sure an IMPORTED_DECL node is added to the BLOCK_VARS list
278 of the innermost containing BLOCK.
280 2008-10-03 Paolo Carlini <paolo.carlini@oracle.com>
283 * error.c (dump_function_decl): Save the exceptions in case of
284 error about incompatible specifications in a specialization.
286 2008-10-01 Andrew Pinski <andrew_pinski@playstation.sony.com>
288 * tree.c (lvalue_p_1): COMPOUND_LITERAL_EXPR is also an lvalue.
290 2008-09-30 H.J. Lu <hongjiu.lu@intel.com>
293 * parser.c (cp_parser_selection_statement): Fix uninitialized
296 2008-09-30 Simon Martin <simartin@users.sourceforge.net>
300 * decl.c (grokdeclarator): Set the type for typedefs to a
301 nested-name-specifier to error_mark_node.
303 2008-09-30 Paolo Bonzini <bonzini@gnu.org>
305 * parser.c (cp_parser_selection_statement): Implement here the
306 -Wempty-body warning for `if' and `else' statements.
307 * semantics.c (finish_if_stmt): Do not call empty_body_warning.
309 2008-09-25 Paolo Carlini <paolo.carlini@oracle.com>
312 * name-lookup.c (maybe_process_template_type_declaration): Check
313 return value of push_template_decl_real for error_mark_node.
315 2008-09-24 Aldy Hernandez <aldyh@redhat.com>
317 * semantics.c (finish_fname): Pass location to fname_decl.
319 2008-09-23 Jakub Jelinek <jakub@redhat.com>
322 * semantics.c (finish_omp_for): If processing_template_decl, just build
323 MODIFY_EXPR for init instead of calling cp_build_modify_expr.
325 2008-09-23 Aldy Hernandez <aldyh@redhat.com>
327 * typeck.c (build_array_ref): Pass location to cp_build_binary_op.
328 (get_member_function_from_ptrfunc): Same.
329 (build_x_binary_op): Same.
330 (build_binary_op): Same.
331 (cp_build_binary_op): New location argument.
332 (pointer_diff): Pass location to cp_build_binary_op.
333 (cp_truthvalue_conversion): Pass location to build_binary_op.
334 (convert_ptrmem): Pass location to cp_build_binary_op.
335 (cp_build_modify_expr): Same.
336 (build_ptrmemfunc): Same.
337 * init.c (expand_cleanup_for_base): Pass location to
338 c_common_truthvalue_conversion.
339 (build_new_1): Pass location to cp_build_binary_op.
340 (build_vec_delete_1): Pass location to *build_binary_op,
341 c_common_truthvalue_conversion.
342 (build_vec_init): Same.
343 (build_delete): Same.
344 * decl.c (compute_array_index_type): Same.
345 * call.c (build_new_op): Same.
346 * rtti.c (build_dynamic_cast_1): Same.
347 * cp-tree.h: Add argument to cp_build_binary_op.
348 * semantics.c (handle_omp_for_class_iterator): Pass location to
349 *build_binary_op, c_common_truthvalue_conversion.
350 * decl2.c (get_guard_cond): Same.
352 2008-09-17 Richard Guenther <rguenther@suse.de>
355 * rtti.c (build_dynamic_cast_1): Convert the COND_EXPR
356 result to the correct type.
358 2008-09-17 H.J. Lu <hongjiu.lu@intel.com>
361 * name-lookup.c (pushdecl_maybe_friend): Don't return the old
362 parameter for duplicate.
364 2008-09-17 Jason Merrill <jason@redhat.com>
367 * name-lookup.c (lookup_type_scope): Look through sk_function_parms.
369 2008-09-17 Jakub Jelinek <jakub@redhat.com>
372 * typeck.c (build_array_ref): Use protected_set_expr_location instead
373 of SET_EXPR_LOCATION when ret might not be an expression.
375 2008-09-17 Jan Hubicka <jh@suse.cz>
378 * cp/decl.c (start_method): Set DECL_NO_INLINE_WARNING_P.
380 2008-09-16 Jakub Jelinek <jakub@redhat.com>
383 * semantics.c (finish_compound_literal): Return error_mark_node if
387 * lex.c (init_reswords): Don't populate ridpointers for D_CONLY
390 2008-09-15 Aldy Hernandez <aldyh@redhat.com>
392 * decl.c (duplicate_decls): Call error_at.
393 (grokfndecl): New location argument. Use location if available.
394 (grokdeclarator): Pass declarator location to grokfndecl.
395 * cp-tree.h (struct cp_declarator): Update comment for id_loc.
396 * decl2.c (check_classfn): Use error_at.
397 * parser.c (cp_parser_init_declarator): Set function_start_locus
399 (cp_parser_member_declaration): Set id_loc for function declarators.
401 2008-09-09 Jan Hubicka <jh@suse.cz>
404 * pt.c (tsubst_decl): Do not copy DECL_STRUCT_FUNCTION pointer.
406 2008-09-09 Jakub Jelinek <jakub@redhat.com>
409 * tree.c (array_type_nelts_top): Add size_one_node instead of
412 2008-09-09 Jason Merrill <jason@redhat.com>
415 * pt.c (tsubst_copy) [PARM_DECL]: Don't abort if the parm has
418 2008-09-09 Jakub Jelinek <jakub@redhat.com>
421 * decl.c (build_enumerator): Handle previous value's DECL_INITIAL
422 being error_operand_p. Don't clear value if it was error_mark_node.
424 2008-09-09 Paolo Bonzini <bonzini@gnu.org>
426 * cp-objcp-common.h (LANG_HOOKS_EXPAND_DECL): Remove.
427 * cp-tree.h: Don't mention DECL_ANON_UNION_ELEMS.
428 * semantics.c (anon_aggr_type_p): Remove.
430 2008-09-06 Jason Merrill <jason@redhat.com>
433 * parser.c (cp_parser_parameter_declaration_list): Process the
434 PARM_DECLs as we go and push them. Return a TREE_LIST.
435 (cp_parser_parameter_declaration_clause): Return a TREE_LIST.
436 (cp_parser_direct_declarator): Create a binding level and
437 suppress deprecated warnings in the parameter list.
438 (make_call_declarator): PARMS is now a tree.
439 * cp-tree.h (struct cp_declarator): Function parms are now a tree.
440 * decl.h (enum deprecated_states, deprecated_state): Move here.
442 (type_is_deprecated): New fn.
443 (grokparms): PARMLIST is a tree now. Warn about parms that
444 use deprecated types.
445 * mangle.c (write_expression): Handle PARM_DECL, CALL_EXPR and
447 * pt.c (tsubst) [DECLTYPE_TYPE]: Set skip_evaluation.
448 (tsubst_copy) [PARM_DECL]: Handle a PARM_DECL used outside of a
450 * name-lookup.c (pushtag): Look through function parameter scopes.
451 (pushdecl_maybe_friend): Don't set DECL_CONTEXT on a PARM_DECL
452 when we're parsing a function declarator.
454 2008-09-05 Douglas Gregor <doug.gregor@gmail.com>
457 * tree.c (cp_build_qualified_type_real): Deal with sharing of
458 TYPE_LANG_SPECIFIC in the canonical types of pointer-to-method
461 2008-09-04 Ian Lance Taylor <iant@google.com>
463 * parser.c (check_no_duplicate_clause): Change code parameter to
464 enum omp_clause_code.
466 2008-09-03 Jakub Jelinek <jakub@redhat.com>
469 * decl.c (cp_finish_decl): Only set
470 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P if decl is VAR_DECL.
473 * cp-tree.h (defer_mark_used_calls, deferred_mark_used_calls): New
475 * decl2.c (mark_used): If defer_mark_used_calls, push decl into
476 deferred_mark_used_calls vector and exit early.
477 * decl.c (defer_mark_used_calls, deferred_mark_used_calls): New
479 (finish_function): Set defer_mark_used_calls for the duration of the
480 function. Call mark_used on any queued decls.
482 2008-09-02 Jason Merrill <jason@redhat.com>
485 * call.c (build_over_call): Make =delete work with SFINAE.
486 * class.c (resolve_address_of_overloaded_function): Likewise.
488 * cp-tree.h (struct lang_decl_flags): Rename threadprivate_p to
489 threadprivate_or_deleted_p.
490 (CP_DECL_THREADPRIVATE_P): Adjust.
491 (DECL_DELETED_FN): Likewise.
492 (SD_UNINITIALIZED, SD_INITIALIZED, SD_DEFAULTED): New macros.
493 (SD_DELETED): New macro.
494 * parser.c (cp_parser_init_declarator): Use them.
495 * decl.c (start_decl): Use them.
497 * decl2.c (mark_used): Give =deleted error even in sizeof.
499 * typeck2.c (check_narrowing): Downgrade narrowing error to
502 2008-09-02 Aldy Hernandez <aldyh@redhat.com>
504 * typeck.c (build_array_ref): Use new location argument.
505 * class.c (build_vtbl_ref_1): Pass location to build_array_ref.
506 * call.c (build_new_op): Same.
507 * decl2.c (grok_array_decl): Same.
508 * cp-tree.h (build_array_ref): Add location argument to prototype.
510 2008-09-01 Aldy Hernandez <aldyh@redhat.com>
512 * typeck.c (build_x_indirect_ref): Add location argument.
513 * class.c (build_base_path): Pass location to build_indirect_ref.
514 * pt.c (tsubst_copy_and_build): Pass location to
515 finish_label_address_expr.
516 * parser.c (cp_parser_unary_expression): Same.
518 2008-08-31 Jason Merrill <jason@redhat.com>
520 Implement late-specified return type using 'auto'.
521 * cp-tree.h (struct cp_declarator): Add late_return_type field to
523 * parser.c (cp_parser_late_return_type_opt): New fn.
524 (cp_parser_direct_declarator): Use it.
525 (make_call_declarator): Put it in the declarator.
526 * decl.c (grokdeclarator): Splice in late-specified return type.
527 * pt.c (splice_late_return_type): New fn.
529 2008-08-29 Michael Meissner <gnu@the-meissners.org>
531 * decl.c (builtin_function_1): Take a bool argument to decide
532 whether to use pushdecl or pushdecl_top_level.
533 (duplicate_decls): Copy function specific target and optimization
534 options on duplicate declarations.
535 (cxx_builtin_function): Update builtin_function_1 call.
536 (cxx_builtin_function_ext_scope): New function, guarantee that the
537 declaration is done at global scope.
539 * cp-objcp-common.h (LANG_HOOKS_BUILTIN_FUNCTION_EXT_SCOPE): New
540 macro, define builtin function hook for delayed machine specific
543 * cp-tree.h (cxx_builtin_function_ext_scope): Add declaration.
545 2008-08-30 Jason Merrill <jason@redhat.com>
548 * pt.c (dependent_type_p): Don't abort on auto outside of a template.
550 2008-08-29 Jason Merrill <jason@redhat.com>
552 Implement C++0x 'auto' semantics.
553 * decl.c (start_decl_1): Don't complain about auto being incomplete.
554 (cp_finish_decl): Deduce auto.
555 * init.c (build_new): Handle 'new auto'.
556 * typeck2.c (cxx_incomplete_type_diagnostic): Give a different
557 message for auto than for normal template type parms.
558 * pt.c (type_dependent_expression_p): Handle { }.
559 (make_auto): New function.
560 (listify_autos): New function.
561 (do_auto_deduction): New function.
562 (is_auto): New function.
563 (type_uses_auto): New function.
564 * cp-tree.h: Declare them.
565 * parser.c (cp_parser_decl_specifier_seq): In C++0x mode, don't
566 treat auto as a declspec.
567 (cp_parser_simple_type_specifier): It's a type-specifier.
569 2008-08-29 Mark Mitchell <mark@codesourcery.com>
571 * mangle.c (write_type): Add target-specific manglings for
572 non-fundamental types to the substitution table.
575 2008-08-29 Jakub Jelinek <jakub@redhat.com>
579 * name-lookup.c (do_using_directive, cp_emit_debug_info_for_using):
580 Adjust debug_hooks->imported_module_or_decl callers.
582 2008-08-29 Jan Hubicka <jh@suse.cz>
584 * cp-gimplify.c (cp_gimplify_expr): Add PRED_CONTINUE heuristic.
586 2008-08-28 Paolo Carlini <paolo.carlini@oracle.com>
589 * decl.c (reshape_init_r): Check init for error_mark_node.
591 2008-08-27 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
594 * semantics.c (maybe_convert_cond): Call verify_sequence_points.
595 (finish_return_stmt): Likewise.
596 (finish_switch_condition): Likewise.
598 2008-08-27 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
600 * cp-tree.h: Fix #error directive.
602 2008-08-26 Douglas Gregor <doug.gregor@gmail.com>
604 * typeck.c (type_after_usual_arithmetic_conversions): Don't do the
605 usual arithmetic conversions on scoped enumeration types.
606 (common_type): Ditto.
607 (default_conversion): Don't perform integral promotions on scoped
609 (build_array_ref): Scoped enumeration types can't be used as
611 * decl.c (start_enum): If building a C++0x scoped enumeration,
612 enter its scope. If provided with an underlying type, check that
613 underlying type and set up the enumeration type accordingly.
614 (finish_enum): Only compute an underlying type if the underlying
615 type isn't already fixed, and only convert the enumerator values
616 now if we've just computed the underlying type. Finish the scope
617 of C++0x scoped enumerations.
618 (build_enumerator): For enumerations with a fixed underlying type,
619 check the enumerator values when the enumerator is defined.
620 (lookup_enumerator): New.
621 * call.c (standard_conversion): Don't allow assignment from
622 integers to scoped enumeration types, even with -fpermissive.
623 Don't convert from scoped enumerations to bool or any arithmetic
625 (build_conditional_expr): Don't per the usual arithmetic
626 conversions for scoped enumeration types.
627 (convert_like_real): Check complain to see if we should
629 * error.c (class_key_or_enum_as_string): Print scoped enums.
630 * cp-tree.h (MAYBE_CLASS_TYPE_P): Check CLASS_TYPE_P, not
632 (INTEGRAL_OR_UNSCOPED_ENUMERATION_TYPE_P): New.
633 (SCOPED_ENUM_P): New.
634 (UNSCOPED_ENUM_P): New.
635 (SET_SCOPED_ENUM_P): New.
636 (ENUM_UNDERLYING_TYPE): New.
637 * pt.c (lookup_template_class): Update the instantiation of enum
638 types to deal with C++0x scoped enumerations and underlying
640 * name-lookup.c (begin_scope): Deal with scoped enumeration
642 (lookup_qualified_name): Deal with lookup into enumeration types.
643 * name-lookup.h (enum scope_kind): Add sk_scoped_enum.
644 * parser.c (cp_parser_class_or_namespace_name): Rename to...
645 (cp_parser_qualifying_entity): ... this. Also, in C++0x mode,
646 parse a type-name that can be an enumeration type.
647 (cp_parser_nested_name_specifier_opt): Update with C++0x grammar.
648 (cp_parser_elaborated_type_specifier): Parse the
649 optional `struct' or `class' following enum (in C++0x).
650 (cp_parser_enum_specifier): Parse C++0x scoped enumerations and
653 2008-08-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
655 * typeck.c: Update all calls to pedwarn.
660 * name-lookup.c: Likewise.
661 * parser.c: Likewise.
663 2008-08-20 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
666 * parser.c (cp_parser_omp_for_loop): Handle parenthesized
669 2008-08-20 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
671 * parser.c: Update all calls to inform.
672 * typeck.c: Likewise.
676 * method.c: Likewise.
677 * friend.c: Likewise.
678 * typeck2.c: Likewise.
680 * name-lookup.c: Likewise.
683 2008-08-19 Jakub Jelinek <jakub@redhat.com>
686 * error.c (cp_print_error_function): Deal with recursive BLOCK trees.
688 2008-08-18 Tomas Bily <tbily@suse.cz>
690 * tree.c (cp_tree_equal): Use CONVERT_EXPR_CODE_P.
692 2008-08-18 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
694 * typeck.c: Update all callers of permerror.
699 * except.c: Likewise.
701 * typeck2.c: Likewise.
703 * semantics.c: Likewise.
704 * name-lookup.c: Likewise.
707 * parser.c: Likewise.
709 2008-08-14 Paolo Carlini <paolo.carlini@oracle.com>
712 * pt.c (check_template_shadow): Change to return a bool.
713 * name-lookup.c (push_class_level_binding): Early return if
714 check_template_shadow returns false.
715 * cp-tree.h (check_template_shadow): Adjust declaration.
717 2008-08-14 Paolo Carlini <paolo.carlini@oracle.com>
720 * decl.c (grokdeclarator): In case of extern and initializer, return
721 error_mark_node after the error.
723 2008-08-13 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
726 * decl.c (grokfndecl): Call check_main_parameters_type only if
729 2008-08-12 Paolo Carlini <paolo.carlini@oracle.com>
732 * parser.c (cp_parser_class_head): Early return error_mark_node in
733 case of global qualification of class name or qualified name that
734 does not name a class.
736 2008-08-09 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
739 * cvt.c (ocp_convert): Warn for out-of-range conversions to enum.
741 2008-08-09 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
744 * cp-tree.h (struct diagnostic_context, struct diagnostic_info):
745 Delete forward declarations. Check that toplev.h has not been
746 included before this file. Include toplev.h and diagnostic.h.
747 * error.c (cp_cpp_error): Use DK_PEDWARN.
748 (cxx_incomplete_type_diagnostic): Update declaration.
749 (cxx_incomplete_type_error): Use DK_ERROR.
750 * typeck2.c (cxx_incomplete_type_diagnostic): Take a diagnostic_t
751 as argument. Use emit_diagnostic.
752 (cxx_incomplete_type_error): Use DK_ERROR.
753 (add_exception_specifier): Use diagnostic_t instead of custom
755 * typeck.c (complete_type_or_else): Update call to
756 cxx_incomplete_type_diagnostic.
757 * init.c (build_delete): Likewise.
758 * call.c (diagnostic_fn_t): Remove unused typedef.
759 (build_temp): Pass a pointer to diagnostic_t.
760 (convert_like_real): Use emit_diagnostic.
761 (joust): Check return value of warning before giving informative
763 * friend.c (do_friend): Check return value of warning
764 before giving informative note.
765 * parser.c (cp_parser_template_id): Likewise.
767 2008-08-09 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
770 * class.c (check_bases_and_members): Warn with -Wuninitialized
773 2008-08-08 Volker Reichelt <v.reichelt@netcologne.de>
776 * decl.c (xref_basetypes): Check base for MAYBE_CLASS_TYPE_P,
777 and make sure it is not a union.
779 2008-08-07 H.J. Lu <hongjiu.lu@intel.com>
781 * semantics.c (finish_decltype_type): Initialize type.
783 2008-08-07 Douglas Gregor <doug.gregor@gmail.com>
785 * semantics.c (finish_decltype_type): Handle calls to function
786 pointers and references to functions properly.
788 2008-08-06 Douglas Gregor <doug.gregor@gmail.com>
791 * parser.c (cp_parser_template_argument): Don't assume that '>>'
792 following a type-id is an error when in C++0x mode.
794 2008-08-06 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
797 * decl.c (grokdeclarator): Use explicit location with permerror_at.
799 2008-08-06 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
802 * typeck.c (cp_build_binary_op): Move code to c-common.c.
804 2008-08-05 Jason Merrill <jason@redhat.com>
807 * decl.c (build_ptrmemfunc_type): Don't require structural
808 comparison of PMF types.
809 * tree.c (cp_build_qualified_type_real): Don't clear
810 a valid TYPE_PTRMEMFUNC_TYPE.
811 * typeck.c (cp_build_unary_op): Still do build_ptrmemfunc in
814 2008-08-04 Jason Merrill <jason@redhat.com>
817 * typeck2.c (check_narrowing): Allow narrowing conversion
818 from an explicit floating-point constant.
821 * pt.c (tsubst_decl): Leave DECL_INITIAL set on deleted
824 2008-08-04 Simon Baldwin <simonb@google.com>
827 * parser.c (cp_parser_elaborated_type_specifier): Warn only when
828 the declaration's id is followed by a semicolon.
830 2008-07-31 Jakub Jelinek <jakub@redhat.com>
833 * rtti.c (get_tinfo_decl_dynamic, get_typeid): Call
834 complete_type_or_else even for UNKNOWN_TYPE to get diagnostics.
836 2008-07-31 Jason Merrill <jason@redhat.com>
839 * init.c (build_new_1): Don't convert pointer to the data type
840 until we're actually going to treat it as that type.
843 * tree.c (build_aggr_init_expr): Split out...
844 (build_cplus_new): ...from here.
845 (stabilize_init): Don't mess with AGGR_INIT_EXPR either.
846 * init.c (build_new_1): new T() means value-initialization,
847 not default-initialization.
848 (build_vec_init): Likewise.
849 (build_value_init_1): Use build_aggr_init_expr.
851 2008-07-30 Dodji Seketeli <dseketel@redhat.com>
854 * decl2.c (fix_temporary_vars_context_r): New function.
855 (one_static_initialization_or_destruction): Make sure temporary
856 variables part of the initialiser have their DECL_CONTEXT()
859 2008-07-30 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
862 * typeck.c (build_binary_op): Encapsulate code into
865 2008-07-29 Jakub Jelinek <jakub@redhat.com>
868 * tree.c (cplus_array_hash, build_cplus_array_type_1): Hash on
869 TYPE_UID instead of pointers.
871 2008-07-29 Jan Hubicka <jh@suse.cz>
873 * optimize.c (maybe_clone_body): Remove DECL_INLINE.
874 * decl.c (duplicate_decls): Likewise.
875 (grokfndecl): Likewise.
876 (start_method): Likewise.
877 * method.c (make_thunk, make_alias_for, implicitly_declare_fn):
879 * pt.c (register_specialization, regenerate_decl_from_template):
881 * decl2.c (grokfield): Likewise.
883 2008-07-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
886 * decl.c (duplicate_decls): Merge USED flags.
888 2008-07-27 Jason Merrill <jason@redhat.com>
891 * decl.c (reshape_init_r): Allow C++0x initializer lists.
893 2008-07-28 Richard Guenther <rguenther@suse.de>
895 Merge from gimple-tuples-branch.
897 2008-07-22 Aldy Hernandez <aldyh@redhat.com>
899 * cp-gimplify.c (gimplify_if_stmt): Set location on newly created
902 2008-07-18 Jakub Jelinek <jakub@redhat.com>
904 * decl.c (finish_function): Call gimple_body after cp_genericize.
906 2008-07-18 Aldy Hernandez <aldyh@redhat.com>
908 * optimize.c: Include gimple.h instead of tree-gimple.h.
909 * Make-lang.in (cp-gimplify.o): Depend on tree-iterator.h.
910 * cp-gimplify.c: Rename tree-gimple.h to gimple.h. Include
913 2008-07-16 Jakub Jelinek <jakub@redhat.com>
915 * optimize.c (maybe_clone_body): Clear DECL_SAVED_TREE for the clone.
917 2008-07-14 Jakub Jelinek <jakub@redhat.com>
919 * cp-gimplify.c (cp_gimplify_expr): Update comment.
921 2008-07-14 Aldy Hernandez <aldyh@redhat.com>
923 * cp-tree.h (union lang_tree_node): Rename GENERIC_NEXT to
925 * cp-gimplify.c (cxx_omp_clause_apply_fn): Rename
926 GIMPLE_MODIFY_STMT to MODIFY_EXPR.
927 (cxx_omp_clause_copy_ctor): Same.
928 (cxx_omp_clause_assign_op): Same.
930 2008-05-28 Jakub Jelinek <jakub@redhat.com>
932 * cp-gimplify.c (cp_gimplify_omp_for): Add pre_p argument. Tuplify.
933 (cp_gimplify_expr): Adjust caller.
935 2008-05-11 Doug Kwan <dougkwan@google.com>
937 * init.c (build_vec_delete): Add type conversion for argument
938 0 of POINTER_PLUS_EXPR.
940 2008-04-29 Doug Kwan <dougkwan@google.com>
942 * decl2 (File): Include "gimple.h"
943 (cp_write_global_declarations): Use gimple_body instead of
945 * Make-lang.in (cp/decl2.o): Add $(GIMPLE_H)
947 2008-04-10 Diego Novillo <dnovillo@google.com>
949 http://gcc.gnu.org/ml/gcc-patches/2008-04/msg00913.html
951 * optimize.c (maybe_clone_body): Re-enable call to
953 * cp-gimplify.c (cp_gimplify_omp_for): Mark disabled
954 code with call to gimple_unreachable.
955 (cp_genericize): Fix handling of clone bodies.
957 2008-04-04 Diego Novillo <dnovillo@google.com>
959 http://gcc.gnu.org/ml/gcc-patches/2008-04/msg00413.html
961 * optimize.c (maybe_clone_body): Re-enable.
963 2008-02-19 Diego Novillo <dnovillo@google.com>
964 Oleg Ryjkov <olegr@google.com>
966 http://gcc.gnu.org/ml/gcc-patches/2008-02/msg00804.html
968 * cp-gimplify.c (gimplify_for_stmt): Change gimple_seq
969 argument to gimple_seq *. Update all users.
970 (gimplify_must_not_throw_expr): Likewise.
972 2008-02-04 Oleg Ryjkov <olegr@google.com>
974 * except.c: Include gimple.h
975 (cp_protect_cleanup_actions): Convert to tuples.
976 * Make-lang.in (cp/except.o): Add dependency on gimple.h
978 2007-11-10 Aldy Hernandez <aldyh@redhat.com>
980 * cp-gimplify.c (gimplify_cp_loop): Call tree_annotate_all_with_locus
981 instead of annotating each block manually.
983 2007-10-30 Aldy Hernandez <aldyh@redhat.com>
985 * cp-gimplify.c (gimplify_cp_loop): Tuplify.
986 (gimplify_for_stmt): Same.
987 (gimplify_switch_stmt): Same.
988 (cp_gimplify_expr): [FOR_STMT]: Do not call gimplify_for_stmt. Return
990 [WHILE_STMT]: Return GS_OK.
992 [CONTINUE_STMT]: Same.
994 (cp_genericize): Set gimple_body() of cloned functions when needed.
996 2007-10-29 Aldy Hernandez <aldy@quesejoda.com>
998 * cp-gimplify.c: Move build_gimple_eh_filter_tree here.
999 (cp_gimplify_init_expr): Convert to tuples.
1000 (gimplify_must_not_throw_expr): Make function return a
1001 gimplify_status and convert to tuples.
1003 2007-10-18 Aldy Hernandez <aldy@quesejoda.com>
1005 * cp-gimplify.c (genericize_try_block): Enable and do not call
1007 (genericize_catch_block): Same.
1008 (genericize_eh_spec_block): Same.
1009 Rename gimple_build_eh_filter_tree to build_gimple_eh_filter_tree.
1010 (cp_gimplify_expr): Enable TRY_BLOCK, HANDLER, and EH_SPEC_BLOCK.
1012 2007-10-16 Aldy Hernandez <aldy@quesejoda.com>
1014 * optimize.c (maybe_clone_body): Comment out call to clone_body.
1015 * decl.c (finish_function): Use gimple_body instead of
1017 * cp-tree.h (cp_gimplify_expr): Last 2 arguments are sequences.
1018 * cp-gimplify.c (genericize_try_block): Comment out.
1019 (genericize_catch_block): Same.
1020 (genericize_eh_spec_block): Same.
1021 (gimplify_cp_loop): Comment out calls to gimplify_stmt.
1022 (gimplify_for_stmt): Comment out.
1023 (gimplify_switch_stmt): Comment out call to gimplify_stmt.
1024 (cp_gimplify_omp_for): Same.
1025 (gimplify_must_not_throw_expr): Argument pre_p is a sequence.
1026 Comment out call to gimplify_stmt and append_to_statement_list.
1027 Rename gimple_build_eh_filter_tree to build_gimple_eh_filter_tree.
1028 (cp_gimplify_init_expr): Arguments pre_p and post_p are sequences.
1029 (cp_gimplify_expr): Same.
1030 Comment out calls to genericize_*_block. Comment out call to
1033 2008-07-27 H.J. Lu <hongjiu.lu@intel.com>
1036 * class.c (type_has_user_provided_default_constructor): Handle
1039 2008-07-27 Paolo Carlini <paolo.carlini@oracle.com>
1041 * decl.c (push_library_fn): Add a parameter for the exceptions that
1042 the function may throw.
1043 (push_void_library_fn, push_throw_library_fn, expand_static_init):
1045 (build_library_fn): Change to static.
1046 * cp-tree.h: Adjust declarations.
1047 * except.c (declare_nothrow_library_fn): New.
1048 (do_get_exception_ptr, do_begin_catch, do_free_exception,
1049 do_allocate_exception): Use the latter, adjust the declarations
1050 (ie, add empty exception-specification), consistently with the
1051 actual implementation in libsupc++.
1053 2008-07-25 Jan Hubicka <jh@suse.cz>
1055 * typeck.c (inline_conversion): Remove.
1056 (cp_build_function_call): Do not use inline_conversion.
1057 * decl.c (duplicate_decls): Do not insist on inline being declared
1059 (start_cleanup_fn): Do not assume that INLINE flags prevent function
1060 from being output. We now remove static functions always.
1061 (finish_function): Do return warning on all static functions.
1062 * call.c (build_over_call): Do not use inline_conversion.
1063 * cp-tree.h (possibly_inlined_p): Declare.
1064 (inline_conversion): Remove.
1065 * pt.c (instantiate_decl): Use possibly_inlined_p predicate.
1066 * decl2.c (cp_write_global_declarations): Likewise.
1067 (mark_used): Likewise.
1068 (possibly_inlined_p): New functions.
1070 2008-07-25 Jason Merrill <jason@redhat.com>
1072 * class.c (type_has_user_provided_default_constructor): Handle
1075 2008-07-23 Jan Hubicka <jh@suse.cz>
1077 * decl.c (duplicate_decls): Update comment and unit-at-a-time.
1078 (grogfndecl): Drop flag_inline_trees code.
1079 * pt.c (instantiate_decl): Drop flag_iline_trees code.
1080 * lex.c (cxx_init): Do not set unit-at-a-time.
1082 2008-07-23 Jason Merrill <jason@redhat.com>
1084 * mangle.c (write_unqualified_name): Avoid infinite recursion when
1085 trying to mangle a decl with no name.
1087 Implement defaulted/deleted functions as per N2346
1088 * cp-tree.h (struct lang_decl_flags): Add defaulted_p bitfield.
1089 (DECL_DELETED_FN): New macro.
1090 (DECL_DEFAULTED_FN): New macro.
1091 * class.c (user_provided_p): New fn.
1092 (defaultable_fn_p): New fn.
1093 (type_has_user_provided_constructor): New fn.
1094 (type_has_user_provided_default_constructor): New fn.
1095 (check_methods): A defaulted fn is still trivial.
1096 (check_bases_and_members): Likewise.
1097 * decl.c (grok_special_member_properties): Likewise.
1098 (duplicate_decls): Complain about redeclaring a function as deleted.
1099 (start_decl): initialized==2 means deleted.
1100 (cp_finish_decl): Handle deleted/defaulted semantics.
1101 * decl2.c (grokfield): Likewise.
1102 (mark_used): Check DECL_DEFAULTED_FN instead of DECL_ARTIFICIAL.
1103 Complain about using a deleted fn.
1104 * init.c (build_value_init_1): Use type_has_user_provided_constructor.
1105 (perform_member_init): Check for a user-provided default constructor
1106 even if TYPE_NEEDS_CONSTRUCTING.
1107 (build_new_1): Likewise.
1108 * call.c (build_over_call): Don't call mark_used twice.
1109 * method.c (implicitly_declare_fn): Set DECL_DEFAULTED_FN.
1110 * search.c (check_final_overrider): Check for deleted mismatch.
1111 * parser.c (cp_parser_init_declarator): Tell start_decl about =delete.
1112 (cp_parser_pure_specifier): Handle =default and =delete.
1114 * error.c (maybe_warn_cpp0x): Suggest -std=gnu++0x as well.
1116 2008-07-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1119 * typeck.c: All calls to pedwarn changed.
1120 * decl.c: All calls to pedwarn changed.
1121 * call.c: All calls to pedwarn changed.
1122 * error.c: All calls to pedwarn changed.
1123 * typeck2.c: All calls to pedwarn changed.
1124 * pt.c: All calls to pedwarn changed.
1125 * name-lookup.c: All calls to pedwarn changed.
1126 * parser.c: All calls to pedwarn changed.
1128 2008-07-21 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1130 * call.c: Fix comment typos.
1131 * class.c: Likewise.
1132 * cp-tree.h: Likewise.
1133 * cxx-pretty-print.c: Likewise.
1136 * name-lookup.c: Likewise.
1137 * operators.def: Likewise.
1138 * parser.c: Likewise.
1141 * typeck.c: Likewise.
1143 2008-07-21 Paolo Carlini <paolo.carlini@oracle.com>
1147 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Only check
1148 copy constructors and copy assignment operators proper.
1150 2008-07-21 Rafael Ávila de Espíndola <espindola@google.com>
1152 * parser.c (cp_token): Remove in_system_header.
1153 (eof_token): Remove in_system_header.
1154 (cp_lexer_get_preprocessor_token): Don't set in_system_header.
1155 (cp_lexer_set_source_position_from_token): Don't set in_system_header.
1156 (cp_parser_member_declaration): Use in_system_header_at.
1157 * pt.c (lookup_template_class): Don't set DECL_IN_SYSTEM_HEADER.
1158 (pop_tinst_level): Don't set in_system_header.
1159 (instantiate_class_template): Don't set in_system_header.
1160 (instantiate_decl): Don't set in_system_header.
1161 (instantiate_pending_templates): Don't set in_system_header.
1163 2008-07-21 Paolo Carlini <paolo.carlini@oracle.com>
1166 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Use
1167 TYPE_NOTHROW_P, not TREE_NOTHROW.
1168 (trait_expr_value): Likewise.
1170 2008-07-18 Dodji Seketeli <dseketel@redhat.com>
1173 * call.c (convert_like_real): Don't take the error code path
1174 when a rvalue or base conversion has the bad_p field set.
1176 2008-07-18 Kris Van Hees <kris.van.hees@oracle.com>
1178 * rtti.c (emit_support_tinfos): Add char16_type_node and
1180 * typeck2.c (digest_init): Support char16_t and char32_t.
1182 2008-07-18 Kavih R. Ghazi <ghazi@caip.rutgers.edu>
1184 * cvt.c (convert_to_void): Avoid C++ keywords.
1185 * decl.c (walk_namespaces_r, wrapup_globals_for_namespace):
1187 * friend.c (is_friend): Likewise.
1188 * init.c (perform_member_init): Likewise.
1189 * mangle.c (write_template_prefix, write_template_template_param):
1191 * name-lookup.c (do_namespace_alias, do_using_directive,
1192 parse_using_directive, ambiguous_decl, arg_assoc): Likewise.
1193 * parser.c (cp_parser_template_id, cp_parser_namespace_definition,
1194 cp_parser_objc_typename, cp_parser_objc_method_keyword_params):
1196 * pt.c (is_specialization_of_friend, lookup_template_class,
1197 push_tinst_level, instantiate_class_template,
1198 tsubst_copy_and_build): Likewise.
1199 * tree.c (add_stmt_to_compound): Likewise.
1200 * typeck.c (finish_class_member_access_expr): Likewise.
1202 2008-07-17 Julian Brown <julian@codesourcery.com>
1203 Mark Mitchell <mark@codesourcery.com>
1205 * decl2.c (determine_visibility): Allow target to override
1206 visibility of class data.
1208 2008-07-17 Paolo Carlini <paolo.carlini@oracle.com>
1211 * semantics.c (trait_expr_value): Update __has_trivial_destructor
1212 semantics to the current WP (N2691).
1214 2008-07-16 Dodji Seketeli <dseketel@redhat.com>
1217 * name-lookup.c (lookup_extern_c_fun_binding_in_all_ns): New function.
1218 (pushdecl_maybe_friend): Check if a redeclaration of extern C function
1219 complies with exception specification constraints.
1221 2008-07-14 Jason Merrill <jason@redhat.com>
1223 * lex.c (init_reswords): Always set D_OBJC.
1225 2008-07-11 Tom Tromey <tromey@redhat.com>
1226 Ian Lance Taylor <iant@google.com>
1228 * lex.c (struct resword, reswords): Don't define.
1229 (D_EXT, D_ASM, D_OBJC, D_CXX0X): Don't define.
1230 (init_reswords): Clarify mask code. Use c_common_reswords rather
1233 2008-07-11 Dodji Seketeli <dseketel@redhat.com>
1236 * decl.c (grokdeclarator): Warn about initializing variables
1237 of storage class 'extern' only after the type of the declarator
1238 has been properly computed.
1240 2008-07-11 Dodji Seketeli <dseketel@redhat.com>
1243 * cp-tree.h (struct cp_decl_specifier_seq): Add a location field. It
1244 carries the location of the primary type.
1245 * parser.c (cp_parser_check_type_definition): Update documentation.
1246 (cp_parser_check_for_definition_in_return_type,
1247 cp_parser_check_for_invalid_template_id,
1248 cp_parser_set_decl_spec_type,
1249 cp_parser_check_for_definition_in_return_type,
1250 cp_parser_diagnose_invalid_type_name,
1251 cp_parser_new_expression, cp_parser_explicit_instantiation,
1252 cp_parser_type_specifier, cp_parser_simple_type_specifier,
1253 cp_parser_omp_for_loop, cp_parser_pragma): Use location in error
1256 2008-07-11 Dodji Seketeli <dseketel@redhat.com>
1260 * semantic.c (qualified_name_lookup_error, finish_id_expression):
1261 Add a location_t parameter so that
1262 error message can have a more accurate location.
1263 * cp-tree.h: Updated prototype
1264 * pt.c (tsubst_qualified_id): Use location in error messages.
1265 * parser.c (cp_parser_postfix_expression,
1266 cp_parser_objc_statement, cp_parser_trait_expr,
1267 cp_parser_token_is_class_key,
1268 cp_parser_uncommitted_to_tentative_parse_p,
1269 cp_parser_check_for_invalid_template_id, cp_parser_is_string_literal,
1270 cp_parser_error, cp_parser_name_lookup_error,
1271 cp_parser_simulate_error, cp_parser_check_decl_spec,
1272 cp_parser_check_decl_spec, cp_parser_non_integral_constant_expression,
1273 cp_parser_diagnose_invalid_type_name,
1274 cp_parser_parse_and_diagnose_invalid_type_name,
1275 cp_parser_require_pragma_eol, cp_parser_make_typename_type,
1276 cp_parser_string_literal, cp_parser_primary_expression,
1277 cp_parser_primary_expression, cp_parser_unqualified_id,
1278 cp_parser_nested_name_specifier_opt, cp_parser_postfix_expression,
1279 cp_parser_postfix_dot_deref_expression, cp_parser_new_expression,
1280 cp_parser_direct_new_declarator, cp_parser_builtin_offsetof,
1281 cp_parser_label_for_labeled_statement, cp_parser_statement_seq_opt,
1282 cp_parser_jump_statement, cp_parser_block_declaration,
1283 cp_parser_simple_declaration, cp_parser_decl_specifier_seq,
1284 cp_parser_function_specifier_opt, cp_parser_decltype,
1285 cp_parser_mem_initializer_list, cp_parser_mem_initializer,
1286 cp_parser_mem_initializer_id, cp_parser_template_parameter,
1287 cp_parser_type_parameter, cp_parser_template_id,
1288 cp_parser_template_name, cp_parser_template_argument): Likewise.
1290 2008-07-09 Paolo Carlini <paolo.carlini@oracle.com>
1293 * pt.c (tsubst_function_type): Remove warning for type qualifiers
1294 on function return type.
1296 2008-07-09 Paolo Carlini <paolo.carlini@oracle.com>
1299 * pt.c (tsubst_function_type): Don't warn for type qualifiers
1300 on function return type in case of system header.
1302 2008-07-09 Raksit Ashok <raksit@google.com>
1304 * parser.c (cp_parser_postfix_expression): New warning based on flag
1305 warn_disallowed_functions.
1307 2008-07-08 Simon Martin <simartin@users.sourceforge.net>
1310 * decl.c (grokdeclarator): Reset storage_class and staticp for friend
1311 functions declared with a storage class qualifier.
1313 2008-07-03 Richard Guenther <rguenther@suse.de>
1316 * typeck.c (cp_build_function_call): Move code to verify
1317 builtin function arguments ...
1318 * call.c (build_cxx_call): ... here.
1320 2008-07-02 Jason Merrill <jason@redhat.com>
1322 * Make-lang.in (cp/typeck2.o): Add $(REAL_H) dependency.
1324 Implement WG21 N2672, Initializer List proposed wording
1325 * cp-tree.h (enum cp_tree_index): Add CPTI_INIT_LIST_TYPE.
1326 (struct lang_type_class): Add has_list_ctor bitfield.
1327 (TYPE_HAS_LIST_CTOR): New macro.
1328 (BRACE_ENCLOSED_INITIALIZER_P): Expect init_list_type_node.
1329 (CONSTRUCTOR_IS_DIRECT_INIT): New macro.
1330 (LOOKUP_NO_NARROWING): New macro.
1331 (LOOKUP_NO_COPY_CTOR_CONVERSION): New macro.
1332 * parser.c (cp_parse_braced_list): Split out from...
1333 (cp_parser_initializer_clause): ...here.
1334 (cp_parser_postfix_expression): Build up CONSTRUCTOR for compound
1336 (cp_lexer_next_token_is_not_keyword): New fn.
1337 (cp_parser_parenthesized_expression_list): Handle { }.
1338 (cp_parser_new_expression, cp_parser_new_initializer): Likewise.
1339 (cp_parser_assignment_expression, cp_parser_condition): Likewise.
1340 (cp_parser_jump_statement, cp_parser_simple_declaration): Likewise.
1341 (cp_parser_mem_initializer, cp_parser_init_declarator): Likewise.
1342 (cp_parser_initializer, cp_parser_functional_cast): Likewise.
1343 (cp_parser_omp_for_loop, cp_parser_cache_group): Likewise.
1344 (cp_parser_save_member_function_body): Likewise.
1345 * call.c (conversion_kind): Add ck_list, ck_aggr.
1346 (struct conversion): Add check_narrowing bitfield, conversion list.
1347 (build_list_conv): New fn.
1348 (build_aggr_conv): New fn.
1349 (implicit_conversion): Call them.
1350 (standard_conversion): Set check_narrowing if appropriate.
1351 (add_function_candidate): Handle LOOKUP_NO_COPY_CTOR_CONVERSION.
1352 (build_user_type_conversion_1): When converting from an init list,
1353 we allow additional conversions except when calling a copy ctor.
1354 (convert_like_real): Calling an explicit ctor for an init list is
1355 ill-formed. Handle ck_list and ck_addr. Check narrowing.
1356 (build_new_method_call): If CONSTRUCTOR_IS_DIRECT_INIT is set and
1357 class doesn't have a list ctor, break the {} into a TREE_LIST.
1358 (compare_ics): ck_list is better than other UDCs.
1359 (set_up_extended_ref_temp): Split out from initialize_reference.
1360 (is_std_init_list): New fn.
1361 (is_list_ctor): New fn.
1362 * decl.c (cxx_init_decl_processing): Create init_list_type_node.
1363 (reshape_init_array_1): Pass it to build_constructor.
1364 (reshape_init_class): Ditto.
1365 (initialize_artificial_var): Pass the appropriate type.
1366 (build_aggr_init_full_exprs): Split out from...
1367 (check_initializer): ...here. Handle new semantics.
1368 (build_init_list_var_init): New subroutine of check_initializer.
1369 (grokdeclarator): Converting constructors can have more than one parm.
1370 (grok_special_member_properties): Set TYPE_HAS_LIST_CTOR.
1371 * init.c (expand_default_init): Only do digest_init for aggregates.
1372 * rtti.c (tinfo_base_init): Pass init_list_type_node to
1373 build_constructor_from_list.
1374 (generic_initializer, ptr_initializer): Ditto.
1375 (ptm_initializer, class_initializer): Ditto.
1376 (get_pseudo_ti_init): Ditto.
1377 * error.c (dump_type): Handle init_list_type_node.
1378 (maybe_warn_cpp0x): New fn.
1379 (maybe_varn_variadic_templates): Call it.
1380 * cvt.c (ocp_convert): Handle conversion from { }.
1381 * tree.c (build_array_of_n_type): New fn.
1382 * typeck2.c (store_init_value): Use init_list_type_node.
1383 (digest_init): Likewise.
1384 (check_narrowing): New fn.
1385 * semantics.c: (finish_compound_literal): Take CONSTRUCTOR instead
1386 of vector of constructor elts. Handle non-aggregate types. Make
1387 constant literals static.
1388 * pt.c: (tsubst_copy_and_build): Adjust.
1389 (unify): Handle { }.
1390 * name-lookup.c (arg_assoc_type): Handle init_list_type_node.
1392 2008-07-01 Daniel Jacobowitz <dan@codesourcery.com>
1394 * typeck.c (comp_ptr_ttypes_real): Use vector_targets_convertible_p.
1395 (comp_ptr_ttypes_const): Likewise.
1397 2008-07-01 Andrew Haley <aph@redhat.com>
1399 * decl.c (finish_constructor_body): Don't set the return value of
1400 the constructor if the constructor is that of a Java type.
1402 2008-06-30 Jakub Jelinek <jakub@redhat.com>
1405 * decl2.c (is_late_template_attribute): If the first attribute
1406 argument is IDENTIFIER_NODE, don't consider it when checking
1407 if arguments are value or type dependent.
1409 2008-06-29 Paolo Carlini <paolo.carlini@oracle.com>
1412 * pt.c (do_type_instantiation): In c++0x mode do not warn for
1415 2008-06-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1417 * Make-lang.in (cp-warn): Delete $(CXX_COMPAT_WARN).
1419 2008-06-28 Jakub Jelinek <jakub@redhat.com>
1422 * repo.c (repo_emit_p): Put const static data members initialized
1423 by const expr into *.rpo file, just return 2 if IDENTIFIER_REPO_CHOSEN
1426 2008-06-27 Paolo Carlini <paolo.carlini@oracle.com>
1429 * pt.c (do_decl_instantiation): In c++0x mode do not warn for
1432 2008-06-24 Jonathan Wakely <jwakely.gcc@gmail.com>
1435 * typeck.c (cp_build_function_call): Show example syntax in
1438 2008-06-21 Jonathan Wakely <jwakely.gcc@gmail.com>
1440 * typeck.c (composite_pointer_type_r, cxx_sizeof_expr,
1441 cxx_alignof_expr, check_template_keyword, cp_build_binary_op,
1442 pointer_diff, cp_build_unary_op, build_x_compound_expr_from_list,
1443 build_reinterpret_cast_1, cp_build_c_cast, check_return_expr): Change
1444 pedwarn to permerror.
1445 * init.c (perform_member_init, build_new_1, build_new): Likewise.
1446 * decl.c (warn_extern_redeclared_static, duplicate_decls,
1447 * identify_goto, check_previous_goto_1, check_goto, define_label,
1448 check_tag_decl, start_decl, check_class_member_definition_namespace,
1449 grokfndecl, grokdeclarator): Likewise.
1450 * except.c (check_handlers): Likewise.
1451 * typeck2.c (digest_init): Likewise.
1452 * pt.c (check_specialization_namespace,
1453 check_explicit_instantiation_namespace,
1454 maybe_process_partial_specialization, check_explicit_specialization,
1455 convert_template_argument, do_decl_instantiation,
1456 do_type_instantiation, instantiate_decl): Likewise.
1457 * semantics.c (finish_template_type_parm): Likewise.
1458 * name-lookup.c (pushdecl_maybe_friend,
1459 check_for_out_of_scope_variable): Likewise.
1460 * decl2.c (finish_static_data_member_decl, build_anon_union_vars,
1461 coerce_new_type): Likewise.
1462 * parser.c (cp_parser_nested_name_specifier_opt,
1463 cp_parser_mem_initializer, cp_parser_elaborated_type_specifier,
1464 cp_parser_class_head, cp_parser_check_class_key): Likewise.
1465 (cp_parser_parameter_declaration): Check flag_permissive instead of
1466 flag_pedantic_errors.
1467 * call.c (joust): Change pedwarn to warning.
1468 * friend.c (make_friend_class): Likewise.
1470 2008-06-16 Jan Hubicka <jh@suse.cz>
1472 * method.c: Include cgraph.h.
1473 (use_thunk): Use cgraph_add_new_function instead of calling backend
1476 2008-06-15 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1478 * parser.c: Fix comment typo.
1480 2008-06-14 Simon Martin <simartin@users.sourceforge.net>
1483 * decl2.c (grokbitfield): Receive the list of attributes, pass it to
1484 grokdeclarator and apply it to the created declaration.
1485 * cp-tree.h (grokbitfield): Update prototype.
1486 * parser.c (cp_parser_member_declaration): Don't apply the attributes
1487 since they are now applied in grokbitfield. Adjusted the call to
1489 (cp_parser_objc_class_ivars): Likewise.
1491 2008-06-14 Simon Martin <simartin@users.sourceforge.net>
1494 * class.c (type_requires_array_cookie): Do not consider delete[]
1495 operators with an ellipsis as second argument.
1497 2008-06-09 Jakub Jelinek <jakub@redhat.com>
1500 * semantics.c (stmt_expr_value_expr): Don't crash on empty
1503 2008-06-08 Paolo Carlini <paolo.carlini@oracle.com>
1506 * pt.c (maybe_process_partial_specialization): Check the tree
1507 returned by push_template_decl for error_mark_node.
1508 * parser.c (cp_parser_class_head): Likewise, check the tree
1509 returned by the latter.
1511 2008-06-07 Paolo Carlini <paolo.carlini@oracle.com>
1514 * decl.c (grokdeclarator): In case of wrong return type return
1515 immediately error_mark_node.
1517 2008-06-06 Jakub Jelinek <jakub@redhat.com>
1519 * cp-tree.h (cxx_omp_finish_clause, cxx_omp_create_clause_info,
1520 dependent_omp_for_p, begin_omp_task, finish_omp_task,
1521 finish_omp_taskwait): New prototypes.
1522 (cxx_omp_clause_default_ctor): Add outer argument.
1523 (finish_omp_for): Add new clauses argument.
1524 * cp-gimplify.c (cxx_omp_finish_clause): New function.
1525 (cxx_omp_predetermined_sharing): Moved from semantics.c, rewritten.
1526 (cxx_omp_clause_default_ctor): Add outer argument.
1527 (cp_genericize_r): Walk OMP_CLAUSE_LASTPRIVATE_STMT.
1528 * cp-objcp-common.h (LANG_HOOKS_OMP_FINISH_CLAUSE): Define.
1529 * parser.c (cp_parser_omp_for_loop): Parse collapsed for loops.
1530 Add par_clauses argument. If decl is present in parallel's
1531 lastprivate clause, change that clause to shared and add
1532 a lastprivate clause for decl to OMP_FOR_CLAUSES.
1533 Fix wording of error messages. Adjust finish_omp_for caller.
1534 Add clauses argument. Parse loops with random access iterators.
1535 (cp_parser_omp_clause_collapse, cp_parser_omp_clause_untied): New
1537 (cp_parser_omp_for, cp_parser_omp_parallel): Adjust
1538 cp_parser_omp_for_loop callers.
1539 (cp_parser_omp_for_cond, cp_parser_omp_for_incr): New helper
1541 (cp_parser_omp_clause_name): Handle collapse and untied
1543 (cp_parser_omp_clause_schedule): Handle auto schedule.
1544 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_COLLAPSE
1545 and PRAGMA_OMP_CLAUSE_UNTIED.
1546 (OMP_FOR_CLAUSE_MASK): Add PRAGMA_OMP_CLAUSE_COLLAPSE.
1547 (OMP_TASK_CLAUSE_MASK): Define.
1548 (cp_parser_omp_task, cp_parser_omp_taskwait): New functions.
1549 (cp_parser_omp_construct): Handle PRAGMA_OMP_TASK.
1550 (cp_parser_pragma): Handle PRAGMA_OMP_TASK and
1551 PRAGMA_OMP_TASKWAIT.
1552 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_COLLAPSE and
1553 OMP_CLAUSE_UNTIED. Handle OMP_CLAUSE_LASTPRIVATE_STMT.
1554 (tsubst_omp_for_iterator): New function.
1555 (dependent_omp_for_p): New function.
1556 (tsubst_expr) <case OMP_FOR>: Use it. Handle collapsed OMP_FOR
1557 loops. Adjust finish_omp_for caller. Handle loops with random
1558 access iterators. Adjust for OMP_FOR_{INIT,COND,INCR} changes.
1559 (tsubst_expr): Handle OMP_TASK.
1560 * semantics.c (cxx_omp_create_clause_info): New function.
1561 (finish_omp_clauses): Call it. Handle OMP_CLAUSE_UNTIED and
1562 OMP_CLAUSE_COLLAPSE.
1563 (cxx_omp_predetermined_sharing): Removed.
1564 * semantics.c (finish_omp_for): Allow pointer iterators. Use
1565 handle_omp_for_class_iterator and dependent_omp_for_p. Handle
1566 collapsed for loops. Adjust c_finish_omp_for caller. Add new
1567 clauses argument. Fix check for type dependent cond or incr.
1568 Set OMP_FOR_CLAUSES to clauses. Use cp_convert instead of
1569 fold_convert to convert incr amount to difference_type. Only
1570 fold if not in template. If decl is mentioned in lastprivate
1571 clause, set OMP_CLAUSE_LASTPRIVATE_STMT. Handle loops with random
1572 access iterators. Adjust for OMP_FOR_{INIT,COND,INCR}
1574 (finish_omp_threadprivate): Allow static class members of the
1576 (handle_omp_for_class_iterator, begin_omp_task, finish_omp_task,
1577 finish_omp_taskwait): New functions.
1579 * parser.c (cp_parser_binary_expression): Add prec argument.
1580 (cp_parser_assignment_expression): Adjust caller.
1581 * cp-tree.h (outer_curly_brace_block): New prototype.
1582 * decl.c (outer_curly_brace_block): No longer static.
1584 2008-06-02 Paolo Carlini <paolo.carlini@oracle.com>
1587 * pt.c (push_template_decl_real): Consistently return error_mark_node
1590 2008-06-02 Tomas Bily <tbily@suse.cz>
1592 * typeck.c (is_bitfield_expr_with_lowered_type): Use CASE_CONVERT.
1593 (cp_build_unary_op): Likewise.
1594 (cp_build_indirect_ref): Use CONVERT_EXPR_P.
1595 (maybe_warn_about_returning_address_of_local): Likewise.
1597 2008-05-29 Paolo Carlini <paolo.carlini@oracle.com>
1600 * pt.c (tsubst_initializer_list): Consistently check the tree
1601 returned by tsubst_pack_expansion for error_mark_node.
1603 2008-05-27 Michael Matz <matz@suse.de>
1606 * call.c (build_new_op): Make warning conditional on
1609 2008-05-27 Alexandre Oliva <aoliva@redhat.com>
1612 * call.c (convert_like_real): Convert bitfield to desired type
1613 before creating temporary.
1615 2008-05-26 Daniel Franke <franke.daniel@gmail.com>
1617 * Makefile.in: Adjusted dependencies on c-incpath.o.
1619 2008-05-23 Jakub Jelinek <jakub@redhat.com>
1622 * cp-gimplify.c (cxx_omp_clause_apply_fn): Call
1623 fold_build_cleanup_point_expr on build_call_a results.
1626 * semantics.c (omp_clause_info_fndecl): New function.
1627 (finish_omp_clauses): Use it.
1629 2008-05-21 Jakub Jelinek <jakub@redhat.com>
1632 * cp-tree.h (check_array_initializer): New prototype.
1633 * decl.c (check_array_initializer): New function.
1634 (check_initializer): Call it.
1635 * semantics.c (finish_compound_literal): Call it for ARRAY_TYPEs.
1637 2008-05-21 Tom Tromey <tromey@redhat.com>
1639 * mangle.c (save_partially_mangled_name): Remove.
1640 (restore_partially_mangled_name): Likewise.
1641 (write_encoding): Update.
1642 (write_unqualified_name): Likewise.
1643 (start_mangling): Always use name_obstack. Remove 'ident_p'
1645 (get_identifier_nocopy): Remove.
1646 (finish_mangling_internal): Rename from finish_mangling.
1647 (finish_mangling): New function.
1648 (finish_mangling_get_identifier): Likewise.
1649 (partially_mangled_name, partially_mangled_name_len): Remove.
1650 (mangle_decl_string): Change return type. Update.
1651 (mangle_decl, mangle_type_string, mangle_special_for_type,
1652 mangle_ctor_vtbl_for_type, mangle_thunk, mangle_guard_variable,
1653 mangle_ref_init_variable): Update.
1655 2008-05-12 Paolo Carlini <paolo.carlini@oracle.com>
1658 * semantics.c (begin_class_definition): Extend checks on the first
1661 2008-05-12 Tomas Bily <tbily@suse.cz>
1663 * typeck2.c (digest_init): Use CONVERT_EXPR_P.
1664 * call.c (build_over_call): Likewise.
1665 * error.c (dump_expr): Use CASE_CONVERT.
1666 * class.c (fixed_type_or_null): Likewise.
1668 2008-05-11 Volker Reichelt <v.reichelt@netcologne.de>
1670 * parser.c (cp_parser_omp_clause_reduction): Add missing "expected"
1672 (cp_parser_omp_clause_schedule): Remove superfluous "expected"
1675 2008-05-07 Kenneth Zadeck <zadeck@naturalbridge.com>
1677 * decl.c (duplicate_decls): Merge in DECL_PURE_P, TREE_READONLY,
1678 DECL_LOOPING_CONST_OR_PURE_P attributes.
1679 * rtti.c (build_dynamic_cast_1): Rename DECL_IS_PURE to
1682 2008-05-02 Simon Baldwin <simonb@google.com>
1685 * typeck.c (build_array_ref): Remove warn_array_subscript_range.
1687 2008-05-01 Simon Baldwin <simonb@google.com>
1689 * typeck.c (build_array_ref): Call warn_array_subscript_range.
1691 2008-04-30 Jakub Jelinek <jakub@redhat.com>
1694 * pt.c (more_specialized_fn): Stop the loop even if there are no
1695 arguments before ellipsis.
1697 2008-04-29 Jakub Jelinek <jakub@redhat.com>
1700 * parser.c (cp_parser_lookup_name): Look through single function
1704 * typeck.c (cp_build_modify_expr) <case PREINCREMENT_EXPR>: Don't build
1705 COMPOUND_EXPR if the second argument would be error_mark_node.
1707 2008-04-28 Jason Merrill <jason@redhat.com>
1708 Liu Guanwei <liu_gw@163.com>
1711 * parser.c (cp_parser_parameter_declaration): Handle < ambiguity
1712 in default arguments.
1714 2008-04-25 Jan Hubicka <jh@suse.cz>
1716 * typeck.c (check_return_expr): Update.
1717 * decl.c (start_preparsed_function): Update.
1718 * method.c (use_thunk): Update.
1720 2008-04-24 Jakub Jelinek <jakub@redhat.com>
1723 * cp-tree.h (cp_reconstruct_complex_type): New prototype.
1724 * cp-objcp-common.h (LANG_HOOKS_RECONSTRUCT_COMPLEX_TYPE): Define.
1725 * decl2.c (is_late_template_attribute): Only make vector_size
1726 late tmpl attribute if argument is type or value dependent.
1727 (cp_reconstruct_complex_type): New function.
1729 2008-04-24 Richard Guenther <rguenther@suse.de>
1731 * typeck.c (cp_build_function_call): Call
1732 check_builtin_function_arguments.
1734 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
1736 * typeck.c (get_member_function_from_ptrfunc): Don't set TREE_INVARIANT.
1737 (build_ptrmemfunc1): Don't set TREE_INVARIANT.
1738 * init.c (build_zero_init): Don't set TREE_INVARIANT.
1739 * class.c (build_base_path): Don't set TREE_INVARIANT.
1740 (build_vtbl_ref_1): Don't set TREE_INVARIANT.
1741 (build_vtbl_initializer): Don't set TREE_INVARIANT.
1742 * decl.c (build_enumerator): Don't set TREE_INVARIANT.
1743 * rtti.c (tinfo_base_init): Don't set TREE_INVARIANT.
1744 (generic_initializer): Don't set TREE_INVARIANT.
1745 (ptr_initializer): Don't set TREE_INVARIANT.
1746 (ptm_initializer): Don't set TREE_INVARIANT.
1747 (class_initializer): Don't set TREE_INVARIANT.
1748 * typeck2.c (process_init_constructor): Don't set TREE_INVARIANT.
1749 * pt.c (push_inline_template_parms_recursive): Don't set TREE_INVARIANT.
1750 (build_template_parm_index): Don't set TREE_INVARIANT.
1751 (reduce_template_parm_level): Don't set TREE_INVARIANT.
1752 (process_template_parm): Don't set TREE_INVARIANT.
1754 2008-04-22 Jason Merrill <jason@redhat.com>
1757 * semantics.c (finish_decltype_type): Check DECL_BIT_FIELD_TYPE
1758 to see if DECL_BIT_FIELD_TYPE should be used, not some other flag.
1759 * typeck.c (is_bitfield_expr_with_lowered_type): Likewise.
1761 2008-04-22 Jakub Jelinek <jakub@redhat.com>
1764 * semantics.c (finish_stmt_expr): Call pop_stmt_list even if the stmt
1765 expression is errorneous.
1767 2008-04-21 Jason Merrill <jason@redhat.com>
1770 * tree.c (cp_tree_equal): Handle FIXED_CST.
1773 * pt.c (template_template_parm_bindings_ok_p): Set
1774 processing_template_decl while in this function.
1776 2008-04-18 Kris Van Hees <kris.van.hees@oracle.com>
1778 * cvt.c (type_promotes_to): Support char16_t and char32_t.
1779 * decl.c (grokdeclarator): Disallow signed/unsigned/short/long on
1780 char16_t and char32_t.
1781 * lex.c (reswords): Add char16_t and char32_t (for c++0x).
1782 * mangle.c (write_builtin_type): Mangle char16_t/char32_t as vendor
1783 extended builtin type "u8char{16,32}_t".
1784 * parser.c (cp_lexer_next_token_is_decl_specifier_keyword): Support
1786 (cp_lexer_print_token): Support CPP_STRING{16,32}.
1787 (cp_parser_is_string_literal): Idem.
1788 (cp_parser_string_literal): Idem.
1789 (cp_parser_primary_expression): Support CPP_CHAR{16,32} and
1791 (cp_parser_simple_type_specifier): Support RID_CHAR{16,32}.
1792 * tree.c (char_type_p): Support char16_t and char32_t as char types.
1793 * typeck.c (string_conv_p): Support char16_t and char32_t.
1795 2008-04-17 Jason Merrill <jason@redhat.com>
1798 * call.c (build_user_type_conversion_1): Represent second step of
1799 copy-init with an rvalue conversion.
1800 (convert_like_real) [ck_user]: Don't implicitly add it here.
1802 2008-04-15 Jakub Jelinek <jakub@redhat.com>
1805 * decl.c (layout_var_decl): If extern or static var has variable
1806 size, set TREE_TYPE (decl) to error_mark_node.
1808 2008-04-16 Danny Smith <dannysmith@users.sourceforge.net>
1811 * optimize.c (maybe_clone_body): Copy DECL_DLLIMPORT_P flag
1814 2008-04-09 Jason Merrill <jason@redhat.com>
1817 * semantics.c (finish_compound_literal): Return a TARGET_EXPR,
1818 not a pushed variable.
1820 2008-04-09 Volker Reichelt <v.reichelt@netcologne.de>
1822 * call.c (build_op_delete_call): Fix quotation in warning message.
1823 * decl.c (grokdeclarator): Quote keyword in error message.
1824 * pt.c (check_for_bare_parameter_packs): Fix quotation in error
1827 * parser.c (cp_parser_check_type_definition): Print error string
1828 directly rather than using "%s".
1829 (cp_parser_postfix_expression): Fix quotation.
1830 (cp_parser_decltype): Likewise.
1831 (cp_parser_sizeof_operand): Fix quotation. Simplify.
1833 * parser.c (cp_parser_non_integral_constant_expression): Build error
1834 message with CONCAT rather than using "%s".
1835 (cp_parser_primary_expression): Fix quotation.
1836 (cp_parser_postfix_expression): Likewise.
1837 (cp_parser_postfix_dot_deref_expression): Likewise.
1838 (cp_parser_unary_expression): Likewise.
1839 (cp_parser_new_expression): Likewise.
1840 (cp_parser_delete_expression): Likewise.
1842 * parser.c (cp_parser_asm_specification_opt): Print CPP_CLOSE_PAREN
1843 as `)', not as `('. Fix quotation.
1844 (cp_parser_consume_semicolon_at_end_of_statement): Fix quotation.
1845 (cp_parser_primary_expression): Likewise.
1846 (cp_parser_nested_name_specifier_opt): Likewise.
1847 (cp_parser_postfix_expression): Likewise.
1848 (cp_parser_postfix_open_square_expression): Likewise.
1849 (cp_parser_parenthesized_expression_list): Likewise.
1850 (cp_parser_pseudo_destructor_name): Likewise.
1851 (cp_parser_new_expression): Likewise.
1852 (cp_parser_direct_new_declarator): Likewise.
1853 (cp_parser_delete_expression): Likewise.
1854 (cp_parser_cast_expression): Likewise.
1855 (cp_parser_question_colon_clause): Likewise.
1856 (cp_parser_builtin_offsetof): Likewise.
1857 (cp_parser_trait_expr): Likewise.
1858 (cp_parser_label_for_labeled_statement): Likewise.
1859 (cp_parser_compound_statement): Likewise.
1860 (cp_parser_selection_statement): Likewise.
1861 (cp_parser_condition): Likewise.
1862 (cp_parser_iteration_statement): Likewise.
1863 (cp_parser_already_scoped_statement): Likewise.
1864 (cp_parser_simple_declaration): Likewise.
1865 (cp_parser_linkage_specification): Likewise.
1866 (cp_parser_static_assert): Likewise.
1867 (cp_parser_decltype): Likewise.
1868 (cp_parser_conversion_function_id): Likewise.
1869 (cp_parser_operator_function_id): Likewise.
1870 (cp_parser_operator): Likewise.
1871 (cp_parser_type_parameter): Likewise.
1872 (cp_parser_template_id): Likewise.
1873 (cp_parser_explicit_instantiation): Likewise.
1874 (cp_parser_explicit_specialization): Likewise.
1875 (cp_parser_enum_specifier): Likewise.
1876 (cp_parser_namespace_definition): Likewise.
1877 (cp_parser_namespace_alias_definition): Likewise.
1878 (cp_parser_using_declaration): Likewise.
1879 (cp_parser_using_directive): Likewise.
1880 (cp_parser_asm_definition): Likewise.
1881 (cp_parser_direct_declarator): Likewise.
1882 (cp_parser_ptr_operator): Likewise.
1883 (cp_parser_parameter_declaration_clause): Likewise.
1884 (cp_parser_initializer_clause): Likewise.
1885 (cp_parser_class_specifier): Likewise.
1886 (cp_parser_member_specification_opt): Likewise.
1887 (cp_parser_member_declaration): Likewise.
1888 (cp_parser_pure_specifier): Likewise.
1889 (cp_parser_constant_initializer): Likewise.
1890 (cp_parser_base_clause): Likewise.
1891 (cp_parser_exception_specification_opt): Likewise.
1892 (cp_parser_try_block): Likewise.
1893 (cp_parser_function_try_block): Likewise.
1894 (cp_parser_handler): Likewise.
1895 (cp_parser_throw_expression): Likewise.
1896 (cp_parser_asm_operand_list): Likewise.
1897 (cp_parser_attributes_opt): Likewise.
1898 (cp_parser_label_declaration): Likewise.
1899 (cp_parser_constructor_declarator_p): Likewise.
1900 (cp_parser_template_declaration_after_export): Likewise.
1901 (cp_parser_single_declaration): Likewise.
1902 (cp_parser_objc_message_expression): Likewise.
1903 (cp_parser_objc_message_args): Likewise.
1904 (cp_parser_objc_encode_expression): Likewise.
1905 (cp_parser_objc_defs_expression): Likewise.
1906 (cp_parser_objc_protocol_expression): Likewise.
1907 (cp_parser_objc_selector_expression): Likewise.
1908 (cp_parser_objc_protocol_refs_opt): Likewise.
1909 (cp_parser_objc_typename): Likewise.
1910 (cp_parser_objc_method_keyword_params): Likewise.
1911 (cp_parser_objc_superclass_or_category): Likewise.
1912 (cp_parser_objc_try_catch_finally_statement): Likewise.
1913 (cp_parser_objc_synchronized_statement): Likewise.
1914 (cp_parser_objc_throw_statement): Likewise.
1915 (cp_parser_omp_var_list_no_open): Likewise.
1916 (cp_parser_omp_clause_default): Likewise.
1917 (cp_parser_omp_clause_if): Likewise.
1918 (cp_parser_omp_clause_num_threads): Likewise.
1919 (cp_parser_omp_clause_reduction): Likewise.
1920 (cp_parser_omp_clause_schedule): Likewise.
1921 (cp_parser_omp_critical): Likewise.
1922 (cp_parser_omp_for_loop): Likewise.
1923 (cp_parser_omp_sections_scope): Likewise.
1925 * parser.c (cp_parser_template_parameter_list): Simplify.
1927 2008-04-07 James E. Wilson <wilson@tuliptree.org>
1929 * pt.c (tsubst_copy, case SIZEOF_EXPR): Initialize len.
1931 2008-04-07 Jason Merrill <jason@redhat.com>
1934 * class.c (type_has_user_nondefault_constructor): A template
1935 counts as a nondefault constructor.
1937 2008-04-04 Paolo Bonzini <bonzini@gnu.org>
1939 * decl.c (cxx_push_function_context): Delete.
1940 (cxx_pop_function_context): Delete.
1941 (start_preparsed_function): Merge cxx_push_function_context (!f->decl
1943 * cp-objcp-common.h (LANG_HOOKS_FUNCTION_INIT,
1944 LANG_HOOKS_FUNCTION_FINAL): Delete.
1945 (LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P): Rename to
1946 LANG_HOOKS_MISSING_NORETURN_OK_P.
1947 * cp-tree.h (cxx_push_function_context, cxx_pop_function_context):
1949 * semantics.c (current_stmt_tree): Fix comment.
1951 2008-04-03 Jakub Jelinek <jakub@redhat.com>
1954 * semantics.c (finish_offsetof): Undo effect of convert_from_reference
1955 before calling fold_offsetof.
1957 2008-04-03 Tom Tromey <tromey@redhat.com>
1959 * Make-lang.in (c++_OBJS): New variable.
1961 2008-04-03 Paolo Bonzini <bonzini@gnu.org>
1963 * optimize.c (clone_body): New, from tree-inline.c.
1965 2008-04-03 Paolo Bonzini <bonzini@gnu.org>
1967 * method.c (synthesize_method): Use {push,pop}_function_context.
1968 * name-lookup.c (push_to_top_level): Likewise.
1969 * parser.c (cp_parser_late_parsing_for_member): Likewise.
1971 2008-03-30 Volker Reichelt <v.reichelt@netcologne.de>
1974 * parser.c (cp_parser_decl_specifier_seq): Add location to error
1977 2008-03-27 Tom Tromey <tromey@redhat.com>
1979 * Make-lang.in: Revert automatic dependency patch.
1981 2008-03-27 Douglas Gregor <doug.gregor@gmail.com>
1984 * typeck.c (build_x_compound_expr): Use cp_build_compound_expr.
1985 (build_compound_expr): New, for compatibility with C
1986 build_compound_expr.
1987 (cp_build_compound_expr): Renamed from build_compound_expr.
1988 (build_c_cast): New, for compatibility with C build_c_cast.
1989 (cp_build_c_cast): Renamed from build_c_cast.
1990 * init.c (build_vec_delete_1): Fix calls to build_compound_expr.
1991 * decl.c (cxx_maybe_build_cleanup): Ditto.
1992 * cp-tree.h (build_compound_expr): Add C-compatibile prototype.
1993 (cp_build_compound_expr): Renamed from build_compound_expr.
1994 (build_c_cast): Add C-compatible prototype.
1995 (cp_build_c_cast): Renamed from build_c_cast.
1996 * typeck2.c (build_functional_cast): Use cp_build_c_cast.
1997 * parser.c (cp_parser_cast_expression): Fix call to build_c_cast.
1999 2008-03-27 Douglas Gregor <doug.gregor@gmail.com>
2001 * pt.c (tsubst_copy) <case SIZEOF_EXPR>: Cope with
2002 tsubst_pack_expansion returning a pack expansion, or a TREE_VEC
2003 ending in a pack expansion, both of which can occur when
2004 substituting into a nested template.
2005 (tsubst_copy_and_build) <case SIZEOF_EXPR>: When we're
2006 instantiating the sizeof...(X) form, make tsubst_copy do the work.
2007 * parser.c (cp_parser_template_parameter): Deal with unnamed
2008 non-type template parameter packs identified by pack expansions in
2011 2008-03-26 Jakub Jelinek <jakub@redhat.com>
2014 * pt.c (apply_late_template_attributes): Don't call tsubst on
2015 first attribute argument if it is IDENTIFIER_NODE.
2018 * error.c (dump_expr): Pass {,UN}ORDERED_EXPR, UN{LT,LE,GT,GE,EQ}_EXPR
2019 and LTGT_EXPR to pp_expression.
2021 2008-03-26 Douglas Gregor <doug.gregor@gmail.com>
2023 * pt.c (coerce_template_template_parm): Moved the body of the loop
2024 of coerce_template_template_parms here, to make iteration over a
2025 template argument pack simpler.
2026 Also, allow matching of a template parameter pack in the template
2027 template parameter to a template parameter in the template
2029 (coerce_template_template_parms): Deal with variadic template
2030 template parameters. Use coerce_template_template_parm.
2031 (unify): Make sure we coerce the template template argument's
2032 template arguments to the template template parameter's template
2033 parameters, not the other way around.
2035 2008-03-25 Tom Tromey <tromey@redhat.com>
2037 * Make-lang.in: Remove .o targets.
2038 (cp/g++spec.o): Moved to cp/. Reduce to variable setting.
2040 (c++_OBJS): New variable.
2041 (CXX_TREE_H, CXX_PRETTY_PRINT_H): Remove.
2043 2008-03-25 Douglas Gregor <doug.gregor@gmail.com>
2045 * typeck.c (composite_pointer_type_r): Add SFINAE support.
2046 (composite_pointer_type): Ditto.
2047 (common_type): Fix call to composite_pointer_type.
2048 (cxx_sizeof_nowarn): New; used to be a macro.
2049 (cxx_sizeof_expr): Add SFINAE support.
2050 (cxx_alignof_expr): Ditto.
2051 (decay_conversion): Fix calls for SFINAE support.
2052 (rationalize_conditional_expr): Add SFINAE support.
2053 (build_class_member_access_expr): Ditto.
2054 (finish_class_member_access_expr): Ditto.
2055 (build_x_indirect_ref): Ditto.
2056 (build_indirect_ref): Original version renamed to
2057 cp_build_indirect_ref; new version provides a bridge from
2059 (cp_build_indirect_ref): Was build_indirect_ref; added SFINAE
2061 (get_member_function_from_ptrfunc): Fix calls for SFINAE support.
2062 (build_function_call): Original version renamed to
2063 cp_build_function_call; new version provides a bridge from
2065 (cp_build_function_call): Was build_function_call; added SFINAE
2067 (convert_arguments): Add SFINAE support.
2068 (build_x_binary_op): Ditto.
2069 (build_binary_op): Original version renamed to cp_build_binary_op;
2070 new version provides a bridge from c-common.
2071 (cp_build_binary_op): Was build_binary_op; added SFINAE support.
2072 (pointer_diff): Fix calls for SFINAE.
2073 (build_x_unary_op): Add SFINAE support.
2074 (condition_conversion): Fix calls for SFINAE.
2075 (build_unary_op): Original version renamed to cp_build_unary_op;
2076 new version provides a bridge from c-common.
2077 (cp_build_unary_op): Was build_unary_op; added SFINAE support.
2078 (unary_complex_lvalue): Fix calls for SFINAE.
2079 (build_x_conditional_expr): Add SFINAE support.
2080 (build_x_compound_expr_from_list): Fix calls for SFINAE.
2081 (build_x_compound_expr): Add SFINAE support.
2082 (convert_ptrmem): Fix calls for SFINAE.
2083 (build_static_cast_1): Add SFINAE support.
2084 (build_static_cast): Ditto.
2085 (build_reinterpret_cast_1): Ditto.
2086 (build_reinterpret_cast): Ditto.
2087 (build_const_cast_1): Ditto.
2088 (build_const_cast): Ditto.
2089 (build_c_cast): Ditto.
2090 (build_modify_expr): Original version renamed to
2091 cp_build_modify_expr; new version provides a bridge from c-common.
2092 (cp_build_modify_expr): Was build_modify_expr; added SFINAE
2094 (build_x_modify_expr): Add SFINAE support.
2095 (build_ptrmemfunc): Fix calls for SFINAE.
2096 (convert_for_assignment): Add SFINAE support.
2097 (convert_for_initialization): Ditto.
2098 (check_return_expr): Fix calls for SFINAE.
2099 (lvalue_or_else): Add SFINAE support.
2100 * init.c (perform_member_init): Fix calls for SFINAE.
2101 (emit_mem_initializers): Ditto.
2102 (expand_virtual_init): Ditto.
2103 (expand_cleanup_for_base): Ditto.
2104 (build_aggr_init): Add SFINAE support.
2105 (expand_default_init): Ditto.
2106 (expand_aggr_init_1): Fix calls for SFINAE.
2107 (build_offset_ref): Ditto.
2108 (build_new_1): Add SFINAE support.
2110 (build_vec_delete_1): Fix calls for SFINAE.
2111 (get_temp_regvar): Ditto.
2112 (build_vec_init): Add SFINAE support.
2113 (build_dtor_call): Fix calls for SFINAE.
2114 (build_delete): Ditto.
2115 (push_base_cleanups): Ditto.
2116 (build_vec_delete_1): Ditto.
2117 * class.c (build_base_path): Fix calls for SFINAE.
2118 (build_simple_base_path): Ditto.
2119 (convert_to_base_statically): Ditto.
2120 (build_vfn_ref): Ditto.
2121 (resolve_address_of_overloaded_function): Ditto.
2122 * decl.c (check_initializer): Fix calls for SFINAE.
2123 (register_dtor_fn): Ditto.
2124 (compute_array_index_type): Ditto.
2125 (finish_enum): Ditto.
2126 (start_preparsed_function): Ditto.
2127 (cxx_maybe_build_cleanup): Ditto.
2128 * call.c (convert_like): Add COMPLAIN argument.
2129 (convert_like_with_context): Ditto.
2130 (build_this): Fix calls for SFINAE.
2131 (build_user_type_conversion): Ditto.
2132 (resolve_args): Ditto.
2133 (build_new_function_call): Add SFINAE support.
2134 (build_operator_new_call): Fix calls for SFINAE.
2135 (build_object_call): Add SFINAE support.
2136 (build_conditional_expr): Ditto.
2137 (build_new_op): Ditto.
2138 (build_op_delete_call): Fix calls for SFINAE.
2139 (build_temp): Ditto.
2140 (convert_like_real): Add SFINAE support.
2141 (build_x_va_arg): Fix calls for SFINAE.
2142 (convert_default_arg): Ditto.
2143 (build_over_call): Add SFINAE support.
2144 (build_java_interface_fn_ref): Fix calls for SFINAE.
2145 (build_special_member_call): Add SFINAE support.
2146 (build_new_method_call): Ditto.
2147 (perform_implicit_conversion): Ditto.
2148 (perform_direct_initialization_if_possible): Ditto.
2149 (initialize_reference): Fix calls for SFINAE.
2150 * method.c (do_build_assign_ref): Fix calls for SFINAE.
2151 * rtti.c (build_headof): Fix calls for SFINAE.
2152 (get_tinfo_decl_dynamic): Ditto.
2153 (get_typeid): Ditto.
2154 (build_dynamic_cast_1): Add SFINAE support.
2155 (build_dynamic_cast): Ditto.
2156 (tinfo_base_init): Fix calls for SFINAE.
2157 * except.c (do_get_exception_ptr): Fix calls for SFINAE.
2158 (do_end_catch): Ditto.
2159 (initialize_handler_parm): Ditto.
2160 (expand_start_catch_block): Ditto.
2161 (do_allocate_exception): Ditto.
2162 (do_free_exception): Ditto.
2163 (build_throw): Ditto.
2164 * cvt.c (build_up_reference): Fix calls for SFINAE.
2165 (convert_to_reference): Ditto.
2166 (ocp_convert): Ditto.
2167 (convert_to_void): Add SFINAE support.
2168 * tree.c (build_dummy_object): Fix calls for SFINAE.
2169 (stabilize_expr): Ditto.
2170 * cp-tree.h (build_conditional_expr): Add tsubst_flags_t
2172 (build_new_method_call): Ditto.
2173 (build_special_member_call): Ditto.
2174 (build_new_op): Ditto.
2175 (perform_implicit_conversion): Ditto.
2176 (perform_direct_initialization_if_possible): Ditto.
2177 (convert_to_void): Ditto.
2178 (build_aggr_init): Ditto.
2180 (build_vec_init): Ditto.
2181 (build_dynamic_cast): Ditto.
2182 (finish_call_expr): Ditto
2183 (cxx_sizeof_or_alignof_expr): Add COMPLAIN parameter.
2184 (cxx_sizeof_nowarn): Remove macro; add function declaration.
2185 (build_class_member_access_expr): Add tsubst_flags_t parameter.
2186 (finish_class_member_access_expr): Ditto.
2187 (build_x_indirect_ref): Ditto.
2188 (cp_build_indirect_ref): New.
2189 (cp_build_function_call): Add tsubst_flags_t parameter.
2190 (build_x_unary_op): Ditto.
2191 (cp_build_unary_op): New.
2192 (build_x_conditional_expr): Add tsubst_flags_t parameter.
2193 (build_x_compound_expr): Ditto.
2194 (build_compound_expr): Ditto.
2195 (build_static_cast): Ditto.
2196 (build_reinterpret_cast): Ditto.
2197 (build_const_cast): Ditto.
2198 (build_c_cast): Ditto.
2199 (build_x_modify_expr): Ditto.
2200 (cp_build_modify_expr): New.
2201 (convert_for_initialization): Add tsubst_flags_t parameter.
2202 (cp_build_binary_op): Remove macro; add function declaration.
2203 (invalid_nonstatic_memfn_p): Add tsubst_flags_t parameter.
2204 (lvalue_or_else): Ditto.
2205 (build_functional_cast): Ditto.
2206 * typeck2.c (digest_init): Fix calls for SFINAE.
2207 (process_init_constructor_array): Ditto.
2208 (process_init_constructor_record): Ditto.
2209 (build_x_arrow): Ditto.
2210 (build_m_component_ref): Ditto.
2211 (build_functional_cast): Add SFINAE support.
2212 * pt.c (tsubst_copy_and_build): Add (more) SFINAE support.
2213 * semantics.c (simplify_loop_decl_cond): Fix calls for SFINAE.
2214 (finish_expr_stmt): Ditto.
2215 (finish_for_expr): Ditto.
2216 (finish_asm_stmt): Ditto.
2217 (finish_non_static_data_member): Ditto.
2218 (finish_qualified_id_expr): Ditto.
2219 (finish_call_expr): Add SFINAE support.
2220 (finish_increment_expr): Fix calls for SFINAE.
2221 (finish_unary_op_expr): Ditto.
2222 (simplify_aggr_init_expr): Ditto.
2223 (finish_omp_clauses): Ditto.
2224 (finish_omp_for): Ditto.
2225 (finish_omp_barrier): Ditto.
2226 (finish_omo_flush): Ditto.
2227 * decl2.c (grok_array_decl): Fix calls or SFINAE.
2228 (build_anon_union_vars): Ditto.
2229 (get_guard_cond): Ditto.
2231 (one_static_initialization_or_destruction): Ditto.
2232 (do_static_initialization_or_destruction): Ditto.
2233 (generate_ctor_or_dtor_function): Ditto.
2234 (build_offset_ref_call_from_tree): Ditto.
2235 * parser.c (cp_parser_postfix_expression): Fix calls for SFINAE.
2236 (cp_parser_postfix_dot_deref_expression): Ditto.
2237 (cp_parser_unary_expression): Ditto.
2238 (cp_parser_new_expression): Ditto.
2239 (cp_parser_cast_expression): Ditto.
2240 (cp_parser_binary_expression): Ditto.
2241 (cp_parser_question_colon_clause): Ditto.
2242 (cp_parser_assignment_expression): Ditto.
2243 (cp_parser_expression): Ditto.
2244 (cp_parser_builtin_offsetof): Ditto.
2245 (cp_parser_template_argument): Ditto.
2246 (cp_parser_functional_cast): Ditto.
2248 2008-03-24 Tom Tromey <tromey@redhat.com>
2250 * lex.c (handle_pragma_interface): Don't copy the filename.
2251 (handle_pragma_implementation): Copy filename using xstrdup.
2253 2008-03-21 Paolo Carlini <pcarlini@suse.de>
2255 * cp-tree.h (IS_AGGR_TYPE): Rename to MAYBE_CLASS_TYPE_P.
2256 (SET_IS_AGGR_TYPE): Rename to SET_CLASS_TYPE_P.
2257 (IS_AGGR_TYPE_CODE): Rename to RECORD_OR_UNION_CODE_P.
2258 (PROMOTES_TO_AGGR_TYPE): Remove.
2259 (CLASS_TYPE_P, TYPE_NON_AGGREGATE_CLASS): Adjust.
2260 * typeck.c (unary_complex_lvalue, build_modify_expr,
2261 convert_for_initialization): Adjust.
2262 * init.c (is_aggr_type): Remove.
2263 (is_class_type): Add.
2264 (build_offset_ref, build_new_1, build_vec_delete_1, build_vec_init,
2265 build_delete): Adjust.
2266 * lex.c (make_aggr_type): Remove.
2267 (make_class_type): Add.
2268 (cxx_make_type): Adjust.
2269 * class.c (finish_struct_1, fixed_type_or_null, is_empty_class):
2271 * decl.c (build_typename_type, make_typename_type,
2272 make_unbound_class_template, cxx_init_decl_processing,
2273 check_tag_decl, groktypename, start_decl_1, layout_var_decl,
2274 check_initializer, cp_finish_decl, build_ptrmemfunc_type, grokparms,
2275 grok_op_properties, xref_tag, check_function_type): Adjust.
2276 * call.c (check_dtor_name, standard_conversion, implicit_conversion,
2277 add_builtin_candidate, add_builtin_candidates,
2278 build_user_type_conversion_1, convert_like_real, build_cxx_call,
2279 is_subseq, compare_ics): Adjust.
2280 * method.c (use_thunk): Adjust.
2281 * rtti.c (build_dynamic_cast_1, create_pseudo_type_info,
2282 create_tinfo_types): Adjust.
2283 * cvt.c (cp_convert_to_pointer, convert_to_pointer_force,
2284 build_up_reference, convert_to_reference, convert_from_reference,
2285 ocp_convert, build_expr_type_conversion): Adjust.
2286 * tree.c (bind_template_template_parm, error_type): Adjust.
2287 * dump.c (cp_dump_tree): Adjust.
2288 * search.c (lookup_member): Adjust.
2289 * friend.c (make_friend_class, do_friend): Adjust.
2290 * typeck2.c (store_init_value, process_init_constructor_array,
2291 process_init_constructor_record, build_x_arrow, build_m_component_ref,
2292 build_functional_cast): Adjust.
2293 * pt.c (finish_member_template_decl, process_template_parm,
2294 lookup_template_class, tsubst_function_type, tsubst,
2295 tsubst_copy_and_build, get_template_base, bt_instantiate_type_proc):
2297 * semantics.c (begin_class_definition, finish_base_specifier,
2298 finish_typeof, cxx_omp_predetermined_sharing, finish_decltype_type):
2300 * name-lookup.c (constructor_name_p, push_overloaded_decl,
2301 do_class_using_decl, lookup_qualified_name,
2302 maybe_process_template_type_declaration): Adjust.
2303 * decl2.c (grok_array_decl, check_member_template,
2304 constrain_class_visibility): Adjust.
2305 * parser.c (cp_parser_class_name): Adjust.
2307 2008-03-18 Paolo Bonzini <bonzini@gnu.org>
2309 * cp-lang.c (LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS): Delete.
2311 2008-03-17 Jason Merrill <jason@redhat.com>
2314 * call.c (reference_binding): Check LOOKUP_NO_TEMP_BIND when binding
2315 a temp directly to a reference as per DR391.
2317 2008-03-12 Richard Guenther <rguenther@suse.de>
2321 2008-02-04 Richard Guenther <rguenther@suse.de>
2324 * decl.c (record_builtin_java_type): Make jboolean a
2325 integer type again where its mode doesn't match that of bool.
2327 2008-01-25 Richard Guenther <rguenther@suse.de>
2330 * decl.c (record_builtin_java_type): Make __java_boolean
2332 * typeck.c (structural_comptypes): Move TYPE_FOR_JAVA check
2333 after TYPE_MAIN_VARIANT check.
2335 2008-03-10 Jakub Jelinek <jakub@redhat.com>
2338 * semantics.c (finish_omp_clauses): Look through NOP_EXPR even
2342 * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
2343 DECL_P in not a variable and appears more than once error messages.
2345 2008-03-07 Paolo Bonzini <bonzini@gnu.org>
2349 2008-02-06 Douglas Gregor <doug.gregor@gmail.com>
2353 * typeck.c (structural_comptypes): Call cp_comptypes.
2354 (comptypes): New; called from the C/C++ common bits to perform
2356 (cp_comptypes): Renamed from comptypes, which is already used,
2357 with a different signature, by the C++ front end.
2358 (build_reinterpret_cast_1): Call cp_comptypes.
2359 (ptr_reasonably_similar): Ditto.
2360 * decl.c (decls_match): Ditto.
2361 * cvt.c (convert_to_reference): Ditto.
2362 * cp-tree.h (same_type_p): Ditto.
2363 (same_or_base_type_p): Ditto.
2364 (comptypes): Rename to cp_comptypes.
2365 * pt.c (canonical_type_parameter): Call cp_comptypes.
2367 2008-03-07 Paolo Bonzini <bonzini@gnu.org>
2369 * cp-objcp-common.c (cxx_types_compatible_p): Remove obsolete
2370 test for equivalence between pointer and references.
2372 2008-03-02 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2375 * class.c (finish_struct_anon): Use permerror instead of pedwarn.
2376 (check_field_decls): Likewise.
2377 (note_name_declared_in_class): Likewise.
2378 * call.c (build_new_op): Likewise.
2379 (convert_like_real): Likewise.
2380 (build_over_call): Likewise.
2381 * lex.c (unqualified_fn_lookup_error): Likewise.
2382 * parser.c (cp_parser_template_id): Likewise.
2383 * cvt.c (warn_ref_binding): Likewise.
2384 (convert_to_reference): Likewise.
2385 (ocp_convert): Likewise.
2386 (convert_to_void): Use error instead of pedwarn.
2387 * error.c (cp_cpp_error): Use pedantic_warning_kind.
2388 * decl.c (compute_array_index_type): Use constant_expression_error.
2390 2008-03-01 Douglas Gregor <doug.gregor@gmail.com>
2392 * parser.c (cp_lexer_next_token_is_decl_specifier_keyword): Note
2393 that auto is either a storage class or a simple type specifier,
2394 depending on the dialect.
2395 (cp_parser_decl_specifier_seq): Complain about `auto' as a storage
2396 specifier in C++98 mode, error in C++0x mode (since we don't
2397 support auto as a type specifier, yet).
2398 (cp_parser_storage_class_specifier_opt): Don't treat `auto' as a
2399 storage specifier in C++0x mode.
2400 (cp_parser_simple_type_specifier): Parse `auto' as a
2401 simple-type-specifier, but error because we don't support it yet.
2403 2008-02-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2405 * parser.c (cp_parser_nonclass_name): New.
2406 (cp_parser_pseudo_destructor_name): Use it instead of
2407 cp_parser_type_name.
2408 (cp_parser_type_name): Move code to cp_parser_nonclass_name.
2410 2008-02-29 Tom Tromey <tromey@redhat.com>
2412 * parser.c (struct cp_token) <input_file_stack_index>: Remove.
2413 (cp_lexer_get_preprocessor_token): Update.
2414 (cp_lexer_set_source_position_from_token): Don't call
2415 restore_input_file_stack.
2416 * lex.c (cxx_init): Don't use push_srcloc or pop_srcloc.
2418 2008-02-28 Richard Guenther <rguenther@suse.de>
2421 2008-02-26 Richard Guenther <rguenther@suse.de>
2423 * decl.c (duplicate_decls): Remove decl from global mapping
2424 before ggc_freeing it.
2426 2008-02-27 Jakub Jelinek <jakub@redhat.com>
2429 * rtti.c: Include c-pragma.h.
2430 (push_abi_namespace, pop_abi_namespace): New functions.
2431 (build_dynamic_cast_1, tinfo_base_init, get_pseudo_ti_index,
2432 create_tinfo_types, emit_support_tinfos): Use them.
2433 * Make-lang.in (cp/rtti.o): Depend on $(C_PRAGMA_H).
2435 2008-02-26 Jason Merrill <jason@redhat.com>
2438 * decl.c (grokdeclarator): Allow a typedef of an unnamed struct
2439 to name the struct for linkage purposes even if it has attributes.
2440 (start_decl): In that case, set ATTR_FLAG_TYPE_IN_PLACE.
2442 2008-02-26 Tom Tromey <tromey@redhat.com>
2444 * parser.c (eof_token): Remove old location code.
2445 (check_empty_body): Remove test of USE_MAPPED_LOCATION.
2446 * decl2.c (generate_ctor_or_dtor_function): Remove old location
2448 (cp_write_global_declarations): Likewise.
2449 * lex.c (cxx_init): Remove old location code.
2450 (handle_pragma_implementation): Remove test of
2451 USE_MAPPED_LOCATION.
2452 * pt.c (tsubst): Remove old location code.
2453 * error.c (cp_print_error_function): Remove test of
2454 USE_MAPPED_LOCATION.
2455 * decl.c (pop_label): Remove old location code.
2456 (finish_function): Likewise.
2458 2008-02-26 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2461 * call.c (magic_varargs_p): Remove BUILT_IN_STDARG_START.
2463 2008-02-26 Richard Guenther <rguenther@suse.de>
2465 * decl.c (duplicate_decls): Remove decl from global mapping
2466 before ggc_freeing it.
2468 2008-02-26 Paolo Carlini <pcarlini@suse.de>
2471 * name-lookup.c (arg_assoc_type): Handle FIXED_POINT_TYPE.
2473 2008-02-26 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2475 * typeck.c (build_class_member_access_expr): Add appropriate
2476 OPT_W* parameter to warning.
2477 (build_reinterpret_cast_1): Likewise.
2478 * name-lookup.c (push_overloaded_decl): Likewise.
2480 2008-02-25 Paolo Carlini <pcarlini@suse.de>
2483 * error.c (dump_expr): Handle CONJ_EXPR.
2485 2008-02-25 Paolo Carlini <pcarlini@suse.de>
2488 * error.c (dump_type): Handle FIXED_POINT_TYPE.
2489 (dump_expr): Handle FIXED_CST.
2491 2008-02-24 Jason Merrill <jason@redhat.com>
2493 * parser.c (cp_parser_declaration): Handle "inline namespace".
2494 (cp_parser_namespace_definition): Likewise.
2497 * name-lookup.c (arg_assoc_namespace): Look down into inline
2500 2008-02-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2502 * typeck.c (check_for_casting_away_constness): Use 1 single
2503 argument, the type of cast, to decide what diagnostics generate.
2504 (build_static_cast_1): Remove unused code. Update call to
2505 check_for_casting_away_constness.
2506 (build_reinterpret_cast_1): Update call to
2507 check_for_casting_away_constness.
2508 (build_const_cast_1): Likewise.
2510 2008-02-24 Paolo Carlini <pcarlini@suse.de>
2512 * error.c (dump_expr): Don't deal directly with NEW_EXPR (and
2513 VEC_NEW_EXPR), forward to pp_expression.
2514 * cxx-pretty-print.c (pp_cxx_new_expression): Fix FIXME.
2516 2008-02-24 Danny Smith <dannysmith@users.sourceforge.net>
2519 * friend.c (do_friend): Call cplus_decl_attributes earlier.
2521 2008-02-22 Andrew Pinski <andrew_pinski@playstation.sony.com>
2524 * decl.c (duplicate_decls): Merge DECL_DISREGARD_INLINE_LIMITS for
2525 template decls' function decl.
2527 2008-02-22 Paolo Carlini <pcarlini@suse.de>
2531 2008-02-14 Paolo Carlini <pcarlini@suse.de>
2534 * pt.c (determine_specialization): In case of function templates,
2535 when the type of DECL does not match FN there is no match.
2537 2008-02-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2540 * typeck.c (build_binary_op): Warn about floating point
2541 comparisons if FLOAT_TYPE_P, not only for REAL_TYPE.
2543 2008-02-19 Jason Merrill <jason@redhat.com>
2546 * pt.c (resolve_overloaded_unification): Set processing_template_decl
2547 while we look for possible bindings.
2549 2008-02-19 Jakub Jelinek <jakub@redhat.com>
2552 * cp-gimplify.c (cxx_omp_clause_apply_fn): Handle vararg copy ctors.
2556 * semantics.c (finish_omp_threadprivate): Do nothing for error_operand_p
2557 vars. Afterwards ensure v is VAR_DECL.
2560 * parser.c (cp_parser_omp_for_loop): If DECL has REFERENCE_TYPE, don't
2561 call cp_finish_decl.
2562 * semantics.c (finish_omp_for): Fail if DECL doesn't have integral type
2565 2008-02-15 Douglas Gregor <doug.gregor@gmail.com>
2570 * pt.c (finish_member_template_decl): If the type in a TYPE_DECL
2571 is error_mark_node, return an error early.
2572 (find_parameter_packs_r): Pass the pointer set along to recursive
2573 calls of cp_walk_subtrees; don't try to manage the pointer set
2575 (uses_parameter_packs): Pass the pointer set to cp_walk_tree.
2576 (make_pack_expansion): Ditto.
2577 (check_for_bare_parameter_packs): Ditto. Also, don't bother taking
2578 a second pass through the tree with find_parameter_packs_r; that
2579 second pass no longer does anything.
2580 (push_template_decl_real): If we have an erroneous declaration,
2581 set its type to error_mark_node before returning an error.
2583 2008-02-14 Douglas Gregor <doug.gregor@gmail.com>
2586 * pt.c (tsubst_initializer_list): Deal with the use of
2587 VOID_TYPE_NODE to indicate value-initialization of the bases.
2589 2008-02-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2590 Jason Merrill <jason@redhat.com>
2594 * class.c (type_has_user_nondefault_constructor): New fn.
2595 * cp-tree.h: Declare it.
2596 * init.c (emit_mem_initializers): Use it for -W warning about
2597 missing base initializer.
2599 2008-02-14 Paolo Carlini <pcarlini@suse.de>
2602 * pt.c (determine_specialization): In case of function templates,
2603 when the type of DECL does not match FN there is no match.
2605 2008-02-13 Jakub Jelinek <jakub@redhat.com>
2606 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2609 * parser.c (cp_parser_pseudo_destructor_name): If next tokens
2610 are not identifier :: ~, return before calling cp_parser_type_name.
2612 2008-02-13 Jason Merrill <jason@redhat.com>
2614 PR c++/34962, c++/34937, c++/34939
2615 * decl2.c (is_late_template_attribute): Always defer attributes
2616 vector_size and weak.
2619 * pt.c (value_dependent_expression_p): Look into DECL_INITIAL
2620 of enumerators, too.
2622 2008-02-12 Jason Merrill <jason@redhat.com>
2625 * call.c (convert_like_real): Pass LOOKUP_NO_CONVERSION to build_temp
2626 if we're doing conversions to call a user-defined conversion function.
2628 2008-02-12 Steven Bosscher <steven@gcc.gnu.org>
2631 * semantics.c (finish_qualified_id_expr): Avoid duplicate access
2634 2008-02-12 Jakub Jelinek <jakub@redhat.com>
2637 * init.c (build_new_1): Don't create placement_expr before
2638 constructing alloc_call. Verify that the pointer is passed by
2639 value to operator new.
2641 2008-02-11 Jason Merrill <jason@redhat.com>
2644 * pt.c (tsubst): Don't look up a template typedef in an explicit
2647 2008-02-11 Douglas Gregor <doug.gregor@gmail.com>
2650 * tree.c (cp_build_qualified_type_real): When building a
2651 cv-qualified array type, build it as a unique type with
2652 build_cplus_array_type_1 and then adopt the unqualified type's
2655 2008-02-11 Paolo Carlini <pcarlini@suse.de>
2658 * decl.c (groktypename): Check grokdeclarator return.
2660 2008-02-10 Jason Merrill <jason@redhat.com>
2663 * decl2.c (cp_write_global_declarations): Don't write out static
2664 data members with DECL_IN_AGGR_P set.
2666 2008-02-08 Jason Merrill <jason@redhat.com>
2669 * tree.c (build_target_expr_with_type): Handle void initializer.
2670 (bot_manip): Remap slot before recursing.
2672 2008-02-06 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2675 * Make-lang.in (cc1plus-dummy, cc1plus): Add $(GMPLIBS).
2677 2008-02-06 Alexandre Oliva <aoliva@redhat.com>
2680 * tree.c: Include tree-flow.h.
2681 (build_target_expr): Check type compatibility.
2682 * Make-lang.in (cp/tree.o): Depend on $(TREE_FLOW_H).
2683 * call.c (convert_like_real): Convert bitfield to expected type.
2685 2008-02-06 Douglas Gregor <doug.gregor@gmail.com>
2689 * typeck.c (structural_comptypes): Call cp_comptypes.
2690 (comptypes): New; called from the C/C++ common bits to perform
2692 (cp_comptypes): Renamed from comptypes, which is already used,
2693 with a different signature, by the C++ front end.
2694 (build_reinterpret_cast_1): Call cp_comptypes.
2695 (ptr_reasonably_similar): Ditto.
2696 * decl.c (decls_match): Ditto.
2697 * cvt.c (convert_to_reference): Ditto.
2698 * cp-tree.h (same_type_p): Ditto.
2699 (same_or_base_type_p): Ditto.
2700 (comptypes): Rename to cp_comptypes.
2701 * pt.c (canonical_type_parameter): Call cp_comptypes.
2703 2008-02-05 Jakub Jelinek <jakub@redhat.com>
2706 * pt.c (tsubst) <case INTEGER_TYPE>: Don't issue error if max is
2707 value dependent expression.
2709 2008-02-05 Douglas Gregor <doug.gregor@gmail.com>
2712 * decl2.c (save_template_attributes): When we're modifying the
2713 TYPE_MAIN_VARIANT to add new attributes, be sure to also modify
2714 all of the other variants to add those same attributes. Otherwise,
2715 the main variant will be inconsistent with those other variants.
2717 2008-02-04 Richard Guenther <rguenther@suse.de>
2720 * decl.c (record_builtin_java_type): Make jboolean a
2721 integer type again where its mode doesn't match that of bool.
2723 2008-02-02 Jason Merrill <jason@redhat.com>
2724 Mark Mitchell <mark@codesourcery.com>
2727 * init.c (build_value_init_1): New function.
2728 (build_value_init): New function.
2729 * typeck2.c (build_functional_cast): Call it.
2730 * cp-gimplify.c (cp_gimplify_init_expr): Handle its output.
2732 * cp-tree.h (TYPE_HAS_USER_CONSTRUCTOR): Rename from
2733 TYPE_HAS_CONSTRUCTOR.
2734 * class.c (finish_struct_bits, maybe_warn_about_overly_private_class,
2735 add_implicitly_declared_members): Adjust.
2736 (check_field_decls): Adjust. Remove warnings about reference/const
2737 in class without constructor.
2738 (check_bases_and_members): Adjust. Give those warnings here instead.
2739 * decl.c (fixup_anonymous_aggr): Adjust.
2740 (check_initializer): Adjust, clarify logic slightly.
2741 (grok_special_member_properties): Adjust, only set if user-provided.
2742 * rtti.c (create_tinfo_types): Don't set.
2743 * cvt.c (ocp_convert): Remove exception for vtable_entry_type et al.
2744 Use same_type_ignoring_top_level_qualifiers_p.
2745 * pt.c (check_explicit_specialization): Adjust.
2746 (instantiate_class_template): Adjust.
2748 2008-01-31 Douglas Gregor <doug.gregor@gmail.com>
2749 Jakub Jelinek <jakub@redhat.com>
2753 * typeck.c (structural_comptypes): Handle comparisons of
2754 VOID_TYPE, BOOLEAN_TYPE, INTEGER_TYPE, FIXED_POINT_TYPE, and
2756 * mangle.c (write_builtin_type): Map down to the canonical type,
2757 which will be one of the predefined type nodes.
2759 2008-01-29 Michael Meissner <michael.meissner@amd.com>
2762 * cp-tree.h (struct full_lang_decl): Make tree_code bitfield 16
2763 bits to allow for expansion of the number of middle end tree
2766 2008-01-29 Douglas Gregor <doug.gregor@gmail.com>
2777 * typeck.c (check_return_expr): Tweak call to
2778 check_for_bare_parameter_packs.
2779 * class.c (add_method): Be careful with error_mark_nodes.
2780 * cp-tree.h (check_for_bare_parameter_packs): Remove "*" from
2782 * pt.c (struct find_parameter_pack_data): Remove
2784 (find_parameter_packs_r): Don't use SET_PACKS_TO_ERROR.
2785 (uses_parameter_packs): Don't set SET_PACKS_TO_ERROR.
2786 (make_pack_expansion): Ditto.
2787 (check_for_bare_parameter_packs): Parameter is now a tree, not a
2789 (process_template_parm): Tweak call to
2790 check_for_bare_parameter_packs.
2791 (push_template_decl_real): Tweak calls to
2792 check_for_bare_parameter_packs. If bare parameter packs are found
2793 in the list of exceptions, clear out that list after giving an
2795 * semantics.c (finish_cond): Tweak call to
2796 check_for_bare_parameter_packs.
2797 (finish_expr_stmt): Ditto.
2798 (finish_for_expr): Ditto.
2799 (finish_switch_cond): Ditto.
2800 (finish_mem_initializers): Ditto.
2801 (finish_member_declaration): Ditto.
2802 (finish_static_assert): Check for bare parameter packs in the
2804 * decl2.c (cplus_decl_attributes): Check for bare parameter packs in the
2805 attributes of a declaration.
2806 * parser.c (cp_parser_using_declaration): Tweak call to
2807 check_for_bare_parameter_packs.
2808 (cp_parser_base_clause): Ditto.
2810 2008-01-28 Jason Merrill <jason@redhat.com>
2813 * class.c (build_base_path): Fix !want_pointer case.
2815 2008-01-27 Jason Merrill <jason@redhat.com>
2818 * class.c (build_base_path): Fix previous change.
2820 2008-01-26 Jakub Jelinek <jakub@redhat.com>
2823 * error.c (dump_expr): Handle TRUTH_AND_EXPR, TRUTH_OR_EXPR
2826 2008-01-26 Richard Guenther <rguenther@suse.de>
2829 * typeck.c (build_binary_op): Remove code to shorten compares.
2831 2008-01-25 Richard Guenther <rguenther@suse.de>
2834 * decl.c (record_builtin_java_type): Make __java_boolean
2836 * typeck.c (structural_comptypes): Move TYPE_FOR_JAVA check
2837 after TYPE_MAIN_VARIANT check.
2839 2008-01-25 Jason Merrill <jason@redhat.com>
2842 * class.c (build_base_path): Don't mess with virtual access if
2844 * call.c (standard_conversion): Don't check whether source type
2847 * decl2.c (is_late_template_attribute): Don't defer attribute
2848 visibility just because the type is dependent.
2850 2008-01-25 Jason Merrill <jason@redhat.com>
2851 Mark Mitchell <mark@codesourcery.com>
2854 * call.c (standard_conversion): Allow conversion from integer/real
2856 (compare_ics): Such a conversion is worse than a normal arithmetic
2859 2008-01-25 Richard Guenther <rguenther@suse.de>
2862 * cp-lang.c (LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS): Define
2865 2008-01-24 Paolo Carlini <pcarlini@suse.de>
2868 * pt.c (push_template_decl_real): Return error_mark_node in case
2869 of template definition of non-template.
2871 2008-01-24 Jason Merrill <jason@redhat.com>
2874 * decl2.c (is_late_template_attribute): Defer any attribute with
2875 dependent args. Also defer type attributes if the type is dependent.
2877 2008-01-22 Jakub Jelinek <jakub@redhat.com>
2878 Alexandre Oliva <aoliva@redhat.com>
2881 * call.c (reference_binding): For bitfields use the declared bitfield
2883 (add_builtin_candidates): Likewise.
2884 * class.c (layout_class_type): For bitfields copy over the
2885 original type quals.
2887 2008-01-22 Jason Merrill <jason@redhat.com>
2890 * decl.c (groktypename): Also ignore attributes on dependent
2891 possibly-class types.
2894 * friend.c (do_friend): Check for prior declaration of a friend
2895 function of a local class.
2896 * name-lookup.c (lookup_name_innermost_nonclass_level):
2898 * name-lookup.h: Declare it.
2900 2008-01-22 Tom Tromey <tromey@redhat.com>
2903 * init.c (build_new_1): Only disallow Java aggregates.
2905 2008-01-22 Jakub Jelinek <jakub@redhat.com>
2908 * semantics.c (finish_omp_for): Don't call c_finish_omp_for
2909 if decl or init is error_mark_node.
2912 * error.c (dump_expr): Handle VECTOR_CST.
2914 2008-01-21 Jason Merrill <jason@redhat.com>
2917 * pt.c (tsubst_aggr_type): Make sure our context is complete.
2920 * pt.c (retrieve_local_specialization): Robustify.
2921 (tsubst_pack_expansion, tsubst_decl): Remove redundant checks.
2924 * pt.c (tsubst): Only call retrieve_local_specialization if the
2925 original typedef was in a function template.
2928 * decl.c (wrap_cleanups_r): Set TRY_CATCH_IS_CLEANUP.
2930 2008-01-21 Richard Guenther <rguenther@suse.de>
2933 * error.c (cp_print_error_function): Deal with recursive
2936 2008-01-20 Paolo Carlini <pcarlini@suse.de>
2939 * error.c (dump_expr): Deal with VIEW_CONVERT_EXPR.
2941 2008-01-20 Paolo Carlini <pcarlini@suse.de>
2945 * name-lookup.c (do_class_using_decl): Do not call constructor_name_p
2946 on non-IS_AGGR_TYPE scope.
2947 (constructor_name_p): Assert IS_AGGR_TYPE.
2949 2008-01-18 Ian Lance Taylor <iant@google.com>
2952 * decl.c (duplicate_decls): Copy DECL_IS_OPERATOR_NEW flag.
2953 (grok_op_properties): For NEW_EXPR and VEC_NEW_EXPR set
2954 DECL_IS_OPERATOR_NEW flag.
2956 2008-01-16 Richard Guenther <rguenther@suse.de>
2959 * typeck.c (is_bitfield_expr_with_lowered_type): Recurse
2960 for conversions to type variants.
2962 2008-01-15 Andreas Tobler <a.tobler@schweiz.org>
2964 * parser.c (cp_parser_template_parameter): Fix C90 issue with mixing
2965 declaration and code. Update copyright year.
2967 2008-01-15 Douglas Gregor <doug.gregor@gmail.com>
2970 * friend.c (do_friend): Don't query TYPE_BEING_DEFINED unless we
2971 know we have a class type.
2973 2008-01-15 Douglas Gregor <doug.gregor@gmail.com>
2976 * pt.c (coerce_template_parameter_pack): When substituting into
2977 the type of a non-type template parameter pack. use the
2978 deduced/substituted arguments.
2979 * parser.c (declarator_can_be_parameter_pack): A pointer-to-member
2980 can be a parameter pack with the ellipsis following it. When we
2981 have an erroneous declaration, allow it to be a parameter pack.
2982 (cp_parser_template_parameter): Complain about default
2983 arguments on non-type template parameter packs, and parse them
2984 using the new cp_parser_default_argument.
2985 (cp_parser_parameter_declaration): Complain about parameter packs
2986 with default arguments. Move parsing of default arguments into a
2987 new function, cp_parser_default_argument.
2988 (cp_parser_default_argument): New; extracted from
2989 cp_parser_parameter_declaration.
2991 2008-01-15 Douglas Gregor <doug.gregor@gmail.com>
2997 * typeck.c (check_return_expr): If there are bare parameter packs
2998 in the return value, set it to error_mark_node.
2999 * tree.c (cp_walk_subtrees): Walk USING_DECL nodes.
3000 * pt.c (find_parameter_packs_r): Look at the type of
3001 IDENTIFIER_NODEs (e.g., for user-defined conversions).
3002 (check_for_bare_parameter_packs): Flip the result: now returns
3003 TRUE when there were bare parameter packs, FALSE otherwise.
3004 (push_template_decl_real): Deal with flipped result of
3005 check_for_bare_parameter_packs.
3006 * semantics.c (finish_cond): If there are bare parameter packs in
3007 the conditional, set it to error_mark_node.
3008 (finish_expr_stmt): If there are bare parameter packs in the
3009 expression, set it to error_mark_node.
3010 (finish_for_expr): Ditto.
3011 (finish_switch_cond): If there are bare parameter packs in
3012 the conditional, set it to error_mark_node.
3013 (finish_mem_initializers): If there are bare parameter packs in
3014 the member initializer, set it to error_mark_node.
3015 (finish_member_declaration): Check the attributes of the
3016 declaration for bare parameter packs, and remove the attributes if
3017 any have bare parameter packs.
3018 * parser.c (cp_parser_using_declaration): Check the using
3019 declaration for bare parameter packs.
3020 (cp_parser_base_clause): If there are bare parameter packs in a
3021 base specifier, don't add it to the chain.
3023 2008-01-15 Douglas Gregor <doug.gregor@gmail.com>
3026 * error.c (dump_simple_decl): Display ellipsis for template
3027 non-type parameter packs.
3028 (dump_decl): Display ellipsis for template type parameter packs.
3029 (dump_template_decl): Display ellipsis for template template
3031 * pt.c (redeclare_class_template): When redeclaring a class
3032 template, check for collisions between template parameters and
3033 template parameter packs.
3035 2008-01-15 Douglas Gregor <doug.gregor@gmail.com>
3038 * pt.c (process_partial_specialization): Don't mark template
3039 parameters that occur in non-deduced contexts.
3040 (struct pair_fn_data): Add include_nondeduced_p.
3041 (for_each_template_parm_r): Only visit non-deduced contexts if
3042 include_nondeduced_p is set.
3043 (for_each_template_parm): Added parameter include_nondeduced_p,
3044 which states whether template parameters found in non-deduced
3045 contexts should be visited.
3046 (uses_template_parms): Visit all template parameters, even those
3047 in non-deduced contexts.
3049 2008-01-15 Douglas Gregor <doug.gregor@gmail.com>
3052 * pt.c (check_default_tmpl_args): Check for parameter packs that
3053 aren't at the end of a primary template.
3054 (push_template_decl_real): Remove check for parameter packs that
3055 aren't at the end of a primary template; that now happens in
3056 check_default_tmpl_args.
3057 * semantics.c (finish_template_template_parm): Use
3058 check_default_tmpl_args to check for errors in the template
3061 2008-01-12 Doug Kwan <dougkwan@google.com>
3063 * decl.c: (grokdeclarator): Use OPT_Wignored_qualifiers
3064 instead of OPT_Wreturn_type in warning due to ignored return type
3066 * pt.c: (tsubst_function_type): Use OPT_Wignored_qualifiers
3067 instead of OPT_Wreturn_type in warning due to ignored return type
3070 2008-01-08 Jakub Jelinek <jakub@redhat.com>
3073 * semantics.c (finish_omp_for): Don't call
3074 fold_build_cleanup_point_expr if processing_template_decl.
3076 2008-01-04 Paolo Carlini <pcarlini@suse.de>
3077 Jakub Jelinek <jakub@redhat.com>
3080 * error.c (dump_template_argument): Deal with TREE_LIST.
3082 2008-01-01 Douglas Gregor <doug.gregor@gmail.com>
3084 * parser.c (cp_parser_check_decl_spec): Don't warn about "long
3085 long" in C++0x mode; change the warning to note that "long long"
3086 is only unsupported in C++98 mode.
3088 2007-12-20 Jason Merrill <jason@redhat.com>
3091 * call.c (standard_conversion): Derived-to-base is considered a
3092 standard conversion.
3094 2007-12-19 Jakub Jelinek <jakub@redhat.com>
3097 * parser.c (cp_parser_omp_parallel): For non-combined parallel
3098 call cp_parser_statement rather than
3099 cp_parser_already_scoped_statement.
3101 2007-12-18 Jason Merrill <jason@redhat.com>
3104 * pt.c (tsubst_aggr_type): Do nothing if the type already doesn't
3106 (dependent_type_p_r): Handle the domain of an array.
3108 2007-12-18 Douglas Gregor <doug.gregor@gmail.com>
3109 Jakub Jelinek <jakub@redhat.com>
3114 * pt.c (template_template_parm_bindings_ok_p): New; verifies
3115 bindings of template template parameters after all template
3116 arguments have been deduced.
3117 (coerce_template_parms): Don't complain when COMPLAIN doesn't
3119 (fn_type_unification): Use template_template_parm_bindings_ok_p.
3120 (unify): Deal with variadic, bound template template parameters.
3121 (get_class_bindings): Use template_template_parm_bindings_ok_p.
3123 2007-12-18 Jakub Jelinek <jakub@redhat.com>
3126 * decl.c (grokdeclarator): Reject friend sfk_constructor
3129 2007-12-17 Jakub Jelinek <jakub@redhat.com>
3132 * parser.c (cp_parser_omp_all_clauses): Accept optional comma
3135 2007-12-15 Alexandre Oliva <aoliva@redhat.com>
3138 * cp-lang.c (cp_classify_record): New.
3139 (LANG_HOOKS_CLASSIFY_RECORD): Override.
3141 2007-12-11 Jakub Jelinek <jakub@redhat.com>
3144 * decl2.c (cp_write_global_declarations): Revert 2007-11-22 change.
3147 * rtti.c (build_dynamic_cast): Call convert_from_reference even for
3148 dynamic_cast in a template.
3150 2007-12-10 Simon Martin <simartin@users.sourceforge.net>
3153 * typeck.c (build_class_member_access_expr): Compute MEMBER_SCOPE from
3154 MEMBER's BASELINK_ACCESS_BINFO instead of its BASELINK_BINFO.
3156 2007-12-10 Jakub Jelinek <jakub@redhat.com>
3159 * error.c (dump_type_prefix, dump_type_suffix): Handle
3160 TYPE_PACK_EXPANSION.
3163 * error.c (dump_expr): Handle ABS_EXPR.
3165 2007-12-09 Jakub Jelinek <jakub@redhat.com>
3169 * repo.c (repo_emit_p): Return 2 for DECL_INTEGRAL_CONSTANT_VAR_P
3170 in class scope rather than DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
3171 Return 2 also if DECL_EXPLICIT_INSTANTIATION.
3172 * decl2.c (import_export_decl): Don't make VAR_DECLs import_p when
3173 flag_use_repository and repo_emit_p returned 2.
3175 2007-12-06 Jakub Jelinek <jakub@redhat.com>
3178 * tree.c (stabilize_call, stabilize_init): Do nothing if
3179 processing_template_decl.
3181 2007-12-05 Jakub Jelinek <jakub@redhat.com>
3184 * semantics.c (finish_decltype_type): For SCOPE_REF issue an
3185 error instead of assertion failure.
3186 * parser.c (cp_parser_decltype): If closing paren is not found,
3187 return error_mark_node.
3189 2007-12-04 Douglas Gregor <doug.gregor@gmail.com>
3192 * name-lookup.c (arg_assoc_template_arg): Recurse on argument
3194 (arg_assoc_type): We don't need to handle TYPE_ARGUMENT_PACK here,
3195 since arg_assoc_template_arg will deal with them (better).
3197 2007-12-04 Douglas Gregor <doug.gregor@gmail.com>
3200 * pt.c (tsubst_exception_specification): Handle substitutions into
3201 member templates, where tsubst_pack_expansion returns a
3202 TYPE_PACK_EXPANSION.
3204 2007-12-04 Douglas Gregor <doug.gregor@gmail.com>
3207 * pt.c (unify_pack_expansion): If we didn't deduce any actual
3208 bindings for the template parameter pack, don't try to keep the
3209 empty deduced arguments.
3210 (unify): If a parameter is a template-id whose template argument
3211 list contains a pack expansion that is not at the end, then we
3212 cannot unify against that template-id.
3214 2007-12-02 Paolo Carlini <pcarlini@suse.de>
3217 * pt.c (current_template_args): Use error_operand_p.
3219 2007-12-02 Paolo Carlini <pcarlini@suse.de>
3222 * error.c (dump_decl): Handle TREE_BINFO.
3224 2007-12-01 Ollie Wild <aaw@google.com>
3227 * typeck.c (build_binary_op): Add conversion of pointers to function
3228 members appearing as operands to the equality operators.
3230 2007-11-30 Jakub Jelinek <jakub@redhat.com>
3233 * error.c (dump_expr): Handle OBJ_TYPE_REF.
3235 2007-11-29 Jakub Jelinek <jakub@redhat.com>
3238 * tree.c (lvalue_p_1) <case COND_EXPR>: Handle x ?: y
3240 * typeck.c (is_bitfield_expr_with_lowered_type) <case COND_EXPR>:
3245 * parser.c (cp_parser_decltype): Don't call finish_id_expression
3247 * semantics.c (finish_decltype_type): Issue error on types, TYPE_DECLs
3250 2007-11-27 Jakub Jelinek <jakub@redhat.com>
3252 PR tree-optimization/34181
3253 * method.c (use_thunk): Don't inline the call in the thunk.
3256 * tree.c (decl_linkage): Static data members and static member
3257 functions in anonymous ns classes are lk_external.
3259 2007-11-26 Andreas Krebbel <krebbel1@de.ibm.com>
3262 * decl.c (start_preparsed_function): Pass
3263 processing_template_decl for the new allocate_struct_function
3266 2007-11-25 Richard Guenther <rguenther@suse.de>
3268 * decl.c (poplevel): Use BLOCK_CHAIN.
3270 2007-11-24 Ollie Wild <aaw@google.com>
3272 * typeck.c (delta_from_ptrmemfunc): New function.
3273 (get_member_function_from_ptrfunc): Call delta_from_ptrmemfunc.
3274 (build_binary_op): Call delta_from_ptrmemfunc.
3276 2007-11-23 Jakub Jelinek <jakub@redhat.com>
3280 * decl.c (cp_finish_decl): Disallow variable or field
3281 definitions if extern "Java" aggregates.
3282 (grokparms): Disallow parameters with extern "Java"
3284 (check_function_type): Disallow function return values
3285 with extern "Java" aggregates.
3286 * init.c (build_new_1): Disallow placement new with
3287 extern "Java" aggregates.
3289 2007-11-23 Mark Mitchell <mark@codesourcery.com>
3290 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
3293 * call.c (convert_like_real): Build a zero constant when __null is
3294 converted to an integer type.
3296 2007-11-22 Jakub Jelinek <jakub@redhat.com>
3299 * decl2.c (cp_write_global_declarations): Issue error about static
3300 data members in anonymous namespace which are declared and used,
3303 2007-11-20 Jakub Jelinek <jakub@redhat.com>
3306 * parser.c (cp_parser_class_head): Reject function template ids.
3309 * tree.c (build_cplus_array_type_1): Don't pass any VLA types
3310 when processing_template_decl to build_array_type.
3313 * pt.c (more_specialized_fn): Don't segfault if one or
3314 both argument list end with ellipsis.
3316 2007-11-18 Jakub Jelinek <jakub@redhat.com>
3319 * semantics.c (finish_call_expr): Set
3320 current_function_returns_abnormally if fn is noreturn FUNCTION_DECL
3321 or OVERLOAD with all noreturn functions.
3323 2007-11-16 Jakub Jelinek <jakub@redhat.com>
3326 * pt.c (apply_late_template_attributes): Do nothing if decl's type is
3329 2007-11-13 Jakub Jelinek <jakub@redhat.com>
3336 * pt.c (find_parameter_packs_r): If ppd->set_packs_to_error,
3337 set to error_mark_node the outermost POINTER_TYPE to the pack if
3338 it is seen in a POINTER_TYPE.
3339 (push_template_decl_real): If check_for_bare_parameter_packs
3340 fails for function return type, set the return type to
3341 integer_type_node. If check_for_bare_parameter_packs failed
3342 for non-function, return error_mark_node.
3345 * call.c (build_new_op): Call resolve_args before calling
3348 2007-11-11 Tom Tromey <tromey@redhat.com>
3351 * lex.c (handle_pragma_implementation): Use cpp_included_before.
3353 2007-11-12 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
3356 * pt.c (redeclare_class_template): Update error message. Use a
3357 note to show the previous declaration.
3358 (tsubst_friend_class): Use the location of the friend template as
3359 the input location before calling redeclare_class_template.
3361 2007-11-11 Jakub Jelinek <jakub@redhat.com>
3364 * semantics.c (finish_pseudo_destructor_expr): Handle
3365 object == error_mark_node.
3367 2007-11-10 Jakub Jelinek <jakub@redhat.com>
3370 * pt.c (tsubst_copy_and_build) <case COMPONENT_REF>: If object_type
3371 is not scalar type, let finish_class_member_access_expr handle
3372 diagnostics. Pass BIT_NOT_EXPR argument to
3373 finish_pseudo_destructor_expr. Handle SCOPE_REF properly.
3375 2007-11-09 Douglas Gregor <doug.gregor@gmail.com>
3378 * decl.c (cp_complete_array_type): If any of the initializer
3379 elements are pack expansions, don't compute the array size yet.
3381 2007-11-08 Andrew Pinski <pinskia@gmail.com>
3384 * tree.c (decl_linkage): Fields have no linkage.
3386 2007-11-08 Daniel Jacobowitz <dan@codesourcery.com>
3388 * class.c (build_ctor_vtbl_group): Lay out the new type and decl.
3390 2007-11-07 Douglas Gregor <doug.gregor@gmail.com>
3395 * semantics.c (finish_decltype_type): See through INDIRECT_REFs.
3396 Be careful with ERROR_MARK_NODEs.
3397 * parser.c (cp_parser_check_access_in_redeclaration): Handle NULL
3400 2007-11-07 Jakub Jelinek <jakub@redhat.com>
3403 * call.c (build_over_call): Don't check TREE_ADDRESSABLE
3406 2007-11-06 Douglas Gregor <doug.gregor@gmail.com>
3410 * tree.c (c_build_qualified_type): Define bridge to
3411 cp_build_qualified_type.
3413 2007-11-06 Douglas Gregor <doug.gregor@gmail.com>
3424 * typeck.c (check_return_expr): Pass address of retval to
3425 check_for_bare_parameter_packs.
3426 * class.c (build_base_field): Tolerate bases that have no layout
3428 (end_of_base): Ditto.
3429 * tree.c (canonical_type_variant): Be careful with
3431 * cp-tree.h (check_for_bare_parameter_packs): Now accepts a
3433 * pt.c (find_parameter_pack_data): Add set_packs_to_error field,
3434 which states whether parameter packs should be replaced with
3436 (find_parameter_packs_r): Pass addresses to cp_walk_tree wherever
3437 possible. If set_packs_to_error is set true, replace the parameter
3438 pack with ERROR_MARK_NODE. Manage our own pointer sets.
3439 (uses_parameter_packs): Don't set parameter packs to
3441 (check_for_bare_parameter_packs): Now takes a pointer to a tree,
3442 which may be modified (if it is a parameter pack). Instructs
3443 find_parameter_packs_r to replace parameter packs with
3444 ERROR_MARK_NODE (so that they won't cause errors later on).
3445 (process_template_parm): Pass pointer to
3446 check_for_bare_parameter_packs.
3447 (process_partial_specialization): Replace pack expansions before
3448 the end of the template argument list with ERROR_MARK_NODE.
3449 (push_template_decl_real): Pass pointer to
3450 check_for_bare_parameter_packs. Replace parameter packs not at the
3451 end of the template parameter list with ERROR_MARK_NODE.
3452 (convert_template_argument): Be more careful about using DECL_NAME
3453 on only declarations.
3454 (unify): Can't unify against ERROR_MARK_NODE.
3455 * semantics.c (finish_cond): Pass pointer to
3456 check_for_bare_parameter_packs.
3457 (finish_expr_stmt): Ditto.
3458 (finish_for_expr): Ditto.
3459 (finish_switch_cond): Pass pointer to
3460 check_for_bare_parameter_packs, and call it before we put the
3461 condition into the statement.
3462 (finish_mem_initializers): Pass pointer to
3463 check_for_bare_parameter_packs.
3464 (finish_member_declaration): Ditto.
3465 * parser.c (cp_parser_base_clause): Ditto.
3467 2007-11-06 Jakub Jelinek <jakub@redhat.com>
3470 * decl.c (cp_finish_decl): Call make_rtl_for_nonlocal_decl already
3471 with the final TREE_READONLY flag in place. processing_template_decl
3472 is known to be 0 in this part of function.
3475 * cp-tree.h: Update comment - TYPE_LANG_FLAG_0 is not
3476 OMP_ATOMIC_DEPENDENT_P in OMP_ATOMIC.
3477 * pt.c (tsubst_expr): Assert OMP_ATOMIC_DEPENDENT_P.
3478 * semantics.c (finish_omp_atomic): Revert most of the
3479 2007-02-05 changes, just keep the new representation of
3480 OMP_ATOMIC_DEPENDENT_P OMP_ATOMIC.
3482 2007-11-05 H.J. Lu <hongjiu.lu@intel.com>
3485 * decl2.c (constrain_visibility): Clear DECL_ONE_ONLY if marked
3488 2007-11-05 Douglas Gregor <doug.gregor@gmail.com>
3493 * typeck.c (merge_types): Don't lose rvalue references when
3495 * call.c (build_over_call): Don't elide move constructors just
3496 because the copy constructor is trivial (!).
3497 (compare_ics): If comparing cv-qualifiers fails, we can still order
3498 based on binding lvalues vs. rvalues.
3500 2007-11-05 Douglas Gregor <doug.gregor@gmail.com>
3503 * pt.c (unify_pack_expansion): bring handling of function call
3504 arguments into line with type_unification_real.
3506 2007-11-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
3508 * typeck.c (build_binary_op): Use pedwarn instead of error for
3511 2007-11-05 Jakub Jelinek <jakub@redhat.com>
3514 * parser.c (cp_parser_unary_expression): For &&label call
3515 cp_parser_non_integral_constant_expression and return error_mark_node
3516 if it returned true.
3519 * decl.c (grokdeclarator): Don't call build_memfn_type if type
3520 is neither FUNCTION_TYPE nor METHOD_TYPE.
3522 2007-11-02 Jakub Jelinek <jakub@redhat.com>
3525 * parser.c (cp_parser_nested_name_specifier_opt): Use
3526 TYPE_MAIN_VARIANT (new_scope) as scope if new_scope is an incomplete
3527 typedef of currently open class.
3529 2007-11-02 Paolo Carlini <pcarlini@suse.de>
3532 * error.c (dump_expr): Deal specially with statements.
3534 2007-11-01 Jason Merrill <jason@redhat.com>
3537 * pt.c (push_template_decl_real): Set DECL_CONTEXT on template
3539 (lookup_template_class): Use it to get the outer template args
3540 for instantiating one.
3543 * pt.c (reduce_template_parm_level): tsubst the parameters
3544 of a template template parm.
3546 2007-11-01 Douglas Gregor <doug.gregor@gmail.com>
3549 * pt.c (find_parameter_packs_r): Handle TYPENAME_TYPE.
3551 2007-11-01 Jakub Jelinek <jakub@redhat.com>
3554 * parser.c (cp_parser_postfix_dot_deref_expression): If
3555 POSTFIX_EXPRESSION is type dependent, try to parse it as pseudo dtor
3556 first and if that succeeds and type is SCALAR_TYPE_P, create
3560 * rtti.c (enum_tinfo_kind): Fix TK_TYPE_INFO_TYPE comment.
3561 (typeid_ok_p): Use the same alias set for abi::__type_info_pseudo
3562 as for std::type_info.
3564 2007-10-31 Paolo Carlini <pcarlini@suse.de>
3567 * cxx-pretty-print.c (pp_cxx_typeid_expression,
3568 pp_cxx_delete_expression): Change to static linkage.
3569 * cxx-pretty-print.h: Adjust declarations.
3570 * error.c (dump_expr, case EXPR_PACK_EXPANSION, TYPEID_EXPR,
3571 MEMBER_REF, DOTSTAR_EXPR, DELETE_EXPR, VEC_DELETE_EXPR,
3572 MODOP_EXPR): Forward to pp_expression.
3574 * cxx-pretty-print.c (pp_cxx_expression, case NON_DEPENDENT_EXPR):
3577 2007-10-31 Christian Bruel <christian.bruel@st.com>
3578 Mark Mitchell <mark@codesourcery.com>
3581 * typeck.c (check_return_expr): Don't set named_return_value_okay_p
3582 if retval is volatile.
3584 2007-10-30 Jakub Jelinek <jakub@redhat.com>
3587 * decl2.c (build_offset_ref_call_from_tree): Call
3588 build_non_dependent_expr on object prior to building ADDR_EXPR from it
3589 if FN is DOTSTAR_EXPR.
3591 2007-10-30 Douglas Gregor <doug.gregor@gmail.com>
3595 * pt.c (find_parameter_packs_r): Fix typo in comment.
3596 (convert_template_argument): Look at the pattern of a pack
3597 expansion to determine what kind of entity we're converting.
3598 (coerce_template_parameter_pack): When we have coerced a non-type
3599 template parameter pack, substitute into the type of that pack.
3600 (tsubst_pack_expansion): When our substitution of a parameter pack
3601 is a "trivial" substitution of itself, just substitute into the
3602 pack expansion rather than actually expanding.
3604 2007-10-29 Jakub Jelinek <jakub@redhat.com>
3607 * class.c (check_bitfield_decl): Don't set field's type to error_mark_node
3608 for non-integral type bitfields. Return true if bitfield is correct, false
3609 error has been diagnosed.
3610 (check_field_decls): If check_bitfield_decl returned false, call also
3613 2007-10-28 Paolo Carlini <pcarlini@suse.de>
3614 Mark Mitchell <mark@codesourcery.com>
3617 * pt.c (do_decl_instantiation): If the VAR_DECL is not a
3618 class member error out and return.
3620 2007-10-27 Jakub Jelinek <jakub@redhat.com>
3622 * error.c (reinit_cxx_pp): Initialize cxx_pp->enclosing_scope
3623 to current_function_decl rather than 0.
3626 * cxx-pretty-print.c (pp_cxx_pm_expression) <case MEMBER_REF>: Print
3628 * error.c (dump_expr): Handle MEMBER_REF and DOTSTAR_EXPR.
3630 2007-10-27 Jason Merrill <jason@redhat.com>
3633 * call.c (convert_default_arg): Detect recursion.
3635 2007-10-27 Jakub Jelinek <jakub@redhat.com>
3638 * cxx-pretty-print.h (pp_cxx_offsetof_expression): New prototype.
3639 * cxx-pretty-print.c (pp_cxx_primary_expression): Handle
3641 (pp_cxx_offsetof_expression_1, pp_cxx_offsetof_expression): New
3643 * error.c (dump_expr): Handle OFFSETOF_EXPR.
3645 2007-10-26 Jason Merrill <jason@redhat.com>
3648 * pt.c (get_template_info): New fn.
3649 (template_class_depth): Use it.
3650 (push_template_decl_real): Check that the template args of the
3651 definition match the args of the previous declaration.
3653 2007-10-26 Paolo Carlini <pcarlini@suse.de>
3656 * decl2.c (coerce_new_type): Do not allow a default argument for
3657 the first parameter.
3659 2007-10-26 Douglas Gregor <doug.gregor@gmail.com>
3662 * parser.c (cp_parser_decltype): Return ERROR_MARK_NODE if we
3663 don't see the leading '('. Only lookup names if we get an
3666 2007-10-26 Jakub Jelinek <jakub@redhat.com>
3669 * parser.c (cp_parser_parenthesized_expression_list): Set
3670 greater_than_is_operator_p to true in between the parens.
3672 2007-10-26 Paolo Carlini <pcarlini@suse.de>
3675 * decl.c (grokdeclarator): In case of conflicting specifiers
3676 just return error_mark_node.
3678 2007-10-26 Ollie Wild <aaw@google.com>
3680 * expr.c (cxx_expand_expr): Removed.
3681 * cp-tree.h (exx_expand_expr): Removed.
3682 * cp-objcp-common.h (LANK_HOOKS_EXPAND_EXPR): Replace cxx_expand_expr
3685 2007-10-25 Paolo Carlini <pcarlini@suse.de>
3688 * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with BIT_NOT_EXPR.
3690 2007-10-23 Jason Merrill <jason@redhat.com>
3692 PR c++/25950 (DR 391)
3693 * call.c (struct conversion): Remove check_copy_constructor_p.
3694 (reference_binding): Always bind a reference directly to a
3695 compatible class rvalue. Pass down LOOKUP_NO_TEMP_BIND during
3697 (check_constructor_callable): Remove.
3698 (convert_like_real): Don't call it.
3699 (initialize_reference): Don't call check_constructor_callable.
3700 (standard_conversion): Check LOOKUP_NO_CONVERSION instead of
3701 LOOKUP_CONSTRUCTOR_CALLABLE. Don't require a temporary for base
3702 conversions if LOOKUP_NO_TEMP_BIND.
3703 (implicit_conversion): Pass through LOOKUP_NO_TEMP_BIND.
3704 (build_user_type_conversion_1): Pass through LOOKUP_NO_TEMP_BIND for
3706 * cp-tree.h (LOOKUP_CONSTRUCTOR_CALLABLE): Remove.
3708 2007-10-22 Jakub Jelinek <jakub@redhat.com>
3711 * semantics.c (finish_omp_clauses): Check !type_dependent_expression_p
3712 before checking if its type is integral.
3714 2007-10-22 Jason Merrill <jason@redhat.com>
3717 * class.c (finish_struct_bits): Copy TYPE_ATTRIBUTES.
3718 * pt.c (apply_late_template_attributes): Splice out dependent
3719 attributes from DECL_ATTRIBUTES.
3721 * decl.c (cxx_maybe_build_cleanup): Use build_address.
3723 2007-10-17 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
3725 * typeck.c (build_binary_op) : Use appropriate warning option
3726 instead of unnamed warning.
3728 2007-10-16 Paolo Carlini <pcarlini@suse.de>
3731 * pt.c (current_template_args): Do not change TREE_LIST elements
3732 with a TREE_VALUE of error_mark_node.
3734 2007-10-16 Mark Mitchell <mark@codesourcery.com>
3736 * typeck.c (cp_apply_type_quals_to_decl): Expand documentation.
3737 * decl.c (start_decl): Tidy.
3738 (start_decl_1): Call cp_apply_type_quals_to_decl after completing
3740 (grokdeclarator): Clarify comment.
3742 2007-10-14 Andrew Pinski <pinskia@gmail.com>
3745 * decl.c (grokfndecl): Return NULL after the "definition of
3746 implicitly-declared" error happened.
3748 2007-10-12 Simon Martin <simartin@users.sourceforge.net>
3751 * call.c (build_user_type_conversion_1): Do not consider conversion
3752 functions to convert a (possibly cv-qualified) object to the (possibly
3753 cv-qualified) same object type (or a reference to it), to a (possibly
3754 cv-qualified) base class of that type (or a reference to it).
3756 2007-10-12 Paolo Carlini <pcarlini@suse.de>
3758 * pt.c (tsubst): Use template_parm_level_and_index.
3760 2007-10-12 Jakub Jelinek <jakub@redhat.com>
3763 * parser.c (cp_parser_compound_statement): Handle label-declarations
3764 at the beginning of the compound statement.
3765 (cp_parser_block_declaration): Issue diagnostics about __label__
3766 not at the beginning of a block.
3768 2007-10-11 Paolo Carlini <pcarlini@suse.de>
3771 * pt.c (coerce_template_parameter_pack): Do not pass error_mark_node
3772 to convert_template_argument.
3773 (coerce_template_parms): Return error_mark_node after fixed-length
3775 (tsubst_decl): Check for error_mark_node the return value of the
3776 first tsubst in 'case VAR_DECL'.
3778 2007-10-08 Ollie Wild <aaw@google.com>
3780 * typeck2.c (digest_init): Call cplus_expand_constant after
3781 convert_for_initialization.
3782 * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
3783 * expr.c (cplus_expand_constant): Updated function description.
3785 2007-10-04 Jason Merrill <jason@redhat.com>
3788 * call.c (initialize_reference): Handle local static reference
3791 2007-10-03 Jason Merrill <jason@redhat.com>
3794 * name-lookup.c (push_namespace_with_attrs): Fold back into...
3795 (push_namespace): Here.
3796 (handle_namespace_attrs): New fn for the attr code.
3797 (leave_scope): Don't pop_visibility.
3798 * name-lookup.h (struct cp_binding_level): Remove has_visibility.
3799 * parser.c (cp_parser_namespace_definition): Call
3800 handle_namespace_attrs and pop_visibility as appropriate.
3803 * mangle.c (write_type) [TYPEOF_TYPE]: Just sorry.
3805 2007-10-03 Alexandre Oliva <aoliva@redhat.com>
3807 * decl.c (duplicate_decls): Preserve linkage flags for mere
3808 redeclarations of gnu_inline definitions.
3810 2007-10-03 Jason Merrill <jason@redhat.com>
3813 * decl.c (wrap_cleanups_r): New fn.
3814 (wrap_temporary_cleanups): New fn.
3815 (initialize_local_var): Call it.
3817 2007-09-29 Jason Merrill <jason@redhat.com>
3820 * decl.c (make_rtl_for_nonlocal_decl): It's ok for a member
3821 constant to not have DECL_EXTERNAL if it's file-local.
3823 2007-09-28 Ollie Wild <aaw@google.com>
3826 2007-09-27 Ollie Wild <aaw@google.com>
3828 * typeck2.c (digest_init): Call cplus_expand_constant after
3829 convert_for_initialization.
3830 * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
3831 * expr.c (cplus_expand_constant): Updated function description.
3833 2007-09-28 Jason Merrill <jason@redhat.com>
3836 * class.c (layout_empty_base): Take rli parameter, update
3837 rli->record_align if empty base has user-specified alignment.
3838 (build_base_field): Pass rli to it.
3840 2007-09-28 Paolo Carlini <pcarlini@suse.de>
3843 * error.c (dump_decl): Deal with TYPE_PACK_EXPANSION.
3845 2007-09-28 Paolo Carlini <pcarlini@suse.de>
3848 * error.c (dump_expr): Deal with ARGUMENT_PACK_SELECT.
3849 (dump_type): Use dump_template_argument for TYPE_ARGUMENT_PACK.
3850 (dump_parameters): Just call dump_type for argument packs too.
3852 2007-09-28 Jakub Jelinek <jakub@redhat.com>
3855 * tree.c (cp_build_qualified_type_real): Handle TYPE_PACK_EXPANSION
3856 qualification by creating qualified PACK_EXPANSION_PATTERN and
3857 then calling make_pack_expansion on it.
3859 2007-09-27 Ollie Wild <aaw@google.com>
3861 * typeck2.c (digest_init): Call cplus_expand_constant after
3862 convert_for_initialization.
3863 * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
3864 * expr.c (cplus_expand_constant): Updated function description.
3866 2007-09-27 Jason Merrill <jason@redhat.com>
3869 * decl2.c (is_late_template_attribute): Don't crash on unknown
3872 2007-09-27 Paolo Carlini <pcarlini@suse.de>
3875 * error.c (dump_expr): Deal with DELETE_EXPR and VEC_DELETE_EXPR.
3876 * cxx-pretty-print.c (pp_cxx_delete_expression): Add missing
3877 spaces in the formatting.
3878 * cxx-pretty-print.h (pp_cxx_delete_expression): Declare.
3880 2007-09-27 Jakub Jelinek <jakub@redhat.com>
3882 * error.c (cxx_print_error_function): Add third argument, pass
3883 it over to lhd_print_error_function.
3884 (cp_print_error_function): If diagnostic->abstract_origin, print
3886 * cp-tree.h (struct diagnostic_info): New forward decl.
3887 (cxx_print_error_function): Add third argument.
3889 2007-09-25 Simon Martin <simartin@users.sourceforge.net>
3892 * name-lookup.c (pushtag): Do not create an implicit typedef before
3893 the associated type declaration is known to be valid.
3895 2007-09-25 Jakub Jelinek <jakub@redhat.com>
3897 * tree.c (cxx_printable_name): Compare FUNCTION_DECL uids
3898 rather than pointers.
3900 2007-09-24 Danny Smith <dannysmith@user.sourceforge.net>
3903 * search.c (check_final_overrider): Fail if
3904 targetm.comp_type_attributes returns 0.
3906 2007-09-24 Jason Merrill <jason@redhat.com>
3909 * pt.c (resolve_typename_type): Don't look things up in the original
3910 template if it would mean losing template arguments.
3912 2007-09-24 Jakub Jelinek <jakub@redhat.com>
3915 * cp-tree.h (cxx_type_hash_eq): New prototype.
3916 * cp-objcp-common.h (LANG_HOOKS_TYPE_HASH_EQ): Redefine.
3917 * tree.c (cxx_type_hash_eq): New function.
3919 2007-09-24 Douglas Gregor <doug.gregor@gmail.com>
3922 * tree.c (cp_build_qualified_type_real): Build a canonical
3923 ARRAY_TYPE if the original ARRAY_TYPE was not a canonical type.
3925 2007-09-24 Douglas Gregor <doug.gregor@gmail.com>
3929 * tree.c (cplus_array_compare): Compare pointers, not types.
3930 (build_cplus_array_type_1): Store new array type into the hash
3931 table before building the canonical type; build the canonical type
3933 (cp_build_qualified_type_real): Put all of the array types with
3934 cv-qualified element types into the C++ array hash table, built as
3935 variants of the unqualified versions.
3937 2007-09-23 Jason Merrill <jason@redhat.com>
3940 * decl.c (grokdeclarator): Look through implicit TYPE_DECLs
3941 for deprecation warnings.
3943 2007-09-22 Jason Merrill <jason@redhat.com>
3946 * call.c (build_over_call): Warn about deprecated virtuals.
3949 * cp-tree.h (ATTR_IS_DEPENDENT): New macro.
3950 (MAYBE_TAGGED_TYPE_P): Remove.
3951 * pt.c (apply_late_template_attributes): Check ATTR_IS_DEPENDENT
3952 instead of calling is_late_template_attribute again.
3953 (tsubst_decl) [TYPE_DECL]: Just check if the name is the tag.
3954 (tsubst): A typedef is a TYPE_NAME != TYPE_MAIN_DECL.
3955 Don't crash on typedefs from non-template classes.
3956 * decl2.c (grokfield): Don't sorry about attrs on template parms.
3957 (is_late_template_attribute): All attributes applied to template
3958 parms or typename types are dependent. Static.
3959 (splice_template_attributes): Pass decl through.
3960 (save_template_attributes): Likewise.
3962 2007-09-20 Jakub Jelinek <jakub@redhat.com>
3965 * pt.c (tsubst_copy) <case SIZEOF_EXPR>: Handle error_mark_node
3966 returned from tsubst_pack_expansion.
3967 (tsubst_copy_and_build) <case SIZEOF_EXPR>: Likewise.
3968 (tsubst_copy_and_build) <case CONSTRUCTOR>: Likewise.
3970 2007-09-20 Paolo Carlini <pcarlini@suse.de>
3973 * semantics.c (finish_id_expression): Use consistently
3974 context_for_name_lookup.
3975 * decl.c (fixup_anonymous_aggr): Fix error message for
3976 anonymous struct (vs union).
3978 2007-09-19 Jason Merrill <jason@redhat.com>
3981 * pt.c (tsubst): Handle typedefs by looking for the specialization.
3982 (retrieve_specialization): Only tagged types use
3983 DECL_TEMPLATE_INSTANTIATIONS.
3984 (instantiate_class_template): Push nested classes too.
3985 (tsubst_decl) [TYPE_DECL]: Only check for canonical decl for
3987 * cp-tree.h (MAYBE_TAGGED_TYPE_P): New macro.
3988 * init.c (is_aggr_type): Remove redundant tests.
3989 * class.c (push_nested_class): Use CLASS_TYPE_P.
3991 2007-09-20 Paolo Carlini <pcarlini@suse.de>
3994 * init.c (build_zero_init): If, recursively, build_zero_init
3995 returns a NULL_TREE, do not append it to the VEC of constructors.
3997 2007-09-18 Jason Merrill <jason@redhat.com>
4000 * pt.c (apply_late_template_attributes): Set processing_template_decl.
4001 (tsubst_decl) [TYPE_DECL]: Preserve naming typedef, pass
4002 ATTR_FLAG_TYPE_IN_PLACE.
4003 (tsubst): Do unqualified lookup to find typedefs from current class.
4004 [ARRAY_TYPE]: Propagate alignment info.
4005 * decl2.c (is_late_template_attribute): Only defer handling of
4006 attribute aligned if the expression is dependent.
4007 (save_template_attributes): If we're deferring any attributes,
4008 make this a naming typedef.
4010 2007-09-18 Paolo Carlini <pcarlini@suse.de>
4012 PR c++/33462 (again)
4013 * cxx-pretty-print.c (pp_cxx_va_arg_expression): Print
4014 va_arg instead of __builtin_va_arg.
4016 2007-09-18 Paolo Carlini <pcarlini@suse.de>
4019 * cxx-pretty-print.c (pp_cxx_va_arg_expression): Add.
4020 (pp_cxx_primary_expression): Use it.
4021 * cxx-pretty-print.h (pp_cxx_va_arg_expression): Declare.
4022 * error.c (dump_expr): Use it.
4024 2007-09-18 Paolo Carlini <pcarlini@suse.de>
4027 * cxx-pretty-print.c (pp_cxx_postfix_expression): Split
4028 out case TYPEID_EXPR to...
4029 (pp_cxx_typeid_expression): ... here; use pp_cxx_left_paren
4030 and pp_cxx_right_paren.
4031 * cxx-pretty-print.h (pp_cxx_typeid_expression): Declare.
4032 * error.c (dump_expr): Use it.
4034 2007-09-18 Paolo Carlini <pcarlini@suse.de>
4037 * cxx-pretty-print.c (pp_cxx_trait_expression): Add.
4038 (pp_cxx_primary_expression): Use it.
4039 * cxx-pretty-print.h (pp_cxx_trait_expression): Declare.
4040 * error.c (dump_expr): Use it.
4042 2007-09-16 Paolo Carlini <pcarlini@suse.de>
4045 * init.c (build_new): Remove warning for zero-element
4048 2007-09-16 Nathan Sidwell <nathan@codesourcery.com>
4051 * call.c (maybe_handle_implicit_object): Set this_p, clear
4052 rvaluedness_matches_p.
4053 (compare_ics): Do not compare rvaluedness matching when one of the
4054 operands is an implicit object.
4056 2007-09-14 Jason Merrill <jason@redhat.com>
4058 PR c++/17743, c++/19163
4059 * decl2.c (is_late_template_attribute): New fn.
4060 (splice_template_attributes, save_template_attributes): New fns.
4061 (cplus_decl_attributes): Call save_template_attributes.
4062 * pt.c (apply_late_template_attributes): New fn.
4063 (instantiate_class_template, tsubst_decl): Use it.
4064 * cp-tree.h: Declare is_late_template_attribute.
4066 2007-09-13 Tom Tromey <tromey@redhat.com>
4068 * parser.c (cp_lexer_new_main): Don't use
4069 c_lex_return_raw_strings.
4070 (cp_lexer_get_preprocessor_token): Update. Add special case when
4073 2007-09-11 Jan Hubicka <jh@suse.cz>
4075 * method.c (use_thunk): Use tree_rest_of_compilation
4076 * cp-objecp-common.h (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Kill.
4077 (LANG_HOOKS_CALLGRAPH_EMIT_ASSOCIATED_THUNKS): Define.
4078 * cp-tree.h (expand_body): Kill.
4079 (emit_associated_thunks): Declare.
4080 * semantics.c (emit_associated_thunks): Export.
4081 (expand_body): Kill.
4083 2007-09-09 David Daney <ddaney@avtrex.com>
4086 * init.c (build_new_1): Use POINTER_PLUS_EXPR instead of MINUS_EXPR
4087 to calculate cookie_ptr.
4089 2007-09-08 Jason Merrill <jason@redhat.com>
4092 * pt.c (most_specialized_class): Set processing_template_decl
4093 while tsubsting partial spec args.
4095 2007-09-06 Jason Merrill <jason@redhat.com>
4097 * decl2.c (get_guard): Copy visibility from the guarded variable.
4099 2007-09-06 Jan Hubicka <jh@suse.cz>
4101 * semantics.c (expand_body): Do not mark arguments of clones used.
4103 2007-09-06 Paolo Carlini <pcarlini@suse.de>
4106 * decl.c (cp_finish_decl): When processing_template_decl,
4107 deal correctly with init as TREE_LIST.
4109 2007-09-06 Tom Tromey <tromey@redhat.com>
4111 * decl.c (finish_function): Put return's location on line zero of
4114 2007-09-05 Jason Merrill <jason@redhat.com>
4117 * except.c (prepare_eh_type): Use type_decays_to.
4120 * init.c (build_delete): Use build_headof to get the address of the
4121 complete object if we aren't using the deleting destructor.
4122 * rtti.c (build_headof): No longer static.
4123 * cp-tree.h: Declare it.
4125 2007-09-06 Jakub Jelinek <jakub@redhat.com>
4127 * decl.c (duplicate_decls): Set TREE_NOTHROW on __builtin_XX
4128 decl if a prototype for XX is provided with throw().
4131 * decl.c (builtin_function_1): Set DECL_ANTICIPATED also
4132 on __*_chk non-__builtin_* decls.
4134 2007-09-05 Paolo Carlini <pcarlini@suse.de>
4137 * semantics.c (finish_id_expression): Use context_for_name_lookup
4138 insted of DECL_CONTEXT, to see through anonymous structs and unions.
4139 * class.c (finish_struct_anon): Deal correctly with anonymous
4140 structs (vs unions, as GNU extension) in error messages.
4142 2007-09-05 Jan Hubicka <jh@suse.cz>
4144 * sematics.c (expand_body): Remove unnecesary import_export_decl
4145 call, DECL_EXTERNAL checks and current_function_decl saving.
4147 2007-09-05 Paolo Carlini <pcarlini@suse.de>
4149 PR c++/29731 (again)
4150 * parser.c (cp_parser_primary_expression): Return error_mark_node
4151 when a statement-expression is found in a template-argument list.
4153 2007-09-04 Jason Merrill <jason@redhat.com>
4155 * except.c (initialize_handler_parm): Use
4156 fold_build_cleanup_point_expr.
4159 * call.c (reference_binding): Don't look for user-defined conversions
4163 * except.c (initialize_handler_parm): Put a CLEANUP_POINT_EXPR inside
4164 the MUST_NOT_THROW_EXPR.
4166 2007-09-04 Richard Sandiford <richard@codesourcery.com>
4168 * decl.c (cp_finish_decl): Call determine_visibility before
4169 make_rtl_for_nonlocal_decl.
4171 2007-09-04 Jason Merrill <jason@redhat.com>
4174 * pt.c (most_specialized_class): Substitute outer template
4175 arguments into the arguments of a member template partial
4177 (strip_innermost_template_args): New fn.
4179 2007-09-03 Daniel Jacobowitz <dan@codesourcery.com>
4181 * Make-lang.in (g++spec.o): Remove SHLIB_MULTILIB.
4183 2007-09-03 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4185 * call.c (name_as_c_string): Supply a TYPE for CONST_CAST.
4186 * decl.c (cp_make_fname_decl): Likewise,
4187 * parser.c (cp_parser_string_literal): Likewise,
4188 * tree.c (pod_type_p, zero_init_p): Use CONST_CAST_TREE.
4189 * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
4192 2007-09-02 Paolo Carlini <pcarlini@suse.de>
4195 * typeck.c (build_unary_op): Fix error message for
4196 Boolean expression as operand to operator--.
4198 2007-09-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4200 * tree.c (pod_type_p, zero_init_p): Use strip_array_types.
4201 * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
4204 2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
4207 * init.c (build_default_init): Make extern.
4208 * cp-tree.h (build_default_init): Declare here.
4209 * pt.c (tsubst_expr): When the instantiation of the initializer of
4210 a variable results in an empty list, default-initialize the
4212 (tsubst_copy_and_build): When the instantiation of the initializer
4213 in a new expression results in an empty initializer list,
4214 default-initialize it.
4216 2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
4218 * mangle.c (write_type): Change mangling of rvalue reference from
4221 2007-08-31 Jakub Jelinek <jakub@redhat.com>
4223 * decl.c (duplicate_decls): Remove duplicated line.
4225 2007-08-31 Paolo Carlini <pcarlini@suse.de>
4228 * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with
4229 BOUND_TEMPLATE_TEMPLATE_PARM.
4231 2007-08-31 Paolo Carlini <pcarlini@suse.de>
4234 * search.c (lookup_member): Check the name argument for
4237 2007-08-31 Paolo Carlini <pcarlini@suse.de>
4240 * parser.c (cp_parser_trait_expr): Check rerurn value of
4243 2007-08-30 Ollie Wild <aaw@google.com>
4245 * cvt.c (cp_convert_to_pointer): Remove force parameter. Call
4246 convert_ptrmem for pointer to member conversions.
4247 (convert_to_pointer_force): Update cp_convert_to_pointer call.
4248 (ocp_convert): Update cp_convert_to_pointer call.
4249 * typeck.c (convert_ptrmem): Add conditional for null pointers to
4251 (build_static_cast_1): Check can_convert for conversions in either
4253 (get_delta_difference_1): New function.
4254 (get_delta_difference): Refactor to call get_delta_difference_1.
4256 2007-08-30 Jakub Jelinek <jakub@redhat.com>
4258 * decl.c (start_preparsed_function): Set
4259 DECL_DISREGARD_INLINE_LIMITS for GNU_INLINE_P functions.
4261 2007-08-28 Paolo Carlini <pcarlini@suse.de>
4264 * error.c (dump_expr): Deal with TEMPLATE_TYPE_PARM and
4265 BOUND_TEMPLATE_TEMPLATE_PARM.
4267 2007-08-28 Jakub Jelinek <jakub@redhat.com>
4271 * pt.c (check_explicit_specialization): Set DECL_INTERFACE_KNOWN
4272 and DECL_NOT_REALLY_EXTERN if tmpl_func is not public.
4274 2007-08-27 Jason Merrill <jason@redhat.com>
4277 * pt.c (build_non_dependent_expr, type_dependent_expression_p):
4278 Look inside STMT_EXPR.
4279 * semantics.c (stmt_expr_value_expr): New fn.
4280 * cp-tree.h: Declare it.
4283 * decl.c (groktypename): Ignore attributes applied to class type.
4285 2007-08-28 Richard Guenther <rguenther@suse.de>
4287 * decl.c (duplicate_decls): Merge DECL_DISREGARD_INLINE_LIMITS.
4289 2007-08-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
4291 * error.c (dump_expr): Handle COMPLEX_CST.
4292 * cxx-pretty-print.c (pp_cxx_primary_expression): Likewise.
4293 (pp_cxx_expression): Likewise.
4295 2007-08-27 Alexandre Oliva <aoliva@redhat.com>
4297 * decl.c (GNU_INLINE_P): New.
4298 (duplicate_decls): Handle gnu_inline. Merge attributes and
4299 some flags in overriding definitions.
4300 (redeclaration_error_message): Handle gnu_inline.
4301 (start_preparsed_function): Likewise.
4303 2007-08-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4305 * call.c (sufficient_parms_p): Constify.
4306 * class.c (same_signature_p): Likewise.
4307 * cp-gimplify.c (is_invisiref_parm,
4308 cxx_omp_privatize_by_reference): Likewise.
4309 * cp-objcp-common.c (has_c_linkage): Likewise.
4310 * cp-tree.h (NON_THUNK_FUNCTION_CHECK, THUNK_FUNCTION_CHECK,
4311 sufficient_parms_p, same_signature_p, copy_fn_p, move_fn_p,
4312 grok_ctor_properties, nothrow_libfn_p, skip_artificial_parms_for,
4313 num_artificial_parms_for, comp_template_parms,
4314 template_parameter_pack_p, any_dependent_template_arguments_p,
4315 any_type_dependent_arguments_p, any_value_dependent_elements_p,
4316 repo_export_class_p, cxx_omp_privatize_by_reference, pod_type_p,
4317 zero_init_p, member_p, cp_lvalue_kind,
4318 builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
4319 varargs_function_p, is_dummy_object, special_function_kind,
4320 string_conv_p, type_unknown_p, comp_except_specs, compparms,
4321 comp_cv_qualification, is_bitfield_expr_with_lowered_type,
4322 unlowered_expr_type, ptr_reasonably_similar, cp_type_readonly,
4323 cp_has_mutable_p, at_least_as_qualified_p,
4324 invalid_nonstatic_memfn_p, lvalue_or_else, lvalue_p): Likewise.
4325 * decl.c (copy_fn_p, move_fn_p, grok_ctor_properties): Likewise.
4326 * except.c (nothrow_libfn_p): Likewise.
4327 * method.c (skip_artificial_parms_for, num_artificial_parms_for):
4329 * pt.c (comp_template_parms, template_parameter_pack_p,
4330 any_type_dependent_arguments_p, any_value_dependent_elements_p,
4331 any_dependent_template_arguments_p): Likewise.
4332 * repo.c (repo_export_class_p): Likewise.
4333 * semantics.c (anon_aggr_type_p): Likewise.
4334 * tree.c (lvalue_p_1, real_lvalue_p, lvalue_p,
4335 builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
4336 varargs_function_p, member_p, is_dummy_object, pod_type_p,
4337 zero_init_p, special_function_p): Likewise.
4338 * typeck.c (comp_array_types, type_unknown_p, comp_except_specs,
4339 comp_array_types, at_least_as_qualified_p, comp_cv_qualification,
4340 compparms, invalid_nonstatic_memfn_p,
4341 is_bitfield_expr_with_lowered_type, unlowered_expr_type,
4342 string_conv_p, ptr_reasonably_similar, cp_type_readonly,
4343 cp_has_mutable_p, lvalue_or_else): Likewise.
4345 2007-08-25 Paolo Bonzini <bonzini@gnu.org>
4347 * decl.c (cp_tree_node_structure): Kill TINST_LEVEL case.
4348 * cp-objcp-common.c (cp_tree_size): Ditto.
4349 * tree.c (cp_walk_subtrees): Ditto
4350 * cp-tree.def (TINST_LEVEL): Go away.
4351 * cp-tree.h (struct tinst_level_s): Rename to struct tinst_level,
4352 move together with other non-tree structs.
4353 (enum cp_tree_node_structure_enum): Nuke TS_CP_TINST_LEVEL.
4354 (union lang_tree_node): Eliminate tinst_level field.
4355 (TINST_DECL, TINST_LOCATION, TINST_IN_SYSTEM_HEADER_P): Annihilate.
4356 (current_instantiation, outermost_tinst_level): Return
4357 a "struct tinst_level *".
4359 * error.c (print_instantiation_partial_context): Change second
4360 parameter to a "struct tinst_level *". Replace accessor macros
4362 (print_instantiation_full_context): Likewise.
4363 * lex.c (in_main_input_context): Likewise.
4365 * pt.c (struct pending_templates): New.
4366 (pending_templates, last_pending_template): Use it as a type.
4367 (current_tinst_level): Change typo to "struct tinst_level *"
4368 (reopen_tinst_level): Accept "struct tinst_level *", return decl.
4369 (add_pending_template): Construct a "struct pending_template".
4370 Replace TINST_LEVEL accessor macros with field access.
4371 (push_tinst_level): Likewise, using GGC_NEW instead of make_node.
4372 (pop_tinst_level): Likewise.
4373 (instantiate_pending_templates): Likewise. Factor common code used
4374 when an instantiation has been done.
4375 (outermost_tinst_level): Replace tree_last with loop.
4376 (current_instantiation): Return a "struct tinst_level *".
4378 2007-08-24 Ollie Wild <aaw@google.com>
4380 * name-lookup.c (add_decl_to_level): Remove addition to vtables chain.
4381 * name-lookup.h (cp_binding_level): Remove vtables member.
4383 2007-08-24 Richard Guenther <rguenther@suse.de>
4385 * tree.c (cp_cannot_inline_tree_fn): Remove.
4386 * cp-tree.h (cp_cannot_inline_tree_fn): Likewise.
4387 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN):
4390 2007-08-24 Jakub Jelinek <jakub@redhat.com>
4393 * typeck.c (build_unary_op) <case PREINCREMENT_EXPR>: Return
4394 error_mark_node right away if build_expr_type_conversion
4398 * name-lookup.c (set_decl_namespace): lookup_qualified_name failure
4399 is error_mark_node rather than NULL_TREE.
4400 * pt.c (check_explicit_specialization): Likewise.
4403 * error.c (resolve_virtual_fun_from_obj_type_ref): Handle
4404 TARGET_VTABLE_USES_DESCRIPTORS targets properly.
4406 2007-08-22 Jason Merrill <jason@redhat.com>
4409 * pt.c (outermost_tinst_level): New function.
4410 * lex.c (in_main_input_context): New function.
4411 * cp-tree.h: Declare it.
4412 * decl2.c (constrain_class_visibility): Use it to avoid warning
4413 about uses of the anonymous namespace in the main input file.
4415 2007-08-21 Jakub Jelinek <jakub@redhat.com>
4417 * init.c (build_new_1): Use get_target_expr instead of save_expr.
4419 2007-08-20 Pawel Sikora <pluto@pld-linux.org>
4422 * class.c (finish_struct_1): Warn when a class has virtual
4423 functions and accessible non-virtual destructor.
4425 2007-08-20 Richard Guenther <rguenther@suse.de>
4429 * call.c (build_new_method_call): Convert initializer to
4431 * init.c (build_aggr_init): Do not fiddle with types.
4432 (build_vec_delete_1): Use correct type for POINTER_PLUS_EXPR.
4433 * except.c (build_throw): Do not drop qualifiers for the
4435 * typeck.c (get_member_function_from_ptrfunc): Do not
4436 fiddle with types, instead convert.
4437 (build_ptrmemfunc1): Convert to the target type for
4439 (gfc_trans_allocate): Convert result to target type.
4440 * cp-objcp-common.c (cxx_get_alias_set): Pointers to
4441 pointer-to-member structures shall have alias set zero as well.
4443 2007-08-20 Richard Guenther <rguenther@suse.de>
4445 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P):
4447 * cp-tree.h (cp_auto_var_in_fn_p): Remove.
4448 (nonstatic_local_decl_p): Likewise.
4449 * tree.c (cp_auto_var_in_fn_p): Remove.
4450 * decl.c (nonstatic_local_decl_p): Remove.
4452 2007-08-20 Richard Guenther <rguenther@suse.de>
4454 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_WALK_SUBTREES):
4456 * tree.h (cp_walk_tree): New define to walk_tree_1 with
4457 cp_walk_subtrees lh parameter.
4458 (cp_walk_tree_without_duplicates): New define to
4459 walk_tree_without_duplicates_1 with cp_walk_subtrees lh parameter.
4460 * tree.c (count_trees): Call
4461 cp_walk_tree_without_duplicates.
4462 (verify_stmt_tree): Call cp_walk_tree.
4463 (break_out_target_exprs): Likewise.
4464 (WALK_SUBTREE): Likewise.
4465 * cp-gimplify.c (cp_genericize): Likewise.
4466 * cp-pt.c (find_parameter_packs_r): Likewise.
4467 (uses_parameter_packs): Likewise.
4468 (make_pack_expansion): Likewise.
4469 (check_for_bare_parameter_packs): Likewise.
4470 (for_each_template_parm): Likewise.
4471 * decl.c (check_default_argument): Call
4472 cp_walk_tree_without_duplicates.
4473 * except.c (build_throw): Likewise.
4474 * decl2.c (type_visibility): Likewise.
4475 * semantics.c (expand_or_defer_fn): Likewise.
4476 (finalize_nrv): Call cp_walk_tree.
4478 2007-08-20 Jakub Jelinek <jakub@redhat.com>
4481 * init.c (build_new_1): Rename placement_var variable to placement_expr.
4482 Initialize it with save_expr rather than get_temp_regvar.
4484 2007-08-17 Andrew Pinski <andrew_pinski@playstation.sony.com>
4487 * tree.c (lvalue_p_1 <case SAVE_EXPR>): SAVE_EXPRs are never
4490 2007-08-17 Ollie Wild <aaw@google.com>
4493 * name-lookup.c (do_nonmember_using_decl): Shift implicit type
4494 declarations into appropriate slots for comparison. Fix type
4497 2007-08-17 Paolo Carlini <pcarlini@suse.de>
4500 * error.c (dump_decl): Deal with UNBOUND_CLASS_TEMPLATE.
4501 * cxx-pretty-print.c (pp_cxx_unqualified_id): Likewise.
4503 2007-08-17 Paolo Carlini <pcarlini@suse.de>
4506 * parser.c (cp_parser_class_head): Improve error message.
4508 2007-08-16 Seongbae Park <seongbae.park@gmail.com>
4510 * pt.c (instantiate_decl): Set input_location
4511 for the function end.
4513 2007-08-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4515 * cp-objcp-common.c (cxx_warn_unused_global_decl, cp_expr_size):
4517 * cp-tree.h (local_variable_p, nonstatic_local_decl_p,
4518 class_tmpl_impl_spec_p, cp_auto_var_in_fn_p, cp_type_quals,
4519 cxx_incomplete_type_diagnostic, cxx_incomplete_type_error,
4520 cxx_warn_unused_global_decl, cp_expr_size): Likewise.
4521 * decl.c (local_variable_p, nonstatic_local_decl_p): Likewise.
4522 * tree.c (class_tmpl_impl_spec_p, cp_auto_var_in_fn_p): Likewise.
4523 * typeck.c (cp_type_quals): Likewise.
4524 * typeck2.c (cxx_incomplete_type_diagnostic,
4525 cxx_incomplete_type_error): Likewise.
4527 2007-08-16 Paolo Carlini <pcarlini@suse.de>
4530 * pt.c (tsubst_friend_function): When check_classfn
4531 returns error_mark_node likewise return it.
4533 2007-08-15 Jakub Jelinek <jakub@redhat.com>
4536 * typeck.c (check_return_expr): Don't NRV optimize vars in
4538 * decl.c (finish_function): Comment fix.
4540 2007-08-15 Paolo Carlini <pcarlini@suse.de>
4543 * pt.c (push_template_decl_real): Depending on TYPE_P
4544 use either TYPE_CONTEXT or DECL_CONTEXT.
4546 2007-08-14 Mark Mitchell <mark@codesourcery.com>
4548 * semantics.c (finish_omp_clauses): Strip a NOP_EXPR if
4549 constructors and destructors return this.
4551 2007-08-14 Paolo Carlini <pcarlini@suse.de>
4554 * decl2.c (check_classfn): Return error_mark_node in case of error;
4555 in that case, do not call add_method.
4556 * decl.c (start_decl): Deal with check_classfn returning
4558 (grokfndecl): Likewise.
4559 * pt.c (tsubst_friend_function): Likewise.
4561 2007-08-14 Andrew Pinski <pinskia@gmail.com>
4564 * typeck.c (build_binary_op): Disallow vector float types with
4565 BIT_IOR_EXPR, BIT_AND_EXPR, and BIT_XOR_EXPR.
4567 2007-08-11 Ian Lance Taylor <iant@google.com>
4569 * cp-objcp-common.c (cxx_get_alias_set): Change return type to
4571 * cp-tree.h (cxx_get_alias_set): Update declaration.
4573 2007-08-10 Ollie Wild <aaw@google.com>
4575 * name-lookup.c (do_nonmember_using_decl): Print an error for ambiguous
4577 (ambiguous_decl): Construct tree of ambiguous types. Remove extaneous
4579 (unqualified_namespace_lookup): Fix ambiguous_decl call.
4580 (lookup_using_namespace): Fix ambiguous_decl call.
4581 (qualified_lookup_using_namespace): Fix ambiguous_decl call.
4583 2007-08-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4585 * call.c (name_as_c_string): Use CONST_CAST.
4586 * decl.c (build_decl): Likewise.
4587 * parser.c (cp_parser_string_literal): Likewise.
4589 2007-08-10 Paolo Carlini <pcarlini@suse.de>
4592 * error.c (dump_expr): Consistently use the *_cxx_*
4593 variants of the pretty-print functions.
4595 2007-08-10 Paolo Carlini <pcarlini@suse.de>
4598 * decl.c (check_special_function_return_type): Just error
4599 on return type specified for conversion operator.
4601 2007-08-09 Daniel Berlin <dberlin@dberlin.org>
4603 * typeck2.c (readonly_error): Handle general expressions.
4604 * error.c (dump_expr): Handle POINTER_PLUS_EXPR
4606 2007-08-06 Dan Hipschman <dsh@google.com>
4608 * method.c (use_thunk): Use DECL_NAME instead of DECL_RTL to
4609 access function name.
4611 2007-08-04 Alfred Minarik <a.minarik@aon.at>
4614 * lang-specs.h: Add .hp, .hxx, .hpp, .h, .HPP, .tcc as c++ header.
4615 * g++spec.c (lang_specific_driver): Check them.
4617 2007-08-06 Paolo Carlini <pcarlini@suse.de>
4620 * pt.c (inline_needs_template_parms): Fix comment; change return type
4623 2007-08-05 Volker Reichelt <v.reichelt@netcologne.de>
4626 2007-03-26 Dirk Mueller <dmueller@suse.de>
4628 * parser.c (cp_parser_member_declaration): Pedwarn
4629 about stray semicolons after member declarations.
4631 2007-08-02 Lee Millward <lee.millward@gmail.com>
4636 * parser.c (cp_parser_asm_definition): Detect and discard asm
4637 statements with invalid inputs or outputs.
4638 (cp_parser_asm_operand_list): Return error mark node if any
4639 of the operands are invalid. Adjust documentation.
4641 2007-08-02 Nick Clifton <nickc@redhat.com>
4643 * typeck.c: Change copyright header to refer to version 3 of the
4644 GNU General Public License and to point readers at the COPYING3
4645 file and the FSF's license web page.
4646 * optimize.c, lang-specs.h, init.c, class.c, repo.c, decl.c,
4647 config-lang.in, cp-tree.def, call.c, decl.h, ptree.c,
4648 Make-lang.in, method.c, rtti.c, cp-objcp-common.c, g++spec.c,
4649 cp-objcp-common.h, except.c, error.c, operators.def, cvt.c,
4650 tree.c, mangle.c, cp-tree.h, dump.c, search.c, friend.c, expr.c,
4651 cp-gimplify.c, cxx-pretty-print.c, cp-lang.c, typeck2.c, pt.c,
4652 cxx-pretty-print.h, semantics.c, name-lookup.c, lex.c, decl2.c,
4653 name-lookup.h, parser.c: Likewise.
4655 2007-08-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4658 * call.c (magic_varargs_p): Honor the "type generic" attribute.
4660 2007-07-30 Paolo Carlini <pcarlini@suse.de>
4663 * semantics.c (finish_label_stmt): Reject the __label__
4664 extension outside function scopes.
4666 2007-07-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4668 * parser.c (eof_token): Un-constify.
4669 (cp_lexer_new_main, cp_lexer_new_from_tokens, VEC_alloc,
4670 cp_lexer_consume_token, cp_lexer_purge_token): Remove spurious
4673 2007-07-28 Kazu Hirata <kazu@codesourcery.com>
4675 * pt.c, tree.c, typeck2.c: Fix comment typos.
4677 2007-07-28 Simon Martin <simartin@users.sourceforge.net>
4678 Mark Mitchell <mark@codesourcery.com>
4681 * name-lookup.c (lookup_name_real): Non namespace-scope bindings can be
4682 hidden due to friend declarations in local classes.
4684 2007-07-27 Douglas Gregor <doug.gregor@gmail.com>
4686 * typeck.c (structural_comptypes): Compare DECLTYPE_TYPE nodes.
4687 * cp-tree.def (DECLTYPE_TYPE): New.
4688 * error.c (dump_type): Dump DECLTYPE_TYPE nodes.
4689 (dump_type_prefix): Ditto.
4690 (dump_type_suffix): Ditto.
4691 * tree.c (DECLTYPE_TYPE): Walk DECLTYPE_TYPE nodes.
4692 * mangle.c (write_type): Handle DECLTYPE_TYPE.
4693 * cp-tree.h (IS_AGGR_TYPE): DECLTYPE_TYPE nodes can be aggregate
4695 (DECLTYPE_TYPE_EXPR): New.
4696 (DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P): New.
4697 (finish_declared_type): Declare.
4698 * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Print
4699 DECLTYPE_TYPE nodes.
4700 (pp_cxx_type_id): Ditto.
4701 * pt.c (for_each_template_parm_r): Walk DECLTYPE_TYPE children.
4702 (tsubst): Substitute into a DECLTYPE_TYPE node.
4703 (tsubst_copy): Ditto.
4704 (unify): Cannot deduce anything from TYPEOF_TYPE or DECLTYPE_TYPE
4706 (dependent_type_p_r): DECLTYPE_TYPE types are always dependent.
4707 * semantics.c (finish_typeof): TYPEOF_TYPE types need to use
4708 structural equality (because we can't hash the expressions).
4709 (finish_declared_type): New.
4710 * lex.c (reswords): Add "decltype" keyword.
4711 * parser.c cp_lexer_next_token_is_decl_specifier_keyword
4712 (cp_parser_postfix_expression): Add member_access_only_p to
4713 restrict postfix expression to member access expressions.
4714 (cp_parser_unary_expression): Update call to
4715 cp_parser_postfix_expression to reflect new parameter.
4716 (cp_parser_declared_type): New.
4717 (cp_parser_simple_type_specifier): Parse decltype types.
4719 2007-07-27 Mark Mitchell <mark@codesourcery.com>
4722 * call.c (convert_for_arg_passing): Only widen bitfields to their
4723 declared types if necessary.
4725 2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4727 * parser.c (cp_parser_string_literal, cp_parser_sizeof_operand):
4730 2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4732 * decl.c (typename_hash, typename_compare): Constify.
4733 * mangle.c (hash_type, compare_type): Likewise.
4734 * pt.c (eq_local_specializations, hash_local_specialization):
4736 * tree.c (cplus_array_hash, cplus_array_compare, list_hash_eq,
4737 list_hash): Likewise.
4738 * typeck2.c (pat_compare): Likewise.
4740 2007-07-24 Nathan Sidwell <nathan@codesourcery.com>
4742 * method.c (implicitly_declare_fn): Increase alignment if member
4743 function pointer format requires it.
4745 2007-07-24 Paolo Carlini <pcarlini@suse.de>
4748 * typeck.c (check_return_expr): Do not pass a null argument
4751 2007-07-24 Paolo Carlini <pcarlini@suse.de>
4754 * decl.c (redeclaration_error_message): Call DECL_ANON_UNION_VAR_P
4757 2007-07-22 Nathan Sidwell <nathan@codesourcery.com>
4760 * typeck.c (convert_arguments): Only use default args if we have
4764 * typeck.c (structural_comptypes): No need to check
4765 resolve_typename_type return value here.
4766 * cp-tree.h (TYPENAME_IS_RESOLVING_P): New.
4767 * pt.c (resolve_typename_type): Follow typename typedefs. Return
4768 original type rather than error_mark_node in case of failure.
4769 * parser.c (cp_parser_nested_name_specifier_opt): Adjust
4770 resolve_typename_type result check.
4771 (cp_parser_direct_declarator, cp_parser_head,
4772 cp_parser_constructor_declarator_p): Likewise.
4774 2007-07-12 Kazu Hirata <kazu@codesourcery.com>
4776 * pt.c (template_parms_variadic_p): Remove.
4777 * cp-tree.h: Remove the prototype for template_parms_variadic_p.
4779 2007-07-12 Jakub Jelinek <jakub@redhat.com>
4782 * error.c (dump_expr) <case AGGR_INIT_EXPR>: Pass true as last
4783 argument to dump_aggr_init_expr_args instead of false.
4785 2007-07-11 Douglas Gregor <doug.gregor@gmail.com>
4787 * typeck.c (comptypes): When USE_CANONICAL_TYPES, use the
4788 canonical types; otherwise, fall back to structural type
4789 comparisons. If ENABLE_CHECKING and USE_CANONICAL_TYPES, give an
4790 internal compiler error if the canonical types are wrong.
4792 2007-07-11 Paolo Carlini <pcarlini@suse.de>
4795 * parser.c (cp_parser_make_indirect_declarator): When the
4796 the code argument is ERROR_MARK return cp_error_declarator.
4798 2007-07-09 Geoffrey Keating <geoffk@apple.com>
4801 * decl.c (cxx_init_decl_processing): Don't set
4802 force_align_functions_log.
4803 (grokfndecl): Honour ptrmemfunc_vbit_in_pfn.
4804 * typeck.c (cxx_alignof_expr): When alignof is used on a plain
4805 FUNCTION_DECL, return its alignment.
4807 2007-07-09 Richard Guenther <rguenther@suse.de>
4809 * decl.c (start_preparsed_function): Do not promote return type.
4811 2007-07-08 Paolo Carlini <pcarlini@suse.de>
4814 * pt.c (unify): Never pass error_mark_node to template_decl_level.
4816 2007-07-07 Mark Mitchell <mark@codesourcery.com>
4819 * pt.c (resolve_overloaded_unification): Robustify. Return a
4821 (type_unification_real): Adjust accordingly.
4823 2007-07-06 Richard Guenther <rguenther@suse.de>
4825 * init.c (build_new_1): Use the correct pointer type.
4826 * typeck2.c (build_m_component_ref): Likewise.
4828 2007-07-05 Mark Mitchell <mark@codesourcery.com>
4831 * init.c (build_zero_init): Always build an initializer for
4833 * typeck2.c (build_functional_cast): Use build_zero_init.
4836 * init.c (build_new_1): Always pass the allocation function to
4837 build_op_delete_call.
4838 * call.c (build_op_delete_call): Handle operator delete with a
4839 variable-argument list. Do not issue an error when no matching
4840 deallocation function is available for a new operator.
4843 * cp-tree.h (any_value_dependent_elements_p): Declare it.
4844 * decl.c (value_dependent_init_p): New function.
4845 (cp_finish_decl): Use it.
4846 * pt.c (value_dependent_expression_p): Use
4847 any_value_dependent_elements_p.
4848 * parser.c (cp_parser_primary_expression): Add comment about
4849 treating dependent qualified names as integral
4850 constant-expressions.
4852 2007-07-04 Douglas Gregor <doug.gregor@gmail.com>
4854 * decl.c (build_ptrmemfunc_type): Always use structural equality
4855 tests when comparing pointer-to-member-function types, because the
4856 handling of TYPE_GET_PTRMEMFUNC_TYPE currently defeats canonical
4859 2007-07-03 Mark Mitchell <mark@codesourcery.com>
4861 * init.c (build_new): Tweak comment.
4863 2007-06-29 Dave Brolley <brolley@redhat.com>
4866 * parser.c (cp_parser_new_type_id): Don't reduce a named array
4867 type to its base type and number of elements here.
4868 * init.c (build_new): Call complete_type_or_else to ensure that the
4869 type is complete and to issue a diagnostic if it is not.
4870 (build_new_1): Don't call complete_type_or_else here.
4872 2007-07-03 Richard Guenther <rguenther@suse.de>
4875 * class.c (fixed_type_or_null): Re-lookup the hashtable slot
4878 2007-07-02 Simon Baldwin <simonb@google.com>
4880 * parser.c (cp_parser_elaborated_type_specifier): Added a warning
4881 for inner-style nested forward declarations that don't declare
4884 2007-07-02 Jakub Jelinek <jakub@redhat.com>
4887 * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
4888 DECL_P in not a variable and appears more than once error messages.
4890 2007-07-01 Ollie Wild <aaw@google.com>
4892 * name-lookup.c (ambiguous_decl): Fix case when new->value is hidden.
4893 (select_decl): Remove function.
4894 (unqualified_namespace_lookup): Populate binding by calling
4895 ambiguous_decl. Remove select_decl call.
4896 (lookup_qualified_name): Remove select_decl call.
4897 * decl.c (lookup_and_check_tag): Check for ambiguous references.
4898 * parser.c (cp_parser_elaborated_type_specifier): Skip redundant error
4899 generation when name lookup is ambiguous.
4901 2007-06-29 Douglas Gregor <doug.gregor@gmail.com>
4904 * init.c (build_new_1): Use structural equality on the copy of the
4907 2007-06-28 Geoffrey Keating <geoffk@apple.com>
4909 * decl2.c (determine_visibility): Implement
4910 flag_visibility_ms_compat effect on type info.
4911 * decl.c (cxx_init_decl_processing): Implement
4912 global effect of flag_visibility_ms_compat.
4914 2007-06-28 Geoffrey Keating <geoffk@apple.com>
4916 * decl2.c (start_objects): Mark constructor-running function
4919 2007-06-26 Simon Martin <simartin@users.sourceforge.net>
4922 * decl.c (grokdeclarator): Reset friendp for member functions declared
4923 friend of their own class.
4925 2007-06-23 Mark Mitchell <mark@codesourcery.com>
4927 * decl2.c (determine_visibility): Don't look for dllexport here.
4928 (determine_visibility_from_class): Tidy.
4930 2007-06-18 Simon Baldwin <simonb@google.com>
4933 * parser.c (cp_parser_single_declaration): Added check for storage
4934 class other than sc_none in parsed declaration, and a flag to indicate
4935 if the call is part of an explicit template specialization parse.
4936 * (cp_parser_explicit_specialization): Specialization check flag added
4937 to call to cp_parser_single_declaration(), set true.
4938 * (cp_parser_template_declaration_after_export): Specialization check
4939 flag added to call to cp_parser_single_declaration(), set false.
4940 * pt.c (check_explicit_specialization): Added code to copy visiblity
4941 and linkage from the templated function to the explicit specialization.
4943 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
4945 * typeck.c (build_binary_op): For templates build the
4946 expression in pieces to avoid the assert in build2_stat.
4947 (get_member_function_from_ptrfunc):
4948 Change over to using POINTER_PLUS_EXPR and convert
4949 the second operand to sizetype.
4950 * typeck2.c (build_m_component_ref): Likewise.
4951 * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR
4952 instead of PLUS_EXPR for pointers.
4953 (build_new_1): Likewise.
4954 (build_vec_delete_1): Likewise.
4955 (build_vec_delete): Likewise.
4956 * class.c (build_base_path): Likewise.
4957 (build_base_path): Likewise.
4958 (convert_to_base_statically): Likewise.
4959 (fixed_type_or_null): Handle POINTER_PLUS_EXPR.
4960 (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR
4961 instead of PLUS_EXPR.
4962 (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR
4963 instead of PLUS_EXPR for pointers.
4964 * call.c (build_special_member_call): Likewise.
4965 * rtti.c (build_headof): Likewise.
4966 Use sizetype instead of ptrdiff_type_node.
4967 (tinfo_base_init): Create a POINTER_PLUS_EXPR
4968 instead of PLUS_EXPR for pointers.
4969 * except.c (expand_start_catch_block): Do a
4970 NEGATIVE and then a POINTER_PLUS_EXPR instead
4972 * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert
4973 PLUS_EXPR on pointer types over to use
4974 POINTER_PLUS_EXPR and remove the conversion
4975 to the pointer types.
4976 * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for
4977 adding to a pointer type. Use size_int instead of
4978 ssize_int. Convert the index to sizetype before
4979 adding it to the pointer.
4981 2007-06-15 Mark Mitchell <mark@codesourcery.com>
4983 * cp-tree.h (DECL_VAR_MARKED_P): Remove.
4984 (DECL_ANON_UNION_VAR_P): New macro.
4985 * class.c (fixed_type_or_null): Tidy. Use a hash table, rather
4986 than DECL_VAR_MARKED_P, to keep track of which variables we have
4988 * decl.c (redeclaration_error_message): Complain about redeclaring
4989 anonymous union members at namespace scope.
4990 * decl2.c (build_anon_union_vars): Set DECL_ANON_UNION_VAR_P.
4992 2007-06-14 Geoff Keating <geoffk@apple.com>
4994 * decl2.c (determine_visibility): Ensure that functions with
4995 hidden types as parameters are hidden.
4998 * decl2.c (determine_visibility): Remove duplicate code for
5001 2007-06-12 Ian Lance Taylor <iant@google.com>
5004 * init.c (avoid_placement_new_aliasing): New static function.
5005 (build_new_1): Call it.
5007 2007-06-11 Rafael Ávila de Espíndola <espindola@google.com>
5009 * cp-objcp-common.h (LANG_HOOKS_SIGNED_TYPE): Remove.
5010 (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove.
5012 2007-06-08 Jakub Jelinek <jakub@redhat.com>
5015 * semantics.c (finish_omp_for): Call fold_build_cleanup_point_expr
5016 on init, the non-decl cond operand and increment value.
5018 2007-06-07 Simon Martin <simartin@users.sourceforge.net>
5021 * decl.c (check_initializer): Report an error when a brace enclosed
5022 initializer is used for a non-aggregate type in C++98.
5023 (redeclaration_error_message): Rewrote flag_cpp0x in terms of
5025 (grokdeclarator): Likewise.
5026 (move_fn_p): Likewise.
5027 * typeck.c (check_return_expr): Likewise.
5028 * call.c (reference_binding): Likewise.
5029 * error.c (cp_cpp_error): Likewise.
5030 * pt.c (check_default_tmpl_args): Likewise.
5032 * lex.c (init_reswords): Likewise.
5033 * parser.c (p_parser_primary_expression): Likewise.
5034 (TOKEN_PRECEDENCE): Likewise.
5035 (cp_parser_init_declarator): Likewise.
5036 (cp_parser_ptr_operator): Likewise.
5037 (cp_parser_parameter_declaration): Likewise.
5038 (cp_parser_enclosed_template_argument_list): Likewise.
5039 (cp_parser_skip_to_end_of_template_parameter_list): Likewise.
5040 (cp_parser_next_token_ends_template_argument_p): Likewise.
5042 2007-06-04 Simon Baldwin <simonb@google.com>
5044 * decl.c (grokdeclarator): Readability change. Moved case labels
5045 into direct switch statement scope.
5047 2007-06-04 Paolo Carlini <pcarlini@suse.de>
5049 * call.c (convert_like_real): Remove pointless code.
5051 2007-05-31 Mark Mitchell <mark@codesourcery.com>
5053 * decl.c (get_atexit_fn_ptr_type): New function.
5054 (get_atexit_node): Use it.
5055 (start_cleanup_fn): Likewise.
5056 (register_dtor_fn): Use the object's destructor, instead of a
5057 separate cleanup function, where possible.
5058 * cp-tree.h (CPTI_ATEXIT_FN_PTR_TYPE): New enumerator.
5059 (atexit_fn_ptr_type_node): New macro.
5060 * decl2.c (build_cleanup): Use build_address.
5062 2007-05-31 Daniel Berlin <dberlin@dberlin.org>
5064 * typeck.c (build_binary_op): Include types in error.
5066 2007-05-31 Jakub Jelinek <jakub@redhat.com>
5069 * decl.c (cp_finish_decl): Also clear was_readonly if a static var
5070 needs runtime initialization.
5072 2007-05-31 Paolo Carlini <pcarlini@suse.de>
5075 * semantics.c (finish_trait_expr): Complete the types.
5077 2007-05-30 Russell Yanofsky <russ@yanofsky.org>
5078 Douglas Gregor <doug.gregor@gmail.com>
5079 Pedro Lamarao <pedro.lamarao@mndfck.org>
5080 Howard Hinnant <howard.hinnant@gmail.com>
5084 * typeck.c (comptypes): Don't consider rvalue and lvalue
5085 reference types to be equivalent.
5086 (check_return_expr): Move from certain lvalues when returning
5088 * decl.c (grokdeclarator): Implement reference collapsing.
5089 (copy_fn_p): Don't consider constructors taking rvalue references
5090 to be copy constructors.
5092 * call.c (conversion): New "rvaluedness_matches_p" member.
5093 (convert_class_to_reference): Require reference type as first
5094 parameter instead of base type.
5095 (reference_binding): Add logic to handle rvalue references.
5096 (implicit_conversion): Update inaccurate comment.
5097 (convert_like_real): Disable creation of temporaries that are
5098 impossible to initialize for types with move constructors.
5099 (build_over_call): Elide move constructors when possible.
5100 (maybe_handle_implicit_object): Set "rvaluedness_matches_p".
5101 (maybe_handle_ref_bind): Return conversion instead of type node.
5102 (compare_ics): Add logic to use "rvaluedness_matches_p" values to
5103 determine preferred conversion sequences.
5104 * cp-tree.h (TYPE_REF_IS_RVALUE): New.
5105 (LOOKUP_PREFER_RVALUE): New.
5106 (DECL_MOVE_CONSTRUCTOR_P): New.
5107 (struct cp_declarator): Add "reference" member for reference
5108 types, with new "rvalue_ref" flag.
5109 (cp_build_reference_type): Declare.
5110 (move_fn_p): Declare.
5111 * error.c (dump_type_prefix): Format rvalue reference types
5112 correctly in error messages.
5113 * except.c (build_throw): Move from certain lvalues when
5115 * mangle.c (write_type): Mangle rvalue references differently
5116 than regular references.
5117 * parser.c (make_reference_declarator): Add boolean parameter for
5119 (cp_parser_make_indirect_declarator): New.
5120 (cp_parser_new_declarator_opt): Call
5121 cp_parser_make_indirect_declarator.
5122 (cp_parser_conversion_declarator_opt): Ditto.
5123 (cp_parser_declarator): Ditto.
5124 (cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference
5126 * pt.c (tsubst): Implement reference collapsing.
5127 (maybe_adjust_types_for_deduction): Implement special template
5128 parameter deduction rule for rvalue references.
5129 (type_unification_real): Update calls to
5130 maybe_adjust_types_for_deduction.
5131 (try_one_overload): Ditto.
5132 (unify_pack_expansion): Ditto.
5133 * tree.c (lvalue_p_1): Handle rvalue reference types.
5134 (cp_build_reference_type): New.
5136 2007-05-30 Jakub Jelinek <jakub@redhat.com>
5139 * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC
5140 variables that need runtime initialization.
5142 2007-05-28 Andrew Pinski <Andrew_pinski@playstation.sony.com>
5145 * typeck.c (build_unary_op <case PREINCREMENT_EXPR,
5146 case POSTINCREMENT_EXPR, case PREDECREMENT_EXPR,
5147 case POSTDECREMENT_EXPR>): Return the error_mark_node
5148 if either the real or imaginary parts would an
5151 2007-05-25 Simon Martin <simartin@users.sourceforge.net>
5152 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5155 * parser.c (cp_parser_skip_to_closing_brace): Return true if the next
5156 token is a closing brace, false if there are no tokens left.
5157 (cp_parser_namespace_alias_definition): Only consume the next token if
5158 it is a closing brace.
5160 * parser.c (cp_parser_class_specifier): Likewise.
5162 2007-05-25 H.J. Lu <hongjiu.lu@intel.com>
5164 * semantics.c (finish_member_declaration): Fix a typo in the
5167 2007-05-25 Douglas Gregor <doug.gregor@gmail.com>
5179 * error.c (dump_type): Dump TYPE_ARGUMENT_PACK nodes.
5180 * cp-tree.h (check_for_bare_parameter_packs): Returns bool.
5181 * pt.c (check_for_bare_parameter_packs): Return bool indicated
5182 whether everything was okay. Fix indentation.
5183 (push_template_decl_real): Check for bare parameter packs in
5184 function parameters; where errors occur, mark the parameter types
5185 with ERROR_MARK_NODEs to avert ICEs.
5186 (coerce_template_parameter_pack): New.
5187 (coerce_template_parms): Moved parameter pack coercion into
5188 coerce_template_parameter_pack, and permit it anywhere in the
5189 template parameter list (not just at the end). Parameter and
5190 argument indices can vary (somewhat) separately now, so add
5191 PARM_IDX and ARG_IDX.
5192 (fn_type_unification): Don't set an argument pack as incomplete if
5193 no argument pack was deduced.
5194 (type_unification_real): If a type parameter is a parameter pack
5195 and has not otherwise been deduced, it will be deduced to an empty
5197 (more_specialized_fn): Use the actual lengths of the argument
5198 lists when comparing against expansions.
5199 * semantics.c (finish_member_declaration): If a field's type has
5200 bare parameter packs, error and set its type to ERROR_MARK_NODE.
5202 2007-05-24 Danny Smith <dannysmith@users.sourceforge.net>
5205 * mangle.c (mangle_decl): Call targetm.mangle_decl_assembler_name.
5207 2007-05-22 Ollie Wild <aaw@google.com>
5209 * name-lookup.c (ambiguous_decl): Adds check for hidden types.
5210 (unqualified_namespace_lookup): Adds check for hidden types.
5212 2007-05-22 Ollie Wild <aaw@google.com>
5214 * decl.c (duplicate_decls): Verify namespace names are unique.
5216 2007-05-21 Mark Mitchell <mark@codesourcery.com>
5218 * decl.c (cxx_maybe_build_cleanup): Handle
5219 __attribute__((cleanup)).
5221 2007-05-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5223 * cvt.c (cp_convert_and_check): Don't check warnings if the
5226 2007-05-18 Geoffrey Keating <geoffk@apple.com>
5228 * mangle.c (write_real_cst): Use 'unsigned long' for %lx.
5230 2007-05-14 Paolo Carlini <pcarlini@suse.de>
5233 * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the
5234 type only if is a class type (5.2.8/4).
5236 2007-05-14 Rafael Ávila de Espíndola <espindola@google.com>
5238 * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
5239 * decl.c (grokdeclarator): Use unsigned_type_for instead of
5240 c_common_unsigned_type.
5242 2007-05-11 Silvius Rus <rus@google.com>
5244 * typeck.c (build_indirect_ref): Add call to
5245 strict_aliasing_warning.
5246 (build_reinterpret_cast_1): Condition call to
5247 strict_aliasing_warning.
5249 2007-05-11 Jan Hubicka <jh@suse.cz>
5251 * semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
5252 * decl2.c (start_objects): ctors and dtors are no longer public.
5253 (cp_write_global_declarations): Do not call c_build_cdtor_fns.
5255 2007-05-07 Andrew Pinski <andrew_pinski@playstation.sony.com>
5257 * typeck.c (build_unary_op): Remove code that used to
5258 handle non lvalue increments/decrements.
5260 2007-05-07 Mike Stump <mrs@apple.com>
5262 * parser.c (check_empty_body): Add.
5263 (cp_parser_iteration_statement): Add call to check_empty_body.
5265 2007-05-05 Geoffrey Keating <geoffk@apple.com>
5268 * mangle.c (write_mangled_name): Mangle static variable names.
5269 (write_unqualified_name): Use local-source-name for
5270 namespace-scope static variables.
5272 2007-05-04 Dirk Mueller <dmueller@suse.de>
5274 * cp-tree.h (DECL_MAIN_P): only if -ffreestanding is
5277 2007-05-02 Seongbae Park <seongbae.park@gmail.com>
5280 * decl2.c (constrain_class_visibility):
5281 Use strip_pointer_or_array_types instead of strip_array_types.
5283 2007-04-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
5286 * decl.c (reshape_init_r): Don't reshape the first element if it
5287 is a pointer to member function.
5289 2007-04-27 Simon Baldwin <simonb@google.com>
5291 * decl.c (grokparms): Changed message format from %qD to %qE.
5293 2007-04-27 Douglas Gregor <doug.gregor@gmail.com>
5295 * error.c (maybe_warn_variadic_templates): Variadic templates are
5296 now in C++0x, so only warn about them in C++98 mode.
5298 2007-04-26 Andrew Pinski <andrew_pinski@playstation.sony.com>
5301 * typeck.c (build_reinterpret_cast_1): Only allow conversion to
5302 integeral types from vectors types.
5304 2007-04-26 Jakub Jelinek <jakub@redhat.com>
5307 * semantics.c (finish_omp_clauses): Don't create CP_OMP_CLAUSE_INFO
5308 for type dependent OMP_CLAUSE_DECLs.
5310 2007-04-24 Mark Mitchell <mark@codesourcery.com>
5313 * cp-tree.h (ARITHMETIC_TYPE): Include COMPLEX_TYPE.
5314 * typeck.c (type_after_usual_arithmetic_conversions): Adjust, as
5315 COMPLEX_TYPE is now an ARITHMETIC_TYPE.
5316 * init.c (build_zero_init): Adjust, as
5317 COMPLEX_TYPE is now a SCALAR_TYPE.
5318 * typeck2.c (digest_init): Allow brace-enclosed initializers for
5319 COMPLEX_TYPE, even though that is now a SCALAR_TYPE.
5321 2007-04-25 Paolo Carlini <pcarlini@suse.de>
5323 * semantics.c (classtype_has_nothrow_copy_or_assign_p): Adjust
5324 per N2255; rename as classtype_has_nothrow_assign_or_copy_p.
5325 (trait_expr_value): Adjust.
5327 2007-04-23 Simon Baldwin <simonb@google.com>
5329 * decl.c (grokparms): Added new error for duplicate function
5330 parameters names in function prototypes, to match gcc behavior.
5332 2007-04-23 Jan Hubicka <jh@suse.cz>
5334 * decl2.c (finish_objects): Do not call target constructor/destructor
5337 2007-04-21 Andrew Pinski <andrew_pinski@playstation.sony.com>
5339 * cp-tree.h (lang_tree_node): Use GENERIC_NEXT
5340 instead of checking GIMPLE_STMT_P in chain_next.
5342 2007-04-17 Mark Mitchell <mark@codesourcery.com>
5345 * call.c (convert_for_arg_passing): Convert bitfields to their
5348 2007-04-17 Simon Martin <simartin@users.sourceforge.net>
5351 * pt.c (value_dependent_expression_p): Handle MODOP_EXPRs.
5353 2007-04-16 Seongbae Park <seongbae.park@gmail.com>
5356 * decl2.c (constrain_class_visibility):
5357 Do not warn about the use of anonymous namespace in the main input file.
5359 2007-04-15 Mark Mitchell <mark@codesourcery.com>
5361 * cp-tree.h (current_template_parms): Fix typo in comment.
5363 2007-04-15 Kazu Hirata <kazu@codesourcery.com>
5365 * cp-tree.h, error.c: Fix comment typos.
5367 2007-04-13 Jason Merrill <jason@redhat.com>
5370 * call.c (reference_binding): Add c_cast_p parm. If true,
5371 add quals to TO as needed to make it reference-compatible.
5373 2007-04-11 Jan Hubicka <jh@suse.cz>
5375 * class.c (convert_to_base_statically): Fold produced tree; verify
5376 that we are not processing template_decl.
5378 2007-04-09 Mark Mitchell <mark@codesourcery.com>
5381 * class.c (build_base_path): Ensure that the converted pointer has
5382 the same cv-qualification as the input.
5384 2007-04-09 Paolo Carlini <pcarlini@suse.de>
5386 * tree.c (cp_tree_equal): Deal with TRAIT_EXPR.
5388 2007-04-08 Steven Bosscher <steven@gcc.gnu.org>
5390 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS):
5392 (LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P): Do not set it.
5393 * tree.c (cp_add_pending_fn_decls): Remove.
5394 * cp-tree.h (cp_add_pending_fn_decls): Remove prototype.
5396 2007-04-07 Daniel Berlin <dberlin@dberlin.org>
5398 Revert change removing staticp.
5400 2007-04-06 Daniel Berlin <dberlin@dberlin.org>
5402 * cp-objcp-common.c (cxx_staticp): Remove.
5403 * cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
5404 * cp-tree.h (cxx_staticp):
5406 2007-04-04 Danny Smith <dannysmith.users.sourceforge.net>
5408 * class.c (check_for_override): Don't remove dllmport attribute
5411 2007-04-03 Jakub Jelinek <jakub@redhat.com>
5414 * typeck.c (build_modify_expr): For COND_EXPR on LHS, if RHS has void
5415 type issue error and return early.
5417 2007-03-30 Jason Merrill <jason@redhat.com>
5420 * typeck.c (cp_type_readonly): New fn.
5421 * cp-tree.h: Declare it.
5422 * decl.c (start_decl): Set implicit DECL_THIS_STATIC here.
5423 (cp_finish_decl): Not here.
5425 2007-03-31 Richard Guenther <rguenther@suse.de>
5427 * optimize.c (maybe_clone_body): Replace splay-tree usage by
5430 2007-03-31 Douglas Gregor <doug.gregor@gmail.com>
5435 * parser.c (declarator_can_be_parameter_pack): New.
5436 (cp_parser_template_parameter): Only parse the `...' if the
5437 declarator can be a parameter pack.
5438 (cp_parser_parameter_declaration): Ditto. Also, handle when TYPE
5440 * pt.c (find_parameter_packs_r): Look into the bounds on integer
5441 types (they could be used as array bounds).
5442 (check_for_bare_parameter_packs): Deal with TEMPLATE_PARM_INDEX.
5443 (tsubst_pack_expansion): Handle failure to expand parameter
5446 2007-03-30 Paolo Carlini <pcarlini@suse.de>
5449 * cp-tree.h (enum cp_trait_kind, struct tree_trait_expr,
5450 TRAIT_EXPR_TYPE1, TRAIT_EXPR_TYPE2, TRAIT_EXPR_KIND): Add.
5451 (enum cp_tree_node_structure_enum, union lang_tree_node): Update.
5452 (CLASS_TYPE_NON_UNION_P): Add.
5453 (struct lang_type_class): Add has_complex_dflt.
5454 (TYPE_HAS_COMPLEX_DFLT, TYPE_HAS_TRIVIAL_DFLT): Add.
5455 (locate_copy, locate_ctor, locate_dtor, finish_trait_expr): Declare.
5456 * cp-tree.def: Add TRAIT_EXPR.
5457 * cp-objcp-common.c (cp_tree_size): Add TRAIT_EXPR case.
5458 * lex.c (struct resword): Add __has_nothrow_assign,
5459 __has_nothrow_constructor, __has_nothrow_copy, __has_trivial_assign,
5460 __has_trivial_constructor, __has_trivial_copy,
5461 __has_trivial_destructor, __has_virtual_destructor, __is_abstract,
5462 __is_base_of, __is_class, __is_convertible_to, __is_empty, __is_enum,
5463 __is_pod, __is_polymorphic, __is_union.
5464 * parser.c (cp_parser_primary_expression): Deal with the new RIDs.
5465 (cp_parser_trait_expr): New.
5466 * semantics.c (finish_trait_expr, trait_expr_value
5467 classtype_has_nothrow_copy_or_assign_p): New.
5468 * method.c (locate_copy, locate_ctor, locate_dtor): Do not define
5470 * decl.c (cp_tree_node_structure): Add TRAIT_EXPR.
5471 * class.c (check_bases, check_field_decl, check_bases_and_members):
5472 Deal with TYPE_HAS_COMPLEX_DFLT (t) too.
5473 * pt.c (uses_template_parms, tsubst_copy_and_build,
5474 value_dependent_expression_p, type_dependent_expression_p): Deal with
5476 * tree.c (cp_walk_subtrees): Deal with TRAIT_EXPR.
5478 2007-03-29 Richard Guenther <rguenther@suse.de>
5480 * tree.c (cp_walk_subtrees): Do not set input_location.
5482 2007-03-28 Simon Martin <simartin@users.sourceforge.net>
5485 * decl.c (grokfndecl): Properly setup decl if it is a constructor or a
5488 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
5490 * parser.c (struct cp_parser): Update comment for
5491 greater_than_is_operator_p.
5492 (cp_parser_primary_expression): In C++0x mode, a cast operator can
5493 be terminated with a `>>' token when !GREATER_THAN_IS_OPERATOR_P.
5494 (TOKEN_PRECEDENCE): In C++0x mode, `>>' is treated like `>' when
5495 !GREATER_THAN_IS_OPERATOR_P.
5496 (cp_parser_binary_expression): When -Wc++0x-compat, warn about
5497 `>>' operators that will become two `>' tokens in C++0x.
5498 (cp_parser_parameter_declaration): Treat `>>' like `>' in C++0x
5499 mode, allowing it to terminate default arguments.
5500 (cp_parser_enclosed_template_argument_list): In C++0x mode, treat
5501 `>>' like two consecutive `>' tokens.
5502 (cp_parser_skip_to_end_of_template_parameter_list): Ditto.
5503 (cp_parser_next_token_ends_template_argument_p): In C++0x, `>>'
5504 ends a template argument.
5506 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
5508 * decl.c (redeclaration_error_message): Complain when redeclaring
5509 a friend function with default template arguments (C++0x mode only).
5510 * cp-tree.h (check_default_tmpl_args): Declare.
5511 * pt.c (check_default_tmpl_args): In C++0x mode, permit default
5512 template arguments in function templates. Add support for checking
5513 the default template arguments of friend templates.
5514 (push_template_decl_real): Fix call to check_default_tmpl_args.
5515 (type_unification_real): If a template parameter has not been
5516 deduced but provides a default template argument, substitute into
5517 that default template argument.
5518 * parser.c (cp_parser_init_declarator): When declaring (but not
5519 defining!) a function template in C++0x mode, check for default
5522 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
5525 * decl.c (grokdeclarator): Deal with cv-qualified function type
5526 typedefs in the same way for member and non-member functions.
5528 2007-03-26 Dirk Mueller <dmueller@suse.de>
5530 * parser.c (cp_parser_member_declaration): Pedwarn
5531 about stray semicolons after member declarations.
5533 2007-03-26 Paolo Carlini <pcarlini@suse.de>
5536 * pt.c (instantiate_decl): Set in_system_header.
5538 2007-03-22 Mark Mitchell <mark@codesourcery.com>
5540 * cp-tree.h (current_tempalte_parms): Improve documentation.
5541 * pt.c (current_template_args): Likewise.
5544 * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Do
5545 not consume tokens when failing.
5547 2007-03-22 Jim Wilson <wilson@specifix.com>
5548 Mark Mitchell <mark@codesourcery.com>
5551 * call.c (standard_conversion): Use type_decays_to. Keep FCODE
5552 consistent with FROM.
5554 2007-03-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
5556 * error.c (dump_expr): Handle dependent names that designate types.
5557 * cxx-pretty-print.c (pp_cxx_unqualified_id): Handle TYPENAME_TYPE.
5559 2007-03-17 Kazu Hirata <kazu@codesourcery.com>
5561 * cp-tree.def, parser.c, pt.c: Fix comment typos.
5563 2007-03-16 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5565 * cvt.c (cp_convert_and_check) : Define.
5566 * cp-tree.h (cp_convert_and_check): Declare.
5567 * call.c (convert_conversion_warnings): Rename to
5568 conversion_null_warnings. The warning for floating-point to
5569 integer is handled by convert_and_check in convert_like_real.
5570 (convert_like_real): convert_conversion_warnings was renamed as
5571 conversion_null_warnings.
5572 * typeck.c (build_binary_op): Use cp_convert_and_check to warn for
5573 overflow and changes of value during conversion.
5575 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5578 * parser.c (cp_parser_statement): If 'namespace' is found, this
5579 only can be a namespace alias definition, so parse it now.
5580 (cp_parser_namespace_alias_definition): if we find an open brace
5581 instead of '=', then this is actually a misplaced namespace
5584 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5587 * decl.c (cxx_init_decl_processing): Move command-line options
5588 processing to c-opts.c.
5590 2007-03-15 Douglas Gregor <doug.gregor@gmail.com>
5592 * ptree.c (cxx_print_type): Use formatting markup for integers
5593 when printing template parameter index/level/orig level.
5594 (cxx_print_xnode): Ditto.
5595 * cp-tree.h (TEMPLATE_PARM_PARAMETER_PACK): Use TREE_LANG_FLAG_0.
5596 (struct template_parm_index_s): Remove the PARAMETER_PACK member.
5597 Make INDEX, LEVEL, and ORIG_LEVEL integers instead of
5599 (struct saved_scope): Make X_PROCESSING_TEMPLATE_DECL an int,
5600 rather than a HOST_WIDE_INT.
5601 Turn X_PROCESSING_EXPLICIT_INSTANTIATION, SKIP_EVALUATION, and
5602 NEED_POP_FUNCTION_CONTEXT into bool bitfields; reorder fields for
5604 (struct language_function): Make RETURNS_VALUE, RETURNS_NULL,
5605 RETURNS_ABNORMALLY, IN_FUNCTION_TRY_HANDLER, and
5606 IN_BASE_INITIALIZER bool bitfields.
5607 (struct cp_declarator): Make KIND a 4-bit field. Make
5608 PARAMETER_PACK_P a bool bitfield just after KIND.
5609 * pt.c (uses_parameter_packs): Destroy the pointer set.
5610 (make_pack_expansion): Ditto.
5611 (check_for_bare_parameter_packs): Ditto.
5612 * name-lookup.c (push_to_top_level): Make need_pop a bool value.
5614 2007-03-14 Andrew Pinski <andrew_pinski@playstation.sony.com>
5617 * call.c (convert_default_arg): Instead of copying the node,
5620 2007-03-15 Dirk Mueller <dmueller@suse.de>
5623 * call.c (convert_conversion_warnings): New..
5624 (convert_like_real): .. factored out from here.
5625 (convert_conversion_warnings): Add warning about
5626 false being converted to NULL in argument passing.
5628 2007-03-14 Dirk Mueller <dmueller@suse.de>
5630 * semantics.c (c_finish_if_stmt): Call empty_if_body_warning.
5631 (finish_do_body): Warn about empty body in do/while statement.
5633 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5635 * class.c (warn_hidden): Add OPT_Woverloaded_virtual to warning.
5637 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5640 * typeck.c (build_binary_op): Call warn_for_div_zero instead of
5643 2007-03-13 Alexandre Oliva <aoliva@redhat.com>
5645 * repo.c (init_repo): Initialize random_seed saved options.
5646 (finish_repo): Adjust.
5648 2007-03-13 Mark Mitchell <mark@codesourcery.com>
5651 * Make-lang.in (doc/g++.1): Use $< to specify the location from
5654 2007-03-12 Seongbae Park <seongbae.park@gmail.com>
5656 * decl.c (compute_array_index_type): New warning flag warn_vla.
5658 2007-03-12 Mark Mitchell <mark@codesourcery.com>
5661 * call.c (convert_default_arg): Copy non-constant arguments.
5663 2007-03-11 Mark Mitchell <mark@codesourcery.com>
5666 * parser.c (cp_parser_postfix_expression): Disallow compound
5667 literals in constant expressions.
5670 * semantics.c (finish_typeof): Use unlowered_expr_type.
5672 2007-03-10 Mark Mitchell <mark@codesourcery.com>
5675 * cp-tree.h (unlowered_expr_type): New function.
5676 * typeck.c (is_bitfield_expr_with_lowered_type): Handle
5677 COMPOUND_EXPR, MODIFY_EXPR, and SAVE_EXPR.
5678 (unlowered_expr_type): New function.
5679 (build_unary_op): Disallow predecrements of bool bitfields.
5680 * call.c (build_conditional_expr): Use unlowered_expr_type.
5681 * pt.c (type_unification_real): Likewise.
5683 2007-03-09 Douglas Gregor <doug.gregor@gmail.com>
5686 * typeck.c (check_return_expr): Check for bare parameter packs.
5687 (comptypes): Compare template parameter packs and
5688 type pack expansions.
5689 * decl.c (grokdeclarator): Deal with the declaration of function
5691 (grokparms): Verify that the (optional) function parameter pack is
5692 at the end of the parameter list.
5693 (xref_basetypes): Handle pack expansions in the base class.
5694 (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT.
5695 * cp-tree.def (TYPE_ARGUMENT_PACK): New.
5696 (NONTYPE_ARGUMENT_PACK): New.
5697 (TYPE_PACK_EXPANSION): New.
5698 (EXPR_PACK_EXPANSION): New.
5699 (ARGUMENT_PACK_SELECT): New.
5700 * cp-objcp-common.c (cp_tree_size): Compute size of
5701 (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and
5702 ARGUMENT_PACK_SELECT.
5703 * error.c (dump_template_argument): Print template argument packs.
5704 (dump_template_argument_list): Ditto.
5705 (dump_template_parameter): Dump `...' for template type parameter
5707 (dump_type): Dump TYPE_PACK_EXPANSION nodes.
5708 (dump_parameters): Print function parameter packs.
5709 (dump_template_parms): Print template argument packs.
5710 (dump_expr): Dump EXPR_PACK_EXPANSION nodes.
5711 (maybe_warn_variadic_templates): New.
5712 * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION.
5713 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
5714 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
5716 * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION.
5717 (write_template_arg): Write argument packs as separate arguments.
5718 * cp-tree.h (struct template_parm_index_s): Add flag that
5719 indicates that the template parameter is actually a parameter
5721 (struct tree_argument_pack_select): New.
5722 (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT.
5723 (union lang_tree_node): Add argument_pack_select.
5724 (FUNCTION_PARAMETER_PACK_P): New.
5725 (PACK_EXPANSION_P): New.
5726 (PACK_EXPANSION_PATTERN): New.
5727 (SET_PACK_EXPANSION_PATTERN): New.
5728 (PACK_EXPANSION_PARAMETER_PACKS): New.
5729 (ARGUMENT_PACK_P): New.
5730 (ARGUMENT_PACK_ARGS): New.
5731 (SET_ARGUMENT_PACK_ARGS): New.
5732 (ARGUMENT_PACK_INCOMPLETE_P): New.
5733 (ARGUMENT_PACK_EXPLICIT_ARGS): New.
5734 (TEMPLATE_PARM_PARAMETER_PACK): New.
5735 (TEMPLATE_TYPE_PARAMETER_PACK): New.
5736 (ARGUMENT_PACK_SELECT_FROM_PACK): New.
5737 (ARGUMENT_PACK_SELECT_INDEX): New.
5738 (ARGUMENT_PACK_SELECT_ARG): New.
5739 (struct cp_declarator): Add parameter_pack_p flag.
5740 (maybe_warn_variadic_templates): Declare.
5741 (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to
5742 indicate a template parameter pack.
5743 (uses_parameter_packs): Declare.
5744 (template_parameter_pack_p): Declare.
5745 (template_parms_variadic_p): Declare.
5746 (make_pack_expansion): Declare.
5747 (check_for_bare_parameter_packs): Declare.
5748 * cxx-pretty-print.c (pp_cxx_unary_expression): Print
5749 sizeof... expressions.
5750 (pp_cxx_expression): Print pack expansions and non-type argument
5752 (pp_cxx_exception_specification): Print pack expansions.
5753 (pp_cxx_direct_declarator): Print ellipsis for parameter packs.
5754 (pp_cxx_ctor_initializer): Print pack expansions.
5755 (pp_cxx_type_id): Print pack expansions.
5756 (pp_cxx_template_argument_list): Print argument packs.
5757 (pp_cxx_template_parameter): Print ellipsis for template parameter
5759 * pt.c (comp_template_parms): Compare template parameter packs.
5760 (template_parameter_pack_p): New.
5761 (template_parms_variadic_p): New.
5762 (template_args_variadic_p): New.
5763 (make_ith_pack_parameter_name): New.
5764 (struct find_parameter_pack_data): New.
5765 (find_parameter_packs_r): New.
5766 (uses_parameter_packs): New.
5767 (make_pack_expansion): New.
5768 (check_for_bare_parameter_packs): New.
5769 (expand_template_argument_pack): New.
5770 (reduce_template_parm_level): Propagate parameter pack flag.
5771 (process_template_parm): Add is_parameter_pack parameter to state
5772 when the parameter is actually a parameter pack. Create template
5773 parameter packs when is_parameter_pack is true.
5774 (current_template_args): The argument for a template parameter
5775 pack is an argument pack containing a single pack expansion.
5776 (process_partial_specialization): When checking that non-type
5777 argument expressions do not involve template parameters, loop over
5778 the arguments in argument packs separately.
5779 (push_template_decl_real): Check that the type of the declaration
5780 does not have any bare parameter packs. Check that primary
5781 templates have no more than one parameter pack, and that it comes
5782 at the end of the template parameter list.
5783 (convert_template_argument): Handle coercions for pack expansion
5784 expressions by coercing the pattern then rebuilding the expansion.
5785 (coerce_template_parms): When coercing the arguments for a
5786 variadic template, pack "extra" arguments into an argument pack.
5787 (coerce_template_template_parms): Cannot coerce between parameter
5788 packs and non-pack parameters.
5789 (template_args_equal): Compare PACK_EXPANSION_P expressions.
5790 (comp_template_args): Expand all template arguments packs before
5791 comparing template argument lists.
5792 (mangle_class_name_for_template): Make argument packs as separate
5794 (for_each_template_parm_r): No need to handle BASELINK.
5795 (instantiate_class_template): Handle pack expansions in the base
5797 (tsubst_pack_expansion): New.
5798 (tsubst_template_args): Handle substitutions of argument packs and
5799 pack expansion into template argument lists.
5800 (tsubst_decl): Expand function parameter packs into separate
5801 function parameters.
5802 (tsubst_arg_types): Expand a type pack expansion into separate
5804 (tsubst_exception_specification): Handle pack expansions in
5805 exception specifiers.
5806 (tsubst): See through ARGUMENT_PACK_SELECT arguments when
5807 replacing a template parameter with its argument. If we encounter
5808 a substitution for an argument pack, just return the parameter
5810 (tsubst_copy): sizeof(X...) returns the number of elements in
5811 parameter pack X. See through ARGUMENT_PACK_SELECT when the
5812 PARM_DECL is a parameter pack.
5813 (tsubst_expr): Expression pack expansions and argument packs
5814 cannot show up here; they will all be handled through function
5815 calls, sizeof, and template argument lists.
5816 (tsubst_copy_and_build): sizeof(X...) returns the number of
5817 elements in parameter pack X. Handle pack expansions in TREE_LIST
5818 and CONSTRUCTOR nodes.
5819 (fn_type_unification): Handle "incomplete" explicit template
5820 argument lists that specify some of the arguments for a template
5822 (type_unification_real): Unify arguments against pack expansions.
5823 (template_parm_level_and_index): New, helper function.
5824 (unify_pack_expansion): New.
5825 (unify): Unify argument packs on an argument-by-argument basis,
5826 handling variadic argument packs as well.
5827 (more_specialized_fn): Handle unification of function parameter
5828 packs. All things being equal, prefer non-variadic function
5829 templates to variadic function templates.
5830 (more_specialized_class): Prefer the variadic class template
5831 partial specialization that binds fewer arguments to a parameter
5833 (regenerate_decl_from_template): Expand function parameter packs
5834 into separate parameters.
5835 (instantiate_decl): Ditto.
5836 (tsubst_initializer_list): Handle pack expansions for base-class
5838 (dependent_type_p_r): Determine dependent types in argument packs
5839 and pack expansions.
5840 (value_dependent_expression_p): Determine value-dependence of
5841 non-type argument packs.
5842 (dependent_template_arg_p): Handle argument packs.
5843 * semantics.c (finish_cond): Check for bare parameter packs.
5844 (finish_expr_stmt): Ditto.
5845 (finish_for_expr): Ditto.
5846 (finish_switch_cond): Ditto.
5847 (finish_mem_initializers): Ditto.
5848 * name-lookup.c (arg_assoc_type): Handle pack expansions and
5850 * decl2.c (cp_build_parm_decl): Mark function parameter packs.
5851 * parser.c (make_declarator): Declarator is not an expansion.
5852 (make_pointer_declarator): Transfer parameter pack flag to outer
5854 (make_reference_declarator): Ditto.
5855 (make_ptrmem_declarator): Ditto.
5856 (make_call_declarator): Ditto.
5857 (make_array_declarator): Ditto.
5858 (cp_parser_postfix_expression): Allow pack expansion expressions
5859 in the argument list for a call expression.
5860 (cp_parser_parenthesized_expression_list): Add new parameter
5861 ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand
5862 into separate arguments."
5863 (cp_parser_new_placement): Allow pack expansion expressions.
5864 (cp_parser_new_initializer): Ditto.
5865 (cp_parser_mem_initializer_list): Allow ellipsis to create a
5866 base-class initializer expansion.
5867 (cp_parser_mem_initializer): Ditto.
5868 (cp_parser_template_parameter_list): Keep track of whether the
5869 template parameter is a template parameter pack.
5870 (cp_parser_template_parameter): Parse the ellipsis to indicate a
5871 template parameter pack.
5872 (cp_parser_type_parameter): Ditto.
5873 (cp_parser_template_argument_list): Parse the ellipsis to indicate
5875 (cp_parser_direct_declarator): Parse the ellipsis to indicate that
5876 this declarator is a parameter pack.
5877 (cp_parser_parameter_declaration): The ellipsis does not end the
5878 parameter declaration, because it might be a parameter pack. Parse
5879 the ellipsis to indicate a parameter pack.
5880 (cp_parser_initializer): Allow pack expansions.
5881 (cp_parser_initializer_list): Allow ellipsis to create an
5882 initializer expansion.
5883 (cp_parser_base_clause): Allow ellipsis to create a base specifier
5885 (cp_parser_type_id_list): Allow ellipsis to create an exception
5886 specifier expansion.
5887 (cp_parser_attribute_list): Don't allow pack expansions.
5888 (cp_parser_functional_cast): Allow pack expansions.
5889 (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to
5890 compute the length of a parameter pack.
5891 (cp_parser_next_token_ends_template_argument_p): An ellipsis can
5892 end a template argument.
5893 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
5894 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
5897 2007-03-09 Dirk Mueller <dmueller@suse.de>
5899 * call.c (build_new_op): Call warn_logical_operator.
5901 2007-03-08 Volker Reichelt <v.reichelt@netcologne.de>
5904 * semantics.c (finish_offsetof): Handle COMPOUND_EXPR.
5907 * pt.c (any_template_arguments_need_structural_equality_p):
5910 2007-03-08 Alexandre Oliva <aoliva@redhat.com>
5912 * decl.c (grokdeclarator): Disable warnings for anonymous
5915 2007-03-05 Volker Reichelt <v.reichelt@netcologne.de>
5917 * typeck2.c (readonly_error): Always emit a hard error.
5918 Remove last argument.
5919 * cp-tree.h (readonly_error): Adjust prototype.
5920 * semantics.c (finish_asm_stmt): Adjust call to readonly_error.
5921 * typeck.c (build_unary_op): Likewise.
5922 (build_modify_expr): Likewise.
5924 2007-03-04 Simon Martin <simartin@users.sourceforge.net>
5927 * tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees.
5929 2007-03-03 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5932 * parser.c (struct cp_parser): New IN_IF_STMT.
5933 (cp_parser_statement_seq_opt): Handle an unexpected 'else',
5934 returning if parsing the body of an 'if' statement or issuing an
5935 error and continuing.
5936 (cp_parser_selection_statement): Set IN_IF_STMT bit when parsing
5938 (cp_parser_jump_statement): Mask new IN_IF_STMT bit.
5940 2007-03-02 Simon Martin <simartin@users.sourceforge.net>
5943 * class.c (update_vtable_entry_for_fn): Properly handle invalid overriders
5946 2007-03-02 Geoffrey Keating <geoffk@apple.com>
5948 * g++spec.c (lang_specific_driver): Add -lstdc++ when compiling
5949 Objective-C++. Don't exit early if -shared-libgcc needs to be
5952 2007-03-02 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5954 * typeck.c (common_base_type): Delete unused function.
5956 2007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
5958 * Make-lang.in: Add dummy lang.install-pdf target.
5960 2007-03-01 Simon Baldwin <simonb@google.com>
5963 * decl.c (check_tag_decl): Added new warning for typedef ignored
5964 when it precedes an otherwise valid non-typedef declaration.
5966 2007-02-28 Sandra Loosemore <sandra@codesourcery.com>
5968 * typeck.c (build_function_call): Store converted arguments
5969 in a stack-allocated array instead of building a list.
5970 (convert_arguments): Store arguments in the array passed in as an
5971 argument, and return the actual number of arguments.
5972 * call.c (build_call): Delete, and replace with...
5973 (build_call_n, build_call_a): New.
5974 (build_op_delete_call): Rewrite to avoid constructing argument lists.
5975 (build_over_call): Store converted arguments in a stack-allocated
5976 array instead of building a list.
5977 (build_cxx_call): Pass arguments in an array instead of as a list.
5978 (build_java_interface_fn_ref): Rewrite to avoid constructing
5980 * tree.h: Update declarations to reflect above changes.
5981 * method.c (use_thunk): Use a stack-allocated array to hold
5982 the arguments instead of a list.
5983 * rtti.c (throw_bad_cast): Update call to cxx_call.
5984 (throw_bad_typeid): Likewise.
5985 (build_dynamic_cast_1): Likewise.
5986 * init.c (build_builtin_delete_call): Use build_call_n.
5987 * decl.c (expand_static_init): Likewise.
5988 * except.c (cp_protect_cleanup_actions): Likewise.
5989 * cp-gimplify.c (genericize_eh_spec_block): Likewise.
5990 (gimplify_must_not_throw_expr): Likewise.
5991 (cxx_omp_apply_fn): Use build_call_a.
5993 2007-02-26 Mark Mitchell <mark@codesourcery.com>
5995 * semantics.c (expand_or_defer_fn): Call c_record_cdtor_fn.
5996 * decl2.c (cp_write_gloabl_declarations): Call c_build_cdtor_fns.
5998 2007-02-25 Mark Mitchell <mark@codesourcery.com>
6000 * cp-tree.h (static_ctors): Remove.
6001 * cp-tree.h (static_dtors): Likewise.
6002 * cp-objcp-common.c (decl_shadowed_for_var_lookup): Adjust for
6003 refactoring of tree_map hierarchy.
6004 (decl_shadowed_for_var_insert): Likewise.
6005 * semantics.c (expand_body): Use c_expand_body.
6006 (expand_or_defer_fn): Don't update static_ctors or static_dtors.
6007 * decl2.c (static_ctors): Remove.
6008 (static_dtors): Likewise.
6009 (generate_ctor_or_dtor_function): Pass NULL_TREE to
6010 objc_generate_static_init_call. Do not call static_[cd]tors.
6011 (generate_ctor_and_dtor_functions_for_priority): Do not check for
6013 (cp_write_global_declarations): Likewise.
6015 2007-02-23 Richard Guenther <rguenther@suse.de>
6017 * class.c (note_name_declared_in_class): Make declaration
6018 changes meaning a pedwarn.
6020 2007-02-22 Michael Matz <matz@suse.de>
6023 * cp-tree.h (TFF_UNQUALIFIED_NAME): New formatting flag.
6024 * error.c (dump_aggr_type, dump_simple_decl, dump_decl,
6025 dump_function_decl): Guard emitting outer scopes by new flag.
6026 * cp-lang.c (cxx_dwarf_name): New function.
6027 (LANG_HOOKS_DWARF_NAME): Define to cxx_dwarf_name.
6028 * pt.c (classtype_mangled_name, mangle_class_name_for_template):
6030 (push_template_decl_real, lookup_template_class): Remove calls
6033 2007-02-19 Mark Mitchell <mark@codesourcery.com>
6035 * call.c (build_new_method_call): Ensure that explicit calls of
6036 destructors have type "void".
6038 2007-02-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
6040 * typeck.c (build_binary_op): Replace -Wstring-literal-comparison
6041 and -Walways-true with -Waddress.
6042 * cvt.c (convert_to_void): Replace unconditional warning with
6045 2007-02-18 Kazu Hirata <kazu@codesourcery.com>
6047 * decl.c, tree.c: Fix comment typos.
6049 2007-02-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
6052 * semantics.c (finish_stmt_expr_expr): Set TREE_TYPE of the
6053 statement expression if we had an error mark node.
6055 2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
6056 Brooks Moses <brooks.moses@codesourcery.com>
6057 Lee Millward <lee.millward@codesourcery.com>
6059 * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
6060 Change class to tcc_vl_exp.
6062 * call.c (build_call): Use build_call_list instead
6064 (build_over_call): Likewise.
6065 (build_new_method_call): Use build_min_non_dep_call_list
6066 instead of build_min_non_dep.
6068 * error.c (dump_call_expr_args): New function.
6069 (dump_aggr_init_expr_args): New function.
6070 (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them.
6071 Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
6073 * cvt.c (convert_to_void): Use build_call_array instead
6074 of build3; use new AGGR_INIT_EXPR accessor macros.
6076 * mangle.c (write_expression): Use TREE_OPERAND_LENGTH
6077 instead of TREE_CODE_LENGTH.
6079 * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
6080 AGGR_INIT_EXPR accessor macros.
6082 * cp-gimplify.c (cp_gimplify_init_expr): Use
6083 AGGR_INIT_EXPR_SLOT to set the slot operand.
6085 * cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
6086 (AGGR_INIT_EXPR_SLOT): New macro.
6087 (AGGR_INIT_EXPR_ARG): New macro.
6088 (aggr_init_expr_nargs): New macro.
6089 (AGGR_INIT_EXPR_ARGP): New macro.
6090 (aggr_init_expr_arg_iterator): New.
6091 (init_aggr_init_expr_arg_iterator): New.
6092 (next_aggr_init_expr_arg): New.
6093 (first_aggr_init_expr_arg): New.
6094 (more_aggr_init_expr_args_p): New.
6095 (FOR_EACH_AGGR_INIT_EXPR_ARG): New.
6096 (stabilize_aggr_init): New declaration.
6097 (build_min_non_dep_call_list): Likewise.
6099 * tree.c (process_aggr_init_operands): New function.
6100 (build_aggr_init_array) New function.
6101 (build_cplus_new): Update to use new CALL_EXPR and
6102 AGGR_INIT_EXPR accessor macros. Replace use of build3 with
6103 build_aggr_init_array.
6104 (build_min_non_dep_call_list) New function.
6105 (build_min_nt): Assert input code parameter is not a variable
6106 length expression class.
6107 (build_min, build_min_non_dep): Likewise.
6108 (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
6109 to check for equality instead of recursing. Handle tcc_vl_exp
6111 (stabilize_call): Update to only handle CALL_EXPRs, not
6112 AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
6113 (stabilize_aggr_init): New function.
6114 (stabilize_init): Use it.
6116 * cxx-pretty-print.c (pp_cxx_postfix_expression)
6117 <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
6118 AGGR_INIT_EXPR accessor macros and argument iterators.
6120 * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
6121 build_vl_exp. Iterate through the operands, recursively
6122 processing each one.
6123 (tsubst_copy_and_build) <CALL_EXPR>: Update to use new
6124 CALL_EXPR accessor macros.
6125 (value_dependent_expression_p) <default>: Handle tcc_vl_exp
6126 tree code classes. Use TREE_OPERAND_LENGTH instead of
6129 * semantics.c (finish_call_expr): Use build_nt_call_list
6130 instead of build_nt.
6131 (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR
6132 accessor macros. Use build_call_array to construct the
6133 CALL_EXPR node instead of build3
6135 * decl2.c (build_offset_ref_call_from_tree): Use
6136 build_nt_call_list and build_min_non_dep_call_list instead
6137 of build_min_nt and build_min_non_dep.
6139 * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
6140 Use build_nt_call_list instead of build_min_nt.
6142 2007-02-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
6145 * call.c (build_conditional_expr): Improve error message.
6147 2007-02-13 Dirk Mueller <dmueller@suse.de>
6149 * friend.c (do_friend): Annotate warning about friend
6150 declarations in templates with OPT_Wnon_template_friend.
6151 Convert informal message from warning() to inform().
6153 2007-02-12 Simon Martin <simartin@users.sourceforge.net>
6154 Mark Mitchell <mark@codesourcery.com>
6157 * pt.c (do_decl_instantiation): Detect type mismatches in explicit
6158 instantiations for variables.
6160 2007-02-12 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
6163 * cp-gimplify.c (gimplify_expr_stmt): Don't check extra_warnings.
6164 Check warn_unused_value just once.
6166 2007-02-11 Mark Mitchell <mark@codesourcery.com>
6169 * pt.c (determine_specialization): Use skip_artificial_parms_for.
6170 (fn_type_unificiation): Likewise.
6171 (get_bindings): Likewise.
6173 o2007-02-06 Mark Mitchell <mark@codesourcery.com>
6176 * decl.c (finish_function): Use DECL_REPLACEABLE.
6177 * tree.c (cp_cannot_inline_tree_fn): Likewise.
6179 2007-02-10 Gabriel Dos Reis <gdr@integrable-solutions.net>
6181 * parser.c (cp_parser_primary_expression): Reformat overly long lines.
6183 2007-02-10 Richard Henderson <rth@redhat.com>, Jakub Jelinek <jakub@redhat.com>
6185 * decl.c (grokvardecl): Don't error if !have_tls.
6186 (grokdeclarator): Likewise.
6187 * parser.c (cp_parser_omp_threadprivate): Likewise.
6189 2007-02-07 Jakub Jelinek <jakub@redhat.com>
6192 * cp-gimplify.c (cp_genericize_r): Don't dereference invisiref
6193 parameters and result decls in omp clauses.
6194 (cxx_omp_privatize_by_reference): Pass also invisiref PARM_DECLs
6197 2007-02-05 Dirk Mueller <dmueller@suse.de>
6200 * parser.c (cp_parser_class_specifier): Always initialize bases.
6202 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
6204 * cp-tree.h (OMP_ATOMIC_CODE): Delete.
6205 (OMP_ATOMIC_DEPENDENT_P): Rewrite.
6206 * pt.c (tsubst_expr): Adjust for new format of dependent OMP_ATOMIC
6208 * semantics.c (finish_omp_atomic): Store a whole expression node
6209 in operand 1, and integer_zero_node in operand 0, for dependent
6210 OMP_ATOMIC. Rewrite to make flow easier to understand.
6212 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
6214 * decl.c (grokdeclarator): Use OPT_Wreturn_type instead of 0.
6216 2007-02-04 Kazu Hirata <kazu@codesourcery.com>
6218 * class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
6219 parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
6221 2007-02-03 Douglas Gregor <doug.gregor@gmail.com>
6223 * parser.c (cp_lexer_get_preprocessor_token): Attach the C++0x
6224 keyword warning to -Wc++0x-compat.
6226 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
6228 * decl.c (grokdeclarator): Update documentation.
6230 2007-02-02 Jakub Jelinek <jakub@redhat.com>
6233 * decl.c (grokdeclarator): If __thread is used together with
6234 a storage class other than extern and static, clear thread_p
6235 after issuing diagnostics and fall through to checking the
6238 2007-01-30 Roger Sayle <roger@eyesopen.com>
6240 * error.c (dump_type_suffix): Avoid use of cp_build_binary_op when
6241 calculating the size of an array (to avoid recursive errors).
6243 2007-01-30 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
6246 * typeck.c (build_binary_op): Fix logic for warning. Move warning
6248 * call.c (convert_like_real): Don't warn when converting to
6251 2007-01-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
6253 * decl.c (pop_label): Replace warning with call to
6254 warn_for_unused_label.
6256 2007-01-28 Andrew Pinski <pinskia@gmail.com>
6259 * semantics.c (finish_pseudo_destructor_expr): Check the
6260 destrutor name by calling check_dtor_name.
6262 2007-01-24 Douglas Gregor <dgregor@osl.iu.edu>
6264 * lex.c (D_CPP0X): Rename.
6266 (reswords): D_CPP0X -> D_CXX0X.
6267 (init_reswords): Ditto.
6268 * parser.c (cp_lexer_get_preprocessor_token): Warn about the use
6269 of C++0x keywords as identifiers.
6271 2007-01-23 Simon Martin <simartin@users.sourceforge.net>
6274 * decl.c (duplicate_decls): Don't reset DECL_INVALID_OVERRIDER_P for
6277 2007-01-23 Ian Lance Taylor <iant@google.com>
6279 * typeck.c (convert_for_assignment): Only warn about a = b = c
6280 when converting to bool.
6282 2007-01-23 Roger Sayle <roger@eyesopen.com>
6284 * call.c (null_ptr_cst_p): Replace use of TREE_CONSTANT_OVERFLOW with
6286 * typeck.c (ignore_overflows): Remove the remaining uses of
6287 TREE_CONSTANT_OVERFLOW.
6289 2007-01-20 Jan Hubicka <jh@suse.cz>
6291 * decl2.c (start_objects, start_static_storage_duration_function):
6292 Do not make the functions uninlinable.
6294 2007-01-17 Ian Lance Taylor <iant@google.com>
6296 * class.c (add_method): Call VEC_reserve_exact rather than passing
6297 a negative size to VEC_reserve.
6299 2007-01-11 Simon Martin <simartin@users.sourceforge.net>
6302 * tree.c (cp_tree_equal): Properly handle MODOP_EXPR trees.
6304 2007-01-10 Mark Mitchell <mark@codesourcery.com>
6307 * decl.c (make_typename_type): If the qualified name is not a
6308 type, issue an error.
6309 * parser.c (cp_parser_elaborated_type_specifier): Fix comment
6312 2007-01-08 Geoffrey Keating <geoffk@apple.com>
6314 * rtti.c: Include target.h.
6315 (emit_support_tinfos): If ! targetm.cxx.library_rtti_comdat (),
6316 don't emit typeinfo for fundamental types as weak.
6317 * Make-lang.in (cp/rtti.o): Update and correct dependencies.
6319 2007-01-08 Richard Guenther <rguenther@suse.de>
6321 * cvt.c (cp_convert_to_pointer): Use build_int_cst_type.
6323 2007-01-08 Mark Shinwell <shinwell@codesourcery.com>
6325 * call.c (standard_conversion): Pass flag to
6326 vector_types_convertible_p to disallow emission of note.
6327 * typeck.c (convert_for_assignment): Pass flag to
6328 vector_types_convertible_p to allow emission of note.
6329 (ptr_reasonably_similar): Pass flag to vector_types_convertible_p
6330 to disallow emission of note.
6332 2007-01-07 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
6335 * typeck.c (build_binary_op): Call overflow_warning if
6336 TREE_OVERFLOW_P is true for the result and not for any of the
6339 2007-01-06 Lee Millward <lee.millward@codesourcery.com>
6342 * class.c (add_method): Don't wait until template
6343 instantiation time to complain about duplicate methods.
6345 2007-01-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
6348 * semantics.c (finish_unary_op_expr): Warn only if result
6349 overflowed and operands did not.
6351 2007-01-05 Ian Lance Taylor <iant@google.com>
6353 * typeck.c (build_binary_op): Warn about comparing a non-weak
6356 2007-01-05 Douglas Gregor <doug.gregor@gmail.com>
6358 * pt.c (tsubst): Propagate the need for structural equality checks
6359 when reducing the level of template parameters.
6361 2007-01-03 Kazu Hirata <kazu@codesourcery.com>
6363 * pt.c: Fix a comment typo.
6365 2007-01-02 Ian Lance Taylor <iant@google.com>
6367 * semantics.c (maybe_convert_cond): Optionally warn when using an
6368 assignment as a condition.
6369 * typeck.c (convert_for_assignment): Optionally warn about
6370 assigning the result of an assignment to a bool.
6372 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
6374 * pt.c (canonical_template_parms): Correct typo in comment.
6376 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
6378 * typeck.c (structural_comptypes): Renamed from "comptypes".
6379 (comptypes): Use canonical type information to perform fast type
6380 comparison. When VERIFY_CANONICAL_TYPES, verify that the
6381 canonical type comparison returns the same results as we would see
6382 from the current, structural check. Support COMPARE_STRUCTURAL
6383 when we need structural checks.
6384 * decl.c (typename_compare): Fix comment.
6385 (build_typename_type): TYPENAME_TYPE nodes require structural
6386 equality checks, because they resolve different based on the
6388 (make_unbound_class_template): UNBOUND_CLASS_TEMPLATE nodes
6389 require structural equality checks (for now).
6390 (build_ptrmemfunc_type): Build the canonical pointer to member
6392 (compute_array_index_type): Whenever we build a new index type
6393 to represent the size of an array in a template, we need to mark
6394 this index type as requiring structural equality. This goes for
6395 arrays with value-dependent sizes with the current ABI, or all
6397 * tree.c (cplus_array_hash): New.
6398 (struct cplus_array_info): New.
6399 (cplus_array_compare): New.
6400 (cplus_array_htab): New.
6401 (build_cplus_array_type_1): Use a hash table to cache the array
6402 types we build. Build the canonical array type for each array
6404 (cp_build_qualified_type_real): When building a cv-qualified array
6405 type, use the hash table of array types and build canonical array
6407 (bind_template_template_parm): BOUND_TEMPLATE_TEMPLATE_PARM nodes
6408 use structural equality (for now).
6409 * cp-tree.h (COMPARE_STRUCTURAL): New.
6410 * pt.c (canonical_template_parms): New.
6411 (canonical_type_parameter): New.
6412 (process_template_parm): Find the canonical type parameter.
6413 (lookup_template_class): When we have named the primary template
6414 type, set the canonical type for our template class to the primary
6415 template type. If any of the template arguments need structural
6416 equality checks, the template class needs structural equality
6418 (tsubst): When reducing the level of a template template
6419 parameter, we require structural equality tests for the resulting
6420 parameter because its template parameters have not had their types
6421 canonicalized. When reducing a template type parameter, find the
6422 canonical reduced type parameter.
6423 (any_template_arguments_need_structural_equality_p): New.