OSDN Git Service

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