N3648: Allow braced and parenthesized initializers.
[gcc.git] / gcc / cp / ChangeLog
1 2013-04-24 Jason Merrill <jason@redhat.com>
2
3 N3648: Allow braced and parenthesized initializers.
4 * parser.c (cp_parser_lambda_introducer): Use cp_parser_initializer.
5 * pt.c (tsubst) [DECLTYPE_TYPE]: Handle DECLTYPE_FOR_INIT_CAPTURE.
6 * semantics.c (lambda_capture_field_type): Use do_auto_deduction.
7 (add_capture): Collapse a parenthesized initializer into a single
8 expression.
9 * cp-tree.h (DECLTYPE_FOR_INIT_CAPTURE): New.
10
11 2013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
12
13 PR c++/56970
14 * init.c (build_offset_ref): Add tsubst_flags_t parameter.
15 * semantics.c (finish_qualified_id_expr): Likewise.
16 (finish_id_expression): Update.
17 * typeck.c (cp_build_addr_expr_1): Likewise.
18 * pt.c (tsubst_qualified_id, resolve_nondeduced_context): Likewise.
19 * cp-tree.h: Update declarations.
20
21 2013-04-22 Jason Merrill <jason@redhat.com>
22
23 Core 1586
24 * parser.c (cp_parser_unqualified_id): Handle ~auto.
25 (cp_parser_pseudo_destructor_name): Likewise.
26 (cp_parser_postfix_dot_deref_expression): Adjust.
27 (cp_lexer_nth_token_is_keyword): New.
28 * semantics.c (finish_pseudo_destructor_expr): Handle ~auto.
29 * typeck.c (lookup_destructor): Handle ~auto.
30
31 * pt.c (fn_type_unification): Push tinst level around
32 type_unification_real if we aren't explaining.
33 * cp-tree.h (TFF_NO_TEMPLATE_BINDINGS): New.
34 * error.c (dump_function_decl): Respect it.
35 (subst_to_string): Pass it.
36
37 PR c++/48665
38 * rtti.c (get_typeid): Diagnose qualified function type.
39 * pt.c (tsubst) [POINTER_TYPE]: Likewise.
40
41 * error.c (dump_aggr_type): Fix lambda detection.
42 (dump_simple_decl): Pretty-print capture field.
43
44 N3323
45 * cvt.c (build_expr_type_conversion): Two conversions that return
46 the same type aren't necessarily ambiguous.
47
48 N3648
49 * parser.c (cp_parser_lambda_introducer): Make lambda capture init
50 pedwarn unconditional except in C++1y mode.
51
52 * semantics.c (potential_constant_expression_1): Don't crash on
53 'this' in NSDMI.
54
55 Core 1612
56 * semantics.c (finish_id_expression): Reject capture of anonymous
57 union member.
58
59 Core 1609
60 * decl2.c (check_default_args): Check for pack expansion.
61
62 * mangle.c (write_type): Mangle decltype(auto).
63
64 2013-04-19 Jason Merrill <jason@redhat.com>
65
66 N3638 changes to return type deduction
67 * decl.c (undeduced_auto_decl): New.
68 (require_deduced_type): New.
69 (fndecl_declared_return_type): New.
70 (decls_match): Use it.
71 (duplicate_decls): Don't check for auto return.
72 (grokdeclarator): Reject virtual auto.
73 * class.c (resolve_address_of_overloaded_function): Handle
74 auto function templates.
75 * decl2.c (mark_used): Use undeduced_auto_decl, require_deduced_type.
76 * cp-tree.h: Declare new fns.
77 * error.c (dump_function_decl): Use fndecl_declared_return_type.
78 * search.c (check_final_overrider): Likewise.
79 * pt.c (make_decltype_auto): New.
80 (do_auto_deduction): Require plain decltype(auto).
81 (is_auto): Adjust.
82
83 DR 941
84 * decl.c (duplicate_decls): Don't propagate DECL_DELETED_FN to
85 template specializations.
86
87 2013-04-16 Ed Smith-Rowland <3dw4rd@verizon.net>
88
89 Implement n3599 - Literal operator templates for strings.
90 * parser.c (make_string_pack (tree value)): New function.
91 (cp_parser_userdef_string_literal (cp_token *)): Use it
92 to construct calls to character string literal operator templates.
93 (cp_parser_template_declaration_after_export): Check for new string
94 literal operator template parameter form.
95
96 2013-04-15 Jason Merrill <jason@redhat.com>
97
98 * pt.c (tsubst) [DECLTYPE_TYPE]: Use tsubst_copy_and_build.
99
100 PR c++/52748
101 * pt.c (tsubst) [DECLTYPE_TYPE]: If ~id is an expression
102 rather than a destructor name, it isn't an unqualified-name.
103 (tsubst_copy_and_build): Pass down decltype_flag to operator
104 handling code, too.
105
106 PR c++/56388
107 * semantics.c (insert_capture_proxy): Just use index 1 in the
108 stmt_list_stack.
109
110 2013-04-12 Jakub Jelinek <jakub@redhat.com>
111
112 * error.c (cp_print_error_function,
113 print_instantiation_partial_context_line,
114 maybe_print_constexpr_context): Colorize locus strings.
115
116 2013-04-11 Jason Merrill <jason@redhat.com>
117
118 PR c++/52748
119 * parser.c (complain_flags): New.
120 (cp_parser_postfix_expression): Use it.
121 (cp_parser_unary_expression): Likewise.
122 (cp_parser_binary_expression): Likewise.
123 (cp_parser_assignment_expression): Likewise.
124 (cp_parser_expression): Likewise.
125 (cp_parser_postfix_open_square_expression): Take decltype_p.
126 (cp_parser_builtin_offsetof): Adjust.
127 (cp_convert_range_for): Pass complain to finish_unary_op_expr.
128 * decl2.c (grok_array_decl): Add decltype_p parm.
129 * cp-tree.h: Adjust prototype.
130 * semantics.c (finish_unary_op_expr): Add complain parm.
131
132 2013-04-11 Jakub Jelinek <jakub@redhat.com>
133
134 PR c++/56895
135 * call.c (null_ptr_cst_p): Call fold_non_dependent_expr_sfinae before
136 calling maybe_constant_value for C++98.
137
138 2013-04-11 Jason Merrill <jason@redhat.com>
139
140 PR c++/56901
141 * semantics.c (lambda_capture_field_type, lambda_proxy_type):
142 Strip references before checking WILDCARD_TYPE_P.
143
144 2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
145
146 * call.c (build_conditional_expr_1, build_over_call): Protect
147 error calls with complain & tf_error.
148 * typeck.c (finish_class_member_access_expr, cp_build_binary_op,
149 build_x_unary_op, cp_build_unary_op, cp_build_compound_expr,
150 build_ptrmemfunc): Likewise.
151 (lookup_destructor): Take tsubst_flags_t parameter, adjust.
152
153 * cvt.c (warn_ref_binding): Rename to diagnose_ref_binding.
154 (convert_to_reference): Adjust.
155
156 2013-04-11 Jason Merrill <jason@redhat.com>
157
158 * pt.c (tsubst_copy) [VAR_DECL]: Don't call tsubst for
159 local variables, look them up instead.
160 (tsubst_decl) [VAR_DECL]: Remove handling for anonymous union
161 proxies and substitution in unevaluated context.
162 (tsubst_expr) [OMP_FOR]: Instantiate OMP_FOR_PRE_BODY
163 before the iterators.
164
165 PR c++/23055
166 * pt.c (uses_deducible_template_parms): New.
167 (deducible_array_bound, deducible_expression): New.
168 (deducible_template_args): New.
169 (unify_one_argument): Call uses_deducible_template_parms.
170
171 2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
172
173 PR c++/56913
174 * typeck2.c (build_m_component_ref): Protect error calls with
175 (complain & tf_error).
176
177 2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
178
179 PR c++/54216
180 * parser.c (cp_parser_enum_specifier): Check for empty
181 anonymous enums and anonymous scoped enums.
182
183 2013-04-10 Jakub Jelinek <jakub@redhat.com>
184
185 PR c++/56895
186 * typeck.c (cp_build_binary_op): Call fold_non_dependent_expr_sfinae
187 first before calling maybe_constant_value for warn_for_div_by_zero
188 or invalid shift count warning purposes.
189
190 2013-04-09 Jason Merrill <jason@redhat.com>
191
192 PR c++/25466
193 * rtti.c (build_typeid): Check the address of the argument
194 rather than looking for an INDIRECT_REF.
195
196 2013-04-04 Jason Merrill <jason@redhat.com>
197
198 PR c++/56838
199 PR c++/17232
200 * typeck2.c (abstract_virtuals_error_sfinae): Disable
201 complete_type again.
202
203 2013-04-08 Paolo Carlini <paolo.carlini@oracle.com>
204
205 PR c++/56871
206 * decl.c (validate_constexpr_redeclaration): Allow an explicit
207 specialization to be different wrt the constexpr specifier.
208
209 2013-04-06 Jason Merrill <jason@redhat.com>
210
211 * parser.c (cp_parser_std_attribute): Treat [[noreturn]] like GNU
212 noreturn attribute.
213
214 2013-04-05 Ed Smith-Rowland <3dw4rd@verizon.net>
215
216 * parser.c (cp_parser_ref_qualifier_seq_opt): Move to
217 cp_parser_ref_qualifier_opt. Error if more than one ref-qual found.
218
219 2013-04-03 Jason Merrill <jason@redhat.com>
220
221 * cp-tree.h (FUNCTION_OR_METHOD_TYPE_CHECK): Remove.
222 (TYPE_RAISES_EXCEPTIONS): Use FUNC_OR_METHOD_CHECK instead.
223 (FUNCTION_REF_QUALIFIED, FUNCTION_RVALUE_QUALIFIED): Likewise.
224
225 * mangle.c (write_type): When writing a function type with
226 function-cv-quals, don't add the unqualified type as a
227 substitution candidate.
228
229 2013-04-03 Paolo Carlini <paolo.carlini@oracle.com>
230
231 PR c++/56815
232 * typeck.c (cp_build_unary_op): Change -Wpointer-arith permerror to
233 pedwarn.
234
235 2013-04-03 Jakub Jelinek <jakub@redhat.com>
236
237 PR debug/56819
238 * tree.c (strip_typedefs): Copy NON_DEFAULT_TEMPLATE_ARGS_COUNT
239 from args to new_args.
240 (strip_typedefs_expr): Copy NON_DEFAULT_TEMPLATE_ARGS_COUNT from t to
241 r instead of doing {S,G}ET_NON_DEFAULT_TEMPLATE_ARGS_COUNT.
242
243 2013-04-02 Jason Merrill <jason@redhat.com>
244
245 PR c++/56821
246 * mangle.c (write_function_type): Mangle ref-qualifier.
247 (write_nested_name): Likewise.
248 (canonicalize_for_substitution): Preserve ref-qualifier.
249 (write_type): Likewise.
250
251 PR c++/34949
252 * decl.c (begin_destructor_body): Clobber the object in a cleanup.
253
254 2013-04-02 Paolo Carlini <paolo.carlini@oracle.com>
255
256 * friend.c (do_friend): Use COMPLETE_OR_OPEN_TYPE_P.
257 * pt.c (find_parameter_packs_r): Use TYPE_ALIAS_P and TYPE_TI_ARGS.
258 (for_each_template_parm_r): Use TYPE_TI_ARGS.
259
260 2013-04-02 Paolo Carlini <paolo.carlini@oracle.com>
261
262 * cp-tree.h (TAGGED_TYPE_P): Remove.
263 (IS_OVERLOAD_TYPE): Rename to OVERLOAD_TYPE_P, adjust.
264 (TYPE_ANONYMOUS_P): Adjust.
265 * call.c (build_new_op_1): Likewise.
266 * class.c (find_abi_tags_r): Likewise.
267 * decl.c (warn_misplaced_attr_for_class_type, start_decl,
268 type_is_deprecated): Likewise.
269 * decl2.c (grokfield, min_vis_r): Likewise.
270 * pt.c (get_template_info): Likewise.
271 * tree.c (handle_abi_tag_attribute): Likewise.
272
273 2013-04-01 Jason Merrill <jason@redhat.com>
274
275 * semantics.c (maybe_constant_value): Check
276 instantiation_dependent_expression_p.
277 * pt.c (build_non_dependent_expr): Don't check it here.
278
279 PR c++/56772
280 * init.c (build_new): Don't try to process an array initializer
281 at template definition time.
282
283 PR c++/56793
284 * typeck.c (finish_class_member_access_expr): Handle enum scope.
285
286 PR c++/56794
287 * parser.c (cp_parser_range_for): Don't try to do auto deduction
288 in a template if the type of the range is incomplete.
289
290 * call.c (add_function_candidate): Take the address of 'this' here.
291 (build_over_call): And here.
292 (build_new_method_call_1, build_op_call_1): Not here.
293 (build_user_type_conversion_1): Or here.
294 (add_candidates): Adjust.
295
296 * cxx-pretty-print.h (pp_cxx_cv_qualifiers): New.
297 * class.c (same_signature_p): Use type_memfn_quals.
298 * cp-tree.h (TYPE_RAISES_EXCEPTIONS): Use
299 FUNCTION_OR_METHOD_TYPE_CHECK.
300 * error.c (dump_type_suffix): Add padding before cv-qualifiers.
301 * pt.c (unify): Use static_fn_type.
302
303 2013-04-01 Bronek Kozicki <b.kozicki@gmail.com>
304 Jason Merrill <jason@redhat.com>
305
306 Implement N2439 (ref-qualifiers for 'this')
307 * cp-tree.h (FUNCTION_REF_QUALIFIED): New.
308 (FUNCTION_RVALUE_QUALIFIED): New.
309 (FUNCTION_OR_METHOD_TYPE_CHECK): New.
310 (cpp0x_warn_str): Add CPP0X_REF_QUALIFIER.
311 (cp_ref_qualifier): New enum.
312 (cp_declarator): Add ref_qualifier.
313 * parser.c (cp_parser_ref_qualifier_seq_opt): New.
314 (cp_parser_direct_declarator): Use it.
315 (make_call_declarator): Adjust.
316 (cp_parser_lambda_declarator_opt): Adjust.
317 * call.c (add_function_candidate): Handle ref-qualifier overload
318 resolution semantics.
319 (standard_conversion): Adjust.
320 * class.c (add_method, same_signature_p): Compare ref-qualifiers.
321 * decl.c (grokdeclarator): Handle ref-qualifiers.
322 (grokfndecl): Check for invalid ref-qualifiers.
323 (static_fn_type, revert_static_member_fn): Adjust.
324 * decl2.c (build_memfn_type): Handle ref-qualifiers.
325 (check_classfn): Check them.
326 (cp_reconstruct_complex_type): Retain them.
327 * error.c (dump_ref_qualifier): New.
328 (dump_type_suffix, dump_function_decl): Use it.
329 (maybe_warn_cpp0x): Handle CPP0X_REF_QUALIFIER.
330 * pt.c (tsubst, tsubst_function_type): Instantiate ref-quals.
331 (unify): Retain them.
332 * tree.c (cp_check_qualified_type): New.
333 (cp_build_qualified_type_real): Keep exception spec and ref-qual.
334 (build_ref_qualified_type): New.
335 (strip_typedefs, build_exception_variant): Keep ref-qualifier.
336 (cp_build_type_attribute_variant): Keep ref-qualifier.
337 * typeck.c (merge_types): Keep ref-qualifier.
338 (structural_comptypes): Compare ref-qualifier.
339 (type_memfn_rqual): New.
340 (apply_memfn_quals): Take ref-qual argument.
341 * typeck2.c (build_m_component_ref): Check ref-qualifier.
342
343 2013-04-01 Paolo Carlini <paolo.carlini@oracle.com>
344
345 * cp-tree.h (DECL_UNBOUND_CLASS_TEMPLATE_P): Remove.
346 (DECL_FUNCTION_TEMPLATE_P): Adjust.
347
348 * cxx-pretty-print.c (pp_cxx_nested_name_specifier,
349 pp_cxx_qualified_id): Use get_containing_scope.
350 * parser.c (cp_parser_class_head): Likewise.
351 * pt.c (push_template_decl_real): Likewise.
352
353 * decl2.c (import_export_decl): Use DECL_TEMPLOID_INSTANTIATION.
354 * pt.c (unify): Use CP_INTEGRAL_TYPE_P.
355
356 2013-03-31 Paolo Carlini <paolo.carlini@oracle.com>
357
358 * decl2.c (collect_candidates_for_java_method_aliases): Use
359 DECL_CLASS_SCOPE_P.
360 * name-lookup.c (pushtag_1) Use TYPE_FUNCTION_SCOPE_P.
361 (pushdecl_maybe_friend_1): Use DECL_DECLARES_FUNCTION_P.
362 * decl.c (duplicate_decls): Likewise.
363 * parser.c (cp_parser_template_declaration_after_export): Likewise,
364 also DECL_DECLARES_TYPE_P.
365 * pt.c (instantiate_class_template_1): Likewise.
366 * search.c (lookup_field_1): Use DECL_DECLARES_TYPE_P.
367 (lookup_field_r): Likewise.
368 (friend_accessible_p): Use DECL_DECLARES_FUNCTION_P.
369 (lookup_fnfields_slot_nolazy): Likewise.
370 * semantics.c (finish_member_declaration): Likewise.
371 * typeck.c (convert_for_initialization): Use TYPE_REFFN_P.
372
373 2013-03-29 Gabriel Dos Reis <gdr@integrable-solutions.net>
374
375 * pt.c (template_parms_to_args): Fix typo in comment.
376
377 2013-03-29 Paolo Carlini <paolo.carlini@oracle.com>
378
379 * call.c (build_op_call_1): Use TYPE_PTRFN_P and TYPE_REFFN_P.
380
381 2013-03-29 Paolo Carlini <paolo.carlini@oracle.com>
382
383 * call.c (add_builtin_candidate): Use TYPE_PTR_P and VOID_TYPE_P.
384 (build_op_call_1): Likewise.
385 (build_over_call): Likewise.
386 (compare_ics): Likewise.
387 * class.c (build_base_path): Likewise.
388 (resolve_address_of_overloaded_function): Likewise.
389 * cp-tree.h: Likewise.
390 * cvt.c (cp_convert_to_pointer): Likewise.
391 (convert_to_reference): Likewise.
392 (ocp_convert): Likewise.
393 (convert_force): Likewise, tidy.
394 * cxx-pretty-print.c (pp_cxx_postfix_expression): Likewise.
395 (pp_cxx_ptr_operator): Likewise.
396 * decl.c (duplicate_decls): Likewise.
397 (start_decl): Likewise.
398 (grok_op_properties): Likewise.
399 (start_preparsed_function): Likewise.
400 (store_parm_decls): Likewise.
401 (finish_function): Likewise.
402 * decl2.c (delete_sanity): Likewise.
403 (acceptable_java_type): Likewise.
404 (grokbitfield): Likewise.
405 (cp_reconstruct_complex_type): Likewise.
406 * error.c (dump_type_prefix): Likewise.
407 (dump_expr): Likewise.
408 * except.c (push_eh_cleanup): Likewise.
409 (complete_ptr_ref_or_void_ptr_p): Likewise.
410 (can_convert_eh): Likewise.
411 * init.c (build_new_1): Likewise.
412 (build_delete): Likewise.
413 (build_vec_delete): Likewise.
414 * mangle.c (write_type): Likewise.
415 * parser.c (lookup_literal_operator): Likewise.
416 * pt.c (convert_nontype_argument_function): Likewise.
417 (convert_nontype_argument): Likewise.
418 (tsubst): Likewise.
419 (unify): Likewise.
420 (dependent_type_p_r): Likewise.
421 * rtti.c (build_headof): Likewise.
422 (build_typeid): Likewise.
423 (build_dynamic_cast_1): Likewise.
424 (target_incomplete_p): Likewise.
425 (typeinfo_in_lib_p): Likewise.
426 * semantics.c (finish_omp_for): Likewise.
427 (cxx_eval_call_expression): Likewise.
428 (maybe_resolve_dummy): Likewise.
429 * tree.c (build_target_expr): Likewise.
430 (cp_build_qualified_type_real): Likewise.
431 * typeck.c (composite_pointer_type_r): Likewise.
432 (composite_pointer_type): Likewise.
433 (comp_except_types): Likewise.
434 (cxx_sizeof_nowarn): Likewise.
435 (string_conv_p): Likewise.
436 (cp_build_array_ref): Likewise.
437 (cp_build_function_call_vec): Likewise, also use TYPE_PTRFN_P.
438 (pointer_diff): Likewise.
439 (cp_build_addr_expr_1): Likewise.
440 (cp_build_unary_op): Likewise.
441 (build_static_cast_1): Likewise.
442 (cp_build_c_cast): Likewise.
443 (comp_ptr_ttypes_real): Likewise.
444 (ptr_reasonably_similar): Likewise.
445 (comp_ptr_ttypes_const): Likewise.
446 (casts_away_constness): Likewise.
447 (check_literal_operator_args): Likewise.
448 * typeck2.c (build_x_arrow): Likewise.
449 (add_exception_specifier): Likewise.
450
451 2013-03-29 Jason Merrill <jason@redhat.com>
452
453 N3582
454 * cp-tree.h (AUTO_IS_DECLTYPE): New.
455 * parser.c (cp_parser_decltype): Handle decltype(auto).
456 (cp_parser_type_id_1): Allow auto without a late-specified
457 return in C++1y.
458 (cp_parser_primary_expression): Use the return value of
459 finish_parenthesized_expr.
460 (cp_parser_transaction_expression): Likewise.
461 * semantics.c (force_paren_expr): New.
462 (finish_parenthesized_expr): Use it.
463 * call.c (build_conditional_expr_1): Likewise.
464 * pt.c (do_auto_deduction): Handle decltype(auto).
465 (tsubst_copy): Handle PAREN_EXPR.
466 (tsubst_copy_and_build): Likewise.
467 * error.c (dump_expr): Handle PAREN_EXPR.
468 * cxx-pretty-print.c (pp_cxx_expression): Likewise.
469 * mangle.c (write_expression): Ignore PAREN_EXPR.
470
471 * parser.c (cp_parser_decltype_expr): Split out...
472 (cp_parser_decltype): ...from here.
473
474 PR c++/56774
475 PR c++/35722
476 * pt.c (unify_pack_expansion): Fix indexing.
477
478 2013-03-29 Gabriel Dos Reis <gdr@integrable-solutions.net>
479
480 * call.c (build_java_interface_fn_ref): Likewise.
481 (make_temporary_var_for_ref_to_temp): Likewise.
482 * class.c (check_field_decls): Likewise.
483 (layout_class_type): Likewise.
484 (finish_struct_1): Likewise.
485 (fixed_type_or_null): Likewise.
486 (get_vtbl_decl_for_binfo): Likewise.
487 * cp-gimplify.c (omp_var_to_track): Likewise.
488 (cp_genericize_r): Likewise.
489 * cp-objcp-common.c (cxx_warn_unused_global_decl): Likewise.
490 * cp-tree.h (LANG_DECL_HAS_MIN): Likewise.
491 (DECL_DISCRIMINATOR_P): Likewise.
492 * decl.c (poplevel): Likewise.
493 (decls_match): Likewise.
494 (duplicate_decls): Likewise.
495 (decl_jump_unsafe): Likewise.
496 (start_decl): Likewise.
497 (check_for_uninitialized_const_var): Likewise.
498 (make_rtl_for_nonlocal_decl): Likewise.
499 (cp_finish_decl): Likewise.
500 (expand_static_init): Likewise.
501 (local_variable_p): Likewise.
502 (maybe_register_incomplete_var): Likewise.
503 * decl2.c (grokfield): Likewise.
504 (comdat_linkage): Likewise.
505 (determine_visibility): Likewise.
506 (import_export_decl): Likewise.
507 (prune_vars_needing_no_initialization): Likewise.
508 (decl_maybe_constant_var_p): Likewise.
509 * error.c (dump_simple_decl): Likewise.
510 (dump_template_decl): Likewise.
511 (cp_printer): Likewise.
512 * except.c (build_throw): Likewise.
513 * init.c (build_vtbl_address): Likewise.
514 (member_init_ok_or_else): Likewise.
515 (build_aggr_init): Likewise.
516 (expand_aggr_init_1): Likewise.
517 (build_offset_ref): Likewise.
518 (constant_value_1): Likewise.
519 * mangle.c (write_mangled_name): Likewise.
520 (write_prefix): Likewise.
521 * name-lookup.c (supplement_binding_1): Likewise.
522 (add_decl_to_level): Likewise.
523 (pushdecl_maybe_friend_1): Likewise.
524 (check_for_out_of_scope_variable): Likewise.
525 (validate_nonmember_using_decl): Likewise.
526 (lookup_name_innermost_nonclass_level_1): Likewise.
527 (lookup_arg_dependent_1): Likewise.
528 * parser.c (cp_parser_lambda_introducer): Likewise.
529 (cp_parser_template_argument): Likewise.
530 (cp_parser_single_declaration): Likewise.
531 * pt.c (convert_nontype_argument): Likewise.
532 (instantiate_class_template_1): Likewise.
533 (tsubst_decl): Likewise.
534 (tsubst_expr): Likewise.
535 (do_decl_instantiation): Likewise.
536 (do_type_instantiation): Likewise.
537 (regenerate_decl_from_template): Likewise.
538 (always_instantiate_p): Likewise.
539 (instantiate_decl): Likewise.
540 (type_dependent_expression_p): Likewise.
541 (build_non_dependent_expr): Likewise.
542 * repo.c (repo_emit_p): Likewise.
543 * rtti.c (build_dynamic_cast_1): Likewise.
544 * search.c (shared_member_p): Likewise.
545 * semantics.c (outer_var_p): Likewise.
546 (finish_id_expression): Likewise.
547 (finish_omp_clauses): Likewise.
548 (finish_decltype_type): Likewise.
549 (ensure_literal_type_for_constexpr_object): Likewise.
550 * tree.c (lvalue_kind): Likewise.
551 (bot_replace): Likewise.
552 (cp_tree_equal): Likewise.
553 (handle_init_priority_attribute): Likewise.
554 (decl_storage_duration): Likewise.
555 * typeck.c (cxx_sizeof_expr): Likewise.
556 (cxx_alignof_expr): Likewise.
557 (decay_conversion): Likewise.
558 (build_class_member_access_expr): Likewise.
559 (cp_build_array_ref): Likewise.
560 (cxx_mark_addressable): Likewise.
561 (maybe_warn_about_returning_address_of_local): Likewise.
562 (check_return_expr): Likewise.
563 * typeck2.c (cxx_readonly_error): Likewise.
564 (abstract_virtuals_error_sfinae): Likewise.
565 (cxx_incomplete_type_diagnostic): Likewise.
566
567 2013-03-28 Lawrence Crowl <crowl@google.com>
568
569 * Make-lang.in
570 (CXX_PARSER_H): Add header dependence.
571 * cp-tree.h
572 (extern debug (cp_binding_level &)): New.
573 (extern debug (cp_binding_level *)): New.
574 * name-lookup.h
575 (debug (cp_binding_level &)): New.
576 (debug (cp_binding_level *)): New.
577 * parser.c
578 (debug (cp_parser &)): New.
579 (debug (cp_parser *)): New.
580 (debug (cp_token &)): New.
581 (debug (cp_token *)): New.
582 (debug (vec<cp_token, va_gc> &)): New.
583 (debug (vec<cp_token, va_gc> *)): New.
584 * parser.c: Add header dependence.
585 (extern debug (cp_parser &)): New.
586 (extern debug (cp_parser *)): New.
587 (extern debug (cp_token &)): New.
588 (extern debug (cp_token *)): New.
589 (extern debug (vec<cp_token, va_gc> &)): New.
590 (extern debug (vec<cp_token, va_gc> *)): New.
591
592 2013-03-28 Jason Merrill <jason@redhat.com>
593
594 PR c++/17232
595 PR c++/52748
596 * typeck2.c (abstract_virtuals_error_sfinae): Don't complete
597 the type if tf_decltype is set.
598 * pt.c (fn_type_unification): Add decltype_p parm.
599 (get_bindings): Adjust.
600 * cp-tree.h: Adjust.
601 * class.c (resolve_address_of_overloaded_function): Adjust.
602 * call.c (add_template_candidate_real, print_z_candidate): Adjust.
603
604 PR c++/56679
605 * parser.c (cp_parser_sizeof_pack): Split out from...
606 (cp_parser_sizeof_operand): ...here. Require (id).
607
608 PR c++/56701
609 * semantics.c (finish_this_expr): 'this' is an rvalue.
610 * typeck.c (cp_build_indirect_ref): Handle NOP_EXPR of 'this'.
611
612 PR c++/56710
613 * semantics.c (finish_member_declaration): Don't push closure
614 members.
615
616 * name-lookup.c (pushdecl_maybe_friend_1): Use
617 nonlambda_method_basetype and current_nonlambda_class_type.
618
619 PR c++/56728
620 * semantics.c (potential_constant_expression_1) [NOP_EXPR]: Reject
621 conversion from integer to pointer.
622 (cxx_eval_constant_expression): Likewise.
623 (cxx_eval_indirect_ref): Use the folded operand if we still think
624 this might be constant.
625
626 2013-03-28 Paolo Carlini <paolo.carlini@oracle.com>
627 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
628
629 PR c++/56725
630 * call.c (convert_like_real): Change series of two permerrors
631 to permerror + inform (and likewise for two errors).
632 (build_new_method_call_1): Likewise.
633 * typeck.c (convert_for_initialization): Change additional
634 warning or error to inform.
635
636 2013-03-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
637
638 * cp-tree.h (next_aggr_init_expr_arg): Remove static specifier.
639 (first_aggr_init_expr): Likewise.
640 (more_aggr_init_expr_args_p): Likewise.
641 (type_of_this_parm): Likewise.
642 (class_of_this_parm): Likewise.
643 * name-lookup.h (get_global_value_if_present): Likewise.
644 (is_typename_at_global_scope): Likewise.
645
646 2013-03-28 Paolo Carlini <paolo.carlini@oracle.com>
647
648 * call.c (joust): Don't call inform for a permerror returning false.
649 * parser.c (cp_parser_check_class_key): Likewise.
650 * pt.c (tsubst_copy_and_build): Likewise.
651
652 2013-03-27 Jason Merrill <jason@redhat.com>
653
654 PR c++/56749
655 * semantics.c (finish_qualified_id_expr): Return early
656 for enum scope.
657
658 2013-03-26 Gabriel Dos Reis <gdr@integrable-solutions.net>
659
660 * call.c (build_new_method_call_1): Use INDIRECT_REF_P.
661 * cvt.c (convert_to_void): Likewise.
662 * error.c (dump_expr): Likewise.
663 * mangle.c (write_expression): Likewise.
664 * parser.c (cp_parser_template_argument): Likewise.
665 * pt.c (convert_nontype_argument): Likewise.
666 (tsubst_copy_and_build): Likewise.
667 * rtti.c (build_typeid): Likewise.
668 * semantics.c (finish_call_expr): Likewise.
669 (finish_decltype_type): Likewise.
670 (build_data_member_initialization): Likewise.
671 * tree.c (is_dummy_object): Likewise.
672 * typeck.c (decay_conversion): Likewise.
673 (build_class_member_access_expr): Likewise.
674 (cp_build_addr_expr_1): Likewise.
675 (unary_complex_lvalue): Likewise.
676 (check_return_expr): Likewise.
677 * typeck2.c (cxx_readonly_error): Likewise.
678
679 2013-03-26 Jason Merrill <jason@redhat.com>
680
681 PR c++/52597
682 * typeck.c (invalid_nonstatic_memfn_p): Use get_first_fn. Take tree.
683 * semantics.c (finish_decltype_type): Check it before type_unknown_p.
684 * cp-tree.h: Adjust prototype.
685
686 PR c++/45282
687 * typeck2.c (build_m_component_ref): Handle prvalue object.
688
689 2013-03-26 Gabriel Dos Reis <gdr@integrable-solutions.net>
690
691 * cp-gimplify.c (cp_genericize_r): Use VAR_OR_FUNCTION_DECL_P.
692 * decl.c (duplicate_decls): Likewise.
693 (cp_finish_decl): Likewise.
694 (check_class_member_definition_namespace): Likewise.
695 * decl2.c (grokfield): Likewise.
696 (decl_needed_p): Likewise.
697 (import_export_decl): Likewise.
698 (mark_used): Likewise.
699 * name-lookup.c (pushdecl_maybe_friend_1): Likewise.
700 * pt.c (push_access_scope): Likewise.
701 (instantiate_decl): Likewise.
702 * ptree.c (cxx_print_decl): Likewise.
703 * repo.c (repo_emit_p): Likewise.
704 * semantics.c (note_decl_for_pch): Likewise.
705 * tree.c (decl_linkage): Likewise.
706
707 2013-03-26 Paolo Carlini <paolo.carlini@oracle.com>
708
709 PR c++/55951
710 * decl.c (check_array_designated_initializer): Handle CONST_DECL
711 as ce->index.
712
713 2013-03-26 Paolo Carlini <paolo.carlini@oracle.com>
714
715 * decl.c (grokfndecl): Handle separately <inline> and <constexpr>
716 error messages.
717
718 * decl.c (grokdeclarator): Declare typedef_p and use it everywhere.
719
720 2013-03-25 Jason Merrill <jason@redhat.com>
721
722 PR c++/56699
723 * semantics.c (maybe_resolve_dummy): Make sure that the enclosing
724 class is derived from the type of the object.
725
726 PR c++/52014
727 * semantics.c (lambda_expr_this_capture): Don't capture 'this' in
728 unevaluated context.
729
730 2013-03-25 Paolo Carlini <paolo.carlini@oracle.com>
731
732 PR c++/56722
733 * decl.c (cp_finish_decl): Check DECL_LANG_SPECIFIC before
734 DECL_TEMPLATE_INSTANTIATION.
735
736 2013-03-22 Jason Merrill <jason@redhat.com>
737
738 PR c++/56684
739 * pt.c (instantiation_dependent_r): Check DECL_INITIAL of VAR_DECL
740 and CONST_DECL.
741
742 2013-03-21 Gabriel Dos Reis <gdr@integrable-solutions.net>
743
744 * cp-tree.h (identifier_p): New.
745 * call.c: Throughout, call identifier_p insstead of direct
746 comparaison of TREE_CODE against IDENTIFIER_NODE.
747 * decl.c: Likewisse.
748 * decl2.c: Likewise.
749 * init.c: Likewise.
750 * mangle.c: Likewise.
751 * name-lookup.c: Likewise.
752 * parser.c: Likewise.
753 * pt.c: Likewise.
754 * search.c: Likewise.
755 * semantics.c: Likewise.
756 * tree.c: Likewise.
757 * typeck.c: Likewise.
758 * typeck2.c: Likewise.
759
760 2013-03-21 Jakub Jelinek <jakub@redhat.com>
761
762 PR middle-end/48087
763 * pt.c (convert_nontype_argument): Count werrorcount as warnings.
764 * call.c (build_temp): Likewise.
765 * method.c (synthesize_method): Likewise.
766 * typeck.c (convert_for_initialization): Likewise.
767
768 2013-03-21 Marc Glisse <marc.glisse@inria.fr>
769
770 * call.c (build_conditional_expr_1): Fold VEC_COND_EXPR.
771
772 2013-03-21 Richard Biener <rguenther@suse.de>
773
774 * error.c (cp_printer): Use DECL_HAS_DEBUG_EXPR_P instead of
775 DECL_DEBUG_EXPR_IS_FROM. Guard properly.
776
777 2013-03-20 Jason Merrill <jason@redhat.com>
778
779 PR c++/56646
780 * parser.c (cp_parser_late_return_type_opt): Save and restore
781 current_class_ptr/ref.
782
783 PR c++/54532
784 * expr.c (cplus_expand_constant): Do nothing if the class is
785 incomplete.
786 * semantics.c (reduced_constant_expression_p): Allow PTRMEM_CST.
787 * typeck2.c (store_init_value): Use reduced_constant_expression_p.
788 * decl.c (maybe_register_incomplete_var): Handle PTRMEM_CST.
789 (complete_vars): Likewise.
790
791 * name-lookup.c (get_anonymous_namespace_name): Never use
792 get_file_function_name.
793
794 * pt.c (retrieve_specialization): Handle null tmpl argument.
795
796 PR c++/17232
797 PR c++/56642
798 * pt.c (tsubst_decl): Check return value of register_specialization.
799 * typeck2.c (abstract_virtuals_error_sfinae): Re-apply complete_type
800 change.
801
802 2013-03-17 Jason Merrill <jason@redhat.com>
803
804 PR c++/54359
805 PR c++/56639
806 * parser.c (cp_parser_direct_declarator): Bail if we see a
807 qualified-id not at namespace scope.
808
809 PR c++/17232
810 PR c++/56642
811 * typeck2.c (abstract_virtuals_error_sfinae): Revert complete_type
812 change for now.
813
814 2013-03-16 Jason Merrill <jason@redhat.com>
815
816 * decl.c (grokdeclarator): Assert that we won't see a pointer to
817 METHOD_TYPE.
818
819 PR c++/54277
820 * cp-tree.h (WILDCARD_TYPE_P): Split out from...
821 (MAYBE_CLASS_TYPE_P): ...here.
822 * semantics.c (lambda_capture_field_type): Only build a
823 magic decltype for wildcard types.
824 (lambda_proxy_type): Likewise.
825 (finish_non_static_data_member): Get the quals from
826 the object.
827
828 PR c++/55931
829 * parser.c (cp_parser_template_argument): Don't
830 fold_non_dependent_expr.
831
832 * parser.c (cp_parser_lambda_declarator_opt): Use
833 cp_parser_trailing_type_id.
834
835 PR c++/45917
836 * parser.c (cp_parser_template_id): Don't forget access checks.
837
838 PR c++/52374
839 * pt.c (tsubst_qualified_id): Use current_nonlambda_class_type.
840
841 PR c++/54764
842 PR c++/55972
843 * name-lookup.h (tag_scope): Add ts_lambda.
844 * semantics.c (begin_lambda_type): Use it.
845 * decl.c (xref_tag_1): Set CLASSTYPE_LAMBDA_EXPR.
846 * pt.c (check_default_tmpl_args): Ignore lambdas.
847 (push_template_decl_real): Handle lambdas.
848 * tree.c (no_linkage_check): Adjust lambda check.
849
850 PR c++/56039
851 * tree.c (strip_typedefs_expr): Complain about lambda, don't abort.
852
853 PR c++/54359
854 * parser.c (cp_parser_direct_declarator): Fix late return
855 for out-of-class defn of member function.
856
857 PR c++/55357
858 * semantics.c (maybe_add_lambda_conv_op): Clear DECL_NAME of copied
859 parms to avoid duplicate -Wshadow warnings.
860
861 * search.c (lookup_base): Handle NULL_TREE.
862
863 PR c++/56481
864 * semantics.c (potential_constant_expression_1): Use of 'this' in
865 a non-constexpr function makes the expression not potentially
866 constant.
867
868 N3276
869 PR c++/52748
870 * cp-tree.h (tsubst_flags): Add tf_decltype.
871 * call.c (build_cxx_call): Don't build a temporary if it's set.
872 (build_over_call): Make sure it's only passed to build_cxx_call.
873 * parser.c (cp_parser_primary_expression): Add decltype_p parm.
874 (cp_parser_unary_expression): Likewise.
875 (cp_parser_cast_expression): Likewise.
876 (cp_parser_binary_expression): Likewise.
877 (cp_parser_assignment_expression): Likewise.
878 (cp_parser_postfix_expression): Likewise. Pass tf_decltype.
879 (cp_parser_expression): Add decltype_p. Force a
880 temporary for a call on the LHS of a comma.
881 (cp_parser_decltype): Pass true to decltype_p parms.
882 * pt.c (tsubst) [DECLTYPE_TYPE]: Pass tf_decltype.
883 (tsubst_copy_and_build): Pass tf_decltype down only for
884 CALL_EXPR and the RHS of COMPOUND_EXPR.
885 * tree.c (build_cplus_new): Call complete_type_or_maybe_complain.
886
887 * cp-tree.h (abstract_class_use): New enum.
888 * typeck2.c (pending_abstract_type): Add use field.
889 (abstract_virtuals_error_sfinae): Add overloads taking
890 abstract_class_use instead of tree.
891 * typeck.c (build_static_cast_1): Call it.
892 * except.c (is_admissible_throw_operand_or_catch_parameter): Call it.
893 * pt.c: Adjust calls.
894 * decl.c (cp_finish_decl): Don't handle functions specially.
895 (grokdeclarator): Always check return type.
896 * init.c (build_new_1): Adjust call.
897
898 DR 337
899 PR c++/17232
900 * pt.c (tsubst) [ARRAY_TYPE]: Use abstract_virtuals_error_sfinae.
901 * typeck2.c (abstract_virtuals_error_sfinae): Call complete_type.
902
903 DR 657
904 * pt.c (tsubst_function_type): Call abstract_virtuals_error_sfinae.
905 (tsubst_arg_types): Likewise.
906
907 DR 1518
908 PR c++/54835
909 * call.c (convert_like_real): Check for explicit constructors
910 even for value-initialization.
911
912 PR c++/54946
913 * pt.c (convert_nontype_argument): Handle invalid pointer.
914
915 * parser.c (cp_parser_lambda_expression): Use nreverse.
916
917 PR c++/56447
918 PR c++/55532
919 * pt.c (instantiate_class_template_1): Instantiate lambda capture
920 list here.
921 (tsubst_copy_and_build): Not here.
922
923 PR c++/55017
924 * method.c (walk_field_subobs): Disallow copy of rvalue ref.
925
926 PR c++/55240
927 * parser.c (parsing_nsdmi): New.
928 * semantics.c (outer_automatic_var_p): Check it.
929 (finish_id_expression): Likewise.
930 * cp-tree.h: Declare it.
931
932 PR c++/55241
933 * error.c (dump_expr) [SIZEOF_EXPR]: Print sizeof... properly.
934
935 * parser.c (lookup_literal_operator): Correct parm/arg naming
936 mixup.
937
938 PR c++/56238
939 * pt.c (fold_non_dependent_expr_sfinae): Check
940 instantiation_dependent_expression_p.
941
942 PR c++/56095
943 * class.c (resolve_address_of_overloaded_function): Accept a
944 reference to function for target_type.
945 (instantiate_type): Likewise.
946 * pt.c (convert_nontype_argument): Pass it to
947 convert_nontype_argument_function.
948
949 2013-03-16 Jakub Jelinek <jakub@redhat.com>
950
951 * tree.c (cp_tree_equal): Fix a pasto.
952
953 PR c++/56607
954 * typeck.c (cp_build_binary_op): When calling warn_for_div_by_zero,
955 pass op1 through maybe_constant_value first.
956
957 2013-03-16 Paolo Carlini <paolo.carlini@oracle.com>
958
959 PR c++/56582
960 * semantics.c (cxx_eval_array_reference): Check for negative index.
961
962 2013-03-14 Jason Merrill <jason@redhat.com>
963
964 PR c++/56614
965 * decl.c (local_variable_p_walkfn): Check DECL_ARTIFICIAL again.
966
967 PR c++/56346
968 * decl.c (register_dtor_fn): Pass null to __cxa_thread_atexit
969 dso_handle parm on targets without __cxa_atexit.
970
971 2013-03-11 Jason Merrill <jason@redhat.com>
972
973 PR c++/56567
974 * typeck.c (check_return_expr): Disallow returning init list here.
975 * semantics.c (apply_deduced_return_type): Not here.
976
977 2013-03-08 Paolo Carlini <paolo.carlini@oracle.com>
978
979 PR c++/51412
980 * cxx-pretty-print.c (pp_cxx_expression): Handle LAMBDA_EXPR.
981 * error.c (dump_expr): Likewise.
982
983 2013-03-08 Jason Merrill <jason@redhat.com>
984
985 PR c++/51884
986 * class.c (modify_all_vtables): Mangle the vtable name before
987 entering dfs_walk.
988
989 * semantics.c (lambda_expr_this_capture): In unevaluated context,
990 just return the nearest 'this'.
991
992 PR c++/51494
993 PR c++/52183
994 PR c++/56222
995 * tree.c (maybe_dummy_object): Don't capture 'this'.
996 * semantics.c (maybe_resolve_dummy): New.
997 (finish_non_static_data_member): Use it.
998 (finish_qualified_id_expr): Don't test is_dummy_object.
999 * cp-tree.h: Declare maybe_resolve_dummy.
1000 * call.c (build_new_method_call_1): Use it.
1001
1002 PR c++/56567
1003 * semantics.c (apply_deduced_return_type): Don't allow returning
1004 std::initializer_list.
1005
1006 2013-03-06 Paolo Carlini <paolo.carlini@oracle.com>
1007
1008 PR c++/56534
1009 * parser.c (cp_parser_elaborated_type_specifier): Don't call
1010 check_elaborated_type_specifier when TREE_CODE (decl) != TYPE_DECL.
1011 * decl.c (check_elaborated_type_specifier): Tidy.
1012
1013 2013-03-06 Jakub Jelinek <jakub@redhat.com>
1014
1015 PR c++/56543
1016 * tree.c (strip_typedefs): Don't copy args if they are NULL.
1017
1018 2013-03-05 Jakub Jelinek <jakub@redhat.com>
1019
1020 * parser.c (cp_parser_braced_list): For {} initialize
1021 *non_constant_p to false.
1022
1023 2013-03-04 Jason Merrill <jason@redhat.com>
1024
1025 PR c++/56464
1026 PR c++/54383
1027 * semantics.c (lambda_expr_this_capture): Handle NSDMI
1028 and non-class scopes.
1029
1030 2013-03-01 Paolo Carlini <paolo.carlini@oracle.com>
1031
1032 * decl.c (grokdeclarator): Remove dead code.
1033
1034 2013-02-28 Jason Merrill <jason@redhat.com>
1035
1036 PR c++/56481
1037 * semantics.c (potential_constant_expression_1): Use
1038 cxx_eval_outermost_constant_expr rather than maybe_constant_value.
1039
1040 PR c++/56243
1041 * call.c (build_over_call): Avoid virtual lookup in a template.
1042
1043 2013-02-27 Jason Merrill <jason@redhat.com>
1044
1045 PR c++/56358
1046 PR c++/56323
1047 * name-lookup.c (do_class_using_decl): Use ctor_identifier instead
1048 of the base name for inheriting ctors.
1049 (push_class_level_binding_1): Remove inheriting ctor handling.
1050 * pt.c (tsubst_decl) [USING_DECL]: Likewise.
1051 * class.c (add_implicitly_declared_members): Adjust.
1052
1053 2013-02-26 David Binderman <dcb314@hotmail.com>
1054
1055 PR c++/55632
1056 * decl.c (grokdeclarator): Tidy publicp assignment.
1057
1058 2013-02-25 Aldy Hernandez <aldyh@redhat.com>
1059
1060 PR c++/56419
1061 * semantics.c (begin_transaction_stmt): Set TREE_SIDE_EFFECTS.
1062 (build_transaction_expr): Same.
1063
1064 2013-02-25 Jason Merrill <jason@redhat.com>
1065
1066 PR c++/56377
1067 * pt.c (fn_type_unification): Wait to call push_tinst_level until
1068 we know what args we're looking at.
1069
1070 PR c++/56438
1071 * semantics.c (potential_constant_expression_1): In C++98, a cast
1072 to non-integral type can't be a constant expression.
1073
1074 2013-02-24 Jakub Jelinek <jakub@redhat.com>
1075
1076 PR c++/56403
1077 * init.c (build_zero_init_1): Use RECORD_OR_UNION_CODE_P instead
1078 of CLASS_TYPE_P.
1079
1080 2013-02-22 Jason Merrill <jason@redhat.com>
1081
1082 PR c++/40405
1083 * pt.c (push_template_decl_real): Set DECL_INTERFACE_KNOWN
1084 if we got the wrong number of template parms.
1085
1086 PR c++/56377
1087 * pt.c (fn_type_unification): Use explicit args in template
1088 instantiation context.
1089
1090 PR c++/56359
1091 * call.c (can_convert_arg): Discard access checks.
1092
1093 PR c++/56395
1094 * tree.c (strip_typedefs): Strip typedefs from TYPENAME_TYPE template
1095 args.
1096
1097 2013-02-20 Paolo Carlini <paolo.carlini@oracle.com>
1098
1099 PR c++/56373
1100 * tree.c (maybe_warn_zero_as_null_pointer_constant): Add.
1101 * cvt.c (ocp_convert): Use the latter.
1102 (cp_convert_to_pointer): Likewise.
1103 * decl.c (check_default_argument): Likewise.
1104 * typeck.c (cp_build_binary_op): Likewise.
1105 * cp-tree.h (maybe_warn_zero_as_null_pointer_constant): Declare.
1106
1107 2013-02-15 Jonathan Wakely <jwakely.gcc@gmail.com>
1108 Paolo Carlini <paolo.carlini@oracle.com>
1109
1110 PR c++/51242
1111 * decl2.c (grokbitfield): Allow scoped enumeration types.
1112
1113 2013-02-15 Jason Merrill <jason@redhat.com>
1114
1115 PR c++/54276
1116 * semantics.c (finish_id_expression): Also return the identifier
1117 for an outer local static.
1118
1119 PR c++/56343
1120 * class.c (check_bases_and_members): Deduce noexcept after
1121 checking bases.
1122
1123 PR c++/52026
1124 * semantics.c (finish_id_expression): In a template, return
1125 the identifier for a constant variable.
1126
1127 2013-02-14 Jason Merrill <jason@redhat.com>
1128
1129 PR c++/54922
1130 * semantics.c (build_anon_member_initialization): New.
1131 (build_data_member_initialization): Use it.
1132
1133 PR c++/55003
1134 * decl.c (cp_finish_decl): Force instantiation of an
1135 auto static data member.
1136
1137 PR c++/55220
1138 * pt.c (unify): A pack expansion that is not the last template
1139 argument makes the entire template argument list non-deduced.
1140
1141 PR c++/56323
1142 * name-lookup.c (do_class_using_decl): Handle typedefs with
1143 inheriting constructors.
1144 (push_class_level_binding_1): Allow inheriting from template
1145 template parameter, too.
1146 * pt.c (tsubst_decl) [USING_DECL]: Likewise.
1147
1148 PR c++/55223
1149 * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Fix handling of
1150 default argument scope.
1151 * mangle.c (write_name): Likewise.
1152
1153 PR c++/55232
1154 * error.c (find_typenames_r): Don't walk into a pack expansion.
1155
1156 2013-02-13 Jason Merrill <jason@redhat.com>
1157
1158 PR c++/55670
1159 * parser.c (cp_parser_member_declaration): Check the declarator
1160 form when detecting a function declaration via typedef.
1161
1162 PR c++/55680
1163 * pt.c (maybe_process_partial_specialization): A lambda
1164 isn't what's being specialized.
1165
1166 PR c++/55710
1167 * semantics.c (maybe_add_lambda_conv_op): Mark static thunk
1168 TREE_USED.
1169
1170 PR c++/55879
1171 * semantics.c (cxx_bind_parameters_in_call): Undo DECL_BY_REFERENCE.
1172
1173 PR c++/55993
1174 * semantics.c (cxx_fold_indirect_ref): Handle empty bases at
1175 non-zero offsets, too.
1176
1177 PR c++/56155
1178 * decl.c (build_enumerator): Always convert the value to a
1179 fixed underlying type.
1180
1181 PR c++/56135
1182 * pt.c (tsubst_copy_and_build): Don't forget any new
1183 captures that arose from use of dependent names.
1184
1185 2013-02-13 Jakub Jelinek <jakub@redhat.com>
1186
1187 PR c++/56302
1188 * semantics.c (finish_asm_stmt): If input constraints allow
1189 neither register nor memory, try maybe_constant_value to get
1190 a constant if possible.
1191
1192 2013-02-12 Jason Merrill <jason@redhat.com>
1193
1194 PR c++/56285
1195 * method.c (add_one_base_init): Handle base constructor
1196 taking rvalue reference parm.
1197
1198 PR c++/56291
1199 * semantics.c (sort_constexpr_mem_initializers): Handle
1200 vptr out of order.
1201
1202 2013-02-09 Jason Merrill <jason@redhat.com>
1203
1204 PR c++/56268
1205 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Call
1206 maybe_instantiate_noexcept.
1207
1208 PR c++/56247
1209 * pt.c (eq_specializations): Set comparing_specializations.
1210 * tree.c (cp_tree_equal): Check it.
1211 * cp-tree.h: Declare it.
1212
1213 * decl.c (decls_match): Check versions later.
1214
1215 PR c++/56238
1216 * pt.c (build_non_dependent_expr): Don't try to fold
1217 instantiation-dependent expressions.
1218 (instantiation_dependent_r) [TRAIT_EXPR]: Split out.
1219 [BIND_EXPR]: Treat as dependent.
1220
1221 2013-02-07 Jakub Jelinek <jakub@redhat.com>
1222
1223 PR c++/56241
1224 * init.c (build_vec_init): Don't append NULL values into new_vec.
1225 (build_zero_init_1): Don't push anything into v if recursive call
1226 returned NULL_TREE.
1227 (build_value_init_noctor): Don't push anything into v if
1228 build_value_init call returned NULL_TREE.
1229
1230 PR c++/56239
1231 * parser.c (cp_parser_token_starts_cast_expression): Renamed to...
1232 (cp_parser_tokens_start_cast_expression): ... this. Change parameter
1233 to cp_parser *, call cp_lexer_peek_token first. For CPP_OPEN_PAREN,
1234 return true only if 2nd token isn't CPP_CLOSE_PAREN.
1235 (cp_parser_cast_expression): Adjust caller.
1236
1237 PR c++/56237
1238 * decl.c (push_local_name): Look at DECL_DISCRIMINATOR (t)
1239 only if DECL_DISCRIMINATOR_SET_P (t) rather than just
1240 DECL_LANG_SPECIFIC (t).
1241
1242 2013-02-07 Jason Merrill <jason@redhat.com>
1243
1244 PR c++/56235
1245 * method.c (do_build_copy_constructor): Don't bother turning
1246 scalars from lvalues to xvalues.
1247 (do_build_copy_assign): Likewise.
1248
1249 2013-02-06 Jason Merrill <jason@redhat.com>
1250
1251 * parser.c (cp_parser_enum_specifier): Check for error_mark_node.
1252
1253 2013-02-05 Jason Merrill <jason@redhat.com>
1254
1255 PR c++/54122
1256 * tree.c (lvalue_kind) [INDIRECT_REF]: Don't check for
1257 METHOD_TYPE.
1258
1259 PR c++/56177
1260 * decl.c (start_preparsed_function): Update restype if we change
1261 decl1.
1262
1263 PR c++/56208
1264 * pt.c (fn_type_unification): Discard any access checks from
1265 substituting explicit args.
1266
1267 2013-01-31 Jason Merrill <jason@redhat.com>
1268
1269 PR c++/56162
1270 PR c++/56104
1271 * typeck.c (get_member_function_from_ptrfunc): Fix
1272 ptrmemfunc_vbit_in_delta case.
1273
1274 2013-01-29 Jason Merrill <jason@redhat.com>
1275
1276 PR libstdc++/54314
1277 * class.c (build_ctor_vtbl_group): Give construction vtables
1278 hidden visibility.
1279
1280 2013-01-25 Jason Merrill <jason@redhat.com>
1281
1282 PR c++/56095
1283 * pt.c (convert_nontype_argument_function): Handle invalid input.
1284 (convert_nontype_argument): Likewise.
1285
1286 PR c++/56104
1287 * typeck.c (get_member_function_from_ptrfunc): Optimize if the
1288 dynamic type has no virtual functions.
1289
1290 2013-01-22 Paolo Carlini <paolo.carlini@oracle.com>
1291
1292 PR c++/55944
1293 * decl.c (check_initializer): Use TARGET_EXPR_DIRECT_INIT_P only
1294 on TARGET_EXPR nodes.
1295
1296 2013-01-22 Jason Merrill <jason@redhat.com>
1297
1298 PR c++/56071
1299 * pt.c (maybe_instantiate_noexcept): Don't defer access checks.
1300
1301 2013-01-22 Dodji Seketeli <dodji@redhat.com>
1302
1303 PR c++/53609
1304 * pt.c (argument_pack_element_is_expansion_p)
1305 (make_argument_pack_select, use_pack_expansion_extra_args_p)
1306 (gen_elem_of_pack_expansion_instantiation): New static functions.
1307 (tsubst): When looking through an ARGUMENT_PACK_SELECT tree node,
1308 look through the possibly resulting pack expansion as well.
1309 (tsubst_pack_expansion): Use use_pack_expansion_extra_p to
1310 generalize when to use the PACK_EXPANSION_EXTRA_ARGS mechanism.
1311 Use gen_elem_of_pack_expansion_instantiation to build the
1312 instantiation piece-wise. Don't use arg_from_parm_pack_p anymore,
1313 as gen_elem_of_pack_expansion_instantiation and the change in
1314 tsubst above generalize this particular case.
1315 (arg_from_parm_pack_p): Remove this for it's not used by
1316 tsubst_pack_expansion anymore.
1317
1318 2013-01-21 Jason Merrill <jason@redhat.com>
1319
1320 PR c++/56059
1321 * tree.c (strip_typedefs_expr) [TREE_VEC]: Preserve non-default
1322 template args count.
1323
1324 2013-01-18 Jason Merrill <jason@redhat.com>
1325
1326 PR target/54908
1327 * decl2.c (get_local_tls_init_fn): New.
1328 (get_tls_init_fn): Handle flag_extern_tls_init. Don't bother
1329 with aliases for internal variables. Don't use weakrefs if
1330 the variable needs destruction.
1331 (generate_tls_wrapper): Mark the wrapper as const if no
1332 initialization is needed.
1333 (handle_tls_init): Don't require aliases.
1334
1335 2013-01-15 Dodji Seketeli <dodji@redhat.com>
1336
1337 PR c++/55663
1338 * pt.c (coerce_innermost_template_parms): New static function.
1339 (instantiate_alias_template): Use it here.
1340
1341 2013-01-09 Jason Merrill <jason@redhat.com>
1342
1343 PR c++/55878
1344 * rtti.c (build_typeid, get_typeid): Add complain parm.
1345 (get_tinfo_decl_dynamic): Likewise.
1346 * cp-tree.h, parser.c, pt.c: Adjust.
1347
1348 PR c++/55893
1349 * decl.c (cp_finish_decl): Clear TREE_READONLY if the variable
1350 needs destruction.
1351
1352 2013-01-09 Jakub Jelinek <jakub@redhat.com>
1353
1354 PR c/48418
1355 * typeck.c (cp_build_binary_op): For LSHIFT_EXPR and RSHIFT_EXPR,
1356 call maybe_constant_value for the negative or too big shift
1357 count warnings.
1358
1359 2013-01-09 Paolo Carlini <paolo.carlini@oracle.com>
1360
1361 PR c++/55801
1362 * decl2.c (var_needs_tls_wrapper): Return false when error_operand_p
1363 of the argument is true.
1364
1365 2013-01-08 Joel Brobecker <brobecker@adacore.com>
1366
1367 * parser.c (cp_parser_initializer_list): Move declaration
1368 of variable non_const to start of lexical block.
1369
1370 2013-01-07 Jason Merrill <jason@redhat.com>
1371
1372 PR c++/55753
1373 * tree.c (build_aggr_init_expr): Do nothing in a template.
1374 * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Strip an ADDR_EXPR off
1375 a FUNCTION_DECL before tsubsting.
1376
1377 2013-01-04 Dodji Seketeli <dodji@redhat.com>
1378
1379 PR c++/52343
1380 * pt.c (check_instantiated_arg): Allow type template arguments.
1381
1382 2013-01-04 Jason Merrill <jason@redhat.com>
1383
1384 PR c++/55877
1385 * decl.c (reset_type_linkage, bt_reset_linkage): New.
1386 (grokdeclarator): Use reset_type_linkage.
1387 * name-lookup.c (binding_table_foreach): Handle null table.
1388 * tree.c (decl_anon_ns_mem_p): Check TYPE_MAIN_DECL, not TYPE_NAME.
1389
1390 2013-01-04 Paolo Carlini <paolo.carlini@oracle.com>
1391
1392 PR c++/54526 (again)
1393 * parser.c (cp_parser_template_id): Revert core of previous change
1394 (keep adjusted inform message).
1395
1396 2013-01-03 Jason Merrill <jason@redhat.com>
1397
1398 PR c++/55419
1399 PR c++/55753
1400 * pt.c (tsubst_copy_and_build) [TARGET_EXPR]: Don't touch
1401 TREE_CONSTANT.
1402
1403 PR c++/55842
1404 * semantics.c (trait_expr_value): Call maybe_instantiate_noexcept.
1405
1406 PR c++/55856
1407 * semantics.c (build_data_member_initialization): Handle DECL_EXPR.
1408
1409 PR c++/53650
1410 * call.c (type_has_extended_temps): New.
1411 * cp-tree.h: Declare it.
1412 * decl.c (check_initializer): Use build_aggr_init for arrays
1413 if it is false.
1414 * init.c (build_vec_init): Avoid mixed signed/unsigned arithmetic.
1415
1416 2013-01-02 Jason Merrill <jason@redhat.com>
1417
1418 PR c++/54325
1419 * call.c (build_new_method_call_1): Don't use build_value_init for
1420 user-provided default constructors.
1421
1422 * decl.c (check_default_argument): Use LOOKUP_IMPLICIT.
1423
1424 PR c++/55032
1425 PR c++/55245
1426 * tree.c (build_cplus_array_type): Copy layout information
1427 to main variant if necessary.
1428 \f
1429 Copyright (C) 2013 Free Software Foundation, Inc.
1430
1431 Copying and distribution of this file, with or without modification,
1432 are permitted in any medium without royalty provided the copyright
1433 notice and this notice are preserved.