1 2013-04-02 Paolo Carlini <paolo.carlini@oracle.com>
3 * cp-tree.h (TAGGED_TYPE_P): Remove.
4 (IS_OVERLOAD_TYPE): Rename to OVERLOAD_TYPE_P, adjust.
5 (TYPE_ANONYMOUS_P): Adjust.
6 * call.c (build_new_op_1): Likewise.
7 * class.c (find_abi_tags_r): Likewise.
8 * decl.c (warn_misplaced_attr_for_class_type, start_decl,
9 type_is_deprecated): Likewise.
10 * decl2.c (grokfield, min_vis_r): Likewise.
11 * pt.c (get_template_info): Likewise.
12 * tree.c (handle_abi_tag_attribute): Likewise.
14 2013-04-01 Jason Merrill <jason@redhat.com>
16 * semantics.c (maybe_constant_value): Check
17 instantiation_dependent_expression_p.
18 * pt.c (build_non_dependent_expr): Don't check it here.
21 * init.c (build_new): Don't try to process an array initializer
22 at template definition time.
25 * typeck.c (finish_class_member_access_expr): Handle enum scope.
28 * parser.c (cp_parser_range_for): Don't try to do auto deduction
29 in a template if the type of the range is incomplete.
31 * call.c (add_function_candidate): Take the address of 'this' here.
32 (build_over_call): And here.
33 (build_new_method_call_1, build_op_call_1): Not here.
34 (build_user_type_conversion_1): Or here.
35 (add_candidates): Adjust.
37 * cxx-pretty-print.h (pp_cxx_cv_qualifiers): New.
38 * class.c (same_signature_p): Use type_memfn_quals.
39 * cp-tree.h (TYPE_RAISES_EXCEPTIONS): Use
40 FUNCTION_OR_METHOD_TYPE_CHECK.
41 * error.c (dump_type_suffix): Add padding before cv-qualifiers.
42 * pt.c (unify): Use static_fn_type.
44 2013-04-01 Bronek Kozicki <b.kozicki@gmail.com>
45 Jason Merrill <jason@redhat.com>
47 Implement N2439 (ref-qualifiers for 'this')
48 * cp-tree.h (FUNCTION_REF_QUALIFIED): New.
49 (FUNCTION_RVALUE_QUALIFIED): New.
50 (FUNCTION_OR_METHOD_TYPE_CHECK): New.
51 (cpp0x_warn_str): Add CPP0X_REF_QUALIFIER.
52 (cp_ref_qualifier): New enum.
53 (cp_declarator): Add ref_qualifier.
54 * parser.c (cp_parser_ref_qualifier_seq_opt): New.
55 (cp_parser_direct_declarator): Use it.
56 (make_call_declarator): Adjust.
57 (cp_parser_lambda_declarator_opt): Adjust.
58 * call.c (add_function_candidate): Handle ref-qualifier overload
60 (standard_conversion): Adjust.
61 * class.c (add_method, same_signature_p): Compare ref-qualifiers.
62 * decl.c (grokdeclarator): Handle ref-qualifiers.
63 (grokfndecl): Check for invalid ref-qualifiers.
64 (static_fn_type, revert_static_member_fn): Adjust.
65 * decl2.c (build_memfn_type): Handle ref-qualifiers.
66 (check_classfn): Check them.
67 (cp_reconstruct_complex_type): Retain them.
68 * error.c (dump_ref_qualifier): New.
69 (dump_type_suffix, dump_function_decl): Use it.
70 (maybe_warn_cpp0x): Handle CPP0X_REF_QUALIFIER.
71 * pt.c (tsubst, tsubst_function_type): Instantiate ref-quals.
73 * tree.c (cp_check_qualified_type): New.
74 (cp_build_qualified_type_real): Keep exception spec and ref-qual.
75 (build_ref_qualified_type): New.
76 (strip_typedefs, build_exception_variant): Keep ref-qualifier.
77 (cp_build_type_attribute_variant): Keep ref-qualifier.
78 * typeck.c (merge_types): Keep ref-qualifier.
79 (structural_comptypes): Compare ref-qualifier.
80 (type_memfn_rqual): New.
81 (apply_memfn_quals): Take ref-qual argument.
82 * typeck2.c (build_m_component_ref): Check ref-qualifier.
84 2013-04-01 Paolo Carlini <paolo.carlini@oracle.com>
86 * cp-tree.h (DECL_UNBOUND_CLASS_TEMPLATE_P): Remove.
87 (DECL_FUNCTION_TEMPLATE_P): Adjust.
89 * cxx-pretty-print.c (pp_cxx_nested_name_specifier,
90 pp_cxx_qualified_id): Use get_containing_scope.
91 * parser.c (cp_parser_class_head): Likewise.
92 * pt.c (push_template_decl_real): Likewise.
94 * decl2.c (import_export_decl): Use DECL_TEMPLOID_INSTANTIATION.
95 * pt.c (unify): Use CP_INTEGRAL_TYPE_P.
97 2013-03-31 Paolo Carlini <paolo.carlini@oracle.com>
99 * decl2.c (collect_candidates_for_java_method_aliases): Use
101 * name-lookup.c (pushtag_1) Use TYPE_FUNCTION_SCOPE_P.
102 (pushdecl_maybe_friend_1): Use DECL_DECLARES_FUNCTION_P.
103 * decl.c (duplicate_decls): Likewise.
104 * parser.c (cp_parser_template_declaration_after_export): Likewise,
105 also DECL_DECLARES_TYPE_P.
106 * pt.c (instantiate_class_template_1): Likewise.
107 * search.c (lookup_field_1): Use DECL_DECLARES_TYPE_P.
108 (lookup_field_r): Likewise.
109 (friend_accessible_p): Use DECL_DECLARES_FUNCTION_P.
110 (lookup_fnfields_slot_nolazy): Likewise.
111 * semantics.c (finish_member_declaration): Likewise.
112 * typeck.c (convert_for_initialization): Use TYPE_REFFN_P.
114 2013-03-29 Gabriel Dos Reis <gdr@integrable-solutions.net>
116 * pt.c (template_parms_to_args): Fix typo in comment.
118 2013-03-29 Paolo Carlini <paolo.carlini@oracle.com>
120 * call.c (build_op_call_1): Use TYPE_PTRFN_P and TYPE_REFFN_P.
122 2013-03-29 Paolo Carlini <paolo.carlini@oracle.com>
124 * call.c (add_builtin_candidate): Use TYPE_PTR_P and VOID_TYPE_P.
125 (build_op_call_1): Likewise.
126 (build_over_call): Likewise.
127 (compare_ics): Likewise.
128 * class.c (build_base_path): Likewise.
129 (resolve_address_of_overloaded_function): Likewise.
130 * cp-tree.h: Likewise.
131 * cvt.c (cp_convert_to_pointer): Likewise.
132 (convert_to_reference): Likewise.
133 (ocp_convert): Likewise.
134 (convert_force): Likewise, tidy.
135 * cxx-pretty-print.c (pp_cxx_postfix_expression): Likewise.
136 (pp_cxx_ptr_operator): Likewise.
137 * decl.c (duplicate_decls): Likewise.
138 (start_decl): Likewise.
139 (grok_op_properties): Likewise.
140 (start_preparsed_function): Likewise.
141 (store_parm_decls): Likewise.
142 (finish_function): Likewise.
143 * decl2.c (delete_sanity): Likewise.
144 (acceptable_java_type): Likewise.
145 (grokbitfield): Likewise.
146 (cp_reconstruct_complex_type): Likewise.
147 * error.c (dump_type_prefix): Likewise.
148 (dump_expr): Likewise.
149 * except.c (push_eh_cleanup): Likewise.
150 (complete_ptr_ref_or_void_ptr_p): Likewise.
151 (can_convert_eh): Likewise.
152 * init.c (build_new_1): Likewise.
153 (build_delete): Likewise.
154 (build_vec_delete): Likewise.
155 * mangle.c (write_type): Likewise.
156 * parser.c (lookup_literal_operator): Likewise.
157 * pt.c (convert_nontype_argument_function): Likewise.
158 (convert_nontype_argument): Likewise.
161 (dependent_type_p_r): Likewise.
162 * rtti.c (build_headof): Likewise.
163 (build_typeid): Likewise.
164 (build_dynamic_cast_1): Likewise.
165 (target_incomplete_p): Likewise.
166 (typeinfo_in_lib_p): Likewise.
167 * semantics.c (finish_omp_for): Likewise.
168 (cxx_eval_call_expression): Likewise.
169 (maybe_resolve_dummy): Likewise.
170 * tree.c (build_target_expr): Likewise.
171 (cp_build_qualified_type_real): Likewise.
172 * typeck.c (composite_pointer_type_r): Likewise.
173 (composite_pointer_type): Likewise.
174 (comp_except_types): Likewise.
175 (cxx_sizeof_nowarn): Likewise.
176 (string_conv_p): Likewise.
177 (cp_build_array_ref): Likewise.
178 (cp_build_function_call_vec): Likewise, also use TYPE_PTRFN_P.
179 (pointer_diff): Likewise.
180 (cp_build_addr_expr_1): Likewise.
181 (cp_build_unary_op): Likewise.
182 (build_static_cast_1): Likewise.
183 (cp_build_c_cast): Likewise.
184 (comp_ptr_ttypes_real): Likewise.
185 (ptr_reasonably_similar): Likewise.
186 (comp_ptr_ttypes_const): Likewise.
187 (casts_away_constness): Likewise.
188 (check_literal_operator_args): Likewise.
189 * typeck2.c (build_x_arrow): Likewise.
190 (add_exception_specifier): Likewise.
192 2013-03-29 Jason Merrill <jason@redhat.com>
195 * cp-tree.h (AUTO_IS_DECLTYPE): New.
196 * parser.c (cp_parser_decltype): Handle decltype(auto).
197 (cp_parser_type_id_1): Allow auto without a late-specified
199 (cp_parser_primary_expression): Use the return value of
200 finish_parenthesized_expr.
201 (cp_parser_transaction_expression): Likewise.
202 * semantics.c (force_paren_expr): New.
203 (finish_parenthesized_expr): Use it.
204 * call.c (build_conditional_expr_1): Likewise.
205 * pt.c (do_auto_deduction): Handle decltype(auto).
206 (tsubst_copy): Handle PAREN_EXPR.
207 (tsubst_copy_and_build): Likewise.
208 * error.c (dump_expr): Handle PAREN_EXPR.
209 * cxx-pretty-print.c (pp_cxx_expression): Likewise.
210 * mangle.c (write_expression): Ignore PAREN_EXPR.
212 * parser.c (cp_parser_decltype_expr): Split out...
213 (cp_parser_decltype): ...from here.
217 * pt.c (unify_pack_expansion): Fix indexing.
219 2013-03-29 Gabriel Dos Reis <gdr@integrable-solutions.net>
221 * call.c (build_java_interface_fn_ref): Likewise.
222 (make_temporary_var_for_ref_to_temp): Likewise.
223 * class.c (check_field_decls): Likewise.
224 (layout_class_type): Likewise.
225 (finish_struct_1): Likewise.
226 (fixed_type_or_null): Likewise.
227 (get_vtbl_decl_for_binfo): Likewise.
228 * cp-gimplify.c (omp_var_to_track): Likewise.
229 (cp_genericize_r): Likewise.
230 * cp-objcp-common.c (cxx_warn_unused_global_decl): Likewise.
231 * cp-tree.h (LANG_DECL_HAS_MIN): Likewise.
232 (DECL_DISCRIMINATOR_P): Likewise.
233 * decl.c (poplevel): Likewise.
234 (decls_match): Likewise.
235 (duplicate_decls): Likewise.
236 (decl_jump_unsafe): Likewise.
237 (start_decl): Likewise.
238 (check_for_uninitialized_const_var): Likewise.
239 (make_rtl_for_nonlocal_decl): Likewise.
240 (cp_finish_decl): Likewise.
241 (expand_static_init): Likewise.
242 (local_variable_p): Likewise.
243 (maybe_register_incomplete_var): Likewise.
244 * decl2.c (grokfield): Likewise.
245 (comdat_linkage): Likewise.
246 (determine_visibility): Likewise.
247 (import_export_decl): Likewise.
248 (prune_vars_needing_no_initialization): Likewise.
249 (decl_maybe_constant_var_p): Likewise.
250 * error.c (dump_simple_decl): Likewise.
251 (dump_template_decl): Likewise.
252 (cp_printer): Likewise.
253 * except.c (build_throw): Likewise.
254 * init.c (build_vtbl_address): Likewise.
255 (member_init_ok_or_else): Likewise.
256 (build_aggr_init): Likewise.
257 (expand_aggr_init_1): Likewise.
258 (build_offset_ref): Likewise.
259 (constant_value_1): Likewise.
260 * mangle.c (write_mangled_name): Likewise.
261 (write_prefix): Likewise.
262 * name-lookup.c (supplement_binding_1): Likewise.
263 (add_decl_to_level): Likewise.
264 (pushdecl_maybe_friend_1): Likewise.
265 (check_for_out_of_scope_variable): Likewise.
266 (validate_nonmember_using_decl): Likewise.
267 (lookup_name_innermost_nonclass_level_1): Likewise.
268 (lookup_arg_dependent_1): Likewise.
269 * parser.c (cp_parser_lambda_introducer): Likewise.
270 (cp_parser_template_argument): Likewise.
271 (cp_parser_single_declaration): Likewise.
272 * pt.c (convert_nontype_argument): Likewise.
273 (instantiate_class_template_1): Likewise.
274 (tsubst_decl): Likewise.
275 (tsubst_expr): Likewise.
276 (do_decl_instantiation): Likewise.
277 (do_type_instantiation): Likewise.
278 (regenerate_decl_from_template): Likewise.
279 (always_instantiate_p): Likewise.
280 (instantiate_decl): Likewise.
281 (type_dependent_expression_p): Likewise.
282 (build_non_dependent_expr): Likewise.
283 * repo.c (repo_emit_p): Likewise.
284 * rtti.c (build_dynamic_cast_1): Likewise.
285 * search.c (shared_member_p): Likewise.
286 * semantics.c (outer_var_p): Likewise.
287 (finish_id_expression): Likewise.
288 (finish_omp_clauses): Likewise.
289 (finish_decltype_type): Likewise.
290 (ensure_literal_type_for_constexpr_object): Likewise.
291 * tree.c (lvalue_kind): Likewise.
292 (bot_replace): Likewise.
293 (cp_tree_equal): Likewise.
294 (handle_init_priority_attribute): Likewise.
295 (decl_storage_duration): Likewise.
296 * typeck.c (cxx_sizeof_expr): Likewise.
297 (cxx_alignof_expr): Likewise.
298 (decay_conversion): Likewise.
299 (build_class_member_access_expr): Likewise.
300 (cp_build_array_ref): Likewise.
301 (cxx_mark_addressable): Likewise.
302 (maybe_warn_about_returning_address_of_local): Likewise.
303 (check_return_expr): Likewise.
304 * typeck2.c (cxx_readonly_error): Likewise.
305 (abstract_virtuals_error_sfinae): Likewise.
306 (cxx_incomplete_type_diagnostic): Likewise.
308 2013-03-28 Lawrence Crowl <crowl@google.com>
311 (CXX_PARSER_H): Add header dependence.
313 (extern debug (cp_binding_level &)): New.
314 (extern debug (cp_binding_level *)): New.
316 (debug (cp_binding_level &)): New.
317 (debug (cp_binding_level *)): New.
319 (debug (cp_parser &)): New.
320 (debug (cp_parser *)): New.
321 (debug (cp_token &)): New.
322 (debug (cp_token *)): New.
323 (debug (vec<cp_token, va_gc> &)): New.
324 (debug (vec<cp_token, va_gc> *)): New.
325 * parser.c: Add header dependence.
326 (extern debug (cp_parser &)): New.
327 (extern debug (cp_parser *)): New.
328 (extern debug (cp_token &)): New.
329 (extern debug (cp_token *)): New.
330 (extern debug (vec<cp_token, va_gc> &)): New.
331 (extern debug (vec<cp_token, va_gc> *)): New.
333 2013-03-28 Jason Merrill <jason@redhat.com>
337 * typeck2.c (abstract_virtuals_error_sfinae): Don't complete
338 the type if tf_decltype is set.
339 * pt.c (fn_type_unification): Add decltype_p parm.
340 (get_bindings): Adjust.
342 * class.c (resolve_address_of_overloaded_function): Adjust.
343 * call.c (add_template_candidate_real, print_z_candidate): Adjust.
346 * parser.c (cp_parser_sizeof_pack): Split out from...
347 (cp_parser_sizeof_operand): ...here. Require (id).
350 * semantics.c (finish_this_expr): 'this' is an rvalue.
351 * typeck.c (cp_build_indirect_ref): Handle NOP_EXPR of 'this'.
354 * semantics.c (finish_member_declaration): Don't push closure
357 * name-lookup.c (pushdecl_maybe_friend_1): Use
358 nonlambda_method_basetype and current_nonlambda_class_type.
361 * semantics.c (potential_constant_expression_1) [NOP_EXPR]: Reject
362 conversion from integer to pointer.
363 (cxx_eval_constant_expression): Likewise.
364 (cxx_eval_indirect_ref): Use the folded operand if we still think
365 this might be constant.
367 2013-03-28 Paolo Carlini <paolo.carlini@oracle.com>
368 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
371 * call.c (convert_like_real): Change series of two permerrors
372 to permerror + inform (and likewise for two errors).
373 (build_new_method_call_1): Likewise.
374 * typeck.c (convert_for_initialization): Change additional
375 warning or error to inform.
377 2013-03-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
379 * cp-tree.h (next_aggr_init_expr_arg): Remove static specifier.
380 (first_aggr_init_expr): Likewise.
381 (more_aggr_init_expr_args_p): Likewise.
382 (type_of_this_parm): Likewise.
383 (class_of_this_parm): Likewise.
384 * name-lookup.h (get_global_value_if_present): Likewise.
385 (is_typename_at_global_scope): Likewise.
387 2013-03-28 Paolo Carlini <paolo.carlini@oracle.com>
389 * call.c (joust): Don't call inform for a permerror returning false.
390 * parser.c (cp_parser_check_class_key): Likewise.
391 * pt.c (tsubst_copy_and_build): Likewise.
393 2013-03-27 Jason Merrill <jason@redhat.com>
396 * semantics.c (finish_qualified_id_expr): Return early
399 2013-03-26 Gabriel Dos Reis <gdr@integrable-solutions.net>
401 * call.c (build_new_method_call_1): Use INDIRECT_REF_P.
402 * cvt.c (convert_to_void): Likewise.
403 * error.c (dump_expr): Likewise.
404 * mangle.c (write_expression): Likewise.
405 * parser.c (cp_parser_template_argument): Likewise.
406 * pt.c (convert_nontype_argument): Likewise.
407 (tsubst_copy_and_build): Likewise.
408 * rtti.c (build_typeid): Likewise.
409 * semantics.c (finish_call_expr): Likewise.
410 (finish_decltype_type): Likewise.
411 (build_data_member_initialization): Likewise.
412 * tree.c (is_dummy_object): Likewise.
413 * typeck.c (decay_conversion): Likewise.
414 (build_class_member_access_expr): Likewise.
415 (cp_build_addr_expr_1): Likewise.
416 (unary_complex_lvalue): Likewise.
417 (check_return_expr): Likewise.
418 * typeck2.c (cxx_readonly_error): Likewise.
420 2013-03-26 Jason Merrill <jason@redhat.com>
423 * typeck.c (invalid_nonstatic_memfn_p): Use get_first_fn. Take tree.
424 * semantics.c (finish_decltype_type): Check it before type_unknown_p.
425 * cp-tree.h: Adjust prototype.
428 * typeck2.c (build_m_component_ref): Handle prvalue object.
430 2013-03-26 Gabriel Dos Reis <gdr@integrable-solutions.net>
432 * cp-gimplify.c (cp_genericize_r): Use VAR_OR_FUNCTION_DECL_P.
433 * decl.c (duplicate_decls): Likewise.
434 (cp_finish_decl): Likewise.
435 (check_class_member_definition_namespace): Likewise.
436 * decl2.c (grokfield): Likewise.
437 (decl_needed_p): Likewise.
438 (import_export_decl): Likewise.
439 (mark_used): Likewise.
440 * name-lookup.c (pushdecl_maybe_friend_1): Likewise.
441 * pt.c (push_access_scope): Likewise.
442 (instantiate_decl): Likewise.
443 * ptree.c (cxx_print_decl): Likewise.
444 * repo.c (repo_emit_p): Likewise.
445 * semantics.c (note_decl_for_pch): Likewise.
446 * tree.c (decl_linkage): Likewise.
448 2013-03-26 Paolo Carlini <paolo.carlini@oracle.com>
451 * decl.c (check_array_designated_initializer): Handle CONST_DECL
454 2013-03-26 Paolo Carlini <paolo.carlini@oracle.com>
456 * decl.c (grokfndecl): Handle separately <inline> and <constexpr>
459 * decl.c (grokdeclarator): Declare typedef_p and use it everywhere.
461 2013-03-25 Jason Merrill <jason@redhat.com>
464 * semantics.c (maybe_resolve_dummy): Make sure that the enclosing
465 class is derived from the type of the object.
468 * semantics.c (lambda_expr_this_capture): Don't capture 'this' in
471 2013-03-25 Paolo Carlini <paolo.carlini@oracle.com>
474 * decl.c (cp_finish_decl): Check DECL_LANG_SPECIFIC before
475 DECL_TEMPLATE_INSTANTIATION.
477 2013-03-22 Jason Merrill <jason@redhat.com>
480 * pt.c (instantiation_dependent_r): Check DECL_INITIAL of VAR_DECL
483 2013-03-21 Gabriel Dos Reis <gdr@integrable-solutions.net>
485 * cp-tree.h (identifier_p): New.
486 * call.c: Throughout, call identifier_p insstead of direct
487 comparaison of TREE_CODE against IDENTIFIER_NODE.
491 * mangle.c: Likewise.
492 * name-lookup.c: Likewise.
493 * parser.c: Likewise.
495 * search.c: Likewise.
496 * semantics.c: Likewise.
498 * typeck.c: Likewise.
499 * typeck2.c: Likewise.
501 2013-03-21 Jakub Jelinek <jakub@redhat.com>
504 * pt.c (convert_nontype_argument): Count werrorcount as warnings.
505 * call.c (build_temp): Likewise.
506 * method.c (synthesize_method): Likewise.
507 * typeck.c (convert_for_initialization): Likewise.
509 2013-03-21 Marc Glisse <marc.glisse@inria.fr>
511 * call.c (build_conditional_expr_1): Fold VEC_COND_EXPR.
513 2013-03-21 Richard Biener <rguenther@suse.de>
515 * error.c (cp_printer): Use DECL_HAS_DEBUG_EXPR_P instead of
516 DECL_DEBUG_EXPR_IS_FROM. Guard properly.
518 2013-03-20 Jason Merrill <jason@redhat.com>
521 * parser.c (cp_parser_late_return_type_opt): Save and restore
522 current_class_ptr/ref.
525 * expr.c (cplus_expand_constant): Do nothing if the class is
527 * semantics.c (reduced_constant_expression_p): Allow PTRMEM_CST.
528 * typeck2.c (store_init_value): Use reduced_constant_expression_p.
529 * decl.c (maybe_register_incomplete_var): Handle PTRMEM_CST.
530 (complete_vars): Likewise.
532 * name-lookup.c (get_anonymous_namespace_name): Never use
533 get_file_function_name.
535 * pt.c (retrieve_specialization): Handle null tmpl argument.
539 * pt.c (tsubst_decl): Check return value of register_specialization.
540 * typeck2.c (abstract_virtuals_error_sfinae): Re-apply complete_type
543 2013-03-17 Jason Merrill <jason@redhat.com>
547 * parser.c (cp_parser_direct_declarator): Bail if we see a
548 qualified-id not at namespace scope.
552 * typeck2.c (abstract_virtuals_error_sfinae): Revert complete_type
555 2013-03-16 Jason Merrill <jason@redhat.com>
557 * decl.c (grokdeclarator): Assert that we won't see a pointer to
561 * cp-tree.h (WILDCARD_TYPE_P): Split out from...
562 (MAYBE_CLASS_TYPE_P): ...here.
563 * semantics.c (lambda_capture_field_type): Only build a
564 magic decltype for wildcard types.
565 (lambda_proxy_type): Likewise.
566 (finish_non_static_data_member): Get the quals from
570 * parser.c (cp_parser_template_argument): Don't
571 fold_non_dependent_expr.
573 * parser.c (cp_parser_lambda_declarator_opt): Use
574 cp_parser_trailing_type_id.
577 * parser.c (cp_parser_template_id): Don't forget access checks.
580 * pt.c (tsubst_qualified_id): Use current_nonlambda_class_type.
584 * name-lookup.h (tag_scope): Add ts_lambda.
585 * semantics.c (begin_lambda_type): Use it.
586 * decl.c (xref_tag_1): Set CLASSTYPE_LAMBDA_EXPR.
587 * pt.c (check_default_tmpl_args): Ignore lambdas.
588 (push_template_decl_real): Handle lambdas.
589 * tree.c (no_linkage_check): Adjust lambda check.
592 * tree.c (strip_typedefs_expr): Complain about lambda, don't abort.
595 * parser.c (cp_parser_direct_declarator): Fix late return
596 for out-of-class defn of member function.
599 * semantics.c (maybe_add_lambda_conv_op): Clear DECL_NAME of copied
600 parms to avoid duplicate -Wshadow warnings.
602 * search.c (lookup_base): Handle NULL_TREE.
605 * semantics.c (potential_constant_expression_1): Use of 'this' in
606 a non-constexpr function makes the expression not potentially
611 * cp-tree.h (tsubst_flags): Add tf_decltype.
612 * call.c (build_cxx_call): Don't build a temporary if it's set.
613 (build_over_call): Make sure it's only passed to build_cxx_call.
614 * parser.c (cp_parser_primary_expression): Add decltype_p parm.
615 (cp_parser_unary_expression): Likewise.
616 (cp_parser_cast_expression): Likewise.
617 (cp_parser_binary_expression): Likewise.
618 (cp_parser_assignment_expression): Likewise.
619 (cp_parser_postfix_expression): Likewise. Pass tf_decltype.
620 (cp_parser_expression): Add decltype_p. Force a
621 temporary for a call on the LHS of a comma.
622 (cp_parser_decltype): Pass true to decltype_p parms.
623 * pt.c (tsubst) [DECLTYPE_TYPE]: Pass tf_decltype.
624 (tsubst_copy_and_build): Pass tf_decltype down only for
625 CALL_EXPR and the RHS of COMPOUND_EXPR.
626 * tree.c (build_cplus_new): Call complete_type_or_maybe_complain.
628 * cp-tree.h (abstract_class_use): New enum.
629 * typeck2.c (pending_abstract_type): Add use field.
630 (abstract_virtuals_error_sfinae): Add overloads taking
631 abstract_class_use instead of tree.
632 * typeck.c (build_static_cast_1): Call it.
633 * except.c (is_admissible_throw_operand_or_catch_parameter): Call it.
634 * pt.c: Adjust calls.
635 * decl.c (cp_finish_decl): Don't handle functions specially.
636 (grokdeclarator): Always check return type.
637 * init.c (build_new_1): Adjust call.
641 * pt.c (tsubst) [ARRAY_TYPE]: Use abstract_virtuals_error_sfinae.
642 * typeck2.c (abstract_virtuals_error_sfinae): Call complete_type.
645 * pt.c (tsubst_function_type): Call abstract_virtuals_error_sfinae.
646 (tsubst_arg_types): Likewise.
650 * call.c (convert_like_real): Check for explicit constructors
651 even for value-initialization.
654 * pt.c (convert_nontype_argument): Handle invalid pointer.
656 * parser.c (cp_parser_lambda_expression): Use nreverse.
660 * pt.c (instantiate_class_template_1): Instantiate lambda capture
662 (tsubst_copy_and_build): Not here.
665 * method.c (walk_field_subobs): Disallow copy of rvalue ref.
668 * parser.c (parsing_nsdmi): New.
669 * semantics.c (outer_automatic_var_p): Check it.
670 (finish_id_expression): Likewise.
671 * cp-tree.h: Declare it.
674 * error.c (dump_expr) [SIZEOF_EXPR]: Print sizeof... properly.
676 * parser.c (lookup_literal_operator): Correct parm/arg naming
680 * pt.c (fold_non_dependent_expr_sfinae): Check
681 instantiation_dependent_expression_p.
684 * class.c (resolve_address_of_overloaded_function): Accept a
685 reference to function for target_type.
686 (instantiate_type): Likewise.
687 * pt.c (convert_nontype_argument): Pass it to
688 convert_nontype_argument_function.
690 2013-03-16 Jakub Jelinek <jakub@redhat.com>
692 * tree.c (cp_tree_equal): Fix a pasto.
695 * typeck.c (cp_build_binary_op): When calling warn_for_div_by_zero,
696 pass op1 through maybe_constant_value first.
698 2013-03-16 Paolo Carlini <paolo.carlini@oracle.com>
701 * semantics.c (cxx_eval_array_reference): Check for negative index.
703 2013-03-14 Jason Merrill <jason@redhat.com>
706 * decl.c (local_variable_p_walkfn): Check DECL_ARTIFICIAL again.
709 * decl.c (register_dtor_fn): Pass null to __cxa_thread_atexit
710 dso_handle parm on targets without __cxa_atexit.
712 2013-03-11 Jason Merrill <jason@redhat.com>
715 * typeck.c (check_return_expr): Disallow returning init list here.
716 * semantics.c (apply_deduced_return_type): Not here.
718 2013-03-08 Paolo Carlini <paolo.carlini@oracle.com>
721 * cxx-pretty-print.c (pp_cxx_expression): Handle LAMBDA_EXPR.
722 * error.c (dump_expr): Likewise.
724 2013-03-08 Jason Merrill <jason@redhat.com>
727 * class.c (modify_all_vtables): Mangle the vtable name before
730 * semantics.c (lambda_expr_this_capture): In unevaluated context,
731 just return the nearest 'this'.
736 * tree.c (maybe_dummy_object): Don't capture 'this'.
737 * semantics.c (maybe_resolve_dummy): New.
738 (finish_non_static_data_member): Use it.
739 (finish_qualified_id_expr): Don't test is_dummy_object.
740 * cp-tree.h: Declare maybe_resolve_dummy.
741 * call.c (build_new_method_call_1): Use it.
744 * semantics.c (apply_deduced_return_type): Don't allow returning
745 std::initializer_list.
747 2013-03-06 Paolo Carlini <paolo.carlini@oracle.com>
750 * parser.c (cp_parser_elaborated_type_specifier): Don't call
751 check_elaborated_type_specifier when TREE_CODE (decl) != TYPE_DECL.
752 * decl.c (check_elaborated_type_specifier): Tidy.
754 2013-03-06 Jakub Jelinek <jakub@redhat.com>
757 * tree.c (strip_typedefs): Don't copy args if they are NULL.
759 2013-03-05 Jakub Jelinek <jakub@redhat.com>
761 * parser.c (cp_parser_braced_list): For {} initialize
762 *non_constant_p to false.
764 2013-03-04 Jason Merrill <jason@redhat.com>
768 * semantics.c (lambda_expr_this_capture): Handle NSDMI
769 and non-class scopes.
771 2013-03-01 Paolo Carlini <paolo.carlini@oracle.com>
773 * decl.c (grokdeclarator): Remove dead code.
775 2013-02-28 Jason Merrill <jason@redhat.com>
778 * semantics.c (potential_constant_expression_1): Use
779 cxx_eval_outermost_constant_expr rather than maybe_constant_value.
782 * call.c (build_over_call): Avoid virtual lookup in a template.
784 2013-02-27 Jason Merrill <jason@redhat.com>
788 * name-lookup.c (do_class_using_decl): Use ctor_identifier instead
789 of the base name for inheriting ctors.
790 (push_class_level_binding_1): Remove inheriting ctor handling.
791 * pt.c (tsubst_decl) [USING_DECL]: Likewise.
792 * class.c (add_implicitly_declared_members): Adjust.
794 2013-02-26 David Binderman <dcb314@hotmail.com>
797 * decl.c (grokdeclarator): Tidy publicp assignment.
799 2013-02-25 Aldy Hernandez <aldyh@redhat.com>
802 * semantics.c (begin_transaction_stmt): Set TREE_SIDE_EFFECTS.
803 (build_transaction_expr): Same.
805 2013-02-25 Jason Merrill <jason@redhat.com>
808 * pt.c (fn_type_unification): Wait to call push_tinst_level until
809 we know what args we're looking at.
812 * semantics.c (potential_constant_expression_1): In C++98, a cast
813 to non-integral type can't be a constant expression.
815 2013-02-24 Jakub Jelinek <jakub@redhat.com>
818 * init.c (build_zero_init_1): Use RECORD_OR_UNION_CODE_P instead
821 2013-02-22 Jason Merrill <jason@redhat.com>
824 * pt.c (push_template_decl_real): Set DECL_INTERFACE_KNOWN
825 if we got the wrong number of template parms.
828 * pt.c (fn_type_unification): Use explicit args in template
829 instantiation context.
832 * call.c (can_convert_arg): Discard access checks.
835 * tree.c (strip_typedefs): Strip typedefs from TYPENAME_TYPE template
838 2013-02-20 Paolo Carlini <paolo.carlini@oracle.com>
841 * tree.c (maybe_warn_zero_as_null_pointer_constant): Add.
842 * cvt.c (ocp_convert): Use the latter.
843 (cp_convert_to_pointer): Likewise.
844 * decl.c (check_default_argument): Likewise.
845 * typeck.c (cp_build_binary_op): Likewise.
846 * cp-tree.h (maybe_warn_zero_as_null_pointer_constant): Declare.
848 2013-02-15 Jonathan Wakely <jwakely.gcc@gmail.com>
849 Paolo Carlini <paolo.carlini@oracle.com>
852 * decl2.c (grokbitfield): Allow scoped enumeration types.
854 2013-02-15 Jason Merrill <jason@redhat.com>
857 * semantics.c (finish_id_expression): Also return the identifier
858 for an outer local static.
861 * class.c (check_bases_and_members): Deduce noexcept after
865 * semantics.c (finish_id_expression): In a template, return
866 the identifier for a constant variable.
868 2013-02-14 Jason Merrill <jason@redhat.com>
871 * semantics.c (build_anon_member_initialization): New.
872 (build_data_member_initialization): Use it.
875 * decl.c (cp_finish_decl): Force instantiation of an
876 auto static data member.
879 * pt.c (unify): A pack expansion that is not the last template
880 argument makes the entire template argument list non-deduced.
883 * name-lookup.c (do_class_using_decl): Handle typedefs with
884 inheriting constructors.
885 (push_class_level_binding_1): Allow inheriting from template
886 template parameter, too.
887 * pt.c (tsubst_decl) [USING_DECL]: Likewise.
890 * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Fix handling of
891 default argument scope.
892 * mangle.c (write_name): Likewise.
895 * error.c (find_typenames_r): Don't walk into a pack expansion.
897 2013-02-13 Jason Merrill <jason@redhat.com>
900 * parser.c (cp_parser_member_declaration): Check the declarator
901 form when detecting a function declaration via typedef.
904 * pt.c (maybe_process_partial_specialization): A lambda
905 isn't what's being specialized.
908 * semantics.c (maybe_add_lambda_conv_op): Mark static thunk
912 * semantics.c (cxx_bind_parameters_in_call): Undo DECL_BY_REFERENCE.
915 * semantics.c (cxx_fold_indirect_ref): Handle empty bases at
916 non-zero offsets, too.
919 * decl.c (build_enumerator): Always convert the value to a
920 fixed underlying type.
923 * pt.c (tsubst_copy_and_build): Don't forget any new
924 captures that arose from use of dependent names.
926 2013-02-13 Jakub Jelinek <jakub@redhat.com>
929 * semantics.c (finish_asm_stmt): If input constraints allow
930 neither register nor memory, try maybe_constant_value to get
931 a constant if possible.
933 2013-02-12 Jason Merrill <jason@redhat.com>
936 * method.c (add_one_base_init): Handle base constructor
937 taking rvalue reference parm.
940 * semantics.c (sort_constexpr_mem_initializers): Handle
943 2013-02-09 Jason Merrill <jason@redhat.com>
946 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Call
947 maybe_instantiate_noexcept.
950 * pt.c (eq_specializations): Set comparing_specializations.
951 * tree.c (cp_tree_equal): Check it.
952 * cp-tree.h: Declare it.
954 * decl.c (decls_match): Check versions later.
957 * pt.c (build_non_dependent_expr): Don't try to fold
958 instantiation-dependent expressions.
959 (instantiation_dependent_r) [TRAIT_EXPR]: Split out.
960 [BIND_EXPR]: Treat as dependent.
962 2013-02-07 Jakub Jelinek <jakub@redhat.com>
965 * init.c (build_vec_init): Don't append NULL values into new_vec.
966 (build_zero_init_1): Don't push anything into v if recursive call
968 (build_value_init_noctor): Don't push anything into v if
969 build_value_init call returned NULL_TREE.
972 * parser.c (cp_parser_token_starts_cast_expression): Renamed to...
973 (cp_parser_tokens_start_cast_expression): ... this. Change parameter
974 to cp_parser *, call cp_lexer_peek_token first. For CPP_OPEN_PAREN,
975 return true only if 2nd token isn't CPP_CLOSE_PAREN.
976 (cp_parser_cast_expression): Adjust caller.
979 * decl.c (push_local_name): Look at DECL_DISCRIMINATOR (t)
980 only if DECL_DISCRIMINATOR_SET_P (t) rather than just
981 DECL_LANG_SPECIFIC (t).
983 2013-02-07 Jason Merrill <jason@redhat.com>
986 * method.c (do_build_copy_constructor): Don't bother turning
987 scalars from lvalues to xvalues.
988 (do_build_copy_assign): Likewise.
990 2013-02-06 Jason Merrill <jason@redhat.com>
992 * parser.c (cp_parser_enum_specifier): Check for error_mark_node.
994 2013-02-05 Jason Merrill <jason@redhat.com>
997 * tree.c (lvalue_kind) [INDIRECT_REF]: Don't check for
1001 * decl.c (start_preparsed_function): Update restype if we change
1005 * pt.c (fn_type_unification): Discard any access checks from
1006 substituting explicit args.
1008 2013-01-31 Jason Merrill <jason@redhat.com>
1012 * typeck.c (get_member_function_from_ptrfunc): Fix
1013 ptrmemfunc_vbit_in_delta case.
1015 2013-01-29 Jason Merrill <jason@redhat.com>
1018 * class.c (build_ctor_vtbl_group): Give construction vtables
1021 2013-01-25 Jason Merrill <jason@redhat.com>
1024 * pt.c (convert_nontype_argument_function): Handle invalid input.
1025 (convert_nontype_argument): Likewise.
1028 * typeck.c (get_member_function_from_ptrfunc): Optimize if the
1029 dynamic type has no virtual functions.
1031 2013-01-22 Paolo Carlini <paolo.carlini@oracle.com>
1034 * decl.c (check_initializer): Use TARGET_EXPR_DIRECT_INIT_P only
1035 on TARGET_EXPR nodes.
1037 2013-01-22 Jason Merrill <jason@redhat.com>
1040 * pt.c (maybe_instantiate_noexcept): Don't defer access checks.
1042 2013-01-22 Dodji Seketeli <dodji@redhat.com>
1045 * pt.c (argument_pack_element_is_expansion_p)
1046 (make_argument_pack_select, use_pack_expansion_extra_args_p)
1047 (gen_elem_of_pack_expansion_instantiation): New static functions.
1048 (tsubst): When looking through an ARGUMENT_PACK_SELECT tree node,
1049 look through the possibly resulting pack expansion as well.
1050 (tsubst_pack_expansion): Use use_pack_expansion_extra_p to
1051 generalize when to use the PACK_EXPANSION_EXTRA_ARGS mechanism.
1052 Use gen_elem_of_pack_expansion_instantiation to build the
1053 instantiation piece-wise. Don't use arg_from_parm_pack_p anymore,
1054 as gen_elem_of_pack_expansion_instantiation and the change in
1055 tsubst above generalize this particular case.
1056 (arg_from_parm_pack_p): Remove this for it's not used by
1057 tsubst_pack_expansion anymore.
1059 2013-01-21 Jason Merrill <jason@redhat.com>
1062 * tree.c (strip_typedefs_expr) [TREE_VEC]: Preserve non-default
1063 template args count.
1065 2013-01-18 Jason Merrill <jason@redhat.com>
1068 * decl2.c (get_local_tls_init_fn): New.
1069 (get_tls_init_fn): Handle flag_extern_tls_init. Don't bother
1070 with aliases for internal variables. Don't use weakrefs if
1071 the variable needs destruction.
1072 (generate_tls_wrapper): Mark the wrapper as const if no
1073 initialization is needed.
1074 (handle_tls_init): Don't require aliases.
1076 2013-01-15 Dodji Seketeli <dodji@redhat.com>
1079 * pt.c (coerce_innermost_template_parms): New static function.
1080 (instantiate_alias_template): Use it here.
1082 2013-01-09 Jason Merrill <jason@redhat.com>
1085 * rtti.c (build_typeid, get_typeid): Add complain parm.
1086 (get_tinfo_decl_dynamic): Likewise.
1087 * cp-tree.h, parser.c, pt.c: Adjust.
1090 * decl.c (cp_finish_decl): Clear TREE_READONLY if the variable
1093 2013-01-09 Jakub Jelinek <jakub@redhat.com>
1096 * typeck.c (cp_build_binary_op): For LSHIFT_EXPR and RSHIFT_EXPR,
1097 call maybe_constant_value for the negative or too big shift
1100 2013-01-09 Paolo Carlini <paolo.carlini@oracle.com>
1103 * decl2.c (var_needs_tls_wrapper): Return false when error_operand_p
1104 of the argument is true.
1106 2013-01-08 Joel Brobecker <brobecker@adacore.com>
1108 * parser.c (cp_parser_initializer_list): Move declaration
1109 of variable non_const to start of lexical block.
1111 2013-01-07 Jason Merrill <jason@redhat.com>
1114 * tree.c (build_aggr_init_expr): Do nothing in a template.
1115 * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Strip an ADDR_EXPR off
1116 a FUNCTION_DECL before tsubsting.
1118 2013-01-04 Dodji Seketeli <dodji@redhat.com>
1121 * pt.c (check_instantiated_arg): Allow type template arguments.
1123 2013-01-04 Jason Merrill <jason@redhat.com>
1126 * decl.c (reset_type_linkage, bt_reset_linkage): New.
1127 (grokdeclarator): Use reset_type_linkage.
1128 * name-lookup.c (binding_table_foreach): Handle null table.
1129 * tree.c (decl_anon_ns_mem_p): Check TYPE_MAIN_DECL, not TYPE_NAME.
1131 2013-01-04 Paolo Carlini <paolo.carlini@oracle.com>
1133 PR c++/54526 (again)
1134 * parser.c (cp_parser_template_id): Revert core of previous change
1135 (keep adjusted inform message).
1137 2013-01-03 Jason Merrill <jason@redhat.com>
1141 * pt.c (tsubst_copy_and_build) [TARGET_EXPR]: Don't touch
1145 * semantics.c (trait_expr_value): Call maybe_instantiate_noexcept.
1148 * semantics.c (build_data_member_initialization): Handle DECL_EXPR.
1151 * call.c (type_has_extended_temps): New.
1152 * cp-tree.h: Declare it.
1153 * decl.c (check_initializer): Use build_aggr_init for arrays
1155 * init.c (build_vec_init): Avoid mixed signed/unsigned arithmetic.
1157 2013-01-02 Jason Merrill <jason@redhat.com>
1160 * call.c (build_new_method_call_1): Don't use build_value_init for
1161 user-provided default constructors.
1163 * decl.c (check_default_argument): Use LOOKUP_IMPLICIT.
1167 * tree.c (build_cplus_array_type): Copy layout information
1168 to main variant if necessary.
1170 Copyright (C) 2013 Free Software Foundation, Inc.
1172 Copying and distribution of this file, with or without modification,
1173 are permitted in any medium without royalty provided the copyright
1174 notice and this notice are preserved.