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