1 2013-04-01 Jason Merrill <jason@redhat.com>
3 * semantics.c (maybe_constant_value): Check
4 instantiation_dependent_expression_p.
5 * pt.c (build_non_dependent_expr): Don't check it here.
8 * init.c (build_new): Don't try to process an array initializer
9 at template definition time.
12 * typeck.c (finish_class_member_access_expr): Handle enum scope.
15 * parser.c (cp_parser_range_for): Don't try to do auto deduction
16 in a template if the type of the range is incomplete.
18 * call.c (add_function_candidate): Take the address of 'this' here.
19 (build_over_call): And here.
20 (build_new_method_call_1, build_op_call_1): Not here.
21 (build_user_type_conversion_1): Or here.
22 (add_candidates): Adjust.
24 * cxx-pretty-print.h (pp_cxx_cv_qualifiers): New.
25 * class.c (same_signature_p): Use type_memfn_quals.
26 * cp-tree.h (TYPE_RAISES_EXCEPTIONS): Use
27 FUNCTION_OR_METHOD_TYPE_CHECK.
28 * error.c (dump_type_suffix): Add padding before cv-qualifiers.
29 * pt.c (unify): Use static_fn_type.
31 2013-04-01 Bronek Kozicki <b.kozicki@gmail.com>
32 Jason Merrill <jason@redhat.com>
34 Implement N2439 (ref-qualifiers for 'this')
35 * cp-tree.h (FUNCTION_REF_QUALIFIED): New.
36 (FUNCTION_RVALUE_QUALIFIED): New.
37 (FUNCTION_OR_METHOD_TYPE_CHECK): New.
38 (cpp0x_warn_str): Add CPP0X_REF_QUALIFIER.
39 (cp_ref_qualifier): New enum.
40 (cp_declarator): Add ref_qualifier.
41 * parser.c (cp_parser_ref_qualifier_seq_opt): New.
42 (cp_parser_direct_declarator): Use it.
43 (make_call_declarator): Adjust.
44 (cp_parser_lambda_declarator_opt): Adjust.
45 * call.c (add_function_candidate): Handle ref-qualifier overload
47 (standard_conversion): Adjust.
48 * class.c (add_method, same_signature_p): Compare ref-qualifiers.
49 * decl.c (grokdeclarator): Handle ref-qualifiers.
50 (grokfndecl): Check for invalid ref-qualifiers.
51 (static_fn_type, revert_static_member_fn): Adjust.
52 * decl2.c (build_memfn_type): Handle ref-qualifiers.
53 (check_classfn): Check them.
54 (cp_reconstruct_complex_type): Retain them.
55 * error.c (dump_ref_qualifier): New.
56 (dump_type_suffix, dump_function_decl): Use it.
57 (maybe_warn_cpp0x): Handle CPP0X_REF_QUALIFIER.
58 * pt.c (tsubst, tsubst_function_type): Instantiate ref-quals.
60 * tree.c (cp_check_qualified_type): New.
61 (cp_build_qualified_type_real): Keep exception spec and ref-qual.
62 (build_ref_qualified_type): New.
63 (strip_typedefs, build_exception_variant): Keep ref-qualifier.
64 (cp_build_type_attribute_variant): Keep ref-qualifier.
65 * typeck.c (merge_types): Keep ref-qualifier.
66 (structural_comptypes): Compare ref-qualifier.
67 (type_memfn_rqual): New.
68 (apply_memfn_quals): Take ref-qual argument.
69 * typeck2.c (build_m_component_ref): Check ref-qualifier.
71 2013-04-01 Paolo Carlini <paolo.carlini@oracle.com>
73 * cp-tree.h (DECL_UNBOUND_CLASS_TEMPLATE_P): Remove.
74 (DECL_FUNCTION_TEMPLATE_P): Adjust.
76 * cxx-pretty-print.c (pp_cxx_nested_name_specifier,
77 pp_cxx_qualified_id): Use get_containing_scope.
78 * parser.c (cp_parser_class_head): Likewise.
79 * pt.c (push_template_decl_real): Likewise.
81 * decl2.c (import_export_decl): Use DECL_TEMPLOID_INSTANTIATION.
82 * pt.c (unify): Use CP_INTEGRAL_TYPE_P.
84 2013-03-31 Paolo Carlini <paolo.carlini@oracle.com>
86 * decl2.c (collect_candidates_for_java_method_aliases): Use
88 * name-lookup.c (pushtag_1) Use TYPE_FUNCTION_SCOPE_P.
89 (pushdecl_maybe_friend_1): Use DECL_DECLARES_FUNCTION_P.
90 * decl.c (duplicate_decls): Likewise.
91 * parser.c (cp_parser_template_declaration_after_export): Likewise,
92 also DECL_DECLARES_TYPE_P.
93 * pt.c (instantiate_class_template_1): Likewise.
94 * search.c (lookup_field_1): Use DECL_DECLARES_TYPE_P.
95 (lookup_field_r): Likewise.
96 (friend_accessible_p): Use DECL_DECLARES_FUNCTION_P.
97 (lookup_fnfields_slot_nolazy): Likewise.
98 * semantics.c (finish_member_declaration): Likewise.
99 * typeck.c (convert_for_initialization): Use TYPE_REFFN_P.
101 2013-03-29 Gabriel Dos Reis <gdr@integrable-solutions.net>
103 * pt.c (template_parms_to_args): Fix typo in comment.
105 2013-03-29 Paolo Carlini <paolo.carlini@oracle.com>
107 * call.c (build_op_call_1): Use TYPE_PTRFN_P and TYPE_REFFN_P.
109 2013-03-29 Paolo Carlini <paolo.carlini@oracle.com>
111 * call.c (add_builtin_candidate): Use TYPE_PTR_P and VOID_TYPE_P.
112 (build_op_call_1): Likewise.
113 (build_over_call): Likewise.
114 (compare_ics): Likewise.
115 * class.c (build_base_path): Likewise.
116 (resolve_address_of_overloaded_function): Likewise.
117 * cp-tree.h: Likewise.
118 * cvt.c (cp_convert_to_pointer): Likewise.
119 (convert_to_reference): Likewise.
120 (ocp_convert): Likewise.
121 (convert_force): Likewise, tidy.
122 * cxx-pretty-print.c (pp_cxx_postfix_expression): Likewise.
123 (pp_cxx_ptr_operator): Likewise.
124 * decl.c (duplicate_decls): Likewise.
125 (start_decl): Likewise.
126 (grok_op_properties): Likewise.
127 (start_preparsed_function): Likewise.
128 (store_parm_decls): Likewise.
129 (finish_function): Likewise.
130 * decl2.c (delete_sanity): Likewise.
131 (acceptable_java_type): Likewise.
132 (grokbitfield): Likewise.
133 (cp_reconstruct_complex_type): Likewise.
134 * error.c (dump_type_prefix): Likewise.
135 (dump_expr): Likewise.
136 * except.c (push_eh_cleanup): Likewise.
137 (complete_ptr_ref_or_void_ptr_p): Likewise.
138 (can_convert_eh): Likewise.
139 * init.c (build_new_1): Likewise.
140 (build_delete): Likewise.
141 (build_vec_delete): Likewise.
142 * mangle.c (write_type): Likewise.
143 * parser.c (lookup_literal_operator): Likewise.
144 * pt.c (convert_nontype_argument_function): Likewise.
145 (convert_nontype_argument): Likewise.
148 (dependent_type_p_r): Likewise.
149 * rtti.c (build_headof): Likewise.
150 (build_typeid): Likewise.
151 (build_dynamic_cast_1): Likewise.
152 (target_incomplete_p): Likewise.
153 (typeinfo_in_lib_p): Likewise.
154 * semantics.c (finish_omp_for): Likewise.
155 (cxx_eval_call_expression): Likewise.
156 (maybe_resolve_dummy): Likewise.
157 * tree.c (build_target_expr): Likewise.
158 (cp_build_qualified_type_real): Likewise.
159 * typeck.c (composite_pointer_type_r): Likewise.
160 (composite_pointer_type): Likewise.
161 (comp_except_types): Likewise.
162 (cxx_sizeof_nowarn): Likewise.
163 (string_conv_p): Likewise.
164 (cp_build_array_ref): Likewise.
165 (cp_build_function_call_vec): Likewise, also use TYPE_PTRFN_P.
166 (pointer_diff): Likewise.
167 (cp_build_addr_expr_1): Likewise.
168 (cp_build_unary_op): Likewise.
169 (build_static_cast_1): Likewise.
170 (cp_build_c_cast): Likewise.
171 (comp_ptr_ttypes_real): Likewise.
172 (ptr_reasonably_similar): Likewise.
173 (comp_ptr_ttypes_const): Likewise.
174 (casts_away_constness): Likewise.
175 (check_literal_operator_args): Likewise.
176 * typeck2.c (build_x_arrow): Likewise.
177 (add_exception_specifier): Likewise.
179 2013-03-29 Jason Merrill <jason@redhat.com>
182 * cp-tree.h (AUTO_IS_DECLTYPE): New.
183 * parser.c (cp_parser_decltype): Handle decltype(auto).
184 (cp_parser_type_id_1): Allow auto without a late-specified
186 (cp_parser_primary_expression): Use the return value of
187 finish_parenthesized_expr.
188 (cp_parser_transaction_expression): Likewise.
189 * semantics.c (force_paren_expr): New.
190 (finish_parenthesized_expr): Use it.
191 * call.c (build_conditional_expr_1): Likewise.
192 * pt.c (do_auto_deduction): Handle decltype(auto).
193 (tsubst_copy): Handle PAREN_EXPR.
194 (tsubst_copy_and_build): Likewise.
195 * error.c (dump_expr): Handle PAREN_EXPR.
196 * cxx-pretty-print.c (pp_cxx_expression): Likewise.
197 * mangle.c (write_expression): Ignore PAREN_EXPR.
199 * parser.c (cp_parser_decltype_expr): Split out...
200 (cp_parser_decltype): ...from here.
204 * pt.c (unify_pack_expansion): Fix indexing.
206 2013-03-29 Gabriel Dos Reis <gdr@integrable-solutions.net>
208 * call.c (build_java_interface_fn_ref): Likewise.
209 (make_temporary_var_for_ref_to_temp): Likewise.
210 * class.c (check_field_decls): Likewise.
211 (layout_class_type): Likewise.
212 (finish_struct_1): Likewise.
213 (fixed_type_or_null): Likewise.
214 (get_vtbl_decl_for_binfo): Likewise.
215 * cp-gimplify.c (omp_var_to_track): Likewise.
216 (cp_genericize_r): Likewise.
217 * cp-objcp-common.c (cxx_warn_unused_global_decl): Likewise.
218 * cp-tree.h (LANG_DECL_HAS_MIN): Likewise.
219 (DECL_DISCRIMINATOR_P): Likewise.
220 * decl.c (poplevel): Likewise.
221 (decls_match): Likewise.
222 (duplicate_decls): Likewise.
223 (decl_jump_unsafe): Likewise.
224 (start_decl): Likewise.
225 (check_for_uninitialized_const_var): Likewise.
226 (make_rtl_for_nonlocal_decl): Likewise.
227 (cp_finish_decl): Likewise.
228 (expand_static_init): Likewise.
229 (local_variable_p): Likewise.
230 (maybe_register_incomplete_var): Likewise.
231 * decl2.c (grokfield): Likewise.
232 (comdat_linkage): Likewise.
233 (determine_visibility): Likewise.
234 (import_export_decl): Likewise.
235 (prune_vars_needing_no_initialization): Likewise.
236 (decl_maybe_constant_var_p): Likewise.
237 * error.c (dump_simple_decl): Likewise.
238 (dump_template_decl): Likewise.
239 (cp_printer): Likewise.
240 * except.c (build_throw): Likewise.
241 * init.c (build_vtbl_address): Likewise.
242 (member_init_ok_or_else): Likewise.
243 (build_aggr_init): Likewise.
244 (expand_aggr_init_1): Likewise.
245 (build_offset_ref): Likewise.
246 (constant_value_1): Likewise.
247 * mangle.c (write_mangled_name): Likewise.
248 (write_prefix): Likewise.
249 * name-lookup.c (supplement_binding_1): Likewise.
250 (add_decl_to_level): Likewise.
251 (pushdecl_maybe_friend_1): Likewise.
252 (check_for_out_of_scope_variable): Likewise.
253 (validate_nonmember_using_decl): Likewise.
254 (lookup_name_innermost_nonclass_level_1): Likewise.
255 (lookup_arg_dependent_1): Likewise.
256 * parser.c (cp_parser_lambda_introducer): Likewise.
257 (cp_parser_template_argument): Likewise.
258 (cp_parser_single_declaration): Likewise.
259 * pt.c (convert_nontype_argument): Likewise.
260 (instantiate_class_template_1): Likewise.
261 (tsubst_decl): Likewise.
262 (tsubst_expr): Likewise.
263 (do_decl_instantiation): Likewise.
264 (do_type_instantiation): Likewise.
265 (regenerate_decl_from_template): Likewise.
266 (always_instantiate_p): Likewise.
267 (instantiate_decl): Likewise.
268 (type_dependent_expression_p): Likewise.
269 (build_non_dependent_expr): Likewise.
270 * repo.c (repo_emit_p): Likewise.
271 * rtti.c (build_dynamic_cast_1): Likewise.
272 * search.c (shared_member_p): Likewise.
273 * semantics.c (outer_var_p): Likewise.
274 (finish_id_expression): Likewise.
275 (finish_omp_clauses): Likewise.
276 (finish_decltype_type): Likewise.
277 (ensure_literal_type_for_constexpr_object): Likewise.
278 * tree.c (lvalue_kind): Likewise.
279 (bot_replace): Likewise.
280 (cp_tree_equal): Likewise.
281 (handle_init_priority_attribute): Likewise.
282 (decl_storage_duration): Likewise.
283 * typeck.c (cxx_sizeof_expr): Likewise.
284 (cxx_alignof_expr): Likewise.
285 (decay_conversion): Likewise.
286 (build_class_member_access_expr): Likewise.
287 (cp_build_array_ref): Likewise.
288 (cxx_mark_addressable): Likewise.
289 (maybe_warn_about_returning_address_of_local): Likewise.
290 (check_return_expr): Likewise.
291 * typeck2.c (cxx_readonly_error): Likewise.
292 (abstract_virtuals_error_sfinae): Likewise.
293 (cxx_incomplete_type_diagnostic): Likewise.
295 2013-03-28 Lawrence Crowl <crowl@google.com>
298 (CXX_PARSER_H): Add header dependence.
300 (extern debug (cp_binding_level &)): New.
301 (extern debug (cp_binding_level *)): New.
303 (debug (cp_binding_level &)): New.
304 (debug (cp_binding_level *)): New.
306 (debug (cp_parser &)): New.
307 (debug (cp_parser *)): New.
308 (debug (cp_token &)): New.
309 (debug (cp_token *)): New.
310 (debug (vec<cp_token, va_gc> &)): New.
311 (debug (vec<cp_token, va_gc> *)): New.
312 * parser.c: Add header dependence.
313 (extern debug (cp_parser &)): New.
314 (extern debug (cp_parser *)): New.
315 (extern debug (cp_token &)): New.
316 (extern debug (cp_token *)): New.
317 (extern debug (vec<cp_token, va_gc> &)): New.
318 (extern debug (vec<cp_token, va_gc> *)): New.
320 2013-03-28 Jason Merrill <jason@redhat.com>
324 * typeck2.c (abstract_virtuals_error_sfinae): Don't complete
325 the type if tf_decltype is set.
326 * pt.c (fn_type_unification): Add decltype_p parm.
327 (get_bindings): Adjust.
329 * class.c (resolve_address_of_overloaded_function): Adjust.
330 * call.c (add_template_candidate_real, print_z_candidate): Adjust.
333 * parser.c (cp_parser_sizeof_pack): Split out from...
334 (cp_parser_sizeof_operand): ...here. Require (id).
337 * semantics.c (finish_this_expr): 'this' is an rvalue.
338 * typeck.c (cp_build_indirect_ref): Handle NOP_EXPR of 'this'.
341 * semantics.c (finish_member_declaration): Don't push closure
344 * name-lookup.c (pushdecl_maybe_friend_1): Use
345 nonlambda_method_basetype and current_nonlambda_class_type.
348 * semantics.c (potential_constant_expression_1) [NOP_EXPR]: Reject
349 conversion from integer to pointer.
350 (cxx_eval_constant_expression): Likewise.
351 (cxx_eval_indirect_ref): Use the folded operand if we still think
352 this might be constant.
354 2013-03-28 Paolo Carlini <paolo.carlini@oracle.com>
355 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
358 * call.c (convert_like_real): Change series of two permerrors
359 to permerror + inform (and likewise for two errors).
360 (build_new_method_call_1): Likewise.
361 * typeck.c (convert_for_initialization): Change additional
362 warning or error to inform.
364 2013-03-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
366 * cp-tree.h (next_aggr_init_expr_arg): Remove static specifier.
367 (first_aggr_init_expr): Likewise.
368 (more_aggr_init_expr_args_p): Likewise.
369 (type_of_this_parm): Likewise.
370 (class_of_this_parm): Likewise.
371 * name-lookup.h (get_global_value_if_present): Likewise.
372 (is_typename_at_global_scope): Likewise.
374 2013-03-28 Paolo Carlini <paolo.carlini@oracle.com>
376 * call.c (joust): Don't call inform for a permerror returning false.
377 * parser.c (cp_parser_check_class_key): Likewise.
378 * pt.c (tsubst_copy_and_build): Likewise.
380 2013-03-27 Jason Merrill <jason@redhat.com>
383 * semantics.c (finish_qualified_id_expr): Return early
386 2013-03-26 Gabriel Dos Reis <gdr@integrable-solutions.net>
388 * call.c (build_new_method_call_1): Use INDIRECT_REF_P.
389 * cvt.c (convert_to_void): Likewise.
390 * error.c (dump_expr): Likewise.
391 * mangle.c (write_expression): Likewise.
392 * parser.c (cp_parser_template_argument): Likewise.
393 * pt.c (convert_nontype_argument): Likewise.
394 (tsubst_copy_and_build): Likewise.
395 * rtti.c (build_typeid): Likewise.
396 * semantics.c (finish_call_expr): Likewise.
397 (finish_decltype_type): Likewise.
398 (build_data_member_initialization): Likewise.
399 * tree.c (is_dummy_object): Likewise.
400 * typeck.c (decay_conversion): Likewise.
401 (build_class_member_access_expr): Likewise.
402 (cp_build_addr_expr_1): Likewise.
403 (unary_complex_lvalue): Likewise.
404 (check_return_expr): Likewise.
405 * typeck2.c (cxx_readonly_error): Likewise.
407 2013-03-26 Jason Merrill <jason@redhat.com>
410 * typeck.c (invalid_nonstatic_memfn_p): Use get_first_fn. Take tree.
411 * semantics.c (finish_decltype_type): Check it before type_unknown_p.
412 * cp-tree.h: Adjust prototype.
415 * typeck2.c (build_m_component_ref): Handle prvalue object.
417 2013-03-26 Gabriel Dos Reis <gdr@integrable-solutions.net>
419 * cp-gimplify.c (cp_genericize_r): Use VAR_OR_FUNCTION_DECL_P.
420 * decl.c (duplicate_decls): Likewise.
421 (cp_finish_decl): Likewise.
422 (check_class_member_definition_namespace): Likewise.
423 * decl2.c (grokfield): Likewise.
424 (decl_needed_p): Likewise.
425 (import_export_decl): Likewise.
426 (mark_used): Likewise.
427 * name-lookup.c (pushdecl_maybe_friend_1): Likewise.
428 * pt.c (push_access_scope): Likewise.
429 (instantiate_decl): Likewise.
430 * ptree.c (cxx_print_decl): Likewise.
431 * repo.c (repo_emit_p): Likewise.
432 * semantics.c (note_decl_for_pch): Likewise.
433 * tree.c (decl_linkage): Likewise.
435 2013-03-26 Paolo Carlini <paolo.carlini@oracle.com>
438 * decl.c (check_array_designated_initializer): Handle CONST_DECL
441 2013-03-26 Paolo Carlini <paolo.carlini@oracle.com>
443 * decl.c (grokfndecl): Handle separately <inline> and <constexpr>
446 * decl.c (grokdeclarator): Declare typedef_p and use it everywhere.
448 2013-03-25 Jason Merrill <jason@redhat.com>
451 * semantics.c (maybe_resolve_dummy): Make sure that the enclosing
452 class is derived from the type of the object.
455 * semantics.c (lambda_expr_this_capture): Don't capture 'this' in
458 2013-03-25 Paolo Carlini <paolo.carlini@oracle.com>
461 * decl.c (cp_finish_decl): Check DECL_LANG_SPECIFIC before
462 DECL_TEMPLATE_INSTANTIATION.
464 2013-03-22 Jason Merrill <jason@redhat.com>
467 * pt.c (instantiation_dependent_r): Check DECL_INITIAL of VAR_DECL
470 2013-03-21 Gabriel Dos Reis <gdr@integrable-solutions.net>
472 * cp-tree.h (identifier_p): New.
473 * call.c: Throughout, call identifier_p insstead of direct
474 comparaison of TREE_CODE against IDENTIFIER_NODE.
478 * mangle.c: Likewise.
479 * name-lookup.c: Likewise.
480 * parser.c: Likewise.
482 * search.c: Likewise.
483 * semantics.c: Likewise.
485 * typeck.c: Likewise.
486 * typeck2.c: Likewise.
488 2013-03-21 Jakub Jelinek <jakub@redhat.com>
491 * pt.c (convert_nontype_argument): Count werrorcount as warnings.
492 * call.c (build_temp): Likewise.
493 * method.c (synthesize_method): Likewise.
494 * typeck.c (convert_for_initialization): Likewise.
496 2013-03-21 Marc Glisse <marc.glisse@inria.fr>
498 * call.c (build_conditional_expr_1): Fold VEC_COND_EXPR.
500 2013-03-21 Richard Biener <rguenther@suse.de>
502 * error.c (cp_printer): Use DECL_HAS_DEBUG_EXPR_P instead of
503 DECL_DEBUG_EXPR_IS_FROM. Guard properly.
505 2013-03-20 Jason Merrill <jason@redhat.com>
508 * parser.c (cp_parser_late_return_type_opt): Save and restore
509 current_class_ptr/ref.
512 * expr.c (cplus_expand_constant): Do nothing if the class is
514 * semantics.c (reduced_constant_expression_p): Allow PTRMEM_CST.
515 * typeck2.c (store_init_value): Use reduced_constant_expression_p.
516 * decl.c (maybe_register_incomplete_var): Handle PTRMEM_CST.
517 (complete_vars): Likewise.
519 * name-lookup.c (get_anonymous_namespace_name): Never use
520 get_file_function_name.
522 * pt.c (retrieve_specialization): Handle null tmpl argument.
526 * pt.c (tsubst_decl): Check return value of register_specialization.
527 * typeck2.c (abstract_virtuals_error_sfinae): Re-apply complete_type
530 2013-03-17 Jason Merrill <jason@redhat.com>
534 * parser.c (cp_parser_direct_declarator): Bail if we see a
535 qualified-id not at namespace scope.
539 * typeck2.c (abstract_virtuals_error_sfinae): Revert complete_type
542 2013-03-16 Jason Merrill <jason@redhat.com>
544 * decl.c (grokdeclarator): Assert that we won't see a pointer to
548 * cp-tree.h (WILDCARD_TYPE_P): Split out from...
549 (MAYBE_CLASS_TYPE_P): ...here.
550 * semantics.c (lambda_capture_field_type): Only build a
551 magic decltype for wildcard types.
552 (lambda_proxy_type): Likewise.
553 (finish_non_static_data_member): Get the quals from
557 * parser.c (cp_parser_template_argument): Don't
558 fold_non_dependent_expr.
560 * parser.c (cp_parser_lambda_declarator_opt): Use
561 cp_parser_trailing_type_id.
564 * parser.c (cp_parser_template_id): Don't forget access checks.
567 * pt.c (tsubst_qualified_id): Use current_nonlambda_class_type.
571 * name-lookup.h (tag_scope): Add ts_lambda.
572 * semantics.c (begin_lambda_type): Use it.
573 * decl.c (xref_tag_1): Set CLASSTYPE_LAMBDA_EXPR.
574 * pt.c (check_default_tmpl_args): Ignore lambdas.
575 (push_template_decl_real): Handle lambdas.
576 * tree.c (no_linkage_check): Adjust lambda check.
579 * tree.c (strip_typedefs_expr): Complain about lambda, don't abort.
582 * parser.c (cp_parser_direct_declarator): Fix late return
583 for out-of-class defn of member function.
586 * semantics.c (maybe_add_lambda_conv_op): Clear DECL_NAME of copied
587 parms to avoid duplicate -Wshadow warnings.
589 * search.c (lookup_base): Handle NULL_TREE.
592 * semantics.c (potential_constant_expression_1): Use of 'this' in
593 a non-constexpr function makes the expression not potentially
598 * cp-tree.h (tsubst_flags): Add tf_decltype.
599 * call.c (build_cxx_call): Don't build a temporary if it's set.
600 (build_over_call): Make sure it's only passed to build_cxx_call.
601 * parser.c (cp_parser_primary_expression): Add decltype_p parm.
602 (cp_parser_unary_expression): Likewise.
603 (cp_parser_cast_expression): Likewise.
604 (cp_parser_binary_expression): Likewise.
605 (cp_parser_assignment_expression): Likewise.
606 (cp_parser_postfix_expression): Likewise. Pass tf_decltype.
607 (cp_parser_expression): Add decltype_p. Force a
608 temporary for a call on the LHS of a comma.
609 (cp_parser_decltype): Pass true to decltype_p parms.
610 * pt.c (tsubst) [DECLTYPE_TYPE]: Pass tf_decltype.
611 (tsubst_copy_and_build): Pass tf_decltype down only for
612 CALL_EXPR and the RHS of COMPOUND_EXPR.
613 * tree.c (build_cplus_new): Call complete_type_or_maybe_complain.
615 * cp-tree.h (abstract_class_use): New enum.
616 * typeck2.c (pending_abstract_type): Add use field.
617 (abstract_virtuals_error_sfinae): Add overloads taking
618 abstract_class_use instead of tree.
619 * typeck.c (build_static_cast_1): Call it.
620 * except.c (is_admissible_throw_operand_or_catch_parameter): Call it.
621 * pt.c: Adjust calls.
622 * decl.c (cp_finish_decl): Don't handle functions specially.
623 (grokdeclarator): Always check return type.
624 * init.c (build_new_1): Adjust call.
628 * pt.c (tsubst) [ARRAY_TYPE]: Use abstract_virtuals_error_sfinae.
629 * typeck2.c (abstract_virtuals_error_sfinae): Call complete_type.
632 * pt.c (tsubst_function_type): Call abstract_virtuals_error_sfinae.
633 (tsubst_arg_types): Likewise.
637 * call.c (convert_like_real): Check for explicit constructors
638 even for value-initialization.
641 * pt.c (convert_nontype_argument): Handle invalid pointer.
643 * parser.c (cp_parser_lambda_expression): Use nreverse.
647 * pt.c (instantiate_class_template_1): Instantiate lambda capture
649 (tsubst_copy_and_build): Not here.
652 * method.c (walk_field_subobs): Disallow copy of rvalue ref.
655 * parser.c (parsing_nsdmi): New.
656 * semantics.c (outer_automatic_var_p): Check it.
657 (finish_id_expression): Likewise.
658 * cp-tree.h: Declare it.
661 * error.c (dump_expr) [SIZEOF_EXPR]: Print sizeof... properly.
663 * parser.c (lookup_literal_operator): Correct parm/arg naming
667 * pt.c (fold_non_dependent_expr_sfinae): Check
668 instantiation_dependent_expression_p.
671 * class.c (resolve_address_of_overloaded_function): Accept a
672 reference to function for target_type.
673 (instantiate_type): Likewise.
674 * pt.c (convert_nontype_argument): Pass it to
675 convert_nontype_argument_function.
677 2013-03-16 Jakub Jelinek <jakub@redhat.com>
679 * tree.c (cp_tree_equal): Fix a pasto.
682 * typeck.c (cp_build_binary_op): When calling warn_for_div_by_zero,
683 pass op1 through maybe_constant_value first.
685 2013-03-16 Paolo Carlini <paolo.carlini@oracle.com>
688 * semantics.c (cxx_eval_array_reference): Check for negative index.
690 2013-03-14 Jason Merrill <jason@redhat.com>
693 * decl.c (local_variable_p_walkfn): Check DECL_ARTIFICIAL again.
696 * decl.c (register_dtor_fn): Pass null to __cxa_thread_atexit
697 dso_handle parm on targets without __cxa_atexit.
699 2013-03-11 Jason Merrill <jason@redhat.com>
702 * typeck.c (check_return_expr): Disallow returning init list here.
703 * semantics.c (apply_deduced_return_type): Not here.
705 2013-03-08 Paolo Carlini <paolo.carlini@oracle.com>
708 * cxx-pretty-print.c (pp_cxx_expression): Handle LAMBDA_EXPR.
709 * error.c (dump_expr): Likewise.
711 2013-03-08 Jason Merrill <jason@redhat.com>
714 * class.c (modify_all_vtables): Mangle the vtable name before
717 * semantics.c (lambda_expr_this_capture): In unevaluated context,
718 just return the nearest 'this'.
723 * tree.c (maybe_dummy_object): Don't capture 'this'.
724 * semantics.c (maybe_resolve_dummy): New.
725 (finish_non_static_data_member): Use it.
726 (finish_qualified_id_expr): Don't test is_dummy_object.
727 * cp-tree.h: Declare maybe_resolve_dummy.
728 * call.c (build_new_method_call_1): Use it.
731 * semantics.c (apply_deduced_return_type): Don't allow returning
732 std::initializer_list.
734 2013-03-06 Paolo Carlini <paolo.carlini@oracle.com>
737 * parser.c (cp_parser_elaborated_type_specifier): Don't call
738 check_elaborated_type_specifier when TREE_CODE (decl) != TYPE_DECL.
739 * decl.c (check_elaborated_type_specifier): Tidy.
741 2013-03-06 Jakub Jelinek <jakub@redhat.com>
744 * tree.c (strip_typedefs): Don't copy args if they are NULL.
746 2013-03-05 Jakub Jelinek <jakub@redhat.com>
748 * parser.c (cp_parser_braced_list): For {} initialize
749 *non_constant_p to false.
751 2013-03-04 Jason Merrill <jason@redhat.com>
755 * semantics.c (lambda_expr_this_capture): Handle NSDMI
756 and non-class scopes.
758 2013-03-01 Paolo Carlini <paolo.carlini@oracle.com>
760 * decl.c (grokdeclarator): Remove dead code.
762 2013-02-28 Jason Merrill <jason@redhat.com>
765 * semantics.c (potential_constant_expression_1): Use
766 cxx_eval_outermost_constant_expr rather than maybe_constant_value.
769 * call.c (build_over_call): Avoid virtual lookup in a template.
771 2013-02-27 Jason Merrill <jason@redhat.com>
775 * name-lookup.c (do_class_using_decl): Use ctor_identifier instead
776 of the base name for inheriting ctors.
777 (push_class_level_binding_1): Remove inheriting ctor handling.
778 * pt.c (tsubst_decl) [USING_DECL]: Likewise.
779 * class.c (add_implicitly_declared_members): Adjust.
781 2013-02-26 David Binderman <dcb314@hotmail.com>
784 * decl.c (grokdeclarator): Tidy publicp assignment.
786 2013-02-25 Aldy Hernandez <aldyh@redhat.com>
789 * semantics.c (begin_transaction_stmt): Set TREE_SIDE_EFFECTS.
790 (build_transaction_expr): Same.
792 2013-02-25 Jason Merrill <jason@redhat.com>
795 * pt.c (fn_type_unification): Wait to call push_tinst_level until
796 we know what args we're looking at.
799 * semantics.c (potential_constant_expression_1): In C++98, a cast
800 to non-integral type can't be a constant expression.
802 2013-02-24 Jakub Jelinek <jakub@redhat.com>
805 * init.c (build_zero_init_1): Use RECORD_OR_UNION_CODE_P instead
808 2013-02-22 Jason Merrill <jason@redhat.com>
811 * pt.c (push_template_decl_real): Set DECL_INTERFACE_KNOWN
812 if we got the wrong number of template parms.
815 * pt.c (fn_type_unification): Use explicit args in template
816 instantiation context.
819 * call.c (can_convert_arg): Discard access checks.
822 * tree.c (strip_typedefs): Strip typedefs from TYPENAME_TYPE template
825 2013-02-20 Paolo Carlini <paolo.carlini@oracle.com>
828 * tree.c (maybe_warn_zero_as_null_pointer_constant): Add.
829 * cvt.c (ocp_convert): Use the latter.
830 (cp_convert_to_pointer): Likewise.
831 * decl.c (check_default_argument): Likewise.
832 * typeck.c (cp_build_binary_op): Likewise.
833 * cp-tree.h (maybe_warn_zero_as_null_pointer_constant): Declare.
835 2013-02-15 Jonathan Wakely <jwakely.gcc@gmail.com>
836 Paolo Carlini <paolo.carlini@oracle.com>
839 * decl2.c (grokbitfield): Allow scoped enumeration types.
841 2013-02-15 Jason Merrill <jason@redhat.com>
844 * semantics.c (finish_id_expression): Also return the identifier
845 for an outer local static.
848 * class.c (check_bases_and_members): Deduce noexcept after
852 * semantics.c (finish_id_expression): In a template, return
853 the identifier for a constant variable.
855 2013-02-14 Jason Merrill <jason@redhat.com>
858 * semantics.c (build_anon_member_initialization): New.
859 (build_data_member_initialization): Use it.
862 * decl.c (cp_finish_decl): Force instantiation of an
863 auto static data member.
866 * pt.c (unify): A pack expansion that is not the last template
867 argument makes the entire template argument list non-deduced.
870 * name-lookup.c (do_class_using_decl): Handle typedefs with
871 inheriting constructors.
872 (push_class_level_binding_1): Allow inheriting from template
873 template parameter, too.
874 * pt.c (tsubst_decl) [USING_DECL]: Likewise.
877 * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Fix handling of
878 default argument scope.
879 * mangle.c (write_name): Likewise.
882 * error.c (find_typenames_r): Don't walk into a pack expansion.
884 2013-02-13 Jason Merrill <jason@redhat.com>
887 * parser.c (cp_parser_member_declaration): Check the declarator
888 form when detecting a function declaration via typedef.
891 * pt.c (maybe_process_partial_specialization): A lambda
892 isn't what's being specialized.
895 * semantics.c (maybe_add_lambda_conv_op): Mark static thunk
899 * semantics.c (cxx_bind_parameters_in_call): Undo DECL_BY_REFERENCE.
902 * semantics.c (cxx_fold_indirect_ref): Handle empty bases at
903 non-zero offsets, too.
906 * decl.c (build_enumerator): Always convert the value to a
907 fixed underlying type.
910 * pt.c (tsubst_copy_and_build): Don't forget any new
911 captures that arose from use of dependent names.
913 2013-02-13 Jakub Jelinek <jakub@redhat.com>
916 * semantics.c (finish_asm_stmt): If input constraints allow
917 neither register nor memory, try maybe_constant_value to get
918 a constant if possible.
920 2013-02-12 Jason Merrill <jason@redhat.com>
923 * method.c (add_one_base_init): Handle base constructor
924 taking rvalue reference parm.
927 * semantics.c (sort_constexpr_mem_initializers): Handle
930 2013-02-09 Jason Merrill <jason@redhat.com>
933 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Call
934 maybe_instantiate_noexcept.
937 * pt.c (eq_specializations): Set comparing_specializations.
938 * tree.c (cp_tree_equal): Check it.
939 * cp-tree.h: Declare it.
941 * decl.c (decls_match): Check versions later.
944 * pt.c (build_non_dependent_expr): Don't try to fold
945 instantiation-dependent expressions.
946 (instantiation_dependent_r) [TRAIT_EXPR]: Split out.
947 [BIND_EXPR]: Treat as dependent.
949 2013-02-07 Jakub Jelinek <jakub@redhat.com>
952 * init.c (build_vec_init): Don't append NULL values into new_vec.
953 (build_zero_init_1): Don't push anything into v if recursive call
955 (build_value_init_noctor): Don't push anything into v if
956 build_value_init call returned NULL_TREE.
959 * parser.c (cp_parser_token_starts_cast_expression): Renamed to...
960 (cp_parser_tokens_start_cast_expression): ... this. Change parameter
961 to cp_parser *, call cp_lexer_peek_token first. For CPP_OPEN_PAREN,
962 return true only if 2nd token isn't CPP_CLOSE_PAREN.
963 (cp_parser_cast_expression): Adjust caller.
966 * decl.c (push_local_name): Look at DECL_DISCRIMINATOR (t)
967 only if DECL_DISCRIMINATOR_SET_P (t) rather than just
968 DECL_LANG_SPECIFIC (t).
970 2013-02-07 Jason Merrill <jason@redhat.com>
973 * method.c (do_build_copy_constructor): Don't bother turning
974 scalars from lvalues to xvalues.
975 (do_build_copy_assign): Likewise.
977 2013-02-06 Jason Merrill <jason@redhat.com>
979 * parser.c (cp_parser_enum_specifier): Check for error_mark_node.
981 2013-02-05 Jason Merrill <jason@redhat.com>
984 * tree.c (lvalue_kind) [INDIRECT_REF]: Don't check for
988 * decl.c (start_preparsed_function): Update restype if we change
992 * pt.c (fn_type_unification): Discard any access checks from
993 substituting explicit args.
995 2013-01-31 Jason Merrill <jason@redhat.com>
999 * typeck.c (get_member_function_from_ptrfunc): Fix
1000 ptrmemfunc_vbit_in_delta case.
1002 2013-01-29 Jason Merrill <jason@redhat.com>
1005 * class.c (build_ctor_vtbl_group): Give construction vtables
1008 2013-01-25 Jason Merrill <jason@redhat.com>
1011 * pt.c (convert_nontype_argument_function): Handle invalid input.
1012 (convert_nontype_argument): Likewise.
1015 * typeck.c (get_member_function_from_ptrfunc): Optimize if the
1016 dynamic type has no virtual functions.
1018 2013-01-22 Paolo Carlini <paolo.carlini@oracle.com>
1021 * decl.c (check_initializer): Use TARGET_EXPR_DIRECT_INIT_P only
1022 on TARGET_EXPR nodes.
1024 2013-01-22 Jason Merrill <jason@redhat.com>
1027 * pt.c (maybe_instantiate_noexcept): Don't defer access checks.
1029 2013-01-22 Dodji Seketeli <dodji@redhat.com>
1032 * pt.c (argument_pack_element_is_expansion_p)
1033 (make_argument_pack_select, use_pack_expansion_extra_args_p)
1034 (gen_elem_of_pack_expansion_instantiation): New static functions.
1035 (tsubst): When looking through an ARGUMENT_PACK_SELECT tree node,
1036 look through the possibly resulting pack expansion as well.
1037 (tsubst_pack_expansion): Use use_pack_expansion_extra_p to
1038 generalize when to use the PACK_EXPANSION_EXTRA_ARGS mechanism.
1039 Use gen_elem_of_pack_expansion_instantiation to build the
1040 instantiation piece-wise. Don't use arg_from_parm_pack_p anymore,
1041 as gen_elem_of_pack_expansion_instantiation and the change in
1042 tsubst above generalize this particular case.
1043 (arg_from_parm_pack_p): Remove this for it's not used by
1044 tsubst_pack_expansion anymore.
1046 2013-01-21 Jason Merrill <jason@redhat.com>
1049 * tree.c (strip_typedefs_expr) [TREE_VEC]: Preserve non-default
1050 template args count.
1052 2013-01-18 Jason Merrill <jason@redhat.com>
1055 * decl2.c (get_local_tls_init_fn): New.
1056 (get_tls_init_fn): Handle flag_extern_tls_init. Don't bother
1057 with aliases for internal variables. Don't use weakrefs if
1058 the variable needs destruction.
1059 (generate_tls_wrapper): Mark the wrapper as const if no
1060 initialization is needed.
1061 (handle_tls_init): Don't require aliases.
1063 2013-01-15 Dodji Seketeli <dodji@redhat.com>
1066 * pt.c (coerce_innermost_template_parms): New static function.
1067 (instantiate_alias_template): Use it here.
1069 2013-01-09 Jason Merrill <jason@redhat.com>
1072 * rtti.c (build_typeid, get_typeid): Add complain parm.
1073 (get_tinfo_decl_dynamic): Likewise.
1074 * cp-tree.h, parser.c, pt.c: Adjust.
1077 * decl.c (cp_finish_decl): Clear TREE_READONLY if the variable
1080 2013-01-09 Jakub Jelinek <jakub@redhat.com>
1083 * typeck.c (cp_build_binary_op): For LSHIFT_EXPR and RSHIFT_EXPR,
1084 call maybe_constant_value for the negative or too big shift
1087 2013-01-09 Paolo Carlini <paolo.carlini@oracle.com>
1090 * decl2.c (var_needs_tls_wrapper): Return false when error_operand_p
1091 of the argument is true.
1093 2013-01-08 Joel Brobecker <brobecker@adacore.com>
1095 * parser.c (cp_parser_initializer_list): Move declaration
1096 of variable non_const to start of lexical block.
1098 2013-01-07 Jason Merrill <jason@redhat.com>
1101 * tree.c (build_aggr_init_expr): Do nothing in a template.
1102 * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Strip an ADDR_EXPR off
1103 a FUNCTION_DECL before tsubsting.
1105 2013-01-04 Dodji Seketeli <dodji@redhat.com>
1108 * pt.c (check_instantiated_arg): Allow type template arguments.
1110 2013-01-04 Jason Merrill <jason@redhat.com>
1113 * decl.c (reset_type_linkage, bt_reset_linkage): New.
1114 (grokdeclarator): Use reset_type_linkage.
1115 * name-lookup.c (binding_table_foreach): Handle null table.
1116 * tree.c (decl_anon_ns_mem_p): Check TYPE_MAIN_DECL, not TYPE_NAME.
1118 2013-01-04 Paolo Carlini <paolo.carlini@oracle.com>
1120 PR c++/54526 (again)
1121 * parser.c (cp_parser_template_id): Revert core of previous change
1122 (keep adjusted inform message).
1124 2013-01-03 Jason Merrill <jason@redhat.com>
1128 * pt.c (tsubst_copy_and_build) [TARGET_EXPR]: Don't touch
1132 * semantics.c (trait_expr_value): Call maybe_instantiate_noexcept.
1135 * semantics.c (build_data_member_initialization): Handle DECL_EXPR.
1138 * call.c (type_has_extended_temps): New.
1139 * cp-tree.h: Declare it.
1140 * decl.c (check_initializer): Use build_aggr_init for arrays
1142 * init.c (build_vec_init): Avoid mixed signed/unsigned arithmetic.
1144 2013-01-02 Jason Merrill <jason@redhat.com>
1147 * call.c (build_new_method_call_1): Don't use build_value_init for
1148 user-provided default constructors.
1150 * decl.c (check_default_argument): Use LOOKUP_IMPLICIT.
1154 * tree.c (build_cplus_array_type): Copy layout information
1155 to main variant if necessary.
1157 Copyright (C) 2013 Free Software Foundation, Inc.
1159 Copying and distribution of this file, with or without modification,
1160 are permitted in any medium without royalty provided the copyright
1161 notice and this notice are preserved.