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