OSDN Git Service

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