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