Core 1191
[gcc.git] / gcc / cp / ChangeLog
1 2011-03-15 Jason Merrill <jason@redhat.com>
2
3 Core 1191
4 * method.c (synthesized_method_walk): Cleanups don't affect the
5 triviality of a constructor, but do affect deletion and exception
6 specification.
7
8 2011-03-15 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
9
10 * decl2.c (cp_check_const_attributes): New.
11 (cplus_decl_attributes): Call cp_check_const_attributes.
12
13 2011-03-15 Jason Merrill <jason@redhat.com>
14
15 PR c++/34758
16 * call.c (convert_default_arg): Use DECL_ORIGIN of fn. Check for
17 recursion first.
18 (push_defarg_context, pop_defarg_context): New.
19 * parser.c (cp_parser_late_parsing_default_args): Use them.
20 * cp-tree.h: Declare them.
21
22 2011-03-11 Dodji Seketeli <dodji@redhat.com>
23
24 * call.c (add_builtin_candidate)<case INDIRECT_REF>: The type of
25 the argument of the indirection operator should not be dependent.
26 Fix the comment.
27
28 2011-03-11 Jason Merrill <jason@redhat.com>
29
30 PR c++/47125
31 * pt.c (tsubst) [TYPENAME_TYPE]: Only give errors if tf_error.
32
33 PR c++/47144
34 * parser.c (cp_parser_template_type_arg): Set
35 type_definition_forbidden_message.
36
37 PR c++/47808
38 * decl.c (compute_array_index_type): Discard folding
39 if it didn't produce a constant.
40
41 2011-03-11 Jakub Jelinek <jakub@redhat.com>
42
43 PR c++/48035
44 * init.c (build_zero_init_1): Extracted from build_zero_init.
45 Add FIELD_SIZE argument, if non-NULL and field bit_position
46 as not smaller than that, don't add that field's initializer.
47 Pass DECL_SIZE as last argument to build_zero_init_1
48 for DECL_FIELD_IS_BASE fields.
49 (build_zero_init): Use build_zero_init_1.
50
51 2011-03-10 Jason Merrill <jason@redhat.com>
52
53 PR c++/48029
54 * pt.c (iterative_hash_template_arg): Remove special case for
55 ARRAY_TYPE.
56
57 PR c++/47198
58 * parser.c (cp_parser_single_declaration): Just return if
59 cp_parser_parse_and_diagnose_invalid_type_name complained.
60
61 2011-03-09 Jason Merrill <jason@redhat.com>
62
63 PR c++/44629
64 * pt.c (unify): An unresolved overload is a nondeduced context.
65
66 2011-03-09 Martin Jambor <mjambor@suse.cz>
67
68 PR tree-optimization/47714
69 * method.c (use_thunk): Clear addressable flag of thunk arguments.
70
71 2011-03-08 Dodji Seketeli <dodji@redhat.com>
72
73 PR c++/47705
74 * pt.c (convert_nontype_argument): Only call decay_conversion on
75 arrays.
76
77 2011-03-08 Jason Merrill <jason@redhat.com>
78
79 PR c++/47488
80 * mangle.c (write_template_arg_literal) [STRING_CST]: Sorry.
81
82 PR c++/47705
83 * pt.c (convert_nontype_argument): Don't crash on non-pointer
84 argument to pointer parameter.
85
86 PR c++/45651
87 * pt.c (instantiate_decl): Don't clear DECL_INTERFACE_KNOWN on
88 !TREE_PUBLIC decls.
89
90 2011-03-08 Dodji Seketeli <dodji@redhat.com>
91
92 PR c++/47957
93 * name-lookup.c (binding_to_template_parms_of_scope_p): Only
94 consider scopes of primary template definitions. Adjust comments.
95
96 2011-03-07 Jason Merrill <jason@redhat.com>
97
98 PR c++/48003
99 * pt.c (convert_nontype_argument): Fix -fpermissive allowing
100 integer overflow.
101 * semantics.c (potential_constant_expression_1): Check TREE_OVERFLOW.
102
103 PR c++/48015
104 * init.c (constant_value_1): Always require init to be TREE_CONSTANT.
105
106 PR c++/48008
107 * mangle.c (write_type): Strip cv-quals from FUNCTION_TYPE here.
108 (write_CV_qualifiers_for_type): Not here.
109
110 2011-03-06 Joseph Myers <joseph@codesourcery.com>
111
112 * lang-specs.h: Match -save-temps* instead of -save-temps.
113
114 2011-03-05 Jason Merrill <jason@redhat.com>
115
116 * mangle.c (write_expression): Change ABI v6 to v5.
117 (write_type): Likewise.
118
119 2011-03-04 Jan Hubicka <jh@suse.cz>
120
121 PR lto/47497
122 * optimize.c (maybe_clone_body): Update call of cgraph_same_body_alias
123 and cgraph_add_thunk.
124 * method.c (make_alias_for_thunk, use_thunk): Likewise.
125 * mangle.c (mangle_decl): Likewise.
126
127 2011-03-04 Jason Merrill <jason@redhat.com>
128
129 PR c++/47971
130 * pt.c (tsubst_copy_and_build) [PSEUDO_DTOR_EXPR]: Use tsubst for type.
131 (tsubst_copy) [default]: Just return t if !ENABLE_CHECKING.
132
133 PR c++/46220
134 * search.c (check_final_overrider): Allow pointer to same incomplete
135 class type with different cv-quals.
136
137 2011-03-03 Paolo Carlini <paolo.carlini@oracle.com>
138
139 PR c++/47974
140 * pt.c (tsubst_template_args): Check argument t for error_mark_node.
141
142 2011-03-03 Jason Merrill <jason@redhat.com>
143
144 PR c++/47950
145 * pt.c (tsubst_copy_and_build) [TARGET_EXPR]: Retain TREE_CONSTANT.
146
147 2011-03-02 Jason Merrill <jason@redhat.com>
148
149 PR c++/47950
150 * parser.c (cp_parser_condition): Don't fold_non_dependent_expr here.
151
152 PR c++/47774
153 * tree.c (build_vec_init_elt): Split out from...
154 (build_vec_init_expr): ...here.
155 (diagnose_non_constexpr_vec_init): New fn.
156 * semantics.c (potential_constant_expression_1): Use it.
157 * cp-tree.h: Declare it.
158
159 2011-03-01 Jason Merrill <jason@redhat.com>
160
161 PR c++/46159
162 * parser.c (cp_parser_primary_expression): Don't warn about a
163 failed tentative parse.
164
165 PR c++/47200
166 * semantics.c (cxx_bind_parameters_in_call): Don't call
167 adjust_temp_type on non-constant args.
168
169 PR c++/47851
170 * call.c (standard_conversion): Provide requested cv-quals on
171 class rvalue conversion.
172
173 PR c++/46282
174 * decl2.c (grokbitfield): Handle type-dependent width.
175
176 2011-02-28 Jason Merrill <jason@redhat.com>
177
178 PR c++/47873
179 * class.c (update_vtable_entry_for_fn): Check BINFO_LOST_PRIMARY_P
180 after checking for a non-thunk.
181
182 2011-02-26 Jason Merrill <jason@redhat.com>
183
184 PR c++/47904
185 * tree.c (cp_tree_equal): Compare DECL_PARM_LEVEL.
186 * pt.c (iterative_hash_template_arg): And hash it.
187
188 PR c++/47897
189 * semantics.c (non_const_var_error): Split out from...
190 (cxx_eval_constant_expression): ...here.
191 (potential_constant_expression_1) [VAR_DECL]: Use it.
192 Allow dependent variables.
193
194 2011-02-24 Jason Merrill <jason@redhat.com>
195
196 * parser.c (cp_parser_constant_expression): Set
197 non_integral_constant_expression correctly for C++0x too.
198 (cp_parser_static_assert): Allow non-constant expression.
199 (cp_parser_direct_declarator): Expect non_constant_p to be set
200 properly for C++0x.
201 * pt.c (value_dependent_expression_p): Handle TYPEID_EXPR.
202 * semantics.c (maybe_constant_value): Check type_unknown_p too.
203 (potential_rvalue_constant_expression): New.
204 (require_potential_rvalue_constant_expression): New.
205
206 2011-02-23 Jason Merrill <jason@redhat.com>
207
208 * cp-tree.h (DECL_PARM_LEVEL): New.
209 (struct lang_decl_parm): Add level field.
210 * name-lookup.c (function_parm_depth): New fn.
211 * name-lookup.h: Declare it.
212 * parser.c (cp_parser_parameter_declaration_list): Use it.
213 * mangle.c (struct globals): Add parm_depth field.
214 (write_bare_function_type): Adjust it.
215 (write_expression): Include the level delta in PARM_DECL mangling
216 for abi >= 6.
217
218 * semantics.c (finish_decltype_type): Remove shortcut for decltype
219 of id-expression.
220 * mangle.c (write_type) [DECLTYPE_TYPE]: Strip it here for abi < 6.
221
222 2011-02-23 Nathan Froyd <froydnj@codesourcery.com>
223
224 PR c++/46868
225 * parser.c (cp_parser_class_specifier): Require a closing brace
226 to attempt error recovery.
227
228 2011-02-23 Jakub Jelinek <jakub@redhat.com>
229
230 PR c++/47833
231 * pt.c (struct pending_template): Add chain_next GTY option.
232 * decl.c (struct named_label_use_entry): Likewise.
233
234 2011-02-22 Paolo Carlini <paolo.carlini@oracle.com>
235
236 PR c++/47242
237 * semantics.c (build_lambda_object): Bail out if a field is
238 error_mark_node.
239
240 2011-02-22 Dodji Seketeli <dodji@redhat.com>
241
242 PR c++/47666
243 * class.c (dfs_declare_virt_assop_and_dtor)
244 (declare_virt_assop_and_dtor): New static functions.
245 (add_implicitly_declared_members): Use
246 declare_virt_assop_and_dtor.
247
248 2011-02-21 Jason Merrill <jason@redhat.com>
249
250 PR c++/47207
251 * decl2.c (decl_constant_var_p): A constexpr var needs an
252 initializer to be constant.
253 * semantics.c (cxx_eval_constant_expression): Complain about
254 constexpr var used in its own initializer.
255 * call.c (set_up_extended_ref_temp): Set
256 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P too.
257
258 2011-02-20 Jason Merrill <jason@redhat.com>
259
260 PR c++/47199
261 * semantics.c (cxx_eval_call_expression): Call
262 cxx_eval_constant_expression in trivial shortcut.
263
264 PR c++/46831
265 * call.c (convert_class_to_reference): Don't try to set up a
266 second conv sequence for non-viable candidates.
267
268 PR c++/47703
269 * error.c (location_of): Handle non-tagged types.
270
271 PR c++/46472
272 * method.c (process_subob_fn): Instantiate constexpr templates.
273 * optimize.c (maybe_clone_body): Propagate DECL_DECLARED_CONSTEXPR_P.
274
275 2011-02-20 Dodji Seketeli <dodji@redhat.com>
276
277 PR c++/46394
278 * pt.c (tsubst_pack_expansion): do not use
279 cp_tree_equal/same_type_p to detect an expansion of a parameter
280 pack.
281
282 2011-02-19 Jason Merrill <jason@redhat.com>
283
284 PR c++/47503
285 * semantics.c (cxx_eval_call_expression): Shortcut trivial copy.
286
287 2011-02-18 Paolo Carlini <paolo.carlini@oracle.com>
288
289 PR c++/47795
290 * semantics.c (finish_non_static_data_member): Early return if
291 object is error_mark_node.
292
293 2011-02-18 Dodji Seketeli <dodji@redhat.com>
294
295 PR c++/47208
296 * pt.c (do_auto_deduction): Do not mention error_mark_node in
297 diagnostics.
298 * semantics.c (finish_id_expression): Do not pass erroneous decl
299 to decl_constant_var_p.
300
301 2011-02-17 Jakub Jelinek <jakub@redhat.com>
302
303 PR c++/47783
304 * cvt.c (convert_from_reference): Call mark_exp_read.
305
306 2011-02-11 Dodji Seketeli <dodji@redhat.com>
307
308 PR c++/47172
309 * pt.c (finish_call_expr): Consider a call expression that has a
310 dependent "this" pointer as being dependent. Add comments.
311 (dependent_type_p, type_dependent_expression_p): Update comments.
312
313 2011-02-16 Dodji Seketeli <dodji@redhat.com>
314
315 PR c++/47326
316 * pt.c (tsubst_copy)<case SIZEOF_EXPR>: Ensure that even pack
317 expansion arguments are not evaluated.
318
319 2011-02-16 Jakub Jelinek <jakub@redhat.com>
320
321 PR c++/47704
322 * cp-tree.h (ENUM_FIXED_UNDERLYING_TYPE_P): Use TYPE_LANG_FLAG_5
323 instead of TYPE_LANG_FLAG_3.
324 * pt.c (lookup_template_class): Copy over
325 ENUM_FIXED_UNDERLYING_TYPE_P.
326
327 2011-02-15 Jason Merrill <jason@redhat.com>
328
329 PR c++/46807
330 * method.c (synthesized_method_walk): Always exit early for
331 trivial fn in C++98 mode.
332
333 2011-02-14 Jason Merrill <jason@redhat.com>
334
335 PR c++/47482
336 * parser.c (cp_parser_enumerator_definition): Call
337 fold_non_dependent_expr.
338
339 2011-02-09 Jason Merrill <jason@redhat.com>
340
341 * decl.c (cp_make_fname_decl): Set DECL_THIS_STATIC at toplevel.
342 * semantics.c (finish_fname): Only return the name if we're in
343 a function.
344
345 * decl.c (build_enumerator): Don't perform integral promotions on
346 non-integral constants.
347
348 * cvt.c (convert_to_void): Handle null op1.
349
350 * class.c (type_has_constexpr_default_constructor): Make sure the
351 caller stripped an enclosing array.
352 * init.c (perform_member_init): Strip arrays before calling it.
353
354 PR c++/47511
355 * semantics.c (potential_constant_expression_1): Handle TEMPLATE_DECL.
356
357 2011-02-03 Dodji Seketeli <dodji@redhat.com>
358
359 PR c++/47398
360 * tree.c (cp_tree_equal)<TEMPLATE_PARM_INDEX>: Take the number of
361 template parameters in account.
362
363 2011-02-03 Nathan Froyd <froydnj@codesourcery.com>
364
365 PR c++/46890
366 * parser.c (cp_parser_class_specifier): Fix setting of
367 want_semicolon.
368
369 2011-01-31 Jakub Jelinek <jakub@redhat.com>
370
371 PR c++/47416
372 * semantics.c (build_data_member_initialization): Handle
373 STATEMENT_LIST always instead of just for CLEANUP_BODY.
374
375 2011-01-31 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
376
377 * g++spec.c (lang_specific_driver) [HAVE_LD_STATIC_DYNAMIC] Use
378 LD_STATIC_OPTION, LD_DYNAMIC_OPTION.
379
380 2011-01-29 Dodji Seketeli <dodji@redhat.com>
381
382 PR c++/47311
383 * cp-tree.h (fixup_template_parms): Declare.
384 * pt.c (end_template_parm_list): Do not fixup template parms here.
385 (fixup_template_parms): Remove static. Fix typo in the
386 comments. Remove useless code statement.
387 (fixup_template_parm): For a template template parameter, fixup
388 its attributes before fixing up its type.
389 * parser.c
390 (cp_parser_template_declaration_after_export): After parsing
391 template parameters fixup their types.
392
393 2011-01-26 Jakub Jelinek <jakub@redhat.com>
394
395 PR c++/47476
396 * semantics.c (potential_constant_expression_1): Handle
397 TRUTH_XOR_EXPR.
398
399 2011-01-26 Dave Korn <dave.korn.cygwin@gmail.com>
400
401 PR c++/43601
402 * semantics.c (expand_or_defer_fn_1): Handle it.
403 * decl2.c (decl_needed_p): Likewise.
404
405 2011-01-21 Jason Merrill <jason@redhat.com>
406
407 PR c++/47041
408 * semantics.c (build_constexpr_constructor_member_initializers):
409 Handle trivial copy.
410
411 2011-01-21 Jakub Jelinek <jakub@redhat.com>
412
413 PR c++/47388
414 * semantics.c (begin_for_stmt): If -fno-for-scope, don't
415 assume init must be NULL if scope is NULL.
416 (begin_range_for_stmt): Likewise.
417
418 2011-01-21 Jason Merrill <jason@redhat.com>
419
420 PR c++/46552
421 * semantics.c (cxx_eval_constant_expression): Handle OFFSET_REF.
422
423 PR c++/46977
424 * semantics.c (potential_constant_expression_1): Split out from
425 potential_constant_expression. Add want_rval parm. Handle
426 template expression forms. Don't enforce restriction on address
427 of automatic variable here. Add a couple of diagnostics that
428 had been missing.
429 (require_potential_constant_expression): New entry point.
430 (build_data_member_initialization, register_constexpr_fundef): Adjust.
431 (maybe_constant_value): Check potential_constant_expression.
432 * pt.c (fold_non_dependent_expr_sfinae): Likewise.
433 * tree.c (build_vec_init_expr): Adjust.
434
435 2011-01-19 Jakub Jelinek <jakub@redhat.com>
436
437 PR c++/47303
438 * decl2.c (finish_anon_union): Only call mangle_decl if TREE_STATIC
439 or DECL_EXTERNAL.
440
441 2011-01-17 Jason Merrill <jason@redhat.com>
442
443 PR c++/47067
444 * semantics.c (base_field_constructor_elt): New fn.
445 (cxx_eval_bare_aggregate): Use it.
446 (build_data_member_initialization): Leave COMPONENT_REF for
447 vfield inits.
448
449 2011-01-14 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
450
451 * parser.c (cp_parser_range_for): Remove the "unused variable" warning
452 workaround.
453
454 2011-01-15 Giovanni Funchal <gafunchal@gmail.com>
455 Jonathan Wakely <jwakely.gcc@gmail.com>
456
457 PR c++/33558
458 * decl.c (grokdeclarator): Reject mutable reference members.
459
460 2011-01-14 Jason Merrill <jason@redhat.com>
461
462 PR c++/47289
463 * pt.c (coerce_template_parms): Fix error recovery.
464
465 PR c++/46903
466 * typeck2.c (check_narrowing): Only check arithmetic types.
467
468 PR c++/46688
469 * tree.c (build_vec_init_expr): Handle flexible array
470 properly.
471
472 2011-01-13 Kai Tietz <kai.tietz@onevision.com>
473
474 PR c++/47213
475 * cp-tree.h (CLASSTYPE_VISIBILITY): Use
476 TYPE_MAIN_DECL instead of TYPE_NAME.
477 (CLASSTYPE_VISIBILITY_SPECIFIED): Likewise.
478 * decl2.c (determine_visibility): Add check
479 of CLASS_TYPE_P for underlying_type.
480
481 2011-01-12 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
482
483 * cp-tree.h (begin_for_scope): New prototype.
484 (begin_for_stmt): Update prototype.
485 (begin_range_for_stmt): Update prototype.
486 * init.c (build_vec_init): Update call to begin_for_stmt.
487 * parser.c (cp_parser_for): New.
488 (cp_parser_c_for): Add three new parameters.
489 (cp_parser_range_for): Likewise. Most parsing code removed.
490 (cp_parser_iteration_statement): Call cp_parser_for instead of
491 cp_parser_c_for and cp_parser_range_for.
492 (cp_parser_for_init_statement): Add new parameter and return type.
493 (cp_parser_block_declaration): Update call to
494 cp_parser_simple_declaration.
495 (cp_parser_simple_declaration): Add new parameter.
496 Update call to cp_parser_init_declarator.
497 (cp_parser_init_declarator): Add new parameter.
498 * pt.c (tsubst_expr): Update call to begin_for_stmt.
499 * semantics.c (begin_for_scope): New.
500 (begin_for_stmt): Add two new parameters.
501 (begin_range_for_stmt): Likewise.
502
503 2011-01-12 Nicola Pero <nicola.pero@meta-innovation.com>
504
505 * parser.c (cp_parser_objc_at_property_declaration): Improved
506 error message.
507
508 2011-01-11 Dodji Seketeli <dodji@redhat.com>
509
510 PR debug/46955
511 * cp-lang.c (get_template_innermost_arguments_folded)
512 (get_template_argument_pack_elems_folded)
513 (template_arg_needs_folding, fold_cplus_constants): New static
514 functions.
515 (LANG_HOOKS_GET_INNERMOST_GENERIC_ARGS): Set this hook to
516 get_template_innermost_arguments_folded.
517 (LANG_HOOKS_GET_ARGUMENT_PACK_ELEMS): Set this hook to
518 get_template_argument_pack_elems_folded.
519
520 2011-01-11 Jason Merrill <jason@redhat.com>
521
522 PR c++/46658
523 * init.c (build_new_1): Handle value-init in templates differently.
524
525 PR c++/45520
526 * tree.c (maybe_dummy_object): Check current_class_ref against
527 context, not current_class_type.
528
529 2011-01-08 Nicola Pero <nicola.pero@meta-innovation.com>
530
531 PR objc/47078
532 * parser.c (cp_parser_objc_typename): If the type is unknown, for
533 error recovery purposes behave as if it was not specified so that
534 the default type is used.
535
536 2011-01-07 Jakub Jelinek <jakub@redhat.com>
537
538 PR c++/47022
539 * pt.c (tsubst_copy_and_build): Use tsubst instead of tsubst_copy
540 for the second build_x_va_arg argument.
541
542 2011-01-05 Tom Tromey <tromey@redhat.com>
543
544 * typeck.c (cp_build_addr_expr_1): Update call to lvalue_error.
545 (lvalue_or_else): Likewise.
546
547 2011-01-01 Kai Tietz <kai.tietz@onevision.com>
548
549 PR target/38662
550 * tree.c (cxx_type_hash_eq):
551 Allow METHOD_TYPE, too.
552
553 \f
554 Copyright (C) 2011 Free Software Foundation, Inc.
555
556 Copying and distribution of this file, with or without modification,
557 are permitted in any medium without royalty provided the copyright
558 notice and this notice are preserved.