OSDN Git Service

2008-03-12 Richard Guenther <rguenther@suse.de>
[pf3gnuchains/gcc-fork.git] / gcc / cp / ChangeLog
1 2008-03-12  Richard Guenther  <rguenther@suse.de>
2
3         PR c++/35469
4         Revert:
5         2008-02-04  Richard Guenther  <rguenther@suse.de>
6
7         PR java/35035
8         * decl.c (record_builtin_java_type): Make jboolean a
9         integer type again where its mode doesn't match that of bool.
10
11         2008-01-25  Richard Guenther  <rguenther@suse.de>
12
13         PR c++/33887
14         * decl.c (record_builtin_java_type): Make __java_boolean
15         a variant of bool.
16         * typeck.c (structural_comptypes): Move TYPE_FOR_JAVA check
17         after TYPE_MAIN_VARIANT check.
18
19 2008-03-10  Jakub Jelinek  <jakub@redhat.com>
20
21         PR c++/35328
22         * semantics.c (finish_omp_clauses): Look through NOP_EXPR even
23         if errorcount.
24
25         PR c++/35337
26         * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
27         DECL_P in not a variable and appears more than once error messages.
28
29 2008-03-07  Paolo Bonzini  <bonzini@gnu.org>
30
31         Revert:
32
33         2008-02-06  Douglas Gregor  <doug.gregor@gmail.com>
34
35         PR c++/35049
36         PR c++/35096
37         * typeck.c (structural_comptypes): Call cp_comptypes.
38         (comptypes): New; called from the C/C++ common bits to perform
39         strict checks.
40         (cp_comptypes): Renamed from comptypes, which is already used,
41         with a different signature, by the C++ front end.
42         (build_reinterpret_cast_1): Call cp_comptypes.
43         (ptr_reasonably_similar): Ditto.
44         * decl.c (decls_match): Ditto.
45         * cvt.c (convert_to_reference): Ditto.
46         * cp-tree.h (same_type_p): Ditto.
47         (same_or_base_type_p): Ditto.
48         (comptypes): Rename to cp_comptypes.
49         * pt.c (canonical_type_parameter): Call cp_comptypes.
50
51 2008-03-07  Paolo Bonzini  <bonzini@gnu.org>
52
53         * cp-objcp-common.c (cxx_types_compatible_p): Remove obsolete
54         test for equivalence between pointer and references.
55
56 2008-03-02  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
57
58         PR 24924
59         * class.c (finish_struct_anon): Use permerror instead of pedwarn.
60         (check_field_decls): Likewise.
61         (note_name_declared_in_class): Likewise.
62         * call.c (build_new_op): Likewise.
63         (convert_like_real): Likewise.
64         (build_over_call): Likewise.
65         * lex.c (unqualified_fn_lookup_error): Likewise.
66         * parser.c (cp_parser_template_id): Likewise.
67         * cvt.c (warn_ref_binding): Likewise.
68         (convert_to_reference): Likewise.
69         (ocp_convert): Likewise.
70         (convert_to_void): Use error instead of pedwarn.
71         * error.c (cp_cpp_error): Use pedantic_warning_kind.
72         * decl.c (compute_array_index_type): Use constant_expression_error.
73         
74 2008-03-01  Douglas Gregor  <doug.gregor@gmail.com>
75
76         * parser.c (cp_lexer_next_token_is_decl_specifier_keyword): Note
77         that auto is either a storage class or a simple type specifier,
78         depending on the dialect.
79         (cp_parser_decl_specifier_seq): Complain about `auto' as a storage
80         specifier in C++98 mode, error in C++0x mode (since we don't
81         support auto as a type specifier, yet).
82         (cp_parser_storage_class_specifier_opt): Don't treat `auto' as a
83         storage specifier in C++0x mode.
84         (cp_parser_simple_type_specifier): Parse `auto' as a
85         simple-type-specifier, but error because we don't support it yet.
86
87 2008-02-29  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
88
89         * parser.c (cp_parser_nonclass_name): New.
90         (cp_parser_pseudo_destructor_name): Use it instead of
91         cp_parser_type_name.
92         (cp_parser_type_name): Move code to cp_parser_nonclass_name.
93
94 2008-02-29  Tom Tromey  <tromey@redhat.com>
95
96         * parser.c (struct cp_token) <input_file_stack_index>: Remove.
97         (cp_lexer_get_preprocessor_token): Update.
98         (cp_lexer_set_source_position_from_token): Don't call
99         restore_input_file_stack.
100         * lex.c (cxx_init): Don't use push_srcloc or pop_srcloc.
101
102 2008-02-28  Richard Guenther  <rguenther@suse.de>
103
104         Revert:
105         2008-02-26  Richard Guenther  <rguenther@suse.de>
106
107         * decl.c (duplicate_decls): Remove decl from global mapping
108         before ggc_freeing it.
109
110 2008-02-27  Jakub Jelinek  <jakub@redhat.com>
111
112         PR c++/35368
113         * rtti.c: Include c-pragma.h.
114         (push_abi_namespace, pop_abi_namespace): New functions.
115         (build_dynamic_cast_1, tinfo_base_init, get_pseudo_ti_index,
116         create_tinfo_types, emit_support_tinfos): Use them.
117         * Make-lang.in (cp/rtti.o): Depend on $(C_PRAGMA_H).
118
119 2008-02-26  Jason Merrill  <jason@redhat.com>
120
121         PR c++/35315
122         * decl.c (grokdeclarator): Allow a typedef of an unnamed struct
123         to name the struct for linkage purposes even if it has attributes.
124         (start_decl): In that case, set ATTR_FLAG_TYPE_IN_PLACE.
125
126 2008-02-26  Tom Tromey  <tromey@redhat.com>
127
128         * parser.c (eof_token): Remove old location code.
129         (check_empty_body): Remove test of USE_MAPPED_LOCATION.
130         * decl2.c (generate_ctor_or_dtor_function): Remove old location
131         code.
132         (cp_write_global_declarations): Likewise.
133         * lex.c (cxx_init): Remove old location code.
134         (handle_pragma_implementation): Remove test of
135         USE_MAPPED_LOCATION.
136         * pt.c (tsubst): Remove old location code.
137         * error.c (cp_print_error_function): Remove test of
138         USE_MAPPED_LOCATION.
139         * decl.c (pop_label): Remove old location code.
140         (finish_function): Likewise.
141
142 2008-02-26  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
143
144         PR 26264
145         * call.c (magic_varargs_p):  Remove BUILT_IN_STDARG_START.
146         
147 2008-02-26  Richard Guenther  <rguenther@suse.de>
148
149         * decl.c (duplicate_decls): Remove decl from global mapping
150         before ggc_freeing it.
151
152 2008-02-26  Paolo Carlini  <pcarlini@suse.de>
153
154         PR c++/35323
155         * name-lookup.c (arg_assoc_type): Handle FIXED_POINT_TYPE.
156
157 2008-02-26  Manuel Lopez-Ibanez <manu@gcc.gnu.org>
158         
159         * typeck.c (build_class_member_access_expr): Add appropriate
160         OPT_W* parameter to warning.
161         (build_reinterpret_cast_1): Likewise.
162         * name-lookup.c (push_overloaded_decl): Likewise.
163         
164 2008-02-25  Paolo Carlini  <pcarlini@suse.de>
165
166         PR c++/35333
167         * error.c (dump_expr): Handle CONJ_EXPR.
168
169 2008-02-25  Paolo Carlini  <pcarlini@suse.de>
170
171         PR c++/35338
172         * error.c (dump_type): Handle FIXED_POINT_TYPE.
173         (dump_expr): Handle FIXED_CST.
174
175 2008-02-24  Jason Merrill  <jason@redhat.com>
176
177         * parser.c (cp_parser_declaration): Handle "inline namespace".
178         (cp_parser_namespace_definition): Likewise.
179
180         PR c++/33486
181         * name-lookup.c (arg_assoc_namespace): Look down into inline 
182         namespaces, too.
183
184 2008-02-23  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
185
186         * typeck.c (check_for_casting_away_constness): Use 1 single
187         argument, the type of cast, to decide what diagnostics generate.
188         (build_static_cast_1): Remove unused code. Update call to
189         check_for_casting_away_constness.
190         (build_reinterpret_cast_1): Update call to
191         check_for_casting_away_constness.
192         (build_const_cast_1): Likewise.
193         
194 2008-02-24  Paolo Carlini  <pcarlini@suse.de>
195
196         * error.c (dump_expr): Don't deal directly with NEW_EXPR (and
197         VEC_NEW_EXPR), forward to pp_expression.
198         * cxx-pretty-print.c (pp_cxx_new_expression): Fix FIXME.
199
200 2008-02-24  Danny Smith  <dannysmith@users.sourceforge.net>
201
202         PR c++/34749
203         * friend.c (do_friend): Call cplus_decl_attributes earlier.
204
205 2008-02-22  Andrew Pinski  <andrew_pinski@playstation.sony.com>
206
207         PR C++/34715
208         * decl.c (duplicate_decls): Merge DECL_DISREGARD_INLINE_LIMITS for
209         template decls' function decl.
210
211 2008-02-22  Paolo Carlini  <pcarlini@suse.de>
212
213         PR c++/35282
214         Revert:
215         2008-02-14  Paolo Carlini  <pcarlini@suse.de>
216
217         PR c++/28743
218         * pt.c (determine_specialization): In case of function templates,
219         when the type of DECL does not match FN there is no match.
220
221 2008-02-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
222
223         PR c/19999
224         * typeck.c (build_binary_op): Warn about floating point
225         comparisons if FLOAT_TYPE_P, not only for REAL_TYPE.
226
227 2008-02-19  Jason Merrill  <jason@redhat.com>
228
229         PR c++/34950
230         * pt.c (resolve_overloaded_unification): Set processing_template_decl
231         while we look for possible bindings.
232
233 2008-02-19  Jakub Jelinek  <jakub@redhat.com>
234
235         PR c++/35028
236         * cp-gimplify.c (cxx_omp_clause_apply_fn): Handle vararg copy ctors.
237
238         PR c++/34964
239         PR c++/35244
240         * semantics.c (finish_omp_threadprivate): Do nothing for error_operand_p
241         vars.  Afterwards ensure v is VAR_DECL.
242
243         PR c++/35078
244         * parser.c (cp_parser_omp_for_loop): If DECL has REFERENCE_TYPE, don't
245         call cp_finish_decl.
246         * semantics.c (finish_omp_for): Fail if DECL doesn't have integral type
247         early.
248
249 2008-02-15  Douglas Gregor  <doug.gregor@gmail.com>
250
251         PR c++/35023
252         PR c++/35024
253         PR c++/35026
254         * pt.c (finish_member_template_decl): If the type in a TYPE_DECL
255         is error_mark_node, return an error early.
256         (find_parameter_packs_r): Pass the pointer set along to recursive
257         calls of cp_walk_subtrees; don't try to manage the pointer set
258         ourselves.
259         (uses_parameter_packs): Pass the pointer set to cp_walk_tree.
260         (make_pack_expansion): Ditto.
261         (check_for_bare_parameter_packs): Ditto. Also, don't bother taking
262         a second pass through the tree with find_parameter_packs_r; that
263         second pass no longer does anything.
264         (push_template_decl_real): If we have an erroneous declaration,
265         set its type to error_mark_node before returning an error.
266
267 2008-02-14  Douglas Gregor  <doug.gregor@gmail.com>
268
269         PR c++/34050
270         * pt.c (tsubst_initializer_list): Deal with the use of
271         VOID_TYPE_NODE to indicate value-initialization of the bases.
272
273 2008-02-14  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
274             Jason Merrill  <jason@redhat.com>
275
276         PR c++/5645
277         PR c++/11159
278         * class.c (type_has_user_nondefault_constructor): New fn.
279         * cp-tree.h: Declare it.
280         * init.c (emit_mem_initializers): Use it for -W warning about
281         missing base initializer.
282
283 2008-02-14  Paolo Carlini  <pcarlini@suse.de>
284
285         PR c++/28743
286         * pt.c (determine_specialization): In case of function templates,
287         when the type of DECL does not match FN there is no match.
288
289 2008-02-13  Jakub Jelinek  <jakub@redhat.com>
290             Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
291
292         PR c++/35138
293         * parser.c (cp_parser_pseudo_destructor_name): If next tokens
294         are not identifier :: ~, return before calling cp_parser_type_name.
295
296 2008-02-13  Jason Merrill  <jason@redhat.com>
297
298         PR c++/34962, c++/34937, c++/34939
299         * decl2.c (is_late_template_attribute): Always defer attributes 
300         vector_size and weak.
301
302         PR c++/34774
303         * pt.c (value_dependent_expression_p): Look into DECL_INITIAL
304         of enumerators, too.
305
306 2008-02-12  Jason Merrill  <jason@redhat.com>
307
308         PR c++/34824
309         * call.c (convert_like_real): Pass LOOKUP_NO_CONVERSION to build_temp
310         if we're doing conversions to call a user-defined conversion function.
311
312 2008-02-12  Steven Bosscher  <steven@gcc.gnu.org>
313
314         PR c++/29048
315         * semantics.c (finish_qualified_id_expr): Avoid duplicate access
316         check here, too.
317
318 2008-02-12  Jakub Jelinek  <jakub@redhat.com>
319
320         PR c++/34862
321         * init.c (build_new_1): Don't create placement_expr before
322         constructing alloc_call.  Verify that the pointer is passed by
323         value to operator new.
324
325 2008-02-11  Jason Merrill  <jason@redhat.com>
326
327         PR c++/35097
328         * pt.c (tsubst): Don't look up a template typedef in an explicit
329         specialization.
330
331 2008-02-11  Douglas Gregor  <doug.gregor@gmail.com>
332
333        PR c++/35113
334        * tree.c (cp_build_qualified_type_real): When building a
335        cv-qualified array type, build it as a unique type with
336        build_cplus_array_type_1 and then adopt the unqualified type's
337        main variant.
338         
339 2008-02-11  Paolo Carlini  <pcarlini@suse.de>
340
341         PR c++/35077
342         * decl.c (groktypename): Check grokdeclarator return.
343
344 2008-02-10  Jason Merrill  <jason@redhat.com>
345
346         PR c++/34094
347         * decl2.c (cp_write_global_declarations): Don't write out static 
348         data members with DECL_IN_AGGR_P set.
349
350 2008-02-08  Jason Merrill  <jason@redhat.com>
351
352         PR c++/35116
353         * tree.c (build_target_expr_with_type): Handle void initializer.
354         (bot_manip): Remap slot before recursing.
355
356 2008-02-06  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
357
358         PR other/35107
359         * Make-lang.in (cc1plus-dummy, cc1plus): Add $(GMPLIBS).
360
361 2008-02-06  Alexandre Oliva  <aoliva@redhat.com>
362
363         PR c++/35056
364         * tree.c: Include tree-flow.h.
365         (build_target_expr): Check type compatibility.
366         * Make-lang.in (cp/tree.o): Depend on $(TREE_FLOW_H).
367         * call.c (convert_like_real): Convert bitfield to expected type.
368
369 2008-02-06  Douglas Gregor  <doug.gregor@gmail.com>
370
371         PR c++/35049
372         PR c++/35096
373         * typeck.c (structural_comptypes): Call cp_comptypes.
374         (comptypes): New; called from the C/C++ common bits to perform
375         strict checks.
376         (cp_comptypes): Renamed from comptypes, which is already used,
377         with a different signature, by the C++ front end.
378         (build_reinterpret_cast_1): Call cp_comptypes.
379         (ptr_reasonably_similar): Ditto.
380         * decl.c (decls_match): Ditto.
381         * cvt.c (convert_to_reference): Ditto.
382         * cp-tree.h (same_type_p): Ditto.
383         (same_or_base_type_p): Ditto.
384         (comptypes): Rename to cp_comptypes.
385         * pt.c (canonical_type_parameter): Call cp_comptypes.
386
387 2008-02-05  Jakub Jelinek  <jakub@redhat.com>
388
389         PR c++/33553
390         * pt.c (tsubst) <case INTEGER_TYPE>: Don't issue error if max is
391         value dependent expression.
392
393 2008-02-05  Douglas Gregor  <doug.gregor@gmail.com>
394
395         PR c++/35074
396         * decl2.c (save_template_attributes): When we're modifying the
397         TYPE_MAIN_VARIANT to add new attributes, be sure to also modify
398         all of the other variants to add those same attributes. Otherwise,
399         the main variant will be inconsistent with those other variants.
400         
401 2008-02-04  Richard Guenther  <rguenther@suse.de>
402
403         PR java/35035
404         * decl.c (record_builtin_java_type): Make jboolean a
405         integer type again where its mode doesn't match that of bool.
406
407 2008-02-02  Jason Merrill  <jason@redhat.com>
408             Mark Mitchell  <mark@codesourcery.com>
409
410         PR c++/33916
411         * init.c (build_value_init_1): New function.
412         (build_value_init): New function.
413         * typeck2.c (build_functional_cast): Call it.
414         * cp-gimplify.c (cp_gimplify_init_expr): Handle its output.
415
416         * cp-tree.h (TYPE_HAS_USER_CONSTRUCTOR): Rename from 
417         TYPE_HAS_CONSTRUCTOR.
418         * class.c (finish_struct_bits, maybe_warn_about_overly_private_class,
419         add_implicitly_declared_members): Adjust.
420         (check_field_decls): Adjust. Remove warnings about reference/const
421         in class without constructor.
422         (check_bases_and_members): Adjust.  Give those warnings here instead.
423         * decl.c (fixup_anonymous_aggr): Adjust.
424         (check_initializer): Adjust, clarify logic slightly.
425         (grok_special_member_properties): Adjust, only set if user-provided.
426         * rtti.c (create_tinfo_types): Don't set.
427         * cvt.c (ocp_convert): Remove exception for vtable_entry_type et al.
428         Use same_type_ignoring_top_level_qualifiers_p.
429         * pt.c (check_explicit_specialization): Adjust.
430         (instantiate_class_template): Adjust.
431
432 2008-01-31  Douglas Gregor  <doug.gregor@gmail.com>
433            Jakub Jelinek  <jakub@redhat.com>
434
435        PR c++/34935
436        PR c++/34936
437        * typeck.c (structural_comptypes): Handle comparisons of
438        VOID_TYPE, BOOLEAN_TYPE, INTEGER_TYPE, FIXED_POINT_TYPE, and
439        REAL_TYPE nodes.
440        * mangle.c (write_builtin_type): Map down to the canonical type,
441        which will be one of the predefined type nodes.
442
443 2008-01-29  Michael Meissner  <michael.meissner@amd.com>
444
445         PR 35004
446         * cp-tree.h (struct full_lang_decl): Make tree_code bitfield 16
447         bits to allow for expansion of the number of middle end tree
448         codes.
449
450 2008-01-29  Douglas Gregor  <doug.gregor@gmail.com>
451
452         PR c++/34055
453         PR c++/34103
454         PR c++/34219
455         PR c++/34606
456         PR c++/34753
457         PR c++/34754
458         PR c++/34755
459         PR c++/34919
460         PR c++/34961
461         * typeck.c (check_return_expr): Tweak call to
462         check_for_bare_parameter_packs.
463         * class.c (add_method): Be careful with error_mark_nodes.
464         * cp-tree.h (check_for_bare_parameter_packs): Remove "*" from
465         signature.
466         * pt.c (struct find_parameter_pack_data): Remove
467         SET_PACKS_TO_ERROR.
468         (find_parameter_packs_r): Don't use SET_PACKS_TO_ERROR.
469         (uses_parameter_packs): Don't set SET_PACKS_TO_ERROR.
470         (make_pack_expansion): Ditto.
471         (check_for_bare_parameter_packs): Parameter is now a tree, not a
472         tree*.
473         (process_template_parm): Tweak call to
474         check_for_bare_parameter_packs.  
475         (push_template_decl_real): Tweak calls to
476         check_for_bare_parameter_packs. If bare parameter packs are found
477         in the list of exceptions, clear out that list after giving an
478         error.
479         * semantics.c (finish_cond): Tweak call to
480         check_for_bare_parameter_packs.
481         (finish_expr_stmt): Ditto.
482         (finish_for_expr): Ditto.
483         (finish_switch_cond): Ditto.
484         (finish_mem_initializers): Ditto.
485         (finish_member_declaration): Ditto.
486         (finish_static_assert): Check for bare parameter packs in the
487         condition.
488         * decl2.c (cplus_decl_attributes): Check for bare parameter packs in the
489         attributes of a declaration.
490         * parser.c (cp_parser_using_declaration): Tweak call to
491         check_for_bare_parameter_packs.
492         (cp_parser_base_clause): Ditto.
493
494 2008-01-28  Jason Merrill  <jason@redhat.com>
495
496         PR c++/35007
497         * class.c (build_base_path): Fix !want_pointer case.
498
499 2008-01-27  Jason Merrill  <jason@redhat.com>
500
501         PR c++/27177
502         * class.c (build_base_path): Fix previous change.
503
504 2008-01-26  Jakub Jelinek  <jakub@redhat.com>
505
506         PR c++/34965
507         * error.c (dump_expr): Handle TRUTH_AND_EXPR, TRUTH_OR_EXPR
508         and TRUTH_XOR_EXPR.
509
510 2008-01-26  Richard Guenther  <rguenther@suse.de>
511
512         PR c++/34235
513         * typeck.c (build_binary_op): Remove code to shorten compares.
514
515 2008-01-25  Richard Guenther  <rguenther@suse.de>
516
517         PR c++/33887
518         * decl.c (record_builtin_java_type): Make __java_boolean
519         a variant of bool.
520         * typeck.c (structural_comptypes): Move TYPE_FOR_JAVA check
521         after TYPE_MAIN_VARIANT check.
522
523 2008-01-25  Jason Merrill  <jason@redhat.com>
524
525         PR c++/27177
526         * class.c (build_base_path): Don't mess with virtual access if
527         skip_evaluation.
528         * call.c (standard_conversion): Don't check whether source type
529         is complete.
530
531         * decl2.c (is_late_template_attribute): Don't defer attribute
532         visibility just because the type is dependent.
533
534 2008-01-25  Jason Merrill  <jason@redhat.com>
535             Mark Mitchell  <mark@codesourcery.com>
536
537         PR c++/31780
538         * call.c (standard_conversion): Allow conversion from integer/real
539         to complex.
540         (compare_ics): Such a conversion is worse than a normal arithmetic
541         conversion.
542         
543 2008-01-25  Richard Guenther  <rguenther@suse.de>
544
545         PR c++/33887
546         * cp-lang.c (LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS): Define
547         to true.
548
549 2008-01-24  Paolo Carlini  <pcarlini@suse.de>
550
551         PR c++/34603
552         * pt.c (push_template_decl_real): Return error_mark_node in case
553         of template definition of non-template.
554
555 2008-01-24  Jason Merrill  <jason@redhat.com>
556
557         PR c++/34913
558         * decl2.c (is_late_template_attribute): Defer any attribute with 
559         dependent args.  Also defer type attributes if the type is dependent.
560
561 2008-01-22  Jakub Jelinek  <jakub@redhat.com>
562             Alexandre Oliva  <aoliva@redhat.com>
563
564         PR c++/33984
565         * call.c (reference_binding): For bitfields use the declared bitfield
566         type.
567         (add_builtin_candidates): Likewise.
568         * class.c (layout_class_type): For bitfields copy over the
569         original type quals.
570
571 2008-01-22  Jason Merrill  <jason@redhat.com>
572
573         PR c++/28560
574         * decl.c (groktypename): Also ignore attributes on dependent 
575         possibly-class types.
576
577         PR c++/34912
578         * friend.c (do_friend): Check for prior declaration of a friend 
579         function of a local class.
580         * name-lookup.c (lookup_name_innermost_nonclass_level): 
581         No longer static.
582         * name-lookup.h: Declare it.
583
584 2008-01-22  Tom Tromey  <tromey@redhat.com>
585
586         PR c++/34829:
587         * init.c (build_new_1): Only disallow Java aggregates.
588
589 2008-01-22  Jakub Jelinek  <jakub@redhat.com>
590
591         PR c++/34607
592         * semantics.c (finish_omp_for): Don't call c_finish_omp_for
593         if decl or init is error_mark_node.
594
595         PR c++/34918
596         * error.c (dump_expr): Handle VECTOR_CST.
597
598 2008-01-21  Jason Merrill  <jason@redhat.com>
599
600         PR c++/33959
601         * pt.c (tsubst_aggr_type): Make sure our context is complete.
602
603         PR c++/34573
604         * pt.c (retrieve_local_specialization): Robustify.
605         (tsubst_pack_expansion, tsubst_decl): Remove redundant checks.
606
607         PR c++/34846
608         * pt.c (tsubst): Only call retrieve_local_specialization if the
609         original typedef was in a function template.
610
611         PR c++/34196
612         * decl.c (wrap_cleanups_r): Set TRY_CATCH_IS_CLEANUP.
613
614 2008-01-21  Richard Guenther  <rguenther@suse.de>
615
616         PR c++/34850
617         * error.c (cp_print_error_function): Deal with recursive
618         BLOCK trees.
619
620 2008-01-20  Paolo Carlini  <pcarlini@suse.de>
621
622         PR c++/34891
623         * error.c (dump_expr): Deal with VIEW_CONVERT_EXPR.
624
625 2008-01-20  Paolo Carlini  <pcarlini@suse.de>
626
627         PR c++/34776
628         PR c++/34486
629         * name-lookup.c (do_class_using_decl): Do not call constructor_name_p
630         on non-IS_AGGR_TYPE scope.
631         (constructor_name_p): Assert IS_AGGR_TYPE.
632
633 2008-01-18  Ian Lance Taylor  <iant@google.com>
634
635         PR c++/33407
636         * decl.c (duplicate_decls): Copy DECL_IS_OPERATOR_NEW flag.
637         (grok_op_properties): For NEW_EXPR and VEC_NEW_EXPR set
638         DECL_IS_OPERATOR_NEW flag.
639
640 2008-01-16  Richard Guenther  <rguenther@suse.de>
641
642         PR c++/33819
643         * typeck.c (is_bitfield_expr_with_lowered_type): Recurse
644         for conversions to type variants.
645
646 2008-01-15  Andreas Tobler  <a.tobler@schweiz.org>
647
648         * parser.c (cp_parser_template_parameter): Fix C90 issue with mixing
649         declaration and code.  Update copyright year.
650
651 2008-01-15  Douglas Gregor  <doug.gregor@gmail.com>
652
653         PR c++/34399
654         * friend.c (do_friend): Don't query TYPE_BEING_DEFINED unless we
655         know we have a class type.
656
657 2008-01-15  Douglas Gregor  <doug.gregor@gmail.com>
658
659         PR c++/34751
660         * pt.c (coerce_template_parameter_pack): When substituting into
661         the type of a non-type template parameter pack. use the
662         deduced/substituted arguments.
663         * parser.c (declarator_can_be_parameter_pack): A pointer-to-member
664         can be a parameter pack with the ellipsis following it.  When we
665         have an erroneous declaration, allow it to be a parameter pack.
666         (cp_parser_template_parameter): Complain about default
667         arguments on non-type template parameter packs, and parse them
668         using the new cp_parser_default_argument.
669         (cp_parser_parameter_declaration): Complain about parameter packs
670         with default arguments. Move parsing of default arguments into a
671         new function, cp_parser_default_argument.
672         (cp_parser_default_argument): New; extracted from
673         cp_parser_parameter_declaration.
674
675 2008-01-15  Douglas Gregor  <doug.gregor@gmail.com>
676
677         PR c++/34051
678         PR c++/34055
679         PR c++/34102
680         PR c++/34103
681         * typeck.c (check_return_expr): If there are bare parameter packs
682         in the return value, set it to error_mark_node.
683         * tree.c (cp_walk_subtrees): Walk USING_DECL nodes.
684         * pt.c (find_parameter_packs_r): Look at the type of
685         IDENTIFIER_NODEs (e.g., for user-defined conversions).
686         (check_for_bare_parameter_packs): Flip the result: now returns
687         TRUE when there were bare parameter packs, FALSE otherwise.
688         (push_template_decl_real): Deal with flipped result of
689         check_for_bare_parameter_packs.
690         * semantics.c (finish_cond): If there are bare parameter packs in
691         the conditional, set it to error_mark_node.
692         (finish_expr_stmt): If there are bare parameter packs in the
693         expression, set it to error_mark_node.
694         (finish_for_expr): Ditto.
695         (finish_switch_cond): If there are bare parameter packs in
696         the conditional, set it to error_mark_node.
697         (finish_mem_initializers): If there are bare parameter packs in
698         the member initializer, set it to error_mark_node.
699         (finish_member_declaration): Check the attributes of the
700         declaration for bare parameter packs, and remove the attributes if
701         any have bare parameter packs.
702         * parser.c (cp_parser_using_declaration): Check the using
703         declaration for bare parameter packs.
704         (cp_parser_base_clause): If there are bare parameter packs in a
705         base specifier, don't add it to the chain.
706
707 2008-01-15  Douglas Gregor  <doug.gregor@gmail.com>
708
709        PR c++/34314
710        * error.c (dump_simple_decl): Display ellipsis for template
711        non-type parameter packs.
712        (dump_decl): Display ellipsis for template type parameter packs.
713        (dump_template_decl): Display ellipsis for template template
714        parameter packs.
715        * pt.c (redeclare_class_template): When redeclaring a class
716        template, check for collisions between template parameters and
717        template parameter packs.
718
719 2008-01-15  Douglas Gregor  <doug.gregor@gmail.com>
720
721        PR c++/33964
722        * pt.c (process_partial_specialization): Don't mark template
723        parameters that occur in non-deduced contexts.
724        (struct pair_fn_data): Add include_nondeduced_p.
725        (for_each_template_parm_r): Only visit non-deduced contexts if
726        include_nondeduced_p is set.
727        (for_each_template_parm): Added parameter include_nondeduced_p,
728        which states whether template parameters found in non-deduced
729        contexts should be visited.
730        (uses_template_parms): Visit all template parameters, even those
731        in non-deduced contexts.
732
733 2008-01-15  Douglas Gregor  <doug.gregor@gmail.com>
734
735        PR c++/34052
736        * pt.c (check_default_tmpl_args): Check for parameter packs that
737        aren't at the end of a primary template.
738        (push_template_decl_real): Remove check for parameter packs that
739        aren't at the end of a primary template; that now happens in
740        check_default_tmpl_args.
741        * semantics.c (finish_template_template_parm): Use
742        check_default_tmpl_args to check for errors in the template
743        parameter list.
744         
745 2008-01-12  Doug Kwan  <dougkwan@google.com>
746
747         * decl.c: (grokdeclarator): Use OPT_Wignored_qualifiers
748         instead of OPT_Wreturn_type in warning due to ignored return type
749         qualifiers.
750         * pt.c: (tsubst_function_type): Use OPT_Wignored_qualifiers
751         instead of OPT_Wreturn_type in warning due to ignored return type
752         qualifiers.
753
754 2008-01-08  Jakub Jelinek  <jakub@redhat.com>
755
756         PR c++/33890
757         * semantics.c (finish_omp_for): Don't call
758         fold_build_cleanup_point_expr if processing_template_decl.
759
760 2008-01-04  Paolo Carlini  <pcarlini@suse.de>
761             Jakub Jelinek  <jakub@redhat.com>
762
763         PR c++/34611
764         * error.c (dump_template_argument): Deal with TREE_LIST.
765
766 2008-01-01  Douglas Gregor  <doug.gregor@gmail.com>
767
768        * parser.c (cp_parser_check_decl_spec): Don't warn about "long
769        long" in C++0x mode; change the warning to note that "long long"
770        is only unsupported in C++98 mode.
771
772 2007-12-20  Jason Merrill  <jason@redhat.com>
773
774         PR c++/34111
775         * call.c (standard_conversion): Derived-to-base is considered a
776         standard conversion.
777
778 2007-12-19  Jakub Jelinek  <jakub@redhat.com>
779
780         PR c++/34513
781         * parser.c (cp_parser_omp_parallel): For non-combined parallel
782         call cp_parser_statement rather than
783         cp_parser_already_scoped_statement.
784
785 2007-12-18  Jason Merrill  <jason@redhat.com>
786
787         PR c++/34206
788         * pt.c (tsubst_aggr_type): Do nothing if the type already doesn't 
789         use template parms.
790         (dependent_type_p_r): Handle the domain of an array.
791
792 2007-12-18  Douglas Gregor  <doug.gregor@gmail.com>
793             Jakub Jelinek  <jakub@redhat.com>
794         
795         PR c++/32565
796         PR c++/33943
797         PR c++/33965
798         * pt.c (template_template_parm_bindings_ok_p): New; verifies
799         bindings of template template parameters after all template
800         arguments have been deduced.
801         (coerce_template_parms): Don't complain when COMPLAIN doesn't
802         include tf_error.
803         (fn_type_unification): Use template_template_parm_bindings_ok_p. 
804         (unify): Deal with variadic, bound template template parameters. 
805         (get_class_bindings): Use template_template_parm_bindings_ok_p. 
806
807 2007-12-18  Jakub Jelinek  <jakub@redhat.com>
808
809         PR c++/34488
810         * decl.c (grokdeclarator): Reject friend sfk_constructor
811         FUNCTION_TYPE.
812
813 2007-12-17  Jakub Jelinek  <jakub@redhat.com>
814
815         PR c/34506
816         * parser.c (cp_parser_omp_all_clauses): Accept optional comma
817         in between clauses.
818
819 2007-12-15  Alexandre Oliva  <aoliva@redhat.com>
820
821         PR debug/7081
822         * cp-lang.c (cp_classify_record): New.
823         (LANG_HOOKS_CLASSIFY_RECORD): Override.
824
825 2007-12-11  Jakub Jelinek  <jakub@redhat.com>
826
827         PR c++/34238
828         * decl2.c (cp_write_global_declarations): Revert 2007-11-22 change.
829
830         PR c++/34364
831         * rtti.c (build_dynamic_cast): Call convert_from_reference even for
832         dynamic_cast in a template.
833
834 2007-12-10  Simon Martin  <simartin@users.sourceforge.net>
835
836         PR c++/34059
837         * typeck.c (build_class_member_access_expr): Compute MEMBER_SCOPE from
838         MEMBER's BASELINK_ACCESS_BINFO instead of its BASELINK_BINFO.
839
840 2007-12-10  Jakub Jelinek  <jakub@redhat.com>
841
842         PR c++/34395
843         * error.c (dump_type_prefix, dump_type_suffix): Handle
844         TYPE_PACK_EXPANSION.
845
846         PR c++/34394
847         * error.c (dump_expr): Handle ABS_EXPR.
848
849 2007-12-09  Jakub Jelinek  <jakub@redhat.com>
850
851         PR c++/34178
852         PR c++/34340
853         * repo.c (repo_emit_p): Return 2 for DECL_INTEGRAL_CONSTANT_VAR_P
854         in class scope rather than DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
855         Return 2 also if DECL_EXPLICIT_INSTANTIATION.
856         * decl2.c (import_export_decl): Don't make VAR_DECLs import_p when
857         flag_use_repository and repo_emit_p returned 2.
858
859 2007-12-06  Jakub Jelinek  <jakub@redhat.com>
860
861         PR c++/34336
862         * tree.c (stabilize_call, stabilize_init): Do nothing if
863         processing_template_decl.
864
865 2007-12-05  Jakub Jelinek  <jakub@redhat.com>
866
867         PR c++/34271
868         * semantics.c (finish_decltype_type): For SCOPE_REF issue an
869         error instead of assertion failure.
870         * parser.c (cp_parser_decltype): If closing paren is not found,
871         return error_mark_node.
872
873 2007-12-04  Douglas Gregor  <doug.gregor@gmail.com>
874
875        PR c++/34101
876        * name-lookup.c (arg_assoc_template_arg): Recurse on argument
877        packs.
878        (arg_assoc_type): We don't need to handle TYPE_ARGUMENT_PACK here,
879        since arg_assoc_template_arg will deal with them (better).
880
881 2007-12-04  Douglas Gregor  <doug.gregor@gmail.com>
882
883        PR c++/33509
884        * pt.c (tsubst_exception_specification): Handle substitutions into
885        member templates, where tsubst_pack_expansion returns a
886        TYPE_PACK_EXPANSION.
887
888 2007-12-04  Douglas Gregor  <doug.gregor@gmail.com>
889
890        PR c++/33091
891        * pt.c (unify_pack_expansion): If we didn't deduce any actual
892        bindings for the template parameter pack, don't try to keep the
893        empty deduced arguments.
894        (unify): If a parameter is a template-id whose template argument
895        list contains a pack expansion that is not at the end, then we
896        cannot unify against that template-id.
897
898 2007-12-02  Paolo Carlini  <pcarlini@suse.de>
899
900         PR c++/34061
901         * pt.c (current_template_args): Use error_operand_p.
902
903 2007-12-02  Paolo Carlini  <pcarlini@suse.de>
904
905         PR c++/34273
906         * error.c (dump_decl): Handle TREE_BINFO.
907
908 2007-12-01  Ollie Wild  <aaw@google.com>
909
910         PR c++/8171
911         * typeck.c (build_binary_op): Add conversion of pointers to function
912         members appearing as operands to the equality operators.
913
914 2007-11-30  Jakub Jelinek  <jakub@redhat.com>
915
916         PR c++/34275
917         * error.c (dump_expr): Handle OBJ_TYPE_REF.
918
919 2007-11-29  Jakub Jelinek  <jakub@redhat.com>
920
921         PR c++/34270
922         * tree.c (lvalue_p_1) <case COND_EXPR>: Handle x ?: y
923         in templates.
924         * typeck.c (is_bitfield_expr_with_lowered_type) <case COND_EXPR>:
925         Likewise.
926
927         PR c++/34267
928         PR c++/34268
929         * parser.c (cp_parser_decltype): Don't call finish_id_expression
930         on ~type.
931         * semantics.c (finish_decltype_type): Issue error on types, TYPE_DECLs
932         and ~type early.
933
934 2007-11-27  Jakub Jelinek  <jakub@redhat.com>
935
936         PR tree-optimization/34181
937         * method.c (use_thunk): Don't inline the call in the thunk.
938
939         PR c++/34213
940         * tree.c (decl_linkage): Static data members and static member
941         functions in anonymous ns classes are lk_external.
942
943 2007-11-26  Andreas Krebbel  <krebbel1@de.ibm.com>
944
945         PR c++/34081
946         * decl.c (start_preparsed_function): Pass 
947         processing_template_decl for the new allocate_struct_function
948         parameter.
949
950 2007-11-25  Richard Guenther  <rguenther@suse.de>
951
952         * decl.c (poplevel): Use BLOCK_CHAIN.
953
954 2007-11-24  Ollie Wild  <aaw@google.com>
955
956         * typeck.c (delta_from_ptrmemfunc): New function.
957         (get_member_function_from_ptrfunc): Call delta_from_ptrmemfunc.
958         (build_binary_op): Call delta_from_ptrmemfunc.
959
960 2007-11-23  Jakub Jelinek  <jakub@redhat.com>
961
962         PR c++/30293
963         PR c++/30294
964         * decl.c (cp_finish_decl): Disallow variable or field
965         definitions if extern "Java" aggregates.
966         (grokparms): Disallow parameters with extern "Java"
967         aggregates.
968         (check_function_type): Disallow function return values
969         with extern "Java" aggregates.
970         * init.c (build_new_1): Disallow placement new with
971         extern "Java" aggregates.
972
973 2007-11-23  Mark Mitchell  <mark@codesourcery.com>
974             Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
975         
976         PR c++/5310
977         * call.c (convert_like_real): Build a zero constant when __null is
978         converted to an integer type.
979         
980 2007-11-22  Jakub Jelinek  <jakub@redhat.com>
981
982         PR c++/34094
983         * decl2.c (cp_write_global_declarations): Issue error about static
984         data members in anonymous namespace which are declared and used,
985         but not defined.
986
987 2007-11-20  Jakub Jelinek  <jakub@redhat.com>
988
989         PR c++/34089
990         * parser.c (cp_parser_class_head): Reject function template ids.
991
992         PR c++/28879
993         * tree.c (build_cplus_array_type_1): Don't pass any VLA types
994         when processing_template_decl to build_array_type.
995
996         PR c++/33962
997         * pt.c (more_specialized_fn): Don't segfault if one or
998         both argument list end with ellipsis.
999
1000 2007-11-18  Jakub Jelinek  <jakub@redhat.com>
1001
1002         PR c++/30988
1003         * semantics.c (finish_call_expr): Set
1004         current_function_returns_abnormally if fn is noreturn FUNCTION_DECL
1005         or OVERLOAD with all noreturn functions.
1006
1007 2007-11-16  Jakub Jelinek  <jakub@redhat.com>
1008
1009         PR c++/34100
1010         * pt.c (apply_late_template_attributes): Do nothing if decl's type is
1011         error_mark_node.
1012
1013 2007-11-13  Jakub Jelinek  <jakub@redhat.com>
1014
1015         PR c++/34054
1016         PR c++/34056
1017         PR c++/34057
1018         PR c++/34058
1019         PR c++/34060
1020         * pt.c (find_parameter_packs_r): If ppd->set_packs_to_error,
1021         set to error_mark_node the outermost POINTER_TYPE to the pack if
1022         it is seen in a POINTER_TYPE.
1023         (push_template_decl_real): If check_for_bare_parameter_packs
1024         fails for function return type, set the return type to
1025         integer_type_node.  If check_for_bare_parameter_packs failed
1026         for non-function, return error_mark_node.
1027
1028         PR c++/29225
1029         * call.c (build_new_op): Call resolve_args before calling
1030         build_over_call.
1031
1032 2007-11-11  Tom Tromey  <tromey@redhat.com>
1033
1034         PR c++/17577:
1035         * lex.c (handle_pragma_implementation): Use cpp_included_before.
1036
1037 2007-11-12  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1038
1039         PR c++/8570
1040         * pt.c (redeclare_class_template): Update error message. Use a
1041         note to show the previous declaration.
1042         (tsubst_friend_class): Use the location of the friend template as
1043         the input location before calling redeclare_class_template.
1044
1045 2007-11-11  Jakub Jelinek  <jakub@redhat.com>
1046
1047         PR c++/34068
1048         * semantics.c (finish_pseudo_destructor_expr): Handle
1049         object == error_mark_node.
1050
1051 2007-11-10  Jakub Jelinek  <jakub@redhat.com>
1052
1053         PR c++/32241
1054         * pt.c (tsubst_copy_and_build) <case COMPONENT_REF>: If object_type
1055         is not scalar type, let finish_class_member_access_expr handle
1056         diagnostics.  Pass BIT_NOT_EXPR argument to
1057         finish_pseudo_destructor_expr.  Handle SCOPE_REF properly.
1058
1059 2007-11-09  Douglas Gregor  <doug.gregor@gmail.com>
1060
1061         PR c++/33510
1062         * decl.c (cp_complete_array_type): If any of the initializer
1063         elements are pack expansions, don't compute the array size yet.
1064
1065 2007-11-08  Andrew Pinski  <pinskia@gmail.com>
1066
1067         PR c++/30297:
1068         * tree.c (decl_linkage): Fields have no linkage.
1069
1070 2007-11-08  Daniel Jacobowitz  <dan@codesourcery.com>
1071
1072         * class.c (build_ctor_vtbl_group): Lay out the new type and decl.
1073
1074 2007-11-07  Douglas Gregor  <doug.gregor@gmail.com>
1075
1076         PR c++/33045
1077         PR c++/33837
1078         PR c++/33838
1079         * semantics.c (finish_decltype_type): See through INDIRECT_REFs.
1080         Be careful with ERROR_MARK_NODEs.
1081         * parser.c (cp_parser_check_access_in_redeclaration): Handle NULL
1082         argument.
1083
1084 2007-11-07  Jakub Jelinek  <jakub@redhat.com>
1085
1086         PR c++/33501
1087         * call.c (build_over_call): Don't check TREE_ADDRESSABLE
1088         on incomplete type.
1089
1090 2007-11-06  Douglas Gregor  <doug.gregor@gmail.com>
1091
1092         PR c++/33977
1093         PR c++/33886
1094         * tree.c (c_build_qualified_type): Define bridge to
1095         cp_build_qualified_type.
1096
1097 2007-11-06  Douglas Gregor  <doug.gregor@gmail.com>
1098
1099         PR c++/31439
1100         PR c++/32114
1101         PR c++/32115
1102         PR c++/32125
1103         PR c++/32126
1104         PR c++/32127
1105         PR c++/32128
1106         PR c++/32253
1107         PR c++/32566
1108         * typeck.c (check_return_expr): Pass address of retval to
1109         check_for_bare_parameter_packs.
1110         * class.c (build_base_field): Tolerate bases that have no layout
1111         due to errors.
1112         (end_of_base): Ditto.
1113         * tree.c (canonical_type_variant): Be careful with
1114         ERROR_MARK_NODE.
1115         * cp-tree.h (check_for_bare_parameter_packs): Now accepts a
1116         tree*.
1117         * pt.c (find_parameter_pack_data): Add set_packs_to_error field,
1118         which states whether parameter packs should be replaced with
1119         ERROR_MARK_NODE.
1120         (find_parameter_packs_r): Pass addresses to cp_walk_tree wherever
1121         possible. If set_packs_to_error is set true, replace the parameter
1122         pack with ERROR_MARK_NODE. Manage our own pointer sets.
1123         (uses_parameter_packs): Don't set parameter packs to
1124         ERROR_MARK_NODE.
1125         (check_for_bare_parameter_packs): Now takes a pointer to a tree,
1126         which may be modified (if it is a parameter pack). Instructs
1127         find_parameter_packs_r to replace parameter packs with
1128         ERROR_MARK_NODE (so that they won't cause errors later on).
1129         (process_template_parm): Pass pointer to
1130         check_for_bare_parameter_packs.
1131         (process_partial_specialization): Replace pack expansions before
1132         the end of the template argument list with ERROR_MARK_NODE.
1133         (push_template_decl_real): Pass pointer to
1134         check_for_bare_parameter_packs. Replace parameter packs not at the
1135         end of the template parameter list with ERROR_MARK_NODE.
1136         (convert_template_argument): Be more careful about using DECL_NAME
1137         on only declarations.
1138         (unify): Can't unify against ERROR_MARK_NODE.
1139         * semantics.c (finish_cond): Pass pointer to
1140         check_for_bare_parameter_packs.
1141         (finish_expr_stmt): Ditto.
1142         (finish_for_expr): Ditto.
1143         (finish_switch_cond): Pass pointer to
1144         check_for_bare_parameter_packs, and call it before we put the
1145         condition into the statement.
1146         (finish_mem_initializers): Pass pointer to
1147         check_for_bare_parameter_packs.
1148         (finish_member_declaration): Ditto.
1149         * parser.c (cp_parser_base_clause): Ditto.
1150         
1151 2007-11-06  Jakub Jelinek  <jakub@redhat.com>
1152
1153         PR target/33168
1154         * decl.c (cp_finish_decl): Call make_rtl_for_nonlocal_decl already
1155         with the final TREE_READONLY flag in place.  processing_template_decl
1156         is known to be 0 in this part of function.
1157
1158         PR c++/33894
1159         * cp-tree.h: Update comment - TYPE_LANG_FLAG_0 is not
1160         OMP_ATOMIC_DEPENDENT_P in OMP_ATOMIC.
1161         * pt.c (tsubst_expr): Assert OMP_ATOMIC_DEPENDENT_P.
1162         * semantics.c (finish_omp_atomic): Revert most of the
1163         2007-02-05 changes, just keep the new representation of
1164         OMP_ATOMIC_DEPENDENT_P OMP_ATOMIC.
1165
1166 2007-11-05  H.J. Lu  <hongjiu.lu@intel.com>
1167
1168         PR c++/33871
1169         * decl2.c (constrain_visibility): Clear DECL_ONE_ONLY if marked
1170         local.
1171
1172 2007-11-05  Douglas Gregor  <doug.gregor@gmail.com>
1173
1174         PR c++/33996
1175         PR c++/33235
1176         PR c++/33930
1177         * typeck.c (merge_types): Don't lose rvalue references when
1178         merging types.
1179         * call.c (build_over_call): Don't elide move constructors just
1180         because the copy constructor is trivial (!).
1181         (compare_ics): If comparing cv-qualifiers fails, we can still order
1182         based on binding lvalues vs. rvalues.
1183
1184 2007-11-05  Douglas Gregor  <doug.gregor@gmail.com>
1185
1186         PR c++/33939
1187         * pt.c (unify_pack_expansion): bring handling of function call
1188         arguments into line with type_unification_real. 
1189
1190 2007-11-05  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1191
1192         * typeck.c (build_binary_op): Use pedwarn instead of error for
1193         consistency.
1194
1195 2007-11-05  Jakub Jelinek  <jakub@redhat.com>
1196
1197         PR c++/33836
1198         * parser.c (cp_parser_unary_expression): For &&label call
1199         cp_parser_non_integral_constant_expression and return error_mark_node
1200         if it returned true.
1201
1202         PR c++/33969
1203         * decl.c (grokdeclarator): Don't call build_memfn_type if type
1204         is neither FUNCTION_TYPE nor METHOD_TYPE.
1205
1206 2007-11-02  Jakub Jelinek  <jakub@redhat.com>
1207
1208         PR c++/33516
1209         * parser.c (cp_parser_nested_name_specifier_opt): Use
1210         TYPE_MAIN_VARIANT (new_scope) as scope if new_scope is an incomplete
1211         typedef of currently open class.
1212
1213 2007-11-02  Paolo Carlini  <pcarlini@suse.de>
1214
1215         PR c++/33495
1216         * error.c (dump_expr): Deal specially with statements.
1217
1218 2007-11-01  Jason Merrill  <jason@redhat.com>
1219
1220         PR c++/30897
1221         * pt.c (push_template_decl_real): Set DECL_CONTEXT on template
1222         template parms.
1223         (lookup_template_class): Use it to get the outer template args
1224         for instantiating one.
1225
1226         PR c++/29236
1227         * pt.c (reduce_template_parm_level): tsubst the parameters
1228         of a template template parm.
1229
1230 2007-11-01  Douglas Gregor  <doug.gregor@gmail.com>
1231
1232         PR c++/33955
1233         * pt.c (find_parameter_packs_r): Handle TYPENAME_TYPE.
1234
1235 2007-11-01  Jakub Jelinek  <jakub@redhat.com>
1236
1237         PR c++/32384
1238         * parser.c (cp_parser_postfix_dot_deref_expression): If
1239         POSTFIX_EXPRESSION is type dependent, try to parse it as pseudo dtor
1240         first and if that succeeds and type is SCALAR_TYPE_P, create
1241         PSEUDO_DTOR_EXPR.
1242
1243         PR c++/32260
1244         * rtti.c (enum_tinfo_kind): Fix TK_TYPE_INFO_TYPE comment.
1245         (typeid_ok_p): Use the same alias set for abi::__type_info_pseudo
1246         as for std::type_info.
1247
1248 2007-10-31  Paolo Carlini  <pcarlini@suse.de>
1249
1250         PR c++/33494
1251         * cxx-pretty-print.c (pp_cxx_typeid_expression,
1252         pp_cxx_delete_expression): Change to static linkage.
1253         * cxx-pretty-print.h: Adjust declarations.
1254         * error.c (dump_expr, case EXPR_PACK_EXPANSION, TYPEID_EXPR,
1255         MEMBER_REF, DOTSTAR_EXPR, DELETE_EXPR, VEC_DELETE_EXPR,
1256         MODOP_EXPR): Forward to pp_expression.
1257
1258         * cxx-pretty-print.c (pp_cxx_expression, case NON_DEPENDENT_EXPR):
1259         Fix typo.
1260
1261 2007-10-31 Christian Bruel  <christian.bruel@st.com>
1262            Mark Mitchell  <mark@codesourcery.com>
1263
1264         PR c++/19531
1265         * typeck.c (check_return_expr): Don't set named_return_value_okay_p
1266         if retval is volatile. 
1267         
1268 2007-10-30  Jakub Jelinek  <jakub@redhat.com>
1269
1270         PR c++/33616
1271         * decl2.c (build_offset_ref_call_from_tree): Call
1272         build_non_dependent_expr on object prior to building ADDR_EXPR from it
1273         if FN is DOTSTAR_EXPR.
1274
1275 2007-10-30  Douglas Gregor  <doug.gregor@gmail.com>
1276
1277         PR c++/31993
1278         PR c++/32252
1279         * pt.c (find_parameter_packs_r): Fix typo in comment.
1280         (convert_template_argument): Look at the pattern of a pack
1281         expansion to determine what kind of entity we're converting.
1282         (coerce_template_parameter_pack): When we have coerced a non-type
1283         template parameter pack, substitute into the type of that pack.
1284         (tsubst_pack_expansion): When our substitution of a parameter pack
1285         is a "trivial" substitution of itself, just substitute into the
1286         pack expansion rather than actually expanding.
1287
1288 2007-10-29  Jakub Jelinek  <jakub@redhat.com>
1289
1290         PR c++/33841
1291         * class.c (check_bitfield_decl): Don't set field's type to error_mark_node
1292         for non-integral type bitfields.  Return true if bitfield is correct, false
1293         error has been diagnosed.
1294         (check_field_decls): If check_bitfield_decl returned false, call also
1295         check_field_decl.
1296
1297 2007-10-28  Paolo Carlini  <pcarlini@suse.de>
1298             Mark Mitchell  <mark@codesourcery.com>
1299
1300         PR c++/30659
1301         * pt.c (do_decl_instantiation): If the VAR_DECL is not a
1302         class member error out and return.
1303
1304 2007-10-27  Jakub Jelinek  <jakub@redhat.com>
1305
1306         * error.c (reinit_cxx_pp): Initialize cxx_pp->enclosing_scope
1307         to current_function_decl rather than 0.
1308
1309         PR c++/33844
1310         * cxx-pretty-print.c (pp_cxx_pm_expression) <case MEMBER_REF>: Print
1311         ->* rather than .*.
1312         * error.c (dump_expr): Handle MEMBER_REF and DOTSTAR_EXPR.
1313
1314 2007-10-27  Jason Merrill  <jason@redhat.com>
1315
1316         PR c++/5247
1317         * call.c (convert_default_arg): Detect recursion.
1318
1319 2007-10-27  Jakub Jelinek  <jakub@redhat.com>
1320
1321         PR c++/33842
1322         * cxx-pretty-print.h (pp_cxx_offsetof_expression): New prototype.
1323         * cxx-pretty-print.c (pp_cxx_primary_expression): Handle
1324         OFFSETOF_EXPR.
1325         (pp_cxx_offsetof_expression_1, pp_cxx_offsetof_expression): New
1326         functions.
1327         * error.c (dump_expr): Handle OFFSETOF_EXPR.
1328
1329 2007-10-26  Jason Merrill  <jason@redhat.com>
1330
1331         PR c++/24791
1332         * pt.c (get_template_info): New fn.
1333         (template_class_depth): Use it.
1334         (push_template_decl_real): Check that the template args of the 
1335         definition match the args of the previous declaration.
1336
1337 2007-10-26  Paolo Carlini  <pcarlini@suse.de>
1338
1339         PR c++/31988
1340         * decl2.c (coerce_new_type): Do not allow a default argument for
1341         the first parameter.
1342
1343 2007-10-26  Douglas Gregor  <doug.gregor@gmail.com>
1344
1345         PR c++/33839
1346         * parser.c (cp_parser_decltype): Return ERROR_MARK_NODE if we
1347         don't see the leading '('. Only lookup names if we get an
1348         IDENTIFIER_NODE.
1349
1350 2007-10-26  Jakub Jelinek  <jakub@redhat.com>
1351
1352         PR c++/33744
1353         * parser.c (cp_parser_parenthesized_expression_list): Set
1354         greater_than_is_operator_p to true in between the parens.
1355
1356 2007-10-26  Paolo Carlini  <pcarlini@suse.de>
1357
1358         PR c++/31747
1359         * decl.c (grokdeclarator): In case of conflicting specifiers
1360         just return error_mark_node.
1361
1362 2007-10-26  Ollie Wild  <aaw@google.com>
1363
1364         * expr.c (cxx_expand_expr): Removed.
1365         * cp-tree.h (exx_expand_expr): Removed.
1366         * cp-objcp-common.h (LANK_HOOKS_EXPAND_EXPR): Replace cxx_expand_expr
1367         with c_expand_expr.
1368
1369 2007-10-25  Paolo Carlini  <pcarlini@suse.de>
1370
1371         PR c++/33843
1372         * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with BIT_NOT_EXPR.
1373
1374 2007-10-23  Jason Merrill  <jason@redhat.com>
1375
1376         PR c++/25950 (DR 391)
1377         * call.c (struct conversion): Remove check_copy_constructor_p.
1378         (reference_binding): Always bind a reference directly to a 
1379         compatible class rvalue.  Pass down LOOKUP_NO_TEMP_BIND during 
1380         temporary creation.
1381         (check_constructor_callable): Remove.
1382         (convert_like_real): Don't call it.
1383         (initialize_reference): Don't call check_constructor_callable.
1384         (standard_conversion): Check LOOKUP_NO_CONVERSION instead of
1385         LOOKUP_CONSTRUCTOR_CALLABLE.  Don't require a temporary for base
1386         conversions if LOOKUP_NO_TEMP_BIND.
1387         (implicit_conversion): Pass through LOOKUP_NO_TEMP_BIND.
1388         (build_user_type_conversion_1): Pass through LOOKUP_NO_TEMP_BIND for
1389         second conversion.
1390         * cp-tree.h (LOOKUP_CONSTRUCTOR_CALLABLE): Remove.
1391
1392 2007-10-22  Jakub Jelinek  <jakub@redhat.com>
1393
1394         PR c++/33372
1395         * semantics.c (finish_omp_clauses): Check !type_dependent_expression_p
1396         before checking if its type is integral.
1397
1398 2007-10-22  Jason Merrill  <jason@redhat.com>
1399
1400         PR c++/33620
1401         * class.c (finish_struct_bits): Copy TYPE_ATTRIBUTES.
1402         * pt.c (apply_late_template_attributes): Splice out dependent
1403         attributes from DECL_ATTRIBUTES.
1404
1405         * decl.c (cxx_maybe_build_cleanup): Use build_address.
1406
1407 2007-10-17  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1408
1409         * typeck.c (build_binary_op) : Use appropriate warning option
1410         instead of unnamed warning.
1411
1412 2007-10-16  Paolo Carlini  <pcarlini@suse.de>
1413
1414         PR c++/31446
1415         * pt.c (current_template_args): Do not change TREE_LIST elements
1416         with a TREE_VALUE of error_mark_node.
1417
1418 2007-10-16  Mark Mitchell  <mark@codesourcery.com>
1419
1420         * typeck.c (cp_apply_type_quals_to_decl): Expand documentation.
1421         * decl.c (start_decl): Tidy.
1422         (start_decl_1): Call cp_apply_type_quals_to_decl after completing
1423         the type.
1424         (grokdeclarator): Clarify comment.
1425
1426 2007-10-14  Andrew Pinski  <pinskia@gmail.com>
1427
1428         PR c++/30303
1429         * decl.c (grokfndecl): Return NULL after the "definition of
1430         implicitly-declared" error happened.
1431
1432 2007-10-12  Simon Martin  <simartin@users.sourceforge.net>
1433
1434         PR c++/26698
1435         * call.c (build_user_type_conversion_1): Do not consider conversion
1436         functions to convert a (possibly cv-qualified) object to the (possibly
1437         cv-qualified) same object type (or a reference to it), to a (possibly
1438         cv-qualified) base class of that type (or a reference to it).
1439
1440 2007-10-12  Paolo Carlini  <pcarlini@suse.de>
1441
1442         * pt.c (tsubst): Use template_parm_level_and_index.
1443
1444 2007-10-12  Jakub Jelinek  <jakub@redhat.com>
1445
1446         PR c++/32121
1447         * parser.c (cp_parser_compound_statement): Handle label-declarations
1448         at the beginning of the compound statement.
1449         (cp_parser_block_declaration): Issue diagnostics about __label__
1450         not at the beginning of a block.
1451
1452 2007-10-11  Paolo Carlini  <pcarlini@suse.de>
1453
1454         PR c++/33461
1455         * pt.c (coerce_template_parameter_pack): Do not pass error_mark_node
1456         to convert_template_argument.
1457         (coerce_template_parms): Return error_mark_node after fixed-length
1458         error.
1459         (tsubst_decl): Check for error_mark_node the return value of the
1460         first tsubst in 'case VAR_DECL'.
1461
1462 2007-10-08  Ollie Wild  <aaw@google.com>
1463
1464         * typeck2.c (digest_init): Call cplus_expand_constant after
1465         convert_for_initialization.
1466         * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
1467         * expr.c (cplus_expand_constant): Updated function description.
1468
1469 2007-10-04  Jason Merrill  <jason@redhat.com>
1470
1471         PR c++/20416
1472         * call.c (initialize_reference): Handle local static reference
1473         temps properly.
1474
1475 2007-10-03  Jason Merrill  <jason@redhat.com>
1476
1477         PR c++/32470
1478         * name-lookup.c (push_namespace_with_attrs): Fold back into...
1479         (push_namespace): Here.
1480         (handle_namespace_attrs): New fn for the attr code.
1481         (leave_scope): Don't pop_visibility.
1482         * name-lookup.h (struct cp_binding_level): Remove has_visibility.
1483         * parser.c (cp_parser_namespace_definition): Call
1484         handle_namespace_attrs and pop_visibility as appropriate. 
1485
1486         PR c++/11756
1487         * mangle.c (write_type) [TYPEOF_TYPE]: Just sorry.
1488
1489 2007-10-03  Alexandre Oliva  <aoliva@redhat.com>
1490
1491         * decl.c (duplicate_decls): Preserve linkage flags for mere
1492         redeclarations of gnu_inline definitions.
1493
1494 2007-10-03  Jason Merrill  <jason@redhat.com>
1495
1496         PR c++/15764
1497         * decl.c (wrap_cleanups_r): New fn.
1498         (wrap_temporary_cleanups): New fn.
1499         (initialize_local_var): Call it.
1500
1501 2007-09-29  Jason Merrill  <jason@redhat.com>
1502
1503         PR c++/33094
1504         * decl.c (make_rtl_for_nonlocal_decl): It's ok for a member 
1505         constant to not have DECL_EXTERNAL if it's file-local.
1506
1507 2007-09-28  Ollie Wild  <aaw@google.com>
1508
1509         Revert
1510         2007-09-27  Ollie Wild  <aaw@google.com>
1511
1512         * typeck2.c (digest_init): Call cplus_expand_constant after
1513         convert_for_initialization.
1514         * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
1515         * expr.c (cplus_expand_constant): Updated function description.
1516
1517 2007-09-28  Jason Merrill  <jason@redhat.com>
1518
1519         PR c++/10179
1520         * class.c (layout_empty_base): Take rli parameter, update
1521         rli->record_align if empty base has user-specified alignment.
1522         (build_base_field): Pass rli to it.
1523
1524 2007-09-28  Paolo Carlini  <pcarlini@suse.de>
1525
1526         PR c++/33213
1527         * error.c (dump_decl): Deal with TYPE_PACK_EXPANSION.
1528
1529 2007-09-28  Paolo Carlini  <pcarlini@suse.de>
1530
1531         PR c++/33118
1532         * error.c (dump_expr): Deal with ARGUMENT_PACK_SELECT.
1533         (dump_type): Use dump_template_argument for TYPE_ARGUMENT_PACK.
1534         (dump_parameters): Just call dump_type for argument packs too.
1535
1536 2007-09-28  Jakub Jelinek  <jakub@redhat.com>
1537
1538         PR c++/31434
1539         * tree.c (cp_build_qualified_type_real): Handle TYPE_PACK_EXPANSION
1540         qualification by creating qualified PACK_EXPANSION_PATTERN and
1541         then calling make_pack_expansion on it.
1542
1543 2007-09-27  Ollie Wild  <aaw@google.com>
1544
1545         * typeck2.c (digest_init): Call cplus_expand_constant after
1546         convert_for_initialization.
1547         * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
1548         * expr.c (cplus_expand_constant): Updated function description.
1549
1550 2007-09-27  Jason Merrill  <jason@redhat.com>
1551
1552         PR c++/33571
1553         * decl2.c (is_late_template_attribute): Don't crash on unknown
1554         attribute.
1555
1556 2007-09-27  Paolo Carlini  <pcarlini@suse.de>
1557
1558         PR c++/33493
1559         * error.c (dump_expr): Deal with DELETE_EXPR and VEC_DELETE_EXPR.
1560         * cxx-pretty-print.c (pp_cxx_delete_expression): Add missing
1561         spaces in the formatting.
1562         * cxx-pretty-print.h (pp_cxx_delete_expression): Declare.
1563
1564 2007-09-27  Jakub Jelinek  <jakub@redhat.com>
1565
1566         * error.c (cxx_print_error_function): Add third argument, pass
1567         it over to lhd_print_error_function.
1568         (cp_print_error_function): If diagnostic->abstract_origin, print
1569         virtual backtrace.
1570         * cp-tree.h (struct diagnostic_info): New forward decl.
1571         (cxx_print_error_function): Add third argument.
1572
1573 2007-09-25  Simon Martin  <simartin@users.sourceforge.net>
1574
1575         PR c++/33207
1576         * name-lookup.c (pushtag): Do not create an implicit typedef before
1577         the associated type declaration is known to be valid.
1578
1579 2007-09-25  Jakub Jelinek  <jakub@redhat.com>
1580
1581         * tree.c (cxx_printable_name): Compare FUNCTION_DECL uids
1582         rather than pointers.
1583
1584 2007-09-24  Danny Smith  <dannysmith@user.sourceforge.net>
1585
1586         PR c++/14688
1587         * search.c (check_final_overrider): Fail if
1588         targetm.comp_type_attributes returns 0.
1589
1590 2007-09-24  Jason Merrill  <jason@redhat.com>
1591
1592         PR c++/33239
1593         * pt.c (resolve_typename_type): Don't look things up in the original
1594         template if it would mean losing template arguments.    
1595
1596 2007-09-24  Jakub Jelinek  <jakub@redhat.com>
1597
1598         PR c++/33506
1599         * cp-tree.h (cxx_type_hash_eq): New prototype.
1600         * cp-objcp-common.h (LANG_HOOKS_TYPE_HASH_EQ): Redefine.
1601         * tree.c (cxx_type_hash_eq): New function.
1602
1603 2007-09-24  Douglas Gregor  <doug.gregor@gmail.com>
1604
1605         PR c++/33185    
1606         * tree.c (cp_build_qualified_type_real): Build a canonical
1607         ARRAY_TYPE if the original ARRAY_TYPE was not a canonical type.
1608         
1609 2007-09-24  Douglas Gregor  <doug.gregor@gmail.com>
1610
1611         PR c++/33112
1612         PR c++/33185    
1613         * tree.c (cplus_array_compare): Compare pointers, not types.
1614         (build_cplus_array_type_1): Store new array type into the hash
1615         table before building the canonical type; build the canonical type
1616         correctly.
1617         (cp_build_qualified_type_real): Put all of the array types with
1618         cv-qualified element types into the C++ array hash table, built as 
1619         variants of the unqualified versions.
1620         
1621 2007-09-23  Jason Merrill  <jason@redhat.com>
1622
1623         PR c++/16370
1624         * decl.c (grokdeclarator): Look through implicit TYPE_DECLs
1625         for deprecation warnings.
1626
1627 2007-09-22  Jason Merrill  <jason@redhat.com>
1628
1629         PR c++/15269
1630         * call.c (build_over_call): Warn about deprecated virtuals.
1631
1632         PR c++/19407
1633         * cp-tree.h (ATTR_IS_DEPENDENT): New macro.
1634         (MAYBE_TAGGED_TYPE_P): Remove.
1635         * pt.c (apply_late_template_attributes): Check ATTR_IS_DEPENDENT
1636         instead of calling is_late_template_attribute again.
1637         (tsubst_decl) [TYPE_DECL]: Just check if the name is the tag.
1638         (tsubst): A typedef is a TYPE_NAME != TYPE_MAIN_DECL.
1639         Don't crash on typedefs from non-template classes.
1640         * decl2.c (grokfield): Don't sorry about attrs on template parms.
1641         (is_late_template_attribute): All attributes applied to template
1642         parms or typename types are dependent.  Static.
1643         (splice_template_attributes): Pass decl through.
1644         (save_template_attributes): Likewise.
1645
1646 2007-09-20  Jakub Jelinek  <jakub@redhat.com>
1647
1648         PR c++/33496
1649         * pt.c (tsubst_copy) <case SIZEOF_EXPR>: Handle error_mark_node
1650         returned from tsubst_pack_expansion.
1651         (tsubst_copy_and_build) <case SIZEOF_EXPR>: Likewise.
1652         (tsubst_copy_and_build) <case CONSTRUCTOR>: Likewise.
1653
1654 2007-09-20  Paolo Carlini  <pcarlini@suse.de>
1655
1656         PR c++/33460
1657         * semantics.c (finish_id_expression): Use consistently
1658         context_for_name_lookup.
1659         * decl.c (fixup_anonymous_aggr): Fix error message for
1660         anonymous struct (vs union).
1661
1662 2007-09-19  Jason Merrill  <jason@redhat.com>
1663
1664         PR c++/7586
1665         * pt.c (tsubst): Handle typedefs by looking for the specialization.
1666         (retrieve_specialization): Only tagged types use 
1667         DECL_TEMPLATE_INSTANTIATIONS.
1668         (instantiate_class_template): Push nested classes too.
1669         (tsubst_decl) [TYPE_DECL]: Only check for canonical decl for
1670         tagged types.
1671         * cp-tree.h (MAYBE_TAGGED_TYPE_P): New macro.
1672         * init.c (is_aggr_type): Remove redundant tests.
1673         * class.c (push_nested_class): Use CLASS_TYPE_P.
1674
1675 2007-09-20  Paolo Carlini  <pcarlini@suse.de>
1676
1677         PR c++/33459
1678         * init.c (build_zero_init): If, recursively, build_zero_init
1679         returns a NULL_TREE, do not append it to the VEC of constructors.
1680
1681 2007-09-18  Jason Merrill  <jason@redhat.com>
1682
1683         PR c++/17743
1684         * pt.c (apply_late_template_attributes): Set processing_template_decl.
1685         (tsubst_decl) [TYPE_DECL]: Preserve naming typedef, pass
1686         ATTR_FLAG_TYPE_IN_PLACE.
1687         (tsubst): Do unqualified lookup to find typedefs from current class.
1688         [ARRAY_TYPE]: Propagate alignment info.
1689         * decl2.c (is_late_template_attribute): Only defer handling of
1690         attribute aligned if the expression is dependent.
1691         (save_template_attributes): If we're deferring any attributes,
1692         make this a naming typedef.
1693
1694 2007-09-18  Paolo Carlini  <pcarlini@suse.de>
1695
1696         PR c++/33462 (again)
1697         * cxx-pretty-print.c (pp_cxx_va_arg_expression): Print
1698         va_arg instead of __builtin_va_arg.
1699
1700 2007-09-18  Paolo Carlini  <pcarlini@suse.de>
1701
1702         PR c++/33462
1703         * cxx-pretty-print.c (pp_cxx_va_arg_expression): Add.
1704         (pp_cxx_primary_expression): Use it.
1705         * cxx-pretty-print.h (pp_cxx_va_arg_expression): Declare.
1706         * error.c (dump_expr): Use it.
1707
1708 2007-09-18  Paolo Carlini  <pcarlini@suse.de>
1709
1710         PR c++/33463
1711         * cxx-pretty-print.c (pp_cxx_postfix_expression): Split
1712         out case TYPEID_EXPR to...
1713         (pp_cxx_typeid_expression): ... here; use pp_cxx_left_paren
1714         and pp_cxx_right_paren.
1715         * cxx-pretty-print.h (pp_cxx_typeid_expression): Declare.
1716         * error.c (dump_expr): Use it.
1717
1718 2007-09-18  Paolo Carlini  <pcarlini@suse.de>
1719
1720         PR c++/33464
1721         * cxx-pretty-print.c (pp_cxx_trait_expression): Add.
1722         (pp_cxx_primary_expression): Use it.
1723         * cxx-pretty-print.h (pp_cxx_trait_expression): Declare.
1724         * error.c (dump_expr): Use it.
1725
1726 2007-09-16  Paolo Carlini  <pcarlini@suse.de>
1727
1728         PR c++/33124
1729         * init.c (build_new): Remove warning for zero-element
1730         allocations.
1731
1732 2007-09-16  Nathan Sidwell  <nathan@codesourcery.com>
1733
1734         PR c++/32756
1735         * call.c (maybe_handle_implicit_object): Set this_p, clear
1736         rvaluedness_matches_p.
1737         (compare_ics): Do not compare rvaluedness matching when one of the
1738         operands is an implicit object.
1739
1740 2007-09-14  Jason Merrill  <jason@redhat.com>
1741
1742         PR c++/17743, c++/19163
1743         * decl2.c (is_late_template_attribute): New fn.
1744         (splice_template_attributes, save_template_attributes): New fns.
1745         (cplus_decl_attributes): Call save_template_attributes.
1746         * pt.c (apply_late_template_attributes): New fn.
1747         (instantiate_class_template, tsubst_decl): Use it.
1748         * cp-tree.h: Declare is_late_template_attribute.
1749
1750 2007-09-13  Tom Tromey  <tromey@redhat.com>
1751
1752         * parser.c (cp_lexer_new_main): Don't use
1753         c_lex_return_raw_strings.
1754         (cp_lexer_get_preprocessor_token): Update.  Add special case when
1755         lexer is NULL.
1756
1757 2007-09-11  Jan Hubicka <jh@suse.cz>
1758
1759         * method.c (use_thunk): Use tree_rest_of_compilation
1760         * cp-objecp-common.h (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Kill.
1761         (LANG_HOOKS_CALLGRAPH_EMIT_ASSOCIATED_THUNKS): Define.
1762         * cp-tree.h (expand_body): Kill.
1763         (emit_associated_thunks): Declare.
1764         * semantics.c (emit_associated_thunks): Export.
1765         (expand_body): Kill.
1766
1767 2007-09-09  David Daney  <ddaney@avtrex.com>
1768
1769         PR c++/33324
1770         * init.c (build_new_1):  Use POINTER_PLUS_EXPR instead of MINUS_EXPR
1771         to calculate cookie_ptr.
1772
1773 2007-09-08  Jason Merrill  <jason@redhat.com>
1774
1775         PR c++/33342
1776         * pt.c (most_specialized_class): Set processing_template_decl
1777         while tsubsting partial spec args.
1778
1779 2007-09-06  Jason Merrill  <jason@redhat.com>
1780
1781         * decl2.c (get_guard): Copy visibility from the guarded variable.
1782
1783 2007-09-06  Jan Hubicka  <jh@suse.cz>
1784
1785         * semantics.c (expand_body): Do not mark arguments of clones used.
1786
1787 2007-09-06  Paolo Carlini  <pcarlini@suse.de>
1788
1789         PR c++/32674
1790         * decl.c (cp_finish_decl): When processing_template_decl,
1791         deal correctly with init as TREE_LIST.
1792
1793 2007-09-06  Tom Tromey  <tromey@redhat.com>
1794
1795         * decl.c (finish_function): Put return's location on line zero of
1796         file.
1797
1798 2007-09-05  Jason Merrill  <jason@redhat.com>
1799
1800         PR c++/15745
1801         * except.c (prepare_eh_type): Use type_decays_to.
1802
1803         PR c++/15097
1804         * init.c (build_delete): Use build_headof to get the address of the
1805         complete object if we aren't using the deleting destructor.
1806         * rtti.c (build_headof): No longer static.
1807         * cp-tree.h: Declare it.
1808
1809 2007-09-06  Jakub Jelinek  <jakub@redhat.com>
1810
1811         * decl.c (duplicate_decls): Set TREE_NOTHROW on __builtin_XX
1812         decl if a prototype for XX is provided with throw().
1813
1814         PR c++/33289
1815         * decl.c (builtin_function_1): Set DECL_ANTICIPATED also
1816         on __*_chk non-__builtin_* decls.
1817
1818 2007-09-05  Paolo Carlini  <pcarlini@suse.de>
1819
1820         PR c++/30302
1821         * semantics.c (finish_id_expression): Use context_for_name_lookup
1822         insted of DECL_CONTEXT, to see through anonymous structs and unions.
1823         * class.c (finish_struct_anon): Deal correctly with anonymous
1824         structs (vs unions, as GNU extension) in error messages.
1825
1826 2007-09-05  Jan Hubicka  <jh@suse.cz>
1827
1828         * cp/sematics.c (expand_body): Remove unnecesary import_export_decl
1829         call, DECL_EXTERNAL checks and current_function_decl saving.
1830
1831 2007-09-05  Paolo Carlini  <pcarlini@suse.de>
1832
1833         PR c++/29731 (again)
1834         * parser.c (cp_parser_primary_expression): Return error_mark_node
1835         when a statement-expression is found in a template-argument list.
1836
1837 2007-09-04  Jason Merrill  <jason@redhat.com>
1838
1839         * except.c (initialize_handler_parm): Use
1840         fold_build_cleanup_point_expr.
1841
1842         PR c++/31419
1843         * call.c (reference_binding): Don't look for user-defined conversions
1844         to the same type.
1845
1846         PR c++/31411
1847         * except.c (initialize_handler_parm): Put a CLEANUP_POINT_EXPR inside
1848         the MUST_NOT_THROW_EXPR.
1849
1850 2007-09-04  Richard Sandiford  <richard@codesourcery.com>
1851
1852         * decl.c (cp_finish_decl): Call determine_visibility before
1853         make_rtl_for_nonlocal_decl.
1854
1855 2007-09-04  Jason Merrill  <jason@redhat.com>
1856
1857         PR c++/14032
1858         * pt.c (most_specialized_class): Substitute outer template
1859         arguments into the arguments of a member template partial
1860         specialization.
1861         (strip_innermost_template_args): New fn.
1862
1863 2007-09-03  Daniel Jacobowitz  <dan@codesourcery.com>
1864
1865         * Make-lang.in (g++spec.o): Remove SHLIB_MULTILIB.
1866
1867 2007-09-03  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1868
1869         * call.c (name_as_c_string): Supply a TYPE for CONST_CAST.
1870         * decl.c (cp_make_fname_decl): Likewise,
1871         * parser.c (cp_parser_string_literal): Likewise,
1872         * tree.c (pod_type_p, zero_init_p): Use CONST_CAST_TREE.
1873         * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
1874         Likewise,
1875
1876 2007-09-02  Paolo Carlini  <pcarlini@suse.de>
1877
1878         PR c++/33208
1879         * typeck.c (build_unary_op): Fix error message for
1880         Boolean expression as operand to operator--.
1881
1882 2007-09-01  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1883
1884         * tree.c (pod_type_p, zero_init_p): Use strip_array_types.
1885         * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
1886         Likewise.
1887
1888 2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
1889
1890         PR c++/32597
1891         * init.c (build_default_init): Make extern.
1892         * cp-tree.h (build_default_init): Declare here.
1893         * pt.c (tsubst_expr): When the instantiation of the initializer of
1894         a variable results in an empty list, default-initialize the
1895         variable.
1896         (tsubst_copy_and_build): When the instantiation of the initializer
1897         in a new expression results in an empty initializer list,
1898         default-initialize it.
1899
1900 2007-08-31  Douglas Gregor  <doug.gregor@gmail.com>
1901
1902         * mangle.c (write_type): Change mangling of rvalue reference from
1903         `RR' to `O'. 
1904
1905 2007-08-31  Jakub Jelinek  <jakub@redhat.com>
1906
1907         * decl.c (duplicate_decls): Remove duplicated line.
1908
1909 2007-08-31  Paolo Carlini  <pcarlini@suse.de>
1910
1911         PR c++/33210
1912         * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with
1913         BOUND_TEMPLATE_TEMPLATE_PARM.
1914
1915 2007-08-31  Paolo Carlini  <pcarlini@suse.de>
1916
1917         PR c++/32113
1918         * search.c (lookup_member): Check the name argument for
1919         error_mark_node.
1920
1921 2007-08-31  Paolo Carlini  <pcarlini@suse.de>
1922
1923         PR c++/33212
1924         * parser.c (cp_parser_trait_expr): Check rerurn value of
1925         cp_parser_type_id.
1926
1927 2007-08-30  Ollie Wild  <aaw@google.com>
1928
1929         * cvt.c (cp_convert_to_pointer): Remove force parameter. Call
1930         convert_ptrmem for pointer to member conversions.
1931         (convert_to_pointer_force): Update cp_convert_to_pointer call.
1932         (ocp_convert): Update cp_convert_to_pointer call.
1933         * typeck.c (convert_ptrmem): Add conditional for null pointers to
1934         members.
1935         (build_static_cast_1): Check can_convert for conversions in either
1936         direction.
1937         (get_delta_difference_1): New function.
1938         (get_delta_difference): Refactor to call get_delta_difference_1.
1939
1940 2007-08-30  Jakub Jelinek  <jakub@redhat.com>
1941
1942         * decl.c (start_preparsed_function): Set
1943         DECL_DISREGARD_INLINE_LIMITS for GNU_INLINE_P functions.
1944
1945 2007-08-28  Paolo Carlini  <pcarlini@suse.de>
1946
1947         PR c++/33209
1948         * error.c (dump_expr): Deal with TEMPLATE_TYPE_PARM and
1949         BOUND_TEMPLATE_TEMPLATE_PARM.
1950
1951 2007-08-28  Jakub Jelinek  <jakub@redhat.com>
1952
1953         PR c++/32596
1954         PR c++/32400
1955         * pt.c (check_explicit_specialization): Set DECL_INTERFACE_KNOWN
1956         and DECL_NOT_REALLY_EXTERN if tmpl_func is not public.
1957
1958 2007-08-27  Jason Merrill  <jason@redhat.com>
1959
1960         PR c++/29000
1961         * pt.c (build_non_dependent_expr, type_dependent_expression_p): 
1962         Look inside STMT_EXPR.
1963         * semantics.c (stmt_expr_value_expr): New fn.
1964         * cp-tree.h: Declare it.
1965
1966         PR c++/28558
1967         * decl.c (groktypename): Ignore attributes applied to class type.
1968
1969 2007-08-28  Richard Guenther  <rguenther@suse.de>
1970
1971         * decl.c (duplicate_decls): Merge DECL_DISREGARD_INLINE_LIMITS.
1972
1973 2007-08-28  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1974         
1975         * error.c (dump_expr): Handle COMPLEX_CST.
1976         * cxx-pretty-print.c (pp_cxx_primary_expression): Likewise.
1977         (pp_cxx_expression): Likewise.
1978
1979 2007-08-27  Alexandre Oliva  <aoliva@redhat.com>
1980
1981         * decl.c (GNU_INLINE_P): New.
1982         (duplicate_decls): Handle gnu_inline.  Merge attributes and
1983         some flags in overriding definitions.
1984         (redeclaration_error_message): Handle gnu_inline.
1985         (start_preparsed_function): Likewise.
1986
1987 2007-08-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1988
1989         * call.c (sufficient_parms_p): Constify.
1990         * class.c (same_signature_p): Likewise.
1991         * cp-gimplify.c (is_invisiref_parm,
1992         cxx_omp_privatize_by_reference): Likewise.
1993         * cp-objcp-common.c (has_c_linkage): Likewise.
1994         * cp-tree.h (NON_THUNK_FUNCTION_CHECK, THUNK_FUNCTION_CHECK,
1995         sufficient_parms_p, same_signature_p, copy_fn_p, move_fn_p,
1996         grok_ctor_properties, nothrow_libfn_p, skip_artificial_parms_for,
1997         num_artificial_parms_for, comp_template_parms,
1998         template_parameter_pack_p, any_dependent_template_arguments_p,
1999         any_type_dependent_arguments_p, any_value_dependent_elements_p,
2000         repo_export_class_p, cxx_omp_privatize_by_reference, pod_type_p,
2001         zero_init_p, member_p, cp_lvalue_kind,
2002         builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
2003         varargs_function_p, is_dummy_object, special_function_kind,
2004         string_conv_p, type_unknown_p, comp_except_specs, compparms,
2005         comp_cv_qualification, is_bitfield_expr_with_lowered_type,
2006         unlowered_expr_type, ptr_reasonably_similar, cp_type_readonly,
2007         cp_has_mutable_p, at_least_as_qualified_p,
2008         invalid_nonstatic_memfn_p, lvalue_or_else, lvalue_p): Likewise.
2009         * decl.c (copy_fn_p, move_fn_p, grok_ctor_properties): Likewise.
2010         * except.c (nothrow_libfn_p): Likewise.
2011         * method.c (skip_artificial_parms_for, num_artificial_parms_for):
2012         Likewise.
2013         * pt.c (comp_template_parms, template_parameter_pack_p,
2014         any_type_dependent_arguments_p, any_value_dependent_elements_p,
2015         any_dependent_template_arguments_p): Likewise.
2016         * repo.c (repo_export_class_p): Likewise.
2017         * semantics.c (anon_aggr_type_p): Likewise.
2018         * tree.c (lvalue_p_1, real_lvalue_p, lvalue_p,
2019         builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
2020         varargs_function_p, member_p, is_dummy_object, pod_type_p,
2021         zero_init_p, special_function_p): Likewise.
2022         * typeck.c (comp_array_types, type_unknown_p, comp_except_specs,
2023         comp_array_types, at_least_as_qualified_p, comp_cv_qualification,
2024         compparms, invalid_nonstatic_memfn_p,
2025         is_bitfield_expr_with_lowered_type, unlowered_expr_type,
2026         string_conv_p, ptr_reasonably_similar, cp_type_readonly,
2027         cp_has_mutable_p, lvalue_or_else): Likewise.
2028
2029 2007-08-25  Paolo Bonzini  <bonzini@gnu.org>
2030
2031         * decl.c (cp_tree_node_structure): Kill TINST_LEVEL case.
2032         * cp-objcp-common.c (cp_tree_size): Ditto.
2033         * tree.c (cp_walk_subtrees): Ditto
2034         * cp-tree.def (TINST_LEVEL): Go away.
2035         * cp-tree.h (struct tinst_level_s): Rename to struct tinst_level,
2036         move together with other non-tree structs.
2037         (enum cp_tree_node_structure_enum): Nuke TS_CP_TINST_LEVEL.
2038         (union lang_tree_node): Eliminate tinst_level field.
2039         (TINST_DECL, TINST_LOCATION, TINST_IN_SYSTEM_HEADER_P): Annihilate.
2040         (current_instantiation, outermost_tinst_level): Return
2041         a "struct tinst_level *".
2042
2043         * error.c (print_instantiation_partial_context): Change second
2044         parameter to a "struct tinst_level *".  Replace accessor macros
2045         with field access.
2046         (print_instantiation_full_context): Likewise.
2047         * lex.c (in_main_input_context): Likewise.
2048
2049         * pt.c (struct pending_templates): New.
2050         (pending_templates, last_pending_template): Use it as a type.
2051         (current_tinst_level): Change typo to "struct tinst_level *"
2052         (reopen_tinst_level): Accept "struct tinst_level *", return decl.
2053         (add_pending_template): Construct a "struct pending_template".
2054         Replace TINST_LEVEL accessor macros with field access.
2055         (push_tinst_level): Likewise, using GGC_NEW instead of make_node.
2056         (pop_tinst_level): Likewise.
2057         (instantiate_pending_templates): Likewise.  Factor common code used
2058         when an instantiation has been done.
2059         (outermost_tinst_level): Replace tree_last with loop.
2060         (current_instantiation): Return a "struct tinst_level *".
2061
2062 2007-08-24  Ollie Wild  <aaw@google.com>
2063
2064         * name-lookup.c (add_decl_to_level): Remove addition to vtables chain.
2065         * name-lookup.h (cp_binding_level): Remove vtables member.
2066
2067 2007-08-24  Richard Guenther  <rguenther@suse.de>
2068
2069         * tree.c (cp_cannot_inline_tree_fn): Remove.
2070         * cp-tree.h (cp_cannot_inline_tree_fn): Likewise.
2071         * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN):
2072         Remove define.
2073
2074 2007-08-24  Jakub Jelinek  <jakub@redhat.com>
2075
2076         PR c++/32567
2077         * typeck.c (build_unary_op) <case PREINCREMENT_EXPR>: Return
2078         error_mark_node right away if build_expr_type_conversion
2079         returned it.
2080
2081         PR c++/32898
2082         * name-lookup.c (set_decl_namespace): lookup_qualified_name failure
2083         is error_mark_node rather than NULL_TREE.
2084         * pt.c (check_explicit_specialization): Likewise.
2085
2086         PR c++/31941
2087         * error.c (resolve_virtual_fun_from_obj_type_ref): Handle
2088         TARGET_VTABLE_USES_DESCRIPTORS targets properly.
2089
2090 2007-08-22  Jason Merrill  <jason@redhat.com>
2091
2092         PR c++/29365
2093         * pt.c (outermost_tinst_level): New function.
2094         * lex.c (in_main_input_context): New function.
2095         * cp-tree.h: Declare it.
2096         * decl2.c (constrain_class_visibility): Use it to avoid warning
2097         about uses of the anonymous namespace in the main input file.
2098
2099 2007-08-21  Jakub Jelinek  <jakub@redhat.com>
2100
2101         * init.c (build_new_1): Use get_target_expr instead of save_expr.
2102
2103 2007-08-20  Pawel Sikora  <pluto@pld-linux.org>
2104
2105         PR c++/7302
2106         * class.c (finish_struct_1): Warn when a class has virtual
2107         functions and accessible non-virtual destructor.
2108
2109 2007-08-20  Richard Guenther  <rguenther@suse.de>
2110
2111         PR c++/22369
2112         PR c++/22451
2113         * call.c (build_new_method_call): Convert initializer to
2114         the basetype.
2115         * init.c (build_aggr_init): Do not fiddle with types.
2116         (build_vec_delete_1): Use correct type for POINTER_PLUS_EXPR.
2117         * except.c (build_throw): Do not drop qualifiers for the
2118         pointer type.
2119         * typeck.c (get_member_function_from_ptrfunc): Do not
2120         fiddle with types, instead convert.
2121         (build_ptrmemfunc1): Convert to the target type for
2122         initialization.
2123         (gfc_trans_allocate): Convert result to target type.
2124         * cp-objcp-common.c (cxx_get_alias_set): Pointers to
2125         pointer-to-member structures shall have alias set zero as well.
2126
2127 2007-08-20  Richard Guenther  <rguenther@suse.de>
2128
2129         * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P):
2130         Remove.
2131         * cp-tree.h (cp_auto_var_in_fn_p): Remove.
2132         (nonstatic_local_decl_p): Likewise.
2133         * tree.c (cp_auto_var_in_fn_p): Remove.
2134         * decl.c (nonstatic_local_decl_p): Remove.
2135
2136 2007-08-20  Richard Guenther  <rguenther@suse.de>
2137
2138         * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_WALK_SUBTREES):
2139         Remove define.
2140         * tree.h (cp_walk_tree): New define to walk_tree_1 with
2141         cp_walk_subtrees lh parameter.
2142         (cp_walk_tree_without_duplicates): New define to
2143         walk_tree_without_duplicates_1 with cp_walk_subtrees lh parameter.
2144         * tree.c (count_trees): Call
2145         cp_walk_tree_without_duplicates.
2146         (verify_stmt_tree): Call cp_walk_tree.
2147         (break_out_target_exprs): Likewise.
2148         (WALK_SUBTREE): Likewise.
2149         * cp-gimplify.c (cp_genericize): Likewise.
2150         * cp-pt.c (find_parameter_packs_r): Likewise.
2151         (uses_parameter_packs): Likewise.
2152         (make_pack_expansion): Likewise.
2153         (check_for_bare_parameter_packs): Likewise.
2154         (for_each_template_parm): Likewise.
2155         * decl.c (check_default_argument): Call
2156         cp_walk_tree_without_duplicates.
2157         * except.c (build_throw): Likewise.
2158         * decl2.c (type_visibility): Likewise.
2159         * semantics.c (expand_or_defer_fn): Likewise.
2160         (finalize_nrv): Call cp_walk_tree.
2161
2162 2007-08-20  Jakub Jelinek  <jakub@redhat.com>
2163
2164         PR c++/33025
2165         * init.c (build_new_1): Rename placement_var variable to placement_expr.
2166         Initialize it with save_expr rather than get_temp_regvar.
2167
2168 2007-08-17  Andrew Pinski  <andrew_pinski@playstation.sony.com>
2169
2170         PR c++/28989
2171         * tree.c (lvalue_p_1 <case SAVE_EXPR>): SAVE_EXPRs are never
2172         lvalues.
2173
2174 2007-08-17  Ollie Wild  <aaw@google.com>
2175
2176         PR c++/31749
2177         * name-lookup.c (do_nonmember_using_decl): Shift implicit type
2178         declarations into appropriate slots for comparison.  Fix type
2179         comparison.
2180
2181 2007-08-17  Paolo Carlini  <pcarlini@suse.de>
2182
2183         PR c++/32112
2184         * error.c (dump_decl): Deal with UNBOUND_CLASS_TEMPLATE.
2185         * cxx-pretty-print.c (pp_cxx_unqualified_id): Likewise.
2186
2187 2007-08-17  Paolo Carlini  <pcarlini@suse.de>
2188
2189         PR c++/32870
2190         * parser.c (cp_parser_class_head): Improve error message.
2191
2192 2007-08-16  Seongbae Park  <seongbae.park@gmail.com>
2193
2194         * pt.c (instantiate_decl): Set input_location
2195         for the function end.
2196
2197 2007-08-16  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
2198
2199         * cp-objcp-common.c (cxx_warn_unused_global_decl, cp_expr_size):
2200         Constify.
2201         * cp-tree.h (local_variable_p, nonstatic_local_decl_p,
2202         class_tmpl_impl_spec_p, cp_auto_var_in_fn_p, cp_type_quals,
2203         cxx_incomplete_type_diagnostic, cxx_incomplete_type_error,
2204         cxx_warn_unused_global_decl, cp_expr_size): Likewise.
2205         * decl.c (local_variable_p, nonstatic_local_decl_p): Likewise.
2206         * tree.c (class_tmpl_impl_spec_p, cp_auto_var_in_fn_p): Likewise.
2207         * typeck.c (cp_type_quals): Likewise.
2208         * typeck2.c (cxx_incomplete_type_diagnostic,
2209         cxx_incomplete_type_error): Likewise.
2210
2211 2007-08-16  Paolo Carlini  <pcarlini@suse.de>
2212
2213         PR c++/31132
2214         * pt.c (tsubst_friend_function): When check_classfn
2215         returns error_mark_node likewise return it.
2216
2217 2007-08-15  Jakub Jelinek  <jakub@redhat.com>
2218
2219         PR c++/32992
2220         * typeck.c (check_return_expr): Don't NRV optimize vars in
2221         anonymous unions.
2222         * decl.c (finish_function): Comment fix.
2223
2224 2007-08-15  Paolo Carlini  <pcarlini@suse.de>
2225
2226         PR c++/33035
2227         * pt.c (push_template_decl_real): Depending on TYPE_P
2228         use either TYPE_CONTEXT or DECL_CONTEXT.
2229
2230 2007-08-14  Mark Mitchell  <mark@codesourcery.com>
2231
2232         * semantics.c (finish_omp_clauses): Strip a NOP_EXPR if
2233         constructors and destructors return this.
2234
2235 2007-08-14  Paolo Carlini  <pcarlini@suse.de>
2236
2237         PR c++/27211
2238         * decl2.c (check_classfn): Return error_mark_node in case of error;
2239         in that case, do not call add_method.
2240         * decl.c (start_decl): Deal with check_classfn returning
2241         error_mark_node.
2242         (grokfndecl): Likewise.
2243         * pt.c (tsubst_friend_function): Likewise.
2244
2245 2007-08-14  Andrew Pinski  <pinskia@gmail.com>
2246
2247         PR c++/30428
2248         * typeck.c (build_binary_op): Disallow vector float types with
2249         BIT_IOR_EXPR, BIT_AND_EXPR, and BIT_XOR_EXPR.
2250
2251 2007-08-11  Ian Lance Taylor  <iant@google.com>
2252
2253         * cp-objcp-common.c (cxx_get_alias_set): Change return type to
2254         alias_set_type.
2255         * cp/cp-tree.h (cxx_get_alias_set): Update declaration.
2256
2257 2007-08-10  Ollie Wild  <aaw@google.com>
2258
2259         * name-lookup.c (do_nonmember_using_decl): Print an error for ambiguous
2260         type lookups.
2261         (ambiguous_decl): Construct tree of ambiguous types.  Remove extaneous
2262         function parameter.
2263         (unqualified_namespace_lookup): Fix ambiguous_decl call.
2264         (lookup_using_namespace): Fix ambiguous_decl call.
2265         (qualified_lookup_using_namespace): Fix ambiguous_decl call.
2266
2267 2007-08-10  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
2268
2269         * call.c (name_as_c_string): Use CONST_CAST.
2270         * decl.c (build_decl): Likewise.
2271         * parser.c (cp_parser_string_literal): Likewise.
2272
2273 2007-08-10  Paolo Carlini  <pcarlini@suse.de>
2274
2275         PR c++/17763
2276         * error.c (dump_expr): Consistently use the *_cxx_*
2277         variants of the pretty-print functions.
2278
2279 2007-08-10  Paolo Carlini  <pcarlini@suse.de>
2280
2281         PR c++/22256
2282         * decl.c (check_special_function_return_type): Just error
2283         on return type specified for conversion operator.
2284
2285 2007-08-09  Daniel Berlin  <dberlin@dberlin.org>
2286
2287         * typeck2.c (readonly_error): Handle general expressions.
2288         * error.c (dump_expr): Handle POINTER_PLUS_EXPR
2289
2290 2007-08-06  Dan Hipschman  <dsh@google.com>
2291
2292         * method.c (use_thunk): Use DECL_NAME instead of DECL_RTL to
2293         access function name.
2294
2295 2007-08-04  Alfred Minarik  <a.minarik@aon.at>
2296
2297         PR pch/13676
2298         * lang-specs.h: Add .hp, .hxx, .hpp, .h, .HPP, .tcc as c++ header.
2299         * g++spec.c (lang_specific_driver): Check them.
2300
2301 2007-08-06  Paolo Carlini  <pcarlini@suse.de>
2302
2303         PR c++/19532
2304         * pt.c (inline_needs_template_parms): Fix comment; change return type
2305         to bool.
2306
2307 2007-08-05  Volker Reichelt  <v.reichelt@netcologne.de>
2308
2309         Revert:
2310         2007-03-26  Dirk Mueller  <dmueller@suse.de>
2311
2312         * parser.c (cp_parser_member_declaration): Pedwarn
2313         about stray semicolons after member declarations.
2314
2315 2007-08-02  Lee Millward  <lee.millward@gmail.com>
2316
2317         PR c++/30849
2318         PR c++/30850
2319         PR c++/30851
2320         * parser.c (cp_parser_asm_definition): Detect and discard asm
2321         statements with invalid inputs or outputs.
2322         (cp_parser_asm_operand_list): Return error mark node if any
2323         of the operands are invalid. Adjust documentation.
2324         
2325 2007-08-02  Nick Clifton  <nickc@redhat.com>
2326
2327         * typeck.c: Change copyright header to refer to version 3 of the
2328         GNU General Public License and to point readers at the COPYING3
2329         file and the FSF's license web page.
2330         * optimize.c, lang-specs.h, init.c, class.c, repo.c, decl.c,
2331         config-lang.in, cp-tree.def, call.c, decl.h, ptree.c,
2332         Make-lang.in, method.c, rtti.c, cp-objcp-common.c, g++spec.c,
2333         cp-objcp-common.h, except.c, error.c, operators.def, cvt.c,
2334         tree.c, mangle.c, cp-tree.h, dump.c, search.c, friend.c, expr.c,
2335         cp-gimplify.c, cxx-pretty-print.c, cp-lang.c, typeck2.c, pt.c,
2336         cxx-pretty-print.h, semantics.c, name-lookup.c, lex.c, decl2.c,
2337         name-lookup.h, parser.c: Likewise.
2338
2339 2007-08-01  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
2340
2341         PR middle-end/32668
2342         * call.c (magic_varargs_p): Honor the "type generic" attribute.
2343
2344 2007-07-30  Paolo Carlini  <pcarlini@suse.de>
2345
2346         PR c++/32108
2347         * semantics.c (finish_label_stmt): Reject the __label__
2348         extension outside function scopes.
2349
2350 2007-07-29  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
2351
2352         * parser.c (eof_token): Un-constify.
2353         (cp_lexer_new_main, cp_lexer_new_from_tokens, VEC_alloc,
2354         cp_lexer_consume_token, cp_lexer_purge_token): Remove spurious
2355         casts.
2356
2357 2007-07-28  Kazu Hirata  <kazu@codesourcery.com>
2358
2359         * pt.c, tree.c, typeck2.c: Fix comment typos.
2360
2361 2007-07-28  Simon Martin  <simartin@users.sourceforge.net>
2362             Mark Mitchell  <mark@codesourcery.com>
2363
2364         PR c++/30917
2365         * name-lookup.c (lookup_name_real): Non namespace-scope bindings can be
2366         hidden due to friend declarations in local classes.
2367
2368 2007-07-27  Douglas Gregor  <doug.gregor@gmail.com>
2369
2370         * typeck.c (structural_comptypes): Compare DECLTYPE_TYPE nodes.
2371         * cp-tree.def (DECLTYPE_TYPE): New.
2372         * error.c (dump_type): Dump DECLTYPE_TYPE nodes.
2373         (dump_type_prefix): Ditto.
2374         (dump_type_suffix): Ditto.
2375         * tree.c (DECLTYPE_TYPE): Walk DECLTYPE_TYPE nodes.
2376         * mangle.c (write_type): Handle DECLTYPE_TYPE.
2377         * cp-tree.h (IS_AGGR_TYPE): DECLTYPE_TYPE nodes can be aggregate
2378         types.
2379         (DECLTYPE_TYPE_EXPR): New.
2380         (DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P): New.
2381         (finish_declared_type): Declare.
2382         * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Print
2383         DECLTYPE_TYPE nodes.
2384         (pp_cxx_type_id): Ditto.
2385         * pt.c (for_each_template_parm_r): Walk DECLTYPE_TYPE children.
2386         (tsubst): Substitute into a DECLTYPE_TYPE node.
2387         (tsubst_copy): Ditto.
2388         (unify): Cannot deduce anything from TYPEOF_TYPE or DECLTYPE_TYPE
2389         nodes.
2390         (dependent_type_p_r): DECLTYPE_TYPE types are always dependent.
2391         * semantics.c (finish_typeof): TYPEOF_TYPE types need to use
2392         structural equality (because we can't hash the expressions).
2393         (finish_declared_type): New.
2394         * lex.c (reswords): Add "decltype" keyword.
2395         * parser.c cp_lexer_next_token_is_decl_specifier_keyword
2396         (cp_parser_postfix_expression): Add member_access_only_p to
2397         restrict postfix expression to member access expressions.
2398         (cp_parser_unary_expression): Update call to
2399         cp_parser_postfix_expression to reflect new parameter.
2400         (cp_parser_declared_type): New.
2401         (cp_parser_simple_type_specifier): Parse decltype types.
2402
2403 2007-07-27  Mark Mitchell  <mark@codesourcery.com>
2404
2405         PR c++/32346
2406         * call.c (convert_for_arg_passing): Only widen bitfields to their
2407         declared types if necessary.
2408
2409 2007-07-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
2410
2411         * parser.c (cp_parser_string_literal, cp_parser_sizeof_operand):
2412         Constify.
2413
2414 2007-07-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
2415
2416         * decl.c (typename_hash, typename_compare): Constify.
2417         * mangle.c (hash_type, compare_type): Likewise.
2418         * pt.c (eq_local_specializations, hash_local_specialization):
2419         Likewise.
2420         * tree.c (cplus_array_hash, cplus_array_compare, list_hash_eq,
2421         list_hash): Likewise.
2422         * typeck2.c (pat_compare): Likewise.
2423
2424 2007-07-24  Nathan Sidwell  <nathan@codesourcery.com>
2425
2426         * method.c (implicitly_declare_fn): Increase alignment if member
2427         function pointer format requires it.
2428
2429 2007-07-24  Paolo Carlini  <pcarlini@suse.de>
2430
2431         PR c++/29001
2432         * typeck.c (check_return_expr): Do not pass a null argument
2433         to null_ptr_cst_p.
2434
2435 2007-07-24  Paolo Carlini  <pcarlini@suse.de>
2436
2437         PR c++/32561
2438         * decl.c (redeclaration_error_message): Call DECL_ANON_UNION_VAR_P
2439         only on VAR_DECL.
2440
2441 2007-07-22  Nathan Sidwell  <nathan@codesourcery.com>
2442
2443         PR c++/32839
2444         * typeck.c (convert_arguments): Only use default args if we have
2445         a function decl.
2446
2447         PR c++/30818
2448         * typeck.c (structural_comptypes): No need to check
2449         resolve_typename_type return value here.
2450         * cp-tree.h (TYPENAME_IS_RESOLVING_P): New.
2451         * pt.c (resolve_typename_type): Follow typename typedefs.  Return
2452         original type rather than error_mark_node in case of failure.
2453         * parser.c (cp_parser_nested_name_specifier_opt): Adjust
2454         resolve_typename_type result check.
2455         (cp_parser_direct_declarator, cp_parser_head,
2456         cp_parser_constructor_declarator_p): Likewise.
2457
2458 2007-07-12  Kazu Hirata  <kazu@codesourcery.com>
2459
2460         * pt.c (template_parms_variadic_p): Remove.
2461         * cp-tree.h: Remove the prototype for template_parms_variadic_p.
2462
2463 2007-07-12  Jakub Jelinek  <jakub@redhat.com>
2464
2465         PR c++/30854
2466         * error.c (dump_expr) <case AGGR_INIT_EXPR>: Pass true as last
2467         argument to dump_aggr_init_expr_args instead of false.
2468
2469 2007-07-11  Douglas Gregor  <doug.gregor@gmail.com>
2470
2471         * typeck.c (comptypes): When USE_CANONICAL_TYPES, use the
2472         canonical types; otherwise, fall back to structural type
2473         comparisons. If ENABLE_CHECKING and USE_CANONICAL_TYPES, give an
2474         internal compiler error if the canonical types are wrong.
2475         
2476 2007-07-11  Paolo Carlini  <pcarlini@suse.de>
2477
2478         PR c++/32560
2479         * parser.c (cp_parser_make_indirect_declarator): When the
2480         the code argument is ERROR_MARK return cp_error_declarator.
2481
2482 2007-07-09  Geoffrey Keating  <geoffk@apple.com>
2483
2484         PR 32617
2485         * decl.c (cxx_init_decl_processing): Don't set
2486         force_align_functions_log.
2487         (grokfndecl): Honour ptrmemfunc_vbit_in_pfn.
2488         * typeck.c (cxx_alignof_expr): When alignof is used on a plain
2489         FUNCTION_DECL, return its alignment.
2490
2491 2007-07-09  Richard Guenther  <rguenther@suse.de>
2492
2493         * decl.c (start_preparsed_function): Do not promote return type.
2494
2495 2007-07-08  Paolo Carlini  <pcarlini@suse.de>
2496
2497         PR c++/30535
2498         * pt.c (unify): Never pass error_mark_node to template_decl_level.
2499
2500 2007-07-07  Mark Mitchell  <mark@codesourcery.com>
2501
2502         PR c++/32232
2503         * pt.c (resolve_overloaded_unification): Robustify.  Return a
2504         bool, not an int.
2505         (type_unification_real): Adjust accordingly.
2506
2507 2007-07-06  Richard Guenther  <rguenther@suse.de>
2508
2509         * init.c (build_new_1): Use the correct pointer type.
2510         * typeck2.c (build_m_component_ref): Likewise.
2511
2512 2007-07-05  Mark Mitchell  <mark@codesourcery.com>
2513
2514         PR c++/32245
2515         * init.c (build_zero_init): Always build an initializer for
2516         non-static storage.
2517         * typeck2.c (build_functional_cast): Use build_zero_init.
2518
2519         PR c++/32251
2520         * init.c (build_new_1): Always pass the allocation function to
2521         build_op_delete_call.
2522         * call.c (build_op_delete_call): Handle operator delete with a
2523         variable-argument list.  Do not issue an error when no matching
2524         deallocation function is available for a new operator.
2525
2526         PR c++/31992
2527         * cp-tree.h (any_value_dependent_elements_p): Declare it.
2528         * decl.c (value_dependent_init_p): New function.
2529         (cp_finish_decl): Use it.
2530         * pt.c (value_dependent_expression_p): Use
2531         any_value_dependent_elements_p.
2532         * parser.c (cp_parser_primary_expression): Add comment about
2533         treating dependent qualified names as integral
2534         constant-expressions.
2535
2536 2007-07-04  Douglas Gregor  <doug.gregor@gmail.com>
2537
2538         * decl.c (build_ptrmemfunc_type): Always use structural equality
2539         tests when comparing pointer-to-member-function types, because the
2540         handling of TYPE_GET_PTRMEMFUNC_TYPE currently defeats canonical
2541         types.
2542         
2543 2007-07-03  Mark Mitchell  <mark@codesourcery.com>
2544
2545         * init.c (build_new): Tweak comment.
2546
2547 2007-06-29  Dave Brolley  <brolley@redhat.com>
2548
2549         PR c++/31743
2550         * parser.c (cp_parser_new_type_id): Don't reduce a named array
2551         type to its base type and number of elements here.
2552         * init.c (build_new): Call complete_type_or_else to ensure that the
2553         type is complete and to issue a diagnostic if it is not.
2554         (build_new_1): Don't call complete_type_or_else here.
2555
2556 2007-07-03  Richard Guenther  <rguenther@suse.de>
2557
2558         PR c++/32609
2559         * class.c (fixed_type_or_null): Re-lookup the hashtable slot
2560         after recursing.
2561
2562 2007-07-02  Simon Baldwin  <simonb@google.com>
2563
2564         * parser.c (cp_parser_elaborated_type_specifier): Added a warning
2565         for inner-style nested forward declarations that don't declare
2566         anything useful.
2567
2568 2007-07-02  Jakub Jelinek  <jakub@redhat.com>
2569
2570         PR c++/31748
2571         * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
2572         DECL_P in not a variable and appears more than once error messages.
2573
2574 2007-07-01  Ollie Wild  <aaw@google.com>
2575
2576         * name-lookup.c (ambiguous_decl): Fix case when new->value is hidden.
2577         (select_decl): Remove function.
2578         (unqualified_namespace_lookup): Populate binding by calling
2579         ambiguous_decl.  Remove select_decl call.
2580         (lookup_qualified_name): Remove select_decl call.
2581         * decl.c (lookup_and_check_tag): Check for ambiguous references.
2582         * parser.c (cp_parser_elaborated_type_specifier): Skip redundant error
2583         generation when name lookup is ambiguous.
2584
2585 2007-06-29  Douglas Gregor  <doug.gregor@gmail.com>
2586
2587         PR c++/31724
2588         * init.c (build_new_1): Use structural equality on the copy of the
2589         array type.
2590
2591 2007-06-28  Geoffrey Keating  <geoffk@apple.com>
2592
2593         * decl2.c (determine_visibility): Implement
2594         flag_visibility_ms_compat effect on type info.
2595         * decl.c (cxx_init_decl_processing): Implement
2596         global effect of flag_visibility_ms_compat.
2597
2598 2007-06-28  Geoffrey Keating  <geoffk@apple.com>
2599
2600         * decl2.c (start_objects): Mark constructor-running function
2601         as artificial.
2602
2603 2007-06-26  Simon Martin  <simartin@users.sourceforge.net>
2604
2605         PR c++/32111
2606         * decl.c (grokdeclarator): Reset friendp for member functions declared
2607         friend of their own class.
2608
2609 2007-06-23  Mark Mitchell  <mark@codesourcery.com>
2610
2611         * decl2.c (determine_visibility): Don't look for dllexport here.
2612         (determine_visibility_from_class): Tidy.
2613
2614 2007-06-18  Simon Baldwin <simonb@google.com>
2615
2616         PR c++/31923
2617         * parser.c (cp_parser_single_declaration): Added check for storage
2618         class other than sc_none in parsed declaration, and a flag to indicate
2619         if the call is part of an explicit template specialization parse.
2620         * (cp_parser_explicit_specialization): Specialization check flag added
2621         to call to cp_parser_single_declaration(), set true.
2622         * (cp_parser_template_declaration_after_export): Specialization check
2623         flag added to call to cp_parser_single_declaration(), set false.
2624         * pt.c (check_explicit_specialization): Added code to copy visiblity
2625         and linkage from the templated function to the explicit specialization.
2626
2627 2007-06-15  Andrew Pinski  <andrew_pinski@playstation.sony.com>
2628
2629         * typeck.c (build_binary_op): For templates build the
2630         expression in pieces to avoid the assert in build2_stat.
2631         (get_member_function_from_ptrfunc):
2632         Change over to using POINTER_PLUS_EXPR and convert
2633         the second operand to sizetype.
2634         * typeck2.c (build_m_component_ref):  Likewise.
2635         * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR
2636         instead of PLUS_EXPR for pointers.
2637         (build_new_1): Likewise.
2638         (build_vec_delete_1): Likewise.
2639         (build_vec_delete): Likewise.
2640         * class.c (build_base_path): Likewise.
2641         (build_base_path): Likewise.
2642         (convert_to_base_statically): Likewise.
2643         (fixed_type_or_null): Handle POINTER_PLUS_EXPR.
2644         (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR
2645         instead of PLUS_EXPR.
2646         (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR
2647         instead of PLUS_EXPR for pointers.
2648         * call.c (build_special_member_call): Likewise.
2649         * rtti.c (build_headof): Likewise.
2650         Use sizetype instead of ptrdiff_type_node.
2651         (tinfo_base_init): Create a POINTER_PLUS_EXPR
2652         instead of PLUS_EXPR for pointers.
2653         * except.c (expand_start_catch_block):  Do a
2654         NEGATIVE and then a POINTER_PLUS_EXPR instead
2655         of a MINUS_EXPR.
2656         * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert
2657         PLUS_EXPR on pointer types over to use
2658         POINTER_PLUS_EXPR and remove the conversion
2659         to the pointer types.
2660         * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for
2661         adding to a pointer type. Use size_int instead of
2662         ssize_int. Convert the index to sizetype before
2663         adding it to the pointer.
2664
2665 2007-06-15  Mark Mitchell  <mark@codesourcery.com>
2666
2667         * cp-tree.h (DECL_VAR_MARKED_P): Remove.
2668         (DECL_ANON_UNION_VAR_P): New macro.
2669         * class.c (fixed_type_or_null): Tidy.  Use a hash table, rather
2670         than DECL_VAR_MARKED_P, to keep track of which variables we have
2671         seen.
2672         * decl.c (redeclaration_error_message): Complain about redeclaring
2673         anonymous union members at namespace scope.
2674         * decl2.c (build_anon_union_vars): Set DECL_ANON_UNION_VAR_P.
2675
2676 2007-06-14  Geoff Keating  <geoffk@apple.com>
2677
2678         * decl2.c (determine_visibility): Ensure that functions with
2679         hidden types as parameters are hidden.
2680
2681         PR 31093
2682         * decl2.c (determine_visibility): Remove duplicate code for
2683         handling type info.
2684
2685 2007-06-12  Ian Lance Taylor  <iant@google.com>
2686
2687         PR libstdc++/29286
2688         * init.c (avoid_placement_new_aliasing): New static function.
2689         (build_new_1): Call it.
2690
2691 2007-06-11  Rafael Avila de Espindola  <espindola@google.com>
2692
2693         * cp-objcp-common.h (LANG_HOOKS_SIGNED_TYPE): Remove.
2694         (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove.
2695
2696 2007-06-08  Jakub Jelinek  <jakub@redhat.com>
2697
2698         PR c++/32177
2699         * semantics.c (finish_omp_for): Call fold_build_cleanup_point_expr
2700         on init, the non-decl cond operand and increment value.
2701
2702 2007-06-07  Simon Martin  <simartin@users.sourceforge.net>
2703
2704         PR c++/30759
2705         * decl.c (check_initializer): Report an error when a brace enclosed
2706         initializer is used for a non-aggregate type in C++98.
2707         (redeclaration_error_message): Rewrote flag_cpp0x in terms of
2708         cxx_dialect.
2709         (grokdeclarator): Likewise.
2710         (move_fn_p): Likewise.
2711         * typeck.c (check_return_expr): Likewise.
2712         * call.c (reference_binding): Likewise.
2713         * error.c (cp_cpp_error): Likewise.
2714         * pt.c (check_default_tmpl_args): Likewise.
2715         (tsubst): Likewise.
2716         * lex.c (init_reswords): Likewise.
2717         * parser.c (p_parser_primary_expression): Likewise.
2718         (TOKEN_PRECEDENCE): Likewise.
2719         (cp_parser_init_declarator): Likewise.
2720         (cp_parser_ptr_operator): Likewise.
2721         (cp_parser_parameter_declaration): Likewise.
2722         (cp_parser_enclosed_template_argument_list): Likewise.
2723         (cp_parser_skip_to_end_of_template_parameter_list): Likewise.
2724         (cp_parser_next_token_ends_template_argument_p): Likewise.
2725
2726 2007-06-04  Simon Baldwin  <simonb@google.com>
2727
2728         * decl.c (grokdeclarator): Readability change.  Moved case labels
2729         into direct switch statement scope.
2730
2731 2007-06-04  Paolo Carlini  <pcarlini@suse.de>
2732
2733         * call.c (convert_like_real): Remove pointless code.
2734
2735 2007-05-31  Mark Mitchell  <mark@codesourcery.com>
2736
2737         * decl.c (get_atexit_fn_ptr_type): New function.
2738         (get_atexit_node): Use it.
2739         (start_cleanup_fn): Likewise.
2740         (register_dtor_fn): Use the object's destructor, instead of a
2741         separate cleanup function, where possible.
2742         * cp-tree.h (CPTI_ATEXIT_FN_PTR_TYPE): New enumerator.
2743         (atexit_fn_ptr_type_node): New macro.
2744         * decl2.c (build_cleanup): Use build_address.
2745
2746 2007-05-31  Daniel Berlin  <dberlin@dberlin.org>
2747
2748         * typeck.c (build_binary_op): Include types in error.
2749
2750 2007-05-31  Jakub Jelinek  <jakub@redhat.com>
2751
2752         PR c++/31806
2753         * decl.c (cp_finish_decl): Also clear was_readonly if a static var
2754         needs runtime initialization.
2755
2756 2007-05-31  Paolo Carlini  <pcarlini@suse.de>
2757
2758         PR c++/32158
2759         * semantics.c (finish_trait_expr): Complete the types.
2760
2761 2007-05-30  Russell Yanofsky <russ@yanofsky.org>
2762             Douglas Gregor <doug.gregor@gmail.com>
2763             Pedro Lamarao <pedro.lamarao@mndfck.org>
2764             Howard Hinnant <howard.hinnant@gmail.com>
2765
2766         PR c++/7412
2767         PR c++/29939
2768         * typeck.c (comptypes): Don't consider rvalue and lvalue
2769         reference types to be equivalent.
2770         (check_return_expr): Move from certain lvalues when returning
2771         them.
2772         * decl.c (grokdeclarator): Implement reference collapsing.
2773         (copy_fn_p): Don't consider constructors taking rvalue references
2774         to be copy constructors.
2775         (move_fn_p): New.
2776         * call.c (conversion): New "rvaluedness_matches_p" member.
2777         (convert_class_to_reference): Require reference type as first
2778         parameter instead of base type.
2779         (reference_binding): Add logic to handle rvalue references.
2780         (implicit_conversion): Update inaccurate comment.
2781         (convert_like_real): Disable creation of temporaries that are
2782         impossible to initialize for types with move constructors.
2783         (build_over_call): Elide move constructors when possible.
2784         (maybe_handle_implicit_object): Set "rvaluedness_matches_p".
2785         (maybe_handle_ref_bind): Return conversion instead of type node.
2786         (compare_ics): Add logic to use "rvaluedness_matches_p" values to
2787         determine preferred conversion sequences.
2788         * cp-tree.h (TYPE_REF_IS_RVALUE): New.
2789         (LOOKUP_PREFER_RVALUE): New.
2790         (DECL_MOVE_CONSTRUCTOR_P): New.
2791         (struct cp_declarator): Add "reference" member for reference
2792         types, with new "rvalue_ref" flag.
2793         (cp_build_reference_type): Declare.
2794         (move_fn_p): Declare.
2795         * error.c (dump_type_prefix): Format rvalue reference types
2796         correctly in error messages.
2797         * except.c (build_throw): Move from certain lvalues when
2798         throwing.
2799         * mangle.c (write_type): Mangle rvalue references differently
2800         than regular references.
2801         * parser.c (make_reference_declarator): Add boolean parameter for
2802         rvalue references.
2803         (cp_parser_make_indirect_declarator): New.
2804         (cp_parser_new_declarator_opt): Call
2805         cp_parser_make_indirect_declarator. 
2806         (cp_parser_conversion_declarator_opt): Ditto.
2807         (cp_parser_declarator): Ditto.
2808         (cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference
2809         declarators.
2810         * pt.c (tsubst): Implement reference collapsing.
2811         (maybe_adjust_types_for_deduction): Implement special template
2812         parameter deduction rule for rvalue references.
2813         (type_unification_real): Update calls to
2814         maybe_adjust_types_for_deduction.
2815         (try_one_overload): Ditto.
2816         (unify_pack_expansion): Ditto.
2817         * tree.c (lvalue_p_1): Handle rvalue reference types.
2818         (cp_build_reference_type): New.
2819
2820 2007-05-30  Jakub Jelinek  <jakub@redhat.com>
2821
2822         PR c++/31809
2823         * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC
2824         variables that need runtime initialization.
2825
2826 2007-05-28  Andrew Pinski  <Andrew_pinski@playstation.sony.com>
2827
2828         PR c++/31339
2829         * typeck.c (build_unary_op <case PREINCREMENT_EXPR,
2830         case POSTINCREMENT_EXPR, case PREDECREMENT_EXPR,
2831         case POSTDECREMENT_EXPR>): Return the error_mark_node
2832         if either the real or imaginary parts would an
2833         error_mark_node.
2834         
2835 2007-05-25  Simon Martin  <simartin@users.sourceforge.net>
2836             Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2837
2838         PR c++/31745
2839         * parser.c (cp_parser_skip_to_closing_brace): Return true if the next
2840         token is a closing brace, false if there are no tokens left.
2841         (cp_parser_namespace_alias_definition): Only consume the next token if
2842         it is a closing brace.
2843
2844         * parser.c (cp_parser_class_specifier): Likewise.
2845
2846 2007-05-25  H.J. Lu  <hongjiu.lu@intel.com>
2847
2848         * semantics.c (finish_member_declaration): Fix a typo in the
2849         last checkin.
2850
2851 2007-05-25  Douglas Gregor <doug.gregor@gmail.com>
2852
2853         PR c++/31431
2854         PR c++/31432
2855         PR c++/31434
2856         PR c++/31435
2857         PR c++/31437
2858         PR c++/31438
2859         PR c++/31442
2860         PR c++/31443
2861         PR c++/31444
2862         PR c++/31445
2863         * error.c (dump_type): Dump TYPE_ARGUMENT_PACK nodes.
2864         * cp-tree.h (check_for_bare_parameter_packs): Returns bool.
2865         * pt.c (check_for_bare_parameter_packs): Return bool indicated
2866         whether everything was okay. Fix indentation.
2867         (push_template_decl_real): Check for bare parameter packs in
2868         function parameters; where errors occur, mark the parameter types
2869         with ERROR_MARK_NODEs to avert ICEs.
2870         (coerce_template_parameter_pack): New.
2871         (coerce_template_parms): Moved parameter pack coercion into
2872         coerce_template_parameter_pack, and permit it anywhere in the
2873         template parameter list (not just at the end). Parameter and
2874         argument indices can vary (somewhat) separately now, so add
2875         PARM_IDX and ARG_IDX.
2876         (fn_type_unification): Don't set an argument pack as incomplete if
2877         no argument pack was deduced.
2878         (type_unification_real): If a type parameter is a parameter pack
2879         and has not otherwise been deduced, it will be deduced to an empty
2880         parameter pack.
2881         (more_specialized_fn): Use the actual lengths of the argument
2882         lists when comparing against expansions.
2883         * semantics.c (finish_member_declaration): If a field's type has
2884         bare parameter packs, error and set its type to ERROR_MARK_NODE.
2885
2886 2007-05-24  Danny Smith  <dannysmith@users.sourceforge.net>
2887
2888         PR target/27067
2889         * mangle.c (mangle_decl): Call targetm.mangle_decl_assembler_name.
2890
2891 2007-05-22  Ollie Wild  <aaw@google.com>
2892
2893         * name-lookup.c (ambiguous_decl): Adds check for hidden types.
2894         (unqualified_namespace_lookup): Adds check for hidden types.
2895
2896 2007-05-22  Ollie Wild  <aaw@google.com>
2897
2898         * decl.c (duplicate_decls): Verify namespace names are unique.
2899
2900 2007-05-21  Mark Mitchell  <mark@codesourcery.com>
2901
2902         * decl.c (cxx_maybe_build_cleanup): Handle
2903         __attribute__((cleanup)).
2904
2905 2007-05-19  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2906
2907         * cvt.c (cp_convert_and_check): Don't check warnings if the
2908         conversion failed.
2909
2910 2007-05-18  Geoffrey Keating  <geoffk@apple.com>
2911
2912         * mangle.c (write_real_cst): Use 'unsigned long' for %lx.
2913
2914 2007-05-14  Paolo Carlini  <pcarlini@suse.de>
2915
2916         PR c++/29928
2917         * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the
2918         type only if is a class type (5.2.8/4).
2919
2920 2007-05-14  Rafael Avila de Espindola  <espindola@google.com>
2921
2922         * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
2923         * decl.c (grokdeclarator): Use unsigned_type_for instead of
2924         c_common_unsigned_type.
2925
2926 2007-05-11  Silvius Rus  <rus@google.com>
2927
2928         * cp/typeck.c (build_indirect_ref): Add call to
2929         strict_aliasing_warning.
2930         (build_reinterpret_cast_1): Condition call to
2931         strict_aliasing_warning. 
2932
2933 2007-05-11  Jan Hubicka  <jh@suse.cz>
2934
2935         * semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
2936         * decl2.c (start_objects): ctors and dtors are no longer public.
2937         (cp_write_global_declarations): Do not call c_build_cdtor_fns.
2938         
2939 2007-05-07  Andrew Pinski  <andrew_pinski@playstation.sony.com>
2940
2941         * typeck.c (build_unary_op): Remove code that used to
2942         handle non lvalue increments/decrements.
2943
2944 2007-05-07  Mike Stump  <mrs@apple.com>
2945
2946         * parser.c (check_empty_body): Add.
2947         (cp_parser_iteration_statement): Add call to check_empty_body.
2948
2949 2007-05-05  Geoffrey Keating  <geoffk@apple.com>
2950
2951         PR 31775
2952         * mangle.c (write_mangled_name): Mangle static variable names.
2953         (write_unqualified_name): Use local-source-name for
2954         namespace-scope static variables.
2955
2956 2007-05-04  Dirk Mueller  <dmueller@suse.de>
2957
2958         * cp-tree.h (DECL_MAIN_P): only if -ffreestanding is
2959         not in effect.
2960
2961 2007-05-02  Seongbae Park  <seongbae.park@gmail.com>
2962
2963         PR c++/31663
2964         * decl2.c (constrain_class_visibility): 
2965         Use strip_pointer_or_array_types instead of strip_array_types.
2966
2967 2007-04-28  Andrew Pinski  <andrew_pinski@playstation.sony.com>
2968
2969         PR C++/30221
2970         * decl.c (reshape_init_r): Don't reshape the first element if it
2971         is a pointer to member function.
2972
2973 2007-04-27  Simon Baldwin  <simonb@google.com>
2974
2975         * decl.c (grokparms): Changed message format from %qD to %qE.
2976
2977 2007-04-27  Douglas Gregor  <doug.gregor@gmail.com>
2978
2979         * error.c (maybe_warn_variadic_templates): Variadic templates are
2980        now in C++0x, so only warn about them in C++98 mode.
2981         
2982 2007-04-26  Andrew Pinski  <andrew_pinski@playstation.sony.com>
2983
2984         PR C++/30016
2985         * typeck.c (build_reinterpret_cast_1): Only allow conversion to
2986         integeral types from vectors types.
2987
2988 2007-04-26  Jakub Jelinek  <jakub@redhat.com>
2989
2990         PR c++/31598
2991         * semantics.c (finish_omp_clauses): Don't create CP_OMP_CLAUSE_INFO
2992         for type dependent OMP_CLAUSE_DECLs.
2993
2994 2007-04-24  Mark Mitchell  <mark@codesourcery.com>
2995
2996         PR c++/31338
2997         * cp-tree.h (ARITHMETIC_TYPE): Include COMPLEX_TYPE.
2998         * typeck.c (type_after_usual_arithmetic_conversions): Adjust, as
2999         COMPLEX_TYPE is now an ARITHMETIC_TYPE.
3000         * init.c (build_zero_init): Adjust, as
3001         COMPLEX_TYPE is now a SCALAR_TYPE.
3002         * typeck2.c (digest_init): Allow brace-enclosed initializers for
3003         COMPLEX_TYPE, even though that is now a SCALAR_TYPE.
3004
3005 2007-04-25  Paolo Carlini  <pcarlini@suse.de>
3006
3007         * semantics.c (classtype_has_nothrow_copy_or_assign_p): Adjust
3008         per N2255; rename as classtype_has_nothrow_assign_or_copy_p.
3009         (trait_expr_value): Adjust.
3010
3011 2007-04-23  Simon Baldwin  <simonb@google.com>
3012
3013         * decl.c (grokparms): Added new error for duplicate function
3014         parameters names in function prototypes, to match gcc behavior.
3015
3016 2007-04-23  Jan Hubicka  <jh@suse.cz>
3017
3018         * cp/decl2.c (finish_objects): Do not call target constructor/destructor
3019         bits dirrectly.
3020
3021 2007-04-21  Andrew Pinski  <andrew_pinski@playstation.sony.com>
3022
3023         * cp-tree.h (lang_tree_node): Use GENERIC_NEXT
3024         instead of checking GIMPLE_STMT_P in chain_next.
3025
3026 2007-04-17  Mark Mitchell  <mark@codesourcery.com>
3027
3028         PR c++/31513
3029         * call.c (convert_for_arg_passing): Convert bitfields to their
3030         declared types.
3031
3032 2007-04-17  Simon Martin  <simartin@users.sourceforge.net>
3033
3034         PR c++/31517
3035         * pt.c (value_dependent_expression_p): Handle MODOP_EXPRs.
3036
3037 2007-04-16  Seongbae Park <seongbae.park@gmail.com>
3038
3039         PR c++/29365
3040         * cp/decl2.c (constrain_class_visibility):
3041         Do not warn about the use of anonymous namespace in the main input file.
3042
3043 2007-04-15  Mark Mitchell  <mark@codesourcery.com>
3044
3045         * cp-tree.h (current_template_parms): Fix typo in comment.
3046
3047 2007-04-15  Kazu Hirata  <kazu@codesourcery.com>
3048
3049         * cp-tree.h, error.c: Fix comment typos.
3050
3051 2007-04-13  Jason Merrill  <jason@redhat.com>
3052
3053         PR c++/31074
3054         * call.c (reference_binding): Add c_cast_p parm.  If true,
3055         add quals to TO as needed to make it reference-compatible.
3056
3057 2007-04-11  Jan Hubicka  <jh@suse.cz>
3058
3059         * cp/class.c (convert_to_base_statically): Fold produced tree; verify
3060         that we are not processing template_decl.
3061
3062 2007-04-09  Mark Mitchell  <mark@codesourcery.com>
3063
3064         PR c++/31449
3065         * class.c (build_base_path): Ensure that the converted pointer has
3066         the same cv-qualification as the input.
3067
3068 2007-04-09  Paolo Carlini  <pcarlini@suse.de>
3069
3070         * tree.c (cp_tree_equal): Deal with TRAIT_EXPR.
3071
3072 2007-04-08  Steven Bosscher  <steven@gcc.gnu.org>
3073
3074         * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS):
3075         Do not set it.
3076         (LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P): Do not set it.
3077         * tree.c (cp_add_pending_fn_decls): Remove.
3078         * cp-tree.h (cp_add_pending_fn_decls): Remove prototype.
3079
3080 2007-04-07  Daniel Berlin  <dberlin@dberlin.org>
3081
3082         Revert change removing staticp.
3083
3084 2007-04-06  Daniel Berlin  <dberlin@dberlin.org>
3085
3086         * cp-objcp-common.c (cxx_staticp): Remove.
3087         * cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
3088         * cp-tree.h (cxx_staticp):      
3089
3090 2007-04-04  Danny Smith  <dannysmith.users.sourceforge.net>
3091
3092         * class.c (check_for_override): Don't remove dllmport attribute
3093         of virtual methods.
3094
3095 2007-04-03  Jakub Jelinek  <jakub@redhat.com>
3096
3097         PR c++/30847
3098         * typeck.c (build_modify_expr): For COND_EXPR on LHS, if RHS has void
3099         type issue error and return early.
3100
3101 2007-03-30  Jason Merrill  <jason@redhat.com>
3102
3103         PR c++/31187
3104         * typeck.c (cp_type_readonly): New fn.
3105         * cp-tree.h: Declare it.
3106         * decl.c (start_decl): Set implicit DECL_THIS_STATIC here.
3107         (cp_finish_decl): Not here.
3108
3109 2007-03-31  Richard Guenther  <rguenther@suse.de>
3110
3111         * optimize.c (maybe_clone_body): Replace splay-tree usage by
3112         pointer-map.
3113
3114 2007-03-31  Douglas Gregor  <doug.gregor@gmail.com>
3115
3116         PR c++/31138
3117         PR c++/31140
3118         PR c++/31141
3119         * parser.c (declarator_can_be_parameter_pack): New.
3120         (cp_parser_template_parameter): Only parse the `...' if the
3121         declarator can be a parameter pack.
3122         (cp_parser_parameter_declaration): Ditto. Also, handle when TYPE
3123         is NULL.
3124         * pt.c (find_parameter_packs_r): Look into the bounds on integer
3125         types (they could be used as array bounds). 
3126         (check_for_bare_parameter_packs): Deal with TEMPLATE_PARM_INDEX.
3127         (tsubst_pack_expansion): Handle failure to expand parameter
3128         packs.
3129         
3130 2007-03-30  Paolo Carlini  <pcarlini@suse.de>
3131
3132         PR c++/26099
3133         * cp-tree.h (enum cp_trait_kind, struct tree_trait_expr,
3134         TRAIT_EXPR_TYPE1, TRAIT_EXPR_TYPE2, TRAIT_EXPR_KIND): Add.
3135         (enum cp_tree_node_structure_enum, union lang_tree_node): Update.
3136         (CLASS_TYPE_NON_UNION_P): Add.
3137         (struct lang_type_class): Add has_complex_dflt.
3138         (TYPE_HAS_COMPLEX_DFLT, TYPE_HAS_TRIVIAL_DFLT): Add.
3139         (locate_copy, locate_ctor, locate_dtor, finish_trait_expr): Declare.
3140         * cp-tree.def: Add TRAIT_EXPR.
3141         * cp-objcp-common.c (cp_tree_size): Add TRAIT_EXPR case.
3142         * lex.c (struct resword): Add __has_nothrow_assign,
3143         __has_nothrow_constructor, __has_nothrow_copy, __has_trivial_assign,
3144         __has_trivial_constructor, __has_trivial_copy,
3145         __has_trivial_destructor, __has_virtual_destructor, __is_abstract,
3146         __is_base_of, __is_class, __is_convertible_to, __is_empty, __is_enum,
3147         __is_pod, __is_polymorphic, __is_union.
3148         * parser.c (cp_parser_primary_expression): Deal with the new RIDs.
3149         (cp_parser_trait_expr): New.
3150         * semantics.c (finish_trait_expr, trait_expr_value
3151         classtype_has_nothrow_copy_or_assign_p): New.
3152         * method.c (locate_copy, locate_ctor, locate_dtor): Do not define
3153         as static.
3154         * decl.c (cp_tree_node_structure): Add TRAIT_EXPR.
3155         * class.c (check_bases, check_field_decl, check_bases_and_members):
3156         Deal with TYPE_HAS_COMPLEX_DFLT (t) too.
3157         * pt.c (uses_template_parms, tsubst_copy_and_build,
3158         value_dependent_expression_p, type_dependent_expression_p): Deal with
3159         TRAIT_EXPR.
3160         * tree.c (cp_walk_subtrees): Deal with TRAIT_EXPR.
3161
3162 2007-03-29  Richard Guenther  <rguenther@suse.de>
3163
3164         * tree.c (cp_walk_subtrees): Do not set input_location.
3165
3166 2007-03-28  Simon Martin  <simartin@users.sourceforge.net>
3167
3168         PR c++/29077
3169         * decl.c (grokfndecl): Properly setup decl if it is a constructor or a
3170         destructor.
3171
3172 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
3173
3174         * parser.c (struct cp_parser): Update comment for
3175         greater_than_is_operator_p.
3176         (cp_parser_primary_expression): In C++0x mode, a cast operator can
3177         be terminated with a `>>' token when !GREATER_THAN_IS_OPERATOR_P.
3178         (TOKEN_PRECEDENCE): In C++0x mode, `>>' is treated like `>' when
3179         !GREATER_THAN_IS_OPERATOR_P.
3180         (cp_parser_binary_expression): When -Wc++0x-compat, warn about
3181         `>>' operators that will become two `>' tokens in C++0x.
3182         (cp_parser_parameter_declaration): Treat `>>' like `>' in C++0x
3183         mode, allowing it to terminate default arguments.
3184         (cp_parser_enclosed_template_argument_list): In C++0x mode, treat
3185         `>>' like two consecutive `>' tokens.
3186         (cp_parser_skip_to_end_of_template_parameter_list): Ditto.
3187         (cp_parser_next_token_ends_template_argument_p): In C++0x, `>>'
3188         ends a template argument.
3189
3190 2007-03-28  Douglas Gregor  <doug.gregor@gmail.com>
3191
3192         * decl.c (redeclaration_error_message): Complain when redeclaring
3193         a friend function with default template arguments (C++0x mode only).
3194         * cp-tree.h (check_default_tmpl_args): Declare.
3195         * pt.c (check_default_tmpl_args): In C++0x mode, permit default
3196         template arguments in function templates. Add support for checking
3197         the default template arguments of friend templates.
3198         (push_template_decl_real): Fix call to check_default_tmpl_args.
3199         (type_unification_real): If a template parameter has not been
3200         deduced but provides a default template argument, substitute into
3201         that default template argument.
3202         * parser.c (cp_parser_init_declarator): When declaring (but not
3203         defining!) a function template in C++0x mode, check for default
3204         template arguments.
3205
3206 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
3207
3208         PR c++/29993
3209         * decl.c (grokdeclarator): Deal with cv-qualified function type
3210         typedefs in the same way for member and non-member functions.
3211
3212 2007-03-26  Dirk Mueller  <dmueller@suse.de>
3213
3214         * parser.c (cp_parser_member_declaration): Pedwarn
3215         about stray semicolons after member declarations.
3216
3217 2007-03-26  Paolo Carlini  <pcarlini@suse.de>
3218
3219         PR c++/30500
3220         * pt.c (instantiate_decl): Set in_system_header.
3221
3222 2007-03-22  Mark Mitchell  <mark@codesourcery.com>
3223
3224         * cp-tree.h (current_tempalte_parms): Improve documentation.
3225         * pt.c (current_template_args): Likewise.
3226
3227         PR c++/30863
3228         * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Do
3229         not consume tokens when failing.
3230
3231 2007-03-22  Jim Wilson  <wilson@specifix.com>
3232             Mark Mitchell  <mark@codesourcery.com>
3233
3234         PR c++/31273
3235         * call.c (standard_conversion): Use type_decays_to.  Keep FCODE
3236         consistent with FROM.
3237
3238 2007-03-22  Gabriel Dos Reis  <gdr@integrable-solutions.net>
3239
3240         * error.c (dump_expr): Handle dependent names that designate types.
3241         * cxx-pretty-print.c (pp_cxx_unqualified_id): Handle TYPENAME_TYPE.
3242
3243 2007-03-17  Kazu Hirata  <kazu@codesourcery.com>
3244
3245         * cp-tree.def, parser.c, pt.c: Fix comment typos.
3246
3247 2007-03-16  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3248
3249         * cvt.c (cp_convert_and_check) : Define.
3250         * cp-tree.h (cp_convert_and_check): Declare.
3251         * call.c (convert_conversion_warnings): Rename to
3252         conversion_null_warnings.  The warning for floating-point to
3253         integer is handled by convert_and_check in convert_like_real.
3254         (convert_like_real): convert_conversion_warnings was renamed as
3255         conversion_null_warnings.
3256         * typeck.c (build_binary_op): Use cp_convert_and_check to warn for
3257         overflow and changes of value during conversion.
3258
3259 2007-03-15  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3260
3261         PR c++/30891
3262         * parser.c (cp_parser_statement): If 'namespace' is found, this
3263         only can be a namespace alias definition, so parse it now.
3264         (cp_parser_namespace_alias_definition): if we find an open brace
3265         instead of '=', then this is actually a misplaced namespace
3266         definition.
3267         
3268 2007-03-15  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3269
3270         PR c++/24924
3271         * decl.c (cxx_init_decl_processing): Move command-line options
3272         processing to c-opts.c.
3273         
3274 2007-03-15  Douglas Gregor  <doug.gregor@gmail.com>
3275
3276         * ptree.c (cxx_print_type): Use formatting markup for integers
3277         when printing template parameter index/level/orig level.
3278         (cxx_print_xnode): Ditto.
3279         * cp-tree.h (TEMPLATE_PARM_PARAMETER_PACK): Use TREE_LANG_FLAG_0.
3280         (struct template_parm_index_s): Remove the PARAMETER_PACK member.
3281         Make INDEX, LEVEL, and ORIG_LEVEL integers instead of
3282         HOST_WIDE_INTs.
3283         (struct saved_scope): Make X_PROCESSING_TEMPLATE_DECL an int,
3284         rather than a HOST_WIDE_INT.
3285         Turn X_PROCESSING_EXPLICIT_INSTANTIATION, SKIP_EVALUATION, and
3286         NEED_POP_FUNCTION_CONTEXT into bool bitfields; reorder fields for
3287         better bit-packing.
3288         (struct language_function): Make RETURNS_VALUE, RETURNS_NULL,
3289         RETURNS_ABNORMALLY, IN_FUNCTION_TRY_HANDLER, and
3290         IN_BASE_INITIALIZER bool bitfields.
3291         (struct cp_declarator): Make KIND a 4-bit field. Make
3292         PARAMETER_PACK_P a bool bitfield just after KIND.
3293         * pt.c (uses_parameter_packs): Destroy the pointer set.
3294         (make_pack_expansion): Ditto.
3295         (check_for_bare_parameter_packs): Ditto.
3296         * name-lookup.c (push_to_top_level): Make need_pop a bool value.
3297         
3298 2007-03-14  Andrew Pinski  <andrew_pinski@playstation.sony.com>
3299
3300         PR c++/31165
3301         * call.c  (convert_default_arg): Instead of copying the node,
3302         unshare it.
3303
3304 2007-03-15  Dirk Mueller  <dmueller@suse.de>
3305
3306         PR c++/30860
3307         * call.c (convert_conversion_warnings): New..
3308         (convert_like_real): .. factored out from here.
3309         (convert_conversion_warnings): Add warning about
3310         false being converted to NULL in argument passing.
3311
3312 2007-03-14  Dirk Mueller  <dmueller@suse.de>
3313
3314         * cp/semantics.c (c_finish_if_stmt): Call empty_if_body_warning.
3315         (finish_do_body): Warn about empty body in do/while statement.
3316
3317 2007-03-14  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3318
3319         * class.c (warn_hidden): Add OPT_Woverloaded_virtual to warning.
3320         
3321 2007-03-14  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3322
3323         PR c/21438
3324         * typeck.c (build_binary_op): Call warn_for_div_zero instead of
3325         warning.
3326         
3327 2007-03-13  Alexandre Oliva  <aoliva@redhat.com>
3328
3329         * cp/repo.c (init_repo): Initialize random_seed saved options.
3330         (finish_repo): Adjust.
3331
3332 2007-03-13  Mark Mitchell  <mark@codesourcery.com>
3333
3334         PR bootstrap/30899
3335         * Make-lang.in (doc/g++.1): Use $< to specify the location from
3336         which to copy.
3337
3338 2007-03-12  Seongbae Park <seongbae.park@gmail.com>
3339
3340         * decl.c (compute_array_index_type): New warning flag warn_vla.
3341
3342 2007-03-12  Mark Mitchell  <mark@codesourcery.com>
3343
3344         PR c++/30108
3345         * call.c (convert_default_arg): Copy non-constant arguments.
3346
3347 2007-03-11  Mark Mitchell  <mark@codesourcery.com>
3348
3349         PR c++/31038
3350         * parser.c (cp_parser_postfix_expression): Disallow compound
3351         literals in constant expressions.
3352
3353         PR c++/30328
3354         * semantics.c (finish_typeof): Use unlowered_expr_type.
3355         
3356 2007-03-10  Mark Mitchell  <mark@codesourcery.com>
3357
3358         PR c++/30274
3359         * cp-tree.h (unlowered_expr_type): New function.
3360         * typeck.c (is_bitfield_expr_with_lowered_type): Handle
3361         COMPOUND_EXPR, MODIFY_EXPR, and SAVE_EXPR.
3362         (unlowered_expr_type): New function.
3363         (build_unary_op): Disallow predecrements of bool bitfields.
3364         * call.c (build_conditional_expr): Use unlowered_expr_type.
3365         * pt.c (type_unification_real): Likewise.
3366
3367 2007-03-09  Douglas Gregor  <doug.gregor@gmail.com>
3368
3369         PR c++/20599
3370         * typeck.c (check_return_expr): Check for bare parameter packs.
3371         (comptypes): Compare template parameter packs and
3372         type pack expansions.
3373         * decl.c (grokdeclarator): Deal with the declaration of function
3374         parameter packs.
3375         (grokparms): Verify that the (optional) function parameter pack is
3376         at the end of the parameter list.
3377         (xref_basetypes): Handle pack expansions in the base class.
3378         (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT.
3379         * cp-tree.def (TYPE_ARGUMENT_PACK): New.
3380         (NONTYPE_ARGUMENT_PACK): New.
3381         (TYPE_PACK_EXPANSION): New.
3382         (EXPR_PACK_EXPANSION): New.
3383         (ARGUMENT_PACK_SELECT): New.
3384         * cp-objcp-common.c (cp_tree_size): Compute size of
3385         (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and
3386         ARGUMENT_PACK_SELECT.
3387         * error.c (dump_template_argument): Print template argument packs.
3388         (dump_template_argument_list): Ditto.
3389         (dump_template_parameter): Dump `...' for template type parameter
3390         packs.
3391         (dump_type): Dump TYPE_PACK_EXPANSION nodes.
3392         (dump_parameters): Print function parameter packs.
3393         (dump_template_parms): Print template argument packs.
3394         (dump_expr): Dump EXPR_PACK_EXPANSION nodes.
3395         (maybe_warn_variadic_templates): New.
3396         * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION.
3397         * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
3398         NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
3399         CAST_EXPR. 
3400         * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION.
3401         (write_template_arg): Write argument packs as separate arguments.
3402         * cp-tree.h (struct template_parm_index_s): Add flag that
3403         indicates that the template parameter is actually a parameter
3404         pack.
3405         (struct tree_argument_pack_select): New.
3406         (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT.
3407         (union lang_tree_node): Add argument_pack_select.
3408         (FUNCTION_PARAMETER_PACK_P): New.
3409         (PACK_EXPANSION_P): New.
3410         (PACK_EXPANSION_PATTERN): New.
3411         (SET_PACK_EXPANSION_PATTERN): New.
3412         (PACK_EXPANSION_PARAMETER_PACKS): New.
3413         (ARGUMENT_PACK_P): New.
3414         (ARGUMENT_PACK_ARGS): New.
3415         (SET_ARGUMENT_PACK_ARGS): New.
3416         (ARGUMENT_PACK_INCOMPLETE_P): New.
3417         (ARGUMENT_PACK_EXPLICIT_ARGS): New.
3418         (TEMPLATE_PARM_PARAMETER_PACK): New.
3419         (TEMPLATE_TYPE_PARAMETER_PACK): New.
3420         (ARGUMENT_PACK_SELECT_FROM_PACK): New.
3421         (ARGUMENT_PACK_SELECT_INDEX): New.
3422         (ARGUMENT_PACK_SELECT_ARG): New.
3423         (struct cp_declarator): Add parameter_pack_p flag.
3424         (maybe_warn_variadic_templates): Declare.
3425         (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to
3426         indicate a template parameter pack. 
3427         (uses_parameter_packs): Declare.
3428         (template_parameter_pack_p): Declare.
3429         (template_parms_variadic_p): Declare.
3430         (make_pack_expansion): Declare.
3431         (check_for_bare_parameter_packs): Declare.
3432         * cxx-pretty-print.c (pp_cxx_unary_expression): Print
3433         sizeof... expressions. 
3434         (pp_cxx_expression): Print pack expansions and non-type argument
3435         packs.
3436         (pp_cxx_exception_specification): Print pack expansions. 
3437         (pp_cxx_direct_declarator): Print ellipsis for parameter packs.
3438         (pp_cxx_ctor_initializer): Print pack expansions.
3439         (pp_cxx_type_id): Print pack expansions.
3440         (pp_cxx_template_argument_list): Print argument packs.
3441         (pp_cxx_template_parameter): Print ellipsis for template parameter
3442         packs.
3443         * pt.c (comp_template_parms): Compare template parameter packs.
3444         (template_parameter_pack_p): New.
3445         (template_parms_variadic_p): New.
3446         (template_args_variadic_p): New.
3447         (make_ith_pack_parameter_name): New.
3448         (struct find_parameter_pack_data): New.
3449         (find_parameter_packs_r): New.
3450         (uses_parameter_packs): New.
3451         (make_pack_expansion): New.
3452         (check_for_bare_parameter_packs): New.
3453         (expand_template_argument_pack): New.
3454         (reduce_template_parm_level): Propagate parameter pack flag.
3455         (process_template_parm): Add is_parameter_pack parameter to state
3456         when the parameter is actually a parameter pack. Create template
3457         parameter packs when is_parameter_pack is true.
3458         (current_template_args): The argument for a template parameter
3459         pack is an argument pack containing a single pack expansion.
3460         (process_partial_specialization): When checking that non-type
3461         argument expressions do not involve template parameters, loop over
3462         the arguments in argument packs separately.
3463         (push_template_decl_real): Check that the type of the declaration
3464         does not have any bare parameter packs. Check that primary
3465         templates have no more than one parameter pack, and that it comes
3466         at the end of the template parameter list.
3467         (convert_template_argument): Handle coercions for pack expansion
3468         expressions by coercing the pattern then rebuilding the expansion.
3469         (coerce_template_parms): When coercing the arguments for a
3470         variadic template, pack "extra" arguments into an argument pack.
3471         (coerce_template_template_parms): Cannot coerce between parameter
3472         packs and non-pack parameters.
3473         (template_args_equal): Compare PACK_EXPANSION_P expressions.
3474         (comp_template_args): Expand all template arguments packs before
3475         comparing template argument lists.
3476         (mangle_class_name_for_template): Make argument packs as separate
3477         template arguments.
3478         (for_each_template_parm_r): No need to handle BASELINK. 
3479         (instantiate_class_template): Handle pack expansions in the base
3480         class list.
3481         (tsubst_pack_expansion): New.
3482         (tsubst_template_args): Handle substitutions of argument packs and
3483         pack expansion into template argument lists.
3484         (tsubst_decl): Expand function parameter packs into separate
3485         function parameters.
3486         (tsubst_arg_types): Expand a type pack expansion into separate
3487         argument types.
3488         (tsubst_exception_specification): Handle pack expansions in
3489         exception specifiers.
3490         (tsubst): See through ARGUMENT_PACK_SELECT arguments when 
3491         replacing a template parameter with its argument. If we encounter
3492         a substitution for an argument pack, just return the parameter
3493         itself. 
3494         (tsubst_copy): sizeof(X...) returns the number of elements in
3495         parameter pack X.  See through ARGUMENT_PACK_SELECT when the
3496         PARM_DECL is a parameter pack.
3497         (tsubst_expr): Expression pack expansions and argument packs
3498         cannot show up here; they will all be handled through function
3499         calls, sizeof, and template argument lists.
3500         (tsubst_copy_and_build): sizeof(X...) returns the number of
3501         elements in parameter pack X.  Handle pack expansions in TREE_LIST
3502         and CONSTRUCTOR nodes.
3503         (fn_type_unification): Handle "incomplete" explicit template
3504         argument lists that specify some of the arguments for a template
3505         parameter pack.
3506         (type_unification_real): Unify arguments against pack expansions.
3507         (template_parm_level_and_index): New, helper function.
3508         (unify_pack_expansion): New.
3509         (unify): Unify argument packs on an argument-by-argument basis,
3510         handling variadic argument packs as well.
3511         (more_specialized_fn): Handle unification of function parameter
3512         packs. All things being equal, prefer non-variadic function
3513         templates to variadic function templates.
3514         (more_specialized_class): Prefer the variadic class template
3515         partial specialization that binds fewer arguments to a parameter
3516         pack.
3517         (regenerate_decl_from_template): Expand function parameter packs
3518         into separate parameters.
3519         (instantiate_decl): Ditto.
3520         (tsubst_initializer_list): Handle pack expansions for base-class
3521         initializers.
3522         (dependent_type_p_r): Determine dependent types in argument packs
3523         and pack expansions.
3524         (value_dependent_expression_p): Determine value-dependence of
3525         non-type argument packs.
3526         (dependent_template_arg_p): Handle argument packs.
3527         * semantics.c (finish_cond): Check for bare parameter packs.
3528         (finish_expr_stmt): Ditto.
3529         (finish_for_expr): Ditto.
3530         (finish_switch_cond): Ditto.
3531         (finish_mem_initializers): Ditto.
3532         * name-lookup.c (arg_assoc_type): Handle pack expansions and
3533         argument packs.
3534         * decl2.c (cp_build_parm_decl): Mark function parameter packs.
3535         * parser.c (make_declarator): Declarator is not an expansion.
3536         (make_pointer_declarator): Transfer parameter pack flag to outer
3537         declarator.
3538         (make_reference_declarator): Ditto.
3539         (make_ptrmem_declarator): Ditto.
3540         (make_call_declarator): Ditto.
3541         (make_array_declarator): Ditto.
3542         (cp_parser_postfix_expression): Allow pack expansion expressions
3543         in the argument list for a call expression.
3544         (cp_parser_parenthesized_expression_list): Add new parameter
3545         ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand
3546         into separate arguments."
3547         (cp_parser_new_placement): Allow pack expansion expressions.
3548         (cp_parser_new_initializer): Ditto.
3549         (cp_parser_mem_initializer_list): Allow ellipsis to create a
3550         base-class initializer expansion.
3551         (cp_parser_mem_initializer): Ditto.
3552         (cp_parser_template_parameter_list): Keep track of whether the
3553         template parameter is a template parameter pack.
3554         (cp_parser_template_parameter): Parse the ellipsis to indicate a
3555         template parameter pack.
3556         (cp_parser_type_parameter): Ditto.
3557         (cp_parser_template_argument_list): Parse the ellipsis to indicate
3558         a pack expansion.
3559         (cp_parser_direct_declarator): Parse the ellipsis to indicate that
3560         this declarator is a parameter pack.
3561         (cp_parser_parameter_declaration): The ellipsis does not end the
3562         parameter declaration, because it might be a parameter pack. Parse
3563         the ellipsis to indicate a parameter pack.
3564         (cp_parser_initializer): Allow pack expansions.
3565         (cp_parser_initializer_list): Allow ellipsis to create an
3566         initializer expansion.
3567         (cp_parser_base_clause): Allow ellipsis to create a base specifier
3568         expansion.
3569         (cp_parser_type_id_list): Allow ellipsis to create an exception
3570         specifier expansion.
3571         (cp_parser_attribute_list): Don't allow pack expansions.
3572         (cp_parser_functional_cast): Allow pack expansions.
3573         (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to
3574         compute the length of a parameter pack.
3575         (cp_parser_next_token_ends_template_argument_p): An ellipsis can
3576         end a template argument.
3577         * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
3578         NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
3579         CAST_EXPR. 
3580
3581 2007-03-09  Dirk Mueller  <dmueller@suse.de>
3582
3583         * cp/call.c (build_new_op): Call warn_logical_operator.
3584
3585 2007-03-08  Volker Reichelt  <reichelt@netcologne.de>
3586
3587         PR c++/30852
3588         * semantics.c (finish_offsetof): Handle COMPOUND_EXPR.
3589
3590         PR c++/30534
3591         * pt.c (any_template_arguments_need_structural_equality_p):
3592         Robustify.
3593
3594 2007-03-08  Alexandre Oliva  <aoliva@redhat.com>
3595
3596         * decl.c (grokdeclarator): Disable warnings for anonymous
3597         bitfields.
3598
3599 2007-03-05  Volker Reichelt  <reichelt@netcologne.de>
3600
3601         * typeck2.c (readonly_error): Always emit a hard error.
3602         Remove last argument.
3603         * cp-tree.h (readonly_error): Adjust prototype.
3604         * semantics.c (finish_asm_stmt): Adjust call to readonly_error.
3605         * typeck.c (build_unary_op): Likewise.
3606         (build_modify_expr): Likewise.
3607
3608 2007-03-04  Simon Martin  <simartin@users.sourceforge.net>
3609
3610         PR c++/30895
3611         * tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees.
3612
3613 2007-03-03  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3614
3615         PR c++/15787
3616         * parser.c (struct cp_parser): New IN_IF_STMT.
3617         (cp_parser_statement_seq_opt): Handle an unexpected 'else',
3618         returning if parsing the body of an 'if' statement or issuing an
3619         error and continuing.
3620         (cp_parser_selection_statement): Set IN_IF_STMT bit when parsing
3621         body of 'if'.
3622         (cp_parser_jump_statement): Mask new IN_IF_STMT bit.
3623         
3624 2007-03-02  Simon Martin  <simartin@users.sourceforge.net>
3625
3626         PR c++/28253
3627         * class.c (update_vtable_entry_for_fn): Properly handle invalid overriders
3628         for thunks.
3629
3630 2007-03-02  Geoffrey Keating  <geoffk@apple.com>
3631
3632         * g++spec.c (lang_specific_driver): Add -lstdc++ when compiling
3633         Objective-C++.  Don't exit early if -shared-libgcc needs to be
3634         added.
3635
3636 2007-03-02  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3637
3638         * typeck.c (common_base_type): Delete unused function.
3639         
3640 2007-03-01  Brooks Moses  <brooks.moses@codesourcery.com>
3641
3642         * Make-lang.in: Add dummy lang.install-pdf target.
3643
3644 2007-03-01  Simon Baldwin <simonb@google.com>
3645
3646         PR c++/23689
3647         * decl.c (check_tag_decl): Added new warning for typedef ignored
3648         when it precedes an otherwise valid non-typedef declaration.
3649
3650 2007-02-28  Sandra Loosemore  <sandra@codesourcery.com>
3651
3652         * typeck.c (build_function_call): Store converted arguments
3653         in a stack-allocated array instead of building a list.
3654         (convert_arguments): Store arguments in the array passed in as an
3655         argument, and return the actual number of arguments.
3656         * call.c (build_call): Delete, and replace with...
3657         (build_call_n, build_call_a): New.
3658         (build_op_delete_call): Rewrite to avoid constructing argument lists.
3659         (build_over_call): Store converted arguments in a stack-allocated
3660         array instead of building a list.
3661         (build_cxx_call): Pass arguments in an array instead of as a list.
3662         (build_java_interface_fn_ref): Rewrite to avoid constructing
3663         argument lists.
3664         * tree.h: Update declarations to reflect above changes.
3665         * method.c (use_thunk): Use a stack-allocated array to hold
3666         the arguments instead of a list.
3667         * rtti.c (throw_bad_cast): Update call to cxx_call.
3668         (throw_bad_typeid): Likewise.
3669         (build_dynamic_cast_1): Likewise.
3670         * init.c (build_builtin_delete_call): Use build_call_n.
3671         * decl.c (expand_static_init): Likewise.
3672         * except.c (cp_protect_cleanup_actions): Likewise.
3673         * cp-gimplify.c (genericize_eh_spec_block): Likewise.
3674         (gimplify_must_not_throw_expr): Likewise.
3675         (cxx_omp_apply_fn): Use build_call_a.
3676
3677 2007-02-26  Mark Mitchell  <mark@codesourcery.com>
3678
3679         * semantics.c (expand_or_defer_fn): Call c_record_cdtor_fn.
3680         * decl2.c (cp_write_gloabl_declarations): Call c_build_cdtor_fns.
3681
3682 2007-02-25  Mark Mitchell  <mark@codesourcery.com>
3683
3684         * cp-tree.h (static_ctors): Remove.
3685         * cp-tree.h (static_dtors): Likewise.
3686         * cp-objcp-common.c (decl_shadowed_for_var_lookup): Adjust for
3687         refactoring of tree_map hierarchy.
3688         (decl_shadowed_for_var_insert): Likewise.
3689         * semantics.c (expand_body): Use c_expand_body.
3690         (expand_or_defer_fn): Don't update static_ctors or static_dtors.
3691         * decl2.c (static_ctors): Remove.
3692         (static_dtors): Likewise.
3693         (generate_ctor_or_dtor_function): Pass NULL_TREE to
3694         objc_generate_static_init_call.  Do not call static_[cd]tors.
3695         (generate_ctor_and_dtor_functions_for_priority): Do not check for
3696         static_[cd]tors.
3697         (cp_write_global_declarations): Likewise.
3698
3699 2007-02-23  Richard Guenther  <rguenther@suse.de>
3700
3701         * class.c (note_name_declared_in_class): Make declaration
3702         changes meaning a pedwarn.
3703
3704 2007-02-22  Michael Matz  <matz@suse.de>
3705
3706         PR c++/29433
3707         * cp-tree.h (TFF_UNQUALIFIED_NAME): New formatting flag.
3708         * error.c (dump_aggr_type, dump_simple_decl, dump_decl,
3709         dump_function_decl): Guard emitting outer scopes by new flag.
3710         * cp-lang.c (cxx_dwarf_name): New function.
3711         (LANG_HOOKS_DWARF_NAME): Define to cxx_dwarf_name.
3712         * pt.c (classtype_mangled_name, mangle_class_name_for_template):
3713         Remove functions.
3714         (push_template_decl_real, lookup_template_class): Remove calls
3715         to above functions.
3716
3717 2007-02-19  Mark Mitchell  <mark@codesourcery.com>
3718
3719         * call.c (build_new_method_call): Ensure that explicit calls of
3720         destructors have type "void".
3721
3722 2007-02-19  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3723
3724         * typeck.c (build_binary_op): Replace -Wstring-literal-comparison
3725         and -Walways-true with -Waddress.
3726         * cvt.c (convert_to_void): Replace unconditional warning with
3727         -Waddress.
3728
3729 2007-02-18  Kazu Hirata  <kazu@codesourcery.com>
3730
3731         * decl.c, tree.c: Fix comment typos.
3732
3733 2007-02-15  Andrew Pinski  <andrew_pinski@playstation.sony.com>
3734
3735         PR C++/30158
3736         * semantics.c (finish_stmt_expr_expr): Set TREE_TYPE of the 
3737         statement expression if we had an error mark node.
3738
3739 2007-02-15  Sandra Loosemore  <sandra@codesourcery.com>
3740             Brooks Moses  <brooks.moses@codesourcery.com>
3741             Lee Millward  <lee.millward@codesourcery.com>
3742
3743         * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
3744         Change class to tcc_vl_exp.
3745
3746         * call.c (build_call): Use build_call_list instead 
3747         of build3. 
3748         (build_over_call): Likewise.
3749         (build_new_method_call): Use build_min_non_dep_call_list 
3750         instead of build_min_non_dep.
3751
3752         * error.c (dump_call_expr_args): New function.
3753         (dump_aggr_init_expr_args): New function.
3754         (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them. 
3755         Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
3756
3757         * cvt.c (convert_to_void): Use build_call_array instead
3758         of build3; use new AGGR_INIT_EXPR accessor macros.
3759
3760         * mangle.c (write_expression): Use TREE_OPERAND_LENGTH
3761         instead of TREE_CODE_LENGTH.
3762
3763         * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
3764         AGGR_INIT_EXPR accessor macros.
3765
3766         * cp-gimplify.c (cp_gimplify_init_expr): Use 
3767         AGGR_INIT_EXPR_SLOT to set the slot operand.
3768
3769         * cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
3770         (AGGR_INIT_EXPR_SLOT): New macro.
3771         (AGGR_INIT_EXPR_ARG): New macro.
3772         (aggr_init_expr_nargs): New macro.
3773         (AGGR_INIT_EXPR_ARGP): New macro.
3774         (aggr_init_expr_arg_iterator): New.
3775         (init_aggr_init_expr_arg_iterator): New.
3776         (next_aggr_init_expr_arg): New.
3777         (first_aggr_init_expr_arg): New.
3778         (more_aggr_init_expr_args_p): New.
3779         (FOR_EACH_AGGR_INIT_EXPR_ARG): New.
3780         (stabilize_aggr_init): New declaration.
3781         (build_min_non_dep_call_list): Likewise.
3782
3783         * tree.c (process_aggr_init_operands): New function.
3784         (build_aggr_init_array) New function.
3785         (build_cplus_new): Update to use new CALL_EXPR and
3786         AGGR_INIT_EXPR accessor macros. Replace use of build3 with
3787         build_aggr_init_array.
3788         (build_min_non_dep_call_list) New function.
3789         (build_min_nt): Assert input code parameter is not a variable
3790         length expression class.
3791         (build_min, build_min_non_dep): Likewise.
3792         (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
3793         to check for equality instead of recursing. Handle tcc_vl_exp
3794         tree code classes.
3795         (stabilize_call): Update to only handle CALL_EXPRs, not 
3796         AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
3797         (stabilize_aggr_init): New function.
3798         (stabilize_init): Use it.
3799
3800         * cxx-pretty-print.c (pp_cxx_postfix_expression)
3801         <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
3802         AGGR_INIT_EXPR accessor macros and argument iterators.
3803         
3804         * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
3805         build_vl_exp. Iterate through the operands, recursively 
3806         processing each one.
3807         (tsubst_copy_and_build) <CALL_EXPR>: Update to use new
3808         CALL_EXPR accessor macros.
3809         (value_dependent_expression_p) <default>: Handle tcc_vl_exp
3810         tree code classes. Use TREE_OPERAND_LENGTH instead of 
3811         TREE_CODE_LENGTH.
3812
3813         * semantics.c (finish_call_expr): Use build_nt_call_list
3814         instead of build_nt.
3815         (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR 
3816         accessor macros. Use build_call_array to construct the 
3817         CALL_EXPR node instead of build3
3818         
3819         * decl2.c (build_offset_ref_call_from_tree): Use 
3820         build_nt_call_list and build_min_non_dep_call_list instead
3821         of build_min_nt and build_min_non_dep.
3822
3823         * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
3824         Use build_nt_call_list instead of build_min_nt.
3825
3826 2007-02-15  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3827
3828         PR c++/28943
3829         * call.c (build_conditional_expr): Improve error message.
3830         
3831 2007-02-13  Dirk Mueller  <dmueller@suse.de>
3832
3833         * friend.c (do_friend): Annotate warning about friend
3834         declarations in templates with OPT_Wnon_template_friend.
3835         Convert informal message from warning() to inform().
3836
3837 2007-02-12  Simon Martin  <simartin@users.sourceforge.net>
3838             Mark Mitchell  <mark@codesourcery.com>
3839
3840         PR c++/14622
3841         * pt.c (do_decl_instantiation): Detect type mismatches in explicit
3842         instantiations for variables.
3843
3844 2007-02-12  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3845
3846         PR middle-end/7651
3847         * cp-gimplify.c (gimplify_expr_stmt): Don't check extra_warnings.
3848         Check warn_unused_value just once.
3849
3850 2007-02-11  Mark Mitchell  <mark@codesourcery.com>
3851
3852         PR c++/26988
3853         * pt.c (determine_specialization): Use skip_artificial_parms_for.
3854         (fn_type_unificiation): Likewise.
3855         (get_bindings): Likewise.
3856
3857 o2007-02-06  Mark Mitchell  <mark@codesourcery.com>
3858
3859         PR target/29487
3860         * decl.c (finish_function): Use DECL_REPLACEABLE.
3861         * tree.c (cp_cannot_inline_tree_fn): Likewise.
3862
3863 2007-02-10  Gabriel Dos Reis  <gdr@integrable-solutions.net>
3864
3865         * parser.c (cp_parser_primary_expression): Reformat overly long lines.
3866
3867 2007-02-10  Richard Henderson  <rth@redhat.com>, Jakub Jelinek  <jakub@redhat.com>
3868
3869         * decl.c (grokvardecl): Don't error if !have_tls.
3870         (grokdeclarator): Likewise.
3871         * parser.c (cp_parser_omp_threadprivate): Likewise.
3872
3873 2007-02-07  Jakub Jelinek  <jakub@redhat.com>
3874
3875         PR c++/30703
3876         * cp-gimplify.c (cp_genericize_r): Don't dereference invisiref
3877         parameters and result decls in omp clauses.
3878         (cxx_omp_privatize_by_reference): Pass also invisiref PARM_DECLs
3879         by reference.
3880
3881 2007-02-05  Dirk Mueller  <dmueller@suse.de>
3882
3883         PR bootstrap/30510
3884         * parser.c (cp_parser_class_specifier): Always initialize bases.
3885
3886 2007-02-05  Paolo Bonzini  <bonzini@gnu.org>
3887
3888         * cp-tree.h (OMP_ATOMIC_CODE): Delete.
3889         (OMP_ATOMIC_DEPENDENT_P): Rewrite.
3890         * pt.c (tsubst_expr): Adjust for new format of dependent OMP_ATOMIC
3891         expressions.
3892         * semantics.c (finish_omp_atomic): Store a whole expression node
3893         in operand 1, and integer_zero_node in operand 0, for dependent
3894         OMP_ATOMIC.  Rewrite to make flow easier to understand.
3895
3896 2007-02-03  Gabriel Dos Reis  <gdr@integrable-solutions.net>
3897
3898         * decl.c (grokdeclarator): Use OPT_Wreturn_type instead of 0.
3899
3900 2007-02-04  Kazu Hirata  <kazu@codesourcery.com>
3901
3902         * class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
3903         parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
3904
3905 2007-02-03  Douglas Gregor  <doug.gregor@gmail.com>
3906
3907        * parser.c (cp_lexer_get_preprocessor_token): Attach the C++0x
3908        keyword warning to -Wc++0x-compat.
3909         
3910 2007-02-03  Gabriel Dos Reis  <gdr@integrable-solutions.net>
3911
3912         * decl.c (grokdeclarator): Update documentation.
3913
3914 2007-02-02  Jakub Jelinek  <jakub@redhat.com>
3915
3916         PR c++/30536
3917         * decl.c (grokdeclarator): If __thread is used together with
3918         a storage class other than extern and static, clear thread_p
3919         after issuing diagnostics and fall through to checking the
3920         storage class.
3921
3922 2007-01-30  Roger Sayle  <roger@eyesopen.com>
3923
3924         * error.c (dump_type_suffix): Avoid use of cp_build_binary_op when
3925         calculating the size of an array (to avoid recursive errors).
3926
3927 2007-01-30  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3928
3929         PR c++/24745
3930         * typeck.c (build_binary_op): Fix logic for warning. Move warning
3931         to -Wpointer-arith.
3932         * call.c (convert_like_real): Don't warn when converting to
3933         boolean type.
3934         
3935 2007-01-29  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3936
3937         * decl.c (pop_label): Replace warning with call to
3938         warn_for_unused_label.
3939
3940 2007-01-28  Andrew Pinski  <pinskia@gmail.com>
3941
3942         PR C++/28988
3943         * semantics.c (finish_pseudo_destructor_expr): Check the
3944         destrutor name by calling check_dtor_name.
3945
3946 2007-01-24  Douglas Gregor  <dgregor@osl.iu.edu>
3947
3948         * lex.c (D_CPP0X): Rename.
3949         (D_CXX0X): To this.
3950         (reswords): D_CPP0X -> D_CXX0X.
3951         (init_reswords): Ditto.
3952         * parser.c (cp_lexer_get_preprocessor_token): Warn about the use
3953         of C++0x keywords as identifiers.
3954
3955 2007-01-23  Simon Martin  <simartin@users.sourceforge.net>
3956
3957         PR c++/27492
3958         * decl.c (duplicate_decls): Don't reset DECL_INVALID_OVERRIDER_P for
3959         function decls.
3960
3961 2007-01-23  Ian Lance Taylor  <iant@google.com>
3962
3963         * typeck.c (convert_for_assignment): Only warn about a = b = c
3964         when converting to bool.
3965
3966 2007-01-23  Roger Sayle  <roger@eyesopen.com>
3967
3968         * call.c (null_ptr_cst_p): Replace use of TREE_CONSTANT_OVERFLOW with
3969         TREE_OVERFLOW.
3970         * typeck.c (ignore_overflows): Remove the remaining uses of
3971         TREE_CONSTANT_OVERFLOW.
3972
3973 2007-01-20  Jan Hubicka  <jh@suse.cz>
3974
3975         * decl2.c (start_objects, start_static_storage_duration_function):
3976         Do not make the functions uninlinable.
3977
3978 2007-01-17  Ian Lance Taylor  <iant@google.com>
3979
3980         * class.c (add_method): Call VEC_reserve_exact rather than passing
3981         a negative size to VEC_reserve.
3982
3983 2007-01-11  Simon Martin  <simartin@users.sourceforge.net>
3984
3985         PR c++/29573
3986         * tree.c (cp_tree_equal): Properly handle MODOP_EXPR trees.
3987
3988 2007-01-10  Mark Mitchell  <mark@codesourcery.com>
3989
3990         PR c++/28999
3991         * decl.c (make_typename_type): If the qualified name is not a
3992         type, issue an error.
3993         * parser.c (cp_parser_elaborated_type_specifier): Fix comment
3994         formatting.
3995
3996 2007-01-08  Geoffrey Keating  <geoffk@apple.com>
3997
3998         * rtti.c: Include target.h.
3999         (emit_support_tinfos): If ! targetm.cxx.library_rtti_comdat (),
4000         don't emit typeinfo for fundamental types as weak.
4001         * Make-lang.in (cp/rtti.o): Update and correct dependencies.
4002
4003 2007-01-08  Richard Guenther  <rguenther@suse.de>
4004
4005         * cvt.c (cp_convert_to_pointer): Use build_int_cst_type.
4006
4007 2007-01-08  Mark Shinwell  <shinwell@codesourcery.com>
4008
4009         * call.c (standard_conversion): Pass flag to
4010         vector_types_convertible_p to disallow emission of note.
4011         * typeck.c (convert_for_assignment): Pass flag to
4012         vector_types_convertible_p to allow emission of note.
4013         (ptr_reasonably_similar): Pass flag to vector_types_convertible_p
4014         to disallow emission of note.
4015
4016 2007-01-07  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
4017
4018         PR c++/28986
4019         * typeck.c (build_binary_op): Call overflow_warning if
4020         TREE_OVERFLOW_P is true for the result and not for any of the
4021         operands.
4022         
4023 2007-01-06  Lee Millward  <lee.millward@codesourcery.com>
4024
4025        PR c++/19439
4026        * class.c (add_method): Don't wait until template
4027        instantiation time to complain about duplicate methods.
4028         
4029 2007-01-05  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
4030
4031         PR c/19978
4032         * semantics.c (finish_unary_op_expr): Warn only if result
4033         overflowed and operands did not.
4034
4035 2007-01-05  Ian Lance Taylor  <iant@google.com>
4036
4037         * typeck.c (build_binary_op): Warn about comparing a non-weak
4038         address to NULL.
4039
4040 2007-01-05  Douglas Gregor  <doug.gregor@gmail.com>
4041
4042         * pt.c (tsubst): Propagate the need for structural equality checks
4043         when reducing the level of template parameters.
4044
4045 2007-01-03  Kazu Hirata  <kazu@codesourcery.com>
4046
4047         * pt.c: Fix a comment typo.
4048
4049 2007-01-02  Ian Lance Taylor  <iant@google.com>
4050
4051         * semantics.c (maybe_convert_cond): Optionally warn when using an
4052         assignment as a condition.
4053         * typeck.c (convert_for_assignment): Optionally warn about
4054         assigning the result of an assignment to a bool.
4055
4056 2007-01-02  Douglas Gregor  <doug.gregor@gmail.com>
4057
4058         * pt.c (canonical_template_parms): Correct typo in comment.
4059         
4060 2007-01-02  Douglas Gregor  <doug.gregor@gmail.com>
4061
4062         * typeck.c (structural_comptypes): Renamed from "comptypes".
4063         (comptypes): Use canonical type information to perform fast type
4064         comparison. When VERIFY_CANONICAL_TYPES, verify that the
4065         canonical type comparison returns the same results as we would see
4066         from the current, structural check. Support COMPARE_STRUCTURAL
4067         when we need structural checks.
4068         * decl.c (typename_compare): Fix comment.
4069         (build_typename_type): TYPENAME_TYPE nodes require structural
4070         equality checks, because they resolve different based on the
4071         current class type.
4072         (make_unbound_class_template): UNBOUND_CLASS_TEMPLATE nodes
4073         require structural equality checks (for now).
4074         (build_ptrmemfunc_type): Build the canonical pointer to member
4075         function type.
4076         (compute_array_index_type): Whenever we build a new index type
4077         to represent the size of an array in a template, we need to mark
4078         this index type as requiring structural equality. This goes for
4079         arrays with value-dependent sizes with the current ABI, or all
4080         arrays with ABI-1.
4081         * tree.c (cplus_array_hash): New.
4082         (struct cplus_array_info): New.
4083         (cplus_array_compare): New.
4084         (cplus_array_htab): New.
4085         (build_cplus_array_type_1): Use a hash table to cache the array
4086         types we build. Build the canonical array type for each array
4087         type.
4088         (cp_build_qualified_type_real): When building a cv-qualified array
4089         type, use the hash table of array types and build canonical array
4090         types as necessary.
4091         (bind_template_template_parm): BOUND_TEMPLATE_TEMPLATE_PARM nodes
4092         use structural equality (for now).
4093         * cp-tree.h (COMPARE_STRUCTURAL): New.
4094         * pt.c (canonical_template_parms): New.
4095         (canonical_type_parameter): New.
4096         (process_template_parm): Find the canonical type parameter.
4097         (lookup_template_class): When we have named the primary template
4098         type, set the canonical type for our template class to the primary
4099         template type. If any of the template arguments need structural
4100         equality checks, the template class needs structural equality
4101         checks.
4102         (tsubst): When reducing the level of a template template
4103         parameter, we require structural equality tests for the resulting
4104         parameter because its template parameters have not had their types
4105         canonicalized. When reducing a template type parameter, find the
4106         canonical reduced type parameter.
4107         (any_template_arguments_need_structural_equality_p): New.
4108