OSDN Git Service

* semantics.c (finish_compound_stmt): Avoid creating an
[pf3gnuchains/gcc-fork.git] / gcc / cp / ChangeLog
1 2010-10-27  Jason Merrill  <jason@redhat.com>
2
3         * semantics.c (finish_compound_stmt): Avoid creating an
4         unnecessary BIND_EXPR.
5
6         * call.c (convert_like_real): Don't check narrowing if the element
7         is also an initializer-list.
8
9 2010-10-27  Nicola Pero  <nicola.pero@meta-innovation.com>
10
11         * parser.c (cp_parser_objc_at_property_declaration): Recognize
12         RID_ASSIGN, RID_COPY, RID_RETAIN, RID_READWRITE and RID_NONATOMIC.
13         Do not use objc_set_property_attr, but use local variables
14         instead.  Detect repeated usage of setter, getter and ivar
15         attributes.  Improved error processing when a setter name does not
16         end in ':'.  Do not check for CPP_CLOSE_PAREN after we determined
17         that the token is a keyword.  Updated call to
18         objc_add_property_declaration.
19
20 2010-10-27  Nicola Pero  <nicola.pero@meta-innovation.com>
21
22         * parser.c (cp_parser_objc_property_decl): Renamed to
23         cp_parser_objc_struct_declaration.  Return the parsed trees
24         instead of calling objc_add_property_variable directly.  Detect
25         missing or invalid declspecs.  Implemented attributes.  Do not eat
26         the ';' at the end.  Exit loop whenever a non-comma is parsed, not
27         just EOF.
28         (cp_parser_objc_at_property): Renamed to
29         cp_parser_objc_at_property_declaration.  Updated calls to
30         objc_add_property_variable, now objc_add_property_declaration, and
31         to cp_parser_objc_property_decl, now
32         cp_parser_objc_struct_declaration.  Rewritten all code to be more
33         robust in dealing with syntax errors, and almost identical to the
34         one in c_parser_objc_at_property_declaration.
35         (cp_parser_objc_property_attrlist): Removed.
36         (cp_parser_objc_method_prototype_list): Updated call to
37         cp_parser_objc_at_property.
38         (cp_parser_objc_method_definition_list): Same change.
39         (cp_parser_objc_class_ivars): Detect a number of invalid
40         declarations of instance variables and produce errors when they
41         are found.
42         
43 2010-10-26  Jason Merrill  <jason@redhat.com>
44
45         * tree.c (build_vec_init_expr): Split out from...
46         (build_array_copy): ...here.
47         * init.c (perform_member_init): Use it.
48         * cp-tree.h: Declare it.
49         * cp-gimplify.c (cp_gimplify_init_expr): Don't gimplify the slot for
50         VEC_INIT_EXPR and AGGR_INIT_EXPR here.  Drop pre/post parameters.
51         (cp_gimplify_expr): Handle array default-initialization via
52         VEC_INIT_EXPR.
53
54         * tree.c (stabilize_expr): Handle xvalues properly.
55
56         * call.c (build_over_call): Use argarray[0] for 'this' argument.
57
58         * decl.c (finish_function): Don't look at function_depth.
59
60 2010-10-25  Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
61
62         Implement opaque-enum-specifiers for C++0x.
63         * cp-tree.h (SET_OPAQUE_ENUM_P): New.
64         (OPAQUE_ENUM_P): New.
65         (ENUM_FIXED_UNDERLYING_TYPE_P): New.
66         (start_enum): Update prototype.
67         (finish_enum_value_list): New prototype.
68         * parser.c (cp_parser_elaborated_type_specifier): Issue a pedwarn if
69         "enum class" is used in an elaborated-type-specifier.
70         (cp_parser_enum_specifier): Rewrite to parse opaque-enum-specifiers.
71         * decl.c (copy_type_enum): New.
72         (finish_enum_value_list): New, with code from finish_enum.
73         (finish_enum): A lot of code removed. Added a gcc_assert.
74         (start_enum): Add parameters enumtype and is_new.
75         Rewrite to work with opaque-enum-specifiers.
76         * pt.c (maybe_process_partial_specialization): Allow for template
77         specialization of enumerations, with a pedwarn.
78         (lookup_template_class): Update call to start_enum. Call to
79         SET_OPAQUE_ENUM_P.
80         (tsubst_enum): Call to begin_scope, finish_scope and
81         finish_enum_value_list.
82
83 2010-10-24  Nicola Pero  <nicola.pero@meta-innovation.com>
84
85         Removed Objective-C++ specific replacement of cxx_printable_name.
86         * cp-objcp-common.h: Added LANG_HOOKS_DECL_PRINTABLE_NAME, set
87         to cxx_printable_name for both C++ and Objective-C++.
88         * cp-lang.h: Removed LANG_HOOKS_DECL_PRINTABLE_NAME.
89
90         * error.c (dump_decl): For Objective-C++, call
91         objc_maybe_printable_name here ...
92         * tree.c (cxx_printable_name_internal): ... instead of here.
93         
94 2010-10-23  Nicola Pero  <nicola.pero@meta-innovation.com>
95
96         * tree.c (cxx_printable_name_internal): In Objective-C++, call
97         objc_maybe_printable_name.
98
99 2010-10-22  Jason Merrill  <jason@redhat.com>
100
101         PR c++/46129
102         * pt.c (instantiate_class_template): Don't instantiate default
103         arguments.
104
105         PR c++/46103
106         * init.c (build_vec_init): Handle memberwise move.
107
108 2010-10-21  Paolo Carlini  <paolo.carlini@oracle.com>
109
110         PR c++/46117
111         * call.c (add_function_candidate): Don't use TREE_VALUE on null
112         parmnode.
113
114 2010-10-20  Nicola Pero  <nicola.pero@meta-innovation.com>
115
116         * parser.c (cp_parser_objc_method_type): Mark inline.  Return a
117         bool instead of calling objc_set_method_type.
118         (cp_parser_objc_method_signature): Updated calls to
119         cp_parser_objc_method_type and to objc_build_method_signature.
120         (cp_parser_objc_method_prototype_list): Updated calls to
121         objc_add_method_declaration.  Use token->type to determine if it
122         is a class method or not.
123         (cp_parser_objc_method_definition_list): Same change.
124
125 2010-10-20  Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
126
127         PR c++/46056
128         * parser.c (cp_convert_range_for): Call cp_finish_decl
129         instead of finish_expr_stmt.
130
131 2010-10-20  Nicola Pero  <nicola.pero@meta-innovation.com>
132
133         * cp-lang.c (finish_file): Removed.
134         * decl2.c (cp_write_global_declarations): Call
135         objc_write_global_declarations when compiling Objective-C++.
136
137 2010-10-19  Paolo Carlini  <paolo.carlini@oracle.com>
138
139         PR c++/46046
140         * pt.c (add_to_template_args): Check extra_args for error_mark_node.
141         (coerce_template_parms): Likewise for args.
142
143 2010-10-18  Nicola Pero  <nicola.pero@meta-innovation.com>
144
145         Implemented parsing @synthesize and @dynamic for Objective-C++.
146         * parser.c (cp_parser_objc_method_definition_list): Recognize
147         RID_AT_SYNTHESIZE and RID_AT_DYNAMIC.
148         (cp_parser_objc_at_dynamic_declaration): New.
149         (cp_parser_objc_at_synthesize_declaration): New.
150
151 2010-10-18  Nicola Pero  <nicola.pero@meta-innovation.com>
152
153         * parser.c (cp_parser_objc_identifier_list): Check the return
154         value of cp_parser_identifier and react if it is error_mark_node.
155
156 2010-10-18  Nicola Pero  <nicola.pero@meta-innovation.com>
157
158         Merge from apple/trunk branch on FSF servers.
159
160         2005-03-01 Fariborz Jahanian <fjahanian@apple.com>
161
162         Radar 4451818
163         * call.c (standard_conversion, implicit_conversion): Ignore
164         'volatile' attribute of artificially volatized type in objc when
165         evaluating various conversion weights.
166
167         2005-11-08  Fariborz Jahanian <fjahanian@apple.com>
168
169         Radar 4330422
170         * typeck.c (comp_ptr_ttypes_real): Remove the hack. un-volatize the
171         artiificially 'volatized' type before doing pointer comparison.
172
173 2010-10-18  Jakub Jelinek  <jakub@redhat.com>
174
175         PR c/46015
176         * semantics.c (finish_goto_stmt): Call mark_rvalue_use on computed
177         goto destination.
178
179 2010-10-17  Nicola Pero  <nicola.pero@meta-innovation.com>
180
181         Merge from apple/trunk branch on FSF servers.
182
183         2006-04-19 Fariborz Jahanian <fjahanian@apple.com>
184
185         Radar 4516785
186         * parser.c (cp_parser_simple_type_specifier): Don't lookup for
187         objc object types if type is scope qualified.
188
189 2010-10-17  Nicola Pero  <nicola.pero@meta-innovation.com>
190
191         Merge from apple/trunk branch on FSF servers.
192
193         2006-03-27 Fariborz Jahanian <fjahanian@apple.com>
194
195         Radar 4133425
196         * lex.c (unqualified_name_lookup_error): Issue diagnostic
197         for private 'ivar' access.
198
199 2010-10-17  Iain Sandoe  <iains@gcc.gnu.org>
200
201         * parser.c (cp_parser_objc_visibility_spec): Update to use visibility
202         enum, and handle @package.
203
204 2010-10-15  Jason Merrill  <jason@redhat.com>
205
206         PR c++/45983
207         * tree.c (cp_build_qualified_type_real): Don't reuse a variant
208         with a different typedef variant of the element type.
209
210 2010-10-14  Iain Sandoe  <iains@gcc.gnu.org>
211
212         merge from FSF apple 'trunk' branch.
213         2006 Fariborz Jahanian <fjahanian@apple.com>
214
215         Radars 4436866, 4505126, 4506903, 4517826
216         * typeck.c (finish_class_member_access_expr): Handle CLASS.property
217         syntax.
218         (cp_build_modify_expr): Likewise.
219         * parser.c (cp_parser_objc_method_prototype_list): Handle @property.
220         (cp_parser_objc_method_definition_list): Likewise.
221         (cp_parser_objc_property_decl): New.
222         (cp_parser_objc_property_attrlist): New.
223         (cp_parser_objc_at_property): New.
224
225 2010-10-14  Richard Guenther  <rguenther@suse.de>
226
227         PR lto/44561
228         * cp-tree.h (NULLPTR_TYPE_P): Adjust.
229         * decl.c (cxx_init_decl_processing): Build a NULLPTR_TYPE node,
230         use build_int_cst.
231         * error.c (dump_type): Handle NULLPTR_TYPE.
232         (dump_type_prefix): Likewise.
233         (dump_type_suffix): Likewise.
234         * mangle.c (write_type): Likewise.
235         * name-lookup.c (arg_assoc_type): Likewise.
236         * rtti.c (typeinfo_in_lib_p): Likewise.
237         * pt.c (tsubst): Likewise.
238
239 2010-10-13  Jason Merrill  <jason@redhat.com>
240
241         PR c++/45984
242         * class.c (fixup_attribute_variants): New fn.
243         * cp-tree.h: Declare it.
244         * pt.c (instantiate_class_template): Call it.
245         * semantics.c (begin_class_definition): Call it.
246
247 2010-10-13  Richard Henderson  <rth@redhat.com>
248
249         * cp-lang.c (cp_eh_personality): Update call to
250         build_personality_function.
251         * except.c (choose_personality_routine): Update function comment.
252
253 2010-10-13  Richard Guenther  <rguenther@suse.de>
254
255         * tree.c (cp_free_lang_data): Free DECL_NAMESPACE_USERS and
256         clear DECL_CHAIN of NAMESPACE_DECLs.
257
258 2010-10-11  Martin Jambor  <mjambor@suse.cz>
259
260         PR c++/45562
261         * cp-tree.h (current_class_ref): Check that cp_function_chain is
262         non-NULL.
263         * call.c (build_cxx_call): Likewise.
264
265 2010-10-10  Jason Merrill  <jason@redhat.com>
266
267         * pt.c (tsubst_default_argument): Handle DEFAULT_ARG.
268         (tsubst_default_arguments): Only do this once for cloned fns.
269         (tsubst): Use typedef_variant_p.  Handle LANG_TYPE.  Don't
270         handle expressions.
271         (tsubst_expr): Avoid calling tsubst_expr for non-expressions.
272         (tsubst_copy_and_build): Likewise.
273         (tsubst_initializer_list): Likewise.
274         (tsubst_copy): Change default to gcc_unreachable.  Handle
275         OVERLOAD and PTRMEM_CST.
276
277 2010-10-10  Jason Merrill  <jason@redhat.com>
278
279         PR lto/45959
280         PR lto/45960
281         * pt.c (tsubst_copy) [INTEGER_CST]: Instantiate the type.
282
283 2010-10-07  Andi Kleen  <ak@linux.intel.com>
284
285         * Make-lang.in (c++_OBJS): Remove dummy-checksum.o.
286         (cc1plus-dummy): Remove.
287         (cc1plus-checksum): Change to run checksum over object files
288         and options only.
289
290 2010-10-08  Joseph Myers  <joseph@codesourcery.com>
291
292         * cp-objcp-common.h (LANG_HOOKS_INIT_OPTIONS_STRUCT): Define.
293
294 2010-10-07  Nicola Pero  <nicola.pero@meta-innovation.com>
295
296         * cp-tree.def: Changed type of AT_ENCODE_EXPR from tcc_unary to
297         tcc_expression.
298         * cxx-pretty-print.c (pp_cxx_unary_expression): Added case for
299         AT_ENCODE_EXPR.
300         * error.c (dump_expr): Added case for AT_ENCODE_EXPR.
301         * pt.c (tsubst_copy): Added case for AT_ENCODE_EXPR.
302         (value_dependent_expression_p): Added case for AT_ENCODE_EXPR.
303         (type_dependent_expression_p): Added case for AT_ENCODE_EXPR.
304         * parser.c (cp_parser_objc_encode_expression): Updated comment.
305
306 2010-10-07  Nicola Pero  <nicola@nicola.brainstorm.co.uk>
307
308         Merge from apple/trunk branch on FSF servers.
309
310         2006-04-26  Fariborz Jahanian <fjahanian@apple.com>
311
312         Radar 4508851
313         * parser.c (cp_parser_objc_interstitial_code): Recognize
314         and parse RID_NAMESPACE keyword.
315
316 2010-10-07  Iain Sandoe  <iains@gcc.gnu.org>
317
318         * parser.c (cp_parser_objc_method_tail_params_opt): Peek new token after
319         finding ellipsis, before checking for attributes.
320
321 2010-10-06  Nicola Pero  <nicola.pero@meta-innovation.com>
322
323         Merge from apple/trunk branch on FSF servers.
324         * cp-tree.def: Added AT_ENCODE_EXPR here instead of to the no
325         longer existing gcc/c-common.def.
326
327         2005-12-14  Fariborz Jahanian <fjahanian@apple.com>
328
329         Radar 4278774
330         * pt.c (tsubst_copy_and_build): Instantiate @endcode(T).
331         * parser.c (cp_parser_objc_encode_expression): Build a templatized
332         parse tree for @encode(T).
333
334         2005-12-14  Fariborz Jahanian <fjahanian@apple.com>
335
336         Radar 4278774
337         * c-common.def: Add new expression code AT_ENCODE_EXPR.
338
339 2010-10-06  Eric Botcazou  <ebotcazou@adacore.com>
340
341         PR c++/45908
342         * typeck.c (cp_build_addr_expr_1): Add check for incomplete types in
343         code folding offsetof-like computations.
344
345 2010-10-05  Nicola Pero  <nicola.pero@meta-innovation.com>
346
347         PR objc++/31125
348         * parser.c (cp_parser_objc_class_interface): If no identifier
349         follows an @interface token, stop parsing the interface after
350         printing an error.
351         (cp_parser_objc_class_implementation): If no identifier follows an
352         @implementation token, stop parsing the implementation after
353         printing an error.
354
355 2010-10-05  Nicola Pero  <nicola.pero@meta-innovation.com>
356
357         PR objc++/23707
358         * parser.c (cp_parser_objc_method_keyword_params): If the required
359         colon is not found while parsing parameters, stop parsing them.
360
361 2010-10-05  Nicola Pero  <nicola.pero@meta-innovation.com>
362
363         PR objc++/31126
364         * parser.c (cp_parser_objc_class_ivars): Do not eat the EOF or
365         @end after detecting it.  Print an error if @end is found without
366         a '}'.
367         (cp_parser_objc_method_prototype_list): Do not eat the EOF after
368         detecting it.  Fixed reading the next token when continuing
369         because of an error in a method signature.  Print an error if EOF
370         is found without an '@end'.
371         (cp_parser_objc_method_definition_list): Same change.
372
373 2010-10-05  Nicola Pero  <nicola.pero@meta-innovation.com>
374
375         Merge from apple/trunk branch on FSF servers:
376
377         2005-10-17  Fariborz Jahanian <fjahanian@apple.com>
378
379         Radar 4290840
380         * parser.c (cp_parser_objc_method_keyword_params): Check for valid
381         method parameters and issue error.
382         (cp_parser_objc_method_definition_list): Check for invalid tokens
383         which cannot start a function definition.
384
385         2005-10-14  Fariborz Jahanian <fjahanian@apple.com>
386
387         Radar 4294425
388         * parser.c (cp_parser_objc_message_args): Check for missing message
389         arguments and syntax error.
390
391         2005-10-13  Fariborz Jahanian <fjahanian@apple.com>
392
393         Radar 4261146
394         * parser.c (cp_parser_objc_class_ivars): Check for @end/eof while
395         looking for '}'.
396
397         2005-08-15  Ziemowit Laski  <zlaski@apple.com>
398
399         Radar 4093475
400         * parser.c (cp_parser_objc_interstitial_code): Catch stray
401         '{' and '}' tokens and issue appropriate errors.
402
403         2005-08-02  Ziemowit Laski  <zlaski@apple.com>
404
405         Radar 4185810
406         (cp_parser_statement_seq_opt): In addition to '}' and
407         end-of-file, a statement sequence may also be terminated
408         by a stray '@end'.
409
410 2010-10-05  Joseph Myers  <joseph@codesourcery.com>
411
412         * cp-tree.h (cxx_print_error_function,
413         cxx_initialize_diagnostics): Declare using diagnostic_context
414         typedef.
415
416 2010-10-04  Andi Kleen <ak@linux.intel.com>
417
418         * Make-lang.in (g++, cc1plus): Add + to build rule.
419
420 2010-10-04  Jason Merrill  <jason@redhat.com>
421
422         * tree.c (decl_storage_duration): New.
423         * cp-tree.h: Declare it.
424         (duration_kind): Return values.
425
426 2010-10-03  Jason Merrill  <jason@redhat.com>
427
428         * typeck.c (require_complete_type_sfinae): Add complain parm to...
429         (require_complete_type): ...this function.
430         (cp_build_array_ref, convert_arguments): Use it.
431         (convert_for_initialization, cp_build_modify_expr): Likewise.
432         * cp-tree.h: Declare it.
433         * call.c (build_over_call): Use it.
434
435 2010-09-30  Iain Sandoe  <iains@gcc.gnu.org>
436
437         merge from FSF 'apple/trunk' branch.
438         2006-01-30  Fariborz Jahanian <fjahanian@apple.com>
439
440         Radar 4386773
441         * cp/parser.c (cp_parser_objc_interstitial_code): For
442         @optional/@required set the optional/required flag.
443
444 2010-09-30  Nicola Pero  <nicola.pero@meta-innovation.com>
445
446         * parser.c (cp_lexer_get_preprocessor_token): Tidied up comments
447         and indentation when finding an Objective-C++ CPP_AT_NAME token.
448
449 2010-09-29  Richard Guenther  <rguenther@suse.de>
450
451         * cp-tree.h (CP_DECL_CONTEXT): Check DECL_FILE_SCOPE_P.
452         (CP_TYPE_CONTEXT): Similar.
453         (FROB_CONTEXT): Frob global_namespace to the global
454         TRANSLATION_UNIT_DECL.
455         * decl.c (cxx_init_decl_processing): Build a TRANSLATION_UNIT_DECL,
456         set DECL_CONTEXT of global_namespace to it.
457         (start_decl): Use CP_DECL_CONTEXT and test TYPE_P
458         instead of zeroing context.
459         (cp_finish_decl): Use DECL_FILE_SCOPE_P.
460         (grokfndecl): Likewise.
461         (start_preparsed_function): Likewise.
462         * name-lookup.c (maybe_push_decl): Use DECL_NAMESPACE_SCOPE_P.
463         (namespace_binding): Use SCOPE_FILE_SCOPE_P.
464         * pt.c (template_class_depth): Use CP_TYPE_CONTEXT.
465         (is_specialization_of_friend): Use CP_DECL_CONTEXT.
466         (push_template_decl_real): Likewise.
467         (tsubst_friend_class): Likewise.  Adjust context comparisons.
468         (instantiate_class_template): Use CP_TYPE_CONTEXT.
469         (tsubst): Do not substitute into TRANSLATION_UNIT_DECL.
470         * cxx-pretty-print.c (pp_cxx_nested_name_specifier): Use
471         SCOPE_FILE_SCOPE_P.
472
473 2010-09-29  Yao Qi  <yao@codesourcery.com>
474
475         * decl.c (get_atexit_node): Fix typo.
476
477 2010-09-28  Jason Merrill  <jason@redhat.com>
478
479         * tree.c (lvalue_kind): Rename from lvalue_p_1, make nonstatic.
480         (real_lvalue_p): Take const_tree.
481         * cp-tree.h: Adjust.
482         * typeck.c (lvalue_or_else): Make temporary arg a permerror.
483         (cp_build_addr_expr_1): Likewise.
484
485 2010-09-28  Iain Sandoe  <iains@gcc.gnu.org>
486
487         Partially merged from apple/trunk branch on FSF servers:
488         2006-04-26 Fariborz Jahanian <fjahanian@apple.com>
489         Radar 3803157 (method attributes)
490
491         * parser.c (cp_parser_objc_method_keyword_params): Handle attributes.
492         (cp_parser_objc_method_tail_params_opt): Likewise.
493         (cp_parser_objc_method_signature): Likewise.
494         (cp_parser_objc_method_maybe_bad_prefix_attributes): New.
495         (cp_parser_objc_method_prototype_list): Handle attributes.
496         (cp_parser_objc_method_definition_list): Likewise.
497
498 2010-09-28  Richard Henderson  <rth@redhat.com>
499
500         * cp-lang.c: Include "target.h".
501         (cp_eh_personality): Use targetm.except_unwind_info.
502         * Make-lang.in (cp-lang.o): Update deps.
503
504 2010-09-28  Iain Sandoe  <iains@gcc.gnu.org>
505
506         * parser.c (cp_parser_objc_valid_prefix_attributes): New.
507         (cp_parser_declaration): Parse prefix attributes for ObjC++.
508         (cp_parser_objc_protocol_declaration): Handle attributes.
509         (cp_parser_objc_class_interface): Likewise.
510         (cp_parser_objc_declaration): Likewise.
511
512 2010-09-27  Jason Merrill  <jason@redhat.com>
513
514         Require lvalues as specified by the standard.
515         * typeck.c (lvalue_or_else): Use real_lvalue_p.
516         (cp_build_addr_expr_1): Split out of cp_build_unary_op.
517         (cp_build_addr_expr, cp_build_addr_expr_strict): Interfaces.
518         (decay_conversion, get_member_function_from_ptrfunc): Adjust.
519         (build_x_unary_op, build_reinterpret_cast_1): Adjust.
520         (build_const_cast_1): Adjust.
521         * cp-tree.h: Declare new fns.
522         * call.c (build_this, convert_like_real, build_over_call): Adjust.
523         (initialize_reference): Adjust.
524         * class.c (build_base_path, convert_to_base_statically): Adjust.
525         (build_vfn_ref, resolve_address_of_overloaded_function): Adjust.
526         * cvt.c (build_up_reference, convert_to_reference): Adjust.
527         * decl.c (register_dtor_fn): Adjust.
528         * decl2.c (build_offset_ref_call_from_tree): Adjust.
529         * except.c (initialize_handler_parm): Adjust.
530         * init.c (build_offset_ref, build_delete, build_vec_delete): Adjust.
531         * rtti.c (build_dynamic_cast_1, tinfo_base_init): Adjust.
532         * tree.c (stabilize_expr): Adjust.
533
534 2010-09-27  Nicola Pero  <nicola.pero@meta-innovation.com>
535
536         Merge from apple/trunk branch on FSF servers:
537
538         2005-12-15  Fariborz Jahanian <fjahanian@apple.com>
539
540         Radar 4229905
541         * typeck.c (composite_pointer_type): Call objc_have_common_type
542         when comparing two objective-c pointer types.
543
544         2005-07-18  Ziemowit Laski  <zlaski@apple.com>
545
546         Radar 4175534
547         * call.c (standard_conversion): Do not issue warnings when
548         comparing ObjC pointer types.
549
550         2005-06-22  Ziemowit Laski  <zlaski@apple.com>
551
552         Radar 4154928
553         * call.c (standard_conversion): Allow for a pointer conversion
554         between any two ObjC pointer types.
555         * typeck.c (composite_pointer_type): Determine common type
556         for two ObjC pointer types.
557
558 2010-09-24  Jan Hubicka  <jh@suse.cz>
559
560         * decl.c (finish_function): Use decl_replaceable_p
561         * method.c (make_alias_for_thunk): Update call of
562         cgraph_same_body_alias.
563
564 2010-09-24  Jason Merrill  <jason@redhat.com>
565
566         * decl.c (compute_array_index_type): Remember type dependence of
567         array bound.
568         * pt.c (dependent_type_p_r): Don't recompute it here.
569
570         * error.c (dump_expr) [CASE_CONVERT]: Print conversion between
571         reference and pointer to the same type as "*" or "&".
572
573 2010-09-24  Nicola Pero  <nicola.pero@meta-innovation.com>
574
575         * typeck.c (warn_args_num): Use warning 'too many arguments to
576         method [methodname]' for an Objective-C method instead of the less
577         satisfactory 'too many arguments to function' (with no method
578         name).
579
580 2010-09-21  Jason Merrill  <jason@redhat.com>
581
582         * mangle.c (write_expression) [SCOPE_REF]: Only do -fabi-version=1
583         special handling if we know the member.
584
585 2010-09-18  Jason Merrill  <jason@redhat.com>
586
587         * call.c (compare_ics): Do lvalue/rvalue reference binding
588         comparison for ck_list, too.
589
590 2010-09-15  Jason Merrill  <jason@redhat.com>
591
592         * semantics.c (finish_id_expression): Diagnose use of function
593         parms in evaluated context outside function body.
594
595         * decl2.c (grokbitfield): Diagnose non-integral width.
596
597         * call.c (convert_like_real): Use the underlying type of the
598         reference for the temporary.
599
600 2010-09-15  Jakub Jelinek  <jakub@redhat.com>
601
602         PR c++/45635
603         * class.c (build_vtbl_initializer): Use fn instead of init's operand
604         as first argument to FDESC_EXPR.
605
606 2010-09-15  Paolo Carlini  <paolo.carlini@oracle.com>
607
608         PR c++/45665
609         * decl.c (grokdeclarator): Check build_memfn_type return value
610         for error_mark_node.
611
612 2010-09-13  Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
613
614         * semantics.c (finish_for_stmt): Always test flag_new_for_scope.
615         (begin_range_for_stmt): Likewise.
616
617 2010-09-11  Rodrigo Rivas <rodrigorivascosta@gmail.com>
618
619         Implement range-based for-statements.
620         * cp-tree.def (RANGE_FOR_STMT): New.
621         * cp-tree.h (RANGE_FOR_DECL, RANGE_FOR_EXPR, RANGE_FOR_BODY): New.
622         (cp_convert_range_for): Declare.
623         * pt.c (tsubst_expr): Add RANGE_FOR_STMT.
624         (tsubst_copy_and_build): perform_koenig_lookup takes extra argument.
625         * semantics.c (begin_range_for_stmt): New.
626         (finish_range_for_decl): New.
627         (finish_for_stmt): Accept also RANGE_FOR_STMT.
628         (perform_koenig_lookup): Add extra argument include_std.
629         * parser.c (cp_parser_c_for): New with code from
630         cp_parser_iteration_statement().
631         (cp_parser_range_for): New.
632         (cp_convert_range_for): New.
633         (cp_parser_iteration_statement): Add range-for support.
634         (cp_parser_condition): Adjust comment.
635         (cp_parser_postfix_expression): perform_koenig_lookup takes extra
636         argument.
637         * dump.c (cp_dump_tree): Add RANGE_FOR_STMT.
638         * cxx-pretty-print.c: Likewise.
639         * lex.c (cxx_init): Likewise.
640         * name-lookup.c (lookup_function_nonclass): Add extra argument
641         include_std.
642         (lookup_arg_dependent): Likewise.
643         * name-lookup.h: Likewise.
644
645 2010-09-10  Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
646
647         PR c++/43824
648         * error.c (maybe_warn_cpp0x): Add new warning
649         CPP0X_INLINE_NAMESPACES.
650         * parser.c (cp_parser_namespace_definition): Likewise.
651         * cp-tree.h (cpp0x_warn_str): Likewise.
652
653 2010-09-10  Richard Guenther  <rguenther@suse.de>
654
655         * decl.c (reshape_init_vector): For VECTOR_TYPEs, use
656         TYPE_VECTOR_SUBPARTS instead of TYPE_DEBUG_REPRESENTATION_TYPE.
657
658 2010-09-10  Jan Hubicka  <jh@suse.cz>
659
660         PR tree-optimization/45605
661         * cp/class.c (build_vtbl_initializer): Avoid wrong type conversion in
662         ADDR_EXPR.
663
664 2010-09-08  Jakub Jelinek  <jakub@redhat.com>
665
666         PR c++/45588
667         * pt.c (tsubst) <case INTEGER_TYPE>: Call mark_rvalue_use
668         before calling fold_decl_constant_value.
669
670 2010-09-07  Arnaud Charlet  <charlet@adacore.com>
671
672         * cp-tree.h (build_enumerator): Add new location_t parameter.
673         (build_lang_decl_loc): New function.
674         * decl.c (build_enumerator): New parameter loc. Use it when calling
675         build_decl. Replace build_lang_decl with build_lang_decl_loc.
676         * pt.c (tsubst_enum): Adjust call to build_enumerator.
677         * parser.c (cp_parser_enumerator_definition): Ditto.
678         * lex.c (build_lang_decl_loc): New function.
679
680 2010-09-06  Dodji Seketeli  <dodji@redhat.com>
681
682         PR c++/45200
683         PR c++/45293
684         PR c++/45558
685         * tree.c (strip_typedefs): Strip typedefs from the context of
686         TYPENAME_TYPEs.
687
688 2010-09-06  Mark Mitchell  <mark@codesourcery.com>
689
690         * typeck.c (cp_build_binary_op): Call do_warn_double_promotion.
691         * call.c (build_conditional_expr): Likewise.
692         (convert_arg_to_ellipsis): Likewise.
693
694 2010-09-06  Arnaud Charlet  <charlet@adacore.com>
695
696         * parser.c (make_pointer_declarator, make_reference_declarator,
697         make_call_declarator, make_array_declarator): Set declarator->id_loc.
698         (cp_parser_init_declarator): Adjust location of decl if appropriate.
699
700 2010-09-06  Jason Merrill  <jason@redhat.com>
701
702         * call.c (implicit_conversion): Fix value-init of enums.
703         (convert_like_real): Likewise.
704
705         * decl.c (cp_finish_decl): Don't change init for auto deduction.
706
707         * pt.c (fold_non_dependent_expr_sfinae): Split out from...
708         (fold_non_dependent_expr): ...here.
709         (convert_nontype_argument): Use it.  Take complain parm.
710         Use perform_implicit_conversion instead of ocp_convert.
711         Allow cv-qual changes.
712         (convert_template_argument): Pass complain down.
713         (tsubst_template_arg): Suppress constant expression warnings.
714         Don't fold here.
715
716         * method.c (synthesized_method_walk): In constructors, also check
717         subobject destructors.
718
719         * semantics.c (finish_compound_literal): Always build a
720         TARGET_EXPR.
721
722 2010-08-30  Paolo Carlini  <paolo.carlini@oracle.com>
723
724         PR c++/45043
725         * decl.c (grokdeclarator): Use MAIN_NAME_P only on IDENTIFIER_NODEs.
726
727 2010-08-30  Jakub Jelinek  <jakub@redhat.com>
728
729         PR middle-end/45423
730         * parser.c (cp_parser_omp_atomic): Handle boolean
731         {PRE,POST}_INCREMENT.
732
733 2010-08-29  Jason Merrill  <jason@redhat.com>
734
735         PR c++/44991
736         * parser.c (cp_parser_parameter_declaration): Pop parameter decls
737         after tentative parsing.
738
739 2010-08-22  Joseph Myers  <joseph@codesourcery.com>
740
741         * Make-lang.in (g++spec.o): Update dependencies.
742         * g++spec.c: Include opts.h
743         (MATH_LIBRARY, LIBSTDCXX): Remove initial "-l".
744         (lang_specific_driver): Use cl_decoded_option structures.
745
746 2010-08-20  Nathan Froyd  <froydnj@codesourcery.com>
747
748         * call.c: Use FOR_EACH_VEC_ELT.
749         * class.c: Likewise.
750         * decl.c: Likewise.
751         * decl2.c: Likewise.
752         * error.c: Likewise.
753         * except.c: Likewise.
754         * mangle.c: Likewise.
755         * method.c: Likewise.
756         * name-lookup.c: Likewise.
757         * parser.c: Likewise.
758         * pt.c: Likewise.
759         * repo.c: Likewise.
760         * semantics.c: Likewise.
761         * typeck2.c: Likewise.
762
763 2010-08-19  Jason Merrill  <jason@redhat.com>
764
765         * call.c (reference_related_p): Check for error_mark_node.
766         (add_function_candidate): Check it instead of
767         same_type_ignoring_top_level_qualifiers_p.
768
769         PR c++/45315
770         * init.c (build_new_1): Don't use build_value_init in a template.
771         (build_value_init): Make sure we don't.
772
773         PR c++/45307
774         * cp-gimplify.c (cp_gimplify_expr): Also remove assignment
775         of empty class CONSTRUCTOR.
776
777         * except.c (pending_noexcept, pending_noexcept_checks): New.
778         (perform_deferred_noexcept_checks): New.
779         (maybe_noexcept_warning): Split from...
780         (finish_noexcept_expr): ...here.  Adjust.
781         * decl2.c (cp_write_global_declarations): Call
782         perform_deferred_noexcept_checks.
783         * cp-tree.h: And declare it.
784
785 2010-08-18  Nathan Froyd  <froydnj@codesourcery.com>
786
787         PR c++/45049
788         * name-lookup.c (push_overloaded_decl): Change DECL_CHAIN to
789         TREE_CHAIN.
790
791 2010-08-17  Kai Tietz  <kai.tietz@onevision.com>
792
793         * class.c (note_name_declared_in_class): Make in 'extern "C"' blocks,
794         or if -fms-extensions is enabled check, check permissive.
795
796 2010-08-09  Jason Merrill  <jason@redhat.com>
797
798         PR c++/45236
799         * pt.c (lookup_template_class): Don't re-coerce outer parms.
800
801 2010-08-09  Nathan Froyd  <froydnj@codesourcery.com>
802
803         * call.c (add_builtin_candidates): Use VECs for local variable
804         `types'.  Adjust remainder of function accordingly.
805
806 2010-08-09  Nathan Froyd  <froydnj@codesourcery.com>
807
808         * name-lookup.c (is_associated_namespace): Convert local variables
809         to be VECs instead of TREE_LISTs.
810
811 2010-08-09  Nathan Froyd  <froydnj@codesourcery.com>
812
813         * tree.c (varargs_function_p): Use stdarg_p.
814
815 2010-08-07  Nathan Froyd  <froydnj@codesourcery.com>
816
817         * parser.c (cp_default_arg_entry): Declare.  Declare a VEC of it.
818         (cp_unparsed_functions_entry): Declare.  Declare a VEC of it.
819         (cp_parser) [unparsed_functions_queues]: Rename to unparsed_queues.
820         Change type to a VEC.
821         (unparsed_funs_with_default_args): Define.
822         (unparsed_funs_with_definitions): Define.
823         (push_unparsed_function_queues): New function.
824         (cp_parser_new): Call it.
825         (pop_unparsed_function_queues): New function.
826         (cp_parser_class_specifier): Adjust processing of unparsed functions.
827         (cp_parser_template_declaration_after_export): Use VEC_safe_push.
828         (cp_parser_save_member_function_body): Likewise.
829         (cp_parser_late_parsing_for_member): Call push_unparsed_function_queues
830         and pop_unparsed_function_queues.
831         (cp_parser_late_parsing_default_args): Likewise.
832         (cp_parser_save_default_args): Use VEC_safe_push.
833
834 2010-08-07  Nathan Froyd  <froydnj@codesourcery.com>
835
836         * name-lookup.h (cp_label_binding): Declare.  Declare a VEC type
837         containing it.
838         (cp_binding_level): Convert shadowed_labels and dead_vars_from_for
839         fields to VECs.
840         * decl.c (poplevel): Adjust for type changes.
841         (declare_local_label): Likewise.
842
843 2010-08-06  Jason Merrill  <jason@redhat.com>
844
845         * typeck.c (complete_type_or_maybe_complain): Split out from...
846         (complete_type_or_else): Here.
847         (build_class_member_access_expr): Call it.
848         (finish_class_member_access_expr): Likewise.
849         * call.c (build_special_member_call): Likewise.
850         * cvt.c (build_expr_type_conversion): Likewise.
851         * init.c (build_new): Likewise.
852         * typeck2.c (build_functional_cast): Likewise.
853         * cp-tree.h: Declare it.
854
855         * init.c (build_value_init): Add complain parm.
856         (build_value_init_noctor): Likewise.
857         (perform_member_init): Pass it.
858         (expand_aggr_init_1): Likewise.
859         (build_new_1): Likewise.
860         (build_vec_init): Likewise.
861         * pt.c (tsubst_expr): Likewise.
862         * typeck2.c (build_functional_cast): Likewise.
863         * cp-tree.h: Adjust.
864         * tree.c (build_target_expr_with_type): Handle error_mark_node.
865
866         * typeck.c (decay_conversion): Any expression with type nullptr_t
867         decays to nullptr.
868
869 2010-07-30  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
870
871         PR c++/45112
872         * decl.c (duplicate_decls): Merge DECL_USER_ALIGN and DECL_PACKED.
873
874 2010-07-27  Jason Merrill  <jason@redhat.com>
875
876         * pt.c (tsubst_expr) [DECL_EXPR]: Handle getting an AGGR_INIT_EXPR
877         from build_value_init.
878         * init.c (build_value_init_noctor): Give error for unknown array
879         bound.
880
881 2010-07-27  Joseph Myers  <joseph@codesourcery.com>
882
883         * cp-objcp-common.h (LANG_HOOKS_MISSING_ARGUMENT): Remove.
884
885 2010-07-27  Joseph Myers  <joseph@codesourcery.com>
886
887         * cp-objcp-common.c (cxx_initialize_diagnostics): First call
888         c_common_initialize_diagnostics.
889         * cp-objcp-common.h (LANG_HOOKS_OPTION_LANG_MASK,
890         LANG_HOOKS_COMPLAIN_WRONG_LANG_P): Define.
891
892 2010-07-21  Jason Merrill  <jason@redhat.com>
893
894         * tree.c (cp_tree_equal): Fix CONSTRUCTOR handling.
895
896         * parser.c (cp_parser_init_declarator): Pass LOOKUP_NORMAL
897         to cp_finish_decl.
898
899 2010-07-20  Jeffrey Yasskin  <jyasskin@google.com>
900
901         PR c++/44641
902         * pt.c (instantiate_class_template): Propagate the template's
903         location to its instance.
904
905 2010-07-20  Jason Merrill  <jason@redhat.com>
906
907         PR c++/44967
908         * pt.c (tsubst_copy_and_build): Rework last change.
909
910         PR c++/44967
911         * pt.c (tsubst_copy_and_build): Handle partial substitution of
912         CALL_EXPR.
913
914 2010-07-19  Jason Merrill  <jason@redhat.com>
915
916         PR c++/44996
917         * semantics.c (finish_decltype_type): Correct decltype
918         of parenthesized rvalue reference variable.
919
920         PR c++/44969
921         * tree.c (cp_tree_equal): Compare type of *CAST_EXPR.
922         * pt.c (iterative_hash_template_arg): Hash type of *CAST_EXPR.
923
924 2010-07-19  Paolo Carlini  <paolo.carlini@oracle.com>
925
926         PR c++/44969
927         * typeck.c (build_x_compound_expr_from_list): Add tsubst_flags_t
928         parameter.
929         * cp-tree.h: Adjust declaration.
930         * init.c (perform_member_init): Adjust caller.
931         * decl.c (grok_reference_init, cp_finish_decl): Likewise.
932         * typeck2.c (store_init_value): Likewise.
933         (build_functional_cast): Pass complain argument to
934         build_x_compound_expr_from_list.
935
936 2010-07-16  Jason Merrill  <jason@redhat.com>
937
938         PR c++/32505
939         * pt.c (process_partial_specialization): Diagnose partial
940         specialization after instantiation.
941         (most_specialized_class): Add complain parm.
942
943         * ptree.c (cxx_print_xnode): Handle TEMPLATE_INFO.
944
945 2010-07-15  Nathan Froyd  <froydnj@codesourcery.com>
946
947         * init.c (build_new_1): Use cp_build_function_call_nary instead of
948         cp_build_function_call.
949
950 2010-07-15  Jason Merrill  <jason@redhat.com>
951
952         PR c++/44909
953         * call.c (add_function_candidate): If we're working on an implicit
954         declaration, don't consider candidates that won't match.
955         * typeck.c (same_type_ignoring_top_level_qualifiers_p): Now a fn.
956         * cp-tree.h (same_type_ignoring_top_level_qualifiers_p): Adjust.
957
958         Revert:
959         * cp-tree.h (struct lang_type_class): Add has_user_opeq.
960         (TYPE_HAS_USER_OPEQ): New.
961         * decl.c (grok_special_member_properties): Set it.
962         * class.c (add_implicitly_declared_members): Don't lazily declare
963         constructors/operator= if a base or member has a user-declared one.
964         (check_bases_and_members, check_bases): Adjust.
965         (check_field_decls, check_field_decl): Adjust.
966
967 2010-07-15  Anatoly Sokolov  <aesok@post.ru>
968
969         * decl.c (integer_three_node): Remove.
970         (cxx_init_decl_processing): Do not initialize the integer_three_node.
971         * cp-tree.h (integer_three_node): Remove.
972
973 2010-07-15  Nathan Froyd  <froydnj@codesourcery.com>
974
975         * cp-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN.
976         * call.c: Likewise.
977         * class.c: Likewise.
978         * cp-gimplify.c: Likewise.
979         * decl.c: Likewise.
980         * decl2.c: Likewise.
981         * init.c: Likewise.
982         * mangle.c: Likewise.
983         * name-lookup.c: Likewise.
984         * optimize.c: Likewise.
985         * parser.c: Likewise.
986         * pt.c: Likewise.
987         * rtti.c: Likewise.
988         * search.c: Likewise.
989         * semantics.c: Likewise.
990         * typeck.c: Likewise.
991         * typeck2.c: Likewise.
992
993 2010-07-14  Jason Merrill  <jason@redhat.com>
994
995         * init.c (sort_mem_initializers): Rename "field_type" to "ctx".
996         (build_field_list): Cache field type.
997
998         Implement C++0x unrestricted unions (N2544)
999         * class.c (check_field_decl): Loosen union handling in C++0x.
1000         * method.c (walk_field_subobs): Split out from...
1001         (synthesized_method_walk): ...here.  Set msg before loops.
1002         (process_subob_fn): Check for triviality in union members.
1003         * init.c (sort_mem_initializers): Splice out uninitialized
1004         anonymous unions and union members.
1005         (push_base_cleanups): Don't automatically destroy anonymous unions
1006         and union members.
1007
1008 2010-07-13  Jason Merrill  <jason@redhat.com>
1009
1010         PR c++/44909
1011         * cp-tree.h (struct lang_type_class): Add has_user_opeq.
1012         (TYPE_HAS_USER_OPEQ): New.
1013         * decl.c (grok_special_member_properties): Set it.
1014         * class.c (add_implicitly_declared_members): Don't lazily declare
1015         constructors/operator= if a base or member has a user-declared one.
1016         (check_bases_and_members, check_bases): Adjust.
1017         (check_field_decls, check_field_decl): Adjust.
1018         * method.c (synthesized_method_walk): Initialize check_vdtor.
1019
1020         PR c++/44540
1021         * mangle.c (write_type): Canonicalize.
1022         (canonicalize_for_substitution): Retain cv-quals on FUNCTION_TYPE.
1023         (write_CV_qualifiers_for_type): Ignore them in abi>=5.
1024
1025 2010-07-13  Paolo Carlini  <paolo.carlini@oracle.com>
1026
1027         PR c++/44908
1028         * call.c (convert_like_real): Adjust convert_ptrmem call, pass
1029         complain argument.
1030         * typeck.c (get_delta_difference): Update prototype, add a
1031         tsubst_flags_t parameter; update get_delta_difference_1 calls and
1032         add checks for error_mark_node.
1033         (get_delta_difference_1): Update prototype, add a tsubst_flags_t
1034         parameter; update lookup_base call.
1035         (build_ptrmemfunc): Update prototype, add a tsubst_flags_t
1036         parameter; update get_delta_difference call and add check for
1037         error_mark_node.
1038         (convert_ptrmem): Update prototype, add a tsubst_flags_t
1039         parameter; update get_delta_difference call and add check for
1040         error_mark_node;  update build_ptrmemfunc call.
1041         (build_static_cast_1): Adjust convert_ptrmem call.
1042         (expand_ptrmemfunc_cst): Adjust get_delta_difference call.
1043         (cp_build_unary_op): Adjust build_ptrmemfunc call.
1044         * cvt.c (cp_convert_to_pointer, convert_force): Adjust convert_ptrmem
1045         and build_ptrmemfunc calls.
1046         * cp-tree.h: Update build_ptrmemfunc and convert_ptrmem prototypes.
1047
1048 2010-07-12  Paolo Carlini  <paolo.carlini@oracle.com>
1049
1050         PR c++/44907
1051         * call.c (build_temp): Add tsubst_flags_t complain parameter;
1052         adjust build_special_member_call call, pass complain.
1053         (convert_like_real): Adjust build_temp call, pass complain.
1054
1055 2010-07-09  Jason Merrill  <jason@redhat.com>
1056
1057         PR c++/43120
1058         * cp-tree.h (BV_LOST_PRIMARY): New macro.
1059         * class.c (update_vtable_entry_for_fn): Fix covariant thunk logic.
1060         Set BV_LOST_PRIMARY.
1061         (build_vtbl_initializer): Check BV_LOST_PRIMARY.
1062
1063 2010-07-08  Jason Merrill  <jason@redhat.com>
1064
1065         PR c++/43120
1066         * class.c (update_vtable_entry_for_fn): Fix handling of dummy
1067         virtual bases for covariant thunks.
1068
1069 2010-07-08  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1070
1071         * cp-tree.h: Do not include toplev.h.
1072
1073 2010-07-06  Jason Merrill  <jason@redhat.com>
1074
1075         PR c++/44703
1076         * call.c (is_std_init_list): Look through typedefs.
1077
1078         PR c++/44778
1079         * init.c (build_offset_ref): If scope isn't dependent,
1080         don't exit early.  Look at TYPE_MAIN_VARIANT.
1081         * pt.c (tsubst_copy) [OFFSET_REF]: Do substitution.
1082
1083         * error.c (dump_function_decl): Don't crash on null DECL_NAME.
1084
1085 2010-07-06  Shujing Zhao  <pearly.zhao@oracle.com>
1086
1087         * cp-tree.h (impl_conv_void): New type.
1088         (convert_to_void): Adjust prototype.
1089         * cvt.c (convert_to_void): Use impl_conv_void, emit and adjust the
1090         diagnostic for easy translation. Change caller.
1091         * typeck.c: Update call to convert_to_void.
1092         * semantics.c: Likewise.
1093         * init.c: Likewise.
1094
1095 2010-07-05  Nathan Froyd  <froydnj@codesourcery.com>
1096
1097         * decl.c (cp_finish_decl): Call add_local_decl.
1098         * optimize.c (clone_body): Adjust for new type of cfun->local_decls.
1099
1100 2010-07-05  Paolo Carlini  <paolo.carlini@oracle.com>
1101
1102         * pt.c (tsubst): Early declare code = TREE_CODE (t) and use it
1103         throughout.
1104
1105 2010-07-05  Shujing Zhao  <pearly.zhao@oracle.com>
1106
1107         PR c++/22138
1108         * parser.c (cp_parser_primary_expression): Error if local template is
1109         declared.
1110
1111 2010-07-02  Le-Chun Wu  <lcwu@google.com>
1112
1113         PR/44128
1114         * name-lookup.c (pushdecl_maybe_friend): Warn when a local decl
1115         (variable or type) shadows another type.
1116
1117 2010-07-02  Jakub Jelinek  <jakub@redhat.com>
1118
1119         PR c++/44780
1120         * typeck.c (convert_for_assignment): When converting a convertible
1121         vector type or objc++ types, call mark_rvalue_use.
1122         * typeck2.c (build_m_component_ref): Use return values from
1123         mark_rvalue_use or mark_lvalue_use.
1124         * class.c (build_base_path): Likewise.
1125         * call.c (build_conditional_expr): Likewise.
1126
1127 2010-07-02  Paolo Carlini  <paolo.carlini@oracle.com>
1128
1129         PR c++/44039
1130         * pt.c (tsubst_baselink): Return error_mark_node if lookup_fnfields
1131         returns NULL_TREE.
1132
1133 2010-07-01  Richard Guenther  <rguenther@suse.de>
1134
1135         * cp-gimplify.c (cp_gimplify_expr): Open-code the rhs
1136         predicate we are looking for, allow non-gimplified
1137         INDIRECT_REFs.
1138
1139 2010-06-30  Paolo Carlini  <paolo.carlini@oracle.com>
1140
1141         PR c++/44628
1142         * typeck.c (cp_build_unary_op): Early return error_mark_node when
1143         arg is NULL_TREE too.
1144         * call.c (convert_class_to_reference): Return error_mark_node when
1145         expr is NULL_TREE.
1146
1147 2010-06-30  Michael Matz  <matz@suse.de>
1148
1149         * repo.c (finish_repo): Fix typo.
1150
1151 2010-06-30  Nathan Froyd  <froydnj@codesourcery.com>
1152
1153         * parser.c (cp_parser_omp_for_loop): Use a VEC for for_block.
1154
1155 2010-06-30  Nathan Froyd  <froydnj@codesourcery.com>
1156
1157         * repo.c (pending_repo): Change type to a VEC.
1158         (finish_repo): Adjust for new type of pending_repo.
1159         (repo_emit_p): Likewise.
1160
1161 2010-06-30  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1162
1163         * tree.c: Include gimple.h. Do not include tree-flow.h
1164         * decl.c: Do not include tree-flow.h
1165         * Make-lang.in: Adjust dependencies.
1166
1167 2010-06-29  Nathan Froyd  <froydnj@codesourcery.com>
1168
1169         * decl.c (incomplete_var): Declare.  Declare VECs containing them.
1170         (incomplete_vars): Adjust comment.  Change type to a VEC.
1171         (maybe_register_incomplete_var): Adjust for new type.
1172         (complete_vars): Adjust iteration over incomplete_vars.
1173
1174 2010-06-29  Nathan Froyd  <froydnj@codesourcery.com>
1175
1176         * decl.c (struct named_label_entry): Change type of bad_decls field
1177         to a VEC.
1178         (poplevel_named_label_1): Adjust for new type of bad_decls.
1179         (check_goto): Likewise.
1180
1181 2010-06-29  Jason Merrill  <jason@redhat.com>
1182
1183         Enable implicitly declared move constructor/operator= (N3053).
1184         * class.c (add_implicitly_declared_members): A class with no
1185         explicitly declared copy or move constructor gets both declared
1186         implicitly, and similarly for operator=.
1187         (check_bases): A type with no copy ctor does not inhibit
1188         a const copy ctor in a derived class.  It does mean the derived
1189         one is non-trivial.
1190         (check_field_decl): Likewise.
1191         (check_bases_and_members): A nonexistent copy ctor/op= is non-trivial.
1192         * tree.c (type_has_nontrivial_copy_init): Adjust semantics.
1193         (trivially_copyable_p): Likewise.
1194         * call.c (convert_like_real): Use type_has_nontrivial_copy_init.
1195         * class.c (finish_struct_bits): Likewise.
1196         * tree.c (build_target_expr_with_type): Likewise.
1197         * typeck2.c (store_init_value): Likewise.
1198
1199         Enable implicitly deleted functions (N2346)
1200         * class.c (check_bases_and_members): Adjust lambda flags.
1201         * method.c (implicitly_declare_fn): Set DECL_DELETED_FN if appropriate.
1202
1203         * decl2.c (mark_used): Adjust error for use of deleted function.
1204
1205         Machinery to support implicit delete/move.
1206         * cp-tree.h: (struct lang_type_class): Add lazy_move_assign,
1207         has_complex_move_ctor, has_complex_move_assign bitfields.
1208         (CLASSTYPE_LAZY_MOVE_ASSIGN): New.
1209         (TYPE_HAS_COMPLEX_MOVE_ASSIGN): New.
1210         (TYPE_HAS_COMPLEX_MOVE_CTOR): New.
1211         (enum special_function_kind): Add sfk_move_assignment.
1212         (LOOKUP_SPECULATIVE): New.
1213         * call.c (build_over_call): Return early if it's set.
1214         (build_over_call): Use trivial_fn_p.
1215         * class.c (check_bases): If the base has no default constructor,
1216         the derived one is non-trivial.  Handle move ctor/op=.
1217         (check_field_decl): Likewise.
1218         (check_bases_and_members): Handle move ctor/op=.
1219         (add_implicitly_declared_members): Handle CLASSTYPE_LAZY_MOVE_ASSIGN.
1220         (type_has_move_constructor, type_has_move_assign): New.
1221         * decl.c (grok_special_member_properties): Handle move ctor/op=.
1222         * method.c (type_has_trivial_fn, type_set_nontrivial_flag): New.
1223         (trivial_fn_p): New.
1224         (do_build_copy_constructor): Use it.
1225         (do_build_assign_ref): Likewise.  Handle move assignment.
1226         (build_stub_type, build_stub_object, locate_fn_flags): New.
1227         (locate_ctor): Use locate_fn_flags.
1228         (locate_copy, locate_dtor): Remove.
1229         (get_dtor, get_default_ctor, get_copy_ctor, get_copy_assign): New.
1230         (process_subob_fn, synthesized_method_walk): New.
1231         (maybe_explain_implicit_delete): New.
1232         (implicitly_declare_fn): Use synthesized_method_walk,
1233         type_has_trivial_fn, and type_set_nontrivial_flag.
1234         (defaulted_late_check): Set DECL_DELETED_FN.
1235         (defaultable_fn_check): Handle sfk_move_assignment.
1236         (lazily_declare_fn): Clear CLASSTYPE_LAZY_* early.  Don't declare
1237         implicitly deleted move ctor/op=.
1238         * search.c (lookup_fnfields_1): Handle sfk_move_assignment.
1239         (lookup_fnfields_slot): New.
1240         * semantics.c (omp_clause_info_fndecl): Remove.
1241         (cxx_omp_create_clause_info): Use get_default_ctor, get_copy_ctor,
1242         get_copy_assign, trivial_fn_p.
1243         (trait_expr_value): Adjust call to locate_ctor.
1244         * tree.c (special_function_p): Handle sfk_move_assignment.
1245
1246         * class.c (type_has_virtual_destructor): New.
1247         * cp-tree.h: Declare it.
1248         * semantics.c (trait_expr_value): Use it.
1249
1250         * call.c (build_over_call): Only give warnings with tf_warning.
1251
1252         * name-lookup.c (pop_scope): Handle NULL_TREE.
1253
1254         * cp-tree.h (TYPE_HAS_ASSIGN_REF): Rename to TYPE_HAS_COPY_ASSIGN.
1255         (TYPE_HAS_CONST_ASSIGN_REF): Rename to TYPE_HAS_CONST_COPY_ASSIGN.
1256         (TYPE_HAS_INIT_REF): Rename to TYPE_HAS_COPY_CTOR.
1257         (TYPE_HAS_CONST_INIT_REF): Rename to TYPE_HAS_CONST_COPY_CTOR.
1258         (TYPE_HAS_COMPLEX_ASSIGN_REF): Rename to TYPE_HAS_COMPLEX_COPY_ASSIGN.
1259         (TYPE_HAS_COMPLEX_INIT_REF): Rename to TYPE_HAS_COMPLEX_COPY_CTOR.
1260         (TYPE_HAS_TRIVIAL_ASSIGN_REF): Rename to TYPE_HAS_TRIVIAL_COPY_ASSIGN.
1261         (TYPE_HAS_TRIVIAL_INIT_REF): Rename to TYPE_HAS_TRIVIAL_COPY_CTOR.
1262         (CLASSTYPE_LAZY_ASSIGNMENT_OP): Rename to CLASSTYPE_LAZY_COPY_ASSIGN.
1263         (sfk_assignment_operator): Rename to sfk_copy_assignment.
1264         * decl.c, call.c, class.c, init.c, method.c, pt.c, ptree.c: Adjust.
1265         * search.c, semantics.c, tree.c: Adjust.
1266
1267         * pt.c (dependent_scope_ref_p): Remove.
1268         (value_dependent_expression_p): Don't call it.
1269         (type_dependent_expression_p): Here either.
1270         * init.c (build_offset_ref): Set TREE_TYPE on a qualified-id
1271         if the scope isn't dependent.
1272
1273         * pt.c (convert_nontype_argument): Use mark_lvalue_use if we want
1274         a reference.
1275
1276         PR c++/44587
1277         * pt.c (has_value_dependent_address): New.
1278         (value_dependent_expression_p): Check it.
1279         (convert_nontype_argument): Likewise.  Call decay_conversion before
1280         folding if we want a pointer.
1281         * semantics.c (finish_id_expression): Don't add SCOPE_REF if the
1282         scope is the current instantiation.
1283
1284 2010-06-28  Jakub Jelinek  <jakub@redhat.com>
1285
1286         PR c++/44682
1287         * class.c (build_base_path): If want_pointer, call mark_rvalue_use
1288         on expr.
1289
1290 2010-06-28  Steven Bosscher  <steven@gcc.gnu.org>
1291
1292         * init.c: Do not include except.h.
1293         * decl.c: Likewise.
1294         * expr.c: Likewise.
1295         * cp-lang.c: Likewise.
1296         * pt.c: Likewise.
1297         * semantics.c: Likewise.
1298         * decl2.c: Likewise.
1299         * except.c: Likewise.
1300         (init_exception_processing): Do not set the removed
1301         lang_protect_cleanup_actions here.
1302         (cp_protect_cleanup_actions): Make non-static and remove prototype.
1303         (doing_eh): New, moved from except.c but removed the do_warning flag.
1304         (expand_start_catch_block): Update doing_eh call.
1305         (expand_end_catch_block): Likewise.
1306         (build_throw): Likewise.
1307         * cp-tree.h: Prototype cp_protect_cleanup_actions.
1308         * cp-objcp-common.h: Set LANG_HOOKS_EH_PROTECT_CLEANUP_ACTIONS to
1309         cp_protect_cleanup_actions.
1310         * Make-lang.in: Update dependencies.
1311
1312 2010-06-26  Jason Merrill  <jason@redhat.com>
1313
1314         * call.c (add_function_candidate): Set LOOKUP_COPY_PARM for any
1315         constructor called with a single argument that takes a reference
1316         to the constructor's class.
1317         (BAD_CONVERSION_RANK): New.
1318         (compare_ics): Use it to compare bad ICSes.
1319
1320 2010-06-25  Joseph Myers  <joseph@codesourcery.com>
1321
1322         * lang-specs.h: Remove +e handling.
1323
1324 2010-06-24  Andi Kleen  <ak@linux.intel.com>
1325
1326         * parser.c: (cp_parser_question_colon_clause):
1327         Switch to use cp_lexer_peek_token.
1328         Call warn_for_omitted_condop. Call pedwarn for omitted
1329         middle operand.
1330
1331 2010-06-22  Jakub Jelinek  <jakub@redhat.com>
1332
1333         PR c++/44619
1334         * typeck2.c (build_m_component_ref): Call mark_lvalue_use on
1335         datum and mark_rvalue_use on component.
1336
1337         PR c++/44627
1338         * error.c (dump_expr): Don't look at CALL_EXPR_ARG (t, 0) if
1339         the CALL_EXPR has no arguments.
1340
1341 2010-06-21  Jason Merrill  <jason@redhat.com>
1342
1343         * typeck.c (comp_except_specs): Fix ce_derived with noexcept.
1344
1345         * semantics.c (check_trait_type): Check COMPLETE_TYPE_P for array
1346         element type.
1347
1348 2010-06-17  Nathan Froyd  <froydnj@codesourcery.com>
1349
1350         * name-lookup.c (struct arg_lookup): Convert namespaces and
1351         classes fields to VEC.
1352         (arg_assoc_namespace): Adjust for new type of namespaces.
1353         (arg_assoc_class): Adjust for new type of classes.
1354         (lookup_arg_dependent): Use make_tree_vector and
1355         release_tree_vector.
1356         * typeck2.c (build_x_arrow): Use vec_member.
1357
1358 2010-06-17  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1359
1360         PR c++/44486
1361         * error.c (dump_decl): Better wording for anonymous namespace.
1362
1363 2010-06-16  Nathan Froyd  <froydnj@codesourcery.com>
1364
1365         * class.c (build_vtbl_initializer): Adjust computation of new_position
1366         and which entry to add padding for.
1367
1368 2010-06-16  Jason Merrill  <jason@redhat.com>
1369
1370         * except.c (check_noexcept_r): Return the problematic function.
1371         (finish_noexcept_expr): Give -Wnoexcept warning.  Add complain parm.
1372         * pt.c (tsubst_copy_and_build): Pass it.
1373         * parser.c (cp_parser_unary_expression): Likewise.
1374         * cp-tree.h: Adjust prototype.
1375
1376         * method.c (defaulted_late_check): Give the defaulted method
1377         the same exception specification as the implicit declaration.
1378
1379 2010-06-15  Jason Merrill  <jason@redhat.com>
1380
1381         * class.c (add_implicitly_declared_members): Implicit assignment
1382         operators can also be virtual overriders.
1383         * method.c (lazily_declare_fn): Likewise.
1384
1385         * call.c (convert_like_real): Give "initializing argument of"
1386         information for ambiguous conversion.  Give source position
1387         of function.
1388
1389         * call.c (print_z_candidates): Do print viable deleted candidates.
1390         (joust): Don't choose a deleted function just because its worst
1391         conversion is better than another candidate's worst.
1392
1393         * call.c (convert_like_real): Don't complain about
1394         list-value-initialization from an explicit constructor.
1395
1396         * decl.c (duplicate_decls): Use DECL_IS_BUILTIN rather than test
1397         DECL_SOURCE_LOCATION directly.
1398
1399         * class.c (type_has_user_provided_default_constructor): Use
1400         sufficient_parms_p.
1401
1402         * call.c (is_subseq): Handle ck_aggr, ck_list.
1403         (compare_ics): Treat an aggregate or ambiguous conversion to the
1404         same type as involving the same function.
1405
1406 2010-06-13  Shujing Zhao  <pearly.zhao@oracle.com>
1407
1408         * typeck.c (convert_for_assignment): Fix comment. Change message
1409         format from %d to %qP.
1410         (convert_for_initialization): Fix comment. 
1411
1412 2010-06-11  Shujing Zhao  <pearly.zhao@oracle.com>
1413
1414         * cp-tree.h (expr_list_kind): New type.
1415         (impl_conv_rhs): New type.
1416         (build_x_compound_expr_from_list, convert_for_initialization): Adjust
1417         prototype.
1418         (typeck.c (convert_arguments): Use impl_conv_rhs and emit the
1419         diagnostics for easy translation. Change caller.
1420         (convert_for_initialization): Use impl_conv_rhs and change caller.
1421         (build_x_compound_expr_from_list): Use expr_list_kind and emit the
1422         diagnostics for easy translation. Change caller.
1423         * decl.c (bad_spec_place): New enum.
1424         (bad_specifiers): Use it and emit the diagnostics for easy
1425         translation. Change caller.
1426         * pt.c (coerce_template_parms): Put the diagnostics in full sentence.
1427
1428 2010-06-09  Nathan Froyd  <froydnj@codesourcery.com>
1429
1430         * cp-tree.h (struct saved_scope): Change decl_ns_list field type
1431         to a VEC.
1432         * decl2.c (cp_write_global_declarations): Adjust for new type of
1433         decl_namespace_list.
1434         * name-lookup.c (current_decl_namespace): Likewise.
1435         (push_decl_namespace): Likewise.
1436         (pop_decl_namespace): Likewise.
1437
1438 2010-06-09  Nathan Froyd  <froydnj@codesourcery.com>
1439
1440         * call.c (build_java_interface_fn_ref): Call build_function_type_list
1441         instead of build_function_type.
1442         * decl.c (cxx_init_decl_processing): Likewise.
1443         (declare_global_var): Likewise.
1444         (get_atexit_node): Likewise.
1445         (expand_static_init): Likewise.
1446         * decl2.c (start_objects): Likewise.
1447         (start_static_storage_duration_function): Likewise.
1448         * except.c (init_exception_processing): Likewise.
1449         (build_exc_ptr): Likewise.
1450         (build_throw): Likewise.
1451         * rtti.c (throw_bad_cast): Likewise.
1452         (throw_bad_typeid): Likewise.
1453         (build_dynamic_cast_1): Likewise.
1454
1455 2010-06-09  Nathan Froyd  <froydnj@codesourcery.com>
1456
1457         * call.c (build_call_n): Call XALLOCAVEC instead of alloca.
1458         (build_op_delete_call): Likewise.
1459         (build_over_call): Likewise.
1460         * cp-gimplify.c (cxx_omp_clause_apply_fn): Likewise.
1461         * pt.c (process_partial_specialization): Likewise.
1462         (tsubst_template_args): Likewise.
1463         * semantics.c (finish_asm_stmt): Likewise.
1464
1465 2010-06-08  Nathan Sidwell  <nathan@codesourcery.com>
1466
1467         * decl.c (record_key_method_defined): New, broken out of ...
1468         (finish_function): ... here.  Call it.  
1469         (start_decl): Treat aliases as definitions.
1470
1471 2010-06-08  Laurynas Biveinis  <laurynas.biveinis@gmail.com>
1472
1473         * typeck2.c (abstract_virtuals_error): Use typed GC allocation.
1474
1475         * pt.c (maybe_process_partial_specialization): Likewise.
1476         (register_specialization): Likewise.
1477         (add_pending_template): Likewise.
1478         (lookup_template_class): Likewise.
1479         (push_tinst_level): Likewise.
1480
1481         * parser.c (cp_lexer_new_main): Likewise.
1482         (cp_lexer_new_from_tokens): Likewise.
1483         (cp_token_cache_new): Likewise.
1484         (cp_parser_context_new): Likewise.
1485         (cp_parser_new): Likewise.
1486         (cp_parser_nested_name_specifier_opt): Likewise.
1487         (cp_parser_template_id): Likewise.
1488
1489         * name-lookup.c (binding_entry_make): Likewise.
1490         (binding_table_construct): Likewise.
1491         (binding_table_new): Likewise.
1492         (cxx_binding_make): Likewise.
1493         (pushdecl_maybe_friend): Likewise.
1494         (begin_scope): Likewise.
1495         (push_to_top_level): Likewise.
1496
1497         * lex.c (init_reswords): Likewise.
1498         (retrofit_lang_decl): Likewise.
1499         (cxx_dup_lang_specific_decl): Likewise.
1500         (copy_lang_type): Likewise.
1501         (cxx_make_type): Likewise.
1502
1503         * decl.c (make_label_decl): Likewise.
1504         (check_goto): Likewise.
1505         (start_preparsed_function): Likewise.
1506         (save_function_data): Likewise.
1507
1508         * cp-tree.h (TYPE_SET_PTRMEMFUNC_TYPE): Likewise.
1509
1510         * cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise.
1511
1512         * class.c (finish_struct_1): Likewise.
1513
1514         * cp-tree.h (struct lang_type): Add variable_size GTY option.
1515         (struct lang_decl): Likewise.
1516
1517         * parser.c (cp_parser_new): Update comment to not reference
1518         ggc_alloc.
1519
1520 2010-06-07  Jason Merrill  <jason@redhat.com>
1521
1522         PR c++/44366
1523         * error.c (dump_parameters): Mask out TFF_SCOPE.
1524         (dump_simple_decl): Don't print the scope of a PARM_DECL.
1525         (dump_scope): Remove no-op mask.
1526
1527         PR c++/44401
1528         * parser.c (cp_parser_lookup_name): Fix naming the constructor.
1529
1530         * cp-tree.h (COMPLETE_OR_OPEN_TYPE_P): New macro.
1531         * init.c (build_offset_ref): Use it.
1532         * pt.c (maybe_process_partial_specialization): Use it.
1533         (instantiate_class_template): Use it.
1534         * search.c (lookup_base): Use it.
1535
1536 2010-06-07  Jakub Jelinek  <jakub@redhat.com>
1537
1538         PR c++/44444
1539         * expr.c (mark_exp_read): Handle INDIRECT_REF.
1540         * cvt.c (convert_to_void): Handle INDIRECT_REF like
1541         handled_component_p.
1542
1543         PR c++/44443
1544         * decl.c (initialize_local_var): If TREE_USED is set on the type,
1545         set also DECL_READ_P on the decl.
1546
1547 2010-05-25  Dodji Seketeli  <dodji@redhat.com>
1548
1549         PR c++/44188
1550         * cp-tree.h (typedef_variant_p): Move this declaration to
1551         gcc/tree.h.
1552         * tree.c (typedef_variant_p): Move this definition to gcc/tree.c.
1553         * decl.c (grokdeclarator): Do not rename debug info of an
1554         anonymous tagged type named by a typedef.
1555
1556 2010-06-05  Fabien Chêne  <fabien@gcc.gnu.org>
1557
1558         PR c++/44086
1559         * class.c (check_field_decls): Move the call to
1560         check_bitfield_decl before trying to set the
1561         CLASSTYPE_READONLY_FIELDS_NEED_INIT flag.
1562
1563 2010-06-05  Steven Bosscher  <steven@gcc.gnu.org>
1564
1565         * typeck.c: Update include path for moved files.
1566         * decl.c: Likewise.
1567         * rtti.c: Likewise.
1568         * cp-gimplify.c: Likewise.
1569         * cp-lang.c: Likewise.
1570         * pt.c: Likewise.
1571         * semantics.c: Likewise.
1572         * cxx-pretty-print.h: Likewise.
1573         * decl2.c: Likewise.
1574         * parser.c: Likewise.
1575         * cp-objcp-common.c: Likewise.
1576         * cp-tree.h: Likewise.
1577         * name-lookup.c: Likewise.
1578         * lex.c: Likewise.
1579         * name-lookup.h: Likewise.
1580         * config-lang.in: Update paths in gtfiles for files in c-family/.
1581         * Make-lang.in: Likewise.
1582
1583 2010-06-04  Magnus Fromreide  <magfr@lysator.liu.se>
1584
1585         * cvt.c (cp_convert_to_pointer): Use null_ptr_cst_p.
1586         * typeck.c (build_ptrmemfunc): Likewise.
1587
1588 2010-06-04  Jason Merrill  <jason@redhat.com>
1589
1590         * typeck2.c (merge_exception_specifiers): Adjust merging of
1591         throw() and noexcept(true).
1592
1593         * pt.c (value_dependent_expression_p) [NOEXCEPT_EXPR]: Avoid
1594         using an uninitialized variable.
1595
1596         * cxx-pretty-print.c (pp_cxx_unary_expression): Handle NOEXCEPT_EXPR.
1597         (pp_cxx_expression): Likewise.
1598
1599         Implement noexcept-specification (15.4)
1600         * parser.c (cp_parser_exception_specification_opt): Parse it.
1601         Give -Wdeprecated warning about throw() specs.
1602         * pt.c (tsubst_exception_specification): Handle it.
1603         * error.c (dump_exception_spec): Handle it.
1604         (dump_expr): Handle NOEXCEPT_EXPR.
1605         * cxx-pretty-print.c (pp_cxx_exception_specification): Likewise.
1606         * typeck.c (comp_except_specs): Handle compatibility rules.
1607         Change exact parm to take an enum.
1608         * typeck2.c (merge_exception_specifiers): Handle noexcept.
1609         * except.c (nothrow_spec_p, type_noexcept_p): New fns.
1610         (type_throw_all_p, build_noexcept_spec): New fns.
1611         * cp-tree.h (TYPE_NOTHROW_P, TYPE_NOEXCEPT_P): Use them.
1612         (comp_except_specs): Define ce_derived, ce_normal, ce_exact enums.
1613         (cp_tree_index): Add CPTI_NOEXCEPT_TRUE_SPEC, CPTI_NOEXCEPT_FALSE_SPEC.
1614         (noexcept_true_spec, noexcept_false_spec): New macros.
1615         * name-lookup.c (pushdecl_maybe_friend): Adjust.
1616         * search.c (check_final_overrider): Adjust.
1617         * decl.c (check_redeclaration_exception_specification): Adjust.
1618         (use_eh_spec_block): Use type_throw_all_p.
1619         (cxx_init_decl_processing): Set noexcept_false_spec,noexcept_true_spec.
1620         Give operator new a noexcept-specification in C++0x mode.
1621         * tree.c (build_exception_variant, cxx_type_hash_eq): Adjust.
1622         (cp_build_type_attribute_variant): Don't test TYPE_RAISES_EXCEPTIONS.
1623
1624         Implement noexcept operator (5.3.7)
1625         * cp-tree.def (NOEXCEPT_EXPR): New.
1626         * except.c (check_noexcept_r, finish_noexcept_expr): New.
1627         * cp-tree.h: Declare finish_noexcept_expr.
1628         * parser.c (cp_parser_unary_expression): Parse noexcept-expression.
1629         * pt.c (tsubst_copy_and_build): And tsubst it.
1630         (type_dependent_expression_p): Handle it.
1631         (value_dependent_expression_p): Handle it.
1632
1633         * call.c (build_conditional_expr): Never fold in unevaluated context.
1634         * tree.c (build_aggr_init_expr): Propagate TREE_NOTHROW.
1635         * semantics.c (simplify_aggr_init_expr): Likewise.
1636         * typeck.c (merge_types): Call merge_exception_specifiers.
1637         * decl.c (duplicate_decls): Check DECL_SOURCE_LOCATION rather than
1638         DECL_ANTICIPATED for preferring new type.
1639
1640 2010-06-04  Joseph Myers  <joseph@codesourcery.com>
1641
1642         * g++spec.c (lang_specific_driver): Use GCC-specific formats in
1643         diagnostics.
1644
1645 2010-06-04  Jakub Jelinek  <jakub@redhat.com>
1646
1647         PR c++/44412
1648         * typeck.c (build_class_member_access_expr): Call mark_exp_read
1649         on object for static data members.
1650
1651 2010-06-04  Jakub Jelinek  <jakub@redhat.com>
1652             Jason Merrill  <jason@redhat.com>
1653
1654         PR c++/44362
1655         * call.c (build_conditional_expr): If both arg2 and arg3 are lvalues
1656         with the same type, call mark_lvalue_use on both.
1657
1658 2010-06-03  Nathan Froyd  <froydnj@codesourcery.com>
1659
1660         * class.c (struct vtbl_init_data_s): Remove last_init field.
1661         (struct secondary_vptr_vtt_init_data_s): Change type of inits field
1662         to a VEC.
1663         (finish_vtbls): Use a VEC rather than a TREE_LIST for the accumulated
1664         initializers.
1665         (build_vtt): Likewise.
1666         (initialize_vtable): Take a VEC instead of a tree.
1667         (build_vtt_inits): Change return type to void.  Take a VEC **
1668         instead of a tree *; accumulate results into said VEC.
1669         (build_ctor_vtbl_group): Use a VEC rather than a TREE_LIST for the
1670         accumulated initializers.  Pass the vtable to accumulate_vtbl_inits.
1671         (accumulate_vtbl_inits): Add extra vtable tree parameter; take a VEC
1672         instead of a tree.
1673         (dfs_accumulate_vtbl_inits): Likewise.  Change return type to void.
1674         (build_vtbl_initializer): Add VEC parameter; accumulate initializers
1675         into it.
1676         (dfs_build_secondary_vptr_vtt_inits): Use CONSTRUCTOR_APPEND_ELT
1677         rather than tree_cons.
1678         (build_vbase_offset_vtbl_entries): Likewise.
1679         (add_vcall_offset): Likewise.
1680         (build_rtti_vtbl_entries): Likewise.
1681         * cp-tree.h (initialize_artificial_var): Take a VEC instead of a tree.
1682         * decl.c (initialize_artificial_var): Use build_constructor instead
1683         of build_constructor_from_list.
1684
1685 2010-06-03  H.J. Lu  <hongjiu.lu@intel.com>
1686
1687         PR c++/44294
1688         * class.c (layout_class_type): Check MAX_FIXED_MODE_SIZE on
1689         bit-field.
1690
1691 2010-06-02  Jonathan Wakely  <jwakely.gcc@gmail.com>
1692
1693         * parser.c (cp_parser_mem_initializer_list): Change error text.
1694
1695 2010-06-02  Jakub Jelinek  <jakub@redhat.com>
1696
1697         * cp-objcp-common.c (shadowed_var_for_decl): Change into
1698         tree_decl_map hashtab from tree_map.
1699         (decl_shadowed_for_var_lookup, decl_shadowed_for_var_insert): Adjust.
1700         (init_shadowed_var_for_decl): Adjust initialization.
1701
1702         PR c++/44361
1703         * cvt.c (convert_to_void): If implicit is NULL, call mark_rvalue_use
1704         instead of calling mark_exp_read only when not an assignment.
1705
1706         PR debug/44367
1707         * semantics.c (finalize_nrv): Don't copy DECL_ARTIFICIAL, DECL_IGNORED_P,
1708         DECL_SOURCE_LOCATION and DECL_ABSTRACT_ORIGIN from var to result.
1709         Set DECL_VALUE_EXPR on var.
1710
1711 2010-06-02  Jason Merrill  <jason@redhat.com>
1712
1713         * error.c (dump_type): Improve typedef handling.
1714
1715         PR c++/9726
1716         PR c++/23594
1717         PR c++/44333
1718         * name-lookup.c (same_entity_p): New.
1719         (ambiguous_decl): Multiple declarations of the same entity
1720         are not ambiguous.
1721
1722 2010-06-01  Jason Merrill  <jason@redhat.com>
1723
1724         DR 990
1725         * call.c (add_list_candidates): Prefer the default constructor.
1726         (build_aggr_conv): Treat missing initializers like { }.
1727         * typeck2.c (process_init_constructor_record): Likewise.
1728         * init.c (expand_default_init): Use digest_init for
1729         direct aggregate initialization, too.
1730
1731         * call.c (add_list_candidates): Split out...
1732         (build_user_type_conversion_1): ...from here.
1733         (build_new_method_call): And here.
1734         (implicit_conversion): Propagate LOOKUP_NO_NARROWING.
1735
1736         PR c++/44358
1737         * call.c (build_list_conv): Set list-initialization flags properly.
1738
1739 2010-06-01  Nathan Froyd  <froydnj@codesourcery.com>
1740
1741         * typeck2.c (build_x_arrow): Make types_memoized a VEC.
1742
1743 2010-06-01  Arnaud Charlet  <charlet@adacore.com>
1744             Matthew Gingell  <gingell@adacore.com>
1745
1746         * Make-lang.in (CXX_C_OBJS): Add c-ada-spec.o.
1747         * decl2.c: Include langhooks.h and c-ada-spec.h.
1748         (cpp_check, collect_source_refs, collect_ada_namespace,
1749         collect_all_refs): New functions.
1750         (cp_write_global_declarations): Add handling of -fdump-ada-spec.
1751         * lang-specs.h: Ditto.
1752
1753 2010-05-29  Nathan Froyd  <froydnj@codesourcery.com>
1754
1755         * cp-tree.h (cp_build_function_call_nary): Declare.
1756         * typeck.c (cp_build_function_call_nary): Define.
1757         * decl.c (register_dtor_fn): Use it instead of
1758         cp_build_function_call.
1759         (cxx_maybe_build_cleanup): Likewise.
1760         * decl2.c (generate_ctor_or_dtor_function): Likewise.
1761         * except.c (do_get_exception_ptr): Likewise.
1762         (do_begin_catch): Likewise.
1763         (do_allocate_exception): Likewise.
1764         (do_free_exception): Likewise.
1765         (build_throw): Likewise.  Use cp_build_function_call_vec instead
1766         of cp_build_function_call.
1767         (do_end_catch): Likewise.
1768
1769 2010-05-29  Nathan Froyd  <froydnj@codesourcery.com>
1770
1771         * cp-tree.h (struct cp_decl_specifier_seq): Move type_location field up.
1772         (struct cp_declarator): Move id_loc field up.
1773
1774 2010-05-29  Steven Bosscher  <steven@gcc.gnu.org>
1775
1776         * cp-tree.h (ATTRIBUTE_GCC_CXXDIAG): Remove.  Require that
1777         this file is included before c-common.h.  Define GCC_DIAG_STYLE
1778         before including diagnostic-core.h and toplev.h.
1779         (pedwarn_cxx98): Use ATTRIBUTE_GCC_DIAG.
1780         * pt.c: Include cp-tree.h before c-common.h.
1781
1782 2010-05-29  Steven Bosscher  <steven@gcc.gnu.org>
1783
1784         * tree.c (c_register_addr_space): Add stub.
1785
1786 2010-05-28  Joseph Myers  <joseph@codesourcery.com>
1787
1788         * g++spec.c (lang_specific_driver): Use fatal_error instead of
1789         fatal.
1790
1791 2010-05-28  Dodji Seketeli  <dodji@redhat.com>
1792
1793         Revert fix of PR c++/44188
1794         * cp-tree.h (typedef_variant_p): Revert moving this declaration to
1795         gcc/tree.h.
1796         * tree.c (typedef_variant_p): Revert moving this definition to
1797         gcc/tree.c.
1798         * decl.c (grokdeclarator): Revert naming typedef handling.
1799
1800 2010-05-27  Joseph Myers  <joseph@codesourcery.com>
1801
1802         * call.c: Include diagnostic-core.h instead of diagnostic.h.
1803         * cp-lang.c: Don't include diagnostic.h
1804         * name-lookup.c: Include diagnostic-core.h instead of
1805         diagnostic.h.
1806         (cp_emit_debug_info_for_using): Use seen_error.
1807         * optimize.c: Include diagnostic-core.h instead of diagnostic.h.
1808         * parser.c: Include diagnostic-core.h instead of diagnostic.h.
1809         * pt.c (iterative_hash_template_arg): Use seen_error.
1810         * repo.c: Include diagnostic-core.h instead of diagnostic.h.
1811         * typeck2.c: Include diagnostic-core.h instead of diagnostic.h.
1812         * Make-lang.in (cp/cp-lang.o, cp/typeck2.o, cp/call.o, cp/repo.o,
1813         cp/optimize.o, cp/parser.o, cp/name-lookup.o): Update
1814         dependencies.
1815
1816 2010-05-25  Dodji Seketeli  <dodji@redhat.com>
1817
1818         PR c++/44188
1819         * cp-tree.h (typedef_variant_p): Move this declaration to
1820         gcc/tree.h.
1821         * tree.c (typedef_variant_p): Move this definition to gcc/tree.c.
1822         * decl.c (grokdeclarator): Do not rename debug info of an
1823         anonymous tagged type named by a typedef.
1824
1825 2010-05-27  Jason Merrill  <jason@redhat.com>
1826
1827         PR c++/43555
1828         * decl.c (grokdeclarator) [cdk_pointer et al]: Force evaluation of
1829         anonymous VLA size.
1830
1831 2010-05-27  Kai Tietz  <kai.tietz@onevision.com>
1832
1833         PR bootstrap/44287
1834         * rtti.c (emit_support_tinfos): Check for NULL_TREE.
1835         * class.c (layout_class_type): Likewise.
1836         * decl.c (finish_enum): Likewise.
1837         * mangle.c (write_builitin_type): Likewise.
1838
1839 2010-05-26  Kai Tietz  <kai.tietz@onevision.com>
1840
1841         * cp-tree.h (cp_decl_specifier_seq): Add new bifield
1842         explicit_int128_p.
1843         * decl.c (grokdeclarator): Handle __int128.
1844         * parser.c (cp_lexer_next_token_is_decl_specifier_ke): Likewise.
1845         (cp_parser_simple_type_specifier): Likewise.
1846         * rtti.c (emit_support_tinfos): Add int128 nodes for rtti.
1847         * typeck.c (cp_common_type): Handle __int128.
1848         * mangle.c (integer_type_codes): Add itk_int128 and
1849         itk_unsigned_int128.
1850
1851 2010-05-26  Jason Merrill  <jason@redhat.com>
1852
1853         PR c++/43382
1854         * pt.c (tsubst_pack_expansion): Don't get confused by recursive
1855         unification.
1856
1857 2010-05-26  Steven Bosscher  <steven@gcc.gnu.org>
1858
1859         * cp-lang.c: Do not include expr.h.
1860
1861 2010-05-26  Steven Bosscher  <steven@gcc.gnu.org>
1862
1863         * decl.c: Do not include rtl.h
1864         * semantics.c: Likewise.
1865
1866 2010-05-25  Steven Bosscher  <steven@gcc.gnu.org>
1867
1868         * cp-tree.h: Do not include splay-tree.h.
1869         (struct prtmem_cst): Remove unused field and false comment.
1870         * typeck.c: Do not include rtl.h, expr.h, and tm_p.h.
1871         * optimize.c: Do not inclde rtl.h, insn-config.h, and integrate.h.
1872         * init.c: Do not include rtl.h and expr.h.
1873         * class.c: Do not include rtl.h.  Include splay-tree.h.
1874         (build_clone): Use plain NULL instead of NULL_RTX.
1875         * decl.c: Do not include expr.h.  Explain why rtl.h has to be
1876         included.  Include splay-tree.h.
1877         * method.c: Do not include rtl.h and expr.h.
1878         (use_thunk): Use plain NULL instead of NULL_RTX.
1879         * except.c: Do not include rtl.h, expr.h, and libfuncs.h.
1880         * tree.c: Do not include rtl.h, insn-config.h, integrate.h,
1881         and target.h.  Include splay-tree.h.
1882         * expr.c: Do not include rtl.h and expr.h.
1883         * pt.c: Do not include obstack.h and rtl.h.
1884         (tsubst_friend_function): Use plain NULL instead of NULL_RTX.
1885         (tsubst_decl): Likewise.
1886         (instantiate_decl): Likewise.
1887         * semantics.c: Do not include exprt.h and debug.h.  Explain why
1888         rtl.h has to be included.
1889         * decl2.c: Do not include rtl.h and expr.h.  Include splay-tree.h.
1890         * call.c: Do not include rtl.h and expr.h.
1891         * search.c: Do not include obstack.h and rtl.h.
1892         * friend.c: Do not include rtl.h and expr.h.
1893         * Make-lang.in: Update dependencies.
1894
1895 2010-05-25  Jakub Jelinek  <jakub@redhat.com>
1896
1897         PR c++/18249
1898         * parser.c (non_integral_constant): Add NIC_NONE.
1899         (required_token): Add RT_NONE.
1900         (cp_parser_unary_expression): Initialize non_constant_p
1901         to NIC_NONE.
1902         (cp_parser_asm_definition): Initialize missing to RT_NONE.
1903         (cp_parser_primary_expression, cp_parser_postfix_expression,
1904         cp_parser_cast_expression, cp_parser_binary_expression,
1905         cp_parser_functional_cast): Fix formatting.
1906
1907 2010-05-25  Shujing Zhao  <pearly.zhao@oracle.com>
1908         
1909         PR c++/18249
1910         * parser.c: Remove inclusion of dyn-string.h.
1911         (non_integral_constant): New enum.
1912         (name_lookup_error): New enum.
1913         (required_token): New enum.
1914         (cp_parser_required_error): New function.
1915         (cp_parser_require): Change the type of variable token_desc to
1916         required_token and use cp_parser_required_error.
1917         (cp_parser_require_keyword): Likewise.
1918         (cp_parser_error): Use gmsgid as parameter.
1919         (cp_parser_name_lookup_error): Change the type of variable desired to
1920         name_lookup_error and put the diagnostic in the full sentences. Change
1921         caller.
1922         (cp_parser_non_integral_constant_expression): Change the type of the
1923         variable thing to non_integral_constant and put the diagnostics in
1924         full sentences. Change caller.
1925
1926 2010-05-24  Eric Botcazou  <ebotcazou@adacore.com>
1927
1928         PR middle-end/44100
1929         * typeck.c (cp_build_unary_op): Fold offsetof-like computations.
1930
1931 2010-05-24  Joseph Myers  <joseph@codesourcery.com>
1932
1933         * error.c (cp_diagnostic_starter): Update call to
1934         diagnostic_build_prefix.
1935         (cp_print_error_function,
1936         print_instantiation_partial_context_line): Check show_column flag
1937         in context.
1938
1939 2010-05-24  Jason Merrill  <jason@redhat.com>
1940
1941         PR c++/41510
1942         * decl.c (check_initializer): Don't wrap an init-list in a
1943         TREE_LIST.
1944         * init.c (build_aggr_init): Don't assume copy-initialization if
1945         init has CONSTRUCTOR_IS_DIRECT_INIT.
1946         * call.c (build_new_method_call): Sanity check.
1947
1948 2010-05-24  Nathan Froyd  <froydnj@codesourcery.com>
1949
1950         * rtti.c (tinfo_base_init): Use build_constructor instead of
1951         build_constructor_from_list.  Don't cons a tree node for
1952         returning.
1953         (generic_initializer): Use build_constructor_single instead of
1954         build_constructor_from_list.
1955         (ptr_initializer): Use build_constructor instead of
1956         build_constructor_from_list
1957         (ptm_initializer): Likewise.
1958         (class_initializer): Likewise.  Take varargs instead of TRAIL.
1959         (get_pseudo_ti_init): Adjust calls to class_initializer.  Use
1960         build_constructor instead of build_constructor_from_list.
1961
1962 2010-05-22  Steven Bosscher  <steven@gcc.gnu.org>
1963
1964         * semantics.c: Include bitmap.h.
1965         * Make-lang.in: Update dependencies.
1966
1967 2010-05-22  Jan Hubicka  <jh@suse.cz>
1968
1969         * decl2.c (maybe_emit_vtables): Produce same comdat group when outputting
1970         comdat vtables.
1971         (cxx_callgraph_analyze_expr): Remove code marking vtables needed.
1972
1973 2010-05-21  Joseph Myers  <joseph@codesourcery.com>
1974
1975         * cxx-pretty-print.c: Correct merge error.
1976
1977 2010-05-21  Joseph Myers  <joseph@codesourcery.com>
1978
1979         * error.c: Include tree-diagnostic.h and tree-pretty-print.h.
1980         (cp_print_error_function): Use diagnostic_abstract_origin macro.
1981         (cp_printer): Handle %K here using percent_K_format.
1982         * cxx-pretty-print.c: Include tree-pretty-print.h.
1983         * Make-lang.in (cp/error.o, cp/cxx-pretty-print.o): Update
1984         dependencies.
1985
1986 2010-05-21  Steven Bosscher  <steven@gcc.gnu.org>
1987
1988         * error.c, tree.c, typeck2.c, cxx-pretty-print.c, mangle.c:
1989         Clean up redundant includes.
1990
1991 2010-05-20  Paolo Carlini  <paolo.carlini@oracle.com>
1992
1993         PR c++/30298
1994         * decl.c (xref_basetypes): Return false in case of ill-formed
1995         redefinition.
1996
1997 2010-05-19  Jason Merrill  <jason@redhat.com>
1998
1999         * call.c (reference_binding): Use cp_build_qualified_type_real
2000         and cp_type_quals consistently.
2001         (add_function_candidate): Likewise.
2002         (build_conditional_expr): Likewise.
2003         (convert_like_real): Likewise.
2004         (type_passed_as): Likewise.
2005         * class.c (add_method): Likewise.
2006         (same_signature_p): Likewise.
2007         (layout_class_type): Likewise.
2008         * decl.c (cxx_init_decl_processing): Likewise.
2009         (cp_fname_init): Likewise.
2010         (grokdeclarator): Likewise.
2011         * decl2.c (cp_reconstruct_complex_type): Likewise.
2012         * init.c (build_new_1): Likewise.
2013         * method.c (do_build_copy_constructor): Likewise.
2014         (implicitly_declare_fn): Likewise.
2015         * pt.c (tsubst_aggr_type): Likewise.
2016         (tsubst): Likewise.
2017         * rtti.c (init_rtti_processing): Likewise.
2018         (build_headof): Likewise.
2019         (build_dynamic_cast_1): Likewise.
2020         (tinfo_base_init): Likewise.
2021         (emit_support_tinfos): Likewise.
2022         * semantics.c (capture_decltype): Likewise.
2023         * tree.c (cv_unqualified): Likewise.
2024         * typeck.c (composite_pointer_type): Likewise.
2025         (string_conv_p): Likewise.
2026
2027         * mangle.c (write_CV_qualifiers_for_type): Tweak.
2028
2029         * call.c (initialize_reference): Use CP_TYPE_CONST_P.
2030         * decl.c (start_decl): Likewise.
2031         * semantics.c (finish_compound_literal): Likewise.
2032         * typeck.c (check_return_expr): Use CP_TYPE_VOLATILE_P.
2033         (cp_type_readonly): Remove.
2034         * cp-tree.h: Remove declaration.
2035
2036         * typeck.c (merge_types): Preserve memfn quals.
2037
2038         * decl.c (grokdeclarator): Don't check quals on fn type.
2039         * typeck.c (cp_apply_type_quals_to_decl): Likewise.
2040         * tree.c (cp_build_qualified_type_real): Simplify qualifier checking.
2041
2042         PR c++/44193
2043         * typeck.c (type_memfn_quals): New fn.
2044         (apply_memfn_quals): New fn.
2045         (cp_type_quals): Return TYPE_UNQUALIFIED for FUNCTION_TYPE.
2046         (cp_type_readonly): Use cp_type_quals.
2047         * cp-tree.h: Add declarations.
2048         * tree.c (cp_build_qualified_type_real): Don't set, but do
2049         preserve, quals on FUNCTION_TYPE.
2050         (strip_typedefs): Use apply_memfn_quals and type_memfn_quals.
2051         * decl.c (build_ptrmem_type): Likewise.
2052         (grokdeclarator): Likewise.
2053         (static_fn_type): Likewise.
2054         * decl2.c (change_return_type): Likewise.
2055         (cp_reconstruct_complex_type): Likewise.
2056         * pt.c (tsubst_function_type): Likewise.
2057         (unify): Likewise.
2058         (tsubst): Likewise.  Drop special FUNCTION_TYPE substitution code.
2059
2060 2010-05-18  Nathan Froyd  <froydnj@codesourcery.com>
2061
2062         * tree.c (build_min_non_dep_call_vec): Update comment.
2063
2064 2010-05-17  Jason Merrill  <jason@redhat.com>
2065
2066         * call.c (struct z_candidate): Add explicit_targs field.
2067         (add_template_candidate_real): Set it.
2068         (build_over_call): Use it to control init-list warning.
2069
2070         PR c++/44157
2071         * call.c (build_over_call): Limit init-list deduction warning to
2072         cases where the argument is actually an init-list.
2073
2074         PR c++/44158
2075         * call.c (build_over_call): Don't do bitwise copy for move ctor.
2076
2077 2010-05-17  Dodji Seketeli  <dodji@redhat.com>
2078             Jason Merrill  <jason@redhat.com>
2079
2080         PR c++/44108
2081         * decl.c (compute_array_index_type): Call mark_rvalue_use.
2082
2083 2010-05-15  Jason Merrill  <jason@redhat.com>
2084
2085         * cp-tree.h (TYPE_NOEXCEPT_P): New macro.
2086         * except.c (begin_eh_spec_block): Use MUST_NOT_THROW_EXPR if
2087         TYPE_NOEXCEPT_P.
2088         (finish_eh_spec_block): Adjust.
2089
2090 2010-05-15  Jakub Jelinek  <jakub@redhat.com>
2091
2092         PR c++/44148
2093         * pt.c (tsubst): Unshare template argument.
2094
2095 2010-05-15  Steven Bosscher  <steven@gcc.gnu.org>
2096
2097         * decl.c: Include tree-iterator.h, as fixup for tree-inline.h changes.
2098         * Make-lang.in: Fix dependencies accordingly.
2099
2100 2010-05-14  Jason Merrill  <jason@redhat.com>
2101
2102         C++ DR 475
2103         * except.c (build_throw): Simplify, adjust for DR 475.
2104
2105         PR c++/44127
2106         * except.c (dtor_nothrow): Return nonzero for type with
2107         trivial destructor.
2108
2109         PR c++/44127
2110         * cp-gimplify.c (gimplify_must_not_throw_expr): Use
2111         gimple_build_eh_must_not_throw.
2112
2113 2010-05-14  Martin Jambor  <mjambor@suse.cz>
2114
2115         * cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Remove both its undef
2116         and define.
2117
2118 2010-05-14  Jonathan Wakely  <jwakely.gcc@gmail.com>
2119
2120         * call.c (build_new_method_call): Change warning text.
2121         * typeck2.c (build_functional_cast): Change error text.
2122
2123 2010-05-14  Shujing Zhao  <pearly.zhao@oracle.com>
2124
2125         PR c++/30566
2126         * name-lookup.c (pushdecl_maybe_friend): Avoid the warnings about
2127         shadowing the outer parameter or variables by the declaration of
2128         nested function in nested structure or class. Warn the shadowing by
2129         the declaration of nested lambda expression.
2130
2131 2010-05-13  Jason Merrill  <jason@redhat.com>
2132
2133         * typeck.c (cp_build_array_ref): Factor out from...
2134         (build_array_ref): ...here.  Drop complain parm.
2135         (build_new_op): Adjust.
2136         * class.c (build_vtbl_ref_1): Adjust.
2137         * decl2.c (grok_array_decl): Adjust.
2138         * cp-tree.h: Adjust prototypes.
2139
2140 2010-05-13  Jan Hubicka  <jh@suse.cz>
2141
2142         * decl.c (cp_finish_decl): Do not worry about used attribute.
2143
2144 2010-05-12  Jason Merrill  <jason@redhat.com>
2145
2146         * typeck.c (build_array_ref): Take complain parm.
2147         * cp-tree.h: Add it to prototype.
2148         * call.c (build_new_op): Pass it.
2149         * class.c (build_vtbl_ref): Pass it.
2150         * decl2.c (grok_array_decl): Pass it.
2151
2152         PR bootstrap/44048
2153         PR target/44099
2154         * cp-tree.def (NULLPTR_TYPE): Remove.
2155         * cp-tree.h (NULLPTR_TYPE_P): New.
2156         (SCALAR_TYPE_P): Use it.
2157         (nullptr_type_node): New.
2158         (cp_tree_index): Add CPTI_NULLPTR_TYPE.
2159         * decl.c (cxx_init_decl_processing): Call record_builtin_type on
2160         nullptr_type_node.
2161         * cvt.c (ocp_convert): Use NULLPTR_TYPE_P instead of NULLPTR_TYPE.
2162         * cxx-pretty-print.c (pp_cxx_constant): Likewise.
2163         * error.c (dump_type, dump_type_prefix, dump_type_suffix): Likewise.
2164         * mangle.c (write_type): Likewise.
2165         * name-lookup.c (arg_assoc_type): Likewise.
2166         * typeck.c (build_reinterpret_cast_1): Likewise.
2167         * rtti.c (typeinfo_in_lib_p): Likewise.
2168         (emit_support_tinfos): Remove local nullptr_type_node.
2169
2170         * cp-tree.h (UNKNOWN_TYPE): Remove.
2171         * decl.c (cxx_init_decl_processing): Use LANG_TYPE instead.
2172         * error.c (dumy_type, dump_type_prefix, dump_type_suffix): Likewise.
2173         * typeck2.c (cxx_incomplete_type_diagnostic): Likewise.
2174         * class.c (instantiate_type): Check unknown_type_node rather than
2175         UNKNOWN_TYPE.
2176         * name-lookup.c (maybe_push_decl): Likewise.
2177         * rtti.c (get_tinfo_decl_dynamic): Likewise.
2178         (get_typeid): Likewise.
2179         * semantics.c (finish_offsetof): Likewise.
2180
2181         PR c++/20669
2182         * call.c (add_template_candidate_real): If deduction fails, still
2183         add the template as a non-viable candidate.
2184         (equal_functions): Handle template candidates.
2185         (print_z_candidate): Likewise.
2186         (print_z_candidates): Likewise.
2187         (build_new_function_call): Likewise.
2188
2189         * cp-tree.h (LOOKUP_LIST_ONLY): New.
2190         * call.c (add_candidates): Enforce it.
2191         (build_new_method_call): Try non-list ctor if no viable list ctor.
2192         (build_user_type_conversion_1): Likewise.
2193
2194         * call.c (add_candidates): Distinguish between type(x) and
2195         x.operator type().
2196         (convert_class_to_reference): Set LOOKUP_NO_CONVERSION.
2197         (build_new_method_call): Give better error for conversion op.
2198
2199         * call.c (add_candidates): Add first_arg and return_type parms.
2200         Add special constructor/conversion op handling.
2201         (convert_class_to_reference): Use it.
2202         (build_user_type_conversion_1): Likewise.
2203         (build_op_call): Likewise.
2204         (build_new_method_call): Likewise.
2205         (build_new_op): Adjust.
2206         (perform_overload_resolution): Adjust.
2207
2208 2010-05-11  Paolo Carlini  <paolo.carlini@oracle.com>
2209
2210         PR c++/34272
2211         PR c++/43630
2212         PR c++/34491
2213         * pt.c (process_partial_specialization): Return error_mark_node
2214         in case of unused template parameters in partial specialization.
2215
2216 2010-05-11  Jakub Jelinek  <jakub@redhat.com>
2217
2218         PR c++/44062
2219         * semantics.c (finish_expr_stmt): Don't call mark_exp_read here...
2220         * cvt.c (convert_to_void): ... but here.  If expr is a COMPOUND_EXPR,
2221         look at its second operand.
2222
2223 2010-05-10  Jason Merrill  <jason@redhat.com>
2224
2225         PR c++/44017
2226         * semantics.c (baselink_for_fns): Revert earlier change.
2227
2228         PR c++/44045
2229         * typeck.c (cp_build_modify_expr): Complain about assignment to
2230         array from init list.
2231
2232 2010-05-10  Fabien Chêne  <fabien.chene@gmail.com>
2233
2234         PR c++/43719
2235         * decl.c (check_initializer): strip array type before checking for
2236         uninitialized const or ref members.
2237
2238 2010-05-07  Fabien Chêne  <fabien.chene@gmail.com>
2239
2240         PR c++/43951
2241         * init.c (diagnose_uninitialized_cst_or_ref_member_1): Returns the
2242         error count. Emit errors only if compain is true.
2243         (build_new_1): Do not return error_mark_node if
2244         diagnose_uninitialized_cst_or_ref_member_1 does not diagnose any
2245         errors. Delay the check for user-provided constructor.
2246         (perform_member_init): Adjust.
2247         * cp-tree.h (diagnose_uninitialized_cst_or_ref_member): Change the
2248         prototype.
2249
2250 2010-05-06  Magnus Fromreide  <magfr@lysator.liu.se>
2251             Jason Merrill  <jason@redhat.com>
2252
2253         Add support for C++0x nullptr.
2254         * cp-tree.def: Add NULLPTR_TYPE.
2255         * cp-tree.h: Add nullptr_node.
2256         (cp_tree_index): Add CPTI_NULLPTR.
2257         (SCALAR_TYPE_P): Add NULLPTR_TYPE.
2258         * call.c (null_ptr_cst_p): Handle nullptr.
2259         (standard_conversion): Likewise.
2260         (convert_arg_to_ellipsis): Likewise.
2261         * mangle.c (write_type): Likewise.
2262         * name-lookup.c (arg_assoc_type): Likewise.
2263         * parser.c (cp_parser_primary_expression): Likewise.
2264         * typeck.c (cp_build_binary_op): Likewise.
2265         (build_reinterpret_cast_1): Likewise.
2266         * error.c (dump_type): Likewise.
2267         (dump_type_prefix, dump_type_suffix): Likewise.
2268         * decl.c (cxx_init_decl_processing): Likewise.
2269         * cxx-pretty-print.c (pp_cxx_constant): Likewise.
2270         * cvt.c (ocp_convert): Likewise.
2271         * rtti.c (typeinfo_in_lib_p, emit_support_tinfos): Put
2272         nullptr_t tinfo in libsupc++.
2273
2274 2010-05-06  Jason Merrill  <jason@redhat.com>
2275
2276         * semantics.c (simplify_aggr_init_expr): Use INIT_EXPR.
2277
2278 2010-04-22  Jakub Jelinek <jakub@redhat.com>
2279             Dodji Seketeli <dodji@redhat.com>
2280
2281         PR c/18624
2282         * cp-tree.h (mark_exp_read, rvalue_use, lvalue_use, type_use):
2283         Declare ...
2284         * expr.c (mark_exp_read, rvalue_use, lvalue_use, type_use): ... new fns.
2285         * typeck.c (cxx_sizeof_expr, cxx_alignof_expr): Call type_use.
2286         (decay_conversion, perform_integral_promotions): Call rvalue_use.
2287         (cp_build_unary_op): Call lvalue_use.
2288         * decl.c (unused_but_set_errorcount): New variable.
2289         (poplevel): Issue -Wunused-but-set-variable diagnostics.
2290         (duplicate_decls): Merge DECL_READ_P flags.
2291         (start_cleanup_fn): Set DECL_READ_P flag.
2292         (finish_function): Issue -Wunused-but-set-parameter diagnostics.
2293         * tree.c (rvalue): Call rvalue_use.
2294         * pt.c (convert_nontype_argument): Likewise.
2295         * semantics.c (finish_expr_stmt, finish_asm_stmt, finish_typeof,
2296         finish_decltype_type): Likewise.
2297         * call.c (convert_like_real) <ck_identity, ck_user>: Call rvalue use.
2298         (build_x_va_arg, build_new_method_call, build_over_call): Call lvalue_use
2299         or rvalue_use depending on the expr.
2300         * init.c (build_new, build_delete): Likewise.
2301         * rtti.c (build_typeid, build_dynamic_cast_1): Likewise.
2302
2303 2010-05-05  Jason Merrill  <jason@redhat.com>
2304
2305         PR c++/43787
2306         * cp-gimplify.c (cp_gimplify_expr): Remove copies of empty classes.
2307         * call.c (build_over_call): Don't try to avoid INIT_EXPR copies here.
2308
2309 2010-05-04  Paolo Carlini  <paolo.carlini@oracle.com>
2310
2311         PR c++/43028
2312         * pt.c (unify): Check each elt for error_mark_node.
2313
2314 2010-05-04  Jason Merrill  <jason@redhat.com>
2315
2316         PR c++/38064
2317         * typeck.c (cp_build_binary_op): Allow enums for <> as well.
2318
2319 2010-05-04  Paolo Carlini  <paolo.carlini@oracle.com>
2320
2321         PR c++/43705
2322         * call.c (build_new_method_call): Return error_mark_node if fns is
2323         NULL_TREE.
2324
2325 2010-05-03  Dodji Seketeli  <dodji@redhat.com>
2326
2327         PR c++/43953
2328         * pt.c (most_specialized_class): Pretend we are processing
2329         a template decl during the call to coerce_template_parms.
2330
2331 2010-05-03  Jason Merrill  <jason@redhat.com>
2332
2333         PR c++/42810
2334         PR c++/43680
2335         * decl.c (finish_enum): Use the TYPE_MIN_VALUE and TYPE_MAX_VALUE
2336         from the selected underlying type unless -fstrict-enums.  Set
2337         ENUM_UNDERLYING_TYPE to have the restricted range.
2338         * cvt.c (type_promotes_to): Use ENUM_UNDERLYING_TYPE.
2339         * class.c (check_bitfield_decl): Likewise.
2340
2341 2010-05-01  H.J. Lu  <hongjiu.lu@intel.com>
2342
2343         PR c++/43951
2344         * init.c (build_new_1): Revert the accidental checkin in
2345         revision 158918.
2346
2347 2010-04-30  Jason Merrill  <jason@redhat.com>
2348
2349         PR c++/43868
2350         * cxx-pretty-print.c (pp_cxx_decl_specifier_seq): Move pmf handling...
2351         (pp_cxx_type_specifier_seq): ...here.
2352
2353 2010-04-30  Steven Bosscher  <steven@gcc.gnu.org>
2354
2355         * optimize.c, parser.c, mangle.c, cp-tree.h: Do not include varray.h.
2356         * Make-lang.in: Don't include varray.h dependency in CXX_TREE_H.
2357
2358 2010-04-30  Shujing Zhao  <pearly.zhao@oracle.com>
2359
2360         PR c++/43779
2361         * typeck.c (warn_args_num): New function.
2362         (convert_arguments): Use warn_args_num to print the diagnostic
2363         messages. 
2364
2365 2010-04-29  Fabien Chêne  <fabien.chene@gmail.com>
2366
2367         PR c++/43890
2368         * init.c (diagnose_uninitialized_cst_or_ref_member): check for
2369         user-provided constructor while recursing.
2370
2371 2010-04-28  Manuel López-Ibáñez  <manu@gcc.gnu.org>
2372
2373         PR c++/9335
2374         * error.c (print_instantiation_partial_context_line): Handle
2375         recursive instantiation.
2376         (print_instantiation_partial_context): Likewise.
2377
2378 2010-04-27  Jason Merrill  <jason@redhat.com>
2379
2380         * init.c (perform_member_init): Check CLASS_TYPE_P.
2381
2382 2010-04-27  Fabien Chêne  <fabien.chene@gmail.com>
2383
2384         PR c++/29043
2385         * init.c (perform_member_init): check for uninitialized const or
2386         reference members, including array types.
2387
2388 2010-04-24  Jason Merrill  <jason@redhat.com>
2389
2390         * tree.c (get_fns): Split out from get_first_fn.
2391         * cp-tree.h: Declare it.
2392         * search.c (shared_member_p): Use it.
2393         * semantics.c (finish_qualified_id_expr): Simplify.
2394         (finish_id_expression): Simplify.
2395
2396         * semantics.c (finish_non_static_data_member): Call maybe_dummy_object
2397         whenever object is NULL_TREE.  Don't do 'this' capture here.
2398         (finish_qualified_id_expr): Pass NULL_TREE.
2399         (finish_id_expression): Likewise.
2400         (lambda_expr_this_capture): Likewise.
2401
2402         * semantics.c (finish_qualified_id_expr): Use maybe_dummy_object
2403         rather than checking current_class_ref directly.
2404         (finish_call_expr): Likewise.
2405
2406         PR c++/43856
2407         * name-lookup.c (qualify_lookup): Disqualify lambda op().
2408         * class.c (current_nonlambda_class_type): New fn.
2409         * semantics.c (nonlambda_method_basetype): New.
2410         * cp-tree.h: Declare them.
2411         * tree.c (maybe_dummy_object): Handle implicit 'this' capture.
2412
2413         * semantics.c (baselink_for_fns): Correct BASELINK_BINFO.
2414
2415         PR c++/43875
2416         * semantics.c (lambda_return_type): Complain about
2417         braced-init-list.
2418
2419         PR c++/43790
2420         * tree.c (cv_unqualified): Handle error_mark_node.
2421
2422         PR c++/41468
2423         * call.c (convert_like_real) [ck_ambig]: Just return error_mark_node
2424         if we don't want errors.
2425
2426         PR c++/41468
2427         * class.c (convert_to_base): Add complain parameter.  Pass
2428         ba_quiet to lookup_base if we don't want errors.
2429         (build_vfield_ref): Pass complain to convert_to_base.
2430         * call.c (convert_like_real): Likewise.
2431         (initialize_reference): Likewise.
2432         (perform_direct_initialization_if_possible): Pass complain to
2433         convert_like_real.
2434         * cp-tree.h: Adjust.
2435
2436 2010-04-27  Fabien Chêne  <fabien.chene@gmail.com>
2437             Jason Merrill  <jason@redhat.com>
2438
2439         PR c++/42844
2440         * decl.c (check_for_uninitialized_const_var): Handle classes that need
2441         constructing, too.
2442         (check_initializer): Call it for classes that need constructing, too.
2443         * class.c (in_class_defaulted_default_constructor): New.
2444         * cp-tree.h: Declare it.
2445
2446 2010-04-20  Jason Merrill  <jason@redhat.com>
2447
2448         PR c++/9335
2449         * init.c (constant_value_1): Treat error_mark_node as a constant
2450         if DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P is set.
2451         * cvt.c (ocp_convert): Handle getting error_mark_node from
2452         integral_constant_value.
2453         * decl.c (compute_array_index_type): Likewise.
2454
2455 2010-04-20  Dodji Seketeli  <dodji@redhat.com>
2456
2457         PR c++/43800
2458         PR c++/43704
2459         * typeck.c (incompatible_dependent_types_p): If one of the
2460         compared types if not a typedef then honour their main variant
2461         equivalence.
2462
2463 2010-04-20  Jakub Jelinek  <jakub@redhat.com>
2464
2465         * cp-tree.h (TYPE_REF_IS_RVALUE): Remove.
2466
2467 2010-04-19  Dodji Seketeli  <dodji@redhat.com>
2468
2469         PR c++/43704
2470         * typeck.c (structural_comptypes): Test dependent typedefs
2471         incompatibility before testing for their main variant based
2472         equivalence.
2473
2474 2010-04-19  Jakub Jelinek  <jakub@redhat.com>
2475
2476         * cp-tree.h (SCOPED_ENUM_P, UNSCOPED_ENUM_P, SET_SCOPED_ENUM_P): Use
2477         ENUM_IS_SCOPED bit instead of TYPE_LANG_FLAG_5.
2478
2479 2010-04-18  Eric Botcazou  <ebotcazou@adacore.com>
2480
2481         * decl.c (cxx_init_decl_processing): Remove second argument in call to
2482         build_common_tree_nodes.
2483
2484 2010-04-14  Jason Merrill  <jason@redhat.com>
2485
2486         PR c++/36625
2487         * parser.c (cp_parser_parenthesized_expression_list): Change
2488         is_attribute_list parm to int to indicate whether or not to
2489         handle initial identifier specially.
2490         (cp_parser_attribute_list): Use attribute_takes_identifier_p.
2491
2492 2010-04-13  Jason Merrill  <jason@redhat.com>
2493
2494         * call.c (type_decays_to): Check MAYBE_CLASS_TYPE_P instead of
2495         CLASS_TYPE_P.
2496         * parser.c (cp_parser_lambda_expression): Complain about lambda in
2497         unevaluated context.
2498         * pt.c (iterative_hash_template_arg): Don't crash on lambda.
2499
2500 2010-04-12  Jason Merrill  <jason@redhat.com>
2501
2502         PR c++/43641
2503         * semantics.c (maybe_add_lambda_conv_op): Use build_call_a and tweak
2504         return value directly.
2505
2506         * call.c (type_decays_to): Call cv_unqualified for non-class type.
2507
2508 2010-04-12  Fabien Chene  <fabien.chene@gmail.com>
2509
2510         PR c++/25811
2511         * cp-tree.h (diagnose_uninitialized_cst_or_ref_member): Declare.
2512         * init.c (build_new_1): Check for uninitialized const members and
2513         uninitialized reference members, when using new without
2514         new-initializer. Call diagnose_uninitialized_cst_or_ref_member.
2515         (diagnose_uninitialized_cst_or_ref_member): Define, call
2516         diagnose_uninitialized_cst_or_ref_member_1.
2517         (diagnose_uninitialized_cst_or_ref_member_1): New function.
2518
2519 2010-04-12  Richard Guenther  <rguenther@suse.de>
2520
2521         PR c++/43611
2522         * semantics.c (expand_or_defer_fn_1): Do not keep extern
2523         template inline functions.
2524
2525 2010-04-09  Manuel López-Ibáñez  <manu@gcc.gnu.org>
2526
2527         PR c++/28584
2528         * typeck.c (cp_build_c_cast): Warn for casting integer to larger
2529         pointer type.
2530
2531 2010-04-07  Jason Merrill  <jason@redhat.com>
2532
2533         PR c++/43016
2534         * decl.c (start_preparsed_function): Do defer nested functions.
2535
2536         PR c++/11094, DR 408
2537         * cp-tree.h (VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): New.
2538         * decl2.c (finish_static_data_member_decl): Set it.
2539         * decl.c (duplicate_decls): Propagate it.
2540         * pt.c (tsubst_decl): Don't substitute the domain of an array
2541         VAR_DECL if it's set.
2542         (regenerate_decl_from_template): Substitute it here.
2543         (type_dependent_expression_p): Return true if it's set.
2544         * semantics.c (finish_decltype_type): Instantiate such a variable.
2545         * typeck.c (cxx_sizeof_expr): Likewise.
2546         (strip_array_domain): New.
2547
2548         PR c++/43145
2549         * name-lookup.c (current_decl_namespace): Non-static.
2550         (pop_nested_namespace): Sanity check.
2551         * cp-tree.h: Declare current_decl_namespace.
2552         * decl.c (grokvardecl): Use it instead of current_namespace.
2553         (grokfndecl): Likewise.
2554
2555         PR c++/38392
2556         * pt.c (tsubst_friend_function): Instatiate a friend that has already
2557         been used.
2558
2559         * pt.c (print_template_statistics): New.
2560         * cp-tree.h: Declare it.
2561         * tree.c (cxx_print_statistics): Call it.
2562
2563         PR c++/41970
2564         * decl.c (grokvardecl): Tweak warning message.
2565         (grokfndecl): Likewise.
2566
2567 2010-04-07  Dodji Seketeli  <dodji@redhat.com>
2568
2569         PR c++/42697
2570         *pt.c (tsubst_decl): Get the arguments of a specialization from
2571         the specialization template, not from the most general template.
2572
2573 2010-04-07  Dodji Seketeli  <dodji@redhat.com>
2574
2575         PR c++/40239
2576         * typeck2.c (process_init_constructor_record):
2577         value-initialize members that are are not explicitely
2578         initialized.
2579
2580 2010-04-07  Jie Zhang  <jie@codesourcery.com>
2581
2582         PR c++/42556
2583         * typeck2.c (split_nonconstant_init_1): Drop empty CONSTRUCTOR
2584         when all of its elements are non-constant and have been split out.
2585
2586 2010-04-06  Taras Glek  <taras@mozilla.com>
2587             Jason Merrill  <jason@redhat.com>
2588
2589         * parser.c (cp_parser_class_specifier): Set class location to that
2590         of IDENTIFIER_NODE instead of '{' when possible.
2591         * semantics.c (begin_class_definition): Do not overide locations
2592         with less precise ones.
2593
2594 2010-04-06  Jason Merrill  <jason@redhat.com>
2595
2596         PR c++/43648
2597         * name-lookup.c (constructor_name_p): Allow X::~X even for typedefs.
2598
2599         PR c++/43621
2600         * pt.c (maybe_update_decl_type): Check the return value from
2601         push_scope.
2602
2603 2010-04-01  Jason Merrill  <jason@redhat.com>
2604
2605         * decl.c (next_initializable_field): No longer static.
2606         * cp-tree.h: Declare it.
2607         * call.c (build_aggr_conv): Fail if there are more initializers
2608         than initializable fields.
2609
2610         * semantics.c (maybe_add_lambda_conv_op): Use null_pointer_node
2611         instead of void_zero_node.
2612
2613 2010-03-31  Dodji Seketeli  <dodji@redhat.com>
2614
2615         PR c++/43558
2616         * cp-tree.h (TEMPLATE_TYPE_PARM_SIBLING_PARMS): New accessor macro.
2617         * pt.c (end_template_parm_list): Store sibling template parms of
2618         each TEMPLATE_TYPE_PARMs into its TEMPLATE_TYPE_PARM_SIBLING_PARMS.
2619         (push_template_decl_real): Don't store the containing template decl
2620         into the DECL_CONTEXT of TEMPLATE_TYPE_PARMs anymore.
2621         * typeck.c (get_template_parms_of_dependent_type): Get sibling parms
2622         of a TEMPLATE_TYPE_PARM from TEMPLATE_TYPE_PARM_SIBLING_PARMS.
2623         Simplify the logic.
2624
2625 2010-03-30  Jason Merrill  <jason@redhat.com>
2626
2627         PR c++/43076
2628         * pt.c (push_template_decl_real): Deal better with running out of
2629         scopes before running out of template parms.
2630
2631         PR c++/41185
2632         PR c++/41786
2633         * parser.c (cp_parser_direct_declarator): Don't allow VLAs in
2634         function parameter context.  Don't print an error if parsing
2635         tentatively.
2636
2637         PR c++/43559
2638         * pt.c (more_specialized_fn): Don't control cv-qualifier check
2639         with same_type_p.
2640
2641 2010-03-26  Jason Merrill  <jason@redhat.com>
2642
2643         PR c++/43509
2644         * parser.c (cp_parser_qualifying_entity): Do accept enum names in
2645         c++0x mode, but not other type-names.
2646
2647 2010-03-26  Dodji Seketeli  <dodji@redhat.com>
2648
2649         PR c++/43327
2650         * pt.c (add_to_template_args): Support NULL ARGS;
2651         (most_specialized_class): call coerce_template_parms on
2652         template arguments passed to get_class_bindings. Use
2653         add_to_template_args.
2654         (unify): Handle VAR_DECLs.
2655
2656 2010-03-26  Dodji Seketeli  <dodji@redhat.com>
2657
2658         * cp-tree.h (get_template_parms_at_level): Change unsigned parm
2659         into int.
2660         * pt.c (get_template_parms_at_level): Adjust.
2661
2662 2010-03-25  Dodji Seketeli  <dodji@redhat.com>
2663
2664         PR c++/43206
2665         * cp-tree.h (get_template_parms_at_level): Declare ...
2666         * pt.c (get_template_parms_at_level): ... new function.
2667         * typeck.c (get_template_parms_of_dependent_type): If a template
2668         type parm's DECL_CONTEXT isn't yet set, get its siblings from
2669         current_template_parms. Use get_template_parms_at_level. Remove
2670         useless test.
2671         (incompatible_dependent_types_p): If we get empty parms from just one
2672         of the template type parms we are comparing then the template parms are
2673         incompatible.
2674
2675 2010-03-24  Jason Merrill  <jason@redhat.com>
2676
2677         PR c++/43502
2678         * parser.c (make_declarator): Initialize id_loc.
2679         (cp_parser_lambda_declarator_opt): And set it.
2680
2681 2010-03-23  Jason Merrill  <jason@redhat.com>
2682
2683         Make lambda conversion op and op() non-static.
2684         * semantics.c (maybe_add_lambda_conv_op): Make non-static.
2685         Also add the thunk function returned by the conversion op.
2686         Mark the conversion deleted if the op() is variadic.
2687         * decl2.c (mark_used): Give helpful message about deleted conversion.
2688         * parser.c (cp_parser_lambda_declarator_opt): Don't make op() static.
2689         * semantics.c (finish_this_expr): Adjust.
2690         * mangle.c (write_closure_type_name): Adjust.
2691         * decl.c (grok_op_properties): Don't allow it.
2692         * call.c (build_user_type_conversion_1): No static conversion ops.
2693         (build_op_call): Or op().
2694
2695         * decl2.c (change_return_type): Fix 'this' quals.
2696
2697 2010-03-22  Jason Merrill  <jason@redhat.com>
2698
2699         PR c++/43333
2700         * tree.c (pod_type_p): Use old meaning in C++98 mode.
2701
2702         PR c++/43281
2703         * pt.c (contains_auto_r): New fn.
2704         (do_auto_deduction): Use it.
2705         (tsubst): Don't look at TREE_TYPE of a TEMPLATE_TYPE_PARM.
2706
2707 2010-03-20  Simon Martin  <simartin@users.sourceforge.net>
2708
2709         PR c++/43081:
2710         * decl2.c (grokfield): Handle invalid initializers for member
2711         functions.
2712
2713 2010-03-20  Dodji Seketeli  <dodji@redhat.com>
2714
2715         PR c++/43375
2716         * method.c (make_alias_for): Avoid crashing when DECL_LANG_SPECIFIC
2717         is NULL.
2718         * decl2.c (vague_linkage_p): Likewise.
2719
2720 2010-03-18  Paolo Carlini  <paolo.carlini@oracle.com>
2721
2722         PR c++/43418
2723         * parser.c (cp_parser_for_init_statement): Use NULL_TREE, not
2724         false, in the cp_parser_expression_statement call.
2725
2726 2010-03-05  Jason Merrill  <jason@redhat.com>
2727
2728         * mangle.c (mangle_decl): Give name collision error even without
2729         ASM_OUTPUT_DEF.
2730
2731 2010-03-04  Marco Poletti  <poletti.marco@gmail.com>
2732
2733         * pt.c (process_partial_specialization): Use error_n instead of
2734         error.
2735
2736 2010-03-03  Jason Merrill  <jason@redhat.com>
2737
2738         PR c++/12909
2739         * mangle.c (mangle_decl): Handle VAR_DECL, too.
2740
2741 2010-03-03  Jason Merrill  <jason@redhat.com>
2742
2743         PR c++/12909
2744         * mangle.c: Include cgraph.h.
2745         (mangle_decl): If the mangled name will change in a later
2746         ABI version, make the later mangled name an alias.
2747         * method.c (make_alias_for): Copy DECL_ARGUMENTS.
2748         * Make-lang.in (mangle.o): Depend on cgraph.h.
2749         * method.c (make_alias_for): Handle VAR_DECL, too.
2750         * decl2.c (vague_linkage_p): Rename from vague_linkage_fn_p.
2751         * tree.c (no_linkage_check): Adjust.
2752         * decl.c (maybe_commonize_var): Adjust.
2753         * cp-tree.h: Adjust.
2754
2755 2010-03-01  Marco Poletti  <poletti.marco@gmail.com>
2756
2757         * pt.c (redeclare_class_template): Use error_n and inform_n.
2758
2759 2010-02-27  Mark Mitchell  <mark@codesourcery.com>
2760
2761         PR c++/42748
2762         * cp-tree.h (push_tinst_level): Declare.
2763         (pop_tinst_level): Likewise.
2764         * pt.c (push_tinst_level): Give it external linkage.
2765         (pop_tinst_level): Likewise.
2766         * mangle.c (mangle_decl_string): Set the source location to that
2767         of the decl while mangling.
2768
2769 2010-02-27  Simon Martin  <simartin@users.sourceforge.net>
2770
2771         PR c++/42054
2772         * pt.c (redeclare_class_template): Return false if there are erroneous
2773         template parameters.
2774
2775 2010-02-24  Manuel López-Ibáñez  <manu@gcc.gnu.org>
2776
2777         * pt.c (push_tinst_level): Replace -ftemplate-depth- with 
2778         -ftemplate-depth=.
2779
2780 2010-02-24  Jason Merrill  <jason@redhat.com>
2781
2782         PR c++/12909
2783         * mangle.c (write_type): Give -Wabi warning for old vector mangling.
2784
2785         * class.c (layout_class_type): Don't give -Wabi warning for a bug
2786         in a previous ABI version.
2787
2788 2010-02-23  Jason Merrill  <jason@redhat.com>
2789
2790         PR c++/43143
2791         * typeck2.c (digest_init_r): Accept value init of array.
2792
2793 2010-02-22  Manuel López-Ibáñez  <manu@gcc.gnu.org>
2794
2795         PR c++/43126
2796         * typeck.c (convert_arguments): Update error message.
2797
2798 2010-02-22  Mike Stump  <mikestump@comcast.net>
2799
2800         PR c++/43125
2801         * decl.c (duplicate_decls): Merge DECL_PRESERVE_P.
2802
2803 2010-02-21  Manuel López-Ibáñez  <manu@gcc.gnu.org>
2804
2805         PR c++/23510
2806         * error.c (print_instantiation_partial_context_line): New.
2807         (print_instantiation_partial_context): Print at most 12 contexts,
2808         skip the rest with a message.
2809
2810 2010-02-21  Dodji Seketeli  <dodji@redhat.com>
2811
2812         PR c++/42824
2813         * pt.c (lookup_template_class): Better support of specialization
2814         of member of class template implicit instantiation.
2815
2816 2010-02-20  Manuel López-Ibáñez  <manu@gcc.gnu.org>
2817
2818         PR c++/35669
2819         * call.c (conversion_null_warnings): Replace -Wconversion with
2820         -Wconversion-null.
2821         * cvt.c (build_expr_type_conversion): Likewise.
2822
2823 2010-02-18  Jason Merrill  <jason@redhat.com>
2824
2825         PR c++/42837
2826         * class.c (create_vtable_ptr): Set DECL_PACKED if type is packed.
2827
2828         PR c++/43108
2829         * typeck.c (cp_build_binary_op): Adapt mixed complex/non handling from
2830         C build_binary_op.
2831         * cp-tree.h (WANT_VECTOR_OR_COMPLEX): Rename from WANT_VECTOR.
2832         * cvt.c (build_expr_type_conversion): Allow COMPLEX_TYPE.
2833
2834         PR c++/43070
2835         * semantics.c (finish_goto_stmt): Don't call decay_conversion.
2836
2837         PR c++/26261
2838         PR c++/43101
2839         * pt.c (tsubst_qualified_id): Do normal lookup in non-dependent scope.
2840         (maybe_update_decl_type): New fn.
2841         * parser.c (cp_parser_init_declarator): Use it.
2842
2843         PR c++/43109
2844         * semantics.c (begin_class_definition): Don't crash on unnamed ns.
2845
2846 2010-02-17  Jason Merrill  <jason@redhat.com>
2847
2848         PR c++/43075
2849         * call.c (build_over_call): Don't create zero-sized assignments.
2850         * cp-gimplify.c (cp_genericize_r): Don't remove them here.
2851         * cp-objcp-common.c (cp_expr_size): Remove.
2852         * cp-tree.h: Remove prototype.
2853
2854         PR c++/43069
2855         * name-lookup.c (set_decl_namespace): Don't copy DECL_CONTEXT if the
2856         decl we looked up doesn't match.
2857
2858         PR c++/43093
2859         * cp-gimplify.c (cp_gimplify_expr) [INIT_EXPR]: Return if we don't
2860         have an INIT_EXPR anymore.
2861
2862         PR c++/43079
2863         * pt.c (convert_nontype_argument): Change assert to test.
2864
2865 2010-02-16  Jason Merrill  <jason@redhat.com>
2866
2867         * cp-gimplify.c (cp_gimplify_expr): Fix error recovery.
2868
2869         PR c++/43031
2870         * cp-gimplify.c (cp_gimplify_expr) [MODIFY_EXPR]: Use
2871         VIEW_CONVERT_EXPR for conversions between structural equality types
2872         that the back end can't tell are the same.
2873
2874         PR c++/43036
2875         * tree.c (build_cplus_array_type): Set TYPE_MAIN_VARIANT to strip
2876         cv-quals from element here.
2877         (cp_build_qualified_type_real): Not here.  Preserve typedef name.
2878
2879 2010-02-14  Jason Merrill  <jason@redhat.com>
2880
2881         PR c++/41997
2882         * semantics.c (finish_compound_literal): Use
2883         cp_apply_type_quals_to_decl when creating a static variable.
2884
2885 2010-02-12  Jason Merrill  <jason@redhat.com>
2886
2887         PR c++/43024
2888         * name-lookup.h (current_binding_level): Check for null
2889         cp_function_chain.
2890
2891 2010-02-12  Jason Merrill  <jason@redhat.com>
2892
2893         PR c++/43054
2894         * tree.c (cp_tree_equal): Correct CALL_EXPR logic.
2895
2896 2010-02-12  Jakub Jelinek  <jakub@redhat.com>
2897
2898         PR c++/43033
2899         * name-lookup.c (pushdecl_maybe_friend): Check default args of t
2900         instead of x.
2901
2902 2010-02-10  Jason Merrill  <jason@redhat.com>
2903
2904         PR c++/41896
2905         * semantics.c (outer_lambda_capture_p): Revert.
2906         (add_capture): Only finish_member_declaration if
2907         we're in the lambda class.
2908         (register_capture_members): New.
2909         * cp-tree.h: Declare it.
2910         * parser.c (cp_parser_lambda_expression): Call it.
2911
2912 2010-02-10  Jason Merrill  <jason@redhat.com>
2913
2914         PR c++/41896
2915         * semantics.c (outer_lambda_capture_p): Use current_function_decl
2916         instead of current_class_type.
2917
2918 2010-02-10  Jason Merrill  <jason@redhat.com>
2919
2920         PR c++/42983, core issue 906
2921         * method.c (defaultable_fn_check): Check virtualness.
2922
2923 2010-02-10  Jason Merrill  <jason@redhat.com>
2924
2925         PR c++/43016
2926         * semantics.c (maybe_add_lambda_conv_op): Set DECL_INTERFACE_KNOWN.
2927
2928 2010-02-10  Shujing Zhao  <pearly.zhao@oracle.com>
2929
2930         * Make-lang.in (cp/cvt.o, cp/parser.o, cp/search.o): Depend on intl.h.
2931         * cvt.c (warn_ref_binding): Wrap the messages into G_() for easy
2932         translation.
2933         * parser.c (cp_parser_postfix_expression, cp_parser_new_type_id)
2934         (cp_parser_cast_expression, cp_parser_condition, cp_parser_decltype)
2935         (cp_parser_parameter_declaration)
2936         (cp_parser_exception_specification_opt)
2937         (cp_parser_exception_declaration): Likewise.
2938         * pt.c (check_default_tmpl_args): Likewise.
2939         * search.c (lookup_field_r): Likewise.
2940
2941 2010-02-09  Jason Merrill  <jason@redhat.com>
2942
2943         PR c++/42399
2944         * pt.c (tsubst_copy_and_build): Propagate LAMBDA_EXPR_LOCATION.
2945
2946 2010-02-09  Jason Merrill  <jason@redhat.com>
2947
2948         PR c++/42370
2949         * decl2.c (change_return_type): New fn.
2950         * semantics.c (apply_lambda_return_type): Use it.
2951         * cp-tree.h: Declare it.
2952
2953 2010-02-05  Richard Guenther  <rguenther@suse.de>
2954
2955         * Make-lang.in (cp/cp-lang.o): Depend on gt-cp-cp-lang.h.
2956         * cp-lang.c: Include gt-cp-cp-lang.h.
2957         * config-lang.in (gtfiles): Add cp/cp-lang.c.
2958
2959 2010-02-05  Dodji Seketeli  <dodji@redhat.com>
2960
2961         PR c++/42915
2962         * typeck.c (get_template_parms_of_dependent_type): Try getting
2963         the template parameters fromt the type itself first.
2964
2965 2010-02-03  Jason Merrill  <jason@redhat.com>
2966
2967         PR c++/4926
2968         PR c++/38600
2969         * mangle.c (write_unqualified_id): Split out from write_expression.
2970         (write_unqualified_name): Call it.
2971         (write_member_name): Likewise.
2972         (write_expression): Support TEMPLATE_ID_EXPR.
2973         Disambiguate operator names.
2974
2975         PR c++/12909
2976         * mangle.c (write_type) [VECTOR_TYPE]: Change mangling with
2977         -fabi-version=4.
2978
2979 2010-02-02  Jason Merrill  <jason@redhat.com>
2980
2981         PR c++/41090
2982         * decl.c (cp_finish_decl): Add local statics to cfun->local_decls.
2983         * optimize.c (clone_body): Remap their initializers when making base
2984         variants.
2985         (maybe_clone_body): Complain if multiple clones aren't safe.
2986
2987 2010-01-29  Dodji Seketeli  <dodji@redhat.com>
2988
2989         PR c++/42758
2990         PR c++/42634
2991         PR c++/42336
2992         PR c++/42797
2993         PR c++/42880
2994         * cp-tree.h (NON_DEFAULT_TEMPLATE_ARGS_COUNT,
2995         SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT,
2996         GET_NON_DEFAULT_TEMPLATE_ARGS_COUNT): New accessor macros.
2997         * pt.c (coerce_template_parms, type_unification_real,
2998         expand_template_argument_pack, coerce_template_parameter_pack):
2999         Set the non default template args count.
3000         (current_template_args): Always set non defaulted
3001         template args count when compiled with --enable-checking
3002         (tsubst_template_args, type_unification_real): Propagate the non
3003         defaulted template args count.
3004         * error.c (get_non_default_template_args_count): Renamed
3005         count_non_default_template_args into this. Don't calculate the
3006         non default template argument count anymore. Use the new
3007         accessor macros above to get it.
3008         (dump_template_argument_list, dump_type, dump_decl,
3009         dump_template_parms): Adjust.
3010         * parser.c (cp_parser_template_argument_list): Always set defaulted
3011         template args count when compiled with --enable-checking.
3012
3013 2010-01-29  Shujing Zhao  <pearly.zhao@oracle.com>
3014
3015         * decl.c (redeclaration_error_message): Wrap the return messages into
3016         G_() for easy translation.
3017
3018 2010-01-28  Jason Merrill  <jason@redhat.com>
3019
3020         PR c++/42880
3021         * semantics.c (begin_class_definition): Don't use type_as_string.
3022
3023 2010-01-28  Dodji Seketeli  <dodji@redhat.com>
3024
3025         PR c++/42713
3026         PR c++/42820
3027         * typeck.c (get_template_parms_of_dependent_type): Factorized
3028         this out of incompatible_template_type_parms_p
3029         (incompatible_dependent_types_p): Renamed
3030         incompatible_template_type_parms_p into this. Make it detect
3031         two incompatible dependent typedefs too.
3032         (structural_comptypes): Use incompatible_dependent_types_p.
3033         * pt.c (get_template_info):
3034         Handle BOUND_TEMPLATE_TEMPLATE_PARAM.
3035
3036 2010-01-20  Janis Johnson  <janis187@us.ibm.com>
3037             Jason Merrill  <jason@redhat.com>
3038
3039         * mangle.c (write_type): Mangle transparent record as member type.
3040         * semantics.c (begin_class_definition): Recognize decimal classes
3041         and set TYPE_TRANSPARENT_AGGR.
3042
3043 2010-01-20  Jason Merrill  <jason@redhat.com>
3044
3045         PR c++/42338
3046         * mangle.c (write_expression): Handle tree codes that have extra
3047         arguments in the middle-end.
3048
3049 2010-01-20  Paolo Carlini  <paolo.carlini@oracle.com>
3050
3051         PR c++/42038
3052         * except.c (expand_start_catch_block): Deal correctly with
3053         do_begin_catch returning error_mark_node.
3054
3055 2010-01-20  Jason Merrill  <jason@redhat.com>
3056
3057         PR c++/41788
3058         * class.c (layout_class_type): Set packed_maybe_necessary for packed
3059         non-PODs.
3060
3061         PR c++/41920
3062         * semantics.c (build_lambda_object): Call mark_used on captured
3063         variables.
3064
3065         PR c++/40750
3066         * decl.c (grokdeclarator): Clear type_quals for a member function
3067         declared using a typedef.  Don't complain about adding cv-quals
3068         to a function typedef in C++0x mode.
3069
3070 2010-01-20  Jakub Jelinek  <jakub@redhat.com>
3071
3072         * decl.c (create_array_type_for_decl): Remove set but not used
3073         variable error_msg.  Remove break stmts after return stmts.
3074
3075 2010-01-19  Dodji Seketeli  <dodji@redhat.com>
3076
3077         * error.c (dump_template_parms, count_non_default_template_args):
3078         Revert fix of PR c++/42634.
3079
3080 2010-01-18  Dodji Seketeli  <dodji@redhat.com>
3081
3082         PR c++/42634
3083         * error.c (dump_template_parms): Use innermost template
3084         arguments before calling count_non_default_template_args.
3085         (count_non_default_template_args): We are being called with
3086         template innermost arguments now. There is no need to ensure
3087         that again.
3088
3089 2010-01-18  Dodji Seketeli  <dodji@redhat.com>
3090
3091         PR c++/42766
3092         * cvt.c (build_expr_type_conversion): Look through OVERLOAD.
3093
3094 2010-01-17  Dodji Seketeli  <dodji@redhat.com>
3095
3096         PR c++/42697
3097         *pt.c (tsubst_decl):  Revert commit for PR c++/42697.
3098
3099 2010-01-17  Dodji Seketeli  <dodji@redhat.com>
3100
3101         PR c++/42697
3102         *pt.c (tsubst_decl): Get the arguments of a specialization from
3103         the specialization template, not from the most general template.
3104
3105 2010-01-16  Jason Merrill  <jason@redhat.com>
3106
3107         PR c++/42761
3108         * semantics.c (finish_decltype_type): Within a template, treat
3109         unresolved CALL_EXPR as dependent.
3110
3111 2010-01-15  Dodji Seketeli  <dodji@redhat.com>
3112
3113         * error.c (dump_template_parms,count_non_default_template_args):
3114         Revert changes of PR c++/42634.
3115
3116 2010-01-14  Jakub Jelinek  <jakub@redhat.com>
3117
3118         PR middle-end/42674
3119         * decl.c (finish_function): Don't emit -Wreturn-type warnings in
3120         functions with noreturn attribute.
3121
3122 2010-01-14  Jason Merrill  <jason@redhat.com>
3123
3124         PR c++/42701
3125         * call.c (build_new_method_call): Don't free the vec here.
3126
3127         PR c++/42655
3128         * call.c (convert_like_real): Do full decay_conversion for ck_rvalue.
3129
3130 2010-01-13  Dodji Seketeli  <dodji@redhat.com>
3131
3132         PR c++/42634
3133         * error.c (dump_template_parms): Use innermost template
3134         arguments before calling count_non_default_template_args.
3135         (count_non_default_template_args): We are being called with
3136         template innermost arguments now. There is no need to ensure
3137         that again.
3138
3139 2010-01-07  Dodji Seketeli  <dodji@redhat.com>
3140
3141         c++/40155
3142         * pt.c (unify_pack_expansion): In non-deduced contexts, re-use template
3143         arguments that were previously deduced.
3144
3145 2010-01-05  Jason Merrill  <jason@redhat.com>
3146
3147         * pt.c (unify_pack_expansion): Handle deduction from init-list.
3148         * call.c (build_over_call): Don't complain about it.
3149
3150 2010-01-04  Jason Merrill  <jason@redhat.com>
3151
3152         PR c++/42555
3153         * pt.c (tsubst_decl): Don't apply type attributes in place.
3154
3155         PR c++/42567
3156         * semantics.c (describable_type): Remove decltype comment and
3157         semantics.
3158
3159
3160 \f
3161 Copyright (C) 2010 Free Software Foundation, Inc.
3162
3163 Copying and distribution of this file, with or without modification,
3164 are permitted in any medium without royalty provided the copyright
3165 notice and this notice are preserved.
3166