1 2013-04-11 Jason Merrill <jason@redhat.com>
4 * pt.c (uses_deducible_template_parms): New.
5 (deducible_array_bound, deducible_expression): New.
6 (deducible_template_args): New.
7 (unify_one_argument): Call uses_deducible_template_parms.
9 2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
12 * typeck2.c (build_m_component_ref): Protect error calls with
13 (complain & tf_error).
15 2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
18 * parser.c (cp_parser_enum_specifier): Check for empty
19 anonymous enums and anonymous scoped enums.
21 2013-04-10 Jakub Jelinek <jakub@redhat.com>
24 * typeck.c (cp_build_binary_op): Call fold_non_dependent_expr_sfinae
25 first before calling maybe_constant_value for warn_for_div_by_zero
26 or invalid shift count warning purposes.
28 2013-04-09 Jason Merrill <jason@redhat.com>
31 * rtti.c (build_typeid): Check the address of the argument
32 rather than looking for an INDIRECT_REF.
34 2013-04-04 Jason Merrill <jason@redhat.com>
38 * typeck2.c (abstract_virtuals_error_sfinae): Disable
41 2013-04-08 Paolo Carlini <paolo.carlini@oracle.com>
44 * decl.c (validate_constexpr_redeclaration): Allow an explicit
45 specialization to be different wrt the constexpr specifier.
47 2013-04-06 Jason Merrill <jason@redhat.com>
49 * parser.c (cp_parser_std_attribute): Treat [[noreturn]] like GNU
52 2013-04-05 Ed Smith-Rowland <3dw4rd@verizon.net>
54 * parser.c (cp_parser_ref_qualifier_seq_opt): Move to
55 cp_parser_ref_qualifier_opt. Error if more than one ref-qual found.
57 2013-04-03 Jason Merrill <jason@redhat.com>
59 * cp-tree.h (FUNCTION_OR_METHOD_TYPE_CHECK): Remove.
60 (TYPE_RAISES_EXCEPTIONS): Use FUNC_OR_METHOD_CHECK instead.
61 (FUNCTION_REF_QUALIFIED, FUNCTION_RVALUE_QUALIFIED): Likewise.
63 * mangle.c (write_type): When writing a function type with
64 function-cv-quals, don't add the unqualified type as a
65 substitution candidate.
67 2013-04-03 Paolo Carlini <paolo.carlini@oracle.com>
70 * typeck.c (cp_build_unary_op): Change -Wpointer-arith permerror to
73 2013-04-03 Jakub Jelinek <jakub@redhat.com>
76 * tree.c (strip_typedefs): Copy NON_DEFAULT_TEMPLATE_ARGS_COUNT
77 from args to new_args.
78 (strip_typedefs_expr): Copy NON_DEFAULT_TEMPLATE_ARGS_COUNT from t to
79 r instead of doing {S,G}ET_NON_DEFAULT_TEMPLATE_ARGS_COUNT.
81 2013-04-02 Jason Merrill <jason@redhat.com>
84 * mangle.c (write_function_type): Mangle ref-qualifier.
85 (write_nested_name): Likewise.
86 (canonicalize_for_substitution): Preserve ref-qualifier.
87 (write_type): Likewise.
90 * decl.c (begin_destructor_body): Clobber the object in a cleanup.
92 2013-04-02 Paolo Carlini <paolo.carlini@oracle.com>
94 * friend.c (do_friend): Use COMPLETE_OR_OPEN_TYPE_P.
95 * pt.c (find_parameter_packs_r): Use TYPE_ALIAS_P and TYPE_TI_ARGS.
96 (for_each_template_parm_r): Use TYPE_TI_ARGS.
98 2013-04-02 Paolo Carlini <paolo.carlini@oracle.com>
100 * cp-tree.h (TAGGED_TYPE_P): Remove.
101 (IS_OVERLOAD_TYPE): Rename to OVERLOAD_TYPE_P, adjust.
102 (TYPE_ANONYMOUS_P): Adjust.
103 * call.c (build_new_op_1): Likewise.
104 * class.c (find_abi_tags_r): Likewise.
105 * decl.c (warn_misplaced_attr_for_class_type, start_decl,
106 type_is_deprecated): Likewise.
107 * decl2.c (grokfield, min_vis_r): Likewise.
108 * pt.c (get_template_info): Likewise.
109 * tree.c (handle_abi_tag_attribute): Likewise.
111 2013-04-01 Jason Merrill <jason@redhat.com>
113 * semantics.c (maybe_constant_value): Check
114 instantiation_dependent_expression_p.
115 * pt.c (build_non_dependent_expr): Don't check it here.
118 * init.c (build_new): Don't try to process an array initializer
119 at template definition time.
122 * typeck.c (finish_class_member_access_expr): Handle enum scope.
125 * parser.c (cp_parser_range_for): Don't try to do auto deduction
126 in a template if the type of the range is incomplete.
128 * call.c (add_function_candidate): Take the address of 'this' here.
129 (build_over_call): And here.
130 (build_new_method_call_1, build_op_call_1): Not here.
131 (build_user_type_conversion_1): Or here.
132 (add_candidates): Adjust.
134 * cxx-pretty-print.h (pp_cxx_cv_qualifiers): New.
135 * class.c (same_signature_p): Use type_memfn_quals.
136 * cp-tree.h (TYPE_RAISES_EXCEPTIONS): Use
137 FUNCTION_OR_METHOD_TYPE_CHECK.
138 * error.c (dump_type_suffix): Add padding before cv-qualifiers.
139 * pt.c (unify): Use static_fn_type.
141 2013-04-01 Bronek Kozicki <b.kozicki@gmail.com>
142 Jason Merrill <jason@redhat.com>
144 Implement N2439 (ref-qualifiers for 'this')
145 * cp-tree.h (FUNCTION_REF_QUALIFIED): New.
146 (FUNCTION_RVALUE_QUALIFIED): New.
147 (FUNCTION_OR_METHOD_TYPE_CHECK): New.
148 (cpp0x_warn_str): Add CPP0X_REF_QUALIFIER.
149 (cp_ref_qualifier): New enum.
150 (cp_declarator): Add ref_qualifier.
151 * parser.c (cp_parser_ref_qualifier_seq_opt): New.
152 (cp_parser_direct_declarator): Use it.
153 (make_call_declarator): Adjust.
154 (cp_parser_lambda_declarator_opt): Adjust.
155 * call.c (add_function_candidate): Handle ref-qualifier overload
156 resolution semantics.
157 (standard_conversion): Adjust.
158 * class.c (add_method, same_signature_p): Compare ref-qualifiers.
159 * decl.c (grokdeclarator): Handle ref-qualifiers.
160 (grokfndecl): Check for invalid ref-qualifiers.
161 (static_fn_type, revert_static_member_fn): Adjust.
162 * decl2.c (build_memfn_type): Handle ref-qualifiers.
163 (check_classfn): Check them.
164 (cp_reconstruct_complex_type): Retain them.
165 * error.c (dump_ref_qualifier): New.
166 (dump_type_suffix, dump_function_decl): Use it.
167 (maybe_warn_cpp0x): Handle CPP0X_REF_QUALIFIER.
168 * pt.c (tsubst, tsubst_function_type): Instantiate ref-quals.
169 (unify): Retain them.
170 * tree.c (cp_check_qualified_type): New.
171 (cp_build_qualified_type_real): Keep exception spec and ref-qual.
172 (build_ref_qualified_type): New.
173 (strip_typedefs, build_exception_variant): Keep ref-qualifier.
174 (cp_build_type_attribute_variant): Keep ref-qualifier.
175 * typeck.c (merge_types): Keep ref-qualifier.
176 (structural_comptypes): Compare ref-qualifier.
177 (type_memfn_rqual): New.
178 (apply_memfn_quals): Take ref-qual argument.
179 * typeck2.c (build_m_component_ref): Check ref-qualifier.
181 2013-04-01 Paolo Carlini <paolo.carlini@oracle.com>
183 * cp-tree.h (DECL_UNBOUND_CLASS_TEMPLATE_P): Remove.
184 (DECL_FUNCTION_TEMPLATE_P): Adjust.
186 * cxx-pretty-print.c (pp_cxx_nested_name_specifier,
187 pp_cxx_qualified_id): Use get_containing_scope.
188 * parser.c (cp_parser_class_head): Likewise.
189 * pt.c (push_template_decl_real): Likewise.
191 * decl2.c (import_export_decl): Use DECL_TEMPLOID_INSTANTIATION.
192 * pt.c (unify): Use CP_INTEGRAL_TYPE_P.
194 2013-03-31 Paolo Carlini <paolo.carlini@oracle.com>
196 * decl2.c (collect_candidates_for_java_method_aliases): Use
198 * name-lookup.c (pushtag_1) Use TYPE_FUNCTION_SCOPE_P.
199 (pushdecl_maybe_friend_1): Use DECL_DECLARES_FUNCTION_P.
200 * decl.c (duplicate_decls): Likewise.
201 * parser.c (cp_parser_template_declaration_after_export): Likewise,
202 also DECL_DECLARES_TYPE_P.
203 * pt.c (instantiate_class_template_1): Likewise.
204 * search.c (lookup_field_1): Use DECL_DECLARES_TYPE_P.
205 (lookup_field_r): Likewise.
206 (friend_accessible_p): Use DECL_DECLARES_FUNCTION_P.
207 (lookup_fnfields_slot_nolazy): Likewise.
208 * semantics.c (finish_member_declaration): Likewise.
209 * typeck.c (convert_for_initialization): Use TYPE_REFFN_P.
211 2013-03-29 Gabriel Dos Reis <gdr@integrable-solutions.net>
213 * pt.c (template_parms_to_args): Fix typo in comment.
215 2013-03-29 Paolo Carlini <paolo.carlini@oracle.com>
217 * call.c (build_op_call_1): Use TYPE_PTRFN_P and TYPE_REFFN_P.
219 2013-03-29 Paolo Carlini <paolo.carlini@oracle.com>
221 * call.c (add_builtin_candidate): Use TYPE_PTR_P and VOID_TYPE_P.
222 (build_op_call_1): Likewise.
223 (build_over_call): Likewise.
224 (compare_ics): Likewise.
225 * class.c (build_base_path): Likewise.
226 (resolve_address_of_overloaded_function): Likewise.
227 * cp-tree.h: Likewise.
228 * cvt.c (cp_convert_to_pointer): Likewise.
229 (convert_to_reference): Likewise.
230 (ocp_convert): Likewise.
231 (convert_force): Likewise, tidy.
232 * cxx-pretty-print.c (pp_cxx_postfix_expression): Likewise.
233 (pp_cxx_ptr_operator): Likewise.
234 * decl.c (duplicate_decls): Likewise.
235 (start_decl): Likewise.
236 (grok_op_properties): Likewise.
237 (start_preparsed_function): Likewise.
238 (store_parm_decls): Likewise.
239 (finish_function): Likewise.
240 * decl2.c (delete_sanity): Likewise.
241 (acceptable_java_type): Likewise.
242 (grokbitfield): Likewise.
243 (cp_reconstruct_complex_type): Likewise.
244 * error.c (dump_type_prefix): Likewise.
245 (dump_expr): Likewise.
246 * except.c (push_eh_cleanup): Likewise.
247 (complete_ptr_ref_or_void_ptr_p): Likewise.
248 (can_convert_eh): Likewise.
249 * init.c (build_new_1): Likewise.
250 (build_delete): Likewise.
251 (build_vec_delete): Likewise.
252 * mangle.c (write_type): Likewise.
253 * parser.c (lookup_literal_operator): Likewise.
254 * pt.c (convert_nontype_argument_function): Likewise.
255 (convert_nontype_argument): Likewise.
258 (dependent_type_p_r): Likewise.
259 * rtti.c (build_headof): Likewise.
260 (build_typeid): Likewise.
261 (build_dynamic_cast_1): Likewise.
262 (target_incomplete_p): Likewise.
263 (typeinfo_in_lib_p): Likewise.
264 * semantics.c (finish_omp_for): Likewise.
265 (cxx_eval_call_expression): Likewise.
266 (maybe_resolve_dummy): Likewise.
267 * tree.c (build_target_expr): Likewise.
268 (cp_build_qualified_type_real): Likewise.
269 * typeck.c (composite_pointer_type_r): Likewise.
270 (composite_pointer_type): Likewise.
271 (comp_except_types): Likewise.
272 (cxx_sizeof_nowarn): Likewise.
273 (string_conv_p): Likewise.
274 (cp_build_array_ref): Likewise.
275 (cp_build_function_call_vec): Likewise, also use TYPE_PTRFN_P.
276 (pointer_diff): Likewise.
277 (cp_build_addr_expr_1): Likewise.
278 (cp_build_unary_op): Likewise.
279 (build_static_cast_1): Likewise.
280 (cp_build_c_cast): Likewise.
281 (comp_ptr_ttypes_real): Likewise.
282 (ptr_reasonably_similar): Likewise.
283 (comp_ptr_ttypes_const): Likewise.
284 (casts_away_constness): Likewise.
285 (check_literal_operator_args): Likewise.
286 * typeck2.c (build_x_arrow): Likewise.
287 (add_exception_specifier): Likewise.
289 2013-03-29 Jason Merrill <jason@redhat.com>
292 * cp-tree.h (AUTO_IS_DECLTYPE): New.
293 * parser.c (cp_parser_decltype): Handle decltype(auto).
294 (cp_parser_type_id_1): Allow auto without a late-specified
296 (cp_parser_primary_expression): Use the return value of
297 finish_parenthesized_expr.
298 (cp_parser_transaction_expression): Likewise.
299 * semantics.c (force_paren_expr): New.
300 (finish_parenthesized_expr): Use it.
301 * call.c (build_conditional_expr_1): Likewise.
302 * pt.c (do_auto_deduction): Handle decltype(auto).
303 (tsubst_copy): Handle PAREN_EXPR.
304 (tsubst_copy_and_build): Likewise.
305 * error.c (dump_expr): Handle PAREN_EXPR.
306 * cxx-pretty-print.c (pp_cxx_expression): Likewise.
307 * mangle.c (write_expression): Ignore PAREN_EXPR.
309 * parser.c (cp_parser_decltype_expr): Split out...
310 (cp_parser_decltype): ...from here.
314 * pt.c (unify_pack_expansion): Fix indexing.
316 2013-03-29 Gabriel Dos Reis <gdr@integrable-solutions.net>
318 * call.c (build_java_interface_fn_ref): Likewise.
319 (make_temporary_var_for_ref_to_temp): Likewise.
320 * class.c (check_field_decls): Likewise.
321 (layout_class_type): Likewise.
322 (finish_struct_1): Likewise.
323 (fixed_type_or_null): Likewise.
324 (get_vtbl_decl_for_binfo): Likewise.
325 * cp-gimplify.c (omp_var_to_track): Likewise.
326 (cp_genericize_r): Likewise.
327 * cp-objcp-common.c (cxx_warn_unused_global_decl): Likewise.
328 * cp-tree.h (LANG_DECL_HAS_MIN): Likewise.
329 (DECL_DISCRIMINATOR_P): Likewise.
330 * decl.c (poplevel): Likewise.
331 (decls_match): Likewise.
332 (duplicate_decls): Likewise.
333 (decl_jump_unsafe): Likewise.
334 (start_decl): Likewise.
335 (check_for_uninitialized_const_var): Likewise.
336 (make_rtl_for_nonlocal_decl): Likewise.
337 (cp_finish_decl): Likewise.
338 (expand_static_init): Likewise.
339 (local_variable_p): Likewise.
340 (maybe_register_incomplete_var): Likewise.
341 * decl2.c (grokfield): Likewise.
342 (comdat_linkage): Likewise.
343 (determine_visibility): Likewise.
344 (import_export_decl): Likewise.
345 (prune_vars_needing_no_initialization): Likewise.
346 (decl_maybe_constant_var_p): Likewise.
347 * error.c (dump_simple_decl): Likewise.
348 (dump_template_decl): Likewise.
349 (cp_printer): Likewise.
350 * except.c (build_throw): Likewise.
351 * init.c (build_vtbl_address): Likewise.
352 (member_init_ok_or_else): Likewise.
353 (build_aggr_init): Likewise.
354 (expand_aggr_init_1): Likewise.
355 (build_offset_ref): Likewise.
356 (constant_value_1): Likewise.
357 * mangle.c (write_mangled_name): Likewise.
358 (write_prefix): Likewise.
359 * name-lookup.c (supplement_binding_1): Likewise.
360 (add_decl_to_level): Likewise.
361 (pushdecl_maybe_friend_1): Likewise.
362 (check_for_out_of_scope_variable): Likewise.
363 (validate_nonmember_using_decl): Likewise.
364 (lookup_name_innermost_nonclass_level_1): Likewise.
365 (lookup_arg_dependent_1): Likewise.
366 * parser.c (cp_parser_lambda_introducer): Likewise.
367 (cp_parser_template_argument): Likewise.
368 (cp_parser_single_declaration): Likewise.
369 * pt.c (convert_nontype_argument): Likewise.
370 (instantiate_class_template_1): Likewise.
371 (tsubst_decl): Likewise.
372 (tsubst_expr): Likewise.
373 (do_decl_instantiation): Likewise.
374 (do_type_instantiation): Likewise.
375 (regenerate_decl_from_template): Likewise.
376 (always_instantiate_p): Likewise.
377 (instantiate_decl): Likewise.
378 (type_dependent_expression_p): Likewise.
379 (build_non_dependent_expr): Likewise.
380 * repo.c (repo_emit_p): Likewise.
381 * rtti.c (build_dynamic_cast_1): Likewise.
382 * search.c (shared_member_p): Likewise.
383 * semantics.c (outer_var_p): Likewise.
384 (finish_id_expression): Likewise.
385 (finish_omp_clauses): Likewise.
386 (finish_decltype_type): Likewise.
387 (ensure_literal_type_for_constexpr_object): Likewise.
388 * tree.c (lvalue_kind): Likewise.
389 (bot_replace): Likewise.
390 (cp_tree_equal): Likewise.
391 (handle_init_priority_attribute): Likewise.
392 (decl_storage_duration): Likewise.
393 * typeck.c (cxx_sizeof_expr): Likewise.
394 (cxx_alignof_expr): Likewise.
395 (decay_conversion): Likewise.
396 (build_class_member_access_expr): Likewise.
397 (cp_build_array_ref): Likewise.
398 (cxx_mark_addressable): Likewise.
399 (maybe_warn_about_returning_address_of_local): Likewise.
400 (check_return_expr): Likewise.
401 * typeck2.c (cxx_readonly_error): Likewise.
402 (abstract_virtuals_error_sfinae): Likewise.
403 (cxx_incomplete_type_diagnostic): Likewise.
405 2013-03-28 Lawrence Crowl <crowl@google.com>
408 (CXX_PARSER_H): Add header dependence.
410 (extern debug (cp_binding_level &)): New.
411 (extern debug (cp_binding_level *)): New.
413 (debug (cp_binding_level &)): New.
414 (debug (cp_binding_level *)): New.
416 (debug (cp_parser &)): New.
417 (debug (cp_parser *)): New.
418 (debug (cp_token &)): New.
419 (debug (cp_token *)): New.
420 (debug (vec<cp_token, va_gc> &)): New.
421 (debug (vec<cp_token, va_gc> *)): New.
422 * parser.c: Add header dependence.
423 (extern debug (cp_parser &)): New.
424 (extern debug (cp_parser *)): New.
425 (extern debug (cp_token &)): New.
426 (extern debug (cp_token *)): New.
427 (extern debug (vec<cp_token, va_gc> &)): New.
428 (extern debug (vec<cp_token, va_gc> *)): New.
430 2013-03-28 Jason Merrill <jason@redhat.com>
434 * typeck2.c (abstract_virtuals_error_sfinae): Don't complete
435 the type if tf_decltype is set.
436 * pt.c (fn_type_unification): Add decltype_p parm.
437 (get_bindings): Adjust.
439 * class.c (resolve_address_of_overloaded_function): Adjust.
440 * call.c (add_template_candidate_real, print_z_candidate): Adjust.
443 * parser.c (cp_parser_sizeof_pack): Split out from...
444 (cp_parser_sizeof_operand): ...here. Require (id).
447 * semantics.c (finish_this_expr): 'this' is an rvalue.
448 * typeck.c (cp_build_indirect_ref): Handle NOP_EXPR of 'this'.
451 * semantics.c (finish_member_declaration): Don't push closure
454 * name-lookup.c (pushdecl_maybe_friend_1): Use
455 nonlambda_method_basetype and current_nonlambda_class_type.
458 * semantics.c (potential_constant_expression_1) [NOP_EXPR]: Reject
459 conversion from integer to pointer.
460 (cxx_eval_constant_expression): Likewise.
461 (cxx_eval_indirect_ref): Use the folded operand if we still think
462 this might be constant.
464 2013-03-28 Paolo Carlini <paolo.carlini@oracle.com>
465 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
468 * call.c (convert_like_real): Change series of two permerrors
469 to permerror + inform (and likewise for two errors).
470 (build_new_method_call_1): Likewise.
471 * typeck.c (convert_for_initialization): Change additional
472 warning or error to inform.
474 2013-03-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
476 * cp-tree.h (next_aggr_init_expr_arg): Remove static specifier.
477 (first_aggr_init_expr): Likewise.
478 (more_aggr_init_expr_args_p): Likewise.
479 (type_of_this_parm): Likewise.
480 (class_of_this_parm): Likewise.
481 * name-lookup.h (get_global_value_if_present): Likewise.
482 (is_typename_at_global_scope): Likewise.
484 2013-03-28 Paolo Carlini <paolo.carlini@oracle.com>
486 * call.c (joust): Don't call inform for a permerror returning false.
487 * parser.c (cp_parser_check_class_key): Likewise.
488 * pt.c (tsubst_copy_and_build): Likewise.
490 2013-03-27 Jason Merrill <jason@redhat.com>
493 * semantics.c (finish_qualified_id_expr): Return early
496 2013-03-26 Gabriel Dos Reis <gdr@integrable-solutions.net>
498 * call.c (build_new_method_call_1): Use INDIRECT_REF_P.
499 * cvt.c (convert_to_void): Likewise.
500 * error.c (dump_expr): Likewise.
501 * mangle.c (write_expression): Likewise.
502 * parser.c (cp_parser_template_argument): Likewise.
503 * pt.c (convert_nontype_argument): Likewise.
504 (tsubst_copy_and_build): Likewise.
505 * rtti.c (build_typeid): Likewise.
506 * semantics.c (finish_call_expr): Likewise.
507 (finish_decltype_type): Likewise.
508 (build_data_member_initialization): Likewise.
509 * tree.c (is_dummy_object): Likewise.
510 * typeck.c (decay_conversion): Likewise.
511 (build_class_member_access_expr): Likewise.
512 (cp_build_addr_expr_1): Likewise.
513 (unary_complex_lvalue): Likewise.
514 (check_return_expr): Likewise.
515 * typeck2.c (cxx_readonly_error): Likewise.
517 2013-03-26 Jason Merrill <jason@redhat.com>
520 * typeck.c (invalid_nonstatic_memfn_p): Use get_first_fn. Take tree.
521 * semantics.c (finish_decltype_type): Check it before type_unknown_p.
522 * cp-tree.h: Adjust prototype.
525 * typeck2.c (build_m_component_ref): Handle prvalue object.
527 2013-03-26 Gabriel Dos Reis <gdr@integrable-solutions.net>
529 * cp-gimplify.c (cp_genericize_r): Use VAR_OR_FUNCTION_DECL_P.
530 * decl.c (duplicate_decls): Likewise.
531 (cp_finish_decl): Likewise.
532 (check_class_member_definition_namespace): Likewise.
533 * decl2.c (grokfield): Likewise.
534 (decl_needed_p): Likewise.
535 (import_export_decl): Likewise.
536 (mark_used): Likewise.
537 * name-lookup.c (pushdecl_maybe_friend_1): Likewise.
538 * pt.c (push_access_scope): Likewise.
539 (instantiate_decl): Likewise.
540 * ptree.c (cxx_print_decl): Likewise.
541 * repo.c (repo_emit_p): Likewise.
542 * semantics.c (note_decl_for_pch): Likewise.
543 * tree.c (decl_linkage): Likewise.
545 2013-03-26 Paolo Carlini <paolo.carlini@oracle.com>
548 * decl.c (check_array_designated_initializer): Handle CONST_DECL
551 2013-03-26 Paolo Carlini <paolo.carlini@oracle.com>
553 * decl.c (grokfndecl): Handle separately <inline> and <constexpr>
556 * decl.c (grokdeclarator): Declare typedef_p and use it everywhere.
558 2013-03-25 Jason Merrill <jason@redhat.com>
561 * semantics.c (maybe_resolve_dummy): Make sure that the enclosing
562 class is derived from the type of the object.
565 * semantics.c (lambda_expr_this_capture): Don't capture 'this' in
568 2013-03-25 Paolo Carlini <paolo.carlini@oracle.com>
571 * decl.c (cp_finish_decl): Check DECL_LANG_SPECIFIC before
572 DECL_TEMPLATE_INSTANTIATION.
574 2013-03-22 Jason Merrill <jason@redhat.com>
577 * pt.c (instantiation_dependent_r): Check DECL_INITIAL of VAR_DECL
580 2013-03-21 Gabriel Dos Reis <gdr@integrable-solutions.net>
582 * cp-tree.h (identifier_p): New.
583 * call.c: Throughout, call identifier_p insstead of direct
584 comparaison of TREE_CODE against IDENTIFIER_NODE.
588 * mangle.c: Likewise.
589 * name-lookup.c: Likewise.
590 * parser.c: Likewise.
592 * search.c: Likewise.
593 * semantics.c: Likewise.
595 * typeck.c: Likewise.
596 * typeck2.c: Likewise.
598 2013-03-21 Jakub Jelinek <jakub@redhat.com>
601 * pt.c (convert_nontype_argument): Count werrorcount as warnings.
602 * call.c (build_temp): Likewise.
603 * method.c (synthesize_method): Likewise.
604 * typeck.c (convert_for_initialization): Likewise.
606 2013-03-21 Marc Glisse <marc.glisse@inria.fr>
608 * call.c (build_conditional_expr_1): Fold VEC_COND_EXPR.
610 2013-03-21 Richard Biener <rguenther@suse.de>
612 * error.c (cp_printer): Use DECL_HAS_DEBUG_EXPR_P instead of
613 DECL_DEBUG_EXPR_IS_FROM. Guard properly.
615 2013-03-20 Jason Merrill <jason@redhat.com>
618 * parser.c (cp_parser_late_return_type_opt): Save and restore
619 current_class_ptr/ref.
622 * expr.c (cplus_expand_constant): Do nothing if the class is
624 * semantics.c (reduced_constant_expression_p): Allow PTRMEM_CST.
625 * typeck2.c (store_init_value): Use reduced_constant_expression_p.
626 * decl.c (maybe_register_incomplete_var): Handle PTRMEM_CST.
627 (complete_vars): Likewise.
629 * name-lookup.c (get_anonymous_namespace_name): Never use
630 get_file_function_name.
632 * pt.c (retrieve_specialization): Handle null tmpl argument.
636 * pt.c (tsubst_decl): Check return value of register_specialization.
637 * typeck2.c (abstract_virtuals_error_sfinae): Re-apply complete_type
640 2013-03-17 Jason Merrill <jason@redhat.com>
644 * parser.c (cp_parser_direct_declarator): Bail if we see a
645 qualified-id not at namespace scope.
649 * typeck2.c (abstract_virtuals_error_sfinae): Revert complete_type
652 2013-03-16 Jason Merrill <jason@redhat.com>
654 * decl.c (grokdeclarator): Assert that we won't see a pointer to
658 * cp-tree.h (WILDCARD_TYPE_P): Split out from...
659 (MAYBE_CLASS_TYPE_P): ...here.
660 * semantics.c (lambda_capture_field_type): Only build a
661 magic decltype for wildcard types.
662 (lambda_proxy_type): Likewise.
663 (finish_non_static_data_member): Get the quals from
667 * parser.c (cp_parser_template_argument): Don't
668 fold_non_dependent_expr.
670 * parser.c (cp_parser_lambda_declarator_opt): Use
671 cp_parser_trailing_type_id.
674 * parser.c (cp_parser_template_id): Don't forget access checks.
677 * pt.c (tsubst_qualified_id): Use current_nonlambda_class_type.
681 * name-lookup.h (tag_scope): Add ts_lambda.
682 * semantics.c (begin_lambda_type): Use it.
683 * decl.c (xref_tag_1): Set CLASSTYPE_LAMBDA_EXPR.
684 * pt.c (check_default_tmpl_args): Ignore lambdas.
685 (push_template_decl_real): Handle lambdas.
686 * tree.c (no_linkage_check): Adjust lambda check.
689 * tree.c (strip_typedefs_expr): Complain about lambda, don't abort.
692 * parser.c (cp_parser_direct_declarator): Fix late return
693 for out-of-class defn of member function.
696 * semantics.c (maybe_add_lambda_conv_op): Clear DECL_NAME of copied
697 parms to avoid duplicate -Wshadow warnings.
699 * search.c (lookup_base): Handle NULL_TREE.
702 * semantics.c (potential_constant_expression_1): Use of 'this' in
703 a non-constexpr function makes the expression not potentially
708 * cp-tree.h (tsubst_flags): Add tf_decltype.
709 * call.c (build_cxx_call): Don't build a temporary if it's set.
710 (build_over_call): Make sure it's only passed to build_cxx_call.
711 * parser.c (cp_parser_primary_expression): Add decltype_p parm.
712 (cp_parser_unary_expression): Likewise.
713 (cp_parser_cast_expression): Likewise.
714 (cp_parser_binary_expression): Likewise.
715 (cp_parser_assignment_expression): Likewise.
716 (cp_parser_postfix_expression): Likewise. Pass tf_decltype.
717 (cp_parser_expression): Add decltype_p. Force a
718 temporary for a call on the LHS of a comma.
719 (cp_parser_decltype): Pass true to decltype_p parms.
720 * pt.c (tsubst) [DECLTYPE_TYPE]: Pass tf_decltype.
721 (tsubst_copy_and_build): Pass tf_decltype down only for
722 CALL_EXPR and the RHS of COMPOUND_EXPR.
723 * tree.c (build_cplus_new): Call complete_type_or_maybe_complain.
725 * cp-tree.h (abstract_class_use): New enum.
726 * typeck2.c (pending_abstract_type): Add use field.
727 (abstract_virtuals_error_sfinae): Add overloads taking
728 abstract_class_use instead of tree.
729 * typeck.c (build_static_cast_1): Call it.
730 * except.c (is_admissible_throw_operand_or_catch_parameter): Call it.
731 * pt.c: Adjust calls.
732 * decl.c (cp_finish_decl): Don't handle functions specially.
733 (grokdeclarator): Always check return type.
734 * init.c (build_new_1): Adjust call.
738 * pt.c (tsubst) [ARRAY_TYPE]: Use abstract_virtuals_error_sfinae.
739 * typeck2.c (abstract_virtuals_error_sfinae): Call complete_type.
742 * pt.c (tsubst_function_type): Call abstract_virtuals_error_sfinae.
743 (tsubst_arg_types): Likewise.
747 * call.c (convert_like_real): Check for explicit constructors
748 even for value-initialization.
751 * pt.c (convert_nontype_argument): Handle invalid pointer.
753 * parser.c (cp_parser_lambda_expression): Use nreverse.
757 * pt.c (instantiate_class_template_1): Instantiate lambda capture
759 (tsubst_copy_and_build): Not here.
762 * method.c (walk_field_subobs): Disallow copy of rvalue ref.
765 * parser.c (parsing_nsdmi): New.
766 * semantics.c (outer_automatic_var_p): Check it.
767 (finish_id_expression): Likewise.
768 * cp-tree.h: Declare it.
771 * error.c (dump_expr) [SIZEOF_EXPR]: Print sizeof... properly.
773 * parser.c (lookup_literal_operator): Correct parm/arg naming
777 * pt.c (fold_non_dependent_expr_sfinae): Check
778 instantiation_dependent_expression_p.
781 * class.c (resolve_address_of_overloaded_function): Accept a
782 reference to function for target_type.
783 (instantiate_type): Likewise.
784 * pt.c (convert_nontype_argument): Pass it to
785 convert_nontype_argument_function.
787 2013-03-16 Jakub Jelinek <jakub@redhat.com>
789 * tree.c (cp_tree_equal): Fix a pasto.
792 * typeck.c (cp_build_binary_op): When calling warn_for_div_by_zero,
793 pass op1 through maybe_constant_value first.
795 2013-03-16 Paolo Carlini <paolo.carlini@oracle.com>
798 * semantics.c (cxx_eval_array_reference): Check for negative index.
800 2013-03-14 Jason Merrill <jason@redhat.com>
803 * decl.c (local_variable_p_walkfn): Check DECL_ARTIFICIAL again.
806 * decl.c (register_dtor_fn): Pass null to __cxa_thread_atexit
807 dso_handle parm on targets without __cxa_atexit.
809 2013-03-11 Jason Merrill <jason@redhat.com>
812 * typeck.c (check_return_expr): Disallow returning init list here.
813 * semantics.c (apply_deduced_return_type): Not here.
815 2013-03-08 Paolo Carlini <paolo.carlini@oracle.com>
818 * cxx-pretty-print.c (pp_cxx_expression): Handle LAMBDA_EXPR.
819 * error.c (dump_expr): Likewise.
821 2013-03-08 Jason Merrill <jason@redhat.com>
824 * class.c (modify_all_vtables): Mangle the vtable name before
827 * semantics.c (lambda_expr_this_capture): In unevaluated context,
828 just return the nearest 'this'.
833 * tree.c (maybe_dummy_object): Don't capture 'this'.
834 * semantics.c (maybe_resolve_dummy): New.
835 (finish_non_static_data_member): Use it.
836 (finish_qualified_id_expr): Don't test is_dummy_object.
837 * cp-tree.h: Declare maybe_resolve_dummy.
838 * call.c (build_new_method_call_1): Use it.
841 * semantics.c (apply_deduced_return_type): Don't allow returning
842 std::initializer_list.
844 2013-03-06 Paolo Carlini <paolo.carlini@oracle.com>
847 * parser.c (cp_parser_elaborated_type_specifier): Don't call
848 check_elaborated_type_specifier when TREE_CODE (decl) != TYPE_DECL.
849 * decl.c (check_elaborated_type_specifier): Tidy.
851 2013-03-06 Jakub Jelinek <jakub@redhat.com>
854 * tree.c (strip_typedefs): Don't copy args if they are NULL.
856 2013-03-05 Jakub Jelinek <jakub@redhat.com>
858 * parser.c (cp_parser_braced_list): For {} initialize
859 *non_constant_p to false.
861 2013-03-04 Jason Merrill <jason@redhat.com>
865 * semantics.c (lambda_expr_this_capture): Handle NSDMI
866 and non-class scopes.
868 2013-03-01 Paolo Carlini <paolo.carlini@oracle.com>
870 * decl.c (grokdeclarator): Remove dead code.
872 2013-02-28 Jason Merrill <jason@redhat.com>
875 * semantics.c (potential_constant_expression_1): Use
876 cxx_eval_outermost_constant_expr rather than maybe_constant_value.
879 * call.c (build_over_call): Avoid virtual lookup in a template.
881 2013-02-27 Jason Merrill <jason@redhat.com>
885 * name-lookup.c (do_class_using_decl): Use ctor_identifier instead
886 of the base name for inheriting ctors.
887 (push_class_level_binding_1): Remove inheriting ctor handling.
888 * pt.c (tsubst_decl) [USING_DECL]: Likewise.
889 * class.c (add_implicitly_declared_members): Adjust.
891 2013-02-26 David Binderman <dcb314@hotmail.com>
894 * decl.c (grokdeclarator): Tidy publicp assignment.
896 2013-02-25 Aldy Hernandez <aldyh@redhat.com>
899 * semantics.c (begin_transaction_stmt): Set TREE_SIDE_EFFECTS.
900 (build_transaction_expr): Same.
902 2013-02-25 Jason Merrill <jason@redhat.com>
905 * pt.c (fn_type_unification): Wait to call push_tinst_level until
906 we know what args we're looking at.
909 * semantics.c (potential_constant_expression_1): In C++98, a cast
910 to non-integral type can't be a constant expression.
912 2013-02-24 Jakub Jelinek <jakub@redhat.com>
915 * init.c (build_zero_init_1): Use RECORD_OR_UNION_CODE_P instead
918 2013-02-22 Jason Merrill <jason@redhat.com>
921 * pt.c (push_template_decl_real): Set DECL_INTERFACE_KNOWN
922 if we got the wrong number of template parms.
925 * pt.c (fn_type_unification): Use explicit args in template
926 instantiation context.
929 * call.c (can_convert_arg): Discard access checks.
932 * tree.c (strip_typedefs): Strip typedefs from TYPENAME_TYPE template
935 2013-02-20 Paolo Carlini <paolo.carlini@oracle.com>
938 * tree.c (maybe_warn_zero_as_null_pointer_constant): Add.
939 * cvt.c (ocp_convert): Use the latter.
940 (cp_convert_to_pointer): Likewise.
941 * decl.c (check_default_argument): Likewise.
942 * typeck.c (cp_build_binary_op): Likewise.
943 * cp-tree.h (maybe_warn_zero_as_null_pointer_constant): Declare.
945 2013-02-15 Jonathan Wakely <jwakely.gcc@gmail.com>
946 Paolo Carlini <paolo.carlini@oracle.com>
949 * decl2.c (grokbitfield): Allow scoped enumeration types.
951 2013-02-15 Jason Merrill <jason@redhat.com>
954 * semantics.c (finish_id_expression): Also return the identifier
955 for an outer local static.
958 * class.c (check_bases_and_members): Deduce noexcept after
962 * semantics.c (finish_id_expression): In a template, return
963 the identifier for a constant variable.
965 2013-02-14 Jason Merrill <jason@redhat.com>
968 * semantics.c (build_anon_member_initialization): New.
969 (build_data_member_initialization): Use it.
972 * decl.c (cp_finish_decl): Force instantiation of an
973 auto static data member.
976 * pt.c (unify): A pack expansion that is not the last template
977 argument makes the entire template argument list non-deduced.
980 * name-lookup.c (do_class_using_decl): Handle typedefs with
981 inheriting constructors.
982 (push_class_level_binding_1): Allow inheriting from template
983 template parameter, too.
984 * pt.c (tsubst_decl) [USING_DECL]: Likewise.
987 * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Fix handling of
988 default argument scope.
989 * mangle.c (write_name): Likewise.
992 * error.c (find_typenames_r): Don't walk into a pack expansion.
994 2013-02-13 Jason Merrill <jason@redhat.com>
997 * parser.c (cp_parser_member_declaration): Check the declarator
998 form when detecting a function declaration via typedef.
1001 * pt.c (maybe_process_partial_specialization): A lambda
1002 isn't what's being specialized.
1005 * semantics.c (maybe_add_lambda_conv_op): Mark static thunk
1009 * semantics.c (cxx_bind_parameters_in_call): Undo DECL_BY_REFERENCE.
1012 * semantics.c (cxx_fold_indirect_ref): Handle empty bases at
1013 non-zero offsets, too.
1016 * decl.c (build_enumerator): Always convert the value to a
1017 fixed underlying type.
1020 * pt.c (tsubst_copy_and_build): Don't forget any new
1021 captures that arose from use of dependent names.
1023 2013-02-13 Jakub Jelinek <jakub@redhat.com>
1026 * semantics.c (finish_asm_stmt): If input constraints allow
1027 neither register nor memory, try maybe_constant_value to get
1028 a constant if possible.
1030 2013-02-12 Jason Merrill <jason@redhat.com>
1033 * method.c (add_one_base_init): Handle base constructor
1034 taking rvalue reference parm.
1037 * semantics.c (sort_constexpr_mem_initializers): Handle
1040 2013-02-09 Jason Merrill <jason@redhat.com>
1043 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Call
1044 maybe_instantiate_noexcept.
1047 * pt.c (eq_specializations): Set comparing_specializations.
1048 * tree.c (cp_tree_equal): Check it.
1049 * cp-tree.h: Declare it.
1051 * decl.c (decls_match): Check versions later.
1054 * pt.c (build_non_dependent_expr): Don't try to fold
1055 instantiation-dependent expressions.
1056 (instantiation_dependent_r) [TRAIT_EXPR]: Split out.
1057 [BIND_EXPR]: Treat as dependent.
1059 2013-02-07 Jakub Jelinek <jakub@redhat.com>
1062 * init.c (build_vec_init): Don't append NULL values into new_vec.
1063 (build_zero_init_1): Don't push anything into v if recursive call
1065 (build_value_init_noctor): Don't push anything into v if
1066 build_value_init call returned NULL_TREE.
1069 * parser.c (cp_parser_token_starts_cast_expression): Renamed to...
1070 (cp_parser_tokens_start_cast_expression): ... this. Change parameter
1071 to cp_parser *, call cp_lexer_peek_token first. For CPP_OPEN_PAREN,
1072 return true only if 2nd token isn't CPP_CLOSE_PAREN.
1073 (cp_parser_cast_expression): Adjust caller.
1076 * decl.c (push_local_name): Look at DECL_DISCRIMINATOR (t)
1077 only if DECL_DISCRIMINATOR_SET_P (t) rather than just
1078 DECL_LANG_SPECIFIC (t).
1080 2013-02-07 Jason Merrill <jason@redhat.com>
1083 * method.c (do_build_copy_constructor): Don't bother turning
1084 scalars from lvalues to xvalues.
1085 (do_build_copy_assign): Likewise.
1087 2013-02-06 Jason Merrill <jason@redhat.com>
1089 * parser.c (cp_parser_enum_specifier): Check for error_mark_node.
1091 2013-02-05 Jason Merrill <jason@redhat.com>
1094 * tree.c (lvalue_kind) [INDIRECT_REF]: Don't check for
1098 * decl.c (start_preparsed_function): Update restype if we change
1102 * pt.c (fn_type_unification): Discard any access checks from
1103 substituting explicit args.
1105 2013-01-31 Jason Merrill <jason@redhat.com>
1109 * typeck.c (get_member_function_from_ptrfunc): Fix
1110 ptrmemfunc_vbit_in_delta case.
1112 2013-01-29 Jason Merrill <jason@redhat.com>
1115 * class.c (build_ctor_vtbl_group): Give construction vtables
1118 2013-01-25 Jason Merrill <jason@redhat.com>
1121 * pt.c (convert_nontype_argument_function): Handle invalid input.
1122 (convert_nontype_argument): Likewise.
1125 * typeck.c (get_member_function_from_ptrfunc): Optimize if the
1126 dynamic type has no virtual functions.
1128 2013-01-22 Paolo Carlini <paolo.carlini@oracle.com>
1131 * decl.c (check_initializer): Use TARGET_EXPR_DIRECT_INIT_P only
1132 on TARGET_EXPR nodes.
1134 2013-01-22 Jason Merrill <jason@redhat.com>
1137 * pt.c (maybe_instantiate_noexcept): Don't defer access checks.
1139 2013-01-22 Dodji Seketeli <dodji@redhat.com>
1142 * pt.c (argument_pack_element_is_expansion_p)
1143 (make_argument_pack_select, use_pack_expansion_extra_args_p)
1144 (gen_elem_of_pack_expansion_instantiation): New static functions.
1145 (tsubst): When looking through an ARGUMENT_PACK_SELECT tree node,
1146 look through the possibly resulting pack expansion as well.
1147 (tsubst_pack_expansion): Use use_pack_expansion_extra_p to
1148 generalize when to use the PACK_EXPANSION_EXTRA_ARGS mechanism.
1149 Use gen_elem_of_pack_expansion_instantiation to build the
1150 instantiation piece-wise. Don't use arg_from_parm_pack_p anymore,
1151 as gen_elem_of_pack_expansion_instantiation and the change in
1152 tsubst above generalize this particular case.
1153 (arg_from_parm_pack_p): Remove this for it's not used by
1154 tsubst_pack_expansion anymore.
1156 2013-01-21 Jason Merrill <jason@redhat.com>
1159 * tree.c (strip_typedefs_expr) [TREE_VEC]: Preserve non-default
1160 template args count.
1162 2013-01-18 Jason Merrill <jason@redhat.com>
1165 * decl2.c (get_local_tls_init_fn): New.
1166 (get_tls_init_fn): Handle flag_extern_tls_init. Don't bother
1167 with aliases for internal variables. Don't use weakrefs if
1168 the variable needs destruction.
1169 (generate_tls_wrapper): Mark the wrapper as const if no
1170 initialization is needed.
1171 (handle_tls_init): Don't require aliases.
1173 2013-01-15 Dodji Seketeli <dodji@redhat.com>
1176 * pt.c (coerce_innermost_template_parms): New static function.
1177 (instantiate_alias_template): Use it here.
1179 2013-01-09 Jason Merrill <jason@redhat.com>
1182 * rtti.c (build_typeid, get_typeid): Add complain parm.
1183 (get_tinfo_decl_dynamic): Likewise.
1184 * cp-tree.h, parser.c, pt.c: Adjust.
1187 * decl.c (cp_finish_decl): Clear TREE_READONLY if the variable
1190 2013-01-09 Jakub Jelinek <jakub@redhat.com>
1193 * typeck.c (cp_build_binary_op): For LSHIFT_EXPR and RSHIFT_EXPR,
1194 call maybe_constant_value for the negative or too big shift
1197 2013-01-09 Paolo Carlini <paolo.carlini@oracle.com>
1200 * decl2.c (var_needs_tls_wrapper): Return false when error_operand_p
1201 of the argument is true.
1203 2013-01-08 Joel Brobecker <brobecker@adacore.com>
1205 * parser.c (cp_parser_initializer_list): Move declaration
1206 of variable non_const to start of lexical block.
1208 2013-01-07 Jason Merrill <jason@redhat.com>
1211 * tree.c (build_aggr_init_expr): Do nothing in a template.
1212 * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Strip an ADDR_EXPR off
1213 a FUNCTION_DECL before tsubsting.
1215 2013-01-04 Dodji Seketeli <dodji@redhat.com>
1218 * pt.c (check_instantiated_arg): Allow type template arguments.
1220 2013-01-04 Jason Merrill <jason@redhat.com>
1223 * decl.c (reset_type_linkage, bt_reset_linkage): New.
1224 (grokdeclarator): Use reset_type_linkage.
1225 * name-lookup.c (binding_table_foreach): Handle null table.
1226 * tree.c (decl_anon_ns_mem_p): Check TYPE_MAIN_DECL, not TYPE_NAME.
1228 2013-01-04 Paolo Carlini <paolo.carlini@oracle.com>
1230 PR c++/54526 (again)
1231 * parser.c (cp_parser_template_id): Revert core of previous change
1232 (keep adjusted inform message).
1234 2013-01-03 Jason Merrill <jason@redhat.com>
1238 * pt.c (tsubst_copy_and_build) [TARGET_EXPR]: Don't touch
1242 * semantics.c (trait_expr_value): Call maybe_instantiate_noexcept.
1245 * semantics.c (build_data_member_initialization): Handle DECL_EXPR.
1248 * call.c (type_has_extended_temps): New.
1249 * cp-tree.h: Declare it.
1250 * decl.c (check_initializer): Use build_aggr_init for arrays
1252 * init.c (build_vec_init): Avoid mixed signed/unsigned arithmetic.
1254 2013-01-02 Jason Merrill <jason@redhat.com>
1257 * call.c (build_new_method_call_1): Don't use build_value_init for
1258 user-provided default constructors.
1260 * decl.c (check_default_argument): Use LOOKUP_IMPLICIT.
1264 * tree.c (build_cplus_array_type): Copy layout information
1265 to main variant if necessary.
1267 Copyright (C) 2013 Free Software Foundation, Inc.
1269 Copying and distribution of this file, with or without modification,
1270 are permitted in any medium without royalty provided the copyright
1271 notice and this notice are preserved.