OSDN Git Service

PR c++/31941
[pf3gnuchains/gcc-fork.git] / gcc / cp / ChangeLog
1 2007-08-24  Jakub Jelinek  <jakub@redhat.com>
2
3         PR c++/31941
4         * error.c (resolve_virtual_fun_from_obj_type_ref): Handle
5         TARGET_VTABLE_USES_DESCRIPTORS targets properly.
6
7 2007-08-22  Jason Merrill  <jason@redhat.com>
8
9         PR c++/29365
10         * pt.c (outermost_tinst_level): New function.
11         * lex.c (in_main_input_context): New function.
12         * cp-tree.h: Declare it.
13         * decl2.c (constrain_class_visibility): Use it to avoid warning
14         about uses of the anonymous namespace in the main input file.
15
16 2007-08-21  Jakub Jelinek  <jakub@redhat.com>
17
18         * init.c (build_new_1): Use get_target_expr instead of save_expr.
19
20 2007-08-20  Pawel Sikora  <pluto@pld-linux.org>
21
22         PR c++/7302
23         * class.c (finish_struct_1): Warn when a class has virtual
24         functions and accessible non-virtual destructor.
25
26 2007-08-20  Richard Guenther  <rguenther@suse.de>
27
28         PR c++/22369
29         PR c++/22451
30         * call.c (build_new_method_call): Convert initializer to
31         the basetype.
32         * init.c (build_aggr_init): Do not fiddle with types.
33         (build_vec_delete_1): Use correct type for POINTER_PLUS_EXPR.
34         * except.c (build_throw): Do not drop qualifiers for the
35         pointer type.
36         * typeck.c (get_member_function_from_ptrfunc): Do not
37         fiddle with types, instead convert.
38         (build_ptrmemfunc1): Convert to the target type for
39         initialization.
40         (gfc_trans_allocate): Convert result to target type.
41         * cp-objcp-common.c (cxx_get_alias_set): Pointers to
42         pointer-to-member structures shall have alias set zero as well.
43
44 2007-08-20  Richard Guenther  <rguenther@suse.de>
45
46         * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P):
47         Remove.
48         * cp-tree.h (cp_auto_var_in_fn_p): Remove.
49         (nonstatic_local_decl_p): Likewise.
50         * tree.c (cp_auto_var_in_fn_p): Remove.
51         * decl.c (nonstatic_local_decl_p): Remove.
52
53 2007-08-20  Richard Guenther  <rguenther@suse.de>
54
55         * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_WALK_SUBTREES):
56         Remove define.
57         * tree.h (cp_walk_tree): New define to walk_tree_1 with
58         cp_walk_subtrees lh parameter.
59         (cp_walk_tree_without_duplicates): New define to
60         walk_tree_without_duplicates_1 with cp_walk_subtrees lh parameter.
61         * tree.c (count_trees): Call
62         cp_walk_tree_without_duplicates.
63         (verify_stmt_tree): Call cp_walk_tree.
64         (break_out_target_exprs): Likewise.
65         (WALK_SUBTREE): Likewise.
66         * cp-gimplify.c (cp_genericize): Likewise.
67         * cp-pt.c (find_parameter_packs_r): Likewise.
68         (uses_parameter_packs): Likewise.
69         (make_pack_expansion): Likewise.
70         (check_for_bare_parameter_packs): Likewise.
71         (for_each_template_parm): Likewise.
72         * decl.c (check_default_argument): Call
73         cp_walk_tree_without_duplicates.
74         * except.c (build_throw): Likewise.
75         * decl2.c (type_visibility): Likewise.
76         * semantics.c (expand_or_defer_fn): Likewise.
77         (finalize_nrv): Call cp_walk_tree.
78
79 2007-08-20  Jakub Jelinek  <jakub@redhat.com>
80
81         PR c++/33025
82         * init.c (build_new_1): Rename placement_var variable to placement_expr.
83         Initialize it with save_expr rather than get_temp_regvar.
84
85 2007-08-17  Andrew Pinski  <andrew_pinski@playstation.sony.com>
86
87         PR c++/28989
88         * tree.c (lvalue_p_1 <case SAVE_EXPR>): SAVE_EXPRs are never
89         lvalues.
90
91 2007-08-17  Ollie Wild  <aaw@google.com>
92
93         PR c++/31749
94         * name-lookup.c (do_nonmember_using_decl): Shift implicit type
95         declarations into appropriate slots for comparison.  Fix type
96         comparison.
97
98 2007-08-17  Paolo Carlini  <pcarlini@suse.de>
99
100         PR c++/32112
101         * error.c (dump_decl): Deal with UNBOUND_CLASS_TEMPLATE.
102         * cxx-pretty-print.c (pp_cxx_unqualified_id): Likewise.
103
104 2007-08-17  Paolo Carlini  <pcarlini@suse.de>
105
106         PR c++/32870
107         * parser.c (cp_parser_class_head): Improve error message.
108
109 2007-08-16  Seongbae Park  <seongbae.park@gmail.com>
110
111         * pt.c (instantiate_decl): Set input_location
112         for the function end.
113
114 2007-08-16  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
115
116         * cp-objcp-common.c (cxx_warn_unused_global_decl, cp_expr_size):
117         Constify.
118         * cp-tree.h (local_variable_p, nonstatic_local_decl_p,
119         class_tmpl_impl_spec_p, cp_auto_var_in_fn_p, cp_type_quals,
120         cxx_incomplete_type_diagnostic, cxx_incomplete_type_error,
121         cxx_warn_unused_global_decl, cp_expr_size): Likewise.
122         * decl.c (local_variable_p, nonstatic_local_decl_p): Likewise.
123         * tree.c (class_tmpl_impl_spec_p, cp_auto_var_in_fn_p): Likewise.
124         * typeck.c (cp_type_quals): Likewise.
125         * typeck2.c (cxx_incomplete_type_diagnostic,
126         cxx_incomplete_type_error): Likewise.
127
128 2007-08-16  Paolo Carlini  <pcarlini@suse.de>
129
130         PR c++/31132
131         * pt.c (tsubst_friend_function): When check_classfn
132         returns error_mark_node likewise return it.
133
134 2007-08-15  Jakub Jelinek  <jakub@redhat.com>
135
136         PR c++/32992
137         * typeck.c (check_return_expr): Don't NRV optimize vars in
138         anonymous unions.
139         * decl.c (finish_function): Comment fix.
140
141 2007-08-15  Paolo Carlini  <pcarlini@suse.de>
142
143         PR c++/33035
144         * pt.c (push_template_decl_real): Depending on TYPE_P
145         use either TYPE_CONTEXT or DECL_CONTEXT.
146
147 2007-08-14  Mark Mitchell  <mark@codesourcery.com>
148
149         * semantics.c (finish_omp_clauses): Strip a NOP_EXPR if
150         constructors and destructors return this.
151
152 2007-08-14  Paolo Carlini  <pcarlini@suse.de>
153
154         PR c++/27211
155         * decl2.c (check_classfn): Return error_mark_node in case of error;
156         in that case, do not call add_method.
157         * decl.c (start_decl): Deal with check_classfn returning
158         error_mark_node.
159         (grokfndecl): Likewise.
160         * pt.c (tsubst_friend_function): Likewise.
161
162 2007-08-14  Andrew Pinski  <pinskia@gmail.com>
163
164         PR c++/30428
165         * typeck.c (build_binary_op): Disallow vector float types with
166         BIT_IOR_EXPR, BIT_AND_EXPR, and BIT_XOR_EXPR.
167
168 2007-08-11  Ian Lance Taylor  <iant@google.com>
169
170         * cp-objcp-common.c (cxx_get_alias_set): Change return type to
171         alias_set_type.
172         * cp/cp-tree.h (cxx_get_alias_set): Update declaration.
173
174 2007-08-10  Ollie Wild  <aaw@google.com>
175
176         * name-lookup.c (do_nonmember_using_decl): Print an error for ambiguous
177         type lookups.
178         (ambiguous_decl): Construct tree of ambiguous types.  Remove extaneous
179         function parameter.
180         (unqualified_namespace_lookup): Fix ambiguous_decl call.
181         (lookup_using_namespace): Fix ambiguous_decl call.
182         (qualified_lookup_using_namespace): Fix ambiguous_decl call.
183
184 2007-08-10  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
185
186         * call.c (name_as_c_string): Use CONST_CAST.
187         * decl.c (build_decl): Likewise.
188         * parser.c (cp_parser_string_literal): Likewise.
189
190 2007-08-10  Paolo Carlini  <pcarlini@suse.de>
191
192         PR c++/17763
193         * error.c (dump_expr): Consistently use the *_cxx_*
194         variants of the pretty-print functions.
195
196 2007-08-10  Paolo Carlini  <pcarlini@suse.de>
197
198         PR c++/22256
199         * decl.c (check_special_function_return_type): Just error
200         on return type specified for conversion operator.
201
202 2007-08-09  Daniel Berlin  <dberlin@dberlin.org>
203
204         * typeck2.c (readonly_error): Handle general expressions.
205         * error.c (dump_expr): Handle POINTER_PLUS_EXPR
206
207 2007-08-06  Dan Hipschman  <dsh@google.com>
208
209         * method.c (use_thunk): Use DECL_NAME instead of DECL_RTL to
210         access function name.
211
212 2007-08-04  Alfred Minarik  <a.minarik@aon.at>
213
214         PR pch/13676
215         * lang-specs.h: Add .hp, .hxx, .hpp, .h, .HPP, .tcc as c++ header.
216         * g++spec.c (lang_specific_driver): Check them.
217
218 2007-08-06  Paolo Carlini  <pcarlini@suse.de>
219
220         PR c++/19532
221         * pt.c (template_class_depth): Fix comment; change return type
222         to bool.
223
224 2007-08-05  Volker Reichelt  <v.reichelt@netcologne.de>
225
226         Revert:
227         2007-03-26  Dirk Mueller  <dmueller@suse.de>
228
229         * parser.c (cp_parser_member_declaration): Pedwarn
230         about stray semicolons after member declarations.
231
232 2007-08-02  Lee Millward  <lee.millward@gmail.com>
233
234         PR c++/30849
235         PR c++/30850
236         PR c++/30851
237         * parser.c (cp_parser_asm_definition): Detect and discard asm
238         statements with invalid inputs or outputs.
239         (cp_parser_asm_operand_list): Return error mark node if any
240         of the operands are invalid. Adjust documentation.
241         
242 2007-08-02  Nick Clifton  <nickc@redhat.com>
243
244         * typeck.c: Change copyright header to refer to version 3 of the
245         GNU General Public License and to point readers at the COPYING3
246         file and the FSF's license web page.
247         * optimize.c, lang-specs.h, init.c, class.c, repo.c, decl.c,
248         config-lang.in, cp-tree.def, call.c, decl.h, ptree.c,
249         Make-lang.in, method.c, rtti.c, cp-objcp-common.c, g++spec.c,
250         cp-objcp-common.h, except.c, error.c, operators.def, cvt.c,
251         tree.c, mangle.c, cp-tree.h, dump.c, search.c, friend.c, expr.c,
252         cp-gimplify.c, cxx-pretty-print.c, cp-lang.c, typeck2.c, pt.c,
253         cxx-pretty-print.h, semantics.c, name-lookup.c, lex.c, decl2.c,
254         name-lookup.h, parser.c: Likewise.
255
256 2007-08-01  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
257
258         PR middle-end/32668
259         * call.c (magic_varargs_p): Honor the "type generic" attribute.
260
261 2007-07-30  Paolo Carlini  <pcarlini@suse.de>
262
263         PR c++/32108
264         * semantics.c (finish_label_stmt): Reject the __label__
265         extension outside function scopes.
266
267 2007-07-29  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
268
269         * parser.c (eof_token): Un-constify.
270         (cp_lexer_new_main, cp_lexer_new_from_tokens, VEC_alloc,
271         cp_lexer_consume_token, cp_lexer_purge_token): Remove spurious
272         casts.
273
274 2007-07-28  Kazu Hirata  <kazu@codesourcery.com>
275
276         * pt.c, tree.c, typeck2.c: Fix comment typos.
277
278 2007-07-28  Simon Martin  <simartin@users.sourceforge.net>
279             Mark Mitchell  <mark@codesourcery.com>
280
281         PR c++/30917
282         * name-lookup.c (lookup_name_real): Non namespace-scope bindings can be
283         hidden due to friend declarations in local classes.
284
285 2007-07-27  Douglas Gregor  <doug.gregor@gmail.com>
286
287         * typeck.c (structural_comptypes): Compare DECLTYPE_TYPE nodes.
288         * cp-tree.def (DECLTYPE_TYPE): New.
289         * error.c (dump_type): Dump DECLTYPE_TYPE nodes.
290         (dump_type_prefix): Ditto.
291         (dump_type_suffix): Ditto.
292         * tree.c (DECLTYPE_TYPE): Walk DECLTYPE_TYPE nodes.
293         * mangle.c (write_type): Handle DECLTYPE_TYPE.
294         * cp-tree.h (IS_AGGR_TYPE): DECLTYPE_TYPE nodes can be aggregate
295         types.
296         (DECLTYPE_TYPE_EXPR): New.
297         (DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P): New.
298         (finish_declared_type): Declare.
299         * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Print
300         DECLTYPE_TYPE nodes.
301         (pp_cxx_type_id): Ditto.
302         * pt.c (for_each_template_parm_r): Walk DECLTYPE_TYPE children.
303         (tsubst): Substitute into a DECLTYPE_TYPE node.
304         (tsubst_copy): Ditto.
305         (unify): Cannot deduce anything from TYPEOF_TYPE or DECLTYPE_TYPE
306         nodes.
307         (dependent_type_p_r): DECLTYPE_TYPE types are always dependent.
308         * semantics.c (finish_typeof): TYPEOF_TYPE types need to use
309         structural equality (because we can't hash the expressions).
310         (finish_declared_type): New.
311         * lex.c (reswords): Add "decltype" keyword.
312         * parser.c cp_lexer_next_token_is_decl_specifier_keyword
313         (cp_parser_postfix_expression): Add member_access_only_p to
314         restrict postfix expression to member access expressions.
315         (cp_parser_unary_expression): Update call to
316         cp_parser_postfix_expression to reflect new parameter.
317         (cp_parser_declared_type): New.
318         (cp_parser_simple_type_specifier): Parse decltype types.
319
320 2007-07-27  Mark Mitchell  <mark@codesourcery.com>
321
322         PR c++/32346
323         * call.c (convert_for_arg_passing): Only widen bitfields to their
324         declared types if necessary.
325
326 2007-07-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
327
328         * parser.c (cp_parser_string_literal, cp_parser_sizeof_operand):
329         Constify.
330
331 2007-07-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
332
333         * decl.c (typename_hash, typename_compare): Constify.
334         * mangle.c (hash_type, compare_type): Likewise.
335         * pt.c (eq_local_specializations, hash_local_specialization):
336         Likewise.
337         * tree.c (cplus_array_hash, cplus_array_compare, list_hash_eq,
338         list_hash): Likewise.
339         * typeck2.c (pat_compare): Likewise.
340
341 2007-07-24  Nathan Sidwell  <nathan@codesourcery.com>
342
343         * method.c (implicitly_declare_fn): Increase alignment if member
344         function pointer format requires it.
345
346 2007-07-24  Paolo Carlini  <pcarlini@suse.de>
347
348         PR c++/29001
349         * typeck.c (check_return_expr): Do not pass a null argument
350         to null_ptr_cst_p.
351
352 2007-07-24  Paolo Carlini  <pcarlini@suse.de>
353
354         PR c++/32561
355         * decl.c (redeclaration_error_message): Call DECL_ANON_UNION_VAR_P
356         only on VAR_DECL.
357
358 2007-07-22  Nathan Sidwell  <nathan@codesourcery.com>
359
360         PR c++/32839
361         * typeck.c (convert_arguments): Only use default args if we have
362         a function decl.
363
364         PR c++/30818
365         * typeck.c (structural_comptypes): No need to check
366         resolve_typename_type return value here.
367         * cp-tree.h (TYPENAME_IS_RESOLVING_P): New.
368         * pt.c (resolve_typename_type): Follow typename typedefs.  Return
369         original type rather than error_mark_node in case of failure.
370         * parser.c (cp_parser_nested_name_specifier_opt): Adjust
371         resolve_typename_type result check.
372         (cp_parser_direct_declarator, cp_parser_head,
373         cp_parser_constructor_declarator_p): Likewise.
374
375 2007-07-12  Kazu Hirata  <kazu@codesourcery.com>
376
377         * pt.c (template_parms_variadic_p): Remove.
378         * cp-tree.h: Remove the prototype for template_parms_variadic_p.
379
380 2007-07-12  Jakub Jelinek  <jakub@redhat.com>
381
382         PR c++/30854
383         * error.c (dump_expr) <case AGGR_INIT_EXPR>: Pass true as last
384         argument to dump_aggr_init_expr_args instead of false.
385
386 2007-07-11  Douglas Gregor  <doug.gregor@gmail.com>
387
388         * typeck.c (comptypes): When USE_CANONICAL_TYPES, use the
389         canonical types; otherwise, fall back to structural type
390         comparisons. If ENABLE_CHECKING and USE_CANONICAL_TYPES, give an
391         internal compiler error if the canonical types are wrong.
392         
393 2007-07-11  Paolo Carlini  <pcarlini@suse.de>
394
395         PR c++/32560
396         * parser.c (cp_parser_make_indirect_declarator): When the
397         the code argument is ERROR_MARK return cp_error_declarator.
398
399 2007-07-09  Geoffrey Keating  <geoffk@apple.com>
400
401         PR 32617
402         * decl.c (cxx_init_decl_processing): Don't set
403         force_align_functions_log.
404         (grokfndecl): Honour ptrmemfunc_vbit_in_pfn.
405         * typeck.c (cxx_alignof_expr): When alignof is used on a plain
406         FUNCTION_DECL, return its alignment.
407
408 2007-07-09  Richard Guenther  <rguenther@suse.de>
409
410         * decl.c (start_preparsed_function): Do not promote return type.
411
412 2007-07-08  Paolo Carlini  <pcarlini@suse.de>
413
414         PR c++/30535
415         * pt.c (unify): Never pass error_mark_node to template_decl_level.
416
417 2007-07-07  Mark Mitchell  <mark@codesourcery.com>
418
419         PR c++/32232
420         * pt.c (resolve_overloaded_unification): Robustify.  Return a
421         bool, not an int.
422         (type_unification_real): Adjust accordingly.
423
424 2007-07-06  Richard Guenther  <rguenther@suse.de>
425
426         * init.c (build_new_1): Use the correct pointer type.
427         * typeck2.c (build_m_component_ref): Likewise.
428
429 2007-07-05  Mark Mitchell  <mark@codesourcery.com>
430
431         PR c++/32245
432         * init.c (build_zero_init): Always build an initializer for
433         non-static storage.
434         * typeck2.c (build_functional_cast): Use build_zero_init.
435
436         PR c++/32251
437         * init.c (build_new_1): Always pass the allocation function to
438         build_op_delete_call.
439         * call.c (build_op_delete_call): Handle operator delete with a
440         variable-argument list.  Do not issue an error when no matching
441         deallocation function is available for a new operator.
442
443         PR c++/31992
444         * cp-tree.h (any_value_dependent_elements_p): Declare it.
445         * decl.c (value_dependent_init_p): New function.
446         (cp_finish_decl): Use it.
447         * pt.c (value_dependent_expression_p): Use
448         any_value_dependent_elements_p.
449         * parser.c (cp_parser_primary_expression): Add comment about
450         treating dependent qualified names as integral
451         constant-expressions.
452
453 2007-07-04  Douglas Gregor  <doug.gregor@gmail.com>
454
455         * decl.c (build_ptrmemfunc_type): Always use structural equality
456         tests when comparing pointer-to-member-function types, because the
457         handling of TYPE_GET_PTRMEMFUNC_TYPE currently defeats canonical
458         types.
459         
460 2007-07-03  Mark Mitchell  <mark@codesourcery.com>
461
462         * init.c (build_new): Tweak comment.
463
464 2007-06-29  Dave Brolley  <brolley@redhat.com>
465
466         PR c++/31743
467         * parser.c (cp_parser_new_type_id): Don't reduce a named array
468         type to its base type and number of elements here.
469         * init.c (build_new): Call complete_type_or_else to ensure that the
470         type is complete and to issue a diagnostic if it is not.
471         (build_new_1): Don't call complete_type_or_else here.
472
473 2007-07-03  Richard Guenther  <rguenther@suse.de>
474
475         PR c++/32609
476         * class.c (fixed_type_or_null): Re-lookup the hashtable slot
477         after recursing.
478
479 2007-07-02  Simon Baldwin  <simonb@google.com>
480
481         * parser.c (cp_parser_elaborated_type_specifier): Added a warning
482         for inner-style nested forward declarations that don't declare
483         anything useful.
484
485 2007-07-02  Jakub Jelinek  <jakub@redhat.com>
486
487         PR c++/31748
488         * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
489         DECL_P in not a variable and appears more than once error messages.
490
491 2007-07-01  Ollie Wild  <aaw@google.com>
492
493         * name-lookup.c (ambiguous_decl): Fix case when new->value is hidden.
494         (select_decl): Remove function.
495         (unqualified_namespace_lookup): Populate binding by calling
496         ambiguous_decl.  Remove select_decl call.
497         (lookup_qualified_name): Remove select_decl call.
498         * decl.c (lookup_and_check_tag): Check for ambiguous references.
499         * parser.c (cp_parser_elaborated_type_specifier): Skip redundant error
500         generation when name lookup is ambiguous.
501
502 2007-06-29  Douglas Gregor  <doug.gregor@gmail.com>
503
504         PR c++/31724
505         * init.c (build_new_1): Use structural equality on the copy of the
506         array type.
507
508 2007-06-28  Geoffrey Keating  <geoffk@apple.com>
509
510         * decl2.c (determine_visibility): Implement
511         flag_visibility_ms_compat effect on type info.
512         * decl.c (cxx_init_decl_processing): Implement
513         global effect of flag_visibility_ms_compat.
514
515 2007-06-28  Geoffrey Keating  <geoffk@apple.com>
516
517         * decl2.c (start_objects): Mark constructor-running function
518         as artificial.
519
520 2007-06-26  Simon Martin  <simartin@users.sourceforge.net>
521
522         PR c++/32111
523         * decl.c (grokdeclarator): Reset friendp for member functions declared
524         friend of their own class.
525
526 2007-06-23  Mark Mitchell  <mark@codesourcery.com>
527
528         * decl2.c (determine_visibility): Don't look for dllexport here.
529         (determine_visibility_from_class): Tidy.
530
531 2007-06-18  Simon Baldwin <simonb@google.com>
532
533         PR c++/31923
534         * parser.c (cp_parser_single_declaration): Added check for storage
535         class other than sc_none in parsed declaration, and a flag to indicate
536         if the call is part of an explicit template specialization parse.
537         * (cp_parser_explicit_specialization): Specialization check flag added
538         to call to cp_parser_single_declaration(), set true.
539         * (cp_parser_template_declaration_after_export): Specialization check
540         flag added to call to cp_parser_single_declaration(), set false.
541         * pt.c (check_explicit_specialization): Added code to copy visiblity
542         and linkage from the templated function to the explicit specialization.
543
544 2007-06-15  Andrew Pinski  <andrew_pinski@playstation.sony.com>
545
546         * typeck.c (build_binary_op): For templates build the
547         expression in pieces to avoid the assert in build2_stat.
548         (get_member_function_from_ptrfunc):
549         Change over to using POINTER_PLUS_EXPR and convert
550         the second operand to sizetype.
551         * typeck2.c (build_m_component_ref):  Likewise.
552         * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR
553         instead of PLUS_EXPR for pointers.
554         (build_new_1): Likewise.
555         (build_vec_delete_1): Likewise.
556         (build_vec_delete): Likewise.
557         * class.c (build_base_path): Likewise.
558         (build_base_path): Likewise.
559         (convert_to_base_statically): Likewise.
560         (fixed_type_or_null): Handle POINTER_PLUS_EXPR.
561         (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR
562         instead of PLUS_EXPR.
563         (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR
564         instead of PLUS_EXPR for pointers.
565         * call.c (build_special_member_call): Likewise.
566         * rtti.c (build_headof): Likewise.
567         Use sizetype instead of ptrdiff_type_node.
568         (tinfo_base_init): Create a POINTER_PLUS_EXPR
569         instead of PLUS_EXPR for pointers.
570         * except.c (expand_start_catch_block):  Do a
571         NEGATIVE and then a POINTER_PLUS_EXPR instead
572         of a MINUS_EXPR.
573         * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert
574         PLUS_EXPR on pointer types over to use
575         POINTER_PLUS_EXPR and remove the conversion
576         to the pointer types.
577         * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for
578         adding to a pointer type. Use size_int instead of
579         ssize_int. Convert the index to sizetype before
580         adding it to the pointer.
581
582 2007-06-15  Mark Mitchell  <mark@codesourcery.com>
583
584         * cp-tree.h (DECL_VAR_MARKED_P): Remove.
585         (DECL_ANON_UNION_VAR_P): New macro.
586         * class.c (fixed_type_or_null): Tidy.  Use a hash table, rather
587         than DECL_VAR_MARKED_P, to keep track of which variables we have
588         seen.
589         * decl.c (redeclaration_error_message): Complain about redeclaring
590         anonymous union members at namespace scope.
591         * decl2.c (build_anon_union_vars): Set DECL_ANON_UNION_VAR_P.
592
593 2007-06-14  Geoff Keating  <geoffk@apple.com>
594
595         * decl2.c (determine_visibility): Ensure that functions with
596         hidden types as parameters are hidden.
597
598         PR 31093
599         * decl2.c (determine_visibility): Remove duplicate code for
600         handling type info.
601
602 2007-06-12  Ian Lance Taylor  <iant@google.com>
603
604         PR libstdc++/29286
605         * init.c (avoid_placement_new_aliasing): New static function.
606         (build_new_1): Call it.
607
608 2007-06-11  Rafael Avila de Espindola  <espindola@google.com>
609
610         * cp-objcp-common.h (LANG_HOOKS_SIGNED_TYPE): Remove.
611         (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove.
612
613 2007-06-08  Jakub Jelinek  <jakub@redhat.com>
614
615         PR c++/32177
616         * semantics.c (finish_omp_for): Call fold_build_cleanup_point_expr
617         on init, the non-decl cond operand and increment value.
618
619 2007-06-07  Simon Martin  <simartin@users.sourceforge.net>
620
621         PR c++/30759
622         * decl.c (check_initializer): Report an error when a brace enclosed
623         initializer is used for a non-aggregate type in C++98.
624         (redeclaration_error_message): Rewrote flag_cpp0x in terms of
625         cxx_dialect.
626         (grokdeclarator): Likewise.
627         (move_fn_p): Likewise.
628         * typeck.c (check_return_expr): Likewise.
629         * call.c (reference_binding): Likewise.
630         * error.c (cp_cpp_error): Likewise.
631         * pt.c (check_default_tmpl_args): Likewise.
632         (tsubst): Likewise.
633         * lex.c (init_reswords): Likewise.
634         * parser.c (p_parser_primary_expression): Likewise.
635         (TOKEN_PRECEDENCE): Likewise.
636         (cp_parser_init_declarator): Likewise.
637         (cp_parser_ptr_operator): Likewise.
638         (cp_parser_parameter_declaration): Likewise.
639         (cp_parser_enclosed_template_argument_list): Likewise.
640         (cp_parser_skip_to_end_of_template_parameter_list): Likewise.
641         (cp_parser_next_token_ends_template_argument_p): Likewise.
642
643 2007-06-04  Simon Baldwin  <simonb@google.com>
644
645         * decl.c (grokdeclarator): Readability change.  Moved case labels
646         into direct switch statement scope.
647
648 2007-06-04  Paolo Carlini  <pcarlini@suse.de>
649
650         * call.c (convert_like_real): Remove pointless code.
651
652 2007-05-31  Mark Mitchell  <mark@codesourcery.com>
653
654         * decl.c (get_atexit_fn_ptr_type): New function.
655         (get_atexit_node): Use it.
656         (start_cleanup_fn): Likewise.
657         (register_dtor_fn): Use the object's destructor, instead of a
658         separate cleanup function, where possible.
659         * cp-tree.h (CPTI_ATEXIT_FN_PTR_TYPE): New enumerator.
660         (atexit_fn_ptr_type_node): New macro.
661         * decl2.c (build_cleanup): Use build_address.
662
663 2007-05-31  Daniel Berlin  <dberlin@dberlin.org>
664
665         * typeck.c (build_binary_op): Include types in error.
666
667 2007-05-31  Jakub Jelinek  <jakub@redhat.com>
668
669         PR c++/31806
670         * decl.c (cp_finish_decl): Also clear was_readonly if a static var
671         needs runtime initialization.
672
673 2007-05-31  Paolo Carlini  <pcarlini@suse.de>
674
675         PR c++/32158
676         * semantics.c (finish_trait_expr): Complete the types.
677
678 2007-05-30  Russell Yanofsky <russ@yanofsky.org>
679             Douglas Gregor <doug.gregor@gmail.com>
680             Pedro Lamarao <pedro.lamarao@mndfck.org>
681             Howard Hinnant <howard.hinnant@gmail.com>
682
683         PR c++/7412
684         PR c++/29939
685         * typeck.c (comptypes): Don't consider rvalue and lvalue
686         reference types to be equivalent.
687         (check_return_expr): Move from certain lvalues when returning
688         them.
689         * decl.c (grokdeclarator): Implement reference collapsing.
690         (copy_fn_p): Don't consider constructors taking rvalue references
691         to be copy constructors.
692         (move_fn_p): New.
693         * call.c (conversion): New "rvaluedness_matches_p" member.
694         (convert_class_to_reference): Require reference type as first
695         parameter instead of base type.
696         (reference_binding): Add logic to handle rvalue references.
697         (implicit_conversion): Update inaccurate comment.
698         (convert_like_real): Disable creation of temporaries that are
699         impossible to initialize for types with move constructors.
700         (build_over_call): Elide move constructors when possible.
701         (maybe_handle_implicit_object): Set "rvaluedness_matches_p".
702         (maybe_handle_ref_bind): Return conversion instead of type node.
703         (compare_ics): Add logic to use "rvaluedness_matches_p" values to
704         determine preferred conversion sequences.
705         * cp-tree.h (TYPE_REF_IS_RVALUE): New.
706         (LOOKUP_PREFER_RVALUE): New.
707         (DECL_MOVE_CONSTRUCTOR_P): New.
708         (struct cp_declarator): Add "reference" member for reference
709         types, with new "rvalue_ref" flag.
710         (cp_build_reference_type): Declare.
711         (move_fn_p): Declare.
712         * error.c (dump_type_prefix): Format rvalue reference types
713         correctly in error messages.
714         * except.c (build_throw): Move from certain lvalues when
715         throwing.
716         * mangle.c (write_type): Mangle rvalue references differently
717         than regular references.
718         * parser.c (make_reference_declarator): Add boolean parameter for
719         rvalue references.
720         (cp_parser_make_indirect_declarator): New.
721         (cp_parser_new_declarator_opt): Call
722         cp_parser_make_indirect_declarator. 
723         (cp_parser_conversion_declarator_opt): Ditto.
724         (cp_parser_declarator): Ditto.
725         (cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference
726         declarators.
727         * pt.c (tsubst): Implement reference collapsing.
728         (maybe_adjust_types_for_deduction): Implement special template
729         parameter deduction rule for rvalue references.
730         (type_unification_real): Update calls to
731         maybe_adjust_types_for_deduction.
732         (try_one_overload): Ditto.
733         (unify_pack_expansion): Ditto.
734         * tree.c (lvalue_p_1): Handle rvalue reference types.
735         (cp_build_reference_type): New.
736
737 2007-05-30  Jakub Jelinek  <jakub@redhat.com>
738
739         PR c++/31809
740         * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC
741         variables that need runtime initialization.
742
743 2007-05-28  Andrew Pinski  <Andrew_pinski@playstation.sony.com>
744
745         PR c++/31339
746         * typeck.c (build_unary_op <case PREINCREMENT_EXPR,
747         case POSTINCREMENT_EXPR, case PREDECREMENT_EXPR,
748         case POSTDECREMENT_EXPR>): Return the error_mark_node
749         if either the real or imaginary parts would an
750         error_mark_node.
751         
752 2007-05-25  Simon Martin  <simartin@users.sourceforge.net>
753             Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
754
755         PR c++/31745
756         * parser.c (cp_parser_skip_to_closing_brace): Return true if the next
757         token is a closing brace, false if there are no tokens left.
758         (cp_parser_namespace_alias_definition): Only consume the next token if
759         it is a closing brace.
760
761         * parser.c (cp_parser_class_specifier): Likewise.
762
763 2007-05-25  H.J. Lu  <hongjiu.lu@intel.com>
764
765         * semantics.c (finish_member_declaration): Fix a typo in the
766         last checkin.
767
768 2007-05-25  Douglas Gregor <doug.gregor@gmail.com>
769
770         PR c++/31431
771         PR c++/31432
772         PR c++/31434
773         PR c++/31435
774         PR c++/31437
775         PR c++/31438
776         PR c++/31442
777         PR c++/31443
778         PR c++/31444
779         PR c++/31445
780         * error.c (dump_type): Dump TYPE_ARGUMENT_PACK nodes.
781         * cp-tree.h (check_for_bare_parameter_packs): Returns bool.
782         * pt.c (check_for_bare_parameter_packs): Return bool indicated
783         whether everything was okay. Fix indentation.
784         (push_template_decl_real): Check for bare parameter packs in
785         function parameters; where errors occur, mark the parameter types
786         with ERROR_MARK_NODEs to avert ICEs.
787         (coerce_template_parameter_pack): New.
788         (coerce_template_parms): Moved parameter pack coercion into
789         coerce_template_parameter_pack, and permit it anywhere in the
790         template parameter list (not just at the end). Parameter and
791         argument indices can vary (somewhat) separately now, so add
792         PARM_IDX and ARG_IDX.
793         (fn_type_unification): Don't set an argument pack as incomplete if
794         no argument pack was deduced.
795         (type_unification_real): If a type parameter is a parameter pack
796         and has not otherwise been deduced, it will be deduced to an empty
797         parameter pack.
798         (more_specialized_fn): Use the actual lengths of the argument
799         lists when comparing against expansions.
800         * semantics.c (finish_member_declaration): If a field's type has
801         bare parameter packs, error and set its type to ERROR_MARK_NODE.
802
803 2007-05-24  Danny Smith  <dannysmith@users.sourceforge.net>
804
805         PR target/27067
806         * mangle.c (mangle_decl): Call targetm.mangle_decl_assembler_name.
807
808 2007-05-22  Ollie Wild  <aaw@google.com>
809
810         * name-lookup.c (ambiguous_decl): Adds check for hidden types.
811         (unqualified_namespace_lookup): Adds check for hidden types.
812
813 2007-05-22  Ollie Wild  <aaw@google.com>
814
815         * decl.c (duplicate_decls): Verify namespace names are unique.
816
817 2007-05-21  Mark Mitchell  <mark@codesourcery.com>
818
819         * decl.c (cxx_maybe_build_cleanup): Handle
820         __attribute__((cleanup)).
821
822 2007-05-19  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
823
824         * cvt.c (cp_convert_and_check): Don't check warnings if the
825         conversion failed.
826
827 2007-05-18  Geoffrey Keating  <geoffk@apple.com>
828
829         * mangle.c (write_real_cst): Use 'unsigned long' for %lx.
830
831 2007-05-14  Paolo Carlini  <pcarlini@suse.de>
832
833         PR c++/29928
834         * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the
835         type only if is a class type (5.2.8/4).
836
837 2007-05-14  Rafael Avila de Espindola  <espindola@google.com>
838
839         * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
840         * decl.c (grokdeclarator): Use unsigned_type_for instead of
841         c_common_unsigned_type.
842
843 2007-05-11  Silvius Rus  <rus@google.com>
844
845         * cp/typeck.c (build_indirect_ref): Add call to
846         strict_aliasing_warning.
847         (build_reinterpret_cast_1): Condition call to
848         strict_aliasing_warning. 
849
850 2007-05-11  Jan Hubicka  <jh@suse.cz>
851
852         * semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
853         * decl2.c (start_objects): ctors and dtors are no longer public.
854         (cp_write_global_declarations): Do not call c_build_cdtor_fns.
855         
856 2007-05-07  Andrew Pinski  <andrew_pinski@playstation.sony.com>
857
858         * typeck.c (build_unary_op): Remove code that used to
859         handle non lvalue increments/decrements.
860
861 2007-05-07  Mike Stump  <mrs@apple.com>
862
863         * parser.c (check_empty_body): Add.
864         (cp_parser_iteration_statement): Add call to check_empty_body.
865
866 2007-05-05  Geoffrey Keating  <geoffk@apple.com>
867
868         PR 31775
869         * mangle.c (write_mangled_name): Mangle static variable names.
870         (write_unqualified_name): Use local-source-name for
871         namespace-scope static variables.
872
873 2007-05-04  Dirk Mueller  <dmueller@suse.de>
874
875         * cp-tree.h (DECL_MAIN_P): only if -ffreestanding is
876         not in effect.
877
878 2007-05-02  Seongbae Park  <seongbae.park@gmail.com>
879
880         PR c++/31663
881         * decl2.c (constrain_class_visibility): 
882         Use strip_pointer_or_array_types instead of strip_array_types.
883
884 2007-04-28  Andrew Pinski  <andrew_pinski@playstation.sony.com>
885
886         PR C++/30221
887         * decl.c (reshape_init_r): Don't reshape the first element if it
888         is a pointer to member function.
889
890 2007-04-27  Simon Baldwin  <simonb@google.com>
891
892         * decl.c (grokparms): Changed message format from %qD to %qE.
893
894 2007-04-27  Douglas Gregor  <doug.gregor@gmail.com>
895
896         * error.c (maybe_warn_variadic_templates): Variadic templates are
897        now in C++0x, so only warn about them in C++98 mode.
898         
899 2007-04-26  Andrew Pinski  <andrew_pinski@playstation.sony.com>
900
901         PR C++/30016
902         * typeck.c (build_reinterpret_cast_1): Only allow conversion to
903         integeral types from vectors types.
904
905 2007-04-26  Jakub Jelinek  <jakub@redhat.com>
906
907         PR c++/31598
908         * semantics.c (finish_omp_clauses): Don't create CP_OMP_CLAUSE_INFO
909         for type dependent OMP_CLAUSE_DECLs.
910
911 2007-04-24  Mark Mitchell  <mark@codesourcery.com>
912
913         PR c++/31338
914         * cp-tree.h (ARITHMETIC_TYPE): Include COMPLEX_TYPE.
915         * typeck.c (type_after_usual_arithmetic_conversions): Adjust, as
916         COMPLEX_TYPE is now an ARITHMETIC_TYPE.
917         * init.c (build_zero_init): Adjust, as
918         COMPLEX_TYPE is now a SCALAR_TYPE.
919         * typeck2.c (digest_init): Allow brace-enclosed initializers for
920         COMPLEX_TYPE, even though that is now a SCALAR_TYPE.
921
922 2007-04-25  Paolo Carlini  <pcarlini@suse.de>
923
924         * semantics.c (classtype_has_nothrow_copy_or_assign_p): Adjust
925         per N2255; rename as classtype_has_nothrow_assign_or_copy_p.
926         (trait_expr_value): Adjust.
927
928 2007-04-23  Simon Baldwin  <simonb@google.com>
929
930         * decl.c (grokparms): Added new error for duplicate function
931         parameters names in function prototypes, to match gcc behavior.
932
933 2007-04-23  Jan Hubicka  <jh@suse.cz>
934
935         * cp/decl2.c (finish_objects): Do not call target constructor/destructor
936         bits dirrectly.
937
938 2007-04-21  Andrew Pinski  <andrew_pinski@playstation.sony.com>
939
940         * cp-tree.h (lang_tree_node): Use GENERIC_NEXT
941         instead of checking GIMPLE_STMT_P in chain_next.
942
943 2007-04-17  Mark Mitchell  <mark@codesourcery.com>
944
945         PR c++/31513
946         * call.c (convert_for_arg_passing): Convert bitfields to their
947         declared types.
948
949 2007-04-17  Simon Martin  <simartin@users.sourceforge.net>
950
951         PR c++/31517
952         * pt.c (value_dependent_expression_p): Handle MODOP_EXPRs.
953
954 2007-04-16  Seongbae Park <seongbae.park@gmail.com>
955
956         PR c++/29365
957         * cp/decl2.c (constrain_class_visibility):
958         Do not warn about the use of anonymous namespace in the main input file.
959
960 2007-04-15  Mark Mitchell  <mark@codesourcery.com>
961
962         * cp-tree.h (current_template_parms): Fix typo in comment.
963
964 2007-04-15  Kazu Hirata  <kazu@codesourcery.com>
965
966         * cp-tree.h, error.c: Fix comment typos.
967
968 2007-04-13  Jason Merrill  <jason@redhat.com>
969
970         PR c++/31074
971         * call.c (reference_binding): Add c_cast_p parm.  If true,
972         add quals to TO as needed to make it reference-compatible.
973
974 2007-04-11  Jan Hubicka  <jh@suse.cz>
975
976         * cp/class.c (convert_to_base_statically): Fold produced tree; verify
977         that we are not processing template_decl.
978
979 2007-04-09  Mark Mitchell  <mark@codesourcery.com>
980
981         PR c++/31449
982         * class.c (build_base_path): Ensure that the converted pointer has
983         the same cv-qualification as the input.
984
985 2007-04-09  Paolo Carlini  <pcarlini@suse.de>
986
987         * tree.c (cp_tree_equal): Deal with TRAIT_EXPR.
988
989 2007-04-08  Steven Bosscher  <steven@gcc.gnu.org>
990
991         * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS):
992         Do not set it.
993         (LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P): Do not set it.
994         * tree.c (cp_add_pending_fn_decls): Remove.
995         * cp-tree.h (cp_add_pending_fn_decls): Remove prototype.
996
997 2007-04-07  Daniel Berlin  <dberlin@dberlin.org>
998
999         Revert change removing staticp.
1000
1001 2007-04-06  Daniel Berlin  <dberlin@dberlin.org>
1002
1003         * cp-objcp-common.c (cxx_staticp): Remove.
1004         * cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
1005         * cp-tree.h (cxx_staticp):      
1006
1007 2007-04-04  Danny Smith  <dannysmith.users.sourceforge.net>
1008
1009         * class.c (check_for_override): Don't remove dllmport attribute
1010         of virtual methods.
1011
1012 2007-04-03  Jakub Jelinek  <jakub@redhat.com>
1013
1014         PR c++/30847
1015         * typeck.c (build_modify_expr): For COND_EXPR on LHS, if RHS has void
1016         type issue error and return early.
1017
1018 2007-03-30  Jason Merrill  <jason@redhat.com>
1019
1020         PR c++/31187
1021         * typeck.c (cp_type_readonly): New fn.
1022         * cp-tree.h: Declare it.
1023         * decl.c (start_decl): Set implicit DECL_THIS_STATIC here.
1024         (cp_finish_decl): Not here.
1025
1026 2007-03-31  Richard Guenther  <rguenther@suse.de>
1027
1028         * optimize.c (maybe_clone_body): Replace splay-tree usage by
1029         pointer-map.
1030
1031 2007-03-31  Douglas Gregor  <doug.gregor@gmail.com>
1032
1033         PR c++/31138
1034         PR c++/31140
1035         PR c++/31141
1036         * parser.c (declarator_can_be_parameter_pack): New.
1037         (cp_parser_template_parameter): Only parse the `...' if the
1038         declarator can be a parameter pack.
1039         (cp_parser_parameter_declaration): Ditto. Also, handle when TYPE
1040         is NULL.
1041         * pt.c (find_parameter_packs_r): Look into the bounds on integer
1042         types (they could be used as array bounds). 
1043         (check_for_bare_parameter_packs): Deal with TEMPLATE_PARM_INDEX.
1044         (tsubst_pack_expansion): Handle failure to expand parameter
1045         packs.
1046         
1047 2007-03-30  Paolo Carlini  <pcarlini@suse.de>
1048
1049         PR c++/26099
1050         * cp-tree.h (enum cp_trait_kind, struct tree_trait_expr,
1051         TRAIT_EXPR_TYPE1, TRAIT_EXPR_TYPE2, TRAIT_EXPR_KIND): Add.
1052         (enum cp_tree_node_structure_enum, union lang_tree_node): Update.
1053         (CLASS_TYPE_NON_UNION_P): Add.
1054         (struct lang_type_class): Add has_complex_dflt.
1055         (TYPE_HAS_COMPLEX_DFLT, TYPE_HAS_TRIVIAL_DFLT): Add.
1056         (locate_copy, locate_ctor, locate_dtor, finish_trait_expr): Declare.
1057         * cp-tree.def: Add TRAIT_EXPR.
1058         * cp-objcp-common.c (cp_tree_size): Add TRAIT_EXPR case.
1059         * lex.c (struct resword): Add __has_nothrow_assign,
1060         __has_nothrow_constructor, __has_nothrow_copy, __has_trivial_assign,
1061         __has_trivial_constructor, __has_trivial_copy,
1062         __has_trivial_destructor, __has_virtual_destructor, __is_abstract,
1063         __is_base_of, __is_class, __is_convertible_to, __is_empty, __is_enum,
1064         __is_pod, __is_polymorphic, __is_union.
1065         * parser.c (cp_parser_primary_expression): Deal with the new RIDs.
1066         (cp_parser_trait_expr): New.
1067         * semantics.c (finish_trait_expr, trait_expr_value
1068         classtype_has_nothrow_copy_or_assign_p): New.
1069         * method.c (locate_copy, locate_ctor, locate_dtor): Do not define
1070         as static.
1071         * decl.c (cp_tree_node_structure): Add TRAIT_EXPR.
1072         * class.c (check_bases, check_field_decl, check_bases_and_members):
1073         Deal with TYPE_HAS_COMPLEX_DFLT (t) too.
1074         * pt.c (uses_template_parms, tsubst_copy_and_build,
1075         value_dependent_expression_p, type_dependent_expression_p): Deal with
1076         TRAIT_EXPR.
1077         * tree.c (cp_walk_subtrees): Deal with TRAIT_EXPR.
1078
1079 2007-03-29  Richard Guenther  <rguenther@suse.de>
1080
1081         * tree.c (cp_walk_subtrees): Do not set input_location.
1082
1083 2007-03-28  Simon Martin  <simartin@users.sourceforge.net>
1084
1085         PR c++/29077
1086         * decl.c (grokfndecl): Properly setup decl if it is a constructor or a
1087         destructor.
1088
1089 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1090
1091         * parser.c (struct cp_parser): Update comment for
1092         greater_than_is_operator_p.
1093         (cp_parser_primary_expression): In C++0x mode, a cast operator can
1094         be terminated with a `>>' token when !GREATER_THAN_IS_OPERATOR_P.
1095         (TOKEN_PRECEDENCE): In C++0x mode, `>>' is treated like `>' when
1096         !GREATER_THAN_IS_OPERATOR_P.
1097         (cp_parser_binary_expression): When -Wc++0x-compat, warn about
1098         `>>' operators that will become two `>' tokens in C++0x.
1099         (cp_parser_parameter_declaration): Treat `>>' like `>' in C++0x
1100         mode, allowing it to terminate default arguments.
1101         (cp_parser_enclosed_template_argument_list): In C++0x mode, treat
1102         `>>' like two consecutive `>' tokens.
1103         (cp_parser_skip_to_end_of_template_parameter_list): Ditto.
1104         (cp_parser_next_token_ends_template_argument_p): In C++0x, `>>'
1105         ends a template argument.
1106
1107 2007-03-28  Douglas Gregor  <doug.gregor@gmail.com>
1108
1109         * decl.c (redeclaration_error_message): Complain when redeclaring
1110         a friend function with default template arguments (C++0x mode only).
1111         * cp-tree.h (check_default_tmpl_args): Declare.
1112         * pt.c (check_default_tmpl_args): In C++0x mode, permit default
1113         template arguments in function templates. Add support for checking
1114         the default template arguments of friend templates.
1115         (push_template_decl_real): Fix call to check_default_tmpl_args.
1116         (type_unification_real): If a template parameter has not been
1117         deduced but provides a default template argument, substitute into
1118         that default template argument.
1119         * parser.c (cp_parser_init_declarator): When declaring (but not
1120         defining!) a function template in C++0x mode, check for default
1121         template arguments.
1122
1123 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
1124
1125         PR c++/29993
1126         * decl.c (grokdeclarator): Deal with cv-qualified function type
1127         typedefs in the same way for member and non-member functions.
1128
1129 2007-03-26  Dirk Mueller  <dmueller@suse.de>
1130
1131         * parser.c (cp_parser_member_declaration): Pedwarn
1132         about stray semicolons after member declarations.
1133
1134 2007-03-26  Paolo Carlini  <pcarlini@suse.de>
1135
1136         PR c++/30500
1137         * pt.c (instantiate_decl): Set in_system_header.
1138
1139 2007-03-22  Mark Mitchell  <mark@codesourcery.com>
1140
1141         * cp-tree.h (current_tempalte_parms): Improve documentation.
1142         * pt.c (current_template_args): Likewise.
1143
1144         PR c++/30863
1145         * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Do
1146         not consume tokens when failing.
1147
1148 2007-03-22  Jim Wilson  <wilson@specifix.com>
1149             Mark Mitchell  <mark@codesourcery.com>
1150
1151         PR c++/31273
1152         * call.c (standard_conversion): Use type_decays_to.  Keep FCODE
1153         consistent with FROM.
1154
1155 2007-03-22  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1156
1157         * error.c (dump_expr): Handle dependent names that designate types.
1158         * cxx-pretty-print.c (pp_cxx_unqualified_id): Handle TYPENAME_TYPE.
1159
1160 2007-03-17  Kazu Hirata  <kazu@codesourcery.com>
1161
1162         * cp-tree.def, parser.c, pt.c: Fix comment typos.
1163
1164 2007-03-16  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1165
1166         * cvt.c (cp_convert_and_check) : Define.
1167         * cp-tree.h (cp_convert_and_check): Declare.
1168         * call.c (convert_conversion_warnings): Rename to
1169         conversion_null_warnings.  The warning for floating-point to
1170         integer is handled by convert_and_check in convert_like_real.
1171         (convert_like_real): convert_conversion_warnings was renamed as
1172         conversion_null_warnings.
1173         * typeck.c (build_binary_op): Use cp_convert_and_check to warn for
1174         overflow and changes of value during conversion.
1175
1176 2007-03-15  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1177
1178         PR c++/30891
1179         * parser.c (cp_parser_statement): If 'namespace' is found, this
1180         only can be a namespace alias definition, so parse it now.
1181         (cp_parser_namespace_alias_definition): if we find an open brace
1182         instead of '=', then this is actually a misplaced namespace
1183         definition.
1184         
1185 2007-03-15  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1186
1187         PR c++/24924
1188         * decl.c (cxx_init_decl_processing): Move command-line options
1189         processing to c-opts.c.
1190         
1191 2007-03-15  Douglas Gregor  <doug.gregor@gmail.com>
1192
1193         * ptree.c (cxx_print_type): Use formatting markup for integers
1194         when printing template parameter index/level/orig level.
1195         (cxx_print_xnode): Ditto.
1196         * cp-tree.h (TEMPLATE_PARM_PARAMETER_PACK): Use TREE_LANG_FLAG_0.
1197         (struct template_parm_index_s): Remove the PARAMETER_PACK member.
1198         Make INDEX, LEVEL, and ORIG_LEVEL integers instead of
1199         HOST_WIDE_INTs.
1200         (struct saved_scope): Make X_PROCESSING_TEMPLATE_DECL an int,
1201         rather than a HOST_WIDE_INT.
1202         Turn X_PROCESSING_EXPLICIT_INSTANTIATION, SKIP_EVALUATION, and
1203         NEED_POP_FUNCTION_CONTEXT into bool bitfields; reorder fields for
1204         better bit-packing.
1205         (struct language_function): Make RETURNS_VALUE, RETURNS_NULL,
1206         RETURNS_ABNORMALLY, IN_FUNCTION_TRY_HANDLER, and
1207         IN_BASE_INITIALIZER bool bitfields.
1208         (struct cp_declarator): Make KIND a 4-bit field. Make
1209         PARAMETER_PACK_P a bool bitfield just after KIND.
1210         * pt.c (uses_parameter_packs): Destroy the pointer set.
1211         (make_pack_expansion): Ditto.
1212         (check_for_bare_parameter_packs): Ditto.
1213         * name-lookup.c (push_to_top_level): Make need_pop a bool value.
1214         
1215 2007-03-14  Andrew Pinski  <andrew_pinski@playstation.sony.com>
1216
1217         PR c++/31165
1218         * call.c  (convert_default_arg): Instead of copying the node,
1219         unshare it.
1220
1221 2007-03-15  Dirk Mueller  <dmueller@suse.de>
1222
1223         PR c++/30860
1224         * call.c (convert_conversion_warnings): New..
1225         (convert_like_real): .. factored out from here.
1226         (convert_conversion_warnings): Add warning about
1227         false being converted to NULL in argument passing.
1228
1229 2007-03-14  Dirk Mueller  <dmueller@suse.de>
1230
1231         * cp/semantics.c (c_finish_if_stmt): Call empty_if_body_warning.
1232         (finish_do_body): Warn about empty body in do/while statement.
1233
1234 2007-03-14  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1235
1236         * class.c (warn_hidden): Add OPT_Woverloaded_virtual to warning.
1237         
1238 2007-03-14  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1239
1240         PR c/21438
1241         * typeck.c (build_binary_op): Call warn_for_div_zero instead of
1242         warning.
1243         
1244 2007-03-13  Alexandre Oliva  <aoliva@redhat.com>
1245
1246         * cp/repo.c (init_repo): Initialize random_seed saved options.
1247         (finish_repo): Adjust.
1248
1249 2007-03-13  Mark Mitchell  <mark@codesourcery.com>
1250
1251         PR bootstrap/30899
1252         * Make-lang.in (doc/g++.1): Use $< to specify the location from
1253         which to copy.
1254
1255 2007-03-12  Seongbae Park <seongbae.park@gmail.com>
1256
1257         * decl.c (compute_array_index_type): New warning flag warn_vla.
1258
1259 2007-03-12  Mark Mitchell  <mark@codesourcery.com>
1260
1261         PR c++/30108
1262         * call.c (convert_default_arg): Copy non-constant arguments.
1263
1264 2007-03-11  Mark Mitchell  <mark@codesourcery.com>
1265
1266         PR c++/31038
1267         * parser.c (cp_parser_postfix_expression): Disallow compound
1268         literals in constant expressions.
1269
1270         PR c++/30328
1271         * semantics.c (finish_typeof): Use unlowered_expr_type.
1272         
1273 2007-03-10  Mark Mitchell  <mark@codesourcery.com>
1274
1275         PR c++/30274
1276         * cp-tree.h (unlowered_expr_type): New function.
1277         * typeck.c (is_bitfield_expr_with_lowered_type): Handle
1278         COMPOUND_EXPR, MODIFY_EXPR, and SAVE_EXPR.
1279         (unlowered_expr_type): New function.
1280         (build_unary_op): Disallow predecrements of bool bitfields.
1281         * call.c (build_conditional_expr): Use unlowered_expr_type.
1282         * pt.c (type_unification_real): Likewise.
1283
1284 2007-03-09  Douglas Gregor  <doug.gregor@gmail.com>
1285
1286         PR c++/20599
1287         * typeck.c (check_return_expr): Check for bare parameter packs.
1288         (comptypes): Compare template parameter packs and
1289         type pack expansions.
1290         * decl.c (grokdeclarator): Deal with the declaration of function
1291         parameter packs.
1292         (grokparms): Verify that the (optional) function parameter pack is
1293         at the end of the parameter list.
1294         (xref_basetypes): Handle pack expansions in the base class.
1295         (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT.
1296         * cp-tree.def (TYPE_ARGUMENT_PACK): New.
1297         (NONTYPE_ARGUMENT_PACK): New.
1298         (TYPE_PACK_EXPANSION): New.
1299         (EXPR_PACK_EXPANSION): New.
1300         (ARGUMENT_PACK_SELECT): New.
1301         * cp-objcp-common.c (cp_tree_size): Compute size of
1302         (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and
1303         ARGUMENT_PACK_SELECT.
1304         * error.c (dump_template_argument): Print template argument packs.
1305         (dump_template_argument_list): Ditto.
1306         (dump_template_parameter): Dump `...' for template type parameter
1307         packs.
1308         (dump_type): Dump TYPE_PACK_EXPANSION nodes.
1309         (dump_parameters): Print function parameter packs.
1310         (dump_template_parms): Print template argument packs.
1311         (dump_expr): Dump EXPR_PACK_EXPANSION nodes.
1312         (maybe_warn_variadic_templates): New.
1313         * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION.
1314         * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
1315         NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
1316         CAST_EXPR. 
1317         * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION.
1318         (write_template_arg): Write argument packs as separate arguments.
1319         * cp-tree.h (struct template_parm_index_s): Add flag that
1320         indicates that the template parameter is actually a parameter
1321         pack.
1322         (struct tree_argument_pack_select): New.
1323         (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT.
1324         (union lang_tree_node): Add argument_pack_select.
1325         (FUNCTION_PARAMETER_PACK_P): New.
1326         (PACK_EXPANSION_P): New.
1327         (PACK_EXPANSION_PATTERN): New.
1328         (SET_PACK_EXPANSION_PATTERN): New.
1329         (PACK_EXPANSION_PARAMETER_PACKS): New.
1330         (ARGUMENT_PACK_P): New.
1331         (ARGUMENT_PACK_ARGS): New.
1332         (SET_ARGUMENT_PACK_ARGS): New.
1333         (ARGUMENT_PACK_INCOMPLETE_P): New.
1334         (ARGUMENT_PACK_EXPLICIT_ARGS): New.
1335         (TEMPLATE_PARM_PARAMETER_PACK): New.
1336         (TEMPLATE_TYPE_PARAMETER_PACK): New.
1337         (ARGUMENT_PACK_SELECT_FROM_PACK): New.
1338         (ARGUMENT_PACK_SELECT_INDEX): New.
1339         (ARGUMENT_PACK_SELECT_ARG): New.
1340         (struct cp_declarator): Add parameter_pack_p flag.
1341         (maybe_warn_variadic_templates): Declare.
1342         (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to
1343         indicate a template parameter pack. 
1344         (uses_parameter_packs): Declare.
1345         (template_parameter_pack_p): Declare.
1346         (template_parms_variadic_p): Declare.
1347         (make_pack_expansion): Declare.
1348         (check_for_bare_parameter_packs): Declare.
1349         * cxx-pretty-print.c (pp_cxx_unary_expression): Print
1350         sizeof... expressions. 
1351         (pp_cxx_expression): Print pack expansions and non-type argument
1352         packs.
1353         (pp_cxx_exception_specification): Print pack expansions. 
1354         (pp_cxx_direct_declarator): Print ellipsis for parameter packs.
1355         (pp_cxx_ctor_initializer): Print pack expansions.
1356         (pp_cxx_type_id): Print pack expansions.
1357         (pp_cxx_template_argument_list): Print argument packs.
1358         (pp_cxx_template_parameter): Print ellipsis for template parameter
1359         packs.
1360         * pt.c (comp_template_parms): Compare template parameter packs.
1361         (template_parameter_pack_p): New.
1362         (template_parms_variadic_p): New.
1363         (template_args_variadic_p): New.
1364         (make_ith_pack_parameter_name): New.
1365         (struct find_parameter_pack_data): New.
1366         (find_parameter_packs_r): New.
1367         (uses_parameter_packs): New.
1368         (make_pack_expansion): New.
1369         (check_for_bare_parameter_packs): New.
1370         (expand_template_argument_pack): New.
1371         (reduce_template_parm_level): Propagate parameter pack flag.
1372         (process_template_parm): Add is_parameter_pack parameter to state
1373         when the parameter is actually a parameter pack. Create template
1374         parameter packs when is_parameter_pack is true.
1375         (current_template_args): The argument for a template parameter
1376         pack is an argument pack containing a single pack expansion.
1377         (process_partial_specialization): When checking that non-type
1378         argument expressions do not involve template parameters, loop over
1379         the arguments in argument packs separately.
1380         (push_template_decl_real): Check that the type of the declaration
1381         does not have any bare parameter packs. Check that primary
1382         templates have no more than one parameter pack, and that it comes
1383         at the end of the template parameter list.
1384         (convert_template_argument): Handle coercions for pack expansion
1385         expressions by coercing the pattern then rebuilding the expansion.
1386         (coerce_template_parms): When coercing the arguments for a
1387         variadic template, pack "extra" arguments into an argument pack.
1388         (coerce_template_template_parms): Cannot coerce between parameter
1389         packs and non-pack parameters.
1390         (template_args_equal): Compare PACK_EXPANSION_P expressions.
1391         (comp_template_args): Expand all template arguments packs before
1392         comparing template argument lists.
1393         (mangle_class_name_for_template): Make argument packs as separate
1394         template arguments.
1395         (for_each_template_parm_r): No need to handle BASELINK. 
1396         (instantiate_class_template): Handle pack expansions in the base
1397         class list.
1398         (tsubst_pack_expansion): New.
1399         (tsubst_template_args): Handle substitutions of argument packs and
1400         pack expansion into template argument lists.
1401         (tsubst_decl): Expand function parameter packs into separate
1402         function parameters.
1403         (tsubst_arg_types): Expand a type pack expansion into separate
1404         argument types.
1405         (tsubst_exception_specification): Handle pack expansions in
1406         exception specifiers.
1407         (tsubst): See through ARGUMENT_PACK_SELECT arguments when 
1408         replacing a template parameter with its argument. If we encounter
1409         a substitution for an argument pack, just return the parameter
1410         itself. 
1411         (tsubst_copy): sizeof(X...) returns the number of elements in
1412         parameter pack X.  See through ARGUMENT_PACK_SELECT when the
1413         PARM_DECL is a parameter pack.
1414         (tsubst_expr): Expression pack expansions and argument packs
1415         cannot show up here; they will all be handled through function
1416         calls, sizeof, and template argument lists.
1417         (tsubst_copy_and_build): sizeof(X...) returns the number of
1418         elements in parameter pack X.  Handle pack expansions in TREE_LIST
1419         and CONSTRUCTOR nodes.
1420         (fn_type_unification): Handle "incomplete" explicit template
1421         argument lists that specify some of the arguments for a template
1422         parameter pack.
1423         (type_unification_real): Unify arguments against pack expansions.
1424         (template_parm_level_and_index): New, helper function.
1425         (unify_pack_expansion): New.
1426         (unify): Unify argument packs on an argument-by-argument basis,
1427         handling variadic argument packs as well.
1428         (more_specialized_fn): Handle unification of function parameter
1429         packs. All things being equal, prefer non-variadic function
1430         templates to variadic function templates.
1431         (more_specialized_class): Prefer the variadic class template
1432         partial specialization that binds fewer arguments to a parameter
1433         pack.
1434         (regenerate_decl_from_template): Expand function parameter packs
1435         into separate parameters.
1436         (instantiate_decl): Ditto.
1437         (tsubst_initializer_list): Handle pack expansions for base-class
1438         initializers.
1439         (dependent_type_p_r): Determine dependent types in argument packs
1440         and pack expansions.
1441         (value_dependent_expression_p): Determine value-dependence of
1442         non-type argument packs.
1443         (dependent_template_arg_p): Handle argument packs.
1444         * semantics.c (finish_cond): Check for bare parameter packs.
1445         (finish_expr_stmt): Ditto.
1446         (finish_for_expr): Ditto.
1447         (finish_switch_cond): Ditto.
1448         (finish_mem_initializers): Ditto.
1449         * name-lookup.c (arg_assoc_type): Handle pack expansions and
1450         argument packs.
1451         * decl2.c (cp_build_parm_decl): Mark function parameter packs.
1452         * parser.c (make_declarator): Declarator is not an expansion.
1453         (make_pointer_declarator): Transfer parameter pack flag to outer
1454         declarator.
1455         (make_reference_declarator): Ditto.
1456         (make_ptrmem_declarator): Ditto.
1457         (make_call_declarator): Ditto.
1458         (make_array_declarator): Ditto.
1459         (cp_parser_postfix_expression): Allow pack expansion expressions
1460         in the argument list for a call expression.
1461         (cp_parser_parenthesized_expression_list): Add new parameter
1462         ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand
1463         into separate arguments."
1464         (cp_parser_new_placement): Allow pack expansion expressions.
1465         (cp_parser_new_initializer): Ditto.
1466         (cp_parser_mem_initializer_list): Allow ellipsis to create a
1467         base-class initializer expansion.
1468         (cp_parser_mem_initializer): Ditto.
1469         (cp_parser_template_parameter_list): Keep track of whether the
1470         template parameter is a template parameter pack.
1471         (cp_parser_template_parameter): Parse the ellipsis to indicate a
1472         template parameter pack.
1473         (cp_parser_type_parameter): Ditto.
1474         (cp_parser_template_argument_list): Parse the ellipsis to indicate
1475         a pack expansion.
1476         (cp_parser_direct_declarator): Parse the ellipsis to indicate that
1477         this declarator is a parameter pack.
1478         (cp_parser_parameter_declaration): The ellipsis does not end the
1479         parameter declaration, because it might be a parameter pack. Parse
1480         the ellipsis to indicate a parameter pack.
1481         (cp_parser_initializer): Allow pack expansions.
1482         (cp_parser_initializer_list): Allow ellipsis to create an
1483         initializer expansion.
1484         (cp_parser_base_clause): Allow ellipsis to create a base specifier
1485         expansion.
1486         (cp_parser_type_id_list): Allow ellipsis to create an exception
1487         specifier expansion.
1488         (cp_parser_attribute_list): Don't allow pack expansions.
1489         (cp_parser_functional_cast): Allow pack expansions.
1490         (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to
1491         compute the length of a parameter pack.
1492         (cp_parser_next_token_ends_template_argument_p): An ellipsis can
1493         end a template argument.
1494         * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
1495         NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
1496         CAST_EXPR. 
1497
1498 2007-03-09  Dirk Mueller  <dmueller@suse.de>
1499
1500         * cp/call.c (build_new_op): Call warn_logical_operator.
1501
1502 2007-03-08  Volker Reichelt  <reichelt@netcologne.de>
1503
1504         PR c++/30852
1505         * semantics.c (finish_offsetof): Handle COMPOUND_EXPR.
1506
1507         PR c++/30534
1508         * pt.c (any_template_arguments_need_structural_equality_p):
1509         Robustify.
1510
1511 2007-03-08  Alexandre Oliva  <aoliva@redhat.com>
1512
1513         * decl.c (grokdeclarator): Disable warnings for anonymous
1514         bitfields.
1515
1516 2007-03-05  Volker Reichelt  <reichelt@netcologne.de>
1517
1518         * typeck2.c (readonly_error): Always emit a hard error.
1519         Remove last argument.
1520         * cp-tree.h (readonly_error): Adjust prototype.
1521         * semantics.c (finish_asm_stmt): Adjust call to readonly_error.
1522         * typeck.c (build_unary_op): Likewise.
1523         (build_modify_expr): Likewise.
1524
1525 2007-03-04  Simon Martin  <simartin@users.sourceforge.net>
1526
1527         PR c++/30895
1528         * tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees.
1529
1530 2007-03-03  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1531
1532         PR c++/15787
1533         * parser.c (struct cp_parser): New IN_IF_STMT.
1534         (cp_parser_statement_seq_opt): Handle an unexpected 'else',
1535         returning if parsing the body of an 'if' statement or issuing an
1536         error and continuing.
1537         (cp_parser_selection_statement): Set IN_IF_STMT bit when parsing
1538         body of 'if'.
1539         (cp_parser_jump_statement): Mask new IN_IF_STMT bit.
1540         
1541 2007-03-02  Simon Martin  <simartin@users.sourceforge.net>
1542
1543         PR c++/28253
1544         * class.c (update_vtable_entry_for_fn): Properly handle invalid overriders
1545         for thunks.
1546
1547 2007-03-02  Geoffrey Keating  <geoffk@apple.com>
1548
1549         * g++spec.c (lang_specific_driver): Add -lstdc++ when compiling
1550         Objective-C++.  Don't exit early if -shared-libgcc needs to be
1551         added.
1552
1553 2007-03-02  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1554
1555         * typeck.c (common_base_type): Delete unused function.
1556         
1557 2007-03-01  Brooks Moses  <brooks.moses@codesourcery.com>
1558
1559         * Make-lang.in: Add dummy lang.install-pdf target.
1560
1561 2007-03-01  Simon Baldwin <simonb@google.com>
1562
1563         PR c++/23689
1564         * decl.c (check_tag_decl): Added new warning for typedef ignored
1565         when it precedes an otherwise valid non-typedef declaration.
1566
1567 2007-02-28  Sandra Loosemore  <sandra@codesourcery.com>
1568
1569         * typeck.c (build_function_call): Store converted arguments
1570         in a stack-allocated array instead of building a list.
1571         (convert_arguments): Store arguments in the array passed in as an
1572         argument, and return the actual number of arguments.
1573         * call.c (build_call): Delete, and replace with...
1574         (build_call_n, build_call_a): New.
1575         (build_op_delete_call): Rewrite to avoid constructing argument lists.
1576         (build_over_call): Store converted arguments in a stack-allocated
1577         array instead of building a list.
1578         (build_cxx_call): Pass arguments in an array instead of as a list.
1579         (build_java_interface_fn_ref): Rewrite to avoid constructing
1580         argument lists.
1581         * tree.h: Update declarations to reflect above changes.
1582         * method.c (use_thunk): Use a stack-allocated array to hold
1583         the arguments instead of a list.
1584         * rtti.c (throw_bad_cast): Update call to cxx_call.
1585         (throw_bad_typeid): Likewise.
1586         (build_dynamic_cast_1): Likewise.
1587         * init.c (build_builtin_delete_call): Use build_call_n.
1588         * decl.c (expand_static_init): Likewise.
1589         * except.c (cp_protect_cleanup_actions): Likewise.
1590         * cp-gimplify.c (genericize_eh_spec_block): Likewise.
1591         (gimplify_must_not_throw_expr): Likewise.
1592         (cxx_omp_apply_fn): Use build_call_a.
1593
1594 2007-02-26  Mark Mitchell  <mark@codesourcery.com>
1595
1596         * semantics.c (expand_or_defer_fn): Call c_record_cdtor_fn.
1597         * decl2.c (cp_write_gloabl_declarations): Call c_build_cdtor_fns.
1598
1599 2007-02-25  Mark Mitchell  <mark@codesourcery.com>
1600
1601         * cp-tree.h (static_ctors): Remove.
1602         * cp-tree.h (static_dtors): Likewise.
1603         * cp-objcp-common.c (decl_shadowed_for_var_lookup): Adjust for
1604         refactoring of tree_map hierarchy.
1605         (decl_shadowed_for_var_insert): Likewise.
1606         * semantics.c (expand_body): Use c_expand_body.
1607         (expand_or_defer_fn): Don't update static_ctors or static_dtors.
1608         * decl2.c (static_ctors): Remove.
1609         (static_dtors): Likewise.
1610         (generate_ctor_or_dtor_function): Pass NULL_TREE to
1611         objc_generate_static_init_call.  Do not call static_[cd]tors.
1612         (generate_ctor_and_dtor_functions_for_priority): Do not check for
1613         static_[cd]tors.
1614         (cp_write_global_declarations): Likewise.
1615
1616 2007-02-23  Richard Guenther  <rguenther@suse.de>
1617
1618         * class.c (note_name_declared_in_class): Make declaration
1619         changes meaning a pedwarn.
1620
1621 2007-02-22  Michael Matz  <matz@suse.de>
1622
1623         PR c++/29433
1624         * cp-tree.h (TFF_UNQUALIFIED_NAME): New formatting flag.
1625         * error.c (dump_aggr_type, dump_simple_decl, dump_decl,
1626         dump_function_decl): Guard emitting outer scopes by new flag.
1627         * cp-lang.c (cxx_dwarf_name): New function.
1628         (LANG_HOOKS_DWARF_NAME): Define to cxx_dwarf_name.
1629         * pt.c (classtype_mangled_name, mangle_class_name_for_template):
1630         Remove functions.
1631         (push_template_decl_real, lookup_template_class): Remove calls
1632         to above functions.
1633
1634 2007-02-19  Mark Mitchell  <mark@codesourcery.com>
1635
1636         * call.c (build_new_method_call): Ensure that explicit calls of
1637         destructors have type "void".
1638
1639 2007-02-19  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1640
1641         * typeck.c (build_binary_op): Replace -Wstring-literal-comparison
1642         and -Walways-true with -Waddress.
1643         * cvt.c (convert_to_void): Replace unconditional warning with
1644         -Waddress.
1645
1646 2007-02-18  Kazu Hirata  <kazu@codesourcery.com>
1647
1648         * decl.c, tree.c: Fix comment typos.
1649
1650 2007-02-15  Andrew Pinski  <andrew_pinski@playstation.sony.com>
1651
1652         PR C++/30158
1653         * semantics.c (finish_stmt_expr_expr): Set TREE_TYPE of the 
1654         statement expression if we had an error mark node.
1655
1656 2007-02-15  Sandra Loosemore  <sandra@codesourcery.com>
1657             Brooks Moses  <brooks.moses@codesourcery.com>
1658             Lee Millward  <lee.millward@codesourcery.com>
1659
1660         * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
1661         Change class to tcc_vl_exp.
1662
1663         * call.c (build_call): Use build_call_list instead 
1664         of build3. 
1665         (build_over_call): Likewise.
1666         (build_new_method_call): Use build_min_non_dep_call_list 
1667         instead of build_min_non_dep.
1668
1669         * error.c (dump_call_expr_args): New function.
1670         (dump_aggr_init_expr_args): New function.
1671         (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them. 
1672         Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
1673
1674         * cvt.c (convert_to_void): Use build_call_array instead
1675         of build3; use new AGGR_INIT_EXPR accessor macros.
1676
1677         * mangle.c (write_expression): Use TREE_OPERAND_LENGTH
1678         instead of TREE_CODE_LENGTH.
1679
1680         * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
1681         AGGR_INIT_EXPR accessor macros.
1682
1683         * cp-gimplify.c (cp_gimplify_init_expr): Use 
1684         AGGR_INIT_EXPR_SLOT to set the slot operand.
1685
1686         * cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
1687         (AGGR_INIT_EXPR_SLOT): New macro.
1688         (AGGR_INIT_EXPR_ARG): New macro.
1689         (aggr_init_expr_nargs): New macro.
1690         (AGGR_INIT_EXPR_ARGP): New macro.
1691         (aggr_init_expr_arg_iterator): New.
1692         (init_aggr_init_expr_arg_iterator): New.
1693         (next_aggr_init_expr_arg): New.
1694         (first_aggr_init_expr_arg): New.
1695         (more_aggr_init_expr_args_p): New.
1696         (FOR_EACH_AGGR_INIT_EXPR_ARG): New.
1697         (stabilize_aggr_init): New declaration.
1698         (build_min_non_dep_call_list): Likewise.
1699
1700         * tree.c (process_aggr_init_operands): New function.
1701         (build_aggr_init_array) New function.
1702         (build_cplus_new): Update to use new CALL_EXPR and
1703         AGGR_INIT_EXPR accessor macros. Replace use of build3 with
1704         build_aggr_init_array.
1705         (build_min_non_dep_call_list) New function.
1706         (build_min_nt): Assert input code parameter is not a variable
1707         length expression class.
1708         (build_min, build_min_non_dep): Likewise.
1709         (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
1710         to check for equality instead of recursing. Handle tcc_vl_exp
1711         tree code classes.
1712         (stabilize_call): Update to only handle CALL_EXPRs, not 
1713         AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
1714         (stabilize_aggr_init): New function.
1715         (stabilize_init): Use it.
1716
1717         * cxx-pretty-print.c (pp_cxx_postfix_expression)
1718         <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
1719         AGGR_INIT_EXPR accessor macros and argument iterators.
1720         
1721         * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
1722         build_vl_exp. Iterate through the operands, recursively 
1723         processing each one.
1724         (tsubst_copy_and_build) <CALL_EXPR>: Update to use new
1725         CALL_EXPR accessor macros.
1726         (value_dependent_expression_p) <default>: Handle tcc_vl_exp
1727         tree code classes. Use TREE_OPERAND_LENGTH instead of 
1728         TREE_CODE_LENGTH.
1729
1730         * semantics.c (finish_call_expr): Use build_nt_call_list
1731         instead of build_nt.
1732         (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR 
1733         accessor macros. Use build_call_array to construct the 
1734         CALL_EXPR node instead of build3
1735         
1736         * decl2.c (build_offset_ref_call_from_tree): Use 
1737         build_nt_call_list and build_min_non_dep_call_list instead
1738         of build_min_nt and build_min_non_dep.
1739
1740         * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
1741         Use build_nt_call_list instead of build_min_nt.
1742
1743 2007-02-15  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1744
1745         PR c++/28943
1746         * call.c (build_conditional_expr): Improve error message.
1747         
1748 2007-02-13  Dirk Mueller  <dmueller@suse.de>
1749
1750         * friend.c (do_friend): Annotate warning about friend
1751         declarations in templates with OPT_Wnon_template_friend.
1752         Convert informal message from warning() to inform().
1753
1754 2007-02-12  Simon Martin  <simartin@users.sourceforge.net>
1755             Mark Mitchell  <mark@codesourcery.com>
1756
1757         PR c++/14622
1758         * pt.c (do_decl_instantiation): Detect type mismatches in explicit
1759         instantiations for variables.
1760
1761 2007-02-12  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1762
1763         PR middle-end/7651
1764         * cp-gimplify.c (gimplify_expr_stmt): Don't check extra_warnings.
1765         Check warn_unused_value just once.
1766
1767 2007-02-11  Mark Mitchell  <mark@codesourcery.com>
1768
1769         PR c++/26988
1770         * pt.c (determine_specialization): Use skip_artificial_parms_for.
1771         (fn_type_unificiation): Likewise.
1772         (get_bindings): Likewise.
1773
1774 o2007-02-06  Mark Mitchell  <mark@codesourcery.com>
1775
1776         PR target/29487
1777         * decl.c (finish_function): Use DECL_REPLACEABLE.
1778         * tree.c (cp_cannot_inline_tree_fn): Likewise.
1779
1780 2007-02-10  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1781
1782         * parser.c (cp_parser_primary_expression): Reformat overly long lines.
1783
1784 2007-02-10  Richard Henderson  <rth@redhat.com>, Jakub Jelinek  <jakub@redhat.com>
1785
1786         * decl.c (grokvardecl): Don't error if !have_tls.
1787         (grokdeclarator): Likewise.
1788         * parser.c (cp_parser_omp_threadprivate): Likewise.
1789
1790 2007-02-07  Jakub Jelinek  <jakub@redhat.com>
1791
1792         PR c++/30703
1793         * cp-gimplify.c (cp_genericize_r): Don't dereference invisiref
1794         parameters and result decls in omp clauses.
1795         (cxx_omp_privatize_by_reference): Pass also invisiref PARM_DECLs
1796         by reference.
1797
1798 2007-02-05  Dirk Mueller  <dmueller@suse.de>
1799
1800         PR bootstrap/30510
1801         * parser.c (cp_parser_class_specifier): Always initialize bases.
1802
1803 2007-02-05  Paolo Bonzini  <bonzini@gnu.org>
1804
1805         * cp-tree.h (OMP_ATOMIC_CODE): Delete.
1806         (OMP_ATOMIC_DEPENDENT_P): Rewrite.
1807         * pt.c (tsubst_expr): Adjust for new format of dependent OMP_ATOMIC
1808         expressions.
1809         * semantics.c (finish_omp_atomic): Store a whole expression node
1810         in operand 1, and integer_zero_node in operand 0, for dependent
1811         OMP_ATOMIC.  Rewrite to make flow easier to understand.
1812
1813 2007-02-03  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1814
1815         * decl.c (grokdeclarator): Use OPT_Wreturn_type instead of 0.
1816
1817 2007-02-04  Kazu Hirata  <kazu@codesourcery.com>
1818
1819         * class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
1820         parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
1821
1822 2007-02-03  Douglas Gregor  <doug.gregor@gmail.com>
1823
1824        * parser.c (cp_lexer_get_preprocessor_token): Attach the C++0x
1825        keyword warning to -Wc++0x-compat.
1826         
1827 2007-02-03  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1828
1829         * decl.c (grokdeclarator): Update documentation.
1830
1831 2007-02-02  Jakub Jelinek  <jakub@redhat.com>
1832
1833         PR c++/30536
1834         * decl.c (grokdeclarator): If __thread is used together with
1835         a storage class other than extern and static, clear thread_p
1836         after issuing diagnostics and fall through to checking the
1837         storage class.
1838
1839 2007-01-30  Roger Sayle  <roger@eyesopen.com>
1840
1841         * error.c (dump_type_suffix): Avoid use of cp_build_binary_op when
1842         calculating the size of an array (to avoid recursive errors).
1843
1844 2007-01-30  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1845
1846         PR c++/24745
1847         * typeck.c (build_binary_op): Fix logic for warning. Move warning
1848         to -Wpointer-arith.
1849         * call.c (convert_like_real): Don't warn when converting to
1850         boolean type.
1851         
1852 2007-01-29  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1853
1854         * decl.c (pop_label): Replace warning with call to
1855         warn_for_unused_label.
1856
1857 2007-01-28  Andrew Pinski  <pinskia@gmail.com>
1858
1859         PR C++/28988
1860         * semantics.c (finish_pseudo_destructor_expr): Check the
1861         destrutor name by calling check_dtor_name.
1862
1863 2007-01-24  Douglas Gregor  <dgregor@osl.iu.edu>
1864
1865         * lex.c (D_CPP0X): Rename.
1866         (D_CXX0X): To this.
1867         (reswords): D_CPP0X -> D_CXX0X.
1868         (init_reswords): Ditto.
1869         * parser.c (cp_lexer_get_preprocessor_token): Warn about the use
1870         of C++0x keywords as identifiers.
1871
1872 2007-01-23  Simon Martin  <simartin@users.sourceforge.net>
1873
1874         PR c++/27492
1875         * decl.c (duplicate_decls): Don't reset DECL_INVALID_OVERRIDER_P for
1876         function decls.
1877
1878 2007-01-23  Ian Lance Taylor  <iant@google.com>
1879
1880         * typeck.c (convert_for_assignment): Only warn about a = b = c
1881         when converting to bool.
1882
1883 2007-01-23  Roger Sayle  <roger@eyesopen.com>
1884
1885         * call.c (null_ptr_cst_p): Replace use of TREE_CONSTANT_OVERFLOW with
1886         TREE_OVERFLOW.
1887         * typeck.c (ignore_overflows): Remove the remaining uses of
1888         TREE_CONSTANT_OVERFLOW.
1889
1890 2007-01-20  Jan Hubicka  <jh@suse.cz>
1891
1892         * decl2.c (start_objects, start_static_storage_duration_function):
1893         Do not make the functions uninlinable.
1894
1895 2007-01-17  Ian Lance Taylor  <iant@google.com>
1896
1897         * class.c (add_method): Call VEC_reserve_exact rather than passing
1898         a negative size to VEC_reserve.
1899
1900 2007-01-11  Simon Martin  <simartin@users.sourceforge.net>
1901
1902         PR c++/29573
1903         * tree.c (cp_tree_equal): Properly handle MODOP_EXPR trees.
1904
1905 2007-01-10  Mark Mitchell  <mark@codesourcery.com>
1906
1907         PR c++/28999
1908         * decl.c (make_typename_type): If the qualified name is not a
1909         type, issue an error.
1910         * parser.c (cp_parser_elaborated_type_specifier): Fix comment
1911         formatting.
1912
1913 2007-01-08  Geoffrey Keating  <geoffk@apple.com>
1914
1915         * rtti.c: Include target.h.
1916         (emit_support_tinfos): If ! targetm.cxx.library_rtti_comdat (),
1917         don't emit typeinfo for fundamental types as weak.
1918         * Make-lang.in (cp/rtti.o): Update and correct dependencies.
1919
1920 2007-01-08  Richard Guenther  <rguenther@suse.de>
1921
1922         * cvt.c (cp_convert_to_pointer): Use build_int_cst_type.
1923
1924 2007-01-08  Mark Shinwell  <shinwell@codesourcery.com>
1925
1926         * call.c (standard_conversion): Pass flag to
1927         vector_types_convertible_p to disallow emission of note.
1928         * typeck.c (convert_for_assignment): Pass flag to
1929         vector_types_convertible_p to allow emission of note.
1930         (ptr_reasonably_similar): Pass flag to vector_types_convertible_p
1931         to disallow emission of note.
1932
1933 2007-01-07  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1934
1935         PR c++/28986
1936         * typeck.c (build_binary_op): Call overflow_warning if
1937         TREE_OVERFLOW_P is true for the result and not for any of the
1938         operands.
1939         
1940 2007-01-06  Lee Millward  <lee.millward@codesourcery.com>
1941
1942        PR c++/19439
1943        * class.c (add_method): Don't wait until template
1944        instantiation time to complain about duplicate methods.
1945         
1946 2007-01-05  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1947
1948         PR c/19978
1949         * semantics.c (finish_unary_op_expr): Warn only if result
1950         overflowed and operands did not.
1951
1952 2007-01-05  Ian Lance Taylor  <iant@google.com>
1953
1954         * typeck.c (build_binary_op): Warn about comparing a non-weak
1955         address to NULL.
1956
1957 2007-01-05  Douglas Gregor  <doug.gregor@gmail.com>
1958
1959         * pt.c (tsubst): Propagate the need for structural equality checks
1960         when reducing the level of template parameters.
1961
1962 2007-01-03  Kazu Hirata  <kazu@codesourcery.com>
1963
1964         * pt.c: Fix a comment typo.
1965
1966 2007-01-02  Ian Lance Taylor  <iant@google.com>
1967
1968         * semantics.c (maybe_convert_cond): Optionally warn when using an
1969         assignment as a condition.
1970         * typeck.c (convert_for_assignment): Optionally warn about
1971         assigning the result of an assignment to a bool.
1972
1973 2007-01-02  Douglas Gregor  <doug.gregor@gmail.com>
1974
1975         * pt.c (canonical_template_parms): Correct typo in comment.
1976         
1977 2007-01-02  Douglas Gregor  <doug.gregor@gmail.com>
1978
1979         * typeck.c (structural_comptypes): Renamed from "comptypes".
1980         (comptypes): Use canonical type information to perform fast type
1981         comparison. When VERIFY_CANONICAL_TYPES, verify that the
1982         canonical type comparison returns the same results as we would see
1983         from the current, structural check. Support COMPARE_STRUCTURAL
1984         when we need structural checks.
1985         * decl.c (typename_compare): Fix comment.
1986         (build_typename_type): TYPENAME_TYPE nodes require structural
1987         equality checks, because they resolve different based on the
1988         current class type.
1989         (make_unbound_class_template): UNBOUND_CLASS_TEMPLATE nodes
1990         require structural equality checks (for now).
1991         (build_ptrmemfunc_type): Build the canonical pointer to member
1992         function type.
1993         (compute_array_index_type): Whenever we build a new index type
1994         to represent the size of an array in a template, we need to mark
1995         this index type as requiring structural equality. This goes for
1996         arrays with value-dependent sizes with the current ABI, or all
1997         arrays with ABI-1.
1998         * tree.c (cplus_array_hash): New.
1999         (struct cplus_array_info): New.
2000         (cplus_array_compare): New.
2001         (cplus_array_htab): New.
2002         (build_cplus_array_type_1): Use a hash table to cache the array
2003         types we build. Build the canonical array type for each array
2004         type.
2005         (cp_build_qualified_type_real): When building a cv-qualified array
2006         type, use the hash table of array types and build canonical array
2007         types as necessary.
2008         (bind_template_template_parm): BOUND_TEMPLATE_TEMPLATE_PARM nodes
2009         use structural equality (for now).
2010         * cp-tree.h (COMPARE_STRUCTURAL): New.
2011         * pt.c (canonical_template_parms): New.
2012         (canonical_type_parameter): New.
2013         (process_template_parm): Find the canonical type parameter.
2014         (lookup_template_class): When we have named the primary template
2015         type, set the canonical type for our template class to the primary
2016         template type. If any of the template arguments need structural
2017         equality checks, the template class needs structural equality
2018         checks.
2019         (tsubst): When reducing the level of a template template
2020         parameter, we require structural equality tests for the resulting
2021         parameter because its template parameters have not had their types
2022         canonicalized. When reducing a template type parameter, find the
2023         canonical reduced type parameter.
2024         (any_template_arguments_need_structural_equality_p): New.
2025