OSDN Git Service

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