OSDN Git Service

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