OSDN Git Service

PR c++/34270
[pf3gnuchains/gcc-fork.git] / gcc / cp / ChangeLog
1 2007-11-29  Jakub Jelinek  <jakub@redhat.com>
2
3         PR c++/34270
4         * tree.c (lvalue_p_1) <case COND_EXPR>: Handle x ?: y
5         in templates.
6         * typeck.c (is_bitfield_expr_with_lowered_type) <case COND_EXPR>:
7         Likewise.
8
9         PR c++/34267
10         PR c++/34268
11         * parser.c (cp_parser_decltype): Don't call finish_id_expression
12         on ~type.
13         * semantics.c (finish_decltype_type): Issue error on types, TYPE_DECLs
14         and ~type early.
15
16 2007-11-27  Jakub Jelinek  <jakub@redhat.com>
17
18         PR tree-optimization/34181
19         * method.c (use_thunk): Don't inline the call in the thunk.
20
21         PR c++/34213
22         * tree.c (decl_linkage): Static data members and static member
23         functions in anonymous ns classes are lk_external.
24
25 2007-11-26  Andreas Krebbel  <krebbel1@de.ibm.com>
26
27         PR c++/34081
28         * decl.c (start_preparsed_function): Pass 
29         processing_template_decl for the new allocate_struct_function
30         parameter.
31
32 2007-11-25  Richard Guenther  <rguenther@suse.de>
33
34         * decl.c (poplevel): Use BLOCK_CHAIN.
35
36 2007-11-24  Ollie Wild  <aaw@google.com>
37
38         * typeck.c (delta_from_ptrmemfunc): New function.
39         (get_member_function_from_ptrfunc): Call delta_from_ptrmemfunc.
40         (build_binary_op): Call delta_from_ptrmemfunc.
41
42 2007-11-23  Jakub Jelinek  <jakub@redhat.com>
43
44         PR c++/30293
45         PR c++/30294
46         * decl.c (cp_finish_decl): Disallow variable or field
47         definitions if extern "Java" aggregates.
48         (grokparms): Disallow parameters with extern "Java"
49         aggregates.
50         (check_function_type): Disallow function return values
51         with extern "Java" aggregates.
52         * init.c (build_new_1): Disallow placement new with
53         extern "Java" aggregates.
54
55 2007-11-23  Mark Mitchell  <mark@codesourcery.com>
56             Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
57         
58         PR c++/5310
59         * call.c (convert_like_real): Build a zero constant when __null is
60         converted to an integer type.
61         
62 2007-11-22  Jakub Jelinek  <jakub@redhat.com>
63
64         PR c++/34094
65         * decl2.c (cp_write_global_declarations): Issue error about static
66         data members in anonymous namespace which are declared and used,
67         but not defined.
68
69 2007-11-20  Jakub Jelinek  <jakub@redhat.com>
70
71         PR c++/34089
72         * parser.c (cp_parser_class_head): Reject function template ids.
73
74         PR c++/28879
75         * tree.c (build_cplus_array_type_1): Don't pass any VLA types
76         when processing_template_decl to build_array_type.
77
78         PR c++/33962
79         * pt.c (more_specialized_fn): Don't segfault if one or
80         both argument list end with ellipsis.
81
82 2007-11-18  Jakub Jelinek  <jakub@redhat.com>
83
84         PR c++/30988
85         * semantics.c (finish_call_expr): Set
86         current_function_returns_abnormally if fn is noreturn FUNCTION_DECL
87         or OVERLOAD with all noreturn functions.
88
89 2007-11-16  Jakub Jelinek  <jakub@redhat.com>
90
91         PR c++/34100
92         * pt.c (apply_late_template_attributes): Do nothing if decl's type is
93         error_mark_node.
94
95 2007-11-13  Jakub Jelinek  <jakub@redhat.com>
96
97         PR c++/34054
98         PR c++/34056
99         PR c++/34057
100         PR c++/34058
101         PR c++/34060
102         * pt.c (find_parameter_packs_r): If ppd->set_packs_to_error,
103         set to error_mark_node the outermost POINTER_TYPE to the pack if
104         it is seen in a POINTER_TYPE.
105         (push_template_decl_real): If check_for_bare_parameter_packs
106         fails for function return type, set the return type to
107         integer_type_node.  If check_for_bare_parameter_packs failed
108         for non-function, return error_mark_node.
109
110         PR c++/29225
111         * call.c (build_new_op): Call resolve_args before calling
112         build_over_call.
113
114 2007-11-11  Tom Tromey  <tromey@redhat.com>
115
116         PR c++/17577:
117         * lex.c (handle_pragma_implementation): Use cpp_included_before.
118
119 2007-11-12  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
120
121         PR c++/8570
122         * pt.c (redeclare_class_template): Update error message. Use a
123         note to show the previous declaration.
124         (tsubst_friend_class): Use the location of the friend template as
125         the input location before calling redeclare_class_template.
126
127 2007-11-11  Jakub Jelinek  <jakub@redhat.com>
128
129         PR c++/34068
130         * semantics.c (finish_pseudo_destructor_expr): Handle
131         object == error_mark_node.
132
133 2007-11-10  Jakub Jelinek  <jakub@redhat.com>
134
135         PR c++/32241
136         * pt.c (tsubst_copy_and_build) <case COMPONENT_REF>: If object_type
137         is not scalar type, let finish_class_member_access_expr handle
138         diagnostics.  Pass BIT_NOT_EXPR argument to
139         finish_pseudo_destructor_expr.  Handle SCOPE_REF properly.
140
141 2007-11-09  Douglas Gregor  <doug.gregor@gmail.com>
142
143         PR c++/33510
144         * decl.c (cp_complete_array_type): If any of the initializer
145         elements are pack expansions, don't compute the array size yet.
146
147 2007-11-08  Andrew Pinski  <pinskia@gmail.com>
148
149         PR c++/30297:
150         * tree.c (decl_linkage): Fields have no linkage.
151
152 2007-11-08  Daniel Jacobowitz  <dan@codesourcery.com>
153
154         * class.c (build_ctor_vtbl_group): Lay out the new type and decl.
155
156 2007-11-07  Douglas Gregor  <doug.gregor@gmail.com>
157
158         PR c++/33045
159         PR c++/33837
160         PR c++/33838
161         * semantics.c (finish_decltype_type): See through INDIRECT_REFs.
162         Be careful with ERROR_MARK_NODEs.
163         * parser.c (cp_parser_check_access_in_redeclaration): Handle NULL
164         argument.
165
166 2007-11-07  Jakub Jelinek  <jakub@redhat.com>
167
168         PR c++/33501
169         * call.c (build_over_call): Don't check TREE_ADDRESSABLE
170         on incomplete type.
171
172 2007-11-06  Douglas Gregor  <doug.gregor@gmail.com>
173
174         PR c++/33977
175         PR c++/33886
176         * tree.c (c_build_qualified_type): Define bridge to
177         cp_build_qualified_type.
178
179 2007-11-06  Douglas Gregor  <doug.gregor@gmail.com>
180
181         PR c++/31439
182         PR c++/32114
183         PR c++/32115
184         PR c++/32125
185         PR c++/32126
186         PR c++/32127
187         PR c++/32128
188         PR c++/32253
189         PR c++/32566
190         * typeck.c (check_return_expr): Pass address of retval to
191         check_for_bare_parameter_packs.
192         * class.c (build_base_field): Tolerate bases that have no layout
193         due to errors.
194         (end_of_base): Ditto.
195         * tree.c (canonical_type_variant): Be careful with
196         ERROR_MARK_NODE.
197         * cp-tree.h (check_for_bare_parameter_packs): Now accepts a
198         tree*.
199         * pt.c (find_parameter_pack_data): Add set_packs_to_error field,
200         which states whether parameter packs should be replaced with
201         ERROR_MARK_NODE.
202         (find_parameter_packs_r): Pass addresses to cp_walk_tree wherever
203         possible. If set_packs_to_error is set true, replace the parameter
204         pack with ERROR_MARK_NODE. Manage our own pointer sets.
205         (uses_parameter_packs): Don't set parameter packs to
206         ERROR_MARK_NODE.
207         (check_for_bare_parameter_packs): Now takes a pointer to a tree,
208         which may be modified (if it is a parameter pack). Instructs
209         find_parameter_packs_r to replace parameter packs with
210         ERROR_MARK_NODE (so that they won't cause errors later on).
211         (process_template_parm): Pass pointer to
212         check_for_bare_parameter_packs.
213         (process_partial_specialization): Replace pack expansions before
214         the end of the template argument list with ERROR_MARK_NODE.
215         (push_template_decl_real): Pass pointer to
216         check_for_bare_parameter_packs. Replace parameter packs not at the
217         end of the template parameter list with ERROR_MARK_NODE.
218         (convert_template_argument): Be more careful about using DECL_NAME
219         on only declarations.
220         (unify): Can't unify against ERROR_MARK_NODE.
221         * semantics.c (finish_cond): Pass pointer to
222         check_for_bare_parameter_packs.
223         (finish_expr_stmt): Ditto.
224         (finish_for_expr): Ditto.
225         (finish_switch_cond): Pass pointer to
226         check_for_bare_parameter_packs, and call it before we put the
227         condition into the statement.
228         (finish_mem_initializers): Pass pointer to
229         check_for_bare_parameter_packs.
230         (finish_member_declaration): Ditto.
231         * parser.c (cp_parser_base_clause): Ditto.
232         
233 2007-11-06  Jakub Jelinek  <jakub@redhat.com>
234
235         PR target/33168
236         * decl.c (cp_finish_decl): Call make_rtl_for_nonlocal_decl already
237         with the final TREE_READONLY flag in place.  processing_template_decl
238         is known to be 0 in this part of function.
239
240         PR c++/33894
241         * cp-tree.h: Update comment - TYPE_LANG_FLAG_0 is not
242         OMP_ATOMIC_DEPENDENT_P in OMP_ATOMIC.
243         * pt.c (tsubst_expr): Assert OMP_ATOMIC_DEPENDENT_P.
244         * semantics.c (finish_omp_atomic): Revert most of the
245         2007-02-05 changes, just keep the new representation of
246         OMP_ATOMIC_DEPENDENT_P OMP_ATOMIC.
247
248 2007-11-05  H.J. Lu  <hongjiu.lu@intel.com>
249
250         PR c++/33871
251         * decl2.c (constrain_visibility): Clear DECL_ONE_ONLY if marked
252         local.
253
254 2007-11-05  Douglas Gregor  <doug.gregor@gmail.com>
255
256         PR c++/33996
257         PR c++/33235
258         PR c++/33930
259         * typeck.c (merge_types): Don't lose rvalue references when
260         merging types.
261         * call.c (build_over_call): Don't elide move constructors just
262         because the copy constructor is trivial (!).
263         (compare_ics): If comparing cv-qualifiers fails, we can still order
264         based on binding lvalues vs. rvalues.
265
266 2007-11-05  Douglas Gregor  <doug.gregor@gmail.com>
267
268         PR c++/33939
269         * pt.c (unify_pack_expansion): bring handling of function call
270         arguments into line with type_unification_real. 
271
272 2007-11-05  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
273
274         * typeck.c (build_binary_op): Use pedwarn instead of error for
275         consistency.
276
277 2007-11-05  Jakub Jelinek  <jakub@redhat.com>
278
279         PR c++/33836
280         * parser.c (cp_parser_unary_expression): For &&label call
281         cp_parser_non_integral_constant_expression and return error_mark_node
282         if it returned true.
283
284         PR c++/33969
285         * decl.c (grokdeclarator): Don't call build_memfn_type if type
286         is neither FUNCTION_TYPE nor METHOD_TYPE.
287
288 2007-11-02  Jakub Jelinek  <jakub@redhat.com>
289
290         PR c++/33516
291         * parser.c (cp_parser_nested_name_specifier_opt): Use
292         TYPE_MAIN_VARIANT (new_scope) as scope if new_scope is an incomplete
293         typedef of currently open class.
294
295 2007-11-02  Paolo Carlini  <pcarlini@suse.de>
296
297         PR c++/33495
298         * error.c (dump_expr): Deal specially with statements.
299
300 2007-11-01  Jason Merrill  <jason@redhat.com>
301
302         PR c++/30897
303         * pt.c (push_template_decl_real): Set DECL_CONTEXT on template
304         template parms.
305         (lookup_template_class): Use it to get the outer template args
306         for instantiating one.
307
308         PR c++/29236
309         * pt.c (reduce_template_parm_level): tsubst the parameters
310         of a template template parm.
311
312 2007-11-01  Douglas Gregor  <doug.gregor@gmail.com>
313
314         PR c++/33955
315         * pt.c (find_parameter_packs_r): Handle TYPENAME_TYPE.
316
317 2007-11-01  Jakub Jelinek  <jakub@redhat.com>
318
319         PR c++/32384
320         * parser.c (cp_parser_postfix_dot_deref_expression): If
321         POSTFIX_EXPRESSION is type dependent, try to parse it as pseudo dtor
322         first and if that succeeds and type is SCALAR_TYPE_P, create
323         PSEUDO_DTOR_EXPR.
324
325         PR c++/32260
326         * rtti.c (enum_tinfo_kind): Fix TK_TYPE_INFO_TYPE comment.
327         (typeid_ok_p): Use the same alias set for abi::__type_info_pseudo
328         as for std::type_info.
329
330 2007-10-31  Paolo Carlini  <pcarlini@suse.de>
331
332         PR c++/33494
333         * cxx-pretty-print.c (pp_cxx_typeid_expression,
334         pp_cxx_delete_expression): Change to static linkage.
335         * cxx-pretty-print.h: Adjust declarations.
336         * error.c (dump_expr, case EXPR_PACK_EXPANSION, TYPEID_EXPR,
337         MEMBER_REF, DOTSTAR_EXPR, DELETE_EXPR, VEC_DELETE_EXPR,
338         MODOP_EXPR): Forward to pp_expression.
339
340         * cxx-pretty-print.c (pp_cxx_expression, case NON_DEPENDENT_EXPR):
341         Fix typo.
342
343 2007-10-31 Christian Bruel  <christian.bruel@st.com>
344            Mark Mitchell  <mark@codesourcery.com>
345
346         PR c++/19531
347         * typeck.c (check_return_expr): Don't set named_return_value_okay_p
348         if retval is volatile. 
349         
350 2007-10-30  Jakub Jelinek  <jakub@redhat.com>
351
352         PR c++/33616
353         * decl2.c (build_offset_ref_call_from_tree): Call
354         build_non_dependent_expr on object prior to building ADDR_EXPR from it
355         if FN is DOTSTAR_EXPR.
356
357 2007-10-30  Douglas Gregor  <doug.gregor@gmail.com>
358
359         PR c++/31993
360         PR c++/32252
361         * pt.c (find_parameter_packs_r): Fix typo in comment.
362         (convert_template_argument): Look at the pattern of a pack
363         expansion to determine what kind of entity we're converting.
364         (coerce_template_parameter_pack): When we have coerced a non-type
365         template parameter pack, substitute into the type of that pack.
366         (tsubst_pack_expansion): When our substitution of a parameter pack
367         is a "trivial" substitution of itself, just substitute into the
368         pack expansion rather than actually expanding.
369
370 2007-10-29  Jakub Jelinek  <jakub@redhat.com>
371
372         PR c++/33841
373         * class.c (check_bitfield_decl): Don't set field's type to error_mark_node
374         for non-integral type bitfields.  Return true if bitfield is correct, false
375         error has been diagnosed.
376         (check_field_decls): If check_bitfield_decl returned false, call also
377         check_field_decl.
378
379 2007-10-28  Paolo Carlini  <pcarlini@suse.de>
380             Mark Mitchell  <mark@codesourcery.com>
381
382         PR c++/30659
383         * pt.c (do_decl_instantiation): If the VAR_DECL is not a
384         class member error out and return.
385
386 2007-10-27  Jakub Jelinek  <jakub@redhat.com>
387
388         * error.c (reinit_cxx_pp): Initialize cxx_pp->enclosing_scope
389         to current_function_decl rather than 0.
390
391         PR c++/33844
392         * cxx-pretty-print.c (pp_cxx_pm_expression) <case MEMBER_REF>: Print
393         ->* rather than .*.
394         * error.c (dump_expr): Handle MEMBER_REF and DOTSTAR_EXPR.
395
396 2007-10-27  Jason Merrill  <jason@redhat.com>
397
398         PR c++/5247
399         * call.c (convert_default_arg): Detect recursion.
400
401 2007-10-27  Jakub Jelinek  <jakub@redhat.com>
402
403         PR c++/33842
404         * cxx-pretty-print.h (pp_cxx_offsetof_expression): New prototype.
405         * cxx-pretty-print.c (pp_cxx_primary_expression): Handle
406         OFFSETOF_EXPR.
407         (pp_cxx_offsetof_expression_1, pp_cxx_offsetof_expression): New
408         functions.
409         * error.c (dump_expr): Handle OFFSETOF_EXPR.
410
411 2007-10-26  Jason Merrill  <jason@redhat.com>
412
413         PR c++/24791
414         * pt.c (get_template_info): New fn.
415         (template_class_depth): Use it.
416         (push_template_decl_real): Check that the template args of the 
417         definition match the args of the previous declaration.
418
419 2007-10-26  Paolo Carlini  <pcarlini@suse.de>
420
421         PR c++/31988
422         * decl2.c (coerce_new_type): Do not allow a default argument for
423         the first parameter.
424
425 2007-10-26  Douglas Gregor  <doug.gregor@gmail.com>
426
427         PR c++/33839
428         * parser.c (cp_parser_decltype): Return ERROR_MARK_NODE if we
429         don't see the leading '('. Only lookup names if we get an
430         IDENTIFIER_NODE.
431
432 2007-10-26  Jakub Jelinek  <jakub@redhat.com>
433
434         PR c++/33744
435         * parser.c (cp_parser_parenthesized_expression_list): Set
436         greater_than_is_operator_p to true in between the parens.
437
438 2007-10-26  Paolo Carlini  <pcarlini@suse.de>
439
440         PR c++/31747
441         * decl.c (grokdeclarator): In case of conflicting specifiers
442         just return error_mark_node.
443
444 2007-10-26  Ollie Wild  <aaw@google.com>
445
446         * expr.c (cxx_expand_expr): Removed.
447         * cp-tree.h (exx_expand_expr): Removed.
448         * cp-objcp-common.h (LANK_HOOKS_EXPAND_EXPR): Replace cxx_expand_expr
449         with c_expand_expr.
450
451 2007-10-25  Paolo Carlini  <pcarlini@suse.de>
452
453         PR c++/33843
454         * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with BIT_NOT_EXPR.
455
456 2007-10-23  Jason Merrill  <jason@redhat.com>
457
458         PR c++/25950 (DR 391)
459         * call.c (struct conversion): Remove check_copy_constructor_p.
460         (reference_binding): Always bind a reference directly to a 
461         compatible class rvalue.  Pass down LOOKUP_NO_TEMP_BIND during 
462         temporary creation.
463         (check_constructor_callable): Remove.
464         (convert_like_real): Don't call it.
465         (initialize_reference): Don't call check_constructor_callable.
466         (standard_conversion): Check LOOKUP_NO_CONVERSION instead of
467         LOOKUP_CONSTRUCTOR_CALLABLE.  Don't require a temporary for base
468         conversions if LOOKUP_NO_TEMP_BIND.
469         (implicit_conversion): Pass through LOOKUP_NO_TEMP_BIND.
470         (build_user_type_conversion_1): Pass through LOOKUP_NO_TEMP_BIND for
471         second conversion.
472         * cp-tree.h (LOOKUP_CONSTRUCTOR_CALLABLE): Remove.
473
474 2007-10-22  Jakub Jelinek  <jakub@redhat.com>
475
476         PR c++/33372
477         * semantics.c (finish_omp_clauses): Check !type_dependent_expression_p
478         before checking if its type is integral.
479
480 2007-10-22  Jason Merrill  <jason@redhat.com>
481
482         PR c++/33620
483         * class.c (finish_struct_bits): Copy TYPE_ATTRIBUTES.
484         * pt.c (apply_late_template_attributes): Splice out dependent
485         attributes from DECL_ATTRIBUTES.
486
487         * decl.c (cxx_maybe_build_cleanup): Use build_address.
488
489 2007-10-17  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
490
491         * typeck.c (build_binary_op) : Use appropriate warning option
492         instead of unnamed warning.
493
494 2007-10-16  Paolo Carlini  <pcarlini@suse.de>
495
496         PR c++/31446
497         * pt.c (current_template_args): Do not change TREE_LIST elements
498         with a TREE_VALUE of error_mark_node.
499
500 2007-10-16  Mark Mitchell  <mark@codesourcery.com>
501
502         * typeck.c (cp_apply_type_quals_to_decl): Expand documentation.
503         * decl.c (start_decl): Tidy.
504         (start_decl_1): Call cp_apply_type_quals_to_decl after completing
505         the type.
506         (grokdeclarator): Clarify comment.
507
508 2007-10-14  Andrew Pinski  <pinskia@gmail.com>
509
510         PR c++/30303
511         * decl.c (grokfndecl): Return NULL after the "definition of
512         implicitly-declared" error happened.
513
514 2007-10-12  Simon Martin  <simartin@users.sourceforge.net>
515
516         PR c++/26698
517         * call.c (build_user_type_conversion_1): Do not consider conversion
518         functions to convert a (possibly cv-qualified) object to the (possibly
519         cv-qualified) same object type (or a reference to it), to a (possibly
520         cv-qualified) base class of that type (or a reference to it).
521
522 2007-10-12  Paolo Carlini  <pcarlini@suse.de>
523
524         * pt.c (tsubst): Use template_parm_level_and_index.
525
526 2007-10-12  Jakub Jelinek  <jakub@redhat.com>
527
528         PR c++/32121
529         * parser.c (cp_parser_compound_statement): Handle label-declarations
530         at the beginning of the compound statement.
531         (cp_parser_block_declaration): Issue diagnostics about __label__
532         not at the beginning of a block.
533
534 2007-10-11  Paolo Carlini  <pcarlini@suse.de>
535
536         PR c++/33461
537         * pt.c (coerce_template_parameter_pack): Do not pass error_mark_node
538         to convert_template_argument.
539         (coerce_template_parms): Return error_mark_node after fixed-length
540         error.
541         (tsubst_decl): Check for error_mark_node the return value of the
542         first tsubst in 'case VAR_DECL'.
543
544 2007-10-08  Ollie Wild  <aaw@google.com>
545
546         * typeck2.c (digest_init): Call cplus_expand_constant after
547         convert_for_initialization.
548         * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
549         * expr.c (cplus_expand_constant): Updated function description.
550
551 2007-10-04  Jason Merrill  <jason@redhat.com>
552
553         PR c++/20416
554         * call.c (initialize_reference): Handle local static reference
555         temps properly.
556
557 2007-10-03  Jason Merrill  <jason@redhat.com>
558
559         PR c++/32470
560         * name-lookup.c (push_namespace_with_attrs): Fold back into...
561         (push_namespace): Here.
562         (handle_namespace_attrs): New fn for the attr code.
563         (leave_scope): Don't pop_visibility.
564         * name-lookup.h (struct cp_binding_level): Remove has_visibility.
565         * parser.c (cp_parser_namespace_definition): Call
566         handle_namespace_attrs and pop_visibility as appropriate. 
567
568         PR c++/11756
569         * mangle.c (write_type) [TYPEOF_TYPE]: Just sorry.
570
571 2007-10-03  Alexandre Oliva  <aoliva@redhat.com>
572
573         * decl.c (duplicate_decls): Preserve linkage flags for mere
574         redeclarations of gnu_inline definitions.
575
576 2007-10-03  Jason Merrill  <jason@redhat.com>
577
578         PR c++/15764
579         * decl.c (wrap_cleanups_r): New fn.
580         (wrap_temporary_cleanups): New fn.
581         (initialize_local_var): Call it.
582
583 2007-09-29  Jason Merrill  <jason@redhat.com>
584
585         PR c++/33094
586         * decl.c (make_rtl_for_nonlocal_decl): It's ok for a member 
587         constant to not have DECL_EXTERNAL if it's file-local.
588
589 2007-09-28  Ollie Wild  <aaw@google.com>
590
591         Revert
592         2007-09-27  Ollie Wild  <aaw@google.com>
593
594         * typeck2.c (digest_init): Call cplus_expand_constant after
595         convert_for_initialization.
596         * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
597         * expr.c (cplus_expand_constant): Updated function description.
598
599 2007-09-28  Jason Merrill  <jason@redhat.com>
600
601         PR c++/10179
602         * class.c (layout_empty_base): Take rli parameter, update
603         rli->record_align if empty base has user-specified alignment.
604         (build_base_field): Pass rli to it.
605
606 2007-09-28  Paolo Carlini  <pcarlini@suse.de>
607
608         PR c++/33213
609         * error.c (dump_decl): Deal with TYPE_PACK_EXPANSION.
610
611 2007-09-28  Paolo Carlini  <pcarlini@suse.de>
612
613         PR c++/33118
614         * error.c (dump_expr): Deal with ARGUMENT_PACK_SELECT.
615         (dump_type): Use dump_template_argument for TYPE_ARGUMENT_PACK.
616         (dump_parameters): Just call dump_type for argument packs too.
617
618 2007-09-28  Jakub Jelinek  <jakub@redhat.com>
619
620         PR c++/31434
621         * tree.c (cp_build_qualified_type_real): Handle TYPE_PACK_EXPANSION
622         qualification by creating qualified PACK_EXPANSION_PATTERN and
623         then calling make_pack_expansion on it.
624
625 2007-09-27  Ollie Wild  <aaw@google.com>
626
627         * typeck2.c (digest_init): Call cplus_expand_constant after
628         convert_for_initialization.
629         * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
630         * expr.c (cplus_expand_constant): Updated function description.
631
632 2007-09-27  Jason Merrill  <jason@redhat.com>
633
634         PR c++/33571
635         * decl2.c (is_late_template_attribute): Don't crash on unknown
636         attribute.
637
638 2007-09-27  Paolo Carlini  <pcarlini@suse.de>
639
640         PR c++/33493
641         * error.c (dump_expr): Deal with DELETE_EXPR and VEC_DELETE_EXPR.
642         * cxx-pretty-print.c (pp_cxx_delete_expression): Add missing
643         spaces in the formatting.
644         * cxx-pretty-print.h (pp_cxx_delete_expression): Declare.
645
646 2007-09-27  Jakub Jelinek  <jakub@redhat.com>
647
648         * error.c (cxx_print_error_function): Add third argument, pass
649         it over to lhd_print_error_function.
650         (cp_print_error_function): If diagnostic->abstract_origin, print
651         virtual backtrace.
652         * cp-tree.h (struct diagnostic_info): New forward decl.
653         (cxx_print_error_function): Add third argument.
654
655 2007-09-25  Simon Martin  <simartin@users.sourceforge.net>
656
657         PR c++/33207
658         * name-lookup.c (pushtag): Do not create an implicit typedef before
659         the associated type declaration is known to be valid.
660
661 2007-09-25  Jakub Jelinek  <jakub@redhat.com>
662
663         * tree.c (cxx_printable_name): Compare FUNCTION_DECL uids
664         rather than pointers.
665
666 2007-09-24  Danny Smith  <dannysmith@user.sourceforge.net>
667
668         PR c++/14688
669         * search.c (check_final_overrider): Fail if
670         targetm.comp_type_attributes returns 0.
671
672 2007-09-24  Jason Merrill  <jason@redhat.com>
673
674         PR c++/33239
675         * pt.c (resolve_typename_type): Don't look things up in the original
676         template if it would mean losing template arguments.    
677
678 2007-09-24  Jakub Jelinek  <jakub@redhat.com>
679
680         PR c++/33506
681         * cp-tree.h (cxx_type_hash_eq): New prototype.
682         * cp-objcp-common.h (LANG_HOOKS_TYPE_HASH_EQ): Redefine.
683         * tree.c (cxx_type_hash_eq): New function.
684
685 2007-09-24  Douglas Gregor  <doug.gregor@gmail.com>
686
687         PR c++/33185    
688         * tree.c (cp_build_qualified_type_real): Build a canonical
689         ARRAY_TYPE if the original ARRAY_TYPE was not a canonical type.
690         
691 2007-09-24  Douglas Gregor  <doug.gregor@gmail.com>
692
693         PR c++/33112
694         PR c++/33185    
695         * tree.c (cplus_array_compare): Compare pointers, not types.
696         (build_cplus_array_type_1): Store new array type into the hash
697         table before building the canonical type; build the canonical type
698         correctly.
699         (cp_build_qualified_type_real): Put all of the array types with
700         cv-qualified element types into the C++ array hash table, built as 
701         variants of the unqualified versions.
702         
703 2007-09-23  Jason Merrill  <jason@redhat.com>
704
705         PR c++/16370
706         * decl.c (grokdeclarator): Look through implicit TYPE_DECLs
707         for deprecation warnings.
708
709 2007-09-22  Jason Merrill  <jason@redhat.com>
710
711         PR c++/15269
712         * call.c (build_over_call): Warn about deprecated virtuals.
713
714         PR c++/19407
715         * cp-tree.h (ATTR_IS_DEPENDENT): New macro.
716         (MAYBE_TAGGED_TYPE_P): Remove.
717         * pt.c (apply_late_template_attributes): Check ATTR_IS_DEPENDENT
718         instead of calling is_late_template_attribute again.
719         (tsubst_decl) [TYPE_DECL]: Just check if the name is the tag.
720         (tsubst): A typedef is a TYPE_NAME != TYPE_MAIN_DECL.
721         Don't crash on typedefs from non-template classes.
722         * decl2.c (grokfield): Don't sorry about attrs on template parms.
723         (is_late_template_attribute): All attributes applied to template
724         parms or typename types are dependent.  Static.
725         (splice_template_attributes): Pass decl through.
726         (save_template_attributes): Likewise.
727
728 2007-09-20  Jakub Jelinek  <jakub@redhat.com>
729
730         PR c++/33496
731         * pt.c (tsubst_copy) <case SIZEOF_EXPR>: Handle error_mark_node
732         returned from tsubst_pack_expansion.
733         (tsubst_copy_and_build) <case SIZEOF_EXPR>: Likewise.
734         (tsubst_copy_and_build) <case CONSTRUCTOR>: Likewise.
735
736 2007-09-20  Paolo Carlini  <pcarlini@suse.de>
737
738         PR c++/33460
739         * semantics.c (finish_id_expression): Use consistently
740         context_for_name_lookup.
741         * decl.c (fixup_anonymous_aggr): Fix error message for
742         anonymous struct (vs union).
743
744 2007-09-19  Jason Merrill  <jason@redhat.com>
745
746         PR c++/7586
747         * pt.c (tsubst): Handle typedefs by looking for the specialization.
748         (retrieve_specialization): Only tagged types use 
749         DECL_TEMPLATE_INSTANTIATIONS.
750         (instantiate_class_template): Push nested classes too.
751         (tsubst_decl) [TYPE_DECL]: Only check for canonical decl for
752         tagged types.
753         * cp-tree.h (MAYBE_TAGGED_TYPE_P): New macro.
754         * init.c (is_aggr_type): Remove redundant tests.
755         * class.c (push_nested_class): Use CLASS_TYPE_P.
756
757 2007-09-20  Paolo Carlini  <pcarlini@suse.de>
758
759         PR c++/33459
760         * init.c (build_zero_init): If, recursively, build_zero_init
761         returns a NULL_TREE, do not append it to the VEC of constructors.
762
763 2007-09-18  Jason Merrill  <jason@redhat.com>
764
765         PR c++/17743
766         * pt.c (apply_late_template_attributes): Set processing_template_decl.
767         (tsubst_decl) [TYPE_DECL]: Preserve naming typedef, pass
768         ATTR_FLAG_TYPE_IN_PLACE.
769         (tsubst): Do unqualified lookup to find typedefs from current class.
770         [ARRAY_TYPE]: Propagate alignment info.
771         * decl2.c (is_late_template_attribute): Only defer handling of
772         attribute aligned if the expression is dependent.
773         (save_template_attributes): If we're deferring any attributes,
774         make this a naming typedef.
775
776 2007-09-18  Paolo Carlini  <pcarlini@suse.de>
777
778         PR c++/33462 (again)
779         * cxx-pretty-print.c (pp_cxx_va_arg_expression): Print
780         va_arg instead of __builtin_va_arg.
781
782 2007-09-18  Paolo Carlini  <pcarlini@suse.de>
783
784         PR c++/33462
785         * cxx-pretty-print.c (pp_cxx_va_arg_expression): Add.
786         (pp_cxx_primary_expression): Use it.
787         * cxx-pretty-print.h (pp_cxx_va_arg_expression): Declare.
788         * error.c (dump_expr): Use it.
789
790 2007-09-18  Paolo Carlini  <pcarlini@suse.de>
791
792         PR c++/33463
793         * cxx-pretty-print.c (pp_cxx_postfix_expression): Split
794         out case TYPEID_EXPR to...
795         (pp_cxx_typeid_expression): ... here; use pp_cxx_left_paren
796         and pp_cxx_right_paren.
797         * cxx-pretty-print.h (pp_cxx_typeid_expression): Declare.
798         * error.c (dump_expr): Use it.
799
800 2007-09-18  Paolo Carlini  <pcarlini@suse.de>
801
802         PR c++/33464
803         * cxx-pretty-print.c (pp_cxx_trait_expression): Add.
804         (pp_cxx_primary_expression): Use it.
805         * cxx-pretty-print.h (pp_cxx_trait_expression): Declare.
806         * error.c (dump_expr): Use it.
807
808 2007-09-16  Paolo Carlini  <pcarlini@suse.de>
809
810         PR c++/33124
811         * init.c (build_new): Remove warning for zero-element
812         allocations.
813
814 2007-09-16  Nathan Sidwell  <nathan@codesourcery.com>
815
816         PR c++/32756
817         * call.c (maybe_handle_implicit_object): Set this_p, clear
818         rvaluedness_matches_p.
819         (compare_ics): Do not compare rvaluedness matching when one of the
820         operands is an implicit object.
821
822 2007-09-14  Jason Merrill  <jason@redhat.com>
823
824         PR c++/17743, c++/19163
825         * decl2.c (is_late_template_attribute): New fn.
826         (splice_template_attributes, save_template_attributes): New fns.
827         (cplus_decl_attributes): Call save_template_attributes.
828         * pt.c (apply_late_template_attributes): New fn.
829         (instantiate_class_template, tsubst_decl): Use it.
830         * cp-tree.h: Declare is_late_template_attribute.
831
832 2007-09-13  Tom Tromey  <tromey@redhat.com>
833
834         * parser.c (cp_lexer_new_main): Don't use
835         c_lex_return_raw_strings.
836         (cp_lexer_get_preprocessor_token): Update.  Add special case when
837         lexer is NULL.
838
839 2007-09-11  Jan Hubicka <jh@suse.cz>
840
841         * method.c (use_thunk): Use tree_rest_of_compilation
842         * cp-objecp-common.h (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Kill.
843         (LANG_HOOKS_CALLGRAPH_EMIT_ASSOCIATED_THUNKS): Define.
844         * cp-tree.h (expand_body): Kill.
845         (emit_associated_thunks): Declare.
846         * semantics.c (emit_associated_thunks): Export.
847         (expand_body): Kill.
848
849 2007-09-09  David Daney  <ddaney@avtrex.com>
850
851         PR c++/33324
852         * init.c (build_new_1):  Use POINTER_PLUS_EXPR instead of MINUS_EXPR
853         to calculate cookie_ptr.
854
855 2007-09-08  Jason Merrill  <jason@redhat.com>
856
857         PR c++/33342
858         * pt.c (most_specialized_class): Set processing_template_decl
859         while tsubsting partial spec args.
860
861 2007-09-06  Jason Merrill  <jason@redhat.com>
862
863         * decl2.c (get_guard): Copy visibility from the guarded variable.
864
865 2007-09-06  Jan Hubicka  <jh@suse.cz>
866
867         * semantics.c (expand_body): Do not mark arguments of clones used.
868
869 2007-09-06  Paolo Carlini  <pcarlini@suse.de>
870
871         PR c++/32674
872         * decl.c (cp_finish_decl): When processing_template_decl,
873         deal correctly with init as TREE_LIST.
874
875 2007-09-06  Tom Tromey  <tromey@redhat.com>
876
877         * decl.c (finish_function): Put return's location on line zero of
878         file.
879
880 2007-09-05  Jason Merrill  <jason@redhat.com>
881
882         PR c++/15745
883         * except.c (prepare_eh_type): Use type_decays_to.
884
885         PR c++/15097
886         * init.c (build_delete): Use build_headof to get the address of the
887         complete object if we aren't using the deleting destructor.
888         * rtti.c (build_headof): No longer static.
889         * cp-tree.h: Declare it.
890
891 2007-09-06  Jakub Jelinek  <jakub@redhat.com>
892
893         * decl.c (duplicate_decls): Set TREE_NOTHROW on __builtin_XX
894         decl if a prototype for XX is provided with throw().
895
896         PR c++/33289
897         * decl.c (builtin_function_1): Set DECL_ANTICIPATED also
898         on __*_chk non-__builtin_* decls.
899
900 2007-09-05  Paolo Carlini  <pcarlini@suse.de>
901
902         PR c++/30302
903         * semantics.c (finish_id_expression): Use context_for_name_lookup
904         insted of DECL_CONTEXT, to see through anonymous structs and unions.
905         * class.c (finish_struct_anon): Deal correctly with anonymous
906         structs (vs unions, as GNU extension) in error messages.
907
908 2007-09-05  Jan Hubicka  <jh@suse.cz>
909
910         * cp/sematics.c (expand_body): Remove unnecesary import_export_decl
911         call, DECL_EXTERNAL checks and current_function_decl saving.
912
913 2007-09-05  Paolo Carlini  <pcarlini@suse.de>
914
915         PR c++/29731 (again)
916         * parser.c (cp_parser_primary_expression): Return error_mark_node
917         when a statement-expression is found in a template-argument list.
918
919 2007-09-04  Jason Merrill  <jason@redhat.com>
920
921         * except.c (initialize_handler_parm): Use
922         fold_build_cleanup_point_expr.
923
924         PR c++/31419
925         * call.c (reference_binding): Don't look for user-defined conversions
926         to the same type.
927
928         PR c++/31411
929         * except.c (initialize_handler_parm): Put a CLEANUP_POINT_EXPR inside
930         the MUST_NOT_THROW_EXPR.
931
932 2007-09-04  Richard Sandiford  <richard@codesourcery.com>
933
934         * decl.c (cp_finish_decl): Call determine_visibility before
935         make_rtl_for_nonlocal_decl.
936
937 2007-09-04  Jason Merrill  <jason@redhat.com>
938
939         PR c++/14032
940         * pt.c (most_specialized_class): Substitute outer template
941         arguments into the arguments of a member template partial
942         specialization.
943         (strip_innermost_template_args): New fn.
944
945 2007-09-03  Daniel Jacobowitz  <dan@codesourcery.com>
946
947         * Make-lang.in (g++spec.o): Remove SHLIB_MULTILIB.
948
949 2007-09-03  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
950
951         * call.c (name_as_c_string): Supply a TYPE for CONST_CAST.
952         * decl.c (cp_make_fname_decl): Likewise,
953         * parser.c (cp_parser_string_literal): Likewise,
954         * tree.c (pod_type_p, zero_init_p): Use CONST_CAST_TREE.
955         * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
956         Likewise,
957
958 2007-09-02  Paolo Carlini  <pcarlini@suse.de>
959
960         PR c++/33208
961         * typeck.c (build_unary_op): Fix error message for
962         Boolean expression as operand to operator--.
963
964 2007-09-01  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
965
966         * tree.c (pod_type_p, zero_init_p): Use strip_array_types.
967         * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
968         Likewise.
969
970 2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
971
972         PR c++/32597
973         * init.c (build_default_init): Make extern.
974         * cp-tree.h (build_default_init): Declare here.
975         * pt.c (tsubst_expr): When the instantiation of the initializer of
976         a variable results in an empty list, default-initialize the
977         variable.
978         (tsubst_copy_and_build): When the instantiation of the initializer
979         in a new expression results in an empty initializer list,
980         default-initialize it.
981
982 2007-08-31  Douglas Gregor  <doug.gregor@gmail.com>
983
984         * mangle.c (write_type): Change mangling of rvalue reference from
985         `RR' to `O'. 
986
987 2007-08-31  Jakub Jelinek  <jakub@redhat.com>
988
989         * decl.c (duplicate_decls): Remove duplicated line.
990
991 2007-08-31  Paolo Carlini  <pcarlini@suse.de>
992
993         PR c++/33210
994         * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with
995         BOUND_TEMPLATE_TEMPLATE_PARM.
996
997 2007-08-31  Paolo Carlini  <pcarlini@suse.de>
998
999         PR c++/32113
1000         * search.c (lookup_member): Check the name argument for
1001         error_mark_node.
1002
1003 2007-08-31  Paolo Carlini  <pcarlini@suse.de>
1004
1005         PR c++/33212
1006         * parser.c (cp_parser_trait_expr): Check rerurn value of
1007         cp_parser_type_id.
1008
1009 2007-08-30  Ollie Wild  <aaw@google.com>
1010
1011         * cvt.c (cp_convert_to_pointer): Remove force parameter. Call
1012         convert_ptrmem for pointer to member conversions.
1013         (convert_to_pointer_force): Update cp_convert_to_pointer call.
1014         (ocp_convert): Update cp_convert_to_pointer call.
1015         * typeck.c (convert_ptrmem): Add conditional for null pointers to
1016         members.
1017         (build_static_cast_1): Check can_convert for conversions in either
1018         direction.
1019         (get_delta_difference_1): New function.
1020         (get_delta_difference): Refactor to call get_delta_difference_1.
1021
1022 2007-08-30  Jakub Jelinek  <jakub@redhat.com>
1023
1024         * decl.c (start_preparsed_function): Set
1025         DECL_DISREGARD_INLINE_LIMITS for GNU_INLINE_P functions.
1026
1027 2007-08-28  Paolo Carlini  <pcarlini@suse.de>
1028
1029         PR c++/33209
1030         * error.c (dump_expr): Deal with TEMPLATE_TYPE_PARM and
1031         BOUND_TEMPLATE_TEMPLATE_PARM.
1032
1033 2007-08-28  Jakub Jelinek  <jakub@redhat.com>
1034
1035         PR c++/32596
1036         PR c++/32400
1037         * pt.c (check_explicit_specialization): Set DECL_INTERFACE_KNOWN
1038         and DECL_NOT_REALLY_EXTERN if tmpl_func is not public.
1039
1040 2007-08-27  Jason Merrill  <jason@redhat.com>
1041
1042         PR c++/29000
1043         * pt.c (build_non_dependent_expr, type_dependent_expression_p): 
1044         Look inside STMT_EXPR.
1045         * semantics.c (stmt_expr_value_expr): New fn.
1046         * cp-tree.h: Declare it.
1047
1048         PR c++/28558
1049         * decl.c (groktypename): Ignore attributes applied to class type.
1050
1051 2007-08-28  Richard Guenther  <rguenther@suse.de>
1052
1053         * decl.c (duplicate_decls): Merge DECL_DISREGARD_INLINE_LIMITS.
1054
1055 2007-08-28  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1056         
1057         * error.c (dump_expr): Handle COMPLEX_CST.
1058         * cxx-pretty-print.c (pp_cxx_primary_expression): Likewise.
1059         (pp_cxx_expression): Likewise.
1060
1061 2007-08-27  Alexandre Oliva  <aoliva@redhat.com>
1062
1063         * decl.c (GNU_INLINE_P): New.
1064         (duplicate_decls): Handle gnu_inline.  Merge attributes and
1065         some flags in overriding definitions.
1066         (redeclaration_error_message): Handle gnu_inline.
1067         (start_preparsed_function): Likewise.
1068
1069 2007-08-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1070
1071         * call.c (sufficient_parms_p): Constify.
1072         * class.c (same_signature_p): Likewise.
1073         * cp-gimplify.c (is_invisiref_parm,
1074         cxx_omp_privatize_by_reference): Likewise.
1075         * cp-objcp-common.c (has_c_linkage): Likewise.
1076         * cp-tree.h (NON_THUNK_FUNCTION_CHECK, THUNK_FUNCTION_CHECK,
1077         sufficient_parms_p, same_signature_p, copy_fn_p, move_fn_p,
1078         grok_ctor_properties, nothrow_libfn_p, skip_artificial_parms_for,
1079         num_artificial_parms_for, comp_template_parms,
1080         template_parameter_pack_p, any_dependent_template_arguments_p,
1081         any_type_dependent_arguments_p, any_value_dependent_elements_p,
1082         repo_export_class_p, cxx_omp_privatize_by_reference, pod_type_p,
1083         zero_init_p, member_p, cp_lvalue_kind,
1084         builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
1085         varargs_function_p, is_dummy_object, special_function_kind,
1086         string_conv_p, type_unknown_p, comp_except_specs, compparms,
1087         comp_cv_qualification, is_bitfield_expr_with_lowered_type,
1088         unlowered_expr_type, ptr_reasonably_similar, cp_type_readonly,
1089         cp_has_mutable_p, at_least_as_qualified_p,
1090         invalid_nonstatic_memfn_p, lvalue_or_else, lvalue_p): Likewise.
1091         * decl.c (copy_fn_p, move_fn_p, grok_ctor_properties): Likewise.
1092         * except.c (nothrow_libfn_p): Likewise.
1093         * method.c (skip_artificial_parms_for, num_artificial_parms_for):
1094         Likewise.
1095         * pt.c (comp_template_parms, template_parameter_pack_p,
1096         any_type_dependent_arguments_p, any_value_dependent_elements_p,
1097         any_dependent_template_arguments_p): Likewise.
1098         * repo.c (repo_export_class_p): Likewise.
1099         * semantics.c (anon_aggr_type_p): Likewise.
1100         * tree.c (lvalue_p_1, real_lvalue_p, lvalue_p,
1101         builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
1102         varargs_function_p, member_p, is_dummy_object, pod_type_p,
1103         zero_init_p, special_function_p): Likewise.
1104         * typeck.c (comp_array_types, type_unknown_p, comp_except_specs,
1105         comp_array_types, at_least_as_qualified_p, comp_cv_qualification,
1106         compparms, invalid_nonstatic_memfn_p,
1107         is_bitfield_expr_with_lowered_type, unlowered_expr_type,
1108         string_conv_p, ptr_reasonably_similar, cp_type_readonly,
1109         cp_has_mutable_p, lvalue_or_else): Likewise.
1110
1111 2007-08-25  Paolo Bonzini  <bonzini@gnu.org>
1112
1113         * decl.c (cp_tree_node_structure): Kill TINST_LEVEL case.
1114         * cp-objcp-common.c (cp_tree_size): Ditto.
1115         * tree.c (cp_walk_subtrees): Ditto
1116         * cp-tree.def (TINST_LEVEL): Go away.
1117         * cp-tree.h (struct tinst_level_s): Rename to struct tinst_level,
1118         move together with other non-tree structs.
1119         (enum cp_tree_node_structure_enum): Nuke TS_CP_TINST_LEVEL.
1120         (union lang_tree_node): Eliminate tinst_level field.
1121         (TINST_DECL, TINST_LOCATION, TINST_IN_SYSTEM_HEADER_P): Annihilate.
1122         (current_instantiation, outermost_tinst_level): Return
1123         a "struct tinst_level *".
1124
1125         * error.c (print_instantiation_partial_context): Change second
1126         parameter to a "struct tinst_level *".  Replace accessor macros
1127         with field access.
1128         (print_instantiation_full_context): Likewise.
1129         * lex.c (in_main_input_context): Likewise.
1130
1131         * pt.c (struct pending_templates): New.
1132         (pending_templates, last_pending_template): Use it as a type.
1133         (current_tinst_level): Change typo to "struct tinst_level *"
1134         (reopen_tinst_level): Accept "struct tinst_level *", return decl.
1135         (add_pending_template): Construct a "struct pending_template".
1136         Replace TINST_LEVEL accessor macros with field access.
1137         (push_tinst_level): Likewise, using GGC_NEW instead of make_node.
1138         (pop_tinst_level): Likewise.
1139         (instantiate_pending_templates): Likewise.  Factor common code used
1140         when an instantiation has been done.
1141         (outermost_tinst_level): Replace tree_last with loop.
1142         (current_instantiation): Return a "struct tinst_level *".
1143
1144 2007-08-24  Ollie Wild  <aaw@google.com>
1145
1146         * name-lookup.c (add_decl_to_level): Remove addition to vtables chain.
1147         * name-lookup.h (cp_binding_level): Remove vtables member.
1148
1149 2007-08-24  Richard Guenther  <rguenther@suse.de>
1150
1151         * tree.c (cp_cannot_inline_tree_fn): Remove.
1152         * cp-tree.h (cp_cannot_inline_tree_fn): Likewise.
1153         * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN):
1154         Remove define.
1155
1156 2007-08-24  Jakub Jelinek  <jakub@redhat.com>
1157
1158         PR c++/32567
1159         * typeck.c (build_unary_op) <case PREINCREMENT_EXPR>: Return
1160         error_mark_node right away if build_expr_type_conversion
1161         returned it.
1162
1163         PR c++/32898
1164         * name-lookup.c (set_decl_namespace): lookup_qualified_name failure
1165         is error_mark_node rather than NULL_TREE.
1166         * pt.c (check_explicit_specialization): Likewise.
1167
1168         PR c++/31941
1169         * error.c (resolve_virtual_fun_from_obj_type_ref): Handle
1170         TARGET_VTABLE_USES_DESCRIPTORS targets properly.
1171
1172 2007-08-22  Jason Merrill  <jason@redhat.com>
1173
1174         PR c++/29365
1175         * pt.c (outermost_tinst_level): New function.
1176         * lex.c (in_main_input_context): New function.
1177         * cp-tree.h: Declare it.
1178         * decl2.c (constrain_class_visibility): Use it to avoid warning
1179         about uses of the anonymous namespace in the main input file.
1180
1181 2007-08-21  Jakub Jelinek  <jakub@redhat.com>
1182
1183         * init.c (build_new_1): Use get_target_expr instead of save_expr.
1184
1185 2007-08-20  Pawel Sikora  <pluto@pld-linux.org>
1186
1187         PR c++/7302
1188         * class.c (finish_struct_1): Warn when a class has virtual
1189         functions and accessible non-virtual destructor.
1190
1191 2007-08-20  Richard Guenther  <rguenther@suse.de>
1192
1193         PR c++/22369
1194         PR c++/22451
1195         * call.c (build_new_method_call): Convert initializer to
1196         the basetype.
1197         * init.c (build_aggr_init): Do not fiddle with types.
1198         (build_vec_delete_1): Use correct type for POINTER_PLUS_EXPR.
1199         * except.c (build_throw): Do not drop qualifiers for the
1200         pointer type.
1201         * typeck.c (get_member_function_from_ptrfunc): Do not
1202         fiddle with types, instead convert.
1203         (build_ptrmemfunc1): Convert to the target type for
1204         initialization.
1205         (gfc_trans_allocate): Convert result to target type.
1206         * cp-objcp-common.c (cxx_get_alias_set): Pointers to
1207         pointer-to-member structures shall have alias set zero as well.
1208
1209 2007-08-20  Richard Guenther  <rguenther@suse.de>
1210
1211         * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P):
1212         Remove.
1213         * cp-tree.h (cp_auto_var_in_fn_p): Remove.
1214         (nonstatic_local_decl_p): Likewise.
1215         * tree.c (cp_auto_var_in_fn_p): Remove.
1216         * decl.c (nonstatic_local_decl_p): Remove.
1217
1218 2007-08-20  Richard Guenther  <rguenther@suse.de>
1219
1220         * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_WALK_SUBTREES):
1221         Remove define.
1222         * tree.h (cp_walk_tree): New define to walk_tree_1 with
1223         cp_walk_subtrees lh parameter.
1224         (cp_walk_tree_without_duplicates): New define to
1225         walk_tree_without_duplicates_1 with cp_walk_subtrees lh parameter.
1226         * tree.c (count_trees): Call
1227         cp_walk_tree_without_duplicates.
1228         (verify_stmt_tree): Call cp_walk_tree.
1229         (break_out_target_exprs): Likewise.
1230         (WALK_SUBTREE): Likewise.
1231         * cp-gimplify.c (cp_genericize): Likewise.
1232         * cp-pt.c (find_parameter_packs_r): Likewise.
1233         (uses_parameter_packs): Likewise.
1234         (make_pack_expansion): Likewise.
1235         (check_for_bare_parameter_packs): Likewise.
1236         (for_each_template_parm): Likewise.
1237         * decl.c (check_default_argument): Call
1238         cp_walk_tree_without_duplicates.
1239         * except.c (build_throw): Likewise.
1240         * decl2.c (type_visibility): Likewise.
1241         * semantics.c (expand_or_defer_fn): Likewise.
1242         (finalize_nrv): Call cp_walk_tree.
1243
1244 2007-08-20  Jakub Jelinek  <jakub@redhat.com>
1245
1246         PR c++/33025
1247         * init.c (build_new_1): Rename placement_var variable to placement_expr.
1248         Initialize it with save_expr rather than get_temp_regvar.
1249
1250 2007-08-17  Andrew Pinski  <andrew_pinski@playstation.sony.com>
1251
1252         PR c++/28989
1253         * tree.c (lvalue_p_1 <case SAVE_EXPR>): SAVE_EXPRs are never
1254         lvalues.
1255
1256 2007-08-17  Ollie Wild  <aaw@google.com>
1257
1258         PR c++/31749
1259         * name-lookup.c (do_nonmember_using_decl): Shift implicit type
1260         declarations into appropriate slots for comparison.  Fix type
1261         comparison.
1262
1263 2007-08-17  Paolo Carlini  <pcarlini@suse.de>
1264
1265         PR c++/32112
1266         * error.c (dump_decl): Deal with UNBOUND_CLASS_TEMPLATE.
1267         * cxx-pretty-print.c (pp_cxx_unqualified_id): Likewise.
1268
1269 2007-08-17  Paolo Carlini  <pcarlini@suse.de>
1270
1271         PR c++/32870
1272         * parser.c (cp_parser_class_head): Improve error message.
1273
1274 2007-08-16  Seongbae Park  <seongbae.park@gmail.com>
1275
1276         * pt.c (instantiate_decl): Set input_location
1277         for the function end.
1278
1279 2007-08-16  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1280
1281         * cp-objcp-common.c (cxx_warn_unused_global_decl, cp_expr_size):
1282         Constify.
1283         * cp-tree.h (local_variable_p, nonstatic_local_decl_p,
1284         class_tmpl_impl_spec_p, cp_auto_var_in_fn_p, cp_type_quals,
1285         cxx_incomplete_type_diagnostic, cxx_incomplete_type_error,
1286         cxx_warn_unused_global_decl, cp_expr_size): Likewise.
1287         * decl.c (local_variable_p, nonstatic_local_decl_p): Likewise.
1288         * tree.c (class_tmpl_impl_spec_p, cp_auto_var_in_fn_p): Likewise.
1289         * typeck.c (cp_type_quals): Likewise.
1290         * typeck2.c (cxx_incomplete_type_diagnostic,
1291         cxx_incomplete_type_error): Likewise.
1292
1293 2007-08-16  Paolo Carlini  <pcarlini@suse.de>
1294
1295         PR c++/31132
1296         * pt.c (tsubst_friend_function): When check_classfn
1297         returns error_mark_node likewise return it.
1298
1299 2007-08-15  Jakub Jelinek  <jakub@redhat.com>
1300
1301         PR c++/32992
1302         * typeck.c (check_return_expr): Don't NRV optimize vars in
1303         anonymous unions.
1304         * decl.c (finish_function): Comment fix.
1305
1306 2007-08-15  Paolo Carlini  <pcarlini@suse.de>
1307
1308         PR c++/33035
1309         * pt.c (push_template_decl_real): Depending on TYPE_P
1310         use either TYPE_CONTEXT or DECL_CONTEXT.
1311
1312 2007-08-14  Mark Mitchell  <mark@codesourcery.com>
1313
1314         * semantics.c (finish_omp_clauses): Strip a NOP_EXPR if
1315         constructors and destructors return this.
1316
1317 2007-08-14  Paolo Carlini  <pcarlini@suse.de>
1318
1319         PR c++/27211
1320         * decl2.c (check_classfn): Return error_mark_node in case of error;
1321         in that case, do not call add_method.
1322         * decl.c (start_decl): Deal with check_classfn returning
1323         error_mark_node.
1324         (grokfndecl): Likewise.
1325         * pt.c (tsubst_friend_function): Likewise.
1326
1327 2007-08-14  Andrew Pinski  <pinskia@gmail.com>
1328
1329         PR c++/30428
1330         * typeck.c (build_binary_op): Disallow vector float types with
1331         BIT_IOR_EXPR, BIT_AND_EXPR, and BIT_XOR_EXPR.
1332
1333 2007-08-11  Ian Lance Taylor  <iant@google.com>
1334
1335         * cp-objcp-common.c (cxx_get_alias_set): Change return type to
1336         alias_set_type.
1337         * cp/cp-tree.h (cxx_get_alias_set): Update declaration.
1338
1339 2007-08-10  Ollie Wild  <aaw@google.com>
1340
1341         * name-lookup.c (do_nonmember_using_decl): Print an error for ambiguous
1342         type lookups.
1343         (ambiguous_decl): Construct tree of ambiguous types.  Remove extaneous
1344         function parameter.
1345         (unqualified_namespace_lookup): Fix ambiguous_decl call.
1346         (lookup_using_namespace): Fix ambiguous_decl call.
1347         (qualified_lookup_using_namespace): Fix ambiguous_decl call.
1348
1349 2007-08-10  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1350
1351         * call.c (name_as_c_string): Use CONST_CAST.
1352         * decl.c (build_decl): Likewise.
1353         * parser.c (cp_parser_string_literal): Likewise.
1354
1355 2007-08-10  Paolo Carlini  <pcarlini@suse.de>
1356
1357         PR c++/17763
1358         * error.c (dump_expr): Consistently use the *_cxx_*
1359         variants of the pretty-print functions.
1360
1361 2007-08-10  Paolo Carlini  <pcarlini@suse.de>
1362
1363         PR c++/22256
1364         * decl.c (check_special_function_return_type): Just error
1365         on return type specified for conversion operator.
1366
1367 2007-08-09  Daniel Berlin  <dberlin@dberlin.org>
1368
1369         * typeck2.c (readonly_error): Handle general expressions.
1370         * error.c (dump_expr): Handle POINTER_PLUS_EXPR
1371
1372 2007-08-06  Dan Hipschman  <dsh@google.com>
1373
1374         * method.c (use_thunk): Use DECL_NAME instead of DECL_RTL to
1375         access function name.
1376
1377 2007-08-04  Alfred Minarik  <a.minarik@aon.at>
1378
1379         PR pch/13676
1380         * lang-specs.h: Add .hp, .hxx, .hpp, .h, .HPP, .tcc as c++ header.
1381         * g++spec.c (lang_specific_driver): Check them.
1382
1383 2007-08-06  Paolo Carlini  <pcarlini@suse.de>
1384
1385         PR c++/19532
1386         * pt.c (inline_needs_template_parms): Fix comment; change return type
1387         to bool.
1388
1389 2007-08-05  Volker Reichelt  <v.reichelt@netcologne.de>
1390
1391         Revert:
1392         2007-03-26  Dirk Mueller  <dmueller@suse.de>
1393
1394         * parser.c (cp_parser_member_declaration): Pedwarn
1395         about stray semicolons after member declarations.
1396
1397 2007-08-02  Lee Millward  <lee.millward@gmail.com>
1398
1399         PR c++/30849
1400         PR c++/30850
1401         PR c++/30851
1402         * parser.c (cp_parser_asm_definition): Detect and discard asm
1403         statements with invalid inputs or outputs.
1404         (cp_parser_asm_operand_list): Return error mark node if any
1405         of the operands are invalid. Adjust documentation.
1406         
1407 2007-08-02  Nick Clifton  <nickc@redhat.com>
1408
1409         * typeck.c: Change copyright header to refer to version 3 of the
1410         GNU General Public License and to point readers at the COPYING3
1411         file and the FSF's license web page.
1412         * optimize.c, lang-specs.h, init.c, class.c, repo.c, decl.c,
1413         config-lang.in, cp-tree.def, call.c, decl.h, ptree.c,
1414         Make-lang.in, method.c, rtti.c, cp-objcp-common.c, g++spec.c,
1415         cp-objcp-common.h, except.c, error.c, operators.def, cvt.c,
1416         tree.c, mangle.c, cp-tree.h, dump.c, search.c, friend.c, expr.c,
1417         cp-gimplify.c, cxx-pretty-print.c, cp-lang.c, typeck2.c, pt.c,
1418         cxx-pretty-print.h, semantics.c, name-lookup.c, lex.c, decl2.c,
1419         name-lookup.h, parser.c: Likewise.
1420
1421 2007-08-01  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1422
1423         PR middle-end/32668
1424         * call.c (magic_varargs_p): Honor the "type generic" attribute.
1425
1426 2007-07-30  Paolo Carlini  <pcarlini@suse.de>
1427
1428         PR c++/32108
1429         * semantics.c (finish_label_stmt): Reject the __label__
1430         extension outside function scopes.
1431
1432 2007-07-29  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1433
1434         * parser.c (eof_token): Un-constify.
1435         (cp_lexer_new_main, cp_lexer_new_from_tokens, VEC_alloc,
1436         cp_lexer_consume_token, cp_lexer_purge_token): Remove spurious
1437         casts.
1438
1439 2007-07-28  Kazu Hirata  <kazu@codesourcery.com>
1440
1441         * pt.c, tree.c, typeck2.c: Fix comment typos.
1442
1443 2007-07-28  Simon Martin  <simartin@users.sourceforge.net>
1444             Mark Mitchell  <mark@codesourcery.com>
1445
1446         PR c++/30917
1447         * name-lookup.c (lookup_name_real): Non namespace-scope bindings can be
1448         hidden due to friend declarations in local classes.
1449
1450 2007-07-27  Douglas Gregor  <doug.gregor@gmail.com>
1451
1452         * typeck.c (structural_comptypes): Compare DECLTYPE_TYPE nodes.
1453         * cp-tree.def (DECLTYPE_TYPE): New.
1454         * error.c (dump_type): Dump DECLTYPE_TYPE nodes.
1455         (dump_type_prefix): Ditto.
1456         (dump_type_suffix): Ditto.
1457         * tree.c (DECLTYPE_TYPE): Walk DECLTYPE_TYPE nodes.
1458         * mangle.c (write_type): Handle DECLTYPE_TYPE.
1459         * cp-tree.h (IS_AGGR_TYPE): DECLTYPE_TYPE nodes can be aggregate
1460         types.
1461         (DECLTYPE_TYPE_EXPR): New.
1462         (DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P): New.
1463         (finish_declared_type): Declare.
1464         * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Print
1465         DECLTYPE_TYPE nodes.
1466         (pp_cxx_type_id): Ditto.
1467         * pt.c (for_each_template_parm_r): Walk DECLTYPE_TYPE children.
1468         (tsubst): Substitute into a DECLTYPE_TYPE node.
1469         (tsubst_copy): Ditto.
1470         (unify): Cannot deduce anything from TYPEOF_TYPE or DECLTYPE_TYPE
1471         nodes.
1472         (dependent_type_p_r): DECLTYPE_TYPE types are always dependent.
1473         * semantics.c (finish_typeof): TYPEOF_TYPE types need to use
1474         structural equality (because we can't hash the expressions).
1475         (finish_declared_type): New.
1476         * lex.c (reswords): Add "decltype" keyword.
1477         * parser.c cp_lexer_next_token_is_decl_specifier_keyword
1478         (cp_parser_postfix_expression): Add member_access_only_p to
1479         restrict postfix expression to member access expressions.
1480         (cp_parser_unary_expression): Update call to
1481         cp_parser_postfix_expression to reflect new parameter.
1482         (cp_parser_declared_type): New.
1483         (cp_parser_simple_type_specifier): Parse decltype types.
1484
1485 2007-07-27  Mark Mitchell  <mark@codesourcery.com>
1486
1487         PR c++/32346
1488         * call.c (convert_for_arg_passing): Only widen bitfields to their
1489         declared types if necessary.
1490
1491 2007-07-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1492
1493         * parser.c (cp_parser_string_literal, cp_parser_sizeof_operand):
1494         Constify.
1495
1496 2007-07-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1497
1498         * decl.c (typename_hash, typename_compare): Constify.
1499         * mangle.c (hash_type, compare_type): Likewise.
1500         * pt.c (eq_local_specializations, hash_local_specialization):
1501         Likewise.
1502         * tree.c (cplus_array_hash, cplus_array_compare, list_hash_eq,
1503         list_hash): Likewise.
1504         * typeck2.c (pat_compare): Likewise.
1505
1506 2007-07-24  Nathan Sidwell  <nathan@codesourcery.com>
1507
1508         * method.c (implicitly_declare_fn): Increase alignment if member
1509         function pointer format requires it.
1510
1511 2007-07-24  Paolo Carlini  <pcarlini@suse.de>
1512
1513         PR c++/29001
1514         * typeck.c (check_return_expr): Do not pass a null argument
1515         to null_ptr_cst_p.
1516
1517 2007-07-24  Paolo Carlini  <pcarlini@suse.de>
1518
1519         PR c++/32561
1520         * decl.c (redeclaration_error_message): Call DECL_ANON_UNION_VAR_P
1521         only on VAR_DECL.
1522
1523 2007-07-22  Nathan Sidwell  <nathan@codesourcery.com>
1524
1525         PR c++/32839
1526         * typeck.c (convert_arguments): Only use default args if we have
1527         a function decl.
1528
1529         PR c++/30818
1530         * typeck.c (structural_comptypes): No need to check
1531         resolve_typename_type return value here.
1532         * cp-tree.h (TYPENAME_IS_RESOLVING_P): New.
1533         * pt.c (resolve_typename_type): Follow typename typedefs.  Return
1534         original type rather than error_mark_node in case of failure.
1535         * parser.c (cp_parser_nested_name_specifier_opt): Adjust
1536         resolve_typename_type result check.
1537         (cp_parser_direct_declarator, cp_parser_head,
1538         cp_parser_constructor_declarator_p): Likewise.
1539
1540 2007-07-12  Kazu Hirata  <kazu@codesourcery.com>
1541
1542         * pt.c (template_parms_variadic_p): Remove.
1543         * cp-tree.h: Remove the prototype for template_parms_variadic_p.
1544
1545 2007-07-12  Jakub Jelinek  <jakub@redhat.com>
1546
1547         PR c++/30854
1548         * error.c (dump_expr) <case AGGR_INIT_EXPR>: Pass true as last
1549         argument to dump_aggr_init_expr_args instead of false.
1550
1551 2007-07-11  Douglas Gregor  <doug.gregor@gmail.com>
1552
1553         * typeck.c (comptypes): When USE_CANONICAL_TYPES, use the
1554         canonical types; otherwise, fall back to structural type
1555         comparisons. If ENABLE_CHECKING and USE_CANONICAL_TYPES, give an
1556         internal compiler error if the canonical types are wrong.
1557         
1558 2007-07-11  Paolo Carlini  <pcarlini@suse.de>
1559
1560         PR c++/32560
1561         * parser.c (cp_parser_make_indirect_declarator): When the
1562         the code argument is ERROR_MARK return cp_error_declarator.
1563
1564 2007-07-09  Geoffrey Keating  <geoffk@apple.com>
1565
1566         PR 32617
1567         * decl.c (cxx_init_decl_processing): Don't set
1568         force_align_functions_log.
1569         (grokfndecl): Honour ptrmemfunc_vbit_in_pfn.
1570         * typeck.c (cxx_alignof_expr): When alignof is used on a plain
1571         FUNCTION_DECL, return its alignment.
1572
1573 2007-07-09  Richard Guenther  <rguenther@suse.de>
1574
1575         * decl.c (start_preparsed_function): Do not promote return type.
1576
1577 2007-07-08  Paolo Carlini  <pcarlini@suse.de>
1578
1579         PR c++/30535
1580         * pt.c (unify): Never pass error_mark_node to template_decl_level.
1581
1582 2007-07-07  Mark Mitchell  <mark@codesourcery.com>
1583
1584         PR c++/32232
1585         * pt.c (resolve_overloaded_unification): Robustify.  Return a
1586         bool, not an int.
1587         (type_unification_real): Adjust accordingly.
1588
1589 2007-07-06  Richard Guenther  <rguenther@suse.de>
1590
1591         * init.c (build_new_1): Use the correct pointer type.
1592         * typeck2.c (build_m_component_ref): Likewise.
1593
1594 2007-07-05  Mark Mitchell  <mark@codesourcery.com>
1595
1596         PR c++/32245
1597         * init.c (build_zero_init): Always build an initializer for
1598         non-static storage.
1599         * typeck2.c (build_functional_cast): Use build_zero_init.
1600
1601         PR c++/32251
1602         * init.c (build_new_1): Always pass the allocation function to
1603         build_op_delete_call.
1604         * call.c (build_op_delete_call): Handle operator delete with a
1605         variable-argument list.  Do not issue an error when no matching
1606         deallocation function is available for a new operator.
1607
1608         PR c++/31992
1609         * cp-tree.h (any_value_dependent_elements_p): Declare it.
1610         * decl.c (value_dependent_init_p): New function.
1611         (cp_finish_decl): Use it.
1612         * pt.c (value_dependent_expression_p): Use
1613         any_value_dependent_elements_p.
1614         * parser.c (cp_parser_primary_expression): Add comment about
1615         treating dependent qualified names as integral
1616         constant-expressions.
1617
1618 2007-07-04  Douglas Gregor  <doug.gregor@gmail.com>
1619
1620         * decl.c (build_ptrmemfunc_type): Always use structural equality
1621         tests when comparing pointer-to-member-function types, because the
1622         handling of TYPE_GET_PTRMEMFUNC_TYPE currently defeats canonical
1623         types.
1624         
1625 2007-07-03  Mark Mitchell  <mark@codesourcery.com>
1626
1627         * init.c (build_new): Tweak comment.
1628
1629 2007-06-29  Dave Brolley  <brolley@redhat.com>
1630
1631         PR c++/31743
1632         * parser.c (cp_parser_new_type_id): Don't reduce a named array
1633         type to its base type and number of elements here.
1634         * init.c (build_new): Call complete_type_or_else to ensure that the
1635         type is complete and to issue a diagnostic if it is not.
1636         (build_new_1): Don't call complete_type_or_else here.
1637
1638 2007-07-03  Richard Guenther  <rguenther@suse.de>
1639
1640         PR c++/32609
1641         * class.c (fixed_type_or_null): Re-lookup the hashtable slot
1642         after recursing.
1643
1644 2007-07-02  Simon Baldwin  <simonb@google.com>
1645
1646         * parser.c (cp_parser_elaborated_type_specifier): Added a warning
1647         for inner-style nested forward declarations that don't declare
1648         anything useful.
1649
1650 2007-07-02  Jakub Jelinek  <jakub@redhat.com>
1651
1652         PR c++/31748
1653         * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
1654         DECL_P in not a variable and appears more than once error messages.
1655
1656 2007-07-01  Ollie Wild  <aaw@google.com>
1657
1658         * name-lookup.c (ambiguous_decl): Fix case when new->value is hidden.
1659         (select_decl): Remove function.
1660         (unqualified_namespace_lookup): Populate binding by calling
1661         ambiguous_decl.  Remove select_decl call.
1662         (lookup_qualified_name): Remove select_decl call.
1663         * decl.c (lookup_and_check_tag): Check for ambiguous references.
1664         * parser.c (cp_parser_elaborated_type_specifier): Skip redundant error
1665         generation when name lookup is ambiguous.
1666
1667 2007-06-29  Douglas Gregor  <doug.gregor@gmail.com>
1668
1669         PR c++/31724
1670         * init.c (build_new_1): Use structural equality on the copy of the
1671         array type.
1672
1673 2007-06-28  Geoffrey Keating  <geoffk@apple.com>
1674
1675         * decl2.c (determine_visibility): Implement
1676         flag_visibility_ms_compat effect on type info.
1677         * decl.c (cxx_init_decl_processing): Implement
1678         global effect of flag_visibility_ms_compat.
1679
1680 2007-06-28  Geoffrey Keating  <geoffk@apple.com>
1681
1682         * decl2.c (start_objects): Mark constructor-running function
1683         as artificial.
1684
1685 2007-06-26  Simon Martin  <simartin@users.sourceforge.net>
1686
1687         PR c++/32111
1688         * decl.c (grokdeclarator): Reset friendp for member functions declared
1689         friend of their own class.
1690
1691 2007-06-23  Mark Mitchell  <mark@codesourcery.com>
1692
1693         * decl2.c (determine_visibility): Don't look for dllexport here.
1694         (determine_visibility_from_class): Tidy.
1695
1696 2007-06-18  Simon Baldwin <simonb@google.com>
1697
1698         PR c++/31923
1699         * parser.c (cp_parser_single_declaration): Added check for storage
1700         class other than sc_none in parsed declaration, and a flag to indicate
1701         if the call is part of an explicit template specialization parse.
1702         * (cp_parser_explicit_specialization): Specialization check flag added
1703         to call to cp_parser_single_declaration(), set true.
1704         * (cp_parser_template_declaration_after_export): Specialization check
1705         flag added to call to cp_parser_single_declaration(), set false.
1706         * pt.c (check_explicit_specialization): Added code to copy visiblity
1707         and linkage from the templated function to the explicit specialization.
1708
1709 2007-06-15  Andrew Pinski  <andrew_pinski@playstation.sony.com>
1710
1711         * typeck.c (build_binary_op): For templates build the
1712         expression in pieces to avoid the assert in build2_stat.
1713         (get_member_function_from_ptrfunc):
1714         Change over to using POINTER_PLUS_EXPR and convert
1715         the second operand to sizetype.
1716         * typeck2.c (build_m_component_ref):  Likewise.
1717         * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR
1718         instead of PLUS_EXPR for pointers.
1719         (build_new_1): Likewise.
1720         (build_vec_delete_1): Likewise.
1721         (build_vec_delete): Likewise.
1722         * class.c (build_base_path): Likewise.
1723         (build_base_path): Likewise.
1724         (convert_to_base_statically): Likewise.
1725         (fixed_type_or_null): Handle POINTER_PLUS_EXPR.
1726         (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR
1727         instead of PLUS_EXPR.
1728         (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR
1729         instead of PLUS_EXPR for pointers.
1730         * call.c (build_special_member_call): Likewise.
1731         * rtti.c (build_headof): Likewise.
1732         Use sizetype instead of ptrdiff_type_node.
1733         (tinfo_base_init): Create a POINTER_PLUS_EXPR
1734         instead of PLUS_EXPR for pointers.
1735         * except.c (expand_start_catch_block):  Do a
1736         NEGATIVE and then a POINTER_PLUS_EXPR instead
1737         of a MINUS_EXPR.
1738         * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert
1739         PLUS_EXPR on pointer types over to use
1740         POINTER_PLUS_EXPR and remove the conversion
1741         to the pointer types.
1742         * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for
1743         adding to a pointer type. Use size_int instead of
1744         ssize_int. Convert the index to sizetype before
1745         adding it to the pointer.
1746
1747 2007-06-15  Mark Mitchell  <mark@codesourcery.com>
1748
1749         * cp-tree.h (DECL_VAR_MARKED_P): Remove.
1750         (DECL_ANON_UNION_VAR_P): New macro.
1751         * class.c (fixed_type_or_null): Tidy.  Use a hash table, rather
1752         than DECL_VAR_MARKED_P, to keep track of which variables we have
1753         seen.
1754         * decl.c (redeclaration_error_message): Complain about redeclaring
1755         anonymous union members at namespace scope.
1756         * decl2.c (build_anon_union_vars): Set DECL_ANON_UNION_VAR_P.
1757
1758 2007-06-14  Geoff Keating  <geoffk@apple.com>
1759
1760         * decl2.c (determine_visibility): Ensure that functions with
1761         hidden types as parameters are hidden.
1762
1763         PR 31093
1764         * decl2.c (determine_visibility): Remove duplicate code for
1765         handling type info.
1766
1767 2007-06-12  Ian Lance Taylor  <iant@google.com>
1768
1769         PR libstdc++/29286
1770         * init.c (avoid_placement_new_aliasing): New static function.
1771         (build_new_1): Call it.
1772
1773 2007-06-11  Rafael Avila de Espindola  <espindola@google.com>
1774
1775         * cp-objcp-common.h (LANG_HOOKS_SIGNED_TYPE): Remove.
1776         (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove.
1777
1778 2007-06-08  Jakub Jelinek  <jakub@redhat.com>
1779
1780         PR c++/32177
1781         * semantics.c (finish_omp_for): Call fold_build_cleanup_point_expr
1782         on init, the non-decl cond operand and increment value.
1783
1784 2007-06-07  Simon Martin  <simartin@users.sourceforge.net>
1785
1786         PR c++/30759
1787         * decl.c (check_initializer): Report an error when a brace enclosed
1788         initializer is used for a non-aggregate type in C++98.
1789         (redeclaration_error_message): Rewrote flag_cpp0x in terms of
1790         cxx_dialect.
1791         (grokdeclarator): Likewise.
1792         (move_fn_p): Likewise.
1793         * typeck.c (check_return_expr): Likewise.
1794         * call.c (reference_binding): Likewise.
1795         * error.c (cp_cpp_error): Likewise.
1796         * pt.c (check_default_tmpl_args): Likewise.
1797         (tsubst): Likewise.
1798         * lex.c (init_reswords): Likewise.
1799         * parser.c (p_parser_primary_expression): Likewise.
1800         (TOKEN_PRECEDENCE): Likewise.
1801         (cp_parser_init_declarator): Likewise.
1802         (cp_parser_ptr_operator): Likewise.
1803         (cp_parser_parameter_declaration): Likewise.
1804         (cp_parser_enclosed_template_argument_list): Likewise.
1805         (cp_parser_skip_to_end_of_template_parameter_list): Likewise.
1806         (cp_parser_next_token_ends_template_argument_p): Likewise.
1807
1808 2007-06-04  Simon Baldwin  <simonb@google.com>
1809
1810         * decl.c (grokdeclarator): Readability change.  Moved case labels
1811         into direct switch statement scope.
1812
1813 2007-06-04  Paolo Carlini  <pcarlini@suse.de>
1814
1815         * call.c (convert_like_real): Remove pointless code.
1816
1817 2007-05-31  Mark Mitchell  <mark@codesourcery.com>
1818
1819         * decl.c (get_atexit_fn_ptr_type): New function.
1820         (get_atexit_node): Use it.
1821         (start_cleanup_fn): Likewise.
1822         (register_dtor_fn): Use the object's destructor, instead of a
1823         separate cleanup function, where possible.
1824         * cp-tree.h (CPTI_ATEXIT_FN_PTR_TYPE): New enumerator.
1825         (atexit_fn_ptr_type_node): New macro.
1826         * decl2.c (build_cleanup): Use build_address.
1827
1828 2007-05-31  Daniel Berlin  <dberlin@dberlin.org>
1829
1830         * typeck.c (build_binary_op): Include types in error.
1831
1832 2007-05-31  Jakub Jelinek  <jakub@redhat.com>
1833
1834         PR c++/31806
1835         * decl.c (cp_finish_decl): Also clear was_readonly if a static var
1836         needs runtime initialization.
1837
1838 2007-05-31  Paolo Carlini  <pcarlini@suse.de>
1839
1840         PR c++/32158
1841         * semantics.c (finish_trait_expr): Complete the types.
1842
1843 2007-05-30  Russell Yanofsky <russ@yanofsky.org>
1844             Douglas Gregor <doug.gregor@gmail.com>
1845             Pedro Lamarao <pedro.lamarao@mndfck.org>
1846             Howard Hinnant <howard.hinnant@gmail.com>
1847
1848         PR c++/7412
1849         PR c++/29939
1850         * typeck.c (comptypes): Don't consider rvalue and lvalue
1851         reference types to be equivalent.
1852         (check_return_expr): Move from certain lvalues when returning
1853         them.
1854         * decl.c (grokdeclarator): Implement reference collapsing.
1855         (copy_fn_p): Don't consider constructors taking rvalue references
1856         to be copy constructors.
1857         (move_fn_p): New.
1858         * call.c (conversion): New "rvaluedness_matches_p" member.
1859         (convert_class_to_reference): Require reference type as first
1860         parameter instead of base type.
1861         (reference_binding): Add logic to handle rvalue references.
1862         (implicit_conversion): Update inaccurate comment.
1863         (convert_like_real): Disable creation of temporaries that are
1864         impossible to initialize for types with move constructors.
1865         (build_over_call): Elide move constructors when possible.
1866         (maybe_handle_implicit_object): Set "rvaluedness_matches_p".
1867         (maybe_handle_ref_bind): Return conversion instead of type node.
1868         (compare_ics): Add logic to use "rvaluedness_matches_p" values to
1869         determine preferred conversion sequences.
1870         * cp-tree.h (TYPE_REF_IS_RVALUE): New.
1871         (LOOKUP_PREFER_RVALUE): New.
1872         (DECL_MOVE_CONSTRUCTOR_P): New.
1873         (struct cp_declarator): Add "reference" member for reference
1874         types, with new "rvalue_ref" flag.
1875         (cp_build_reference_type): Declare.
1876         (move_fn_p): Declare.
1877         * error.c (dump_type_prefix): Format rvalue reference types
1878         correctly in error messages.
1879         * except.c (build_throw): Move from certain lvalues when
1880         throwing.
1881         * mangle.c (write_type): Mangle rvalue references differently
1882         than regular references.
1883         * parser.c (make_reference_declarator): Add boolean parameter for
1884         rvalue references.
1885         (cp_parser_make_indirect_declarator): New.
1886         (cp_parser_new_declarator_opt): Call
1887         cp_parser_make_indirect_declarator. 
1888         (cp_parser_conversion_declarator_opt): Ditto.
1889         (cp_parser_declarator): Ditto.
1890         (cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference
1891         declarators.
1892         * pt.c (tsubst): Implement reference collapsing.
1893         (maybe_adjust_types_for_deduction): Implement special template
1894         parameter deduction rule for rvalue references.
1895         (type_unification_real): Update calls to
1896         maybe_adjust_types_for_deduction.
1897         (try_one_overload): Ditto.
1898         (unify_pack_expansion): Ditto.
1899         * tree.c (lvalue_p_1): Handle rvalue reference types.
1900         (cp_build_reference_type): New.
1901
1902 2007-05-30  Jakub Jelinek  <jakub@redhat.com>
1903
1904         PR c++/31809
1905         * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC
1906         variables that need runtime initialization.
1907
1908 2007-05-28  Andrew Pinski  <Andrew_pinski@playstation.sony.com>
1909
1910         PR c++/31339
1911         * typeck.c (build_unary_op <case PREINCREMENT_EXPR,
1912         case POSTINCREMENT_EXPR, case PREDECREMENT_EXPR,
1913         case POSTDECREMENT_EXPR>): Return the error_mark_node
1914         if either the real or imaginary parts would an
1915         error_mark_node.
1916         
1917 2007-05-25  Simon Martin  <simartin@users.sourceforge.net>
1918             Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1919
1920         PR c++/31745
1921         * parser.c (cp_parser_skip_to_closing_brace): Return true if the next
1922         token is a closing brace, false if there are no tokens left.
1923         (cp_parser_namespace_alias_definition): Only consume the next token if
1924         it is a closing brace.
1925
1926         * parser.c (cp_parser_class_specifier): Likewise.
1927
1928 2007-05-25  H.J. Lu  <hongjiu.lu@intel.com>
1929
1930         * semantics.c (finish_member_declaration): Fix a typo in the
1931         last checkin.
1932
1933 2007-05-25  Douglas Gregor <doug.gregor@gmail.com>
1934
1935         PR c++/31431
1936         PR c++/31432
1937         PR c++/31434
1938         PR c++/31435
1939         PR c++/31437
1940         PR c++/31438
1941         PR c++/31442
1942         PR c++/31443
1943         PR c++/31444
1944         PR c++/31445
1945         * error.c (dump_type): Dump TYPE_ARGUMENT_PACK nodes.
1946         * cp-tree.h (check_for_bare_parameter_packs): Returns bool.
1947         * pt.c (check_for_bare_parameter_packs): Return bool indicated
1948         whether everything was okay. Fix indentation.
1949         (push_template_decl_real): Check for bare parameter packs in
1950         function parameters; where errors occur, mark the parameter types
1951         with ERROR_MARK_NODEs to avert ICEs.
1952         (coerce_template_parameter_pack): New.
1953         (coerce_template_parms): Moved parameter pack coercion into
1954         coerce_template_parameter_pack, and permit it anywhere in the
1955         template parameter list (not just at the end). Parameter and
1956         argument indices can vary (somewhat) separately now, so add
1957         PARM_IDX and ARG_IDX.
1958         (fn_type_unification): Don't set an argument pack as incomplete if
1959         no argument pack was deduced.
1960         (type_unification_real): If a type parameter is a parameter pack
1961         and has not otherwise been deduced, it will be deduced to an empty
1962         parameter pack.
1963         (more_specialized_fn): Use the actual lengths of the argument
1964         lists when comparing against expansions.
1965         * semantics.c (finish_member_declaration): If a field's type has
1966         bare parameter packs, error and set its type to ERROR_MARK_NODE.
1967
1968 2007-05-24  Danny Smith  <dannysmith@users.sourceforge.net>
1969
1970         PR target/27067
1971         * mangle.c (mangle_decl): Call targetm.mangle_decl_assembler_name.
1972
1973 2007-05-22  Ollie Wild  <aaw@google.com>
1974
1975         * name-lookup.c (ambiguous_decl): Adds check for hidden types.
1976         (unqualified_namespace_lookup): Adds check for hidden types.
1977
1978 2007-05-22  Ollie Wild  <aaw@google.com>
1979
1980         * decl.c (duplicate_decls): Verify namespace names are unique.
1981
1982 2007-05-21  Mark Mitchell  <mark@codesourcery.com>
1983
1984         * decl.c (cxx_maybe_build_cleanup): Handle
1985         __attribute__((cleanup)).
1986
1987 2007-05-19  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1988
1989         * cvt.c (cp_convert_and_check): Don't check warnings if the
1990         conversion failed.
1991
1992 2007-05-18  Geoffrey Keating  <geoffk@apple.com>
1993
1994         * mangle.c (write_real_cst): Use 'unsigned long' for %lx.
1995
1996 2007-05-14  Paolo Carlini  <pcarlini@suse.de>
1997
1998         PR c++/29928
1999         * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the
2000         type only if is a class type (5.2.8/4).
2001
2002 2007-05-14  Rafael Avila de Espindola  <espindola@google.com>
2003
2004         * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
2005         * decl.c (grokdeclarator): Use unsigned_type_for instead of
2006         c_common_unsigned_type.
2007
2008 2007-05-11  Silvius Rus  <rus@google.com>
2009
2010         * cp/typeck.c (build_indirect_ref): Add call to
2011         strict_aliasing_warning.
2012         (build_reinterpret_cast_1): Condition call to
2013         strict_aliasing_warning. 
2014
2015 2007-05-11  Jan Hubicka  <jh@suse.cz>
2016
2017         * semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
2018         * decl2.c (start_objects): ctors and dtors are no longer public.
2019         (cp_write_global_declarations): Do not call c_build_cdtor_fns.
2020         
2021 2007-05-07  Andrew Pinski  <andrew_pinski@playstation.sony.com>
2022
2023         * typeck.c (build_unary_op): Remove code that used to
2024         handle non lvalue increments/decrements.
2025
2026 2007-05-07  Mike Stump  <mrs@apple.com>
2027
2028         * parser.c (check_empty_body): Add.
2029         (cp_parser_iteration_statement): Add call to check_empty_body.
2030
2031 2007-05-05  Geoffrey Keating  <geoffk@apple.com>
2032
2033         PR 31775
2034         * mangle.c (write_mangled_name): Mangle static variable names.
2035         (write_unqualified_name): Use local-source-name for
2036         namespace-scope static variables.
2037
2038 2007-05-04  Dirk Mueller  <dmueller@suse.de>
2039
2040         * cp-tree.h (DECL_MAIN_P): only if -ffreestanding is
2041         not in effect.
2042
2043 2007-05-02  Seongbae Park  <seongbae.park@gmail.com>
2044
2045         PR c++/31663
2046         * decl2.c (constrain_class_visibility): 
2047         Use strip_pointer_or_array_types instead of strip_array_types.
2048
2049 2007-04-28  Andrew Pinski  <andrew_pinski@playstation.sony.com>
2050
2051         PR C++/30221
2052         * decl.c (reshape_init_r): Don't reshape the first element if it
2053         is a pointer to member function.
2054
2055 2007-04-27  Simon Baldwin  <simonb@google.com>
2056
2057         * decl.c (grokparms): Changed message format from %qD to %qE.
2058
2059 2007-04-27  Douglas Gregor  <doug.gregor@gmail.com>
2060
2061         * error.c (maybe_warn_variadic_templates): Variadic templates are
2062        now in C++0x, so only warn about them in C++98 mode.
2063         
2064 2007-04-26  Andrew Pinski  <andrew_pinski@playstation.sony.com>
2065
2066         PR C++/30016
2067         * typeck.c (build_reinterpret_cast_1): Only allow conversion to
2068         integeral types from vectors types.
2069
2070 2007-04-26  Jakub Jelinek  <jakub@redhat.com>
2071
2072         PR c++/31598
2073         * semantics.c (finish_omp_clauses): Don't create CP_OMP_CLAUSE_INFO
2074         for type dependent OMP_CLAUSE_DECLs.
2075
2076 2007-04-24  Mark Mitchell  <mark@codesourcery.com>
2077
2078         PR c++/31338
2079         * cp-tree.h (ARITHMETIC_TYPE): Include COMPLEX_TYPE.
2080         * typeck.c (type_after_usual_arithmetic_conversions): Adjust, as
2081         COMPLEX_TYPE is now an ARITHMETIC_TYPE.
2082         * init.c (build_zero_init): Adjust, as
2083         COMPLEX_TYPE is now a SCALAR_TYPE.
2084         * typeck2.c (digest_init): Allow brace-enclosed initializers for
2085         COMPLEX_TYPE, even though that is now a SCALAR_TYPE.
2086
2087 2007-04-25  Paolo Carlini  <pcarlini@suse.de>
2088
2089         * semantics.c (classtype_has_nothrow_copy_or_assign_p): Adjust
2090         per N2255; rename as classtype_has_nothrow_assign_or_copy_p.
2091         (trait_expr_value): Adjust.
2092
2093 2007-04-23  Simon Baldwin  <simonb@google.com>
2094
2095         * decl.c (grokparms): Added new error for duplicate function
2096         parameters names in function prototypes, to match gcc behavior.
2097
2098 2007-04-23  Jan Hubicka  <jh@suse.cz>
2099
2100         * cp/decl2.c (finish_objects): Do not call target constructor/destructor
2101         bits dirrectly.
2102
2103 2007-04-21  Andrew Pinski  <andrew_pinski@playstation.sony.com>
2104
2105         * cp-tree.h (lang_tree_node): Use GENERIC_NEXT
2106         instead of checking GIMPLE_STMT_P in chain_next.
2107
2108 2007-04-17  Mark Mitchell  <mark@codesourcery.com>
2109
2110         PR c++/31513
2111         * call.c (convert_for_arg_passing): Convert bitfields to their
2112         declared types.
2113
2114 2007-04-17  Simon Martin  <simartin@users.sourceforge.net>
2115
2116         PR c++/31517
2117         * pt.c (value_dependent_expression_p): Handle MODOP_EXPRs.
2118
2119 2007-04-16  Seongbae Park <seongbae.park@gmail.com>
2120
2121         PR c++/29365
2122         * cp/decl2.c (constrain_class_visibility):
2123         Do not warn about the use of anonymous namespace in the main input file.
2124
2125 2007-04-15  Mark Mitchell  <mark@codesourcery.com>
2126
2127         * cp-tree.h (current_template_parms): Fix typo in comment.
2128
2129 2007-04-15  Kazu Hirata  <kazu@codesourcery.com>
2130
2131         * cp-tree.h, error.c: Fix comment typos.
2132
2133 2007-04-13  Jason Merrill  <jason@redhat.com>
2134
2135         PR c++/31074
2136         * call.c (reference_binding): Add c_cast_p parm.  If true,
2137         add quals to TO as needed to make it reference-compatible.
2138
2139 2007-04-11  Jan Hubicka  <jh@suse.cz>
2140
2141         * cp/class.c (convert_to_base_statically): Fold produced tree; verify
2142         that we are not processing template_decl.
2143
2144 2007-04-09  Mark Mitchell  <mark@codesourcery.com>
2145
2146         PR c++/31449
2147         * class.c (build_base_path): Ensure that the converted pointer has
2148         the same cv-qualification as the input.
2149
2150 2007-04-09  Paolo Carlini  <pcarlini@suse.de>
2151
2152         * tree.c (cp_tree_equal): Deal with TRAIT_EXPR.
2153
2154 2007-04-08  Steven Bosscher  <steven@gcc.gnu.org>
2155
2156         * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS):
2157         Do not set it.
2158         (LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P): Do not set it.
2159         * tree.c (cp_add_pending_fn_decls): Remove.
2160         * cp-tree.h (cp_add_pending_fn_decls): Remove prototype.
2161
2162 2007-04-07  Daniel Berlin  <dberlin@dberlin.org>
2163
2164         Revert change removing staticp.
2165
2166 2007-04-06  Daniel Berlin  <dberlin@dberlin.org>
2167
2168         * cp-objcp-common.c (cxx_staticp): Remove.
2169         * cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
2170         * cp-tree.h (cxx_staticp):      
2171
2172 2007-04-04  Danny Smith  <dannysmith.users.sourceforge.net>
2173
2174         * class.c (check_for_override): Don't remove dllmport attribute
2175         of virtual methods.
2176
2177 2007-04-03  Jakub Jelinek  <jakub@redhat.com>
2178
2179         PR c++/30847
2180         * typeck.c (build_modify_expr): For COND_EXPR on LHS, if RHS has void
2181         type issue error and return early.
2182
2183 2007-03-30  Jason Merrill  <jason@redhat.com>
2184
2185         PR c++/31187
2186         * typeck.c (cp_type_readonly): New fn.
2187         * cp-tree.h: Declare it.
2188         * decl.c (start_decl): Set implicit DECL_THIS_STATIC here.
2189         (cp_finish_decl): Not here.
2190
2191 2007-03-31  Richard Guenther  <rguenther@suse.de>
2192
2193         * optimize.c (maybe_clone_body): Replace splay-tree usage by
2194         pointer-map.
2195
2196 2007-03-31  Douglas Gregor  <doug.gregor@gmail.com>
2197
2198         PR c++/31138
2199         PR c++/31140
2200         PR c++/31141
2201         * parser.c (declarator_can_be_parameter_pack): New.
2202         (cp_parser_template_parameter): Only parse the `...' if the
2203         declarator can be a parameter pack.
2204         (cp_parser_parameter_declaration): Ditto. Also, handle when TYPE
2205         is NULL.
2206         * pt.c (find_parameter_packs_r): Look into the bounds on integer
2207         types (they could be used as array bounds). 
2208         (check_for_bare_parameter_packs): Deal with TEMPLATE_PARM_INDEX.
2209         (tsubst_pack_expansion): Handle failure to expand parameter
2210         packs.
2211         
2212 2007-03-30  Paolo Carlini  <pcarlini@suse.de>
2213
2214         PR c++/26099
2215         * cp-tree.h (enum cp_trait_kind, struct tree_trait_expr,
2216         TRAIT_EXPR_TYPE1, TRAIT_EXPR_TYPE2, TRAIT_EXPR_KIND): Add.
2217         (enum cp_tree_node_structure_enum, union lang_tree_node): Update.
2218         (CLASS_TYPE_NON_UNION_P): Add.
2219         (struct lang_type_class): Add has_complex_dflt.
2220         (TYPE_HAS_COMPLEX_DFLT, TYPE_HAS_TRIVIAL_DFLT): Add.
2221         (locate_copy, locate_ctor, locate_dtor, finish_trait_expr): Declare.
2222         * cp-tree.def: Add TRAIT_EXPR.
2223         * cp-objcp-common.c (cp_tree_size): Add TRAIT_EXPR case.
2224         * lex.c (struct resword): Add __has_nothrow_assign,
2225         __has_nothrow_constructor, __has_nothrow_copy, __has_trivial_assign,
2226         __has_trivial_constructor, __has_trivial_copy,
2227         __has_trivial_destructor, __has_virtual_destructor, __is_abstract,
2228         __is_base_of, __is_class, __is_convertible_to, __is_empty, __is_enum,
2229         __is_pod, __is_polymorphic, __is_union.
2230         * parser.c (cp_parser_primary_expression): Deal with the new RIDs.
2231         (cp_parser_trait_expr): New.
2232         * semantics.c (finish_trait_expr, trait_expr_value
2233         classtype_has_nothrow_copy_or_assign_p): New.
2234         * method.c (locate_copy, locate_ctor, locate_dtor): Do not define
2235         as static.
2236         * decl.c (cp_tree_node_structure): Add TRAIT_EXPR.
2237         * class.c (check_bases, check_field_decl, check_bases_and_members):
2238         Deal with TYPE_HAS_COMPLEX_DFLT (t) too.
2239         * pt.c (uses_template_parms, tsubst_copy_and_build,
2240         value_dependent_expression_p, type_dependent_expression_p): Deal with
2241         TRAIT_EXPR.
2242         * tree.c (cp_walk_subtrees): Deal with TRAIT_EXPR.
2243
2244 2007-03-29  Richard Guenther  <rguenther@suse.de>
2245
2246         * tree.c (cp_walk_subtrees): Do not set input_location.
2247
2248 2007-03-28  Simon Martin  <simartin@users.sourceforge.net>
2249
2250         PR c++/29077
2251         * decl.c (grokfndecl): Properly setup decl if it is a constructor or a
2252         destructor.
2253
2254 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
2255
2256         * parser.c (struct cp_parser): Update comment for
2257         greater_than_is_operator_p.
2258         (cp_parser_primary_expression): In C++0x mode, a cast operator can
2259         be terminated with a `>>' token when !GREATER_THAN_IS_OPERATOR_P.
2260         (TOKEN_PRECEDENCE): In C++0x mode, `>>' is treated like `>' when
2261         !GREATER_THAN_IS_OPERATOR_P.
2262         (cp_parser_binary_expression): When -Wc++0x-compat, warn about
2263         `>>' operators that will become two `>' tokens in C++0x.
2264         (cp_parser_parameter_declaration): Treat `>>' like `>' in C++0x
2265         mode, allowing it to terminate default arguments.
2266         (cp_parser_enclosed_template_argument_list): In C++0x mode, treat
2267         `>>' like two consecutive `>' tokens.
2268         (cp_parser_skip_to_end_of_template_parameter_list): Ditto.
2269         (cp_parser_next_token_ends_template_argument_p): In C++0x, `>>'
2270         ends a template argument.
2271
2272 2007-03-28  Douglas Gregor  <doug.gregor@gmail.com>
2273
2274         * decl.c (redeclaration_error_message): Complain when redeclaring
2275         a friend function with default template arguments (C++0x mode only).
2276         * cp-tree.h (check_default_tmpl_args): Declare.
2277         * pt.c (check_default_tmpl_args): In C++0x mode, permit default
2278         template arguments in function templates. Add support for checking
2279         the default template arguments of friend templates.
2280         (push_template_decl_real): Fix call to check_default_tmpl_args.
2281         (type_unification_real): If a template parameter has not been
2282         deduced but provides a default template argument, substitute into
2283         that default template argument.
2284         * parser.c (cp_parser_init_declarator): When declaring (but not
2285         defining!) a function template in C++0x mode, check for default
2286         template arguments.
2287
2288 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
2289
2290         PR c++/29993
2291         * decl.c (grokdeclarator): Deal with cv-qualified function type
2292         typedefs in the same way for member and non-member functions.
2293
2294 2007-03-26  Dirk Mueller  <dmueller@suse.de>
2295
2296         * parser.c (cp_parser_member_declaration): Pedwarn
2297         about stray semicolons after member declarations.
2298
2299 2007-03-26  Paolo Carlini  <pcarlini@suse.de>
2300
2301         PR c++/30500
2302         * pt.c (instantiate_decl): Set in_system_header.
2303
2304 2007-03-22  Mark Mitchell  <mark@codesourcery.com>
2305
2306         * cp-tree.h (current_tempalte_parms): Improve documentation.
2307         * pt.c (current_template_args): Likewise.
2308
2309         PR c++/30863
2310         * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Do
2311         not consume tokens when failing.
2312
2313 2007-03-22  Jim Wilson  <wilson@specifix.com>
2314             Mark Mitchell  <mark@codesourcery.com>
2315
2316         PR c++/31273
2317         * call.c (standard_conversion): Use type_decays_to.  Keep FCODE
2318         consistent with FROM.
2319
2320 2007-03-22  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2321
2322         * error.c (dump_expr): Handle dependent names that designate types.
2323         * cxx-pretty-print.c (pp_cxx_unqualified_id): Handle TYPENAME_TYPE.
2324
2325 2007-03-17  Kazu Hirata  <kazu@codesourcery.com>
2326
2327         * cp-tree.def, parser.c, pt.c: Fix comment typos.
2328
2329 2007-03-16  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2330
2331         * cvt.c (cp_convert_and_check) : Define.
2332         * cp-tree.h (cp_convert_and_check): Declare.
2333         * call.c (convert_conversion_warnings): Rename to
2334         conversion_null_warnings.  The warning for floating-point to
2335         integer is handled by convert_and_check in convert_like_real.
2336         (convert_like_real): convert_conversion_warnings was renamed as
2337         conversion_null_warnings.
2338         * typeck.c (build_binary_op): Use cp_convert_and_check to warn for
2339         overflow and changes of value during conversion.
2340
2341 2007-03-15  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2342
2343         PR c++/30891
2344         * parser.c (cp_parser_statement): If 'namespace' is found, this
2345         only can be a namespace alias definition, so parse it now.
2346         (cp_parser_namespace_alias_definition): if we find an open brace
2347         instead of '=', then this is actually a misplaced namespace
2348         definition.
2349         
2350 2007-03-15  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2351
2352         PR c++/24924
2353         * decl.c (cxx_init_decl_processing): Move command-line options
2354         processing to c-opts.c.
2355         
2356 2007-03-15  Douglas Gregor  <doug.gregor@gmail.com>
2357
2358         * ptree.c (cxx_print_type): Use formatting markup for integers
2359         when printing template parameter index/level/orig level.
2360         (cxx_print_xnode): Ditto.
2361         * cp-tree.h (TEMPLATE_PARM_PARAMETER_PACK): Use TREE_LANG_FLAG_0.
2362         (struct template_parm_index_s): Remove the PARAMETER_PACK member.
2363         Make INDEX, LEVEL, and ORIG_LEVEL integers instead of
2364         HOST_WIDE_INTs.
2365         (struct saved_scope): Make X_PROCESSING_TEMPLATE_DECL an int,
2366         rather than a HOST_WIDE_INT.
2367         Turn X_PROCESSING_EXPLICIT_INSTANTIATION, SKIP_EVALUATION, and
2368         NEED_POP_FUNCTION_CONTEXT into bool bitfields; reorder fields for
2369         better bit-packing.
2370         (struct language_function): Make RETURNS_VALUE, RETURNS_NULL,
2371         RETURNS_ABNORMALLY, IN_FUNCTION_TRY_HANDLER, and
2372         IN_BASE_INITIALIZER bool bitfields.
2373         (struct cp_declarator): Make KIND a 4-bit field. Make
2374         PARAMETER_PACK_P a bool bitfield just after KIND.
2375         * pt.c (uses_parameter_packs): Destroy the pointer set.
2376         (make_pack_expansion): Ditto.
2377         (check_for_bare_parameter_packs): Ditto.
2378         * name-lookup.c (push_to_top_level): Make need_pop a bool value.
2379         
2380 2007-03-14  Andrew Pinski  <andrew_pinski@playstation.sony.com>
2381
2382         PR c++/31165
2383         * call.c  (convert_default_arg): Instead of copying the node,
2384         unshare it.
2385
2386 2007-03-15  Dirk Mueller  <dmueller@suse.de>
2387
2388         PR c++/30860
2389         * call.c (convert_conversion_warnings): New..
2390         (convert_like_real): .. factored out from here.
2391         (convert_conversion_warnings): Add warning about
2392         false being converted to NULL in argument passing.
2393
2394 2007-03-14  Dirk Mueller  <dmueller@suse.de>
2395
2396         * cp/semantics.c (c_finish_if_stmt): Call empty_if_body_warning.
2397         (finish_do_body): Warn about empty body in do/while statement.
2398
2399 2007-03-14  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2400
2401         * class.c (warn_hidden): Add OPT_Woverloaded_virtual to warning.
2402         
2403 2007-03-14  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2404
2405         PR c/21438
2406         * typeck.c (build_binary_op): Call warn_for_div_zero instead of
2407         warning.
2408         
2409 2007-03-13  Alexandre Oliva  <aoliva@redhat.com>
2410
2411         * cp/repo.c (init_repo): Initialize random_seed saved options.
2412         (finish_repo): Adjust.
2413
2414 2007-03-13  Mark Mitchell  <mark@codesourcery.com>
2415
2416         PR bootstrap/30899
2417         * Make-lang.in (doc/g++.1): Use $< to specify the location from
2418         which to copy.
2419
2420 2007-03-12  Seongbae Park <seongbae.park@gmail.com>
2421
2422         * decl.c (compute_array_index_type): New warning flag warn_vla.
2423
2424 2007-03-12  Mark Mitchell  <mark@codesourcery.com>
2425
2426         PR c++/30108
2427         * call.c (convert_default_arg): Copy non-constant arguments.
2428
2429 2007-03-11  Mark Mitchell  <mark@codesourcery.com>
2430
2431         PR c++/31038
2432         * parser.c (cp_parser_postfix_expression): Disallow compound
2433         literals in constant expressions.
2434
2435         PR c++/30328
2436         * semantics.c (finish_typeof): Use unlowered_expr_type.
2437         
2438 2007-03-10  Mark Mitchell  <mark@codesourcery.com>
2439
2440         PR c++/30274
2441         * cp-tree.h (unlowered_expr_type): New function.
2442         * typeck.c (is_bitfield_expr_with_lowered_type): Handle
2443         COMPOUND_EXPR, MODIFY_EXPR, and SAVE_EXPR.
2444         (unlowered_expr_type): New function.
2445         (build_unary_op): Disallow predecrements of bool bitfields.
2446         * call.c (build_conditional_expr): Use unlowered_expr_type.
2447         * pt.c (type_unification_real): Likewise.
2448
2449 2007-03-09  Douglas Gregor  <doug.gregor@gmail.com>
2450
2451         PR c++/20599
2452         * typeck.c (check_return_expr): Check for bare parameter packs.
2453         (comptypes): Compare template parameter packs and
2454         type pack expansions.
2455         * decl.c (grokdeclarator): Deal with the declaration of function
2456         parameter packs.
2457         (grokparms): Verify that the (optional) function parameter pack is
2458         at the end of the parameter list.
2459         (xref_basetypes): Handle pack expansions in the base class.
2460         (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT.
2461         * cp-tree.def (TYPE_ARGUMENT_PACK): New.
2462         (NONTYPE_ARGUMENT_PACK): New.
2463         (TYPE_PACK_EXPANSION): New.
2464         (EXPR_PACK_EXPANSION): New.
2465         (ARGUMENT_PACK_SELECT): New.
2466         * cp-objcp-common.c (cp_tree_size): Compute size of
2467         (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and
2468         ARGUMENT_PACK_SELECT.
2469         * error.c (dump_template_argument): Print template argument packs.
2470         (dump_template_argument_list): Ditto.
2471         (dump_template_parameter): Dump `...' for template type parameter
2472         packs.
2473         (dump_type): Dump TYPE_PACK_EXPANSION nodes.
2474         (dump_parameters): Print function parameter packs.
2475         (dump_template_parms): Print template argument packs.
2476         (dump_expr): Dump EXPR_PACK_EXPANSION nodes.
2477         (maybe_warn_variadic_templates): New.
2478         * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION.
2479         * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
2480         NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
2481         CAST_EXPR. 
2482         * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION.
2483         (write_template_arg): Write argument packs as separate arguments.
2484         * cp-tree.h (struct template_parm_index_s): Add flag that
2485         indicates that the template parameter is actually a parameter
2486         pack.
2487         (struct tree_argument_pack_select): New.
2488         (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT.
2489         (union lang_tree_node): Add argument_pack_select.
2490         (FUNCTION_PARAMETER_PACK_P): New.
2491         (PACK_EXPANSION_P): New.
2492         (PACK_EXPANSION_PATTERN): New.
2493         (SET_PACK_EXPANSION_PATTERN): New.
2494         (PACK_EXPANSION_PARAMETER_PACKS): New.
2495         (ARGUMENT_PACK_P): New.
2496         (ARGUMENT_PACK_ARGS): New.
2497         (SET_ARGUMENT_PACK_ARGS): New.
2498         (ARGUMENT_PACK_INCOMPLETE_P): New.
2499         (ARGUMENT_PACK_EXPLICIT_ARGS): New.
2500         (TEMPLATE_PARM_PARAMETER_PACK): New.
2501         (TEMPLATE_TYPE_PARAMETER_PACK): New.
2502         (ARGUMENT_PACK_SELECT_FROM_PACK): New.
2503         (ARGUMENT_PACK_SELECT_INDEX): New.
2504         (ARGUMENT_PACK_SELECT_ARG): New.
2505         (struct cp_declarator): Add parameter_pack_p flag.
2506         (maybe_warn_variadic_templates): Declare.
2507         (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to
2508         indicate a template parameter pack. 
2509         (uses_parameter_packs): Declare.
2510         (template_parameter_pack_p): Declare.
2511         (template_parms_variadic_p): Declare.
2512         (make_pack_expansion): Declare.
2513         (check_for_bare_parameter_packs): Declare.
2514         * cxx-pretty-print.c (pp_cxx_unary_expression): Print
2515         sizeof... expressions. 
2516         (pp_cxx_expression): Print pack expansions and non-type argument
2517         packs.
2518         (pp_cxx_exception_specification): Print pack expansions. 
2519         (pp_cxx_direct_declarator): Print ellipsis for parameter packs.
2520         (pp_cxx_ctor_initializer): Print pack expansions.
2521         (pp_cxx_type_id): Print pack expansions.
2522         (pp_cxx_template_argument_list): Print argument packs.
2523         (pp_cxx_template_parameter): Print ellipsis for template parameter
2524         packs.
2525         * pt.c (comp_template_parms): Compare template parameter packs.
2526         (template_parameter_pack_p): New.
2527         (template_parms_variadic_p): New.
2528         (template_args_variadic_p): New.
2529         (make_ith_pack_parameter_name): New.
2530         (struct find_parameter_pack_data): New.
2531         (find_parameter_packs_r): New.
2532         (uses_parameter_packs): New.
2533         (make_pack_expansion): New.
2534         (check_for_bare_parameter_packs): New.
2535         (expand_template_argument_pack): New.
2536         (reduce_template_parm_level): Propagate parameter pack flag.
2537         (process_template_parm): Add is_parameter_pack parameter to state
2538         when the parameter is actually a parameter pack. Create template
2539         parameter packs when is_parameter_pack is true.
2540         (current_template_args): The argument for a template parameter
2541         pack is an argument pack containing a single pack expansion.
2542         (process_partial_specialization): When checking that non-type
2543         argument expressions do not involve template parameters, loop over
2544         the arguments in argument packs separately.
2545         (push_template_decl_real): Check that the type of the declaration
2546         does not have any bare parameter packs. Check that primary
2547         templates have no more than one parameter pack, and that it comes
2548         at the end of the template parameter list.
2549         (convert_template_argument): Handle coercions for pack expansion
2550         expressions by coercing the pattern then rebuilding the expansion.
2551         (coerce_template_parms): When coercing the arguments for a
2552         variadic template, pack "extra" arguments into an argument pack.
2553         (coerce_template_template_parms): Cannot coerce between parameter
2554         packs and non-pack parameters.
2555         (template_args_equal): Compare PACK_EXPANSION_P expressions.
2556         (comp_template_args): Expand all template arguments packs before
2557         comparing template argument lists.
2558         (mangle_class_name_for_template): Make argument packs as separate
2559         template arguments.
2560         (for_each_template_parm_r): No need to handle BASELINK. 
2561         (instantiate_class_template): Handle pack expansions in the base
2562         class list.
2563         (tsubst_pack_expansion): New.
2564         (tsubst_template_args): Handle substitutions of argument packs and
2565         pack expansion into template argument lists.
2566         (tsubst_decl): Expand function parameter packs into separate
2567         function parameters.
2568         (tsubst_arg_types): Expand a type pack expansion into separate
2569         argument types.
2570         (tsubst_exception_specification): Handle pack expansions in
2571         exception specifiers.
2572         (tsubst): See through ARGUMENT_PACK_SELECT arguments when 
2573         replacing a template parameter with its argument. If we encounter
2574         a substitution for an argument pack, just return the parameter
2575         itself. 
2576         (tsubst_copy): sizeof(X...) returns the number of elements in
2577         parameter pack X.  See through ARGUMENT_PACK_SELECT when the
2578         PARM_DECL is a parameter pack.
2579         (tsubst_expr): Expression pack expansions and argument packs
2580         cannot show up here; they will all be handled through function
2581         calls, sizeof, and template argument lists.
2582         (tsubst_copy_and_build): sizeof(X...) returns the number of
2583         elements in parameter pack X.  Handle pack expansions in TREE_LIST
2584         and CONSTRUCTOR nodes.
2585         (fn_type_unification): Handle "incomplete" explicit template
2586         argument lists that specify some of the arguments for a template
2587         parameter pack.
2588         (type_unification_real): Unify arguments against pack expansions.
2589         (template_parm_level_and_index): New, helper function.
2590         (unify_pack_expansion): New.
2591         (unify): Unify argument packs on an argument-by-argument basis,
2592         handling variadic argument packs as well.
2593         (more_specialized_fn): Handle unification of function parameter
2594         packs. All things being equal, prefer non-variadic function
2595         templates to variadic function templates.
2596         (more_specialized_class): Prefer the variadic class template
2597         partial specialization that binds fewer arguments to a parameter
2598         pack.
2599         (regenerate_decl_from_template): Expand function parameter packs
2600         into separate parameters.
2601         (instantiate_decl): Ditto.
2602         (tsubst_initializer_list): Handle pack expansions for base-class
2603         initializers.
2604         (dependent_type_p_r): Determine dependent types in argument packs
2605         and pack expansions.
2606         (value_dependent_expression_p): Determine value-dependence of
2607         non-type argument packs.
2608         (dependent_template_arg_p): Handle argument packs.
2609         * semantics.c (finish_cond): Check for bare parameter packs.
2610         (finish_expr_stmt): Ditto.
2611         (finish_for_expr): Ditto.
2612         (finish_switch_cond): Ditto.
2613         (finish_mem_initializers): Ditto.
2614         * name-lookup.c (arg_assoc_type): Handle pack expansions and
2615         argument packs.
2616         * decl2.c (cp_build_parm_decl): Mark function parameter packs.
2617         * parser.c (make_declarator): Declarator is not an expansion.
2618         (make_pointer_declarator): Transfer parameter pack flag to outer
2619         declarator.
2620         (make_reference_declarator): Ditto.
2621         (make_ptrmem_declarator): Ditto.
2622         (make_call_declarator): Ditto.
2623         (make_array_declarator): Ditto.
2624         (cp_parser_postfix_expression): Allow pack expansion expressions
2625         in the argument list for a call expression.
2626         (cp_parser_parenthesized_expression_list): Add new parameter
2627         ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand
2628         into separate arguments."
2629         (cp_parser_new_placement): Allow pack expansion expressions.
2630         (cp_parser_new_initializer): Ditto.
2631         (cp_parser_mem_initializer_list): Allow ellipsis to create a
2632         base-class initializer expansion.
2633         (cp_parser_mem_initializer): Ditto.
2634         (cp_parser_template_parameter_list): Keep track of whether the
2635         template parameter is a template parameter pack.
2636         (cp_parser_template_parameter): Parse the ellipsis to indicate a
2637         template parameter pack.
2638         (cp_parser_type_parameter): Ditto.
2639         (cp_parser_template_argument_list): Parse the ellipsis to indicate
2640         a pack expansion.
2641         (cp_parser_direct_declarator): Parse the ellipsis to indicate that
2642         this declarator is a parameter pack.
2643         (cp_parser_parameter_declaration): The ellipsis does not end the
2644         parameter declaration, because it might be a parameter pack. Parse
2645         the ellipsis to indicate a parameter pack.
2646         (cp_parser_initializer): Allow pack expansions.
2647         (cp_parser_initializer_list): Allow ellipsis to create an
2648         initializer expansion.
2649         (cp_parser_base_clause): Allow ellipsis to create a base specifier
2650         expansion.
2651         (cp_parser_type_id_list): Allow ellipsis to create an exception
2652         specifier expansion.
2653         (cp_parser_attribute_list): Don't allow pack expansions.
2654         (cp_parser_functional_cast): Allow pack expansions.
2655         (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to
2656         compute the length of a parameter pack.
2657         (cp_parser_next_token_ends_template_argument_p): An ellipsis can
2658         end a template argument.
2659         * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
2660         NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
2661         CAST_EXPR. 
2662
2663 2007-03-09  Dirk Mueller  <dmueller@suse.de>
2664
2665         * cp/call.c (build_new_op): Call warn_logical_operator.
2666
2667 2007-03-08  Volker Reichelt  <reichelt@netcologne.de>
2668
2669         PR c++/30852
2670         * semantics.c (finish_offsetof): Handle COMPOUND_EXPR.
2671
2672         PR c++/30534
2673         * pt.c (any_template_arguments_need_structural_equality_p):
2674         Robustify.
2675
2676 2007-03-08  Alexandre Oliva  <aoliva@redhat.com>
2677
2678         * decl.c (grokdeclarator): Disable warnings for anonymous
2679         bitfields.
2680
2681 2007-03-05  Volker Reichelt  <reichelt@netcologne.de>
2682
2683         * typeck2.c (readonly_error): Always emit a hard error.
2684         Remove last argument.
2685         * cp-tree.h (readonly_error): Adjust prototype.
2686         * semantics.c (finish_asm_stmt): Adjust call to readonly_error.
2687         * typeck.c (build_unary_op): Likewise.
2688         (build_modify_expr): Likewise.
2689
2690 2007-03-04  Simon Martin  <simartin@users.sourceforge.net>
2691
2692         PR c++/30895
2693         * tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees.
2694
2695 2007-03-03  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2696
2697         PR c++/15787
2698         * parser.c (struct cp_parser): New IN_IF_STMT.
2699         (cp_parser_statement_seq_opt): Handle an unexpected 'else',
2700         returning if parsing the body of an 'if' statement or issuing an
2701         error and continuing.
2702         (cp_parser_selection_statement): Set IN_IF_STMT bit when parsing
2703         body of 'if'.
2704         (cp_parser_jump_statement): Mask new IN_IF_STMT bit.
2705         
2706 2007-03-02  Simon Martin  <simartin@users.sourceforge.net>
2707
2708         PR c++/28253
2709         * class.c (update_vtable_entry_for_fn): Properly handle invalid overriders
2710         for thunks.
2711
2712 2007-03-02  Geoffrey Keating  <geoffk@apple.com>
2713
2714         * g++spec.c (lang_specific_driver): Add -lstdc++ when compiling
2715         Objective-C++.  Don't exit early if -shared-libgcc needs to be
2716         added.
2717
2718 2007-03-02  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2719
2720         * typeck.c (common_base_type): Delete unused function.
2721         
2722 2007-03-01  Brooks Moses  <brooks.moses@codesourcery.com>
2723
2724         * Make-lang.in: Add dummy lang.install-pdf target.
2725
2726 2007-03-01  Simon Baldwin <simonb@google.com>
2727
2728         PR c++/23689
2729         * decl.c (check_tag_decl): Added new warning for typedef ignored
2730         when it precedes an otherwise valid non-typedef declaration.
2731
2732 2007-02-28  Sandra Loosemore  <sandra@codesourcery.com>
2733
2734         * typeck.c (build_function_call): Store converted arguments
2735         in a stack-allocated array instead of building a list.
2736         (convert_arguments): Store arguments in the array passed in as an
2737         argument, and return the actual number of arguments.
2738         * call.c (build_call): Delete, and replace with...
2739         (build_call_n, build_call_a): New.
2740         (build_op_delete_call): Rewrite to avoid constructing argument lists.
2741         (build_over_call): Store converted arguments in a stack-allocated
2742         array instead of building a list.
2743         (build_cxx_call): Pass arguments in an array instead of as a list.
2744         (build_java_interface_fn_ref): Rewrite to avoid constructing
2745         argument lists.
2746         * tree.h: Update declarations to reflect above changes.
2747         * method.c (use_thunk): Use a stack-allocated array to hold
2748         the arguments instead of a list.
2749         * rtti.c (throw_bad_cast): Update call to cxx_call.
2750         (throw_bad_typeid): Likewise.
2751         (build_dynamic_cast_1): Likewise.
2752         * init.c (build_builtin_delete_call): Use build_call_n.
2753         * decl.c (expand_static_init): Likewise.
2754         * except.c (cp_protect_cleanup_actions): Likewise.
2755         * cp-gimplify.c (genericize_eh_spec_block): Likewise.
2756         (gimplify_must_not_throw_expr): Likewise.
2757         (cxx_omp_apply_fn): Use build_call_a.
2758
2759 2007-02-26  Mark Mitchell  <mark@codesourcery.com>
2760
2761         * semantics.c (expand_or_defer_fn): Call c_record_cdtor_fn.
2762         * decl2.c (cp_write_gloabl_declarations): Call c_build_cdtor_fns.
2763
2764 2007-02-25  Mark Mitchell  <mark@codesourcery.com>
2765
2766         * cp-tree.h (static_ctors): Remove.
2767         * cp-tree.h (static_dtors): Likewise.
2768         * cp-objcp-common.c (decl_shadowed_for_var_lookup): Adjust for
2769         refactoring of tree_map hierarchy.
2770         (decl_shadowed_for_var_insert): Likewise.
2771         * semantics.c (expand_body): Use c_expand_body.
2772         (expand_or_defer_fn): Don't update static_ctors or static_dtors.
2773         * decl2.c (static_ctors): Remove.
2774         (static_dtors): Likewise.
2775         (generate_ctor_or_dtor_function): Pass NULL_TREE to
2776         objc_generate_static_init_call.  Do not call static_[cd]tors.
2777         (generate_ctor_and_dtor_functions_for_priority): Do not check for
2778         static_[cd]tors.
2779         (cp_write_global_declarations): Likewise.
2780
2781 2007-02-23  Richard Guenther  <rguenther@suse.de>
2782
2783         * class.c (note_name_declared_in_class): Make declaration
2784         changes meaning a pedwarn.
2785
2786 2007-02-22  Michael Matz  <matz@suse.de>
2787
2788         PR c++/29433
2789         * cp-tree.h (TFF_UNQUALIFIED_NAME): New formatting flag.
2790         * error.c (dump_aggr_type, dump_simple_decl, dump_decl,
2791         dump_function_decl): Guard emitting outer scopes by new flag.
2792         * cp-lang.c (cxx_dwarf_name): New function.
2793         (LANG_HOOKS_DWARF_NAME): Define to cxx_dwarf_name.
2794         * pt.c (classtype_mangled_name, mangle_class_name_for_template):
2795         Remove functions.
2796         (push_template_decl_real, lookup_template_class): Remove calls
2797         to above functions.
2798
2799 2007-02-19  Mark Mitchell  <mark@codesourcery.com>
2800
2801         * call.c (build_new_method_call): Ensure that explicit calls of
2802         destructors have type "void".
2803
2804 2007-02-19  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2805
2806         * typeck.c (build_binary_op): Replace -Wstring-literal-comparison
2807         and -Walways-true with -Waddress.
2808         * cvt.c (convert_to_void): Replace unconditional warning with
2809         -Waddress.
2810
2811 2007-02-18  Kazu Hirata  <kazu@codesourcery.com>
2812
2813         * decl.c, tree.c: Fix comment typos.
2814
2815 2007-02-15  Andrew Pinski  <andrew_pinski@playstation.sony.com>
2816
2817         PR C++/30158
2818         * semantics.c (finish_stmt_expr_expr): Set TREE_TYPE of the 
2819         statement expression if we had an error mark node.
2820
2821 2007-02-15  Sandra Loosemore  <sandra@codesourcery.com>
2822             Brooks Moses  <brooks.moses@codesourcery.com>
2823             Lee Millward  <lee.millward@codesourcery.com>
2824
2825         * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
2826         Change class to tcc_vl_exp.
2827
2828         * call.c (build_call): Use build_call_list instead 
2829         of build3. 
2830         (build_over_call): Likewise.
2831         (build_new_method_call): Use build_min_non_dep_call_list 
2832         instead of build_min_non_dep.
2833
2834         * error.c (dump_call_expr_args): New function.
2835         (dump_aggr_init_expr_args): New function.
2836         (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them. 
2837         Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
2838
2839         * cvt.c (convert_to_void): Use build_call_array instead
2840         of build3; use new AGGR_INIT_EXPR accessor macros.
2841
2842         * mangle.c (write_expression): Use TREE_OPERAND_LENGTH
2843         instead of TREE_CODE_LENGTH.
2844
2845         * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
2846         AGGR_INIT_EXPR accessor macros.
2847
2848         * cp-gimplify.c (cp_gimplify_init_expr): Use 
2849         AGGR_INIT_EXPR_SLOT to set the slot operand.
2850
2851         * cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
2852         (AGGR_INIT_EXPR_SLOT): New macro.
2853         (AGGR_INIT_EXPR_ARG): New macro.
2854         (aggr_init_expr_nargs): New macro.
2855         (AGGR_INIT_EXPR_ARGP): New macro.
2856         (aggr_init_expr_arg_iterator): New.
2857         (init_aggr_init_expr_arg_iterator): New.
2858         (next_aggr_init_expr_arg): New.
2859         (first_aggr_init_expr_arg): New.
2860         (more_aggr_init_expr_args_p): New.
2861         (FOR_EACH_AGGR_INIT_EXPR_ARG): New.
2862         (stabilize_aggr_init): New declaration.
2863         (build_min_non_dep_call_list): Likewise.
2864
2865         * tree.c (process_aggr_init_operands): New function.
2866         (build_aggr_init_array) New function.
2867         (build_cplus_new): Update to use new CALL_EXPR and
2868         AGGR_INIT_EXPR accessor macros. Replace use of build3 with
2869         build_aggr_init_array.
2870         (build_min_non_dep_call_list) New function.
2871         (build_min_nt): Assert input code parameter is not a variable
2872         length expression class.
2873         (build_min, build_min_non_dep): Likewise.
2874         (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
2875         to check for equality instead of recursing. Handle tcc_vl_exp
2876         tree code classes.
2877         (stabilize_call): Update to only handle CALL_EXPRs, not 
2878         AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
2879         (stabilize_aggr_init): New function.
2880         (stabilize_init): Use it.
2881
2882         * cxx-pretty-print.c (pp_cxx_postfix_expression)
2883         <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
2884         AGGR_INIT_EXPR accessor macros and argument iterators.
2885         
2886         * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
2887         build_vl_exp. Iterate through the operands, recursively 
2888         processing each one.
2889         (tsubst_copy_and_build) <CALL_EXPR>: Update to use new
2890         CALL_EXPR accessor macros.
2891         (value_dependent_expression_p) <default>: Handle tcc_vl_exp
2892         tree code classes. Use TREE_OPERAND_LENGTH instead of 
2893         TREE_CODE_LENGTH.
2894
2895         * semantics.c (finish_call_expr): Use build_nt_call_list
2896         instead of build_nt.
2897         (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR 
2898         accessor macros. Use build_call_array to construct the 
2899         CALL_EXPR node instead of build3
2900         
2901         * decl2.c (build_offset_ref_call_from_tree): Use 
2902         build_nt_call_list and build_min_non_dep_call_list instead
2903         of build_min_nt and build_min_non_dep.
2904
2905         * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
2906         Use build_nt_call_list instead of build_min_nt.
2907
2908 2007-02-15  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2909
2910         PR c++/28943
2911         * call.c (build_conditional_expr): Improve error message.
2912         
2913 2007-02-13  Dirk Mueller  <dmueller@suse.de>
2914
2915         * friend.c (do_friend): Annotate warning about friend
2916         declarations in templates with OPT_Wnon_template_friend.
2917         Convert informal message from warning() to inform().
2918
2919 2007-02-12  Simon Martin  <simartin@users.sourceforge.net>
2920             Mark Mitchell  <mark@codesourcery.com>
2921
2922         PR c++/14622
2923         * pt.c (do_decl_instantiation): Detect type mismatches in explicit
2924         instantiations for variables.
2925
2926 2007-02-12  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2927
2928         PR middle-end/7651
2929         * cp-gimplify.c (gimplify_expr_stmt): Don't check extra_warnings.
2930         Check warn_unused_value just once.
2931
2932 2007-02-11  Mark Mitchell  <mark@codesourcery.com>
2933
2934         PR c++/26988
2935         * pt.c (determine_specialization): Use skip_artificial_parms_for.
2936         (fn_type_unificiation): Likewise.
2937         (get_bindings): Likewise.
2938
2939 o2007-02-06  Mark Mitchell  <mark@codesourcery.com>
2940
2941         PR target/29487
2942         * decl.c (finish_function): Use DECL_REPLACEABLE.
2943         * tree.c (cp_cannot_inline_tree_fn): Likewise.
2944
2945 2007-02-10  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2946
2947         * parser.c (cp_parser_primary_expression): Reformat overly long lines.
2948
2949 2007-02-10  Richard Henderson  <rth@redhat.com>, Jakub Jelinek  <jakub@redhat.com>
2950
2951         * decl.c (grokvardecl): Don't error if !have_tls.
2952         (grokdeclarator): Likewise.
2953         * parser.c (cp_parser_omp_threadprivate): Likewise.
2954
2955 2007-02-07  Jakub Jelinek  <jakub@redhat.com>
2956
2957         PR c++/30703
2958         * cp-gimplify.c (cp_genericize_r): Don't dereference invisiref
2959         parameters and result decls in omp clauses.
2960         (cxx_omp_privatize_by_reference): Pass also invisiref PARM_DECLs
2961         by reference.
2962
2963 2007-02-05  Dirk Mueller  <dmueller@suse.de>
2964
2965         PR bootstrap/30510
2966         * parser.c (cp_parser_class_specifier): Always initialize bases.
2967
2968 2007-02-05  Paolo Bonzini  <bonzini@gnu.org>
2969
2970         * cp-tree.h (OMP_ATOMIC_CODE): Delete.
2971         (OMP_ATOMIC_DEPENDENT_P): Rewrite.
2972         * pt.c (tsubst_expr): Adjust for new format of dependent OMP_ATOMIC
2973         expressions.
2974         * semantics.c (finish_omp_atomic): Store a whole expression node
2975         in operand 1, and integer_zero_node in operand 0, for dependent
2976         OMP_ATOMIC.  Rewrite to make flow easier to understand.
2977
2978 2007-02-03  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2979
2980         * decl.c (grokdeclarator): Use OPT_Wreturn_type instead of 0.
2981
2982 2007-02-04  Kazu Hirata  <kazu@codesourcery.com>
2983
2984         * class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
2985         parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
2986
2987 2007-02-03  Douglas Gregor  <doug.gregor@gmail.com>
2988
2989        * parser.c (cp_lexer_get_preprocessor_token): Attach the C++0x
2990        keyword warning to -Wc++0x-compat.
2991         
2992 2007-02-03  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2993
2994         * decl.c (grokdeclarator): Update documentation.
2995
2996 2007-02-02  Jakub Jelinek  <jakub@redhat.com>
2997
2998         PR c++/30536
2999         * decl.c (grokdeclarator): If __thread is used together with
3000         a storage class other than extern and static, clear thread_p
3001         after issuing diagnostics and fall through to checking the
3002         storage class.
3003
3004 2007-01-30  Roger Sayle  <roger@eyesopen.com>
3005
3006         * error.c (dump_type_suffix): Avoid use of cp_build_binary_op when
3007         calculating the size of an array (to avoid recursive errors).
3008
3009 2007-01-30  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3010
3011         PR c++/24745
3012         * typeck.c (build_binary_op): Fix logic for warning. Move warning
3013         to -Wpointer-arith.
3014         * call.c (convert_like_real): Don't warn when converting to
3015         boolean type.
3016         
3017 2007-01-29  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3018
3019         * decl.c (pop_label): Replace warning with call to
3020         warn_for_unused_label.
3021
3022 2007-01-28  Andrew Pinski  <pinskia@gmail.com>
3023
3024         PR C++/28988
3025         * semantics.c (finish_pseudo_destructor_expr): Check the
3026         destrutor name by calling check_dtor_name.
3027
3028 2007-01-24  Douglas Gregor  <dgregor@osl.iu.edu>
3029
3030         * lex.c (D_CPP0X): Rename.
3031         (D_CXX0X): To this.
3032         (reswords): D_CPP0X -> D_CXX0X.
3033         (init_reswords): Ditto.
3034         * parser.c (cp_lexer_get_preprocessor_token): Warn about the use
3035         of C++0x keywords as identifiers.
3036
3037 2007-01-23  Simon Martin  <simartin@users.sourceforge.net>
3038
3039         PR c++/27492
3040         * decl.c (duplicate_decls): Don't reset DECL_INVALID_OVERRIDER_P for
3041         function decls.
3042
3043 2007-01-23  Ian Lance Taylor  <iant@google.com>
3044
3045         * typeck.c (convert_for_assignment): Only warn about a = b = c
3046         when converting to bool.
3047
3048 2007-01-23  Roger Sayle  <roger@eyesopen.com>
3049
3050         * call.c (null_ptr_cst_p): Replace use of TREE_CONSTANT_OVERFLOW with
3051         TREE_OVERFLOW.
3052         * typeck.c (ignore_overflows): Remove the remaining uses of
3053         TREE_CONSTANT_OVERFLOW.
3054
3055 2007-01-20  Jan Hubicka  <jh@suse.cz>
3056
3057         * decl2.c (start_objects, start_static_storage_duration_function):
3058         Do not make the functions uninlinable.
3059
3060 2007-01-17  Ian Lance Taylor  <iant@google.com>
3061
3062         * class.c (add_method): Call VEC_reserve_exact rather than passing
3063         a negative size to VEC_reserve.
3064
3065 2007-01-11  Simon Martin  <simartin@users.sourceforge.net>
3066
3067         PR c++/29573
3068         * tree.c (cp_tree_equal): Properly handle MODOP_EXPR trees.
3069
3070 2007-01-10  Mark Mitchell  <mark@codesourcery.com>
3071
3072         PR c++/28999
3073         * decl.c (make_typename_type): If the qualified name is not a
3074         type, issue an error.
3075         * parser.c (cp_parser_elaborated_type_specifier): Fix comment
3076         formatting.
3077
3078 2007-01-08  Geoffrey Keating  <geoffk@apple.com>
3079
3080         * rtti.c: Include target.h.
3081         (emit_support_tinfos): If ! targetm.cxx.library_rtti_comdat (),
3082         don't emit typeinfo for fundamental types as weak.
3083         * Make-lang.in (cp/rtti.o): Update and correct dependencies.
3084
3085 2007-01-08  Richard Guenther  <rguenther@suse.de>
3086
3087         * cvt.c (cp_convert_to_pointer): Use build_int_cst_type.
3088
3089 2007-01-08  Mark Shinwell  <shinwell@codesourcery.com>
3090
3091         * call.c (standard_conversion): Pass flag to
3092         vector_types_convertible_p to disallow emission of note.
3093         * typeck.c (convert_for_assignment): Pass flag to
3094         vector_types_convertible_p to allow emission of note.
3095         (ptr_reasonably_similar): Pass flag to vector_types_convertible_p
3096         to disallow emission of note.
3097
3098 2007-01-07  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3099
3100         PR c++/28986
3101         * typeck.c (build_binary_op): Call overflow_warning if
3102         TREE_OVERFLOW_P is true for the result and not for any of the
3103         operands.
3104         
3105 2007-01-06  Lee Millward  <lee.millward@codesourcery.com>
3106
3107        PR c++/19439
3108        * class.c (add_method): Don't wait until template
3109        instantiation time to complain about duplicate methods.
3110         
3111 2007-01-05  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3112
3113         PR c/19978
3114         * semantics.c (finish_unary_op_expr): Warn only if result
3115         overflowed and operands did not.
3116
3117 2007-01-05  Ian Lance Taylor  <iant@google.com>
3118
3119         * typeck.c (build_binary_op): Warn about comparing a non-weak
3120         address to NULL.
3121
3122 2007-01-05  Douglas Gregor  <doug.gregor@gmail.com>
3123
3124         * pt.c (tsubst): Propagate the need for structural equality checks
3125         when reducing the level of template parameters.
3126
3127 2007-01-03  Kazu Hirata  <kazu@codesourcery.com>
3128
3129         * pt.c: Fix a comment typo.
3130
3131 2007-01-02  Ian Lance Taylor  <iant@google.com>
3132
3133         * semantics.c (maybe_convert_cond): Optionally warn when using an
3134         assignment as a condition.
3135         * typeck.c (convert_for_assignment): Optionally warn about
3136         assigning the result of an assignment to a bool.
3137
3138 2007-01-02  Douglas Gregor  <doug.gregor@gmail.com>
3139
3140         * pt.c (canonical_template_parms): Correct typo in comment.
3141         
3142 2007-01-02  Douglas Gregor  <doug.gregor@gmail.com>
3143
3144         * typeck.c (structural_comptypes): Renamed from "comptypes".
3145         (comptypes): Use canonical type information to perform fast type
3146         comparison. When VERIFY_CANONICAL_TYPES, verify that the
3147         canonical type comparison returns the same results as we would see
3148         from the current, structural check. Support COMPARE_STRUCTURAL
3149         when we need structural checks.
3150         * decl.c (typename_compare): Fix comment.
3151         (build_typename_type): TYPENAME_TYPE nodes require structural
3152         equality checks, because they resolve different based on the
3153         current class type.
3154         (make_unbound_class_template): UNBOUND_CLASS_TEMPLATE nodes
3155         require structural equality checks (for now).
3156         (build_ptrmemfunc_type): Build the canonical pointer to member
3157         function type.
3158         (compute_array_index_type): Whenever we build a new index type
3159         to represent the size of an array in a template, we need to mark
3160         this index type as requiring structural equality. This goes for
3161         arrays with value-dependent sizes with the current ABI, or all
3162         arrays with ABI-1.
3163         * tree.c (cplus_array_hash): New.
3164         (struct cplus_array_info): New.
3165         (cplus_array_compare): New.
3166         (cplus_array_htab): New.
3167         (build_cplus_array_type_1): Use a hash table to cache the array
3168         types we build. Build the canonical array type for each array
3169         type.
3170         (cp_build_qualified_type_real): When building a cv-qualified array
3171         type, use the hash table of array types and build canonical array
3172         types as necessary.
3173         (bind_template_template_parm): BOUND_TEMPLATE_TEMPLATE_PARM nodes
3174         use structural equality (for now).
3175         * cp-tree.h (COMPARE_STRUCTURAL): New.
3176         * pt.c (canonical_template_parms): New.
3177         (canonical_type_parameter): New.
3178         (process_template_parm): Find the canonical type parameter.
3179         (lookup_template_class): When we have named the primary template
3180         type, set the canonical type for our template class to the primary
3181         template type. If any of the template arguments need structural
3182         equality checks, the template class needs structural equality
3183         checks.
3184         (tsubst): When reducing the level of a template template
3185         parameter, we require structural equality tests for the resulting
3186         parameter because its template parameters have not had their types
3187         canonicalized. When reducing a template type parameter, find the
3188         canonical reduced type parameter.
3189         (any_template_arguments_need_structural_equality_p): New.
3190