OSDN Git Service

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