OSDN Git Service

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