OSDN Git Service

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