OSDN Git Service

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