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