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