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