/cp
[official-gcc.git] / gcc / cp / ChangeLog
blob3f05f291ea603ba44a566141378a781f5a7adfc3
1 2013-03-16  Paolo Carlini  <paolo.carlini@oracle.com>
3         PR c++/56582
4         * semantics.c (cxx_eval_array_reference): Check for negative index.
6 2013-03-14  Jason Merrill  <jason@redhat.com>
8         PR c++/56614
9         * decl.c (local_variable_p_walkfn): Check DECL_ARTIFICIAL again.
11         PR c++/56346
12         * decl.c (register_dtor_fn): Pass null to __cxa_thread_atexit
13         dso_handle parm on targets without __cxa_atexit.
15 2013-03-11  Jason Merrill  <jason@redhat.com>
17         PR c++/56567
18         * typeck.c (check_return_expr): Disallow returning init list here.
19         * semantics.c (apply_deduced_return_type): Not here.
21 2013-03-08  Paolo Carlini  <paolo.carlini@oracle.com>
23         PR c++/51412
24         * cxx-pretty-print.c (pp_cxx_expression): Handle LAMBDA_EXPR.
25         * error.c (dump_expr): Likewise.
27 2013-03-08  Jason Merrill  <jason@redhat.com>
29         PR c++/51884
30         * class.c (modify_all_vtables): Mangle the vtable name before
31         entering dfs_walk.
33         * semantics.c (lambda_expr_this_capture): In unevaluated context,
34         just return the nearest 'this'.
36         PR c++/51494
37         PR c++/52183
38         PR c++/56222
39         * tree.c (maybe_dummy_object): Don't capture 'this'.
40         * semantics.c (maybe_resolve_dummy): New.
41         (finish_non_static_data_member): Use it.
42         (finish_qualified_id_expr): Don't test is_dummy_object.
43         * cp-tree.h: Declare maybe_resolve_dummy.
44         * call.c (build_new_method_call_1): Use it.
46         PR c++/56567
47         * semantics.c (apply_deduced_return_type): Don't allow returning
48         std::initializer_list.
50 2013-03-06  Paolo Carlini  <paolo.carlini@oracle.com>
52         PR c++/56534
53         * parser.c (cp_parser_elaborated_type_specifier): Don't call
54         check_elaborated_type_specifier when TREE_CODE (decl) != TYPE_DECL.
55         * decl.c (check_elaborated_type_specifier): Tidy.
57 2013-03-06  Jakub Jelinek  <jakub@redhat.com>
59         PR c++/56543
60         * tree.c (strip_typedefs): Don't copy args if they are NULL.
62 2013-03-05  Jakub Jelinek  <jakub@redhat.com>
64         * parser.c (cp_parser_braced_list): For {} initialize
65         *non_constant_p to false.
67 2013-03-04  Jason Merrill  <jason@redhat.com>
69         PR c++/56464
70         PR c++/54383
71         * semantics.c (lambda_expr_this_capture): Handle NSDMI
72         and non-class scopes.
74 2013-03-01  Paolo Carlini  <paolo.carlini@oracle.com>
76         * decl.c (grokdeclarator): Remove dead code.
78 2013-02-28  Jason Merrill  <jason@redhat.com>
80         PR c++/56481
81         * semantics.c (potential_constant_expression_1): Use
82         cxx_eval_outermost_constant_expr rather than maybe_constant_value.
84         PR c++/56243
85         * call.c (build_over_call): Avoid virtual lookup in a template.
87 2013-02-27  Jason Merrill  <jason@redhat.com>
89         PR c++/56358
90         PR c++/56323
91         * name-lookup.c (do_class_using_decl): Use ctor_identifier instead
92         of the base name for inheriting ctors.
93         (push_class_level_binding_1): Remove inheriting ctor handling.
94         * pt.c (tsubst_decl) [USING_DECL]: Likewise.
95         * class.c (add_implicitly_declared_members): Adjust.
97 2013-02-26  David Binderman  <dcb314@hotmail.com>
99         PR c++/55632
100         * decl.c (grokdeclarator): Tidy publicp assignment.
102 2013-02-25  Aldy Hernandez  <aldyh@redhat.com>
104         PR c++/56419
105         * semantics.c (begin_transaction_stmt): Set TREE_SIDE_EFFECTS.
106         (build_transaction_expr): Same.
108 2013-02-25  Jason Merrill  <jason@redhat.com>
110         PR c++/56377
111         * pt.c (fn_type_unification): Wait to call push_tinst_level until
112         we know what args we're looking at.
114         PR c++/56438
115         * semantics.c (potential_constant_expression_1): In C++98, a cast
116         to non-integral type can't be a constant expression.
118 2013-02-24  Jakub Jelinek  <jakub@redhat.com>
120         PR c++/56403
121         * init.c (build_zero_init_1): Use RECORD_OR_UNION_CODE_P instead
122         of CLASS_TYPE_P.
124 2013-02-22  Jason Merrill  <jason@redhat.com>
126         PR c++/40405
127         * pt.c (push_template_decl_real): Set DECL_INTERFACE_KNOWN
128         if we got the wrong number of template parms.
130         PR c++/56377
131         * pt.c (fn_type_unification): Use explicit args in template
132         instantiation context.
134         PR c++/56359
135         * call.c (can_convert_arg): Discard access checks.
137         PR c++/56395
138         * tree.c (strip_typedefs): Strip typedefs from TYPENAME_TYPE template
139         args.
141 2013-02-20  Paolo Carlini  <paolo.carlini@oracle.com>
143         PR c++/56373
144         * tree.c (maybe_warn_zero_as_null_pointer_constant): Add.
145         * cvt.c (ocp_convert): Use the latter.
146         (cp_convert_to_pointer): Likewise.
147         * decl.c (check_default_argument): Likewise.
148         * typeck.c (cp_build_binary_op): Likewise.
149         * cp-tree.h (maybe_warn_zero_as_null_pointer_constant): Declare.
151 2013-02-15  Jonathan Wakely  <jwakely.gcc@gmail.com>
152             Paolo Carlini  <paolo.carlini@oracle.com>
154         PR c++/51242
155         * decl2.c (grokbitfield): Allow scoped enumeration types.
157 2013-02-15  Jason Merrill  <jason@redhat.com>
159         PR c++/54276
160         * semantics.c (finish_id_expression): Also return the identifier
161         for an outer local static.
163         PR c++/56343
164         * class.c (check_bases_and_members): Deduce noexcept after
165         checking bases.
167         PR c++/52026
168         * semantics.c (finish_id_expression): In a template, return
169         the identifier for a constant variable.
171 2013-02-14  Jason Merrill  <jason@redhat.com>
173         PR c++/54922
174         * semantics.c (build_anon_member_initialization): New.
175         (build_data_member_initialization): Use it.
177         PR c++/55003
178         * decl.c (cp_finish_decl): Force instantiation of an
179         auto static data member.
181         PR c++/55220
182         * pt.c (unify): A pack expansion that is not the last template
183         argument makes the entire template argument list non-deduced.
185         PR c++/56323
186         * name-lookup.c (do_class_using_decl): Handle typedefs with
187         inheriting constructors.
188         (push_class_level_binding_1): Allow inheriting from template
189         template parameter, too.
190         * pt.c (tsubst_decl) [USING_DECL]: Likewise.
192         PR c++/55223
193         * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Fix handling of
194         default argument scope.
195         * mangle.c (write_name): Likewise.
197         PR c++/55232
198         * error.c (find_typenames_r): Don't walk into a pack expansion.
200 2013-02-13  Jason Merrill  <jason@redhat.com>
202         PR c++/55670
203         * parser.c (cp_parser_member_declaration): Check the declarator
204         form when detecting a function declaration via typedef.
206         PR c++/55680
207         * pt.c (maybe_process_partial_specialization): A lambda
208         isn't what's being specialized.
210         PR c++/55710
211         * semantics.c (maybe_add_lambda_conv_op): Mark static thunk
212         TREE_USED.
214         PR c++/55879
215         * semantics.c (cxx_bind_parameters_in_call): Undo DECL_BY_REFERENCE.
217         PR c++/55993
218         * semantics.c (cxx_fold_indirect_ref): Handle empty bases at
219         non-zero offsets, too.
221         PR c++/56155
222         * decl.c (build_enumerator): Always convert the value to a
223         fixed underlying type.
225         PR c++/56135
226         * pt.c (tsubst_copy_and_build): Don't forget any new
227         captures that arose from use of dependent names.
229 2013-02-13  Jakub Jelinek  <jakub@redhat.com>
231         PR c++/56302
232         * semantics.c (finish_asm_stmt): If input constraints allow
233         neither register nor memory, try maybe_constant_value to get
234         a constant if possible.
236 2013-02-12  Jason Merrill  <jason@redhat.com>
238         PR c++/56285
239         * method.c (add_one_base_init): Handle base constructor
240         taking rvalue reference parm.
242         PR c++/56291
243         * semantics.c (sort_constexpr_mem_initializers): Handle
244         vptr out of order.
246 2013-02-09  Jason Merrill  <jason@redhat.com>
248         PR c++/56268
249         * semantics.c (classtype_has_nothrow_assign_or_copy_p): Call
250         maybe_instantiate_noexcept.
252         PR c++/56247
253         * pt.c (eq_specializations): Set comparing_specializations.
254         * tree.c (cp_tree_equal): Check it.
255         * cp-tree.h: Declare it.
257         * decl.c (decls_match): Check versions later.
259         PR c++/56238
260         * pt.c (build_non_dependent_expr): Don't try to fold
261         instantiation-dependent expressions.
262         (instantiation_dependent_r) [TRAIT_EXPR]: Split out.
263         [BIND_EXPR]: Treat as dependent.
265 2013-02-07  Jakub Jelinek  <jakub@redhat.com>
267         PR c++/56241
268         * init.c (build_vec_init): Don't append NULL values into new_vec.
269         (build_zero_init_1): Don't push anything into v if recursive call
270         returned NULL_TREE.
271         (build_value_init_noctor): Don't push anything into v if
272         build_value_init call returned NULL_TREE.
274         PR c++/56239
275         * parser.c (cp_parser_token_starts_cast_expression): Renamed to...
276         (cp_parser_tokens_start_cast_expression): ... this.  Change parameter
277         to cp_parser *, call cp_lexer_peek_token first.  For CPP_OPEN_PAREN,
278         return true only if 2nd token isn't CPP_CLOSE_PAREN.
279         (cp_parser_cast_expression): Adjust caller.
281         PR c++/56237
282         * decl.c (push_local_name): Look at DECL_DISCRIMINATOR (t)
283         only if DECL_DISCRIMINATOR_SET_P (t) rather than just
284         DECL_LANG_SPECIFIC (t).
286 2013-02-07  Jason Merrill  <jason@redhat.com>
288         PR c++/56235
289         * method.c (do_build_copy_constructor): Don't bother turning
290         scalars from lvalues to xvalues.
291         (do_build_copy_assign): Likewise.
293 2013-02-06  Jason Merrill  <jason@redhat.com>
295         * parser.c (cp_parser_enum_specifier): Check for error_mark_node.
297 2013-02-05  Jason Merrill  <jason@redhat.com>
299         PR c++/54122
300         * tree.c (lvalue_kind) [INDIRECT_REF]: Don't check for
301         METHOD_TYPE.
303         PR c++/56177
304         * decl.c (start_preparsed_function): Update restype if we change
305         decl1.
307         PR c++/56208
308         * pt.c (fn_type_unification): Discard any access checks from
309         substituting explicit args.
311 2013-01-31  Jason Merrill  <jason@redhat.com>
313         PR c++/56162
314         PR c++/56104
315         * typeck.c (get_member_function_from_ptrfunc): Fix
316         ptrmemfunc_vbit_in_delta case.
318 2013-01-29  Jason Merrill  <jason@redhat.com>
320         PR libstdc++/54314
321         * class.c (build_ctor_vtbl_group): Give construction vtables
322         hidden visibility.
324 2013-01-25  Jason Merrill  <jason@redhat.com>
326         PR c++/56095
327         * pt.c (convert_nontype_argument_function): Handle invalid input.
328         (convert_nontype_argument): Likewise.
330         PR c++/56104
331         * typeck.c (get_member_function_from_ptrfunc): Optimize if the
332         dynamic type has no virtual functions.
334 2013-01-22  Paolo Carlini  <paolo.carlini@oracle.com>
336         PR c++/55944
337         * decl.c (check_initializer): Use TARGET_EXPR_DIRECT_INIT_P only
338         on TARGET_EXPR nodes.
340 2013-01-22  Jason Merrill  <jason@redhat.com>
342         PR c++/56071
343         * pt.c (maybe_instantiate_noexcept): Don't defer access checks.
345 2013-01-22  Dodji Seketeli  <dodji@redhat.com>
347         PR c++/53609
348         * pt.c (argument_pack_element_is_expansion_p)
349         (make_argument_pack_select, use_pack_expansion_extra_args_p)
350         (gen_elem_of_pack_expansion_instantiation): New static functions.
351         (tsubst): When looking through an ARGUMENT_PACK_SELECT tree node,
352         look through the possibly resulting pack expansion as well.
353         (tsubst_pack_expansion): Use use_pack_expansion_extra_p to
354         generalize when to use the PACK_EXPANSION_EXTRA_ARGS mechanism.
355         Use gen_elem_of_pack_expansion_instantiation to build the
356         instantiation piece-wise.  Don't use arg_from_parm_pack_p anymore,
357         as gen_elem_of_pack_expansion_instantiation and the change in
358         tsubst above generalize this particular case.
359         (arg_from_parm_pack_p): Remove this for it's not used by
360         tsubst_pack_expansion anymore.
362 2013-01-21  Jason Merrill  <jason@redhat.com>
364         PR c++/56059
365         * tree.c (strip_typedefs_expr) [TREE_VEC]: Preserve non-default
366         template args count.
368 2013-01-18  Jason Merrill  <jason@redhat.com>
370         PR target/54908
371         * decl2.c (get_local_tls_init_fn): New.
372         (get_tls_init_fn): Handle flag_extern_tls_init.  Don't bother
373         with aliases for internal variables.  Don't use weakrefs if
374         the variable needs destruction.
375         (generate_tls_wrapper): Mark the wrapper as const if no
376         initialization is needed.
377         (handle_tls_init): Don't require aliases.
379 2013-01-15  Dodji Seketeli  <dodji@redhat.com>
381         PR c++/55663
382         * pt.c (coerce_innermost_template_parms): New static function.
383         (instantiate_alias_template):  Use it here.
385 2013-01-09  Jason Merrill  <jason@redhat.com>
387         PR c++/55878
388         * rtti.c (build_typeid, get_typeid): Add complain parm.
389         (get_tinfo_decl_dynamic): Likewise.
390         * cp-tree.h, parser.c, pt.c: Adjust.
392         PR c++/55893
393         * decl.c (cp_finish_decl): Clear TREE_READONLY if the variable
394         needs destruction.
396 2013-01-09  Jakub Jelinek  <jakub@redhat.com>
398         PR c/48418
399         * typeck.c (cp_build_binary_op): For LSHIFT_EXPR and RSHIFT_EXPR,
400         call maybe_constant_value for the negative or too big shift
401         count warnings.
403 2013-01-09  Paolo Carlini  <paolo.carlini@oracle.com>
405         PR c++/55801
406         * decl2.c (var_needs_tls_wrapper): Return false when error_operand_p
407         of the argument is true.
409 2013-01-08  Joel Brobecker  <brobecker@adacore.com>
411         * parser.c (cp_parser_initializer_list): Move declaration
412         of variable non_const to start of lexical block.
414 2013-01-07  Jason Merrill  <jason@redhat.com>
416         PR c++/55753
417         * tree.c (build_aggr_init_expr): Do nothing in a template.
418         * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Strip an ADDR_EXPR off
419         a FUNCTION_DECL before tsubsting.
421 2013-01-04  Dodji Seketeli  <dodji@redhat.com>
423         PR c++/52343
424         * pt.c (check_instantiated_arg): Allow type template arguments.
426 2013-01-04  Jason Merrill  <jason@redhat.com>
428         PR c++/55877
429         * decl.c (reset_type_linkage, bt_reset_linkage): New.
430         (grokdeclarator): Use reset_type_linkage.
431         * name-lookup.c (binding_table_foreach): Handle null table.
432         * tree.c (decl_anon_ns_mem_p): Check TYPE_MAIN_DECL, not TYPE_NAME.
434 2013-01-04  Paolo Carlini  <paolo.carlini@oracle.com>
436         PR c++/54526 (again)
437         * parser.c (cp_parser_template_id): Revert core of previous change
438         (keep adjusted inform message).
440 2013-01-03  Jason Merrill  <jason@redhat.com>
442         PR c++/55419
443         PR c++/55753
444         * pt.c (tsubst_copy_and_build) [TARGET_EXPR]: Don't touch
445         TREE_CONSTANT.
447         PR c++/55842
448         * semantics.c (trait_expr_value): Call maybe_instantiate_noexcept.
450         PR c++/55856
451         * semantics.c (build_data_member_initialization): Handle DECL_EXPR.
453         PR c++/53650
454         * call.c (type_has_extended_temps): New.
455         * cp-tree.h: Declare it.
456         * decl.c (check_initializer): Use build_aggr_init for arrays
457         if it is false.
458         * init.c (build_vec_init): Avoid mixed signed/unsigned arithmetic.
460 2013-01-02  Jason Merrill  <jason@redhat.com>
462         PR c++/54325
463         * call.c (build_new_method_call_1): Don't use build_value_init for
464         user-provided default constructors.
466         * decl.c (check_default_argument): Use LOOKUP_IMPLICIT.
468         PR c++/55032
469         PR c++/55245
470         * tree.c (build_cplus_array_type): Copy layout information
471         to main variant if necessary.
473 Copyright (C) 2013 Free Software Foundation, Inc.
475 Copying and distribution of this file, with or without modification,
476 are permitted in any medium without royalty provided the copyright
477 notice and this notice are preserved.