OSDN Git Service

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