1 2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
4 * parser.c (cp_parser_enum_specifier): Check for empty
5 anonymous enums and anonymous scoped enums.
7 2013-04-10 Jakub Jelinek <jakub@redhat.com>
10 * typeck.c (cp_build_binary_op): Call fold_non_dependent_expr_sfinae
11 first before calling maybe_constant_value for warn_for_div_by_zero
12 or invalid shift count warning purposes.
14 2013-04-09 Jason Merrill <jason@redhat.com>
17 * rtti.c (build_typeid): Check the address of the argument
18 rather than looking for an INDIRECT_REF.
20 2013-04-04 Jason Merrill <jason@redhat.com>
24 * typeck2.c (abstract_virtuals_error_sfinae): Disable
27 2013-04-08 Paolo Carlini <paolo.carlini@oracle.com>
30 * decl.c (validate_constexpr_redeclaration): Allow an explicit
31 specialization to be different wrt the constexpr specifier.
33 2013-04-06 Jason Merrill <jason@redhat.com>
35 * parser.c (cp_parser_std_attribute): Treat [[noreturn]] like GNU
38 2013-04-05 Ed Smith-Rowland <3dw4rd@verizon.net>
40 * parser.c (cp_parser_ref_qualifier_seq_opt): Move to
41 cp_parser_ref_qualifier_opt. Error if more than one ref-qual found.
43 2013-04-03 Jason Merrill <jason@redhat.com>
45 * cp-tree.h (FUNCTION_OR_METHOD_TYPE_CHECK): Remove.
46 (TYPE_RAISES_EXCEPTIONS): Use FUNC_OR_METHOD_CHECK instead.
47 (FUNCTION_REF_QUALIFIED, FUNCTION_RVALUE_QUALIFIED): Likewise.
49 * mangle.c (write_type): When writing a function type with
50 function-cv-quals, don't add the unqualified type as a
51 substitution candidate.
53 2013-04-03 Paolo Carlini <paolo.carlini@oracle.com>
56 * typeck.c (cp_build_unary_op): Change -Wpointer-arith permerror to
59 2013-04-03 Jakub Jelinek <jakub@redhat.com>
62 * tree.c (strip_typedefs): Copy NON_DEFAULT_TEMPLATE_ARGS_COUNT
63 from args to new_args.
64 (strip_typedefs_expr): Copy NON_DEFAULT_TEMPLATE_ARGS_COUNT from t to
65 r instead of doing {S,G}ET_NON_DEFAULT_TEMPLATE_ARGS_COUNT.
67 2013-04-02 Jason Merrill <jason@redhat.com>
70 * mangle.c (write_function_type): Mangle ref-qualifier.
71 (write_nested_name): Likewise.
72 (canonicalize_for_substitution): Preserve ref-qualifier.
73 (write_type): Likewise.
76 * decl.c (begin_destructor_body): Clobber the object in a cleanup.
78 2013-04-02 Paolo Carlini <paolo.carlini@oracle.com>
80 * friend.c (do_friend): Use COMPLETE_OR_OPEN_TYPE_P.
81 * pt.c (find_parameter_packs_r): Use TYPE_ALIAS_P and TYPE_TI_ARGS.
82 (for_each_template_parm_r): Use TYPE_TI_ARGS.
84 2013-04-02 Paolo Carlini <paolo.carlini@oracle.com>
86 * cp-tree.h (TAGGED_TYPE_P): Remove.
87 (IS_OVERLOAD_TYPE): Rename to OVERLOAD_TYPE_P, adjust.
88 (TYPE_ANONYMOUS_P): Adjust.
89 * call.c (build_new_op_1): Likewise.
90 * class.c (find_abi_tags_r): Likewise.
91 * decl.c (warn_misplaced_attr_for_class_type, start_decl,
92 type_is_deprecated): Likewise.
93 * decl2.c (grokfield, min_vis_r): Likewise.
94 * pt.c (get_template_info): Likewise.
95 * tree.c (handle_abi_tag_attribute): Likewise.
97 2013-04-01 Jason Merrill <jason@redhat.com>
99 * semantics.c (maybe_constant_value): Check
100 instantiation_dependent_expression_p.
101 * pt.c (build_non_dependent_expr): Don't check it here.
104 * init.c (build_new): Don't try to process an array initializer
105 at template definition time.
108 * typeck.c (finish_class_member_access_expr): Handle enum scope.
111 * parser.c (cp_parser_range_for): Don't try to do auto deduction
112 in a template if the type of the range is incomplete.
114 * call.c (add_function_candidate): Take the address of 'this' here.
115 (build_over_call): And here.
116 (build_new_method_call_1, build_op_call_1): Not here.
117 (build_user_type_conversion_1): Or here.
118 (add_candidates): Adjust.
120 * cxx-pretty-print.h (pp_cxx_cv_qualifiers): New.
121 * class.c (same_signature_p): Use type_memfn_quals.
122 * cp-tree.h (TYPE_RAISES_EXCEPTIONS): Use
123 FUNCTION_OR_METHOD_TYPE_CHECK.
124 * error.c (dump_type_suffix): Add padding before cv-qualifiers.
125 * pt.c (unify): Use static_fn_type.
127 2013-04-01 Bronek Kozicki <b.kozicki@gmail.com>
128 Jason Merrill <jason@redhat.com>
130 Implement N2439 (ref-qualifiers for 'this')
131 * cp-tree.h (FUNCTION_REF_QUALIFIED): New.
132 (FUNCTION_RVALUE_QUALIFIED): New.
133 (FUNCTION_OR_METHOD_TYPE_CHECK): New.
134 (cpp0x_warn_str): Add CPP0X_REF_QUALIFIER.
135 (cp_ref_qualifier): New enum.
136 (cp_declarator): Add ref_qualifier.
137 * parser.c (cp_parser_ref_qualifier_seq_opt): New.
138 (cp_parser_direct_declarator): Use it.
139 (make_call_declarator): Adjust.
140 (cp_parser_lambda_declarator_opt): Adjust.
141 * call.c (add_function_candidate): Handle ref-qualifier overload
142 resolution semantics.
143 (standard_conversion): Adjust.
144 * class.c (add_method, same_signature_p): Compare ref-qualifiers.
145 * decl.c (grokdeclarator): Handle ref-qualifiers.
146 (grokfndecl): Check for invalid ref-qualifiers.
147 (static_fn_type, revert_static_member_fn): Adjust.
148 * decl2.c (build_memfn_type): Handle ref-qualifiers.
149 (check_classfn): Check them.
150 (cp_reconstruct_complex_type): Retain them.
151 * error.c (dump_ref_qualifier): New.
152 (dump_type_suffix, dump_function_decl): Use it.
153 (maybe_warn_cpp0x): Handle CPP0X_REF_QUALIFIER.
154 * pt.c (tsubst, tsubst_function_type): Instantiate ref-quals.
155 (unify): Retain them.
156 * tree.c (cp_check_qualified_type): New.
157 (cp_build_qualified_type_real): Keep exception spec and ref-qual.
158 (build_ref_qualified_type): New.
159 (strip_typedefs, build_exception_variant): Keep ref-qualifier.
160 (cp_build_type_attribute_variant): Keep ref-qualifier.
161 * typeck.c (merge_types): Keep ref-qualifier.
162 (structural_comptypes): Compare ref-qualifier.
163 (type_memfn_rqual): New.
164 (apply_memfn_quals): Take ref-qual argument.
165 * typeck2.c (build_m_component_ref): Check ref-qualifier.
167 2013-04-01 Paolo Carlini <paolo.carlini@oracle.com>
169 * cp-tree.h (DECL_UNBOUND_CLASS_TEMPLATE_P): Remove.
170 (DECL_FUNCTION_TEMPLATE_P): Adjust.
172 * cxx-pretty-print.c (pp_cxx_nested_name_specifier,
173 pp_cxx_qualified_id): Use get_containing_scope.
174 * parser.c (cp_parser_class_head): Likewise.
175 * pt.c (push_template_decl_real): Likewise.
177 * decl2.c (import_export_decl): Use DECL_TEMPLOID_INSTANTIATION.
178 * pt.c (unify): Use CP_INTEGRAL_TYPE_P.
180 2013-03-31 Paolo Carlini <paolo.carlini@oracle.com>
182 * decl2.c (collect_candidates_for_java_method_aliases): Use
184 * name-lookup.c (pushtag_1) Use TYPE_FUNCTION_SCOPE_P.
185 (pushdecl_maybe_friend_1): Use DECL_DECLARES_FUNCTION_P.
186 * decl.c (duplicate_decls): Likewise.
187 * parser.c (cp_parser_template_declaration_after_export): Likewise,
188 also DECL_DECLARES_TYPE_P.
189 * pt.c (instantiate_class_template_1): Likewise.
190 * search.c (lookup_field_1): Use DECL_DECLARES_TYPE_P.
191 (lookup_field_r): Likewise.
192 (friend_accessible_p): Use DECL_DECLARES_FUNCTION_P.
193 (lookup_fnfields_slot_nolazy): Likewise.
194 * semantics.c (finish_member_declaration): Likewise.
195 * typeck.c (convert_for_initialization): Use TYPE_REFFN_P.
197 2013-03-29 Gabriel Dos Reis <gdr@integrable-solutions.net>
199 * pt.c (template_parms_to_args): Fix typo in comment.
201 2013-03-29 Paolo Carlini <paolo.carlini@oracle.com>
203 * call.c (build_op_call_1): Use TYPE_PTRFN_P and TYPE_REFFN_P.
205 2013-03-29 Paolo Carlini <paolo.carlini@oracle.com>
207 * call.c (add_builtin_candidate): Use TYPE_PTR_P and VOID_TYPE_P.
208 (build_op_call_1): Likewise.
209 (build_over_call): Likewise.
210 (compare_ics): Likewise.
211 * class.c (build_base_path): Likewise.
212 (resolve_address_of_overloaded_function): Likewise.
213 * cp-tree.h: Likewise.
214 * cvt.c (cp_convert_to_pointer): Likewise.
215 (convert_to_reference): Likewise.
216 (ocp_convert): Likewise.
217 (convert_force): Likewise, tidy.
218 * cxx-pretty-print.c (pp_cxx_postfix_expression): Likewise.
219 (pp_cxx_ptr_operator): Likewise.
220 * decl.c (duplicate_decls): Likewise.
221 (start_decl): Likewise.
222 (grok_op_properties): Likewise.
223 (start_preparsed_function): Likewise.
224 (store_parm_decls): Likewise.
225 (finish_function): Likewise.
226 * decl2.c (delete_sanity): Likewise.
227 (acceptable_java_type): Likewise.
228 (grokbitfield): Likewise.
229 (cp_reconstruct_complex_type): Likewise.
230 * error.c (dump_type_prefix): Likewise.
231 (dump_expr): Likewise.
232 * except.c (push_eh_cleanup): Likewise.
233 (complete_ptr_ref_or_void_ptr_p): Likewise.
234 (can_convert_eh): Likewise.
235 * init.c (build_new_1): Likewise.
236 (build_delete): Likewise.
237 (build_vec_delete): Likewise.
238 * mangle.c (write_type): Likewise.
239 * parser.c (lookup_literal_operator): Likewise.
240 * pt.c (convert_nontype_argument_function): Likewise.
241 (convert_nontype_argument): Likewise.
244 (dependent_type_p_r): Likewise.
245 * rtti.c (build_headof): Likewise.
246 (build_typeid): Likewise.
247 (build_dynamic_cast_1): Likewise.
248 (target_incomplete_p): Likewise.
249 (typeinfo_in_lib_p): Likewise.
250 * semantics.c (finish_omp_for): Likewise.
251 (cxx_eval_call_expression): Likewise.
252 (maybe_resolve_dummy): Likewise.
253 * tree.c (build_target_expr): Likewise.
254 (cp_build_qualified_type_real): Likewise.
255 * typeck.c (composite_pointer_type_r): Likewise.
256 (composite_pointer_type): Likewise.
257 (comp_except_types): Likewise.
258 (cxx_sizeof_nowarn): Likewise.
259 (string_conv_p): Likewise.
260 (cp_build_array_ref): Likewise.
261 (cp_build_function_call_vec): Likewise, also use TYPE_PTRFN_P.
262 (pointer_diff): Likewise.
263 (cp_build_addr_expr_1): Likewise.
264 (cp_build_unary_op): Likewise.
265 (build_static_cast_1): Likewise.
266 (cp_build_c_cast): Likewise.
267 (comp_ptr_ttypes_real): Likewise.
268 (ptr_reasonably_similar): Likewise.
269 (comp_ptr_ttypes_const): Likewise.
270 (casts_away_constness): Likewise.
271 (check_literal_operator_args): Likewise.
272 * typeck2.c (build_x_arrow): Likewise.
273 (add_exception_specifier): Likewise.
275 2013-03-29 Jason Merrill <jason@redhat.com>
278 * cp-tree.h (AUTO_IS_DECLTYPE): New.
279 * parser.c (cp_parser_decltype): Handle decltype(auto).
280 (cp_parser_type_id_1): Allow auto without a late-specified
282 (cp_parser_primary_expression): Use the return value of
283 finish_parenthesized_expr.
284 (cp_parser_transaction_expression): Likewise.
285 * semantics.c (force_paren_expr): New.
286 (finish_parenthesized_expr): Use it.
287 * call.c (build_conditional_expr_1): Likewise.
288 * pt.c (do_auto_deduction): Handle decltype(auto).
289 (tsubst_copy): Handle PAREN_EXPR.
290 (tsubst_copy_and_build): Likewise.
291 * error.c (dump_expr): Handle PAREN_EXPR.
292 * cxx-pretty-print.c (pp_cxx_expression): Likewise.
293 * mangle.c (write_expression): Ignore PAREN_EXPR.
295 * parser.c (cp_parser_decltype_expr): Split out...
296 (cp_parser_decltype): ...from here.
300 * pt.c (unify_pack_expansion): Fix indexing.
302 2013-03-29 Gabriel Dos Reis <gdr@integrable-solutions.net>
304 * call.c (build_java_interface_fn_ref): Likewise.
305 (make_temporary_var_for_ref_to_temp): Likewise.
306 * class.c (check_field_decls): Likewise.
307 (layout_class_type): Likewise.
308 (finish_struct_1): Likewise.
309 (fixed_type_or_null): Likewise.
310 (get_vtbl_decl_for_binfo): Likewise.
311 * cp-gimplify.c (omp_var_to_track): Likewise.
312 (cp_genericize_r): Likewise.
313 * cp-objcp-common.c (cxx_warn_unused_global_decl): Likewise.
314 * cp-tree.h (LANG_DECL_HAS_MIN): Likewise.
315 (DECL_DISCRIMINATOR_P): Likewise.
316 * decl.c (poplevel): Likewise.
317 (decls_match): Likewise.
318 (duplicate_decls): Likewise.
319 (decl_jump_unsafe): Likewise.
320 (start_decl): Likewise.
321 (check_for_uninitialized_const_var): Likewise.
322 (make_rtl_for_nonlocal_decl): Likewise.
323 (cp_finish_decl): Likewise.
324 (expand_static_init): Likewise.
325 (local_variable_p): Likewise.
326 (maybe_register_incomplete_var): Likewise.
327 * decl2.c (grokfield): Likewise.
328 (comdat_linkage): Likewise.
329 (determine_visibility): Likewise.
330 (import_export_decl): Likewise.
331 (prune_vars_needing_no_initialization): Likewise.
332 (decl_maybe_constant_var_p): Likewise.
333 * error.c (dump_simple_decl): Likewise.
334 (dump_template_decl): Likewise.
335 (cp_printer): Likewise.
336 * except.c (build_throw): Likewise.
337 * init.c (build_vtbl_address): Likewise.
338 (member_init_ok_or_else): Likewise.
339 (build_aggr_init): Likewise.
340 (expand_aggr_init_1): Likewise.
341 (build_offset_ref): Likewise.
342 (constant_value_1): Likewise.
343 * mangle.c (write_mangled_name): Likewise.
344 (write_prefix): Likewise.
345 * name-lookup.c (supplement_binding_1): Likewise.
346 (add_decl_to_level): Likewise.
347 (pushdecl_maybe_friend_1): Likewise.
348 (check_for_out_of_scope_variable): Likewise.
349 (validate_nonmember_using_decl): Likewise.
350 (lookup_name_innermost_nonclass_level_1): Likewise.
351 (lookup_arg_dependent_1): Likewise.
352 * parser.c (cp_parser_lambda_introducer): Likewise.
353 (cp_parser_template_argument): Likewise.
354 (cp_parser_single_declaration): Likewise.
355 * pt.c (convert_nontype_argument): Likewise.
356 (instantiate_class_template_1): Likewise.
357 (tsubst_decl): Likewise.
358 (tsubst_expr): Likewise.
359 (do_decl_instantiation): Likewise.
360 (do_type_instantiation): Likewise.
361 (regenerate_decl_from_template): Likewise.
362 (always_instantiate_p): Likewise.
363 (instantiate_decl): Likewise.
364 (type_dependent_expression_p): Likewise.
365 (build_non_dependent_expr): Likewise.
366 * repo.c (repo_emit_p): Likewise.
367 * rtti.c (build_dynamic_cast_1): Likewise.
368 * search.c (shared_member_p): Likewise.
369 * semantics.c (outer_var_p): Likewise.
370 (finish_id_expression): Likewise.
371 (finish_omp_clauses): Likewise.
372 (finish_decltype_type): Likewise.
373 (ensure_literal_type_for_constexpr_object): Likewise.
374 * tree.c (lvalue_kind): Likewise.
375 (bot_replace): Likewise.
376 (cp_tree_equal): Likewise.
377 (handle_init_priority_attribute): Likewise.
378 (decl_storage_duration): Likewise.
379 * typeck.c (cxx_sizeof_expr): Likewise.
380 (cxx_alignof_expr): Likewise.
381 (decay_conversion): Likewise.
382 (build_class_member_access_expr): Likewise.
383 (cp_build_array_ref): Likewise.
384 (cxx_mark_addressable): Likewise.
385 (maybe_warn_about_returning_address_of_local): Likewise.
386 (check_return_expr): Likewise.
387 * typeck2.c (cxx_readonly_error): Likewise.
388 (abstract_virtuals_error_sfinae): Likewise.
389 (cxx_incomplete_type_diagnostic): Likewise.
391 2013-03-28 Lawrence Crowl <crowl@google.com>
394 (CXX_PARSER_H): Add header dependence.
396 (extern debug (cp_binding_level &)): New.
397 (extern debug (cp_binding_level *)): New.
399 (debug (cp_binding_level &)): New.
400 (debug (cp_binding_level *)): New.
402 (debug (cp_parser &)): New.
403 (debug (cp_parser *)): New.
404 (debug (cp_token &)): New.
405 (debug (cp_token *)): New.
406 (debug (vec<cp_token, va_gc> &)): New.
407 (debug (vec<cp_token, va_gc> *)): New.
408 * parser.c: Add header dependence.
409 (extern debug (cp_parser &)): New.
410 (extern debug (cp_parser *)): New.
411 (extern debug (cp_token &)): New.
412 (extern debug (cp_token *)): New.
413 (extern debug (vec<cp_token, va_gc> &)): New.
414 (extern debug (vec<cp_token, va_gc> *)): New.
416 2013-03-28 Jason Merrill <jason@redhat.com>
420 * typeck2.c (abstract_virtuals_error_sfinae): Don't complete
421 the type if tf_decltype is set.
422 * pt.c (fn_type_unification): Add decltype_p parm.
423 (get_bindings): Adjust.
425 * class.c (resolve_address_of_overloaded_function): Adjust.
426 * call.c (add_template_candidate_real, print_z_candidate): Adjust.
429 * parser.c (cp_parser_sizeof_pack): Split out from...
430 (cp_parser_sizeof_operand): ...here. Require (id).
433 * semantics.c (finish_this_expr): 'this' is an rvalue.
434 * typeck.c (cp_build_indirect_ref): Handle NOP_EXPR of 'this'.
437 * semantics.c (finish_member_declaration): Don't push closure
440 * name-lookup.c (pushdecl_maybe_friend_1): Use
441 nonlambda_method_basetype and current_nonlambda_class_type.
444 * semantics.c (potential_constant_expression_1) [NOP_EXPR]: Reject
445 conversion from integer to pointer.
446 (cxx_eval_constant_expression): Likewise.
447 (cxx_eval_indirect_ref): Use the folded operand if we still think
448 this might be constant.
450 2013-03-28 Paolo Carlini <paolo.carlini@oracle.com>
451 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
454 * call.c (convert_like_real): Change series of two permerrors
455 to permerror + inform (and likewise for two errors).
456 (build_new_method_call_1): Likewise.
457 * typeck.c (convert_for_initialization): Change additional
458 warning or error to inform.
460 2013-03-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
462 * cp-tree.h (next_aggr_init_expr_arg): Remove static specifier.
463 (first_aggr_init_expr): Likewise.
464 (more_aggr_init_expr_args_p): Likewise.
465 (type_of_this_parm): Likewise.
466 (class_of_this_parm): Likewise.
467 * name-lookup.h (get_global_value_if_present): Likewise.
468 (is_typename_at_global_scope): Likewise.
470 2013-03-28 Paolo Carlini <paolo.carlini@oracle.com>
472 * call.c (joust): Don't call inform for a permerror returning false.
473 * parser.c (cp_parser_check_class_key): Likewise.
474 * pt.c (tsubst_copy_and_build): Likewise.
476 2013-03-27 Jason Merrill <jason@redhat.com>
479 * semantics.c (finish_qualified_id_expr): Return early
482 2013-03-26 Gabriel Dos Reis <gdr@integrable-solutions.net>
484 * call.c (build_new_method_call_1): Use INDIRECT_REF_P.
485 * cvt.c (convert_to_void): Likewise.
486 * error.c (dump_expr): Likewise.
487 * mangle.c (write_expression): Likewise.
488 * parser.c (cp_parser_template_argument): Likewise.
489 * pt.c (convert_nontype_argument): Likewise.
490 (tsubst_copy_and_build): Likewise.
491 * rtti.c (build_typeid): Likewise.
492 * semantics.c (finish_call_expr): Likewise.
493 (finish_decltype_type): Likewise.
494 (build_data_member_initialization): Likewise.
495 * tree.c (is_dummy_object): Likewise.
496 * typeck.c (decay_conversion): Likewise.
497 (build_class_member_access_expr): Likewise.
498 (cp_build_addr_expr_1): Likewise.
499 (unary_complex_lvalue): Likewise.
500 (check_return_expr): Likewise.
501 * typeck2.c (cxx_readonly_error): Likewise.
503 2013-03-26 Jason Merrill <jason@redhat.com>
506 * typeck.c (invalid_nonstatic_memfn_p): Use get_first_fn. Take tree.
507 * semantics.c (finish_decltype_type): Check it before type_unknown_p.
508 * cp-tree.h: Adjust prototype.
511 * typeck2.c (build_m_component_ref): Handle prvalue object.
513 2013-03-26 Gabriel Dos Reis <gdr@integrable-solutions.net>
515 * cp-gimplify.c (cp_genericize_r): Use VAR_OR_FUNCTION_DECL_P.
516 * decl.c (duplicate_decls): Likewise.
517 (cp_finish_decl): Likewise.
518 (check_class_member_definition_namespace): Likewise.
519 * decl2.c (grokfield): Likewise.
520 (decl_needed_p): Likewise.
521 (import_export_decl): Likewise.
522 (mark_used): Likewise.
523 * name-lookup.c (pushdecl_maybe_friend_1): Likewise.
524 * pt.c (push_access_scope): Likewise.
525 (instantiate_decl): Likewise.
526 * ptree.c (cxx_print_decl): Likewise.
527 * repo.c (repo_emit_p): Likewise.
528 * semantics.c (note_decl_for_pch): Likewise.
529 * tree.c (decl_linkage): Likewise.
531 2013-03-26 Paolo Carlini <paolo.carlini@oracle.com>
534 * decl.c (check_array_designated_initializer): Handle CONST_DECL
537 2013-03-26 Paolo Carlini <paolo.carlini@oracle.com>
539 * decl.c (grokfndecl): Handle separately <inline> and <constexpr>
542 * decl.c (grokdeclarator): Declare typedef_p and use it everywhere.
544 2013-03-25 Jason Merrill <jason@redhat.com>
547 * semantics.c (maybe_resolve_dummy): Make sure that the enclosing
548 class is derived from the type of the object.
551 * semantics.c (lambda_expr_this_capture): Don't capture 'this' in
554 2013-03-25 Paolo Carlini <paolo.carlini@oracle.com>
557 * decl.c (cp_finish_decl): Check DECL_LANG_SPECIFIC before
558 DECL_TEMPLATE_INSTANTIATION.
560 2013-03-22 Jason Merrill <jason@redhat.com>
563 * pt.c (instantiation_dependent_r): Check DECL_INITIAL of VAR_DECL
566 2013-03-21 Gabriel Dos Reis <gdr@integrable-solutions.net>
568 * cp-tree.h (identifier_p): New.
569 * call.c: Throughout, call identifier_p insstead of direct
570 comparaison of TREE_CODE against IDENTIFIER_NODE.
574 * mangle.c: Likewise.
575 * name-lookup.c: Likewise.
576 * parser.c: Likewise.
578 * search.c: Likewise.
579 * semantics.c: Likewise.
581 * typeck.c: Likewise.
582 * typeck2.c: Likewise.
584 2013-03-21 Jakub Jelinek <jakub@redhat.com>
587 * pt.c (convert_nontype_argument): Count werrorcount as warnings.
588 * call.c (build_temp): Likewise.
589 * method.c (synthesize_method): Likewise.
590 * typeck.c (convert_for_initialization): Likewise.
592 2013-03-21 Marc Glisse <marc.glisse@inria.fr>
594 * call.c (build_conditional_expr_1): Fold VEC_COND_EXPR.
596 2013-03-21 Richard Biener <rguenther@suse.de>
598 * error.c (cp_printer): Use DECL_HAS_DEBUG_EXPR_P instead of
599 DECL_DEBUG_EXPR_IS_FROM. Guard properly.
601 2013-03-20 Jason Merrill <jason@redhat.com>
604 * parser.c (cp_parser_late_return_type_opt): Save and restore
605 current_class_ptr/ref.
608 * expr.c (cplus_expand_constant): Do nothing if the class is
610 * semantics.c (reduced_constant_expression_p): Allow PTRMEM_CST.
611 * typeck2.c (store_init_value): Use reduced_constant_expression_p.
612 * decl.c (maybe_register_incomplete_var): Handle PTRMEM_CST.
613 (complete_vars): Likewise.
615 * name-lookup.c (get_anonymous_namespace_name): Never use
616 get_file_function_name.
618 * pt.c (retrieve_specialization): Handle null tmpl argument.
622 * pt.c (tsubst_decl): Check return value of register_specialization.
623 * typeck2.c (abstract_virtuals_error_sfinae): Re-apply complete_type
626 2013-03-17 Jason Merrill <jason@redhat.com>
630 * parser.c (cp_parser_direct_declarator): Bail if we see a
631 qualified-id not at namespace scope.
635 * typeck2.c (abstract_virtuals_error_sfinae): Revert complete_type
638 2013-03-16 Jason Merrill <jason@redhat.com>
640 * decl.c (grokdeclarator): Assert that we won't see a pointer to
644 * cp-tree.h (WILDCARD_TYPE_P): Split out from...
645 (MAYBE_CLASS_TYPE_P): ...here.
646 * semantics.c (lambda_capture_field_type): Only build a
647 magic decltype for wildcard types.
648 (lambda_proxy_type): Likewise.
649 (finish_non_static_data_member): Get the quals from
653 * parser.c (cp_parser_template_argument): Don't
654 fold_non_dependent_expr.
656 * parser.c (cp_parser_lambda_declarator_opt): Use
657 cp_parser_trailing_type_id.
660 * parser.c (cp_parser_template_id): Don't forget access checks.
663 * pt.c (tsubst_qualified_id): Use current_nonlambda_class_type.
667 * name-lookup.h (tag_scope): Add ts_lambda.
668 * semantics.c (begin_lambda_type): Use it.
669 * decl.c (xref_tag_1): Set CLASSTYPE_LAMBDA_EXPR.
670 * pt.c (check_default_tmpl_args): Ignore lambdas.
671 (push_template_decl_real): Handle lambdas.
672 * tree.c (no_linkage_check): Adjust lambda check.
675 * tree.c (strip_typedefs_expr): Complain about lambda, don't abort.
678 * parser.c (cp_parser_direct_declarator): Fix late return
679 for out-of-class defn of member function.
682 * semantics.c (maybe_add_lambda_conv_op): Clear DECL_NAME of copied
683 parms to avoid duplicate -Wshadow warnings.
685 * search.c (lookup_base): Handle NULL_TREE.
688 * semantics.c (potential_constant_expression_1): Use of 'this' in
689 a non-constexpr function makes the expression not potentially
694 * cp-tree.h (tsubst_flags): Add tf_decltype.
695 * call.c (build_cxx_call): Don't build a temporary if it's set.
696 (build_over_call): Make sure it's only passed to build_cxx_call.
697 * parser.c (cp_parser_primary_expression): Add decltype_p parm.
698 (cp_parser_unary_expression): Likewise.
699 (cp_parser_cast_expression): Likewise.
700 (cp_parser_binary_expression): Likewise.
701 (cp_parser_assignment_expression): Likewise.
702 (cp_parser_postfix_expression): Likewise. Pass tf_decltype.
703 (cp_parser_expression): Add decltype_p. Force a
704 temporary for a call on the LHS of a comma.
705 (cp_parser_decltype): Pass true to decltype_p parms.
706 * pt.c (tsubst) [DECLTYPE_TYPE]: Pass tf_decltype.
707 (tsubst_copy_and_build): Pass tf_decltype down only for
708 CALL_EXPR and the RHS of COMPOUND_EXPR.
709 * tree.c (build_cplus_new): Call complete_type_or_maybe_complain.
711 * cp-tree.h (abstract_class_use): New enum.
712 * typeck2.c (pending_abstract_type): Add use field.
713 (abstract_virtuals_error_sfinae): Add overloads taking
714 abstract_class_use instead of tree.
715 * typeck.c (build_static_cast_1): Call it.
716 * except.c (is_admissible_throw_operand_or_catch_parameter): Call it.
717 * pt.c: Adjust calls.
718 * decl.c (cp_finish_decl): Don't handle functions specially.
719 (grokdeclarator): Always check return type.
720 * init.c (build_new_1): Adjust call.
724 * pt.c (tsubst) [ARRAY_TYPE]: Use abstract_virtuals_error_sfinae.
725 * typeck2.c (abstract_virtuals_error_sfinae): Call complete_type.
728 * pt.c (tsubst_function_type): Call abstract_virtuals_error_sfinae.
729 (tsubst_arg_types): Likewise.
733 * call.c (convert_like_real): Check for explicit constructors
734 even for value-initialization.
737 * pt.c (convert_nontype_argument): Handle invalid pointer.
739 * parser.c (cp_parser_lambda_expression): Use nreverse.
743 * pt.c (instantiate_class_template_1): Instantiate lambda capture
745 (tsubst_copy_and_build): Not here.
748 * method.c (walk_field_subobs): Disallow copy of rvalue ref.
751 * parser.c (parsing_nsdmi): New.
752 * semantics.c (outer_automatic_var_p): Check it.
753 (finish_id_expression): Likewise.
754 * cp-tree.h: Declare it.
757 * error.c (dump_expr) [SIZEOF_EXPR]: Print sizeof... properly.
759 * parser.c (lookup_literal_operator): Correct parm/arg naming
763 * pt.c (fold_non_dependent_expr_sfinae): Check
764 instantiation_dependent_expression_p.
767 * class.c (resolve_address_of_overloaded_function): Accept a
768 reference to function for target_type.
769 (instantiate_type): Likewise.
770 * pt.c (convert_nontype_argument): Pass it to
771 convert_nontype_argument_function.
773 2013-03-16 Jakub Jelinek <jakub@redhat.com>
775 * tree.c (cp_tree_equal): Fix a pasto.
778 * typeck.c (cp_build_binary_op): When calling warn_for_div_by_zero,
779 pass op1 through maybe_constant_value first.
781 2013-03-16 Paolo Carlini <paolo.carlini@oracle.com>
784 * semantics.c (cxx_eval_array_reference): Check for negative index.
786 2013-03-14 Jason Merrill <jason@redhat.com>
789 * decl.c (local_variable_p_walkfn): Check DECL_ARTIFICIAL again.
792 * decl.c (register_dtor_fn): Pass null to __cxa_thread_atexit
793 dso_handle parm on targets without __cxa_atexit.
795 2013-03-11 Jason Merrill <jason@redhat.com>
798 * typeck.c (check_return_expr): Disallow returning init list here.
799 * semantics.c (apply_deduced_return_type): Not here.
801 2013-03-08 Paolo Carlini <paolo.carlini@oracle.com>
804 * cxx-pretty-print.c (pp_cxx_expression): Handle LAMBDA_EXPR.
805 * error.c (dump_expr): Likewise.
807 2013-03-08 Jason Merrill <jason@redhat.com>
810 * class.c (modify_all_vtables): Mangle the vtable name before
813 * semantics.c (lambda_expr_this_capture): In unevaluated context,
814 just return the nearest 'this'.
819 * tree.c (maybe_dummy_object): Don't capture 'this'.
820 * semantics.c (maybe_resolve_dummy): New.
821 (finish_non_static_data_member): Use it.
822 (finish_qualified_id_expr): Don't test is_dummy_object.
823 * cp-tree.h: Declare maybe_resolve_dummy.
824 * call.c (build_new_method_call_1): Use it.
827 * semantics.c (apply_deduced_return_type): Don't allow returning
828 std::initializer_list.
830 2013-03-06 Paolo Carlini <paolo.carlini@oracle.com>
833 * parser.c (cp_parser_elaborated_type_specifier): Don't call
834 check_elaborated_type_specifier when TREE_CODE (decl) != TYPE_DECL.
835 * decl.c (check_elaborated_type_specifier): Tidy.
837 2013-03-06 Jakub Jelinek <jakub@redhat.com>
840 * tree.c (strip_typedefs): Don't copy args if they are NULL.
842 2013-03-05 Jakub Jelinek <jakub@redhat.com>
844 * parser.c (cp_parser_braced_list): For {} initialize
845 *non_constant_p to false.
847 2013-03-04 Jason Merrill <jason@redhat.com>
851 * semantics.c (lambda_expr_this_capture): Handle NSDMI
852 and non-class scopes.
854 2013-03-01 Paolo Carlini <paolo.carlini@oracle.com>
856 * decl.c (grokdeclarator): Remove dead code.
858 2013-02-28 Jason Merrill <jason@redhat.com>
861 * semantics.c (potential_constant_expression_1): Use
862 cxx_eval_outermost_constant_expr rather than maybe_constant_value.
865 * call.c (build_over_call): Avoid virtual lookup in a template.
867 2013-02-27 Jason Merrill <jason@redhat.com>
871 * name-lookup.c (do_class_using_decl): Use ctor_identifier instead
872 of the base name for inheriting ctors.
873 (push_class_level_binding_1): Remove inheriting ctor handling.
874 * pt.c (tsubst_decl) [USING_DECL]: Likewise.
875 * class.c (add_implicitly_declared_members): Adjust.
877 2013-02-26 David Binderman <dcb314@hotmail.com>
880 * decl.c (grokdeclarator): Tidy publicp assignment.
882 2013-02-25 Aldy Hernandez <aldyh@redhat.com>
885 * semantics.c (begin_transaction_stmt): Set TREE_SIDE_EFFECTS.
886 (build_transaction_expr): Same.
888 2013-02-25 Jason Merrill <jason@redhat.com>
891 * pt.c (fn_type_unification): Wait to call push_tinst_level until
892 we know what args we're looking at.
895 * semantics.c (potential_constant_expression_1): In C++98, a cast
896 to non-integral type can't be a constant expression.
898 2013-02-24 Jakub Jelinek <jakub@redhat.com>
901 * init.c (build_zero_init_1): Use RECORD_OR_UNION_CODE_P instead
904 2013-02-22 Jason Merrill <jason@redhat.com>
907 * pt.c (push_template_decl_real): Set DECL_INTERFACE_KNOWN
908 if we got the wrong number of template parms.
911 * pt.c (fn_type_unification): Use explicit args in template
912 instantiation context.
915 * call.c (can_convert_arg): Discard access checks.
918 * tree.c (strip_typedefs): Strip typedefs from TYPENAME_TYPE template
921 2013-02-20 Paolo Carlini <paolo.carlini@oracle.com>
924 * tree.c (maybe_warn_zero_as_null_pointer_constant): Add.
925 * cvt.c (ocp_convert): Use the latter.
926 (cp_convert_to_pointer): Likewise.
927 * decl.c (check_default_argument): Likewise.
928 * typeck.c (cp_build_binary_op): Likewise.
929 * cp-tree.h (maybe_warn_zero_as_null_pointer_constant): Declare.
931 2013-02-15 Jonathan Wakely <jwakely.gcc@gmail.com>
932 Paolo Carlini <paolo.carlini@oracle.com>
935 * decl2.c (grokbitfield): Allow scoped enumeration types.
937 2013-02-15 Jason Merrill <jason@redhat.com>
940 * semantics.c (finish_id_expression): Also return the identifier
941 for an outer local static.
944 * class.c (check_bases_and_members): Deduce noexcept after
948 * semantics.c (finish_id_expression): In a template, return
949 the identifier for a constant variable.
951 2013-02-14 Jason Merrill <jason@redhat.com>
954 * semantics.c (build_anon_member_initialization): New.
955 (build_data_member_initialization): Use it.
958 * decl.c (cp_finish_decl): Force instantiation of an
959 auto static data member.
962 * pt.c (unify): A pack expansion that is not the last template
963 argument makes the entire template argument list non-deduced.
966 * name-lookup.c (do_class_using_decl): Handle typedefs with
967 inheriting constructors.
968 (push_class_level_binding_1): Allow inheriting from template
969 template parameter, too.
970 * pt.c (tsubst_decl) [USING_DECL]: Likewise.
973 * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Fix handling of
974 default argument scope.
975 * mangle.c (write_name): Likewise.
978 * error.c (find_typenames_r): Don't walk into a pack expansion.
980 2013-02-13 Jason Merrill <jason@redhat.com>
983 * parser.c (cp_parser_member_declaration): Check the declarator
984 form when detecting a function declaration via typedef.
987 * pt.c (maybe_process_partial_specialization): A lambda
988 isn't what's being specialized.
991 * semantics.c (maybe_add_lambda_conv_op): Mark static thunk
995 * semantics.c (cxx_bind_parameters_in_call): Undo DECL_BY_REFERENCE.
998 * semantics.c (cxx_fold_indirect_ref): Handle empty bases at
999 non-zero offsets, too.
1002 * decl.c (build_enumerator): Always convert the value to a
1003 fixed underlying type.
1006 * pt.c (tsubst_copy_and_build): Don't forget any new
1007 captures that arose from use of dependent names.
1009 2013-02-13 Jakub Jelinek <jakub@redhat.com>
1012 * semantics.c (finish_asm_stmt): If input constraints allow
1013 neither register nor memory, try maybe_constant_value to get
1014 a constant if possible.
1016 2013-02-12 Jason Merrill <jason@redhat.com>
1019 * method.c (add_one_base_init): Handle base constructor
1020 taking rvalue reference parm.
1023 * semantics.c (sort_constexpr_mem_initializers): Handle
1026 2013-02-09 Jason Merrill <jason@redhat.com>
1029 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Call
1030 maybe_instantiate_noexcept.
1033 * pt.c (eq_specializations): Set comparing_specializations.
1034 * tree.c (cp_tree_equal): Check it.
1035 * cp-tree.h: Declare it.
1037 * decl.c (decls_match): Check versions later.
1040 * pt.c (build_non_dependent_expr): Don't try to fold
1041 instantiation-dependent expressions.
1042 (instantiation_dependent_r) [TRAIT_EXPR]: Split out.
1043 [BIND_EXPR]: Treat as dependent.
1045 2013-02-07 Jakub Jelinek <jakub@redhat.com>
1048 * init.c (build_vec_init): Don't append NULL values into new_vec.
1049 (build_zero_init_1): Don't push anything into v if recursive call
1051 (build_value_init_noctor): Don't push anything into v if
1052 build_value_init call returned NULL_TREE.
1055 * parser.c (cp_parser_token_starts_cast_expression): Renamed to...
1056 (cp_parser_tokens_start_cast_expression): ... this. Change parameter
1057 to cp_parser *, call cp_lexer_peek_token first. For CPP_OPEN_PAREN,
1058 return true only if 2nd token isn't CPP_CLOSE_PAREN.
1059 (cp_parser_cast_expression): Adjust caller.
1062 * decl.c (push_local_name): Look at DECL_DISCRIMINATOR (t)
1063 only if DECL_DISCRIMINATOR_SET_P (t) rather than just
1064 DECL_LANG_SPECIFIC (t).
1066 2013-02-07 Jason Merrill <jason@redhat.com>
1069 * method.c (do_build_copy_constructor): Don't bother turning
1070 scalars from lvalues to xvalues.
1071 (do_build_copy_assign): Likewise.
1073 2013-02-06 Jason Merrill <jason@redhat.com>
1075 * parser.c (cp_parser_enum_specifier): Check for error_mark_node.
1077 2013-02-05 Jason Merrill <jason@redhat.com>
1080 * tree.c (lvalue_kind) [INDIRECT_REF]: Don't check for
1084 * decl.c (start_preparsed_function): Update restype if we change
1088 * pt.c (fn_type_unification): Discard any access checks from
1089 substituting explicit args.
1091 2013-01-31 Jason Merrill <jason@redhat.com>
1095 * typeck.c (get_member_function_from_ptrfunc): Fix
1096 ptrmemfunc_vbit_in_delta case.
1098 2013-01-29 Jason Merrill <jason@redhat.com>
1101 * class.c (build_ctor_vtbl_group): Give construction vtables
1104 2013-01-25 Jason Merrill <jason@redhat.com>
1107 * pt.c (convert_nontype_argument_function): Handle invalid input.
1108 (convert_nontype_argument): Likewise.
1111 * typeck.c (get_member_function_from_ptrfunc): Optimize if the
1112 dynamic type has no virtual functions.
1114 2013-01-22 Paolo Carlini <paolo.carlini@oracle.com>
1117 * decl.c (check_initializer): Use TARGET_EXPR_DIRECT_INIT_P only
1118 on TARGET_EXPR nodes.
1120 2013-01-22 Jason Merrill <jason@redhat.com>
1123 * pt.c (maybe_instantiate_noexcept): Don't defer access checks.
1125 2013-01-22 Dodji Seketeli <dodji@redhat.com>
1128 * pt.c (argument_pack_element_is_expansion_p)
1129 (make_argument_pack_select, use_pack_expansion_extra_args_p)
1130 (gen_elem_of_pack_expansion_instantiation): New static functions.
1131 (tsubst): When looking through an ARGUMENT_PACK_SELECT tree node,
1132 look through the possibly resulting pack expansion as well.
1133 (tsubst_pack_expansion): Use use_pack_expansion_extra_p to
1134 generalize when to use the PACK_EXPANSION_EXTRA_ARGS mechanism.
1135 Use gen_elem_of_pack_expansion_instantiation to build the
1136 instantiation piece-wise. Don't use arg_from_parm_pack_p anymore,
1137 as gen_elem_of_pack_expansion_instantiation and the change in
1138 tsubst above generalize this particular case.
1139 (arg_from_parm_pack_p): Remove this for it's not used by
1140 tsubst_pack_expansion anymore.
1142 2013-01-21 Jason Merrill <jason@redhat.com>
1145 * tree.c (strip_typedefs_expr) [TREE_VEC]: Preserve non-default
1146 template args count.
1148 2013-01-18 Jason Merrill <jason@redhat.com>
1151 * decl2.c (get_local_tls_init_fn): New.
1152 (get_tls_init_fn): Handle flag_extern_tls_init. Don't bother
1153 with aliases for internal variables. Don't use weakrefs if
1154 the variable needs destruction.
1155 (generate_tls_wrapper): Mark the wrapper as const if no
1156 initialization is needed.
1157 (handle_tls_init): Don't require aliases.
1159 2013-01-15 Dodji Seketeli <dodji@redhat.com>
1162 * pt.c (coerce_innermost_template_parms): New static function.
1163 (instantiate_alias_template): Use it here.
1165 2013-01-09 Jason Merrill <jason@redhat.com>
1168 * rtti.c (build_typeid, get_typeid): Add complain parm.
1169 (get_tinfo_decl_dynamic): Likewise.
1170 * cp-tree.h, parser.c, pt.c: Adjust.
1173 * decl.c (cp_finish_decl): Clear TREE_READONLY if the variable
1176 2013-01-09 Jakub Jelinek <jakub@redhat.com>
1179 * typeck.c (cp_build_binary_op): For LSHIFT_EXPR and RSHIFT_EXPR,
1180 call maybe_constant_value for the negative or too big shift
1183 2013-01-09 Paolo Carlini <paolo.carlini@oracle.com>
1186 * decl2.c (var_needs_tls_wrapper): Return false when error_operand_p
1187 of the argument is true.
1189 2013-01-08 Joel Brobecker <brobecker@adacore.com>
1191 * parser.c (cp_parser_initializer_list): Move declaration
1192 of variable non_const to start of lexical block.
1194 2013-01-07 Jason Merrill <jason@redhat.com>
1197 * tree.c (build_aggr_init_expr): Do nothing in a template.
1198 * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Strip an ADDR_EXPR off
1199 a FUNCTION_DECL before tsubsting.
1201 2013-01-04 Dodji Seketeli <dodji@redhat.com>
1204 * pt.c (check_instantiated_arg): Allow type template arguments.
1206 2013-01-04 Jason Merrill <jason@redhat.com>
1209 * decl.c (reset_type_linkage, bt_reset_linkage): New.
1210 (grokdeclarator): Use reset_type_linkage.
1211 * name-lookup.c (binding_table_foreach): Handle null table.
1212 * tree.c (decl_anon_ns_mem_p): Check TYPE_MAIN_DECL, not TYPE_NAME.
1214 2013-01-04 Paolo Carlini <paolo.carlini@oracle.com>
1216 PR c++/54526 (again)
1217 * parser.c (cp_parser_template_id): Revert core of previous change
1218 (keep adjusted inform message).
1220 2013-01-03 Jason Merrill <jason@redhat.com>
1224 * pt.c (tsubst_copy_and_build) [TARGET_EXPR]: Don't touch
1228 * semantics.c (trait_expr_value): Call maybe_instantiate_noexcept.
1231 * semantics.c (build_data_member_initialization): Handle DECL_EXPR.
1234 * call.c (type_has_extended_temps): New.
1235 * cp-tree.h: Declare it.
1236 * decl.c (check_initializer): Use build_aggr_init for arrays
1238 * init.c (build_vec_init): Avoid mixed signed/unsigned arithmetic.
1240 2013-01-02 Jason Merrill <jason@redhat.com>
1243 * call.c (build_new_method_call_1): Don't use build_value_init for
1244 user-provided default constructors.
1246 * decl.c (check_default_argument): Use LOOKUP_IMPLICIT.
1250 * tree.c (build_cplus_array_type): Copy layout information
1251 to main variant if necessary.
1253 Copyright (C) 2013 Free Software Foundation, Inc.
1255 Copying and distribution of this file, with or without modification,
1256 are permitted in any medium without royalty provided the copyright
1257 notice and this notice are preserved.