Reverted commit 143546 related to PR c++/26693
[platform/upstream/gcc.git] / gcc / cp / ChangeLog
1 2009-01-22  Dodji Seketeli  <dodji@redhat.com>
2
3         PR c++/38930
4         * decl2.c (grokfield): Reverting changes of PR c++/26693
5         (save_template_attributes): Likewise.
6         * decl.c (grokdeclarator): Likewise.
7         * name-lookup.c (pushdecl_maybe_friend): Likewise.
8         * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): Likewise.
9         (append_type_to_template_for_access_check): Likewise.
10         * semantics.c (check_accessibility_of_qualified_id): Likewise.
11         * pt.c (instantiate_class_template, instantiate_template ): Likewise.
12         (tsubst): Likewise.
13         (resolve_type_name_type): Likewise.
14         (append_type_to_template_for_access_check): Likewise.
15
16 2009-01-21  Dodji Seketeli  <dodji@redhat.com>
17
18         PR c++/26693
19         * decl2.c (grokfield): when a typedef appears in a
20         class, create the typedef variant type node for it.
21         (save_template_attributes): Creating typedef variant type node
22          here is now useless.
23         * decl.c (grokdeclarator): If the typedef'ed struct/class was
24         anonymous, set the proper type name to all its type variants.
25         * name-lookup.c (pushdecl_maybe_friend): Reuse the
26         set_underlying_type function to install typedef variant types.
27         * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): New template accessor
28         macro.
29         (append_type_to_template_for_access_check): New entry points.
30         * semantics.c (check_accessibility_of_qualified_id):
31         When a typedef that is a member of a class appears in a template,
32         add it to the template. It will be ...
33         * pt.c (instantiate_class_template, instantiate_template ): ... access
34         checked at template instantiation time.
35         (tsubst): Handle the case of being called with NULL args.
36         (resolve_type_name_type): The type name should be the name of the
37         main type variant.
38         (append_type_to_template_for_access_check): New entry point.
39
40 2009-01-19  Jason Merrill  <jason@redhat.com>
41
42         PR c++/23287
43         * parser.c (cp_parser_unqualified_id): In a template,
44         accept ~identifier.
45         * typeck.c (lookup_destructor): Handle IDENTIFIER_NODE.
46
47 2009-01-16  Jason Merrill  <jason@redhat.com>
48
49         PR c++/38877
50         * tree.c (lvalue_p_1): Allow non-fields in COMPONENT_REF.
51         * init.c (build_new): Don't call describable_type unless we
52         have an auto.
53
54         PR c++/29470
55         * pt.c (tsubst_decl) [USING_DECL]: Propagate access flags.
56
57         PR c++/38579
58         * search.c (protected_accessible_p): N doesn't vary.
59
60 2009-01-15  Jason Merrill  <jason@redhat.com>
61
62         PR c++/38850
63         * pt.c (tsubst_copy_and_build): Tell finish_call_expr to
64         accept hidden friends.
65
66 2009-01-15  Andrew Pinski  <andrew_pinski@playstation.sony.com>
67
68         PR C++/29388
69         * decl.c (grokdeclarator): Check for a non namespace/class context.
70
71 2009-01-15  Jason Merrill  <jason@redhat.com>
72
73         PR c++/36334
74         PR c++/37646
75         * tree.c (lvalue_p_1): Handle BASELINK.  A COMPONENT_REF to
76         a function isn't necessarily an lvalue. Take tree, not const_tree.
77         (lvalue_p, real_lvalue_p): Take tree, not const_tree.
78         * typeck.c (lvalue_or_else): Likewise.
79         * cp-tree.h: Adjust prototypes.
80
81 2009-01-15  Steve Ellcey  <sje@cup.hp.com>
82
83         PR c++/38357
84         * pt.c (tsubst): Check for NULL args.
85
86 2009-01-15  Dodji Seketeli  <dodji@redhat.com>
87
88         PR c++/38636
89         * name-lookup.c (pushtag): Don't create members to types that are not
90         being created.
91
92 2009-01-14  Nick Clifton  <nickc@redhat.com>
93
94         PR c++/37862
95         * parser.c: Pass cp_id_kind computed in
96         cp_parser_postfix_dot_deref_expression to
97         cp_parser_primary_expression.
98
99 2009-01-13  Jakub Jelinek  <jakub@redhat.com>
100
101         PR c++/38795
102         * tree.c (cp_walk_subtrees): Handle REINTERPRET_CAST_EXPR,
103         STATIC_CAST_EXPR, CONST_CAST_EXPR and DYNAMIC_CAST_EXPR the same
104         as CAST_EXPR.
105
106 2009-01-12  Jason Merrill  <jason@redhat.com>
107             Steve Ellcey  <sje@cup.hp.com>
108
109         PR c++/35109
110         * name-lookup.c (lookup_name_real): Keep looking past a hidden 
111         binding.
112
113 2009-01-12  Dodji Seketeli  <dodji@redhat.com>
114
115         PR c++/36019
116         * pt.c (parameter_of_template_p): New function.
117         * cp-tree.h: Declare it.
118         * name-lookup.c (binding_to_template_parms_of_scope_p): New
119         function.
120         (outer_binding): Take template parameters in account when looking for
121         a name binding.
122
123 2009-01-12  Jason Merrill  <jason@redhat.com>
124
125         PR c++/31488
126         * tree.c (pod_type_p): Return 1 for structs created by the back end.
127
128 2009-01-12  Jakub Jelinek  <jakub@redhat.com>
129
130         PR c/32041
131         * parser.c (cp_parser_builtin_offsetof): Allow `->' in
132         offsetof member-designator, handle it as `[0].'.
133
134         PR c++/38794
135         * decl.c (start_function): If grokdeclarator hasn't returned
136         FUNCTION_DECL nor error_mark_node, issue diagnostics.
137
138 2009-01-11  Jakub Jelinek  <jakub@redhat.com>
139
140         PR c++/36254
141         * cp-gimplify.c (genericize_if_stmt): Renamed from ...
142         (gimplify_if_stmt): ... this.
143         (cp_gimplify_expr): Don't handle IF_STMT here.
144         (cp_genericize_r): Call genericize_if_stmt for IF_STMT.
145
146 2009-01-10  Andrew Pinski  <pinskia@gmail.com>
147
148         PR c++/38648
149         * typeck.c (cp_build_modify_expr): Check for NULL current_function_decl.
150
151         PR c++/36695
152         * typeck2.c (build_functional_cast): Check for reference type and NULL
153         PARMS.
154
155 2009-01-09  Steve Ellcey  <sje@cup.hp.com>
156
157         * typeck.c (cp_build_unary_op): Check for ERROR_MARK.
158
159 2009-01-09  Jakub Jelinek  <jakub@redhat.com>
160
161         PR c++/35335
162         * error.c (dump_expr): Handle EXPR_STMT like BIND_EXPR.
163
164 2009-01-09  John F. Carr  <jfc@mit.edu>
165
166         PR c++/37877
167         * parser.c (cp_parser_class_specifier): Clear
168         parser->in_unbraced_linkage_specification_p while parsing class
169         specifiers.
170
171 2009-01-07  Jakub Jelinek  <jakub@redhat.com>
172
173         PR c++/38725
174         * semantics.c (finish_goto_stmt): Convert destination to
175         void *.
176
177 2009-01-06  Jason Merrill  <jason@redhat.com>
178
179         PR c++/35297
180         PR c++/35477
181         PR c++/35784
182         PR c++/36846
183         PR c++/38276
184         * pt.c (check_default_tmpl_args): Don't complain about
185         out-of-order parameter packs in the enclosing class
186         or parameter packs after default args.
187         (coerce_template_parms): If we have more than one
188         parameter pack, don't flatten argument packs.
189         (template_args_equal): Handle argument packs.
190         (comp_template_args): Don't flatten argument packs.
191         (check_instantiated_arg): Split out from...
192         (check_instantiated_args): Here.  Handle arg packs.
193         (convert_template_argument): Just check that nontype argument
194         packs have the right type.
195
196 2009-01-05  Dodji Seketeli  <dodji@redhat.com>
197
198         PR c++/38472
199         * typeck.c (type_after_usual_arithmetic_conversions): Fix a typo.
200
201 2009-01-05  Jason Merrill  <jason@redhat.com>
202
203         PR c++/38698
204         * typeck2.c (process_init_constructor_union): Handle union with
205         no fields.
206
207         * mangle.c (write_expression): Remove mangling for zero-operand
208         casts.
209
210         PR c++/38701
211         * decl.c (cp_finish_decl): Clear DECL_INITIAL for invalid
212         defaulting.
213
214         PR c++/38702
215         * class.c (defaultable_fn_p): Only operator== can be a copy
216         assignment operator.
217
218 2009-01-02  Jason Merrill  <jason@redhat.com>
219
220         PR c++/38698
221         * typeck2.c (process_init_constructor_union): Handle excess
222         initializers.
223         (process_init_constructor_record): Likewise.
224
225         PR c++/38684
226         * typeck2.c (digest_init_r): Don't use process_init_constructor
227         for non-aggregate classes.
228
229 2008-12-31  Jakub Jelinek  <jakub@redhat.com>
230
231         PR c++/38647
232         * parser.c (cp_parser_primary_expression) <case RID_FUNCTION_NAME>:
233         Return error_mark_node if cp_parser_non_integral_constant_expression
234         returns true.
235
236         PR c++/38640
237         * semantics.c (finish_decltype_type): Handle TEMPLATE_PARM_INDEX.
238
239 2008-12-29  Jakub Jelinek  <jakub@redhat.com>
240
241         PR c++/38635
242         * parser.c (cp_parser_condition): Use cp_parser_require
243         instead of cp_lexer_consume_token to consume =.
244
245         PR c++/38637
246         * decl.c (start_enum): If enumtype is error_mark_node, exit early.
247
248 2008-12-28  Jakub Jelinek  <jakub@redhat.com>
249
250         PR c++/38650
251         * semantics.c (finish_omp_for): Don't add CLEANUP_POINT_EXPR
252         around volatile iteration var in condition and/or increment
253         expression.
254
255 2008-12-27  Jakub Jelinek  <jakub@redhat.com>
256
257         PR c++/38639
258         * pt.c (tsubst_omp_for_iterator): RECUR on whole init_expr instead of
259         just its type.
260
261 2008-12-21  Jason Merrill  <jason@redhat.com>
262
263         PR c++/38597
264         * name-lookup.c (arg_assoc_type): Handle DECLTYPE_TYPE.
265
266 2008-12-20  Jakub Jelinek  <jakub@redhat.com>
267             Manuel López-Ibáñez  <manu@gcc.gnu.org>
268
269         PR c++/36921
270         * c-common.c (warn_about_parentheses): Remove ARG_UNUSED from
271         arg_left.  Don't warn about X<=Y<=Z if comparison's type isn't
272         integral.
273
274 2008-12-19  Jakub Jelinek  <jakub@redhat.com>
275
276         PR c++/38577
277         * call.c (build_new_method_call): Handle call being COMPOUND_EXPR
278         or NOP_EXPR.
279
280 2008-12-18  Jakub Jelinek  <jakub@redhat.com>
281
282         PR c++/38427
283         * init.c (perform_member_init): For value-initialized
284         references call permerror instead of warning and don't emit any
285         INIT_EXPR.
286
287 2008-12-18  Jason Merrill  <jason@redhat.com>
288
289         PR c++/38485
290         * parser.c (cp_parser_token_starts_cast_expression): An EOF
291         can't start a cast-expression.
292
293 2008-12-17  Jason Merrill  <jason@redhat.com>
294
295         * semantics.c (describable_type): New function.
296         (finish_decltype_type): Use it for dependent exprs.
297         * cp-tree.h: Declare it.
298         * mangle.c (write_type) [DECLTYPE_TYPE]: Set skip_evaluation.
299         (write_expression): If skip_evaluation, use type stubs.
300         * tree.c (cp_tree_equal): Handle PARM_DECLs from different
301         declarations of a function.
302         * init.c (build_new): Do auto deduction if type is describable.
303         * decl.c (cp_finish_decl): Likewise.
304         * parser.c (cp_parser_omp_for_loop): Likewise.
305
306 2008-12-10  Jason Merrill  <jason@redhat.com>
307
308         PR c++/35319
309         * mangle.c (write_builtin_type): Add mangling for decimal floating 
310         point and fixed point types.
311         (write_type): Pass FIXED_POINT_TYPE along.
312
313 2008-12-09  Mark Mitchell  <mark@codesourcery.com>
314
315         PR c++/37971
316         * class.c (resolve_address_of_overloaded_function): Check
317         accessibility of member functions unless FLAGS indicates
318         otherwise.
319         * call.c (standard_conversion): Adjust flags passed to
320         instantiate_type.
321         (convert_default_arg): Do not perform access checks.
322         * cp-tree.h (tsubst_flags_t): Add tf_no_access_control.
323
324 2008-12-08  Steve Ellcey  <sje@cup.hp.com>
325
326         * decl2.c (mark_used): Remove assemble_external call.
327
328 2008-12-08  Dodji Seketeli  <dodji@redhat.com>
329
330         PR debug/38390
331         * name-lookup.c (kept_level_p): Don't forget the case of levels
332           having using directives.
333
334 2008-12-08  Richard Henderson  <rth@redhat.com>
335
336         PR 38240
337         * class.c (finish_struct_bits): Use SET_TYPE_MODE.
338         * decl.c (record_unknown_type): Likewise.
339         (start_enum, finish_enum): Likewise.
340
341 2008-12-05  Jakub Jelinek  <jakub@redhat.com>
342
343         PR c++/35336
344         * error.c (dump_expr): Handle BIT_FIELD_REF.
345
346 2008-12-05  Sebastian Pop  <sebastian.pop@amd.com>
347
348         PR bootstrap/38262
349         * Make-lang.in (cc1plus-dummy, cc1plus): Add BACKENDLIBS,
350         remove GMPLIBS.
351
352 2008-12-04  Jason Merrill  <jason@redhat.com>
353
354         PR c++/37906
355         * decl.c (grok_special_member_properties): Set TYPE_HAS_COMPLEX_DFLT
356         here.
357         * class.c (check_bases_and_members): Rather than assuming any
358         user-declared default constructor is complex here.
359
360 2008-12-04  Richard Guenther  <rguenther@suse.de>
361
362         PR c++/38334
363         * typeck.c (get_member_function_from_ptrfunc): Mark the vtbl
364         pointer access with TREE_NO_WARNING.
365
366 2008-12-03  Jason Merrill  <jason@redhat.com>
367
368         PR c++/38232
369         * init.c (build_value_init): Do initial zero-initialization
370         of a class with an implicitly-defined constructor using
371         build_zero_init rather than in build_value_init.
372         (build_value_init_1): Fold into build_value_init.
373
374         PR c++/38256
375         * parser.c (cp_parser_conversion_type_id): Diagnose
376         'operator auto' here.
377         * decl.c (grokdeclarator): Not here.
378
379         PR c++/38380
380         * decl.c (grokdeclarator): Only set DECL_NONCONVERTING_P
381         on explicit constructors.
382         * pt.c (tsubst_copy_and_build) [CONSTRUCTOR]: Propagate
383         CONSTRUCTOR_IS_DIRECT_INIT.
384
385 2008-12-02  Jason Merrill  <jason@redhat.com>
386
387         PR c++/35782, c++/37860
388         * call.c (build_user_type_conversion_1): Remember
389         list-initialization.
390         (convert_like_real): Likewise.
391         (build_over_call): Don't require the copy constructor
392         for copy-list-initialization.
393         * cp-tree.h (TARGET_EXPR_LIST_INIT_P): New macro.
394
395         PR c++/37234
396         * decl.c (cp_finish_decl): Handle =default and =delete for
397         templates, too.
398
399 2008-12-01  Jakub Jelinek  <jakub@redhat.com>
400
401         PR c++/38257
402         * parser.c (cp_parser_omp_for_loop): Handle auto.
403         * pt.c (tsubst_omp_for_iterator): Likewise.
404
405 2008-11-28  Jason Merrill  <jason@redhat.com>
406
407         PR c++/38233
408         * init.c (perform_member_init): Fix value-initialization.
409         (build_value_init_1): Add assert to catch cases that will break
410         in the gimplifier.
411         (build_default_init): Remove.
412         * cp-tree.h: Remove its prototype.
413         * pt.c (tsubst_expr) [DECL_EXPR]: Use build_value_init for
414         value-initialization.
415
416         PR c++/38278
417         * parser.c (cp_parser_class_name): Only call 
418         maybe_note_name_used_in_class if we actually found a class name.
419
420 2008-11-25  Jason Merrill  <jason@redhat.com>
421
422         PR c++/28743
423         * decl2.c (check_classfn): Error rather than abort on parameter
424         list mismatch.
425
426 2008-11-20  Jason Merrill  <jason@redhat.com>
427
428         PR c++/28513
429         * parser.c (cp_parser_class_name): Call maybe_note_name_used_in_class.
430
431         PR c++/37540
432         * call.c (build_over_call): Take the address of the function even
433         in a template.
434         (build_new_method_call): Remember the type of the called function
435         in a template.
436
437 2008-11-19  Dodji Seketeli  <dodji@redhat.com>
438
439         PR c++/37142
440         * pt.c (coerce_template_template_parm): Use the more robust
441         uses_template_parms instead of dependent_type_p.
442
443 2008-11-19  Dodji Seketeli  <dodji@redhat.com>
444
445         PR c++/35405
446         * pt.c (lookup_template_class): Check pointers before dereferencing
447         them.
448         * error.c (dump_template_decl): Likewise.
449
450 2008-11-19  Jason Merrill  <jason@redhat.com>
451
452         PR c++/36410
453         * decl2.c (grokfield): Pass ATTR_FLAG_TYPE_IN_PLACE for a typedef
454         that names a class for linkage purposes.
455
456         PR c++/37563
457         * parser.c (cp_parser_pseudo_destructor_name): A pseudo-destructor
458         name is not a declaration.
459
460         PR c++/37256
461         * pt.c (instantiate_decl): Don't require a definition of
462         a template that is explicitly instantiated 'extern'.
463
464 2008-11-18  Jason Merrill  <jason@redhat.com>
465             Jakub Jelinek  <jakub@redhat.com>
466         
467         PR c++/37962
468         * parser.c (cp_parser_type_id): Complain about auto.
469         * decl.c (grokdeclarator): Complain about parameters and
470         conversion functions declared with auto.
471
472         * call.c (standard_conversion): Use CLASS_TYPE_P instead of
473         MAYBE_CLASS_TYPE_P.
474         * cp-tree.h (TYPE_NON_AGGREGATE_CLASS): Likewise.
475
476 2008-11-17  Jakub Jelinek  <jakub@redhat.com>
477
478         PR c++/36089
479         * init.c (constant_value_1): Handle TREE_LIST init.
480
481 2008-11-15  Jakub Jelinek  <jakub@redhat.com>
482
483         PR c++/37561
484         * typeck.c (cp_build_unary_op): Don't call get_unwidened.  Use
485         argtype instead of result_type.
486
487 2008-11-14  Jason Merrill  <jason@redhat.com>
488
489         PR c++/38030
490         * semantics.c (finish_call_expr): Don't repeat arg-dep lookup
491         for a non-dependent call.
492
493         PR c++/37740
494         * call.c (build_aggr_conv): Increment i.
495
496 2008-11-13  Jason Merrill  <jason@redhat.com>
497
498         PR c++/37932
499         * typeck2.c (process_init_constructor_record): Update bitfield
500         handling.
501         (check_narrowing): Update bitfield handling, print source type.
502         
503 2008-11-12  Jakub Jelinek  <jakub@redhat.com>
504
505         PR c++/36478
506         Revert:
507         2007-05-07  Mike Stump  <mrs@apple.com>
508         * parser.c (check_empty_body): Add.
509         (cp_parser_iteration_statement): Add call to check_empty_body.
510
511 2008-11-12  Jason Merrill  <jason@redhat.com>
512
513         PR c++/38007
514         * typeck.c (cp_build_modify_expr): Update bitfield handling.
515
516 2008-11-12  Jakub Jelinek  <jakub@redhat.com>
517
518         PR c++/34269
519         * parser.c (cp_parser_simple_declaration): Don't commit
520         to tentative parse if parse errors were seen.
521
522         PR c++/35334
523         * error.c (dump_expr): Handle COMPLEX_EXPR.
524
525 2008-11-10  Jakub Jelinek  <jakub@redhat.com>
526
527         PR c++/38021
528         * parser.c (cp_parser_enum_specifier): After parsing :,
529         parse definitely.  Don't return early if type specifier
530         is erroneous.
531
532 2008-11-06  David Edelsohn  <edelsohn@gnu.org>
533
534         PR target/26397
535         * g++spec.c (LIBSTDCXX_STATIC): New.
536         (lang_spec_driver): Use LIBSTDCXX_STATIC when not
537         shared_libgcc.
538         
539 2008-11-05  Fabien Chene <fabien.chene@gmail.com>
540
541         PR c++/32519
542         * cp-tree.h: Fix DECL_NONSTATIC_MEMBER_P to handle member template
543         functions.
544
545 2008-11-05  Richard Guenther  <rguenther@suse.de>
546
547         PR middle-end/37742
548         * decl.c (start_preparsed_function): Use the correct type for
549         building the RESULT_DECL.
550
551 2008-10-31  Jakub Jelinek  <jakub@redhat.com>
552
553         PR c++/37967
554         * decl.c (grokdeclarator): Diagnose auto function decl without
555         late return type and late return type function decl where type
556         is not auto.
557
558         PR c++/37965
559         * decl.c (cp_finish_decl): Diagnose type_uses_auto type with
560         no initializer.
561
562 2008-10-29  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
563
564         PR 11492
565         * class.c (check_bitfield_decl): Rename min_precision to
566         tree_int_cst_min_precision.
567         * decl.c (finish_enum): Likewise.
568
569 2008-10-29  Manuel López-Ibáñez  <manu@gcc.gnu.org>
570
571         PR c++/26997
572         * parser.c (cp_parser_token_starts_cast_expression): New.
573         (cp_parser_cast_expression): Peek the next token to decide whether
574         this could be a parenthesized constructor or is definitely an
575         actual cast.
576
577 2008-10-24  Manuel López-Ibáñez  <manu@gcc.gnu.org>
578
579         PR c/7543
580         * typeck.c (build_x_binary_op): Update call to
581         warn_about_parentheses.
582         * parser.c (cp_parser_binary_expression): Add note about passing
583         the correct code for unary expressions.
584
585 2008-10-24  Jakub Jelinek  <jakub@redhat.com>
586
587         * Make-lang.in (check-c++-subtargets): New alias for
588         check-g++-subtargets.
589         (lang_checks_parallelized): Add check-g++.
590         (check_g++_parallelize): New variable.
591
592 2008-10-21  Richard Guenther  <rguenther@suse.de>
593
594         * semantics.c (simplify_aggr_init_exprs_r): Remove.
595         (expand_or_defer_fn): Do not walk the function body to
596         simplify aggr_init_exprs.
597
598 2008-10-20  Manuel López-Ibáñez  <manu@gcc.gnu.org>
599
600         PR c++/37004
601         * typeck.c (cp_common_type): New. The same as
602         type_after_usual_arithmetic_conversions but without promotions.
603         (type_after_usual_arithmetic_conversions): Do the promotions and
604         call cp_common_type.
605         (common_type): Make it behave like the C version of this
606         function. Do not handle pointer types.
607         (common_pointer_type): Move handling of pointer types from
608         common_type to here.
609         (cp_build_binary_op): Use common_pointer_type instead of
610         common_type in call to pointer_diff.
611         Use cp_common_type instead of common_type.
612         * cp-tree.h (common_pointer_type): Declare.
613
614 2008-10-14  Jakub Jelinek  <jakub@redhat.com>
615
616         PR c++/37819
617         * cp-gimplify.c (cp_genericize_r): Only fold_convert COND_EXPR
618         arguments if they don't already have COND_EXPR's type.
619
620 2008-10-14  Paolo Carlini  <paolo.carlini@oracle.com>
621
622         PR c++/37650
623         * pt.c (push_template_decl_real): Check that current_template_parms
624         is not null.
625         (process_partial_specialization): Assert current_template_parms not
626         null.
627
628 2008-10-13  Doug Evans  <dje@google.com>
629
630         * cp-tree.h (DECL_MAIN_P): Fix parentheses around expression.
631
632 2008-10-10  Jakub Jelinek  <jakub@redhat.com>
633
634         PR c++/37146
635         * cp-gimplify.c (cp_genericize_r): Fix up bitfield operands of
636         COND_EXPR.
637
638 2008-10-09  Jakub Jelinek  <jakub@redhat.com>
639
640         PR c++/37568
641         * semantics.c (finalize_nrv_r): Clear DECL_INITIAL instead of
642         setting it to error_mark_node.
643
644 2008-10-07  Steve Ellcey  <sje@cup.hp.com>
645
646         * decl.c (start_cleanup_fn): Declare as inline.
647
648 2008-10-06  Jason Merrill  <jason@redhat.com>
649
650         PR c++/37376, other mangling issues
651         * mangle.c (write_type): Update TYPE_PACK_EXPANSION mangling.
652         (write_member_name): Break out from...
653         (write_expression): ...here.  Handle dependent COMPONENT_REF.
654         (write_template_arg): Wrap an argument pack in 'I'/'E'.
655         (write_builtin_type): Update char16/32_t mangling.
656         (write_nested_name, write_prefix): Don't forget template args
657         for typename types.
658         * operators.def: Add ARROW_EXPR, update COMPONENT_REF and 
659         EXPR_PACK_EXPANSION.
660
661 2008-10-06  Aldy Hernandez  <aldyh@redhat.com>
662
663         * typeck.c (build_x_indirect_ref): Add location argument.
664         (cp_build_binary_op): Pass location to warn_for_div_by_zero.
665         (cp_build_unary_op): Add location argument.
666         (cp_build_modify_expr): Same.
667         * class.c (build_base_path): Pass location to build_indirect_ref.
668         * semantics.c (handle_omp_for_class_iterator): Pass elocus to
669         build_modify_expr.
670
671 2008-10-05  Dodji Seketeli  <dodji@redhat.com>
672
673         PR c++/37410
674         * cp-gimplify.c (cp_gimplify_expr): For each USING_STMT
675         make sure an IMPORTED_DECL node is added to the BLOCK_VARS list
676         of the innermost containing BLOCK.
677
678 2008-10-03  Paolo Carlini  <paolo.carlini@oracle.com>
679
680         PR c++/37719
681         * error.c (dump_function_decl): Save the exceptions in case of
682         error about incompatible specifications in a specialization.
683
684 2008-10-01  Andrew Pinski  <andrew_pinski@playstation.sony.com>
685
686         * tree.c (lvalue_p_1): COMPOUND_LITERAL_EXPR is also an lvalue.
687
688 2008-09-30  H.J. Lu  <hongjiu.lu@intel.com>
689
690         PR c++/37683
691         * parser.c (cp_parser_selection_statement): Fix uninitialized
692         variable.
693
694 2008-09-30  Simon Martin  <simartin@users.sourceforge.net>
695
696         PR c++/37555
697         PR c++/37556
698         * decl.c (grokdeclarator): Set the type for typedefs to a
699         nested-name-specifier to error_mark_node.
700
701 2008-09-30  Paolo Bonzini  <bonzini@gnu.org>
702
703         * parser.c (cp_parser_selection_statement): Implement here the
704         -Wempty-body warning for `if' and `else' statements.
705         * semantics.c (finish_if_stmt): Do not call empty_body_warning.
706
707 2008-09-25  Paolo Carlini  <paolo.carlini@oracle.com>
708
709         PR c++/37649
710         * name-lookup.c (maybe_process_template_type_declaration): Check
711         return value of push_template_decl_real for error_mark_node.
712
713 2008-09-24  Aldy Hernandez  <aldyh@redhat.com>
714
715         * semantics.c (finish_fname): Pass location to fname_decl.
716
717 2008-09-23  Jakub Jelinek  <jakub@redhat.com>
718
719         PR c++/37533
720         * semantics.c (finish_omp_for): If processing_template_decl, just build
721         MODIFY_EXPR for init instead of calling cp_build_modify_expr.
722
723 2008-09-23  Aldy Hernandez  <aldyh@redhat.com>
724
725         * typeck.c (build_array_ref): Pass location to cp_build_binary_op.
726         (get_member_function_from_ptrfunc): Same.
727         (build_x_binary_op): Same.
728         (build_binary_op): Same.
729         (cp_build_binary_op): New location argument.
730         (pointer_diff): Pass location to cp_build_binary_op.
731         (cp_truthvalue_conversion): Pass location to build_binary_op.
732         (convert_ptrmem): Pass location to cp_build_binary_op.
733         (cp_build_modify_expr): Same.
734         (build_ptrmemfunc): Same.
735         * init.c (expand_cleanup_for_base): Pass location to
736         c_common_truthvalue_conversion.
737         (build_new_1): Pass location to cp_build_binary_op.
738         (build_vec_delete_1): Pass location to *build_binary_op,
739         c_common_truthvalue_conversion.
740         (build_vec_init): Same.
741         (build_delete): Same.
742         * decl.c (compute_array_index_type): Same.
743         * call.c (build_new_op): Same.
744         * rtti.c (build_dynamic_cast_1): Same.
745         * cp-tree.h: Add argument to cp_build_binary_op.
746         * semantics.c (handle_omp_for_class_iterator): Pass location to
747         *build_binary_op, c_common_truthvalue_conversion.
748         * decl2.c (get_guard_cond): Same.
749
750 2008-09-17  Richard Guenther  <rguenther@suse.de>
751
752         PR c++/22374
753         * rtti.c (build_dynamic_cast_1): Convert the COND_EXPR
754         result to the correct type.
755
756 2008-09-17  H.J. Lu  <hongjiu.lu@intel.com>
757
758         PR c++/37450
759         * name-lookup.c (pushdecl_maybe_friend): Don't return the old
760         parameter for duplicate.
761
762 2008-09-17  Jason Merrill  <jason@redhat.com>
763
764         PR c++/37588
765         * name-lookup.c (lookup_type_scope): Look through sk_function_parms.
766
767 2008-09-17  Jakub Jelinek  <jakub@redhat.com>
768
769         PR c++/37552
770         * typeck.c (build_array_ref): Use protected_set_expr_location instead
771         of SET_EXPR_LOCATION when ret might not be an expression.
772
773 2008-09-17  Jan Hubicka  <jh@suse.cz>
774
775         PR c++/18071
776         * cp/decl.c (start_method): Set DECL_NO_INLINE_WARNING_P.
777
778 2008-09-16  Jakub Jelinek  <jakub@redhat.com>
779
780         PR c++/37531
781         * semantics.c (finish_compound_literal): Return error_mark_node if
782         type is errorneous.
783
784         PR c++/37532
785         * lex.c (init_reswords): Don't populate ridpointers for D_CONLY
786         reserved words.
787
788 2008-09-15  Aldy Hernandez  <aldyh@redhat.com>
789
790         * decl.c (duplicate_decls): Call error_at.
791         (grokfndecl): New location argument.  Use location if available.
792         (grokdeclarator): Pass declarator location to grokfndecl.
793         * cp-tree.h (struct cp_declarator): Update comment for id_loc.
794         * decl2.c (check_classfn): Use error_at.
795         * parser.c (cp_parser_init_declarator): Set function_start_locus
796         to brace location.
797         (cp_parser_member_declaration): Set id_loc for function declarators.
798
799 2008-09-09  Jan Hubicka  <jh@suse.cz>
800
801         PR middle-end/37500
802         * pt.c (tsubst_decl): Do not copy DECL_STRUCT_FUNCTION pointer.
803
804 2008-09-09  Jakub Jelinek  <jakub@redhat.com>
805
806         PR c++/37417
807         * tree.c (array_type_nelts_top): Add size_one_node instead of
808         integer_one_node.
809
810 2008-09-09  Jason Merrill  <jason@redhat.com>
811
812         PR c++/37439
813         * pt.c (tsubst_copy) [PARM_DECL]: Don't abort if the parm has
814         DECL_CONTEXT set.
815
816 2008-09-09  Jakub Jelinek  <jakub@redhat.com>
817
818         PR c++/37389
819         * decl.c (build_enumerator): Handle previous value's DECL_INITIAL
820         being error_operand_p.  Don't clear value if it was error_mark_node.
821
822 2008-09-09  Paolo Bonzini  <bonzini@gnu.org>
823
824         * cp-objcp-common.h (LANG_HOOKS_EXPAND_DECL): Remove.
825         * cp-tree.h: Don't mention DECL_ANON_UNION_ELEMS.
826         * semantics.c (anon_aggr_type_p): Remove.
827
828 2008-09-06  Jason Merrill  <jason@redhat.com>
829
830         PR c++/37302
831         * parser.c (cp_parser_parameter_declaration_list): Process the
832         PARM_DECLs as we go and push them.  Return a TREE_LIST.
833         (cp_parser_parameter_declaration_clause): Return a TREE_LIST.
834         (cp_parser_direct_declarator): Create a binding level and
835         suppress deprecated warnings in the parameter list.
836         (make_call_declarator): PARMS is now a tree.
837         * cp-tree.h (struct cp_declarator): Function parms are now a tree.
838         * decl.h (enum deprecated_states, deprecated_state): Move here.
839         * decl.c: From here.
840         (type_is_deprecated): New fn.
841         (grokparms): PARMLIST is a tree now.  Warn about parms that
842         use deprecated types.
843         * mangle.c (write_expression): Handle PARM_DECL, CALL_EXPR and
844         0-operand cast.
845         * pt.c (tsubst) [DECLTYPE_TYPE]: Set skip_evaluation.
846         (tsubst_copy) [PARM_DECL]: Handle a PARM_DECL used outside of a 
847         function.
848         * name-lookup.c (pushtag): Look through function parameter scopes.
849         (pushdecl_maybe_friend): Don't set DECL_CONTEXT on a PARM_DECL 
850         when we're parsing a function declarator.
851
852 2008-09-05  Douglas Gregor  <doug.gregor@gmail.com>
853
854        PR c++/37342
855        * tree.c (cp_build_qualified_type_real): Deal with sharing of
856        TYPE_LANG_SPECIFIC in the canonical types of pointer-to-method
857        types.
858         
859 2008-09-04  Ian Lance Taylor  <iant@google.com>
860
861         * parser.c (check_no_duplicate_clause): Change code parameter to
862         enum omp_clause_code.
863
864 2008-09-03  Jakub Jelinek  <jakub@redhat.com>
865
866         PR c++/37348
867         * decl.c (cp_finish_decl): Only set
868         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P if decl is VAR_DECL.
869
870         PR c++/37189
871         * cp-tree.h (defer_mark_used_calls, deferred_mark_used_calls): New
872         extern decls.
873         * decl2.c (mark_used): If defer_mark_used_calls, push decl into
874         deferred_mark_used_calls vector and exit early.
875         * decl.c (defer_mark_used_calls, deferred_mark_used_calls): New
876         variables.
877         (finish_function): Set defer_mark_used_calls for the duration of the
878         function.  Call mark_used on any queued decls.
879
880 2008-09-02  Jason Merrill  <jason@redhat.com>
881
882         PR c++/37208
883         * call.c (build_over_call): Make =delete work with SFINAE.
884         * class.c (resolve_address_of_overloaded_function): Likewise.
885
886         * cp-tree.h (struct lang_decl_flags): Rename threadprivate_p to
887         threadprivate_or_deleted_p.
888         (CP_DECL_THREADPRIVATE_P): Adjust.
889         (DECL_DELETED_FN): Likewise.
890         (SD_UNINITIALIZED, SD_INITIALIZED, SD_DEFAULTED): New macros.
891         (SD_DELETED): New macro.
892         * parser.c (cp_parser_init_declarator): Use them.
893         * decl.c (start_decl): Use them.
894
895         * decl2.c (mark_used): Give =deleted error even in sizeof.
896
897         * typeck2.c (check_narrowing): Downgrade narrowing error to
898         permerror.
899
900 2008-09-02  Aldy Hernandez  <aldyh@redhat.com>
901
902         * typeck.c (build_array_ref): Use new location argument.
903         * class.c (build_vtbl_ref_1): Pass location to build_array_ref.
904         * call.c (build_new_op): Same.
905         * decl2.c (grok_array_decl): Same.
906         * cp-tree.h (build_array_ref): Add location argument to prototype.
907
908 2008-09-01  Aldy Hernandez  <aldyh@redhat.com>
909
910         * typeck.c (build_x_indirect_ref): Add location argument.
911         * class.c (build_base_path): Pass location to build_indirect_ref.
912         * pt.c (tsubst_copy_and_build): Pass location to
913         finish_label_address_expr.
914         * parser.c (cp_parser_unary_expression): Same.
915
916 2008-08-31  Jason Merrill  <jason@redhat.com>
917
918         Implement late-specified return type using 'auto'.
919         * cp-tree.h (struct cp_declarator): Add late_return_type field to
920         function declarator.
921         * parser.c (cp_parser_late_return_type_opt): New fn.
922         (cp_parser_direct_declarator): Use it.
923         (make_call_declarator): Put it in the declarator.
924         * decl.c (grokdeclarator): Splice in late-specified return type.
925         * pt.c (splice_late_return_type): New fn.
926
927 2008-08-29  Michael Meissner  <gnu@the-meissners.org>
928
929         * decl.c (builtin_function_1): Take a bool argument to decide
930         whether to use pushdecl or pushdecl_top_level.
931         (duplicate_decls): Copy function specific target and optimization
932         options on duplicate declarations.
933         (cxx_builtin_function): Update builtin_function_1 call.
934         (cxx_builtin_function_ext_scope): New function, guarantee that the
935         declaration is done at global scope.
936
937         * cp-objcp-common.h (LANG_HOOKS_BUILTIN_FUNCTION_EXT_SCOPE): New
938         macro, define builtin function hook for delayed machine specific
939         builtins.
940
941         * cp-tree.h (cxx_builtin_function_ext_scope): Add declaration.
942
943 2008-08-30  Jason Merrill  <jason@redhat.com>
944
945         PR c++/37288
946         * pt.c (dependent_type_p): Don't abort on auto outside of a template.
947
948 2008-08-29  Jason Merrill  <jason@redhat.com>
949
950         Implement C++0x 'auto' semantics.
951         * decl.c (start_decl_1): Don't complain about auto being incomplete.
952         (cp_finish_decl): Deduce auto.
953         * init.c (build_new): Handle 'new auto'.
954         * typeck2.c (cxx_incomplete_type_diagnostic): Give a different
955         message for auto than for normal template type parms.
956         * pt.c (type_dependent_expression_p): Handle { }.
957         (make_auto): New function.
958         (listify_autos): New function.
959         (do_auto_deduction): New function.
960         (is_auto): New function.
961         (type_uses_auto): New function.
962         * cp-tree.h: Declare them.
963         * parser.c (cp_parser_decl_specifier_seq): In C++0x mode, don't
964         treat auto as a declspec.
965         (cp_parser_simple_type_specifier): It's a type-specifier.
966
967 2008-08-29  Mark Mitchell  <mark@codesourcery.com>
968
969         * mangle.c (write_type): Add target-specific manglings for
970         non-fundamental types to the substitution table.
971         gcc/testsuite/
972
973 2008-08-29  Jakub Jelinek  <jakub@redhat.com>
974
975         PR fortran/29635
976         PR fortran/23057
977         * name-lookup.c (do_using_directive, cp_emit_debug_info_for_using):
978         Adjust debug_hooks->imported_module_or_decl callers.
979
980 2008-08-29  Jan Hubicka  <jh@suse.cz>
981
982         * cp-gimplify.c (cp_gimplify_expr): Add PRED_CONTINUE heuristic.
983
984 2008-08-28  Paolo Carlini  <paolo.carlini@oracle.com>
985
986         PR c++/37260
987         * decl.c (reshape_init_r): Check init for error_mark_node.
988
989 2008-08-27  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
990
991         PR c++/17880
992         * semantics.c (maybe_convert_cond): Call verify_sequence_points.
993         (finish_return_stmt): Likewise.
994         (finish_switch_condition): Likewise.
995
996 2008-08-27  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
997
998         * cp-tree.h: Fix #error directive.
999
1000 2008-08-26  Douglas Gregor  <doug.gregor@gmail.com>
1001
1002         * typeck.c (type_after_usual_arithmetic_conversions): Don't do the
1003         usual arithmetic conversions on scoped enumeration types.
1004         (common_type): Ditto.
1005         (default_conversion): Don't perform integral promotions on scoped
1006         enumeration types. 
1007         (build_array_ref): Scoped enumeration types can't be used as
1008         subscripts.
1009         * decl.c (start_enum): If building a C++0x scoped enumeration,
1010         enter its scope. If provided with an underlying type, check that
1011         underlying type and set up the enumeration type accordingly.
1012         (finish_enum): Only compute an underlying type if the underlying
1013         type isn't already fixed, and only convert the enumerator values
1014         now if we've just computed the underlying type. Finish the scope
1015         of C++0x scoped enumerations.
1016         (build_enumerator): For enumerations with a fixed underlying type,
1017         check the enumerator values when the enumerator is defined.
1018         (lookup_enumerator): New.
1019         * call.c (standard_conversion): Don't allow assignment from
1020         integers to scoped enumeration types, even with -fpermissive.
1021         Don't convert from scoped enumerations to bool or any arithmetic
1022         types.
1023         (build_conditional_expr): Don't per the usual arithmetic
1024         conversions for scoped enumeration types.
1025         (convert_like_real): Check complain to see if we should
1026         produce warnings.
1027         * error.c (class_key_or_enum_as_string): Print scoped enums.
1028         * cp-tree.h (MAYBE_CLASS_TYPE_P): Check CLASS_TYPE_P, not
1029         TYPE_LANG_FLAG_5.
1030         (INTEGRAL_OR_UNSCOPED_ENUMERATION_TYPE_P): New.
1031         (SCOPED_ENUM_P): New.
1032         (UNSCOPED_ENUM_P): New.
1033         (SET_SCOPED_ENUM_P): New.
1034         (ENUM_UNDERLYING_TYPE): New.
1035         * pt.c (lookup_template_class): Update the instantiation of enum
1036         types to deal with C++0x scoped enumerations and underlying
1037         types.
1038         * name-lookup.c (begin_scope): Deal with scoped enumeration
1039         scopes.
1040         (lookup_qualified_name): Deal with lookup into enumeration types.
1041         * name-lookup.h (enum scope_kind): Add sk_scoped_enum.
1042         * parser.c (cp_parser_class_or_namespace_name): Rename to...
1043         (cp_parser_qualifying_entity): ... this. Also, in C++0x mode,
1044         parse a type-name that can be an enumeration type.
1045         (cp_parser_nested_name_specifier_opt): Update with C++0x grammar.
1046         (cp_parser_elaborated_type_specifier): Parse the
1047         optional `struct' or `class' following enum (in C++0x).
1048         (cp_parser_enum_specifier): Parse C++0x scoped enumerations and
1049         enum-base clauses.
1050
1051 2008-08-21  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1052
1053         * typeck.c: Update all calls to pedwarn.
1054         * decl.c: Likewise.
1055         * call.c: Likewise.
1056         * error.c: Likewise.
1057         * pt.c: Likewise.
1058         * name-lookup.c: Likewise.
1059         * parser.c: Likewise.
1060
1061 2008-08-20  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1062
1063         PR c++/35158
1064         * parser.c (cp_parser_omp_for_loop): Handle parenthesized
1065         initializers.
1066
1067 2008-08-20  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1068
1069         * parser.c: Update all calls to inform.
1070         * typeck.c: Likewise.
1071         * init.c: Likewise.
1072         * class.c: Likewise.
1073         * call.c: Likewise.
1074         * method.c: Likewise.
1075         * friend.c: Likewise.
1076         * typeck2.c: Likewise.
1077         * pt.c: Likewise.
1078         * name-lookup.c: Likewise.
1079         * lex.c: Likewise.
1080
1081 2008-08-19  Jakub Jelinek  <jakub@redhat.com>
1082
1083         PR debug/37156
1084         * error.c (cp_print_error_function): Deal with recursive BLOCK trees.
1085
1086 2008-08-18  Tomas Bily  <tbily@suse.cz>
1087
1088         * tree.c (cp_tree_equal): Use CONVERT_EXPR_CODE_P.
1089
1090 2008-08-18  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1091
1092         * typeck.c: Update all callers of permerror.
1093         * init.c: Likewise.
1094         * class.c: Likewise.
1095         * decl.c: Likewise.
1096         * call.c: Likewise.
1097         * except.c: Likewise.
1098         * cvt.c: Likewise.
1099         * typeck2.c: Likewise.
1100         * pt.c: Likewise.
1101         * semantics.c: Likewise.
1102         * name-lookup.c: Likewise.
1103         * lex.c: Likewise.
1104         * decl2.c: Likewise.
1105         * parser.c: Likewise.
1106
1107 2008-08-14  Paolo Carlini  <paolo.carlini@oracle.com>
1108
1109         PR c++/34485
1110         * pt.c (check_template_shadow): Change to return a bool.
1111         * name-lookup.c (push_class_level_binding): Early return if
1112         check_template_shadow returns false.
1113         * cp-tree.h (check_template_shadow): Adjust declaration.
1114
1115 2008-08-14  Paolo Carlini  <paolo.carlini@oracle.com>
1116
1117         PR c++/34600
1118         * decl.c (grokdeclarator): In case of extern and initializer, return
1119         error_mark_node after the error.
1120
1121 2008-08-13  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1122
1123         PR 30551
1124         * decl.c (grokfndecl): Call check_main_parameters_type only if
1125         -Wmain.
1126
1127 2008-08-12  Paolo Carlini  <paolo.carlini@oracle.com>
1128
1129         PR c++/37087
1130         * parser.c (cp_parser_class_head): Early return error_mark_node in
1131         case of global qualification of class name or qualified name that
1132         does not name a class.
1133
1134 2008-08-09  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1135
1136         PR c++/12242
1137         * cvt.c (ocp_convert): Warn for out-of-range conversions to enum.
1138
1139 2008-08-09  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1140
1141         PR 36901
1142         * cp-tree.h (struct diagnostic_context, struct diagnostic_info):
1143         Delete forward declarations. Check that toplev.h has not been
1144         included before this file. Include toplev.h and diagnostic.h.
1145         * error.c (cp_cpp_error): Use DK_PEDWARN.
1146         (cxx_incomplete_type_diagnostic): Update declaration.
1147         (cxx_incomplete_type_error): Use DK_ERROR.
1148         * typeck2.c (cxx_incomplete_type_diagnostic): Take a diagnostic_t
1149         as argument. Use emit_diagnostic.
1150         (cxx_incomplete_type_error): Use DK_ERROR.
1151         (add_exception_specifier): Use diagnostic_t instead of custom
1152         codes.  
1153         * typeck.c (complete_type_or_else): Update call to
1154         cxx_incomplete_type_diagnostic.
1155         * init.c (build_delete): Likewise.  
1156         * call.c (diagnostic_fn_t): Remove unused typedef.
1157         (build_temp): Pass a pointer to diagnostic_t.
1158         (convert_like_real): Use emit_diagnostic.
1159         (joust): Check return value of warning before giving informative
1160         note.  
1161         * friend.c (do_friend): Check return value of warning
1162         before giving informative note.
1163         * parser.c (cp_parser_template_id): Likewise.
1164
1165 2008-08-09  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1166
1167         PR 7651
1168         * class.c (check_bases_and_members): Warn with -Wuninitialized
1169         instead of -Wextra.
1170         
1171 2008-08-08  Volker Reichelt  <v.reichelt@netcologne.de>
1172
1173         PR c++/35985
1174         * decl.c (xref_basetypes): Check base for MAYBE_CLASS_TYPE_P,
1175         and make sure it is not a union.
1176
1177 2008-08-07  H.J. Lu  <hongjiu.lu@intel.com>
1178
1179         * semantics.c (finish_decltype_type): Initialize type.
1180
1181 2008-08-07  Douglas Gregor  <doug.gregor@gmail.com>
1182
1183         * semantics.c (finish_decltype_type): Handle calls to function
1184         pointers and references to functions properly.
1185
1186 2008-08-06  Douglas Gregor  <doug.gregor@gmail.com>
1187
1188         PR c++/36460
1189         * parser.c (cp_parser_template_argument): Don't assume that '>>'
1190         following a type-id is an error when in C++0x mode.
1191
1192 2008-08-06  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1193
1194         PR 26785
1195         * decl.c (grokdeclarator): Use explicit location with permerror_at.
1196
1197 2008-08-06  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1198
1199         PR 8715
1200         * typeck.c (cp_build_binary_op): Move code to c-common.c.
1201
1202 2008-08-05  Jason Merrill  <jason@redhat.com>
1203
1204         PR c++/37016
1205         * decl.c (build_ptrmemfunc_type): Don't require structural
1206         comparison of PMF types.
1207         * tree.c (cp_build_qualified_type_real): Don't clear
1208         a valid TYPE_PTRMEMFUNC_TYPE.
1209         * typeck.c (cp_build_unary_op): Still do build_ptrmemfunc in
1210         templates.
1211
1212 2008-08-04  Jason Merrill  <jason@redhat.com>
1213
1214         PR c++/36963
1215         * typeck2.c (check_narrowing): Allow narrowing conversion
1216         from an explicit floating-point constant.
1217
1218         PR c++/37006
1219         * pt.c (tsubst_decl): Leave DECL_INITIAL set on deleted
1220         instantiations.
1221
1222 2008-08-04  Simon Baldwin  <simonb@google.com>
1223
1224         PR c++/36999
1225         * parser.c (cp_parser_elaborated_type_specifier): Warn only when
1226         the declaration's id is followed by a semicolon.
1227
1228 2008-07-31  Jakub Jelinek  <jakub@redhat.com>
1229
1230         PR c++/36405
1231         * rtti.c (get_tinfo_decl_dynamic, get_typeid): Call
1232         complete_type_or_else even for UNKNOWN_TYPE to get diagnostics.
1233
1234 2008-07-31  Jason Merrill  <jason@redhat.com>
1235
1236         PR c++/36633
1237         * init.c (build_new_1): Don't convert pointer to the data type
1238         until we're actually going to treat it as that type.
1239
1240         PR c++/11309
1241         * tree.c (build_aggr_init_expr): Split out...
1242         (build_cplus_new): ...from here.
1243         (stabilize_init): Don't mess with AGGR_INIT_EXPR either.
1244         * init.c (build_new_1): new T() means value-initialization,
1245         not default-initialization.
1246         (build_vec_init): Likewise.
1247         (build_value_init_1): Use build_aggr_init_expr.
1248
1249 2008-07-30  Dodji Seketeli  <dseketel@redhat.com>
1250
1251         PR c++/36767
1252         * decl2.c (fix_temporary_vars_context_r): New function.
1253          (one_static_initialization_or_destruction): Make sure temporary
1254          variables part of the initialiser have their DECL_CONTEXT()
1255          properly set.
1256
1257 2008-07-30  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1258
1259         PR 34389
1260         * typeck.c (build_binary_op): Encapsulate code into
1261         shorten_binary_op.
1262
1263 2008-07-29  Jakub Jelinek  <jakub@redhat.com>
1264
1265         PR c++/36852
1266         * tree.c (cplus_array_hash, build_cplus_array_type_1): Hash on
1267         TYPE_UID instead of pointers.
1268
1269 2008-07-29  Jan Hubicka  <jh@suse.cz>
1270
1271         * optimize.c (maybe_clone_body): Remove DECL_INLINE.
1272         * decl.c (duplicate_decls): Likewise.
1273         (grokfndecl): Likewise.
1274         (start_method): Likewise.
1275         * method.c (make_thunk, make_alias_for, implicitly_declare_fn):
1276         Likewise.
1277         * pt.c (register_specialization, regenerate_decl_from_template):
1278         Likewise.
1279         * decl2.c (grokfield): Likewise.
1280
1281 2008-07-29  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1282
1283         PR 34985
1284         * decl.c (duplicate_decls): Merge USED flags.
1285
1286 2008-07-27  Jason Merrill  <jason@redhat.com>
1287
1288         PR c++/36943
1289         * decl.c (reshape_init_r): Allow C++0x initializer lists.
1290
1291 2008-07-28  Richard Guenther  <rguenther@suse.de>
1292
1293         Merge from gimple-tuples-branch.
1294
1295         2008-07-22  Aldy Hernandez  <aldyh@redhat.com>
1296
1297         * cp-gimplify.c (gimplify_if_stmt): Set location on newly created
1298         COND_EXPR.
1299
1300         2008-07-18  Jakub Jelinek  <jakub@redhat.com>
1301
1302         * decl.c (finish_function): Call gimple_body after cp_genericize.
1303
1304         2008-07-18  Aldy Hernandez  <aldyh@redhat.com>
1305
1306         * optimize.c: Include gimple.h instead of tree-gimple.h.
1307         * Make-lang.in (cp-gimplify.o): Depend on tree-iterator.h.
1308         * cp-gimplify.c: Rename tree-gimple.h to gimple.h.  Include
1309         tree-iterator.h.
1310
1311         2008-07-16  Jakub Jelinek  <jakub@redhat.com>
1312
1313         * optimize.c (maybe_clone_body): Clear DECL_SAVED_TREE for the clone.
1314
1315         2008-07-14  Jakub Jelinek  <jakub@redhat.com>
1316
1317         * cp-gimplify.c (cp_gimplify_expr): Update comment.
1318
1319         2008-07-14  Aldy Hernandez  <aldyh@redhat.com>
1320
1321         * cp-tree.h (union lang_tree_node): Rename GENERIC_NEXT to
1322         TREE_CHAIN.
1323         * cp-gimplify.c (cxx_omp_clause_apply_fn): Rename
1324         GIMPLE_MODIFY_STMT to MODIFY_EXPR.
1325         (cxx_omp_clause_copy_ctor): Same.
1326         (cxx_omp_clause_assign_op): Same.
1327
1328         2008-05-28  Jakub Jelinek  <jakub@redhat.com>
1329
1330         * cp-gimplify.c (cp_gimplify_omp_for): Add pre_p argument.  Tuplify.
1331         (cp_gimplify_expr): Adjust caller.
1332
1333         2008-05-11 Doug Kwan  <dougkwan@google.com>
1334
1335         * init.c (build_vec_delete): Add type conversion for argument
1336         0 of POINTER_PLUS_EXPR.
1337
1338         2008-04-29  Doug Kwan  <dougkwan@google.com>
1339
1340         * decl2 (File): Include "gimple.h"
1341         (cp_write_global_declarations): Use gimple_body instead of
1342         DECL_SAVED_TREE.
1343         * Make-lang.in (cp/decl2.o): Add $(GIMPLE_H)
1344
1345         2008-04-10  Diego Novillo  <dnovillo@google.com>
1346
1347         http://gcc.gnu.org/ml/gcc-patches/2008-04/msg00913.html
1348
1349         * optimize.c (maybe_clone_body): Re-enable call to
1350         clone_body.
1351         * cp-gimplify.c (cp_gimplify_omp_for): Mark disabled
1352         code with call to gimple_unreachable.
1353         (cp_genericize): Fix handling of clone bodies.
1354
1355         2008-04-04  Diego Novillo  <dnovillo@google.com>
1356
1357         http://gcc.gnu.org/ml/gcc-patches/2008-04/msg00413.html
1358
1359         * optimize.c (maybe_clone_body): Re-enable.
1360
1361         2008-02-19  Diego Novillo  <dnovillo@google.com>
1362                     Oleg Ryjkov  <olegr@google.com>
1363
1364         http://gcc.gnu.org/ml/gcc-patches/2008-02/msg00804.html
1365
1366         * cp-gimplify.c (gimplify_for_stmt): Change gimple_seq
1367         argument to gimple_seq *.  Update all users.
1368         (gimplify_must_not_throw_expr): Likewise.
1369
1370         2008-02-04  Oleg Ryjkov <olegr@google.com>
1371
1372         * except.c: Include gimple.h
1373         (cp_protect_cleanup_actions): Convert to tuples.
1374         * Make-lang.in (cp/except.o): Add dependency on gimple.h
1375
1376         2007-11-10  Aldy Hernandez  <aldyh@redhat.com>
1377
1378         * cp-gimplify.c (gimplify_cp_loop): Call tree_annotate_all_with_locus
1379         instead of annotating each block manually.
1380
1381         2007-10-30  Aldy Hernandez  <aldyh@redhat.com>
1382
1383         * cp-gimplify.c (gimplify_cp_loop): Tuplify.
1384         (gimplify_for_stmt): Same.
1385         (gimplify_switch_stmt): Same.
1386         (cp_gimplify_expr): [FOR_STMT]: Do not call gimplify_for_stmt.  Return
1387         GS_OK.
1388         [WHILE_STMT]: Return GS_OK.
1389         [SWITCH_STMT]: Same.
1390         [CONTINUE_STMT]: Same.
1391         [BREAK_STMT]: Same.
1392         (cp_genericize): Set gimple_body() of cloned functions when needed.
1393
1394         2007-10-29  Aldy Hernandez  <aldy@quesejoda.com>
1395
1396         * cp-gimplify.c: Move build_gimple_eh_filter_tree here.
1397         (cp_gimplify_init_expr): Convert to tuples.
1398         (gimplify_must_not_throw_expr): Make function return a
1399         gimplify_status and convert to tuples.
1400
1401         2007-10-18  Aldy Hernandez  <aldy@quesejoda.com>
1402
1403         * cp-gimplify.c (genericize_try_block): Enable and do not call
1404         gimplify_stmt.
1405         (genericize_catch_block): Same.
1406         (genericize_eh_spec_block): Same.
1407         Rename gimple_build_eh_filter_tree to build_gimple_eh_filter_tree.
1408         (cp_gimplify_expr): Enable TRY_BLOCK, HANDLER, and EH_SPEC_BLOCK.
1409
1410         2007-10-16  Aldy Hernandez  <aldy@quesejoda.com>
1411
1412         * optimize.c (maybe_clone_body): Comment out call to clone_body.
1413         * decl.c (finish_function): Use gimple_body instead of
1414         DECL_SAVED_TREE.
1415         * cp-tree.h (cp_gimplify_expr): Last 2 arguments are sequences.
1416         * cp-gimplify.c (genericize_try_block): Comment out.
1417         (genericize_catch_block): Same.
1418         (genericize_eh_spec_block): Same.
1419         (gimplify_cp_loop): Comment out calls to gimplify_stmt.
1420         (gimplify_for_stmt): Comment out.
1421         (gimplify_switch_stmt): Comment out call to gimplify_stmt.
1422         (cp_gimplify_omp_for): Same.
1423         (gimplify_must_not_throw_expr): Argument pre_p is a sequence.
1424         Comment out call to gimplify_stmt and append_to_statement_list.
1425         Rename gimple_build_eh_filter_tree to build_gimple_eh_filter_tree.
1426         (cp_gimplify_init_expr): Arguments pre_p and post_p are sequences.
1427         (cp_gimplify_expr): Same.
1428         Comment out calls to genericize_*_block.  Comment out call to
1429         gimplify_for_stmt.
1430
1431 2008-07-27  H.J. Lu  <hongjiu.lu@intel.com>
1432
1433         PR c++/36944
1434         * class.c (type_has_user_provided_default_constructor): Handle
1435         default parameters.
1436
1437 2008-07-27  Paolo Carlini  <paolo.carlini@oracle.com>
1438
1439         * decl.c (push_library_fn): Add a parameter for the exceptions that
1440         the function may throw.
1441         (push_void_library_fn, push_throw_library_fn, expand_static_init):
1442         Adjust.
1443         (build_library_fn): Change to static.
1444         * cp-tree.h: Adjust declarations.
1445         * except.c (declare_nothrow_library_fn): New.
1446         (do_get_exception_ptr, do_begin_catch, do_free_exception,
1447         do_allocate_exception):  Use the latter, adjust the declarations
1448         (ie, add empty exception-specification), consistently with the
1449         actual implementation in libsupc++.
1450
1451 2008-07-25  Jan Hubicka  <jh@suse.cz>
1452
1453         * typeck.c (inline_conversion): Remove.
1454         (cp_build_function_call): Do not use inline_conversion.
1455         * decl.c (duplicate_decls): Do not insist on inline being declared
1456         early.
1457         (start_cleanup_fn): Do not assume that INLINE flags prevent function
1458         from being output.  We now remove static functions always.
1459         (finish_function): Do return warning on all static functions.
1460         * call.c (build_over_call): Do not use inline_conversion.
1461         * cp-tree.h (possibly_inlined_p): Declare.
1462         (inline_conversion): Remove.
1463         * pt.c (instantiate_decl): Use possibly_inlined_p predicate.
1464         * decl2.c (cp_write_global_declarations): Likewise.
1465         (mark_used): Likewise.
1466         (possibly_inlined_p): New functions.
1467
1468 2008-07-25  Jason Merrill  <jason@redhat.com>
1469
1470         * class.c (type_has_user_provided_default_constructor): Handle
1471         templates.
1472
1473 2008-07-23  Jan Hubicka  <jh@suse.cz>
1474
1475         * decl.c (duplicate_decls): Update comment and unit-at-a-time.
1476         (grogfndecl): Drop flag_inline_trees code.
1477         * pt.c (instantiate_decl): Drop flag_iline_trees code.
1478         * lex.c (cxx_init): Do not set unit-at-a-time.
1479
1480 2008-07-23  Jason Merrill  <jason@redhat.com>
1481
1482         * mangle.c (write_unqualified_name): Avoid infinite recursion when
1483         trying to mangle a decl with no name.
1484
1485         Implement defaulted/deleted functions as per N2346
1486         * cp-tree.h (struct lang_decl_flags): Add defaulted_p bitfield.
1487         (DECL_DELETED_FN): New macro.
1488         (DECL_DEFAULTED_FN): New macro.
1489         * class.c (user_provided_p): New fn.
1490         (defaultable_fn_p): New fn.
1491         (type_has_user_provided_constructor): New fn.
1492         (type_has_user_provided_default_constructor): New fn.
1493         (check_methods): A defaulted fn is still trivial.
1494         (check_bases_and_members): Likewise.
1495         * decl.c (grok_special_member_properties): Likewise.
1496         (duplicate_decls): Complain about redeclaring a function as deleted.
1497         (start_decl): initialized==2 means deleted.
1498         (cp_finish_decl): Handle deleted/defaulted semantics.
1499         * decl2.c (grokfield): Likewise.
1500         (mark_used): Check DECL_DEFAULTED_FN instead of DECL_ARTIFICIAL.
1501         Complain about using a deleted fn.
1502         * init.c (build_value_init_1): Use type_has_user_provided_constructor.
1503         (perform_member_init): Check for a user-provided default constructor
1504         even if TYPE_NEEDS_CONSTRUCTING.
1505         (build_new_1): Likewise.
1506         * call.c (build_over_call): Don't call mark_used twice.
1507         * method.c (implicitly_declare_fn): Set DECL_DEFAULTED_FN.
1508         * search.c (check_final_overrider): Check for deleted mismatch.
1509         * parser.c (cp_parser_init_declarator): Tell start_decl about =delete.
1510         (cp_parser_pure_specifier): Handle =default and =delete.
1511
1512         * error.c (maybe_warn_cpp0x): Suggest -std=gnu++0x as well.
1513
1514 2008-07-23  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1515
1516         PR 35058
1517         * typeck.c: All calls to pedwarn changed.
1518         * decl.c: All calls to pedwarn changed.
1519         * call.c: All calls to pedwarn changed.
1520         * error.c: All calls to pedwarn changed.
1521         * typeck2.c: All calls to pedwarn changed.
1522         * pt.c: All calls to pedwarn changed.
1523         * name-lookup.c: All calls to pedwarn changed.
1524         * parser.c: All calls to pedwarn changed.
1525
1526 2008-07-21  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1527
1528         * call.c: Fix comment typos.
1529         * class.c: Likewise.
1530         * cp-tree.h: Likewise.
1531         * cxx-pretty-print.c: Likewise.
1532         * decl.c: Likewise.
1533         * init.c: Likewise.
1534         * name-lookup.c: Likewise.
1535         * operators.def: Likewise.
1536         * parser.c: Likewise.
1537         * pt.c: Likewise.
1538         * tree.c: Likewise.
1539         * typeck.c: Likewise.
1540
1541 2008-07-21  Paolo Carlini  <paolo.carlini@oracle.com>
1542
1543         PR c++/36871
1544         PR c++/36872
1545         * semantics.c (classtype_has_nothrow_assign_or_copy_p): Only check
1546         copy constructors and copy assignment operators proper.
1547
1548 2008-07-21  Rafael Ávila de Espíndola  <espindola@google.com>
1549
1550         * parser.c (cp_token): Remove in_system_header.
1551         (eof_token): Remove in_system_header.
1552         (cp_lexer_get_preprocessor_token): Don't set in_system_header.
1553         (cp_lexer_set_source_position_from_token): Don't set in_system_header.
1554         (cp_parser_member_declaration):  Use in_system_header_at.
1555         * pt.c (lookup_template_class): Don't set DECL_IN_SYSTEM_HEADER.
1556         (pop_tinst_level): Don't set in_system_header.
1557         (instantiate_class_template): Don't set in_system_header.
1558         (instantiate_decl): Don't set in_system_header.
1559         (instantiate_pending_templates): Don't set in_system_header.
1560
1561 2008-07-21  Paolo Carlini  <paolo.carlini@oracle.com>
1562
1563         PR c++/36870
1564         * semantics.c (classtype_has_nothrow_assign_or_copy_p): Use
1565         TYPE_NOTHROW_P, not TREE_NOTHROW.
1566         (trait_expr_value): Likewise.
1567
1568 2008-07-18  Dodji Seketeli  <dseketel@redhat.com>
1569
1570         PR c++/36407
1571         * call.c (convert_like_real): Don't take the error code path
1572           when a rvalue or base conversion has the bad_p field set.
1573
1574 2008-07-18  Kris Van Hees  <kris.van.hees@oracle.com>
1575
1576         * rtti.c (emit_support_tinfos): Add char16_type_node and
1577         char32_type_node.
1578         * typeck2.c (digest_init): Support char16_t and char32_t.
1579
1580 2008-07-18  Kavih R. Ghazi  <ghazi@caip.rutgers.edu>
1581
1582         * cvt.c (convert_to_void): Avoid C++ keywords.
1583         * decl.c (walk_namespaces_r, wrapup_globals_for_namespace):
1584         Likewise.
1585         * friend.c (is_friend): Likewise.
1586         * init.c (perform_member_init): Likewise.
1587         * mangle.c (write_template_prefix, write_template_template_param):
1588         Likewise.
1589         * name-lookup.c (do_namespace_alias, do_using_directive,
1590         parse_using_directive, ambiguous_decl, arg_assoc): Likewise.
1591         * parser.c (cp_parser_template_id, cp_parser_namespace_definition,
1592         cp_parser_objc_typename, cp_parser_objc_method_keyword_params):
1593         Likewise.
1594         * pt.c (is_specialization_of_friend, lookup_template_class,
1595         push_tinst_level, instantiate_class_template,
1596         tsubst_copy_and_build): Likewise.
1597         * tree.c (add_stmt_to_compound): Likewise.
1598         * typeck.c (finish_class_member_access_expr): Likewise.
1599
1600 2008-07-17  Julian Brown  <julian@codesourcery.com>
1601             Mark Mitchell  <mark@codesourcery.com>
1602
1603         * decl2.c (determine_visibility): Allow target to override
1604         visibility of class data.
1605
1606 2008-07-17  Paolo Carlini  <paolo.carlini@oracle.com>
1607
1608         PR c++/36855
1609         * semantics.c (trait_expr_value): Update __has_trivial_destructor
1610         semantics to the current WP (N2691).
1611
1612 2008-07-16  Dodji Seketeli  <dseketel@redhat.com>
1613
1614         PR c++/13699
1615         * name-lookup.c (lookup_extern_c_fun_binding_in_all_ns): New function.
1616         (pushdecl_maybe_friend): Check if a redeclaration of extern C function
1617         complies with exception specification constraints.
1618
1619 2008-07-14  Jason Merrill  <jason@redhat.com>
1620
1621         * lex.c (init_reswords): Always set D_OBJC.
1622
1623 2008-07-11  Tom Tromey  <tromey@redhat.com>
1624             Ian Lance Taylor  <iant@google.com>
1625
1626         * lex.c (struct resword, reswords): Don't define.
1627         (D_EXT, D_ASM, D_OBJC, D_CXX0X): Don't define.
1628         (init_reswords): Clarify mask code.  Use c_common_reswords rather
1629         than reswords.
1630
1631 2008-07-11  Dodji Seketeli  <dseketel@redhat.com>
1632
1633         PR c++/13101
1634         * decl.c (grokdeclarator): Warn about initializing variables
1635         of storage class 'extern' only after the type of the declarator
1636         has been properly computed.
1637
1638 2008-07-11  Dodji Seketeli  <dseketel@redhat.com>
1639
1640         PR c++/31754
1641         * cp-tree.h (struct cp_decl_specifier_seq): Add a location field. It
1642         carries the location of the primary type.
1643         * parser.c (cp_parser_check_type_definition): Update documentation.
1644         (cp_parser_check_for_definition_in_return_type,
1645         cp_parser_check_for_invalid_template_id,
1646         cp_parser_set_decl_spec_type,
1647         cp_parser_check_for_definition_in_return_type,
1648         cp_parser_diagnose_invalid_type_name,
1649         cp_parser_new_expression, cp_parser_explicit_instantiation,
1650         cp_parser_type_specifier, cp_parser_simple_type_specifier,
1651         cp_parser_omp_for_loop, cp_parser_pragma): Use location in error
1652         messages.
1653
1654 2008-07-11 Dodji Seketeli <dseketel@redhat.com>
1655
1656         PR c++/31754
1657         * pt.c, semantic.c:
1658         * semantic.c (qualified_name_lookup_error, finish_id_expression):
1659         Add a location_t parameter so that
1660         error message can have a more accurate location.
1661         * cp-tree.h: Updated prototype
1662         * pt.c (tsubst_qualified_id): Use location in error messages.
1663         * parser.c (cp_parser_postfix_expression,
1664         cp_parser_objc_statement, cp_parser_trait_expr,
1665         cp_parser_token_is_class_key,
1666         cp_parser_uncommitted_to_tentative_parse_p,
1667         cp_parser_check_for_invalid_template_id, cp_parser_is_string_literal,
1668         cp_parser_error, cp_parser_name_lookup_error,
1669         cp_parser_simulate_error, cp_parser_check_decl_spec,
1670         cp_parser_check_decl_spec, cp_parser_non_integral_constant_expression,
1671         cp_parser_diagnose_invalid_type_name,
1672         cp_parser_parse_and_diagnose_invalid_type_name,
1673         cp_parser_require_pragma_eol, cp_parser_make_typename_type,
1674         cp_parser_string_literal, cp_parser_primary_expression,
1675         cp_parser_primary_expression, cp_parser_unqualified_id,
1676         cp_parser_nested_name_specifier_opt, cp_parser_postfix_expression,
1677         cp_parser_postfix_dot_deref_expression, cp_parser_new_expression,
1678         cp_parser_direct_new_declarator, cp_parser_builtin_offsetof,
1679         cp_parser_label_for_labeled_statement, cp_parser_statement_seq_opt,
1680         cp_parser_jump_statement, cp_parser_block_declaration,
1681         cp_parser_simple_declaration, cp_parser_decl_specifier_seq,
1682         cp_parser_function_specifier_opt, cp_parser_decltype,
1683         cp_parser_mem_initializer_list, cp_parser_mem_initializer,
1684         cp_parser_mem_initializer_id, cp_parser_template_parameter,
1685         cp_parser_type_parameter, cp_parser_template_id,
1686         cp_parser_template_name, cp_parser_template_argument): Likewise.
1687
1688 2008-07-09  Paolo Carlini  <paolo.carlini@oracle.com>
1689
1690         PR c++/36760
1691         * pt.c (tsubst_function_type): Remove warning for type qualifiers
1692         on function return type.
1693
1694 2008-07-09  Paolo Carlini  <paolo.carlini@oracle.com>
1695
1696         PR c++/36760
1697         * pt.c (tsubst_function_type): Don't warn for type qualifiers
1698         on function return type in case of system header.
1699
1700 2008-07-09  Raksit Ashok <raksit@google.com>
1701
1702         * parser.c (cp_parser_postfix_expression): New warning based on flag
1703         warn_disallowed_functions.
1704
1705 2008-07-08  Simon Martin  <simartin@users.sourceforge.net>
1706
1707         PR c++/34963
1708         * decl.c (grokdeclarator): Reset storage_class and staticp for friend
1709         functions declared with a storage class qualifier.
1710
1711 2008-07-03  Richard Guenther  <rguenther@suse.de>
1712
1713         PR c++/36128
1714         * typeck.c (cp_build_function_call): Move code to verify
1715         builtin function arguments ...
1716         * call.c (build_cxx_call): ... here.
1717
1718 2008-07-02  Jason Merrill  <jason@redhat.com>
1719
1720         * Make-lang.in (cp/typeck2.o): Add $(REAL_H) dependency.
1721
1722         Implement WG21 N2672, Initializer List proposed wording
1723         * cp-tree.h (enum cp_tree_index): Add CPTI_INIT_LIST_TYPE.
1724         (struct lang_type_class): Add has_list_ctor bitfield.
1725         (TYPE_HAS_LIST_CTOR): New macro.
1726         (BRACE_ENCLOSED_INITIALIZER_P): Expect init_list_type_node.
1727         (CONSTRUCTOR_IS_DIRECT_INIT): New macro.
1728         (LOOKUP_NO_NARROWING): New macro.
1729         (LOOKUP_NO_COPY_CTOR_CONVERSION): New macro.
1730         * parser.c (cp_parse_braced_list): Split out from...
1731         (cp_parser_initializer_clause): ...here.
1732         (cp_parser_postfix_expression): Build up CONSTRUCTOR for compound
1733         literal here.
1734         (cp_lexer_next_token_is_not_keyword): New fn.
1735         (cp_parser_parenthesized_expression_list): Handle { }.
1736         (cp_parser_new_expression, cp_parser_new_initializer): Likewise.
1737         (cp_parser_assignment_expression, cp_parser_condition): Likewise.
1738         (cp_parser_jump_statement, cp_parser_simple_declaration): Likewise.
1739         (cp_parser_mem_initializer, cp_parser_init_declarator): Likewise.
1740         (cp_parser_initializer, cp_parser_functional_cast): Likewise.
1741         (cp_parser_omp_for_loop, cp_parser_cache_group): Likewise.
1742         (cp_parser_save_member_function_body): Likewise.
1743         * call.c (conversion_kind): Add ck_list, ck_aggr.
1744         (struct conversion): Add check_narrowing bitfield, conversion list.
1745         (build_list_conv): New fn.
1746         (build_aggr_conv): New fn.
1747         (implicit_conversion): Call them.
1748         (standard_conversion): Set check_narrowing if appropriate.
1749         (add_function_candidate): Handle LOOKUP_NO_COPY_CTOR_CONVERSION.
1750         (build_user_type_conversion_1): When converting from an init list,
1751         we allow additional conversions except when calling a copy ctor.
1752         (convert_like_real): Calling an explicit ctor for an init list is
1753         ill-formed.  Handle ck_list and ck_addr.  Check narrowing.
1754         (build_new_method_call): If CONSTRUCTOR_IS_DIRECT_INIT is set and
1755         class doesn't have a list ctor, break the {} into a TREE_LIST.
1756         (compare_ics): ck_list is better than other UDCs.
1757         (set_up_extended_ref_temp): Split out from initialize_reference.
1758         (is_std_init_list): New fn.
1759         (is_list_ctor): New fn.
1760         * decl.c (cxx_init_decl_processing): Create init_list_type_node.
1761         (reshape_init_array_1): Pass it to build_constructor.
1762         (reshape_init_class): Ditto.
1763         (initialize_artificial_var): Pass the appropriate type.
1764         (build_aggr_init_full_exprs): Split out from...
1765         (check_initializer): ...here.  Handle new semantics.
1766         (build_init_list_var_init): New subroutine of check_initializer.
1767         (grokdeclarator): Converting constructors can have more than one parm.
1768         (grok_special_member_properties): Set TYPE_HAS_LIST_CTOR.
1769         * init.c (expand_default_init): Only do digest_init for aggregates.
1770         * rtti.c (tinfo_base_init): Pass init_list_type_node to
1771         build_constructor_from_list.
1772         (generic_initializer, ptr_initializer): Ditto.
1773         (ptm_initializer, class_initializer): Ditto.
1774         (get_pseudo_ti_init): Ditto.
1775         * error.c (dump_type): Handle init_list_type_node.
1776         (maybe_warn_cpp0x): New fn.
1777         (maybe_varn_variadic_templates): Call it.
1778         * cvt.c (ocp_convert): Handle conversion from { }.
1779         * tree.c (build_array_of_n_type): New fn.
1780         * typeck2.c (store_init_value): Use init_list_type_node.
1781         (digest_init): Likewise.
1782         (check_narrowing): New fn.
1783         * semantics.c: (finish_compound_literal): Take CONSTRUCTOR instead
1784         of vector of constructor elts.  Handle non-aggregate types.  Make
1785         constant literals static.
1786         * pt.c: (tsubst_copy_and_build): Adjust.
1787         (unify): Handle { }.
1788         * name-lookup.c (arg_assoc_type): Handle init_list_type_node.
1789
1790 2008-07-01  Daniel Jacobowitz  <dan@codesourcery.com>
1791
1792         * typeck.c (comp_ptr_ttypes_real): Use vector_targets_convertible_p.
1793         (comp_ptr_ttypes_const): Likewise.
1794
1795 2008-07-01  Andrew Haley  <aph@redhat.com>
1796
1797         * decl.c (finish_constructor_body): Don't set the return value of
1798         the constructor if the constructor is that of a Java type.
1799
1800 2008-06-30  Jakub Jelinek  <jakub@redhat.com>
1801
1802         PR c++/36662
1803         * decl2.c (is_late_template_attribute): If the first attribute
1804         argument is IDENTIFIER_NODE, don't consider it when checking
1805         if arguments are value or type dependent.
1806
1807 2008-06-29  Paolo Carlini  <paolo.carlini@oracle.com>
1808
1809         PR c++/36655
1810         * pt.c (do_type_instantiation): In c++0x mode do not warn for
1811         extern template.
1812
1813 2008-06-29  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1814
1815         * Make-lang.in (cp-warn): Delete $(CXX_COMPAT_WARN).
1816
1817 2008-06-28  Jakub Jelinek  <jakub@redhat.com>
1818
1819         PR c++/36364
1820         * repo.c (repo_emit_p): Put const static data members initialized
1821         by const expr into *.rpo file, just return 2 if IDENTIFIER_REPO_CHOSEN
1822         for it is 0.
1823
1824 2008-06-27  Paolo Carlini  <paolo.carlini@oracle.com>
1825
1826         PR c++/36655
1827         * pt.c (do_decl_instantiation): In c++0x mode do not warn for
1828         extern template.
1829
1830 2008-06-24  Jonathan Wakely  <jwakely.gcc@gmail.com>
1831
1832         PR c++/23194
1833         * typeck.c (cp_build_function_call): Show example syntax in
1834         diagnostic.
1835
1836 2008-06-21  Jonathan Wakely  <jwakely.gcc@gmail.com>
1837
1838         * typeck.c (composite_pointer_type_r, cxx_sizeof_expr,
1839         cxx_alignof_expr, check_template_keyword, cp_build_binary_op,
1840         pointer_diff, cp_build_unary_op, build_x_compound_expr_from_list,
1841         build_reinterpret_cast_1, cp_build_c_cast, check_return_expr): Change
1842         pedwarn to permerror.
1843         * init.c (perform_member_init, build_new_1, build_new): Likewise.
1844         * decl.c (warn_extern_redeclared_static, duplicate_decls,
1845         * identify_goto, check_previous_goto_1, check_goto, define_label,
1846         check_tag_decl, start_decl, check_class_member_definition_namespace,
1847         grokfndecl, grokdeclarator): Likewise.
1848         * except.c (check_handlers): Likewise.
1849         * typeck2.c (digest_init): Likewise.
1850         * pt.c (check_specialization_namespace,
1851         check_explicit_instantiation_namespace,
1852         maybe_process_partial_specialization, check_explicit_specialization,
1853         convert_template_argument, do_decl_instantiation,
1854         do_type_instantiation, instantiate_decl): Likewise.
1855         * semantics.c (finish_template_type_parm): Likewise.
1856         * name-lookup.c (pushdecl_maybe_friend,
1857         check_for_out_of_scope_variable): Likewise.
1858         * decl2.c (finish_static_data_member_decl, build_anon_union_vars,
1859         coerce_new_type): Likewise.
1860         * parser.c (cp_parser_nested_name_specifier_opt,
1861         cp_parser_mem_initializer, cp_parser_elaborated_type_specifier,
1862         cp_parser_class_head, cp_parser_check_class_key): Likewise.
1863         (cp_parser_parameter_declaration): Check flag_permissive instead of
1864         flag_pedantic_errors.
1865         * call.c (joust): Change pedwarn to warning.
1866         * friend.c (make_friend_class): Likewise.
1867
1868 2008-06-16  Jan Hubicka  <jh@suse.cz>
1869
1870         * method.c: Include cgraph.h.
1871         (use_thunk): Use cgraph_add_new_function instead of calling backend
1872         directly.
1873
1874 2008-06-15  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1875
1876         * parser.c: Fix comment typo.
1877
1878 2008-06-14  Simon Martin  <simartin@users.sourceforge.net>
1879
1880         PR c++/35320
1881         * decl2.c (grokbitfield): Receive the list of attributes, pass it to
1882         grokdeclarator and apply it to the created declaration.
1883         * cp-tree.h (grokbitfield): Update prototype.
1884         * parser.c (cp_parser_member_declaration): Don't apply the attributes
1885         since they are now applied in grokbitfield. Adjusted the call to
1886         grokbitfield.
1887         (cp_parser_objc_class_ivars): Likewise.
1888
1889 2008-06-14  Simon Martin  <simartin@users.sourceforge.net>
1890
1891         PR c++/35317
1892         * class.c (type_requires_array_cookie): Do not consider delete[]
1893         operators with an ellipsis as second argument.
1894
1895 2008-06-09  Jakub Jelinek  <jakub@redhat.com>
1896
1897         PR c++/36408
1898         * semantics.c (stmt_expr_value_expr): Don't crash on empty
1899         STATEMENT_LIST.
1900
1901 2008-06-08  Paolo Carlini  <paolo.carlini@oracle.com>
1902
1903          PR c++/35242
1904          * pt.c (maybe_process_partial_specialization): Check the tree
1905         returned by push_template_decl for error_mark_node.
1906         * parser.c (cp_parser_class_head): Likewise, check the tree
1907         returned by the latter.
1908
1909 2008-06-07  Paolo Carlini  <paolo.carlini@oracle.com>
1910
1911          PR c++/35327
1912          * decl.c (grokdeclarator): In case of wrong return type return
1913         immediately error_mark_node.
1914
1915 2008-06-06  Jakub Jelinek  <jakub@redhat.com>
1916
1917         * cp-tree.h (cxx_omp_finish_clause, cxx_omp_create_clause_info,
1918         dependent_omp_for_p, begin_omp_task, finish_omp_task,
1919         finish_omp_taskwait): New prototypes.
1920         (cxx_omp_clause_default_ctor): Add outer argument.
1921         (finish_omp_for): Add new clauses argument.
1922         * cp-gimplify.c (cxx_omp_finish_clause): New function.
1923         (cxx_omp_predetermined_sharing): Moved from semantics.c, rewritten.
1924         (cxx_omp_clause_default_ctor): Add outer argument.
1925         (cp_genericize_r): Walk OMP_CLAUSE_LASTPRIVATE_STMT.
1926         * cp-objcp-common.h (LANG_HOOKS_OMP_FINISH_CLAUSE): Define.
1927         * parser.c (cp_parser_omp_for_loop): Parse collapsed for loops.
1928         Add par_clauses argument.  If decl is present in parallel's
1929         lastprivate clause, change that clause to shared and add
1930         a lastprivate clause for decl to OMP_FOR_CLAUSES.
1931         Fix wording of error messages.  Adjust finish_omp_for caller.
1932         Add clauses argument.  Parse loops with random access iterators.
1933         (cp_parser_omp_clause_collapse, cp_parser_omp_clause_untied): New
1934         functions.
1935         (cp_parser_omp_for, cp_parser_omp_parallel): Adjust
1936         cp_parser_omp_for_loop callers.
1937         (cp_parser_omp_for_cond, cp_parser_omp_for_incr): New helper
1938         functions.
1939         (cp_parser_omp_clause_name): Handle collapse and untied
1940         clauses.
1941         (cp_parser_omp_clause_schedule): Handle auto schedule.
1942         (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_COLLAPSE
1943         and PRAGMA_OMP_CLAUSE_UNTIED.
1944         (OMP_FOR_CLAUSE_MASK): Add PRAGMA_OMP_CLAUSE_COLLAPSE.
1945         (OMP_TASK_CLAUSE_MASK): Define.
1946         (cp_parser_omp_task, cp_parser_omp_taskwait): New functions.
1947         (cp_parser_omp_construct): Handle PRAGMA_OMP_TASK.
1948         (cp_parser_pragma): Handle PRAGMA_OMP_TASK and
1949         PRAGMA_OMP_TASKWAIT.
1950         * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_COLLAPSE and
1951         OMP_CLAUSE_UNTIED.  Handle OMP_CLAUSE_LASTPRIVATE_STMT.
1952         (tsubst_omp_for_iterator): New function.
1953         (dependent_omp_for_p): New function.
1954         (tsubst_expr) <case OMP_FOR>: Use it.  Handle collapsed OMP_FOR
1955         loops.  Adjust finish_omp_for caller.  Handle loops with random
1956         access iterators.  Adjust for OMP_FOR_{INIT,COND,INCR} changes.
1957         (tsubst_expr): Handle OMP_TASK.
1958         * semantics.c (cxx_omp_create_clause_info): New function.
1959         (finish_omp_clauses): Call it.  Handle OMP_CLAUSE_UNTIED and
1960         OMP_CLAUSE_COLLAPSE.
1961         (cxx_omp_predetermined_sharing): Removed.
1962         * semantics.c (finish_omp_for): Allow pointer iterators.  Use
1963         handle_omp_for_class_iterator and dependent_omp_for_p.  Handle
1964         collapsed for loops.  Adjust c_finish_omp_for caller.  Add new
1965         clauses argument.  Fix check for type dependent cond or incr.
1966         Set OMP_FOR_CLAUSES to clauses.  Use cp_convert instead of
1967         fold_convert to convert incr amount to difference_type.  Only
1968         fold if not in template.  If decl is mentioned in lastprivate
1969         clause, set OMP_CLAUSE_LASTPRIVATE_STMT.  Handle loops with random
1970         access iterators.  Adjust for OMP_FOR_{INIT,COND,INCR}
1971         changes.
1972         (finish_omp_threadprivate): Allow static class members of the
1973         current class.
1974         (handle_omp_for_class_iterator, begin_omp_task, finish_omp_task,
1975         finish_omp_taskwait): New functions.
1976
1977         * parser.c (cp_parser_binary_expression): Add prec argument.
1978         (cp_parser_assignment_expression): Adjust caller.
1979         * cp-tree.h (outer_curly_brace_block): New prototype.
1980         * decl.c (outer_curly_brace_block): No longer static.
1981
1982 2008-06-02  Paolo Carlini  <paolo.carlini@oracle.com>
1983
1984          PR c++/36404
1985          * pt.c (push_template_decl_real): Consistently return error_mark_node
1986         on error.
1987
1988 2008-06-02  Tomas Bily  <tbily@suse.cz>
1989
1990          * typeck.c (is_bitfield_expr_with_lowered_type): Use CASE_CONVERT.
1991          (cp_build_unary_op): Likewise.
1992          (cp_build_indirect_ref): Use CONVERT_EXPR_P.
1993          (maybe_warn_about_returning_address_of_local): Likewise.
1994
1995 2008-05-29  Paolo Carlini  <paolo.carlini@oracle.com>
1996
1997          PR c++/35243
1998          * pt.c (tsubst_initializer_list): Consistently check the tree
1999          returned by tsubst_pack_expansion for error_mark_node.
2000
2001 2008-05-27  Michael Matz  <matz@suse.de>
2002
2003         PR c++/27975
2004         * call.c (build_new_op): Make warning conditional on
2005         OPT_Wenum_compare.
2006
2007 2008-05-27  Alexandre Oliva  <aoliva@redhat.com>
2008
2009         PR c++/35909
2010         * call.c (convert_like_real): Convert bitfield to desired type
2011         before creating temporary.
2012
2013 2008-05-26  Daniel Franke  <franke.daniel@gmail.com>
2014
2015         * Makefile.in: Adjusted dependencies on c-incpath.o.
2016
2017 2008-05-23  Jakub Jelinek  <jakub@redhat.com>
2018
2019         PR c++/36237
2020         * cp-gimplify.c (cxx_omp_clause_apply_fn): Call
2021         fold_build_cleanup_point_expr on build_call_a results.
2022
2023         PR c++/36308
2024         * semantics.c (omp_clause_info_fndecl): New function.
2025         (finish_omp_clauses): Use it.
2026
2027 2008-05-21  Jakub Jelinek  <jakub@redhat.com>
2028
2029         PR c++/36023
2030         * cp-tree.h (check_array_initializer): New prototype.
2031         * decl.c (check_array_initializer): New function.
2032         (check_initializer): Call it.
2033         * semantics.c (finish_compound_literal): Call it for ARRAY_TYPEs.
2034
2035 2008-05-21  Tom Tromey  <tromey@redhat.com>
2036
2037         * mangle.c (save_partially_mangled_name): Remove.
2038         (restore_partially_mangled_name): Likewise.
2039         (write_encoding): Update.
2040         (write_unqualified_name): Likewise.
2041         (start_mangling): Always use name_obstack.  Remove 'ident_p'
2042         argument.
2043         (get_identifier_nocopy): Remove.
2044         (finish_mangling_internal): Rename from finish_mangling.
2045         (finish_mangling): New function.
2046         (finish_mangling_get_identifier): Likewise.
2047         (partially_mangled_name, partially_mangled_name_len): Remove.
2048         (mangle_decl_string): Change return type.  Update.
2049         (mangle_decl, mangle_type_string, mangle_special_for_type,
2050         mangle_ctor_vtbl_for_type, mangle_thunk, mangle_guard_variable,
2051         mangle_ref_init_variable): Update.
2052
2053 2008-05-12  Paolo Carlini  <paolo.carlini@oracle.com>
2054
2055          PR c++/35331
2056          * semantics.c (begin_class_definition): Extend checks on the first
2057         argument.
2058
2059 2008-05-12  Tomas Bily  <tbily@suse.cz>
2060
2061          * typeck2.c (digest_init): Use CONVERT_EXPR_P.
2062          * call.c (build_over_call): Likewise.
2063          * error.c (dump_expr): Use CASE_CONVERT.
2064          * class.c (fixed_type_or_null): Likewise.
2065
2066 2008-05-11  Volker Reichelt  <v.reichelt@netcologne.de>
2067
2068         * parser.c (cp_parser_omp_clause_reduction): Add missing "expected"
2069         in error message.
2070         (cp_parser_omp_clause_schedule): Remove superfluous "expected"
2071         in error message.
2072
2073 2008-05-07  Kenneth Zadeck  <zadeck@naturalbridge.com>
2074
2075         * decl.c (duplicate_decls): Merge in DECL_PURE_P, TREE_READONLY,
2076         DECL_LOOPING_CONST_OR_PURE_P attributes.
2077         * rtti.c (build_dynamic_cast_1): Rename DECL_IS_PURE to
2078         DECL_PURE_P.
2079
2080 2008-05-02  Simon Baldwin  <simonb@google.com>
2081
2082         PR bootstrap/36108
2083         * typeck.c (build_array_ref): Remove warn_array_subscript_range.
2084
2085 2008-05-01  Simon Baldwin  <simonb@google.com>
2086
2087         * typeck.c (build_array_ref): Call warn_array_subscript_range.
2088
2089 2008-04-30  Jakub Jelinek  <jakub@redhat.com>
2090
2091         PR c++/35986
2092         * pt.c (more_specialized_fn): Stop the loop even if there are no
2093         arguments before ellipsis.
2094
2095 2008-04-29  Jakub Jelinek  <jakub@redhat.com>
2096
2097         PR c++/35650
2098         * parser.c (cp_parser_lookup_name): Look through single function
2099         OVERLOAD.
2100
2101         PR c++/35987
2102         * typeck.c (cp_build_modify_expr) <case PREINCREMENT_EXPR>: Don't build
2103         COMPOUND_EXPR if the second argument would be error_mark_node.
2104
2105 2008-04-28  Jason Merrill  <jason@redhat.com>
2106             Liu Guanwei <liu_gw@163.com>
2107
2108         PR c++/57
2109         * parser.c (cp_parser_parameter_declaration): Handle < ambiguity
2110         in default arguments.
2111
2112 2008-04-25  Jan Hubicka  <jh@suse.cz>
2113
2114         * typeck.c (check_return_expr): Update.
2115         * decl.c (start_preparsed_function): Update.
2116         * method.c (use_thunk): Update.
2117
2118 2008-04-24  Jakub Jelinek  <jakub@redhat.com>
2119
2120         PR c++/35758
2121         * cp-tree.h (cp_reconstruct_complex_type): New prototype.
2122         * cp-objcp-common.h (LANG_HOOKS_RECONSTRUCT_COMPLEX_TYPE): Define.
2123         * decl2.c (is_late_template_attribute): Only make vector_size
2124         late tmpl attribute if argument is type or value dependent.
2125         (cp_reconstruct_complex_type): New function.
2126
2127 2008-04-24  Richard Guenther  <rguenther@suse.de>
2128
2129         * typeck.c (cp_build_function_call): Call
2130         check_builtin_function_arguments.
2131
2132 2008-04-23  Paolo Bonzini  <bonzini@gnu.org>
2133
2134         * typeck.c (get_member_function_from_ptrfunc): Don't set TREE_INVARIANT.
2135         (build_ptrmemfunc1): Don't set TREE_INVARIANT.
2136         * init.c (build_zero_init): Don't set TREE_INVARIANT.
2137         * class.c (build_base_path): Don't set TREE_INVARIANT.
2138         (build_vtbl_ref_1): Don't set TREE_INVARIANT.
2139         (build_vtbl_initializer): Don't set TREE_INVARIANT.
2140         * decl.c (build_enumerator): Don't set TREE_INVARIANT.
2141         * rtti.c (tinfo_base_init): Don't set TREE_INVARIANT.
2142         (generic_initializer): Don't set TREE_INVARIANT.
2143         (ptr_initializer): Don't set TREE_INVARIANT.
2144         (ptm_initializer): Don't set TREE_INVARIANT.
2145         (class_initializer): Don't set TREE_INVARIANT.
2146         * typeck2.c (process_init_constructor): Don't set TREE_INVARIANT.
2147         * pt.c (push_inline_template_parms_recursive): Don't set TREE_INVARIANT.
2148         (build_template_parm_index): Don't set TREE_INVARIANT.
2149         (reduce_template_parm_level): Don't set TREE_INVARIANT.
2150         (process_template_parm): Don't set TREE_INVARIANT.
2151
2152 2008-04-22  Jason Merrill  <jason@redhat.com>
2153
2154         PR c++/35316
2155         * semantics.c (finish_decltype_type): Check DECL_BIT_FIELD_TYPE
2156         to see if DECL_BIT_FIELD_TYPE should be used, not some other flag.
2157         * typeck.c (is_bitfield_expr_with_lowered_type): Likewise.
2158
2159 2008-04-22  Jakub Jelinek  <jakub@redhat.com>
2160
2161         PR c++/35747
2162         * semantics.c (finish_stmt_expr): Call pop_stmt_list even if the stmt
2163         expression is errorneous.
2164
2165 2008-04-21  Jason Merrill  <jason@redhat.com>
2166
2167         PR c++/35325
2168         * tree.c (cp_tree_equal): Handle FIXED_CST.
2169
2170         PR c++/35678
2171         * pt.c (template_template_parm_bindings_ok_p): Set
2172         processing_template_decl while in this function.
2173
2174 2008-04-18  Kris Van Hees <kris.van.hees@oracle.com>
2175
2176         * cvt.c (type_promotes_to): Support char16_t and char32_t.
2177         * decl.c (grokdeclarator): Disallow signed/unsigned/short/long on
2178         char16_t and char32_t.
2179         * lex.c (reswords): Add char16_t and char32_t (for c++0x).
2180         * mangle.c (write_builtin_type): Mangle char16_t/char32_t as vendor
2181         extended builtin type "u8char{16,32}_t".
2182         * parser.c (cp_lexer_next_token_is_decl_specifier_keyword): Support
2183         RID_CHAR{16,32}.
2184         (cp_lexer_print_token): Support CPP_STRING{16,32}.
2185         (cp_parser_is_string_literal): Idem.
2186         (cp_parser_string_literal): Idem.
2187         (cp_parser_primary_expression): Support CPP_CHAR{16,32} and
2188         CPP_STRING{16,32}.
2189         (cp_parser_simple_type_specifier): Support RID_CHAR{16,32}.
2190         * tree.c (char_type_p): Support char16_t and char32_t as char types.
2191         * typeck.c (string_conv_p): Support char16_t and char32_t.
2192
2193 2008-04-17  Jason Merrill  <jason@redhat.com>
2194
2195         PR c++/35773
2196         * call.c (build_user_type_conversion_1): Represent second step of
2197         copy-init with an rvalue conversion.
2198         (convert_like_real) [ck_user]: Don't implicitly add it here.
2199
2200 2008-04-15  Jakub Jelinek  <jakub@redhat.com>
2201
2202         PR c/35751
2203         * decl.c (layout_var_decl): If extern or static var has variable
2204         size, set TREE_TYPE (decl) to error_mark_node.
2205
2206 2008-04-16  Danny Smith  <dannysmith@users.sourceforge.net>
2207
2208         PR target/35921
2209         * optimize.c (maybe_clone_body): Copy DECL_DLLIMPORT_P flag
2210         to clone.
2211
2212 2008-04-09  Jason Merrill  <jason@redhat.com>
2213
2214         PR c++/35708
2215         * semantics.c (finish_compound_literal): Return a TARGET_EXPR,
2216         not a pushed variable.
2217
2218 2008-04-09  Volker Reichelt  <v.reichelt@netcologne.de>
2219
2220         * call.c (build_op_delete_call): Fix quotation in warning message.
2221         * decl.c (grokdeclarator): Quote keyword in error message.
2222         * pt.c (check_for_bare_parameter_packs): Fix quotation in error
2223         message.
2224
2225         * parser.c (cp_parser_check_type_definition): Print error string
2226         directly rather than using "%s".
2227         (cp_parser_postfix_expression): Fix quotation.
2228         (cp_parser_decltype): Likewise.
2229         (cp_parser_sizeof_operand): Fix quotation. Simplify.
2230
2231         * parser.c (cp_parser_non_integral_constant_expression): Build error
2232         message with CONCAT rather than using "%s".
2233         (cp_parser_primary_expression): Fix quotation.
2234         (cp_parser_postfix_expression): Likewise.
2235         (cp_parser_postfix_dot_deref_expression): Likewise.
2236         (cp_parser_unary_expression): Likewise.
2237         (cp_parser_new_expression): Likewise.
2238         (cp_parser_delete_expression): Likewise.
2239
2240         * parser.c (cp_parser_asm_specification_opt): Print CPP_CLOSE_PAREN
2241         as `)', not as `('.  Fix quotation.
2242         (cp_parser_consume_semicolon_at_end_of_statement): Fix quotation.
2243         (cp_parser_primary_expression): Likewise.
2244         (cp_parser_nested_name_specifier_opt): Likewise.
2245         (cp_parser_postfix_expression): Likewise.
2246         (cp_parser_postfix_open_square_expression): Likewise.
2247         (cp_parser_parenthesized_expression_list): Likewise.
2248         (cp_parser_pseudo_destructor_name): Likewise.
2249         (cp_parser_new_expression): Likewise.
2250         (cp_parser_direct_new_declarator): Likewise.
2251         (cp_parser_delete_expression): Likewise.
2252         (cp_parser_cast_expression): Likewise.
2253         (cp_parser_question_colon_clause): Likewise.
2254         (cp_parser_builtin_offsetof): Likewise.
2255         (cp_parser_trait_expr): Likewise.
2256         (cp_parser_label_for_labeled_statement): Likewise.
2257         (cp_parser_compound_statement): Likewise.
2258         (cp_parser_selection_statement): Likewise.
2259         (cp_parser_condition): Likewise.
2260         (cp_parser_iteration_statement): Likewise.
2261         (cp_parser_already_scoped_statement): Likewise.
2262         (cp_parser_simple_declaration): Likewise.
2263         (cp_parser_linkage_specification): Likewise.
2264         (cp_parser_static_assert): Likewise.
2265         (cp_parser_decltype): Likewise.
2266         (cp_parser_conversion_function_id): Likewise.
2267         (cp_parser_operator_function_id): Likewise.
2268         (cp_parser_operator): Likewise.
2269         (cp_parser_type_parameter): Likewise.
2270         (cp_parser_template_id): Likewise.
2271         (cp_parser_explicit_instantiation): Likewise.
2272         (cp_parser_explicit_specialization): Likewise.
2273         (cp_parser_enum_specifier): Likewise.
2274         (cp_parser_namespace_definition): Likewise.
2275         (cp_parser_namespace_alias_definition): Likewise.
2276         (cp_parser_using_declaration): Likewise.
2277         (cp_parser_using_directive): Likewise.
2278         (cp_parser_asm_definition): Likewise.
2279         (cp_parser_direct_declarator): Likewise.
2280         (cp_parser_ptr_operator): Likewise.
2281         (cp_parser_parameter_declaration_clause): Likewise.
2282         (cp_parser_initializer_clause): Likewise.
2283         (cp_parser_class_specifier): Likewise.
2284         (cp_parser_member_specification_opt): Likewise.
2285         (cp_parser_member_declaration): Likewise.
2286         (cp_parser_pure_specifier): Likewise.
2287         (cp_parser_constant_initializer): Likewise.
2288         (cp_parser_base_clause): Likewise.
2289         (cp_parser_exception_specification_opt): Likewise.
2290         (cp_parser_try_block): Likewise.
2291         (cp_parser_function_try_block): Likewise.
2292         (cp_parser_handler): Likewise.
2293         (cp_parser_throw_expression): Likewise.
2294         (cp_parser_asm_operand_list): Likewise.
2295         (cp_parser_attributes_opt): Likewise.
2296         (cp_parser_label_declaration): Likewise.
2297         (cp_parser_constructor_declarator_p): Likewise.
2298         (cp_parser_template_declaration_after_export): Likewise.
2299         (cp_parser_single_declaration): Likewise.
2300         (cp_parser_objc_message_expression): Likewise.
2301         (cp_parser_objc_message_args): Likewise.
2302         (cp_parser_objc_encode_expression): Likewise.
2303         (cp_parser_objc_defs_expression): Likewise.
2304         (cp_parser_objc_protocol_expression): Likewise.
2305         (cp_parser_objc_selector_expression): Likewise.
2306         (cp_parser_objc_protocol_refs_opt): Likewise.
2307         (cp_parser_objc_typename): Likewise.
2308         (cp_parser_objc_method_keyword_params): Likewise.
2309         (cp_parser_objc_superclass_or_category): Likewise.
2310         (cp_parser_objc_try_catch_finally_statement): Likewise.
2311         (cp_parser_objc_synchronized_statement): Likewise.
2312         (cp_parser_objc_throw_statement): Likewise.
2313         (cp_parser_omp_var_list_no_open): Likewise.
2314         (cp_parser_omp_clause_default): Likewise.
2315         (cp_parser_omp_clause_if): Likewise.
2316         (cp_parser_omp_clause_num_threads): Likewise.
2317         (cp_parser_omp_clause_reduction): Likewise.
2318         (cp_parser_omp_clause_schedule): Likewise.
2319         (cp_parser_omp_critical): Likewise.
2320         (cp_parser_omp_for_loop): Likewise.
2321         (cp_parser_omp_sections_scope): Likewise.
2322
2323         * parser.c (cp_parser_template_parameter_list): Simplify.
2324
2325 2008-04-07  James E. Wilson  <wilson@tuliptree.org>
2326
2327         * pt.c (tsubst_copy, case SIZEOF_EXPR): Initialize len.
2328
2329 2008-04-07  Jason Merrill  <jason@redhat.com>
2330
2331         PR c++/35734
2332         * class.c (type_has_user_nondefault_constructor): A template
2333         counts as a nondefault constructor.
2334
2335 2008-04-04  Paolo Bonzini  <bonzini@gnu.org>
2336
2337         * decl.c (cxx_push_function_context): Delete.
2338         (cxx_pop_function_context): Delete.
2339         (start_preparsed_function): Merge cxx_push_function_context (!f->decl
2340         code only).
2341         * cp-objcp-common.h (LANG_HOOKS_FUNCTION_INIT,
2342         LANG_HOOKS_FUNCTION_FINAL): Delete.
2343         (LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P): Rename to
2344         LANG_HOOKS_MISSING_NORETURN_OK_P.
2345         * cp-tree.h (cxx_push_function_context, cxx_pop_function_context):
2346         Delete prototype.
2347         * semantics.c (current_stmt_tree): Fix comment.
2348
2349 2008-04-03  Jakub Jelinek  <jakub@redhat.com>
2350
2351         PR c++/35741
2352         * semantics.c (finish_offsetof): Undo effect of convert_from_reference
2353         before calling fold_offsetof.
2354
2355 2008-04-03  Tom Tromey  <tromey@redhat.com>
2356
2357         * Make-lang.in (c++_OBJS): New variable.
2358
2359 2008-04-03  Paolo Bonzini  <bonzini@gnu.org>
2360
2361         * optimize.c (clone_body): New, from tree-inline.c.
2362
2363 2008-04-03  Paolo Bonzini  <bonzini@gnu.org>
2364
2365          * method.c (synthesize_method): Use {push,pop}_function_context.
2366          * name-lookup.c (push_to_top_level): Likewise.
2367          * parser.c (cp_parser_late_parsing_for_member): Likewise.
2368
2369 2008-03-30  Volker Reichelt  <v.reichelt@netcologne.de>
2370
2371         PR c++/35578
2372         * parser.c (cp_parser_decl_specifier_seq): Add location to error
2373         message.
2374
2375 2008-03-27  Tom Tromey  <tromey@redhat.com>
2376
2377         * Make-lang.in: Revert automatic dependency patch.
2378
2379 2008-03-27  Douglas Gregor  <doug.gregor@gmail.com>
2380
2381         PR obj-c++/35704
2382         * typeck.c (build_x_compound_expr): Use cp_build_compound_expr.
2383         (build_compound_expr): New, for compatibility with C
2384         build_compound_expr.
2385         (cp_build_compound_expr): Renamed from build_compound_expr.
2386         (build_c_cast): New, for compatibility with C build_c_cast.
2387         (cp_build_c_cast): Renamed from build_c_cast.
2388         * init.c (build_vec_delete_1): Fix calls to build_compound_expr.
2389         * decl.c (cxx_maybe_build_cleanup): Ditto.
2390         * cp-tree.h (build_compound_expr): Add C-compatibile prototype.
2391         (cp_build_compound_expr): Renamed from build_compound_expr.
2392         (build_c_cast): Add C-compatible prototype.
2393         (cp_build_c_cast): Renamed from build_c_cast.
2394         * typeck2.c (build_functional_cast): Use cp_build_c_cast.
2395         * parser.c (cp_parser_cast_expression): Fix call to build_c_cast.
2396
2397 2008-03-27  Douglas Gregor  <doug.gregor@gmail.com>
2398
2399         * pt.c (tsubst_copy) <case SIZEOF_EXPR>: Cope with
2400         tsubst_pack_expansion returning a pack expansion, or a TREE_VEC
2401         ending in a pack expansion, both of which can occur when
2402         substituting into a nested template.
2403         (tsubst_copy_and_build) <case SIZEOF_EXPR>: When we're
2404         instantiating the sizeof...(X) form, make tsubst_copy do the work.
2405         * parser.c (cp_parser_template_parameter): Deal with unnamed
2406         non-type template parameter packs identified by pack expansions in
2407         the parameter type.
2408
2409 2008-03-26  Jakub Jelinek  <jakub@redhat.com>
2410
2411         PR c++/35546
2412         * pt.c (apply_late_template_attributes): Don't call tsubst on
2413         first attribute argument if it is IDENTIFIER_NODE.
2414
2415         PR c++/35332
2416         * error.c (dump_expr): Pass {,UN}ORDERED_EXPR, UN{LT,LE,GT,GE,EQ}_EXPR
2417         and LTGT_EXPR to pp_expression.
2418
2419 2008-03-26  Douglas Gregor  <doug.gregor@gmail.com>
2420
2421         * pt.c (coerce_template_template_parm): Moved the body of the loop
2422         of coerce_template_template_parms here, to make iteration over a
2423         template argument pack simpler.
2424         Also, allow matching of a template parameter pack in the template
2425         template parameter to a template parameter in the template
2426         template argument.
2427         (coerce_template_template_parms): Deal with variadic template
2428         template parameters. Use coerce_template_template_parm.
2429         (unify): Make sure we coerce the template template argument's
2430         template arguments to the template template parameter's template
2431         parameters, not the other way around.
2432
2433 2008-03-25  Tom Tromey  <tromey@redhat.com>
2434
2435         * Make-lang.in: Remove .o targets.
2436         (cp/g++spec.o): Moved to cp/.  Reduce to variable setting.
2437         (GXX_OBJS): Update.
2438         (c++_OBJS): New variable.
2439         (CXX_TREE_H, CXX_PRETTY_PRINT_H): Remove.
2440
2441 2008-03-25  Douglas Gregor  <doug.gregor@gmail.com>
2442
2443         * typeck.c (composite_pointer_type_r): Add SFINAE support.
2444         (composite_pointer_type): Ditto.
2445         (common_type): Fix call to composite_pointer_type.
2446         (cxx_sizeof_nowarn): New; used to be a macro.
2447         (cxx_sizeof_expr): Add SFINAE support.
2448         (cxx_alignof_expr): Ditto.
2449         (decay_conversion): Fix calls for SFINAE support.
2450         (rationalize_conditional_expr): Add SFINAE support.
2451         (build_class_member_access_expr): Ditto.
2452         (finish_class_member_access_expr): Ditto.
2453         (build_x_indirect_ref): Ditto.
2454         (build_indirect_ref): Original version renamed to
2455         cp_build_indirect_ref; new version provides a bridge from
2456         c-common.
2457         (cp_build_indirect_ref): Was build_indirect_ref; added SFINAE
2458         support.
2459         (get_member_function_from_ptrfunc): Fix calls for SFINAE support.
2460         (build_function_call): Original version renamed to
2461         cp_build_function_call; new version provides a bridge from
2462         c-common.
2463         (cp_build_function_call): Was build_function_call; added SFINAE
2464         support.
2465         (convert_arguments): Add SFINAE support.
2466         (build_x_binary_op): Ditto.
2467         (build_binary_op): Original version renamed to cp_build_binary_op;
2468         new version provides a bridge from c-common.
2469         (cp_build_binary_op): Was build_binary_op; added SFINAE support.
2470         (pointer_diff): Fix calls for SFINAE.
2471         (build_x_unary_op): Add SFINAE support.
2472         (condition_conversion): Fix calls for SFINAE.
2473         (build_unary_op): Original version renamed to cp_build_unary_op;
2474         new version provides a bridge from c-common.
2475         (cp_build_unary_op): Was build_unary_op; added SFINAE support.
2476         (unary_complex_lvalue): Fix calls for SFINAE.
2477         (build_x_conditional_expr): Add SFINAE support.
2478         (build_x_compound_expr_from_list): Fix calls for SFINAE.
2479         (build_x_compound_expr): Add SFINAE support.
2480         (convert_ptrmem): Fix calls for SFINAE.
2481         (build_static_cast_1): Add SFINAE support.
2482         (build_static_cast): Ditto.
2483         (build_reinterpret_cast_1): Ditto.
2484         (build_reinterpret_cast): Ditto.
2485         (build_const_cast_1): Ditto.
2486         (build_const_cast): Ditto.
2487         (build_c_cast): Ditto.
2488         (build_modify_expr): Original version renamed to
2489         cp_build_modify_expr; new version provides a bridge from c-common.
2490         (cp_build_modify_expr): Was build_modify_expr; added SFINAE
2491         support.
2492         (build_x_modify_expr): Add SFINAE support.
2493         (build_ptrmemfunc): Fix calls for SFINAE.
2494         (convert_for_assignment): Add SFINAE support.
2495         (convert_for_initialization): Ditto.
2496         (check_return_expr): Fix calls for SFINAE.
2497         (lvalue_or_else): Add SFINAE support.
2498         * init.c (perform_member_init): Fix calls for SFINAE.
2499         (emit_mem_initializers): Ditto.
2500         (expand_virtual_init): Ditto.
2501         (expand_cleanup_for_base): Ditto.
2502         (build_aggr_init): Add SFINAE support.
2503         (expand_default_init): Ditto.
2504         (expand_aggr_init_1): Fix calls for SFINAE.
2505         (build_offset_ref): Ditto.
2506         (build_new_1): Add SFINAE support.
2507         (build_new): Ditto.
2508         (build_vec_delete_1): Fix calls for SFINAE.
2509         (get_temp_regvar): Ditto.
2510         (build_vec_init): Add SFINAE support.
2511         (build_dtor_call): Fix calls for SFINAE.
2512         (build_delete): Ditto.
2513         (push_base_cleanups): Ditto.
2514         (build_vec_delete_1): Ditto.
2515         * class.c (build_base_path): Fix calls for SFINAE.
2516         (build_simple_base_path): Ditto.
2517         (convert_to_base_statically): Ditto.
2518         (build_vfn_ref): Ditto.
2519         (resolve_address_of_overloaded_function): Ditto.
2520         * decl.c (check_initializer): Fix calls for SFINAE.
2521         (register_dtor_fn): Ditto.
2522         (compute_array_index_type): Ditto.
2523         (finish_enum): Ditto.
2524         (start_preparsed_function): Ditto.
2525         (cxx_maybe_build_cleanup): Ditto.
2526         * call.c (convert_like): Add COMPLAIN argument.
2527         (convert_like_with_context): Ditto.
2528         (build_this): Fix calls for SFINAE.
2529         (build_user_type_conversion): Ditto.
2530         (resolve_args): Ditto.
2531         (build_new_function_call): Add SFINAE support.
2532         (build_operator_new_call): Fix calls for SFINAE.
2533         (build_object_call): Add SFINAE support.
2534         (build_conditional_expr): Ditto.
2535         (build_new_op): Ditto.
2536         (build_op_delete_call): Fix calls for SFINAE.
2537         (build_temp): Ditto.
2538         (convert_like_real): Add SFINAE support.
2539         (build_x_va_arg): Fix calls for SFINAE.
2540         (convert_default_arg): Ditto.
2541         (build_over_call): Add SFINAE support.
2542         (build_java_interface_fn_ref): Fix calls for SFINAE.
2543         (build_special_member_call): Add SFINAE support.
2544         (build_new_method_call): Ditto.
2545         (perform_implicit_conversion): Ditto.
2546         (perform_direct_initialization_if_possible): Ditto.
2547         (initialize_reference): Fix calls for SFINAE.
2548         * method.c (do_build_assign_ref): Fix calls for SFINAE.
2549         * rtti.c (build_headof): Fix calls for SFINAE.
2550         (get_tinfo_decl_dynamic): Ditto.
2551         (get_typeid): Ditto.
2552         (build_dynamic_cast_1): Add SFINAE support.
2553         (build_dynamic_cast): Ditto.
2554         (tinfo_base_init): Fix calls for SFINAE.
2555         * except.c (do_get_exception_ptr): Fix calls for SFINAE.
2556         (do_end_catch): Ditto.
2557         (initialize_handler_parm): Ditto.
2558         (expand_start_catch_block): Ditto.
2559         (do_allocate_exception): Ditto.
2560         (do_free_exception): Ditto.
2561         (build_throw): Ditto.
2562         * cvt.c (build_up_reference): Fix calls for SFINAE.
2563         (convert_to_reference): Ditto.
2564         (ocp_convert): Ditto.
2565         (convert_to_void): Add SFINAE support.
2566         * tree.c (build_dummy_object): Fix calls for SFINAE.
2567         (stabilize_expr): Ditto.
2568         * cp-tree.h (build_conditional_expr): Add tsubst_flags_t
2569         parameter.
2570         (build_new_method_call): Ditto.
2571         (build_special_member_call): Ditto.
2572         (build_new_op): Ditto.
2573         (perform_implicit_conversion): Ditto.
2574         (perform_direct_initialization_if_possible): Ditto.
2575         (convert_to_void): Ditto.
2576         (build_aggr_init): Ditto.
2577         (build_new): Ditto.
2578         (build_vec_init): Ditto.
2579         (build_dynamic_cast): Ditto.
2580         (finish_call_expr): Ditto
2581         (cxx_sizeof_or_alignof_expr): Add COMPLAIN parameter.
2582         (cxx_sizeof_nowarn): Remove macro; add function declaration.
2583         (build_class_member_access_expr): Add tsubst_flags_t parameter.
2584         (finish_class_member_access_expr): Ditto.
2585         (build_x_indirect_ref): Ditto.
2586         (cp_build_indirect_ref): New.
2587         (cp_build_function_call): Add tsubst_flags_t parameter.
2588         (build_x_unary_op): Ditto.
2589         (cp_build_unary_op): New.
2590         (build_x_conditional_expr): Add tsubst_flags_t parameter.
2591         (build_x_compound_expr): Ditto.
2592         (build_compound_expr): Ditto.
2593         (build_static_cast): Ditto.
2594         (build_reinterpret_cast): Ditto.
2595         (build_const_cast): Ditto.
2596         (build_c_cast): Ditto.
2597         (build_x_modify_expr): Ditto.
2598         (cp_build_modify_expr): New.
2599         (convert_for_initialization): Add tsubst_flags_t parameter.
2600         (cp_build_binary_op): Remove macro; add function declaration.
2601         (invalid_nonstatic_memfn_p): Add tsubst_flags_t parameter.
2602         (lvalue_or_else): Ditto.
2603         (build_functional_cast): Ditto.
2604         * typeck2.c (digest_init): Fix calls for SFINAE.
2605         (process_init_constructor_array): Ditto.
2606         (process_init_constructor_record): Ditto.
2607         (build_x_arrow): Ditto.
2608         (build_m_component_ref): Ditto.
2609         (build_functional_cast): Add SFINAE support.
2610         * pt.c (tsubst_copy_and_build): Add (more) SFINAE support.
2611         * semantics.c (simplify_loop_decl_cond): Fix calls for SFINAE.
2612         (finish_expr_stmt): Ditto.
2613         (finish_for_expr): Ditto.
2614         (finish_asm_stmt): Ditto.
2615         (finish_non_static_data_member): Ditto.
2616         (finish_qualified_id_expr): Ditto.
2617         (finish_call_expr): Add SFINAE support.
2618         (finish_increment_expr): Fix calls for SFINAE.
2619         (finish_unary_op_expr): Ditto.
2620         (simplify_aggr_init_expr): Ditto.
2621         (finish_omp_clauses): Ditto.
2622         (finish_omp_for): Ditto.
2623         (finish_omp_barrier): Ditto.
2624         (finish_omo_flush): Ditto.
2625         * decl2.c (grok_array_decl): Fix calls or SFINAE.
2626         (build_anon_union_vars): Ditto.
2627         (get_guard_cond): Ditto.
2628         (set_guard): Ditto.
2629         (one_static_initialization_or_destruction): Ditto.
2630         (do_static_initialization_or_destruction): Ditto.
2631         (generate_ctor_or_dtor_function): Ditto.
2632         (build_offset_ref_call_from_tree): Ditto.
2633         * parser.c (cp_parser_postfix_expression): Fix calls for SFINAE.
2634         (cp_parser_postfix_dot_deref_expression): Ditto.
2635         (cp_parser_unary_expression): Ditto.
2636         (cp_parser_new_expression): Ditto.
2637         (cp_parser_cast_expression): Ditto.
2638         (cp_parser_binary_expression): Ditto.
2639         (cp_parser_question_colon_clause): Ditto.
2640         (cp_parser_assignment_expression): Ditto.
2641         (cp_parser_expression): Ditto.
2642         (cp_parser_builtin_offsetof): Ditto.
2643         (cp_parser_template_argument): Ditto.
2644         (cp_parser_functional_cast): Ditto.
2645
2646 2008-03-24  Tom Tromey  <tromey@redhat.com>
2647
2648         * lex.c (handle_pragma_interface): Don't copy the filename.
2649         (handle_pragma_implementation): Copy filename using xstrdup.
2650
2651 2008-03-21  Paolo Carlini  <pcarlini@suse.de>
2652
2653         * cp-tree.h (IS_AGGR_TYPE): Rename to MAYBE_CLASS_TYPE_P.
2654         (SET_IS_AGGR_TYPE): Rename to SET_CLASS_TYPE_P.
2655         (IS_AGGR_TYPE_CODE): Rename to RECORD_OR_UNION_CODE_P.
2656         (PROMOTES_TO_AGGR_TYPE): Remove.
2657         (CLASS_TYPE_P, TYPE_NON_AGGREGATE_CLASS): Adjust.
2658         * typeck.c (unary_complex_lvalue, build_modify_expr,
2659         convert_for_initialization): Adjust.
2660         * init.c (is_aggr_type): Remove.
2661         (is_class_type): Add.
2662         (build_offset_ref, build_new_1, build_vec_delete_1, build_vec_init,
2663         build_delete): Adjust.
2664         * lex.c (make_aggr_type): Remove.
2665         (make_class_type): Add.
2666         (cxx_make_type): Adjust.
2667         * class.c (finish_struct_1, fixed_type_or_null, is_empty_class):
2668         Adjust.
2669         * decl.c (build_typename_type, make_typename_type,
2670         make_unbound_class_template, cxx_init_decl_processing,
2671         check_tag_decl, groktypename, start_decl_1, layout_var_decl,
2672         check_initializer, cp_finish_decl, build_ptrmemfunc_type, grokparms,
2673         grok_op_properties, xref_tag, check_function_type): Adjust.
2674         * call.c (check_dtor_name, standard_conversion, implicit_conversion,
2675         add_builtin_candidate, add_builtin_candidates,
2676         build_user_type_conversion_1, convert_like_real, build_cxx_call,
2677         is_subseq, compare_ics): Adjust.
2678         * method.c (use_thunk): Adjust.
2679         * rtti.c (build_dynamic_cast_1, create_pseudo_type_info,
2680         create_tinfo_types): Adjust.
2681         * cvt.c (cp_convert_to_pointer, convert_to_pointer_force,
2682         build_up_reference, convert_to_reference, convert_from_reference,
2683         ocp_convert, build_expr_type_conversion): Adjust.
2684         * tree.c (bind_template_template_parm, error_type): Adjust.
2685         * dump.c (cp_dump_tree): Adjust.
2686         * search.c (lookup_member): Adjust.
2687         * friend.c (make_friend_class, do_friend): Adjust.
2688         * typeck2.c (store_init_value, process_init_constructor_array,
2689         process_init_constructor_record, build_x_arrow, build_m_component_ref,
2690         build_functional_cast): Adjust.
2691         * pt.c (finish_member_template_decl, process_template_parm,
2692         lookup_template_class, tsubst_function_type, tsubst,
2693         tsubst_copy_and_build, get_template_base, bt_instantiate_type_proc):
2694         Adjust.
2695         * semantics.c (begin_class_definition, finish_base_specifier,
2696         finish_typeof, cxx_omp_predetermined_sharing, finish_decltype_type):
2697         Adjust.
2698         * name-lookup.c (constructor_name_p, push_overloaded_decl,
2699         do_class_using_decl, lookup_qualified_name,
2700         maybe_process_template_type_declaration): Adjust.
2701         * decl2.c (grok_array_decl, check_member_template,
2702         constrain_class_visibility): Adjust.
2703         * parser.c (cp_parser_class_name): Adjust.
2704
2705 2008-03-18  Paolo Bonzini  <bonzini@gnu.org>
2706
2707          * cp-lang.c (LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS): Delete.
2708
2709 2008-03-17  Jason Merrill  <jason@redhat.com>
2710
2711         PR c++/35548
2712         * call.c (reference_binding): Check LOOKUP_NO_TEMP_BIND when binding
2713         a temp directly to a reference as per DR391.
2714
2715 2008-03-12  Richard Guenther  <rguenther@suse.de>
2716
2717         PR c++/35469
2718         Revert:
2719         2008-02-04  Richard Guenther  <rguenther@suse.de>
2720
2721          PR java/35035
2722          * decl.c (record_builtin_java_type): Make jboolean a
2723          integer type again where its mode doesn't match that of bool.
2724
2725         2008-01-25  Richard Guenther  <rguenther@suse.de>
2726
2727          PR c++/33887
2728          * decl.c (record_builtin_java_type): Make __java_boolean
2729          a variant of bool.
2730          * typeck.c (structural_comptypes): Move TYPE_FOR_JAVA check
2731          after TYPE_MAIN_VARIANT check.
2732
2733 2008-03-10  Jakub Jelinek  <jakub@redhat.com>
2734
2735         PR c++/35328
2736         * semantics.c (finish_omp_clauses): Look through NOP_EXPR even
2737         if errorcount.
2738
2739         PR c++/35337
2740         * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
2741         DECL_P in not a variable and appears more than once error messages.
2742
2743 2008-03-07  Paolo Bonzini  <bonzini@gnu.org>
2744
2745         Revert:
2746
2747         2008-02-06  Douglas Gregor  <doug.gregor@gmail.com>
2748
2749         PR c++/35049
2750         PR c++/35096
2751         * typeck.c (structural_comptypes): Call cp_comptypes.
2752         (comptypes): New; called from the C/C++ common bits to perform
2753         strict checks.
2754         (cp_comptypes): Renamed from comptypes, which is already used,
2755         with a different signature, by the C++ front end.
2756         (build_reinterpret_cast_1): Call cp_comptypes.
2757         (ptr_reasonably_similar): Ditto.
2758         * decl.c (decls_match): Ditto.
2759         * cvt.c (convert_to_reference): Ditto.
2760         * cp-tree.h (same_type_p): Ditto.
2761         (same_or_base_type_p): Ditto.
2762         (comptypes): Rename to cp_comptypes.
2763         * pt.c (canonical_type_parameter): Call cp_comptypes.
2764
2765 2008-03-07  Paolo Bonzini  <bonzini@gnu.org>
2766
2767         * cp-objcp-common.c (cxx_types_compatible_p): Remove obsolete
2768         test for equivalence between pointer and references.
2769
2770 2008-03-02  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2771
2772         PR 24924
2773         * class.c (finish_struct_anon): Use permerror instead of pedwarn.
2774         (check_field_decls): Likewise.
2775         (note_name_declared_in_class): Likewise.
2776         * call.c (build_new_op): Likewise.
2777         (convert_like_real): Likewise.
2778         (build_over_call): Likewise.
2779         * lex.c (unqualified_fn_lookup_error): Likewise.
2780         * parser.c (cp_parser_template_id): Likewise.
2781         * cvt.c (warn_ref_binding): Likewise.
2782         (convert_to_reference): Likewise.
2783         (ocp_convert): Likewise.
2784         (convert_to_void): Use error instead of pedwarn.
2785         * error.c (cp_cpp_error): Use pedantic_warning_kind.
2786         * decl.c (compute_array_index_type): Use constant_expression_error.
2787
2788 2008-03-01  Douglas Gregor  <doug.gregor@gmail.com>
2789
2790         * parser.c (cp_lexer_next_token_is_decl_specifier_keyword): Note
2791         that auto is either a storage class or a simple type specifier,
2792         depending on the dialect.
2793         (cp_parser_decl_specifier_seq): Complain about `auto' as a storage
2794         specifier in C++98 mode, error in C++0x mode (since we don't
2795         support auto as a type specifier, yet).
2796         (cp_parser_storage_class_specifier_opt): Don't treat `auto' as a
2797         storage specifier in C++0x mode.
2798         (cp_parser_simple_type_specifier): Parse `auto' as a
2799         simple-type-specifier, but error because we don't support it yet.
2800
2801 2008-02-29  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2802
2803         * parser.c (cp_parser_nonclass_name): New.
2804         (cp_parser_pseudo_destructor_name): Use it instead of
2805         cp_parser_type_name.
2806         (cp_parser_type_name): Move code to cp_parser_nonclass_name.
2807
2808 2008-02-29  Tom Tromey  <tromey@redhat.com>
2809
2810         * parser.c (struct cp_token) <input_file_stack_index>: Remove.
2811         (cp_lexer_get_preprocessor_token): Update.
2812         (cp_lexer_set_source_position_from_token): Don't call
2813         restore_input_file_stack.
2814         * lex.c (cxx_init): Don't use push_srcloc or pop_srcloc.
2815
2816 2008-02-28  Richard Guenther  <rguenther@suse.de>
2817
2818         Revert:
2819         2008-02-26  Richard Guenther  <rguenther@suse.de>
2820
2821         * decl.c (duplicate_decls): Remove decl from global mapping
2822         before ggc_freeing it.
2823
2824 2008-02-27  Jakub Jelinek  <jakub@redhat.com>
2825
2826         PR c++/35368
2827         * rtti.c: Include c-pragma.h.
2828         (push_abi_namespace, pop_abi_namespace): New functions.
2829         (build_dynamic_cast_1, tinfo_base_init, get_pseudo_ti_index,
2830         create_tinfo_types, emit_support_tinfos): Use them.
2831         * Make-lang.in (cp/rtti.o): Depend on $(C_PRAGMA_H).
2832
2833 2008-02-26  Jason Merrill  <jason@redhat.com>
2834
2835         PR c++/35315
2836         * decl.c (grokdeclarator): Allow a typedef of an unnamed struct
2837         to name the struct for linkage purposes even if it has attributes.
2838         (start_decl): In that case, set ATTR_FLAG_TYPE_IN_PLACE.
2839
2840 2008-02-26  Tom Tromey  <tromey@redhat.com>
2841
2842         * parser.c (eof_token): Remove old location code.
2843         (check_empty_body): Remove test of USE_MAPPED_LOCATION.
2844         * decl2.c (generate_ctor_or_dtor_function): Remove old location
2845         code.
2846         (cp_write_global_declarations): Likewise.
2847         * lex.c (cxx_init): Remove old location code.
2848         (handle_pragma_implementation): Remove test of
2849         USE_MAPPED_LOCATION.
2850         * pt.c (tsubst): Remove old location code.
2851         * error.c (cp_print_error_function): Remove test of
2852         USE_MAPPED_LOCATION.
2853         * decl.c (pop_label): Remove old location code.
2854         (finish_function): Likewise.
2855
2856 2008-02-26  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2857
2858         PR 26264
2859         * call.c (magic_varargs_p):  Remove BUILT_IN_STDARG_START.
2860
2861 2008-02-26  Richard Guenther  <rguenther@suse.de>
2862
2863         * decl.c (duplicate_decls): Remove decl from global mapping
2864         before ggc_freeing it.
2865
2866 2008-02-26  Paolo Carlini  <pcarlini@suse.de>
2867
2868          PR c++/35323
2869          * name-lookup.c (arg_assoc_type): Handle FIXED_POINT_TYPE.
2870
2871 2008-02-26  Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2872
2873         * typeck.c (build_class_member_access_expr): Add appropriate
2874         OPT_W* parameter to warning.
2875         (build_reinterpret_cast_1): Likewise.
2876         * name-lookup.c (push_overloaded_decl): Likewise.
2877
2878 2008-02-25  Paolo Carlini  <pcarlini@suse.de>
2879
2880          PR c++/35333
2881          * error.c (dump_expr): Handle CONJ_EXPR.
2882
2883 2008-02-25  Paolo Carlini  <pcarlini@suse.de>
2884
2885          PR c++/35338
2886          * error.c (dump_type): Handle FIXED_POINT_TYPE.
2887         (dump_expr): Handle FIXED_CST.
2888
2889 2008-02-24  Jason Merrill  <jason@redhat.com>
2890
2891         * parser.c (cp_parser_declaration): Handle "inline namespace".
2892         (cp_parser_namespace_definition): Likewise.
2893
2894         PR c++/33486
2895         * name-lookup.c (arg_assoc_namespace): Look down into inline
2896         namespaces, too.
2897
2898 2008-02-23  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2899
2900         * typeck.c (check_for_casting_away_constness): Use 1 single
2901         argument, the type of cast, to decide what diagnostics generate.
2902         (build_static_cast_1): Remove unused code. Update call to
2903         check_for_casting_away_constness.
2904         (build_reinterpret_cast_1): Update call to
2905         check_for_casting_away_constness.
2906         (build_const_cast_1): Likewise.
2907
2908 2008-02-24  Paolo Carlini  <pcarlini@suse.de>
2909
2910         * error.c (dump_expr): Don't deal directly with NEW_EXPR (and
2911         VEC_NEW_EXPR), forward to pp_expression.
2912         * cxx-pretty-print.c (pp_cxx_new_expression): Fix FIXME.
2913
2914 2008-02-24  Danny Smith  <dannysmith@users.sourceforge.net>
2915
2916         PR c++/34749
2917         * friend.c (do_friend): Call cplus_decl_attributes earlier.
2918
2919 2008-02-22  Andrew Pinski  <andrew_pinski@playstation.sony.com>
2920
2921         PR C++/34715
2922         * decl.c (duplicate_decls): Merge DECL_DISREGARD_INLINE_LIMITS for
2923         template decls' function decl.
2924
2925 2008-02-22  Paolo Carlini  <pcarlini@suse.de>
2926
2927         PR c++/35282
2928         Revert:
2929         2008-02-14  Paolo Carlini  <pcarlini@suse.de>
2930
2931          PR c++/28743
2932          * pt.c (determine_specialization): In case of function templates,
2933         when the type of DECL does not match FN there is no match.
2934
2935 2008-02-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2936
2937         PR c/19999
2938         * typeck.c (build_binary_op): Warn about floating point
2939         comparisons if FLOAT_TYPE_P, not only for REAL_TYPE.
2940
2941 2008-02-19  Jason Merrill  <jason@redhat.com>
2942
2943         PR c++/34950
2944         * pt.c (resolve_overloaded_unification): Set processing_template_decl
2945         while we look for possible bindings.
2946
2947 2008-02-19  Jakub Jelinek  <jakub@redhat.com>
2948
2949         PR c++/35028
2950         * cp-gimplify.c (cxx_omp_clause_apply_fn): Handle vararg copy ctors.
2951
2952         PR c++/34964
2953         PR c++/35244
2954         * semantics.c (finish_omp_threadprivate): Do nothing for error_operand_p
2955         vars.  Afterwards ensure v is VAR_DECL.
2956
2957         PR c++/35078
2958         * parser.c (cp_parser_omp_for_loop): If DECL has REFERENCE_TYPE, don't
2959         call cp_finish_decl.
2960         * semantics.c (finish_omp_for): Fail if DECL doesn't have integral type
2961         early.
2962
2963 2008-02-15  Douglas Gregor  <doug.gregor@gmail.com>
2964
2965         PR c++/35023
2966         PR c++/35024
2967         PR c++/35026
2968         * pt.c (finish_member_template_decl): If the type in a TYPE_DECL
2969         is error_mark_node, return an error early.
2970         (find_parameter_packs_r): Pass the pointer set along to recursive
2971         calls of cp_walk_subtrees; don't try to manage the pointer set
2972         ourselves.
2973         (uses_parameter_packs): Pass the pointer set to cp_walk_tree.
2974         (make_pack_expansion): Ditto.
2975         (check_for_bare_parameter_packs): Ditto. Also, don't bother taking
2976         a second pass through the tree with find_parameter_packs_r; that
2977         second pass no longer does anything.
2978         (push_template_decl_real): If we have an erroneous declaration,
2979         set its type to error_mark_node before returning an error.
2980
2981 2008-02-14  Douglas Gregor  <doug.gregor@gmail.com>
2982
2983         PR c++/34050
2984         * pt.c (tsubst_initializer_list): Deal with the use of
2985         VOID_TYPE_NODE to indicate value-initialization of the bases.
2986
2987 2008-02-14  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2988             Jason Merrill  <jason@redhat.com>
2989
2990         PR c++/5645
2991         PR c++/11159
2992         * class.c (type_has_user_nondefault_constructor): New fn.
2993         * cp-tree.h: Declare it.
2994         * init.c (emit_mem_initializers): Use it for -W warning about
2995         missing base initializer.
2996
2997 2008-02-14  Paolo Carlini  <pcarlini@suse.de>
2998
2999          PR c++/28743
3000          * pt.c (determine_specialization): In case of function templates,
3001         when the type of DECL does not match FN there is no match.
3002
3003 2008-02-13  Jakub Jelinek  <jakub@redhat.com>
3004             Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3005
3006         PR c++/35138
3007         * parser.c (cp_parser_pseudo_destructor_name): If next tokens
3008         are not identifier :: ~, return before calling cp_parser_type_name.
3009
3010 2008-02-13  Jason Merrill  <jason@redhat.com>
3011
3012         PR c++/34962, c++/34937, c++/34939
3013         * decl2.c (is_late_template_attribute): Always defer attributes
3014         vector_size and weak.
3015
3016         PR c++/34774
3017         * pt.c (value_dependent_expression_p): Look into DECL_INITIAL
3018         of enumerators, too.
3019
3020 2008-02-12  Jason Merrill  <jason@redhat.com>
3021
3022         PR c++/34824
3023         * call.c (convert_like_real): Pass LOOKUP_NO_CONVERSION to build_temp
3024         if we're doing conversions to call a user-defined conversion function.
3025
3026 2008-02-12  Steven Bosscher  <steven@gcc.gnu.org>
3027
3028         PR c++/29048
3029         * semantics.c (finish_qualified_id_expr): Avoid duplicate access
3030         check here, too.
3031
3032 2008-02-12  Jakub Jelinek  <jakub@redhat.com>
3033
3034         PR c++/34862
3035         * init.c (build_new_1): Don't create placement_expr before
3036         constructing alloc_call.  Verify that the pointer is passed by
3037         value to operator new.
3038
3039 2008-02-11  Jason Merrill  <jason@redhat.com>
3040
3041         PR c++/35097
3042         * pt.c (tsubst): Don't look up a template typedef in an explicit
3043         specialization.
3044
3045 2008-02-11  Douglas Gregor  <doug.gregor@gmail.com>
3046
3047         PR c++/35113
3048         * tree.c (cp_build_qualified_type_real): When building a
3049         cv-qualified array type, build it as a unique type with
3050         build_cplus_array_type_1 and then adopt the unqualified type's
3051         main variant.
3052
3053 2008-02-11  Paolo Carlini  <pcarlini@suse.de>
3054
3055         PR c++/35077
3056         * decl.c (groktypename): Check grokdeclarator return.
3057
3058 2008-02-10  Jason Merrill  <jason@redhat.com>
3059
3060         PR c++/34094
3061         * decl2.c (cp_write_global_declarations): Don't write out static
3062         data members with DECL_IN_AGGR_P set.
3063
3064 2008-02-08  Jason Merrill  <jason@redhat.com>
3065
3066         PR c++/35116
3067         * tree.c (build_target_expr_with_type): Handle void initializer.
3068         (bot_manip): Remap slot before recursing.
3069
3070 2008-02-06  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
3071
3072         PR other/35107
3073         * Make-lang.in (cc1plus-dummy, cc1plus): Add $(GMPLIBS).
3074
3075 2008-02-06  Alexandre Oliva  <aoliva@redhat.com>
3076
3077         PR c++/35056
3078         * tree.c: Include tree-flow.h.
3079         (build_target_expr): Check type compatibility.
3080         * Make-lang.in (cp/tree.o): Depend on $(TREE_FLOW_H).
3081         * call.c (convert_like_real): Convert bitfield to expected type.
3082
3083 2008-02-06  Douglas Gregor  <doug.gregor@gmail.com>
3084
3085         PR c++/35049
3086         PR c++/35096
3087         * typeck.c (structural_comptypes): Call cp_comptypes.
3088         (comptypes): New; called from the C/C++ common bits to perform
3089         strict checks.
3090         (cp_comptypes): Renamed from comptypes, which is already used,
3091         with a different signature, by the C++ front end.
3092         (build_reinterpret_cast_1): Call cp_comptypes.
3093         (ptr_reasonably_similar): Ditto.
3094         * decl.c (decls_match): Ditto.
3095         * cvt.c (convert_to_reference): Ditto.
3096         * cp-tree.h (same_type_p): Ditto.
3097         (same_or_base_type_p): Ditto.
3098         (comptypes): Rename to cp_comptypes.
3099         * pt.c (canonical_type_parameter): Call cp_comptypes.
3100
3101 2008-02-05  Jakub Jelinek  <jakub@redhat.com>
3102
3103         PR c++/33553
3104         * pt.c (tsubst) <case INTEGER_TYPE>: Don't issue error if max is
3105         value dependent expression.
3106
3107 2008-02-05  Douglas Gregor  <doug.gregor@gmail.com>
3108
3109         PR c++/35074
3110         * decl2.c (save_template_attributes): When we're modifying the
3111         TYPE_MAIN_VARIANT to add new attributes, be sure to also modify
3112         all of the other variants to add those same attributes. Otherwise,
3113         the main variant will be inconsistent with those other variants.
3114
3115 2008-02-04  Richard Guenther  <rguenther@suse.de>
3116
3117         PR java/35035
3118         * decl.c (record_builtin_java_type): Make jboolean a
3119         integer type again where its mode doesn't match that of bool.
3120
3121 2008-02-02  Jason Merrill  <jason@redhat.com>
3122             Mark Mitchell  <mark@codesourcery.com>
3123
3124         PR c++/33916
3125         * init.c (build_value_init_1): New function.
3126         (build_value_init): New function.
3127         * typeck2.c (build_functional_cast): Call it.
3128         * cp-gimplify.c (cp_gimplify_init_expr): Handle its output.
3129
3130         * cp-tree.h (TYPE_HAS_USER_CONSTRUCTOR): Rename from
3131         TYPE_HAS_CONSTRUCTOR.
3132         * class.c (finish_struct_bits, maybe_warn_about_overly_private_class,
3133         add_implicitly_declared_members): Adjust.
3134         (check_field_decls): Adjust. Remove warnings about reference/const
3135         in class without constructor.
3136         (check_bases_and_members): Adjust.  Give those warnings here instead.
3137         * decl.c (fixup_anonymous_aggr): Adjust.
3138         (check_initializer): Adjust, clarify logic slightly.
3139         (grok_special_member_properties): Adjust, only set if user-provided.
3140         * rtti.c (create_tinfo_types): Don't set.
3141         * cvt.c (ocp_convert): Remove exception for vtable_entry_type et al.
3142         Use same_type_ignoring_top_level_qualifiers_p.
3143         * pt.c (check_explicit_specialization): Adjust.
3144         (instantiate_class_template): Adjust.
3145
3146 2008-01-31  Douglas Gregor  <doug.gregor@gmail.com>
3147             Jakub Jelinek  <jakub@redhat.com>
3148
3149         PR c++/34935
3150         PR c++/34936
3151         * typeck.c (structural_comptypes): Handle comparisons of
3152         VOID_TYPE, BOOLEAN_TYPE, INTEGER_TYPE, FIXED_POINT_TYPE, and
3153         REAL_TYPE nodes.
3154         * mangle.c (write_builtin_type): Map down to the canonical type,
3155         which will be one of the predefined type nodes.
3156
3157 2008-01-29  Michael Meissner  <michael.meissner@amd.com>
3158
3159         PR 35004
3160         * cp-tree.h (struct full_lang_decl): Make tree_code bitfield 16
3161         bits to allow for expansion of the number of middle end tree
3162         codes.
3163
3164 2008-01-29  Douglas Gregor  <doug.gregor@gmail.com>
3165
3166         PR c++/34055
3167         PR c++/34103
3168         PR c++/34219
3169         PR c++/34606
3170         PR c++/34753
3171         PR c++/34754
3172         PR c++/34755
3173         PR c++/34919
3174         PR c++/34961
3175         * typeck.c (check_return_expr): Tweak call to
3176         check_for_bare_parameter_packs.
3177         * class.c (add_method): Be careful with error_mark_nodes.
3178         * cp-tree.h (check_for_bare_parameter_packs): Remove "*" from
3179         signature.
3180         * pt.c (struct find_parameter_pack_data): Remove
3181         SET_PACKS_TO_ERROR.
3182         (find_parameter_packs_r): Don't use SET_PACKS_TO_ERROR.
3183         (uses_parameter_packs): Don't set SET_PACKS_TO_ERROR.
3184         (make_pack_expansion): Ditto.
3185         (check_for_bare_parameter_packs): Parameter is now a tree, not a
3186         tree*.
3187         (process_template_parm): Tweak call to
3188         check_for_bare_parameter_packs.
3189         (push_template_decl_real): Tweak calls to
3190         check_for_bare_parameter_packs. If bare parameter packs are found
3191         in the list of exceptions, clear out that list after giving an
3192         error.
3193         * semantics.c (finish_cond): Tweak call to
3194         check_for_bare_parameter_packs.
3195         (finish_expr_stmt): Ditto.
3196         (finish_for_expr): Ditto.
3197         (finish_switch_cond): Ditto.
3198         (finish_mem_initializers): Ditto.
3199         (finish_member_declaration): Ditto.
3200         (finish_static_assert): Check for bare parameter packs in the
3201         condition.
3202         * decl2.c (cplus_decl_attributes): Check for bare parameter packs in the
3203         attributes of a declaration.
3204         * parser.c (cp_parser_using_declaration): Tweak call to
3205         check_for_bare_parameter_packs.
3206         (cp_parser_base_clause): Ditto.
3207
3208 2008-01-28  Jason Merrill  <jason@redhat.com>
3209
3210         PR c++/35007
3211         * class.c (build_base_path): Fix !want_pointer case.
3212
3213 2008-01-27  Jason Merrill  <jason@redhat.com>
3214
3215         PR c++/27177
3216         * class.c (build_base_path): Fix previous change.
3217
3218 2008-01-26  Jakub Jelinek  <jakub@redhat.com>
3219
3220         PR c++/34965
3221         * error.c (dump_expr): Handle TRUTH_AND_EXPR, TRUTH_OR_EXPR
3222         and TRUTH_XOR_EXPR.
3223
3224 2008-01-26  Richard Guenther  <rguenther@suse.de>
3225
3226         PR c++/34235
3227         * typeck.c (build_binary_op): Remove code to shorten compares.
3228
3229 2008-01-25  Richard Guenther  <rguenther@suse.de>
3230
3231         PR c++/33887
3232         * decl.c (record_builtin_java_type): Make __java_boolean
3233         a variant of bool.
3234         * typeck.c (structural_comptypes): Move TYPE_FOR_JAVA check
3235         after TYPE_MAIN_VARIANT check.
3236
3237 2008-01-25  Jason Merrill  <jason@redhat.com>
3238
3239         PR c++/27177
3240         * class.c (build_base_path): Don't mess with virtual access if
3241         skip_evaluation.
3242         * call.c (standard_conversion): Don't check whether source type
3243         is complete.
3244
3245         * decl2.c (is_late_template_attribute): Don't defer attribute
3246         visibility just because the type is dependent.
3247
3248 2008-01-25  Jason Merrill  <jason@redhat.com>
3249             Mark Mitchell  <mark@codesourcery.com>
3250
3251         PR c++/31780
3252         * call.c (standard_conversion): Allow conversion from integer/real
3253         to complex.
3254         (compare_ics): Such a conversion is worse than a normal arithmetic
3255         conversion.
3256
3257 2008-01-25  Richard Guenther  <rguenther@suse.de>
3258
3259         PR c++/33887
3260         * cp-lang.c (LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS): Define
3261         to true.
3262
3263 2008-01-24  Paolo Carlini  <pcarlini@suse.de>
3264
3265          PR c++/34603
3266          * pt.c (push_template_decl_real): Return error_mark_node in case
3267         of template definition of non-template.
3268
3269 2008-01-24  Jason Merrill  <jason@redhat.com>
3270
3271         PR c++/34913
3272         * decl2.c (is_late_template_attribute): Defer any attribute with
3273         dependent args.  Also defer type attributes if the type is dependent.
3274
3275 2008-01-22  Jakub Jelinek  <jakub@redhat.com>
3276             Alexandre Oliva  <aoliva@redhat.com>
3277
3278         PR c++/33984
3279         * call.c (reference_binding): For bitfields use the declared bitfield
3280         type.
3281         (add_builtin_candidates): Likewise.
3282         * class.c (layout_class_type): For bitfields copy over the
3283         original type quals.
3284
3285 2008-01-22  Jason Merrill  <jason@redhat.com>
3286
3287         PR c++/28560
3288         * decl.c (groktypename): Also ignore attributes on dependent
3289         possibly-class types.
3290
3291         PR c++/34912
3292         * friend.c (do_friend): Check for prior declaration of a friend
3293         function of a local class.
3294         * name-lookup.c (lookup_name_innermost_nonclass_level):
3295         No longer static.
3296         * name-lookup.h: Declare it.
3297
3298 2008-01-22  Tom Tromey  <tromey@redhat.com>
3299
3300         PR c++/34829:
3301         * init.c (build_new_1): Only disallow Java aggregates.
3302
3303 2008-01-22  Jakub Jelinek  <jakub@redhat.com>
3304
3305         PR c++/34607
3306         * semantics.c (finish_omp_for): Don't call c_finish_omp_for
3307         if decl or init is error_mark_node.
3308
3309         PR c++/34918
3310         * error.c (dump_expr): Handle VECTOR_CST.
3311
3312 2008-01-21  Jason Merrill  <jason@redhat.com>
3313
3314         PR c++/33959
3315         * pt.c (tsubst_aggr_type): Make sure our context is complete.
3316
3317         PR c++/34573
3318         * pt.c (retrieve_local_specialization): Robustify.
3319         (tsubst_pack_expansion, tsubst_decl): Remove redundant checks.
3320
3321         PR c++/34846
3322         * pt.c (tsubst): Only call retrieve_local_specialization if the
3323         original typedef was in a function template.
3324
3325         PR c++/34196
3326         * decl.c (wrap_cleanups_r): Set TRY_CATCH_IS_CLEANUP.
3327
3328 2008-01-21  Richard Guenther  <rguenther@suse.de>
3329
3330         PR c++/34850
3331         * error.c (cp_print_error_function): Deal with recursive
3332         BLOCK trees.
3333
3334 2008-01-20  Paolo Carlini  <pcarlini@suse.de>
3335
3336          PR c++/34891
3337          * error.c (dump_expr): Deal with VIEW_CONVERT_EXPR.
3338
3339 2008-01-20  Paolo Carlini  <pcarlini@suse.de>
3340
3341          PR c++/34776
3342         PR c++/34486
3343          * name-lookup.c (do_class_using_decl): Do not call constructor_name_p
3344         on non-IS_AGGR_TYPE scope.
3345         (constructor_name_p): Assert IS_AGGR_TYPE.
3346
3347 2008-01-18  Ian Lance Taylor  <iant@google.com>
3348
3349         PR c++/33407
3350         * decl.c (duplicate_decls): Copy DECL_IS_OPERATOR_NEW flag.
3351         (grok_op_properties): For NEW_EXPR and VEC_NEW_EXPR set
3352         DECL_IS_OPERATOR_NEW flag.
3353
3354 2008-01-16  Richard Guenther  <rguenther@suse.de>
3355
3356         PR c++/33819
3357         * typeck.c (is_bitfield_expr_with_lowered_type): Recurse
3358         for conversions to type variants.
3359
3360 2008-01-15  Andreas Tobler  <a.tobler@schweiz.org>
3361
3362         * parser.c (cp_parser_template_parameter): Fix C90 issue with mixing
3363         declaration and code.  Update copyright year.
3364
3365 2008-01-15  Douglas Gregor  <doug.gregor@gmail.com>
3366
3367         PR c++/34399
3368         * friend.c (do_friend): Don't query TYPE_BEING_DEFINED unless we
3369         know we have a class type.
3370
3371 2008-01-15  Douglas Gregor  <doug.gregor@gmail.com>
3372
3373         PR c++/34751
3374         * pt.c (coerce_template_parameter_pack): When substituting into
3375         the type of a non-type template parameter pack. use the
3376         deduced/substituted arguments.
3377         * parser.c (declarator_can_be_parameter_pack): A pointer-to-member
3378         can be a parameter pack with the ellipsis following it.  When we
3379         have an erroneous declaration, allow it to be a parameter pack.
3380         (cp_parser_template_parameter): Complain about default
3381         arguments on non-type template parameter packs, and parse them
3382         using the new cp_parser_default_argument.
3383         (cp_parser_parameter_declaration): Complain about parameter packs
3384         with default arguments. Move parsing of default arguments into a
3385         new function, cp_parser_default_argument.
3386         (cp_parser_default_argument): New; extracted from
3387         cp_parser_parameter_declaration.
3388
3389 2008-01-15  Douglas Gregor  <doug.gregor@gmail.com>
3390
3391         PR c++/34051
3392         PR c++/34055
3393         PR c++/34102
3394         PR c++/34103
3395         * typeck.c (check_return_expr): If there are bare parameter packs
3396         in the return value, set it to error_mark_node.
3397         * tree.c (cp_walk_subtrees): Walk USING_DECL nodes.
3398         * pt.c (find_parameter_packs_r): Look at the type of
3399         IDENTIFIER_NODEs (e.g., for user-defined conversions).
3400         (check_for_bare_parameter_packs): Flip the result: now returns
3401         TRUE when there were bare parameter packs, FALSE otherwise.
3402         (push_template_decl_real): Deal with flipped result of
3403         check_for_bare_parameter_packs.
3404         * semantics.c (finish_cond): If there are bare parameter packs in
3405         the conditional, set it to error_mark_node.
3406         (finish_expr_stmt): If there are bare parameter packs in the
3407         expression, set it to error_mark_node.
3408         (finish_for_expr): Ditto.
3409         (finish_switch_cond): If there are bare parameter packs in
3410         the conditional, set it to error_mark_node.
3411         (finish_mem_initializers): If there are bare parameter packs in
3412         the member initializer, set it to error_mark_node.
3413         (finish_member_declaration): Check the attributes of the
3414         declaration for bare parameter packs, and remove the attributes if
3415         any have bare parameter packs.
3416         * parser.c (cp_parser_using_declaration): Check the using
3417         declaration for bare parameter packs.
3418         (cp_parser_base_clause): If there are bare parameter packs in a
3419         base specifier, don't add it to the chain.
3420
3421 2008-01-15  Douglas Gregor  <doug.gregor@gmail.com>
3422
3423         PR c++/34314
3424         * error.c (dump_simple_decl): Display ellipsis for template
3425         non-type parameter packs.
3426         (dump_decl): Display ellipsis for template type parameter packs.
3427         (dump_template_decl): Display ellipsis for template template
3428         parameter packs.
3429         * pt.c (redeclare_class_template): When redeclaring a class
3430         template, check for collisions between template parameters and
3431         template parameter packs.
3432
3433 2008-01-15  Douglas Gregor  <doug.gregor@gmail.com>
3434
3435         PR c++/33964
3436         * pt.c (process_partial_specialization): Don't mark template
3437         parameters that occur in non-deduced contexts.
3438         (struct pair_fn_data): Add include_nondeduced_p.
3439         (for_each_template_parm_r): Only visit non-deduced contexts if
3440         include_nondeduced_p is set.
3441         (for_each_template_parm): Added parameter include_nondeduced_p,
3442         which states whether template parameters found in non-deduced
3443         contexts should be visited.
3444         (uses_template_parms): Visit all template parameters, even those
3445         in non-deduced contexts.
3446
3447 2008-01-15  Douglas Gregor  <doug.gregor@gmail.com>
3448
3449         PR c++/34052
3450         * pt.c (check_default_tmpl_args): Check for parameter packs that
3451         aren't at the end of a primary template.
3452         (push_template_decl_real): Remove check for parameter packs that
3453         aren't at the end of a primary template; that now happens in
3454         check_default_tmpl_args.
3455         * semantics.c (finish_template_template_parm): Use
3456         check_default_tmpl_args to check for errors in the template
3457         parameter list.
3458
3459 2008-01-12  Doug Kwan  <dougkwan@google.com>
3460
3461         * decl.c: (grokdeclarator): Use OPT_Wignored_qualifiers
3462         instead of OPT_Wreturn_type in warning due to ignored return type
3463         qualifiers.
3464         * pt.c: (tsubst_function_type): Use OPT_Wignored_qualifiers
3465         instead of OPT_Wreturn_type in warning due to ignored return type
3466         qualifiers.
3467
3468 2008-01-08  Jakub Jelinek  <jakub@redhat.com>
3469
3470         PR c++/33890
3471         * semantics.c (finish_omp_for): Don't call
3472         fold_build_cleanup_point_expr if processing_template_decl.
3473
3474 2008-01-04  Paolo Carlini  <pcarlini@suse.de>
3475             Jakub Jelinek  <jakub@redhat.com>
3476
3477         PR c++/34611
3478         * error.c (dump_template_argument): Deal with TREE_LIST.
3479
3480 2008-01-01  Douglas Gregor  <doug.gregor@gmail.com>
3481
3482         * parser.c (cp_parser_check_decl_spec): Don't warn about "long
3483         long" in C++0x mode; change the warning to note that "long long"
3484         is only unsupported in C++98 mode.
3485
3486 2007-12-20  Jason Merrill  <jason@redhat.com>
3487
3488         PR c++/34111
3489         * call.c (standard_conversion): Derived-to-base is considered a
3490         standard conversion.
3491
3492 2007-12-19  Jakub Jelinek  <jakub@redhat.com>
3493
3494         PR c++/34513
3495         * parser.c (cp_parser_omp_parallel): For non-combined parallel
3496         call cp_parser_statement rather than
3497         cp_parser_already_scoped_statement.
3498
3499 2007-12-18  Jason Merrill  <jason@redhat.com>
3500
3501         PR c++/34206
3502         * pt.c (tsubst_aggr_type): Do nothing if the type already doesn't
3503         use template parms.
3504         (dependent_type_p_r): Handle the domain of an array.
3505
3506 2007-12-18  Douglas Gregor  <doug.gregor@gmail.com>
3507              Jakub Jelinek  <jakub@redhat.com>
3508
3509         PR c++/32565
3510         PR c++/33943
3511         PR c++/33965
3512         * pt.c (template_template_parm_bindings_ok_p): New; verifies
3513         bindings of template template parameters after all template
3514         arguments have been deduced.
3515         (coerce_template_parms): Don't complain when COMPLAIN doesn't
3516         include tf_error.
3517         (fn_type_unification): Use template_template_parm_bindings_ok_p.
3518         (unify): Deal with variadic, bound template template parameters.
3519         (get_class_bindings): Use template_template_parm_bindings_ok_p.
3520
3521 2007-12-18  Jakub Jelinek  <jakub@redhat.com>
3522
3523         PR c++/34488
3524         * decl.c (grokdeclarator): Reject friend sfk_constructor
3525         FUNCTION_TYPE.
3526
3527 2007-12-17  Jakub Jelinek  <jakub@redhat.com>
3528
3529         PR c/34506
3530         * parser.c (cp_parser_omp_all_clauses): Accept optional comma
3531         in between clauses.
3532
3533 2007-12-15  Alexandre Oliva  <aoliva@redhat.com>
3534
3535         PR debug/7081
3536         * cp-lang.c (cp_classify_record): New.
3537         (LANG_HOOKS_CLASSIFY_RECORD): Override.
3538
3539 2007-12-11  Jakub Jelinek  <jakub@redhat.com>
3540
3541         PR c++/34238
3542         * decl2.c (cp_write_global_declarations): Revert 2007-11-22 change.
3543
3544         PR c++/34364
3545         * rtti.c (build_dynamic_cast): Call convert_from_reference even for
3546         dynamic_cast in a template.
3547
3548 2007-12-10  Simon Martin  <simartin@users.sourceforge.net>
3549
3550         PR c++/34059
3551         * typeck.c (build_class_member_access_expr): Compute MEMBER_SCOPE from
3552         MEMBER's BASELINK_ACCESS_BINFO instead of its BASELINK_BINFO.
3553
3554 2007-12-10  Jakub Jelinek  <jakub@redhat.com>
3555
3556         PR c++/34395
3557         * error.c (dump_type_prefix, dump_type_suffix): Handle
3558         TYPE_PACK_EXPANSION.
3559
3560         PR c++/34394
3561         * error.c (dump_expr): Handle ABS_EXPR.
3562
3563 2007-12-09  Jakub Jelinek  <jakub@redhat.com>
3564
3565         PR c++/34178
3566         PR c++/34340
3567         * repo.c (repo_emit_p): Return 2 for DECL_INTEGRAL_CONSTANT_VAR_P
3568         in class scope rather than DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
3569         Return 2 also if DECL_EXPLICIT_INSTANTIATION.
3570         * decl2.c (import_export_decl): Don't make VAR_DECLs import_p when
3571         flag_use_repository and repo_emit_p returned 2.
3572
3573 2007-12-06  Jakub Jelinek  <jakub@redhat.com>
3574
3575         PR c++/34336
3576         * tree.c (stabilize_call, stabilize_init): Do nothing if
3577         processing_template_decl.
3578
3579 2007-12-05  Jakub Jelinek  <jakub@redhat.com>
3580
3581         PR c++/34271
3582         * semantics.c (finish_decltype_type): For SCOPE_REF issue an
3583         error instead of assertion failure.
3584         * parser.c (cp_parser_decltype): If closing paren is not found,
3585         return error_mark_node.
3586
3587 2007-12-04  Douglas Gregor  <doug.gregor@gmail.com>
3588
3589         PR c++/34101
3590         * name-lookup.c (arg_assoc_template_arg): Recurse on argument
3591         packs.
3592         (arg_assoc_type): We don't need to handle TYPE_ARGUMENT_PACK here,
3593         since arg_assoc_template_arg will deal with them (better).
3594
3595 2007-12-04  Douglas Gregor  <doug.gregor@gmail.com>
3596
3597         PR c++/33509
3598         * pt.c (tsubst_exception_specification): Handle substitutions into
3599         member templates, where tsubst_pack_expansion returns a
3600         TYPE_PACK_EXPANSION.
3601
3602 2007-12-04  Douglas Gregor  <doug.gregor@gmail.com>
3603
3604         PR c++/33091
3605         * pt.c (unify_pack_expansion): If we didn't deduce any actual
3606         bindings for the template parameter pack, don't try to keep the
3607         empty deduced arguments.
3608         (unify): If a parameter is a template-id whose template argument
3609         list contains a pack expansion that is not at the end, then we
3610         cannot unify against that template-id.
3611
3612 2007-12-02  Paolo Carlini  <pcarlini@suse.de>
3613
3614          PR c++/34061
3615          * pt.c (current_template_args): Use error_operand_p.
3616
3617 2007-12-02  Paolo Carlini  <pcarlini@suse.de>
3618
3619          PR c++/34273
3620          * error.c (dump_decl): Handle TREE_BINFO.
3621
3622 2007-12-01  Ollie Wild  <aaw@google.com>
3623
3624         PR c++/8171
3625         * typeck.c (build_binary_op): Add conversion of pointers to function
3626         members appearing as operands to the equality operators.
3627
3628 2007-11-30  Jakub Jelinek  <jakub@redhat.com>
3629
3630         PR c++/34275
3631         * error.c (dump_expr): Handle OBJ_TYPE_REF.
3632
3633 2007-11-29  Jakub Jelinek  <jakub@redhat.com>
3634
3635         PR c++/34270
3636         * tree.c (lvalue_p_1) <case COND_EXPR>: Handle x ?: y
3637         in templates.
3638         * typeck.c (is_bitfield_expr_with_lowered_type) <case COND_EXPR>:
3639         Likewise.
3640
3641         PR c++/34267
3642         PR c++/34268
3643         * parser.c (cp_parser_decltype): Don't call finish_id_expression
3644         on ~type.
3645         * semantics.c (finish_decltype_type): Issue error on types, TYPE_DECLs
3646         and ~type early.
3647
3648 2007-11-27  Jakub Jelinek  <jakub@redhat.com>
3649
3650         PR tree-optimization/34181
3651         * method.c (use_thunk): Don't inline the call in the thunk.
3652
3653         PR c++/34213
3654         * tree.c (decl_linkage): Static data members and static member
3655         functions in anonymous ns classes are lk_external.
3656
3657 2007-11-26  Andreas Krebbel  <krebbel1@de.ibm.com>
3658
3659         PR c++/34081
3660         * decl.c (start_preparsed_function): Pass
3661         processing_template_decl for the new allocate_struct_function
3662         parameter.
3663
3664 2007-11-25  Richard Guenther  <rguenther@suse.de>
3665
3666         * decl.c (poplevel): Use BLOCK_CHAIN.
3667
3668 2007-11-24  Ollie Wild  <aaw@google.com>
3669
3670         * typeck.c (delta_from_ptrmemfunc): New function.
3671         (get_member_function_from_ptrfunc): Call delta_from_ptrmemfunc.
3672         (build_binary_op): Call delta_from_ptrmemfunc.
3673
3674 2007-11-23  Jakub Jelinek  <jakub@redhat.com>
3675
3676         PR c++/30293
3677         PR c++/30294
3678         * decl.c (cp_finish_decl): Disallow variable or field
3679         definitions if extern "Java" aggregates.
3680         (grokparms): Disallow parameters with extern "Java"
3681         aggregates.
3682         (check_function_type): Disallow function return values
3683         with extern "Java" aggregates.
3684         * init.c (build_new_1): Disallow placement new with
3685         extern "Java" aggregates.
3686
3687 2007-11-23  Mark Mitchell  <mark@codesourcery.com>
3688             Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3689
3690         PR c++/5310
3691         * call.c (convert_like_real): Build a zero constant when __null is
3692         converted to an integer type.
3693
3694 2007-11-22  Jakub Jelinek  <jakub@redhat.com>
3695
3696         PR c++/34094
3697         * decl2.c (cp_write_global_declarations): Issue error about static
3698         data members in anonymous namespace which are declared and used,
3699         but not defined.
3700
3701 2007-11-20  Jakub Jelinek  <jakub@redhat.com>
3702
3703         PR c++/34089
3704         * parser.c (cp_parser_class_head): Reject function template ids.
3705
3706         PR c++/28879
3707         * tree.c (build_cplus_array_type_1): Don't pass any VLA types
3708         when processing_template_decl to build_array_type.
3709
3710         PR c++/33962
3711         * pt.c (more_specialized_fn): Don't segfault if one or
3712         both argument list end with ellipsis.
3713
3714 2007-11-18  Jakub Jelinek  <jakub@redhat.com>
3715
3716         PR c++/30988
3717         * semantics.c (finish_call_expr): Set
3718         current_function_returns_abnormally if fn is noreturn FUNCTION_DECL
3719         or OVERLOAD with all noreturn functions.
3720
3721 2007-11-16  Jakub Jelinek  <jakub@redhat.com>
3722
3723         PR c++/34100
3724         * pt.c (apply_late_template_attributes): Do nothing if decl's type is
3725         error_mark_node.
3726
3727 2007-11-13  Jakub Jelinek  <jakub@redhat.com>
3728
3729         PR c++/34054
3730         PR c++/34056
3731         PR c++/34057
3732         PR c++/34058
3733         PR c++/34060
3734         * pt.c (find_parameter_packs_r): If ppd->set_packs_to_error,
3735         set to error_mark_node the outermost POINTER_TYPE to the pack if
3736         it is seen in a POINTER_TYPE.
3737         (push_template_decl_real): If check_for_bare_parameter_packs
3738         fails for function return type, set the return type to
3739         integer_type_node.  If check_for_bare_parameter_packs failed
3740         for non-function, return error_mark_node.
3741
3742         PR c++/29225
3743         * call.c (build_new_op): Call resolve_args before calling
3744         build_over_call.
3745
3746 2007-11-11  Tom Tromey  <tromey@redhat.com>
3747
3748         PR c++/17577:
3749         * lex.c (handle_pragma_implementation): Use cpp_included_before.
3750
3751 2007-11-12  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3752
3753         PR c++/8570
3754         * pt.c (redeclare_class_template): Update error message. Use a
3755         note to show the previous declaration.
3756         (tsubst_friend_class): Use the location of the friend template as
3757         the input location before calling redeclare_class_template.
3758
3759 2007-11-11  Jakub Jelinek  <jakub@redhat.com>
3760
3761         PR c++/34068
3762         * semantics.c (finish_pseudo_destructor_expr): Handle
3763         object == error_mark_node.
3764
3765 2007-11-10  Jakub Jelinek  <jakub@redhat.com>
3766
3767         PR c++/32241
3768         * pt.c (tsubst_copy_and_build) <case COMPONENT_REF>: If object_type
3769         is not scalar type, let finish_class_member_access_expr handle
3770         diagnostics.  Pass BIT_NOT_EXPR argument to
3771         finish_pseudo_destructor_expr.  Handle SCOPE_REF properly.
3772
3773 2007-11-09  Douglas Gregor  <doug.gregor@gmail.com>
3774
3775         PR c++/33510
3776         * decl.c (cp_complete_array_type): If any of the initializer
3777         elements are pack expansions, don't compute the array size yet.
3778
3779 2007-11-08  Andrew Pinski  <pinskia@gmail.com>
3780
3781         PR c++/30297:
3782         * tree.c (decl_linkage): Fields have no linkage.
3783
3784 2007-11-08  Daniel Jacobowitz  <dan@codesourcery.com>
3785
3786         * class.c (build_ctor_vtbl_group): Lay out the new type and decl.
3787
3788 2007-11-07  Douglas Gregor  <doug.gregor@gmail.com>
3789
3790         PR c++/33045
3791         PR c++/33837
3792         PR c++/33838
3793         * semantics.c (finish_decltype_type): See through INDIRECT_REFs.
3794         Be careful with ERROR_MARK_NODEs.
3795         * parser.c (cp_parser_check_access_in_redeclaration): Handle NULL
3796         argument.
3797
3798 2007-11-07  Jakub Jelinek  <jakub@redhat.com>
3799
3800         PR c++/33501
3801         * call.c (build_over_call): Don't check TREE_ADDRESSABLE
3802         on incomplete type.
3803
3804 2007-11-06  Douglas Gregor  <doug.gregor@gmail.com>
3805
3806         PR c++/33977
3807         PR c++/33886
3808         * tree.c (c_build_qualified_type): Define bridge to
3809         cp_build_qualified_type.
3810
3811 2007-11-06  Douglas Gregor  <doug.gregor@gmail.com>
3812
3813         PR c++/31439
3814         PR c++/32114
3815         PR c++/32115
3816         PR c++/32125
3817         PR c++/32126
3818         PR c++/32127
3819         PR c++/32128
3820         PR c++/32253
3821         PR c++/32566
3822         * typeck.c (check_return_expr): Pass address of retval to
3823         check_for_bare_parameter_packs.
3824         * class.c (build_base_field): Tolerate bases that have no layout
3825         due to errors.
3826         (end_of_base): Ditto.
3827         * tree.c (canonical_type_variant): Be careful with
3828         ERROR_MARK_NODE.
3829         * cp-tree.h (check_for_bare_parameter_packs): Now accepts a
3830         tree*.
3831         * pt.c (find_parameter_pack_data): Add set_packs_to_error field,
3832         which states whether parameter packs should be replaced with
3833         ERROR_MARK_NODE.
3834         (find_parameter_packs_r): Pass addresses to cp_walk_tree wherever
3835         possible. If set_packs_to_error is set true, replace the parameter
3836         pack with ERROR_MARK_NODE. Manage our own pointer sets.
3837         (uses_parameter_packs): Don't set parameter packs to
3838         ERROR_MARK_NODE.
3839         (check_for_bare_parameter_packs): Now takes a pointer to a tree,
3840         which may be modified (if it is a parameter pack). Instructs
3841         find_parameter_packs_r to replace parameter packs with
3842         ERROR_MARK_NODE (so that they won't cause errors later on).
3843         (process_template_parm): Pass pointer to
3844         check_for_bare_parameter_packs.
3845         (process_partial_specialization): Replace pack expansions before
3846         the end of the template argument list with ERROR_MARK_NODE.
3847         (push_template_decl_real): Pass pointer to
3848         check_for_bare_parameter_packs. Replace parameter packs not at the
3849         end of the template parameter list with ERROR_MARK_NODE.
3850         (convert_template_argument): Be more careful about using DECL_NAME
3851         on only declarations.
3852         (unify): Can't unify against ERROR_MARK_NODE.
3853         * semantics.c (finish_cond): Pass pointer to
3854         check_for_bare_parameter_packs.
3855         (finish_expr_stmt): Ditto.
3856         (finish_for_expr): Ditto.
3857         (finish_switch_cond): Pass pointer to
3858         check_for_bare_parameter_packs, and call it before we put the
3859         condition into the statement.
3860         (finish_mem_initializers): Pass pointer to
3861         check_for_bare_parameter_packs.
3862         (finish_member_declaration): Ditto.
3863         * parser.c (cp_parser_base_clause): Ditto.
3864
3865 2007-11-06  Jakub Jelinek  <jakub@redhat.com>
3866
3867         PR target/33168
3868         * decl.c (cp_finish_decl): Call make_rtl_for_nonlocal_decl already
3869         with the final TREE_READONLY flag in place.  processing_template_decl
3870         is known to be 0 in this part of function.
3871
3872         PR c++/33894
3873         * cp-tree.h: Update comment - TYPE_LANG_FLAG_0 is not
3874         OMP_ATOMIC_DEPENDENT_P in OMP_ATOMIC.
3875         * pt.c (tsubst_expr): Assert OMP_ATOMIC_DEPENDENT_P.
3876         * semantics.c (finish_omp_atomic): Revert most of the
3877         2007-02-05 changes, just keep the new representation of
3878         OMP_ATOMIC_DEPENDENT_P OMP_ATOMIC.
3879
3880 2007-11-05  H.J. Lu  <hongjiu.lu@intel.com>
3881
3882         PR c++/33871
3883         * decl2.c (constrain_visibility): Clear DECL_ONE_ONLY if marked
3884         local.
3885
3886 2007-11-05  Douglas Gregor  <doug.gregor@gmail.com>
3887
3888         PR c++/33996
3889         PR c++/33235
3890         PR c++/33930
3891         * typeck.c (merge_types): Don't lose rvalue references when
3892         merging types.
3893         * call.c (build_over_call): Don't elide move constructors just
3894         because the copy constructor is trivial (!).
3895         (compare_ics): If comparing cv-qualifiers fails, we can still order
3896         based on binding lvalues vs. rvalues.
3897
3898 2007-11-05  Douglas Gregor  <doug.gregor@gmail.com>
3899
3900         PR c++/33939
3901         * pt.c (unify_pack_expansion): bring handling of function call
3902         arguments into line with type_unification_real.
3903
3904 2007-11-05  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3905
3906         * typeck.c (build_binary_op): Use pedwarn instead of error for
3907         consistency.
3908
3909 2007-11-05  Jakub Jelinek  <jakub@redhat.com>
3910
3911         PR c++/33836
3912         * parser.c (cp_parser_unary_expression): For &&label call
3913         cp_parser_non_integral_constant_expression and return error_mark_node
3914         if it returned true.
3915
3916         PR c++/33969
3917         * decl.c (grokdeclarator): Don't call build_memfn_type if type
3918         is neither FUNCTION_TYPE nor METHOD_TYPE.
3919
3920 2007-11-02  Jakub Jelinek  <jakub@redhat.com>
3921
3922         PR c++/33516
3923         * parser.c (cp_parser_nested_name_specifier_opt): Use
3924         TYPE_MAIN_VARIANT (new_scope) as scope if new_scope is an incomplete
3925         typedef of currently open class.
3926
3927 2007-11-02  Paolo Carlini  <pcarlini@suse.de>
3928
3929         PR c++/33495
3930         * error.c (dump_expr): Deal specially with statements.
3931
3932 2007-11-01  Jason Merrill  <jason@redhat.com>
3933
3934         PR c++/30897
3935         * pt.c (push_template_decl_real): Set DECL_CONTEXT on template
3936         template parms.
3937         (lookup_template_class): Use it to get the outer template args
3938         for instantiating one.
3939
3940         PR c++/29236
3941         * pt.c (reduce_template_parm_level): tsubst the parameters
3942         of a template template parm.
3943
3944 2007-11-01  Douglas Gregor  <doug.gregor@gmail.com>
3945
3946         PR c++/33955
3947         * pt.c (find_parameter_packs_r): Handle TYPENAME_TYPE.
3948
3949 2007-11-01  Jakub Jelinek  <jakub@redhat.com>
3950
3951         PR c++/32384
3952         * parser.c (cp_parser_postfix_dot_deref_expression): If
3953         POSTFIX_EXPRESSION is type dependent, try to parse it as pseudo dtor
3954         first and if that succeeds and type is SCALAR_TYPE_P, create
3955         PSEUDO_DTOR_EXPR.
3956
3957         PR c++/32260
3958         * rtti.c (enum_tinfo_kind): Fix TK_TYPE_INFO_TYPE comment.
3959         (typeid_ok_p): Use the same alias set for abi::__type_info_pseudo
3960         as for std::type_info.
3961
3962 2007-10-31  Paolo Carlini  <pcarlini@suse.de>
3963
3964         PR c++/33494
3965         * cxx-pretty-print.c (pp_cxx_typeid_expression,
3966         pp_cxx_delete_expression): Change to static linkage.
3967         * cxx-pretty-print.h: Adjust declarations.
3968         * error.c (dump_expr, case EXPR_PACK_EXPANSION, TYPEID_EXPR,
3969         MEMBER_REF, DOTSTAR_EXPR, DELETE_EXPR, VEC_DELETE_EXPR,
3970         MODOP_EXPR): Forward to pp_expression.
3971
3972         * cxx-pretty-print.c (pp_cxx_expression, case NON_DEPENDENT_EXPR):
3973         Fix typo.
3974
3975 2007-10-31 Christian Bruel  <christian.bruel@st.com>
3976             Mark Mitchell  <mark@codesourcery.com>
3977
3978         PR c++/19531
3979         * typeck.c (check_return_expr): Don't set named_return_value_okay_p
3980         if retval is volatile.
3981
3982 2007-10-30  Jakub Jelinek  <jakub@redhat.com>
3983
3984         PR c++/33616
3985         * decl2.c (build_offset_ref_call_from_tree): Call
3986         build_non_dependent_expr on object prior to building ADDR_EXPR from it
3987         if FN is DOTSTAR_EXPR.
3988
3989 2007-10-30  Douglas Gregor  <doug.gregor@gmail.com>
3990
3991         PR c++/31993
3992         PR c++/32252
3993         * pt.c (find_parameter_packs_r): Fix typo in comment.
3994         (convert_template_argument): Look at the pattern of a pack
3995         expansion to determine what kind of entity we're converting.
3996         (coerce_template_parameter_pack): When we have coerced a non-type
3997         template parameter pack, substitute into the type of that pack.
3998         (tsubst_pack_expansion): When our substitution of a parameter pack
3999         is a "trivial" substitution of itself, just substitute into the
4000         pack expansion rather than actually expanding.
4001
4002 2007-10-29  Jakub Jelinek  <jakub@redhat.com>
4003
4004         PR c++/33841
4005         * class.c (check_bitfield_decl): Don't set field's type to error_mark_node
4006         for non-integral type bitfields.  Return true if bitfield is correct, false
4007         error has been diagnosed.
4008         (check_field_decls): If check_bitfield_decl returned false, call also
4009         check_field_decl.
4010
4011 2007-10-28  Paolo Carlini  <pcarlini@suse.de>
4012             Mark Mitchell  <mark@codesourcery.com>
4013
4014         PR c++/30659
4015         * pt.c (do_decl_instantiation): If the VAR_DECL is not a
4016         class member error out and return.
4017
4018 2007-10-27  Jakub Jelinek  <jakub@redhat.com>
4019
4020         * error.c (reinit_cxx_pp): Initialize cxx_pp->enclosing_scope
4021         to current_function_decl rather than 0.
4022
4023         PR c++/33844
4024         * cxx-pretty-print.c (pp_cxx_pm_expression) <case MEMBER_REF>: Print
4025         ->* rather than .*.
4026         * error.c (dump_expr): Handle MEMBER_REF and DOTSTAR_EXPR.
4027
4028 2007-10-27  Jason Merrill  <jason@redhat.com>
4029
4030         PR c++/5247
4031         * call.c (convert_default_arg): Detect recursion.
4032
4033 2007-10-27  Jakub Jelinek  <jakub@redhat.com>
4034
4035         PR c++/33842
4036         * cxx-pretty-print.h (pp_cxx_offsetof_expression): New prototype.
4037         * cxx-pretty-print.c (pp_cxx_primary_expression): Handle
4038         OFFSETOF_EXPR.
4039         (pp_cxx_offsetof_expression_1, pp_cxx_offsetof_expression): New
4040         functions.
4041         * error.c (dump_expr): Handle OFFSETOF_EXPR.
4042
4043 2007-10-26  Jason Merrill  <jason@redhat.com>
4044
4045         PR c++/24791
4046         * pt.c (get_template_info): New fn.
4047         (template_class_depth): Use it.
4048         (push_template_decl_real): Check that the template args of the
4049         definition match the args of the previous declaration.
4050
4051 2007-10-26  Paolo Carlini  <pcarlini@suse.de>
4052
4053         PR c++/31988
4054         * decl2.c (coerce_new_type): Do not allow a default argument for
4055         the first parameter.
4056
4057 2007-10-26  Douglas Gregor  <doug.gregor@gmail.com>
4058
4059         PR c++/33839
4060         * parser.c (cp_parser_decltype): Return ERROR_MARK_NODE if we
4061         don't see the leading '('. Only lookup names if we get an
4062         IDENTIFIER_NODE.
4063
4064 2007-10-26  Jakub Jelinek  <jakub@redhat.com>
4065
4066         PR c++/33744
4067         * parser.c (cp_parser_parenthesized_expression_list): Set
4068         greater_than_is_operator_p to true in between the parens.
4069
4070 2007-10-26  Paolo Carlini  <pcarlini@suse.de>
4071
4072         PR c++/31747
4073         * decl.c (grokdeclarator): In case of conflicting specifiers
4074         just return error_mark_node.
4075
4076 2007-10-26  Ollie Wild  <aaw@google.com>
4077
4078         * expr.c (cxx_expand_expr): Removed.
4079         * cp-tree.h (exx_expand_expr): Removed.
4080         * cp-objcp-common.h (LANK_HOOKS_EXPAND_EXPR): Replace cxx_expand_expr
4081         with c_expand_expr.
4082
4083 2007-10-25  Paolo Carlini  <pcarlini@suse.de>
4084
4085         PR c++/33843
4086         * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with BIT_NOT_EXPR.
4087
4088 2007-10-23  Jason Merrill  <jason@redhat.com>
4089
4090         PR c++/25950 (DR 391)
4091         * call.c (struct conversion): Remove check_copy_constructor_p.
4092         (reference_binding): Always bind a reference directly to a
4093         compatible class rvalue.  Pass down LOOKUP_NO_TEMP_BIND during
4094         temporary creation.
4095         (check_constructor_callable): Remove.
4096         (convert_like_real): Don't call it.
4097         (initialize_reference): Don't call check_constructor_callable.
4098         (standard_conversion): Check LOOKUP_NO_CONVERSION instead of
4099         LOOKUP_CONSTRUCTOR_CALLABLE.  Don't require a temporary for base
4100         conversions if LOOKUP_NO_TEMP_BIND.
4101         (implicit_conversion): Pass through LOOKUP_NO_TEMP_BIND.
4102         (build_user_type_conversion_1): Pass through LOOKUP_NO_TEMP_BIND for
4103         second conversion.
4104         * cp-tree.h (LOOKUP_CONSTRUCTOR_CALLABLE): Remove.
4105
4106 2007-10-22  Jakub Jelinek  <jakub@redhat.com>
4107
4108         PR c++/33372
4109         * semantics.c (finish_omp_clauses): Check !type_dependent_expression_p
4110         before checking if its type is integral.
4111
4112 2007-10-22  Jason Merrill  <jason@redhat.com>
4113
4114         PR c++/33620
4115         * class.c (finish_struct_bits): Copy TYPE_ATTRIBUTES.
4116         * pt.c (apply_late_template_attributes): Splice out dependent
4117         attributes from DECL_ATTRIBUTES.
4118
4119         * decl.c (cxx_maybe_build_cleanup): Use build_address.
4120
4121 2007-10-17  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
4122
4123         * typeck.c (build_binary_op) : Use appropriate warning option
4124         instead of unnamed warning.
4125
4126 2007-10-16  Paolo Carlini  <pcarlini@suse.de>
4127
4128         PR c++/31446
4129         * pt.c (current_template_args): Do not change TREE_LIST elements
4130         with a TREE_VALUE of error_mark_node.
4131
4132 2007-10-16  Mark Mitchell  <mark@codesourcery.com>
4133
4134         * typeck.c (cp_apply_type_quals_to_decl): Expand documentation.
4135         * decl.c (start_decl): Tidy.
4136         (start_decl_1): Call cp_apply_type_quals_to_decl after completing
4137         the type.
4138         (grokdeclarator): Clarify comment.
4139
4140 2007-10-14  Andrew Pinski  <pinskia@gmail.com>
4141
4142         PR c++/30303
4143         * decl.c (grokfndecl): Return NULL after the "definition of
4144         implicitly-declared" error happened.
4145
4146 2007-10-12  Simon Martin  <simartin@users.sourceforge.net>
4147
4148         PR c++/26698
4149         * call.c (build_user_type_conversion_1): Do not consider conversion
4150         functions to convert a (possibly cv-qualified) object to the (possibly
4151         cv-qualified) same object type (or a reference to it), to a (possibly
4152         cv-qualified) base class of that type (or a reference to it).
4153
4154 2007-10-12  Paolo Carlini  <pcarlini@suse.de>
4155
4156         * pt.c (tsubst): Use template_parm_level_and_index.
4157
4158 2007-10-12  Jakub Jelinek  <jakub@redhat.com>
4159
4160         PR c++/32121
4161         * parser.c (cp_parser_compound_statement): Handle label-declarations
4162         at the beginning of the compound statement.
4163         (cp_parser_block_declaration): Issue diagnostics about __label__
4164         not at the beginning of a block.
4165
4166 2007-10-11  Paolo Carlini  <pcarlini@suse.de>
4167
4168         PR c++/33461
4169         * pt.c (coerce_template_parameter_pack): Do not pass error_mark_node
4170         to convert_template_argument.
4171         (coerce_template_parms): Return error_mark_node after fixed-length
4172         error.
4173         (tsubst_decl): Check for error_mark_node the return value of the
4174         first tsubst in 'case VAR_DECL'.
4175
4176 2007-10-08  Ollie Wild  <aaw@google.com>
4177
4178         * typeck2.c (digest_init): Call cplus_expand_constant after
4179         convert_for_initialization.
4180         * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
4181         * expr.c (cplus_expand_constant): Updated function description.
4182
4183 2007-10-04  Jason Merrill  <jason@redhat.com>
4184
4185         PR c++/20416
4186         * call.c (initialize_reference): Handle local static reference
4187         temps properly.
4188
4189 2007-10-03  Jason Merrill  <jason@redhat.com>
4190
4191         PR c++/32470
4192         * name-lookup.c (push_namespace_with_attrs): Fold back into...
4193         (push_namespace): Here.
4194         (handle_namespace_attrs): New fn for the attr code.
4195         (leave_scope): Don't pop_visibility.
4196         * name-lookup.h (struct cp_binding_level): Remove has_visibility.
4197         * parser.c (cp_parser_namespace_definition): Call
4198         handle_namespace_attrs and pop_visibility as appropriate.
4199
4200         PR c++/11756
4201         * mangle.c (write_type) [TYPEOF_TYPE]: Just sorry.
4202
4203 2007-10-03  Alexandre Oliva  <aoliva@redhat.com>
4204
4205         * decl.c (duplicate_decls): Preserve linkage flags for mere
4206         redeclarations of gnu_inline definitions.
4207
4208 2007-10-03  Jason Merrill  <jason@redhat.com>
4209
4210         PR c++/15764
4211         * decl.c (wrap_cleanups_r): New fn.
4212         (wrap_temporary_cleanups): New fn.
4213         (initialize_local_var): Call it.
4214
4215 2007-09-29  Jason Merrill  <jason@redhat.com>
4216
4217         PR c++/33094
4218         * decl.c (make_rtl_for_nonlocal_decl): It's ok for a member
4219         constant to not have DECL_EXTERNAL if it's file-local.
4220
4221 2007-09-28  Ollie Wild  <aaw@google.com>
4222
4223         Revert
4224         2007-09-27  Ollie Wild  <aaw@google.com>
4225
4226         * typeck2.c (digest_init): Call cplus_expand_constant after
4227         convert_for_initialization.
4228         * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
4229         * expr.c (cplus_expand_constant): Updated function description.
4230
4231 2007-09-28  Jason Merrill  <jason@redhat.com>
4232
4233         PR c++/10179
4234         * class.c (layout_empty_base): Take rli parameter, update
4235         rli->record_align if empty base has user-specified alignment.
4236         (build_base_field): Pass rli to it.
4237
4238 2007-09-28  Paolo Carlini  <pcarlini@suse.de>
4239
4240         PR c++/33213
4241         * error.c (dump_decl): Deal with TYPE_PACK_EXPANSION.
4242
4243 2007-09-28  Paolo Carlini  <pcarlini@suse.de>
4244
4245         PR c++/33118
4246         * error.c (dump_expr): Deal with ARGUMENT_PACK_SELECT.
4247         (dump_type): Use dump_template_argument for TYPE_ARGUMENT_PACK.
4248         (dump_parameters): Just call dump_type for argument packs too.
4249
4250 2007-09-28  Jakub Jelinek  <jakub@redhat.com>
4251
4252         PR c++/31434
4253         * tree.c (cp_build_qualified_type_real): Handle TYPE_PACK_EXPANSION
4254         qualification by creating qualified PACK_EXPANSION_PATTERN and
4255         then calling make_pack_expansion on it.
4256
4257 2007-09-27  Ollie Wild  <aaw@google.com>
4258
4259         * typeck2.c (digest_init): Call cplus_expand_constant after
4260         convert_for_initialization.
4261         * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
4262         * expr.c (cplus_expand_constant): Updated function description.
4263
4264 2007-09-27  Jason Merrill  <jason@redhat.com>
4265
4266         PR c++/33571
4267         * decl2.c (is_late_template_attribute): Don't crash on unknown
4268         attribute.
4269
4270 2007-09-27  Paolo Carlini  <pcarlini@suse.de>
4271
4272         PR c++/33493
4273         * error.c (dump_expr): Deal with DELETE_EXPR and VEC_DELETE_EXPR.
4274         * cxx-pretty-print.c (pp_cxx_delete_expression): Add missing
4275         spaces in the formatting.
4276         * cxx-pretty-print.h (pp_cxx_delete_expression): Declare.
4277
4278 2007-09-27  Jakub Jelinek  <jakub@redhat.com>
4279
4280         * error.c (cxx_print_error_function): Add third argument, pass
4281         it over to lhd_print_error_function.
4282         (cp_print_error_function): If diagnostic->abstract_origin, print
4283         virtual backtrace.
4284         * cp-tree.h (struct diagnostic_info): New forward decl.
4285         (cxx_print_error_function): Add third argument.
4286
4287 2007-09-25  Simon Martin  <simartin@users.sourceforge.net>
4288
4289         PR c++/33207
4290         * name-lookup.c (pushtag): Do not create an implicit typedef before
4291         the associated type declaration is known to be valid.
4292
4293 2007-09-25  Jakub Jelinek  <jakub@redhat.com>
4294
4295         * tree.c (cxx_printable_name): Compare FUNCTION_DECL uids
4296         rather than pointers.
4297
4298 2007-09-24  Danny Smith  <dannysmith@user.sourceforge.net>
4299
4300         PR c++/14688
4301          * search.c (check_final_overrider): Fail if
4302         targetm.comp_type_attributes returns 0.
4303
4304 2007-09-24  Jason Merrill  <jason@redhat.com>
4305
4306         PR c++/33239
4307         * pt.c (resolve_typename_type): Don't look things up in the original
4308         template if it would mean losing template arguments.
4309
4310 2007-09-24  Jakub Jelinek  <jakub@redhat.com>
4311
4312         PR c++/33506
4313         * cp-tree.h (cxx_type_hash_eq): New prototype.
4314         * cp-objcp-common.h (LANG_HOOKS_TYPE_HASH_EQ): Redefine.
4315         * tree.c (cxx_type_hash_eq): New function.
4316
4317 2007-09-24  Douglas Gregor  <doug.gregor@gmail.com>
4318
4319         PR c++/33185
4320         * tree.c (cp_build_qualified_type_real): Build a canonical
4321         ARRAY_TYPE if the original ARRAY_TYPE was not a canonical type.
4322
4323 2007-09-24  Douglas Gregor  <doug.gregor@gmail.com>
4324
4325         PR c++/33112
4326         PR c++/33185
4327         * tree.c (cplus_array_compare): Compare pointers, not types.
4328         (build_cplus_array_type_1): Store new array type into the hash
4329         table before building the canonical type; build the canonical type
4330         correctly.
4331         (cp_build_qualified_type_real): Put all of the array types with
4332         cv-qualified element types into the C++ array hash table, built as
4333         variants of the unqualified versions.
4334
4335 2007-09-23  Jason Merrill  <jason@redhat.com>
4336
4337         PR c++/16370
4338         * decl.c (grokdeclarator): Look through implicit TYPE_DECLs
4339         for deprecation warnings.
4340
4341 2007-09-22  Jason Merrill  <jason@redhat.com>
4342
4343         PR c++/15269
4344         * call.c (build_over_call): Warn about deprecated virtuals.
4345
4346         PR c++/19407
4347         * cp-tree.h (ATTR_IS_DEPENDENT): New macro.
4348         (MAYBE_TAGGED_TYPE_P): Remove.
4349         * pt.c (apply_late_template_attributes): Check ATTR_IS_DEPENDENT
4350         instead of calling is_late_template_attribute again.
4351         (tsubst_decl) [TYPE_DECL]: Just check if the name is the tag.
4352         (tsubst): A typedef is a TYPE_NAME != TYPE_MAIN_DECL.
4353         Don't crash on typedefs from non-template classes.
4354         * decl2.c (grokfield): Don't sorry about attrs on template parms.
4355         (is_late_template_attribute): All attributes applied to template
4356         parms or typename types are dependent.  Static.
4357         (splice_template_attributes): Pass decl through.
4358         (save_template_attributes): Likewise.
4359
4360 2007-09-20  Jakub Jelinek  <jakub@redhat.com>
4361
4362         PR c++/33496
4363         * pt.c (tsubst_copy) <case SIZEOF_EXPR>: Handle error_mark_node
4364         returned from tsubst_pack_expansion.
4365         (tsubst_copy_and_build) <case SIZEOF_EXPR>: Likewise.
4366         (tsubst_copy_and_build) <case CONSTRUCTOR>: Likewise.
4367
4368 2007-09-20  Paolo Carlini  <pcarlini@suse.de>
4369
4370         PR c++/33460
4371         * semantics.c (finish_id_expression): Use consistently
4372         context_for_name_lookup.
4373         * decl.c (fixup_anonymous_aggr): Fix error message for
4374         anonymous struct (vs union).
4375
4376 2007-09-19  Jason Merrill  <jason@redhat.com>
4377
4378         PR c++/7586
4379         * pt.c (tsubst): Handle typedefs by looking for the specialization.
4380         (retrieve_specialization): Only tagged types use
4381         DECL_TEMPLATE_INSTANTIATIONS.
4382         (instantiate_class_template): Push nested classes too.
4383         (tsubst_decl) [TYPE_DECL]: Only check for canonical decl for
4384         tagged types.
4385         * cp-tree.h (MAYBE_TAGGED_TYPE_P): New macro.
4386         * init.c (is_aggr_type): Remove redundant tests.
4387         * class.c (push_nested_class): Use CLASS_TYPE_P.
4388
4389 2007-09-20  Paolo Carlini  <pcarlini@suse.de>
4390
4391         PR c++/33459
4392         * init.c (build_zero_init): If, recursively, build_zero_init
4393         returns a NULL_TREE, do not append it to the VEC of constructors.
4394
4395 2007-09-18  Jason Merrill  <jason@redhat.com>
4396
4397         PR c++/17743
4398         * pt.c (apply_late_template_attributes): Set processing_template_decl.
4399         (tsubst_decl) [TYPE_DECL]: Preserve naming typedef, pass
4400         ATTR_FLAG_TYPE_IN_PLACE.
4401         (tsubst): Do unqualified lookup to find typedefs from current class.
4402         [ARRAY_TYPE]: Propagate alignment info.
4403         * decl2.c (is_late_template_attribute): Only defer handling of
4404         attribute aligned if the expression is dependent.
4405         (save_template_attributes): If we're deferring any attributes,
4406         make this a naming typedef.
4407
4408 2007-09-18  Paolo Carlini  <pcarlini@suse.de>
4409
4410         PR c++/33462 (again)
4411         * cxx-pretty-print.c (pp_cxx_va_arg_expression): Print
4412         va_arg instead of __builtin_va_arg.
4413
4414 2007-09-18  Paolo Carlini  <pcarlini@suse.de>
4415
4416         PR c++/33462
4417         * cxx-pretty-print.c (pp_cxx_va_arg_expression): Add.
4418         (pp_cxx_primary_expression): Use it.
4419         * cxx-pretty-print.h (pp_cxx_va_arg_expression): Declare.
4420         * error.c (dump_expr): Use it.
4421
4422 2007-09-18  Paolo Carlini  <pcarlini@suse.de>
4423
4424         PR c++/33463
4425         * cxx-pretty-print.c (pp_cxx_postfix_expression): Split
4426         out case TYPEID_EXPR to...
4427         (pp_cxx_typeid_expression): ... here; use pp_cxx_left_paren
4428         and pp_cxx_right_paren.
4429         * cxx-pretty-print.h (pp_cxx_typeid_expression): Declare.
4430         * error.c (dump_expr): Use it.
4431
4432 2007-09-18  Paolo Carlini  <pcarlini@suse.de>
4433
4434         PR c++/33464
4435         * cxx-pretty-print.c (pp_cxx_trait_expression): Add.
4436         (pp_cxx_primary_expression): Use it.
4437         * cxx-pretty-print.h (pp_cxx_trait_expression): Declare.
4438         * error.c (dump_expr): Use it.
4439
4440 2007-09-16  Paolo Carlini  <pcarlini@suse.de>
4441
4442         PR c++/33124
4443         * init.c (build_new): Remove warning for zero-element
4444         allocations.
4445
4446 2007-09-16  Nathan Sidwell  <nathan@codesourcery.com>
4447
4448         PR c++/32756
4449         * call.c (maybe_handle_implicit_object): Set this_p, clear
4450         rvaluedness_matches_p.
4451         (compare_ics): Do not compare rvaluedness matching when one of the
4452         operands is an implicit object.
4453
4454 2007-09-14  Jason Merrill  <jason@redhat.com>
4455
4456         PR c++/17743, c++/19163
4457         * decl2.c (is_late_template_attribute): New fn.
4458         (splice_template_attributes, save_template_attributes): New fns.
4459         (cplus_decl_attributes): Call save_template_attributes.
4460         * pt.c (apply_late_template_attributes): New fn.
4461         (instantiate_class_template, tsubst_decl): Use it.
4462         * cp-tree.h: Declare is_late_template_attribute.
4463
4464 2007-09-13  Tom Tromey  <tromey@redhat.com>
4465
4466         * parser.c (cp_lexer_new_main): Don't use
4467         c_lex_return_raw_strings.
4468         (cp_lexer_get_preprocessor_token): Update.  Add special case when
4469         lexer is NULL.
4470
4471 2007-09-11  Jan Hubicka <jh@suse.cz>
4472
4473         * method.c (use_thunk): Use tree_rest_of_compilation
4474         * cp-objecp-common.h (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Kill.
4475         (LANG_HOOKS_CALLGRAPH_EMIT_ASSOCIATED_THUNKS): Define.
4476         * cp-tree.h (expand_body): Kill.
4477         (emit_associated_thunks): Declare.
4478         * semantics.c (emit_associated_thunks): Export.
4479         (expand_body): Kill.
4480
4481 2007-09-09  David Daney  <ddaney@avtrex.com>
4482
4483         PR c++/33324
4484         * init.c (build_new_1):  Use POINTER_PLUS_EXPR instead of MINUS_EXPR
4485         to calculate cookie_ptr.
4486
4487 2007-09-08  Jason Merrill  <jason@redhat.com>
4488
4489         PR c++/33342
4490         * pt.c (most_specialized_class): Set processing_template_decl
4491         while tsubsting partial spec args.
4492
4493 2007-09-06  Jason Merrill  <jason@redhat.com>
4494
4495         * decl2.c (get_guard): Copy visibility from the guarded variable.
4496
4497 2007-09-06  Jan Hubicka  <jh@suse.cz>
4498
4499         * semantics.c (expand_body): Do not mark arguments of clones used.
4500
4501 2007-09-06  Paolo Carlini  <pcarlini@suse.de>
4502
4503         PR c++/32674
4504         * decl.c (cp_finish_decl): When processing_template_decl,
4505         deal correctly with init as TREE_LIST.
4506
4507 2007-09-06  Tom Tromey  <tromey@redhat.com>
4508
4509         * decl.c (finish_function): Put return's location on line zero of
4510         file.
4511
4512 2007-09-05  Jason Merrill  <jason@redhat.com>
4513
4514         PR c++/15745
4515         * except.c (prepare_eh_type): Use type_decays_to.
4516
4517         PR c++/15097
4518         * init.c (build_delete): Use build_headof to get the address of the
4519         complete object if we aren't using the deleting destructor.
4520         * rtti.c (build_headof): No longer static.
4521         * cp-tree.h: Declare it.
4522
4523 2007-09-06  Jakub Jelinek  <jakub@redhat.com>
4524
4525         * decl.c (duplicate_decls): Set TREE_NOTHROW on __builtin_XX
4526         decl if a prototype for XX is provided with throw().
4527
4528         PR c++/33289
4529         * decl.c (builtin_function_1): Set DECL_ANTICIPATED also
4530         on __*_chk non-__builtin_* decls.
4531
4532 2007-09-05  Paolo Carlini  <pcarlini@suse.de>
4533
4534         PR c++/30302
4535         * semantics.c (finish_id_expression): Use context_for_name_lookup
4536         insted of DECL_CONTEXT, to see through anonymous structs and unions.
4537         * class.c (finish_struct_anon): Deal correctly with anonymous
4538         structs (vs unions, as GNU extension) in error messages.
4539
4540 2007-09-05  Jan Hubicka  <jh@suse.cz>
4541
4542         * sematics.c (expand_body): Remove unnecesary import_export_decl
4543         call, DECL_EXTERNAL checks and current_function_decl saving.
4544
4545 2007-09-05  Paolo Carlini  <pcarlini@suse.de>
4546
4547         PR c++/29731 (again)
4548         * parser.c (cp_parser_primary_expression): Return error_mark_node
4549         when a statement-expression is found in a template-argument list.
4550
4551 2007-09-04  Jason Merrill  <jason@redhat.com>
4552
4553         * except.c (initialize_handler_parm): Use
4554         fold_build_cleanup_point_expr.
4555
4556         PR c++/31419
4557         * call.c (reference_binding): Don't look for user-defined conversions
4558         to the same type.
4559
4560         PR c++/31411
4561         * except.c (initialize_handler_parm): Put a CLEANUP_POINT_EXPR inside
4562         the MUST_NOT_THROW_EXPR.
4563
4564 2007-09-04  Richard Sandiford  <richard@codesourcery.com>
4565
4566         * decl.c (cp_finish_decl): Call determine_visibility before
4567         make_rtl_for_nonlocal_decl.
4568
4569 2007-09-04  Jason Merrill  <jason@redhat.com>
4570
4571         PR c++/14032
4572         * pt.c (most_specialized_class): Substitute outer template
4573         arguments into the arguments of a member template partial
4574         specialization.
4575         (strip_innermost_template_args): New fn.
4576
4577 2007-09-03  Daniel Jacobowitz  <dan@codesourcery.com>
4578
4579         * Make-lang.in (g++spec.o): Remove SHLIB_MULTILIB.
4580
4581 2007-09-03  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4582
4583         * call.c (name_as_c_string): Supply a TYPE for CONST_CAST.
4584         * decl.c (cp_make_fname_decl): Likewise,
4585         * parser.c (cp_parser_string_literal): Likewise,
4586         * tree.c (pod_type_p, zero_init_p): Use CONST_CAST_TREE.
4587         * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
4588         Likewise,
4589
4590 2007-09-02  Paolo Carlini  <pcarlini@suse.de>
4591
4592         PR c++/33208
4593         * typeck.c (build_unary_op): Fix error message for
4594         Boolean expression as operand to operator--.
4595
4596 2007-09-01  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4597
4598         * tree.c (pod_type_p, zero_init_p): Use strip_array_types.
4599         * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
4600         Likewise.
4601
4602 2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
4603
4604         PR c++/32597
4605         * init.c (build_default_init): Make extern.
4606         * cp-tree.h (build_default_init): Declare here.
4607         * pt.c (tsubst_expr): When the instantiation of the initializer of
4608         a variable results in an empty list, default-initialize the
4609         variable.
4610         (tsubst_copy_and_build): When the instantiation of the initializer
4611         in a new expression results in an empty initializer list,
4612         default-initialize it.
4613
4614 2007-08-31  Douglas Gregor  <doug.gregor@gmail.com>
4615
4616         * mangle.c (write_type): Change mangling of rvalue reference from
4617         `RR' to `O'.
4618
4619 2007-08-31  Jakub Jelinek  <jakub@redhat.com>
4620
4621         * decl.c (duplicate_decls): Remove duplicated line.
4622
4623 2007-08-31  Paolo Carlini  <pcarlini@suse.de>
4624
4625         PR c++/33210
4626         * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with
4627         BOUND_TEMPLATE_TEMPLATE_PARM.
4628
4629 2007-08-31  Paolo Carlini  <pcarlini@suse.de>
4630
4631         PR c++/32113
4632         * search.c (lookup_member): Check the name argument for
4633         error_mark_node.
4634
4635 2007-08-31  Paolo Carlini  <pcarlini@suse.de>
4636
4637         PR c++/33212
4638         * parser.c (cp_parser_trait_expr): Check rerurn value of
4639         cp_parser_type_id.
4640
4641 2007-08-30  Ollie Wild  <aaw@google.com>
4642
4643         * cvt.c (cp_convert_to_pointer): Remove force parameter. Call
4644         convert_ptrmem for pointer to member conversions.
4645         (convert_to_pointer_force): Update cp_convert_to_pointer call.
4646         (ocp_convert): Update cp_convert_to_pointer call.
4647         * typeck.c (convert_ptrmem): Add conditional for null pointers to
4648         members.
4649         (build_static_cast_1): Check can_convert for conversions in either
4650         direction.
4651         (get_delta_difference_1): New function.
4652         (get_delta_difference): Refactor to call get_delta_difference_1.
4653
4654 2007-08-30  Jakub Jelinek  <jakub@redhat.com>
4655
4656         * decl.c (start_preparsed_function): Set
4657         DECL_DISREGARD_INLINE_LIMITS for GNU_INLINE_P functions.
4658
4659 2007-08-28  Paolo Carlini  <pcarlini@suse.de>
4660
4661         PR c++/33209
4662         * error.c (dump_expr): Deal with TEMPLATE_TYPE_PARM and
4663         BOUND_TEMPLATE_TEMPLATE_PARM.
4664
4665 2007-08-28  Jakub Jelinek  <jakub@redhat.com>
4666
4667         PR c++/32596
4668         PR c++/32400
4669         * pt.c (check_explicit_specialization): Set DECL_INTERFACE_KNOWN
4670         and DECL_NOT_REALLY_EXTERN if tmpl_func is not public.
4671
4672 2007-08-27  Jason Merrill  <jason@redhat.com>
4673
4674         PR c++/29000
4675         * pt.c (build_non_dependent_expr, type_dependent_expression_p):
4676         Look inside STMT_EXPR.
4677         * semantics.c (stmt_expr_value_expr): New fn.
4678         * cp-tree.h: Declare it.
4679
4680         PR c++/28558
4681         * decl.c (groktypename): Ignore attributes applied to class type.
4682
4683 2007-08-28  Richard Guenther  <rguenther@suse.de>
4684
4685         * decl.c (duplicate_decls): Merge DECL_DISREGARD_INLINE_LIMITS.
4686
4687 2007-08-28  Gabriel Dos Reis  <gdr@integrable-solutions.net>
4688
4689         * error.c (dump_expr): Handle COMPLEX_CST.
4690         * cxx-pretty-print.c (pp_cxx_primary_expression): Likewise.
4691         (pp_cxx_expression): Likewise.
4692
4693 2007-08-27  Alexandre Oliva  <aoliva@redhat.com>
4694
4695         * decl.c (GNU_INLINE_P): New.
4696         (duplicate_decls): Handle gnu_inline.  Merge attributes and
4697         some flags in overriding definitions.
4698         (redeclaration_error_message): Handle gnu_inline.
4699         (start_preparsed_function): Likewise.
4700
4701 2007-08-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4702
4703         * call.c (sufficient_parms_p): Constify.
4704         * class.c (same_signature_p): Likewise.
4705         * cp-gimplify.c (is_invisiref_parm,
4706         cxx_omp_privatize_by_reference): Likewise.
4707         * cp-objcp-common.c (has_c_linkage): Likewise.
4708         * cp-tree.h (NON_THUNK_FUNCTION_CHECK, THUNK_FUNCTION_CHECK,
4709         sufficient_parms_p, same_signature_p, copy_fn_p, move_fn_p,
4710         grok_ctor_properties, nothrow_libfn_p, skip_artificial_parms_for,
4711         num_artificial_parms_for, comp_template_parms,
4712         template_parameter_pack_p, any_dependent_template_arguments_p,
4713         any_type_dependent_arguments_p, any_value_dependent_elements_p,
4714         repo_export_class_p, cxx_omp_privatize_by_reference, pod_type_p,
4715         zero_init_p, member_p, cp_lvalue_kind,
4716         builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
4717         varargs_function_p, is_dummy_object, special_function_kind,
4718         string_conv_p, type_unknown_p, comp_except_specs, compparms,
4719         comp_cv_qualification, is_bitfield_expr_with_lowered_type,
4720         unlowered_expr_type, ptr_reasonably_similar, cp_type_readonly,
4721         cp_has_mutable_p, at_least_as_qualified_p,
4722         invalid_nonstatic_memfn_p, lvalue_or_else, lvalue_p): Likewise.
4723         * decl.c (copy_fn_p, move_fn_p, grok_ctor_properties): Likewise.
4724         * except.c (nothrow_libfn_p): Likewise.
4725         * method.c (skip_artificial_parms_for, num_artificial_parms_for):
4726         Likewise.
4727         * pt.c (comp_template_parms, template_parameter_pack_p,
4728         any_type_dependent_arguments_p, any_value_dependent_elements_p,
4729         any_dependent_template_arguments_p): Likewise.
4730         * repo.c (repo_export_class_p): Likewise.
4731         * semantics.c (anon_aggr_type_p): Likewise.
4732         * tree.c (lvalue_p_1, real_lvalue_p, lvalue_p,
4733         builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
4734         varargs_function_p, member_p, is_dummy_object, pod_type_p,
4735         zero_init_p, special_function_p): Likewise.
4736         * typeck.c (comp_array_types, type_unknown_p, comp_except_specs,
4737         comp_array_types, at_least_as_qualified_p, comp_cv_qualification,
4738         compparms, invalid_nonstatic_memfn_p,
4739         is_bitfield_expr_with_lowered_type, unlowered_expr_type,
4740         string_conv_p, ptr_reasonably_similar, cp_type_readonly,
4741         cp_has_mutable_p, lvalue_or_else): Likewise.
4742
4743 2007-08-25  Paolo Bonzini  <bonzini@gnu.org>
4744
4745         * decl.c (cp_tree_node_structure): Kill TINST_LEVEL case.
4746         * cp-objcp-common.c (cp_tree_size): Ditto.
4747         * tree.c (cp_walk_subtrees): Ditto
4748         * cp-tree.def (TINST_LEVEL): Go away.
4749         * cp-tree.h (struct tinst_level_s): Rename to struct tinst_level,
4750         move together with other non-tree structs.
4751         (enum cp_tree_node_structure_enum): Nuke TS_CP_TINST_LEVEL.
4752         (union lang_tree_node): Eliminate tinst_level field.
4753         (TINST_DECL, TINST_LOCATION, TINST_IN_SYSTEM_HEADER_P): Annihilate.
4754         (current_instantiation, outermost_tinst_level): Return
4755         a "struct tinst_level *".
4756
4757         * error.c (print_instantiation_partial_context): Change second
4758         parameter to a "struct tinst_level *".  Replace accessor macros
4759         with field access.
4760         (print_instantiation_full_context): Likewise.
4761         * lex.c (in_main_input_context): Likewise.
4762
4763         * pt.c (struct pending_templates): New.
4764         (pending_templates, last_pending_template): Use it as a type.
4765         (current_tinst_level): Change typo to "struct tinst_level *"
4766         (reopen_tinst_level): Accept "struct tinst_level *", return decl.
4767         (add_pending_template): Construct a "struct pending_template".
4768         Replace TINST_LEVEL accessor macros with field access.
4769         (push_tinst_level): Likewise, using GGC_NEW instead of make_node.
4770         (pop_tinst_level): Likewise.
4771         (instantiate_pending_templates): Likewise.  Factor common code used
4772         when an instantiation has been done.
4773         (outermost_tinst_level): Replace tree_last with loop.
4774         (current_instantiation): Return a "struct tinst_level *".
4775
4776 2007-08-24  Ollie Wild  <aaw@google.com>
4777
4778         * name-lookup.c (add_decl_to_level): Remove addition to vtables chain.
4779         * name-lookup.h (cp_binding_level): Remove vtables member.
4780
4781 2007-08-24  Richard Guenther  <rguenther@suse.de>
4782
4783         * tree.c (cp_cannot_inline_tree_fn): Remove.
4784         * cp-tree.h (cp_cannot_inline_tree_fn): Likewise.
4785         * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN):
4786         Remove define.
4787
4788 2007-08-24  Jakub Jelinek  <jakub@redhat.com>
4789
4790         PR c++/32567
4791         * typeck.c (build_unary_op) <case PREINCREMENT_EXPR>: Return
4792         error_mark_node right away if build_expr_type_conversion
4793         returned it.
4794
4795         PR c++/32898
4796         * name-lookup.c (set_decl_namespace): lookup_qualified_name failure
4797         is error_mark_node rather than NULL_TREE.
4798         * pt.c (check_explicit_specialization): Likewise.
4799
4800         PR c++/31941
4801         * error.c (resolve_virtual_fun_from_obj_type_ref): Handle
4802         TARGET_VTABLE_USES_DESCRIPTORS targets properly.
4803
4804 2007-08-22  Jason Merrill  <jason@redhat.com>
4805
4806         PR c++/29365
4807         * pt.c (outermost_tinst_level): New function.
4808         * lex.c (in_main_input_context): New function.
4809         * cp-tree.h: Declare it.
4810         * decl2.c (constrain_class_visibility): Use it to avoid warning
4811         about uses of the anonymous namespace in the main input file.
4812
4813 2007-08-21  Jakub Jelinek  <jakub@redhat.com>
4814
4815         * init.c (build_new_1): Use get_target_expr instead of save_expr.
4816
4817 2007-08-20  Pawel Sikora  <pluto@pld-linux.org>
4818
4819         PR c++/7302
4820         * class.c (finish_struct_1): Warn when a class has virtual
4821         functions and accessible non-virtual destructor.
4822
4823 2007-08-20  Richard Guenther  <rguenther@suse.de>
4824
4825         PR c++/22369
4826         PR c++/22451
4827         * call.c (build_new_method_call): Convert initializer to
4828         the basetype.
4829         * init.c (build_aggr_init): Do not fiddle with types.
4830         (build_vec_delete_1): Use correct type for POINTER_PLUS_EXPR.
4831         * except.c (build_throw): Do not drop qualifiers for the
4832         pointer type.
4833         * typeck.c (get_member_function_from_ptrfunc): Do not
4834         fiddle with types, instead convert.
4835         (build_ptrmemfunc1): Convert to the target type for
4836         initialization.
4837         (gfc_trans_allocate): Convert result to target type.
4838         * cp-objcp-common.c (cxx_get_alias_set): Pointers to
4839         pointer-to-member structures shall have alias set zero as well.
4840
4841 2007-08-20  Richard Guenther  <rguenther@suse.de>
4842
4843         * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P):
4844         Remove.
4845         * cp-tree.h (cp_auto_var_in_fn_p): Remove.
4846         (nonstatic_local_decl_p): Likewise.
4847         * tree.c (cp_auto_var_in_fn_p): Remove.
4848         * decl.c (nonstatic_local_decl_p): Remove.
4849
4850 2007-08-20  Richard Guenther  <rguenther@suse.de>
4851
4852         * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_WALK_SUBTREES):
4853         Remove define.
4854         * tree.h (cp_walk_tree): New define to walk_tree_1 with
4855         cp_walk_subtrees lh parameter.
4856         (cp_walk_tree_without_duplicates): New define to
4857         walk_tree_without_duplicates_1 with cp_walk_subtrees lh parameter.
4858         * tree.c (count_trees): Call
4859         cp_walk_tree_without_duplicates.
4860         (verify_stmt_tree): Call cp_walk_tree.
4861         (break_out_target_exprs): Likewise.
4862         (WALK_SUBTREE): Likewise.
4863         * cp-gimplify.c (cp_genericize): Likewise.
4864         * cp-pt.c (find_parameter_packs_r): Likewise.
4865         (uses_parameter_packs): Likewise.
4866         (make_pack_expansion): Likewise.
4867         (check_for_bare_parameter_packs): Likewise.
4868         (for_each_template_parm): Likewise.
4869         * decl.c (check_default_argument): Call
4870         cp_walk_tree_without_duplicates.
4871         * except.c (build_throw): Likewise.
4872         * decl2.c (type_visibility): Likewise.
4873         * semantics.c (expand_or_defer_fn): Likewise.
4874         (finalize_nrv): Call cp_walk_tree.
4875
4876 2007-08-20  Jakub Jelinek  <jakub@redhat.com>
4877
4878         PR c++/33025
4879         * init.c (build_new_1): Rename placement_var variable to placement_expr.
4880         Initialize it with save_expr rather than get_temp_regvar.
4881
4882 2007-08-17  Andrew Pinski  <andrew_pinski@playstation.sony.com>
4883
4884         PR c++/28989
4885         * tree.c (lvalue_p_1 <case SAVE_EXPR>): SAVE_EXPRs are never
4886         lvalues.
4887
4888 2007-08-17  Ollie Wild  <aaw@google.com>
4889
4890         PR c++/31749
4891         * name-lookup.c (do_nonmember_using_decl): Shift implicit type
4892         declarations into appropriate slots for comparison.  Fix type
4893         comparison.
4894
4895 2007-08-17  Paolo Carlini  <pcarlini@suse.de>
4896
4897         PR c++/32112
4898         * error.c (dump_decl): Deal with UNBOUND_CLASS_TEMPLATE.
4899         * cxx-pretty-print.c (pp_cxx_unqualified_id): Likewise.
4900
4901 2007-08-17  Paolo Carlini  <pcarlini@suse.de>
4902
4903         PR c++/32870
4904         * parser.c (cp_parser_class_head): Improve error message.
4905
4906 2007-08-16  Seongbae Park  <seongbae.park@gmail.com>
4907
4908         * pt.c (instantiate_decl): Set input_location
4909         for the function end.
4910
4911 2007-08-16  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4912
4913         * cp-objcp-common.c (cxx_warn_unused_global_decl, cp_expr_size):
4914         Constify.
4915         * cp-tree.h (local_variable_p, nonstatic_local_decl_p,
4916         class_tmpl_impl_spec_p, cp_auto_var_in_fn_p, cp_type_quals,
4917         cxx_incomplete_type_diagnostic, cxx_incomplete_type_error,
4918         cxx_warn_unused_global_decl, cp_expr_size): Likewise.
4919         * decl.c (local_variable_p, nonstatic_local_decl_p): Likewise.
4920         * tree.c (class_tmpl_impl_spec_p, cp_auto_var_in_fn_p): Likewise.
4921         * typeck.c (cp_type_quals): Likewise.
4922         * typeck2.c (cxx_incomplete_type_diagnostic,
4923         cxx_incomplete_type_error): Likewise.
4924
4925 2007-08-16  Paolo Carlini  <pcarlini@suse.de>
4926
4927         PR c++/31132
4928         * pt.c (tsubst_friend_function): When check_classfn
4929         returns error_mark_node likewise return it.
4930
4931 2007-08-15  Jakub Jelinek  <jakub@redhat.com>
4932
4933         PR c++/32992
4934         * typeck.c (check_return_expr): Don't NRV optimize vars in
4935         anonymous unions.
4936         * decl.c (finish_function): Comment fix.
4937
4938 2007-08-15  Paolo Carlini  <pcarlini@suse.de>
4939
4940         PR c++/33035
4941         * pt.c (push_template_decl_real): Depending on TYPE_P
4942         use either TYPE_CONTEXT or DECL_CONTEXT.
4943
4944 2007-08-14  Mark Mitchell  <mark@codesourcery.com>
4945
4946         * semantics.c (finish_omp_clauses): Strip a NOP_EXPR if
4947         constructors and destructors return this.
4948
4949 2007-08-14  Paolo Carlini  <pcarlini@suse.de>
4950
4951         PR c++/27211
4952         * decl2.c (check_classfn): Return error_mark_node in case of error;
4953         in that case, do not call add_method.
4954         * decl.c (start_decl): Deal with check_classfn returning
4955         error_mark_node.
4956         (grokfndecl): Likewise.
4957         * pt.c (tsubst_friend_function): Likewise.
4958
4959 2007-08-14  Andrew Pinski  <pinskia@gmail.com>
4960
4961         PR c++/30428
4962         * typeck.c (build_binary_op): Disallow vector float types with
4963         BIT_IOR_EXPR, BIT_AND_EXPR, and BIT_XOR_EXPR.
4964
4965 2007-08-11  Ian Lance Taylor  <iant@google.com>
4966
4967         * cp-objcp-common.c (cxx_get_alias_set): Change return type to
4968         alias_set_type.
4969         * cp-tree.h (cxx_get_alias_set): Update declaration.
4970
4971 2007-08-10  Ollie Wild  <aaw@google.com>
4972
4973         * name-lookup.c (do_nonmember_using_decl): Print an error for ambiguous
4974         type lookups.
4975         (ambiguous_decl): Construct tree of ambiguous types.  Remove extaneous
4976         function parameter.
4977         (unqualified_namespace_lookup): Fix ambiguous_decl call.
4978         (lookup_using_namespace): Fix ambiguous_decl call.
4979         (qualified_lookup_using_namespace): Fix ambiguous_decl call.
4980
4981 2007-08-10  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4982
4983         * call.c (name_as_c_string): Use CONST_CAST.
4984         * decl.c (build_decl): Likewise.
4985         * parser.c (cp_parser_string_literal): Likewise.
4986
4987 2007-08-10  Paolo Carlini  <pcarlini@suse.de>
4988
4989         PR c++/17763
4990         * error.c (dump_expr): Consistently use the *_cxx_*
4991         variants of the pretty-print functions.
4992
4993 2007-08-10  Paolo Carlini  <pcarlini@suse.de>
4994
4995         PR c++/22256
4996         * decl.c (check_special_function_return_type): Just error
4997         on return type specified for conversion operator.
4998
4999 2007-08-09  Daniel Berlin  <dberlin@dberlin.org>
5000
5001         * typeck2.c (readonly_error): Handle general expressions.
5002         * error.c (dump_expr): Handle POINTER_PLUS_EXPR
5003
5004 2007-08-06  Dan Hipschman  <dsh@google.com>
5005
5006         * method.c (use_thunk): Use DECL_NAME instead of DECL_RTL to
5007         access function name.
5008
5009 2007-08-04  Alfred Minarik  <a.minarik@aon.at>
5010
5011         PR pch/13676
5012         * lang-specs.h: Add .hp, .hxx, .hpp, .h, .HPP, .tcc as c++ header.
5013         * g++spec.c (lang_specific_driver): Check them.
5014
5015 2007-08-06  Paolo Carlini  <pcarlini@suse.de>
5016
5017         PR c++/19532
5018         * pt.c (inline_needs_template_parms): Fix comment; change return type
5019         to bool.
5020
5021 2007-08-05  Volker Reichelt  <v.reichelt@netcologne.de>
5022
5023         Revert:
5024         2007-03-26  Dirk Mueller  <dmueller@suse.de>
5025
5026         * parser.c (cp_parser_member_declaration): Pedwarn
5027         about stray semicolons after member declarations.
5028
5029 2007-08-02  Lee Millward  <lee.millward@gmail.com>
5030
5031         PR c++/30849
5032         PR c++/30850
5033         PR c++/30851
5034         * parser.c (cp_parser_asm_definition): Detect and discard asm
5035         statements with invalid inputs or outputs.
5036          (cp_parser_asm_operand_list): Return error mark node if any
5037          of the operands are invalid. Adjust documentation.
5038
5039 2007-08-02  Nick Clifton  <nickc@redhat.com>
5040
5041         * typeck.c: Change copyright header to refer to version 3 of the
5042         GNU General Public License and to point readers at the COPYING3
5043         file and the FSF's license web page.
5044         * optimize.c, lang-specs.h, init.c, class.c, repo.c, decl.c,
5045         config-lang.in, cp-tree.def, call.c, decl.h, ptree.c,
5046         Make-lang.in, method.c, rtti.c, cp-objcp-common.c, g++spec.c,
5047         cp-objcp-common.h, except.c, error.c, operators.def, cvt.c,
5048         tree.c, mangle.c, cp-tree.h, dump.c, search.c, friend.c, expr.c,
5049         cp-gimplify.c, cxx-pretty-print.c, cp-lang.c, typeck2.c, pt.c,
5050         cxx-pretty-print.h, semantics.c, name-lookup.c, lex.c, decl2.c,
5051         name-lookup.h, parser.c: Likewise.
5052
5053 2007-08-01  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5054
5055         PR middle-end/32668
5056         * call.c (magic_varargs_p): Honor the "type generic" attribute.
5057
5058 2007-07-30  Paolo Carlini  <pcarlini@suse.de>
5059
5060         PR c++/32108
5061         * semantics.c (finish_label_stmt): Reject the __label__
5062         extension outside function scopes.
5063
5064 2007-07-29  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5065
5066         * parser.c (eof_token): Un-constify.
5067         (cp_lexer_new_main, cp_lexer_new_from_tokens, VEC_alloc,
5068         cp_lexer_consume_token, cp_lexer_purge_token): Remove spurious
5069         casts.
5070
5071 2007-07-28  Kazu Hirata  <kazu@codesourcery.com>
5072
5073         * pt.c, tree.c, typeck2.c: Fix comment typos.
5074
5075 2007-07-28  Simon Martin  <simartin@users.sourceforge.net>
5076             Mark Mitchell  <mark@codesourcery.com>
5077
5078         PR c++/30917
5079         * name-lookup.c (lookup_name_real): Non namespace-scope bindings can be
5080         hidden due to friend declarations in local classes.
5081
5082 2007-07-27  Douglas Gregor  <doug.gregor@gmail.com>
5083
5084         * typeck.c (structural_comptypes): Compare DECLTYPE_TYPE nodes.
5085         * cp-tree.def (DECLTYPE_TYPE): New.
5086         * error.c (dump_type): Dump DECLTYPE_TYPE nodes.
5087         (dump_type_prefix): Ditto.
5088         (dump_type_suffix): Ditto.
5089         * tree.c (DECLTYPE_TYPE): Walk DECLTYPE_TYPE nodes.
5090         * mangle.c (write_type): Handle DECLTYPE_TYPE.
5091         * cp-tree.h (IS_AGGR_TYPE): DECLTYPE_TYPE nodes can be aggregate
5092         types.
5093         (DECLTYPE_TYPE_EXPR): New.
5094         (DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P): New.
5095         (finish_declared_type): Declare.
5096         * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Print
5097         DECLTYPE_TYPE nodes.
5098         (pp_cxx_type_id): Ditto.
5099         * pt.c (for_each_template_parm_r): Walk DECLTYPE_TYPE children.
5100         (tsubst): Substitute into a DECLTYPE_TYPE node.
5101         (tsubst_copy): Ditto.
5102         (unify): Cannot deduce anything from TYPEOF_TYPE or DECLTYPE_TYPE
5103         nodes.
5104         (dependent_type_p_r): DECLTYPE_TYPE types are always dependent.
5105         * semantics.c (finish_typeof): TYPEOF_TYPE types need to use
5106         structural equality (because we can't hash the expressions).
5107         (finish_declared_type): New.
5108         * lex.c (reswords): Add "decltype" keyword.
5109         * parser.c cp_lexer_next_token_is_decl_specifier_keyword
5110         (cp_parser_postfix_expression): Add member_access_only_p to
5111         restrict postfix expression to member access expressions.
5112         (cp_parser_unary_expression): Update call to
5113         cp_parser_postfix_expression to reflect new parameter.
5114         (cp_parser_declared_type): New.
5115         (cp_parser_simple_type_specifier): Parse decltype types.
5116
5117 2007-07-27  Mark Mitchell  <mark@codesourcery.com>
5118
5119         PR c++/32346
5120         * call.c (convert_for_arg_passing): Only widen bitfields to their
5121         declared types if necessary.
5122
5123 2007-07-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5124
5125         * parser.c (cp_parser_string_literal, cp_parser_sizeof_operand):
5126         Constify.
5127
5128 2007-07-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5129
5130         * decl.c (typename_hash, typename_compare): Constify.
5131         * mangle.c (hash_type, compare_type): Likewise.
5132         * pt.c (eq_local_specializations, hash_local_specialization):
5133         Likewise.
5134         * tree.c (cplus_array_hash, cplus_array_compare, list_hash_eq,
5135         list_hash): Likewise.
5136         * typeck2.c (pat_compare): Likewise.
5137
5138 2007-07-24  Nathan Sidwell  <nathan@codesourcery.com>
5139
5140         * method.c (implicitly_declare_fn): Increase alignment if member
5141         function pointer format requires it.
5142
5143 2007-07-24  Paolo Carlini  <pcarlini@suse.de>
5144
5145         PR c++/29001
5146         * typeck.c (check_return_expr): Do not pass a null argument
5147         to null_ptr_cst_p.
5148
5149 2007-07-24  Paolo Carlini  <pcarlini@suse.de>
5150
5151         PR c++/32561
5152         * decl.c (redeclaration_error_message): Call DECL_ANON_UNION_VAR_P
5153         only on VAR_DECL.
5154
5155 2007-07-22  Nathan Sidwell  <nathan@codesourcery.com>
5156
5157         PR c++/32839
5158         * typeck.c (convert_arguments): Only use default args if we have
5159         a function decl.
5160
5161         PR c++/30818
5162         * typeck.c (structural_comptypes): No need to check
5163         resolve_typename_type return value here.
5164         * cp-tree.h (TYPENAME_IS_RESOLVING_P): New.
5165         * pt.c (resolve_typename_type): Follow typename typedefs.  Return
5166         original type rather than error_mark_node in case of failure.
5167         * parser.c (cp_parser_nested_name_specifier_opt): Adjust
5168         resolve_typename_type result check.
5169         (cp_parser_direct_declarator, cp_parser_head,
5170         cp_parser_constructor_declarator_p): Likewise.
5171
5172 2007-07-12  Kazu Hirata  <kazu@codesourcery.com>
5173
5174         * pt.c (template_parms_variadic_p): Remove.
5175         * cp-tree.h: Remove the prototype for template_parms_variadic_p.
5176
5177 2007-07-12  Jakub Jelinek  <jakub@redhat.com>
5178
5179         PR c++/30854
5180         * error.c (dump_expr) <case AGGR_INIT_EXPR>: Pass true as last
5181         argument to dump_aggr_init_expr_args instead of false.
5182
5183 2007-07-11  Douglas Gregor  <doug.gregor@gmail.com>
5184
5185         * typeck.c (comptypes): When USE_CANONICAL_TYPES, use the
5186         canonical types; otherwise, fall back to structural type
5187         comparisons. If ENABLE_CHECKING and USE_CANONICAL_TYPES, give an
5188         internal compiler error if the canonical types are wrong.
5189
5190 2007-07-11  Paolo Carlini  <pcarlini@suse.de>
5191
5192         PR c++/32560
5193         * parser.c (cp_parser_make_indirect_declarator): When the
5194         the code argument is ERROR_MARK return cp_error_declarator.
5195
5196 2007-07-09  Geoffrey Keating  <geoffk@apple.com>
5197
5198         PR 32617
5199         * decl.c (cxx_init_decl_processing): Don't set
5200         force_align_functions_log.
5201         (grokfndecl): Honour ptrmemfunc_vbit_in_pfn.
5202         * typeck.c (cxx_alignof_expr): When alignof is used on a plain
5203         FUNCTION_DECL, return its alignment.
5204
5205 2007-07-09  Richard Guenther  <rguenther@suse.de>
5206
5207         * decl.c (start_preparsed_function): Do not promote return type.
5208
5209 2007-07-08  Paolo Carlini  <pcarlini@suse.de>
5210
5211         PR c++/30535
5212         * pt.c (unify): Never pass error_mark_node to template_decl_level.
5213
5214 2007-07-07  Mark Mitchell  <mark@codesourcery.com>
5215
5216         PR c++/32232
5217         * pt.c (resolve_overloaded_unification): Robustify.  Return a
5218         bool, not an int.
5219         (type_unification_real): Adjust accordingly.
5220
5221 2007-07-06  Richard Guenther  <rguenther@suse.de>
5222
5223         * init.c (build_new_1): Use the correct pointer type.
5224         * typeck2.c (build_m_component_ref): Likewise.
5225
5226 2007-07-05  Mark Mitchell  <mark@codesourcery.com>
5227
5228         PR c++/32245
5229         * init.c (build_zero_init): Always build an initializer for
5230         non-static storage.
5231         * typeck2.c (build_functional_cast): Use build_zero_init.
5232
5233         PR c++/32251
5234         * init.c (build_new_1): Always pass the allocation function to
5235         build_op_delete_call.
5236         * call.c (build_op_delete_call): Handle operator delete with a
5237         variable-argument list.  Do not issue an error when no matching
5238         deallocation function is available for a new operator.
5239
5240         PR c++/31992
5241         * cp-tree.h (any_value_dependent_elements_p): Declare it.
5242         * decl.c (value_dependent_init_p): New function.
5243         (cp_finish_decl): Use it.
5244         * pt.c (value_dependent_expression_p): Use
5245         any_value_dependent_elements_p.
5246         * parser.c (cp_parser_primary_expression): Add comment about
5247         treating dependent qualified names as integral
5248         constant-expressions.
5249
5250 2007-07-04  Douglas Gregor  <doug.gregor@gmail.com>
5251
5252         * decl.c (build_ptrmemfunc_type): Always use structural equality
5253         tests when comparing pointer-to-member-function types, because the
5254         handling of TYPE_GET_PTRMEMFUNC_TYPE currently defeats canonical
5255         types.
5256
5257 2007-07-03  Mark Mitchell  <mark@codesourcery.com>
5258
5259         * init.c (build_new): Tweak comment.
5260
5261 2007-06-29  Dave Brolley  <brolley@redhat.com>
5262
5263         PR c++/31743
5264         * parser.c (cp_parser_new_type_id): Don't reduce a named array
5265         type to its base type and number of elements here.
5266         * init.c (build_new): Call complete_type_or_else to ensure that the
5267         type is complete and to issue a diagnostic if it is not.
5268         (build_new_1): Don't call complete_type_or_else here.
5269
5270 2007-07-03  Richard Guenther  <rguenther@suse.de>
5271
5272         PR c++/32609
5273         * class.c (fixed_type_or_null): Re-lookup the hashtable slot
5274         after recursing.
5275
5276 2007-07-02  Simon Baldwin  <simonb@google.com>
5277
5278         * parser.c (cp_parser_elaborated_type_specifier): Added a warning
5279         for inner-style nested forward declarations that don't declare
5280         anything useful.
5281
5282 2007-07-02  Jakub Jelinek  <jakub@redhat.com>
5283
5284         PR c++/31748
5285         * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
5286         DECL_P in not a variable and appears more than once error messages.
5287
5288 2007-07-01  Ollie Wild  <aaw@google.com>
5289
5290         * name-lookup.c (ambiguous_decl): Fix case when new->value is hidden.
5291         (select_decl): Remove function.
5292         (unqualified_namespace_lookup): Populate binding by calling
5293         ambiguous_decl.  Remove select_decl call.
5294         (lookup_qualified_name): Remove select_decl call.
5295         * decl.c (lookup_and_check_tag): Check for ambiguous references.
5296         * parser.c (cp_parser_elaborated_type_specifier): Skip redundant error
5297         generation when name lookup is ambiguous.
5298
5299 2007-06-29  Douglas Gregor  <doug.gregor@gmail.com>
5300
5301         PR c++/31724
5302         * init.c (build_new_1): Use structural equality on the copy of the
5303         array type.
5304
5305 2007-06-28  Geoffrey Keating  <geoffk@apple.com>
5306
5307         * decl2.c (determine_visibility): Implement
5308         flag_visibility_ms_compat effect on type info.
5309         * decl.c (cxx_init_decl_processing): Implement
5310         global effect of flag_visibility_ms_compat.
5311
5312 2007-06-28  Geoffrey Keating  <geoffk@apple.com>
5313
5314         * decl2.c (start_objects): Mark constructor-running function
5315         as artificial.
5316
5317 2007-06-26  Simon Martin  <simartin@users.sourceforge.net>
5318
5319         PR c++/32111
5320         * decl.c (grokdeclarator): Reset friendp for member functions declared
5321         friend of their own class.
5322
5323 2007-06-23  Mark Mitchell  <mark@codesourcery.com>
5324
5325         * decl2.c (determine_visibility): Don't look for dllexport here.
5326         (determine_visibility_from_class): Tidy.
5327
5328 2007-06-18  Simon Baldwin <simonb@google.com>
5329
5330         PR c++/31923
5331         * parser.c (cp_parser_single_declaration): Added check for storage
5332         class other than sc_none in parsed declaration, and a flag to indicate
5333         if the call is part of an explicit template specialization parse.
5334         * (cp_parser_explicit_specialization): Specialization check flag added
5335         to call to cp_parser_single_declaration(), set true.
5336         * (cp_parser_template_declaration_after_export): Specialization check
5337         flag added to call to cp_parser_single_declaration(), set false.
5338         * pt.c (check_explicit_specialization): Added code to copy visiblity
5339         and linkage from the templated function to the explicit specialization.
5340
5341 2007-06-15  Andrew Pinski  <andrew_pinski@playstation.sony.com>
5342
5343         * typeck.c (build_binary_op): For templates build the
5344         expression in pieces to avoid the assert in build2_stat.
5345         (get_member_function_from_ptrfunc):
5346         Change over to using POINTER_PLUS_EXPR and convert
5347         the second operand to sizetype.
5348         * typeck2.c (build_m_component_ref):  Likewise.
5349         * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR
5350         instead of PLUS_EXPR for pointers.
5351         (build_new_1): Likewise.
5352         (build_vec_delete_1): Likewise.
5353         (build_vec_delete): Likewise.
5354         * class.c (build_base_path): Likewise.
5355         (build_base_path): Likewise.
5356         (convert_to_base_statically): Likewise.
5357         (fixed_type_or_null): Handle POINTER_PLUS_EXPR.
5358         (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR
5359         instead of PLUS_EXPR.
5360         (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR
5361         instead of PLUS_EXPR for pointers.
5362         * call.c (build_special_member_call): Likewise.
5363         * rtti.c (build_headof): Likewise.
5364         Use sizetype instead of ptrdiff_type_node.
5365         (tinfo_base_init): Create a POINTER_PLUS_EXPR
5366         instead of PLUS_EXPR for pointers.
5367         * except.c (expand_start_catch_block):  Do a
5368         NEGATIVE and then a POINTER_PLUS_EXPR instead
5369         of a MINUS_EXPR.
5370         * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert
5371         PLUS_EXPR on pointer types over to use
5372         POINTER_PLUS_EXPR and remove the conversion
5373         to the pointer types.
5374         * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for
5375         adding to a pointer type. Use size_int instead of
5376         ssize_int. Convert the index to sizetype before
5377         adding it to the pointer.
5378
5379 2007-06-15  Mark Mitchell  <mark@codesourcery.com>
5380
5381         * cp-tree.h (DECL_VAR_MARKED_P): Remove.
5382         (DECL_ANON_UNION_VAR_P): New macro.
5383         * class.c (fixed_type_or_null): Tidy.  Use a hash table, rather
5384         than DECL_VAR_MARKED_P, to keep track of which variables we have
5385         seen.
5386         * decl.c (redeclaration_error_message): Complain about redeclaring
5387         anonymous union members at namespace scope.
5388         * decl2.c (build_anon_union_vars): Set DECL_ANON_UNION_VAR_P.
5389
5390 2007-06-14  Geoff Keating  <geoffk@apple.com>
5391
5392         * decl2.c (determine_visibility): Ensure that functions with
5393         hidden types as parameters are hidden.
5394
5395         PR 31093
5396         * decl2.c (determine_visibility): Remove duplicate code for
5397         handling type info.
5398
5399 2007-06-12  Ian Lance Taylor  <iant@google.com>
5400
5401         PR libstdc++/29286
5402         * init.c (avoid_placement_new_aliasing): New static function.
5403         (build_new_1): Call it.
5404
5405 2007-06-11  Rafael Ávila de Espíndola  <espindola@google.com>
5406
5407         * cp-objcp-common.h (LANG_HOOKS_SIGNED_TYPE): Remove.
5408         (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove.
5409
5410 2007-06-08  Jakub Jelinek  <jakub@redhat.com>
5411
5412         PR c++/32177
5413         * semantics.c (finish_omp_for): Call fold_build_cleanup_point_expr
5414         on init, the non-decl cond operand and increment value.
5415
5416 2007-06-07  Simon Martin  <simartin@users.sourceforge.net>
5417
5418         PR c++/30759
5419         * decl.c (check_initializer): Report an error when a brace enclosed
5420         initializer is used for a non-aggregate type in C++98.
5421         (redeclaration_error_message): Rewrote flag_cpp0x in terms of
5422         cxx_dialect.
5423         (grokdeclarator): Likewise.
5424         (move_fn_p): Likewise.
5425         * typeck.c (check_return_expr): Likewise.
5426         * call.c (reference_binding): Likewise.
5427         * error.c (cp_cpp_error): Likewise.
5428         * pt.c (check_default_tmpl_args): Likewise.
5429         (tsubst): Likewise.
5430         * lex.c (init_reswords): Likewise.
5431         * parser.c (p_parser_primary_expression): Likewise.
5432         (TOKEN_PRECEDENCE): Likewise.
5433         (cp_parser_init_declarator): Likewise.
5434         (cp_parser_ptr_operator): Likewise.
5435         (cp_parser_parameter_declaration): Likewise.
5436         (cp_parser_enclosed_template_argument_list): Likewise.
5437         (cp_parser_skip_to_end_of_template_parameter_list): Likewise.
5438         (cp_parser_next_token_ends_template_argument_p): Likewise.
5439
5440 2007-06-04  Simon Baldwin  <simonb@google.com>
5441
5442         * decl.c (grokdeclarator): Readability change.  Moved case labels
5443         into direct switch statement scope.
5444
5445 2007-06-04  Paolo Carlini  <pcarlini@suse.de>
5446
5447         * call.c (convert_like_real): Remove pointless code.
5448
5449 2007-05-31  Mark Mitchell  <mark@codesourcery.com>
5450
5451         * decl.c (get_atexit_fn_ptr_type): New function.
5452         (get_atexit_node): Use it.
5453         (start_cleanup_fn): Likewise.
5454         (register_dtor_fn): Use the object's destructor, instead of a
5455         separate cleanup function, where possible.
5456         * cp-tree.h (CPTI_ATEXIT_FN_PTR_TYPE): New enumerator.
5457         (atexit_fn_ptr_type_node): New macro.
5458         * decl2.c (build_cleanup): Use build_address.
5459
5460 2007-05-31  Daniel Berlin  <dberlin@dberlin.org>
5461
5462         * typeck.c (build_binary_op): Include types in error.
5463
5464 2007-05-31  Jakub Jelinek  <jakub@redhat.com>
5465
5466         PR c++/31806
5467         * decl.c (cp_finish_decl): Also clear was_readonly if a static var
5468         needs runtime initialization.
5469
5470 2007-05-31  Paolo Carlini  <pcarlini@suse.de>
5471
5472         PR c++/32158
5473         * semantics.c (finish_trait_expr): Complete the types.
5474
5475 2007-05-30  Russell Yanofsky <russ@yanofsky.org>
5476              Douglas Gregor <doug.gregor@gmail.com>
5477              Pedro Lamarao <pedro.lamarao@mndfck.org>
5478              Howard Hinnant <howard.hinnant@gmail.com>
5479
5480         PR c++/7412
5481         PR c++/29939
5482         * typeck.c (comptypes): Don't consider rvalue and lvalue
5483         reference types to be equivalent.
5484         (check_return_expr): Move from certain lvalues when returning
5485         them.
5486         * decl.c (grokdeclarator): Implement reference collapsing.
5487         (copy_fn_p): Don't consider constructors taking rvalue references
5488         to be copy constructors.
5489         (move_fn_p): New.
5490         * call.c (conversion): New "rvaluedness_matches_p" member.
5491         (convert_class_to_reference): Require reference type as first
5492         parameter instead of base type.
5493         (reference_binding): Add logic to handle rvalue references.
5494         (implicit_conversion): Update inaccurate comment.
5495         (convert_like_real): Disable creation of temporaries that are
5496         impossible to initialize for types with move constructors.
5497         (build_over_call): Elide move constructors when possible.
5498         (maybe_handle_implicit_object): Set "rvaluedness_matches_p".
5499         (maybe_handle_ref_bind): Return conversion instead of type node.
5500         (compare_ics): Add logic to use "rvaluedness_matches_p" values to
5501         determine preferred conversion sequences.
5502         * cp-tree.h (TYPE_REF_IS_RVALUE): New.
5503         (LOOKUP_PREFER_RVALUE): New.
5504         (DECL_MOVE_CONSTRUCTOR_P): New.
5505         (struct cp_declarator): Add "reference" member for reference
5506         types, with new "rvalue_ref" flag.
5507         (cp_build_reference_type): Declare.
5508         (move_fn_p): Declare.
5509         * error.c (dump_type_prefix): Format rvalue reference types
5510         correctly in error messages.
5511         * except.c (build_throw): Move from certain lvalues when
5512         throwing.
5513         * mangle.c (write_type): Mangle rvalue references differently
5514         than regular references.
5515         * parser.c (make_reference_declarator): Add boolean parameter for
5516         rvalue references.
5517         (cp_parser_make_indirect_declarator): New.
5518         (cp_parser_new_declarator_opt): Call
5519         cp_parser_make_indirect_declarator.
5520         (cp_parser_conversion_declarator_opt): Ditto.
5521         (cp_parser_declarator): Ditto.
5522         (cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference
5523         declarators.
5524         * pt.c (tsubst): Implement reference collapsing.
5525         (maybe_adjust_types_for_deduction): Implement special template
5526         parameter deduction rule for rvalue references.
5527         (type_unification_real): Update calls to
5528         maybe_adjust_types_for_deduction.
5529         (try_one_overload): Ditto.
5530         (unify_pack_expansion): Ditto.
5531         * tree.c (lvalue_p_1): Handle rvalue reference types.
5532         (cp_build_reference_type): New.
5533
5534 2007-05-30  Jakub Jelinek  <jakub@redhat.com>
5535
5536         PR c++/31809
5537         * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC
5538         variables that need runtime initialization.
5539
5540 2007-05-28  Andrew Pinski  <Andrew_pinski@playstation.sony.com>
5541
5542         PR c++/31339
5543         * typeck.c (build_unary_op <case PREINCREMENT_EXPR,
5544         case POSTINCREMENT_EXPR, case PREDECREMENT_EXPR,
5545         case POSTDECREMENT_EXPR>): Return the error_mark_node
5546         if either the real or imaginary parts would an
5547         error_mark_node.
5548
5549 2007-05-25  Simon Martin  <simartin@users.sourceforge.net>
5550             Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
5551
5552         PR c++/31745
5553         * parser.c (cp_parser_skip_to_closing_brace): Return true if the next
5554         token is a closing brace, false if there are no tokens left.
5555         (cp_parser_namespace_alias_definition): Only consume the next token if
5556         it is a closing brace.
5557
5558         * parser.c (cp_parser_class_specifier): Likewise.
5559
5560 2007-05-25  H.J. Lu  <hongjiu.lu@intel.com>
5561
5562         * semantics.c (finish_member_declaration): Fix a typo in the
5563         last checkin.
5564
5565 2007-05-25  Douglas Gregor <doug.gregor@gmail.com>
5566
5567         PR c++/31431
5568         PR c++/31432
5569         PR c++/31434
5570         PR c++/31435
5571         PR c++/31437
5572         PR c++/31438
5573         PR c++/31442
5574         PR c++/31443
5575         PR c++/31444
5576         PR c++/31445
5577         * error.c (dump_type): Dump TYPE_ARGUMENT_PACK nodes.
5578         * cp-tree.h (check_for_bare_parameter_packs): Returns bool.
5579         * pt.c (check_for_bare_parameter_packs): Return bool indicated
5580         whether everything was okay. Fix indentation.
5581         (push_template_decl_real): Check for bare parameter packs in
5582         function parameters; where errors occur, mark the parameter types
5583         with ERROR_MARK_NODEs to avert ICEs.
5584         (coerce_template_parameter_pack): New.
5585         (coerce_template_parms): Moved parameter pack coercion into
5586         coerce_template_parameter_pack, and permit it anywhere in the
5587         template parameter list (not just at the end). Parameter and
5588         argument indices can vary (somewhat) separately now, so add
5589         PARM_IDX and ARG_IDX.
5590         (fn_type_unification): Don't set an argument pack as incomplete if
5591         no argument pack was deduced.
5592         (type_unification_real): If a type parameter is a parameter pack
5593         and has not otherwise been deduced, it will be deduced to an empty
5594         parameter pack.
5595         (more_specialized_fn): Use the actual lengths of the argument
5596         lists when comparing against expansions.
5597         * semantics.c (finish_member_declaration): If a field's type has
5598         bare parameter packs, error and set its type to ERROR_MARK_NODE.
5599
5600 2007-05-24  Danny Smith  <dannysmith@users.sourceforge.net>
5601
5602         PR target/27067
5603         * mangle.c (mangle_decl): Call targetm.mangle_decl_assembler_name.
5604
5605 2007-05-22  Ollie Wild  <aaw@google.com>
5606
5607         * name-lookup.c (ambiguous_decl): Adds check for hidden types.
5608         (unqualified_namespace_lookup): Adds check for hidden types.
5609
5610 2007-05-22  Ollie Wild  <aaw@google.com>
5611
5612         * decl.c (duplicate_decls): Verify namespace names are unique.
5613
5614 2007-05-21  Mark Mitchell  <mark@codesourcery.com>
5615
5616         * decl.c (cxx_maybe_build_cleanup): Handle
5617         __attribute__((cleanup)).
5618
5619 2007-05-19  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
5620
5621         * cvt.c (cp_convert_and_check): Don't check warnings if the
5622         conversion failed.
5623
5624 2007-05-18  Geoffrey Keating  <geoffk@apple.com>
5625
5626         * mangle.c (write_real_cst): Use 'unsigned long' for %lx.
5627
5628 2007-05-14  Paolo Carlini  <pcarlini@suse.de>
5629
5630         PR c++/29928
5631         * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the
5632         type only if is a class type (5.2.8/4).
5633
5634 2007-05-14  Rafael Ávila de Espíndola  <espindola@google.com>
5635
5636         * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
5637         * decl.c (grokdeclarator): Use unsigned_type_for instead of
5638         c_common_unsigned_type.
5639
5640 2007-05-11  Silvius Rus  <rus@google.com>
5641
5642         * typeck.c (build_indirect_ref): Add call to
5643         strict_aliasing_warning.
5644         (build_reinterpret_cast_1): Condition call to
5645         strict_aliasing_warning.
5646
5647 2007-05-11  Jan Hubicka  <jh@suse.cz>
5648
5649         * semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
5650         * decl2.c (start_objects): ctors and dtors are no longer public.
5651         (cp_write_global_declarations): Do not call c_build_cdtor_fns.
5652
5653 2007-05-07  Andrew Pinski  <andrew_pinski@playstation.sony.com>
5654
5655         * typeck.c (build_unary_op): Remove code that used to
5656         handle non lvalue increments/decrements.
5657
5658 2007-05-07  Mike Stump  <mrs@apple.com>
5659
5660         * parser.c (check_empty_body): Add.
5661         (cp_parser_iteration_statement): Add call to check_empty_body.
5662
5663 2007-05-05  Geoffrey Keating  <geoffk@apple.com>
5664
5665         PR 31775
5666         * mangle.c (write_mangled_name): Mangle static variable names.
5667         (write_unqualified_name): Use local-source-name for
5668         namespace-scope static variables.
5669
5670 2007-05-04  Dirk Mueller  <dmueller@suse.de>
5671
5672         * cp-tree.h (DECL_MAIN_P): only if -ffreestanding is
5673         not in effect.
5674
5675 2007-05-02  Seongbae Park  <seongbae.park@gmail.com>
5676
5677         PR c++/31663
5678         * decl2.c (constrain_class_visibility):
5679         Use strip_pointer_or_array_types instead of strip_array_types.
5680
5681 2007-04-28  Andrew Pinski  <andrew_pinski@playstation.sony.com>
5682
5683         PR C++/30221
5684         * decl.c (reshape_init_r): Don't reshape the first element if it
5685         is a pointer to member function.
5686
5687 2007-04-27  Simon Baldwin  <simonb@google.com>
5688
5689         * decl.c (grokparms): Changed message format from %qD to %qE.
5690
5691 2007-04-27  Douglas Gregor  <doug.gregor@gmail.com>
5692
5693         * error.c (maybe_warn_variadic_templates): Variadic templates are
5694         now in C++0x, so only warn about them in C++98 mode.
5695
5696 2007-04-26  Andrew Pinski  <andrew_pinski@playstation.sony.com>
5697
5698         PR C++/30016
5699         * typeck.c (build_reinterpret_cast_1): Only allow conversion to
5700         integeral types from vectors types.
5701
5702 2007-04-26  Jakub Jelinek  <jakub@redhat.com>
5703
5704         PR c++/31598
5705         * semantics.c (finish_omp_clauses): Don't create CP_OMP_CLAUSE_INFO
5706         for type dependent OMP_CLAUSE_DECLs.
5707
5708 2007-04-24  Mark Mitchell  <mark@codesourcery.com>
5709
5710         PR c++/31338
5711         * cp-tree.h (ARITHMETIC_TYPE): Include COMPLEX_TYPE.
5712         * typeck.c (type_after_usual_arithmetic_conversions): Adjust, as
5713         COMPLEX_TYPE is now an ARITHMETIC_TYPE.
5714         * init.c (build_zero_init): Adjust, as
5715         COMPLEX_TYPE is now a SCALAR_TYPE.
5716         * typeck2.c (digest_init): Allow brace-enclosed initializers for
5717         COMPLEX_TYPE, even though that is now a SCALAR_TYPE.
5718
5719 2007-04-25  Paolo Carlini  <pcarlini@suse.de>
5720
5721         * semantics.c (classtype_has_nothrow_copy_or_assign_p): Adjust
5722         per N2255; rename as classtype_has_nothrow_assign_or_copy_p.
5723         (trait_expr_value): Adjust.
5724
5725 2007-04-23  Simon Baldwin  <simonb@google.com>
5726
5727         * decl.c (grokparms): Added new error for duplicate function
5728         parameters names in function prototypes, to match gcc behavior.
5729
5730 2007-04-23  Jan Hubicka  <jh@suse.cz>
5731
5732         * decl2.c (finish_objects): Do not call target constructor/destructor
5733         bits dirrectly.
5734
5735 2007-04-21  Andrew Pinski  <andrew_pinski@playstation.sony.com>
5736
5737         * cp-tree.h (lang_tree_node): Use GENERIC_NEXT
5738         instead of checking GIMPLE_STMT_P in chain_next.
5739
5740 2007-04-17  Mark Mitchell  <mark@codesourcery.com>
5741
5742         PR c++/31513
5743         * call.c (convert_for_arg_passing): Convert bitfields to their
5744         declared types.
5745
5746 2007-04-17  Simon Martin  <simartin@users.sourceforge.net>
5747
5748         PR c++/31517
5749         * pt.c (value_dependent_expression_p): Handle MODOP_EXPRs.
5750
5751 2007-04-16  Seongbae Park <seongbae.park@gmail.com>
5752
5753         PR c++/29365
5754         * decl2.c (constrain_class_visibility):
5755         Do not warn about the use of anonymous namespace in the main input file.
5756
5757 2007-04-15  Mark Mitchell  <mark@codesourcery.com>
5758
5759         * cp-tree.h (current_template_parms): Fix typo in comment.
5760
5761 2007-04-15  Kazu Hirata  <kazu@codesourcery.com>
5762
5763         * cp-tree.h, error.c: Fix comment typos.
5764
5765 2007-04-13  Jason Merrill  <jason@redhat.com>
5766
5767         PR c++/31074
5768         * call.c (reference_binding): Add c_cast_p parm.  If true,
5769         add quals to TO as needed to make it reference-compatible.
5770
5771 2007-04-11  Jan Hubicka  <jh@suse.cz>
5772
5773         * class.c (convert_to_base_statically): Fold produced tree; verify
5774         that we are not processing template_decl.
5775
5776 2007-04-09  Mark Mitchell  <mark@codesourcery.com>
5777
5778         PR c++/31449
5779         * class.c (build_base_path): Ensure that the converted pointer has
5780         the same cv-qualification as the input.
5781
5782 2007-04-09  Paolo Carlini  <pcarlini@suse.de>
5783
5784         * tree.c (cp_tree_equal): Deal with TRAIT_EXPR.
5785
5786 2007-04-08  Steven Bosscher  <steven@gcc.gnu.org>
5787
5788         * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS):
5789         Do not set it.
5790         (LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P): Do not set it.
5791         * tree.c (cp_add_pending_fn_decls): Remove.
5792         * cp-tree.h (cp_add_pending_fn_decls): Remove prototype.
5793
5794 2007-04-07  Daniel Berlin  <dberlin@dberlin.org>
5795
5796         Revert change removing staticp.
5797
5798 2007-04-06  Daniel Berlin  <dberlin@dberlin.org>
5799
5800         * cp-objcp-common.c (cxx_staticp): Remove.
5801         * cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
5802         * cp-tree.h (cxx_staticp):
5803
5804 2007-04-04  Danny Smith  <dannysmith.users.sourceforge.net>
5805
5806         * class.c (check_for_override): Don't remove dllmport attribute
5807         of virtual methods.
5808
5809 2007-04-03  Jakub Jelinek  <jakub@redhat.com>
5810
5811         PR c++/30847
5812         * typeck.c (build_modify_expr): For COND_EXPR on LHS, if RHS has void
5813         type issue error and return early.
5814
5815 2007-03-30  Jason Merrill  <jason@redhat.com>
5816
5817         PR c++/31187
5818         * typeck.c (cp_type_readonly): New fn.
5819         * cp-tree.h: Declare it.
5820         * decl.c (start_decl): Set implicit DECL_THIS_STATIC here.
5821         (cp_finish_decl): Not here.
5822
5823 2007-03-31  Richard Guenther  <rguenther@suse.de>
5824
5825         * optimize.c (maybe_clone_body): Replace splay-tree usage by
5826         pointer-map.
5827
5828 2007-03-31  Douglas Gregor  <doug.gregor@gmail.com>
5829
5830         PR c++/31138
5831         PR c++/31140
5832         PR c++/31141
5833         * parser.c (declarator_can_be_parameter_pack): New.
5834         (cp_parser_template_parameter): Only parse the `...' if the
5835         declarator can be a parameter pack.
5836         (cp_parser_parameter_declaration): Ditto. Also, handle when TYPE
5837         is NULL.
5838         * pt.c (find_parameter_packs_r): Look into the bounds on integer
5839         types (they could be used as array bounds).
5840         (check_for_bare_parameter_packs): Deal with TEMPLATE_PARM_INDEX.
5841         (tsubst_pack_expansion): Handle failure to expand parameter
5842         packs.
5843
5844 2007-03-30  Paolo Carlini  <pcarlini@suse.de>
5845
5846         PR c++/26099
5847         * cp-tree.h (enum cp_trait_kind, struct tree_trait_expr,
5848         TRAIT_EXPR_TYPE1, TRAIT_EXPR_TYPE2, TRAIT_EXPR_KIND): Add.
5849         (enum cp_tree_node_structure_enum, union lang_tree_node): Update.
5850         (CLASS_TYPE_NON_UNION_P): Add.
5851         (struct lang_type_class): Add has_complex_dflt.
5852         (TYPE_HAS_COMPLEX_DFLT, TYPE_HAS_TRIVIAL_DFLT): Add.
5853         (locate_copy, locate_ctor, locate_dtor, finish_trait_expr): Declare.
5854         * cp-tree.def: Add TRAIT_EXPR.
5855         * cp-objcp-common.c (cp_tree_size): Add TRAIT_EXPR case.
5856         * lex.c (struct resword): Add __has_nothrow_assign,
5857         __has_nothrow_constructor, __has_nothrow_copy, __has_trivial_assign,
5858         __has_trivial_constructor, __has_trivial_copy,
5859         __has_trivial_destructor, __has_virtual_destructor, __is_abstract,
5860         __is_base_of, __is_class, __is_convertible_to, __is_empty, __is_enum,
5861         __is_pod, __is_polymorphic, __is_union.
5862         * parser.c (cp_parser_primary_expression): Deal with the new RIDs.
5863         (cp_parser_trait_expr): New.
5864         * semantics.c (finish_trait_expr, trait_expr_value
5865         classtype_has_nothrow_copy_or_assign_p): New.
5866         * method.c (locate_copy, locate_ctor, locate_dtor): Do not define
5867         as static.
5868         * decl.c (cp_tree_node_structure): Add TRAIT_EXPR.
5869         * class.c (check_bases, check_field_decl, check_bases_and_members):
5870         Deal with TYPE_HAS_COMPLEX_DFLT (t) too.
5871         * pt.c (uses_template_parms, tsubst_copy_and_build,
5872         value_dependent_expression_p, type_dependent_expression_p): Deal with
5873         TRAIT_EXPR.
5874         * tree.c (cp_walk_subtrees): Deal with TRAIT_EXPR.
5875
5876 2007-03-29  Richard Guenther  <rguenther@suse.de>
5877
5878         * tree.c (cp_walk_subtrees): Do not set input_location.
5879
5880 2007-03-28  Simon Martin  <simartin@users.sourceforge.net>
5881
5882         PR c++/29077
5883         * decl.c (grokfndecl): Properly setup decl if it is a constructor or a
5884         destructor.
5885
5886 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
5887
5888         * parser.c (struct cp_parser): Update comment for
5889         greater_than_is_operator_p.
5890         (cp_parser_primary_expression): In C++0x mode, a cast operator can
5891         be terminated with a `>>' token when !GREATER_THAN_IS_OPERATOR_P.
5892         (TOKEN_PRECEDENCE): In C++0x mode, `>>' is treated like `>' when
5893         !GREATER_THAN_IS_OPERATOR_P.
5894         (cp_parser_binary_expression): When -Wc++0x-compat, warn about
5895         `>>' operators that will become two `>' tokens in C++0x.
5896         (cp_parser_parameter_declaration): Treat `>>' like `>' in C++0x
5897         mode, allowing it to terminate default arguments.
5898         (cp_parser_enclosed_template_argument_list): In C++0x mode, treat
5899         `>>' like two consecutive `>' tokens.
5900         (cp_parser_skip_to_end_of_template_parameter_list): Ditto.
5901         (cp_parser_next_token_ends_template_argument_p): In C++0x, `>>'
5902         ends a template argument.
5903
5904 2007-03-28  Douglas Gregor  <doug.gregor@gmail.com>
5905
5906         * decl.c (redeclaration_error_message): Complain when redeclaring
5907         a friend function with default template arguments (C++0x mode only).
5908         * cp-tree.h (check_default_tmpl_args): Declare.
5909         * pt.c (check_default_tmpl_args): In C++0x mode, permit default
5910         template arguments in function templates. Add support for checking
5911         the default template arguments of friend templates.
5912         (push_template_decl_real): Fix call to check_default_tmpl_args.
5913         (type_unification_real): If a template parameter has not been
5914         deduced but provides a default template argument, substitute into
5915         that default template argument.
5916         * parser.c (cp_parser_init_declarator): When declaring (but not
5917         defining!) a function template in C++0x mode, check for default
5918         template arguments.
5919
5920 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
5921
5922         PR c++/29993
5923         * decl.c (grokdeclarator): Deal with cv-qualified function type
5924         typedefs in the same way for member and non-member functions.
5925
5926 2007-03-26  Dirk Mueller  <dmueller@suse.de>
5927
5928         * parser.c (cp_parser_member_declaration): Pedwarn
5929         about stray semicolons after member declarations.
5930
5931 2007-03-26  Paolo Carlini  <pcarlini@suse.de>
5932
5933         PR c++/30500
5934         * pt.c (instantiate_decl): Set in_system_header.
5935
5936 2007-03-22  Mark Mitchell  <mark@codesourcery.com>
5937
5938         * cp-tree.h (current_tempalte_parms): Improve documentation.
5939         * pt.c (current_template_args): Likewise.
5940
5941         PR c++/30863
5942         * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Do
5943         not consume tokens when failing.
5944
5945 2007-03-22  Jim Wilson  <wilson@specifix.com>
5946             Mark Mitchell  <mark@codesourcery.com>
5947
5948         PR c++/31273
5949         * call.c (standard_conversion): Use type_decays_to.  Keep FCODE
5950         consistent with FROM.
5951
5952 2007-03-22  Gabriel Dos Reis  <gdr@integrable-solutions.net>
5953
5954         * error.c (dump_expr): Handle dependent names that designate types.
5955         * cxx-pretty-print.c (pp_cxx_unqualified_id): Handle TYPENAME_TYPE.
5956
5957 2007-03-17  Kazu Hirata  <kazu@codesourcery.com>
5958
5959         * cp-tree.def, parser.c, pt.c: Fix comment typos.
5960
5961 2007-03-16  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
5962
5963         * cvt.c (cp_convert_and_check) : Define.
5964         * cp-tree.h (cp_convert_and_check): Declare.
5965         * call.c (convert_conversion_warnings): Rename to
5966         conversion_null_warnings.  The warning for floating-point to
5967         integer is handled by convert_and_check in convert_like_real.
5968         (convert_like_real): convert_conversion_warnings was renamed as
5969         conversion_null_warnings.
5970         * typeck.c (build_binary_op): Use cp_convert_and_check to warn for
5971         overflow and changes of value during conversion.
5972
5973 2007-03-15  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
5974
5975         PR c++/30891
5976         * parser.c (cp_parser_statement): If 'namespace' is found, this
5977         only can be a namespace alias definition, so parse it now.
5978         (cp_parser_namespace_alias_definition): if we find an open brace
5979         instead of '=', then this is actually a misplaced namespace
5980         definition.
5981
5982 2007-03-15  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
5983
5984         PR c++/24924
5985         * decl.c (cxx_init_decl_processing): Move command-line options
5986         processing to c-opts.c.
5987
5988 2007-03-15  Douglas Gregor  <doug.gregor@gmail.com>
5989
5990         * ptree.c (cxx_print_type): Use formatting markup for integers
5991         when printing template parameter index/level/orig level.
5992         (cxx_print_xnode): Ditto.
5993         * cp-tree.h (TEMPLATE_PARM_PARAMETER_PACK): Use TREE_LANG_FLAG_0.
5994         (struct template_parm_index_s): Remove the PARAMETER_PACK member.
5995         Make INDEX, LEVEL, and ORIG_LEVEL integers instead of
5996         HOST_WIDE_INTs.
5997         (struct saved_scope): Make X_PROCESSING_TEMPLATE_DECL an int,
5998         rather than a HOST_WIDE_INT.
5999         Turn X_PROCESSING_EXPLICIT_INSTANTIATION, SKIP_EVALUATION, and
6000         NEED_POP_FUNCTION_CONTEXT into bool bitfields; reorder fields for
6001         better bit-packing.
6002         (struct language_function): Make RETURNS_VALUE, RETURNS_NULL,
6003         RETURNS_ABNORMALLY, IN_FUNCTION_TRY_HANDLER, and
6004         IN_BASE_INITIALIZER bool bitfields.
6005         (struct cp_declarator): Make KIND a 4-bit field. Make
6006         PARAMETER_PACK_P a bool bitfield just after KIND.
6007         * pt.c (uses_parameter_packs): Destroy the pointer set.
6008         (make_pack_expansion): Ditto.
6009         (check_for_bare_parameter_packs): Ditto.
6010         * name-lookup.c (push_to_top_level): Make need_pop a bool value.
6011
6012 2007-03-14  Andrew Pinski  <andrew_pinski@playstation.sony.com>
6013
6014         PR c++/31165
6015         * call.c  (convert_default_arg): Instead of copying the node,
6016         unshare it.
6017
6018 2007-03-15  Dirk Mueller  <dmueller@suse.de>
6019
6020         PR c++/30860
6021         * call.c (convert_conversion_warnings): New..
6022         (convert_like_real): .. factored out from here.
6023         (convert_conversion_warnings): Add warning about
6024         false being converted to NULL in argument passing.
6025
6026 2007-03-14  Dirk Mueller  <dmueller@suse.de>
6027
6028         * semantics.c (c_finish_if_stmt): Call empty_if_body_warning.
6029         (finish_do_body): Warn about empty body in do/while statement.
6030
6031 2007-03-14  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
6032
6033         * class.c (warn_hidden): Add OPT_Woverloaded_virtual to warning.
6034
6035 2007-03-14  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
6036
6037         PR c/21438
6038         * typeck.c (build_binary_op): Call warn_for_div_zero instead of
6039         warning.
6040
6041 2007-03-13  Alexandre Oliva  <aoliva@redhat.com>
6042
6043         * repo.c (init_repo): Initialize random_seed saved options.
6044         (finish_repo): Adjust.
6045
6046 2007-03-13  Mark Mitchell  <mark@codesourcery.com>
6047
6048         PR bootstrap/30899
6049         * Make-lang.in (doc/g++.1): Use $< to specify the location from
6050         which to copy.
6051
6052 2007-03-12  Seongbae Park <seongbae.park@gmail.com>
6053
6054         * decl.c (compute_array_index_type): New warning flag warn_vla.
6055
6056 2007-03-12  Mark Mitchell  <mark@codesourcery.com>
6057
6058         PR c++/30108
6059         * call.c (convert_default_arg): Copy non-constant arguments.
6060
6061 2007-03-11  Mark Mitchell  <mark@codesourcery.com>
6062
6063         PR c++/31038
6064         * parser.c (cp_parser_postfix_expression): Disallow compound
6065         literals in constant expressions.
6066
6067         PR c++/30328
6068         * semantics.c (finish_typeof): Use unlowered_expr_type.
6069
6070 2007-03-10  Mark Mitchell  <mark@codesourcery.com>
6071
6072         PR c++/30274
6073         * cp-tree.h (unlowered_expr_type): New function.
6074         * typeck.c (is_bitfield_expr_with_lowered_type): Handle
6075         COMPOUND_EXPR, MODIFY_EXPR, and SAVE_EXPR.
6076         (unlowered_expr_type): New function.
6077         (build_unary_op): Disallow predecrements of bool bitfields.
6078         * call.c (build_conditional_expr): Use unlowered_expr_type.
6079         * pt.c (type_unification_real): Likewise.
6080
6081 2007-03-09  Douglas Gregor  <doug.gregor@gmail.com>
6082
6083         PR c++/20599
6084         * typeck.c (check_return_expr): Check for bare parameter packs.
6085         (comptypes): Compare template parameter packs and
6086         type pack expansions.
6087         * decl.c (grokdeclarator): Deal with the declaration of function
6088         parameter packs.
6089         (grokparms): Verify that the (optional) function parameter pack is
6090         at the end of the parameter list.
6091         (xref_basetypes): Handle pack expansions in the base class.
6092         (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT.
6093         * cp-tree.def (TYPE_ARGUMENT_PACK): New.
6094         (NONTYPE_ARGUMENT_PACK): New.
6095         (TYPE_PACK_EXPANSION): New.
6096         (EXPR_PACK_EXPANSION): New.
6097         (ARGUMENT_PACK_SELECT): New.
6098         * cp-objcp-common.c (cp_tree_size): Compute size of
6099         (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and
6100         ARGUMENT_PACK_SELECT.
6101         * error.c (dump_template_argument): Print template argument packs.
6102         (dump_template_argument_list): Ditto.
6103         (dump_template_parameter): Dump `...' for template type parameter
6104         packs.
6105         (dump_type): Dump TYPE_PACK_EXPANSION nodes.
6106         (dump_parameters): Print function parameter packs.
6107         (dump_template_parms): Print template argument packs.
6108         (dump_expr): Dump EXPR_PACK_EXPANSION nodes.
6109         (maybe_warn_variadic_templates): New.
6110         * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION.
6111         * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
6112         NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
6113         CAST_EXPR.
6114         * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION.
6115         (write_template_arg): Write argument packs as separate arguments.
6116         * cp-tree.h (struct template_parm_index_s): Add flag that
6117         indicates that the template parameter is actually a parameter
6118         pack.
6119         (struct tree_argument_pack_select): New.
6120         (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT.
6121         (union lang_tree_node): Add argument_pack_select.
6122         (FUNCTION_PARAMETER_PACK_P): New.
6123         (PACK_EXPANSION_P): New.
6124         (PACK_EXPANSION_PATTERN): New.
6125         (SET_PACK_EXPANSION_PATTERN): New.
6126         (PACK_EXPANSION_PARAMETER_PACKS): New.
6127         (ARGUMENT_PACK_P): New.
6128         (ARGUMENT_PACK_ARGS): New.
6129         (SET_ARGUMENT_PACK_ARGS): New.
6130         (ARGUMENT_PACK_INCOMPLETE_P): New.
6131         (ARGUMENT_PACK_EXPLICIT_ARGS): New.
6132         (TEMPLATE_PARM_PARAMETER_PACK): New.
6133         (TEMPLATE_TYPE_PARAMETER_PACK): New.
6134         (ARGUMENT_PACK_SELECT_FROM_PACK): New.
6135         (ARGUMENT_PACK_SELECT_INDEX): New.
6136         (ARGUMENT_PACK_SELECT_ARG): New.
6137         (struct cp_declarator): Add parameter_pack_p flag.
6138         (maybe_warn_variadic_templates): Declare.
6139         (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to
6140         indicate a template parameter pack.
6141         (uses_parameter_packs): Declare.
6142         (template_parameter_pack_p): Declare.
6143         (template_parms_variadic_p): Declare.
6144         (make_pack_expansion): Declare.
6145         (check_for_bare_parameter_packs): Declare.
6146         * cxx-pretty-print.c (pp_cxx_unary_expression): Print
6147         sizeof... expressions.
6148         (pp_cxx_expression): Print pack expansions and non-type argument
6149         packs.
6150         (pp_cxx_exception_specification): Print pack expansions.
6151         (pp_cxx_direct_declarator): Print ellipsis for parameter packs.
6152         (pp_cxx_ctor_initializer): Print pack expansions.
6153         (pp_cxx_type_id): Print pack expansions.
6154         (pp_cxx_template_argument_list): Print argument packs.
6155         (pp_cxx_template_parameter): Print ellipsis for template parameter
6156         packs.
6157         * pt.c (comp_template_parms): Compare template parameter packs.
6158         (template_parameter_pack_p): New.
6159         (template_parms_variadic_p): New.
6160         (template_args_variadic_p): New.
6161         (make_ith_pack_parameter_name): New.
6162         (struct find_parameter_pack_data): New.
6163         (find_parameter_packs_r): New.
6164         (uses_parameter_packs): New.
6165         (make_pack_expansion): New.
6166         (check_for_bare_parameter_packs): New.
6167         (expand_template_argument_pack): New.
6168         (reduce_template_parm_level): Propagate parameter pack flag.
6169         (process_template_parm): Add is_parameter_pack parameter to state
6170         when the parameter is actually a parameter pack. Create template
6171         parameter packs when is_parameter_pack is true.
6172         (current_template_args): The argument for a template parameter
6173         pack is an argument pack containing a single pack expansion.
6174         (process_partial_specialization): When checking that non-type
6175         argument expressions do not involve template parameters, loop over
6176         the arguments in argument packs separately.
6177         (push_template_decl_real): Check that the type of the declaration
6178         does not have any bare parameter packs. Check that primary
6179         templates have no more than one parameter pack, and that it comes
6180         at the end of the template parameter list.
6181         (convert_template_argument): Handle coercions for pack expansion
6182         expressions by coercing the pattern then rebuilding the expansion.
6183         (coerce_template_parms): When coercing the arguments for a
6184         variadic template, pack "extra" arguments into an argument pack.
6185         (coerce_template_template_parms): Cannot coerce between parameter
6186         packs and non-pack parameters.
6187         (template_args_equal): Compare PACK_EXPANSION_P expressions.
6188         (comp_template_args): Expand all template arguments packs before
6189         comparing template argument lists.
6190         (mangle_class_name_for_template): Make argument packs as separate
6191         template arguments.
6192         (for_each_template_parm_r): No need to handle BASELINK.
6193         (instantiate_class_template): Handle pack expansions in the base
6194         class list.
6195         (tsubst_pack_expansion): New.
6196         (tsubst_template_args): Handle substitutions of argument packs and
6197         pack expansion into template argument lists.
6198         (tsubst_decl): Expand function parameter packs into separate
6199         function parameters.
6200         (tsubst_arg_types): Expand a type pack expansion into separate
6201         argument types.
6202         (tsubst_exception_specification): Handle pack expansions in
6203         exception specifiers.
6204         (tsubst): See through ARGUMENT_PACK_SELECT arguments when
6205         replacing a template parameter with its argument. If we encounter
6206         a substitution for an argument pack, just return the parameter
6207         itself.
6208         (tsubst_copy): sizeof(X...) returns the number of elements in
6209         parameter pack X.  See through ARGUMENT_PACK_SELECT when the
6210         PARM_DECL is a parameter pack.
6211         (tsubst_expr): Expression pack expansions and argument packs
6212         cannot show up here; they will all be handled through function
6213         calls, sizeof, and template argument lists.
6214         (tsubst_copy_and_build): sizeof(X...) returns the number of
6215         elements in parameter pack X.  Handle pack expansions in TREE_LIST
6216         and CONSTRUCTOR nodes.
6217         (fn_type_unification): Handle "incomplete" explicit template
6218         argument lists that specify some of the arguments for a template
6219         parameter pack.
6220         (type_unification_real): Unify arguments against pack expansions.
6221         (template_parm_level_and_index): New, helper function.
6222         (unify_pack_expansion): New.
6223         (unify): Unify argument packs on an argument-by-argument basis,
6224         handling variadic argument packs as well.
6225         (more_specialized_fn): Handle unification of function parameter
6226         packs. All things being equal, prefer non-variadic function
6227         templates to variadic function templates.
6228         (more_specialized_class): Prefer the variadic class template
6229         partial specialization that binds fewer arguments to a parameter
6230         pack.
6231         (regenerate_decl_from_template): Expand function parameter packs
6232         into separate parameters.
6233         (instantiate_decl): Ditto.
6234         (tsubst_initializer_list): Handle pack expansions for base-class
6235         initializers.
6236         (dependent_type_p_r): Determine dependent types in argument packs
6237         and pack expansions.
6238         (value_dependent_expression_p): Determine value-dependence of
6239         non-type argument packs.
6240         (dependent_template_arg_p): Handle argument packs.
6241         * semantics.c (finish_cond): Check for bare parameter packs.
6242         (finish_expr_stmt): Ditto.
6243         (finish_for_expr): Ditto.
6244         (finish_switch_cond): Ditto.
6245         (finish_mem_initializers): Ditto.
6246         * name-lookup.c (arg_assoc_type): Handle pack expansions and
6247         argument packs.
6248         * decl2.c (cp_build_parm_decl): Mark function parameter packs.
6249         * parser.c (make_declarator): Declarator is not an expansion.
6250         (make_pointer_declarator): Transfer parameter pack flag to outer
6251         declarator.
6252         (make_reference_declarator): Ditto.
6253         (make_ptrmem_declarator): Ditto.
6254         (make_call_declarator): Ditto.
6255         (make_array_declarator): Ditto.
6256         (cp_parser_postfix_expression): Allow pack expansion expressions
6257         in the argument list for a call expression.
6258         (cp_parser_parenthesized_expression_list): Add new parameter
6259         ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand
6260         into separate arguments."
6261         (cp_parser_new_placement): Allow pack expansion expressions.
6262         (cp_parser_new_initializer): Ditto.
6263         (cp_parser_mem_initializer_list): Allow ellipsis to create a
6264         base-class initializer expansion.
6265         (cp_parser_mem_initializer): Ditto.
6266         (cp_parser_template_parameter_list): Keep track of whether the
6267         template parameter is a template parameter pack.
6268         (cp_parser_template_parameter): Parse the ellipsis to indicate a
6269         template parameter pack.
6270         (cp_parser_type_parameter): Ditto.
6271         (cp_parser_template_argument_list): Parse the ellipsis to indicate
6272         a pack expansion.
6273         (cp_parser_direct_declarator): Parse the ellipsis to indicate that
6274         this declarator is a parameter pack.
6275         (cp_parser_parameter_declaration): The ellipsis does not end the
6276         parameter declaration, because it might be a parameter pack. Parse
6277         the ellipsis to indicate a parameter pack.
6278         (cp_parser_initializer): Allow pack expansions.
6279         (cp_parser_initializer_list): Allow ellipsis to create an
6280         initializer expansion.
6281         (cp_parser_base_clause): Allow ellipsis to create a base specifier
6282         expansion.
6283         (cp_parser_type_id_list): Allow ellipsis to create an exception
6284         specifier expansion.
6285         (cp_parser_attribute_list): Don't allow pack expansions.
6286         (cp_parser_functional_cast): Allow pack expansions.
6287         (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to
6288         compute the length of a parameter pack.
6289         (cp_parser_next_token_ends_template_argument_p): An ellipsis can
6290         end a template argument.
6291         * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
6292         NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
6293         CAST_EXPR.
6294
6295 2007-03-09  Dirk Mueller  <dmueller@suse.de>
6296
6297         * call.c (build_new_op): Call warn_logical_operator.
6298
6299 2007-03-08  Volker Reichelt  <v.reichelt@netcologne.de>
6300
6301         PR c++/30852
6302         * semantics.c (finish_offsetof): Handle COMPOUND_EXPR.
6303
6304         PR c++/30534
6305         * pt.c (any_template_arguments_need_structural_equality_p):
6306         Robustify.
6307
6308 2007-03-08  Alexandre Oliva  <aoliva@redhat.com>
6309
6310         * decl.c (grokdeclarator): Disable warnings for anonymous
6311         bitfields.
6312
6313 2007-03-05  Volker Reichelt  <v.reichelt@netcologne.de>
6314
6315         * typeck2.c (readonly_error): Always emit a hard error.
6316         Remove last argument.
6317         * cp-tree.h (readonly_error): Adjust prototype.
6318         * semantics.c (finish_asm_stmt): Adjust call to readonly_error.
6319         * typeck.c (build_unary_op): Likewise.
6320         (build_modify_expr): Likewise.
6321
6322 2007-03-04  Simon Martin  <simartin@users.sourceforge.net>
6323
6324         PR c++/30895
6325         * tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees.
6326
6327 2007-03-03  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
6328
6329         PR c++/15787
6330         * parser.c (struct cp_parser): New IN_IF_STMT.
6331         (cp_parser_statement_seq_opt): Handle an unexpected 'else',
6332         returning if parsing the body of an 'if' statement or issuing an
6333         error and continuing.
6334         (cp_parser_selection_statement): Set IN_IF_STMT bit when parsing
6335         body of 'if'.
6336         (cp_parser_jump_statement): Mask new IN_IF_STMT bit.
6337
6338 2007-03-02  Simon Martin  <simartin@users.sourceforge.net>
6339
6340         PR c++/28253
6341         * class.c (update_vtable_entry_for_fn): Properly handle invalid overriders
6342         for thunks.
6343
6344 2007-03-02  Geoffrey Keating  <geoffk@apple.com>
6345
6346         * g++spec.c (lang_specific_driver): Add -lstdc++ when compiling
6347         Objective-C++.  Don't exit early if -shared-libgcc needs to be
6348         added.
6349
6350 2007-03-02  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
6351
6352         * typeck.c (common_base_type): Delete unused function.
6353
6354 2007-03-01  Brooks Moses  <brooks.moses@codesourcery.com>
6355
6356         * Make-lang.in: Add dummy lang.install-pdf target.
6357
6358 2007-03-01  Simon Baldwin <simonb@google.com>
6359
6360         PR c++/23689
6361         * decl.c (check_tag_decl): Added new warning for typedef ignored
6362         when it precedes an otherwise valid non-typedef declaration.
6363
6364 2007-02-28  Sandra Loosemore  <sandra@codesourcery.com>
6365
6366         * typeck.c (build_function_call): Store converted arguments
6367         in a stack-allocated array instead of building a list.
6368         (convert_arguments): Store arguments in the array passed in as an
6369         argument, and return the actual number of arguments.
6370         * call.c (build_call): Delete, and replace with...
6371         (build_call_n, build_call_a): New.
6372         (build_op_delete_call): Rewrite to avoid constructing argument lists.
6373         (build_over_call): Store converted arguments in a stack-allocated
6374         array instead of building a list.
6375         (build_cxx_call): Pass arguments in an array instead of as a list.
6376         (build_java_interface_fn_ref): Rewrite to avoid constructing
6377         argument lists.
6378         * tree.h: Update declarations to reflect above changes.
6379         * method.c (use_thunk): Use a stack-allocated array to hold
6380         the arguments instead of a list.
6381         * rtti.c (throw_bad_cast): Update call to cxx_call.
6382         (throw_bad_typeid): Likewise.
6383         (build_dynamic_cast_1): Likewise.
6384         * init.c (build_builtin_delete_call): Use build_call_n.
6385         * decl.c (expand_static_init): Likewise.
6386         * except.c (cp_protect_cleanup_actions): Likewise.
6387         * cp-gimplify.c (genericize_eh_spec_block): Likewise.
6388         (gimplify_must_not_throw_expr): Likewise.
6389         (cxx_omp_apply_fn): Use build_call_a.
6390
6391 2007-02-26  Mark Mitchell  <mark@codesourcery.com>
6392
6393         * semantics.c (expand_or_defer_fn): Call c_record_cdtor_fn.
6394         * decl2.c (cp_write_gloabl_declarations): Call c_build_cdtor_fns.
6395
6396 2007-02-25  Mark Mitchell  <mark@codesourcery.com>
6397
6398         * cp-tree.h (static_ctors): Remove.
6399         * cp-tree.h (static_dtors): Likewise.
6400         * cp-objcp-common.c (decl_shadowed_for_var_lookup): Adjust for
6401         refactoring of tree_map hierarchy.
6402         (decl_shadowed_for_var_insert): Likewise.
6403         * semantics.c (expand_body): Use c_expand_body.
6404         (expand_or_defer_fn): Don't update static_ctors or static_dtors.
6405         * decl2.c (static_ctors): Remove.
6406         (static_dtors): Likewise.
6407         (generate_ctor_or_dtor_function): Pass NULL_TREE to
6408         objc_generate_static_init_call.  Do not call static_[cd]tors.
6409         (generate_ctor_and_dtor_functions_for_priority): Do not check for
6410         static_[cd]tors.
6411         (cp_write_global_declarations): Likewise.
6412
6413 2007-02-23  Richard Guenther  <rguenther@suse.de>
6414
6415         * class.c (note_name_declared_in_class): Make declaration
6416         changes meaning a pedwarn.
6417
6418 2007-02-22  Michael Matz  <matz@suse.de>
6419
6420         PR c++/29433
6421         * cp-tree.h (TFF_UNQUALIFIED_NAME): New formatting flag.
6422         * error.c (dump_aggr_type, dump_simple_decl, dump_decl,
6423         dump_function_decl): Guard emitting outer scopes by new flag.
6424         * cp-lang.c (cxx_dwarf_name): New function.
6425         (LANG_HOOKS_DWARF_NAME): Define to cxx_dwarf_name.
6426         * pt.c (classtype_mangled_name, mangle_class_name_for_template):
6427         Remove functions.
6428         (push_template_decl_real, lookup_template_class): Remove calls
6429         to above functions.
6430
6431 2007-02-19  Mark Mitchell  <mark@codesourcery.com>
6432
6433         * call.c (build_new_method_call): Ensure that explicit calls of
6434         destructors have type "void".
6435
6436 2007-02-19  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
6437
6438         * typeck.c (build_binary_op): Replace -Wstring-literal-comparison
6439         and -Walways-true with -Waddress.
6440         * cvt.c (convert_to_void): Replace unconditional warning with
6441         -Waddress.
6442
6443 2007-02-18  Kazu Hirata  <kazu@codesourcery.com>
6444
6445         * decl.c, tree.c: Fix comment typos.
6446
6447 2007-02-15  Andrew Pinski  <andrew_pinski@playstation.sony.com>
6448
6449         PR C++/30158
6450         * semantics.c (finish_stmt_expr_expr): Set TREE_TYPE of the
6451         statement expression if we had an error mark node.
6452
6453 2007-02-15  Sandra Loosemore  <sandra@codesourcery.com>
6454             Brooks Moses  <brooks.moses@codesourcery.com>
6455             Lee Millward  <lee.millward@codesourcery.com>
6456
6457         * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
6458         Change class to tcc_vl_exp.
6459
6460         * call.c (build_call): Use build_call_list instead
6461         of build3.
6462         (build_over_call): Likewise.
6463         (build_new_method_call): Use build_min_non_dep_call_list
6464         instead of build_min_non_dep.
6465
6466         * error.c (dump_call_expr_args): New function.
6467         (dump_aggr_init_expr_args): New function.
6468         (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them.
6469         Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
6470
6471         * cvt.c (convert_to_void): Use build_call_array instead
6472         of build3; use new AGGR_INIT_EXPR accessor macros.
6473
6474         * mangle.c (write_expression): Use TREE_OPERAND_LENGTH
6475         instead of TREE_CODE_LENGTH.
6476
6477         * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
6478         AGGR_INIT_EXPR accessor macros.
6479
6480         * cp-gimplify.c (cp_gimplify_init_expr): Use
6481         AGGR_INIT_EXPR_SLOT to set the slot operand.
6482
6483         * cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
6484         (AGGR_INIT_EXPR_SLOT): New macro.
6485         (AGGR_INIT_EXPR_ARG): New macro.
6486         (aggr_init_expr_nargs): New macro.
6487         (AGGR_INIT_EXPR_ARGP): New macro.
6488         (aggr_init_expr_arg_iterator): New.
6489         (init_aggr_init_expr_arg_iterator): New.
6490         (next_aggr_init_expr_arg): New.
6491         (first_aggr_init_expr_arg): New.
6492         (more_aggr_init_expr_args_p): New.
6493         (FOR_EACH_AGGR_INIT_EXPR_ARG): New.
6494         (stabilize_aggr_init): New declaration.
6495         (build_min_non_dep_call_list): Likewise.
6496
6497         * tree.c (process_aggr_init_operands): New function.
6498         (build_aggr_init_array) New function.
6499         (build_cplus_new): Update to use new CALL_EXPR and
6500         AGGR_INIT_EXPR accessor macros. Replace use of build3 with
6501         build_aggr_init_array.
6502         (build_min_non_dep_call_list) New function.
6503         (build_min_nt): Assert input code parameter is not a variable
6504         length expression class.
6505         (build_min, build_min_non_dep): Likewise.
6506         (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
6507         to check for equality instead of recursing. Handle tcc_vl_exp
6508         tree code classes.
6509         (stabilize_call): Update to only handle CALL_EXPRs, not
6510         AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
6511         (stabilize_aggr_init): New function.
6512         (stabilize_init): Use it.
6513
6514         * cxx-pretty-print.c (pp_cxx_postfix_expression)
6515         <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
6516         AGGR_INIT_EXPR accessor macros and argument iterators.
6517
6518         * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
6519         build_vl_exp. Iterate through the operands, recursively
6520         processing each one.
6521         (tsubst_copy_and_build) <CALL_EXPR>: Update to use new
6522         CALL_EXPR accessor macros.
6523         (value_dependent_expression_p) <default>: Handle tcc_vl_exp
6524         tree code classes. Use TREE_OPERAND_LENGTH instead of
6525         TREE_CODE_LENGTH.
6526
6527         * semantics.c (finish_call_expr): Use build_nt_call_list
6528         instead of build_nt.
6529         (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR
6530         accessor macros. Use build_call_array to construct the
6531         CALL_EXPR node instead of build3
6532
6533         * decl2.c (build_offset_ref_call_from_tree): Use
6534         build_nt_call_list and build_min_non_dep_call_list instead
6535         of build_min_nt and build_min_non_dep.
6536
6537         * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
6538         Use build_nt_call_list instead of build_min_nt.
6539
6540 2007-02-15  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
6541
6542         PR c++/28943
6543         * call.c (build_conditional_expr): Improve error message.
6544
6545 2007-02-13  Dirk Mueller  <dmueller@suse.de>
6546
6547         * friend.c (do_friend): Annotate warning about friend
6548         declarations in templates with OPT_Wnon_template_friend.
6549         Convert informal message from warning() to inform().
6550
6551 2007-02-12  Simon Martin  <simartin@users.sourceforge.net>
6552             Mark Mitchell  <mark@codesourcery.com>
6553
6554         PR c++/14622
6555         * pt.c (do_decl_instantiation): Detect type mismatches in explicit
6556         instantiations for variables.
6557
6558 2007-02-12  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
6559
6560         PR middle-end/7651
6561         * cp-gimplify.c (gimplify_expr_stmt): Don't check extra_warnings.
6562         Check warn_unused_value just once.
6563
6564 2007-02-11  Mark Mitchell  <mark@codesourcery.com>
6565
6566         PR c++/26988
6567         * pt.c (determine_specialization): Use skip_artificial_parms_for.
6568         (fn_type_unificiation): Likewise.
6569         (get_bindings): Likewise.
6570
6571 o2007-02-06  Mark Mitchell  <mark@codesourcery.com>
6572
6573         PR target/29487
6574         * decl.c (finish_function): Use DECL_REPLACEABLE.
6575         * tree.c (cp_cannot_inline_tree_fn): Likewise.
6576
6577 2007-02-10  Gabriel Dos Reis  <gdr@integrable-solutions.net>
6578
6579         * parser.c (cp_parser_primary_expression): Reformat overly long lines.
6580
6581 2007-02-10  Richard Henderson  <rth@redhat.com>, Jakub Jelinek  <jakub@redhat.com>
6582
6583         * decl.c (grokvardecl): Don't error if !have_tls.
6584         (grokdeclarator): Likewise.
6585         * parser.c (cp_parser_omp_threadprivate): Likewise.
6586
6587 2007-02-07  Jakub Jelinek  <jakub@redhat.com>
6588
6589         PR c++/30703
6590         * cp-gimplify.c (cp_genericize_r): Don't dereference invisiref
6591         parameters and result decls in omp clauses.
6592         (cxx_omp_privatize_by_reference): Pass also invisiref PARM_DECLs
6593         by reference.
6594
6595 2007-02-05  Dirk Mueller  <dmueller@suse.de>
6596
6597         PR bootstrap/30510
6598         * parser.c (cp_parser_class_specifier): Always initialize bases.
6599
6600 2007-02-05  Paolo Bonzini  <bonzini@gnu.org>
6601
6602         * cp-tree.h (OMP_ATOMIC_CODE): Delete.
6603         (OMP_ATOMIC_DEPENDENT_P): Rewrite.
6604         * pt.c (tsubst_expr): Adjust for new format of dependent OMP_ATOMIC
6605         expressions.
6606         * semantics.c (finish_omp_atomic): Store a whole expression node
6607         in operand 1, and integer_zero_node in operand 0, for dependent
6608         OMP_ATOMIC.  Rewrite to make flow easier to understand.
6609
6610 2007-02-03  Gabriel Dos Reis  <gdr@integrable-solutions.net>
6611
6612         * decl.c (grokdeclarator): Use OPT_Wreturn_type instead of 0.
6613
6614 2007-02-04  Kazu Hirata  <kazu@codesourcery.com>
6615
6616         * class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
6617         parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
6618
6619 2007-02-03  Douglas Gregor  <doug.gregor@gmail.com>
6620
6621         * parser.c (cp_lexer_get_preprocessor_token): Attach the C++0x
6622         keyword warning to -Wc++0x-compat.
6623
6624 2007-02-03  Gabriel Dos Reis  <gdr@integrable-solutions.net>
6625
6626         * decl.c (grokdeclarator): Update documentation.
6627
6628 2007-02-02  Jakub Jelinek  <jakub@redhat.com>
6629
6630         PR c++/30536
6631         * decl.c (grokdeclarator): If __thread is used together with
6632         a storage class other than extern and static, clear thread_p
6633         after issuing diagnostics and fall through to checking the
6634         storage class.
6635
6636 2007-01-30  Roger Sayle  <roger@eyesopen.com>
6637
6638         * error.c (dump_type_suffix): Avoid use of cp_build_binary_op when
6639         calculating the size of an array (to avoid recursive errors).
6640
6641 2007-01-30  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
6642
6643         PR c++/24745
6644         * typeck.c (build_binary_op): Fix logic for warning. Move warning
6645         to -Wpointer-arith.
6646         * call.c (convert_like_real): Don't warn when converting to
6647         boolean type.
6648
6649 2007-01-29  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
6650
6651         * decl.c (pop_label): Replace warning with call to
6652         warn_for_unused_label.
6653
6654 2007-01-28  Andrew Pinski  <pinskia@gmail.com>
6655
6656         PR C++/28988
6657         * semantics.c (finish_pseudo_destructor_expr): Check the
6658         destrutor name by calling check_dtor_name.
6659
6660 2007-01-24  Douglas Gregor  <dgregor@osl.iu.edu>
6661
6662         * lex.c (D_CPP0X): Rename.
6663         (D_CXX0X): To this.
6664         (reswords): D_CPP0X -> D_CXX0X.
6665         (init_reswords): Ditto.
6666         * parser.c (cp_lexer_get_preprocessor_token): Warn about the use
6667         of C++0x keywords as identifiers.
6668
6669 2007-01-23  Simon Martin  <simartin@users.sourceforge.net>
6670
6671         PR c++/27492
6672         * decl.c (duplicate_decls): Don't reset DECL_INVALID_OVERRIDER_P for
6673         function decls.
6674
6675 2007-01-23  Ian Lance Taylor  <iant@google.com>
6676
6677         * typeck.c (convert_for_assignment): Only warn about a = b = c
6678         when converting to bool.
6679
6680 2007-01-23  Roger Sayle  <roger@eyesopen.com>
6681
6682         * call.c (null_ptr_cst_p): Replace use of TREE_CONSTANT_OVERFLOW with
6683         TREE_OVERFLOW.
6684         * typeck.c (ignore_overflows): Remove the remaining uses of
6685         TREE_CONSTANT_OVERFLOW.
6686
6687 2007-01-20  Jan Hubicka  <jh@suse.cz>
6688
6689         * decl2.c (start_objects, start_static_storage_duration_function):
6690         Do not make the functions uninlinable.
6691
6692 2007-01-17  Ian Lance Taylor  <iant@google.com>
6693
6694         * class.c (add_method): Call VEC_reserve_exact rather than passing
6695         a negative size to VEC_reserve.
6696
6697 2007-01-11  Simon Martin  <simartin@users.sourceforge.net>
6698
6699         PR c++/29573
6700         * tree.c (cp_tree_equal): Properly handle MODOP_EXPR trees.
6701
6702 2007-01-10  Mark Mitchell  <mark@codesourcery.com>
6703
6704         PR c++/28999
6705         * decl.c (make_typename_type): If the qualified name is not a
6706         type, issue an error.
6707         * parser.c (cp_parser_elaborated_type_specifier): Fix comment
6708         formatting.
6709
6710 2007-01-08  Geoffrey Keating  <geoffk@apple.com>
6711
6712         * rtti.c: Include target.h.
6713         (emit_support_tinfos): If ! targetm.cxx.library_rtti_comdat (),
6714         don't emit typeinfo for fundamental types as weak.
6715         * Make-lang.in (cp/rtti.o): Update and correct dependencies.
6716
6717 2007-01-08  Richard Guenther  <rguenther@suse.de>
6718
6719         * cvt.c (cp_convert_to_pointer): Use build_int_cst_type.
6720
6721 2007-01-08  Mark Shinwell  <shinwell@codesourcery.com>
6722
6723         * call.c (standard_conversion): Pass flag to
6724         vector_types_convertible_p to disallow emission of note.
6725         * typeck.c (convert_for_assignment): Pass flag to
6726         vector_types_convertible_p to allow emission of note.
6727         (ptr_reasonably_similar): Pass flag to vector_types_convertible_p
6728         to disallow emission of note.
6729
6730 2007-01-07  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
6731
6732         PR c++/28986
6733         * typeck.c (build_binary_op): Call overflow_warning if
6734         TREE_OVERFLOW_P is true for the result and not for any of the
6735         operands.
6736
6737 2007-01-06  Lee Millward  <lee.millward@codesourcery.com>
6738
6739         PR c++/19439
6740         * class.c (add_method): Don't wait until template
6741         instantiation time to complain about duplicate methods.
6742
6743 2007-01-05  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
6744
6745         PR c/19978
6746         * semantics.c (finish_unary_op_expr): Warn only if result
6747         overflowed and operands did not.
6748
6749 2007-01-05  Ian Lance Taylor  <iant@google.com>
6750
6751         * typeck.c (build_binary_op): Warn about comparing a non-weak
6752         address to NULL.
6753
6754 2007-01-05  Douglas Gregor  <doug.gregor@gmail.com>
6755
6756         * pt.c (tsubst): Propagate the need for structural equality checks
6757         when reducing the level of template parameters.
6758
6759 2007-01-03  Kazu Hirata  <kazu@codesourcery.com>
6760
6761         * pt.c: Fix a comment typo.
6762
6763 2007-01-02  Ian Lance Taylor  <iant@google.com>
6764
6765         * semantics.c (maybe_convert_cond): Optionally warn when using an
6766         assignment as a condition.
6767         * typeck.c (convert_for_assignment): Optionally warn about
6768         assigning the result of an assignment to a bool.
6769
6770 2007-01-02  Douglas Gregor  <doug.gregor@gmail.com>
6771
6772         * pt.c (canonical_template_parms): Correct typo in comment.
6773
6774 2007-01-02  Douglas Gregor  <doug.gregor@gmail.com>
6775
6776         * typeck.c (structural_comptypes): Renamed from "comptypes".
6777         (comptypes): Use canonical type information to perform fast type
6778         comparison. When VERIFY_CANONICAL_TYPES, verify that the
6779         canonical type comparison returns the same results as we would see
6780         from the current, structural check. Support COMPARE_STRUCTURAL
6781         when we need structural checks.
6782         * decl.c (typename_compare): Fix comment.
6783         (build_typename_type): TYPENAME_TYPE nodes require structural
6784         equality checks, because they resolve different based on the
6785         current class type.
6786         (make_unbound_class_template): UNBOUND_CLASS_TEMPLATE nodes
6787         require structural equality checks (for now).
6788         (build_ptrmemfunc_type): Build the canonical pointer to member
6789         function type.
6790         (compute_array_index_type): Whenever we build a new index type
6791         to represent the size of an array in a template, we need to mark
6792         this index type as requiring structural equality. This goes for
6793         arrays with value-dependent sizes with the current ABI, or all
6794         arrays with ABI-1.
6795         * tree.c (cplus_array_hash): New.
6796         (struct cplus_array_info): New.
6797         (cplus_array_compare): New.
6798         (cplus_array_htab): New.
6799         (build_cplus_array_type_1): Use a hash table to cache the array
6800         types we build. Build the canonical array type for each array
6801         type.
6802         (cp_build_qualified_type_real): When building a cv-qualified array
6803         type, use the hash table of array types and build canonical array
6804         types as necessary.
6805         (bind_template_template_parm): BOUND_TEMPLATE_TEMPLATE_PARM nodes
6806         use structural equality (for now).
6807         * cp-tree.h (COMPARE_STRUCTURAL): New.
6808         * pt.c (canonical_template_parms): New.
6809         (canonical_type_parameter): New.
6810         (process_template_parm): Find the canonical type parameter.
6811         (lookup_template_class): When we have named the primary template
6812         type, set the canonical type for our template class to the primary
6813         template type. If any of the template arguments need structural
6814         equality checks, the template class needs structural equality
6815         checks.
6816         (tsubst): When reducing the level of a template template
6817         parameter, we require structural equality tests for the resulting
6818         parameter because its template parameters have not had their types
6819         canonicalized. When reducing a template type parameter, find the
6820         canonical reduced type parameter.
6821         (any_template_arguments_need_structural_equality_p): New.
6822