re PR c++/54341 (ICE (segfault) in cx_check_missing_mem_inits, at cp/semantics.c...
[gcc.git] / gcc / cp / ChangeLog
1 2012-09-06 Jason Merrill <jason@redhat.com>
2
3 PR c++/54341
4 PR c++/54253
5 * semantics.c (sort_constexpr_mem_initializers): New.
6 (build_constexpr_constructor_member_initializers): Use it.
7 (cx_check_missing_mem_inits): Skip artificial fields.
8 * init.c (expand_aggr_init_1): Don't zero out a class
9 with no data.
10
11 2012-09-05 Paolo Carlini <paolo.carlini@oracle.com>
12
13 PR c++/54191
14 * search.c (lookup_base): Add tsubst_flags_t parameter.
15 (adjust_result_of_qualified_name_lookup, check_final_overrider):
16 Adjust.
17 * name-lookup.c (do_class_using_decl): Adjust.
18 * typeck2.c (binfo_or_else, build_scoped_ref, build_m_component_ref):
19 Likewise.
20 * cvt.c (cp_convert_to_pointer, convert_to_pointer_force,
21 build_up_reference): Likewise.
22 * rtti.c (build_dynamic_cast_1): Likewise.
23 * tree.c (maybe_dummy_object): Likewise.
24 * call.c (build_conditional_expr_1, build_over_call): Likewise.
25 * cp-tree.h (UNIQUELY_DERIVED_FROM_P, PUBLICLY_UNIQUELY_DERIVED_P):
26 Remove.
27 (enum base_access_flags, ba_quiet): Remove.
28 (uniquely_derived_from_p, publicly_uniquely_derived_p): Declare.
29 * except.c (can_convert_eh): Adjust.
30 * decl.c (grokdeclarator): Likewise.
31 * typeck.c (comp_except_types, build_class_member_access_expr,
32 finish_class_member_access_expr, get_member_function_from_ptrfunc,
33 build_static_cast_1, get_delta_difference_1): Likewise.
34 * class.c (build_base_path, convert_to_base, build_vtbl_ref_1,
35 warn_about_ambiguous_bases): Likewise.
36 (uniquely_derived_from_p, publicly_uniquely_derived_p): Define.
37
38 2012-09-04 Jason Merrill <jason@redhat.com>
39
40 PR c++/54441
41 * decl.c (reshape_init_class): Handle invalid initializer for
42 0-length array member.
43
44 * error.c (dump_type_suffix): Correct handling of 0-length arrays.
45
46 PR c++/54420
47 * cp-tree.h (LAMBDANAME_P): Remove.
48 (LAMBDA_TYPE_P): Check CLASSTYPE_LAMBDA_EXPR instead.
49 * cp-lang.c (cxx_dwarf_name): Likewise.
50 * error.c (dump_aggr_type): Likewise.
51 * semantics.c (begin_lambda_type): Set CLASSTYPE_LAMBDA_EXPR sooner.
52
53 PR c++/54198
54 * decl.c (check_default_argument): Set cp_unevaluated_operand
55 around call to perform_implicit_conversion_flags.
56
57 PR c++/54437
58 PR c++/51213
59 * pt.c (fn_type_unification): Call coerce_template_parms before
60 entering substitution context.
61
62 2012-08-31 Paolo Carlini <paolo.carlini@oracle.com>
63 Jason Merrill <jason@redhat.com>
64
65 PR c++/18747
66 * pt.c (check_template_variable): New.
67 (num_template_headers_for_class): Split out...
68 * decl.c (grokdeclarator): ...from here.
69 (start_decl): Remove redundant diagnostic.
70 * cp-tree.h: Declare them
71 * parser.c (cp_parser_single_declaration): Call check_template_variable.
72
73 2012-08-31 Ollie Wild <aaw@google.com>
74
75 PR c++/54197
76 * call.c (extend_ref_init_temps_1): Handle COMPOUND_EXPR trees.
77
78 2012-08-30 Jason Merrill <jason@redhat.com>
79
80 PR c++/50545
81 PR c++/51222
82 * pt.c (instantiation_dependent_r): New.
83 (instantiation_dependent_expression_p): New.
84 (value_dependent_expression_p): Use it. SCOPE_REF is always dependent.
85 * semantics.c (finish_decltype_type): Use it.
86 * cp-tree.h: Declare it.
87
88 * semantics.c (finish_qualified_id_expr): Handle building up a
89 non-dependent SCOPE_REF here.
90 (finish_id_expression): Not here.
91 * error.c (dump_decl) [SCOPE_REF]: Only pass TFF_UNQUALIFIED_NAME.
92
93 * friend.c (make_friend_class): Handle template template parameters.
94 * parser.c (cp_parser_template_declaration_after_export): Likewise.
95 * pt.c (tsubst_friend_class): Likewise.
96 (instantiate_class_template_1): Likewise
97 * decl.c (check_elaborated_type_specifier): Likewise.
98 (lookup_and_check_tag): Likewise.
99
100 * pt.c (get_class_bindings): Call coerce_template_parms. Add
101 main_tmpl parameter.
102 (more_specialized_class): Add main_tmpl parameter.
103 (most_specialized_class): Adjust calls.
104
105 * decl.c (cp_finish_decl): Check for invalid multiple initializers
106 even if the initializer is dependent.
107
108 * pt.c (instantiate_template_1): Keep processing_template_decl set
109 if there are dependent args.
110
111 2012-08-25 Paolo Carlini <paolo.carlini@oracle.com>
112
113 PR c++/51421
114 * decl2.c (mark_used): Consistently return false after errors
115 about uses before deduction of auto.
116 * semantics.c (finish_id_expression): Check mark_used return
117 value and return error_mark_node in case of failure.
118
119 2012-08-24 Jason Merrill <jason@redhat.com>
120
121 PR c++/51213 (again)
122 * pt.c (deduction_tsubst_fntype): Remove.
123 (fn_type_unification): Check deduction depth and call
124 instantiate_template here. Handle default argument access checks.
125 (determine_specialization): Suppress access control.
126 (tsubst_decl): Check for excessive deduction depth.
127 (recheck_decl_substitution): Make sure access control is on.
128 (type_unification_real): Don't mess with access deferring here.
129 (get_bindings): Adjust for fn_type_unification return type.
130 * call.c (enum rejection_reason_code): Drop rr_template_instantiation.
131 (template_instantiation_rejection): Remove.
132 (struct rejection_reason): Change targs to num_targs.
133 (template_unification_rejection, print_z_candidate): Adjust.
134 (add_template_candidate_real): Adjust for fn_type_unification change.
135 * class.c (resolve_address_of_overloaded_function): Likewise.
136 * cp-tree.h: Adjust declaration.
137
138 * pt.c (tsubst_default_argument): Indicate where the default
139 argument is being instantiated for.
140 (tsubst_expr): Restore previous location.
141 (tsubst_copy_and_build): Set and restore location.
142 * call.c (build_new_method_call_1): Remember location of call.
143 * semantics.c (finish_call_expr): Here too.
144 * parser.c (cp_parser_omp_for_loop): Remember the location of the
145 increment expression.
146
147 * pt.c (resolve_overloaded_unification): Use coerce_template_parms
148 instead of get_bindings.
149 (resolve_nondeduced_context): Likewise.
150
151 * pt.c (register_specialization): Correct argument to
152 check_specialization_namespace.
153 (determine_specialization): Don't consider members of
154 unspecialized types.
155
156 2012-08-23 Jason Merrill <jason@redhat.com>
157
158 * decl.c (compute_array_index_type): Use type_dependent_expression_p.
159
160 2012-08-23 Paolo Carlini <paolo.carlini@oracle.com>
161
162 PR c++/20420
163 * name-lookup.c (supplement_binding_1): Handle specially enums
164 only in class templates.
165 (validate_nonmember_using_decl): Enforce 7.3.3/10 about duplicate
166 using declarations at function scope.
167
168 2012-08-21 Richard Guenther <rguenther@suse.de>
169
170 * cp-tree.h (TREE_INDIRECT_USING): Use TREE_LANG_FLAG_0 accessor.
171 (ATTR_IS_DEPENDENT): Likewise.
172 (ARGUMENT_PACK_INCOMPLETE_P): Use TREE_ADDRESSABLE instead of
173 TREE_LANG_FLAG_0 on TREE_VECs.
174
175 2012-08-20 Paolo Carlini <paolo.carlini@oracle.com>
176
177 PR c++/10416
178 * decl.c (poplevel): Check TYPE_HAS_NONTRIVIAL_DESTRUCTOR for
179 Wunused_variable too.
180
181 2012-08-20 Diego Novillo <dnovillo@google.com>
182
183 * decl.c (poplevel): Start TV_NAME_LOOKUP conditionally.
184
185 2012-08-20 Richard Guenther <rguenther@suse.de>
186
187 * name-lookup.c (store_binding_p): New predicate, split out from ...
188 (store_binding): ... here. Always store binding and require
189 target vector with enough space.
190 (store_bindings): Collect to store bindings and reserve space
191 for them, then store them.
192 (store_class_bindings): Likewise.
193
194 2012-08-19 Mikael Morin <mikael@gcc.gnu.org>
195
196 * Make-lang.in: Fix typo.
197
198 2012-08-17 Jakub Jelinek <jakub@redhat.com>
199
200 * cp-tree.def (SIZEOF_EXPR): Move to c-common.def.
201
202 2012-08-14 Diego Novillo <dnovillo@google.com>
203
204 Merge from cxx-conversion branch. Re-write VEC in C++.
205
206 * call.c (add_function_candidate): Remove const qualifier
207 from call to VEC_index.
208
209 2012-08-10 Richard Guenther <rguenther@suse.de>
210
211 * error.c (dump_expr): Handle anonymous SSA names.
212
213 2012-08-07 Steven Bosscher <steven@gcc.gnu.org>
214
215 * error.c (print_instantiation_context): Pretty-print a newline before
216 diagnostic_flush_buffer.
217 * cxx-pretty-print.c (pp_cxx_function_definition): Use
218 pp_newline_and_flush instead of separate pp_newline and pp_flush.
219
220 2012-08-06 Dodji Seketeli <dodji@redhat.com>
221
222 Avoid crashing on erroneous static_assert usage
223 * semantics.c (finish_static_assert): Don't crash on erroneous
224 message or condition.
225
226 2012-08-06 Marc Glisse <marc.glisse@inria.fr>
227 Paolo Carlini <paolo.carlini@oracle.com>
228
229 PR c++/54165
230 * typeck.c (build_static_cast_1): Move the conversion to void case
231 before the perform_direct_initialization_if_possible call.
232
233 2012-08-03 Marc Glisse <marc.glisse@inria.fr>
234
235 * pt.c (tsubst_copy_and_build): Handle VECTOR_TYPE like scalars.
236 * cp-tree.h (scalarish_type_p): Declare.
237 * tree.c (scalarish_type_p): Make non-static.
238
239 2012-08-02 Jason Merrill <jason@redhat.com>
240 Paolo Carlini <paolo.carlini@oracle.com>
241
242 PR c++/51213 (again)
243 * pt.c (type_unification_real): Call push_deferring_access_checks /
244 pop_deferring_access_checks around the substitution of default
245 template args.
246 (instantiate_template_1): When the specialization returned by
247 retrieve_specialization has FNDECL_HAS_ACCESS_ERRORS set and we
248 are in a SFINAE context, simply return error_mark_node.
249 * cp-tree.h (FNDECL_RECHECK_ACCESS_P): Rename FNDECL_HAS_ACCESS_ERRORS.
250
251 2012-07-31 Paolo Carlini <paolo.carlini@oracle.com>
252
253 * pt.c (check_default_tmpl_args): Change is_primary and is_partial
254 parameters to bool type, adjust.
255 (push_template_decl_real): Tidy.
256 * parser.c (cp_parser_init_declarator): Adjust.
257 * decl.c (redeclaration_error_message): Likewise.
258 * cp-tree.h (check_default_tmpl_args): Update prototype.
259
260 2012-07-31 Paolo Carlini <paolo.carlini@oracle.com>
261
262 PR c++/53624
263 * pt.c (check_default_tmpl_args): Don't check local types.
264
265 2012-07-25 Sandra Loosemore <sandra@codesourcery.com>
266 Paul Brook <paul@codesourcery.com>
267
268 PR target/53633
269 * decl.c (finish_function): Check targetm.warn_func_return.
270
271 2012-07-25 Jason Merrill <jason@redhat.com>
272
273 PR c++/54086
274 * decl.c (grokdeclarator): Allow const and constexpr together.
275
276 PR c++/54020
277 * semantics.c (potential_constant_expression_1) [COND_EXPR]: Call
278 maybe_constant_value.
279
280 * cp-tree.h (tsubst_flags): Remove tf_no_access_control.
281 * call.c (standard_conversion): Don't set it.
282 * class.c (resolve_address_of_overloaded_function): Don't check it.
283 * decl.c (check_default_argument): Call
284 perform_implicit_conversion_flags.
285
286 * pt.c (print_candidates_1): Use inform instead of error.
287
288 2012-07-24 Paolo Carlini <paolo.carlini@oracle.com>
289
290 * pt.c (convert_template_argument, tsubst): Simplify fourth argument
291 to make_typename_type (complain & tf_error -> complain).
292
293 2012-07-24 Steven Bosscher <steven@gcc.gnu.org>
294
295 * class.c (n_vtables, n_vtable_entries, n_vtable_searches,
296 n_vtable_elems, n_convert_harshness, n_compute_conversion_costs,
297 n_inner_fields_searched): Always define.
298 (build_primary_vtable): Convert #ifdef GATHER_STATISTICS to if-code.
299 (print_class_statistics): Convert #ifdef GATHER_STATISTICS to if-code.
300 * tree.c (depth_reached): Always define global.
301 (cxx_print_statistics): Convert #ifdef GATHER_STATISTICS to if-code.
302 * pt.c (depth_reached): Always define.
303 (push_tinst_level): Convert #ifdef GATHER_STATISTICS to if-code.
304 * search.c (n_fields_searched, n_calls_lookup_field,
305 n_calls_lookup_field_1, n_calls_lookup_fnfields,
306 n_calls_lookup_fnfields_1, n_calls_get_base_type,
307 n_outer_fields_searched, n_contexts_saved): Always define.
308 (lookup_field_1): Convert #ifdef GATHER_STATISTICS to if-code.
309 (lookup_member): Likewise.
310 (lookup_fnfields_idx_nolazy): Likewise.
311 (print_search_statistics): Likewise.
312 (reinit_search_statistics): Unconditionally re-set counters.
313 * lex.c (retrofit_lang_decl): Convert #ifdef GATHER_STATISTICS
314 to if-code.
315 (cxx_dup_lang_specific_decl): Likewise.
316 (copy_lang_type): Likewise.
317 (cxx_make_type): Likewise.
318
319 2012-07-20 Jason Merrill <jason@redhat.com>
320
321 PR c++/54038
322 * tree.c (build_cplus_array_type): Use build_cplus_array_type to build
323 canonical array type rather than mess with its TYPE_*_VARIANT.
324
325 2012-07-19 Jason Merrill <jason@redhat.com>
326
327 PR c++/54026
328 * typeck.c (cp_apply_type_quals_to_decl): Check COMPLETE_TYPE_P.
329
330 PR c++/54021
331 * call.c (build_cxx_call): Set optimize when folding
332 __builtin_constant_p in a constexpr function.
333
334 2012-07-18 Jason Merrill <jason@redhat.com>
335
336 * pt.c (instantiate_decl): Don't recheck substitutions.
337
338 2012-07-18 Paolo Carlini <paolo.carlini@oracle.com>
339 Jason Merrill <jason@redhat.com>
340
341 DR 1170
342 PR c++/51213
343 * semantics.c (perform_access_checks): Add complain parm, return bool.
344 (perform_deferred_access_checks): Likewise.
345 (perform_or_defer_access_check): Likewise.
346 (speculative_access_check): Remove.
347 * call.c (enforce_access): Add complain parm, return bool.
348 * decl.c, friend.c, class.c, init.c, parser.c: Adjust callers.
349 * search.c: Adjust callers.
350 * cp-tree.h (TINFO_RECHECK_ACCESS_P): New macro.
351 (FNDECL_RECHECK_ACCESS_P): New macro.
352 * method.c (synthesized_method_walk): Stop deferring access checks.
353 * pt.c (recheck_decl_substitution): New.
354 (instantiate_template_1): Set and check FNDECL_RECHECK_ACCESS_P.
355
356 2012-07-18 Jason Merrill <jason@redhat.com>
357
358 * method.c (process_subob_fn): Make sure no_implicit_p is non-null
359 before trying to store through it.
360
361 2012-07-17 Jason Merrill <jason@redhat.com>
362
363 PR c++/53995
364 * decl.c (finish_enum_value_list): Only call
365 insert_late_enum_def_into_classtype_sorted_fields in class scope.
366
367 PR c++/53989
368 * tree.c (build_cplus_array_type): Also add TYPE_CANONICAL
369 to the list of variants.
370
371 * decl.c (xref_basetypes): Complain about incomplete template base.
372 * class.c (finish_struct): Adjust variants in templates, too.
373
374 PR c++/53549
375 * parser.c (cp_parser_class_head): Call xref_basetypes here.
376 (cp_parser_class_specifier_1): Not here.
377 * pt.c (tsubst_decl) [USING_DECL]: Check uses_template_parms
378 as well as DECL_DEPENDENT_P.
379
380 2012-07-16 Jason Merrill <jason@redhat.com>
381
382 * cp-tree.h (struct deferred_access_check): Add location.
383 * semantics.c (perform_access_checks): Use it.
384 (perform_or_defer_access_check): Store it.
385
386 2012-07-16 Steven Bosscher <steven@gcc.gnu.org>
387
388 * dump.c (dump_stmt): Moved here from c-dump.c.
389 * optimize.c: Include dumpfile.h instead of tree-dump.h.
390 * class.c: Likewise.
391 * decl2.c: Likewise.
392 * Make-lang.in: Fix dependencies.
393
394 2012-07-13 Jason Merrill <jason@redhat.com>
395
396 PR c++/53953
397 * method.c (synthesized_method_walk): Initialize no_implicit_p sooner.
398
399 2012-07-12 Jason Merrill <jason@redhat.com>
400
401 * pt.c (instantiate_decl): Check typedefs access here.
402 (instantiate_template_1): Not here.
403
404 * pt.c (deduction_tsubst_fntype): Just suppress access checking.
405 (instantiate_template_1): Set DECL_TI_TEMPLATE before access checking.
406 (push_deduction_access_scope, pop_deduction_access_scope): Remove.
407
408 2012-07-11 Jason Merrill <jason@redhat.com>
409
410 DR 1402
411 * method.c (synthesized_method_walk): Replace uses of msg with diag.
412 Correct handling of virtual bases with move operations.
413 (process_subob_fn, walk_field_subobs): Replace uses of msg with diag.
414
415 2012-07-11 Steven Bosscher <steven@gcc.gnu.org>
416
417 * method.c: Do not include tree-pass.h.
418
419 2012-07-10 Jason Merrill <jason@redhat.com>
420
421 DR 1402
422 PR c++/53733
423 * cp-tree.h (FNDECL_SUPPRESS_IMPLICIT_DECL): New.
424 (struct lang_decl_fn): Add suppress_implicit_decl field.
425 * method.c (implicitly_declare_fn): Check it.
426 (process_subob_fn): Add no_implicit_p parm.
427 (walk_field_subobs, synthesized_method_walk): Likewise.
428 (maybe_explain_implicit_delete): Adjust.
429 (explain_implicit_non_constexpr): Adjust.
430
431 * method.c (synthesized_method_walk): Avoid changing
432 EH spec based on cleanups in other places, too.
433
434 2012-07-09 Sterling Augustine <saugustine@google.com>
435
436 * error.c (lang_decl_name): Use TFF_UNQUALIFIED_NAME flag.
437
438 2012-07-08 Steven Bosscher <steven@gcc.gnu.org>
439
440 * decl.c (cp_finish_decl): Add FIXME at add_local_decl call site.
441
442 2012-07-06 Jason Merrill <jason@redhat.com>
443
444 PR c++/53862
445 * pt.c (tsubst_arg_types): Add "end" parameter.
446 (check_undeduced_parms): Use it.
447
448 * cp-tree.h (DECL_DECLARES_TYPE_P): Check DECL_TYPE_TEMPLATE_P.
449
450 PR c++/53858
451 * name-lookup.c (ambiguous_decl): Use DECL_TYPE_TEMPLATE_P.
452
453 2012-07-05 Jason Merrill <jason@redhat.com>
454
455 PR c++/53039
456 * pt.c (arg_from_parm_pack_p): Go back to using same_type_p or
457 cp_tree_equal.
458
459 * cp-tree.h (TEMPLATE_PARM_NUM_SIBLINGS): Remove.
460 (struct template_parm_index_s): Remove num_siblings.
461 * pt.c (fixup_template_parms, fixup_template_parm_index): Remove.
462 (fixup_template_type_parm_type): Remove.
463 (build_template_parm_index): Remove num_siblings parm.
464 (process_template_parm): Likewise.
465 * parser.c (cp_parser_template_parameter_list): Adjust.
466 * tree.c (cp_tree_equal): Don't compare num_siblings.
467 * typeck.c (comp_template_parms_position): Likewise.
468
469 PR c++/50852
470 PR c++/53039
471 * tree.c (strip_typedefs_expr): New.
472 * cp-tree.h: Declare it.
473 * pt.c (convert_template_argument, unify): Use it.
474 * parser.c (cp_parser_template_declaration_after_export): Don't call
475 fixup_template_parms.
476
477 2012-07-04 Jason Merrill <jason@redhat.com>
478
479 PR c++/53848
480 PR c++/53524
481 * decl.c (build_enumerator): Don't use build_lang_decl_loc.
482
483 2012-07-03 Jakub Jelinek <jakub@redhat.com>
484
485 PR c++/53812
486 * semantics.c (finish_goto_stmt): Surround computed goto argument
487 with CLEANUP_POINT_EXPR if needed.
488
489 2012-07-02 Jason Merrill <jason@redhat.com>
490
491 PR c++/53619
492 * pt.c (in_template_function): New.
493 * cp-tree.h: Declare it.
494 * class.c (build_base_path, resolves_to_fixed_type_p): Use it.
495
496 PR c++/53783
497 * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Use tsubst
498 for LAMBDA_EXPR_EXTRA_SCOPE.
499
500 PR c++/53788
501 * pt.c (build_non_dependent_expr): Don't wrap a dummy object.
502
503 PR c++/53816
504 * class.c (resolves_to_fixed_type_p): Check uses_template_parms
505 (current_function_decl) instead of processing_template_decl.
506
507 PR c++/53821
508 * semantics.c (maybe_add_lambda_conv_op): Don't set
509 DECL_INTERFACE_KNOWN.
510
511 PR c++/53524
512 * call.c (build_conditional_expr_1): Don't warn about comparison of
513 two enumerators before their enumeration is complete.
514 (build_new_op_1): Call decay_conversion before warn_logical_operator.
515 * decl.c (build_enumerator): Set DECL_CONTEXT of an enumerator to
516 its enumeration.
517 * decl2.c (mark_used): Call used_types_insert for enums.
518 * semantics.c (finish_id_expression): Don't decay CONST_DECL.
519 (finish_member_declaration): Don't change DECL_CONTEXT of enumerators.
520 * class.c (check_field_decls): Don't change DECL_CONTEXT of enums.
521 * typeck.c (convert_for_assignment): Don't decay CONST_DECL.
522 (build_class_member_access_expr): Look through unscoped enums.
523 * search.c (context_for_name_lookup): Look through unscoped enums.
524 * pt.c (tsubst_copy_and_build): Don't decay CONST_DECL.
525 (tsubst_copy): Use DECL_CONTEXT to find the enumeration.
526 * tree.c (decl_linkage): Likewise.
527 * cvt.c (ocp_convert): Check decayed expr for enum range warning.
528
529 2012-06-29 Steven Bosscher <steven@gcc.gnu.org>
530
531 * Make-lang.in: Remove tree-mudflap.o from CXX_AND_OBJCXX_OBJS.
532
533 2012-06-27 Jason Merrill <jason@redhat.com>
534
535 * parser.c (cp_parser_check_for_invalid_template_id): tag_type parm.
536 (cp_parser_simple_type_specifier, cp_parser_class_head): Adjust.
537 (cp_parser_elaborated_type_specifier): Adjust.
538 * decl.c (duplicate_decls): Return error_mark_node on template
539 mismatch.
540
541 PR c++/53563
542 * parser.c (cp_parser_template_id): Add tag_type parm.
543 (cp_parser_template_name): Likewise.
544 (cp_parser_id_expression, cp_parser_unqualified_id): Adjust.
545 (cp_parser_pseudo_destructor_name, cp_parser_type_name): Adjust.
546 (cp_parser_simple_type_specifier, cp_parser_class_name): Adjust.
547 (cp_parser_elaborated_type_specifier, cp_parser_class_head): Adjust.
548
549 2012-06-27 Ramana Radhakrishnan <ramana.radhakrishnan@linaro.org>
550
551 PR C++/51033
552 * semantics.c (constexpr_call): Fix typo in comment.
553 (cxx_eval_vec_perm_expr): New.
554 (cxx_eval_constant_expression): Fold VEC_PERM_EXPRs.
555
556 2012-06-26 Richard Guenther <rguenther@suse.de>
557
558 PR c++/53752
559 * mangle.c (write_array_type): Truncate the number-of-elements
560 result.
561
562 2012-06-25 Jason Merrill <jason@redhat.com>
563
564 PR c++/53498
565 PR c++/53305
566 * pt.c (tsubst_decl) [PARM_DECL]: Don't recurse into DECL_CHAIN
567 if cp_unevaluated_operand is set.
568 (tsubst_copy) [PARM_DECL]: Don't copy before tsubsting.
569
570 PR c++/52988
571 * typeck.c (decay_conversion): Don't discard side-effects from
572 expressions of nullptr_t.
573
574 2012-06-25 Florian Weimer <fweimer@redhat.com>
575
576 * init.c (build_new_1): Warn about (T[N]) for variable N, and
577 reject T[M][N].
578
579 * parser.c (cp_parser_direct_new_declarator): Accept non-constant
580 expressions. Handled now in build_new_1.
581
582 2012-06-25 Jason Merrill <jason@redhat.com>
583
584 PR c++/53202
585 * semantics.c (build_data_member_initialization): Always keep
586 initializer for empty base.
587 (cxx_eval_bare_aggregate): Discard it here.
588
589 PR c++/53565
590 * pt.c (tsubst_omp_for_iterator): Simplify DECL_EXPR handling.
591 (tsubst_expr) [OMP_FOR]: Here, too.
592
593 2012-06-25 Jakub Jelinek <jakub@redhat.com>
594
595 PR c++/53594
596 * class.c (check_bases_and_members): Avoid -Wuninitialized
597 diagnostics for non-static const members or references if they
598 use NSDMI.
599
600 2012-06-16 Ville Voutilainen <ville.voutilainen@gmail.com>
601
602 * parser.c (cp_parser_direct_declarator): Move virt-specifier
603 parsing after late-specified return type parsing.
604
605 2012-06-14 Jason Merrill <jason@redhat.com>
606
607 PR c++/53651
608 * name-lookup.c (constructor_name_p): Don't try to look at the
609 name of a DECLTYPE_TYPE.
610
611 2012-06-18 Lawrence Crowl <crowl@google.com>
612
613 * decl2.c (cp_write_global_declarations): Rename use of TV_PHASE_CGRAPH
614 to TV_PHASE_OPT_GEN.
615
616 2012-06-18 Steven Bosscher <steven@gcc.gnu.org>
617
618 * decl.c (finish_function): Remove code conditional on VMS_TARGET.
619
620 2012-06-15 Marc Glisse <marc.glisse@inria.fr>
621
622 PR c++/51033
623 * semantics.c (literal_type_p): Handle VECTOR_TYPE.
624 (potential_constant_expression_1): Handle VEC_PERM_EXPR.
625 * parser.c (cp_parser_postfix_expression): Handle RID_BUILTIN_SHUFFLE.
626
627 2012-06-09 Jason Merrill <jason@redhat.com>
628
629 * pt.c (tsubst_expr) [TAG_DEFN]: Instantiate local class.
630 * class.c (finish_struct): Don't add a TAG_DEFN for a lambda.
631 * decl2.c (finish_static_data_member_decl): Avoid redundant error.
632
633 PR c++/53599
634 * name-lookup.c (pushtag_1): Add a DECL_EXPR for a local class.
635 * semantics.c (finish_cond): Build a COMPOUND_EXPR.
636 * pt.c (tsubst_expr) [COMPOUND_EXPR]: Handle.
637 [DECL_EXPR]: Don't call cp_finish_decl for an implicit typedef.
638 Don't return the decl.
639
640 2012-06-11 Richard Guenther <rguenther@suse.de>
641
642 PR c++/53605
643 * mangle.c (write_array_type): Use double-ints for array domain
644 arithmetic.
645
646 2012-06-07 Fabien ChĂȘne <fabien@gcc.gnu.org>
647
648 PR c++/51214
649 * cp-tree.h (insert_late_enum_def_into_classtype_sorted_fields):
650 Declare.
651 * class.c (insert_into_classtype_sorted_fields): New.
652 (add_enum_fields_to_record_type): New.
653 (count_fields): Adjust the comment.
654 (add_fields_to_record_type): Likewise.
655 (finish_struct_1): Move the code that inserts the fields for the
656 sorted case, into insert_into_classtype_sorted_fields, and call
657 it.
658 (insert_late_enum_def_into_classtype_sorted_fields): Define.
659 * decl.c (finish_enum_value_list): Call
660 insert_late_enum_def_into_classtype_sorted_fields if a late enum
661 definition is encountered.
662
663 2012-06-06 Paolo Carlini <paolo.carlini@oracle.com>
664
665 PR c++/53567
666 * typeck.c (cp_perform_integral_promotions): New, like
667 perform_integral_promotions but also takes a tsubst_flags_t parameter.
668 (pointer_diff): Add tsubst_flags_t parameter.
669 (decay_conversion, cp_default_conversion, cp_build_array_ref,
670 cp_build_binary_op, cp_build_unary_op, build_static_cast_1,
671 build_reinterpret_cast_1, cp_build_modify_expr,
672 convert_for_assignment): Adjust.
673 * optimize.c (build_delete_destructor_body): Adjust.
674 * init.c (expand_virtual_init, expand_default_init, build_new_1,
675 build_new, build_vec_delete_1, build_vec_init, build_delete): Adjust.
676 (construct_virtual_base): Adjust LOOKUP_COMPLAIN -> 0.
677 * class.c (build_base_path): Adjust.
678 * decl.c (compute_array_index_type, finish_destructor_body): Likewise.
679 * method.c (synthesized_method_walk): Adjust flag and complain.
680 * rtti.c (ifnonnull): Add tsubst_flags_t parameter.
681 (build_typeid, build_dynamic_cast_1): Adjust.
682 * except.c (initialize_handler_parm): Likewise.
683 * typeck2.c (process_init_constructor_record): Likewise.
684 * pt.c (tsubst_friend_class): Don't change flags.
685 * semantics.c (finish_goto_stmt, handle_omp_for_class_iterator,
686 finish_static_assert): Likewise.
687 * parser.c (cp_parser_lookup_name): Just pass 0 as flags to
688 lookup_name_real.
689 * call.c (build_op_delete_call): Add tsubst_flags_t parameter.
690 (convert_like_real, convert_arg_to_ellipsis, convert_for_arg_passing):
691 Adjust.
692 (standard_conversion): Adjust LOOKUP_COMPLAIN -> 0.
693 (implicit_conversion): Mask out tf_error with a FIXME.
694 (build_user_type_conversion_1, build_new_op_1, build_over_call): Use
695 complain & tf_error instead of flags & LOOKUP_COMPLAIN.
696 * cvt.c (cp_convert_to_pointer, convert_to_pointer_force,
697 build_up_reference, convert_to_reference, cp_convert,
698 cp_convert_and_check, ocp_convert, convert_force): Add tsubst_flags_t
699 parameter.
700 (convert_to_reference, ocp_convert): Use complain & tf_error instead
701 of flags & LOOKUP_COMPLAIN.
702 (convert_force): Adjust LOOKUP_COMPLAIN -> 0.
703 * name-lookup.c (identifier_type_value_1, lookup_qualified_name,
704 lookup_name_real, lookup_function_nonclass, lookup_name,
705 lookup_name_prefer_type): Adjust LOOKUP_COMPLAIN -> 0.
706 * cp-tree.h: Adjust prototypes; remove LOOKUP_COMPLAIN.
707
708 2012-06-06 Steven Bosscher <steven@gcc.gnu.org>
709
710 * decl.c: Do not include output.h.
711 (start_decl): Remove code for flag_conserve_space.
712
713 2012-06-06 Fabien ChĂȘne <fabien@gcc.gnu.org>
714
715 PR c++/52841
716 * parser.c (cp_parser_alias_declaration): Return earlier
717 if an error occured.
718
719 2012-06-04 Paolo Carlini <paolo.carlini@oracle.com>
720
721 PR c++/53524
722 * call.c (build_conditional_expr_1): Use OPT_Wenum_compare
723 to control enumeral mismatch in conditional expression too.
724
725 2012-06-04 Sterling Augustine <saugustine@google.com>
726
727 * cp-tree.h: Declare decl_as_dwarf_string, lang_decl_dwarf_name.
728 * cp-lang.c (cxx_dwarf_name): Call them.
729
730 2012-06-04 Steven Bosscher <steven@gcc.gnu.org>
731
732 * semantics.c: Do not include output.h.
733 * decl2.c: Likewise.
734 * friend.c: Likewise.
735 * typeck.c: Likewise.
736 * typeck2.c: Likewise.
737 * Make-lang.in: Fix dependencies.
738
739 2012-06-01 Jason Merrill <jason@redhat.com>
740
741 PR c++/52973
742 * parser.c (cp_parser_class_head): Apply attributes here.
743 * semantics.c (begin_class_definition): Not here.
744 * cp-tree.h: Adjust.
745
746 PR c++/52725
747 * parser.c (cp_parser_binary_expression): Bail early if we're parsing
748 tentatively and the LHS has a parse error.
749
750 PR c++/53137
751 * pt.c (instantiate_class_template_1): Set LAMBDA_EXPR_THIS_CAPTURE.
752 (instantiate_decl): Don't push_to_top_level for local class methods.
753 (instantiate_class_template_1): Or for local classes.
754
755 PR c++/53484
756 * pt.c (do_auto_deduction): Don't try to deduce from a
757 type-dependent initializer.
758
759 2012-06-01 Paolo Carlini <paolo.carlini@oracle.com>
760
761 PR c++/26155
762 * name-lookup.c (push_namespace): When error recovery is
763 impossible just error out in duplicate_decls.
764
765 2012-05-31 Steven Bosscher <steven@gcc.gnu.org>
766
767 * call.c: Do not include output.h.
768 * class.c: Likewise.
769 * except.c: Likewise.
770 * friend.c: Likewise.
771 * init.c: Likewise.
772 * lex.c: Likewise.
773 * method.c: Likewise.
774 * parser.c: Likewise.
775 * pt.c: Likewise.
776 * rtti.c: Likewise.
777 * search.c: Likewise.
778
779 2012-05-30 Jason Merrill <jason@redhat.com>
780
781 PR c++/53356
782 * tree.c (stabilize_init): Handle stabilizing a TARGET_EXPR
783 representing a bitwise copy of a glvalue.
784
785 * tree.c (stabilize_expr): Tweak logic.
786
787 PR c++/53356
788 * tree.c (stabilize_init): Side effects make the init unstable.
789
790 2012-05-28 Paolo Carlini <paolo.carlini@oracle.com>
791
792 PR c++/53503
793 * semantics.c (potential_constant_expression_1): Handle LTGT_EXPR.
794
795 2012-05-26 Paolo Carlini <paolo.carlini@oracle.com>
796
797 PR c++/53491
798 * tree.c (stabilize_expr): Handle exp of void type.
799
800 2012-05-26 Jason Merrill <jason@redhat.com>
801
802 PR c++/53220
803 * call.c (convert_like_real) [ck_list]: Take array address directly.
804 * typeck.c (decay_conversion): Reject decay of an array compound
805 literal.
806
807 2012-05-25 Paolo Carlini <paolo.carlini@oracle.com>
808
809 PR c++/32054
810 * parser.c (cp_parser_member_declaration): A storage class is not
811 allowed in a declaration of an anonymous aggregate in a class scope.
812
813 2012-05-24 Uros Bizjak <ubizjak@gmail.com>
814
815 PR obj-c++/53441
816 * decl.c (grokdeclarator): Check that current_class_type is non-NULL
817 before calling constructor_name_p.
818
819 2012-05-24 Paolo Carlini <paolo.carlini@oracle.com>
820
821 PR c++/32080
822 * parser.c (cp_parser_ctor_initializer_opt_and_function_body,
823 cp_parser_function_body): Add a bool parameter, true when parsing
824 a function-try-block.
825 (cp_parser_function_try_block): Pass true to the above.
826 (cp_parser_function_definition_after_declarator,
827 cp_parser_function_transaction): Adjust.
828
829 2012-05-23 Paolo Carlini <paolo.carlini@oracle.com>
830
831 PR c++/29185
832 * decl2.c (delete_sanity): Extend 'deleting array' warning to
833 any array type.
834
835 2012-05-21 Paolo Carlini <paolo.carlini@oracle.com>
836
837 PR c++/51184
838 * decl.c (grokdeclarator): Diagnose functions returning abstract
839 class types as TYPENAME.
840 * cp-tree.h (ABSTRACT_CLASS_TYPE_P): Add.
841 * except.c (is_admissible_throw_operand_or_catch_parameter): Use it.
842 * pt.c (tsubst): Likewise.
843 * semantics.c (trait_expr_value): Likewise.
844
845 2012-05-21 Paolo Carlini <paolo.carlini@oracle.com>
846
847 PR c++/40821
848 * parser.c (cp_parser_attributes_opt): Enforce error checking of
849 unbalanced parentheses in the presence of tentative parsing.
850
851 2012-05-17 Paolo Carlini <paolo.carlini@oracle.com>
852
853 PR c++/39681
854 * parser.c (cp_parser_new_type_id): Early return error_mark_node
855 if the cp_parser_type_specifier_seq call has type_specifier_seq.type
856 error_mark_node; tidy.
857 (cp_parser_new_expression): Always initialize nelts to NULL_TREE to
858 avoid uninitialized warnings.
859 (cp_parser_init_declarator, cp_parser_late_parse_one_default_arg):
860 Call cp_parser_skip_to_end_of_statement if cp_parser_initializer
861 returns error_mark_node.
862
863 2012-05-17 Paolo Carlini <paolo.carlini@oracle.com>
864
865 PR c++/53371
866 * except.c (is_admissible_throw_operand): Rename to
867 is_admissible_throw_operand_or_catch_parameter and handle
868 catch parameter too.
869 (expand_start_catch_block): Use it.
870 (build_throw): Adjust.
871
872 2012-05-17 Paolo Carlini <paolo.carlini@oracle.com>
873
874 PR c++/44516
875 * typeck.c (build_x_array_ref, build_x_conditional_expr,
876 build_x_compound_expr, build_x_modify_expr): Add location_t parameter.
877 (finish_class_member_access_expr, build_x_indirect_ref,
878 build_x_binary_op, build_x_compound_expr_from_list,
879 build_x_compound_expr_from_vec): Adjust callers.
880 * tree.c (build_min_nt_loc): New.
881 (build_min_nt): Remove.
882 * typeck2.c (build_x_arrow): Adjust callers.
883 * pt.c (tsubst_qualified_id, tsubst_omp_for_iterator,
884 tsubst_copy_and_build): Likewise.
885 * semantics.c (finish_mem_initializers, handle_omp_for_class_iterator,
886 finish_omp_atomic): Likewise.
887 * decl2.c (grok_array_decl, build_anon_union_vars): Adjust.
888 * parser.c (cp_parser_question_colon_clause,
889 cp_parser_assignment_expression, cp_parser_expression,
890 cp_parser_template_id, cp_parser_omp_for_loop): Likewise.
891 * cp-tree.h: Update.
892
893 2012-05-16 Dodji Seketeli <dodji@redhat.com>
894
895 PR preprocessor/7263
896 * cp-tree.h (enum cp_decl_spec): Add new enumerators to cover all
897 the possible declarator specifiers so far.
898 (struct cp_decl_specifier_seq::locations): Declare new member.
899 (cp_decl_specifier_seq::{specs, type_location}): Remove.
900 (decl_spec_seq_has_spec_p): Declare new function.
901 * parser.c (cp_parser_check_decl_spec): Remove.
902 (set_and_check_decl_spec_loc): Define new static function.
903 (decl_spec_seq_has_spec_p): Define new public function.
904 (cp_parser_decl_specifier_seq, cp_parser_function_specifier_opt)
905 (cp_parser_type_specifier, cp_parser_simple_type_specifier)
906 (cp_parser_set_storage_class, cp_parser_set_decl_spec_type)
907 (cp_parser_alias_declaration): Set the locations for each
908 declspec, using set_and_check_decl_spec_loc.
909 (cp_parser_explicit_instantiation, cp_parser_init_declarator)
910 (cp_parser_member_declaration, cp_parser_init_declarator): Use the
911 new declspec location for specifiers. Use the new
912 decl_spec_seq_has_spec_p.
913 (cp_parser_type_specifier_seq): Use the new
914 set_and_check_decl_spec_loc. Stop using
915 cp_parser_check_decl_spec. Use the new decl_spec_seq_has_spec_p.
916 (, cp_parser_init_declarator): Use the new
917 set_and_check_decl_spec_loc.
918 (cp_parser_single_declaration, cp_parser_friend_p)
919 (cp_parser_objc_class_ivars, cp_parser_objc_struct_declaration):
920 Use the new decl_spec_seq_has_spec_p.
921 * decl.c (check_tag_decl): Use new decl_spec_seq_has_spec_p. Use
922 the more precise ds_redefined_builtin_type_spec location for
923 diagnostics about re-declaring C++ built-in types.
924 (start_decl, grokvardecl, grokdeclarator): Use the new
925 decl_spec_seq_has_spec_p.
926
927 2012-05-15 Paolo Carlini <paolo.carlini@oracle.com>
928
929 PR c++/11856
930 * pt.c (tsubst_copy_and_build): Increase / decrease
931 c_inhibit_evaluation_warnings around build_x_binary_op call.
932
933 2012-05-12 Paolo Carlini <paolo.carlini@oracle.com>
934
935 * cp-tree.h (TYPE_PTRMEM_P): Rename to TYPE_PTRDATAMEM_P.
936 (TYPE_PTR_TO_MEMBER_P): Rename to TYPE_PTRMEM_P.
937 (TYPE_PTR_OR_PTRMEM_P): Add.
938 * typeck.c (composite_pointer_type_r, composite_pointer_type,
939 common_pointer_type, cp_build_indirect_ref, cp_build_binary_op,
940 cp_truthvalue_conversion, convert_ptrmem, build_static_cast_1,
941 build_reinterpret_cast_1, build_const_cast_1, comp_ptr_ttypes_real,
942 casts_away_constness_r, casts_away_constness): Adjust.
943 * init.c (build_zero_init_1): Adjust.
944 * class.c (check_field_decls): Likewise.
945 * decl.c (check_default_argument): Likewise.
946 * rtti.c (target_incomplete_p): Likewise.
947 * tree.c (zero_init_p): Likewise.
948 * cxx-pretty-print.c (pp_cxx_ptr_operator,
949 pp_cxx_abstract_declarator): Likewise.
950 * typeck2.c (build_m_component_ref): Likewise.
951 * pt.c (convert_nontype_argument, invalid_nontype_parm_type_p,
952 dependent_type_p_r): Likewise.
953 * call.c (null_member_pointer_value_p, standard_conversion,
954 add_builtin_candidate, build_conditional_expr_1, compare_ics):
955 Likewise.
956 * cp-objcp-common.c (cp_var_mod_type_p): Likewise.
957 * cvt.c (cp_convert_to_pointer, ocp_convert,
958 perform_qualification_conversions): Likewise.
959 * mangle.c (write_type): Likewise.
960 * name-lookup.c (arg_assoc_type): Likewise.
961
962 2012-05-12 Paolo Carlini <paolo.carlini@oracle.com>
963
964 * parser.c (struct cp_parser_expression_stack_entry): Add location_t
965 field.
966 (cp_parser_binary_expression): Rework to always update at the same
967 time tree_type and loc.
968 * call.c (print_z_candidate): Add location_t parameter.
969 (print_z_candidates, convert_like_real, joust): Adjust.
970
971 2012-05-11 Alexandre Oliva <aoliva@redhat.com>
972
973 PR c++/53209
974 * pt.c (tsubst_decl): Bail out if argvec is error_mark_node.
975
976 2012-05-11 Paolo Carlini <paolo.carlini@oracle.com>
977
978 PR c++/53305
979 * pt.c (tsubst_copy: case PARM_DECL): Return error_mark_node if
980 tsubst_decl returns NULL_TREE.
981 * cxx-pretty-print.c (pp_cxx_simple_type_specifier): Handle
982 BOUND_TEMPLATE_TEMPLATE_PARM.
983
984 2012-05-10 Paolo Carlini <paolo.carlini@oracle.com>
985
986 PR c++/53158
987 * cvt.c (ocp_convert): Error out early for void -> bool conversions.
988 * typeck.c (decay_conversion): Use error_at.
989 * call.c (build_integral_nontype_arg_conv, convert_like_real,
990 convert_arg_to_ellipsis, perform_implicit_conversion_flags,
991 initialize_reference): Likewise.
992 * cvt.c (warn_ref_binding): Add location_t parameter.
993 (cp_convert_to_pointer, convert_to_reference, ocp_convert,
994 convert_to_void, ): Use error_at and warning_at.
995
996 2012-05-10 Paolo Carlini <paolo.carlini@oracle.com>
997
998 PR c++/53301
999 * decl.c (check_default_argument): Fix typo (POINTER_TYPE_P
1000 instead of TYPE_PTR_P) in zero-as-null-pointer-constant warning.
1001
1002 2012-05-06 Paolo Carlini <paolo.carlini@oracle.com>
1003
1004 PR c++/53152
1005 * call.c (op_error, build_new_op_1, build_new_op): Add location_t
1006 parameter.
1007 (build_conditional_expr_1): Adjust.
1008 * typeck.c (build_x_indirect_ref, build_x_binary_op,
1009 build_x_unary_op): Add location_t parameter.
1010 (rationalize_conditional_expr, build_x_array_ref,
1011 build_x_compound_expr, cp_build_modify_expr, build_x_modify_expr):
1012 Adjust.
1013 * typeck2.c (build_x_arrow): Add location_t parameter.
1014 * semantics.c (finish_unary_op_expr): Likewise.
1015 (finish_increment_expr, handle_omp_for_class_iterator): Adjust.
1016 * decl2.c (grok_array_decl): Add location_t parameter.
1017 * parser.c (cp_parser_postfix_open_square_expression,
1018 cp_parser_postfix_dot_deref_expression, cp_parser_unary_expression,
1019 cp_parser_binary_expression, cp_parser_builtin_offsetof,
1020 do_range_for_auto_deduction, cp_convert_range_for,
1021 cp_parser_template_argument, cp_parser_omp_for_cond): Pass the
1022 location, adjust.
1023 * pt.c (tsubst_copy_and_build): Adjust.
1024 * tree.c (maybe_dummy_object): Likewise.
1025 * cp-tree.h: Update declarations.
1026
1027 2012-05-04 Paolo Carlini <paolo.carlini@oracle.com>
1028
1029 * semantics.c (cxx_eval_constant_expression, case CONVERT_EXPR): Tidy.
1030
1031 2012-05-04 Paolo Carlini <paolo.carlini@oracle.com>
1032
1033 PR c++/53166
1034 * pt.c (instantiate_class_template_1): Increase / decrease
1035 c_inhibit_evaluation_warnings around the tsubst_expr call
1036 for STATIC_ASSERT_CONDITION.
1037 (tsubst_expr, case STATIC_ASSERT): Likewise.
1038 * typeck.c (cp_build_binary_op, case EQ_EXPR/NE_EXPR): Check
1039 c_inhibit_evaluation_warnings in the OPT_Waddress warnings.
1040
1041 2012-05-03 Paolo Carlini <paolo.carlini@oracle.com>
1042
1043 PR c++/53186
1044 * call.c (build_over_call): Handle final member functions
1045 and class types.
1046 (build_new_method_call_1): Do not handle here.
1047
1048 2012-05-02 Richard Guenther <rguenther@suse.de>
1049
1050 * decl.c (grokdeclarator): Properly check for sizes that
1051 cover more than half of the address-space.
1052
1053 2012-04-30 Marc Glisse <marc.glisse@inria.fr>
1054
1055 PR c++/51033
1056 * typeck.c (cp_build_array_ref): Handle VECTOR_TYPE.
1057 * decl2.c (grok_array_decl): Likewise.
1058
1059 PR c++/51314
1060 * parser.c (cp_parser_sizeof_operand): Require parentheses for
1061 sizeof...
1062
1063 2012-04-30 Dodji Seketeli <dodji@redhat.com>
1064
1065 Fix location for static class members
1066 * decl.c (grokdeclarator): Use the location carried by the
1067 declarator for the DECL of the static class member.
1068
1069 Fix va_arg type location
1070 * cp-tree.h (build_x_va_arg): Take an additional location
1071 parameter.
1072 * call.c (build_x_va_arg): Take a loc parameter for the location
1073 of the type of the va_arg expression.
1074 * parser.c (cp_parser_primary_expression): Pass the type of the
1075 type in the va_arg expression to build_x_va_arg.
1076 * pt.c (tsubst_copy): Adjust calls to build_x_va_arg.
1077
1078 Make conversion warnings work on NULL with -ftrack-macro-expansion
1079 * call.c (conversion_null_warnings): Use the new
1080 expansion_point_location_if_in_system_header.
1081 * cvt.c (build_expr_type_conversion): Likewise.
1082 * typeck.c (cp_build_binary_op): Likewise.
1083
1084 2012-04-30 Manuel López-Ibåñez <manu@gcc.gnu.org>
1085
1086 * typeck.c (convert_for_assignment): Replace
1087 Wmissing-format-attribute with Wsuggest-attribute=format.
1088 * call.c (convert_for_arg_passing): Likewise.
1089
1090 2012-04-26 Paolo Carlini <paolo.carlini@oracle.com>
1091
1092 PR c++/53096
1093 * class.c (check_bases_and_members): Implement core/1333, do not
1094 disallow defaulted in the class body non-const ref special members.
1095
1096 2012-04-24 Paolo Carlini <paolo.carlini@oracle.com>
1097
1098 PR c++/52363
1099 * call.c (tourney, perform_overload_resolution,
1100 build_operator_new_call, build_user_type_conversion_1,
1101 build_user_type_conversion, perform_overload_resolution,
1102 add_template_candidate, add_template_candidate_real,
1103 add_template_conv_candidate, add_builtin_candidates,
1104 add_builtin_candidate, build_builtin_candidate,
1105 add_conv_candidate, add_function_candidate, implicit_conversion,
1106 reference_binding, build_list_conv, conditional_conversion,
1107 add_candidates, can_convert_array, build_aggr_conv,
1108 build_array_conv, build_complex_conv, conditional_conversion):
1109 Add tsubst_flags_t parameter.
1110 (joust): Likewise, use it to handle SFINAE as if pedantic.
1111 (add_list_candidates, build_integral_nontype_arg_conv,
1112 perform_overload_resolution, build_new_function_call,
1113 build_operator_new_call, build_op_call_1,
1114 build_conditional_expr_1, build_new_op_1, convert_like_real,
1115 convert_arg_to_ellipsis, convert_default_arg,
1116 convert_for_arg_passing, build_over_call,
1117 build_new_method_call_1, can_convert_arg, can_convert_arg_bad,
1118 perform_implicit_conversion_flags,
1119 perform_direct_initialization_if_possible,
1120 initialize_reference): Adjust.
1121 * typeck.c (casts_away_constness, casts_away_constness_r):
1122 Add tsubst_flags_t parameter.
1123 (convert_arguments, check_for_casting_away_constness,
1124 build_static_cast_1, build_ptrmemfunc, convert_for_assignment):
1125 Adjust.
1126 * decl.c (reshape_init_r, check_default_argument): Likewise.
1127 * cp-gimplify.c (cxx_omp_clause_apply_fn): Likewise.
1128 * pt.c (convert_nontype_argument, check_non_deducible_conversion):
1129 Likewise.
1130 * init.c (build_new_1): Likewise.
1131 * cvt.c (convert_to_reference, ocp_convert, build_type_conversion,
1132 build_expr_type_conversion, ): Likewise.
1133 * search.c (check_final_overrider): Likewise.
1134 * cp-tree.h (build_user_type_conversion,
1135 build_operator_new_call, can_convert, can_convert_arg,
1136 can_convert_arg_bad, convert_default_arg,
1137 convert_arg_to_ellipsis, convert_for_arg_passing):
1138 Adjust declaration.
1139
1140 2012-04-22 Jan Hubicka <jh@suse.cz>
1141
1142 * decl2.c (maybe_make_one_only): Mark keyed COMDATs as USED so they
1143 gets finalized.
1144
1145 2012-04-22 Manuel López-Ibåñez <manu@gcc.gnu.org>
1146
1147 PR c/44774
1148 * typeck.c (composite_pointer_type): Likewise.
1149 (cxx_sizeof_or_alignof_type): Likewise.
1150 (cp_build_array_ref): Likewise.
1151 (cp_build_function_call_vec): Likewise.
1152 (cp_build_addr_expr_1): Likewise.
1153 (convert_member_func_to_ptr): Likewise.
1154 * decl.c (check_tag_decl): Likewise.
1155 (check_static_variable_definition): Likewise.
1156 (compute_array_index_type): Likewise.
1157 (create_array_type_for_decl): Likewise.
1158 (grokdeclarator): Likewise.
1159 (grok_op_properties): Likewise.
1160 * error.c (maybe_warn_cpp0x): Likewise.
1161 * pt.c (maybe_process_partial_specialization): Likewise.
1162 (convert_template_argument): Likewise.
1163 (do_decl_instantiation): Likewise.
1164 (do_type_instantiation): Likewise.
1165 * parser.c (cp_parser_primary_expression): Likewise.
1166 (cp_parser_postfix_expression): Likewise.
1167 (cp_parser_unary_expression): Likewise.
1168 (cp_parser_question_colon_clause): Likewise.
1169 (cp_parser_lambda_introducer): Likewise.
1170 (cp_parser_lambda_declarator_opt): Likewise.
1171 (cp_parser_compound_statement): Likewise.
1172 (cp_parser_jump_statement): Likewise.
1173 (cp_parser_declaration_seq_opt): Likewise.
1174 (cp_parser_enum_specifier): Likewise.
1175 (cp_parser_enumerator_list): Likewise.
1176 (cp_parser_initializer_list): Likewise.
1177 (cp_parser_member_declaration): Likewise.
1178 * call.c (build_conditional_expr_1): Likewise.
1179 * friend.c (make_friend_class): Likewise.
1180 * name-lookup.c (pushdecl_maybe_friend_1): Likewise.
1181
1182 2012-04-21 Jan Hubicka <jh@suse.cz>
1183
1184 * method.c (make_alias_for): Do not set TREE_SYMBOL_REFERENCED.
1185 * decl2.c (mark_needed): Likewise.
1186 (decl_needed_p): Do not test TREE_SYMBOL_REFERENCED.
1187
1188 * decl2.c (cxx_callgraph_analyze_expr): Remove.
1189 * cp-objcp-common.h (LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR): Remove.
1190 * cp-tree.h (cxx_callgraph_analyze_expr): Remove.
1191
1192 2012-04-21 Manuel López-Ibåñez <manu@gcc.gnu.org>
1193
1194 PR 35441
1195 * typeck.c (cp_build_function_call_vec): Do not pretty-print
1196 expressions when caret is enabled.
1197
1198 2012-04-20 Jan Hubicka <jh@suse.cz>
1199
1200 PR target/53042
1201 * decl2.c (maybe_emit_vtables): Do not initialize same_comdat_group
1202 list when target has no support for it.
1203
1204 2012-04-20 Michael Matz <matz@suse.de>
1205
1206 * error.c (pedwarn_cxx98): Move va_end call after user
1207 of the va_list.
1208
1209 2012-04-18 Paolo Carlini <paolo.carlini@oracle.com>
1210
1211 PR c++/52422
1212 * cp-tree.h (build_addr_func, decay_conversion,
1213 get_member_function_from_ptrfunc,
1214 build_m_component_ref, convert_member_func_to_ptr):
1215 Add tsubst_flags_t parameter.
1216 * typeck.c (cp_default_conversion): Add.
1217 (decay_conversion, default_conversion,
1218 get_member_function_from_ptrfunc, convert_member_func_to_ptr):
1219 Add tsubst_flags_t parameter and use it throughout.
1220 (cp_build_indirect_ref, cp_build_array_ref,
1221 cp_build_function_call_vec, convert_arguments, build_x_binary_op,
1222 cp_build_binary_op, cp_build_unary_op, build_reinterpret_cast_1,
1223 build_const_cast_1, expand_ptrmemfunc_cst,
1224 convert_for_initialization): Adjust.
1225 * init.c (build_vec_init): Adjust.
1226 * decl.c (grok_reference_init, get_atexit_node): Likewise.
1227 * rtti.c (build_dynamic_cast_1, tinfo_base_init): Likewise.
1228 * except.c (build_throw): Likewise.
1229 * typeck2.c (build_x_arrow): Likewise.
1230 (build_m_component_ref): Add tsubst_flags_t parameter and
1231 use it throughout.
1232 * pt.c (convert_nontype_argument): Adjust.
1233 * semantics.c (finish_asm_stmt, maybe_add_lambda_conv_op): Likewise.
1234 * decl2.c (build_offset_ref_call_from_tree): Likewise.
1235 * call.c (build_addr_func): Add tsubst_flags_t parameter and
1236 use it throughout.
1237 (build_call_a, build_conditional_expr_1, build_new_op_1,
1238 convert_like_real, convert_arg_to_ellipsis, build_over_call,
1239 build_special_member_call): Adjust.
1240 * cvt.c (cp_convert_to_pointer, force_rvalue,
1241 build_expr_type_conversion): Likewise.
1242
1243 2012-04-17 Tom de Vries <tom@codesourcery.com>
1244
1245 * cp-gimplify.c (begin_bc_block): Add location parameter and use as
1246 location argument to create_artificial_label.
1247 (finish_bc_block): Change return type to void. Remove body_seq
1248 parameter, and add block parameter. Append label to STMT_LIST and
1249 return in block.
1250 (gimplify_cp_loop, gimplify_for_stmt, gimplify_while_stmt)
1251 (gimplify_do_stmt, gimplify_switch_stmt): Remove function.
1252 (genericize_cp_loop, genericize_for_stmt, genericize_while_stmt)
1253 (genericize_do_stmt, genericize_switch_stmt, genericize_continue_stmt)
1254 (genericize_break_stmt, genericize_omp_for_stmt): New function.
1255 (cp_gimplify_omp_for): Remove bc_continue processing.
1256 (cp_gimplify_expr): Genericize VEC_INIT_EXPR.
1257 (cp_gimplify_expr): Mark FOR_STMT, WHILE_STMT, DO_STMT, SWITCH_STMT,
1258 CONTINUE_STMT, and BREAK_STMT as unreachable.
1259 (cp_genericize_r): Genericize FOR_STMT, WHILE_STMT, DO_STMT,
1260 SWITCH_STMT, CONTINUE_STMT, BREAK_STMT and OMP_FOR.
1261 (cp_genericize_tree): New function, factored out of ...
1262 (cp_genericize): ... this function.
1263
1264 2012-04-17 Paolo Carlini <paolo.carlini@oracle.com>
1265
1266 PR c++/52599
1267 * semantics.c (build_constexpr_constructor_member_initializers):
1268 Check for function-try-block as function-body.
1269
1270 2012-04-17 Paolo Carlini <paolo.carlini@oracle.com>
1271
1272 PR c++/53003
1273 * parser.c (cp_parser_member_declaration): Check that
1274 initializer_token_start is non null before dereferencing it.
1275
1276 2012-04-16 Jason Merrill <jason@redhat.com>
1277
1278 PR c++/38543
1279 * pt.c (determine_specialization): Instead of comparing the number
1280 of parms, check that tsubst gives the right answer.
1281
1282 PR c++/52008
1283 * pt.c (process_partial_specialization): Complain about a partial
1284 specialization with fewer args than primary template parms.
1285
1286 PR c++/50830
1287 * pt.c (convert_template_argument): Handle template template
1288 argument packs.
1289
1290 PR c++/50303
1291 * pt.c (tsubst_pack_expansion): Use tsubst_expr for template
1292 template parameters.
1293
1294 2012-04-16 Paolo Carlini <paolo.carlini@oracle.com>
1295
1296 PR c++/49152
1297 * call.c (op_error): Print types; when flag_diagnostics_show_caret
1298 is false print expressions too.
1299 (op_error_string): Add.
1300
1301 2012-04-16 Jason Merrill <jason@redhat.com>
1302
1303 PR c++/51148
1304 * friend.c (make_friend_class): Call check_for_bare_parameter_packs.
1305
1306 2012-04-16 Jan Hubicka <jh@suse.cz>
1307
1308 * decl2.c (collect_candidates_for_java_method_alias): Use FOR_EACH
1309 walkers to walk cgraph and varpool.
1310
1311 2012-04-15 Jason Merrill <jason@redhat.com>
1312
1313 PR c++/47220
1314 * pt.c (coerce_template_parameter_pack): Check for error_mark_node.
1315
1316 PR c++/52292
1317 PR c++/52380
1318 * pt.c (coerce_template_parms): Even if we aren't converting we
1319 want to expand argument packs.
1320
1321 PR c++/52706
1322 * mangle.c (write_type): nullptr_t is a builtin type.
1323
1324 2012-04-14 Jan Hubicka <jh@suse.cz>
1325
1326 * tree.c: Update field referenced for new cgraph/varpool layout.
1327 * decl2.c: Likewise.
1328
1329 2012-04-13 Jason Merrill <jason@redhat.com>
1330
1331 PR c++/52824
1332 * pt.c (any_pack_expanson_args_p): New.
1333 (coerce_template_parms): Use it.
1334
1335 PR c++/52905
1336 * call.c (joust): Handle comparing list and non-list ctors.
1337
1338 PR c++/52915
1339 * decl2.c (finish_anon_union): Use cp_finish_decl.
1340 * error.c (dump_function_name): Avoid showing anonymous "name".
1341
1342 2012-04-11 Fabien ChĂȘne <fabien@gcc.gnu.org>
1343
1344 PR c++/52465
1345 * parser.c (cp_parser_class_name): Call strip_using_decl and
1346 return the target decl.
1347 * name-lookup.c (strip_using_decl): Returns NULL_TREE if the decl
1348 to be stripped is NULL_TREE.
1349 (qualify_lookup): Call strip_using_decl and perform some checks on
1350 the target decl.
1351
1352 2012-04-11 Jason Merrill <jason@redhat.com>
1353
1354 PR debug/45088
1355 * decl.c (grokdeclarator): Strip the injected-class-name typedef
1356 if we are building a declaration or compound type.
1357
1358 PR c++/52906
1359 * decl.c (check_tag_decl): Don't complain about attributes if we
1360 don't even have a type.
1361
1362 2012-04-10 Manuel López-Ibåñez <manu@gcc.gnu.org>
1363
1364 * cvt.c (convert_to_void): Update comment.
1365
1366 2012-04-05 Jason Merrill <jason@redhat.com>
1367
1368 PR c++/52596
1369 * semantics.c (finish_non_static_data_member): In templates, pass
1370 the decl to build_qualified_name.
1371 * tree.c (lvalue_kind) [SCOPE_REF]: Handle FIELD_DECL.
1372
1373 2012-04-04 Jason Merrill <jason@redhat.com>
1374
1375 PR c++/52845
1376 * decl.c (finish_function): Update fntype after deducing return type.
1377
1378 2012-04-03 Jason Merrill <jason@redhat.com>
1379
1380 PR c++/52796
1381 * pt.c (tsubst_initializer_list): A pack expansion with no elements
1382 means value-initialization.
1383
1384 2012-04-01 Paolo Carlini <paolo.carlini@oracle.com>
1385
1386 PR c++/50043
1387 * class.c (deduce_noexcept_on_destructor,
1388 deduce_noexcept_on_destructors): New.
1389 (check_bases_and_members): Call the latter.
1390 * decl.c (grokfndecl): Call the former.
1391 * method.c (implicitly_declare_fn): Not static.
1392 * cp-tree.h (deduce_noexcept_on_destructor, implicitly_declare_fn):
1393 Declare
1394
1395 2012-03-29 Paolo Carlini <paolo.carlini@oracle.com>
1396
1397 PR c++/52718
1398 * decl.c (check_default_argument): With -Wzero-as-null-pointer-constant
1399 warn for a zero as null pointer constant default argument.
1400
1401 2012-03-29 Jason Merrill <jason@redhat.com>
1402
1403 PR c++/52685
1404 * tree.c (copy_binfo): Handle BINFO_DEPENDENT_BASE_P.
1405
1406 2012-03-29 Jakub Jelinek <jakub@redhat.com>
1407
1408 PR c++/52759
1409 * decl.c (start_decl): Don't call maybe_apply_pragma_weak
1410 if processing_template_decl.
1411
1412 2012-03-29 Jason Merrill <jason@redhat.com>
1413
1414 PR c++/52743
1415 * call.c (compare_ics): Handle ck_aggr like ck_list.
1416
1417 2012-03-28 Jason Merrill <jason@redhat.com>
1418
1419 PR c++/52746
1420 * typeck.c (lookup_destructor): Clear BASELINK_QUALIFIED_P if
1421 we didn't get an explicit scope.
1422 * pt.c (tsubst_baselink): Likewise.
1423
1424 2012-03-28 Richard Guenther <rguenther@suse.de>
1425
1426 * typeck2.c (process_init_constructor_array): Use the proper
1427 type for computing the array length.
1428
1429 2012-03-27 Meador Inge <meadori@codesourcery.com>
1430
1431 PR c++/52672
1432 * semantics.c (cxx_fold_indirect_ref): Don't attempt to fold
1433 stripped child trees that are not pointer types.
1434
1435 2012-03-21 Jason Merrill <jason@redhat.com>
1436
1437 Implement return type deduction for normal functions with -std=c++1y.
1438 * cp-tree.h (FNDECL_USED_AUTO): New macro.
1439 (LAMBDA_EXPR_DEDUCE_RETURN_TYPE_P): Remove.
1440 (dependent_lambda_return_type_node): Remove.
1441 (CPTI_DEPENDENT_LAMBDA_RETURN_TYPE): Remove.
1442 (struct language_function): Add x_auto_return_pattern field.
1443 (current_function_auto_return_pattern): New.
1444 (enum tsubst_flags): Add tf_partial.
1445 * decl.c (decls_match): Handle auto return comparison.
1446 (duplicate_decls): Adjust error message for auto return.
1447 (cxx_init_decl_processing): Remove dependent_lambda_return_type_node.
1448 (cp_finish_decl): Don't do auto deduction for functions.
1449 (grokdeclarator): Allow auto return without trailing return type in
1450 C++1y mode.
1451 (check_function_type): Defer checking of deduced return type.
1452 (start_preparsed_function): Set current_function_auto_return_pattern.
1453 (finish_function): Set deduced return type to void if not previously
1454 deduced.
1455 * decl2.c (change_return_type): Handle error_mark_node.
1456 (mark_used): Always instantiate functions with deduced return type.
1457 Complain about use if deduction isn't done.
1458 * parser.c (cp_parser_lambda_declarator_opt): Use 'auto' for
1459 initial return type.
1460 (cp_parser_lambda_body): Don't deduce return type in a template.
1461 (cp_parser_conversion_type_id): Allow auto in C++1y.
1462 * pt.c (instantiate_class_template_1): Don't mess with
1463 LAMBDA_EXPR_DEDUCE_RETURN_TYPE_P.
1464 (tsubst_copy_and_build): Likewise.
1465 (fn_type_unification, tsubst): Don't reduce the template parm level
1466 of 'auto' during deduction.
1467 (unify): Compare 'auto' specially.
1468 (get_bindings): Change test.
1469 (always_instantiate_p): Always instantiate functions with deduced
1470 return type.
1471 (do_auto_deduction): Handle error_mark_node and lambda context.
1472 Don't check for use in initializer.
1473 (contains_auto_r): Remove.
1474 * search.c (lookup_conversions_r): Handle auto conversion function.
1475 * semantics.c (lambda_return_type): Handle null return. Don't mess
1476 with dependent_lambda_return_type_node.
1477 (apply_deduced_return_type): Rename from apply_lambda_return_type.
1478 * typeck.c (merge_types): Handle auto.
1479 (check_return_expr): Do auto deduction.
1480 * typeck2.c (add_exception_specifier): Fix complain check.
1481
1482 2012-03-22 Paolo Carlini <paolo.carlini@oracle.com>
1483
1484 PR c++/52487
1485 * class.c (check_field_decls): Call literal_type_p only
1486 on complete types.
1487
1488 2012-03-22 Jakub Jelinek <jakub@redhat.com>
1489
1490 PR c++/52671
1491 * decl.c (check_tag_decl): Only use CLASSTYPE_TEMPLATE_INSTANTIATION
1492 on CLASS_TYPE_P types.
1493
1494 2012-03-20 Jason Merrill <jason@redhat.com>
1495
1496 * lex.c (init_reswords): Use >= for cxx_dialect test.
1497 * parser.c (cp_parser_exception_specification_opt): Likewise.
1498
1499 * mangle.c (write_type): Handle 'auto'.
1500 * init.c (build_new): Don't do auto deduction where it might
1501 affect template mangling.
1502
1503 PR c++/52510
1504 * decl.c (reshape_init_class): Handle repeated reshaping.
1505 * search.c (lookup_field_1): Add sanity check.
1506
1507 2012-03-19 Paolo Carlini <paolo.carlini@oracle.com>
1508
1509 PR c++/14710
1510 * cp-tree.h (xvalue_p, maybe_warn_about_useless_cast): Declare.
1511 * tree.c (xvalue_p): Define.
1512 * typeck.c (maybe_warn_about_useless_cast): Define.
1513 (build_reinterpret_cast, build_const_cast,
1514 build_static_cast, cp_build_c_cast): Use maybe_warn_about_useless_cast.
1515 * rtti.c (build_dynamic_cast): Likewise.
1516 * pt.c (tsubst_copy_and_build, case CAST_EXPR): Increment/decrement
1517 c_inhibit_evaluation_warnings before/after the build_* calls.
1518
1519 2012-03-15 Jason Merrill <jason@redhat.com>
1520
1521 PR c++/52582
1522 * method.c (implicitly_declare_fn): Set DECL_EXTERNAL.
1523
1524 2012-03-15 Manuel López-Ibåñez <manu@gcc.gnu.org>
1525
1526 PR c++/44783
1527 * error.c (print_instantiation_partial_context): Use
1528 template_backtrace_limit.
1529
1530 2012-03-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1531
1532 * Make-lang.in (doc/g++.1): Remove IRIX 6.5 reference.
1533
1534 2012-03-14 Jakub Jelinek <jakub@redhat.com>
1535
1536 PR c++/52521
1537 * parser.c (lookup_literal_operator): Return fn only if
1538 processed all arguments from args vector and argtypes is
1539 void_list_node.
1540
1541 2012-01-30 Dodji Seketeli <dodji@redhat.com>
1542
1543 PR c++/51641
1544 * cp-tree.h (template_type_parameter_p): Declare new function.
1545 (parameter_of_template_p): Remove.
1546 * pt.c (template_type_parameter_p): Define new function.
1547 (parameter_of_template_p): Remove.
1548 * name-lookup.c (binding_to_template_parms_of_scope_p): Don't rely
1549 on parameter_of_template_p anymore. Compare the level of the
1550 template parameter to the depth of the template.
1551
1552 2011-12-15 Dodji Seketeli <dodji@redhat.com>
1553
1554 * call.c (standard_conversion, build_integral_nontype_arg_conv)
1555 (build_new_op_1, convert_like_real, is_subseq)
1556 (maybe_handle_implicit_object, maybe_handle_ref_bind, compare_ics)
1557 (joust): Use next_conversion instead of accessing fields of struct
1558 conversion directly.
1559
1560 2012-03-12 Paolo Carlini <paolo.carlini@oracle.com>
1561
1562 PR c++/52299
1563 * pt.c (tsubst_copy_and_build, case COND_EXPR): Avoid bogus
1564 division by zero warnings.
1565
1566 2012-03-08 Paolo Carlini <paolo.carlini@oracle.com>
1567
1568 * typeck.c (build_array_ref, cp_build_addr_expr_1, convert_ptrmem,
1569 build_ptrmemfunc): Consistently forward the tsubst_flags_t
1570 parameter.
1571 * call.c (resolve_args): Likewise.
1572
1573 2012-03-07 Jason Merrill <jason@redhat.com>
1574
1575 PR c++/52521
1576 * mangle.c (write_literal_operator_name): The length comes after the
1577 operator prefix.
1578
1579 2012-03-05 Jakub Jelinek <jakub@redhat.com>
1580
1581 * pt.c (local_specializations): Change from htab_t into
1582 struct pointer_map_t *.
1583 (retrieve_local_specializations, register_local_specialization,
1584 tsubst_pack_expansion, instantiate_decl): Adjust users.
1585 (eq_local_specializations, hash_local_specialization): Remove.
1586
1587 2012-03-05 Jason Merrill <jason@redhat.com>
1588
1589 PR c++/51930
1590 * decl2.c (determine_visibility): Correct calculation of class
1591 args depth.
1592 * decl.c (check_tag_decl): Adjust warning.
1593
1594 * method.c (synthesized_method_walk): Cleanups don't affect the EH
1595 spec either.
1596
1597 2012-03-03 Jason Merrill <jason@redhat.com>
1598
1599 * init.c (perform_member_init): Cope with uninstantiated NSDMI.
1600
1601 Core 1270
1602 * call.c (build_aggr_conv): Call reshape_init.
1603 (convert_like_real): Likewise.
1604 * typeck2.c (process_init_constructor): Clear TREE_CONSTANT if
1605 not all constant.
1606
1607 * mangle.c (write_nested_name): Use decl_mangling_context.
1608 (write_prefix, write_template_prefix): Likewise.
1609
1610 PR c++/36797
1611 * mangle.c (write_expression): Improve diagnostic for TRAIT_EXPR.
1612
1613 * class.c (add_method): Always build an OVERLOAD for using-decls.
1614 * search.c (lookup_member): Handle getting an OVERLOAD for a
1615 single function.
1616
1617 2012-03-02 Paolo Carlini <paolo.carlini@oracle.com>
1618
1619 PR c++/51989
1620 * typeck2.c (build_x_arrow): Take a tsubst_flags_t argument and
1621 propagate it.
1622 * cp-tree.h (build_x_arrow): Adjust prototype.
1623 * pt.c (tsubst_copy_and_build): Adjust call.
1624 * parser.c (cp_parser_postfix_dot_deref_expression): Likewise.
1625
1626 2012-03-02 Paolo Carlini <paolo.carlini@oracle.com>
1627
1628 * name-lookup.c (binding_to_template_parms_of_scope_p): Clean up.
1629
1630 2012-02-29 Jason Merrill <jason@redhat.com>
1631
1632 PR c++/51930
1633 * decl.c (check_tag_decl): Move warning for misplaced attributes here.
1634 (shadow_tag): From here.
1635 * parser.c (cp_parser_explicit_instantiation): Don't warn here.
1636
1637 2012-02-21 Jakub Jelinek <jakub@redhat.com>
1638
1639 PR c++/52312
1640 * typeck.c (check_literal_operator_args): Initialize *long_double_p
1641 and *long_long_unsigned_p even if processing_template_decl.
1642
1643 2012-02-16 Jason Merrill <jason@redhat.com>
1644
1645 PR c++/52248
1646 * decl.c (define_label): Use timevar_cond_start/stop.
1647
1648 2012-02-16 Fabien ChĂȘne <fabien@gcc.gnu.org>
1649
1650 PR c++/52126
1651 * decl.c (xref_basetypes): call dependent_scope_p instead of
1652 dependent_type_p.
1653
1654 2012-02-16 Jason Merrill <jason@redhat.com>
1655
1656 PR c++/51415
1657 * error.c (dump_expr): Handle lambda closures specifically.
1658
1659 2012-02-14 Jason Merrill <jason@redhat.com>
1660
1661 * parser.c (cp_parser_explicit_instantiation): Give a warning
1662 for ignored attributes on explicit class instantiation.
1663
1664 2012-02-14 Jakub Jelinek <jakub@redhat.com>
1665
1666 PR c++/52247
1667 * pt.c (tsubst_copy_asm_operands): For LABEL_DECL values call
1668 lookup_label on label's name and set TREE_USED.
1669
1670 2012-02-14 Jason Merrill <jason@redhat.com>
1671
1672 PR c++/39055
1673 * decl.c (local_variable_p_walkfn): Don't check DECL_ARTIFICIAL.
1674
1675 2012-02-14 Jakub Jelinek <jakub@redhat.com>
1676
1677 PR c/52181
1678 * decl.c (duplicate_decls): If olddecl has bigger DECL_ALIGN than
1679 newdecl, copy DECL_ALIGN to newdecl and or DECL_USER_ALIGN bits.
1680
1681 2012-02-07 Jason Merrill <jason@redhat.com>
1682
1683 PR c++/51675
1684 * semantics.c (cx_check_missing_mem_inits): Handle unions.
1685 Fix constexpr default constructor logic.
1686
1687 PR c++/52035
1688 * pt.c (tsubst): Strip uninstantiated typedef.
1689
1690 2012-02-06 Jason Merrill <jason@redhat.com>
1691
1692 PR c++/52088
1693 * cvt.c (build_expr_type_conversion): Check for template conversion.
1694
1695 2012-01-31 Jason Merrill <jason@redhat.com>
1696
1697 PR c++/52043
1698 * cp-tree.h (PACK_EXPANSION_LOCAL_P): New.
1699 * pt.c (make_pack_expansion, tsubst_initializer_list): Set it.
1700 (tsubst_pack_expansion): Check it.
1701
1702 2012-01-29 Paolo Carlini <paolo.carlini@oracle.com>
1703
1704 PR c++/51327
1705 * class.c (explain_non_literal_class): Correctly handle implicitly
1706 deleted constructors.
1707
1708 2012-01-27 Jakub Jelinek <jakub@redhat.com>
1709
1710 PR c++/51852
1711 * pt.c (tsubst_pack_expansion): Delete and restore
1712 local_specialization whenever need_local_specialization, not just
1713 when saved_local_specializations is non-NULL.
1714
1715 2012-01-26 Paolo Carlini <paolo.carlini@oracle.com>
1716
1717 PR c++/51370
1718 * error.c (dump_decl, [TEMPLATE_ID_EXPR]): Handle error_mark_node
1719 as TREE_OPERAND (t, 1).
1720
1721 2012-01-24 Jason Merrill <jason@redhat.com>
1722
1723 PR c++/51917
1724 * decl.c (xref_basetypes): Check VEC_length instead of VEC_space.
1725
1726 PR c++/51973
1727 * tree.c (called_fns_equal): Check template args.
1728 (cp_tree_equal): Call it.
1729
1730 2012-01-24 Aldy Hernandez <aldyh@redhat.com>
1731 Patrick Marlier <patrick.marlier@gmail.com>
1732
1733 PR c++/51928
1734 * class.c (set_method_tm_attributes): Use TARGET_THUNK instead of
1735 thunk for set_one_vmethod_tm_attributes.
1736
1737 2012-01-24 Paolo Carlini <paolo.carlini@oracle.com>
1738
1739 PR c++/51223
1740 * call.c (build_over_call): Check for error_mark_node as
1741 TREE_VALUE when default arguments are processed.
1742
1743 2012-01-23 Jason Merrill <jason@redhat.com>
1744
1745 PR c++/51930
1746 * decl2.c (determine_visibility): Check for visibility attribute
1747 on template specialization.
1748
1749 2012-01-23 Paolo Carlini <paolo.carlini@oracle.com>
1750
1751 PR c++/51398
1752 * pt.c (parameter_of_template_p): Skip error_mark_node parameters.
1753
1754 2012-01-23 Jason Merrill <jason@redhat.com>
1755
1756 PR c++/51925
1757 * class.c (add_method): Set OVL_USED for using-decls.
1758 * tree.c (ovl_scope): New.
1759 * cp-tree.h: Declare it.
1760 * parser.c (cp_parser_template_name): Use it.
1761 * semantics.c (baselink_for_fns): Likewise.
1762 * name-lookup.c (set_inherited_value_binding_p): Likewise.
1763
1764 2012-01-20 Paolo Carlini <paolo.carlini@oracle.com>
1765
1766 PR c++/51402
1767 * pt.c (lookup_template_class_1): Check context returned by
1768 tsubst for error_mark_node.
1769
1770 2012-01-19 Kai Tietz <ktietz@redhat.com>
1771
1772 PR c++/51344
1773 * decl2.c (save_template_attributes): Use merge_attributes
1774 instead of chaining up via TREE_CHAIN.
1775
1776 2012-01-19 Jason Merrill <jason@redhat.com>
1777
1778 PR c++/51889
1779 * class.c (finish_struct): Call add_method here for function usings.
1780 * semantics.c (finish_member_declaration): Not here.
1781
1782 2012-01-18 Paolo Carlini <paolo.carlini@oracle.com>
1783
1784 PR c++/51225
1785 * typeck2.c (store_init_value): Within a template guard
1786 cxx_constant_value with require_potential_constant_expression.
1787 * pt.c (convert_nontype_argument): Likewise.
1788
1789 2012-01-16 Jakub Jelinek <jakub@redhat.com>
1790
1791 PR c++/51854
1792 * mangle.c (write_template_arg_literal): Handle complex.
1793
1794 2012-01-16 Jason Merrill <jason@redhat.com>
1795
1796 PR c++/51827
1797 * mangle.c (mangle_decl): Don't mangle uninstantiated templates.
1798
1799 PR c++/51868
1800 * typeck.c (build_static_cast_1): Handle bit-fields properly.
1801
1802 2012-01-13 Ian Lance Taylor <iant@google.com>
1803
1804 PR c++/50012
1805 * typeck.c (enum_cast_to_int): New static function.
1806 (cp_build_binary_op): When handling warn_sign_compare, don't test
1807 for TREE_NO_WARNING. Do call enum_cast_to_int.
1808 * call.c (avoid_sign_compare_warnings): Remove static function.
1809 (build_new_op_1): Don't call avoid_sign_compare_warnings.
1810
1811 2012-01-13 Steven Bosscher <steven@gcc.gnu.org>
1812
1813 * decl2.c: Do not include tree-mudflap.h
1814 * semantics.c: Likewise.
1815
1816 2012-01-13 Jason Merrill <jason@redhat.com>
1817
1818 PR c++/20681
1819 * semantics.c (finish_break_stmt): Avoid adding an unreachable
1820 BREAK_STMT.
1821
1822 PR c++/51813
1823 * decl2.c (constrain_visibility): Clear DECL_VISIBILITY_SPECIFIED
1824 when reducing the visibility.
1825
1826 PR c++/51620
1827 * class.c (build_vtbl_initializer): Use __cxa_deleted_virtual.
1828
1829 2012-01-12 Jason Merrill <jason@redhat.com>
1830
1831 PR c++/51714
1832 * pt.c (value_dependent_expression_p): Treat STMT_EXPR as
1833 value-dependent.
1834
1835 2012-01-13 Dodji Seketeli <dodji@redhat.com>
1836
1837 PR c++/51633
1838 * semantics.c (cp_parser_ctor_initializer_opt_and_function_body):
1839 Set the pointer to the last block of the constructor to the
1840 current statement.
1841 (build_constexpr_constructor_member_initializers): Get
1842 build_data_member_initialization a chance to deal with more
1843 statements before we choke.
1844
1845 2012-01-12 Jason Merrill <jason@redhat.com>
1846
1847 PR c++/48051
1848 * mangle.c (write_expression): Mangle BASELINK scope if
1849 BASELINK_QUALIFIED_P.
1850 * search.c (adjust_result_of_qualified_name_lookup): Set
1851 BASELINK_QUALIFIED_P.
1852 * tree.c (cp_tree_equal) [BASELINK]: Compare BASELINK_QUALIFIED_P.
1853 * parser.c (cp_parser_postfix_dot_deref_expression): Don't call
1854 adjust_result_of_qualified_name_lookup for non-qualified names.
1855
1856 PR c++/51403
1857 * pt.c (unify): Handle error_mark_node.
1858
1859 2012-01-11 Jason Merrill <jason@redhat.com>
1860
1861 PR c++/51565
1862 * call.c (standard_conversion): For ptrmemfuncs, compare the
1863 static_fn_types.
1864
1865 PR c++/51818
1866 * mangle.c (find_substitution): A type is only a substitution
1867 match if we're looking for a type.
1868 (write_nested_name): Use decl_mangling_context.
1869
1870 * decl.c (decls_match): Assert that the arguments are decls.
1871
1872 PR c++/51613
1873 * pt.c (resolve_overloaded_unification): Compare types with
1874 same_type_p, not decls_match.
1875
1876 2012-01-10 Jason Merrill <jason@redhat.com>
1877
1878 PR c++/51614
1879 * class.c (build_base_path): Diagnose ambiguous base.
1880
1881 PR c++/51433
1882 * semantics.c (cxx_eval_call_expression): Always retry previously
1883 non-constant expressions.
1884
1885 2012-01-06 Jason Merrill <jason@redhat.com>
1886
1887 DR 686
1888 PR c++/47450
1889 * parser.c (cp_parser_new_expression): Set
1890 type_definition_forbidden_message.
1891
1892 PR c++/6057
1893 PR c++/48051
1894 PR c++/50855
1895 PR c++/51322
1896 * mangle.c (write_expression): Support NEW_EXPR, DELETE_EXPR,
1897 THROW_EXPR, CONSTRUCTOR, OVERLOAD. Fix PREINCREMENT_EXPR and
1898 PREDECREMENT_EXPR.
1899 (write_template_arg): Fix mangling of class-scope functions and
1900 argument packs.
1901 (mangle_decl): Update suggested -fabi-version argument.
1902 * operators.def: Add DOTSTAR_EXPR, REINTERPRET_CAST_EXPR,
1903 DYNAMIC_CAST_EXPR; correct CONST_CAST_EXPR, STATIC_CAST_EXPR.
1904 * tree.c (dependent_name): No longer static.
1905 * cp-tree.h: Declare it.
1906 * pt.c (unify): Defer handling of unconverted functions.
1907
1908 * mangle.c (mangle_decl): Don't generate mangling aliases
1909 for maybe-in-charge [cd]tors.
1910
1911 * error.c (dump_expr): Print type of CONSTRUCTOR.
1912
1913 2012-01-05 Dodji Seketeli <dodji@redhat.com>
1914
1915 PR c++/51541
1916 * parser.c (cp_parser_alias_declaration): Get out early upon
1917 errors in the identifier or the attributes.
1918
1919 2012-01-04 Paolo Carlini <paolo.carlini@oracle.com>
1920
1921 PR c++/51064
1922 * pt.c (tsubst_copy_and_build): Maybe set TREE_NO_WARNING on
1923 the tree returned by build_x_binary_op.
1924
1925 2012-01-03 Paolo Carlini <paolo.carlini@oracle.com>
1926
1927 PR c++/51738
1928 * parser.c (cp_parser_postfix_open_square_expression): Handle
1929 postfix-expression [ braced-init-list ].
1930
1931 2012-01-03 Paolo Carlini <paolo.carlini@oracle.com>
1932
1933 PR c++/29273
1934 * rtti.c (build_dynamic_cast_1): In case of T a pointer type,
1935 call decay_conversion on v.
1936
1937 2012-01-03 Paolo Carlini <paolo.carlini@oracle.com>
1938
1939 PR c++/15867
1940 * decl.c (duplicate_decls): With -Wredundant-decls don't warn for
1941 declaration followed by specialization.
1942
1943 2012-01-03 Jakub Jelinek <jakub@redhat.com>
1944
1945 PR c++/51669
1946 * semantics.c (finish_omp_clauses): Call fold_build_cleanup_point_expr
1947 on OMP_CLAUSE_{IF,FINAL,NUM_THREADS,SCHEDULE_CHUNK}_EXPR.
1948
1949 2012-01-02 Jason Merrill <jason@redhat.com>
1950
1951 DR 1359
1952 PR c++/51675
1953 * method.c (walk_field_subobs): Don't check for uninitialized
1954 fields in a union.
1955 (synthesized_method_walk): Check here.
1956
1957 DR 325
1958 PR c++/51666
1959 * parser.c (cp_parser_cache_defarg): Split out...
1960 (cp_parser_parameter_declaration): ...from here.
1961 (cp_parser_save_nsdmi): Use it.
1962 (cp_parser_cache_group): Remove CPP_COMMA support.
1963
1964 2012-01-02 Dodji Seketeli <dodji@redhat.com>
1965
1966 PR c++/51462
1967 * semantics.c (cx_check_missing_mem_inits): Don't assert in case
1968 of error.
1969
1970 2012-01-02 Paolo Carlini <paolo.carlini@oracle.com>
1971
1972 PR c++/20140
1973 * typeck2.c (digest_init_r): Use copy_init when initializing
1974 an array of chars.
1975
1976 2012-01-01 Paolo Carlini <paolo.carlini@oracle.com>
1977
1978 PR c++/16603
1979 * decl.c (build_enumerator): Don't call perform_integral_promotions
1980 on the value.
1981
1982 2012-01-01 Paolo Carlini <paolo.carlini@oracle.com>
1983
1984 PR c++/51379
1985 * typeck.c (build_reinterpret_cast_1): Implement resolution of
1986 DR 799.
1987
1988 2012-01-01 Fabien ChĂȘne <fabien@gcc.gnu.org>
1989
1990 * parser.c (cp_parser_using_declaration): Add a warning about
1991 deprecated access declarations when no errors were encountered
1992 while parsing the access declaration. Save the first token in
1993 order to emit the warning at the right place.
1994 \f
1995 Copyright (C) 2012 Free Software Foundation, Inc.
1996
1997 Copying and distribution of this file, with or without modification,
1998 are permitted in any medium without royalty provided the copyright
1999 notice and this notice are preserved.