OSDN Git Service

* decl.c (record_builtin_java_type): Use canonicalized integer
[pf3gnuchains/gcc-fork.git] / gcc / cp / ChangeLog
1 2009-03-06  Alexandre Oliva  <aoliva@redhat.com>
2
3         * decl.c (record_builtin_java_type): Use canonicalized integer
4         types.
5
6 2009-03-04  Jason Merrill  <jason@redhat.com>
7
8         PR c++/38908
9         * class.c (is_really_empty_class): New fn.
10         * cp-tree.h: Declare it.
11         * cp-objcp-common.c (cp_expr_size): Use it.
12
13         PR c++/13549
14         * semantics.c (perform_koenig_lookup): Handle TEMPLATE_ID_EXPR.
15         * parser.c (cp_parser_postfix_expression): Call it for 
16         TEMPLATE_ID_EXPR.
17         * tree.c (is_overloaded_fn): Look through TEMPLATE_ID_EXPR.
18         (get_first_fn): Likewise.
19
20         PR c++/9634
21         PR c++/29469
22         PR c++/29607
23         Implement DR 224.
24         * decl.c (make_typename_type): Do look inside currently open classes.
25         * parser.c (cp_parser_lookup_name): Likewise.
26         (cp_parser_template_name): Likewise.
27         * pt.c (dependent_scope_p): New function.
28         * cp-tree.h: Declare it.
29         * class.c (currently_open_class): Return fast if T isn't a class.
30
31 2009-02-26  H.J. Lu  <hongjiu.lu@intel.com>
32
33         PR c++/37789
34         * parser.c (cp_parser_mem_initializer): Return error_mark_node
35         if cp_parser_mem_initializer_id returns error_mark_node.
36
37 2009-02-24  Richard Guenther  <rguenther@suse.de>
38
39         PR c++/39242
40         * pt.c (instantiate_decl): Do not instantiate extern, non-inline
41         declared functions.
42
43 2009-02-23  H.J. Lu  <hongjiu.lu@intel.com>
44
45         PR c++/36411
46         * pt.c (coerce_template_template_parms): Return 0 if parameter
47         is error_mark_node.
48
49 2009-02-23  Jason Merrill  <jason@redhat.com>
50
51         * pt.c (unify): Call maybe_adjust_types_for_deduction when
52         deducing from an initializer list.
53
54 2009-02-20  Jason Merrill  <jason@redhat.com>
55
56         PR c++/39225
57         * decl.c (grokdeclarator): Handle ~identifier.
58
59 2009-02-19  Jakub Jelinek  <jakub@redhat.com>
60
61         PR target/39175
62         * decl2.c (determine_visibility): If visibility changed and
63         DECL_RTL has been already set, call make_decl_rtl to update symbol
64         flags.
65
66 2009-02-19  H.J. Lu  <hongjiu.lu@intel.com>
67
68         PR c++/39188
69         * cp-tree.h (maybe_commonize_var): New.
70
71         * decl.c (maybe_commonize_var): Make it extern.
72
73         * decl2.c (finish_anon_union): Call maybe_commonize_var.
74
75 2009-02-18  H.J. Lu  <hongjiu.lu@intel.com>
76
77         PR c++/39219
78         * parser.c (cp_parser_enum_specifier): Apply all attributes.
79
80 2009-02-18  Jason Merrill  <jason@redhat.com>
81
82         * cfns.h: Tweak pathname for cfns.gperf.
83
84 2009-02-13  Jason Merrill  <jason@redhat.com>
85
86         PR c++/39070
87         * semantics.c (finish_call_expr): Change koenig_p parm to int.
88         If -1, don't set KOENIG_LOOKUP_P but do keep hidden candidates.
89         * cp-tree.h: Adjust prototype.
90         * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Pass -1.
91
92 2009-02-12  Jason Merrill  <jason@redhat.com>
93
94         PR c++/38950
95         * pt.c (unify)[TEMPLATE_PARM_INDEX]: Convert to the tsubsted type.
96
97 2009-02-11  Jason Merrill  <jason@redhat.com>
98
99         PR c++/39153
100         * decl2.c (cp_write_global_declarations): 
101         Check DECL_DEFAULTED_FN, not DECL_ARTIFICIAL.
102
103         PR c++/30111
104         * init.c (build_value_init_noctor): Split out from...
105         (build_value_init): ...here.
106         (expand_aggr_init_1): Handle value-initialization.
107         * cp-tree.h: Add declaration.
108         * class.c (type_has_user_provided_constructor): 
109         Handle non-class arguments.
110
111 2009-02-10  Jason Merrill  <jason@redhat.com>
112
113         PR c++/38649
114         * class.c (defaultable_fn_p): Handle ... properly.
115
116         PR c++/36744
117         * tree.c (lvalue_p_1): Condition rvalue ref handling on
118         treat_class_rvalues_as_lvalues, too.
119
120 2009-02-10  Paolo Carlini  <paolo.carlini@oracle.com>
121
122         PR c++/34397
123         * typeck.c (build_x_array_ref): New.
124         * cp-tree.h: Declare it.
125         * pt.c (tsubst_copy_and_build): Use it for case ARRAY_REF.
126
127 2009-02-09  Jason Merrill  <jason@redhat.com>
128
129         PR c++/39109
130         * semantics.c (simplify_aggr_init_expr): Do zero-initialization here.
131         * init.c (build_value_init): Not here. Don't build a TARGET_EXPR.
132         * tree.c (get_target_expr): Handle AGGR_INIT_EXPR.
133         * cp-gimplify.c (cp_gimplify_init_expr): Remove special handling
134         for build_value_init TARGET_EXPR.
135         * cp-tree.h (AGGR_INIT_ZERO_FIRST): New macro.
136
137 2009-02-06  Paolo Carlini  <paolo.carlini@oracle.com>
138
139         PR c++/35147
140         PR c++/37737
141         * cp-tree.h (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Check TREE_VEC_LENGTH.
142
143 2009-02-04  Jakub Jelinek  <jakub@redhat.com>
144
145         PR c++/39095
146         * operators.def: Use COMPONENT_REF code for ->/pt operator again,
147         remove ./dt operator.
148         * mangle.c (write_expression): Handle COMPONENT_REF after handling
149         ADDR_EXPR, for COMPONENT_REF without ARROW_EXPR inside of it
150         write_string ("dt") instead of using operators.def.
151
152 2009-02-03  Jason Merrill  <jason@redhat.com>
153
154         * typeck.c (cp_build_unary_op): Only complain about taking address
155         of main if pedantic.
156
157 2009-02-03  Jakub Jelinek  <jakub@redhat.com>
158
159         PR inline-asm/39059
160         * parser.c (cp_parser_primary_expression): Reject FIXED_CSTs.
161
162         PR c++/39056
163         * typeck2.c (digest_init_r): Don't call process_init_constructor
164         for COMPLEX_TYPE.
165
166 2009-02-03  Paolo Bonzini  <bonzini@gnu.org>
167
168         PR c++/36897
169         * pt.c (convert_nontype_argument_function): Expect expr to be an
170         ADDR_EXPR.
171
172         PR c++/37314
173         * typeck.c (merge_types): Call resolve_typename_type if only
174         one type is a typename.
175
176 2009-02-02  Jason Merrill  <jason@redhat.com>
177
178         PR c++/39054
179         * parser.c (cp_parser_unqualified_id): Don't wrap error_mark_node 
180         in BIT_NOT_EXPR.
181
182 2009-02-01  Paolo Carlini  <paolo.carlini@oracle.com>
183
184         PR c++/39053
185         * parser.c (cp_parser_pure_specifier): If there are no tokens left
186         do not call cp_lexer_consume_token.
187
188 2009-01-30  Jakub Jelinek  <jakub@redhat.com>
189
190         PR c++/39028
191         * parser.c (cp_parser_already_scoped_statement): Handle __label__
192         declarations.
193
194 2009-01-30  Paolo Carlini  <paolo.carlini@oracle.com>
195
196         PR c++/33465
197         * error.c (dump_expr): Handle FIX_TRUNC_EXPR and FLOAT_EXPR.
198
199 2009-01-30  Paolo Carlini  <paolo.carlini@oracle.com>
200
201         PR c++/38655
202         * error.c (dump_type_prefix, dump_type_suffix): Handle FIXED_POINT_TYPE.
203
204 2009-01-29  Paolo Carlini  <paolo.carlini@oracle.com>
205
206         * typeck.c (invalid_nonstatic_memfn_p): Use
207         DECL_NONSTATIC_MEMBER_FUNCTION_P.
208
209 2009-01-27  Paolo Carlini  <paolo.carlini@oracle.com>
210
211         PR c++/37554
212         * call.c (build_over_call): If convert_for_arg_passing returns
213         error_mark_node unconditionally return it.
214
215 2009-01-22  Adam Nemet  <anemet@caviumnetworks.com>
216
217         * class.c (check_field_decls): Also inherit packed for bitfields
218         regardless of their type.
219
220 2009-01-22  Dodji Seketeli  <dodji@redhat.com>
221
222         PR c++/38930
223         * decl2.c (grokfield): Reverting changes of PR c++/26693
224         (save_template_attributes): Likewise.
225         * decl.c (grokdeclarator): Likewise.
226         * name-lookup.c (pushdecl_maybe_friend): Likewise.
227         * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): Likewise.
228         (append_type_to_template_for_access_check): Likewise.
229         * semantics.c (check_accessibility_of_qualified_id): Likewise.
230         * pt.c (instantiate_class_template, instantiate_template ): Likewise.
231         (tsubst): Likewise.
232         (resolve_type_name_type): Likewise.
233         (append_type_to_template_for_access_check): Likewise.
234
235 2009-01-21  Dodji Seketeli  <dodji@redhat.com>
236
237         PR c++/26693
238         * decl2.c (grokfield): when a typedef appears in a
239         class, create the typedef variant type node for it.
240         (save_template_attributes): Creating typedef variant type node
241          here is now useless.
242         * decl.c (grokdeclarator): If the typedef'ed struct/class was
243         anonymous, set the proper type name to all its type variants.
244         * name-lookup.c (pushdecl_maybe_friend): Reuse the
245         set_underlying_type function to install typedef variant types.
246         * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): New template accessor
247         macro.
248         (append_type_to_template_for_access_check): New entry points.
249         * semantics.c (check_accessibility_of_qualified_id):
250         When a typedef that is a member of a class appears in a template,
251         add it to the template. It will be ...
252         * pt.c (instantiate_class_template, instantiate_template ): ... access
253         checked at template instantiation time.
254         (tsubst): Handle the case of being called with NULL args.
255         (resolve_type_name_type): The type name should be the name of the
256         main type variant.
257         (append_type_to_template_for_access_check): New entry point.
258
259 2009-01-19  Jason Merrill  <jason@redhat.com>
260
261         PR c++/23287
262         * parser.c (cp_parser_unqualified_id): In a template,
263         accept ~identifier.
264         * typeck.c (lookup_destructor): Handle IDENTIFIER_NODE.
265
266 2009-01-16  Jason Merrill  <jason@redhat.com>
267
268         PR c++/38877
269         * tree.c (lvalue_p_1): Allow non-fields in COMPONENT_REF.
270         * init.c (build_new): Don't call describable_type unless we
271         have an auto.
272
273         PR c++/29470
274         * pt.c (tsubst_decl) [USING_DECL]: Propagate access flags.
275
276         PR c++/38579
277         * search.c (protected_accessible_p): N doesn't vary.
278
279 2009-01-15  Jason Merrill  <jason@redhat.com>
280
281         PR c++/38850
282         * pt.c (tsubst_copy_and_build): Tell finish_call_expr to
283         accept hidden friends.
284
285 2009-01-15  Andrew Pinski  <andrew_pinski@playstation.sony.com>
286
287         PR C++/29388
288         * decl.c (grokdeclarator): Check for a non namespace/class context.
289
290 2009-01-15  Jason Merrill  <jason@redhat.com>
291
292         PR c++/36334
293         PR c++/37646
294         * tree.c (lvalue_p_1): Handle BASELINK.  A COMPONENT_REF to
295         a function isn't necessarily an lvalue. Take tree, not const_tree.
296         (lvalue_p, real_lvalue_p): Take tree, not const_tree.
297         * typeck.c (lvalue_or_else): Likewise.
298         * cp-tree.h: Adjust prototypes.
299
300 2009-01-15  Steve Ellcey  <sje@cup.hp.com>
301
302         PR c++/38357
303         * pt.c (tsubst): Check for NULL args.
304
305 2009-01-15  Dodji Seketeli  <dodji@redhat.com>
306
307         PR c++/38636
308         * name-lookup.c (pushtag): Don't create members to types that are not
309         being created.
310
311 2009-01-14  Nick Clifton  <nickc@redhat.com>
312
313         PR c++/37862
314         * parser.c: Pass cp_id_kind computed in
315         cp_parser_postfix_dot_deref_expression to
316         cp_parser_primary_expression.
317
318 2009-01-13  Jakub Jelinek  <jakub@redhat.com>
319
320         PR c++/38795
321         * tree.c (cp_walk_subtrees): Handle REINTERPRET_CAST_EXPR,
322         STATIC_CAST_EXPR, CONST_CAST_EXPR and DYNAMIC_CAST_EXPR the same
323         as CAST_EXPR.
324
325 2009-01-12  Jason Merrill  <jason@redhat.com>
326             Steve Ellcey  <sje@cup.hp.com>
327
328         PR c++/35109
329         * name-lookup.c (lookup_name_real): Keep looking past a hidden 
330         binding.
331
332 2009-01-12  Dodji Seketeli  <dodji@redhat.com>
333
334         PR c++/36019
335         * pt.c (parameter_of_template_p): New function.
336         * cp-tree.h: Declare it.
337         * name-lookup.c (binding_to_template_parms_of_scope_p): New
338         function.
339         (outer_binding): Take template parameters in account when looking for
340         a name binding.
341
342 2009-01-12  Jason Merrill  <jason@redhat.com>
343
344         PR c++/31488
345         * tree.c (pod_type_p): Return 1 for structs created by the back end.
346
347 2009-01-12  Jakub Jelinek  <jakub@redhat.com>
348
349         PR c/32041
350         * parser.c (cp_parser_builtin_offsetof): Allow `->' in
351         offsetof member-designator, handle it as `[0].'.
352
353         PR c++/38794
354         * decl.c (start_function): If grokdeclarator hasn't returned
355         FUNCTION_DECL nor error_mark_node, issue diagnostics.
356
357 2009-01-11  Jakub Jelinek  <jakub@redhat.com>
358
359         PR c++/36254
360         * cp-gimplify.c (genericize_if_stmt): Renamed from ...
361         (gimplify_if_stmt): ... this.
362         (cp_gimplify_expr): Don't handle IF_STMT here.
363         (cp_genericize_r): Call genericize_if_stmt for IF_STMT.
364
365 2009-01-10  Andrew Pinski  <pinskia@gmail.com>
366
367         PR c++/38648
368         * typeck.c (cp_build_modify_expr): Check for NULL current_function_decl.
369
370         PR c++/36695
371         * typeck2.c (build_functional_cast): Check for reference type and NULL
372         PARMS.
373
374 2009-01-09  Steve Ellcey  <sje@cup.hp.com>
375
376         * typeck.c (cp_build_unary_op): Check for ERROR_MARK.
377
378 2009-01-09  Jakub Jelinek  <jakub@redhat.com>
379
380         PR c++/35335
381         * error.c (dump_expr): Handle EXPR_STMT like BIND_EXPR.
382
383 2009-01-09  John F. Carr  <jfc@mit.edu>
384
385         PR c++/37877
386         * parser.c (cp_parser_class_specifier): Clear
387         parser->in_unbraced_linkage_specification_p while parsing class
388         specifiers.
389
390 2009-01-07  Jakub Jelinek  <jakub@redhat.com>
391
392         PR c++/38725
393         * semantics.c (finish_goto_stmt): Convert destination to
394         void *.
395
396 2009-01-06  Jason Merrill  <jason@redhat.com>
397
398         PR c++/35297
399         PR c++/35477
400         PR c++/35784
401         PR c++/36846
402         PR c++/38276
403         * pt.c (check_default_tmpl_args): Don't complain about
404         out-of-order parameter packs in the enclosing class
405         or parameter packs after default args.
406         (coerce_template_parms): If we have more than one
407         parameter pack, don't flatten argument packs.
408         (template_args_equal): Handle argument packs.
409         (comp_template_args): Don't flatten argument packs.
410         (check_instantiated_arg): Split out from...
411         (check_instantiated_args): Here.  Handle arg packs.
412         (convert_template_argument): Just check that nontype argument
413         packs have the right type.
414
415 2009-01-05  Dodji Seketeli  <dodji@redhat.com>
416
417         PR c++/38472
418         * typeck.c (type_after_usual_arithmetic_conversions): Fix a typo.
419
420 2009-01-05  Jason Merrill  <jason@redhat.com>
421
422         PR c++/38698
423         * typeck2.c (process_init_constructor_union): Handle union with
424         no fields.
425
426         * mangle.c (write_expression): Remove mangling for zero-operand
427         casts.
428
429         PR c++/38701
430         * decl.c (cp_finish_decl): Clear DECL_INITIAL for invalid
431         defaulting.
432
433         PR c++/38702
434         * class.c (defaultable_fn_p): Only operator== can be a copy
435         assignment operator.
436
437 2009-01-02  Jason Merrill  <jason@redhat.com>
438
439         PR c++/38698
440         * typeck2.c (process_init_constructor_union): Handle excess
441         initializers.
442         (process_init_constructor_record): Likewise.
443
444         PR c++/38684
445         * typeck2.c (digest_init_r): Don't use process_init_constructor
446         for non-aggregate classes.