]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/cp/ChangeLog
gcc/
[thirdparty/gcc.git] / gcc / cp / ChangeLog
CommitLineData
4a020a8c 12012-07-08 Steven Bosscher <steven@gcc.gnu.org>
2
3 * decl.c (cp_finish_decl): Add FIXME at add_local_decl call site.
4
6668d73c 52012-07-06 Jason Merrill <jason@redhat.com>
6
ca5518fc 7 PR c++/53862
8 * pt.c (tsubst_arg_types): Add "end" parameter.
9 (check_undeduced_parms): Use it.
10
7dbc9f49 11 * cp-tree.h (DECL_DECLARES_TYPE_P): Check DECL_TYPE_TEMPLATE_P.
12
6668d73c 13 PR c++/53858
14 * name-lookup.c (ambiguous_decl): Use DECL_TYPE_TEMPLATE_P.
15
944bf831 162012-07-05 Jason Merrill <jason@redhat.com>
17
6a7f681c 18 PR c++/53039
19 * pt.c (arg_from_parm_pack_p): Go back to using same_type_p or
20 cp_tree_equal.
21
208949c4 22 * cp-tree.h (TEMPLATE_PARM_NUM_SIBLINGS): Remove.
23 (struct template_parm_index_s): Remove num_siblings.
24 * pt.c (fixup_template_parms, fixup_template_parm_index): Remove.
25 (fixup_template_type_parm_type): Remove.
26 (build_template_parm_index): Remove num_siblings parm.
27 (process_template_parm): Likewise.
28 * parser.c (cp_parser_template_parameter_list): Adjust.
29 * tree.c (cp_tree_equal): Don't compare num_siblings.
30 * typeck.c (comp_template_parms_position): Likewise.
31
944bf831 32 PR c++/50852
33 PR c++/53039
34 * tree.c (strip_typedefs_expr): New.
35 * cp-tree.h: Declare it.
36 * pt.c (convert_template_argument, unify): Use it.
37 * parser.c (cp_parser_template_declaration_after_export): Don't call
38 fixup_template_parms.
39
9c30a2d5 402012-07-04 Jason Merrill <jason@redhat.com>
41
42 PR c++/53848
43 PR c++/53524
44 * decl.c (build_enumerator): Don't use build_lang_decl_loc.
45
9f071b17 462012-07-03 Jakub Jelinek <jakub@redhat.com>
47
48 PR c++/53812
49 * semantics.c (finish_goto_stmt): Surround computed goto argument
50 with CLEANUP_POINT_EXPR if needed.
51
c28ddc97 522012-07-02 Jason Merrill <jason@redhat.com>
53
ad026e7d 54 PR c++/53619
55 * pt.c (in_template_function): New.
56 * cp-tree.h: Declare it.
57 * class.c (build_base_path, resolves_to_fixed_type_p): Use it.
58
64da67de 59 PR c++/53783
60 * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Use tsubst
61 for LAMBDA_EXPR_EXTRA_SCOPE.
62
93d504b2 63 PR c++/53788
64 * pt.c (build_non_dependent_expr): Don't wrap a dummy object.
65
579349b1 66 PR c++/53816
67 * class.c (resolves_to_fixed_type_p): Check uses_template_parms
68 (current_function_decl) instead of processing_template_decl.
69
b1039d02 70 PR c++/53821
71 * semantics.c (maybe_add_lambda_conv_op): Don't set
72 DECL_INTERFACE_KNOWN.
73
c28ddc97 74 PR c++/53524
75 * call.c (build_conditional_expr_1): Don't warn about comparison of
76 two enumerators before their enumeration is complete.
77 (build_new_op_1): Call decay_conversion before warn_logical_operator.
78 * decl.c (build_enumerator): Set DECL_CONTEXT of an enumerator to
79 its enumeration.
80 * decl2.c (mark_used): Call used_types_insert for enums.
81 * semantics.c (finish_id_expression): Don't decay CONST_DECL.
82 (finish_member_declaration): Don't change DECL_CONTEXT of enumerators.
83 * class.c (check_field_decls): Don't change DECL_CONTEXT of enums.
84 * typeck.c (convert_for_assignment): Don't decay CONST_DECL.
85 (build_class_member_access_expr): Look through unscoped enums.
86 * search.c (context_for_name_lookup): Look through unscoped enums.
87 * pt.c (tsubst_copy_and_build): Don't decay CONST_DECL.
88 (tsubst_copy): Use DECL_CONTEXT to find the enumeration.
89 * tree.c (decl_linkage): Likewise.
90 * cvt.c (ocp_convert): Check decayed expr for enum range warning.
91
e53d55e7 922012-06-29 Steven Bosscher <steven@gcc.gnu.org>
93
94 * Make-lang.in: Remove tree-mudflap.o from CXX_AND_OBJCXX_OBJS.
95
bb2431cc 962012-06-27 Jason Merrill <jason@redhat.com>
97
aa2f35a5 98 * parser.c (cp_parser_check_for_invalid_template_id): tag_type parm.
99 (cp_parser_simple_type_specifier, cp_parser_class_head): Adjust.
100 (cp_parser_elaborated_type_specifier): Adjust.
101 * decl.c (duplicate_decls): Return error_mark_node on template
102 mismatch.
103
bb2431cc 104 PR c++/53563
105 * parser.c (cp_parser_template_id): Add tag_type parm.
106 (cp_parser_template_name): Likewise.
107 (cp_parser_id_expression, cp_parser_unqualified_id): Adjust.
108 (cp_parser_pseudo_destructor_name, cp_parser_type_name): Adjust.
109 (cp_parser_simple_type_specifier, cp_parser_class_name): Adjust.
110 (cp_parser_elaborated_type_specifier, cp_parser_class_head): Adjust.
111
4cdb0eae 1122012-06-27 Ramana Radhakrishnan <ramana.radhakrishnan@linaro.org>
113
114 PR C++/51033
115 * semantics.c (constexpr_call): Fix typo in comment.
116 (cxx_eval_vec_perm_expr): New.
117 (cxx_eval_constant_expression): Fold VEC_PERM_EXPRs.
118
9b7441d7 1192012-06-26 Richard Guenther <rguenther@suse.de>
120
121 PR c++/53752
122 * mangle.c (write_array_type): Truncate the number-of-elements
123 result.
124
d5bcfd11 1252012-06-25 Jason Merrill <jason@redhat.com>
126
da68aaeb 127 PR c++/53498
128 PR c++/53305
129 * pt.c (tsubst_decl) [PARM_DECL]: Don't recurse into DECL_CHAIN
130 if cp_unevaluated_operand is set.
131 (tsubst_copy) [PARM_DECL]: Don't copy before tsubsting.
132
d5bcfd11 133 PR c++/52988
134 * typeck.c (decay_conversion): Don't discard side-effects from
135 expressions of nullptr_t.
136
653d8b92 1372012-06-25 Florian Weimer <fweimer@redhat.com>
138
139 * init.c (build_new_1): Warn about (T[N]) for variable N, and
140 reject T[M][N].
141
142 * parser.c (cp_parser_direct_new_declarator): Accept non-constant
143 expressions. Handled now in build_new_1.
144
b48c7649 1452012-06-25 Jason Merrill <jason@redhat.com>
146
2e6c5d72 147 PR c++/53202
148 * semantics.c (build_data_member_initialization): Always keep
149 initializer for empty base.
150 (cxx_eval_bare_aggregate): Discard it here.
151
b48c7649 152 PR c++/53565
153 * pt.c (tsubst_omp_for_iterator): Simplify DECL_EXPR handling.
154 (tsubst_expr) [OMP_FOR]: Here, too.
155
5f0d1d09 1562012-06-25 Jakub Jelinek <jakub@redhat.com>
157
158 PR c++/53594
159 * class.c (check_bases_and_members): Avoid -Wuninitialized
160 diagnostics for non-static const members or references if they
161 use NSDMI.
162
1632012-06-16 Ville Voutilainen <ville.voutilainen@gmail.com>
8013e732 164
165 * parser.c (cp_parser_direct_declarator): Move virt-specifier
166 parsing after late-specified return type parsing.
167
0ba44b8b 1682012-06-14 Jason Merrill <jason@redhat.com>
169
170 PR c++/53651
171 * name-lookup.c (constructor_name_p): Don't try to look at the
172 name of a DECLTYPE_TYPE.
173
161121a9 1742012-06-18 Lawrence Crowl <crowl@google.com>
175
176 * decl2.c (cp_write_global_declarations): Rename use of TV_PHASE_CGRAPH
177 to TV_PHASE_OPT_GEN.
178
6789e11c 1792012-06-18 Steven Bosscher <steven@gcc.gnu.org>
180
181 * decl.c (finish_function): Remove code conditional on VMS_TARGET.
182
bf0cb017 1832012-06-15 Marc Glisse <marc.glisse@inria.fr>
184
185 PR c++/51033
186 * semantics.c (literal_type_p): Handle VECTOR_TYPE.
187 (potential_constant_expression_1): Handle VEC_PERM_EXPR.
188 * parser.c (cp_parser_postfix_expression): Handle RID_BUILTIN_SHUFFLE.
189
c9e4cdb5 1902012-06-09 Jason Merrill <jason@redhat.com>
191
97858640 192 * pt.c (tsubst_expr) [TAG_DEFN]: Instantiate local class.
193 * class.c (finish_struct): Don't add a TAG_DEFN for a lambda.
194 * decl2.c (finish_static_data_member_decl): Avoid redundant error.
195
c9e4cdb5 196 PR c++/53599
197 * name-lookup.c (pushtag_1): Add a DECL_EXPR for a local class.
198 * semantics.c (finish_cond): Build a COMPOUND_EXPR.
199 * pt.c (tsubst_expr) [COMPOUND_EXPR]: Handle.
200 [DECL_EXPR]: Don't call cp_finish_decl for an implicit typedef.
201 Don't return the decl.
202
a124222f 2032012-06-11 Richard Guenther <rguenther@suse.de>
204
f1cb32b5 205 PR c++/53605
a124222f 206 * mangle.c (write_array_type): Use double-ints for array domain
207 arithmetic.
208
5c6001e5 2092012-06-07 Fabien ChĂȘne <fabien@gcc.gnu.org>
273b3fa5 210
211 PR c++/51214
212 * cp-tree.h (insert_late_enum_def_into_classtype_sorted_fields):
213 Declare.
214 * class.c (insert_into_classtype_sorted_fields): New.
215 (add_enum_fields_to_record_type): New.
216 (count_fields): Adjust the comment.
217 (add_fields_to_record_type): Likewise.
218 (finish_struct_1): Move the code that inserts the fields for the
219 sorted case, into insert_into_classtype_sorted_fields, and call
220 it.
221 (insert_late_enum_def_into_classtype_sorted_fields): Define.
222 * decl.c (finish_enum_value_list): Call
223 insert_late_enum_def_into_classtype_sorted_fields if a late enum
224 definition is encountered.
225
c4698a21 2262012-06-06 Paolo Carlini <paolo.carlini@oracle.com>
227
228 PR c++/53567
229 * typeck.c (cp_perform_integral_promotions): New, like
230 perform_integral_promotions but also takes a tsubst_flags_t parameter.
231 (pointer_diff): Add tsubst_flags_t parameter.
232 (decay_conversion, cp_default_conversion, cp_build_array_ref,
233 cp_build_binary_op, cp_build_unary_op, build_static_cast_1,
234 build_reinterpret_cast_1, cp_build_modify_expr,
235 convert_for_assignment): Adjust.
236 * optimize.c (build_delete_destructor_body): Adjust.
237 * init.c (expand_virtual_init, expand_default_init, build_new_1,
238 build_new, build_vec_delete_1, build_vec_init, build_delete): Adjust.
239 (construct_virtual_base): Adjust LOOKUP_COMPLAIN -> 0.
240 * class.c (build_base_path): Adjust.
241 * decl.c (compute_array_index_type, finish_destructor_body): Likewise.
242 * method.c (synthesized_method_walk): Adjust flag and complain.
243 * rtti.c (ifnonnull): Add tsubst_flags_t parameter.
244 (build_typeid, build_dynamic_cast_1): Adjust.
245 * except.c (initialize_handler_parm): Likewise.
246 * typeck2.c (process_init_constructor_record): Likewise.
247 * pt.c (tsubst_friend_class): Don't change flags.
248 * semantics.c (finish_goto_stmt, handle_omp_for_class_iterator,
249 finish_static_assert): Likewise.
250 * parser.c (cp_parser_lookup_name): Just pass 0 as flags to
251 lookup_name_real.
252 * call.c (build_op_delete_call): Add tsubst_flags_t parameter.
253 (convert_like_real, convert_arg_to_ellipsis, convert_for_arg_passing):
254 Adjust.
255 (standard_conversion): Adjust LOOKUP_COMPLAIN -> 0.
256 (implicit_conversion): Mask out tf_error with a FIXME.
257 (build_user_type_conversion_1, build_new_op_1, build_over_call): Use
258 complain & tf_error instead of flags & LOOKUP_COMPLAIN.
259 * cvt.c (cp_convert_to_pointer, convert_to_pointer_force,
260 build_up_reference, convert_to_reference, cp_convert,
261 cp_convert_and_check, ocp_convert, convert_force): Add tsubst_flags_t
262 parameter.
263 (convert_to_reference, ocp_convert): Use complain & tf_error instead
264 of flags & LOOKUP_COMPLAIN.
265 (convert_force): Adjust LOOKUP_COMPLAIN -> 0.
266 * name-lookup.c (identifier_type_value_1, lookup_qualified_name,
267 lookup_name_real, lookup_function_nonclass, lookup_name,
268 lookup_name_prefer_type): Adjust LOOKUP_COMPLAIN -> 0.
269 * cp-tree.h: Adjust prototypes; remove LOOKUP_COMPLAIN.
270
b37a3600 2712012-06-06 Steven Bosscher <steven@gcc.gnu.org>
272
273 * decl.c: Do not include output.h.
274 (start_decl): Remove code for flag_conserve_space.
275
5c6001e5 2762012-06-06 Fabien ChĂȘne <fabien@gcc.gnu.org>
ba1d6bad 277
278 PR c++/52841
279 * parser.c (cp_parser_alias_declaration): Return earlier
280 if an error occured.
281
2a99a57e 2822012-06-04 Paolo Carlini <paolo.carlini@oracle.com>
283
284 PR c++/53524
285 * call.c (build_conditional_expr_1): Use OPT_Wenum_compare
286 to control enumeral mismatch in conditional expression too.
287
5f9e7dd5 2882012-06-04 Sterling Augustine <saugustine@google.com>
289
290 * cp-tree.h: Declare decl_as_dwarf_string, lang_decl_dwarf_name.
291 * cp-lang.c (cxx_dwarf_name): Call them.
292
dff12c10 2932012-06-04 Steven Bosscher <steven@gcc.gnu.org>
294
295 * semantics.c: Do not include output.h.
296 * decl2.c: Likewise.
297 * friend.c: Likewise.
298 * typeck.c: Likewise.
299 * typeck2.c: Likewise.
300 * Make-lang.in: Fix dependencies.
301
275371d8 3022012-06-01 Jason Merrill <jason@redhat.com>
303
6935b87a 304 PR c++/52973
305 * parser.c (cp_parser_class_head): Apply attributes here.
306 * semantics.c (begin_class_definition): Not here.
307 * cp-tree.h: Adjust.
308
5578e0f4 309 PR c++/52725
310 * parser.c (cp_parser_binary_expression): Bail early if we're parsing
311 tentatively and the LHS has a parse error.
312
f899a730 313 PR c++/53137
314 * pt.c (instantiate_class_template_1): Set LAMBDA_EXPR_THIS_CAPTURE.
315 (instantiate_decl): Don't push_to_top_level for local class methods.
316 (instantiate_class_template_1): Or for local classes.
317
275371d8 318 PR c++/53484
319 * pt.c (do_auto_deduction): Don't try to deduce from a
320 type-dependent initializer.
321
d8a1daa8 3222012-06-01 Paolo Carlini <paolo.carlini@oracle.com>
323
324 PR c++/26155
325 * name-lookup.c (push_namespace): When error recovery is
326 impossible just error out in duplicate_decls.
327
b5369b7d 3282012-05-31 Steven Bosscher <steven@gcc.gnu.org>
329
330 * call.c: Do not include output.h.
331 * class.c: Likewise.
332 * except.c: Likewise.
333 * friend.c: Likewise.
334 * init.c: Likewise.
335 * lex.c: Likewise.
336 * method.c: Likewise.
337 * parser.c: Likewise.
338 * pt.c: Likewise.
339 * rtti.c: Likewise.
340 * search.c: Likewise.
341
722a5835 3422012-05-30 Jason Merrill <jason@redhat.com>
343
55d147ea 344 PR c++/53356
345 * tree.c (stabilize_init): Handle stabilizing a TARGET_EXPR
346 representing a bitwise copy of a glvalue.
347
07a3e841 348 * tree.c (stabilize_expr): Tweak logic.
349
722a5835 350 PR c++/53356
351 * tree.c (stabilize_init): Side effects make the init unstable.
352
8d42956b 3532012-05-28 Paolo Carlini <paolo.carlini@oracle.com>
354
355 PR c++/53503
356 * semantics.c (potential_constant_expression_1): Handle LTGT_EXPR.
357
4602ae77 3582012-05-26 Paolo Carlini <paolo.carlini@oracle.com>
359
360 PR c++/53491
361 * tree.c (stabilize_expr): Handle exp of void type.
362
eb5d9b7b 3632012-05-26 Jason Merrill <jason@redhat.com>
364
365 PR c++/53220
366 * call.c (convert_like_real) [ck_list]: Take array address directly.
367 * typeck.c (decay_conversion): Reject decay of an array compound
368 literal.
369
97abbe27 3702012-05-25 Paolo Carlini <paolo.carlini@oracle.com>
371
372 PR c++/32054
373 * parser.c (cp_parser_member_declaration): A storage class is not
374 allowed in a declaration of an anonymous aggregate in a class scope.
375
961954a9 3762012-05-24 Uros Bizjak <ubizjak@gmail.com>
377
378 PR obj-c++/53441
379 * decl.c (grokdeclarator): Check that current_class_type is non-NULL
380 before calling constructor_name_p.
381
376a817b 3822012-05-24 Paolo Carlini <paolo.carlini@oracle.com>
383
384 PR c++/32080
385 * parser.c (cp_parser_ctor_initializer_opt_and_function_body,
386 cp_parser_function_body): Add a bool parameter, true when parsing
387 a function-try-block.
388 (cp_parser_function_try_block): Pass true to the above.
389 (cp_parser_function_definition_after_declarator,
390 cp_parser_function_transaction): Adjust.
391
5a8ef569 3922012-05-23 Paolo Carlini <paolo.carlini@oracle.com>
393
394 PR c++/29185
395 * decl2.c (delete_sanity): Extend 'deleting array' warning to
396 any array type.
397
793fb8f3 3982012-05-21 Paolo Carlini <paolo.carlini@oracle.com>
399
400 PR c++/51184
401 * decl.c (grokdeclarator): Diagnose functions returning abstract
402 class types as TYPENAME.
403 * cp-tree.h (ABSTRACT_CLASS_TYPE_P): Add.
404 * except.c (is_admissible_throw_operand_or_catch_parameter): Use it.
405 * pt.c (tsubst): Likewise.
406 * semantics.c (trait_expr_value): Likewise.
407
4082012-05-21 Paolo Carlini <paolo.carlini@oracle.com>
409
410 PR c++/40821
411 * parser.c (cp_parser_attributes_opt): Enforce error checking of
412 unbalanced parentheses in the presence of tentative parsing.
413
3592befb 4142012-05-17 Paolo Carlini <paolo.carlini@oracle.com>
415
416 PR c++/39681
417 * parser.c (cp_parser_new_type_id): Early return error_mark_node
418 if the cp_parser_type_specifier_seq call has type_specifier_seq.type
419 error_mark_node; tidy.
420 (cp_parser_new_expression): Always initialize nelts to NULL_TREE to
421 avoid uninitialized warnings.
422 (cp_parser_init_declarator, cp_parser_late_parse_one_default_arg):
423 Call cp_parser_skip_to_end_of_statement if cp_parser_initializer
424 returns error_mark_node.
425
2572143c 4262012-05-17 Paolo Carlini <paolo.carlini@oracle.com>
427
428 PR c++/53371
429 * except.c (is_admissible_throw_operand): Rename to
430 is_admissible_throw_operand_or_catch_parameter and handle
431 catch parameter too.
432 (expand_start_catch_block): Use it.
433 (build_throw): Adjust.
434
255b5d15 4352012-05-17 Paolo Carlini <paolo.carlini@oracle.com>
436
437 PR c++/44516
438 * typeck.c (build_x_array_ref, build_x_conditional_expr,
439 build_x_compound_expr, build_x_modify_expr): Add location_t parameter.
440 (finish_class_member_access_expr, build_x_indirect_ref,
441 build_x_binary_op, build_x_compound_expr_from_list,
442 build_x_compound_expr_from_vec): Adjust callers.
443 * tree.c (build_min_nt_loc): New.
444 (build_min_nt): Remove.
445 * typeck2.c (build_x_arrow): Adjust callers.
446 * pt.c (tsubst_qualified_id, tsubst_omp_for_iterator,
447 tsubst_copy_and_build): Likewise.
448 * semantics.c (finish_mem_initializers, handle_omp_for_class_iterator,
449 finish_omp_atomic): Likewise.
450 * decl2.c (grok_array_decl, build_anon_union_vars): Adjust.
451 * parser.c (cp_parser_question_colon_clause,
452 cp_parser_assignment_expression, cp_parser_expression,
453 cp_parser_template_id, cp_parser_omp_for_loop): Likewise.
454 * cp-tree.h: Update.
455
a60f3e81 4562012-05-16 Dodji Seketeli <dodji@redhat.com>
457
458 PR preprocessor/7263
459 * cp-tree.h (enum cp_decl_spec): Add new enumerators to cover all
460 the possible declarator specifiers so far.
461 (struct cp_decl_specifier_seq::locations): Declare new member.
462 (cp_decl_specifier_seq::{specs, type_location}): Remove.
463 (decl_spec_seq_has_spec_p): Declare new function.
464 * parser.c (cp_parser_check_decl_spec): Remove.
465 (set_and_check_decl_spec_loc): Define new static function.
466 (decl_spec_seq_has_spec_p): Define new public function.
467 (cp_parser_decl_specifier_seq, cp_parser_function_specifier_opt)
468 (cp_parser_type_specifier, cp_parser_simple_type_specifier)
469 (cp_parser_set_storage_class, cp_parser_set_decl_spec_type)
470 (cp_parser_alias_declaration): Set the locations for each
471 declspec, using set_and_check_decl_spec_loc.
472 (cp_parser_explicit_instantiation, cp_parser_init_declarator)
473 (cp_parser_member_declaration, cp_parser_init_declarator): Use the
474 new declspec location for specifiers. Use the new
475 decl_spec_seq_has_spec_p.
476 (cp_parser_type_specifier_seq): Use the new
477 set_and_check_decl_spec_loc. Stop using
478 cp_parser_check_decl_spec. Use the new decl_spec_seq_has_spec_p.
479 (, cp_parser_init_declarator): Use the new
480 set_and_check_decl_spec_loc.
481 (cp_parser_single_declaration, cp_parser_friend_p)
482 (cp_parser_objc_class_ivars, cp_parser_objc_struct_declaration):
483 Use the new decl_spec_seq_has_spec_p.
484 * decl.c (check_tag_decl): Use new decl_spec_seq_has_spec_p. Use
485 the more precise ds_redefined_builtin_type_spec location for
486 diagnostics about re-declaring C++ built-in types.
487 (start_decl, grokvardecl, grokdeclarator): Use the new
488 decl_spec_seq_has_spec_p.
489
82e6ef7c 4902012-05-15 Paolo Carlini <paolo.carlini@oracle.com>
491
cd4797ff 492 PR c++/11856
82e6ef7c 493 * pt.c (tsubst_copy_and_build): Increase / decrease
494 c_inhibit_evaluation_warnings around build_x_binary_op call.
495
05765a91 4962012-05-12 Paolo Carlini <paolo.carlini@oracle.com>
497
498 * cp-tree.h (TYPE_PTRMEM_P): Rename to TYPE_PTRDATAMEM_P.
499 (TYPE_PTR_TO_MEMBER_P): Rename to TYPE_PTRMEM_P.
500 (TYPE_PTR_OR_PTRMEM_P): Add.
501 * typeck.c (composite_pointer_type_r, composite_pointer_type,
502 common_pointer_type, cp_build_indirect_ref, cp_build_binary_op,
503 cp_truthvalue_conversion, convert_ptrmem, build_static_cast_1,
504 build_reinterpret_cast_1, build_const_cast_1, comp_ptr_ttypes_real,
505 casts_away_constness_r, casts_away_constness): Adjust.
506 * init.c (build_zero_init_1): Adjust.
507 * class.c (check_field_decls): Likewise.
508 * decl.c (check_default_argument): Likewise.
509 * rtti.c (target_incomplete_p): Likewise.
510 * tree.c (zero_init_p): Likewise.
511 * cxx-pretty-print.c (pp_cxx_ptr_operator,
512 pp_cxx_abstract_declarator): Likewise.
513 * typeck2.c (build_m_component_ref): Likewise.
514 * pt.c (convert_nontype_argument, invalid_nontype_parm_type_p,
515 dependent_type_p_r): Likewise.
516 * call.c (null_member_pointer_value_p, standard_conversion,
517 add_builtin_candidate, build_conditional_expr_1, compare_ics):
518 Likewise.
519 * cp-objcp-common.c (cp_var_mod_type_p): Likewise.
520 * cvt.c (cp_convert_to_pointer, ocp_convert,
521 perform_qualification_conversions): Likewise.
522 * mangle.c (write_type): Likewise.
523 * name-lookup.c (arg_assoc_type): Likewise.
524
1e6d0c16 5252012-05-12 Paolo Carlini <paolo.carlini@oracle.com>
526
527 * parser.c (struct cp_parser_expression_stack_entry): Add location_t
528 field.
529 (cp_parser_binary_expression): Rework to always update at the same
530 time tree_type and loc.
531 * call.c (print_z_candidate): Add location_t parameter.
532 (print_z_candidates, convert_like_real, joust): Adjust.
533
4e9c48c8 5342012-05-11 Alexandre Oliva <aoliva@redhat.com>
535
536 PR c++/53209
537 * pt.c (tsubst_decl): Bail out if argvec is error_mark_node.
538
5bcc2f92 5392012-05-11 Paolo Carlini <paolo.carlini@oracle.com>
540
541 PR c++/53305
542 * pt.c (tsubst_copy: case PARM_DECL): Return error_mark_node if
543 tsubst_decl returns NULL_TREE.
544 * cxx-pretty-print.c (pp_cxx_simple_type_specifier): Handle
545 BOUND_TEMPLATE_TEMPLATE_PARM.
546
61f69bc9 5472012-05-10 Paolo Carlini <paolo.carlini@oracle.com>
548
549 PR c++/53158
550 * cvt.c (ocp_convert): Error out early for void -> bool conversions.
551 * typeck.c (decay_conversion): Use error_at.
552 * call.c (build_integral_nontype_arg_conv, convert_like_real,
553 convert_arg_to_ellipsis, perform_implicit_conversion_flags,
554 initialize_reference): Likewise.
555 * cvt.c (warn_ref_binding): Add location_t parameter.
556 (cp_convert_to_pointer, convert_to_reference, ocp_convert,
557 convert_to_void, ): Use error_at and warning_at.
558
78222ab9 5592012-05-10 Paolo Carlini <paolo.carlini@oracle.com>
560
561 PR c++/53301
562 * decl.c (check_default_argument): Fix typo (POINTER_TYPE_P
563 instead of TYPE_PTR_P) in zero-as-null-pointer-constant warning.
564
ef0b0c72 5652012-05-06 Paolo Carlini <paolo.carlini@oracle.com>
566
567 PR c++/53152
568 * call.c (op_error, build_new_op_1, build_new_op): Add location_t
569 parameter.
570 (build_conditional_expr_1): Adjust.
571 * typeck.c (build_x_indirect_ref, build_x_binary_op,
572 build_x_unary_op): Add location_t parameter.
573 (rationalize_conditional_expr, build_x_array_ref,
574 build_x_compound_expr, cp_build_modify_expr, build_x_modify_expr):
575 Adjust.
576 * typeck2.c (build_x_arrow): Add location_t parameter.
577 * semantics.c (finish_unary_op_expr): Likewise.
578 (finish_increment_expr, handle_omp_for_class_iterator): Adjust.
579 * decl2.c (grok_array_decl): Add location_t parameter.
580 * parser.c (cp_parser_postfix_open_square_expression,
581 cp_parser_postfix_dot_deref_expression, cp_parser_unary_expression,
582 cp_parser_binary_expression, cp_parser_builtin_offsetof,
583 do_range_for_auto_deduction, cp_convert_range_for,
584 cp_parser_template_argument, cp_parser_omp_for_cond): Pass the
585 location, adjust.
586 * pt.c (tsubst_copy_and_build): Adjust.
587 * tree.c (maybe_dummy_object): Likewise.
588 * cp-tree.h: Update declarations.
589
e80c5f2b 5902012-05-04 Paolo Carlini <paolo.carlini@oracle.com>
591
592 * semantics.c (cxx_eval_constant_expression, case CONVERT_EXPR): Tidy.
593
69f685c0 5942012-05-04 Paolo Carlini <paolo.carlini@oracle.com>
595
596 PR c++/53166
597 * pt.c (instantiate_class_template_1): Increase / decrease
598 c_inhibit_evaluation_warnings around the tsubst_expr call
599 for STATIC_ASSERT_CONDITION.
600 (tsubst_expr, case STATIC_ASSERT): Likewise.
601 * typeck.c (cp_build_binary_op, case EQ_EXPR/NE_EXPR): Check
602 c_inhibit_evaluation_warnings in the OPT_Waddress warnings.
603
6b45067f 6042012-05-03 Paolo Carlini <paolo.carlini@oracle.com>
605
606 PR c++/53186
607 * call.c (build_over_call): Handle final member functions
608 and class types.
609 (build_new_method_call_1): Do not handle here.
610
85d86b55 6112012-05-02 Richard Guenther <rguenther@suse.de>
612
613 * decl.c (grokdeclarator): Properly check for sizes that
614 cover more than half of the address-space.
615
f3186cfc 6162012-04-30 Marc Glisse <marc.glisse@inria.fr>
617
7059d45d 618 PR c++/51033
619 * typeck.c (cp_build_array_ref): Handle VECTOR_TYPE.
620 * decl2.c (grok_array_decl): Likewise.
621
f3186cfc 622 PR c++/51314
623 * parser.c (cp_parser_sizeof_operand): Require parentheses for
624 sizeof...
625
db30b351 6262012-04-30 Dodji Seketeli <dodji@redhat.com>
627
7e3d3ba6 628 Fix location for static class members
629 * decl.c (grokdeclarator): Use the location carried by the
630 declarator for the DECL of the static class member.
631
346b240d 632 Fix va_arg type location
633 * cp-tree.h (build_x_va_arg): Take an additional location
634 parameter.
635 * call.c (build_x_va_arg): Take a loc parameter for the location
636 of the type of the va_arg expression.
637 * parser.c (cp_parser_primary_expression): Pass the type of the
638 type in the va_arg expression to build_x_va_arg.
639 * pt.c (tsubst_copy): Adjust calls to build_x_va_arg.
640
db30b351 641 Make conversion warnings work on NULL with -ftrack-macro-expansion
642 * call.c (conversion_null_warnings): Use the new
643 expansion_point_location_if_in_system_header.
644 * cvt.c (build_expr_type_conversion): Likewise.
645 * typeck.c (cp_build_binary_op): Likewise.
646
b86527d8 6472012-04-30 Manuel López-Ibåñez <manu@gcc.gnu.org>
648
649 * typeck.c (convert_for_assignment): Replace
650 Wmissing-format-attribute with Wsuggest-attribute=format.
651 * call.c (convert_for_arg_passing): Likewise.
652
2eb359ba 6532012-04-26 Paolo Carlini <paolo.carlini@oracle.com>
654
655 PR c++/53096
656 * class.c (check_bases_and_members): Implement core/1333, do not
657 disallow defaulted in the class body non-const ref special members.
658
66bbeb85 6592012-04-24 Paolo Carlini <paolo.carlini@oracle.com>
660
661 PR c++/52363
662 * call.c (tourney, perform_overload_resolution,
663 build_operator_new_call, build_user_type_conversion_1,
664 build_user_type_conversion, perform_overload_resolution,
665 add_template_candidate, add_template_candidate_real,
666 add_template_conv_candidate, add_builtin_candidates,
667 add_builtin_candidate, build_builtin_candidate,
668 add_conv_candidate, add_function_candidate, implicit_conversion,
669 reference_binding, build_list_conv, conditional_conversion,
670 add_candidates, can_convert_array, build_aggr_conv,
671 build_array_conv, build_complex_conv, conditional_conversion):
672 Add tsubst_flags_t parameter.
673 (joust): Likewise, use it to handle SFINAE as if pedantic.
674 (add_list_candidates, build_integral_nontype_arg_conv,
675 perform_overload_resolution, build_new_function_call,
676 build_operator_new_call, build_op_call_1,
677 build_conditional_expr_1, build_new_op_1, convert_like_real,
678 convert_arg_to_ellipsis, convert_default_arg,
679 convert_for_arg_passing, build_over_call,
680 build_new_method_call_1, can_convert_arg, can_convert_arg_bad,
681 perform_implicit_conversion_flags,
682 perform_direct_initialization_if_possible,
683 initialize_reference): Adjust.
684 * typeck.c (casts_away_constness, casts_away_constness_r):
685 Add tsubst_flags_t parameter.
686 (convert_arguments, check_for_casting_away_constness,
687 build_static_cast_1, build_ptrmemfunc, convert_for_assignment):
688 Adjust.
689 * decl.c (reshape_init_r, check_default_argument): Likewise.
690 * cp-gimplify.c (cxx_omp_clause_apply_fn): Likewise.
691 * pt.c (convert_nontype_argument, check_non_deducible_conversion):
692 Likewise.
693 * init.c (build_new_1): Likewise.
694 * cvt.c (convert_to_reference, ocp_convert, build_type_conversion,
695 build_expr_type_conversion, ): Likewise.
696 * search.c (check_final_overrider): Likewise.
697 * cp-tree.h (build_user_type_conversion,
698 build_operator_new_call, can_convert, can_convert_arg,
699 can_convert_arg_bad, convert_default_arg,
700 convert_arg_to_ellipsis, convert_for_arg_passing):
701 Adjust declaration.
702
ff2a5ada 7032012-04-22 Jan Hubicka <jh@suse.cz>
704
705 * decl2.c (maybe_make_one_only): Mark keyed COMDATs as USED so they
706 gets finalized.
707
29438999 7082012-04-22 Manuel López-Ibåñez <manu@gcc.gnu.org>
709
710 PR c/44774
711 * typeck.c (composite_pointer_type): Likewise.
712 (cxx_sizeof_or_alignof_type): Likewise.
713 (cp_build_array_ref): Likewise.
714 (cp_build_function_call_vec): Likewise.
715 (cp_build_addr_expr_1): Likewise.
716 (convert_member_func_to_ptr): Likewise.
717 * decl.c (check_tag_decl): Likewise.
718 (check_static_variable_definition): Likewise.
719 (compute_array_index_type): Likewise.
720 (create_array_type_for_decl): Likewise.
721 (grokdeclarator): Likewise.
722 (grok_op_properties): Likewise.
723 * error.c (maybe_warn_cpp0x): Likewise.
724 * pt.c (maybe_process_partial_specialization): Likewise.
725 (convert_template_argument): Likewise.
726 (do_decl_instantiation): Likewise.
727 (do_type_instantiation): Likewise.
728 * parser.c (cp_parser_primary_expression): Likewise.
729 (cp_parser_postfix_expression): Likewise.
730 (cp_parser_unary_expression): Likewise.
731 (cp_parser_question_colon_clause): Likewise.
732 (cp_parser_lambda_introducer): Likewise.
733 (cp_parser_lambda_declarator_opt): Likewise.
734 (cp_parser_compound_statement): Likewise.
735 (cp_parser_jump_statement): Likewise.
736 (cp_parser_declaration_seq_opt): Likewise.
737 (cp_parser_enum_specifier): Likewise.
738 (cp_parser_enumerator_list): Likewise.
739 (cp_parser_initializer_list): Likewise.
740 (cp_parser_member_declaration): Likewise.
741 * call.c (build_conditional_expr_1): Likewise.
742 * friend.c (make_friend_class): Likewise.
743 * name-lookup.c (pushdecl_maybe_friend_1): Likewise.
744
2f4b5e45 7452012-04-21 Jan Hubicka <jh@suse.cz>
746
747 * method.c (make_alias_for): Do not set TREE_SYMBOL_REFERENCED.
748 * decl2.c (mark_needed): Likewise.
749 (decl_needed_p): Do not test TREE_SYMBOL_REFERENCED.
750
751 * decl2.c (cxx_callgraph_analyze_expr): Remove.
752 * cp-objcp-common.h (LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR): Remove.
753 * cp-tree.h (cxx_callgraph_analyze_expr): Remove.
754
28738b20 7552012-04-21 Manuel López-Ibåñez <manu@gcc.gnu.org>
756
757 PR 35441
758 * typeck.c (cp_build_function_call_vec): Do not pretty-print
759 expressions when caret is enabled.
760
484a0b1b 7612012-04-20 Jan Hubicka <jh@suse.cz>
762
763 PR target/53042
764 * decl2.c (maybe_emit_vtables): Do not initialize same_comdat_group
765 list when target has no support for it.
766
b666516d 7672012-04-20 Michael Matz <matz@suse.de>
768
769 * error.c (pedwarn_cxx98): Move va_end call after user
770 of the va_list.
771
4405c1ad 7722012-04-18 Paolo Carlini <paolo.carlini@oracle.com>
773
774 PR c++/52422
775 * cp-tree.h (build_addr_func, decay_conversion,
776 get_member_function_from_ptrfunc,
777 build_m_component_ref, convert_member_func_to_ptr):
778 Add tsubst_flags_t parameter.
779 * typeck.c (cp_default_conversion): Add.
780 (decay_conversion, default_conversion,
781 get_member_function_from_ptrfunc, convert_member_func_to_ptr):
782 Add tsubst_flags_t parameter and use it throughout.
783 (cp_build_indirect_ref, cp_build_array_ref,
784 cp_build_function_call_vec, convert_arguments, build_x_binary_op,
785 cp_build_binary_op, cp_build_unary_op, build_reinterpret_cast_1,
786 build_const_cast_1, expand_ptrmemfunc_cst,
787 convert_for_initialization): Adjust.
788 * init.c (build_vec_init): Adjust.
789 * decl.c (grok_reference_init, get_atexit_node): Likewise.
790 * rtti.c (build_dynamic_cast_1, tinfo_base_init): Likewise.
791 * except.c (build_throw): Likewise.
792 * typeck2.c (build_x_arrow): Likewise.
793 (build_m_component_ref): Add tsubst_flags_t parameter and
794 use it throughout.
795 * pt.c (convert_nontype_argument): Adjust.
796 * semantics.c (finish_asm_stmt, maybe_add_lambda_conv_op): Likewise.
797 * decl2.c (build_offset_ref_call_from_tree): Likewise.
798 * call.c (build_addr_func): Add tsubst_flags_t parameter and
799 use it throughout.
800 (build_call_a, build_conditional_expr_1, build_new_op_1,
801 convert_like_real, convert_arg_to_ellipsis, build_over_call,
802 build_special_member_call): Adjust.
803 * cvt.c (cp_convert_to_pointer, force_rvalue,
804 build_expr_type_conversion): Likewise.
805
57cf061a 8062012-04-17 Tom de Vries <tom@codesourcery.com>
807
808 * cp-gimplify.c (begin_bc_block): Add location parameter and use as
809 location argument to create_artificial_label.
810 (finish_bc_block): Change return type to void. Remove body_seq
811 parameter, and add block parameter. Append label to STMT_LIST and
812 return in block.
813 (gimplify_cp_loop, gimplify_for_stmt, gimplify_while_stmt)
814 (gimplify_do_stmt, gimplify_switch_stmt): Remove function.
815 (genericize_cp_loop, genericize_for_stmt, genericize_while_stmt)
816 (genericize_do_stmt, genericize_switch_stmt, genericize_continue_stmt)
817 (genericize_break_stmt, genericize_omp_for_stmt): New function.
818 (cp_gimplify_omp_for): Remove bc_continue processing.
819 (cp_gimplify_expr): Genericize VEC_INIT_EXPR.
820 (cp_gimplify_expr): Mark FOR_STMT, WHILE_STMT, DO_STMT, SWITCH_STMT,
821 CONTINUE_STMT, and BREAK_STMT as unreachable.
822 (cp_genericize_r): Genericize FOR_STMT, WHILE_STMT, DO_STMT,
823 SWITCH_STMT, CONTINUE_STMT, BREAK_STMT and OMP_FOR.
824 (cp_genericize_tree): New function, factored out of ...
825 (cp_genericize): ... this function.
826
a2748d43 8272012-04-17 Paolo Carlini <paolo.carlini@oracle.com>
828
829 PR c++/52599
830 * semantics.c (build_constexpr_constructor_member_initializers):
831 Check for function-try-block as function-body.
832
8332012-04-17 Paolo Carlini <paolo.carlini@oracle.com>
834
835 PR c++/53003
836 * parser.c (cp_parser_member_declaration): Check that
837 initializer_token_start is non null before dereferencing it.
838
2323e713 8392012-04-16 Jason Merrill <jason@redhat.com>
840
bc38e4e1 841 PR c++/38543
842 * pt.c (determine_specialization): Instead of comparing the number
843 of parms, check that tsubst gives the right answer.
844
3c8837b5 845 PR c++/52008
846 * pt.c (process_partial_specialization): Complain about a partial
847 specialization with fewer args than primary template parms.
848
9eb175d4 849 PR c++/50830
850 * pt.c (convert_template_argument): Handle template template
851 argument packs.
852
2323e713 853 PR c++/50303
854 * pt.c (tsubst_pack_expansion): Use tsubst_expr for template
855 template parameters.
856
1c9c9381 8572012-04-16 Paolo Carlini <paolo.carlini@oracle.com>
858
859 PR c++/49152
860 * call.c (op_error): Print types; when flag_diagnostics_show_caret
861 is false print expressions too.
862 (op_error_string): Add.
863
93f2ac0b 8642012-04-16 Jason Merrill <jason@redhat.com>
865
866 PR c++/51148
867 * friend.c (make_friend_class): Call check_for_bare_parameter_packs.
868
7c455d87 8692012-04-16 Jan Hubicka <jh@suse.cz>
870
871 * decl2.c (collect_candidates_for_java_method_alias): Use FOR_EACH
872 walkers to walk cgraph and varpool.
873
fbcdace8 8742012-04-15 Jason Merrill <jason@redhat.com>
875
b70c8dca 876 PR c++/47220
877 * pt.c (coerce_template_parameter_pack): Check for error_mark_node.
878
1c4078ea 879 PR c++/52292
880 PR c++/52380
881 * pt.c (coerce_template_parms): Even if we aren't converting we
882 want to expand argument packs.
883
fbcdace8 884 PR c++/52706
885 * mangle.c (write_type): nullptr_t is a builtin type.
886
7d0d0ce1 8872012-04-14 Jan Hubicka <jh@suse.cz>
888
889 * tree.c: Update field referenced for new cgraph/varpool layout.
890 * decl2.c: Likewise.
891
7b7a44c9 8922012-04-13 Jason Merrill <jason@redhat.com>
893
2419ca22 894 PR c++/52824
895 * pt.c (any_pack_expanson_args_p): New.
896 (coerce_template_parms): Use it.
897
1497da26 898 PR c++/52905
899 * call.c (joust): Handle comparing list and non-list ctors.
900
7b7a44c9 901 PR c++/52915
902 * decl2.c (finish_anon_union): Use cp_finish_decl.
903 * error.c (dump_function_name): Avoid showing anonymous "name".
904
83ae9f05 9052012-04-11 Fabien ChĂȘne <fabien@gcc.gnu.org>
906
907 PR c++/52465
908 * parser.c (cp_parser_class_name): Call strip_using_decl and
909 return the target decl.
910 * name-lookup.c (strip_using_decl): Returns NULL_TREE if the decl
911 to be stripped is NULL_TREE.
912 (qualify_lookup): Call strip_using_decl and perform some checks on
913 the target decl.
914
bafe7bc2 9152012-04-11 Jason Merrill <jason@redhat.com>
916
5c3b448c 917 PR debug/45088
918 * decl.c (grokdeclarator): Strip the injected-class-name typedef
919 if we are building a declaration or compound type.
920
bafe7bc2 921 PR c++/52906
922 * decl.c (check_tag_decl): Don't complain about attributes if we
923 don't even have a type.
924
3d177e8c 9252012-04-10 Manuel López-Ibåñez <manu@gcc.gnu.org>
926
927 * cvt.c (convert_to_void): Update comment.
928
a59543d9 9292012-04-05 Jason Merrill <jason@redhat.com>
930
931 PR c++/52596
932 * semantics.c (finish_non_static_data_member): In templates, pass
933 the decl to build_qualified_name.
934 * tree.c (lvalue_kind) [SCOPE_REF]: Handle FIELD_DECL.
935
868e0fda 9362012-04-04 Jason Merrill <jason@redhat.com>
937
938 PR c++/52845
939 * decl.c (finish_function): Update fntype after deducing return type.
940
bb2288b7 9412012-04-03 Jason Merrill <jason@redhat.com>
942
943 PR c++/52796
944 * pt.c (tsubst_initializer_list): A pack expansion with no elements
945 means value-initialization.
946
0568e5f9 9472012-04-01 Paolo Carlini <paolo.carlini@oracle.com>
948
949 PR c++/50043
950 * class.c (deduce_noexcept_on_destructor,
951 deduce_noexcept_on_destructors): New.
952 (check_bases_and_members): Call the latter.
953 * decl.c (grokfndecl): Call the former.
954 * method.c (implicitly_declare_fn): Not static.
955 * cp-tree.h (deduce_noexcept_on_destructor, implicitly_declare_fn):
956 Declare
957
c55e1e56 9582012-03-29 Paolo Carlini <paolo.carlini@oracle.com>
959
960 PR c++/52718
961 * decl.c (check_default_argument): With -Wzero-as-null-pointer-constant
962 warn for a zero as null pointer constant default argument.
963
aa827ee9 9642012-03-29 Jason Merrill <jason@redhat.com>
965
966 PR c++/52685
967 * tree.c (copy_binfo): Handle BINFO_DEPENDENT_BASE_P.
968
d306e228 9692012-03-29 Jakub Jelinek <jakub@redhat.com>
970
971 PR c++/52759
972 * decl.c (start_decl): Don't call maybe_apply_pragma_weak
973 if processing_template_decl.
974
31708e0a 9752012-03-29 Jason Merrill <jason@redhat.com>
976
977 PR c++/52743
978 * call.c (compare_ics): Handle ck_aggr like ck_list.
979
47a1eb5e 9802012-03-28 Jason Merrill <jason@redhat.com>
981
982 PR c++/52746
983 * typeck.c (lookup_destructor): Clear BASELINK_QUALIFIED_P if
984 we didn't get an explicit scope.
985 * pt.c (tsubst_baselink): Likewise.
986
e5c15e80 9872012-03-28 Richard Guenther <rguenther@suse.de>
988
989 * typeck2.c (process_init_constructor_array): Use the proper
990 type for computing the array length.
991
9bf1a5dd 9922012-03-27 Meador Inge <meadori@codesourcery.com>
993
994 PR c++/52672
995 * semantics.c (cxx_fold_indirect_ref): Don't attempt to fold
996 stripped child trees that are not pointer types.
997
86359a65 9982012-03-21 Jason Merrill <jason@redhat.com>
999
1000 Implement return type deduction for normal functions with -std=c++1y.
1001 * cp-tree.h (FNDECL_USED_AUTO): New macro.
1002 (LAMBDA_EXPR_DEDUCE_RETURN_TYPE_P): Remove.
1003 (dependent_lambda_return_type_node): Remove.
1004 (CPTI_DEPENDENT_LAMBDA_RETURN_TYPE): Remove.
1005 (struct language_function): Add x_auto_return_pattern field.
1006 (current_function_auto_return_pattern): New.
1007 (enum tsubst_flags): Add tf_partial.
1008 * decl.c (decls_match): Handle auto return comparison.
1009 (duplicate_decls): Adjust error message for auto return.
1010 (cxx_init_decl_processing): Remove dependent_lambda_return_type_node.
1011 (cp_finish_decl): Don't do auto deduction for functions.
1012 (grokdeclarator): Allow auto return without trailing return type in
1013 C++1y mode.
1014 (check_function_type): Defer checking of deduced return type.
1015 (start_preparsed_function): Set current_function_auto_return_pattern.
1016 (finish_function): Set deduced return type to void if not previously
1017 deduced.
1018 * decl2.c (change_return_type): Handle error_mark_node.
1019 (mark_used): Always instantiate functions with deduced return type.
1020 Complain about use if deduction isn't done.
1021 * parser.c (cp_parser_lambda_declarator_opt): Use 'auto' for
1022 initial return type.
1023 (cp_parser_lambda_body): Don't deduce return type in a template.
1024 (cp_parser_conversion_type_id): Allow auto in C++1y.
1025 * pt.c (instantiate_class_template_1): Don't mess with
1026 LAMBDA_EXPR_DEDUCE_RETURN_TYPE_P.
1027 (tsubst_copy_and_build): Likewise.
1028 (fn_type_unification, tsubst): Don't reduce the template parm level
1029 of 'auto' during deduction.
1030 (unify): Compare 'auto' specially.
1031 (get_bindings): Change test.
1032 (always_instantiate_p): Always instantiate functions with deduced
1033 return type.
1034 (do_auto_deduction): Handle error_mark_node and lambda context.
1035 Don't check for use in initializer.
1036 (contains_auto_r): Remove.
1037 * search.c (lookup_conversions_r): Handle auto conversion function.
1038 * semantics.c (lambda_return_type): Handle null return. Don't mess
1039 with dependent_lambda_return_type_node.
1040 (apply_deduced_return_type): Rename from apply_lambda_return_type.
1041 * typeck.c (merge_types): Handle auto.
1042 (check_return_expr): Do auto deduction.
1043 * typeck2.c (add_exception_specifier): Fix complain check.
1044
2e305ec5 10452012-03-22 Paolo Carlini <paolo.carlini@oracle.com>
1046
1047 PR c++/52487
1048 * class.c (check_field_decls): Call literal_type_p only
1049 on complete types.
1050
879b75b1 10512012-03-22 Jakub Jelinek <jakub@redhat.com>
1052
1053 PR c++/52671
1054 * decl.c (check_tag_decl): Only use CLASSTYPE_TEMPLATE_INSTANTIATION
1055 on CLASS_TYPE_P types.
1056
a1665c71 10572012-03-20 Jason Merrill <jason@redhat.com>
1058
543efdbe 1059 * lex.c (init_reswords): Use >= for cxx_dialect test.
1060 * parser.c (cp_parser_exception_specification_opt): Likewise.
1061
1610993e 1062 * mangle.c (write_type): Handle 'auto'.
1063 * init.c (build_new): Don't do auto deduction where it might
1064 affect template mangling.
1065
a1665c71 1066 PR c++/52510
1067 * decl.c (reshape_init_class): Handle repeated reshaping.
1068 * search.c (lookup_field_1): Add sanity check.
1069
62206d34 10702012-03-19 Paolo Carlini <paolo.carlini@oracle.com>
1071
1072 PR c++/14710
1073 * cp-tree.h (xvalue_p, maybe_warn_about_useless_cast): Declare.
1074 * tree.c (xvalue_p): Define.
1075 * typeck.c (maybe_warn_about_useless_cast): Define.
1076 (build_reinterpret_cast, build_const_cast,
1077 build_static_cast, cp_build_c_cast): Use maybe_warn_about_useless_cast.
1078 * rtti.c (build_dynamic_cast): Likewise.
1079 * pt.c (tsubst_copy_and_build, case CAST_EXPR): Increment/decrement
1080 c_inhibit_evaluation_warnings before/after the build_* calls.
1081
b4f6d117 10822012-03-15 Jason Merrill <jason@redhat.com>
1083
1084 PR c++/52582
1085 * method.c (implicitly_declare_fn): Set DECL_EXTERNAL.
1086
249faa35 10872012-03-15 Manuel López-Ibåñez <manu@gcc.gnu.org>
1088
1089 PR c++/44783
1090 * error.c (print_instantiation_partial_context): Use
1091 template_backtrace_limit.
1092
5641963c 10932012-03-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1094
1095 * Make-lang.in (doc/g++.1): Remove IRIX 6.5 reference.
1096
66468a32 10972012-03-14 Jakub Jelinek <jakub@redhat.com>
1098
1099 PR c++/52521
1100 * parser.c (lookup_literal_operator): Return fn only if
1101 processed all arguments from args vector and argtypes is
1102 void_list_node.
1103
f5774b88 11042012-01-30 Dodji Seketeli <dodji@redhat.com>
1105
1106 PR c++/51641
1107 * cp-tree.h (template_type_parameter_p): Declare new function.
f5774b88 1108 (parameter_of_template_p): Remove.
249faa35 1109 * pt.c (template_type_parameter_p): Define new function.
1110 (parameter_of_template_p): Remove.
1111 * name-lookup.c (binding_to_template_parms_of_scope_p): Don't rely
f5774b88 1112 on parameter_of_template_p anymore. Compare the level of the
1113 template parameter to the depth of the template.
1114
5ac302b4 11152011-12-15 Dodji Seketeli <dodji@redhat.com>
1116
1117 * call.c (standard_conversion, build_integral_nontype_arg_conv)
1118 (build_new_op_1, convert_like_real, is_subseq)
1119 (maybe_handle_implicit_object, maybe_handle_ref_bind, compare_ics)
1120 (joust): Use next_conversion instead of accessing fields of struct
1121 conversion directly.
1122
0f2dcb44 11232012-03-12 Paolo Carlini <paolo.carlini@oracle.com>
1124
1125 PR c++/52299
1126 * pt.c (tsubst_copy_and_build, case COND_EXPR): Avoid bogus
1127 division by zero warnings.
1128
34f12878 11292012-03-08 Paolo Carlini <paolo.carlini@oracle.com>
1130
1131 * typeck.c (build_array_ref, cp_build_addr_expr_1, convert_ptrmem,
1132 build_ptrmemfunc): Consistently forward the tsubst_flags_t
1133 parameter.
1134 * call.c (resolve_args): Likewise.
1135
b9eba7af 11362012-03-07 Jason Merrill <jason@redhat.com>
1137
1138 PR c++/52521
1139 * mangle.c (write_literal_operator_name): The length comes after the
1140 operator prefix.
1141
07932ea7 11422012-03-05 Jakub Jelinek <jakub@redhat.com>
1143
1144 * pt.c (local_specializations): Change from htab_t into
1145 struct pointer_map_t *.
1146 (retrieve_local_specializations, register_local_specialization,
1147 tsubst_pack_expansion, instantiate_decl): Adjust users.
1148 (eq_local_specializations, hash_local_specialization): Remove.
1149
8919e4f8 11502012-03-05 Jason Merrill <jason@redhat.com>
1151
dc3784b9 1152 PR c++/51930
1153 * decl2.c (determine_visibility): Correct calculation of class
1154 args depth.
1155 * decl.c (check_tag_decl): Adjust warning.
1156
8919e4f8 1157 * method.c (synthesized_method_walk): Cleanups don't affect the EH
1158 spec either.
1159
ce1c0a7d 11602012-03-03 Jason Merrill <jason@redhat.com>
1161
f2b34014 1162 * init.c (perform_member_init): Cope with uninstantiated NSDMI.
1163
0138a8ea 1164 Core 1270
1165 * call.c (build_aggr_conv): Call reshape_init.
1166 (convert_like_real): Likewise.
1167 * typeck2.c (process_init_constructor): Clear TREE_CONSTANT if
1168 not all constant.
1169
7abd84e4 1170 * mangle.c (write_nested_name): Use decl_mangling_context.
1171 (write_prefix, write_template_prefix): Likewise.
1172
c5d17c88 1173 PR c++/36797
1174 * mangle.c (write_expression): Improve diagnostic for TRAIT_EXPR.
1175
ce1c0a7d 1176 * class.c (add_method): Always build an OVERLOAD for using-decls.
1177 * search.c (lookup_member): Handle getting an OVERLOAD for a
1178 single function.
1179
2ad2700d 11802012-03-02 Paolo Carlini <paolo.carlini@oracle.com>
1181
1182 PR c++/51989
1183 * typeck2.c (build_x_arrow): Take a tsubst_flags_t argument and
1184 propagate it.
1185 * cp-tree.h (build_x_arrow): Adjust prototype.
1186 * pt.c (tsubst_copy_and_build): Adjust call.
1187 * parser.c (cp_parser_postfix_dot_deref_expression): Likewise.
1188
19159b3e 11892012-03-02 Paolo Carlini <paolo.carlini@oracle.com>
1190
1191 * name-lookup.c (binding_to_template_parms_of_scope_p): Clean up.
1192
ce6ea847 11932012-02-29 Jason Merrill <jason@redhat.com>
1194
1195 PR c++/51930
1196 * decl.c (check_tag_decl): Move warning for misplaced attributes here.
1197 (shadow_tag): From here.
1198 * parser.c (cp_parser_explicit_instantiation): Don't warn here.
1199
9ba809de 12002012-02-21 Jakub Jelinek <jakub@redhat.com>
1201
1202 PR c++/52312
1203 * typeck.c (check_literal_operator_args): Initialize *long_double_p
1204 and *long_long_unsigned_p even if processing_template_decl.
1205
c0b14876 12062012-02-16 Jason Merrill <jason@redhat.com>
1207
1208 PR c++/52248
1209 * decl.c (define_label): Use timevar_cond_start/stop.
1210
4fc6070e 12112012-02-16 Fabien ChĂȘne <fabien@gcc.gnu.org>
1212
1213 PR c++/52126
1214 * decl.c (xref_basetypes): call dependent_scope_p instead of
1215 dependent_type_p.
1216
89b7df3a 12172012-02-16 Jason Merrill <jason@redhat.com>
1218
1219 PR c++/51415
1220 * error.c (dump_expr): Handle lambda closures specifically.
1221
32881079 12222012-02-14 Jason Merrill <jason@redhat.com>
1223
1224 * parser.c (cp_parser_explicit_instantiation): Give a warning
1225 for ignored attributes on explicit class instantiation.
1226
aa6de25a 12272012-02-14 Jakub Jelinek <jakub@redhat.com>
1228
1229 PR c++/52247
1230 * pt.c (tsubst_copy_asm_operands): For LABEL_DECL values call
1231 lookup_label on label's name and set TREE_USED.
1232
ed30b6cc 12332012-02-14 Jason Merrill <jason@redhat.com>
1234
1235 PR c++/39055
1236 * decl.c (local_variable_p_walkfn): Don't check DECL_ARTIFICIAL.
1237
fc0d4990 12382012-02-14 Jakub Jelinek <jakub@redhat.com>
1239
1240 PR c/52181
1241 * decl.c (duplicate_decls): If olddecl has bigger DECL_ALIGN than
1242 newdecl, copy DECL_ALIGN to newdecl and or DECL_USER_ALIGN bits.
1243
44f861fc 12442012-02-07 Jason Merrill <jason@redhat.com>
1245
2e5f66c6 1246 PR c++/51675
1247 * semantics.c (cx_check_missing_mem_inits): Handle unions.
1248 Fix constexpr default constructor logic.
1249
44f861fc 1250 PR c++/52035
1251 * pt.c (tsubst): Strip uninstantiated typedef.
1252
da7eaa22 12532012-02-06 Jason Merrill <jason@redhat.com>
1254
1255 PR c++/52088
1256 * cvt.c (build_expr_type_conversion): Check for template conversion.
1257
a5f9ef73 12582012-01-31 Jason Merrill <jason@redhat.com>
1259
1260 PR c++/52043
1261 * cp-tree.h (PACK_EXPANSION_LOCAL_P): New.
1262 * pt.c (make_pack_expansion, tsubst_initializer_list): Set it.
1263 (tsubst_pack_expansion): Check it.
1264
8203f380 12652012-01-29 Paolo Carlini <paolo.carlini@oracle.com>
1266
1267 PR c++/51327
1268 * class.c (explain_non_literal_class): Correctly handle implicitly
1269 deleted constructors.
1270
73fea988 12712012-01-27 Jakub Jelinek <jakub@redhat.com>
1272
1273 PR c++/51852
1274 * pt.c (tsubst_pack_expansion): Delete and restore
1275 local_specialization whenever need_local_specialization, not just
1276 when saved_local_specializations is non-NULL.
1277
7d96d151 12782012-01-26 Paolo Carlini <paolo.carlini@oracle.com>
1279
1280 PR c++/51370
1281 * error.c (dump_decl, [TEMPLATE_ID_EXPR]): Handle error_mark_node
1282 as TREE_OPERAND (t, 1).
1283
5a3e2e79 12842012-01-24 Jason Merrill <jason@redhat.com>
1285
dd8e87ae 1286 PR c++/51917
1287 * decl.c (xref_basetypes): Check VEC_length instead of VEC_space.
1288
5a3e2e79 1289 PR c++/51973
1290 * tree.c (called_fns_equal): Check template args.
1291 (cp_tree_equal): Call it.
1292
83ad1a07 12932012-01-24 Aldy Hernandez <aldyh@redhat.com>
1294 Patrick Marlier <patrick.marlier@gmail.com>
1295
1296 PR c++/51928
1297 * class.c (set_method_tm_attributes): Use TARGET_THUNK instead of
1298 thunk for set_one_vmethod_tm_attributes.
1299
57fba9a7 13002012-01-24 Paolo Carlini <paolo.carlini@oracle.com>
1301
1302 PR c++/51223
1303 * call.c (build_over_call): Check for error_mark_node as
1304 TREE_VALUE when default arguments are processed.
1305
a837ff93 13062012-01-23 Jason Merrill <jason@redhat.com>
1307
1308 PR c++/51930
1309 * decl2.c (determine_visibility): Check for visibility attribute
1310 on template specialization.
1311
88b35b1e 13122012-01-23 Paolo Carlini <paolo.carlini@oracle.com>
1313
1314 PR c++/51398
1315 * pt.c (parameter_of_template_p): Skip error_mark_node parameters.
1316
47744737 13172012-01-23 Jason Merrill <jason@redhat.com>
1318
1319 PR c++/51925
1320 * class.c (add_method): Set OVL_USED for using-decls.
1321 * tree.c (ovl_scope): New.
1322 * cp-tree.h: Declare it.
1323 * parser.c (cp_parser_template_name): Use it.
1324 * semantics.c (baselink_for_fns): Likewise.
1325 * name-lookup.c (set_inherited_value_binding_p): Likewise.
1326
b9a90eac 13272012-01-20 Paolo Carlini <paolo.carlini@oracle.com>
1328
1329 PR c++/51402
1330 * pt.c (lookup_template_class_1): Check context returned by
1331 tsubst for error_mark_node.
1332
ebc77885 13332012-01-19 Kai Tietz <ktietz@redhat.com>
1334
1335 PR c++/51344
1336 * decl2.c (save_template_attributes): Use merge_attributes
1337 instead of chaining up via TREE_CHAIN.
1338
a33d30fe 13392012-01-19 Jason Merrill <jason@redhat.com>
1340
1341 PR c++/51889
1342 * class.c (finish_struct): Call add_method here for function usings.
1343 * semantics.c (finish_member_declaration): Not here.
1344
03cbe7c9 13452012-01-18 Paolo Carlini <paolo.carlini@oracle.com>
1346
1347 PR c++/51225
1348 * typeck2.c (store_init_value): Within a template guard
1349 cxx_constant_value with require_potential_constant_expression.
1350 * pt.c (convert_nontype_argument): Likewise.
1351
193dc72f 13522012-01-16 Jakub Jelinek <jakub@redhat.com>
1353
1354 PR c++/51854
1355 * mangle.c (write_template_arg_literal): Handle complex.
1356
899e9211 13572012-01-16 Jason Merrill <jason@redhat.com>
1358
71d3f205 1359 PR c++/51827
1360 * mangle.c (mangle_decl): Don't mangle uninstantiated templates.
1361
899e9211 1362 PR c++/51868
1363 * typeck.c (build_static_cast_1): Handle bit-fields properly.
1364
3637bb87 13652012-01-13 Ian Lance Taylor <iant@google.com>
1366
1367 PR c++/50012
1368 * typeck.c (enum_cast_to_int): New static function.
1369 (cp_build_binary_op): When handling warn_sign_compare, don't test
1370 for TREE_NO_WARNING. Do call enum_cast_to_int.
1371 * call.c (avoid_sign_compare_warnings): Remove static function.
1372 (build_new_op_1): Don't call avoid_sign_compare_warnings.
1373
13b67b5c 13742012-01-13 Steven Bosscher <steven@gcc.gnu.org>
1375
1376 * decl2.c: Do not include tree-mudflap.h
1377 * semantics.c: Likewise.
1378
de865950 13792012-01-13 Jason Merrill <jason@redhat.com>
1380
e8653c02 1381 PR c++/20681
1382 * semantics.c (finish_break_stmt): Avoid adding an unreachable
1383 BREAK_STMT.
1384
bf56937c 1385 PR c++/51813
1386 * decl2.c (constrain_visibility): Clear DECL_VISIBILITY_SPECIFIED
1387 when reducing the visibility.
1388
de865950 1389 PR c++/51620
1390 * class.c (build_vtbl_initializer): Use __cxa_deleted_virtual.
1391
9599f526 13922012-01-12 Jason Merrill <jason@redhat.com>
1393
1394 PR c++/51714
1395 * pt.c (value_dependent_expression_p): Treat STMT_EXPR as
1396 value-dependent.
1397
5770f123 13982012-01-13 Dodji Seketeli <dodji@redhat.com>
1399
1400 PR c++/51633
1401 * semantics.c (cp_parser_ctor_initializer_opt_and_function_body):
1402 Set the pointer to the last block of the constructor to the
1403 current statement.
1404 (build_constexpr_constructor_member_initializers): Get
1405 build_data_member_initialization a chance to deal with more
1406 statements before we choke.
1407
c10e5f92 14082012-01-12 Jason Merrill <jason@redhat.com>
1409
8272c334 1410 PR c++/48051
1411 * mangle.c (write_expression): Mangle BASELINK scope if
1412 BASELINK_QUALIFIED_P.
1413 * search.c (adjust_result_of_qualified_name_lookup): Set
1414 BASELINK_QUALIFIED_P.
1415 * tree.c (cp_tree_equal) [BASELINK]: Compare BASELINK_QUALIFIED_P.
1416 * parser.c (cp_parser_postfix_dot_deref_expression): Don't call
1417 adjust_result_of_qualified_name_lookup for non-qualified names.
1418
c10e5f92 1419 PR c++/51403
1420 * pt.c (unify): Handle error_mark_node.
1421
42cac518 14222012-01-11 Jason Merrill <jason@redhat.com>
1423
474725e1 1424 PR c++/51565
1425 * call.c (standard_conversion): For ptrmemfuncs, compare the
1426 static_fn_types.
1427
272bba4d 1428 PR c++/51818
1429 * mangle.c (find_substitution): A type is only a substitution
1430 match if we're looking for a type.
1431 (write_nested_name): Use decl_mangling_context.
1432
30cc5e09 1433 * decl.c (decls_match): Assert that the arguments are decls.
1434
42cac518 1435 PR c++/51613
1436 * pt.c (resolve_overloaded_unification): Compare types with
1437 same_type_p, not decls_match.
1438
944ec1bb 14392012-01-10 Jason Merrill <jason@redhat.com>
1440
fdc21495 1441 PR c++/51614
1442 * class.c (build_base_path): Diagnose ambiguous base.
1443
944ec1bb 1444 PR c++/51433
1445 * semantics.c (cxx_eval_call_expression): Always retry previously
1446 non-constant expressions.
1447
81d8c61f 14482012-01-06 Jason Merrill <jason@redhat.com>
1449
73fcfc2c 1450 DR 686
1451 PR c++/47450
1452 * parser.c (cp_parser_new_expression): Set
1453 type_definition_forbidden_message.
1454
2d847c18 1455 PR c++/6057
1456 PR c++/48051
1457 PR c++/50855
1458 PR c++/51322
1459 * mangle.c (write_expression): Support NEW_EXPR, DELETE_EXPR,
1460 THROW_EXPR, CONSTRUCTOR, OVERLOAD. Fix PREINCREMENT_EXPR and
1461 PREDECREMENT_EXPR.
1462 (write_template_arg): Fix mangling of class-scope functions and
1463 argument packs.
1464 (mangle_decl): Update suggested -fabi-version argument.
1465 * operators.def: Add DOTSTAR_EXPR, REINTERPRET_CAST_EXPR,
1466 DYNAMIC_CAST_EXPR; correct CONST_CAST_EXPR, STATIC_CAST_EXPR.
1467 * tree.c (dependent_name): No longer static.
1468 * cp-tree.h: Declare it.
1469 * pt.c (unify): Defer handling of unconverted functions.
1470
fb5491a0 1471 * mangle.c (mangle_decl): Don't generate mangling aliases
1472 for maybe-in-charge [cd]tors.
1473
81d8c61f 1474 * error.c (dump_expr): Print type of CONSTRUCTOR.
1475
f9d09581 14762012-01-05 Dodji Seketeli <dodji@redhat.com>
1477
1478 PR c++/51541
1479 * parser.c (cp_parser_alias_declaration): Get out early upon
1480 errors in the identifier or the attributes.
1481
ce7c3fb6 14822012-01-04 Paolo Carlini <paolo.carlini@oracle.com>
1483
1484 PR c++/51064
1485 * pt.c (tsubst_copy_and_build): Maybe set TREE_NO_WARNING on
1486 the tree returned by build_x_binary_op.
1487
91b6856f 14882012-01-03 Paolo Carlini <paolo.carlini@oracle.com>
1489
1490 PR c++/51738
1491 * parser.c (cp_parser_postfix_open_square_expression): Handle
1492 postfix-expression [ braced-init-list ].
1493
9b569e36 14942012-01-03 Paolo Carlini <paolo.carlini@oracle.com>
1495
1496 PR c++/29273
1497 * rtti.c (build_dynamic_cast_1): In case of T a pointer type,
1498 call decay_conversion on v.
1499
73a98f36 15002012-01-03 Paolo Carlini <paolo.carlini@oracle.com>
1501
1502 PR c++/15867
1503 * decl.c (duplicate_decls): With -Wredundant-decls don't warn for
1504 declaration followed by specialization.
1505
a1e95a65 15062012-01-03 Jakub Jelinek <jakub@redhat.com>
1507
1508 PR c++/51669
1509 * semantics.c (finish_omp_clauses): Call fold_build_cleanup_point_expr
1510 on OMP_CLAUSE_{IF,FINAL,NUM_THREADS,SCHEDULE_CHUNK}_EXPR.
1511
ce24dc8d 15122012-01-02 Jason Merrill <jason@redhat.com>
1513
2425eec7 1514 DR 1359
1515 PR c++/51675
1516 * method.c (walk_field_subobs): Don't check for uninitialized
1517 fields in a union.
1518 (synthesized_method_walk): Check here.
1519
ce24dc8d 1520 DR 325
1521 PR c++/51666
1522 * parser.c (cp_parser_cache_defarg): Split out...
1523 (cp_parser_parameter_declaration): ...from here.
1524 (cp_parser_save_nsdmi): Use it.
1525 (cp_parser_cache_group): Remove CPP_COMMA support.
1526
208d6e3e 15272012-01-02 Dodji Seketeli <dodji@redhat.com>
1528
1529 PR c++/51462
1530 * semantics.c (cx_check_missing_mem_inits): Don't assert in case
1531 of error.
1532
bd46a023 15332012-01-02 Paolo Carlini <paolo.carlini@oracle.com>
1534
1535 PR c++/20140
1536 * typeck2.c (digest_init_r): Use copy_init when initializing
1537 an array of chars.
1538
4e9d8e18 15392012-01-01 Paolo Carlini <paolo.carlini@oracle.com>
1540
1541 PR c++/16603
1542 * decl.c (build_enumerator): Don't call perform_integral_promotions
1543 on the value.
1544
8eae84ad 15452012-01-01 Paolo Carlini <paolo.carlini@oracle.com>
1546
1547 PR c++/51379
1548 * typeck.c (build_reinterpret_cast_1): Implement resolution of
1549 DR 799.
1550
15512012-01-01 Fabien ChĂȘne <fabien@gcc.gnu.org>
3239a030 1552
1553 * parser.c (cp_parser_using_declaration): Add a warning about
1554 deprecated access declarations when no errors were encountered
1555 while parsing the access declaration. Save the first token in
1556 order to emit the warning at the right place.
7dfbd804 1557\f
8dfa851a 1558Copyright (C) 2012 Free Software Foundation, Inc.
7dfbd804 1559
1560Copying and distribution of this file, with or without modification,
1561are permitted in any medium without royalty provided the copyright
1562notice and this notice are preserved.