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