* class.c (finish_struct_1): Check virtual functions
[official-gcc.git] / gcc / cp / ChangeLog
blobaf55e29add394ecad609168fb6b73c9286bc5ff6
1 2012-11-13  Jason Merrill  <jason@redhat.com>
3         * class.c (finish_struct_1): Check virtual functions
4         for missing ABI tags.
6         PR c++/55275
7         * pt.c (maybe_process_partial_specialization): Update
8         DECL_SOURCE_LOCATION for new specializations.
10 2012-11-14  Paolo Carlini  <paolo.carlini@oracle.com>
12         PR c++/55323
13         * init.c (emit_mem_initializers): Skip arguments == error_mark_node.
15 2012-11-14  Fabien ChĂȘne  <fabien@gcc.gnu.org>
17         PR c++/11750
18         * call.c (build_new_method_call_1): Check that the instance type
19         and the function context are the same before setting the flag
20         LOOKUP_NONVIRTUAL.
22 2012-11-13  Sriraman Tallam  <tmsriram@google.com>
24         * class.c (mark_versions_used): Remove.
25         (resolve_address_of_overloaded_function): Call target hook
26         for versioned functions. Refactor to call
27         get_function_versions_dispatcher.
28         * decl.c (duplicate_decls): Add comments.
29         * cp/call.c (get_function_version_dispatcher): Expose function.
30         (mark_versions_used): Expose function.
31         * cp/cp-tree.h (mark_versions_used): New declaration.
32         (get_function_version_dispatcher): Ditto.
34 2012-11-13  Dodji Seketeli  <dodji@redhat.com>
36         PR c++/54466
37         * pt.c (lookup_template_class_1): TYPE_STUB_DECL should be
38         accessed on the main variant of the type.
40 2012-11-12  Ed Smith-Rowland  <3dw4rd@verizon.net>
42         * parser.c (cp_parser_objc_class_ivars):
43         Index declspecs.locations by ds_typedef rather than ds_thread.
45 2012-11-09  Ed Smith-Rowland  <3dw4rd@verizon.net>
47         PR c++/54413
48         * decl.c (grokfndecl): Adjust calls to interpret_x_suffix.
50 2012-11-09  Jason Merrill  <jason@redhat.com>
52         PR c++/54859
53         * pt.c (check_instantiated_arg): Don't complain about dependent args.
55         * tree.c (cxx_attribute_table): Add abi_tag attribute.
56         (check_abi_tag_redeclaration, handle_abi_tag_attribute): New.
57         * class.c (find_abi_tags_r, check_abi_tags): New.
58         (check_bases, check_field_decl): Call check_abi_tags.
59         * decl.c (redeclaration_error_message): Call
60         check_abi_tag_redeclaration.
61         * mangle.c (tree_string_cmp, write_abi_tags): New.
62         (write_unqualified_name): Call write_abi_tags.
64 2012-11-07  Paolo Carlini  <paolo.carlini@oracle.com>
66         PR c++/55226
67         Revert:
68         2012-10-23  Paolo Carlini  <paolo.carlini@oracle.com>
70         PR c++/54922
71         * semantics.c (cx_check_missing_mem_inits): Handle anonymous union
72         members.
74 2012-11-07  Florian Weimer  <fweimer@redhat.com>
76         * init.c (build_new_1): Do not check for arithmetic overflow if
77         inner array size is 1.
79 2012-11-05  Sriraman Tallam  <tmsriram@google.com>
81         * class.c (add_method): Change assembler names of function versions.
82         (mark_versions_used): New static function.
83         (resolve_address_of_overloaded_function): Create dispatcher decl and
84         return address of dispatcher instead.
85         * decl.c (decls_match): Make decls unmatched for versioned
86         functions.
87         (duplicate_decls): Remove ambiguity for versioned functions.
88         Delete versioned function data for merged decls.
89         * decl2.c (check_classfn): Check attributes of versioned functions
90         for match.
91         * call.c (get_function_version_dispatcher): New function.
92         (mark_versions_used): New static function.
93         (build_over_call): Make calls to multiversioned functions
94         to call the dispatcher.
95         (joust): For calls to multi-versioned functions, make the most
96         specialized function version win.
98 2012-10-31  Lawrence Crowl  <crowl@google.com>
100         * decl2.c (var_finalized_p): Rename varpool_node to
101         varpool_node_for_decl.
102         (maybe_emit_vtables): Likewise.
104 2012-10-31  Paolo Carlini  <paolo.carlini@oracle.com>
106         PR c++/54583
107         * tree.c (build_cplus_array_type): Set TREE_NO_WARNING on the
108         TYPE_SIZE of VLAs.
110 2012-10-31  Dodji Seketeli  <dodji@redhat.com>
112         PR c++/54955
113         * parser.c (cp_nth_tokens_can_be_std_attribute_p): Recognize the
114         'Alignas' keyword as the beginning of a c++11 attribute specifier.
115         Update the comment of the function.
116         (cp_next_tokens_can_be_gnu_attribute_p): Update the comment of the
117         function.
119 2012-10-29  Jonathan Wakely  <jwakely.gcc@gmail.com>
121         PR c++/54930
122         * typeck.c (maybe_warn_about_returning_address_of_local): Use
123         OPT_Wreturn_local_addr.
125 2012-10-26  Jakub Jelinek  <jakub@redhat.com>
127         PR c++/55081
128         * typeck2.c (store_init_value): Call fold_non_dependent_expr
129         and maybe_constant_init even for C++98.
131 2012-10-26  Paolo Carlini  <paolo.carlini@oracle.com>
133         PR c++/54984
134         * init.c (build_new): Don't turn a null *init into a pointer to
135         empty vector orig_init.
137 2012-10-25  Paolo Carlini  <paolo.carlini@oracle.com>
139         PR c++/53761
140         * class.c (finish_struct_1): Reject aggregates decorated with
141         __transparent_union__ which cannot be made transparent because
142         the type of the first field has a different ABI from the class
143         overall.
145 2012-10-25  Jason Merrill  <jason@redhat.com>
147         Core 1402
148         * call.c (joust): An implicitly deleted move function is
149         worse than any non-deleted function.
150         * method.c (process_subob_fn): No special rules for move.
151         (synthesized_method_walk, implicitly_declare_fn): Likewise.
152         Warn about virtual base with non-trivial move assignment.
153         * cp-tree.h (struct lang_decl_fn): Remove suppress_implicit_decl.
154         (FNDECL_SUPPRESS_IMPLICIT_DECL): Remove.
156         * semantics.c (finish_omp_threadprivate): Call complete_type.
158         * class.c (one_inherited_ctor): Warn about variadic inherited ctor.
160 2012-10-25  Marc Glisse  <marc.glisse@inria.fr>
162         PR c++/54427
163         * typeck.c (build_x_conditional_expr): Handle VEC_COND_EXPR.
164         * call.c (build_conditional_expr_1): Likewise.
166 2012-10-25  Paolo Carlini  <paolo.carlini@oracle.com>
168         PR c++/34892
169         * parser.c (cp_parser_template_parameter): When
170         cp_parser_parameter_declaration parsed a default argument don't
171         see if *is_parameter_pack needs setting.
173 2012-10-23  Paolo Carlini  <paolo.carlini@oracle.com>
175         PR c++/54922
176         * semantics.c (cx_check_missing_mem_inits): Handle anonymous union
177         members.
179 2012-10-23  Jakub Jelinek  <jakub@redhat.com>
181         PR c++/54844
182         * pt.c (tsubst_copy, tsubst_copy_and_build) <case SIZEOF_EXPR>: Use
183         tsubst instead of tsubst_copy* on types.
185         PR c++/54988
186         * decl2.c (cplus_decl_attributes): Don't return early
187         if attributes is NULL.
189 2012-10-18  Paolo Carlini  <paolo.carlini@oracle.com>
191         PR c++/54501
192         * decl.c (reshape_init_array_1): Avoid infinite loops.
194 2012-10-15  Alexandre Oliva  <aoliva@redhat.com>
195             Paolo Carlini  <paolo.carlini@oracle.com>
197         PR c++/17805
198         * call.c (build_new_op_1): Filter out operator functions that don't
199         satisfy enum-conversion match requirements.
201 2012-10-15  Paolo Carlini  <paolo.carlini@oracle.com>
203         PR c++/50080 (again)
204         * parser.c (cp_parser_optional_template_keyword): When -pedantic
205         and C++98 mode restore pre-Core/468 behavior.
207 2012-10-15  Paolo Carlini  <paolo.carlini@oracle.com>
209         PR c++/50080
210         * parser.c (cp_parser_optional_template_keyword): Implement
211         Core/468, allow outside template.
213 2012-10-14  Jason Merrill  <jason@redhat.com>
214             Ville Voutilainen  <ville.voutilainen@gmail.com>
216         Implement C++11 inheriting constructors.
217         * cp-tree.h (cpp0x_warn_str): Add CPP0X_INHERITING_CTORS.
218         (DECL_INHERITED_CTOR_BASE, SET_DECL_INHERITED_CTOR_BASE): New.
219         (special_function_kind): Add sfk_inheriting_constructor.
220         * class.c (add_method): An inheriting ctor is hidden by a
221         user-declared one.
222         (one_inheriting_sig, one_inherited_ctor): New.
223         (add_implicitly_declared_members): Handle inheriting ctors.
224         * error.c (maybe_warn_cpp0x): Handle CPP0X_INHERITING_CTORS.
225         * init.c (emit_mem_initializers): Don't set LOOKUP_DEFAULTED
226         for an inheriting constructor.
227         * method.c (type_has_trivial_fn): Handle sfk_inheriting_constructor.
228         (type_set_nontrivial_flag): Likewise.
229         (add_one_base_init): Split out from...
230         (do_build_copy_constructor): ...here.  Handle inheriting constructors.
231         (locate_fn_flags): Handle a list of arg types.
232         (synthesized_method_walk): Handle inheriting constructors.
233         (maybe_explain_implicit_delete): Likewise.
234         (deduce_inheriting_ctor): New.
235         (implicitly_declare_fn): Handle inheriting constructors.
236         * name-lookup.c (push_class_level_binding_1): An inheriting constructor
237         does not declare the base's name.
238         (do_class_using_decl): Allow inheriting constructors.
239         * pt.c (template_parms_to_args): Split from current_template_args.
240         (add_inherited_template_parms): New.
241         (tsubst_decl): Handle inheriting constructors.
242         * tree.c (special_function_p): Handle inheriting constructors.
244 2012-10-12  Jakub Jelinek  <jakub@redhat.com>
246         PR c/54381
247         * semantics.c (finish_call_expr): Pass array of 3 sizeof_arg
248         trees and locs (corresponding to first 3 arguments) to
249         sizeof_pointer_memaccess_warning.
251 2012-10-12  Paolo Carlini  <paolo.carlini@oracle.com>
253         PR c++/24449
254         * decl.c (grokfndecl): When checking for ::main declarations
255         use PROCESSING_REAL_TEMPLATE_DECL_P().
257 2012-10-12  Marc Glisse  <marc.glisse@inria.fr>
259         PR c++/53055
260         * call.c (build_new_op_1): Pass RO_ARROW_STAR to cp_build_indirect_ref.
261         * typeck.c (cp_build_indirect_ref): Handle RO_ARROW_STAR.
263 2012-10-11  Jason Merrill  <jason@redhat.com>
265         * cp-tree.h (DECL_THUNKS): NULL_TREE for non-virtual functions.
266         (SET_DECL_THUNKS): New.
267         * decl.c (duplicate_decls): Adjust.
268         * method.c (make_thunk): Adjust.
270         * decl.c (grokdeclarator): Set DECL_GNU_TLS_P for static data
271         members, too.
273 2012-10-09  Dodji Seketeli  <dodji@redhat.com>
275         PR c++/53540 - using fails to be equivalent to typedef
276         * cp-tree.h (TYPE_TEMPLATE_INFO): For an alias that is not an
277         instance of alias template, don't look for its TEMPLATE_INFO in
278         its declaration.
279         (alias_template_specialization_p): Take const_tree.
280         * pt.c (alias_template_specialization_p): Take a const_tree.
281         Don't call primary_template_instantiation_p.
282         (primary_template_instantiation_p): Call
283         alias_template_specialization_p.
285 2012-10-10  Dodji Seketeli  <dodji@redhat.com>
287         * parser (cp_parser_statement): Parse c++11 attributes
288         tentatively.
289         (cp_parser_std_attribute_spec_seq): Do not warn too early about
290         using c++11 attributes in non c++11 mode.
292 2012-10-10  Dehao Chen  <dehao@google.com>
294         * cp-gimplify.c (cp_genericize_r): Set location for TRY expr.
296 2012-10-09  Lawrence Crowl  <crowl@google.com>
298         * Make-lang.in (class.o): Add dependence on hash-table.h.
299         (tree.o): Likewise.
300         (semantics.o): Likewise.
301         * class.c (fixed_type_or_null): Change to new type-safe hash table.
302         * tree.c (verify_stmt_tree): Likewise.
303         (verify_stmt_tree_r): Likewise.
304         * semantics.c (struct nrv_data): Likewise.
306 2012-10-09  Paolo Carlini  <paolo.carlini@oracle.com>
308         PR c++/54194
309         * typeck.c (build_x_binary_op): Update warn_about_parentheses call.
310         * parser.c (cp_parser_binary_expression): Use SET_EXPR_LOCATION
311         on current.lhs.
313 2012-10-09  Marc Glisse  <marc.glisse@inria.fr>
315         PR c++/54427
316         * typeck.c (cp_build_binary_op): Handle mixed scalar-vector
317         operations.
318         [LSHIFT_EXPR, RSHIFT_EXPR]: Likewise.
320 2012-10-08  Jakub Jelinek  <jakub@redhat.com>
322         PR c++/54858
323         * tree.c (cp_tree_equal): Handle FIELD_DECL.
325 2012-10-08  Jason Merrill  <jason@redhat.com>
327         Allow dynamic initialization of thread_locals.
328         * decl.c: Define tls_aggregates.
329         (expand_static_init): Remove sorry.  Add to tls_aggregates.
330         * cp-tree.h: Declare tls_aggregates.
331         * call.c (set_up_extended_ref_temp): Add to tls_aggregates.
332         * decl2.c (var_needs_tls_wrapper): New.
333         (var_defined_without_dynamic_init): New.
334         (get_tls_init_fn, get_tls_wrapper_fn): New.
335         (generate_tls_wrapper, handle_tls_init): New.
336         (cp_write_global_declarations): Call handle_tls_init and
337         enerate_tls_wrapper.
338         * mangle.c (write_guarded_var_name): Split out from..
339         (mangle_guard_variable): ...here.
340         (mangle_tls_init_fn, mangle_tls_wrapper_fn): Use it.
341         (decl_tls_wrapper_p): New.
342         * semantics.c (finish_id_expression): Replace use of thread_local
343         variable with a call to its wrapper.
345         * decl.c (get_thread_atexit_node): New.
346         (register_dtor_fn): Use it for TLS.
348         Partial implementation of C++11 thread_local.
349         * decl.c (cp_finish_decl): Remove errors about non-trivial
350         initialization and destruction of TLS variables.
351         (register_dtor_fn): Add sorry about TLS variables.
352         (expand_static_init): Add sorry about non-local TLS variables,
353         or error with __thread.
354         Don't emit thread-safety guards for local TLS variables.
355         (grokdeclarator): thread_local in a function implies static.
356         * decl.h: Adjust prototype.
357         * decl2.c (get_guard): Copy DECL_TLS_MODEL.
358         * parser.c (cp_parser_set_storage_class, cp_parser_set_decl_spec_type)
359         (set_and_check_decl_spec_loc): Take the token rather than the location.
360         Distinguish between __thread and thread_local.
361         (cp_parser_set_storage_class): Don't complain about thread_local before
362         extern/static.
363         (token_is__thread): New.
364         * call.c (make_temporary_var_for_ref_to_temp): Handle TLS.
365         * cp-tree.h (DECL_GNU_TLS_P): New.
366         (cp_decl_specifier_seq): Add gnu_thread_keyword_p.
368 2012-10-08  Dodji Seketeli  <dodji@redhat.com>
370         PR c++/53528 C++11 attribute support
371         * cp-tree.h (enum cpp0x_warn_str::CPP0X_ATTRIBUTES): New member.
372         (enum cp_decl_spec::ds_std_attribute): New enumerator.
373         (struct cp_decl_specifier_seq::std_attributes): New field.
374         (cxx_alignas_expr, warn_misplaced_attr_for_class_type): Declare
375         new functions.
376         (check_tag_decl): Take an extra parameter for explicit
377         instantiations.
378         * decl.c (warn_misplaced_attr_for_class_type): Extract from ...
379         (check_tag_decl): ... here.  Add check for c++11 attributes being
380         applied to an explicit instantiation.  Take an extra parameter for
381         explicit instantiations.
382         (grokdeclarator): Make sure a c++11 attribute after an array
383         declarator appertains to the array, an attribute after a function
384         declarator appertains to the function type, an attribute after a
385         declarator-id appertains to the entity being declared, and an
386         attribute after a pointer declarator appertain to the pointer.
387         * decl2.c (is_late_template_attribute): Use get_attribute_name.
388         * error.c (maybe_warn_cpp0x): Support
389         CPP0X_GENERALIZED_ATTRIBUTES.
390         * parser.c (cp_next_tokens_can_be_attribute_p)
391         (cp_next_tokens_can_be_gnu_attribute_p)
392         (cp_next_tokens_can_be_std_attribute_p)
393         (cp_nth_tokens_can_be_attribute_p)
394         (cp_nth_tokens_can_be_gnu_attribute_p)
395         (cp_nth_tokens_can_be_std_attribute_p)
396         (cp_parser_gnu_attribute_list, cp_parser_std_attribute)
397         (cp_parser_std_attribute_spec, cp_parser_std_attribute_spec_seq)
398         (cp_parser_attributes_opt, cp_parser_std_attribute_list): New
399         static functions.
400         (cp_parser_gnu_attributes_opt): Replace cp_parser_attributes_opt.
401         (cp_parser_gnu_attribute_list): Replace cp_parser_attribute_list.
402         (cp_parser_postfix_expression): Disallow "[[" tokens here.
403         (cp_parser_label_for_labeled_statement): Use take an extra
404         parameter for attributes.
405         (cp_parser_block_declaration): Use
406         cp_nth_tokens_can_be_std_attribute_p here.
407         (cp_parser_decl_specifier_seq): Likewise.  Store C++11 attributes
408         that appears in in decl specifiers in cp_decl_specifier_seq::std_attributes.
409         declaration.  Emit proper warning about misplaced c++11 attributes
410         for class type.
411         (cp_parser_explicit_instantiation): Adjust call to check_tag_decl.
412         (cp_parser_init_declarator):  Parsing attributes here is no more a
413         GNU extension in c++-11.
414         (cp_parser_type_specifier_seq): Use
415         cp_next_tokens_can_be_attribute_p.
416         (cp_parser_direct_declarator): Likewise.  Hang c++11 attributes
417         following the declarator to its syntactic construct.  It'll later
418         be applied to the proper appertaining entity by grokdeclarator.
419         (cp_parser_ptr_operator): Likewise.
420         (make_declarator): Initialize cp_declarator::std_attribute.
421         (make_pointer_declarator, make_reference_declarator)
422         (make_ptrmem_declarator, cp_parser_make_indirect_declarator): Take
423         attributes that appertain to the pointer/reference in argument.
424         (cp_parser_ptr_operator): Take an out parameter for c++11
425         attributes.  Update comments.
426         (cp_parser_new_declarator_opt)
427         (cp_parser_conversion_declarator_opt): Adjust.
428         (cp_parser_declarator): Likewise.  Handle C++11 attributes.
429         Rename attributes to gnu_attribute for better legibility.
430         (cp_parser_simple_declaration): Update comment.
431         (cp_parser_class_specifier_1): Parse GNU attributes specifically
432         (cp_parser_enum_specifier): Accept only gnu attributes after the
433         specifier.
434         (cp_parser_member_declaration): Don't clear attributes -- intended
435         for the entity being declared -- too early because check_tag_decl
436         needs them.
437         (cp_parser_statement): Update comment.  Parse optional c++11
438         attributes at the beginning of the relevant kind of statements and
439         ignore them, for now, unless when calling
440         cp_parser_label_for_labeled_statement.
441         (cp_parser_label_for_labeled_statement): Take c++11 attributes
442         in parameter.
443         * semantics.c (potential_constant_expression_1): Likewise.
444         * typeck.c (fundamental_alignment_p, cxx_alignas_expr): New public
445         functions.
447 2012-10-07  Paolo Carlini  <paolo.carlini@oracle.com>
449         * pt.c (fold_non_dependent_expr_sfinae): Remove static specifier.
450         (tsubst_copy_and_build): Use get_target_expr_sfinae.
451         * call.c (build_conditional_expr_1, convert_like_real): Likewise.
452         * cvt.c (build_up_reference): Likewise.
453         (ocp_convert): Use abstract_virtuals_error_sfinae.
454         (build_up_reference): Propagate complain to cp_build_addr_expr.
455         * decl.c (compute_array_index_type): Use fold_non_dependent_expr_sfinae.
456         * cp-tree.h: Update declarations.
458         * cvt.c (build_expr_type_conversion): Tidy.
460         * tree.c (stabilize_aggr_init): Change to static.
462 2012-10-07  Paolo Carlini  <paolo.carlini@oracle.com>
464         PR c++/51422
465         * semantics.c (is_normal_capture_proxy): Return true for
466         error_mark_node as DECL_VALUE_EXPR.
468 2012-10-05  Jakub Jelinek  <jakub@redhat.com>
470         * cp-tree.h (SIZEOF_EXPR_TYPE_P): Define.
471         * tree.c (cp_tree_equal): Handle SIZEOF_EXPR with
472         SIZEOF_EXPR_TYPE_P.
473         * mangle.c (write_expression): Likewise.
474         * cxx-pretty-print.c (pp_cxx_unary_expression): Likewise.
475         * error.c (dump_expr): Likewise.
476         * parser.c (cp_parser_unary_expression): For sizeof call
477         cxx_sizeof_or_alignof_{type,expr} just for diagnostics and
478         return SIZEOF_EXPR with the operand.
479         * pt.c (tsubst_copy, tsubst_copy_and_build): For SIZEOF_EXPR,
480         call cxx_sizeof_or_alignof_{type,expr} for diagnostics, but
481         return SIZEOF_EXPR with tsubsted operand.
482         (value_dependent_expression_p): Handle SIZEOF_EXPR with
483         SIZEOF_EXPR_TYPE_P.
484         (instantiation_dependent_r): Likewise.
485         * call.c (null_ptr_cst_p): Call maybe_constant_value for C++98.
486         * semantics.c (finish_call_expr): Call
487         sizeof_pointer_memaccess_warning if needed.
488         (cxx_eval_constant_expression): Handle SIZEOF_EXPR.
489         (potential_constant_expression_1): Remove early exit for
490         C++98.  Handle PROPERTY_REF.
491         * decl.c (duplicate_decls): When redeclaring a builtin function,
492         keep the merged decl builtin also if newdecl is a gnu_inline
493         inline definition.
494         (fold_sizeof_expr_r): New function.
495         (compute_array_index_type): Fold SIZEOF_EXPRs in itype.
496         * cp-gimplify.c (cp_genericize_r): Fold SIZEOF_EXPR.
497         * typeck.c (cp_build_binary_op): For warn_for_sign_compare
498         try harder using maybe_constant_value to get INTEGER_CSTs.
500         * decl.c (stabilize_vla_size): Call pointer_set_destroy
501         at the end.
503 2012-10-04  Arnaud Charlet  <charlet@adacore.com>
504         
505         * decl2.c (cp_write_global_declarations): Fix handling of
506         -fdump-ada-spec*.
508 2012-10-03  Jakub Jelinek  <jakub@redhat.com>
510         PR c++/54777
511         * semantics.c (cxx_eval_constant_expression) <case COMPOUND_EXPR>: If
512         not ignoring the second operand, pass the original second operand
513         and not one with stripped nops to cxx_eval_constant_expression.
515 2012-10-01  Jason Merrill  <jason@redhat.com>
517         * decl.c (check_initializer): Set DECL_NONTRIVIALLY_INITIALIZED_P
518         for a constructor call.
519         (decl_jump_unsafe): So don't bother checking
520         type_has_nontrivial_default_init.
521         * call.c (set_up_extended_ref_temp): Set
522         DECL_NONTRIVIALLY_INITIALIZED_P.
524         * cp-tree.h (TYPE_FUNCTION_OR_TEMPLATE_DECL_CHECK): New.
525         (DECL_FRIEND_P, DECL_ANTICIPATED): Use it.
526         (TYPE_FUNCTION_OR_TEMPLATE_DECL_P): New.
527         * name-lookup.c (hidden_name_p): Use it.
529         * cp-tree.h (DECL_PRETTY_FUNCTION_P): Just look at the name.
530         * decl.c (cp_make_fname_decl): Adjust.
532 2012-09-30  Sharad Singhai  <singhai@google.com>
534         * decl2.c (cp_write_global_declarations): Use a different method
535         to determine if the dump has ben initialized.
537 2012-09-29  Paolo Carlini  <paolo.carlini@oracle.com>
539         PR c++/54738
540         * decl2.c (build_offset_ref_call_from_tree): Add tsubst_flags_t
541         parameter.
542         * pt.c (tsubst_copy_and_build): Adjust.
543         * parser.c (cp_parser_postfix_expression): Likewise.
544         * cp-tree.h: Adjust declaration.
546 2012-09-28  Dodji Seketeli  <dodji@redhat.com>
548         PR c++/54372 - unused attribute inactive on dependant entities
549         * decl2.c (is_late_template_attribute): "unused" attribute is to
550         be applied at compile time.
552 2012-09-25  Dodji Seketeli  <dodji@redhat.com>
554         PR c++/29028 - Missed unused warning on using declaration
555         * decl.c (poplevel<warn_unused*>): Do not forget that some local
556         bindings are represented by a TREE_LIST.
558 2012-09-25  Dodji Seketeli  <dodji@redhat.com>
560         PR c++/53551 - -Wunused-local-typedefs misses uses
561         * decl.c (make_typename_type): Record the use of typedefs.
563 2012-09-27  Jakub Jelinek  <jakub@redhat.com>
565         * init.c (build_new_1): Don't test TREE_CONSTANT
566         of INTEGER_CST.
568 2012-09-25  Paolo Carlini  <paolo.carlini@oracle.com>
570         PR c++/54526
571         * parser.c (cp_parser_template_id): In C++11 mode simply accept
572         X<::A>.
574 2012-09-25  Zhenqiang Chen <zhenqiang.chen@linaro.org>
576         PR c++/50970
577         * typeck.c (cp_build_binary_op): Check side effects before generating
578         pfn and delta related expressions.
580 2012-09-24  Lawrence Crowl  <crowl@google.com>
582         * init.c (build_new_1): Change to new double_int API.
583         * decl.c (build_enumerator): Likewise.
584         * typeck2.c (process_init_constructor_array): Likewise.
585         * mangle.c (write_array_type): Likewise.
587 2012-09-24  Paolo Carlini  <paolo.carlini@oracle.com>
589         PR c++/50828
590         * error.c (dump_function_decl): Strip TFF_TEMPLATE_NAME from flags
591         at the outset.
593 2012-09-24  Jason Merrill  <jason@redhat.com>
595         * decl.c (get_atexit_node): Remove dead code.
597         * Make-lang.in (cp/parser.o): Depend on decl.h.
599 2012-09-20  Paolo Carlini  <paolo.carlini@oracle.com>
601         PR c++/52432
602         * pt.c (tsubst_copy_and_build): If tf_error is not set in the complain
603         argument don't call unqualified_name_lookup_error.
605 2012-09-19  Marc Glisse  <marc.glisse@inria.fr>
607         PR c++/54581
608         * semantics.c (finish_decltype_type): Make vectors not opaque.
610 2012-09-17  Jason Merrill  <jason@redhat.com>
612         PR c++/54575
613         * pt.c (instantiate_alias_template): New.
614         (tsubst): Use it.
615         (push_access_scope): Allow TYPE_DECL.
617 2012-09-14  Jason Merrill  <jason@redhat.com>
619         PR c++/53661
620         * typeck2.c (check_narrowing): Avoid false positives on conversion
621         from enumeral type.
623 2012-09-14  Marc Glisse  <marc.glisse@inria.fr>
625         PR c++/54427
626         * typeck.c (cp_build_binary_op) [LSHIFT_EXPR, RSHIFT_EXPR, EQ_EXPR,
627         NE_EXPR, LE_EXPR, GE_EXPR, LT_EXPR, GT_EXPR]: Handle VECTOR_TYPE.
629 2012-09-14  Paolo Carlini  <paolo.carlini@oracle.com>
631         * decl.c (make_typename_type): Only error out if tf_error is set
632         in complain.
634 2012-09-13  Paolo Carlini  <paolo.carlini@oracle.com>
635             Manuel LĂłpez-Ibåñez  <manu@gcc.gnu.org>
637         PR c++/53210
638         * init.c (perform_member_init): Use OPT_Winit_self instead of
639         OPT_Wuninitialized.
641 2012-09-13  Paolo Carlini  <paolo.carlini@oracle.com>
643         * typeck.c (build_indirect_ref, build_function_call,
644         build_function_call_vec, build_binary_op, build_unary_op,
645         build_compound_expr, build_c_cast, build_modify_expr): Remove
646         uses of ATTRIBUTE_UNUSED on the parameters.
647         * class.c (set_linkage_according_to_type, resort_type_method_vec,
648         dfs_find_final_overrider_post, empty_base_at_nonzero_offset_p):
649         Likewise.
650         * decl.c (local_variable_p_walkfn): Likewise.
651         * except.c (wrap_cleanups_r, check_noexcept_r): Likewise.
652         * error.c (find_typenames_r): Likewise.
653         * tree.c (verify_stmt_tree_r, bot_replace,
654         handle_java_interface_attribute, handle_com_interface_attribute,
655         handle_init_priority_attribute, c_register_addr_space): Likewise.
656         * cp-gimplify.c (cxx_omp_clause_default_ctor): Likewise.
657         * cp-lang.c (objcp_tsubst_copy_and_build): Likewise.
658         * pt.c (unify_success, unify_invalid, instantiation_dependent_r):
659         Likewise.
660         * semantics.c (dfs_calculate_bases_pre): Likewise.
661         * decl2.c (fix_temporary_vars_context_r, clear_decl_external):
662         Likewise.
663         * parser.c (cp_lexer_token_at, cp_parser_omp_clause_mergeable,
664         cp_parser_omp_clause_nowait, cp_parser_omp_clause_ordered,
665         cp_parser_omp_clause_untied): Likewise.
666         * mangle.c (write_unnamed_type_name,
667         discriminator_for_string_literal): Likewise.
668         * search.c (dfs_accessible_post, dfs_debug_mark): Likewise.
669         * lex.c (handle_pragma_vtable, handle_pragma_unit,
670         handle_pragma_interface, handle_pragma_implementation,
671         handle_pragma_java_exceptions): Likewise.
673 2012-09-13  Jason Merrill  <jason@redhat.com>
675         PR c++/53839
676         * semantics.c (cxx_eval_indirect_ref): If we aren't looking for an
677         address, make sure the value is constant.
679         PR c++/54511
680         * pt.c (tsubst_decl) [VAR_DECL]: Handle DECL_ANON_UNION_VAR_P.
682         PR c++/53836
683         * pt.c (value_dependent_expression_p): A TREE_LIST initializer must
684         be dependent.
686 2012-09-10  Paolo Carlini  <paolo.carlini@oracle.com>
688         PR c++/54541
689         PR c++/54542
690         * call.c (build_cxx_call): Add tsubst_flags_t parameter, use
691         require_complete_type_sfinae.
692         (build_op_delete_call, build_over_call): Adjust.
693         * typeck.c (build_x_compound_expr_from_vec): Add tsubst_flags_t
694         parameter.
695         (cp_build_function_call_vec): Adjust.
696         * init.c (build_new_1): Likewise.
697         * rtti.c (throw_bad_cast, throw_bad_typeid, build_dynamic_cast_1):
698         Likewise.
699         * optimize.c (build_delete_destructor_body): Likewise.
700         * cp-tree.h: Adjust declarations.
702         * call.c (convert_arg_to_ellipsis): Use require_complete_type_sfinae.
704 2012-09-10  Jason Merrill  <jason@redhat.com>
706         PR c++/54538
707         PR c++/53783
708         * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Go back to using RECUR
709         for LAMBDA_EXPR_EXTRA_SCOPE except for function scope.
711         PR c++/54506
712         * decl.c (move_signature_fn_p): Split out from move_fn_p.
713         * method.c (process_subob_fn): Use it.
714         * cp-tree.h: Declare it.
716 2012-09-07  Jason Merrill  <jason@redhat.com>
718         * semantics.c (sort_constexpr_mem_initializers): Tweak.
720 2012-09-09  Mark Kettenis  <kettenis@openbsd.org>
722         * decl.c (reshape_init_class): Avoid dereferencing a
723         past-the-end pointer.
725 2012-09-07  Paolo Carlini  <paolo.carlini@oracle.com>
727         * pt.c (num_template_headers_for_class): Rework per the code
728         inline in cp_parser_check_declarator_template_parameters.
729         * parser.c (cp_parser_check_declarator_template_parameters):
730         Use num_template_headers_for_class.
732 2012-09-06  Jason Merrill  <jason@redhat.com>
734         PR c++/54341
735         PR c++/54253
736         * semantics.c (sort_constexpr_mem_initializers): New.
737         (build_constexpr_constructor_member_initializers): Use it.
738         (cx_check_missing_mem_inits): Skip artificial fields.
739         * init.c (expand_aggr_init_1): Don't zero out a class
740         with no data.
742 2012-09-05  Paolo Carlini  <paolo.carlini@oracle.com>
744         PR c++/54191
745         * search.c (lookup_base): Add tsubst_flags_t parameter.
746         (adjust_result_of_qualified_name_lookup, check_final_overrider):
747         Adjust.
748         * name-lookup.c (do_class_using_decl): Adjust.
749         * typeck2.c (binfo_or_else, build_scoped_ref, build_m_component_ref):
750         Likewise.
751         * cvt.c (cp_convert_to_pointer, convert_to_pointer_force,
752         build_up_reference): Likewise.
753         * rtti.c (build_dynamic_cast_1): Likewise.
754         * tree.c (maybe_dummy_object): Likewise.
755         * call.c (build_conditional_expr_1, build_over_call): Likewise.
756         * cp-tree.h (UNIQUELY_DERIVED_FROM_P, PUBLICLY_UNIQUELY_DERIVED_P):
757         Remove.
758         (enum base_access_flags, ba_quiet): Remove.
759         (uniquely_derived_from_p, publicly_uniquely_derived_p): Declare.
760         * except.c (can_convert_eh): Adjust.
761         * decl.c (grokdeclarator): Likewise.
762         * typeck.c (comp_except_types, build_class_member_access_expr,
763         finish_class_member_access_expr, get_member_function_from_ptrfunc,
764         build_static_cast_1, get_delta_difference_1): Likewise.
765         * class.c (build_base_path, convert_to_base, build_vtbl_ref_1,
766         warn_about_ambiguous_bases): Likewise.
767         (uniquely_derived_from_p, publicly_uniquely_derived_p): Define.
769 2012-09-04  Jason Merrill  <jason@redhat.com>
771         PR c++/54441
772         * decl.c (reshape_init_class): Handle invalid initializer for
773         0-length array member.
775         * error.c (dump_type_suffix): Correct handling of 0-length arrays.
777         PR c++/54420
778         * cp-tree.h (LAMBDANAME_P): Remove.
779         (LAMBDA_TYPE_P): Check CLASSTYPE_LAMBDA_EXPR instead.
780         * cp-lang.c (cxx_dwarf_name): Likewise.
781         * error.c (dump_aggr_type): Likewise.
782         * semantics.c (begin_lambda_type): Set CLASSTYPE_LAMBDA_EXPR sooner.
784         PR c++/54198
785         * decl.c (check_default_argument): Set cp_unevaluated_operand
786         around call to perform_implicit_conversion_flags.
788         PR c++/54437
789         PR c++/51213
790         * pt.c (fn_type_unification): Call coerce_template_parms before
791         entering substitution context.
793 2012-08-31  Paolo Carlini  <paolo.carlini@oracle.com>
794             Jason Merrill  <jason@redhat.com>
796         PR c++/18747
797         * pt.c (check_template_variable): New.
798         (num_template_headers_for_class): Split out...
799         * decl.c (grokdeclarator): ...from here.
800         (start_decl): Remove redundant diagnostic.
801         * cp-tree.h: Declare them
802         * parser.c (cp_parser_single_declaration): Call check_template_variable.
804 2012-08-31  Ollie Wild  <aaw@google.com>
806         PR c++/54197
807         * call.c (extend_ref_init_temps_1): Handle COMPOUND_EXPR trees.
809 2012-08-30  Jason Merrill  <jason@redhat.com>
811         PR c++/50545
812         PR c++/51222
813         * pt.c (instantiation_dependent_r): New.
814         (instantiation_dependent_expression_p): New.
815         (value_dependent_expression_p): Use it.  SCOPE_REF is always dependent.
816         * semantics.c (finish_decltype_type): Use it.
817         * cp-tree.h: Declare it.
819         * semantics.c (finish_qualified_id_expr): Handle building up a
820         non-dependent SCOPE_REF here.
821         (finish_id_expression): Not here.
822         * error.c (dump_decl) [SCOPE_REF]: Only pass TFF_UNQUALIFIED_NAME.
824         * friend.c (make_friend_class): Handle template template parameters.
825         * parser.c (cp_parser_template_declaration_after_export): Likewise.
826         * pt.c (tsubst_friend_class): Likewise.
827         (instantiate_class_template_1): Likewise
828         * decl.c (check_elaborated_type_specifier): Likewise.
829         (lookup_and_check_tag): Likewise.
831         * pt.c (get_class_bindings): Call coerce_template_parms.  Add
832         main_tmpl parameter.
833         (more_specialized_class): Add main_tmpl parameter.
834         (most_specialized_class): Adjust calls.
836         * decl.c (cp_finish_decl): Check for invalid multiple initializers
837         even if the initializer is dependent.
839         * pt.c (instantiate_template_1): Keep processing_template_decl set
840         if there are dependent args.
842 2012-08-25  Paolo Carlini  <paolo.carlini@oracle.com>
844         PR c++/51421
845         * decl2.c (mark_used): Consistently return false after errors
846         about uses before deduction of auto.
847         * semantics.c (finish_id_expression): Check mark_used return
848         value and return error_mark_node in case of failure.
850 2012-08-24  Jason Merrill  <jason@redhat.com>
852         PR c++/51213 (again)
853         * pt.c (deduction_tsubst_fntype): Remove.
854         (fn_type_unification): Check deduction depth and call
855         instantiate_template here.  Handle default argument access checks.
856         (determine_specialization): Suppress access control.
857         (tsubst_decl): Check for excessive deduction depth.
858         (recheck_decl_substitution): Make sure access control is on.
859         (type_unification_real): Don't mess with access deferring here.
860         (get_bindings): Adjust for fn_type_unification return type.
861         * call.c (enum rejection_reason_code): Drop rr_template_instantiation.
862         (template_instantiation_rejection): Remove.
863         (struct rejection_reason): Change targs to num_targs.
864         (template_unification_rejection, print_z_candidate): Adjust.
865         (add_template_candidate_real): Adjust for fn_type_unification change.
866         * class.c (resolve_address_of_overloaded_function): Likewise.
867         * cp-tree.h: Adjust declaration.
869         * pt.c (tsubst_default_argument): Indicate where the default
870         argument is being instantiated for.
871         (tsubst_expr): Restore previous location.
872         (tsubst_copy_and_build): Set and restore location.
873         * call.c (build_new_method_call_1): Remember location of call.
874         * semantics.c (finish_call_expr): Here too.
875         * parser.c (cp_parser_omp_for_loop): Remember the location of the
876         increment expression.
878         * pt.c (resolve_overloaded_unification): Use coerce_template_parms
879         instead of get_bindings.
880         (resolve_nondeduced_context): Likewise.
882         * pt.c (register_specialization): Correct argument to
883         check_specialization_namespace.
884         (determine_specialization): Don't consider members of
885         unspecialized types.
887 2012-08-23  Jason Merrill  <jason@redhat.com>
889         * decl.c (compute_array_index_type): Use type_dependent_expression_p.
891 2012-08-23  Paolo Carlini  <paolo.carlini@oracle.com>
893         PR c++/20420
894         * name-lookup.c (supplement_binding_1): Handle specially enums
895         only in class templates.
896         (validate_nonmember_using_decl): Enforce 7.3.3/10 about duplicate
897         using declarations at function scope.
899 2012-08-21  Richard Guenther  <rguenther@suse.de>
901         * cp-tree.h (TREE_INDIRECT_USING): Use TREE_LANG_FLAG_0 accessor.
902         (ATTR_IS_DEPENDENT): Likewise.
903         (ARGUMENT_PACK_INCOMPLETE_P): Use TREE_ADDRESSABLE instead of
904         TREE_LANG_FLAG_0 on TREE_VECs.
906 2012-08-20  Florian Weimer  <fweimer@redhat.com>
908         PR c++/19351
909         * call.c (build_operator_new_call): Add size_check argument and
910         evaluate it.
911         * cp-tree.h (build_operator_new_call): Adjust declaration.
912         * init.c (build_new_1): Compute array size check and apply it.
914 2012-08-20  Paolo Carlini  <paolo.carlini@oracle.com>
916         PR c++/10416
917         * decl.c (poplevel): Check TYPE_HAS_NONTRIVIAL_DESTRUCTOR for
918         Wunused_variable too.
920 2012-08-20  Diego Novillo  <dnovillo@google.com>
922         * decl.c (poplevel): Start TV_NAME_LOOKUP conditionally.
924 2012-08-20  Richard Guenther  <rguenther@suse.de>
926         * name-lookup.c (store_binding_p): New predicate, split out from ...
927         (store_binding): ... here.  Always store binding and require
928         target vector with enough space.
929         (store_bindings): Collect to store bindings and reserve space
930         for them, then store them.
931         (store_class_bindings): Likewise.
933 2012-08-19  Mikael Morin  <mikael@gcc.gnu.org>
935         * Make-lang.in: Fix typo.
937 2012-08-17  Jakub Jelinek  <jakub@redhat.com>
939         * cp-tree.def (SIZEOF_EXPR): Move to c-common.def.
941 2012-08-14   Diego Novillo  <dnovillo@google.com>
943         Merge from cxx-conversion branch.  Re-write VEC in C++.
945         * call.c (add_function_candidate): Remove const qualifier
946         from call to VEC_index.
948 2012-08-10  Richard Guenther  <rguenther@suse.de>
950         * error.c (dump_expr): Handle anonymous SSA names.
952 2012-08-07  Steven Bosscher  <steven@gcc.gnu.org>
954         * error.c (print_instantiation_context): Pretty-print a newline before
955         diagnostic_flush_buffer.
956         * cxx-pretty-print.c (pp_cxx_function_definition): Use
957         pp_newline_and_flush instead of separate pp_newline and pp_flush.
959 2012-08-06  Dodji Seketeli  <dodji@redhat.com>
961         Avoid crashing on erroneous static_assert usage
962         * semantics.c (finish_static_assert): Don't crash on erroneous
963         message or condition.
965 2012-08-06  Marc Glisse  <marc.glisse@inria.fr>
966             Paolo Carlini  <paolo.carlini@oracle.com>
968         PR c++/54165
969         * typeck.c (build_static_cast_1): Move the conversion to void case
970         before the perform_direct_initialization_if_possible call.
972 2012-08-03  Marc Glisse  <marc.glisse@inria.fr>
974         * pt.c (tsubst_copy_and_build): Handle VECTOR_TYPE like scalars.
975         * cp-tree.h (scalarish_type_p): Declare.
976         * tree.c (scalarish_type_p): Make non-static.
978 2012-08-02  Jason Merrill  <jason@redhat.com>
979             Paolo Carlini  <paolo.carlini@oracle.com>
981         PR c++/51213 (again)
982         * pt.c (type_unification_real): Call push_deferring_access_checks /
983         pop_deferring_access_checks around the substitution of default
984         template args.
985         (instantiate_template_1): When the specialization returned by
986         retrieve_specialization has FNDECL_HAS_ACCESS_ERRORS set and we
987         are in a SFINAE context, simply return error_mark_node.
988         * cp-tree.h (FNDECL_RECHECK_ACCESS_P): Rename FNDECL_HAS_ACCESS_ERRORS.
990 2012-07-31  Paolo Carlini  <paolo.carlini@oracle.com>
992         * pt.c (check_default_tmpl_args): Change is_primary and is_partial
993         parameters to bool type, adjust.
994         (push_template_decl_real): Tidy.
995         * parser.c (cp_parser_init_declarator): Adjust.
996         * decl.c (redeclaration_error_message): Likewise.
997         * cp-tree.h (check_default_tmpl_args): Update prototype.
999 2012-07-31  Paolo Carlini  <paolo.carlini@oracle.com>
1001         PR c++/53624
1002         * pt.c (check_default_tmpl_args): Don't check local types.
1004 2012-07-25  Sandra Loosemore  <sandra@codesourcery.com>
1005             Paul Brook  <paul@codesourcery.com>
1007         PR target/53633
1008         * decl.c (finish_function): Check targetm.warn_func_return.
1010 2012-07-25  Jason Merrill  <jason@redhat.com>
1012         PR c++/54086
1013         * decl.c (grokdeclarator): Allow const and constexpr together.
1015         PR c++/54020
1016         * semantics.c (potential_constant_expression_1) [COND_EXPR]: Call
1017         maybe_constant_value.
1019         * cp-tree.h (tsubst_flags): Remove tf_no_access_control.
1020         * call.c (standard_conversion): Don't set it.
1021         * class.c (resolve_address_of_overloaded_function): Don't check it.
1022         * decl.c (check_default_argument): Call
1023         perform_implicit_conversion_flags.
1025         * pt.c (print_candidates_1): Use inform instead of error.
1027 2012-07-24  Paolo Carlini  <paolo.carlini@oracle.com>
1029         * pt.c (convert_template_argument, tsubst): Simplify fourth argument
1030         to make_typename_type (complain & tf_error -> complain).
1032 2012-07-24  Steven Bosscher  <steven@gcc.gnu.org>
1034         * class.c (n_vtables, n_vtable_entries, n_vtable_searches,
1035         n_vtable_elems, n_convert_harshness, n_compute_conversion_costs,
1036         n_inner_fields_searched): Always define.
1037         (build_primary_vtable): Convert #ifdef GATHER_STATISTICS to if-code.
1038         (print_class_statistics): Convert #ifdef GATHER_STATISTICS to if-code.
1039         * tree.c (depth_reached): Always define global.
1040         (cxx_print_statistics): Convert #ifdef GATHER_STATISTICS to if-code.
1041         * pt.c (depth_reached): Always define.
1042         (push_tinst_level): Convert #ifdef GATHER_STATISTICS to if-code.
1043         * search.c (n_fields_searched, n_calls_lookup_field,
1044         n_calls_lookup_field_1, n_calls_lookup_fnfields,
1045         n_calls_lookup_fnfields_1, n_calls_get_base_type,
1046         n_outer_fields_searched, n_contexts_saved): Always define.
1047         (lookup_field_1): Convert #ifdef GATHER_STATISTICS to if-code.
1048         (lookup_member): Likewise.
1049         (lookup_fnfields_idx_nolazy): Likewise.
1050         (print_search_statistics): Likewise.
1051         (reinit_search_statistics): Unconditionally re-set counters.
1052         * lex.c (retrofit_lang_decl): Convert #ifdef GATHER_STATISTICS
1053         to if-code.
1054         (cxx_dup_lang_specific_decl): Likewise.
1055         (copy_lang_type): Likewise.
1056         (cxx_make_type): Likewise.
1058 2012-07-20  Jason Merrill  <jason@redhat.com>
1060         PR c++/54038
1061         * tree.c (build_cplus_array_type): Use build_cplus_array_type to build
1062         canonical array type rather than mess with its TYPE_*_VARIANT.
1064 2012-07-19  Jason Merrill  <jason@redhat.com>
1066         PR c++/54026
1067         * typeck.c (cp_apply_type_quals_to_decl): Check COMPLETE_TYPE_P.
1069         PR c++/54021
1070         * call.c (build_cxx_call): Set optimize when folding
1071         __builtin_constant_p in a constexpr function.
1073 2012-07-18  Jason Merrill  <jason@redhat.com>
1075         * pt.c (instantiate_decl): Don't recheck substitutions.
1077 2012-07-18  Paolo Carlini  <paolo.carlini@oracle.com>
1078             Jason Merrill  <jason@redhat.com>
1080         DR 1170
1081         PR c++/51213
1082         * semantics.c (perform_access_checks): Add complain parm, return bool.
1083         (perform_deferred_access_checks): Likewise.
1084         (perform_or_defer_access_check): Likewise.
1085         (speculative_access_check): Remove.
1086         * call.c (enforce_access): Add complain parm, return bool.
1087         * decl.c, friend.c, class.c, init.c, parser.c: Adjust callers.
1088         * search.c: Adjust callers.
1089         * cp-tree.h (TINFO_RECHECK_ACCESS_P): New macro.
1090         (FNDECL_RECHECK_ACCESS_P): New macro.
1091         * method.c (synthesized_method_walk): Stop deferring access checks.
1092         * pt.c (recheck_decl_substitution): New.
1093         (instantiate_template_1): Set and check FNDECL_RECHECK_ACCESS_P.
1095 2012-07-18  Jason Merrill  <jason@redhat.com>
1097         * method.c (process_subob_fn): Make sure no_implicit_p is non-null
1098         before trying to store through it.
1100 2012-07-17  Jason Merrill  <jason@redhat.com>
1102         PR c++/53995
1103         * decl.c (finish_enum_value_list): Only call
1104         insert_late_enum_def_into_classtype_sorted_fields in class scope.
1106         PR c++/53989
1107         * tree.c (build_cplus_array_type): Also add TYPE_CANONICAL
1108         to the list of variants.
1110         * decl.c (xref_basetypes): Complain about incomplete template base.
1111         * class.c (finish_struct): Adjust variants in templates, too.
1113         PR c++/53549
1114         * parser.c (cp_parser_class_head): Call xref_basetypes here.
1115         (cp_parser_class_specifier_1): Not here.
1116         * pt.c (tsubst_decl) [USING_DECL]: Check uses_template_parms
1117         as well as DECL_DEPENDENT_P.
1119 2012-07-16  Jason Merrill  <jason@redhat.com>
1121         * cp-tree.h (struct deferred_access_check): Add location.
1122         * semantics.c (perform_access_checks): Use it.
1123         (perform_or_defer_access_check): Store it.
1125 2012-07-16  Steven Bosscher  <steven@gcc.gnu.org>
1127         * dump.c (dump_stmt): Moved here from c-dump.c.
1128         * optimize.c: Include dumpfile.h instead of tree-dump.h.
1129         * class.c: Likewise.
1130         * decl2.c: Likewise.
1131         * Make-lang.in: Fix dependencies.
1133 2012-07-13  Jason Merrill  <jason@redhat.com>
1135         PR c++/53953
1136         * method.c (synthesized_method_walk): Initialize no_implicit_p sooner.
1138 2012-07-12  Jason Merrill  <jason@redhat.com>
1140         * pt.c (instantiate_decl): Check typedefs access here.
1141         (instantiate_template_1): Not here.
1143         * pt.c (deduction_tsubst_fntype): Just suppress access checking.
1144         (instantiate_template_1): Set DECL_TI_TEMPLATE before access checking.
1145         (push_deduction_access_scope, pop_deduction_access_scope): Remove.
1147 2012-07-11  Jason Merrill  <jason@redhat.com>
1149         DR 1402
1150         * method.c (synthesized_method_walk): Replace uses of msg with diag.
1151         Correct handling of virtual bases with move operations.
1152         (process_subob_fn, walk_field_subobs): Replace uses of msg with diag.
1154 2012-07-11  Steven Bosscher  <steven@gcc.gnu.org>
1156         * method.c: Do not include tree-pass.h.
1158 2012-07-10  Jason Merrill  <jason@redhat.com>
1160         DR 1402
1161         PR c++/53733
1162         * cp-tree.h (FNDECL_SUPPRESS_IMPLICIT_DECL): New.
1163         (struct lang_decl_fn): Add suppress_implicit_decl field.
1164         * method.c (implicitly_declare_fn): Check it.
1165         (process_subob_fn): Add no_implicit_p parm.
1166         (walk_field_subobs, synthesized_method_walk): Likewise.
1167         (maybe_explain_implicit_delete): Adjust.
1168         (explain_implicit_non_constexpr): Adjust.
1170         * method.c (synthesized_method_walk): Avoid changing
1171         EH spec based on cleanups in other places, too.
1173 2012-07-09  Sterling Augustine  <saugustine@google.com>
1175         * error.c (lang_decl_name): Use TFF_UNQUALIFIED_NAME flag.
1177 2012-07-08  Steven Bosscher  <steven@gcc.gnu.org>
1179         * decl.c (cp_finish_decl): Add FIXME at add_local_decl call site.
1181 2012-07-06  Jason Merrill  <jason@redhat.com>
1183         PR c++/53862
1184         * pt.c (tsubst_arg_types): Add "end" parameter.
1185         (check_undeduced_parms): Use it.
1187         * cp-tree.h (DECL_DECLARES_TYPE_P): Check DECL_TYPE_TEMPLATE_P.
1189         PR c++/53858
1190         * name-lookup.c (ambiguous_decl): Use DECL_TYPE_TEMPLATE_P.
1192 2012-07-05  Jason Merrill  <jason@redhat.com>
1194         PR c++/53039
1195         * pt.c (arg_from_parm_pack_p): Go back to using same_type_p or
1196         cp_tree_equal.
1198         * cp-tree.h (TEMPLATE_PARM_NUM_SIBLINGS): Remove.
1199         (struct template_parm_index_s): Remove num_siblings.
1200         * pt.c (fixup_template_parms, fixup_template_parm_index): Remove.
1201         (fixup_template_type_parm_type): Remove.
1202         (build_template_parm_index): Remove num_siblings parm.
1203         (process_template_parm): Likewise.
1204         * parser.c (cp_parser_template_parameter_list): Adjust.
1205         * tree.c (cp_tree_equal): Don't compare num_siblings.
1206         * typeck.c (comp_template_parms_position): Likewise.
1208         PR c++/50852
1209         PR c++/53039
1210         * tree.c (strip_typedefs_expr): New.
1211         * cp-tree.h: Declare it.
1212         * pt.c (convert_template_argument, unify): Use it.
1213         * parser.c (cp_parser_template_declaration_after_export): Don't call
1214         fixup_template_parms.
1216 2012-07-04  Jason Merrill  <jason@redhat.com>
1218         PR c++/53848
1219         PR c++/53524
1220         * decl.c (build_enumerator): Don't use build_lang_decl_loc.
1222 2012-07-03  Jakub Jelinek  <jakub@redhat.com>
1224         PR c++/53812
1225         * semantics.c (finish_goto_stmt): Surround computed goto argument
1226         with CLEANUP_POINT_EXPR if needed.
1228 2012-07-02  Jason Merrill  <jason@redhat.com>
1230         PR c++/53619
1231         * pt.c (in_template_function): New.
1232         * cp-tree.h: Declare it.
1233         * class.c (build_base_path, resolves_to_fixed_type_p): Use it.
1235         PR c++/53783
1236         * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Use tsubst
1237         for LAMBDA_EXPR_EXTRA_SCOPE.
1239         PR c++/53788
1240         * pt.c (build_non_dependent_expr): Don't wrap a dummy object.
1242         PR c++/53816
1243         * class.c (resolves_to_fixed_type_p): Check uses_template_parms
1244         (current_function_decl) instead of processing_template_decl.
1246         PR c++/53821
1247         * semantics.c (maybe_add_lambda_conv_op): Don't set
1248         DECL_INTERFACE_KNOWN.
1250         PR c++/53524
1251         * call.c (build_conditional_expr_1): Don't warn about comparison of
1252         two enumerators before their enumeration is complete.
1253         (build_new_op_1): Call decay_conversion before warn_logical_operator.
1254         * decl.c (build_enumerator): Set DECL_CONTEXT of an enumerator to
1255         its enumeration.
1256         * decl2.c (mark_used): Call used_types_insert for enums.
1257         * semantics.c (finish_id_expression): Don't decay CONST_DECL.
1258         (finish_member_declaration): Don't change DECL_CONTEXT of enumerators.
1259         * class.c (check_field_decls): Don't change DECL_CONTEXT of enums.
1260         * typeck.c (convert_for_assignment): Don't decay CONST_DECL.
1261         (build_class_member_access_expr): Look through unscoped enums.
1262         * search.c (context_for_name_lookup): Look through unscoped enums.
1263         * pt.c (tsubst_copy_and_build): Don't decay CONST_DECL.
1264         (tsubst_copy): Use DECL_CONTEXT to find the enumeration.
1265         * tree.c (decl_linkage): Likewise.
1266         * cvt.c (ocp_convert): Check decayed expr for enum range warning.
1268 2012-06-29  Steven Bosscher  <steven@gcc.gnu.org>
1270         * Make-lang.in: Remove tree-mudflap.o from CXX_AND_OBJCXX_OBJS.
1272 2012-06-27  Jason Merrill  <jason@redhat.com>
1274         * parser.c (cp_parser_check_for_invalid_template_id): tag_type parm.
1275         (cp_parser_simple_type_specifier, cp_parser_class_head): Adjust.
1276         (cp_parser_elaborated_type_specifier): Adjust.
1277         * decl.c (duplicate_decls): Return error_mark_node on template
1278         mismatch.
1280         PR c++/53563
1281         * parser.c (cp_parser_template_id): Add tag_type parm.
1282         (cp_parser_template_name): Likewise.
1283         (cp_parser_id_expression, cp_parser_unqualified_id): Adjust.
1284         (cp_parser_pseudo_destructor_name, cp_parser_type_name): Adjust.
1285         (cp_parser_simple_type_specifier, cp_parser_class_name): Adjust.
1286         (cp_parser_elaborated_type_specifier, cp_parser_class_head): Adjust.
1288 2012-06-27  Ramana Radhakrishnan  <ramana.radhakrishnan@linaro.org>
1290         PR C++/51033
1291         * semantics.c (constexpr_call): Fix typo in comment.
1292         (cxx_eval_vec_perm_expr): New.
1293         (cxx_eval_constant_expression): Fold VEC_PERM_EXPRs.
1295 2012-06-26  Richard Guenther  <rguenther@suse.de>
1297         PR c++/53752
1298         * mangle.c (write_array_type): Truncate the number-of-elements
1299         result.
1301 2012-06-25  Jason Merrill  <jason@redhat.com>
1303         PR c++/53498
1304         PR c++/53305
1305         * pt.c (tsubst_decl) [PARM_DECL]: Don't recurse into DECL_CHAIN
1306         if cp_unevaluated_operand is set.
1307         (tsubst_copy) [PARM_DECL]: Don't copy before tsubsting.
1309         PR c++/52988
1310         * typeck.c (decay_conversion): Don't discard side-effects from
1311         expressions of nullptr_t.
1313 2012-06-25  Florian Weimer  <fweimer@redhat.com>
1315         * init.c (build_new_1): Warn about (T[N]) for variable N, and
1316         reject T[M][N].
1318         * parser.c (cp_parser_direct_new_declarator): Accept non-constant
1319         expressions.  Handled now in build_new_1.
1321 2012-06-25  Jason Merrill  <jason@redhat.com>
1323         PR c++/53202
1324         * semantics.c (build_data_member_initialization): Always keep
1325         initializer for empty base.
1326         (cxx_eval_bare_aggregate): Discard it here.
1328         PR c++/53565
1329         * pt.c (tsubst_omp_for_iterator): Simplify DECL_EXPR handling.
1330         (tsubst_expr) [OMP_FOR]: Here, too.
1332 2012-06-25  Jakub Jelinek  <jakub@redhat.com>
1334         PR c++/53594
1335         * class.c (check_bases_and_members): Avoid -Wuninitialized
1336         diagnostics for non-static const members or references if they
1337         use NSDMI.
1339 2012-06-16  Ville Voutilainen  <ville.voutilainen@gmail.com>
1341         * parser.c (cp_parser_direct_declarator): Move virt-specifier
1342         parsing after late-specified return type parsing.
1344 2012-06-14  Jason Merrill  <jason@redhat.com>
1346         PR c++/53651
1347         * name-lookup.c (constructor_name_p): Don't try to look at the
1348         name of a DECLTYPE_TYPE.
1350 2012-06-18  Lawrence Crowl  <crowl@google.com>
1352         * decl2.c (cp_write_global_declarations): Rename use of TV_PHASE_CGRAPH
1353         to TV_PHASE_OPT_GEN.
1355 2012-06-18  Steven Bosscher  <steven@gcc.gnu.org>
1357         * decl.c (finish_function): Remove code conditional on VMS_TARGET.
1359 2012-06-15  Marc Glisse  <marc.glisse@inria.fr>
1361         PR c++/51033
1362         * semantics.c (literal_type_p): Handle VECTOR_TYPE.
1363         (potential_constant_expression_1): Handle VEC_PERM_EXPR.
1364         * parser.c (cp_parser_postfix_expression): Handle RID_BUILTIN_SHUFFLE.
1366 2012-06-09  Jason Merrill  <jason@redhat.com>
1368         * pt.c (tsubst_expr) [TAG_DEFN]: Instantiate local class.
1369         * class.c (finish_struct): Don't add a TAG_DEFN for a lambda.
1370         * decl2.c (finish_static_data_member_decl): Avoid redundant error.
1372         PR c++/53599
1373         * name-lookup.c (pushtag_1): Add a DECL_EXPR for a local class.
1374         * semantics.c (finish_cond): Build a COMPOUND_EXPR.
1375         * pt.c (tsubst_expr) [COMPOUND_EXPR]: Handle.
1376         [DECL_EXPR]: Don't call cp_finish_decl for an implicit typedef.
1377         Don't return the decl.
1379 2012-06-11  Richard Guenther  <rguenther@suse.de>
1381         PR c++/53605
1382         * mangle.c (write_array_type): Use double-ints for array domain
1383         arithmetic.
1385 2012-06-07  Fabien ChĂȘne  <fabien@gcc.gnu.org>
1387         PR c++/51214
1388         * cp-tree.h (insert_late_enum_def_into_classtype_sorted_fields):
1389         Declare.
1390         * class.c (insert_into_classtype_sorted_fields): New.
1391         (add_enum_fields_to_record_type): New.
1392         (count_fields): Adjust the comment.
1393         (add_fields_to_record_type): Likewise.
1394         (finish_struct_1): Move the code that inserts the fields for the
1395         sorted case, into insert_into_classtype_sorted_fields, and call
1396         it.
1397         (insert_late_enum_def_into_classtype_sorted_fields): Define.
1398         * decl.c (finish_enum_value_list): Call
1399         insert_late_enum_def_into_classtype_sorted_fields if a late enum
1400         definition is encountered.
1402 2012-06-06  Paolo Carlini  <paolo.carlini@oracle.com>
1404         PR c++/53567
1405         * typeck.c (cp_perform_integral_promotions): New, like
1406         perform_integral_promotions but also takes a tsubst_flags_t parameter.
1407         (pointer_diff): Add tsubst_flags_t parameter.
1408         (decay_conversion, cp_default_conversion, cp_build_array_ref,
1409         cp_build_binary_op, cp_build_unary_op, build_static_cast_1,
1410         build_reinterpret_cast_1, cp_build_modify_expr,
1411         convert_for_assignment): Adjust.
1412         * optimize.c (build_delete_destructor_body): Adjust.
1413         * init.c (expand_virtual_init, expand_default_init, build_new_1,
1414         build_new, build_vec_delete_1, build_vec_init, build_delete): Adjust.
1415         (construct_virtual_base): Adjust LOOKUP_COMPLAIN -> 0.
1416         * class.c (build_base_path): Adjust.
1417         * decl.c (compute_array_index_type, finish_destructor_body): Likewise.
1418         * method.c (synthesized_method_walk): Adjust flag and complain.
1419         * rtti.c (ifnonnull): Add tsubst_flags_t parameter.
1420         (build_typeid, build_dynamic_cast_1): Adjust.
1421         * except.c (initialize_handler_parm): Likewise.
1422         * typeck2.c (process_init_constructor_record): Likewise.
1423         * pt.c (tsubst_friend_class): Don't change flags.
1424         * semantics.c (finish_goto_stmt, handle_omp_for_class_iterator,
1425         finish_static_assert): Likewise.
1426         * parser.c (cp_parser_lookup_name): Just pass 0 as flags to
1427         lookup_name_real.
1428         * call.c (build_op_delete_call): Add tsubst_flags_t parameter.
1429         (convert_like_real, convert_arg_to_ellipsis, convert_for_arg_passing):
1430         Adjust.
1431         (standard_conversion): Adjust LOOKUP_COMPLAIN -> 0.
1432         (implicit_conversion): Mask out tf_error with a FIXME.
1433         (build_user_type_conversion_1, build_new_op_1, build_over_call): Use
1434         complain & tf_error instead of flags & LOOKUP_COMPLAIN.
1435         * cvt.c (cp_convert_to_pointer, convert_to_pointer_force,
1436         build_up_reference, convert_to_reference, cp_convert,
1437         cp_convert_and_check, ocp_convert, convert_force): Add tsubst_flags_t
1438         parameter.
1439         (convert_to_reference, ocp_convert): Use complain & tf_error instead
1440         of flags & LOOKUP_COMPLAIN.
1441         (convert_force): Adjust LOOKUP_COMPLAIN -> 0.
1442         * name-lookup.c (identifier_type_value_1, lookup_qualified_name,
1443         lookup_name_real, lookup_function_nonclass, lookup_name,
1444         lookup_name_prefer_type): Adjust LOOKUP_COMPLAIN -> 0.
1445         * cp-tree.h: Adjust prototypes; remove LOOKUP_COMPLAIN.
1447 2012-06-06  Steven Bosscher  <steven@gcc.gnu.org>
1449         * decl.c: Do not include output.h.
1450         (start_decl): Remove code for flag_conserve_space.
1452 2012-06-06  Fabien ChĂȘne  <fabien@gcc.gnu.org>
1454         PR c++/52841
1455         * parser.c (cp_parser_alias_declaration): Return earlier
1456         if an error occured.
1458 2012-06-04  Paolo Carlini  <paolo.carlini@oracle.com>
1460         PR c++/53524
1461         * call.c (build_conditional_expr_1): Use OPT_Wenum_compare
1462         to control enumeral mismatch in conditional expression too.
1464 2012-06-04   Sterling Augustine  <saugustine@google.com>
1466         * cp-tree.h: Declare decl_as_dwarf_string, lang_decl_dwarf_name.
1467         * cp-lang.c (cxx_dwarf_name): Call them.
1469 2012-06-04  Steven Bosscher  <steven@gcc.gnu.org>
1471         * semantics.c: Do not include output.h.
1472         * decl2.c: Likewise.
1473         * friend.c: Likewise.
1474         * typeck.c: Likewise.
1475         * typeck2.c: Likewise.
1476         * Make-lang.in: Fix dependencies.
1478 2012-06-01  Jason Merrill  <jason@redhat.com>
1480         PR c++/52973
1481         * parser.c (cp_parser_class_head): Apply attributes here.
1482         * semantics.c (begin_class_definition): Not here.
1483         * cp-tree.h: Adjust.
1485         PR c++/52725
1486         * parser.c (cp_parser_binary_expression): Bail early if we're parsing
1487         tentatively and the LHS has a parse error.
1489         PR c++/53137
1490         * pt.c (instantiate_class_template_1): Set LAMBDA_EXPR_THIS_CAPTURE.
1491         (instantiate_decl): Don't push_to_top_level for local class methods.
1492         (instantiate_class_template_1): Or for local classes.
1494         PR c++/53484
1495         * pt.c (do_auto_deduction): Don't try to deduce from a
1496         type-dependent initializer.
1498 2012-06-01  Paolo Carlini  <paolo.carlini@oracle.com>
1500         PR c++/26155
1501         * name-lookup.c (push_namespace): When error recovery is
1502         impossible just error out in duplicate_decls.
1504 2012-05-31  Steven Bosscher  <steven@gcc.gnu.org>
1506         * call.c: Do not include output.h.
1507         * class.c: Likewise.
1508         * except.c: Likewise.
1509         * friend.c: Likewise.
1510         * init.c: Likewise.
1511         * lex.c: Likewise.
1512         * method.c: Likewise.
1513         * parser.c: Likewise.
1514         * pt.c: Likewise.
1515         * rtti.c: Likewise.
1516         * search.c: Likewise.
1518 2012-05-30  Jason Merrill  <jason@redhat.com>
1520         PR c++/53356
1521         * tree.c (stabilize_init): Handle stabilizing a TARGET_EXPR
1522         representing a bitwise copy of a glvalue.
1524         * tree.c (stabilize_expr): Tweak logic.
1526         PR c++/53356
1527         * tree.c (stabilize_init): Side effects make the init unstable.
1529 2012-05-28  Paolo Carlini  <paolo.carlini@oracle.com>
1531         PR c++/53503
1532         * semantics.c (potential_constant_expression_1): Handle LTGT_EXPR.
1534 2012-05-26  Paolo Carlini  <paolo.carlini@oracle.com>
1536         PR c++/53491
1537         * tree.c (stabilize_expr): Handle exp of void type.
1539 2012-05-26  Jason Merrill  <jason@redhat.com>
1541         PR c++/53220
1542         * call.c (convert_like_real) [ck_list]: Take array address directly.
1543         * typeck.c (decay_conversion): Reject decay of an array compound
1544         literal.
1546 2012-05-25  Paolo Carlini  <paolo.carlini@oracle.com>
1548         PR c++/32054
1549         * parser.c (cp_parser_member_declaration): A storage class is not
1550         allowed in a declaration of an anonymous aggregate in a class scope.
1552 2012-05-24  Uros Bizjak  <ubizjak@gmail.com>
1554         PR obj-c++/53441
1555         * decl.c (grokdeclarator): Check that current_class_type is non-NULL
1556         before calling constructor_name_p.
1558 2012-05-24  Paolo Carlini  <paolo.carlini@oracle.com>
1560         PR c++/32080
1561         * parser.c (cp_parser_ctor_initializer_opt_and_function_body,
1562         cp_parser_function_body): Add a bool parameter, true when parsing
1563         a function-try-block.
1564         (cp_parser_function_try_block): Pass true to the above.
1565         (cp_parser_function_definition_after_declarator,
1566         cp_parser_function_transaction): Adjust.
1568 2012-05-23  Paolo Carlini  <paolo.carlini@oracle.com>
1570         PR c++/29185
1571         * decl2.c (delete_sanity): Extend 'deleting array' warning to
1572         any array type.
1574 2012-05-21  Paolo Carlini  <paolo.carlini@oracle.com>
1576         PR c++/51184
1577         * decl.c (grokdeclarator): Diagnose functions returning abstract
1578         class types as TYPENAME.
1579         * cp-tree.h (ABSTRACT_CLASS_TYPE_P): Add.
1580         * except.c (is_admissible_throw_operand_or_catch_parameter): Use it.
1581         * pt.c (tsubst): Likewise.
1582         * semantics.c (trait_expr_value): Likewise.
1584 2012-05-21  Paolo Carlini  <paolo.carlini@oracle.com>
1586         PR c++/40821
1587         * parser.c (cp_parser_attributes_opt): Enforce error checking of
1588         unbalanced parentheses in the presence of tentative parsing.
1590 2012-05-17  Paolo Carlini  <paolo.carlini@oracle.com>
1592         PR c++/39681
1593         * parser.c (cp_parser_new_type_id): Early return error_mark_node
1594         if the cp_parser_type_specifier_seq call has type_specifier_seq.type
1595         error_mark_node; tidy.
1596         (cp_parser_new_expression): Always initialize nelts to NULL_TREE to
1597         avoid uninitialized warnings.
1598         (cp_parser_init_declarator, cp_parser_late_parse_one_default_arg):
1599         Call cp_parser_skip_to_end_of_statement if cp_parser_initializer
1600         returns error_mark_node.
1602 2012-05-17  Paolo Carlini  <paolo.carlini@oracle.com>
1604         PR c++/53371
1605         * except.c (is_admissible_throw_operand): Rename to
1606         is_admissible_throw_operand_or_catch_parameter and handle
1607         catch parameter too.
1608         (expand_start_catch_block): Use it.
1609         (build_throw): Adjust.
1611 2012-05-17  Paolo Carlini  <paolo.carlini@oracle.com>
1613         PR c++/44516
1614         * typeck.c (build_x_array_ref, build_x_conditional_expr,
1615         build_x_compound_expr, build_x_modify_expr): Add location_t parameter.
1616         (finish_class_member_access_expr, build_x_indirect_ref,
1617         build_x_binary_op, build_x_compound_expr_from_list,
1618         build_x_compound_expr_from_vec): Adjust callers.
1619         * tree.c (build_min_nt_loc): New.
1620         (build_min_nt): Remove.
1621         * typeck2.c (build_x_arrow): Adjust callers.
1622         * pt.c (tsubst_qualified_id, tsubst_omp_for_iterator,
1623         tsubst_copy_and_build): Likewise.
1624         * semantics.c (finish_mem_initializers, handle_omp_for_class_iterator,
1625          finish_omp_atomic): Likewise.
1626         * decl2.c (grok_array_decl, build_anon_union_vars): Adjust.
1627         * parser.c (cp_parser_question_colon_clause,
1628         cp_parser_assignment_expression, cp_parser_expression,
1629         cp_parser_template_id, cp_parser_omp_for_loop): Likewise.
1630         * cp-tree.h: Update.
1632 2012-05-16  Dodji Seketeli  <dodji@redhat.com>
1634         PR preprocessor/7263
1635         * cp-tree.h (enum cp_decl_spec): Add new enumerators to cover all
1636         the possible declarator specifiers so far.
1637         (struct cp_decl_specifier_seq::locations): Declare new member.
1638         (cp_decl_specifier_seq::{specs, type_location}): Remove.
1639         (decl_spec_seq_has_spec_p): Declare new function.
1640         * parser.c (cp_parser_check_decl_spec): Remove.
1641         (set_and_check_decl_spec_loc): Define new static function.
1642         (decl_spec_seq_has_spec_p): Define new public function.
1643         (cp_parser_decl_specifier_seq, cp_parser_function_specifier_opt)
1644         (cp_parser_type_specifier, cp_parser_simple_type_specifier)
1645         (cp_parser_set_storage_class, cp_parser_set_decl_spec_type)
1646         (cp_parser_alias_declaration): Set the locations for each
1647         declspec, using set_and_check_decl_spec_loc.
1648         (cp_parser_explicit_instantiation, cp_parser_init_declarator)
1649         (cp_parser_member_declaration, cp_parser_init_declarator): Use the
1650         new declspec location for specifiers.  Use the new
1651         decl_spec_seq_has_spec_p.
1652         (cp_parser_type_specifier_seq): Use the new
1653         set_and_check_decl_spec_loc.  Stop using
1654         cp_parser_check_decl_spec.  Use the new decl_spec_seq_has_spec_p.
1655         (, cp_parser_init_declarator): Use the new
1656         set_and_check_decl_spec_loc.
1657         (cp_parser_single_declaration, cp_parser_friend_p)
1658         (cp_parser_objc_class_ivars, cp_parser_objc_struct_declaration):
1659         Use the new decl_spec_seq_has_spec_p.
1660         * decl.c (check_tag_decl): Use new decl_spec_seq_has_spec_p.  Use
1661         the more precise ds_redefined_builtin_type_spec location for
1662         diagnostics about re-declaring C++ built-in types.
1663         (start_decl, grokvardecl, grokdeclarator): Use the new
1664         decl_spec_seq_has_spec_p.
1666 2012-05-15  Paolo Carlini  <paolo.carlini@oracle.com>
1668         PR c++/11856
1669         * pt.c (tsubst_copy_and_build): Increase / decrease
1670         c_inhibit_evaluation_warnings around build_x_binary_op call.
1672 2012-05-12  Paolo Carlini  <paolo.carlini@oracle.com>
1674         * cp-tree.h (TYPE_PTRMEM_P): Rename to TYPE_PTRDATAMEM_P.
1675         (TYPE_PTR_TO_MEMBER_P): Rename to TYPE_PTRMEM_P.
1676         (TYPE_PTR_OR_PTRMEM_P): Add.
1677         * typeck.c (composite_pointer_type_r, composite_pointer_type,
1678         common_pointer_type, cp_build_indirect_ref, cp_build_binary_op,
1679         cp_truthvalue_conversion, convert_ptrmem, build_static_cast_1,
1680         build_reinterpret_cast_1, build_const_cast_1, comp_ptr_ttypes_real,
1681         casts_away_constness_r, casts_away_constness): Adjust.
1682         * init.c (build_zero_init_1): Adjust.
1683         * class.c (check_field_decls): Likewise.
1684         * decl.c (check_default_argument): Likewise.
1685         * rtti.c (target_incomplete_p): Likewise.
1686         * tree.c (zero_init_p): Likewise.
1687         * cxx-pretty-print.c (pp_cxx_ptr_operator,
1688         pp_cxx_abstract_declarator): Likewise.
1689         * typeck2.c (build_m_component_ref): Likewise.
1690         * pt.c (convert_nontype_argument, invalid_nontype_parm_type_p,
1691         dependent_type_p_r): Likewise.
1692         * call.c (null_member_pointer_value_p, standard_conversion,
1693         add_builtin_candidate, build_conditional_expr_1, compare_ics):
1694         Likewise.
1695         * cp-objcp-common.c (cp_var_mod_type_p): Likewise.
1696         * cvt.c (cp_convert_to_pointer, ocp_convert,
1697         perform_qualification_conversions): Likewise.
1698         * mangle.c (write_type): Likewise.
1699         * name-lookup.c (arg_assoc_type): Likewise.
1701 2012-05-12  Paolo Carlini  <paolo.carlini@oracle.com>
1703         * parser.c (struct cp_parser_expression_stack_entry): Add location_t
1704         field.
1705         (cp_parser_binary_expression): Rework to always update at the same
1706         time tree_type and loc.
1707         * call.c (print_z_candidate): Add location_t parameter.
1708         (print_z_candidates, convert_like_real, joust): Adjust.
1710 2012-05-11  Alexandre Oliva  <aoliva@redhat.com>
1712         PR c++/53209
1713         * pt.c (tsubst_decl): Bail out if argvec is error_mark_node.
1715 2012-05-11  Paolo Carlini  <paolo.carlini@oracle.com>
1717         PR c++/53305
1718         * pt.c (tsubst_copy: case PARM_DECL): Return error_mark_node if
1719         tsubst_decl returns NULL_TREE.
1720         * cxx-pretty-print.c (pp_cxx_simple_type_specifier): Handle
1721         BOUND_TEMPLATE_TEMPLATE_PARM.
1723 2012-05-10  Paolo Carlini  <paolo.carlini@oracle.com>
1725         PR c++/53158
1726         * cvt.c (ocp_convert): Error out early for void -> bool conversions.
1727         * typeck.c (decay_conversion): Use error_at.
1728         * call.c (build_integral_nontype_arg_conv, convert_like_real,
1729         convert_arg_to_ellipsis, perform_implicit_conversion_flags,
1730         initialize_reference): Likewise.
1731         * cvt.c (warn_ref_binding): Add location_t parameter.
1732         (cp_convert_to_pointer, convert_to_reference, ocp_convert,
1733         convert_to_void, ): Use error_at and warning_at.
1735 2012-05-10  Paolo Carlini  <paolo.carlini@oracle.com>
1737         PR c++/53301
1738         * decl.c (check_default_argument): Fix typo (POINTER_TYPE_P
1739         instead of TYPE_PTR_P) in zero-as-null-pointer-constant warning.
1741 2012-05-06  Paolo Carlini  <paolo.carlini@oracle.com>
1743         PR c++/53152
1744         * call.c (op_error, build_new_op_1, build_new_op): Add location_t
1745         parameter.
1746         (build_conditional_expr_1): Adjust.
1747         * typeck.c (build_x_indirect_ref, build_x_binary_op,
1748         build_x_unary_op): Add location_t parameter.
1749         (rationalize_conditional_expr, build_x_array_ref,
1750         build_x_compound_expr, cp_build_modify_expr, build_x_modify_expr):
1751         Adjust.
1752         * typeck2.c (build_x_arrow): Add location_t parameter.
1753         * semantics.c (finish_unary_op_expr): Likewise.
1754         (finish_increment_expr, handle_omp_for_class_iterator): Adjust.
1755         * decl2.c (grok_array_decl): Add location_t parameter.
1756         * parser.c (cp_parser_postfix_open_square_expression,
1757         cp_parser_postfix_dot_deref_expression, cp_parser_unary_expression,
1758         cp_parser_binary_expression, cp_parser_builtin_offsetof,
1759         do_range_for_auto_deduction, cp_convert_range_for,
1760         cp_parser_template_argument, cp_parser_omp_for_cond): Pass the
1761         location, adjust.
1762         * pt.c (tsubst_copy_and_build): Adjust.
1763         * tree.c (maybe_dummy_object): Likewise.
1764         * cp-tree.h: Update declarations.
1766 2012-05-04  Paolo Carlini  <paolo.carlini@oracle.com>
1768         * semantics.c (cxx_eval_constant_expression, case CONVERT_EXPR): Tidy.
1770 2012-05-04  Paolo Carlini  <paolo.carlini@oracle.com>
1772         PR c++/53166
1773         * pt.c (instantiate_class_template_1): Increase / decrease
1774         c_inhibit_evaluation_warnings around the tsubst_expr call
1775         for STATIC_ASSERT_CONDITION.
1776         (tsubst_expr, case STATIC_ASSERT): Likewise.
1777         * typeck.c (cp_build_binary_op, case EQ_EXPR/NE_EXPR): Check
1778         c_inhibit_evaluation_warnings in the OPT_Waddress warnings.
1780 2012-05-03  Paolo Carlini  <paolo.carlini@oracle.com>
1782         PR c++/53186
1783         * call.c (build_over_call): Handle final member functions
1784         and class types.
1785         (build_new_method_call_1): Do not handle here.
1787 2012-05-02  Richard Guenther  <rguenther@suse.de>
1789         * decl.c (grokdeclarator): Properly check for sizes that
1790         cover more than half of the address-space.
1792 2012-04-30  Marc Glisse  <marc.glisse@inria.fr>
1794         PR c++/51033
1795         * typeck.c (cp_build_array_ref): Handle VECTOR_TYPE.
1796         * decl2.c (grok_array_decl): Likewise.
1798         PR c++/51314
1799         * parser.c (cp_parser_sizeof_operand): Require parentheses for
1800         sizeof...
1802 2012-04-30  Dodji Seketeli  <dodji@redhat.com>
1804         Fix location for static class members
1805         * decl.c (grokdeclarator): Use the location carried by the
1806         declarator for the DECL of the static class member.
1808         Fix va_arg type location
1809         * cp-tree.h (build_x_va_arg): Take an additional location
1810         parameter.
1811         * call.c (build_x_va_arg): Take a loc parameter for the location
1812         of the type of the va_arg expression.
1813         * parser.c (cp_parser_primary_expression): Pass the type of the
1814         type in the va_arg expression to build_x_va_arg.
1815         * pt.c (tsubst_copy): Adjust calls to build_x_va_arg.
1817         Make conversion warnings work on NULL with -ftrack-macro-expansion
1818         * call.c (conversion_null_warnings): Use the new
1819         expansion_point_location_if_in_system_header.
1820         * cvt.c (build_expr_type_conversion): Likewise.
1821         * typeck.c (cp_build_binary_op): Likewise.
1823 2012-04-30  Manuel LĂłpez-Ibåñez  <manu@gcc.gnu.org>
1825         * typeck.c (convert_for_assignment):  Replace
1826         Wmissing-format-attribute with Wsuggest-attribute=format.
1827         * call.c (convert_for_arg_passing): Likewise.
1829 2012-04-26  Paolo Carlini  <paolo.carlini@oracle.com>
1831         PR c++/53096
1832         * class.c (check_bases_and_members): Implement core/1333, do not
1833         disallow defaulted in the class body non-const ref special members.
1835 2012-04-24  Paolo Carlini  <paolo.carlini@oracle.com>
1837         PR c++/52363
1838         * call.c (tourney, perform_overload_resolution,
1839         build_operator_new_call, build_user_type_conversion_1,
1840         build_user_type_conversion, perform_overload_resolution,
1841         add_template_candidate, add_template_candidate_real,
1842         add_template_conv_candidate, add_builtin_candidates,
1843         add_builtin_candidate, build_builtin_candidate,
1844         add_conv_candidate, add_function_candidate, implicit_conversion,
1845         reference_binding, build_list_conv, conditional_conversion,
1846         add_candidates, can_convert_array, build_aggr_conv,
1847         build_array_conv, build_complex_conv, conditional_conversion):
1848         Add tsubst_flags_t parameter.
1849         (joust): Likewise, use it to handle SFINAE as if pedantic.
1850         (add_list_candidates, build_integral_nontype_arg_conv,
1851         perform_overload_resolution, build_new_function_call,
1852         build_operator_new_call, build_op_call_1,
1853         build_conditional_expr_1, build_new_op_1, convert_like_real,
1854         convert_arg_to_ellipsis, convert_default_arg,
1855         convert_for_arg_passing, build_over_call,
1856         build_new_method_call_1, can_convert_arg, can_convert_arg_bad,
1857         perform_implicit_conversion_flags,
1858         perform_direct_initialization_if_possible,
1859         initialize_reference): Adjust.
1860         * typeck.c (casts_away_constness, casts_away_constness_r):
1861         Add tsubst_flags_t parameter.
1862         (convert_arguments, check_for_casting_away_constness,
1863         build_static_cast_1, build_ptrmemfunc, convert_for_assignment):
1864         Adjust.
1865         * decl.c (reshape_init_r, check_default_argument): Likewise.
1866         * cp-gimplify.c (cxx_omp_clause_apply_fn): Likewise.
1867         * pt.c (convert_nontype_argument, check_non_deducible_conversion):
1868         Likewise.
1869         * init.c (build_new_1): Likewise.
1870         * cvt.c (convert_to_reference, ocp_convert, build_type_conversion,
1871         build_expr_type_conversion, ): Likewise.
1872         * search.c (check_final_overrider): Likewise.
1873         * cp-tree.h (build_user_type_conversion,
1874         build_operator_new_call, can_convert, can_convert_arg,
1875         can_convert_arg_bad, convert_default_arg,
1876         convert_arg_to_ellipsis, convert_for_arg_passing):
1877         Adjust declaration.
1879 2012-04-22  Jan Hubicka  <jh@suse.cz>
1881         * decl2.c (maybe_make_one_only): Mark keyed COMDATs as USED so they
1882         gets finalized.
1884 2012-04-22  Manuel LĂłpez-Ibåñez  <manu@gcc.gnu.org>
1886         PR c/44774
1887         * typeck.c (composite_pointer_type): Likewise.
1888         (cxx_sizeof_or_alignof_type): Likewise.
1889         (cp_build_array_ref): Likewise.
1890         (cp_build_function_call_vec): Likewise.
1891         (cp_build_addr_expr_1): Likewise.
1892         (convert_member_func_to_ptr): Likewise.
1893         * decl.c (check_tag_decl): Likewise.
1894         (check_static_variable_definition): Likewise.
1895         (compute_array_index_type): Likewise.
1896         (create_array_type_for_decl): Likewise.
1897         (grokdeclarator): Likewise.
1898         (grok_op_properties): Likewise.
1899         * error.c (maybe_warn_cpp0x): Likewise.
1900         * pt.c (maybe_process_partial_specialization): Likewise.
1901         (convert_template_argument): Likewise.
1902         (do_decl_instantiation): Likewise.
1903         (do_type_instantiation): Likewise.
1904         * parser.c (cp_parser_primary_expression): Likewise.
1905         (cp_parser_postfix_expression): Likewise.
1906         (cp_parser_unary_expression): Likewise.
1907         (cp_parser_question_colon_clause): Likewise.
1908         (cp_parser_lambda_introducer): Likewise.
1909         (cp_parser_lambda_declarator_opt): Likewise.
1910         (cp_parser_compound_statement): Likewise.
1911         (cp_parser_jump_statement): Likewise.
1912         (cp_parser_declaration_seq_opt): Likewise.
1913         (cp_parser_enum_specifier): Likewise.
1914         (cp_parser_enumerator_list): Likewise.
1915         (cp_parser_initializer_list): Likewise.
1916         (cp_parser_member_declaration): Likewise.
1917         * call.c (build_conditional_expr_1): Likewise.
1918         * friend.c (make_friend_class): Likewise.
1919         * name-lookup.c (pushdecl_maybe_friend_1): Likewise.
1921 2012-04-21  Jan Hubicka  <jh@suse.cz>
1923         * method.c (make_alias_for): Do not set TREE_SYMBOL_REFERENCED.
1924         * decl2.c (mark_needed): Likewise.
1925         (decl_needed_p): Do not test TREE_SYMBOL_REFERENCED.
1927         * decl2.c (cxx_callgraph_analyze_expr): Remove.
1928         * cp-objcp-common.h (LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR): Remove.
1929         * cp-tree.h (cxx_callgraph_analyze_expr): Remove.
1931 2012-04-21  Manuel LĂłpez-Ibåñez  <manu@gcc.gnu.org>
1933         PR 35441
1934         * typeck.c (cp_build_function_call_vec): Do not pretty-print
1935         expressions when caret is enabled.
1937 2012-04-20  Jan Hubicka  <jh@suse.cz>
1939         PR target/53042
1940         * decl2.c (maybe_emit_vtables): Do not initialize same_comdat_group
1941         list when target has no support for it.
1943 2012-04-20  Michael Matz  <matz@suse.de>
1945         * error.c (pedwarn_cxx98): Move va_end call after user
1946         of the va_list.
1948 2012-04-18  Paolo Carlini  <paolo.carlini@oracle.com>
1950         PR c++/52422
1951         * cp-tree.h (build_addr_func, decay_conversion,
1952         get_member_function_from_ptrfunc,
1953         build_m_component_ref, convert_member_func_to_ptr):
1954         Add tsubst_flags_t parameter.
1955         * typeck.c (cp_default_conversion): Add.
1956         (decay_conversion, default_conversion,
1957         get_member_function_from_ptrfunc, convert_member_func_to_ptr):
1958         Add tsubst_flags_t parameter and use it throughout.
1959         (cp_build_indirect_ref, cp_build_array_ref,
1960         cp_build_function_call_vec, convert_arguments, build_x_binary_op,
1961         cp_build_binary_op, cp_build_unary_op, build_reinterpret_cast_1,
1962         build_const_cast_1, expand_ptrmemfunc_cst,
1963         convert_for_initialization): Adjust.
1964         * init.c (build_vec_init): Adjust.
1965         * decl.c (grok_reference_init, get_atexit_node): Likewise.
1966         * rtti.c (build_dynamic_cast_1, tinfo_base_init): Likewise.
1967         * except.c (build_throw): Likewise.
1968         * typeck2.c (build_x_arrow): Likewise.
1969         (build_m_component_ref): Add tsubst_flags_t parameter and
1970         use it throughout.
1971         * pt.c (convert_nontype_argument): Adjust.
1972         * semantics.c (finish_asm_stmt, maybe_add_lambda_conv_op): Likewise.
1973         * decl2.c (build_offset_ref_call_from_tree): Likewise.
1974         * call.c (build_addr_func): Add tsubst_flags_t parameter and
1975         use it throughout.
1976         (build_call_a, build_conditional_expr_1, build_new_op_1,
1977         convert_like_real, convert_arg_to_ellipsis, build_over_call,
1978         build_special_member_call): Adjust.
1979         * cvt.c (cp_convert_to_pointer, force_rvalue,
1980         build_expr_type_conversion): Likewise.
1982 2012-04-17  Tom de Vries  <tom@codesourcery.com>
1984         * cp-gimplify.c (begin_bc_block): Add location parameter and use as
1985         location argument to create_artificial_label.
1986         (finish_bc_block): Change return type to void.  Remove body_seq
1987         parameter, and add block parameter.  Append label to STMT_LIST and
1988         return in block.
1989         (gimplify_cp_loop, gimplify_for_stmt, gimplify_while_stmt)
1990         (gimplify_do_stmt, gimplify_switch_stmt): Remove function.
1991         (genericize_cp_loop, genericize_for_stmt, genericize_while_stmt)
1992         (genericize_do_stmt, genericize_switch_stmt, genericize_continue_stmt)
1993         (genericize_break_stmt, genericize_omp_for_stmt): New function.
1994         (cp_gimplify_omp_for): Remove bc_continue processing.
1995         (cp_gimplify_expr): Genericize VEC_INIT_EXPR.
1996         (cp_gimplify_expr): Mark FOR_STMT, WHILE_STMT, DO_STMT, SWITCH_STMT,
1997         CONTINUE_STMT, and BREAK_STMT as unreachable.
1998         (cp_genericize_r): Genericize FOR_STMT, WHILE_STMT, DO_STMT,
1999         SWITCH_STMT, CONTINUE_STMT, BREAK_STMT and OMP_FOR.
2000         (cp_genericize_tree): New function, factored out of ...
2001         (cp_genericize): ... this function.
2003 2012-04-17  Paolo Carlini  <paolo.carlini@oracle.com>
2005         PR c++/52599
2006         * semantics.c (build_constexpr_constructor_member_initializers):
2007         Check for function-try-block as function-body.
2009 2012-04-17  Paolo Carlini  <paolo.carlini@oracle.com>
2011         PR c++/53003
2012         * parser.c (cp_parser_member_declaration): Check that
2013         initializer_token_start is non null before dereferencing it.
2015 2012-04-16  Jason Merrill  <jason@redhat.com>
2017         PR c++/38543
2018         * pt.c (determine_specialization): Instead of comparing the number
2019         of parms, check that tsubst gives the right answer.
2021         PR c++/52008
2022         * pt.c (process_partial_specialization): Complain about a partial
2023         specialization with fewer args than primary template parms.
2025         PR c++/50830
2026         * pt.c (convert_template_argument): Handle template template
2027         argument packs.
2029         PR c++/50303
2030         * pt.c (tsubst_pack_expansion): Use tsubst_expr for template
2031         template parameters.
2033 2012-04-16  Paolo Carlini  <paolo.carlini@oracle.com>
2035         PR c++/49152
2036         * call.c (op_error): Print types; when flag_diagnostics_show_caret
2037         is false print expressions too.
2038         (op_error_string): Add.
2040 2012-04-16  Jason Merrill  <jason@redhat.com>
2042         PR c++/51148
2043         * friend.c (make_friend_class): Call check_for_bare_parameter_packs.
2045 2012-04-16  Jan Hubicka  <jh@suse.cz>
2047         * decl2.c (collect_candidates_for_java_method_alias): Use FOR_EACH
2048         walkers to walk cgraph and varpool.
2050 2012-04-15  Jason Merrill  <jason@redhat.com>
2052         PR c++/47220
2053         * pt.c (coerce_template_parameter_pack): Check for error_mark_node.
2055         PR c++/52292
2056         PR c++/52380
2057         * pt.c (coerce_template_parms): Even if we aren't converting we
2058         want to expand argument packs.
2060         PR c++/52706
2061         * mangle.c (write_type): nullptr_t is a builtin type.
2063 2012-04-14  Jan Hubicka  <jh@suse.cz>
2065         * tree.c: Update field referenced for new cgraph/varpool layout.
2066         * decl2.c: Likewise.
2068 2012-04-13  Jason Merrill  <jason@redhat.com>
2070         PR c++/52824
2071         * pt.c (any_pack_expanson_args_p): New.
2072         (coerce_template_parms): Use it.
2074         PR c++/52905
2075         * call.c (joust): Handle comparing list and non-list ctors.
2077         PR c++/52915
2078         * decl2.c (finish_anon_union): Use cp_finish_decl.
2079         * error.c (dump_function_name): Avoid showing anonymous "name".
2081 2012-04-11  Fabien ChĂȘne  <fabien@gcc.gnu.org>
2083         PR c++/52465
2084         * parser.c (cp_parser_class_name): Call strip_using_decl and
2085         return the target decl.
2086         * name-lookup.c (strip_using_decl): Returns NULL_TREE if the decl
2087         to be stripped is NULL_TREE.
2088         (qualify_lookup): Call strip_using_decl and perform some checks on
2089         the target decl.
2091 2012-04-11  Jason Merrill  <jason@redhat.com>
2093         PR debug/45088
2094         * decl.c (grokdeclarator): Strip the injected-class-name typedef
2095         if we are building a declaration or compound type.
2097         PR c++/52906
2098         * decl.c (check_tag_decl): Don't complain about attributes if we
2099         don't even have a type.
2101 2012-04-10  Manuel LĂłpez-Ibåñez  <manu@gcc.gnu.org>
2103         * cvt.c (convert_to_void): Update comment.
2105 2012-04-05  Jason Merrill  <jason@redhat.com>
2107         PR c++/52596
2108         * semantics.c (finish_non_static_data_member): In templates, pass
2109         the decl to build_qualified_name.
2110         * tree.c (lvalue_kind) [SCOPE_REF]: Handle FIELD_DECL.
2112 2012-04-04  Jason Merrill  <jason@redhat.com>
2114         PR c++/52845
2115         * decl.c (finish_function): Update fntype after deducing return type.
2117 2012-04-03  Jason Merrill  <jason@redhat.com>
2119         PR c++/52796
2120         * pt.c (tsubst_initializer_list): A pack expansion with no elements
2121         means value-initialization.
2123 2012-04-01  Paolo Carlini  <paolo.carlini@oracle.com>
2125         PR c++/50043
2126         * class.c (deduce_noexcept_on_destructor,
2127         deduce_noexcept_on_destructors): New.
2128         (check_bases_and_members): Call the latter.
2129         * decl.c (grokfndecl): Call the former.
2130         * method.c (implicitly_declare_fn): Not static.
2131         * cp-tree.h (deduce_noexcept_on_destructor, implicitly_declare_fn):
2132         Declare
2134 2012-03-29  Paolo Carlini  <paolo.carlini@oracle.com>
2136         PR c++/52718
2137         * decl.c (check_default_argument): With -Wzero-as-null-pointer-constant
2138         warn for a zero as null pointer constant default argument.
2140 2012-03-29  Jason Merrill  <jason@redhat.com>
2142         PR c++/52685
2143         * tree.c (copy_binfo): Handle BINFO_DEPENDENT_BASE_P.
2145 2012-03-29  Jakub Jelinek  <jakub@redhat.com>
2147         PR c++/52759
2148         * decl.c (start_decl): Don't call maybe_apply_pragma_weak
2149         if processing_template_decl.
2151 2012-03-29  Jason Merrill  <jason@redhat.com>
2153         PR c++/52743
2154         * call.c (compare_ics): Handle ck_aggr like ck_list.
2156 2012-03-28  Jason Merrill  <jason@redhat.com>
2158         PR c++/52746
2159         * typeck.c (lookup_destructor): Clear BASELINK_QUALIFIED_P if
2160         we didn't get an explicit scope.
2161         * pt.c (tsubst_baselink): Likewise.
2163 2012-03-28  Richard Guenther  <rguenther@suse.de>
2165         * typeck2.c (process_init_constructor_array): Use the proper
2166         type for computing the array length.
2168 2012-03-27  Meador Inge  <meadori@codesourcery.com>
2170         PR c++/52672
2171         * semantics.c (cxx_fold_indirect_ref): Don't attempt to fold
2172         stripped child trees that are not pointer types.
2174 2012-03-21  Jason Merrill  <jason@redhat.com>
2176         Implement return type deduction for normal functions with -std=c++1y.
2177         * cp-tree.h (FNDECL_USED_AUTO): New macro.
2178         (LAMBDA_EXPR_DEDUCE_RETURN_TYPE_P): Remove.
2179         (dependent_lambda_return_type_node): Remove.
2180         (CPTI_DEPENDENT_LAMBDA_RETURN_TYPE): Remove.
2181         (struct language_function): Add x_auto_return_pattern field.
2182         (current_function_auto_return_pattern): New.
2183         (enum tsubst_flags): Add tf_partial.
2184         * decl.c (decls_match): Handle auto return comparison.
2185         (duplicate_decls): Adjust error message for auto return.
2186         (cxx_init_decl_processing): Remove dependent_lambda_return_type_node.
2187         (cp_finish_decl): Don't do auto deduction for functions.
2188         (grokdeclarator): Allow auto return without trailing return type in
2189         C++1y mode.
2190         (check_function_type): Defer checking of deduced return type.
2191         (start_preparsed_function): Set current_function_auto_return_pattern.
2192         (finish_function): Set deduced return type to void if not previously
2193         deduced.
2194         * decl2.c (change_return_type): Handle error_mark_node.
2195         (mark_used): Always instantiate functions with deduced return type.
2196         Complain about use if deduction isn't done.
2197         * parser.c (cp_parser_lambda_declarator_opt): Use 'auto' for
2198         initial return type.
2199         (cp_parser_lambda_body): Don't deduce return type in a template.
2200         (cp_parser_conversion_type_id): Allow auto in C++1y.
2201         * pt.c (instantiate_class_template_1): Don't mess with
2202         LAMBDA_EXPR_DEDUCE_RETURN_TYPE_P.
2203         (tsubst_copy_and_build): Likewise.
2204         (fn_type_unification, tsubst): Don't reduce the template parm level
2205         of 'auto' during deduction.
2206         (unify): Compare 'auto' specially.
2207         (get_bindings): Change test.
2208         (always_instantiate_p): Always instantiate functions with deduced
2209         return type.
2210         (do_auto_deduction): Handle error_mark_node and lambda context.
2211         Don't check for use in initializer.
2212         (contains_auto_r): Remove.
2213         * search.c (lookup_conversions_r): Handle auto conversion function.
2214         * semantics.c (lambda_return_type): Handle null return.  Don't mess
2215         with dependent_lambda_return_type_node.
2216         (apply_deduced_return_type): Rename from apply_lambda_return_type.
2217         * typeck.c (merge_types): Handle auto.
2218         (check_return_expr): Do auto deduction.
2219         * typeck2.c (add_exception_specifier): Fix complain check.
2221 2012-03-22  Paolo Carlini  <paolo.carlini@oracle.com>
2223         PR c++/52487
2224         * class.c (check_field_decls): Call literal_type_p only
2225         on complete types.
2227 2012-03-22  Jakub Jelinek  <jakub@redhat.com>
2229         PR c++/52671
2230         * decl.c (check_tag_decl): Only use CLASSTYPE_TEMPLATE_INSTANTIATION
2231         on CLASS_TYPE_P types.
2233 2012-03-20  Jason Merrill  <jason@redhat.com>
2235         * lex.c (init_reswords): Use >= for cxx_dialect test.
2236         * parser.c (cp_parser_exception_specification_opt): Likewise.
2238         * mangle.c (write_type): Handle 'auto'.
2239         * init.c (build_new): Don't do auto deduction where it might
2240         affect template mangling.
2242         PR c++/52510
2243         * decl.c (reshape_init_class): Handle repeated reshaping.
2244         * search.c (lookup_field_1): Add sanity check.
2246 2012-03-19  Paolo Carlini  <paolo.carlini@oracle.com>
2248         PR c++/14710
2249         * cp-tree.h (xvalue_p, maybe_warn_about_useless_cast): Declare.
2250         * tree.c (xvalue_p): Define.
2251         * typeck.c (maybe_warn_about_useless_cast): Define.
2252         (build_reinterpret_cast, build_const_cast,
2253         build_static_cast, cp_build_c_cast): Use maybe_warn_about_useless_cast.
2254         * rtti.c (build_dynamic_cast): Likewise.
2255         * pt.c (tsubst_copy_and_build, case CAST_EXPR): Increment/decrement
2256         c_inhibit_evaluation_warnings before/after the build_* calls.
2258 2012-03-15  Jason Merrill  <jason@redhat.com>
2260         PR c++/52582
2261         * method.c (implicitly_declare_fn): Set DECL_EXTERNAL.
2263 2012-03-15  Manuel LĂłpez-Ibåñez  <manu@gcc.gnu.org>
2265         PR c++/44783
2266         * error.c (print_instantiation_partial_context): Use
2267         template_backtrace_limit.
2269 2012-03-14  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
2271         * Make-lang.in (doc/g++.1): Remove IRIX 6.5 reference.
2273 2012-03-14  Jakub Jelinek  <jakub@redhat.com>
2275         PR c++/52521
2276         * parser.c (lookup_literal_operator): Return fn only if
2277         processed all arguments from args vector and argtypes is
2278         void_list_node.
2280 2012-01-30  Dodji Seketeli  <dodji@redhat.com>
2282         PR c++/51641
2283         * cp-tree.h (template_type_parameter_p): Declare new function.
2284         (parameter_of_template_p): Remove.
2285         * pt.c (template_type_parameter_p): Define new function.
2286         (parameter_of_template_p): Remove.
2287         * name-lookup.c (binding_to_template_parms_of_scope_p): Don't rely
2288         on parameter_of_template_p anymore.  Compare the level of the
2289         template parameter to the depth of the template.
2291 2011-12-15  Dodji Seketeli  <dodji@redhat.com>
2293         * call.c (standard_conversion, build_integral_nontype_arg_conv)
2294         (build_new_op_1, convert_like_real, is_subseq)
2295         (maybe_handle_implicit_object, maybe_handle_ref_bind, compare_ics)
2296         (joust): Use next_conversion instead of accessing fields of struct
2297         conversion directly.
2299 2012-03-12  Paolo Carlini  <paolo.carlini@oracle.com>
2301         PR c++/52299
2302         * pt.c (tsubst_copy_and_build, case COND_EXPR): Avoid bogus
2303         division by zero warnings.
2305 2012-03-08  Paolo Carlini  <paolo.carlini@oracle.com>
2307         * typeck.c (build_array_ref, cp_build_addr_expr_1, convert_ptrmem,
2308         build_ptrmemfunc): Consistently forward the tsubst_flags_t
2309         parameter.
2310         * call.c (resolve_args): Likewise.
2312 2012-03-07  Jason Merrill  <jason@redhat.com>
2314         PR c++/52521
2315         * mangle.c (write_literal_operator_name): The length comes after the
2316         operator prefix.
2318 2012-03-05  Jakub Jelinek  <jakub@redhat.com>
2320         * pt.c (local_specializations): Change from htab_t into
2321         struct pointer_map_t *.
2322         (retrieve_local_specializations, register_local_specialization,
2323         tsubst_pack_expansion, instantiate_decl): Adjust users.
2324         (eq_local_specializations, hash_local_specialization): Remove.
2326 2012-03-05  Jason Merrill  <jason@redhat.com>
2328         PR c++/51930
2329         * decl2.c (determine_visibility): Correct calculation of class
2330         args depth.
2331         * decl.c (check_tag_decl): Adjust warning.
2333         * method.c (synthesized_method_walk): Cleanups don't affect the EH
2334         spec either.
2336 2012-03-03  Jason Merrill  <jason@redhat.com>
2338         * init.c (perform_member_init): Cope with uninstantiated NSDMI.
2340         Core 1270
2341         * call.c (build_aggr_conv): Call reshape_init.
2342         (convert_like_real): Likewise.
2343         * typeck2.c (process_init_constructor): Clear TREE_CONSTANT if
2344         not all constant.
2346         * mangle.c (write_nested_name): Use decl_mangling_context.
2347         (write_prefix, write_template_prefix): Likewise.
2349         PR c++/36797
2350         * mangle.c (write_expression): Improve diagnostic for TRAIT_EXPR.
2352         * class.c (add_method): Always build an OVERLOAD for using-decls.
2353         * search.c (lookup_member): Handle getting an OVERLOAD for a
2354         single function.
2356 2012-03-02  Paolo Carlini  <paolo.carlini@oracle.com>
2358         PR c++/51989
2359         * typeck2.c (build_x_arrow): Take a tsubst_flags_t argument and
2360         propagate it.
2361         * cp-tree.h (build_x_arrow): Adjust prototype.
2362         * pt.c (tsubst_copy_and_build): Adjust call.
2363         * parser.c (cp_parser_postfix_dot_deref_expression): Likewise.
2365 2012-03-02  Paolo Carlini  <paolo.carlini@oracle.com>
2367         * name-lookup.c (binding_to_template_parms_of_scope_p): Clean up.
2369 2012-02-29  Jason Merrill  <jason@redhat.com>
2371         PR c++/51930
2372         * decl.c (check_tag_decl): Move warning for misplaced attributes here.
2373         (shadow_tag): From here.
2374         * parser.c (cp_parser_explicit_instantiation): Don't warn here.
2376 2012-02-21  Jakub Jelinek  <jakub@redhat.com>
2378         PR c++/52312
2379         * typeck.c (check_literal_operator_args): Initialize *long_double_p
2380         and *long_long_unsigned_p even if processing_template_decl.
2382 2012-02-16  Jason Merrill  <jason@redhat.com>
2384         PR c++/52248
2385         * decl.c (define_label): Use timevar_cond_start/stop.
2387 2012-02-16  Fabien ChĂȘne  <fabien@gcc.gnu.org>
2389         PR c++/52126
2390         * decl.c (xref_basetypes): call dependent_scope_p instead of
2391         dependent_type_p.
2393 2012-02-16  Jason Merrill  <jason@redhat.com>
2395         PR c++/51415
2396         * error.c (dump_expr): Handle lambda closures specifically.
2398 2012-02-14  Jason Merrill  <jason@redhat.com>
2400         * parser.c (cp_parser_explicit_instantiation): Give a warning
2401         for ignored attributes on explicit class instantiation.
2403 2012-02-14  Jakub Jelinek  <jakub@redhat.com>
2405         PR c++/52247
2406         * pt.c (tsubst_copy_asm_operands): For LABEL_DECL values call
2407         lookup_label on label's name and set TREE_USED.
2409 2012-02-14  Jason Merrill  <jason@redhat.com>
2411         PR c++/39055
2412         * decl.c (local_variable_p_walkfn): Don't check DECL_ARTIFICIAL.
2414 2012-02-14  Jakub Jelinek  <jakub@redhat.com>
2416         PR c/52181
2417         * decl.c (duplicate_decls): If olddecl has bigger DECL_ALIGN than
2418         newdecl, copy DECL_ALIGN to newdecl and or DECL_USER_ALIGN bits.
2420 2012-02-07  Jason Merrill  <jason@redhat.com>
2422         PR c++/51675
2423         * semantics.c (cx_check_missing_mem_inits): Handle unions.
2424         Fix constexpr default constructor logic.
2426         PR c++/52035
2427         * pt.c (tsubst): Strip uninstantiated typedef.
2429 2012-02-06  Jason Merrill  <jason@redhat.com>
2431         PR c++/52088
2432         * cvt.c (build_expr_type_conversion): Check for template conversion.
2434 2012-01-31  Jason Merrill  <jason@redhat.com>
2436         PR c++/52043
2437         * cp-tree.h (PACK_EXPANSION_LOCAL_P): New.
2438         * pt.c (make_pack_expansion, tsubst_initializer_list): Set it.
2439         (tsubst_pack_expansion): Check it.
2441 2012-01-29  Paolo Carlini  <paolo.carlini@oracle.com>
2443         PR c++/51327
2444         * class.c (explain_non_literal_class): Correctly handle implicitly
2445         deleted constructors.
2447 2012-01-27  Jakub Jelinek  <jakub@redhat.com>
2449         PR c++/51852
2450         * pt.c (tsubst_pack_expansion): Delete and restore
2451         local_specialization whenever need_local_specialization, not just
2452         when saved_local_specializations is non-NULL.
2454 2012-01-26  Paolo Carlini  <paolo.carlini@oracle.com>
2456         PR c++/51370
2457         * error.c (dump_decl, [TEMPLATE_ID_EXPR]): Handle error_mark_node
2458         as TREE_OPERAND (t, 1).
2460 2012-01-24  Jason Merrill  <jason@redhat.com>
2462         PR c++/51917
2463         * decl.c (xref_basetypes): Check VEC_length instead of VEC_space.
2465         PR c++/51973
2466         * tree.c (called_fns_equal): Check template args.
2467         (cp_tree_equal): Call it.
2469 2012-01-24  Aldy Hernandez  <aldyh@redhat.com>
2470             Patrick Marlier  <patrick.marlier@gmail.com>
2472         PR c++/51928
2473         * class.c (set_method_tm_attributes): Use TARGET_THUNK instead of
2474         thunk for set_one_vmethod_tm_attributes.
2476 2012-01-24  Paolo Carlini  <paolo.carlini@oracle.com>
2478         PR c++/51223
2479         * call.c (build_over_call): Check for error_mark_node as
2480         TREE_VALUE when default arguments are processed.
2482 2012-01-23  Jason Merrill  <jason@redhat.com>
2484         PR c++/51930
2485         * decl2.c (determine_visibility): Check for visibility attribute
2486         on template specialization.
2488 2012-01-23  Paolo Carlini  <paolo.carlini@oracle.com>
2490         PR c++/51398
2491         * pt.c (parameter_of_template_p): Skip error_mark_node parameters.
2493 2012-01-23  Jason Merrill  <jason@redhat.com>
2495         PR c++/51925
2496         * class.c (add_method): Set OVL_USED for using-decls.
2497         * tree.c (ovl_scope): New.
2498         * cp-tree.h: Declare it.
2499         * parser.c (cp_parser_template_name): Use it.
2500         * semantics.c (baselink_for_fns): Likewise.
2501         * name-lookup.c (set_inherited_value_binding_p): Likewise.
2503 2012-01-20  Paolo Carlini  <paolo.carlini@oracle.com>
2505         PR c++/51402
2506         * pt.c (lookup_template_class_1): Check context returned by
2507         tsubst for error_mark_node.
2509 2012-01-19  Kai Tietz  <ktietz@redhat.com>
2511         PR c++/51344
2512         * decl2.c (save_template_attributes): Use merge_attributes
2513         instead of chaining up via TREE_CHAIN.
2515 2012-01-19  Jason Merrill  <jason@redhat.com>
2517         PR c++/51889
2518         * class.c (finish_struct): Call add_method here for function usings.
2519         * semantics.c (finish_member_declaration): Not here.
2521 2012-01-18  Paolo Carlini  <paolo.carlini@oracle.com>
2523         PR c++/51225
2524         * typeck2.c (store_init_value): Within a template guard
2525         cxx_constant_value with require_potential_constant_expression.
2526         * pt.c (convert_nontype_argument): Likewise.
2528 2012-01-16  Jakub Jelinek  <jakub@redhat.com>
2530         PR c++/51854
2531         * mangle.c (write_template_arg_literal): Handle complex.
2533 2012-01-16  Jason Merrill  <jason@redhat.com>
2535         PR c++/51827
2536         * mangle.c (mangle_decl): Don't mangle uninstantiated templates.
2538         PR c++/51868
2539         * typeck.c (build_static_cast_1): Handle bit-fields properly.
2541 2012-01-13  Ian Lance Taylor  <iant@google.com>
2543         PR c++/50012
2544         * typeck.c (enum_cast_to_int): New static function.
2545         (cp_build_binary_op): When handling warn_sign_compare, don't test
2546         for TREE_NO_WARNING.  Do call enum_cast_to_int.
2547         * call.c (avoid_sign_compare_warnings): Remove static function.
2548         (build_new_op_1): Don't call avoid_sign_compare_warnings.
2550 2012-01-13  Steven Bosscher  <steven@gcc.gnu.org>
2552         * decl2.c: Do not include tree-mudflap.h
2553         * semantics.c: Likewise.
2555 2012-01-13  Jason Merrill  <jason@redhat.com>
2557         PR c++/20681
2558         * semantics.c (finish_break_stmt): Avoid adding an unreachable
2559         BREAK_STMT.
2561         PR c++/51813
2562         * decl2.c (constrain_visibility): Clear DECL_VISIBILITY_SPECIFIED
2563         when reducing the visibility.
2565         PR c++/51620
2566         * class.c (build_vtbl_initializer): Use __cxa_deleted_virtual.
2568 2012-01-12  Jason Merrill  <jason@redhat.com>
2570         PR c++/51714
2571         * pt.c (value_dependent_expression_p): Treat STMT_EXPR as
2572         value-dependent.
2574 2012-01-13  Dodji Seketeli  <dodji@redhat.com>
2576         PR c++/51633
2577         * semantics.c (cp_parser_ctor_initializer_opt_and_function_body):
2578         Set the pointer to the last block of the constructor to the
2579         current statement.
2580         (build_constexpr_constructor_member_initializers): Get
2581         build_data_member_initialization a chance to deal with more
2582         statements before we choke.
2584 2012-01-12  Jason Merrill  <jason@redhat.com>
2586         PR c++/48051
2587         * mangle.c (write_expression): Mangle BASELINK scope if
2588         BASELINK_QUALIFIED_P.
2589         * search.c (adjust_result_of_qualified_name_lookup): Set
2590         BASELINK_QUALIFIED_P.
2591         * tree.c (cp_tree_equal) [BASELINK]: Compare BASELINK_QUALIFIED_P.
2592         * parser.c (cp_parser_postfix_dot_deref_expression): Don't call
2593         adjust_result_of_qualified_name_lookup for non-qualified names.
2595         PR c++/51403
2596         * pt.c (unify): Handle error_mark_node.
2598 2012-01-11  Jason Merrill  <jason@redhat.com>
2600         PR c++/51565
2601         * call.c (standard_conversion): For ptrmemfuncs, compare the
2602         static_fn_types.
2604         PR c++/51818
2605         * mangle.c (find_substitution): A type is only a substitution
2606         match if we're looking for a type.
2607         (write_nested_name): Use decl_mangling_context.
2609         * decl.c (decls_match): Assert that the arguments are decls.
2611         PR c++/51613
2612         * pt.c (resolve_overloaded_unification): Compare types with
2613         same_type_p, not decls_match.
2615 2012-01-10  Jason Merrill  <jason@redhat.com>
2617         PR c++/51614
2618         * class.c (build_base_path): Diagnose ambiguous base.
2620         PR c++/51433
2621         * semantics.c (cxx_eval_call_expression): Always retry previously
2622         non-constant expressions.
2624 2012-01-06  Jason Merrill  <jason@redhat.com>
2626         DR 686
2627         PR c++/47450
2628         * parser.c (cp_parser_new_expression): Set
2629         type_definition_forbidden_message.
2631         PR c++/6057
2632         PR c++/48051
2633         PR c++/50855
2634         PR c++/51322
2635         * mangle.c (write_expression): Support NEW_EXPR, DELETE_EXPR,
2636         THROW_EXPR, CONSTRUCTOR, OVERLOAD.  Fix PREINCREMENT_EXPR and
2637         PREDECREMENT_EXPR.
2638         (write_template_arg): Fix mangling of class-scope functions and
2639         argument packs.
2640         (mangle_decl): Update suggested -fabi-version argument.
2641         * operators.def: Add DOTSTAR_EXPR, REINTERPRET_CAST_EXPR,
2642         DYNAMIC_CAST_EXPR; correct CONST_CAST_EXPR, STATIC_CAST_EXPR.
2643         * tree.c (dependent_name): No longer static.
2644         * cp-tree.h: Declare it.
2645         * pt.c (unify): Defer handling of unconverted functions.
2647         * mangle.c (mangle_decl): Don't generate mangling aliases
2648         for maybe-in-charge [cd]tors.
2650         * error.c (dump_expr): Print type of CONSTRUCTOR.
2652 2012-01-05  Dodji Seketeli  <dodji@redhat.com>
2654         PR c++/51541
2655         * parser.c (cp_parser_alias_declaration): Get out early upon
2656         errors in the identifier or the attributes.
2658 2012-01-04  Paolo Carlini  <paolo.carlini@oracle.com>
2660         PR c++/51064
2661         * pt.c (tsubst_copy_and_build): Maybe set TREE_NO_WARNING on
2662         the tree returned by build_x_binary_op.
2664 2012-01-03  Paolo Carlini  <paolo.carlini@oracle.com>
2666         PR c++/51738
2667         * parser.c (cp_parser_postfix_open_square_expression): Handle
2668         postfix-expression [ braced-init-list ].
2670 2012-01-03  Paolo Carlini  <paolo.carlini@oracle.com>
2672         PR c++/29273
2673         * rtti.c (build_dynamic_cast_1): In case of T a pointer type,
2674         call decay_conversion on v.
2676 2012-01-03  Paolo Carlini  <paolo.carlini@oracle.com>
2678         PR c++/15867
2679         * decl.c (duplicate_decls): With -Wredundant-decls don't warn for
2680         declaration followed by specialization.
2682 2012-01-03  Jakub Jelinek  <jakub@redhat.com>
2684         PR c++/51669
2685         * semantics.c (finish_omp_clauses): Call fold_build_cleanup_point_expr
2686         on OMP_CLAUSE_{IF,FINAL,NUM_THREADS,SCHEDULE_CHUNK}_EXPR.
2688 2012-01-02  Jason Merrill  <jason@redhat.com>
2690         DR 1359
2691         PR c++/51675
2692         * method.c (walk_field_subobs): Don't check for uninitialized
2693         fields in a union.
2694         (synthesized_method_walk): Check here.
2696         DR 325
2697         PR c++/51666
2698         * parser.c (cp_parser_cache_defarg): Split out...
2699         (cp_parser_parameter_declaration): ...from here.
2700         (cp_parser_save_nsdmi): Use it.
2701         (cp_parser_cache_group): Remove CPP_COMMA support.
2703 2012-01-02  Dodji Seketeli  <dodji@redhat.com>
2705         PR c++/51462
2706         * semantics.c (cx_check_missing_mem_inits): Don't assert in case
2707         of error.
2709 2012-01-02  Paolo Carlini  <paolo.carlini@oracle.com>
2711         PR c++/20140
2712         * typeck2.c (digest_init_r): Use copy_init when initializing
2713         an array of chars.
2715 2012-01-01  Paolo Carlini  <paolo.carlini@oracle.com>
2717         PR c++/16603
2718         * decl.c (build_enumerator): Don't call perform_integral_promotions
2719         on the value.
2721 2012-01-01  Paolo Carlini  <paolo.carlini@oracle.com>
2723         PR c++/51379
2724         * typeck.c (build_reinterpret_cast_1): Implement resolution of
2725         DR 799.
2727 2012-01-01  Fabien ChĂȘne  <fabien@gcc.gnu.org>
2729         * parser.c (cp_parser_using_declaration): Add a warning about
2730         deprecated access declarations when no errors were encountered
2731         while parsing the access declaration. Save the first token in
2732         order to emit the warning at the right place.
2734 Copyright (C) 2012 Free Software Foundation, Inc.
2736 Copying and distribution of this file, with or without modification,
2737 are permitted in any medium without royalty provided the copyright
2738 notice and this notice are preserved.