OSDN Git Service

2011-11-08 Richard Guenther <rguenther@suse.de>
[pf3gnuchains/gcc-fork.git] / gcc / cp / ChangeLog
1 2011-11-08  Richard Guenther  <rguenther@suse.de>
2
3         PR middle-end/51010
4         * error.c (dump_expr): Handle SSA_NAMEs.
5
6 2011-11-07  Richard Henderson  <rth@redhat.com>
7             Aldy Hernandez  <aldyh@redhat.com>
8             Torvald Riegel  <triegel@redhat.com>
9
10         Merged from transactional-memory.
11
12         * call.c (build_new_function_call): Call tm_malloc_replacement.
13         * class.c (check_bases): Compute transaction attributes for the
14         class based on its base classes.
15         (look_for_tm_attr_overrides, set_one_vmethod_tm_attributes,
16         set_method_tm_attributes): New.
17         (finish_struct_1): Call set_method_tm_attributes.
18         * cp-tree.h (begin_transaction_stmt, finish_transaction_stmt,
19         build_transaction_expr): Declare.
20         (TRANSACTION_EXPR_IS_STMT): New.
21         * decl.c (push_cp_library_fn): Set attribute to transaction_safe.
22         * except.c (do_get_exception_ptr): Apply transaction_pure.
23         (do_begin_catch): Mark _ITM_cxa_begin_catch transaction_pure and
24         record as transactional-memory wrapper.
25         (do_end_catch): Similarly for _ITM_cxa_end_catch.
26         (do_allocate_exception): Similarly for _ITM_cxa_allocate_exception.
27         (build_throw): Similarly for _ITM_cxa_throw. Make __cxa_rethrow pure.
28         * parser.h (struct cp_parser): Add in_transaction flag.
29         * parser.c (enum non_integral_constant): Add NIC_TRANSACTION.
30         (cp_parser_non_integral_constant_expression): Handle NIC_TRANSACTION.
31         (enum required_token): Add transaction tokens.
32         (cp_parser_transaction, cp_parser_transaction_expression,
33         cp_parser_function_transaction, cp_parser_transaction_cancel,
34         cp_parser_txn_attribute_opt): New.
35         (cp_parser_unary_expression): Handle RID_TRANSACTION*.
36         (cp_parser_statement, cp_parser_function_definition_after_declarator,
37         cp_parser_token_starts_function_definition_p): Same.
38         (cp_parser_required_error): Handle RT_TRANSACTION*.
39         * pt.c (tsubst_expr): Handle TRANSACTION_EXPR.
40         * semantics.c (begin_transaction_stmt, finish_transaction_stmt,
41         build_transaction_expr): New.
42
43 2011-11-08  Dodji Seketeli  <dodji@redhat.com>
44
45         Fix context handling of alias-declaration
46         * decl.c (start_decl): Update comment.
47         * error.c (dump_alias_template_specialization): Dump the context
48         of the specialization.
49         * parser.c (cp_parser_alias_declaration): Call pop_scope on the
50         pushed scope yielded by start_decl.
51
52 2011-11-08  Paolo Carlini  <paolo.carlini@oracle.com>
53
54         PR c++/50864
55         * parser.c (cp_parser_postfix_dot_deref_expression): Reject invalid
56         uses of '->' and '.' as postfix-expression in namespace scope.
57
58 2011-11-07  Jason Merrill  <jason@redhat.com>
59
60         PR c++/50848
61         * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Don't crash
62         if lookup finds a non-function.
63
64         PR c++/50863
65         * parser.c (cp_parser_initializer_list): Parse C99
66         array designators tentatively.
67
68         PR c++/50870
69         * pt.c (tsubst_copy): Handle NAMESPACE_DECL.
70         (tsubst_copy_and_build) [COMPONENT_REF]: Handle a still-dependent
71         object.
72
73 2011-11-07  Paolo Carlini  <paolo.carlini@oracle.com>
74
75         * pt.c (tsubst_copy_and_build): Fix qualified_name_lookup_error
76         call in case COMPONENT_REF.
77
78 2011-11-07  Jason Merrill  <jason@redhat.com>
79             Dodji Seketeli  <dodji@redhat.com>
80
81         Support C++11 alias-declaration
82         PR c++/45114
83         * cp-tree.h (TYPE_DECL_ALIAS_P, TYPE_ALIAS_P)
84         (DECL_TYPE_TEMPLATE_P, DECL_ALIAS_TEMPLATE_P): New accessor
85         macros.
86         (TYPE_TEMPLATE_INFO): Get template info of an alias template
87         specializations from its TYPE_DECL.
88         (SET_TYPE_TEMPLATE_INFO): Set template info of alias template
89         specializations into its TYPE_DECL.
90         (DECL_CLASS_TEMPLATE_P): Re-write using the new
91         DECL_TYPE_TEMPLATE_P.
92         (enum cp_decl_spec): Add new ds_alias enumerator.
93         (alias_type_or_template_p, alias_template_specialization_p):
94         Declare new functions.
95         * parser.c (cp_parser_alias_declaration): New static function.
96         (cp_parser_check_decl_spec): Add "using" name for the `alias'
97         declspec.
98         (cp_parser_type_name): Update comment.  Support simple-template-id
99         representing alias template specializations in c++0x mode.
100         (cp_parser_qualifying_entity): Update comment.  Use
101         cp_parser_type_name.
102         (cp_parser_block_declaration): Handle alias-declaration in c++11.
103         Update comment.
104         (cp_parser_template_id): Handle specializations of alias
105         templates.
106         (cp_parser_member_declaration): Add alias-declaration production
107         to comment.  Support alias-declarations.
108         (cp_parser_template_declaration_after_export): Handle alias
109         templates in c++11.
110         * decl.c (make_typename_type, make_unbound_class_template): Accept
111         alias templates.
112         (grokdeclarator): Set TYPE_DECL_ALIAS_P on alias
113         declarations.
114         * decl2.c (grokfield): Move template creation after setting up the
115         TYPE_DECL of the alias, so that the TEMPLATE_DECL of the alias
116         template actually carries the right type-id of the alias
117         declaration.
118         * pt.c (alias_type_or_template_p)
119         (alias_template_specialization_p): Define new public functions.
120         (maybe_process_partial_specialization): Reject partial
121         specializations of alias templates.
122         (primary_template_instantiation_p): Consider alias template
123         instantiations.
124         (push_template_decl_real): Assert that TYPE_DECLs of alias
125         templates are different from those of class template.  Store
126         template info onto the TYPE_DECL of the alias template.
127         (convert_template_argument): Strip aliases from template
128         arguments.
129         (lookup_template_class_1): Handle the creation of the
130         specialization of an alias template.
131         (tsubst_decl): Create a substituted copy of the TYPE_DECL of an
132         member alias template.
133         (tsubst): Handle substituting into the type of an alias template.
134         Handle substituting UNBOUND_CLASS_TEMPLATE into
135         BOUND_TEMPLATE_TEMPLATE_PARM.
136         (do_type_instantiation): Better diagnostics when trying to
137         explicitely instantiate a non-class template.
138         * search.c (lookup_field_1, lookup_field_r): Support looking up
139         alias templates.
140         * semantics.c (finish_template_type): For instantiations of alias
141         templates, return the TYPE_DECL of the actual alias and not the
142         one of the aliased type.
143         * error.c (dump_alias_template_specialization): New static
144         function.
145         (dump_type): Handle printing of alias templates and their
146         specializations.  templates.
147         (dump_aggr_type): For specialization of alias templates, fetch
148         arguments from the right place.
149         (dump_decl): Print an alias-declaration like `using decl = type;'
150         (dump_template_decl):  Support printing of alias templates.
151
152 2011-11-07  Jason Merrill  <jason@redhat.com>
153
154         PR c++/35688
155         * decl2.c (constrain_visibility): Return void.  Add tmpl parm
156         which gives the constraint priority over an attribute.
157         (constrain_visibility_for_template, determine_visibility): Adjust.
158         * pt.c (instantiate_class_template_1): Call determine_visibility.
159
160         PR c++/33255
161         * decl.c (save_function_data): Clear local_typedefs.
162
163         * decl.c (cp_finish_decl): Only make_tree_vector if we're calling
164         check_initializer.
165
166 2011-11-06  Jason Merrill  <jason@redhat.com>
167
168         PR c++/35688
169         * decl2.c (constrain_visibility): Check decl_has_visibility_attr
170         rather than DECL_VISIBILITY_SPECIFIED.
171
172 2011-11-06  Paolo Carlini  <paolo.carlini@oracle.com>
173
174         PR c++/47695
175         * decl2.c (mark_used): Early return false after error or sorry.
176         * cp-tree.h (mark_used): Adjust declaration.
177         * semantics.c (finish_id_expression): Check mark_used return value.
178
179 2011-11-05  Jason Merrill  <jason@redhat.com>
180
181         PR c++/48370
182         * decl.c (cp_finish_decl): Mostly revert previous change.
183
184 2011-11-04  Jason Merrill  <jason@redhat.com>
185
186         PR c++/26714
187         * init.c (perform_member_init): Strip TARGET_EXPR around NSDMI.
188         Do temporary lifetime extension.
189
190         PR c++/48370
191         * decl.c (cp_finish_decl): Run cleanups in the right order.
192
193 2011-11-04  Eric Botcazou  <ebotcazou@adacore.com>
194
195         PR c++/50608
196         * semantics.c (finish_offsetof): Adjust call to fold_offsetof.
197         * typeck.c (cp_build_addr_expr_1): Call fold_offsetof_1.
198
199 2011-11-04  Paolo Carlini  <paolo.carlini@oracle.com>
200
201         * typeck.c (build_indirect_ref): Use ATTRIBUTE_UNUSED.
202         * mangle.c (write_unnamed_type_name): Likewise.
203
204 2011-11-04  Magnus Fromreide  <magfr@lysator.liu.se>
205
206         * parser.c (cp_parser_enumerator_list): Do not warn about
207         trailing commas in C++0x mode.
208
209 2011-11-04  Olivier Goffart  <olivier@woboq.com>
210             Jason Merrill  <jason@redhat.com>
211
212         PR c++/50965
213         * class.c (check_field_decls): NSDMI makes a class non-aggregate.
214
215 2011-11-04  Paolo Carlini  <paolo.carlini@oracle.com>
216
217         PR c++/48420
218         * call.c (conversion_null_warnings): For 'false' to NULL pointer,
219         just check that TREE_TYPE (expr) is a BOOLEAN_TYPE.
220
221 2011-11-04  Ed Smith-Rowland  <3dw4rd@verizon.net>
222
223         PR c++/50941
224         * parser.c (cp_parser_userdef_string_literal): Fix string length.
225
226 2011-11-04  Jason Merrill  <jason@redhat.com>
227
228         PR c++/48370
229         * call.c (extend_ref_init_temps, extend_ref_init_temps_1): New.
230         (set_up_extended_ref_temp): Use it.  Change cleanup parm to VEC.
231         (initialize_reference): Just call convert_like.
232         * decl.c (grok_reference_init): Just call initialize_reference.
233         (build_init_list_var_init): Remove.
234         (check_initializer): Change cleanup parm to VEC.  Handle references
235         like other types.  Call perform_implicit_conversion instead
236         of build_init_list_var_init.  Don't use build_aggr_init for
237         aggregate initialization of arrays.
238         (cp_finish_decl): Change cleanup to VEC.
239         * typeck2.c (store_init_value): Call extend_ref_init_temps.
240         Use build_vec_init for non-constant arrays.
241         * init.c (expand_aggr_init_1): Adjust.
242         (build_vec_init): Avoid re-converting an initializer
243         that's already digested.
244         * mangle.c (mangle_ref_init_variable): Add a discriminator.
245         * cp-tree.h: Adjust.
246         * typeck.c (convert_for_initialization): Adjust.
247         * decl2.c (maybe_emit_vtables): Adjust.
248
249 2011-11-02  Jason Merrill  <jason@redhat.com>
250
251         PR c++/50930
252         * init.c (build_aggr_init): Don't set LOOKUP_ONLYCONVERTING
253         if the initializer has TARGET_EXPR_DIRECT_INIT_P.
254         (expand_default_init): An initializer with TARGET_EXPR_DIRECT_INIT_P
255         or TARGET_EXPR_LIST_INIT_P doesn't need more processing.
256         * tree.c (bot_manip): Propagate TARGET_EXPR_IMPLICIT_P,
257         TARGET_EXPR_LIST_INIT_P, TARGET_EXPR_DIRECT_INIT_P.
258         * call.c (convert_like_real): Set TARGET_EXPR_DIRECT_INIT_P
259         as appropriate on list-value-initialization.
260
261         * parser.c (cp_parser_decl_specifier_seq): Change "C++0x" to
262         "C++11" in warnings.
263         (cp_lexer_get_preprocessor_token): Likewise.
264         (cp_parser_binary_expression): Likewise.
265
266 2011-11-02  Paolo Carlini  <paolo.carlini@oracle.com>
267
268         PR c++/50810
269         * typeck2.c (check_narrowing): Adjust OPT_Wnarrowing diagnostics.
270         (digest_init_r): Call check_narrowing irrespective of the C++ dialect.
271         * decl.c (check_initializer): Likewise.
272         * semantics.c (finish_compound_literal): Likewise.
273
274 2011-11-02  Paolo Carlini  <paolo.carlini@oracle.com>
275
276         PR c++/50956
277         * typeck.c (build_const_cast_1): Fix -Wcast-qual for false
278         comp_ptr_ttypes_const.
279
280 2011-11-02  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
281
282         * Make-lang.in (g++spec.o): Pass SHLIB instead of SHLIB_LINK.
283
284 2011-11-01  Paolo Carlini  <paolo.carlini@oracle.com>
285
286         PR c++/44277
287         * cvt.c (cp_convert_to_pointer): Warn for zero as null pointer
288         constant.
289         * typeck.c (cp_truthvalue_conversion): Handle pointers and member
290         function pointers under c_inhibit_evaluation_warnings; use
291         nullptr_node for data member pointers.
292         (cp_build_binary_op): Tweak, just forward to cp_convert op1,
293         either a nullptr_node or an integer_zero_node.
294         (build_ptrmemfunc): Use nullptr_node.
295         * init.c (build_zero_init_1): Likewise.
296
297 2011-11-01  Jason Merrill  <jason@redhat.com>
298
299         PR c++/50500
300         DR 1082
301         * search.c (lookup_fnfields_idx_nolazy): Split out from...
302         (lookup_fnfields_1): ...here.
303         (lookup_fnfields_slot_nolazy): Use it.
304         * cp-tree.h: Declare it.
305         * class.c (type_has_move_assign): Use it.
306         (type_has_user_declared_move_assign): Likewise.
307
308 2011-10-31  Jason Merrill  <jason@redhat.com>
309
310         PR c++/50920
311         * class.c (check_field_decl): Change c++0x in diags to c++11.
312         * error.c (maybe_warn_cpp0x): Likewise.
313         * parser.c (cp_parser_diagnose_invalid_type_name): Likewise.
314         * pt.c (check_default_tmpl_args): Likewise.
315
316 2011-10-31   Diego Novillo  <dnovillo@google.com>
317
318         * mangle.c (get_mangled_id): Factor from ...
319         (mangle_decl): ... here.
320         Call get_mangled_id.
321
322 2011-10-25  Gerald Pfeifer  <gerald@pfeifer.com>
323
324         * NEWS (GCC 2.95): Refer to GNU/Linux instead of Linux.
325         (EGCS 1.0): Ditto.
326
327 2011-10-29  Paolo Carlini  <paolo.carlini@oracle.com>
328
329         PR c++/50901
330         * call.c (build_new_op_1): Handle ABS_EXPR together with the
331         other unary EXPR.
332
333 2011-10-28  Paolo Carlini  <paolo.carlini@oracle.com>
334
335         Revert:
336         2011-10-28  Paolo Carlini  <paolo.carlini@oracle.com>
337
338         PR c++/50864
339         * pt.c (tsubst_copy_and_build): Fix qualified_name_lookup_error
340         call in case COMPONENT_REF.
341
342 2011-10-28  Paolo Carlini  <paolo.carlini@oracle.com>
343
344         * pt.c (unify_pack_expansion): Initialize bad_old_arg and bad_new_arg.
345
346 2011-10-28  Paolo Carlini  <paolo.carlini@oracle.com>
347
348         PR c++/50864
349         * pt.c (tsubst_copy_and_build): Fix qualified_name_lookup_error
350         call in case COMPONENT_REF.
351
352 2011-10-27  Jason Merrill  <jason@redhat.com>
353
354         * semantics.c (cxx_eval_outermost_constant_expr): Check
355         cp_has_mutable_p.
356         (cxx_eval_component_reference): Check DECL_MUTABLE_P.
357
358 2011-10-27  Roberto Agostino Vitillo  <ravitillo@lbl.gov>
359
360         PR c++/30066
361         * decl2.c (determine_hidden_inline): New function.
362         (determine_visibility): fvisibility-inlines-hidden affects inline
363         functions.
364
365 2011-10-27  Dodji Seketeli  <dodji@redhat.com>
366
367         * cp-tree.h (DECL_DECLARES_TYPE_P): Fix comment.
368
369 2011-10-26  Jason Merrill  <jason@redhat.com>
370
371         * typeck.c (check_literal_operator_args): Avoid building types.
372
373 2011-10-26  Ed Smith-Rowland  <3dw4rd@verizon.net>
374
375         Implement C++11 user-defined literals.
376         * cp-objcp-common.c: (cp_tree_size) Return size of USERDEF_LITERAL tree.
377         * cp-tree.h: (UDLIT_OP_*, UDLIT_OPER_P): Literal operator
378         name tools. New tree code for user-defined literals.
379         * cxx-pretty-print.h: (pp_cxx_userdef_literal) New.
380         * cxx-pretty-print.c: (pp_cxx_userdef_literal) New.
381         (pp_cxx_primary_expression, pp_cxx_expression): Use it.
382         * decl.c: (cp_tree_node_structure): Return new tree code.
383         (duplicate_decls): Check for raw vs. template operator conflicts.
384         (grokfndecl, grokdeclarator): New checks for literal operators.
385         * error.c: (dump_expr): Warn about user-defined literals
386         in C++98 mode. (dump_function_name): Pretty printing.
387         * mangle.c: (write_literal_operator_name): New.
388         (write_unqualified_id, write_unqualified_name): Use it.
389         * parser.c: (cp_parser_operator): Handle operator"".
390         (cp_parser_userdef_char_literal, cp_parser_userdef_numeric_literal,
391         cp_parser_userdef_string_literal): New.
392         (cp_parser_primary_expression): Handle new user-defined literal tokens
393         with new functions.
394         * semantics.c: (potential_constant_expression_1): Add
395         user-defined literals.
396         * typeck.c (check_raw_literal_operator,
397         check_literal_operator_args): New.
398
399 2011-10-26  Paolo Carlini  <paolo.carlini@oracle.com>
400
401         * typeck.c (cp_build_addr_expr_1): Use BASELINK_P.
402         * class.c (instantiate_type): Likewise.
403         * pt.c (convert_nontype_argument_function, uses_template_parms,
404         tsubst_copy, resolve_nondeduced_context, type_dependent_expression_p):
405         Likewise.
406         * semantics.c (finish_decltype_type): Likewise.
407         * decl2.c (mark_used): Likewise.
408         * name-lookup.c (arg_assoc): Likewise.
409
410 2011-10-26  Paolo Carlini  <paolo.carlini@oracle.com>
411
412         PR c++/50870
413         * typeck.c (non_reference): Pass NULL_TREE through.
414
415 2011-10-25  Jason Merrill  <jason@redhat.com>
416
417         PR c++/50866
418         PR c++/41449
419         * semantics.c (maybe_cleanup_point_expr_void): No longer static.
420         * typeck2.c (split_nonconstant_init_1): Use it.
421         * cp-tree.h: Declare it.
422         * decl.c (wrap_cleanups_r): Stop at CLEANUP_POINT_EXPR.
423
424         PR c++/49996
425         * tree.c (stabilize_init): Stabilize scalar elements of a
426         CONSTRUCTOR, too.
427
428 2011-10-25  Paolo Carlini  <paolo.carlini@oracle.com>
429
430         PR c++/50858
431         * typeck.c (composite_pointer_type_r): Check return value of
432         composite_pointer_type_r for error_mark_node.
433
434 2011-10-25  Paolo Carlini  <paolo.carlini@oracle.com>
435
436         PR c++/50861
437         * pt.c (tsubst_copy_and_build): Check return value of
438         tsubst_copy_and_build for error_mark_node.
439
440 2011-10-23  Paolo Carlini  <paolo.carlini@oracle.com>
441
442         PR c++/50841
443         Revert:
444         2011-10-23  Paolo Carlini  <paolo.carlini@oracle.com>
445
446         PR c++/50810
447         * typeck2.c (check_narrowing): Adjust OPT_Wnarrowing diagnostics.
448         (digest_init_r): Call check_narrowing irrespective of the C++ dialect.
449         * decl.c (check_initializer): Likewise.
450         * semantics.c (finish_compound_literal): Likewise.
451
452 2011-10-23  Paolo Carlini  <paolo.carlini@oracle.com>
453
454         PR c++/50810
455         * typeck2.c (check_narrowing): Adjust OPT_Wnarrowing diagnostics.
456         (digest_init_r): Call check_narrowing irrespective of the C++ dialect.
457         * decl.c (check_initializer): Likewise.
458         * semantics.c (finish_compound_literal): Likewise.
459
460 2011-10-21  Paolo Carlini  <paolo.carlini@oracle.com>
461
462         PR c++/45385
463         * init.c (build_vec_init): Early return error_mark_node if
464         maxindex is -1.
465
466 2011-10-21  Paolo Carlini  <paolo.carlini@oracle.com>
467
468         PR c++/31423
469         * typeck2.c (cxx_incomplete_type_diagnostic): Improve error message
470         for invalid use of member function.
471
472 2011-10-21  Ville Voutilainen  <ville.voutilainen@gmail.com>
473
474         PR c++/50811
475         * parser.c (cp_parser_class_head): Parse virt-specifiers
476         regardless of whether an id is present
477
478 2011-10-20  Jason Merrill  <jason@redhat.com>
479
480         PR c++/41449
481         * typeck2.c (split_nonconstant_init_1): Handle EH cleanup of
482         initialized subobjects.
483
484 2011-10-19  Paolo Carlini  <paolo.carlini@oracle.com>
485
486         PR c++/13657
487         * class.c (instantiate_type): Fix error message.
488
489 2011-10-19  Jason Merrill  <jason@redhat.com>
490
491         PR c++/50793
492         * tree.c (bot_manip): Propagate AGGR_INIT_ZERO_FIRST.
493
494 2011-10-19  Roland Stigge  <stigge@antcom.de>
495
496         PR translation/49704
497         * semantics.c (potential_constant_expression_1): Use "AST" instead of
498         "ast" in sorry message.
499
500 2011-10-19  Paolo Carlini  <paolo.carlini@oracle.com>
501
502         PR c++/38761
503         PR c++/40872
504         * decl.c (duplicate_decls, make_typename_type, grokdeclarator): Use
505         G_() in error message strings to facilitate translation.
506         * semantics.c (finish_id_expression): Likewise.
507         * parser.c (cp_parser_nested_name_specifier_opt,
508         cp_parser_parameter_declaration): Likewise.
509
510 2011-10-18  Jason Merrill  <jason@redhat.com>
511
512         PR c++/50531
513         * pt.c (instantiate_decl): Recognize when a function defaulted
514         outside the class is already instantiated.
515
516         PR c++/50742
517         * decl.c (check_previous_goto_1): Handle using-decl.
518
519 2011-10-18  Jason Merrill  <jason@redhat.com>
520
521         PR c++/50500
522         DR 1082
523         * class.c (type_has_user_declared_move_constructor): New.
524         (type_has_user_declared_move_assign): New.
525         (add_implicitly_declared_members): Add lazy copy ops
526         even if there's a move.
527         * method.c (lazily_declare_fn): Delete implicit copies
528         if there's a move.
529         (maybe_explain_implicit_delete): Explain this.  Use inform rather
530         than error.
531         * cp-tree.h: Declare new fns.
532
533 2011-10-18   Diego Novillo  <dnovillo@google.com>
534
535         * parser.c: Remove ENABLE_CHECKING markers around debugging
536         routines.
537         (cp_lexer_dump_tokens): Add arguments START_TOKEN and CURR_TOKEN.
538         Make static
539         When printing CURR_TOKEN surround it in [[ ]].
540         Start printing at START_TOKEN.
541         Update all users.
542         (cp_debug_print_tree_if_set): New.
543         (cp_debug_print_context): New.
544         (cp_debug_print_context_stack): New.
545         (cp_debug_print_flag): New.
546         (cp_debug_print_unparsed_function): New.
547         (cp_debug_print_unparsed_queues): New.
548         (cp_debug_parser_tokens): New.
549         (cp_debug_parser): New.
550         (cp_lexer_start_debugging): Set cp_lexer_debug_stream to stderr.
551         (cp_lexer_stop_debugging): Set cp_lexer_debug_stream to NULL.
552         * parser.h (cp_lexer_dump_tokens): Remove declaration.
553         (cp_debug_parser): Declare.
554
555 2011-10-17  Michael Spertus  <mike_spertus@symantec.com>
556
557         * cp-tree.def: Add BASES as a new tree code.
558         * cp-tree.h (enum cp_trait_kind): Add CPTK_BASES, CPTK_DIRECT_BASES.
559         (BASES_TYPE, BASES_DIRECT): Define.
560         (calculate_bases, finish_bases, calculate_direct_bases): Declare.
561         * parser.c (cp_parser_trait_expr, cp_parser_template_argument_list,
562         (cp_parser_simple_type_specifier, cp_parser_save_nsdmi): Use them.
563         * pt.c (find_parameter_packs_r, tsubst_pack_expansion): Likewise.
564         * semantics.c (calculate_bases, finish_bases, calculate_direct_bases,
565         dfs_calculate_bases_pre, dfs_calculate_bases_post,
566         calculate_bases_helper): Define.
567
568 2011-10-17  Jason Merrill  <jason@redhat.com>
569
570         PR c++/50736
571         * parser.c (cp_parser_lambda_introducer): Check for more
572         invalid captures.
573
574 2011-10-17  Paolo Carlini  <paolo.carlini@oracle.com>
575
576         PR c++/44524
577         * typeck.c (build_class_member_access_expr): Provide a better error
578         message for X.Y where X is a pointer to class type.
579         (finish_class_member_access_expr): Likewise.
580
581 2011-10-15  Tom Tromey  <tromey@redhat.com>
582             Dodji Seketeli  <dodji@redhat.com>
583
584         * error.c (cp_diagnostic_starter): Pass the relevant location to
585         diagnostic_report_current_module.
586         (cp_diagnostic_finalizer): Call virt_loc_aware_diagnostic_finalizer.
587
588 2011-10-17  Paolo Carlini  <paolo.carlini@oracle.com>
589
590         PR c++/48489
591         * typeck.c (finish_class_member_access_expr): Fix error call
592         for TREE_CODE (access_path) == TREE_BINFO.
593
594 2011-10-15  Paolo Carlini  <paolo.carlini@oracle.com>
595
596         PR c++/50732
597         * semantics.c (finish_trait_expr): Do not try to instantiate the
598         the base type of an __is_base_of trait.
599         (check_trait_type): Return a tree; use complete_type_or_else.
600
601 2011-10-14  Jason Merrill  <jason@redhat.com>
602
603         PR c++/50563
604         * parser.c (cp_parser_cache_group): Handle end==CPP_COMMA.
605         (cp_parser_save_nsdmi): Pass it.
606
607         PR c++/50707
608         * method.c (walk_field_subobs): Check for NSDMI before
609         complaining about uninitialized fields.
610
611         * pt.c (tsubst_decl) [FIELD_DECL]: Use void_zero_node
612         instead of error_mark_node as a placeholder.
613
614 2011-10-14  Paolo Carlini  <paolo.carlini@oracle.com>
615
616         PR c++/38174
617         * call.c (add_builtin_candidate): If two pointers have a composite
618         pointer type, generate a single candidate with that type.
619
620 2011-10-13  Jason Merrill  <jason@redhat.com>
621
622         PR c++/50614
623         * cp-tree.h (VAR_TEMPL_TYPE_FIELD_OR_FUNCTION_DECL_CHECK): New.
624         (DECL_TEMPLATE_INFO): Use it.
625         * pt.c (tsubst_decl) [FIELD_DECL]: Set DECL_TEMPLATE_INFO
626         if the decl has an NSDMI.
627         * init.c (perform_member_init): Use it.
628
629         PR c++/50437
630         * cp-tree.h (struct tree_lambda_expr): Add closure field.
631         (LAMBDA_EXPR_CLOSURE): New.
632         * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Likewise.
633         * semantics.c (build_lambda_object): Use it instead of TREE_TYPE.
634         (begin_lambda_type, lambda_function, add_capture): Likewise.
635         (add_default_capture, lambda_expr_this_capture): Likewise.
636
637 2011-10-13   Diego Novillo  <dnovillo@google.com>
638
639         * cp-tree.h (struct language_function): Rename in_function_try_handler
640         to x_in_function_try_handler.
641         Rename in_base_initializer to x_in_base_initializer.
642         Update all users.
643
644 2011-10-13   Diego Novillo  <dnovillo@google.com>
645
646         * class.c (sorted_fields_type_new): Factor out of ...
647         (finish_struct_1): ... here.
648
649 2011-10-13  Jason Merrill  <jason@redhat.com>
650
651         PR c++/50618
652         * init.c (expand_aggr_init_1): Don't zero-initialize virtual
653         bases of a base subobject.
654
655 2011-10-12  Paolo Carlini  <paolo.carlini@oracle.com>
656
657         PR c++/50594
658         * decl.c (cxx_init_decl_processing): Add
659         __attribute__((externally_visible)) to operator new and
660         operator delete library fn.
661
662 2011-10-11  Michael Meissner  <meissner@linux.vnet.ibm.com>
663
664         * decl.c (duplicate_decls): Delete old interface with two parallel
665         arrays to hold standard builtin declarations, and replace it with
666         a function based interface that can support creating builtins on
667         the fly in the future.  Change all uses, and poison the old
668         names.  Make sure 0 is not a legitimate builtin index.
669         * except.c (build_eh_type_type): Ditto.
670         (choose_personality_routine): Ditto.
671         * semantics.c (finish_omp_atomic): Ditto.
672         (finish_omp_barrier): Ditto.
673         (finish_omp_flush): Ditto.
674         (finish_omp_taskwait): Ditto.
675
676 2011-10-11  Jason Merrill  <jason@redhat.com>
677
678         PR c++/49855
679         PR c++/49896
680         * cp-tree.def (IMPLICIT_CONV_EXPR): New.
681         * call.c (perform_implicit_conversion_flags): Build it
682         instead of NOP_EXPR.
683         * cp-objcp-common.c (cp_common_init_ts): It's typed.
684         * cxx-pretty-print.c (pp_cxx_cast_expression): Handle it.
685         (pp_cxx_expression): Likewise.
686         * error.c (dump_expr): Likewise.
687         * semantics.c (potential_constant_expression_1): Likewise.
688         * tree.c (cp_tree_equal): Likewise.
689         (cp_walk_subtrees): Likewise.
690         * pt.c (iterative_hash_template_arg): Likewise.
691         (for_each_template_parm_r): Likewise.
692         (type_dependent_expression_p): Likewise.
693         (tsubst_copy, tsubst_copy_and_build): Handle IMPLICIT_CONV_EXPR
694         and CONVERT_EXPR.
695         * cp-tree.h (IMPLICIT_CONV_EXPR_DIRECT_INIT): New.
696
697 2011-10-11  Paolo Carlini  <paolo.carlini@oracle.com>
698
699         PR c++/50611
700         * pt.c (tsubst_copy_and_build): If (complain & tf_error) is false
701         do not call unqualified_name_lookup_error.
702
703 2011-10-10  Paolo Carlini  <paolo.carlini@oracle.com>
704
705         PR c++/50660
706         * call.c (conversion_null_warnings): Don't look through references.
707
708 2011-10-09  Paolo Carlini  <paolo.carlini@oracle.com>
709
710         PR c++/38980
711         * init.c (constant_value_1): Add bool parameter.
712         (decl_constant_value_safe): Add.
713         (integral_constant_value): Adjust.
714         (decl_constant_value): Adjust.
715         * cp-tree.h (decl_constant_value_safe): Declare.
716         * typeck.c (decay_conversion): Use decl_constant_value_safe.
717         * call.c (convert_like_real): Likewise.
718
719 2011-10-09  Jakub Jelinek  <jakub@redhat.com>
720             Diego Novillo  <dnovillo@google.com>
721
722         * pt.c (reregister_specialization): Use htab_find instead of
723         htab_find_slot with INSERT.
724         (maybe_process_partial_specialization, lookup_template_class_1): Change
725         slot variable type to void ** to avoid aliasing problems.
726         (register_specialization): Likewise.  Use slot != NULL instead of
727         more expensive !optimize_specialization_lookup_p (tmpl) test.
728
729 2011-10-08  Paolo Carlini  <paolo.carlini@oracle.com>
730
731         PR c++/34927
732         * typeck2.c (abstract_virtuals_error_sfinae): Don't produce duplicate
733         inform messages in case of cloned destructor.
734
735 2011-10-06  Jason Merrill  <jason@redhat.com>
736
737         PR c++/39164
738         * decl.c (grokfndecl): Diagnose redefinition of defaulted fn.
739
740 2011-10-02  Jason Merrill  <jason@redhat.com>
741
742         * pt.c (tsubst_pack_expansion): Re-use ARGUMENT_PACK_SELECTs.
743         Change unsubstituted_packs to bool.
744
745         * parser.c (cp_parser_range_for): Don't try to deduce from {}
746         in a template.
747
748         PR c++/35722
749         Implement N2555 (expanding pack expansion to fixed parm list)
750         * pt.c (coerce_template_parms): Allow expanding a pack expansion
751         to a fixed-length argument list.
752         (unify_pack_expansion): Handle explicit args properly.
753         (unify) [TREE_VEC]: Handle pack expansions here.
754         [TYPE_ARGUMENT_PACK]: Not here.
755         (tsubst_pack_expansion): Don't try to do partial substitution.
756         (pack_deducible_p): New.
757         (fn_type_unification): Use it.
758         (find_parameter_packs_r): Take the TYPE_MAIN_VARIANT
759         of a type parameter.
760         (check_non_deducible_conversion): Split from type_unification_real.
761         (unify_one_argument): Split from type_unification_real...
762         (unify_pack_expansion): ...and here.  Drop call_args_p parm.
763         (type_unification_real, unify, more_specialized_fn): Adjust.
764
765         * class.c (fixed_type_or_null): Handle NSDMI.
766         * method.c (walk_field_subobs): Disable NSDMI noexcept checking
767         for now.
768
769 2011-09-30  Jason Merrill  <jason@redhat.com>
770
771         * cp-tree.h (TREE_NEGATED_INT): Remove.
772         * semantics.c (finish_unary_op_expr): Don't set it.
773
774 2011-09-30  Janis Johnson  <janisjo@codesourcery.com>
775
776         PR c++/44473
777         * mangle.c (write_type): Handle CV qualifiers for decimal classes.
778
779 2011-09-26   Andi Kleen <ak@linux.intel.com>
780
781         * repo.c (finish_repo): Use HOST_WIDE_INT_PRINT_HEX_PURE.
782
783 2011-09-28  Paolo Carlini  <paolo.carlini@oracle.com>
784
785         PR c++/45278
786         * typeck.c (cp_build_binary_op): With -Wextra, warn for ordered
787         comparison of pointer with zero.
788
789 2011-09-27  Paolo Carlini  <paolo.carlini@oracle.com>
790
791         PR c++/31489
792         * parser.c (cp_parser_elaborated_type_specifier): For RECORD_TYPE,
793         set CLASSTYPE_DECLARED_CLASS.
794
795 2011-09-27  Jakub Jelinek  <jakub@redhat.com>
796
797         * decl.c (duplicate_decls): If compatible stpcpy prototype
798         is seen, set implicit_built_in_decls[BUILT_IN_STPCPY].
799
800 2011-09-26  Jason Merrill  <jason@redhat.com>
801
802         PR c++/45012
803         * pt.c (tsubst_copy_and_build) [CONST_DECL]: Don't pull out
804         constant value if we're still in a template.
805
806         PR c++/46105
807         * typeck.c (structural_comptypes): Ignore cv-quals on typename scope.
808
809         PR c++/50508
810         * semantics.c (cxx_eval_logical_expression): Use tree_int_cst_equal
811         rather than ==.
812
813 2011-09-26  Paolo Carlini  <paolo.carlini@oracle.com>
814
815         PR c++/45487
816         * error.c (dump_template_bindings): Separate bindings with semicolons
817         instead of commas.
818
819 2011-09-26  Jason Merrill  <jason@redhat.com>
820
821         PR c++/50512
822         * call.c (compare_ics): Only consider rvaluedness_matches_p
823         if the target type is the same or it too differs in rvalueness.
824
825         PR c++/50523
826         * call.c (implicit_conversion): Mask out inappropriate LOOKUP
827         flags at the top of the function.
828
829         * pt.c (tsubst_copy) [PARM_DECL]: Handle 'this' in NSDMI.
830
831 2011-09-26  Paolo Carlini  <paolo.carlini@oracle.com>
832
833         * pt.c (convert_nontype_argument): Handle NULLPTR_TYPE.
834
835 2011-09-26  Paolo Carlini  <paolo.carlini@oracle.com>
836
837         PR c++/26747
838         * cp-gimplify.c (get_bc_label): Remove obsolete diagnostics.
839
840 2011-09-25  Jason Merrill  <jason@redhat.com>
841
842         * parser.c (inject_this_parameter): Split out from
843         cp_parser_late_return_type_opt.
844         (cp_parser_class_specifier_1): Use it for NSDMIs.
845         * tree.c (bot_replace): Replace NSDMI 'this' with real 'this'.
846
847 2011-09-24  Jason Merrill  <jason@redhat.com>
848
849         * except.c (expr_noexcept_p): Split out from finish_noexcept_expr.
850         * cp-tree.h: Declare it.
851         * method.c (walk_field_subobs): Use it.
852
853         * init.c (perform_member_init): Instantiate NSDMI here.
854         * pt.c (tsubst_decl) [FIELD_DECL]: Not here.
855
856         Handle deferred parsing of NSDMIs.
857         * parser.h (cp_unparsed_functions_entry): Add nsdmis field.
858         * parser.c (unparsed_nsdmis, cp_parser_save_nsdmi): New.
859         (cp_parser_late_parse_one_default_arg): Split out from
860         cp_parser_late_parsing_default_args.
861         (cp_parser_late_parsing_nsdmi): New.
862         (push_unparsed_function_queues): Set it.
863         (cp_parser_parameter_declaration): Save the '=' token.
864         (cp_parser_template_parameter): Likewise.
865         (cp_parser_default_argument): Call cp_parser_initializer
866         rather than cp_parser_initializer_clause.
867         (cp_parser_class_specifier_1): Parse unparsed_nsdmis.
868         (cp_parser_member_declaration): Handle nsdmis.
869         * decl2.c (grokfield): Handle DEFAULT_ARG for a function.
870
871         Implement C++11 non-static data member initializers.
872         * cp-tree.h (enum cpp_warn_str): Add CPP0X_NSDMI.
873         * error.c (maybe_warn_cpp0x): Handle it.
874         * call.c (convert_like_real) [ck_user]: Don't complain about
875         using an explicit constructor for direct-initialization.
876         * class.c (check_field_decl): Fix ancient typo.
877         (check_field_decls): NSDMIs make the default ctor non-trivial.
878         * decl.c (cp_finish_decl): Record NSDMI.
879         (grokdeclarator): Allow NSDMI.
880         * decl2.c (grokfield): Allow NSDMI.  Correct LOOKUP flags.
881         * init.c (perform_member_init): Use NSDMI.
882         * method.c (walk_field_subobs): Check for NSDMI.
883         * parser.c (cp_parser_member_declaration): Parse { } init.
884         * semantics.c (register_constexpr_fundef): Don't talk about
885         a return statement in a constexpr constructor.
886         (cxx_eval_call_expression): Check DECL_INITIAL instead of
887         DECL_SAVED_TREE.
888
889 2011-09-24  Paolo Carlini  <paolo.carlini@oracle.com>
890
891         PR c++/44267
892         * class.c (build_base_path): Add a tsubst_flags_t parameter.
893         (convert_to_base): Adjust call.
894         * typeck.c (build_class_member_access_expr,
895         get_member_function_from_ptrfunc, build_static_cast_1): Likewise.
896         * init.c (dfs_initialize_vtbl_ptrs, emit_mem_initializers): Likewise.
897         * method.c (do_build_copy_constructor, do_build_copy_assign): Likewise.
898         * rtti.c (build_dynamic_cast_1): Likewise.
899         * typeck2.c (build_scoped_ref, build_m_component_ref): Likewise.
900         * call.c (build_over_call, build_special_member_call): Likewise.
901         * cvt.c (cp_convert_to_pointer, convert_to_pointer_force,
902         build_up_reference): Likewise.
903         * cp-tree.h (build_base_path): Adjust declaration.
904
905 2011-09-23  Jason Merrill  <jason@redhat.com>
906
907         Core 253 - allow const objects with no initializer or
908         user-provided default constructor if the defaulted constructor
909         initializes all the subobjects.
910         PR c++/20039
911         PR c++/42844
912         * class.c (default_init_uninitialized_part): New.
913         * cp-tree.h: Declare it.
914         * decl.c (check_for_uninitialized_const_var): Use it.
915         * init.c (perform_member_init): Likewise.
916         (build_new_1): Likewise.
917         * method.c (walk_field_subobs): Likewise.
918
919 2011-09-23  Paolo Carlini  <paolo.carlini@oracle.com>
920
921         PR c++/50258
922         * decl.c (check_static_variable_definition): Allow in-class
923         initialization of static data member of non-integral type in
924         permissive mode.
925
926 2011-09-22  Paolo Carlini  <paolo.carlini@oracle.com>
927
928         PR c++/50491
929         * semantics.c (potential_constant_expression_1): Handle USING_DECL.
930
931 2011-09-22  Paolo Carlini  <paolo.carlini@oracle.com>
932
933         PR c++/50371
934         * pt.c (invalid_nontype_parm_type_p): Handle NULLPTR_TYPE.
935
936 2011-09-22  Jonathan Wakely  <jwakely.gcc@gmail.com>
937             Paolo Carlini  <paolo.carlini@oracle.com>
938
939         PR c++/50344
940         * friend.c (make_friend_class): cv-qualification is ok in a
941         friend declaration.
942
943 2011-09-21  Paolo Carlini  <paolo.carlini@oracle.com>
944
945         PR c++/50454
946         * decl.c (grokdeclarator): Consistently handle both __int128
947         and unsigned __int128 with -pedantic; suppress diagnostic in
948         system headers.
949
950 2011-09-20  Jason Merrill  <jason@redhat.com>
951
952         * cp-tree.h (DECL_TEMPLOID_INSTANTIATION): New.
953         (DECL_GENERATED_P): New.
954         * class.c (finalize_literal_type_property): Use them.
955         * semantics.c (is_instantiation_of_constexpr): Likewise.
956         (register_constexpr_fundef): Likewise.
957
958         * call.c (convert_default_arg): Avoid redundant copy.
959         * tree.c (bot_manip): Copy everything.
960
961 2011-09-20 Roberto Agostino Vitillo <ravitillo@lbl.gov>
962
963         * call.c (build_new_method_call_1): Use non-virtual lookup
964         for final virtual functions.
965
966 2011-09-16  Jason Merrill  <jason@redhat.com>
967
968         PR c++/50424
969         * call.c (set_flags_from_callee): Split out from build_call_a.
970         * cp-tree.h: Declare it.
971         * tree.c (bot_manip): Call it.
972
973 2011-09-15  Jason Merrill  <jason@redhat.com>
974
975         PR c++/50365
976         * parser.c (cp_parser_late_return_type_opt): Check quals parameter
977         for clearing current_class_ptr, too.
978
979 2011-09-14   Diego Novillo  <dnovillo@google.com>
980
981         * name-lookup.c (lookup_arg_dependent): Use conditional
982         timevars.
983         * decl.c (xref_tag): Likewise.
984
985 2011-09-14  Paolo Carlini  <paolo.carlini@oracle.com>
986
987         PR c++/50391
988         * pt.c (regenerate_decl_from_template): Don't pass an error_mark_node
989         to build_exception_variant.
990
991 2011-09-13  Dodji Seketeli  <dodji@redhat.com>
992
993         PR c++/48320
994         * pt.c (template_parameter_pack_p): Support TEMPLATE_PARM_INDEX
995         nodes.  Add a comment.
996         (arg_from_parm_pack_p):  New static function, factorized out from
997         tsubst_pack_expansion and extended to support non-type parameter
998         packs represented with TEMPLATE_PARM_INDEX nodes.
999         (tsubst_pack_expansion): Use arg_from_parm_pack_p.
1000
1001 2011-09-12  Jason Merrill  <jason@redhat.com>
1002
1003         * pt.c (type_unification_real): Fix handling of DEDUCE_CONV
1004         with no deducible template parameters.
1005         * call.c (rejection_reason_code): Add rr_template_conversion.
1006         (print_z_candidate): Handle it.
1007         (template_conversion_rejection): New.
1008         (build_user_type_conversion_1): Use it.
1009
1010         * call.c (merge_conversion_sequences): Set bad_p and user_conv_p
1011         on all of the second conversion sequence.
1012         (build_user_type_conversion_1): Set bad_p on the ck_user conv.
1013         (convert_like_real): Handle bad ck_ref_bind with user_conv_p in the
1014         first section.  Fix loop logic.
1015         (initialize_reference): Call convert_like for diagnostics when
1016         we have a (bad) conversion.
1017
1018         * call.c (convert_class_to_reference)
1019         (convert_class_to_reference_1): Remove.
1020         (reference_binding): Use build_user_type_conversion_1 instead.
1021
1022         * call.c (initialize_reference): Add flags parm.
1023         * decl.c (grok_reference_init): Likewise.
1024         (check_initializer): Pass it.
1025         * typeck.c (convert_for_initialization): Likewise.
1026         * cp-tree.h: Adjust.
1027
1028         * cp-tree.h (LOOKUP_NO_RVAL_BIND): New.
1029         * call.c (conditional_conversion): Use it.
1030         (reference_binding): Fix handling of xvalues.
1031
1032 2011-09-09  Jason Merrill  <jason@redhat.com>
1033
1034         * call.c (implicit_conversion): Check BRACE_ENCLOSED_INITIALIZER_P
1035         before forcing instantiation.
1036
1037 2011-09-08  Paolo Carlini  <paolo.carlini@oracle.com>
1038
1039         PR c++/50324
1040         * typeck2.c (digest_init_r): Call complete_type_or_maybe_complain
1041         instead of complete_type_or_else.
1042
1043 2011-09-08  Dodji Seketeli  <dodji@redhat.com>
1044
1045         PR c++/33255 - Support -Wunused-local-typedefs warning
1046         * name-lookup.c (pushdecl_maybe_friend_1): Use the new
1047         record_locally_defined_typedef.
1048         * decl.c (finish_function): Use the new
1049         maybe_warn_unused_local_typedefs.
1050         (grokfield): Use the new record_locally_defined_typedef.
1051         * parser.c (lookup_name): Use the new maybe_record_typedef_use.
1052
1053 2011-09-07  Paolo Carlini  <paolo.carlini@oracle.com>
1054
1055         PR c++/50309
1056         * decl.c (grokdeclarator): Check u.function.exception_specification
1057         for error_mark_node.
1058
1059 2011-09-07  Jason Merrill  <jason@redhat.com>
1060
1061         PR c++/50298
1062         * parser.c (cp_parser_member_declaration): Don't require a constant
1063         rvalue here in C++0x.
1064
1065         * pt.c (type_unification_real): Correct complain arg for tsubsting
1066         default template args.
1067
1068         * pt.c (tsubst_aggr_type): Check TYPE_P before tsubsting.
1069
1070 2011-09-06  Jason Merrill  <jason@redhat.com>
1071
1072         PR c++/50296
1073         * semantics.c (register_constexpr_fundef): Call is_valid_constexpr_fn.
1074         (cx_check_missing_mem_inits): Handle bases and empty trivial members.
1075         (validate_constexpr_fundecl): Remove.
1076         * decl.c (start_preparsed_function): Don't call it.
1077         * cp-tree.h: Don't declare it.
1078
1079 2011-09-04  Jason Merrill  <jason@redhat.com>
1080
1081         PR c++/49267
1082         * call.c (reference_binding): Don't set is_lvalue for an rvalue
1083         reference rfrom.
1084
1085         PR c++/49267
1086         PR c++/49458
1087         DR 1328
1088         * call.c (reference_binding): Set rvaluedness_matches_p properly
1089         for reference to function conversion ops.
1090         (compare_ics): Adjust.
1091
1092         * class.c (trivial_default_constructor_is_constexpr): Rename from
1093         synthesized_default_constructor_is_constexpr.
1094         (type_has_constexpr_default_constructor): Adjust.
1095         (add_implicitly_declared_members): Call it instead.
1096         (explain_non_literal_class): Explain about non-constexpr default ctor.
1097         * cp-tree.h: Adjust.
1098         * method.c (synthesized_method_walk): Adjust.
1099         * semantics.c (explain_invalid_constexpr_fn): Handle defaulted
1100         functions, too.
1101
1102         PR c++/50248
1103         Core 1358
1104         * init.c (perform_member_init): Don't diagnose missing inits here.
1105         (emit_mem_initializers): Or here.
1106         * method.c (process_subob_fn): Don't instantiate constexpr ctors.
1107         * semantics.c (cx_check_missing_mem_inits): New.
1108         (explain_invalid_constexpr_fn): Call it.
1109         (register_constexpr_fundef): Likewise.  Leave
1110         DECL_DECLARED_CONSTEXPR_P set when the body is unsuitable.
1111         (cxx_eval_call_expression): Adjust diagnostics.
1112         (cxx_eval_constant_expression): Catch use of 'this' in a constructor.
1113
1114 2011-08-30  Jason Merrill  <jason@redhat.com>
1115
1116         PR c++/50084
1117         * cp-tree.h (cp_decl_specifier_seq): Rename user_defined_type_p
1118         to type_definition_p.
1119         * parser.c (cp_parser_set_decl_spec_type): Likewise.
1120         * decl.c (grokdeclarator): Check it.
1121
1122         PR c++/50089
1123         * semantics.c (finish_id_expression): Use
1124         current_nonlambda_class_type for qualified-ids.
1125
1126         PR c++/50114
1127         * decl.c (poplevel): Disable for scope compatibility hack
1128         in C++11 mode.
1129
1130         PR c++/50220
1131         * semantics.c (add_capture): Call complete_type for copy.
1132
1133         PR c++/50234
1134         * semantics.c (cxx_eval_component_reference): Handle
1135         value-initialization for omitted initializers.
1136
1137 2011-08-29  Jason Merrill  <jason@redhat.com>
1138
1139         PR c++/50224
1140         * semantics.c (finish_id_expression): Mark captured variables used.
1141
1142 2011-08-29  Jakub Jelinek  <jakub@redhat.com>
1143             Jason Merrill  <jason@redhat.com>
1144
1145         PR c++/50207
1146         * class.c (finish_struct_1): Complain if the first field is
1147         artificial.
1148
1149 2011-08-29  Jason Merrill  <jason@redhat.com>
1150
1151         PR c++/50209
1152         Core DR 994
1153         * parser.c (cp_parser_default_argument): Use
1154         cp_parser_initializer_clause.
1155         (cp_parser_late_parsing_default_args): Likewise.
1156
1157 2011-08-26  Jason Merrill  <jason@redhat.com>
1158
1159         Core DR 342
1160         PR c++/48582
1161         * pt.c (check_valid_ptrmem_cst_expr): A null member pointer value
1162         is valid in C++11.
1163         (convert_nontype_argument): Likewise.  Implicitly convert nullptr
1164         and do constant folding.
1165         * mangle.c (write_template_arg_literal): Mangle null member
1166         pointer values as 0.
1167         * call.c (null_member_pointer_value_p): New.
1168         * cp-tree.h: Declare it.
1169
1170 2011-08-25  Jason Merrill  <jason@redhat.com>
1171
1172         * call.c (convert_like_real): Remove redundant complain checks.
1173
1174         PR c++/50157
1175         * call.c (convert_like_real): Exit early if bad and !tf_error.
1176
1177 2011-08-23  Jason Merrill  <jason@redhat.com>
1178
1179         * typeck2.c (build_functional_cast): Don't try to avoid calling
1180         build_value_init.
1181         * pt.c (instantiate_class_template_1): Don't copy TYPE_HAS_* flags.
1182
1183 2011-08-23  Jason Merrill  <jason@redhat.com>
1184
1185         PR c++/49045
1186         Core 1321
1187         * tree.c (dependent_name): New.
1188         (cp_tree_equal): Two calls with the same dependent name are
1189         equivalent even if the overload sets are different.
1190
1191 2011-08-23  Jason Merrill  <jason@redhat.com>
1192
1193         * tree.c (build_target_expr): Set TREE_CONSTANT on
1194         literal TARGET_EXPR if the value is constant.
1195         * typeck2.c (build_functional_cast): Don't set it here.
1196
1197 2011-08-23  Jason Merrill  <jason@redhat.com>
1198
1199         Core 903 (partial)
1200         * call.c (null_ptr_cst_p): Only 0 qualifies in C++11.
1201
1202 2011-08-23  Jason Merrill  <jason@redhat.com>
1203
1204         Core 975
1205         * decl.c (cxx_init_decl_processing): Initialize
1206         dependent_lambda_return_type_node.
1207         * cp-tree.h (cp_tree_index): Add CPTI_DEPENDENT_LAMBDA_RETURN_TYPE.
1208         (dependent_lambda_return_type_node): Define.
1209         (DECLTYPE_FOR_LAMBDA_RETURN): Remove.
1210         * semantics.c (lambda_return_type): Handle overloaded function.
1211         Use dependent_lambda_return_type_node instead of
1212         DECLTYPE_FOR_LAMBDA_RETURN.
1213         (apply_lambda_return_type): Don't check dependent_type_p.
1214         * pt.c (tsubst_copy_and_build): Handle lambda return type deduction.
1215         (instantiate_class_template_1): Likewise.
1216         (tsubst): Don't use DECLTYPE_FOR_LAMBDA_RETURN.
1217         * mangle.c (write_type): Likewise.
1218         * typeck.c (structural_comptypes): Likewise.
1219         (check_return_expr): Handle dependent_lambda_return_type_node.
1220
1221 2011-08-23  Jason Merrill  <jason@redhat.com>
1222
1223         PR c++/50024
1224         * semantics.c (maybe_constant_value): Don't try to fold { }.
1225         * pt.c (build_non_dependent_expr): Don't wrap { }.
1226         * init.c (build_value_init): Allow scalar value-init in templates.
1227
1228 2011-08-23  Jason Merrill  <jason@redhat.com>
1229
1230         * semantics.c (potential_constant_expression_1): Allow 'this'.
1231
1232 2011-08-23  Jakub Jelinek  <jakub@redhat.com>
1233
1234         PR c++/50158
1235         * typeck.c (cp_build_modify_expr): Call mark_rvalue_use on rhs
1236         if it has side-effects and needs to be preevaluated.
1237
1238 2011-08-23  Siddhesh Poyarekar  <siddhesh.poyarekar@gmail.com>
1239
1240         PR c++/50055
1241         * except.c (begin_eh_spec_block): Build EH_SPEC block on the
1242         same line as the function.
1243
1244 2011-08-23  Jakub Jelinek  <jakub@redhat.com>
1245
1246         PR c++/46862
1247         * class.c (finish_struct_1): If TYPE_TRANSPARENT_AGGR is set on a type
1248         which doesn't have any fields, clear it and diagnose.
1249
1250 2011-08-18  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
1251             Marc Glisse  <marc.glisse@normalesup.org>
1252
1253         PR libstdc++-v3/1773
1254         * mangle.c (decl_mangling_context): Call
1255         targetm.cxx.decl_mangling_context.
1256         (write_unscoped_name): Use decl_mangling_context.
1257
1258 2011-08-18  Dodji Seketeli  <dodji@redhat.com>
1259
1260         PR c++/45625
1261         * pt.c (parameter_of_template_p): Handle comparison with DECLs of
1262         template parameters as created by process_template_parm.
1263
1264 2011-08-16  Jason Merrill  <jason@redhat.com>
1265
1266         PR c++/50086
1267         * pt.c (unify_pack_expansion): Correct overloaded unification
1268         logic.
1269
1270         * pt.c (instantiate_class_template_1): If DECL_PRESERVE_P is set
1271         on a member function or static data member, call mark_used.
1272
1273         PR c++/50054
1274         * typeck2.c (cxx_incomplete_type_diagnostic): Handle
1275         init_list_type_node.
1276
1277 2011-08-13  Jason Merrill  <jason@redhat.com>
1278
1279         PR c++/50075
1280         * name-lookup.c (local_bindings_p): New.
1281         * name-lookup.h: Declare it.
1282         * lex.c (unqualified_name_lookup_error): Use it.
1283
1284         PR c++/50059
1285         * error.c (dump_expr): Handle MODIFY_EXPR properly.
1286
1287         * decl.c (grok_reference_init): Handle constexpr here.
1288         * call.c (initialize_reference): Not here.
1289
1290 2011-08-12  David Li  <davidxl@google.com>
1291
1292         * class.c (update_vtable_entry_for_fn): Set
1293         LOST_PRIMARY bit properly.
1294
1295 2011-08-12  Jason Merrill  <jason@redhat.com>
1296
1297         PR c++/50034
1298         * call.c (convert_arg_to_ellipsis): force_rvalue only in
1299         potentially evaluated context.
1300
1301 2011-08-12  Richard Guenther  <rguenther@suse.de>
1302
1303         * call.c (build_over_call): Instead of memcpy use an
1304         assignment of two MEM_REFs.
1305
1306 2011-08-11  Romain Geissler  <romain.geissler@gmail.com>
1307             Brian Hackett  <bhackett1024@gmail.com>
1308
1309         * decl.c (cp_finish_decl): Invoke callbacks on finish_decl event.
1310
1311 2011-08-10  Richard Guenther  <rguenther@suse.de>
1312
1313         * call.c (build_over_call): Call memcpy unconditionally.
1314
1315 2011-08-08  Jason Merrill  <jason@redhat.com>
1316
1317         PR c++/50020
1318         * semantics.c (finish_call_expr): Don't look at 'this' if we
1319         had an explicit object argument.
1320
1321         PR c++/50011
1322         * typeck2.c (check_narrowing): Fix integer logic.
1323
1324 2011-08-08  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
1325
1326         * Make-lang.in (g++$(exeext)): Add $(EXTRA_GCC_LIBS).
1327
1328 2011-08-05  Jason Merrill  <jason@redhat.com>
1329
1330         PR c++/48993
1331         * semantics.c (potential_constant_expression_1) [CALL_EXPR]: Sorry
1332         on 'this' in a constructor.
1333
1334         PR c++/49921
1335         * semantics.c (finish_decltype_type): Call invalid_nonstatic_memfn_p.
1336
1337         PR c++/49669
1338         * init.c (perform_member_init): Handle invalid array initializer.
1339
1340         PR c++/49988
1341         * semantics.c (cxx_eval_array_reference): Handle failure to
1342         reduce the array operand to something we can work with.
1343
1344 2011-08-05  Gabriel Charette  <gchare@google.com>
1345
1346         * decl.c (finish_function): Remove unecessary line 0 hack.
1347
1348 2011-08-05  Jason Merrill  <jason@redhat.com>
1349
1350         PR c++/47453
1351         * typeck.c (build_x_compound_expr_from_list): Also complain
1352         about ({...}).
1353
1354         PR c++/49812
1355         * typeck.c (cp_build_unary_op) [POSTINCREMENT_EXPR]: Strip cv-quals.
1356
1357         PR c++/49983
1358         * parser.c (cp_parser_range_for): Only do auto deduction in
1359         template if the range is non-dependent.
1360
1361         * init.c (perform_member_init): Always build_aggr_init
1362         for a class member with an explicit mem-initializer.
1363
1364         * pt.c (unify) [TEMPLATE_TYPE_PARM]: Allow VLA for C++0x 'auto'.
1365
1366 2011-08-04  Jakub Jelinek  <jakub@redhat.com>
1367
1368         PR middle-end/49905
1369         * decl.c (cxx_init_decl_processing): Add alloc_size (1) attribute
1370         for operator new and operator new [].  Call init_attributes.
1371
1372 2011-08-02  Jason Merrill  <jason@redhat.com>
1373
1374         PR c++/43886
1375         * parser.c (cp_parser_lambda_body): Clear local_variables_forbidden_p.
1376
1377         PR c++/49577
1378         * typeck2.c (check_narrowing): Check unsigned mismatch.
1379         * semantics.c (finish_compound_literal): check_narrowing.
1380
1381         PR c++/49593
1382         * pt.c (find_parameter_packs_r): Handle CONSTRUCTOR.
1383
1384         PR c++/49803
1385         * init.c (sort_mem_initializers): Initialize uses_unions_p here.
1386         (build_field_list): Not here.
1387
1388         PR c++/49834
1389         * parser.c (build_range_temp): Split out from...
1390         (cp_convert_range_for): ...here.
1391         (do_range_for_auto_deduction): New.
1392         (cp_parser_range_for): Use it.
1393
1394 2011-08-02  Jakub Jelinek  <jakub@redhat.com>
1395
1396         * cp-tree.h (finish_omp_atomic): Adjust prototype.
1397         (cxx_omp_const_qual_no_mutable): New prototype.
1398         (finish_omp_taskyield): New prototype.
1399         * parser.c (cp_parser_omp_atomic): (cp_parser_omp_atomic): Handle
1400         parsing OpenMP 3.1 atomics.  Adjust finish_omp_atomic caller.
1401         (cp_parser_omp_clause_name): Handle final and mergeable clauses.
1402         (cp_parser_omp_clause_final, cp_parser_omp_clause_mergeable): New
1403         functions.
1404         (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_FINAL
1405         and PRAGMA_OMP_CLAUSE_MERGEABLE.
1406         (OMP_TASK_CLAUSE_MASK): Allow final and mergeable clauses.
1407         (cp_parser_omp_taskyield): New function.
1408         (cp_parser_pragma): Handle PRAGMA_OMP_TASKYIELD.
1409         (cp_parser_omp_clause_reduction): Handle min and max.
1410         * pt.c (tsubst_expr) <case OMP_ATOMIC>: Handle OpenMP 3.1 atomics.
1411         (tsubst_omp_clauses): Handle OMP_CLAUSE_FINAL and
1412         OMP_CLAUSE_MERGEABLE.
1413         * semantics.c (finish_omp_atomic): Add OPCODE, V, LHS1 and RHS1
1414         arguments.  Handle OpenMP 3.1 atomics.  Adjust c_finish_omp_atomic
1415         caller.
1416         (finish_omp_clauses): Don't complain about const qualified
1417         predetermined vars and static data members in firstprivate clause.
1418         Handle OMP_CLAUSE_FINAL and OMP_CLAUSE_MERGEABLE. Handle MIN_EXPR
1419         and MAX_EXPR.
1420         (finish_omp_taskyield): New function.
1421         * cp-gimplify.c (cxx_omp_const_qual_no_mutable): New function.
1422         (cxx_omp_predetermined_sharing): Use it.
1423
1424 2011-08-02  Jason Merrill  <jason@redhat.com>
1425
1426         * call.c (build_call_a): Also check at_function_scope_p.
1427
1428 2011-08-01  Jason Merrill  <jason@redhat.com>
1429
1430         PR c++/49932
1431         * mangle.c (write_prefix): Handle decltype.
1432
1433         PR c++/49924
1434         * semantics.c (cxx_eval_vec_init_1): Fix logic.
1435
1436         PR c++/49813
1437         * semantics.c (potential_constant_expression_1): Allow any builtin.
1438         (morally_constexpr_builtin_function_p): Remove.
1439
1440 2011-07-29  Jason Merrill  <jason@redhat.com>
1441
1442         PR c++/49867
1443         * parser.c (cp_parser_lambda_expression): Also clear in_statement
1444         and in_switch_statement_p.
1445         (cp_parser_class_specifier): Likewise.
1446
1447 2011-07-28  Jason Merrill  <jason@redhat.com>
1448
1449         PR c++/49808
1450         * pt.c (tsubst) [TEMPLATE_PARM_INDEX]: Call convert_from_reference.
1451         (convert_nontype_argument, tsubst_template_arg): Handle its output.
1452
1453 2011-07-28  Paolo Carlini  <paolo.carlini@oracle.com>
1454
1455         PR c++/49813
1456         * semantics.c (potential_constant_expression_1):  Handle FMA_EXPR.
1457
1458 2011-07-27  Jeffrey Yasskin  <jyasskin@google.com>
1459
1460         * pt.c (build_template_decl): Copy the function_decl's
1461         source location to the new template_decl.
1462
1463 2011-07-26  Paolo Carlini  <paolo.carlini@oracle.com>
1464
1465         PR c++/49776
1466         * typeck.c (cp_build_modify_expr): Check digest_init return value
1467         for error_mark_node.
1468
1469 2011-07-25  Paolo Carlini  <paolo.carlini@oracle.com>
1470
1471         PR bootstrap/49845
1472         * parser.c (cp_parser_perform_range_for_lookup): Always assign *being
1473         and *end before returning.
1474
1475 2011-07-25  Paolo Carlini  <paolo.carlini@oracle.com>
1476
1477         PR c++/49838
1478         * parser.c (cp_parser_perform_range_for_lookup): Early return if
1479         error_operand_p (range).
1480
1481 2011-07-23  Jason Merrill  <jason@redhat.com>
1482
1483         PR c++/49823
1484         * parser.c (cp_parser_qualifying_entity): Handle templates.
1485
1486 2011-07-22  Jason Merrill  <jason@redhat.com>
1487
1488         PR c++/49793
1489         * typeck2.c (check_narrowing): Downgrade permerror to pedwarn.
1490         Make conditional on -Wnarrowing.
1491
1492 2011-07-22  Ville Voutilainen  <ville.voutilainen@gmail.com>
1493
1494         Warn about the use of final/override in non-c++0x mode, and
1495         add __final for non-c++0x mode.
1496         * cp-tree.h (cpp0x_warn_str): Add CPP0X_OVERRIDE_CONTROLS.
1497         * error.c (maybe_warn_cpp0x): Adjust.
1498         * parser.c (cp_parser_virt_specifier_seq_opt): Use it. Add
1499         '__final' as a non-c++0x alternative for 'final'.
1500
1501 2011-07-22  Jason Merrill  <jason@redhat.com>
1502             Mark Glisse  <marc.glisse@normalesup.org>
1503
1504         PR c++/30112
1505         * decl.c (cp_finish_decl): Apply pragma redefine_extname in
1506         other namespaces as well.
1507         * name-lookup.c (c_linkage_bindings): Define.
1508         (lookup_extern_c_fun_in_all_ns): Rename from
1509         lookup_extern_c_fun_binding_in_all_ns.  Return tree.
1510         (pushdecl_maybe_friend_1): Adjust.  Copy DECL_ASSEMBLER_NAME.
1511
1512 2011-07-20  Jason Merrill  <jason@redhat.com>
1513
1514         * parser.c (cp_parser_initializer_list): Handle C99 .id= and [N]=
1515         designated initializer syntax.
1516         * decl.c (check_array_designated_initializer): Add index parm.
1517         (maybe_deduce_size_from_array_init): Pass it.
1518         (reshape_init_array_1): Likewise.
1519
1520         PR c++/6709 (DR 743)
1521         PR c++/42603 (DR 950)
1522         * parser.c (token_is_decltype, cp_lexer_next_token_is_decltype): New.
1523         (cp_parser_nested_name_specifier_opt): Allow decltype.
1524         (cp_parser_qualifying_entity): Likewise.
1525         (cp_parser_decltype): Replace source tokens with CPP_DECLTYPE.
1526         (cp_parser_simple_type_specifier): Handle decltype as scope.
1527         (cp_parser_base_specifier): Allow decltype.
1528         (cp_parser_base_clause): Don't crash on null base.
1529         * parser.h (CPP_KEYWORD, CPP_TEMPLATE_ID): Move to c-common.h.
1530         (CPP_NESTED_NAME_SPECIFIER, N_CP_TTYPES): Likewise.
1531
1532 2011-07-19  Jason Merrill  <jason@redhat.com>
1533
1534         PR c++/49785
1535         * pt.c (coerce_template_parms): Handle non-pack after pack.
1536
1537 2011-07-19  Richard Guenther  <rguenther@suse.de>
1538
1539         * call.c (build_special_member_call): Use fold_build_pointer_plus.
1540         * class.c (build_base_path): Likewise.
1541         (convert_to_base_statically): Likewise.
1542         (dfs_accumulate_vtbl_inits): Likewise.
1543         * cp-gimplify.c (cxx_omp_clause_apply_fn): Likewise.
1544         * except.c (expand_start_catch_block): Likewise.
1545         * init.c (expand_virtual_init): Likewise.
1546         (build_new_1): Likewise.
1547         (build_vec_delete_1): Likewise.
1548         (build_vec_delete): Likewise.
1549         * rtti.c (build_headof): Likewise.
1550         (tinfo_base_init): Likewise.
1551         * typeck.c (get_member_function_from_ptrfunc): Likewise.
1552         (cp_build_addr_expr_1): Likewise.
1553         * typeck2.c (build_m_component_ref): Likewise.
1554
1555 2011-07-18  Martin Jambor  <mjambor@suse.cz>
1556
1557         * parser.c (cp_parser_parameter_declaration_list): Initialize
1558         parenthesized_p.
1559
1560 2011-07-16  Jason Merrill  <jason@redhat.com>
1561
1562         * pt.c (tinst_level_tick, last_template_error_tick): Replace with
1563         last_error_tinst_level.
1564         (push_tinst_level, pop_tinst_level): Adjust.
1565         (problematic_instantiation_changed): Adjust.
1566         (record_last_problematic_instantiation): Adjust.
1567         * error.c (cp_print_error_function): Don't print
1568         current_function_decl if we're in a template instantiation context.
1569         (print_instantiation_full_context): Always print first line.
1570
1571 2011-07-16  Nathan Froyd  <froydnj@codesourcery.com>
1572             Jason Merrill  <jason@redhat.com>
1573
1574         PR c++/45329
1575         PR c++/48934
1576         * cp-tree.h (fn_type_unification): Add `bool' parameter.
1577         * pt.c (enum template_base_result): Define.
1578         (unify_success, unify_unknown): Define.
1579         (unify_parameter_deduction_failure): Define.
1580         (unify_invalid, unify_cv_qual_mismatch, unify_type_mismatch): Define.
1581         (unify_parameter_pack_mismatch): Define.
1582         (unify_parameter_pack_inconsistent): Define.
1583         (unify_ptrmem_cst_mismatch, unify_vla_arg): Define.
1584         (unify_expression_unequal, unify_inconsistency): Define.
1585         (unify_method_type_error, unify_arity): Likewise.
1586         (unify_too_many_parameters, unify_too_few_parameters): Define.
1587         (unify_arg_conversion, unify_no_common_base): Define.
1588         (unify_illformed_ptrmem_cst_expr): Define.
1589         (unify_substitution_failure): Define.
1590         (unify_inconsistent_template_template_parameters): Define.
1591         (unify_template_deduction_failure): Define.
1592         (unify_template_argument_mismatch): Define.
1593         (unify_overload_resolution_failure): Define.
1594         (comp_template_args_with_info): New function, split out from...
1595         (comp_template_args): ...here.  Call it.
1596         (deduction_tsubst_fntype): Add `complain' parameter'.  Pass it
1597         to tsubst.
1598         (unify): Add `explain_p' parameter.  Pass to all relevant calls.
1599         Call above status functions when appropriate.
1600         (resolve_overloaded_unification, try_one_overload): Likewise.
1601         (type_unification, type_unification_real): Likewise.
1602         (unify_pack_expansion): Likewise.
1603         (get_template_base, try_class_unification): Likewise.
1604         (get_bindings, more_specialized_fn): Pass false to unification
1605         calls.
1606         (get_class_bindings, do_auto_deduction): Likewise.
1607         (convert_nontype_argument): Likewise.
1608         (fn_type_unification): Likewise.  Pass tf_warning_or_error if
1609         explain_p.
1610         (get_template_base): Add `explain_p' parameter and pass it to
1611         try_class_unification.  Return an enum template_base_result.
1612         * class.c (resolve_address_of_overloaded_function): Pass false to
1613         fn_type_unification.
1614         * call.c (enum rejection_reason_code): Add new codes.
1615         (struct rejection_reason): Add template_unification field.
1616         Add template_instantiation field.
1617         (template_unification_rejection): Define.
1618         (template_unification_error_rejection): Define.
1619         (template_instantiation_rejection): Define.
1620         (invalid_copy_with_fn_template_rejection): Define.
1621         (add_template_candidate): Pass false to unify.
1622         Provide more rejection reasons when possible.
1623         (print_template_unification_rejection): Define.
1624         (print_arity_rejection): Define, split out from...
1625         (print_z_candidate): ...here.  Add cases for new rejection
1626         reasons.
1627
1628 2011-07-15  Jason Merrill  <jason@redhat.com>
1629
1630         * Make-lang.in (check-g++-strict-gc): New.
1631         (cp/except.o): Depend on gt-cp-except.h
1632         * except.c: Include gt-cp-except.h.
1633         * config-lang.in (gtfiles): Add cp/except.c.
1634         * decl2.c (mark_used): Adjust constexpr condition, set
1635         function_depth around template instantiation.
1636         * parser.c (cp_parser_lambda_body): Set function_depth.
1637         * semantics.c (maybe_add_lambda_conv_op): Likewise.
1638
1639         PR testsuite/49741
1640         * Make-lang.in (check-c++0x): Use --extra_opts instead of--tool_opts.
1641
1642 2011-07-13  Jason Merrill  <jason@redhat.com>
1643
1644         * Make-lang.in (check-c++0x): New.
1645
1646 2011-07-13  Richard Sandiford  <richard.sandiford@linaro.org>
1647
1648         * typeck2.c (split_nonconstant_init_1): Pass the initializer directly,
1649         rather than a pointer to it.  Return true if the whole of the value
1650         was initialized by the generated statements.  Use
1651         complete_ctor_at_level_p instead of count_type_elements.
1652
1653 2011-07-12   Diego Novillo  <dnovillo@google.com>
1654
1655         * name-lookup.h (cp_binding_level): Rename from cxx_scope.
1656         Update all users.
1657         (struct cp_binding_level): Fix indentation.
1658
1659 2011-07-11  Jason Merrill  <jason@redhat.com>
1660
1661         PR c++/49672
1662         * pt.c (extract_fnparm_pack): Split out from...
1663         (make_fnparm_pack): ...here.
1664         (instantiate_decl): Handle non-pack parms after a pack.
1665         * semantics.c (maybe_add_lambda_conv_op): Don't in a template.
1666
1667         * decl2.c (decl_constant_var_p): Use decl_maybe_constant_var_p.
1668
1669         PR c++/44609
1670         * cp-tree.h (struct tinst_level): Add errors field.
1671         * pt.c (neglectable_inst_p, limit_bad_template_recurson): New.
1672         (push_tinst_level): Don't start another decl in that case.
1673         (reopen_tinst_level): Adjust errors field.
1674         * decl2.c (cp_write_global_declarations): Don't complain about
1675         undefined inline if its template was defined.
1676         * mangle.c (mangle_decl_string): Handle failure from push_tinst_level.
1677
1678 2011-07-10  Jason Merrill  <jason@redhat.com>
1679
1680         PR c++/49691
1681         * parser.c (cp_parser_late_return_type_opt): Check quals parameter
1682         rather than current_class_type to determine whether to set 'this'.
1683         (cp_parser_direct_declarator): Pass -1 to quals if member_p is false.
1684         (cp_parser_init_declarator): Pass down member_p.
1685
1686 2011-07-09  Jason Merrill  <jason@redhat.com>
1687
1688         * tree.c (build_vec_init_elt): Strip TARGET_EXPR.
1689
1690 2011-07-08  Jason Merrill  <jason@redhat.com>
1691
1692         PR c++/45437
1693         * typeck.c (cp_build_modify_expr): Preevaluate RHS.
1694
1695         * method.c (use_thunk): Use cgraph_add_to_same_comdat_group.
1696         * optimize.c (maybe_clone_body): Likewise.
1697         * semantics.c (maybe_add_lambda_conv_op): Likewise.
1698
1699         PR c++/45603
1700         * decl.c (expand_static_init): Don't get confused by user
1701         declaration of __cxa_guard_acquire.
1702
1703         * typeck.c (cp_apply_type_quals_to_decl): Don't check
1704         COMPLETE_TYPE_P either.
1705
1706         PR c++/49673
1707         * typeck.c (cp_apply_type_quals_to_decl): Don't check
1708         TYPE_NEEDS_CONSTRUCTING.
1709
1710 2011-07-07  Jason Merrill  <jason@redhat.com>
1711
1712         PR c++/49663
1713         * pt.c (push_deduction_access_scope): Preserve
1714         processing_template_decl across push_to_top_level.
1715         And revert:
1716         * class.c (pushclass): Accept NULL argument.
1717         (popclass): Deal with popping null class.
1718         * pt.c (push_access_scope, pop_access_scope): Use them rather than
1719         push_to_top_level/pop_from_top_level.
1720         * name-lookup.c (lookup_name_real_1): Check current_class_type.
1721
1722 2011-07-07  Jakub Jelinek  <jakub@redhat.com>
1723
1724         PR c/49644
1725         * typeck.c (cp_build_binary_op): For MULT_EXPR and TRUNC_DIV_EXPR with
1726         one non-complex and one complex argument, call save_expr on both
1727         operands.
1728
1729 2011-07-06  Jason Merrill  <jason@redhat.com>
1730
1731         PR c++/49353
1732         * semantics.c (expand_or_defer_fn_1): Clear DECL_EXTERNAL
1733         on kept inlines.
1734
1735         PR c++/49568
1736         * method.c (make_thunk, use_thunk): Copy DECL_COMDAT.
1737
1738 2011-07-05  Jason Merrill  <jason@redhat.com>
1739
1740         PR c++/48157
1741         * pt.c (tsubst_qualified_id): Preserve TEMPLATE_ID_EXPR in
1742         partial instantiation.
1743
1744         PR c++/49598
1745         * semantics.c (finish_id_expression): convert_from_reference.
1746
1747 2011-07-05  Richard Guenther  <rguenther@suse.de>
1748
1749         * decl.c (cxx_init_decl_processing): Defer building common
1750         tree nodes to c_common_nodes_and_builtins.
1751
1752 2011-07-04  Jason Merrill  <jason@redhat.com>
1753
1754         DR 1207
1755         PR c++/49589
1756         * mangle.c (write_expression): Handle 'this'.
1757         * parser.c (cp_parser_postfix_dot_deref_expression): Allow
1758         incomplete *this.
1759         * semantics.c (potential_constant_expression_1): Check that
1760         DECL_CONTEXT is set on 'this'.
1761
1762         * error.c (dump_template_bindings): Don't print typenames
1763         for a partial instantiation.
1764         (dump_function_decl): If we aren't printing function arguments,
1765         print template arguments as <args> rather than [with ...].
1766         (dump_expr): Don't print return type or template header.
1767         [BASELINK]: Use BASELINK_FUNCTIONS rather than get_first_fn.
1768         * pt.c (dependent_template_arg_p): Handle null arg.
1769
1770         * error.c (type_to_string): Avoid redundant akas.
1771
1772 2011-07-01  Jonathan Wakely  <jwakely.gcc@gmail.com>
1773
1774         PR c++/49605
1775         * init.c (build_delete): Only warn for sfk_deleting_destructor.
1776
1777 2011-07-01  Jakub Jelinek  <jakub@redhat.com>
1778
1779         * Make-lang.in (cp/decl.o): Depend on pointer-set.h.
1780         (cp/class.o): Likewise.
1781         (cp/error.o): Likewise.
1782         (cp/name-lookup.o): Likewise.
1783         (cp/decl2.o): Likewise.  Don't depend on $(POINTER_SET_H).
1784
1785 2011-07-01  Jason Merrill  <jason@redhat.com>
1786
1787         PR c++/48261
1788         * pt.c (lookup_template_function): Handle non-function.
1789
1790         PR c++/48593
1791         * pt.c (tsubst_qualified_id): Check PTRMEM_OK_P.
1792         * tree.c (build_qualified_name): Set PTRMEM_OK_P.
1793         * semantics.c (finish_parenthesized_expr): Clear PTRMEM_OK_P on
1794         SCOPE_REF, too.
1795         * cp-tree.h (PTRMEM_OK_P): Apply to SCOPE_REF, too.
1796         (QUALIFIED_NAME_IS_TEMPLATE): Switch to lang flag 1.
1797
1798         PR c++/48883
1799         PR c++/49609
1800         * pt.c (resolve_nondeduced_context): Call mark_used.
1801
1802         PR c++/49085
1803         * semantics.c (finish_offsetof): Complain about incomplete type.
1804
1805 2011-06-30  Jason Merrill  <jason@redhat.com>
1806
1807         PR c++/49387
1808         * rtti.c (get_tinfo_decl): Call complete_type.
1809
1810         PR c++/49569
1811         * method.c (implicitly_declare_fn): Set DECL_PARM_LEVEL and
1812         DECL_PARM_INDEX on rhs parm.
1813
1814         * pt.c (iterative_hash_template_arg): Use cp_tree_operand_length.
1815
1816         PR c++/49355
1817         * tree.c (stabilize_init): Handle aggregate initialization.
1818
1819         PR c++/48481
1820         * name-lookup.c (struct arg_lookup): Add fn_set.
1821         (add_function): Check it.
1822         (lookup_arg_dependent_1): Initialize it.
1823
1824 2011-06-29  Jason Merrill  <jason@redhat.com>
1825
1826         PR c++/49216
1827         * init.c (build_new_1): Pass {} down to build_vec_init.
1828         (build_vec_init): Handle it.
1829
1830         DR 1207
1831         PR c++/49003
1832         * cp-tree.h (struct saved_scope): Add x_current_class_ptr,
1833         x_current_class_ref.
1834         (current_class_ptr, current_class_ref): Use them.
1835         * decl.c (build_this_parm): Handle getting the class type.
1836         * parser.c (cp_parser_late_return_type_opt): Set up 'this'
1837         for use within the trailing return type.
1838
1839         * pt.c (tsubst_decl) [VAR_DECL]: In unevaluated operand,
1840         don't tsubst DECL_INITIAL unless our type use auto.
1841
1842         PR c++/49520
1843         * semantics.c (constexpr_fn_retval): Handle CLEANUP_POINT_EXPR here.
1844         (massage_constexpr_body): Not here.
1845
1846         PR c++/49554
1847         * semantics.c (lambda_proxy_type): New.
1848         (build_capture_proxy): Use it.
1849         * cp-tree.h (DECLTYPE_FOR_LAMBDA_PROXY): New.
1850         * pt.c (tsubst) [DECLTYPE_TYPE]: Use them.
1851
1852         PR c++/45923
1853         * class.c (explain_non_literal_class): New.
1854         (finalize_literal_type_property): Call it.
1855         * cp-tree.h: Declare it.
1856         * semantics.c (ensure_literal_type_for_constexpr_object): Call it.
1857         (is_valid_constexpr_fn): Likewise.
1858         (massage_constexpr_body): Split out from...
1859         (register_constexpr_fundef): ...here.
1860         (is_instantiation_of_constexpr): New.
1861         (expand_or_defer_fn_1): Leave DECL_SAVED_TREE alone in that case.
1862         (explain_invalid_constexpr_fn): New.
1863         (cxx_eval_call_expression): Call it.
1864         (potential_constant_expression_1): Likewise.  Avoid redundant errors.
1865         * method.c (process_subob_fn): Diagnose non-constexpr.
1866         (walk_field_subobs): Likewise.
1867         (synthesized_method_walk): Don't shortcut if we want diagnostics.
1868         (explain_implicit_non_constexpr): New.
1869         (defaulted_late_check): Use it.
1870         * call.c (build_cxx_call): Remember location.
1871
1872         * method.c (maybe_explain_implicit_delete): Use pointer_set
1873         instead of htab.
1874
1875         * class.c (finalize_literal_type_property): Update conditions.
1876         * method.c (defaulted_late_check): Set TYPE_HAS_CONSTEXPR_CTOR.
1877
1878         * tree.c (build_vec_init_expr): Don't add TARGET_EXPR.
1879         * typeck2.c (digest_init_r): Handle VEC_INIT_EXPR.
1880         * semantics.c (cxx_eval_vec_init_1): Correct type.
1881
1882         * init.c (build_value_init): Decide whether or not to zero-initialize
1883         based on user-providedness of default ctor, not any ctor.
1884         (build_value_init_noctor): Adjust assert.
1885
1886         DR 990
1887         * call.c (convert_like_real) [ck_user]: Handle value-initialization.
1888         (build_new_method_call_1): Likewise.
1889         * init.c (expand_default_init): Handle direct list-initialization
1890         of aggregates.
1891
1892 2011-06-27  Jakub Jelinek  <jakub@redhat.com>
1893
1894         * cp-tree.h (union lang_tree_node): Use it in chain_next expression.
1895
1896 2011-06-26  Jason Merrill  <jason@redhat.com>
1897
1898         PR c++/49528
1899         * semantics.c (potential_constant_expression_1): Check
1900         for non-literality rather than cleanup.
1901         (cxx_eval_constant_expression): Likewise.
1902
1903         PR c++/49528
1904         * semantics.c (potential_constant_expression_1): A TARGET_EXPR
1905         with a cleanup isn't constant.
1906         (cxx_eval_constant_expression): Likewise.
1907         * init.c (expand_default_init): Use maybe_constant_init.
1908
1909 2011-06-24  Jakub Jelinek  <jakub@redhat.com>
1910
1911         PR c++/46400
1912         * cp-tree.h (union lang_tree_node): Use TYPE_NEXT_VARIANT
1913         instead of TYPE_CHAIN for chain_next for types.
1914
1915 2011-06-23  Gabriel Charette  <gchare@google.com>
1916
1917         * name-lookup.h (cp_binding_level): Removed unused
1918         member names_size. Update all users.
1919
1920 2011-06-23  Jason Merrill  <jason@redhat.com>
1921
1922         * typeck2.c (build_functional_cast): Strip cv-quals for value init.
1923         * init.c (build_zero_init_1): Not here.
1924
1925         PR c++/35255
1926         * pt.c (resolve_overloaded_unification): Fix DR 115 handling.
1927
1928 2011-06-23  Paolo Carlini  <paolo.carlini@oracle.com>
1929
1930         PR c++/44625
1931         * decl2.c (build_anon_union_vars): Early return error_mark_node
1932         for a nested anonymous struct.
1933
1934 2011-06-23  Jason Merrill  <jason@redhat.com>
1935
1936         PR c++/49507
1937         * decl2.c (mark_used): Don't call synthesize_method for
1938         functions defaulted outside the class.
1939
1940         * optimize.c (maybe_clone_body): Set linkage flags before
1941         cgraph_same_body_alias.
1942
1943         PR c++/49440
1944         * class.c (set_linkage_according_to_type): Hand off to
1945         determine_visibility.
1946
1947         PR c++/49395
1948         * init.c (build_zero_init_1): Strip cv-quals from scalar types.
1949
1950         PR c++/36435
1951         * pt.c (most_specialized_instantiation): Do check return types.
1952
1953 2011-06-22  Jason Merrill  <jason@redhat.com>
1954
1955         PR c++/49260
1956         * call.c (build_call_a): Set cp_function_chain->can_throw here.
1957         (build_cxx_call): Not here.
1958
1959 2011-06-21  Jason Merrill  <jason@redhat.com>
1960
1961         PR c++/49172
1962         * decl.c (cp_finish_decl): Adjust init_const_expr_p for refs.
1963         (grokdeclarator): constexpr doesn't apply const for refs.
1964         * parser.c (cp_parser_initializer_clause): Don't call
1965         maybe_constant_value here.
1966         * call.c (initialize_reference): Handle constexpr.
1967
1968         PR c++/49482
1969         * semantics.c (maybe_add_lambda_conv_op): Call mark_exp_read for
1970         static fn parameters.
1971
1972         * call.c (add_builtin_candidates): Use cv_unqualified rather than
1973         TYPE_MAIN_VARIANT.
1974         * pt.c (tsubst_arg_types): Likewise.
1975         * except.c (build_throw): Use cv_unqualified.
1976
1977         PR c++/49418
1978         * call.c (cxx_type_promotes_to): Don't strip cv-quals.
1979         * semantics.c (lambda_return_type): Strip them here.
1980
1981 2011-06-21  Andrew MacLeod  <amacleod@redhat.com>
1982
1983         * semantics.c: Add sync_ or SYNC__ to builtin names.
1984
1985 2011-06-20  Jason Merrill  <jason@redhat.com>
1986
1987         PR c++/49216
1988         * init.c (build_vec_init): Don't try to use a CONSTRUCTOR when
1989         base is a pointer.
1990         * typeck2.c (process_init_constructor_array): Use {} for classes,
1991         too.
1992         * call.c (convert_like_real): Handle substitution failure.
1993
1994         PR c++/48138
1995         * pt.c (canonicalize_type_argument): New.
1996         (convert_template_argument, unify): Use it.
1997
1998         PR c++/47080
1999         * call.c (rejection_reason_code): Add rr_explicit_conversion.
2000         (print_z_candidate): Handle it.
2001         (explicit_conversion_rejection): New.
2002         (build_user_type_conversion_1): Reject an explicit conversion
2003         function that requires more than a qualification conversion.
2004
2005         PR c++/47635
2006         * decl.c (grokdeclarator): Don't set ctype to an ENUMERAL_TYPE.
2007
2008         PR c++/48138
2009         * tree.c (strip_typedefs): Use build_aligned_type.
2010
2011         PR c++/49205
2012         * call.c (sufficient_parms_p): Allow parameter packs too.
2013
2014         PR c++/43321
2015         * semantics.c (describable_type): Remove.
2016         * cp-tree.h: Likewise.
2017         * decl.c (cp_finish_decl): Don't call it.
2018         * init.c (build_new): Likewise.
2019         * parser.c (cp_parser_omp_for_loop): Likewise.
2020         * pt.c (tsubst_decl): Likewise.
2021         (do_auto_deduction): If we fail in a template, try again
2022         at instantiation time.
2023
2024         PR c++/43831
2025         * parser.c (cp_parser_lambda_introducer): Complain about redundant
2026         captures.
2027         * semantics.c (add_capture): Likewise.
2028         (register_capture_members): Clear IDENTIFIER_MARKED.
2029
2030 2011-06-17  Jason Merrill  <jason@redhat.com>
2031
2032         PR c++/49458
2033         * call.c (convert_class_to_reference_1): Allow binding function
2034         lvalue to rvalue reference.
2035
2036         PR c++/43912
2037         Generate proxy VAR_DECLs for better lambda debug info.
2038         * cp-tree.h (FUNCTION_NEEDS_BODY_BLOCK): Add lambda operator().
2039         (LAMBDA_EXPR_PENDING_PROXIES): New.
2040         (struct tree_lambda_expr): Add pending_proxies.
2041         * name-lookup.c (pushdecl_maybe_friend_1): Handle capture shadowing.
2042         (qualify_lookup): Use is_lambda_ignored_entity.
2043         * parser.c (cp_parser_lambda_expression): Don't adjust field names.
2044         Call insert_pending_capture_proxies.
2045         (cp_parser_lambda_introducer): Use this_identifier.
2046         (cp_parser_lambda_declarator_opt): Call the object parameter
2047         of the op() "__closure" instead of "this".
2048         (cp_parser_lambda_body): Call build_capture_proxy.
2049         * semantics.c (build_capture_proxy, is_lambda_ignored_entity): New.
2050         (insert_pending_capture_proxies, insert_capture_proxy): New.
2051         (is_normal_capture_proxy, is_capture_proxy): New.
2052         (add_capture): Add __ to field names here, return capture proxy.
2053         (add_default_capture): Use this_identifier, adjust to expect
2054         add_capture to return a capture proxy.
2055         (outer_lambda_capture_p, thisify_lambda_field): Remove.
2056         (finish_id_expression, lambda_expr_this_capture): Adjust.
2057         (build_lambda_expr): Initialize LAMBDA_EXPR_PENDING_PROXIES.
2058         * pt.c (tsubst_copy_and_build): Check that LAMBDA_EXPR_PENDING_PROXIES
2059         is null.
2060
2061         * name-lookup.c (pushdecl_maybe_friend_1): Do check for shadowing
2062         of artificial locals.
2063
2064         * parser.c (cp_parser_lambda_expression): Clear
2065         LAMBDA_EXPR_THIS_CAPTURE after parsing.
2066         * pt.c (tsubst_copy_and_build): Make sure it isn't set.
2067
2068         * cp-tree.h (struct tree_lambda_expr): Change common to typed.
2069         Move non-pointers to end of struct.
2070
2071         * pt.c (tsubst_decl): Handle DECL_VALUE_EXPR on reference.
2072         * decl.c (check_initializer): Handle DECL_VALUE_EXPR_P.
2073
2074         * semantics.c (finish_non_static_data_member): Preserve dereference
2075         in template.
2076
2077 2011-06-16  Jason Merrill  <jason@redhat.com>
2078
2079         PR c++/44160
2080         * parser.c (cp_parser_lambda_body): Share code between
2081         simple and complex cases instead of using cp_parser_function_body.
2082
2083         PR c++/45378
2084         * decl.c (check_initializer): Check narrowing.
2085
2086         PR c++/49229
2087         * pt.c (tsubst_decl) [FUNCTION_DECL]: Handle substitution failure.
2088
2089         PR c++/49251
2090         * semantics.c (finish_id_expression): Mark even dependent
2091         variables as used.
2092
2093         PR c++/49420
2094         * error.c (dump_template_argument): Don't try to omit default
2095         template args from an argument pack.
2096
2097 2011-06-15  H.J. Lu  <hongjiu.lu@intel.com>
2098
2099         PR c++/49412
2100         * decl.c (get_dso_handle_node): Mark __dso_handle hidden if
2101         assembler supports hidden visibility.
2102
2103 2011-06-14  Jason Merrill  <jason@redhat.com>
2104
2105         PR c++/49107
2106         * cp-tree.h (DEFERRED_NOEXCEPT_SPEC_P): Handle overload.
2107         * method.c (defaulted_late_check): Only maybe_instantiate_noexcept
2108         if the declaration had an exception-specifier.
2109         (process_subob_fn): Don't maybe_instantiate_noexcept.
2110         * pt.c (maybe_instantiate_noexcept): Handle overload.
2111         * typeck2.c (nothrow_spec_p_uninst): New.
2112         (merge_exception_specifiers): Add 'fn' parm.  Build up overload.
2113         * typeck.c (merge_types): Adjust.
2114
2115         * pt.c (deduction_tsubst_fntype): Don't save input_location.
2116         (maybe_instantiate_noexcept): Likewise.
2117
2118 2011-06-14  Joseph Myers  <joseph@codesourcery.com>
2119
2120         * Make-lang.in (cp/method.o): Update dependencies.
2121         * method.c: Include common/common-target.h.
2122         (use_thunk): Use targetm_common.have_named_sections.
2123
2124 2011-06-14  Steve Ellcey  <sje@cup.hp.com>
2125
2126         * decl.c (cxx_init_decl_processing): Use ptr_mode instead of Pmode.
2127
2128 2011-06-14  Jason Merrill  <jason@redhat.com>
2129
2130         * error.c (type_to_string): Print typedef-stripped version too.
2131
2132         PR c++/49117
2133         * call.c (perform_implicit_conversion_flags): Print source type as
2134         well as expression.
2135
2136         PR c++/49389
2137         * typeck2.c (build_m_component_ref): Preserve rvalueness.
2138
2139         PR c++/49369
2140         * class.c (build_base_path): Fix cv-quals in unevaluated context.
2141
2142         PR c++/49290
2143         * semantics.c (cxx_fold_indirect_ref): Local, more permissive copy
2144         of fold_indirect_ref_1.
2145         (cxx_eval_indirect_ref): Use it.
2146
2147 2011-06-11  Jan Hubicka  <jh@suse.cz>
2148
2149         * decl2.c (cp_write_global_declarations): Process aliases; look trhough
2150         same body aliases.
2151
2152 2011-06-10  Paolo Carlini  <paolo.carlini@oracle.com>
2153
2154         PR c++/41769
2155         * decl.c (grokdeclarator): Reject operator names in parameters.
2156
2157 2011-06-10  Jan Hubicka  <jh@suse.cz>
2158
2159         * decl2.c (clear_decl_external): New functoin.
2160         (cp_write_global_declarations): Use it.
2161
2162 2011-06-10  Paolo Carlini  <paolo.carlini@oracle.com>
2163
2164         * cp-tree.h (error_operand_p): Remove.
2165
2166 2011-06-09  David Krauss  <potswa@mac.com>
2167
2168         PR c++/49118
2169         * typeck2.c (build_x_arrow): Push fake template context
2170         to produce diagnostic on acyclic endless operator-> drill-down.
2171         * call.c (build_new_op): Change Boolean overload status
2172         value to a pointer to the overload function.
2173         * cp-tree.h: Likewise.
2174         * typeck.c: Likewise.
2175         * parser.c: Likewise.
2176         * decl2.c: Likewise.
2177         * pt.c: Likewise.
2178
2179 2011-06-09  Jason Merrill  <jason@redhat.com>
2180
2181         * semantics.c (maybe_constant_value): Handle overflowed input.
2182         (non_const_var_error): Handle non-constant DECL_INITIAL.
2183
2184         * pt.c (build_non_dependent_expr): Use fold_non_dependent_expr_sfinae.
2185
2186         * parser.c (cp_parser_constant_expression): Just return the
2187         non-constant expression.
2188
2189         * semantics.c (finish_compound_literal): Set TREE_HAS_CONSTRUCTOR.
2190
2191 2011-06-09  Paolo Carlini  <paolo.carlini@oracle.com>
2192
2193         PR c++/29003
2194         * decl.c (grokdeclarator): Reject operator names in typedefs.
2195
2196 2011-06-08  Jason Merrill  <jason@redhat.com>
2197
2198         PR c++/49107
2199         * cp-tree.def (DEFERRED_NOEXCEPT): New.
2200         * cp-tree.h (struct tree_deferred_noexcept): New.
2201         (DEFERRED_NOEXCEPT_PATTERN, DEFERRED_NOEXCEPT_ARGS): New.
2202         (DEFERRED_NOEXCEPT_SPEC_P): New.
2203         (enum cp_tree_node_structure_enum): Add TS_CP_DEFERRED_NOEXCEPT.
2204         (union lang_tree_node): Add tree_deferred_noexcept.
2205         (maybe_instantiate_noexcept): Declare.
2206         * cp-objcp-common.c (cp_tree_size): Handle DEFERRED_NOEXCEPT.
2207         * error.c (dump_exception_spec): Likewise.
2208         * cxx-pretty-print.c (pp_cxx_exception_specification): Likewise.
2209         * ptree.c (cxx_print_xnode): Likewise.
2210         * tree.c (cp_tree_equal): Likewise.
2211         * decl.c (cp_tree_node_structure): Likewise.
2212         (duplicate_decls): Call maybe_instantiate_noexcept.
2213         * except.c (build_noexcept_spec): Handle DEFERRED_NOEXCEPT.
2214         (nothrow_spec_p, type_noexcept_p, type_throw_all_p): Check
2215         DEFERRED_NOEXCEPT_SPEC_P.
2216         * typeck2.c (merge_exception_specifiers): Likewise.
2217         * decl2.c (mark_used): Call maybe_instantiate_noexcept.
2218         * method.c (process_subob_fn, defaulted_late_check): Likewise.
2219         * pt.c (tsubst_exception_specification): Add defer_ok parm.
2220         Build DEFERRED_NOEXCEPT.
2221         (maybe_instantiate_noexcept): New.
2222         (tsubst, regenerate_decl_from_template, instantiate_decl): Adjust.
2223         * search.c (check_final_overrider): Call maybe_instantiate_noexcept.
2224
2225         * semantics.c (potential_constant_expression_1): Handle destructor
2226         call.
2227
2228 2011-06-08  Jakub Jelinek  <jakub@redhat.com>
2229
2230         * cp-tree.h (struct tinst_level): Add chain_next GTY
2231         markup.
2232
2233 2011-06-08  Jason Merrill  <jason@redhat.com>
2234
2235         PR c++/49322
2236         * pt.c (deduction_tsubst_fntype): Don't free the tinst entry
2237         if a pending_template entry is pointing at it.
2238
2239 2011-06-07  Jason Merrill  <jason@redhat.com>
2240
2241         PR c++/48969
2242         PR c++/44175
2243         * error.c (subst_to_string): New.
2244         (cp_printer): Use it for 'S'.
2245         (print_instantiation_partial_context_line): Handle subst context.
2246         * pt.c (push_tinst_level): Handle subst context.
2247         (deduction_tsubst_fntype): Don't track specific substitutions.
2248         Use push_tinst_level.
2249
2250         * pt.c (deduction_tsubst_fntype): Use push_deduction_access_scope.
2251         (fn_type_unification): Don't call push_deduction_access_scope here.
2252
2253 2011-06-06  Jason Merrill  <jason@redhat.com>
2254
2255         PR c++/48780
2256         * typeck.c (perform_integral_promotions): Don't promote scoped enums.
2257         * call.c (convert_arg_to_ellipsis): Promote them here in old ABI.
2258
2259 2011-06-06  Nicola Pero  <nicola.pero@meta-innovation.com>,
2260
2261         PR obj-c++/48275
2262         * parser.c (cp_parser_objc_at_property_declaration): Allow setter
2263         and getter names to use all the allowed method names.
2264
2265 2011-06-06  Jason Merrill  <jason@redhat.com>
2266
2267         PR c++/49298
2268         * semantics.c (potential_constant_expression_1): Handle FIELD_DECL.
2269
2270         PR objc++/49221
2271         * decl.c (cp_finish_decl): Check DECL_FUNCTION_SCOPE_P rather than
2272         at_function_scope_p.
2273
2274         PR c++/49134
2275         * tree.c (build_target_expr): Deal with ARM ABI tweaks.
2276
2277 2011-06-04  Jonathan Wakely  <jwakely.gcc@gmail.com>
2278
2279         * init.c (build_delete): Warn when deleting type with non-virtual
2280         destructor.
2281
2282 2011-06-03  Jakub Jelinek  <jakub@redhat.com>
2283
2284         PR c++/49276
2285         * mangle.c (write_nested_name): Use CP_DECL_CONTEXT instead of
2286         DECL_CONTEXT.
2287
2288 2011-06-01  Jason Merrill  <jason@redhat.com>
2289
2290         * pt.c (build_non_dependent_expr): Remove special handling of
2291         REFERENCE_REF_P.
2292
2293         PR c++/44175
2294         * pt.c (template_args_equal): Handle one arg being NULL_TREE.
2295         (deduction_tsubst_fntype): Handle excessive non-infinite recursion.
2296
2297         PR c++/49253
2298         * typeck2.c (build_x_arrow): Don't use build_min_nt.
2299
2300 2010-05-31  Fabien ChĂȘne  <fabien@gcc.gnu.org>
2301
2302         PR c++/48010
2303         * name-lookup.c (supplement_binding_1): If the old binding was a
2304         type name, also check that the DECL actually refers to the same
2305         type or is not a type.
2306
2307 2011-05-31  Jason Merrill  <jason@redhat.com>
2308
2309         PR c++/44870
2310         * tree.c (lvalue_kind): Recurse on NON_DEPENDENT_EXPR.  Handle
2311         ARROW_EXPR, TYPEID_EXPR, and arbitrary class-valued expressions.
2312         (build_min_non_dep): Preserve reference refs.
2313         (build_min_non_dep_call_vec): Likewise
2314
2315 2011-05-30  Jakub Jelinek  <jakub@redhat.com>
2316
2317         PR c++/49223
2318         * semantics.c (finish_omp_clauses): Call require_complete_type
2319         even for copyin/copyprivate clauses.  Only call
2320         cxx_omp_create_clause_info if inner_type is COMPLETE_TYPE_P.
2321
2322 2011-05-28  Jason Merrill  <jason@redhat.com>
2323
2324         PR c++/46124
2325         * parser.c (cp_parser_lambda_expression): Improve error recovery.
2326         (cp_parser_lambda_declarator_opt): Likewise.  Return bool.
2327
2328 2011-05-27  Jason Merrill  <jason@redhat.com>
2329
2330         PR c++/47277
2331         * parser.c (cp_parser_pseudo_destructor_name): Commit to parse
2332         after we see the ~.
2333
2334         * mangle.c (mangle_decl_string): Make sure we don't try to mangle
2335         templates.
2336
2337         PR c++/47049
2338         * semantics.c (maybe_add_lambda_conv_op): Fix COMDAT sharing.
2339         * decl.c (start_preparsed_function): Don't call comdat_linkage for
2340         a template.
2341
2342         PR c++/47132
2343         * mangle.c (write_expression): Handle MODOP_EXPR.
2344
2345         PR c++/47277
2346         * parser.c (cp_parser_unqualified_id): Don't check
2347         constructor_name_p for enums.
2348
2349         PR c++/47687
2350         * pt.c (dependent_type_p_r): Avoid infinite recursion.
2351
2352         PR c++/48284
2353         * error.c (dump_expr) [COMPONENT_REF]: Use pp_cxx_dot
2354         with INDIRECT_REF of REFERENCE_TYPE.
2355
2356         PR c++/49181
2357         * pt.c (get_mostly_instantiated_function_type): Use push_access_scope.
2358
2359 2011-05-27  Nathan Froyd  <froydnj@codesourcery.com>
2360
2361         * cp-tree.h (building_stmt_tree): Delete.
2362         * decl.c (save_function_data): Tweak initializer for x_cur_stmt_list.
2363         (build_aggr_init_full_exprs): Call building_stmt_list_p
2364         instead of building_stmt_tree.
2365         (initialize_local_var): Likewise.
2366         (finish_function): Likewise.
2367         * decl2.c (finish_anon_union): Likewise.
2368         * init.c (begin_init_stmts): Likewise.
2369         (finish_init_stmts): Likewise.
2370         (expand_aggr_init_1): Likewise.
2371         * name-lookup.c (do_local_using_decl): Likewise.
2372         (do_namespace_alias): Likewise.
2373         (do_using_directive): Likewise.
2374         (cp_emit_debug_info_for_using): Likewise.
2375         * semantics.c (add_stmt): Assert that stmt_list_stack is non-empty.
2376
2377 2011-05-27  Paolo Carlini  <paolo.carlini@oracle.com>
2378
2379         PR c++/42056
2380         * typeck2.c (build_functional_cast): Complain early for invalid uses
2381         of 'auto' and set type to error_mark_node.
2382
2383 2011-05-26  Jason Merrill  <jason@redhat.com>
2384
2385         PR c++/47721
2386         * parser.c (cp_parser_member_declaration): Allow friend T.
2387         * friend.c (make_friend_class): Ignore non-classes.
2388         * pt.c (instantiate_class_template_1): Handle TEMPLATE_TYPE_PARM.
2389
2390         DR 1004
2391         * pt.c (convert_template_argument): Don't complain about using
2392         injected-class-name as template template argument.
2393
2394         PR c++/47956
2395         * decl.c (check_static_variable_definition): Now static.
2396         (cp_finish_decl): Call it here.
2397         (grokdeclarator): Not here.
2398         * pt.c (instantiate_class_template_1): Or here.
2399         * cp-tree.h: Don't declare it.
2400
2401 2011-05-26  Janis Johnson  <janis187@us.ibm.com>
2402             Nathan Froyd  <froydnj@codesourcery.com>
2403
2404         PR c++/2288
2405         PR c++/18770
2406         * name-lookup.h (enum scope_kind): Add sk_cond.
2407         * name-lookup.c (pushdecl_maybe_friend): Get scope of shadowed local.
2408         Detect and report error for redeclaration from for-init or if
2409         or switch condition.
2410         (begin_scope): Handle sk_cond.
2411         * semantics.c (begin_if_stmt): Use sk_cond.
2412         (begin switch_stmt): Ditto.
2413
2414 2011-05-26  Jason Merrill  <jason@redhat.com>
2415
2416         PR c++/48211
2417         * name-lookup.h (cp_class_binding): Make base a pointer.
2418         * name-lookup.c (new_class_binding): Adjust.
2419         (poplevel_class): Adjust.
2420
2421         PR c++/48424
2422         * decl.c (grokparms): Function parameter packs don't need to
2423         go at the end.
2424         * pt.c (type_unification_real): But they aren't deduced otherwise.
2425
2426 2011-05-25  Jason Merrill  <jason@redhat.com>
2427
2428         PR c++/48536
2429         * decl.c (build_enumerator): If incremented enumerator won't fit in
2430         previous integral type, find one it will fit in.
2431
2432         PR c++/48599
2433         * decl.c (create_array_type_for_decl): Complain about array of auto.
2434
2435         PR c++/44994
2436         PR c++/49156
2437         * error.c (dump_template_bindings): Set processing_template_decl
2438         for a partial instantiation.
2439
2440         PR c++/45401
2441         * decl.c (grokdeclarator): Don't change type when adding rvalue ref
2442         to another reference type.
2443
2444         PR c++/44311
2445         * decl.c (case_conversion): New.
2446         (finish_case_label): Use it.
2447
2448         * ptree.c (cxx_print_xnode): Handle ARGUMENT_PACK_SELECT.
2449
2450         PR c++/45698
2451         * pt.c (dependent_template_arg_p): See through ARGUMENT_PACK_SELECT.
2452
2453         PR c++/46005
2454         * decl.c (grokdeclarator): Complain about auto typedef.
2455
2456         PR c++/46245
2457         * decl.c (grokdeclarator): Complain later for auto parameter.
2458         * pt.c (splice_late_return_type): Handle use in a template
2459         type-parameter.
2460
2461         PR c++/46696
2462         * typeck.c (cp_build_modify_expr): Check DECL_DEFAULTED_FN.
2463
2464         PR c++/47184
2465         * parser.c (cp_parser_parameter_declaration): Recognize
2466         list-initialization.
2467         (cp_parser_direct_declarator): Check for the closing
2468         paren before parsing definitely.
2469
2470         PR c++/48935
2471         * parser.c (cp_parser_constructor_declarator_p): Don't check
2472         constructor_name_p for enums.
2473         (cp_parser_diagnose_invalid_type_name): Correct error message.
2474
2475         PR c++/45418
2476         * init.c (perform_member_init): Handle list-initialization
2477         of array of non-trivial class type.
2478
2479         PR c++/45080
2480         * pt.c (instantiate_class_template_1): Call maybe_add_lambda_conv_op.
2481         * semantics.c (lambda_function): Check COMPLETE_OR_OPEN_TYPE_P.
2482
2483         PR c++/48292
2484         * pt.c (tsubst_decl) [PARM_DECL]: Handle partial instantiation of
2485         function parameter pack.
2486         (tsubst_pack_expansion): Likewise.
2487
2488         * cp-objcp-common.c (cp_common_init_ts): TYPE_ARGUMENT_PACK has
2489         TS_COMMON.
2490
2491 2011-05-25  Jakub Jelinek  <jakub@redhat.com>
2492
2493         * cp-objcp-common.c (cp_common_init_ts): Mark CTOR_INITIALIZER
2494         as TS_TYPED.
2495
2496         PR c++/49136
2497         * semantics.c (cxx_eval_bit_field_ref): Handle the
2498         case when BIT_FIELD_REF doesn't cover only a single field.
2499
2500 2011-05-24  Jason Merrill  <jason@redhat.com>
2501
2502         PR c++/49042
2503         * pt.c (get_mostly_instantiated_function_type): Use
2504         push_deferring_access_checks rather than set flag_access_control.
2505
2506 2011-05-24  Nicola Pero  <nicola.pero@meta-innovation.com>,
2507
2508         * parser.c (cp_parser_objc_class_ivars): Deal gracefully with a
2509         syntax error in declaring an ObjC instance variable.
2510
2511 2011-05-24  Jason Merrill  <jason@redhat.com>
2512
2513         PR c++/48884
2514         * class.c (pushclass): Accept NULL argument.
2515         (popclass): Deal with popping null class.
2516         * pt.c (push_access_scope, pop_access_scope): Use them rather than
2517         push_to_top_level/pop_from_top_level.
2518         (push_deduction_access_scope, pop_defarg_context): New.
2519         (fn_type_unification): Use them.
2520         * name-lookup.c (lookup_name_real_1): Check current_class_type.
2521
2522 2011-05-24  Paolo Carlini  <paolo.carlini@oracle.com>
2523
2524         * decl.c (grokdeclarator): Use current_class_name.
2525
2526 2011-05-24  Joseph Myers  <joseph@codesourcery.com>
2527
2528         * Make-lang.in (GXX_OBJS): Remove prefix.o.
2529         (g++$(exeext)): Use libcommon-target.a.
2530         (CXX_C_OBJS): Remove prefix.o.
2531
2532 2011-05-23  Jason Merrill  <jason@redhat.com>
2533
2534         * pt.c (tsubst_copy_and_build): Use current_class_name.
2535
2536         PR c++/49102
2537         * call.c (convert_arg_to_ellipsis): Call force_rvalue.
2538
2539         PR c++/49105
2540         * typeck.c (cp_build_c_cast): Don't strip cv-quals when
2541         converting to reference.
2542         (build_static_cast_1): Update for glvalues.
2543
2544         PR c++/49105
2545         * typeck.c (build_const_cast_1): Handle rvalue references.
2546
2547         PR c++/47263
2548         * decl.c (use_eh_spec_block): Do use an EH spec block for a
2549         lambda op().
2550
2551         PR c++/49058
2552         * call.c (splice_viable): Be strict in templates.
2553
2554         PR c++/47336
2555         * error.c (dump_template_bindings): Suppress access control.
2556
2557         PR c++/47544
2558         * pt.c (instantiate_decl): Handle =default.
2559
2560         PR c++/48617
2561         * pt.c (invalid_nontype_parm_type_p): Allow DECLTYPE_TYPE.
2562
2563 2011-05-23  Nathan Froyd  <froydnj@codesourcery.com>
2564
2565         * call.c (build_over_call): Tweak call to check_function_arguments.
2566         * typeck.c (cp_build_function_call_vec): Likewise.
2567
2568 2011-05-23  Jonathan Wakely  <jwakely.gcc@gmail.com>
2569
2570         PR c++/18016
2571         * init.c (perform_member_init): Check for self-initialization.
2572
2573 2011-05-22  Jason Merrill  <jason@redhat.com>
2574
2575         PR c++/48647
2576         * typeck.c (composite_pointer_type_r): Return error_mark_node
2577         on error in SFINAE context.
2578
2579 2011-05-20  Jason Merrill  <jason@redhat.com>
2580
2581         PR c++/48945
2582         * decl.c (grokdeclarator): Don't add set const function-cv-qual
2583         for constexpr fns to memfn_quals, just add it to the type.
2584         (revert_static_member_fn): Don't complain about quals.
2585         (check_static_quals): New.
2586         (grokfndecl): Call it.
2587         (start_preparsed_function): Don't call revert_static_member_fn.
2588
2589         PR c++/48945
2590         * decl.c (revert_static_member_fn): Ignore const on constexpr fn.
2591
2592         PR c++/48780
2593         * cvt.c (type_promotes_to): Don't promote scoped enums.
2594
2595         PR c++/49066
2596         * decl.c (duplicate_decls): Preserve DECL_DELETED_FN.
2597
2598         PR c++/48873
2599         * tree.c (stabilize_expr): Fix typo.
2600
2601         DR 1073
2602         PR c++/49082
2603         * typeck.c (comp_except_specs): noexcept(false) is not compatible
2604         with throw(type-list).
2605         * typeck2.c (merge_exception_specifiers): noexcept(false)
2606         beats any more limited specification.
2607
2608         PR c++/24163
2609         PR c++/29131
2610         * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Avoid repeating
2611         unqualified lookup.
2612         * semantics.c (perform_koenig_lookup): Add complain parm.
2613         * cp-tree.h: Adjust.
2614         * parser.c (cp_parser_postfix_expression): Adjust.
2615         (cp_parser_perform_range_for_lookup): Adjust.
2616
2617 2011-05-20  Jason Merrill  <jason@redhat.com>
2618
2619         * semantics.c (finish_call_expr): SET_EXPR_LOCATION.
2620
2621 2011-05-20  Joseph Myers  <joseph@codesourcery.com>
2622
2623         * Make-lang.in (GXX_OBJS): Remove intl.o and version.o.
2624
2625 2011-05-19  Jakub Jelinek  <jakub@redhat.com>
2626
2627         PR c++/49043
2628         * decl.c (check_omp_return): Stop searching on sk_function_parms.
2629
2630         PR c++/48869
2631         * method.c (get_dtor, get_copy_ctor): Add COMPLAIN argument,
2632         pass it down to locate_fn_flags.
2633         * cp-tree.h (get_dtor, get_copy_ctor): Adjust prototypes.
2634         * semantics.c (cxx_omp_create_clause_info): Adjust callers.
2635         * cp-gimplify.c: Include splay-tree.h.
2636         (splay_tree_compare_decl_uid, omp_var_to_track,
2637         omp_cxx_notice_variable): New functions.
2638         (struct cp_genericize_omp_taskreg): New type.
2639         (struct cp_genericize_data): Add omp_ctx field.
2640         (cp_genericize_r): Attempt to determine implicitly determined
2641         firstprivate class type variables.
2642         (cp_genericize): Clear omp_ctx.
2643         * Make-lang.in (cp/cp-gimplify.o): Depend on $(SPLAY_TREE_H).
2644
2645 2011-05-18  Jason Merrill  <jason@redhat.com>
2646
2647         PR c++/48948
2648         PR c++/49015
2649         * class.c (finalize_literal_type_property): Do check
2650         for constexpr member functions of non-literal class.
2651         (finish_struct): Don't call check_deferred_constexpr_decls.
2652         * cp-tree.h: Don't declare it.
2653         (DECL_DEFERRED_CONSTEXPR_CHECK): Remove.
2654         * decl.c (grok_special_member_properties): Don't check it
2655         (grokfnedcl): Don't call validate_constexpr_fundecl.
2656         (start_preparsed_function): Do call it.
2657         * pt.c (tsubst_decl): Don't call it.
2658         (instantiate_class_template_1): Don't call
2659         check_deferred_constexpr_decls.
2660         * semantics.c (literal_type_p): Check for any incompleteness.
2661         (ensure_literal_type_for_constexpr_object): Likewise.
2662         (is_valid_constexpr_fn): Revert deferral changes.
2663         (validate_constexpr_fundecl): Likewise.
2664         (register_constexpr_fundef): Likewise.
2665         (check_deferred_constexpr_decls): Remove.
2666
2667 2011-05-16  Jason Merrill  <jason@redhat.com>
2668
2669         PR c++/48969
2670         * pt.c (deduction_tsubst_fntype): Use a VEC initially.
2671
2672 2011-05-15  Paolo Carlini  <paolo.carlini@oracle.com>
2673
2674         * cxx-pretty-print.c: Update comment.
2675         * semantics.c (trait_expr_value, finish_trait_expr):
2676         Reorder the cases.
2677         * parser.c (cp_parser_primary_expression): Likewise.
2678
2679 2011-05-15  Jonathan Wakely  <jwakely.gcc@gmail.com>
2680
2681         PR c++/48994
2682         * parser.c (cp_parser_perform_range_for_lookup): Call complete_type.
2683
2684 2011-05-13  Ville Voutilainen  <ville.voutilainen@gmail.com>
2685
2686         Implement final on class.
2687         * class.c (check_bases): Diagnose derivation from a final class.
2688         * cp-tree.h (lang_type_class): Add is_final and adjust dummy.
2689         (CLASSTYPE_FINAL): New.
2690         * parser.c (cp_parser_class_head): Parse class-virt-specifier, set
2691         CLASSTYPE_FINAL.
2692         * pt.c (instantiate_class_template_1): Copy CLASSTYPE_FINAL.
2693
2694 2011-05-13  Jason Merrill  <jason@redhat.com>
2695
2696         PR c++/48969
2697         * pt.c (deduction_tsubst_fntype): New.
2698         (fn_type_unification): Use it.
2699         (init_template_processing): Initialize hash table.
2700         (print_template_statistics): Print hash table stats.
2701
2702         * call.c (build_op_call): Use timevar_cond_start/stop.
2703         (build_user_type_conversion): Likewise.
2704
2705 2011-05-12  Jason Merrill  <jason@redhat.com>
2706
2707         * cp-tree.h (DECL_DEFERRED_CONSTEXPR_CHECK): New.
2708         * semantics.c (validate_constexpr_fundecl): Set it.
2709         (check_deferred_constexpr_decls): Clear it.
2710         (register_constexpr_fundef): Make sure it isn't set.
2711         * decl.c (grok_special_member_properties): Check it.
2712
2713 2011-05-11  Jason Merrill  <jason@redhat.com>
2714
2715         PR c++/48948
2716         * semantics.c (validate_constexpr_fundecl): Defer checking if
2717         an argument type is being defined.
2718         (is_valid_constexpr_fn): Add defer_ok parm.
2719         (cxx_eval_call_expression): Adjust.
2720         (check_deferred_constexpr_decls): New.
2721         (literal_type_p): Make sure type isn't being defined.
2722         (ensure_literal_type_for_constexpr_object): Handle type being defined.
2723         * cp-tree.h: Declare check_deferred_constexpr_decls.
2724         * decl.c (grokfndecl): Call validate_constexpr_fundecl here.
2725         (start_preparsed_function, cp_finish_decl): Not here.
2726         * class.c (finalize_literal_type_property): Don't call
2727         validate_constexpr_fundecl.
2728         (finish_struct): Call check_deferred_constexpr_decls.
2729         * pt.c (tsubst_decl): Call validate_constexpr_fundecl.
2730         (instantiate_class_template): Call check_deferred_constexpr_decls.
2731
2732         * semantics.c (validate_constexpr_fundecl): Check DECL_TEMPLATE_INFO
2733         rather than DECL_TEMPLATE_INSTANTIATION.
2734         (cxx_eval_call_expression): Likewise.
2735
2736         * semantics.c (register_constexpr_fundef): Add to hash table here.
2737         (validate_constexpr_fundecl): Not here.
2738
2739         * decl.c (grokdeclarator): Only set DECL_DECLARED_CONSTEXPR_P once.
2740
2741         * pt.c (build_non_dependent_expr): Don't check null_ptr_cst_p,
2742         do call maybe_constant_value in C++0x mode.
2743         * semantics.c (cxx_eval_constant_expression): Handle TEMPLATE_DECL.
2744
2745         PR c++/48745
2746         * pt.c (value_dependent_expr_p): Handle CONSTRUCTOR.
2747
2748 2011-05-11  Nathan Froyd  <froydnj@codesourcery.com>
2749
2750         * cp-tree.h (TYPENAME_TYPE_FULLNAME, TYPEOF_TYPE_EXPR): Use
2751         TYPE_VALUES_RAW.
2752         (UNDERLYING_TYPE_TYPE, DECLTYPE_TYPE_EXPR): Likewise.
2753         (DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P): Likewise.
2754         (TEMPLATE_TYPE_PARM_INDEX): Likewise.
2755
2756 2011-05-10  Jason Merrill  <jason@redhat.com>
2757
2758         PR c++/48930
2759         * class.c (type_build_ctor_call): New.
2760         * cp-tree.h: Declare it.
2761         * decl.c (check_initializer): Use it instead of
2762         TYPE_NEEDS_CONSTRUCTING.
2763         * init.c (build_value_init, build_value_init_noctor): Likewise.
2764         (perform_member_init, expand_aggr_init_1, build_new_1): Likewise.
2765         (build_vec_init): Likewise.
2766         * typeck2.c (process_init_constructor_array): Likewise.
2767         (process_init_constructor_record): Likewise.
2768
2769         PR c++/48736
2770         * pt.c (tsubst_copy_and_build): Handle substitution of a pack
2771         expansion producing another expansion.
2772
2773 2011-05-10  Ville Voutilainen  <ville.voutilainen@gmail.com>
2774
2775         Fixes for override/final.
2776         * class.c (check_for_override): Diagnose final on a nonvirtual
2777         member function, diagnose override for a virtual with no matching
2778         override. Don't fiddle around with DECL_VINDEX.
2779
2780 2011-05-10  Nathan Froyd  <froydnj@codesourcery.com>
2781
2782         * cp-tree.def (EXPR_PACK_EXPANSION): Add an operand.
2783         * cp-objcp-common.c (cp_common_init_ts): Mark it as TS_TYPED.
2784         * cp-tree.h (PACK_EXPANSION_PARAMETER_PACKS): Use the new
2785         operand of EXPR_PACK_EXPANSION.
2786         (cp_tree_operand_length): Declare.
2787         * tree.c (cp_tree_operand_length): Define.
2788         (cp_tree_equal): Call it.
2789         * pt.c (value_dependent_expr_P): Likewise.
2790         * mangle.c (write_expression): Likewise.
2791
2792 2011-05-09  Paolo Carlini  <paolo.carlini@oracle.com>
2793
2794         PR c++/48737
2795         PR c++/48744
2796         * decl.c (reshape_init): Take a complain parameter and do
2797         not call error if tf_error is not set.
2798         (check_initializer, reshape_init_r, reshape_init_array,
2799         reshape_init_array_1, reshape_init_vector, reshape_init_class):
2800         Adjust.
2801         * typeck2.c (digest_init_r): Take a complain parameter and
2802         pass it to convert_for_initialization.
2803         (digest_init, digest_init_flags, process_init_constructor_array,
2804         process_init_constructor_record, process_init_constructor_union,
2805         process_init_constructor, digest_init_r): Adjust.
2806         * init.c (expand_default_init, build_new_1): Likewise.
2807         * typeck.c (cp_build_modify_expr): Likewise.
2808         * decl2.c (grokfield): Likewise.
2809         * call.c (convert_like_real, convert_default_arg): Likewise.
2810         * semantics.c (finish_compound_literal): Pass complain to
2811         reshape_init and digest_init.
2812         * cp-tree.h: Adjust declarations.
2813
2814 2011-05-07  Fabien ChĂȘne  <fabien@gcc.gnu.org>
2815
2816         PR c++/48859
2817         * init.c (diagnose_uninitialized_cst_or_ref_member_1): stop the
2818         recursion if there is user defined constructor.
2819
2820 2011-05-09  Jason Merrill  <jason@redhat.com>
2821
2822         PR c++/34772
2823         * decl.c (initialize_local_var): Use DECL_INITIAL for simple
2824         initialization.
2825
2826 2011-05-08  Ville Voutilainen  <ville.voutilainen@gmail.com>
2827
2828         Implement final/override for member functions.
2829         * class.c (check_for_override): Check for DECL_OVERRIDE_P.
2830         * cp-tree.h (DECL_OVERRIDE_P, DECL_FINAL_P): New.
2831         (cp_virt_specifiers, enum virt_specifier): New.
2832         * decl.c (set_virt_specifiers): New.
2833         (grokdeclarator): Use them. Diagnose virt-specifiers on non-fields.
2834         * parser.c (make_call_declarator): add virt-specifiers parameter.
2835         (cp_parser_lambda_declarator_opt): Adjust.
2836         (cp_parser_direct_declarator): Likewise.
2837         (cp_parser_virt_specifier_seq_opt): New.
2838         * search.c (check_final_overrider): Diagnose attempts to override
2839         a final member function.
2840
2841 2011-05-09  Dodji Seketeli  <dodji@redhat.com>
2842
2843         PR c++/48574
2844         * class.c (fixed_type_or_null): Use type_dependent_p_push to test
2845         if the instance has a dependent initializer.
2846
2847 2011-05-08  Paolo Carlini  <paolo.carlini@oracle.com>
2848
2849         PR c++/48816
2850         * cxx-pretty-print.c (pp_cxx_template_declaration): Remove
2851         effectively unused variable.
2852
2853 2011-05-07  Eric Botcazou  <ebotcazou@adacore.com>
2854
2855         * name-lookup.h (global_bindings_p): Adjust prototype.
2856         * name-lookup.c (global_bindings_p): Return bool.
2857
2858 2011-05-06  Jason Merrill  <jason@redhat.com>
2859
2860         * decl.c (stabilize_save_expr_r): Set *walk_subtrees as
2861         appropriate.
2862
2863         PR c++/48909
2864         * semantics.c (cxx_eval_conditional_expression): Check
2865         integer_zerop instead.
2866         (potential_constant_expression_1): Likewise.
2867
2868         PR c++/48911
2869         * semantics.c (cxx_eval_array_reference): Handle implicit
2870         initializers.
2871
2872 2011-05-06  Nathan Froyd  <froydnj@codesourcery.com>
2873
2874         * cp-tree.h (type_of_this_parm, class_of_this_parm): New functions.
2875         * call.c (standard_conversion): Call class_of_this_parm.
2876         * cxx-pretty-print.c (pp_cxx_implicit_parameter_type): Likewise.
2877         (pp_cxx_direct_abstract_declarator): Likewise.
2878         * decl2.c (change_return_type): Likewise.
2879         (cp_reconstruct_complex_type): Likewise.
2880         * error.c (dump_type_suffix, dump_function_decl): Likewise.
2881         * mangle.c (write_function_type): Likewise.
2882         * pt.c (unify): Likewise.
2883         * typeck.c (merge_types, type_memfn_quals): Likewise.
2884         * decl.c (build_this_parm): Call type_of_this_parm.
2885
2886 2011-05-06  Dodji Seketeli  <dodji@redhat.com>
2887
2888         PR c++/48838
2889         * cp-tree.h (non_static_member_function_p): Declare new function.
2890         * tree.c (non_static_member_function_p): Define it.
2891         * semantics.c (finish_call_expr): Use it.
2892
2893 2011-05-05  Nathan Froyd  <froydnj@codesourcery.com>
2894
2895         * decl.c (finish_case_label): Omit the loc argument to
2896         build_case_label.
2897
2898 2011-05-05  Jason Merrill  <jason@redhat.com>
2899
2900         * cp-tree.h (REFERENCE_REF_P): Just check the type.
2901         * cvt.c (convert_from_reference): Adjust.
2902         * pt.c (build_non_dependent_expr): Adjust.
2903         * semantics.c (finish_offsetof): Adjust.
2904         * tree.c (lvalue_kind): Use it.
2905
2906         PR c++/48873
2907         * tree.c (stabilize_expr): Don't make gratuitous copies of classes.
2908
2909 2011-05-05  Eric Botcazou  <ebotcazou@adacore.com>
2910
2911         * decl.c (start_preparsed_function): Do not set
2912         dont_save_pending_sizes_p.
2913
2914 2011-05-05  Joseph Myers  <joseph@codesourcery.com>
2915
2916         * parser.c (cp_parser_objc_method_definition_list): Update call to
2917         objc_start_method_definition.
2918
2919 2011-05-04  Jason Merrill  <jason@redhat.com>
2920
2921         PR c++/48749
2922         * class.c (resolves_to_fixed_type_p): Don't look closely
2923         in templates.
2924
2925 2011-05-03  Paolo Carlini  <paolo.carlini@oracle.com>
2926
2927         PR c++/28501
2928         * call.c (add_builtin_candidate): Handle REALPART_EXPR and
2929         IMAGPART_EXPR.
2930
2931 2011-05-02  Lawrence Crowl  <crowl@google.com>
2932
2933         * decl.c: (push_local_name): Change TV_NAME_LOOKUP to start/stop.
2934         (poplevel): Refactor POP_TIMEVAR_AND_RETURN to plain code.
2935         Change TV_NAME_LOOKUP to start/stop.
2936         (define_label): Refactor timevar calls out to a wrapper function.
2937         Change TV_NAME_LOOKUP to start/stop.
2938         (xref_tag): Likewise.
2939         (lookup_label): Refactor timevar calls out to a wrapper function.
2940         Change TV_NAME_LOOKUP to start_cond/stop_cond.
2941
2942         * pt.c: (instantiate_class_template): Add a wrapper to push/pop new
2943         TV_TEMPLATE_INST.
2944         (instantiate_template): Add a wrapper to push/pop new TV_TEMPLATE_INST.
2945         (lookup_template_class): Refactor timevar calls out to a wrapper
2946         function.  Change use of TV_NAME_LOOKUP to TV_TEMPLATE_INST.
2947         (instantiate_decl): Change TV_PARSE to TV_TEMPLATE_INST.
2948
2949         * name-lookup.c: (store_bindings): Change TV_NAME_LOOKUP to start/stop.
2950         (poplevel_class): Change TV_NAME_LOOKUP to start_cond/stop_cond.
2951         (push_namespace): Likewise.
2952         (pop_nested_namespace): Likewise.
2953         (pushdecl_namespace_level): Likewise.
2954         (store_class_bindings): Likewise.
2955         (push_to_top_level): Likewise.
2956         (identifier_type_value): Refactor timevar calls out to a wrapper
2957         function.  Change TV_NAME_LOOKUP to start/stop.
2958         (find_binding): Likewise.
2959         (push_using_decl): Likewise.
2960         (lookup_arg_dependent): Likewise.
2961         (push_using_directive): Likewise.
2962         (qualified_lookup_using_namespace): Refactor POP_TIMEVAR_AND_RETURN
2963         to plain code.  Change TV_NAME_LOOKUP to start/stop.
2964         (lookup_type_current_level): Likewise.  Refactor inner return to
2965         break.
2966         (pushdecl_class_level): Refactor POP_TIMEVAR_AND_RETURN to plain
2967         code.  Change TV_NAME_LOOKUP to start_cond/stop_cond.
2968         (pushdecl_top_level_1): Likewise.
2969         (lookup_using_namespace): Likewise.
2970         (pushdecl_with_scope): Refactor timevar calls out to a wrapper
2971         function.  Change TV_NAME_LOOKUP to start_cond/stop_cond.
2972         (push_overloaded_decl): Likewise.
2973         (push_class_level_binding): Likewise.
2974         (namespace_binding): Likewise.
2975         (set_namespace_binding): Likewise.
2976         (supplement_binding): Likewise.
2977         (unqualified_namespace_lookup): Likewise.
2978         (lookup_name_real): Likewise.
2979         (lookup_type_scope): Likewise.
2980         (namespace_ancestor): Likewise.
2981         (lookup_name_innermost_nonclass_level): Likewise.
2982         (pushtag): Likewise.
2983         (pop_from_top_level): Likewise.
2984         (pushdecl_maybe_friend): Refactor timevar calls out to a wrapper
2985         function.  Change TV_NAME_LOOKUP to start_cond/stop_cond.  Wrap long
2986         lines.
2987         (add_using_namespace): Refactor timevar calls out to a wrapper
2988         function.  Change TV_NAME_LOOKUP to start_cond/stop_cond.  Bypass
2989         wrapper on call to self.
2990
2991         * decl2.c: (cp_write_global_declarations):  Add start/stop of
2992         new TV_PHASE_DEFERRED, TV_PHASE_CGRAPH, TV_PHASE_CHECK_DBGINFO.
2993         Remove push/pop calls to TV_VARCONST.
2994
2995         * parser.c: Add include of "timevar.h".
2996         (cp_parser_explicit_instantiation): Add push/pop calls to
2997         TV_TEMPLATE_INST.
2998         (cp_parser_enum_specifier): Add push/pop calls to new TV_PARSE_ENUM.
2999         (cp_parser_class_specifier): Add wrapper to add push/pop calls to
3000         TV_PARSE_STRUCT.
3001         (cp_parser_function_definition_from_specifiers_and_declarator): Add
3002         push/pop calls to new TV_PARSE_FUNC or TV_PARSE_INLINE.
3003         (cp_parser_late_parsing_for_member):  Add push/pop calls to
3004         new TV_PARSE_INMETH.
3005
3006         * call.c: Add include of "timevar.h".
3007         (convert_class_to_reference): Wrap and add push/pop calls to 
3008         TV_OVERLOAD.
3009         (build_op_call): Likewise.
3010         (build_conditional_expr): Likewise.
3011         (build_new_op): Likewise.
3012         (build_new_method_call): Likewise.
3013         (build_user_type_conversion): Reorganize to single return and add
3014         push/pop calls to TV_OVERLOAD.
3015         (perform_overload_resolution): Likewise.
3016
3017         * Make-lang.in: Add dependence of call.o and parser.o on $(TIMEVAR_H).
3018
3019 2011-05-02  Jason Merrill  <jason@redhat.com>
3020
3021         * tree.c (build_vec_init_expr): Take complain parm.
3022         (build_vec_init_elt): Likewise.  Free arg vector.
3023         (diagnose_non_constexpr_vec_init, build_array_copy): Adjust.
3024         * cp-tree.h (VEC_INIT_EXPR_SLOT): Use VEC_INIT_EXPR_CHECK.
3025         (VEC_INIT_EXPR_INIT): Likewise.
3026         Adjust build_vec_init_expr declaration.
3027         * init.c (perform_member_init): Adjust.
3028
3029         Revert:
3030         PR c++/40975
3031         * cp-tree.def (VEC_INIT_EXPR): Add third operand.
3032         * cp-tree.h (VEC_INIT_EXPR_NELTS): New.
3033         * cp-gimplify.c (cp_gimplify_expr) [VEC_INIT_EXPR]: Handle it.
3034         * tree.c (build_vec_init_expr): Handle getting pointer/nelts.
3035         (build_vec_init_elt): Don't expect an array type.
3036         (build_array_copy): Adjust.
3037         * init.c (perform_member_init): Adjust.
3038         (build_new_1): Use build_vec_init_expr.
3039
3040         PR c++/48834
3041         * tree.c (build_vec_init_expr): Set TREE_SIDE_EFFECTS.
3042         Protect an explicit target.
3043
3044         PR c++/48446
3045         * decl.c (stabilize_save_expr_r, stabilize_vla_size): New.
3046         (compute_array_index_type): Revert earlier 48446 changes.
3047         (grokdeclarator): Use stabilize_vla_size.
3048
3049 2011-05-02  Dmitry Gorbachev  <d.g.gorbachev@gmail.com>
3050             Eric Botcazou <ebotcazou@adacore.com>
3051
3052         * parser.c (cp_parser_init_declarator): Set pushed_scope to NULL_TREE
3053         instead of inappropriate zero values.
3054
3055 2011-05-02  Paolo Carlini  <paolo.carlini@oracle.com>
3056
3057         PR c++/47969
3058         * decl.c (compute_array_index_type): Check build_expr_type_conversion
3059         return value for NULL_TREE.
3060
3061 2011-04-29  Paolo Carlini  <paolo.carlini@oracle.com>
3062
3063         PR c++/48606
3064         * init.c (perform_member_init): Check build_value_init return
3065         value for error_mark_node.
3066
3067 2011-04-29  Diego Novillo  <dnovillo@google.com>
3068             Le-Chun Wu  <lcwu@google.com>
3069
3070         * call.c (conversion_null_warnings): Also handle assignments
3071         when warning about NULL conversions.
3072
3073 2011-04-29  Le-Chun Wu  <lcwu@google.com>
3074
3075         * cp-tree.h (LOOKUP_EXPLICIT_TMPL_ARGS): Define.
3076         * call.c (build_new_function_call): Set it for TEMPLATE_ID_EXPRs.
3077         (build_over_call): Use it to determine whether to emit a NULL
3078         warning for template function instantiations.
3079         (build_new_method_call): Set LOOKUP_EXPLICIT_TMPL_ARGS if
3080         EXPLICIT_TARGS is set.
3081
3082 2011-04-29  Nicola Pero  <nicola.pero@meta-innovation.com>,
3083             Mike Stump <mikestump@comcast.net>
3084
3085         * Make-lang.in ($(srcdir)/cp/cfns.h): Enable the dependency only
3086         in maintainer mode.  Use the --output-file option of gperf instead
3087         of > to prevent creating an empty cp/cfns.h when gperf is not
3088         available.
3089
3090 2011-04-28  Paolo Carlini  <paolo.carlini@oracle.com>
3091
3092         PR c++/48798
3093         * semantics.c (finish_base_specifier): cv-qualified base class
3094         is fine, per DR 484.
3095
3096 2011-04-28  Dodji Seketeli  <dodji@redhat.com>
3097
3098         PR c++/48656
3099         * semantics.c (finish_call_expr): Don't forget BASELINK nodes when
3100         considering call expressions involving a member function.
3101
3102 2011-04-28  Paolo Carlini  <paolo.carlini@oracle.com>
3103
3104         PR c++/48530
3105         * tree.c (build_cplus_new): Check build_target_expr return
3106         value for error_mark_node.
3107
3108 2011-04-28  Paolo Carlini  <paolo.carlini@oracle.com>
3109
3110         PR c++/48771
3111         * semantics.c (literal_type_p): Reference types are literal types,
3112         per the FDIS.
3113         (valid_type_in_constexpr_fundecl_p): Remove.
3114         (is_valid_constexpr_fn): Adjust.
3115
3116 2011-04-27  Jason Merrill  <jason@redhat.com>
3117
3118         PR libstdc++/48760
3119         Implement list-initialization of _Complex.
3120         * decl.c (reshape_init_r): Allow {real,imag} for _Complex.
3121         (check_initializer): Likewise.
3122         * call.c (build_complex_conv): New.
3123         (implicit_conversion): Call it.
3124         (convert_like_real): Handle it.
3125         * typeck2.c (check_narrowing): Handle it.
3126
3127         * init.c (build_vec_delete_1): Look for sfk_deleting_destructor to
3128         decide whether to delete.
3129         (build_vec_init): Pass sfk_complete_destructor.
3130
3131         PR c++/40975
3132         * cp-tree.def (VEC_INIT_EXPR): Add third operand.
3133         * cp-tree.h (VEC_INIT_EXPR_NELTS): New.
3134         * cp-gimplify.c (cp_gimplify_expr) [VEC_INIT_EXPR]: Handle it.
3135         * tree.c (build_vec_init_expr): Handle getting pointer/nelts.
3136         (build_vec_init_elt): Don't expect an array type.
3137         (build_array_copy): Adjust.
3138         * init.c (perform_member_init): Adjust.
3139         (build_new_1): Use build_vec_init_expr.
3140
3141         * class.c (resolve_address_of_overloaded_function): Don't
3142         change OVERLOAD to TREE_LIST.
3143         * pt.c (print_candidates_1): Remove nonsensical assert.
3144
3145         PR c++/48046
3146         * parser.c (cp_parser_diagnose_invalid_type_name): Commit
3147         to tentative parse sooner.
3148
3149 2011-04-26  Jason Merrill  <jason@redhat.com>
3150
3151         PR c++/42687
3152         * parser.c (cp_parser_primary_expression): Set *idk to
3153         CP_ID_KIND_NONE for a parenthesized identifier.
3154
3155         * ptree.c (cxx_print_type) [TYPENAME_TYPE]: Dump fullname.
3156         (cxx_print_identifier): Correct indentation.
3157
3158         PR c++/48530
3159         * decl.c (cxx_maybe_build_cleanup): Add complain parm.
3160         * tree.c (force_target_expr): Add complain parm.
3161         (build_target_expr_with_type): Likewise.
3162         (get_target_expr_sfinae): Split out.
3163         (build_vec_init_expr, bot_manip): Adjust.
3164         * init.c (build_vec_delete, build_vec_delete_1): Add complain parm.
3165         (build_delete, build_dtor_call): Likewise.
3166         (perform_direct_initialization_if_possible): Adjust.
3167         (build_vec_init): Handle error return.
3168         * cvt.c (force_rvalue): Add complain parm.
3169         Call build_special_member_call directly.
3170         * decl2.c (delete_sanity): Add complain parm.
3171         (build_cleanup): Adjust.
3172         * pt.c (tsubst_copy_and_build, tsubst_expr): Adjust.
3173         * semantics.c (finish_stmt_expr_expr): Adjust.
3174         (finish_compound_literal): Adjust.
3175         * parser.c (cp_parser_delete_expression): Adjust.
3176         * typeck2.c (build_functional_cast): Adjust.
3177         * cp-tree.h: Adjust.
3178
3179 2011-04-26  Martin Jambor  <mjambor@suse.cz>
3180
3181         * class.c (cp_fold_obj_type_ref): Remove.
3182         * cp-tree.h (cp_fold_obj_type_ref): Remove declaration.
3183
3184 2011-04-25  Paolo Carlini  <paolo.carlini@oracle.com>
3185
3186         * cp-tree.def: Add a new UNDERLYING_TYPE tree code.
3187         * cp-tree.h (enum cp_trait_kind): Add CPTK_UNDERLYING_TYPE, tidy.
3188         (UNDERLYING_TYPE_TYPE): Add.
3189         * cp-objcp-common.c (cp_common_init_ts): Mark UNDERLYING_TYPE
3190         as TS_COMMON.
3191         * parser.c (cp_lexer_next_token_is_decl_specifier_keyword,
3192         cp_parser_simple_type_specifier): Handle UNDERLYING_TYPE.
3193         (cp_parser_trait_expr): Deal with RID_UNDERLYING_TYPE; tidy.
3194         * semantics.c (finish_underlying_type): New.
3195         * typeck.c (structural_comptypes): Handle UNDERLYING_TYPE.
3196         * error.c (dump_type, dump_type_prefix, dump_type_suffix): Likewise.
3197         * cxx-pretty-print.c (p_cxx_type_id): Likewise.
3198         * tree.c (cp_walk_subtrees): Likewise.
3199         * pt.c (for_each_template_parm_r, tsubst, unify,
3200         dependent_type_p_r): Likewise.
3201         * mangle.c (write_type): Sorry for __underlying_type.
3202
3203 2011-04-25  Jason Merrill  <jason@redhat.com>
3204
3205         PR c++/48707
3206         * decl.c (type_dependent_init_p): New.
3207         (cp_finish_decl): Check it.
3208         * pt.c (any_type_dependent_elements_p): New.
3209         * cp-tree.h: Declare it.
3210
3211 2011-04-20  Jason Merrill  <jason@redhat.com>
3212
3213         * semantics.c (finish_compound_literal): Don't put an array
3214         with a dtor in a static variable.
3215
3216         * call.c (build_over_call): Handle trivial dtor.
3217
3218         * search.c (lookup_fnfields_slot): Call complete_type.
3219
3220         PR c++/48594
3221         * decl2.c (build_offset_ref_call_from_tree): Move
3222         non-dependency of object outside condition.
3223
3224         PR c++/48657
3225         * decl.c (cp_finish_decl): Simplify template handling.
3226
3227 2011-04-20  Jim Meyering  <meyering@redhat.com>
3228
3229         * tree.c (cxx_printable_name_internal): Remove useless if-before-free.
3230
3231 2011-04-19  Jason Merrill  <jason@redhat.com>
3232
3233         PR c++/46304
3234         * typeck.c (cp_build_binary_op): Fold COMPLEX_EXPR.
3235
3236         PR c++/45267
3237         * decl.c (duplicate_decls): Keep always_inline attribute
3238         in sync with DECL_DISREGARD_INLINE_LIMITS.
3239
3240 2011-04-18  Jason Merrill  <jason@redhat.com>
3241
3242         PR c++/48569
3243         * typeck2.c (build_functional_cast): Handle VOID_TYPE.
3244
3245         PR c++/48537
3246         * init.c (build_value_init): Handle UNION_TYPE the same.
3247
3248 2011-04-18  Jakub Jelinek  <jakub@redhat.com>
3249
3250         PR c++/48632
3251         * parser.c (cp_parser_omp_for_loop): Don't use cp_parser_omp_for_incr
3252         for type dependent pointers.
3253
3254 2011-04-18  Jim Meyering  <meyering@redhat.com>
3255
3256         * pt.c (type_unification_real): Fix typo in comment: s/in in/in/.
3257
3258 2011-04-17  Jan Hubicka  <jh@suse.cz>
3259
3260         * semantics.c (finish_goto_stmt): Do set UNINLINABLE flag on computed
3261         gotos.
3262
3263 2011-04-17  Jason Merrill  <jason@redhat.com>
3264
3265         PR c++/48531
3266         * typeck2.c (build_functional_cast): Disallow array type.
3267
3268         * tree.c (get_target_expr): Handle VEC_INIT_EXPR.
3269
3270 2011-04-17  Jan Hubicka  <jh@suse.cz>
3271
3272         * class.c (cp_fold_obj_type_ref): Drop vtable_method.
3273
3274 2011-04-15  Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
3275
3276         Implement N3271
3277         * parser.c (cp_convert_range_for): Split into
3278         cp_parser_perform_range_for_lookup.
3279         (cp_parser_perform_range_for_lookup): New.
3280         (cp_parser_range_for_member_function): New.
3281         (cp_parser_for_init_statement): Correct error message.
3282         * semantics.c (finish_call_expr): Accept COMPONENT_REF.
3283
3284 2011-04-14  Nicola Pero  <nicola.pero@meta-innovation.com>
3285
3286         * parser.c (cp_parser_objc_protocol_declaration): Updated for
3287         change from objc_declare_protocols() to objc_declare_protocol().
3288
3289 2011-04-14  Nathan Froyd  <froydnj@codesourcery.com>
3290
3291         PR objc++/48479
3292         * typeck.c (cxx_mark_addressable) [CONST_DECL]: Mark addressable
3293         and return immediately.
3294
3295 2011-04-14  Nathan Froyd  <froydnj@codesourcery.com>
3296
3297         * cp-tree.def (SWITCH_STMT): Add an extra operand.
3298         * cp-objcp-common.c (cp_common_init_ts): Mark it as TS_TYPED.
3299         * cp-tree.h (SWITCH_STMT_SCOPE): Define.
3300         * semantics.c (begin_switch__stmt): Pass scope to build_stmt.
3301         (finish_switch_stmt): Use SWITCH_STMT_SCOPE instead of TREE_CHAIN.
3302
3303 2011-04-14  Nathan Froyd  <froydnj@codesourcery.com>
3304
3305         * cp-tree.def (IF_STMT): Add an extra operand.
3306         * cp-objcp-common.c (cp_common_init_ts): Mark it as TS_TYPED.
3307         * cp-tree.h (IF_SCOPE): Define.
3308         * semantics.c (begin_if_stmt): Pass scope to build_stmt.
3309         (finish_if_stmt): Use IF_SCOPE instead of TREE_CHAIN.
3310
3311 2011-04-14  Nathan Froyd  <froydnj@codesourcery.com>
3312
3313         * cp-tree.def (FOR_STMT, RANGE_FOR_STMT): Add an extra operand.
3314         * cp-objcp-common.c (cp_common_init_ts): Mark them as TS_TYPED.
3315         * cp-tree.h (FOR_SCOPE, RANGE_FOR_SCOPE): Define.
3316         * semantics.c (begin_for_stmt): Pass an extra arg to build_stmt.
3317         Use FOR_SCOPE instead of TREE_CHAIN.
3318         (begin_range_for_stmt): Likewise, with RANGE_FOR_SCOPE.
3319         (finish_for_stmt): Likewise.
3320
3321 2011-04-14  Jason Merrill  <jason@redhat.com>
3322
3323         * parser.c (cp_parser_postfix_expression): Fix flags passed to
3324         build_new_method_call.
3325         * semantics.c (finish_call_expr): Likewise.
3326
3327         PR c++/48531
3328         * init.c (build_value_init_noctor): Check complain consistently.
3329
3330         PR c++/48557
3331         * typeck.c (cp_build_binary_op): Don't decay void operands.
3332
3333         PR c++/48446
3334         * decl.c (compute_array_index_type): Use get_temp_regvar instead
3335         of variable_size.
3336         * init.c (get_temp_regvar): No longer static.
3337         * cp-tree.h: Declare it.
3338
3339 2011-04-14  Nicola Pero  <nicola.pero@meta-innovation.com>
3340
3341         * parser.c (cp_parser_objc_class_declaration): Updated for change
3342         in objc_declare_class().
3343
3344 2011-04-14  Nathan Froyd  <froydnj@codesourcery.com>
3345
3346         * decl.c (poplevel): Use block_chainon.
3347
3348 2011-04-13  Jason Merrill  <jason@redhat.com>
3349
3350         PR c++/48594
3351         * decl2.c (build_offset_ref_call_from_tree): Fix calling a functor
3352         or pointer to (non-member) function.
3353
3354 2011-04-13  Jakub Jelinek  <jakub@redhat.com>
3355
3356         PR c++/48570
3357         * semantics.c (cxx_eval_array_reference): Handle reading from
3358         wchar_t, char16_t and char32_t STRING_CST.
3359
3360 2011-04-13  Dodji Seketeli  <dodji@redhat.com>
3361
3362         PR c++/48574
3363         * class.c (fixed_type_or_null): We cannot determine the dynamic
3364         type of a reference variable if its initializer is dependent.
3365
3366 2011-04-13  Jason Merrill  <jason@redhat.com>
3367
3368         PR c++/48581
3369         * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Don't complain about
3370         unqualified lookup failing if we're still in a template.
3371
3372 2011-04-12  Nathan Froyd  <froydnj@codesourcery.com>
3373
3374         * cp-lang.c (cp_init_ts): Call cp_common_init_ts.  Move
3375         tree_contains_struct initialization to...
3376         * cp-objcp-common.c (cp_common_init_ts): ...here.  Use MARK_*
3377         macros.
3378         * cp-objcp-common.h (cp_common_init_ts): Declare.
3379         * cp-tree.h (union lang_tree_node): Check for TS_COMMON before
3380         calling TREE_CHAIN.
3381
3382 2011-04-12  Nicola Pero  <nicola.pero@meta-innovation.com>
3383
3384         * parser.c (cp_parser_objc_message_expression): Updated call
3385         to objc_build_message_expr.
3386
3387 2011-04-12  Martin Jambor  <mjambor@suse.cz>
3388
3389         * class.c (cp_fold_obj_type_ref): Call cgraph_get_node instead of
3390         cgraph_get_create_node.
3391         * decl2.c (cp_write_global_declarations): Call cgraph_get_node
3392         instead of cgraph_get_create_node.
3393         * method.c (make_alias_for_thunk): Call cgraph_get_node
3394         instead of cgraph_get_create_node, assert it returns non-NULL.
3395         (use_thunk): Likewise.
3396         * optimize.c (maybe_clone_body): Call cgraph_same_body_alias only
3397         when flag_syntax_only is not set.  Call cgraph_get_node instead of
3398         cgraph_get_create_node.
3399         (maybe_clone_body): Call cgraph_get_node instead of
3400         cgraph_get_create_node.
3401
3402 2011-04-12  Martin Jambor  <mjambor@suse.cz>
3403
3404         * class.c (cp_fold_obj_type_ref): Call cgraph_get_create_node
3405         instead of cgraph_node.
3406         * decl2.c (cxx_callgraph_analyze_expr): Likewise.
3407         (cp_write_global_declarations): Likewise.
3408         * optimize.c (maybe_clone_body): Likewise.
3409         * semantics.c (maybe_add_lambda_conv_op): Likewise.
3410         * mangle.c (mangle_decl): Likewise.
3411         * method.c (make_alias_for_thunk): Likewise.
3412         (use_thunk): Likewise.
3413
3414 2011-04-11  Jason Merrill  <jason@redhat.com>
3415
3416         PR c++/48535
3417         * decl.c (cp_complete_array_type_or_error): New.
3418         * semantics.c (finish_compound_literal): Use it.
3419         * cp-tree.h: Declare it.
3420
3421         PR c++/48535
3422         * semantics.c (finish_compound_literal): Handle references.
3423
3424         PR c++/48535
3425         * semantics.c (finish_compound_literal): Take complain parm.
3426         (build_lambda_object): Adjust.
3427         * cp-tree.h: Adjust.
3428         * call.c (convert_like_real): Adjust.
3429         * decl.c (check_initializer): Adjust.
3430         * parser.c (cp_parser_postfix_expression): Adjust.
3431         (cp_parser_functional_cast): Adjust.
3432         * pt.c (tsubst_copy_and_build): Adjust.
3433         * typeck2.c (process_init_constructor_record): Adjust.
3434
3435         PR c++/48534
3436         * cvt.c (ocp_convert): Use build_nop to convert to underlying type
3437         of scoped enum.
3438
3439         PR c++/48523
3440         * tree.c (maybe_dummy_object): Use build_x_indirect_ref rather
3441         than cp_build_indirect_ref.
3442
3443         PR c++/48457, Core 1238
3444         * call.c (reference_binding): Allow rvalue reference to bind to
3445         function lvalue.
3446         * tree.c (lvalue_kind): Functions are always lvalues.
3447
3448 2011-04-07  Jason Merrill  <jason@redhat.com>
3449
3450         PR c++/48500
3451         * semantics.c (potential_constant_expression_1) [CALL_EXPR]: Check
3452         arguments even if we don't know the function.
3453
3454         PR c++/48481
3455         * tree.c (build_overload): Allow an unwrapped FUNCTION_DECL
3456         at the end of the chain.
3457         * pt.c (dependent_template_p): Use OVL_CURRENT/NEXT.
3458         (iterative_hash_template_arg): Likewise.
3459
3460         PR c++/48481
3461         * cp-tree.h (OVL_ARG_DEPENDENT): New.
3462         * name-lookup.c (add_function): Set it.
3463         * semantics.c (finish_call_expr): Free OVERLOADs if it's set.
3464
3465         PR c++/48481
3466         * call.c (build_user_type_conversion_1): Use lookup_fnfields_slot.
3467         Release unused vector.
3468
3469         PR c++/48451
3470         * pt.c (fn_type_unification): Don't clear incomplete pack flag.
3471         (type_unification_real): Clear it here instead.
3472
3473         PR c++/48468
3474         * except.c (build_noexcept_spec): Propagate error_mark_node.
3475         (finish_noexcept_expr): Likewise.
3476
3477         PR c++/48452
3478         * typeck.c (build_x_compound_expr_from_list): Return error_mark_node
3479         in SFINAE context.
3480
3481         PR c++/48450