OSDN Git Service

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