re PR c++/51413 (Broken diagnostic with __builtin_offsetof)
[gcc.git] / gcc / cp / ChangeLog
1 2013-06-14 Paolo Carlini <paolo.carlini@oracle.com>
2
3 PR c++/51413
4 * semantics.c (finish_offsetof): Handle INDIRECT_REF as expr.
5
6 2013-06-14 Paolo Carlini <paolo.carlini@oracle.com>
7
8 PR c++/57599
9 * rtti.c (build_dynamic_cast_1): In case of cast to an unambiguous
10 accessible base simply forward to build_static_cast.
11
12 2013-06-12 Paolo Carlini <paolo.carlini@oracle.com>
13
14 PR c++/38958
15 * decl.c (poplevel): For the benefit of -Wunused-variable see
16 through references.
17
18 2013-06-12 Paolo Carlini <paolo.carlini@oracle.com>
19
20 * parser.c (cp_parser_nested_name_specifier_opt): Fix typo in comment.
21
22 2013-06-12 Paolo Carlini <paolo.carlini@oracle.com>
23
24 PR c++/42021
25 * parser.c (cp_parser_nested_name_specifier_opt): Avoid emitting
26 again diagnostic already emitted by cp_parser_lookup_name.
27
28 2013-06-11 Jan Hubicka <jh@suse.cz>
29
30 PR c++/57551
31 * cp/pt.c (mark_decl_instantiated): Do not export explicit
32 instantiations of anonymous namespace templates.
33
34 2013-06-10 Jason Merrill <jason@redhat.com>
35
36 * name-lookup.c (add_decl_to_level): Add decls in an anonymous
37 namespace to static_decls.
38
39 2013-06-07 Sriraman Tallam <tmsriram@google.com>
40
41 PR c++/57548
42 * call.c (build_over_call): Check if current_function_decl is
43 NULL.
44
45 2013-06-07 Paolo Carlini <paolo.carlini@oracle.com>
46
47 PR c++/53658
48 * pt.c (lookup_template_class_1): Consistently use TYPE_MAIN_DECL,
49 not TYPE_STUB_DECL, to access the _DECL for a _TYPE.
50
51 2013-06-06 Jason Merrill <jason@redhat.com>
52
53 PR c++/55520
54 * semantics.c (add_capture): Diagnose capture of variable-size
55 type that is not a C++1y array of runtime bound.
56
57 * decl.c (grokdeclarator): Keep a decl with error type.
58 (grokfield, grokbitfield): Likewise.
59 * pt.c (instantiate_class_template_1): Likewise.
60 (tsubst_decl): Drop redundant error.
61 * class.c (walk_subobject_offsets): Handle erroneous fields.
62 * typeck2.c (process_init_constructor_record): Likewise.
63
64 2013-06-05 Paolo Carlini <paolo.carlini@oracle.com>
65
66 PR c++/51908
67 * parser.c (cp_parser_postfix_expression [RID_*CAST]): Set
68 parser->in_type_id_in_expr_p before calling cp_parser_type_id.
69
70 2013-06-03 Jan Hubicka <jh@suse.cz>
71
72 * decl2.c (maybe_make_one_only): Use forced_by_abi instead of
73 mark_decl_referenced.
74 (mark_needed): Likewise.
75
76 2013-06-03 Jason Merrill <jason@redhat.com>
77
78 * class.c (mark_type_abi_tags): New.
79 (check_abi_tags): Use it.
80
81 2013-06-03 Paolo Carlini <paolo.carlini@oracle.com>
82
83 PR c++/57419
84 * decl2.c (mark_used): Add overload taking a tsubst_flags_t too.
85 * semantics.c (finish_qualified_id_expr): Use it.
86 * cp-tree.h: Update.
87
88 2013-06-01 Jan Hubicka <jh@suse.cz>
89
90 * decl2.c (cp_write_global_declarations): Replace same_body_alias
91 by symbol.cpp_implicit_alias.
92
93 2013-05-30 Jason Merrill <jason@redhat.com>
94
95 PR c++/57404
96 * cp-lang.c (cp_classify_record): Handle structs without
97 TYPE_LANG_SPECIFIC.
98
99 PR c++/52377
100 * class.c (common_enclosing_class): New.
101 * cp-tree.h: Declare it.
102 * init.c (sort_mem_initializers): Don't splice out a union member
103 with an NSDMI.
104
105 2013-05-29 Jan Hubicka <jh@suse.cz>
106
107 * tree.c (cp_fix_function_decl_p): Update for new symtab flags.
108 * decl2.c )var_finalized_p, cp_write_global_declarations): Likewise.
109
110 2013-05-25 Paolo Carlini <paolo.carlini@oracle.com>
111
112 PR c++/25666
113 * decl2.c (check_classfn): Check for destructors declared as member
114 templates.
115
116 2013-05-24 Jason Merrill <jason@redhat.com>
117
118 PR c++/56971
119 * pt.c (any_template_arguments_need_structural_equality_p): A
120 TEMPLATE_TEMPLATE_PARM can require structural type comparison.
121
122 2013-05-24 Paolo Carlini <paolo.carlini@oracle.com>
123
124 PR c++/19618
125 * class.c (check_bitfield_decl): Warn for bool and enum bitfields
126 with width exceeding the type.
127
128 2013-05-24 Jason Merrill <jason@redhat.com>
129
130 PR c++/57391
131 * semantics.c (cxx_eval_constant_expression): Handle FMA_EXPR.
132 (cxx_eval_trinary_expression): Rename from cxx_eval_vec_perm_expr.
133
134 2013-05-23 Jason Merrill <jason@redhat.com>
135
136 PR c++/57388
137 * tree.c (build_ref_qualified_type): Clear
138 FUNCTION_RVALUE_QUALIFIED for lvalue ref-qualifier.
139
140 2013-05-22 Jason Merrill <jason@redhat.com>
141
142 PR c++/56930
143 * call.c (convert_like_real): Use cp_convert_and_check.
144 * cvt.c (cp_convert_and_check): Use maybe_constant_value.
145 * semantics.c (cxx_eval_constant_expression): Handle LTGT_EXPR.
146 (potential_constant_expression_1): Handle OMP_ATOMIC*.
147
148 PR c++/56915
149 * semantics.c (maybe_add_lambda_conv_op): Give up if the call op
150 isn't defined.
151
152 2013-05-22 Paolo Carlini <paolo.carlini@oracle.com>
153
154 PR c++/57352
155 * parser.c (cp_parser_conversion_type_id): Set up
156 parser->type_definition_forbidden_message before calling
157 cp_parser_type_specifier_seq.
158
159 2013-05-22 Paolo Carlini <paolo.carlini@oracle.com>
160
161 PR c++/57211
162 * method.c (defaultable_fn_check): Avoid do_warn_unused_parameter
163 warnings about defaulted functions.
164
165 2013-05-21 Paolo Carlini <paolo.carlini@oracle.com>
166
167 * call.c (build_conditional_expr_1): Add location_t parameter.
168 (build_conditional_expr): Likewise.
169 * typeck.c (rationalize_conditional_expr, cp_build_array_ref,
170 get_member_function_from_ptrfunc, build_x_conditional_expr,
171 cp_build_modify_expr): Update.
172 * init.c (build_new_1): Likewise.
173 * cp-tree.h: Update declaration.
174
175 2013-05-20 Jason Merrill <jason@redhat.com>
176
177 PR c++/57016
178 * pt.c (instantiation_dependent_r) [TRAIT_EXPR]: Only check type2
179 if there is one.
180
181 PR c++/57102
182 * decl.c (fndecl_declared_return_type): Also look in
183 DECL_SAVED_FUNCTION_DATA.
184
185 2013-05-20 Paolo Carlini <paolo.carlini@oracle.com>
186
187 PR c++/12288
188 * parser.c (cp_parser_parameter_declaration): Check return value
189 of cp_parser_parse_and_diagnose_invalid_type_name.
190
191 2013-05-20 Jason Merrill <jason@redhat.com>
192
193 PR c++/57319
194 * class.c (vbase_has_user_provided_move_assign): New.
195 * method.c (synthesized_method_walk): Check it.
196 * cp-tree.h: Declare it.
197
198 PR c++/57325
199 * tree.c (build_cplus_array_type): Copy layout info if element
200 type is complete.
201
202 2013-05-20 Paolo Carlini <paolo.carlini@oracle.com>
203
204 PR c++/23608
205 * call.c (build_new_op_1): Propagate loc to cp_build_binary_op.
206
207 2013-05-20 Jason Merrill <jason@redhat.com>
208
209 PR c++/57317
210 * decl2.c (determine_visibility): Use PRIMARY_TEMPLATE_P to decide
211 whether a template has its own args.
212
213 2013-05-20 Paolo Carlini <paolo.carlini@oracle.com>
214
215 PR c++/57327
216 * pt.c (unify_no_common_base): Swap arg and parm arguments to inform.
217
218 2013-05-20 Paolo Carlini <paolo.carlini@oracle.com>
219
220 PR c++/10207
221 * parser.c (cp_parser_postfix_expression): Use cp_parser_braced_list
222 instead of cp_parser_initializer_list for compound-literals.
223
224 2013-05-20 Marc Glisse <marc.glisse@inria.fr>
225
226 PR c++/57175
227 * typeck.c (check_return_expr): Reverse the alignment comparison.
228
229 2013-05-17 Paolo Carlini <paolo.carlini@oracle.com>
230
231 PR c++/18126
232 * parser.c (cp_parser_sizeof_operand): As a GNU Extension, parse
233 correctly sizeof compound-literal; update comments.
234
235 2013-05-16 Marc Glisse <marc.glisse@inria.fr>
236
237 * call.c (build_conditional_expr_1): Use cp_build_binary_op
238 instead of directly calling fold_build2.
239
240 2013-05-16 Jason Merrill <jason@redhat.com>
241
242 * Make-lang.in (cc1plus$(exeext)): Use link mutex.
243
244 PR c++/57279
245 * decl.c (grokdeclarator): Allow member function qualifiers in
246 TYPENAME context in C++11 mode.
247
248 2013-05-16 Dodji Seketeli <dodji@redhat.com>
249
250 PR c++/56782 - Regression with empty pack expansions
251 * pt.c (use_pack_expansion_extra_args_p): When at least a
252 parameter pack has an empty argument pack, and another parameter
253 pack has no argument pack at all, use the PACK_EXPANSION_EXTRA
254 mechanism.
255
256 2013-05-15 Paolo Carlini <paolo.carlini@oracle.com>
257
258 * name-lookup.c (pushdecl_maybe_friend_1): Replace pairs of
259 warning_at and permerror with warning_at/inform and permerror/
260 inform, respectively.
261
262 2013-05-15 Paolo Carlini <paolo.carlini@oracle.com>
263
264 PR c++/31952
265 * name-lookup.c (pushdecl_maybe_friend_1): Diagnose illegal
266 redeclarations.
267
268 2013-05-14 Jason Merrill <jason@redhat.com>
269
270 PR c++/57243
271 * parser.c (cp_parser_range_for): Call complete_type.
272
273 PR c++/57041
274 * pt.c (tsubst_copy_and_build): Don't recur into a designator.
275
276 2013-05-14 Paolo Carlini <paolo.carlini@oracle.com>
277
278 PR c++/53903
279 * method.c (defaulted_late_check): Check for compatible exception
280 specification out of class explicitly defaulted functions too.
281
282 2013-05-14 Jason Merrill <jason@redhat.com>
283
284 PR c++/56998
285 * semantics.c (potential_constant_expression_1): Make sure the
286 called function is potentially constant.
287 * call.c (null_ptr_cst_p): Revert earlier change.
288
289 2013-05-13 Jason Merrill <jason@redhat.com>
290
291 PR c++/56998
292 * call.c (null_ptr_cst_p): An expression with side-effects can't
293 be a C++03 null pointer constant.
294
295 PR c++/57041
296 * decl.c (reshape_init_class): Handle error_mark_node.
297
298 PR c++/57254
299 * typeck.c (merge_types): Propagate ref-qualifier
300 in METHOD_TYPE case.
301
302 PR c++/57253
303 * decl.c (grokdeclarator): Apply ref-qualifier
304 in the TYPENAME case.
305
306 PR c++/57252
307 * decl.c (decls_match): Compare ref-qualifiers.
308
309 2013-05-10 Jason Merrill <jason@redhat.com>
310
311 PR c++/57196
312 * pt.c (convert_template_argument): Use dependent_template_arg_p,
313 not uses_template_parms.
314
315 PR c++/57047
316 * semantics.c (cxx_fold_indirect_ref): Fix thinko.
317
318 PR c++/55149
319 * semantics.c (add_capture): Error rather than abort on copy
320 capture of VLA.
321 * typeck.c (maybe_warn_about_returning_address_of_local): Don't
322 warn about capture proxy.
323
324 2013-05-09 Jason Merrill <jason@redhat.com>
325
326 * decl.c (cp_finish_decl): Only check VLA bound in C++1y mode.
327
328 PR c++/57222
329 * pt.c (lookup_template_class_1): Handle getting a template
330 template parameter as D1.
331
332 N3639 C++1y VLA diagnostics
333 * decl.c (grokdeclarator): Complain about reference, pointer, or
334 typedef to VLA.
335 (create_array_type_for_decl): Complain about array of VLA.
336 * pt.c (tsubst): Likewise.
337 * rtti.c (get_tinfo_decl): Talk about "array of runtime bound".
338 * semantics.c (finish_decltype_type): Complain about decltype of VLA.
339 * typeck.c (cp_build_addr_expr_1): Complain about VLA.
340 (cxx_sizeof_or_alignof_type): Likewise.
341
342 N3639 C++1y VLA support
343 * decl.c (compute_array_index_type): Allow VLAs in C++1y mode.
344 (check_array_initializer): Allow VLA init.
345 (reshape_init_array_1): Adjust.
346 (cp_finish_decl): Check for invalid VLA length.
347 * typeck2.c (process_init_constructor_array): Adjust.
348 (store_init_value): Use build_vec_init for VLAs.
349 * semantics.c (add_capture): Capture VLA as ptr+len.
350 (vla_capture_type): New.
351 (build_capture_proxy): Rebuild the VLA.
352 * typeck.c (build_simple_component_ref): Split out from...
353 (build_ptrmemfunc_access_expr): ...here.
354 * tree.c (array_of_runtime_bound_p): New.
355 * init.c (throw_bad_array_length): New.
356 (build_vec_init): Use it.
357 * parser.c (cp_convert_range_for): When iterating over a VLA,
358 use it directly rather than bind a reference.
359 * cp-tree.h: Declare new functions.
360
361 2013-05-08 Jason Merrill <jason@redhat.com>
362
363 * except.c (is_admissible_throw_operand_or_catch_parameter): Check
364 variably_modified_type_p.
365 (expand_start_catch_block): Mark the typeinfo used here.
366 * semantics.c (finish_handler_parms): Not here.
367
368 * error.c (dump_type_suffix): Try harder on VLA length.
369
370 Core 624/N2932
371 * init.c (throw_bad_array_new_length): New.
372 (build_new_1): Use it. Don't warn about braced-init-list.
373 (build_vec_init): Use it.
374 * call.c (build_operator_new_call): Use it.
375
376 PR c++/57068
377 * decl.c (grokdeclarator): Warn about ref-qualifiers here.
378 * parser.c (cp_parser_ref_qualifier_seq_opt): Not here.
379 * error.c (maybe_warn_cpp0x): s/0x/11/.
380
381 2013-05-08 Paolo Carlini <paolo.carlini@oracle.com>
382
383 PR c++/51226
384 * parser.c (cp_parser_enum_specifier): Handle nested_name_specifier
385 == error_mark_node.
386
387 2013-05-06 Marc Glisse <marc.glisse@inria.fr>
388
389 * typeck.c (cp_build_binary_op): Call save_expr before
390 build_vector_from_val.
391
392 2013-05-06 Paolo Carlini <paolo.carlini@oracle.com>
393
394 PR c++/57183
395 * decl.c (cp_finish_decl): After do_auto_deduction copy the
396 qualifers with cp_apply_type_quals_to_decl.
397
398 2013-05-05 Paolo Carlini <paolo.carlini@oracle.com>
399
400 * pt.c (convert_nontype_argument): Add missing whitespace in
401 error message.
402
403 2013-05-04 Paolo Carlini <paolo.carlini@oracle.com>
404
405 PR c++/53745
406 * decl.c (build_enumerator): Improve error message.
407
408 2013-05-03 Paolo Carlini <paolo.carlini@oracle.com>
409
410 PR c++/14283
411 * parser.c (cp_parser_diagnose_invalid_type_name): Improve error
412 messages for template types and fix column numbers.
413
414 2013-05-01 Paolo Carlini <paolo.carlini@oracle.com>
415
416 PR c++/57132
417 * pt.c (tsubst_copy_and_build, MODOP_EXPR): Increase / decrease
418 c_inhibit_evaluation_warnings around build_x_modify_expr call.
419
420 2013-05-01 Paolo Carlini <paolo.carlini@oracle.com>
421
422 PR c++/57092
423 * semantics.c (finish_decltype_type): Handle instantiated template
424 non-type arguments.
425
426 2013-04-28 Paolo Carlini <paolo.carlini@oracle.com>
427
428 PR c++/56450
429 * semantics.c (finish_decltype_type): Handle COMPOUND_EXPR.
430
431 2013-04-26 Jakub Jelinek <jakub@redhat.com>
432
433 * error.c (cp_print_error_function): Adjust file_name_as_prefix
434 caller.
435
436 2013-04-25 Jason Merrill <jason@redhat.com>
437
438 PR c++/56859
439 * typeck.c (cxx_alignas_expr): Handle value-dependence properly.
440
441 PR c++/50261
442 * init.c (perform_member_init): Call reshape_init.
443
444 2013-04-24 Jason Merrill <jason@redhat.com>
445
446 PR c++/53721
447 * parser.c (cp_parser_postfix_dot_deref_expression): Fix thinko.
448
449 2013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
450
451 * typeck.c (cxx_sizeof_or_alignof_type): Change -Wpointer-arith
452 pedwarn to simply use OPT_Wpointer_arith.
453 (cp_build_unary_op): Likewise.
454
455 2013-04-24 Jason Merrill <jason@redhat.com>
456
457 N3648: init-captures are named.
458 * semantics.c (add_capture): Don't prepend "__" to init-captures.
459 (build_capture_proxy): Adjust.
460 * error.c (dump_simple_decl): Check DECL_NORMAL_CAPTURE_P.
461
462 N3648: Allow braced and parenthesized initializers.
463 * parser.c (cp_parser_lambda_introducer): Use cp_parser_initializer.
464 * pt.c (tsubst) [DECLTYPE_TYPE]: Handle DECLTYPE_FOR_INIT_CAPTURE.
465 * semantics.c (lambda_capture_field_type): Use do_auto_deduction.
466 (add_capture): Collapse a parenthesized initializer into a single
467 expression.
468 * cp-tree.h (DECLTYPE_FOR_INIT_CAPTURE): New.
469
470 2013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
471
472 PR c++/56970
473 * init.c (build_offset_ref): Add tsubst_flags_t parameter.
474 * semantics.c (finish_qualified_id_expr): Likewise.
475 (finish_id_expression): Update.
476 * typeck.c (cp_build_addr_expr_1): Likewise.
477 * pt.c (tsubst_qualified_id, resolve_nondeduced_context): Likewise.
478 * cp-tree.h: Update declarations.
479
480 2013-04-22 Jason Merrill <jason@redhat.com>
481
482 Core 1586
483 * parser.c (cp_parser_unqualified_id): Handle ~auto.
484 (cp_parser_pseudo_destructor_name): Likewise.
485 (cp_parser_postfix_dot_deref_expression): Adjust.
486 (cp_lexer_nth_token_is_keyword): New.
487 * semantics.c (finish_pseudo_destructor_expr): Handle ~auto.
488 * typeck.c (lookup_destructor): Handle ~auto.
489
490 * pt.c (fn_type_unification): Push tinst level around
491 type_unification_real if we aren't explaining.
492 * cp-tree.h (TFF_NO_TEMPLATE_BINDINGS): New.
493 * error.c (dump_function_decl): Respect it.
494 (subst_to_string): Pass it.
495
496 PR c++/48665
497 * rtti.c (get_typeid): Diagnose qualified function type.
498 * pt.c (tsubst) [POINTER_TYPE]: Likewise.
499
500 * error.c (dump_aggr_type): Fix lambda detection.
501 (dump_simple_decl): Pretty-print capture field.
502
503 N3323
504 * cvt.c (build_expr_type_conversion): Two conversions that return
505 the same type aren't necessarily ambiguous.
506
507 N3648
508 * parser.c (cp_parser_lambda_introducer): Make lambda capture init
509 pedwarn unconditional except in C++1y mode.
510
511 * semantics.c (potential_constant_expression_1): Don't crash on
512 'this' in NSDMI.
513
514 Core 1612
515 * semantics.c (finish_id_expression): Reject capture of anonymous
516 union member.
517
518 Core 1609
519 * decl2.c (check_default_args): Check for pack expansion.
520
521 * mangle.c (write_type): Mangle decltype(auto).
522
523 2013-04-19 Jason Merrill <jason@redhat.com>
524
525 N3638 changes to return type deduction
526 * decl.c (undeduced_auto_decl): New.
527 (require_deduced_type): New.
528 (fndecl_declared_return_type): New.
529 (decls_match): Use it.
530 (duplicate_decls): Don't check for auto return.
531 (grokdeclarator): Reject virtual auto.
532 * class.c (resolve_address_of_overloaded_function): Handle
533 auto function templates.
534 * decl2.c (mark_used): Use undeduced_auto_decl, require_deduced_type.
535 * cp-tree.h: Declare new fns.
536 * error.c (dump_function_decl): Use fndecl_declared_return_type.
537 * search.c (check_final_overrider): Likewise.
538 * pt.c (make_decltype_auto): New.
539 (do_auto_deduction): Require plain decltype(auto).
540 (is_auto): Adjust.
541
542 DR 941
543 * decl.c (duplicate_decls): Don't propagate DECL_DELETED_FN to
544 template specializations.
545
546 2013-04-16 Ed Smith-Rowland <3dw4rd@verizon.net>
547
548 Implement n3599 - Literal operator templates for strings.
549 * parser.c (make_string_pack (tree value)): New function.
550 (cp_parser_userdef_string_literal (cp_token *)): Use it
551 to construct calls to character string literal operator templates.
552 (cp_parser_template_declaration_after_export): Check for new string
553 literal operator template parameter form.
554
555 2013-04-15 Jason Merrill <jason@redhat.com>
556
557 * pt.c (tsubst) [DECLTYPE_TYPE]: Use tsubst_copy_and_build.
558
559 PR c++/52748
560 * pt.c (tsubst) [DECLTYPE_TYPE]: If ~id is an expression
561 rather than a destructor name, it isn't an unqualified-name.
562 (tsubst_copy_and_build): Pass down decltype_flag to operator
563 handling code, too.
564
565 PR c++/56388
566 * semantics.c (insert_capture_proxy): Just use index 1 in the
567 stmt_list_stack.
568
569 2013-04-12 Jakub Jelinek <jakub@redhat.com>
570
571 * error.c (cp_print_error_function,
572 print_instantiation_partial_context_line,
573 maybe_print_constexpr_context): Colorize locus strings.
574
575 2013-04-11 Jason Merrill <jason@redhat.com>
576
577 PR c++/52748
578 * parser.c (complain_flags): New.
579 (cp_parser_postfix_expression): Use it.
580 (cp_parser_unary_expression): Likewise.
581 (cp_parser_binary_expression): Likewise.
582 (cp_parser_assignment_expression): Likewise.
583 (cp_parser_expression): Likewise.
584 (cp_parser_postfix_open_square_expression): Take decltype_p.
585 (cp_parser_builtin_offsetof): Adjust.
586 (cp_convert_range_for): Pass complain to finish_unary_op_expr.
587 * decl2.c (grok_array_decl): Add decltype_p parm.
588 * cp-tree.h: Adjust prototype.
589 * semantics.c (finish_unary_op_expr): Add complain parm.
590
591 2013-04-11 Jakub Jelinek <jakub@redhat.com>
592
593 PR c++/56895
594 * call.c (null_ptr_cst_p): Call fold_non_dependent_expr_sfinae before
595 calling maybe_constant_value for C++98.
596
597 2013-04-11 Jason Merrill <jason@redhat.com>
598
599 PR c++/56901
600 * semantics.c (lambda_capture_field_type, lambda_proxy_type):
601 Strip references before checking WILDCARD_TYPE_P.
602
603 2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
604
605 * call.c (build_conditional_expr_1, build_over_call): Protect
606 error calls with complain & tf_error.
607 * typeck.c (finish_class_member_access_expr, cp_build_binary_op,
608 build_x_unary_op, cp_build_unary_op, cp_build_compound_expr,
609 build_ptrmemfunc): Likewise.
610 (lookup_destructor): Take tsubst_flags_t parameter, adjust.
611
612 * cvt.c (warn_ref_binding): Rename to diagnose_ref_binding.
613 (convert_to_reference): Adjust.
614
615 2013-04-11 Jason Merrill <jason@redhat.com>
616
617 * pt.c (tsubst_copy) [VAR_DECL]: Don't call tsubst for
618 local variables, look them up instead.
619 (tsubst_decl) [VAR_DECL]: Remove handling for anonymous union
620 proxies and substitution in unevaluated context.
621 (tsubst_expr) [OMP_FOR]: Instantiate OMP_FOR_PRE_BODY
622 before the iterators.
623
624 PR c++/23055
625 * pt.c (uses_deducible_template_parms): New.
626 (deducible_array_bound, deducible_expression): New.
627 (deducible_template_args): New.
628 (unify_one_argument): Call uses_deducible_template_parms.
629
630 2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
631
632 PR c++/56913
633 * typeck2.c (build_m_component_ref): Protect error calls with
634 (complain & tf_error).
635
636 2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
637
638 PR c++/54216
639 * parser.c (cp_parser_enum_specifier): Check for empty
640 anonymous enums and anonymous scoped enums.
641
642 2013-04-10 Jakub Jelinek <jakub@redhat.com>
643
644 PR c++/56895
645 * typeck.c (cp_build_binary_op): Call fold_non_dependent_expr_sfinae
646 first before calling maybe_constant_value for warn_for_div_by_zero
647 or invalid shift count warning purposes.
648
649 2013-04-09 Jason Merrill <jason@redhat.com>
650
651 PR c++/25466
652 * rtti.c (build_typeid): Check the address of the argument
653 rather than looking for an INDIRECT_REF.
654
655 2013-04-04 Jason Merrill <jason@redhat.com>
656
657 PR c++/56838
658 PR c++/17232
659 * typeck2.c (abstract_virtuals_error_sfinae): Disable
660 complete_type again.
661
662 2013-04-08 Paolo Carlini <paolo.carlini@oracle.com>
663
664 PR c++/56871
665 * decl.c (validate_constexpr_redeclaration): Allow an explicit
666 specialization to be different wrt the constexpr specifier.
667
668 2013-04-06 Jason Merrill <jason@redhat.com>
669
670 * parser.c (cp_parser_std_attribute): Treat [[noreturn]] like GNU
671 noreturn attribute.
672
673 2013-04-05 Ed Smith-Rowland <3dw4rd@verizon.net>
674
675 * parser.c (cp_parser_ref_qualifier_seq_opt): Move to
676 cp_parser_ref_qualifier_opt. Error if more than one ref-qual found.
677
678 2013-04-03 Jason Merrill <jason@redhat.com>
679
680 * cp-tree.h (FUNCTION_OR_METHOD_TYPE_CHECK): Remove.
681 (TYPE_RAISES_EXCEPTIONS): Use FUNC_OR_METHOD_CHECK instead.
682 (FUNCTION_REF_QUALIFIED, FUNCTION_RVALUE_QUALIFIED): Likewise.
683
684 * mangle.c (write_type): When writing a function type with
685 function-cv-quals, don't add the unqualified type as a
686 substitution candidate.
687
688 2013-04-03 Paolo Carlini <paolo.carlini@oracle.com>
689
690 PR c++/56815
691 * typeck.c (cp_build_unary_op): Change -Wpointer-arith permerror to
692 pedwarn.
693
694 2013-04-03 Jakub Jelinek <jakub@redhat.com>
695
696 PR debug/56819
697 * tree.c (strip_typedefs): Copy NON_DEFAULT_TEMPLATE_ARGS_COUNT
698 from args to new_args.
699 (strip_typedefs_expr): Copy NON_DEFAULT_TEMPLATE_ARGS_COUNT from t to
700 r instead of doing {S,G}ET_NON_DEFAULT_TEMPLATE_ARGS_COUNT.
701
702 2013-04-02 Jason Merrill <jason@redhat.com>
703
704 PR c++/56821
705 * mangle.c (write_function_type): Mangle ref-qualifier.
706 (write_nested_name): Likewise.
707 (canonicalize_for_substitution): Preserve ref-qualifier.
708 (write_type): Likewise.
709
710 PR c++/34949
711 * decl.c (begin_destructor_body): Clobber the object in a cleanup.
712
713 2013-04-02 Paolo Carlini <paolo.carlini@oracle.com>
714
715 * friend.c (do_friend): Use COMPLETE_OR_OPEN_TYPE_P.
716 * pt.c (find_parameter_packs_r): Use TYPE_ALIAS_P and TYPE_TI_ARGS.
717 (for_each_template_parm_r): Use TYPE_TI_ARGS.
718
719 2013-04-02 Paolo Carlini <paolo.carlini@oracle.com>
720
721 * cp-tree.h (TAGGED_TYPE_P): Remove.
722 (IS_OVERLOAD_TYPE): Rename to OVERLOAD_TYPE_P, adjust.
723 (TYPE_ANONYMOUS_P): Adjust.
724 * call.c (build_new_op_1): Likewise.
725 * class.c (find_abi_tags_r): Likewise.
726 * decl.c (warn_misplaced_attr_for_class_type, start_decl,
727 type_is_deprecated): Likewise.
728 * decl2.c (grokfield, min_vis_r): Likewise.
729 * pt.c (get_template_info): Likewise.
730 * tree.c (handle_abi_tag_attribute): Likewise.
731
732 2013-04-01 Jason Merrill <jason@redhat.com>
733
734 * semantics.c (maybe_constant_value): Check
735 instantiation_dependent_expression_p.
736 * pt.c (build_non_dependent_expr): Don't check it here.
737
738 PR c++/56772
739 * init.c (build_new): Don't try to process an array initializer
740 at template definition time.
741
742 PR c++/56793
743 * typeck.c (finish_class_member_access_expr): Handle enum scope.
744
745 PR c++/56794
746 * parser.c (cp_parser_range_for): Don't try to do auto deduction
747 in a template if the type of the range is incomplete.
748
749 * call.c (add_function_candidate): Take the address of 'this' here.
750 (build_over_call): And here.
751 (build_new_method_call_1, build_op_call_1): Not here.
752 (build_user_type_conversion_1): Or here.
753 (add_candidates): Adjust.
754
755 * cxx-pretty-print.h (pp_cxx_cv_qualifiers): New.
756 * class.c (same_signature_p): Use type_memfn_quals.
757 * cp-tree.h (TYPE_RAISES_EXCEPTIONS): Use
758 FUNCTION_OR_METHOD_TYPE_CHECK.
759 * error.c (dump_type_suffix): Add padding before cv-qualifiers.
760 * pt.c (unify): Use static_fn_type.
761
762 2013-04-01 Bronek Kozicki <b.kozicki@gmail.com>
763 Jason Merrill <jason@redhat.com>
764
765 Implement N2439 (ref-qualifiers for 'this')
766 * cp-tree.h (FUNCTION_REF_QUALIFIED): New.
767 (FUNCTION_RVALUE_QUALIFIED): New.
768 (FUNCTION_OR_METHOD_TYPE_CHECK): New.
769 (cpp0x_warn_str): Add CPP0X_REF_QUALIFIER.
770 (cp_ref_qualifier): New enum.
771 (cp_declarator): Add ref_qualifier.
772 * parser.c (cp_parser_ref_qualifier_seq_opt): New.
773 (cp_parser_direct_declarator): Use it.
774 (make_call_declarator): Adjust.
775 (cp_parser_lambda_declarator_opt): Adjust.
776 * call.c (add_function_candidate): Handle ref-qualifier overload
777 resolution semantics.
778 (standard_conversion): Adjust.
779 * class.c (add_method, same_signature_p): Compare ref-qualifiers.
780 * decl.c (grokdeclarator): Handle ref-qualifiers.
781 (grokfndecl): Check for invalid ref-qualifiers.
782 (static_fn_type, revert_static_member_fn): Adjust.
783 * decl2.c (build_memfn_type): Handle ref-qualifiers.
784 (check_classfn): Check them.
785 (cp_reconstruct_complex_type): Retain them.
786 * error.c (dump_ref_qualifier): New.
787 (dump_type_suffix, dump_function_decl): Use it.
788 (maybe_warn_cpp0x): Handle CPP0X_REF_QUALIFIER.
789 * pt.c (tsubst, tsubst_function_type): Instantiate ref-quals.
790 (unify): Retain them.
791 * tree.c (cp_check_qualified_type): New.
792 (cp_build_qualified_type_real): Keep exception spec and ref-qual.
793 (build_ref_qualified_type): New.
794 (strip_typedefs, build_exception_variant): Keep ref-qualifier.
795 (cp_build_type_attribute_variant): Keep ref-qualifier.
796 * typeck.c (merge_types): Keep ref-qualifier.
797 (structural_comptypes): Compare ref-qualifier.
798 (type_memfn_rqual): New.
799 (apply_memfn_quals): Take ref-qual argument.
800 * typeck2.c (build_m_component_ref): Check ref-qualifier.
801
802 2013-04-01 Paolo Carlini <paolo.carlini@oracle.com>
803
804 * cp-tree.h (DECL_UNBOUND_CLASS_TEMPLATE_P): Remove.
805 (DECL_FUNCTION_TEMPLATE_P): Adjust.
806
807 * cxx-pretty-print.c (pp_cxx_nested_name_specifier,
808 pp_cxx_qualified_id): Use get_containing_scope.
809 * parser.c (cp_parser_class_head): Likewise.
810 * pt.c (push_template_decl_real): Likewise.
811
812 * decl2.c (import_export_decl): Use DECL_TEMPLOID_INSTANTIATION.
813 * pt.c (unify): Use CP_INTEGRAL_TYPE_P.
814
815 2013-03-31 Paolo Carlini <paolo.carlini@oracle.com>
816
817 * decl2.c (collect_candidates_for_java_method_aliases): Use
818 DECL_CLASS_SCOPE_P.
819 * name-lookup.c (pushtag_1) Use TYPE_FUNCTION_SCOPE_P.
820 (pushdecl_maybe_friend_1): Use DECL_DECLARES_FUNCTION_P.
821 * decl.c (duplicate_decls): Likewise.
822 * parser.c (cp_parser_template_declaration_after_export): Likewise,
823 also DECL_DECLARES_TYPE_P.
824 * pt.c (instantiate_class_template_1): Likewise.
825 * search.c (lookup_field_1): Use DECL_DECLARES_TYPE_P.
826 (lookup_field_r): Likewise.
827 (friend_accessible_p): Use DECL_DECLARES_FUNCTION_P.
828 (lookup_fnfields_slot_nolazy): Likewise.
829 * semantics.c (finish_member_declaration): Likewise.
830 * typeck.c (convert_for_initialization): Use TYPE_REFFN_P.
831
832 2013-03-29 Gabriel Dos Reis <gdr@integrable-solutions.net>
833
834 * pt.c (template_parms_to_args): Fix typo in comment.
835
836 2013-03-29 Paolo Carlini <paolo.carlini@oracle.com>
837
838 * call.c (build_op_call_1): Use TYPE_PTRFN_P and TYPE_REFFN_P.
839
840 2013-03-29 Paolo Carlini <paolo.carlini@oracle.com>
841
842 * call.c (add_builtin_candidate): Use TYPE_PTR_P and VOID_TYPE_P.
843 (build_op_call_1): Likewise.
844 (build_over_call): Likewise.
845 (compare_ics): Likewise.
846 * class.c (build_base_path): Likewise.
847 (resolve_address_of_overloaded_function): Likewise.
848 * cp-tree.h: Likewise.
849 * cvt.c (cp_convert_to_pointer): Likewise.
850 (convert_to_reference): Likewise.
851 (ocp_convert): Likewise.
852 (convert_force): Likewise, tidy.
853 * cxx-pretty-print.c (pp_cxx_postfix_expression): Likewise.
854 (pp_cxx_ptr_operator): Likewise.
855 * decl.c (duplicate_decls): Likewise.
856 (start_decl): Likewise.
857 (grok_op_properties): Likewise.
858 (start_preparsed_function): Likewise.
859 (store_parm_decls): Likewise.
860 (finish_function): Likewise.
861 * decl2.c (delete_sanity): Likewise.
862 (acceptable_java_type): Likewise.
863 (grokbitfield): Likewise.
864 (cp_reconstruct_complex_type): Likewise.
865 * error.c (dump_type_prefix): Likewise.
866 (dump_expr): Likewise.
867 * except.c (push_eh_cleanup): Likewise.
868 (complete_ptr_ref_or_void_ptr_p): Likewise.
869 (can_convert_eh): Likewise.
870 * init.c (build_new_1): Likewise.
871 (build_delete): Likewise.
872 (build_vec_delete): Likewise.
873 * mangle.c (write_type): Likewise.
874 * parser.c (lookup_literal_operator): Likewise.
875 * pt.c (convert_nontype_argument_function): Likewise.
876 (convert_nontype_argument): Likewise.
877 (tsubst): Likewise.
878 (unify): Likewise.
879 (dependent_type_p_r): Likewise.
880 * rtti.c (build_headof): Likewise.
881 (build_typeid): Likewise.
882 (build_dynamic_cast_1): Likewise.
883 (target_incomplete_p): Likewise.
884 (typeinfo_in_lib_p): Likewise.
885 * semantics.c (finish_omp_for): Likewise.
886 (cxx_eval_call_expression): Likewise.
887 (maybe_resolve_dummy): Likewise.
888 * tree.c (build_target_expr): Likewise.
889 (cp_build_qualified_type_real): Likewise.
890 * typeck.c (composite_pointer_type_r): Likewise.
891 (composite_pointer_type): Likewise.
892 (comp_except_types): Likewise.
893 (cxx_sizeof_nowarn): Likewise.
894 (string_conv_p): Likewise.
895 (cp_build_array_ref): Likewise.
896 (cp_build_function_call_vec): Likewise, also use TYPE_PTRFN_P.
897 (pointer_diff): Likewise.
898 (cp_build_addr_expr_1): Likewise.
899 (cp_build_unary_op): Likewise.
900 (build_static_cast_1): Likewise.
901 (cp_build_c_cast): Likewise.
902 (comp_ptr_ttypes_real): Likewise.
903 (ptr_reasonably_similar): Likewise.
904 (comp_ptr_ttypes_const): Likewise.
905 (casts_away_constness): Likewise.
906 (check_literal_operator_args): Likewise.
907 * typeck2.c (build_x_arrow): Likewise.
908 (add_exception_specifier): Likewise.
909
910 2013-03-29 Jason Merrill <jason@redhat.com>
911
912 N3582
913 * cp-tree.h (AUTO_IS_DECLTYPE): New.
914 * parser.c (cp_parser_decltype): Handle decltype(auto).
915 (cp_parser_type_id_1): Allow auto without a late-specified
916 return in C++1y.
917 (cp_parser_primary_expression): Use the return value of
918 finish_parenthesized_expr.
919 (cp_parser_transaction_expression): Likewise.
920 * semantics.c (force_paren_expr): New.
921 (finish_parenthesized_expr): Use it.
922 * call.c (build_conditional_expr_1): Likewise.
923 * pt.c (do_auto_deduction): Handle decltype(auto).
924 (tsubst_copy): Handle PAREN_EXPR.
925 (tsubst_copy_and_build): Likewise.
926 * error.c (dump_expr): Handle PAREN_EXPR.
927 * cxx-pretty-print.c (pp_cxx_expression): Likewise.
928 * mangle.c (write_expression): Ignore PAREN_EXPR.
929
930 * parser.c (cp_parser_decltype_expr): Split out...
931 (cp_parser_decltype): ...from here.
932
933 PR c++/56774
934 PR c++/35722
935 * pt.c (unify_pack_expansion): Fix indexing.
936
937 2013-03-29 Gabriel Dos Reis <gdr@integrable-solutions.net>
938
939 * call.c (build_java_interface_fn_ref): Likewise.
940 (make_temporary_var_for_ref_to_temp): Likewise.
941 * class.c (check_field_decls): Likewise.
942 (layout_class_type): Likewise.
943 (finish_struct_1): Likewise.
944 (fixed_type_or_null): Likewise.
945 (get_vtbl_decl_for_binfo): Likewise.
946 * cp-gimplify.c (omp_var_to_track): Likewise.
947 (cp_genericize_r): Likewise.
948 * cp-objcp-common.c (cxx_warn_unused_global_decl): Likewise.
949 * cp-tree.h (LANG_DECL_HAS_MIN): Likewise.
950 (DECL_DISCRIMINATOR_P): Likewise.
951 * decl.c (poplevel): Likewise.
952 (decls_match): Likewise.
953 (duplicate_decls): Likewise.
954 (decl_jump_unsafe): Likewise.
955 (start_decl): Likewise.
956 (check_for_uninitialized_const_var): Likewise.
957 (make_rtl_for_nonlocal_decl): Likewise.
958 (cp_finish_decl): Likewise.
959 (expand_static_init): Likewise.
960 (local_variable_p): Likewise.
961 (maybe_register_incomplete_var): Likewise.
962 * decl2.c (grokfield): Likewise.
963 (comdat_linkage): Likewise.
964 (determine_visibility): Likewise.
965 (import_export_decl): Likewise.
966 (prune_vars_needing_no_initialization): Likewise.
967 (decl_maybe_constant_var_p): Likewise.
968 * error.c (dump_simple_decl): Likewise.
969 (dump_template_decl): Likewise.
970 (cp_printer): Likewise.
971 * except.c (build_throw): Likewise.
972 * init.c (build_vtbl_address): Likewise.
973 (member_init_ok_or_else): Likewise.
974 (build_aggr_init): Likewise.
975 (expand_aggr_init_1): Likewise.
976 (build_offset_ref): Likewise.
977 (constant_value_1): Likewise.
978 * mangle.c (write_mangled_name): Likewise.
979 (write_prefix): Likewise.
980 * name-lookup.c (supplement_binding_1): Likewise.
981 (add_decl_to_level): Likewise.
982 (pushdecl_maybe_friend_1): Likewise.
983 (check_for_out_of_scope_variable): Likewise.
984 (validate_nonmember_using_decl): Likewise.
985 (lookup_name_innermost_nonclass_level_1): Likewise.
986 (lookup_arg_dependent_1): Likewise.
987 * parser.c (cp_parser_lambda_introducer): Likewise.
988 (cp_parser_template_argument): Likewise.
989 (cp_parser_single_declaration): Likewise.
990 * pt.c (convert_nontype_argument): Likewise.
991 (instantiate_class_template_1): Likewise.
992 (tsubst_decl): Likewise.
993 (tsubst_expr): Likewise.
994 (do_decl_instantiation): Likewise.
995 (do_type_instantiation): Likewise.
996 (regenerate_decl_from_template): Likewise.
997 (always_instantiate_p): Likewise.
998 (instantiate_decl): Likewise.
999 (type_dependent_expression_p): Likewise.
1000 (build_non_dependent_expr): Likewise.
1001 * repo.c (repo_emit_p): Likewise.
1002 * rtti.c (build_dynamic_cast_1): Likewise.
1003 * search.c (shared_member_p): Likewise.
1004 * semantics.c (outer_var_p): Likewise.
1005 (finish_id_expression): Likewise.
1006 (finish_omp_clauses): Likewise.
1007 (finish_decltype_type): Likewise.
1008 (ensure_literal_type_for_constexpr_object): Likewise.
1009 * tree.c (lvalue_kind): Likewise.
1010 (bot_replace): Likewise.
1011 (cp_tree_equal): Likewise.
1012 (handle_init_priority_attribute): Likewise.
1013 (decl_storage_duration): Likewise.
1014 * typeck.c (cxx_sizeof_expr): Likewise.
1015 (cxx_alignof_expr): Likewise.
1016 (decay_conversion): Likewise.
1017 (build_class_member_access_expr): Likewise.
1018 (cp_build_array_ref): Likewise.
1019 (cxx_mark_addressable): Likewise.
1020 (maybe_warn_about_returning_address_of_local): Likewise.
1021 (check_return_expr): Likewise.
1022 * typeck2.c (cxx_readonly_error): Likewise.
1023 (abstract_virtuals_error_sfinae): Likewise.
1024 (cxx_incomplete_type_diagnostic): Likewise.
1025
1026 2013-03-28 Lawrence Crowl <crowl@google.com>
1027
1028 * Make-lang.in
1029 (CXX_PARSER_H): Add header dependence.
1030 * cp-tree.h
1031 (extern debug (cp_binding_level &)): New.
1032 (extern debug (cp_binding_level *)): New.
1033 * name-lookup.h
1034 (debug (cp_binding_level &)): New.
1035 (debug (cp_binding_level *)): New.
1036 * parser.c
1037 (debug (cp_parser &)): New.
1038 (debug (cp_parser *)): New.
1039 (debug (cp_token &)): New.
1040 (debug (cp_token *)): New.
1041 (debug (vec<cp_token, va_gc> &)): New.
1042 (debug (vec<cp_token, va_gc> *)): New.
1043 * parser.c: Add header dependence.
1044 (extern debug (cp_parser &)): New.
1045 (extern debug (cp_parser *)): New.
1046 (extern debug (cp_token &)): New.
1047 (extern debug (cp_token *)): New.
1048 (extern debug (vec<cp_token, va_gc> &)): New.
1049 (extern debug (vec<cp_token, va_gc> *)): New.
1050
1051 2013-03-28 Jason Merrill <jason@redhat.com>
1052
1053 PR c++/17232
1054 PR c++/52748
1055 * typeck2.c (abstract_virtuals_error_sfinae): Don't complete
1056 the type if tf_decltype is set.
1057 * pt.c (fn_type_unification): Add decltype_p parm.
1058 (get_bindings): Adjust.
1059 * cp-tree.h: Adjust.
1060 * class.c (resolve_address_of_overloaded_function): Adjust.
1061 * call.c (add_template_candidate_real, print_z_candidate): Adjust.
1062
1063 PR c++/56679
1064 * parser.c (cp_parser_sizeof_pack): Split out from...
1065 (cp_parser_sizeof_operand): ...here. Require (id).
1066
1067 PR c++/56701
1068 * semantics.c (finish_this_expr): 'this' is an rvalue.
1069 * typeck.c (cp_build_indirect_ref): Handle NOP_EXPR of 'this'.
1070
1071 PR c++/56710
1072 * semantics.c (finish_member_declaration): Don't push closure
1073 members.
1074
1075 * name-lookup.c (pushdecl_maybe_friend_1): Use
1076 nonlambda_method_basetype and current_nonlambda_class_type.
1077
1078 PR c++/56728
1079 * semantics.c (potential_constant_expression_1) [NOP_EXPR]: Reject
1080 conversion from integer to pointer.
1081 (cxx_eval_constant_expression): Likewise.
1082 (cxx_eval_indirect_ref): Use the folded operand if we still think
1083 this might be constant.
1084
1085 2013-03-28 Paolo Carlini <paolo.carlini@oracle.com>
1086 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1087
1088 PR c++/56725
1089 * call.c (convert_like_real): Change series of two permerrors
1090 to permerror + inform (and likewise for two errors).
1091 (build_new_method_call_1): Likewise.
1092 * typeck.c (convert_for_initialization): Change additional
1093 warning or error to inform.
1094
1095 2013-03-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
1096
1097 * cp-tree.h (next_aggr_init_expr_arg): Remove static specifier.
1098 (first_aggr_init_expr): Likewise.
1099 (more_aggr_init_expr_args_p): Likewise.
1100 (type_of_this_parm): Likewise.
1101 (class_of_this_parm): Likewise.
1102 * name-lookup.h (get_global_value_if_present): Likewise.
1103 (is_typename_at_global_scope): Likewise.
1104
1105 2013-03-28 Paolo Carlini <paolo.carlini@oracle.com>
1106
1107 * call.c (joust): Don't call inform for a permerror returning false.
1108 * parser.c (cp_parser_check_class_key): Likewise.
1109 * pt.c (tsubst_copy_and_build): Likewise.
1110
1111 2013-03-27 Jason Merrill <jason@redhat.com>
1112
1113 PR c++/56749
1114 * semantics.c (finish_qualified_id_expr): Return early
1115 for enum scope.
1116
1117 2013-03-26 Gabriel Dos Reis <gdr@integrable-solutions.net>
1118
1119 * call.c (build_new_method_call_1): Use INDIRECT_REF_P.
1120 * cvt.c (convert_to_void): Likewise.
1121 * error.c (dump_expr): Likewise.
1122 * mangle.c (write_expression): Likewise.
1123 * parser.c (cp_parser_template_argument): Likewise.
1124 * pt.c (convert_nontype_argument): Likewise.
1125 (tsubst_copy_and_build): Likewise.
1126 * rtti.c (build_typeid): Likewise.
1127 * semantics.c (finish_call_expr): Likewise.
1128 (finish_decltype_type): Likewise.
1129 (build_data_member_initialization): Likewise.
1130 * tree.c (is_dummy_object): Likewise.
1131 * typeck.c (decay_conversion): Likewise.
1132 (build_class_member_access_expr): Likewise.
1133 (cp_build_addr_expr_1): Likewise.
1134 (unary_complex_lvalue): Likewise.
1135 (check_return_expr): Likewise.
1136 * typeck2.c (cxx_readonly_error): Likewise.
1137
1138 2013-03-26 Jason Merrill <jason@redhat.com>
1139
1140 PR c++/52597
1141 * typeck.c (invalid_nonstatic_memfn_p): Use get_first_fn. Take tree.
1142 * semantics.c (finish_decltype_type): Check it before type_unknown_p.
1143 * cp-tree.h: Adjust prototype.
1144
1145 PR c++/45282
1146 * typeck2.c (build_m_component_ref): Handle prvalue object.
1147
1148 2013-03-26 Gabriel Dos Reis <gdr@integrable-solutions.net>
1149
1150 * cp-gimplify.c (cp_genericize_r): Use VAR_OR_FUNCTION_DECL_P.
1151 * decl.c (duplicate_decls): Likewise.
1152 (cp_finish_decl): Likewise.
1153 (check_class_member_definition_namespace): Likewise.
1154 * decl2.c (grokfield): Likewise.
1155 (decl_needed_p): Likewise.
1156 (import_export_decl): Likewise.
1157 (mark_used): Likewise.
1158 * name-lookup.c (pushdecl_maybe_friend_1): Likewise.
1159 * pt.c (push_access_scope): Likewise.
1160 (instantiate_decl): Likewise.
1161 * ptree.c (cxx_print_decl): Likewise.
1162 * repo.c (repo_emit_p): Likewise.
1163 * semantics.c (note_decl_for_pch): Likewise.
1164 * tree.c (decl_linkage): Likewise.
1165
1166 2013-03-26 Paolo Carlini <paolo.carlini@oracle.com>
1167
1168 PR c++/55951
1169 * decl.c (check_array_designated_initializer): Handle CONST_DECL
1170 as ce->index.
1171
1172 2013-03-26 Paolo Carlini <paolo.carlini@oracle.com>
1173
1174 * decl.c (grokfndecl): Handle separately <inline> and <constexpr>
1175 error messages.
1176
1177 * decl.c (grokdeclarator): Declare typedef_p and use it everywhere.
1178
1179 2013-03-25 Jason Merrill <jason@redhat.com>
1180
1181 PR c++/56699
1182 * semantics.c (maybe_resolve_dummy): Make sure that the enclosing
1183 class is derived from the type of the object.
1184
1185 PR c++/52014
1186 * semantics.c (lambda_expr_this_capture): Don't capture 'this' in
1187 unevaluated context.
1188
1189 2013-03-25 Paolo Carlini <paolo.carlini@oracle.com>
1190
1191 PR c++/56722
1192 * decl.c (cp_finish_decl): Check DECL_LANG_SPECIFIC before
1193 DECL_TEMPLATE_INSTANTIATION.
1194
1195 2013-03-22 Jason Merrill <jason@redhat.com>
1196
1197 PR c++/56684
1198 * pt.c (instantiation_dependent_r): Check DECL_INITIAL of VAR_DECL
1199 and CONST_DECL.
1200
1201 2013-03-21 Gabriel Dos Reis <gdr@integrable-solutions.net>
1202
1203 * cp-tree.h (identifier_p): New.
1204 * call.c: Throughout, call identifier_p insstead of direct
1205 comparaison of TREE_CODE against IDENTIFIER_NODE.
1206 * decl.c: Likewisse.
1207 * decl2.c: Likewise.
1208 * init.c: Likewise.
1209 * mangle.c: Likewise.
1210 * name-lookup.c: Likewise.
1211 * parser.c: Likewise.
1212 * pt.c: Likewise.
1213 * search.c: Likewise.
1214 * semantics.c: Likewise.
1215 * tree.c: Likewise.
1216 * typeck.c: Likewise.
1217 * typeck2.c: Likewise.
1218
1219 2013-03-21 Jakub Jelinek <jakub@redhat.com>
1220
1221 PR middle-end/48087
1222 * pt.c (convert_nontype_argument): Count werrorcount as warnings.
1223 * call.c (build_temp): Likewise.
1224 * method.c (synthesize_method): Likewise.
1225 * typeck.c (convert_for_initialization): Likewise.
1226
1227 2013-03-21 Marc Glisse <marc.glisse@inria.fr>
1228
1229 * call.c (build_conditional_expr_1): Fold VEC_COND_EXPR.
1230
1231 2013-03-21 Richard Biener <rguenther@suse.de>
1232
1233 * error.c (cp_printer): Use DECL_HAS_DEBUG_EXPR_P instead of
1234 DECL_DEBUG_EXPR_IS_FROM. Guard properly.
1235
1236 2013-03-20 Jason Merrill <jason@redhat.com>
1237
1238 PR c++/56646
1239 * parser.c (cp_parser_late_return_type_opt): Save and restore
1240 current_class_ptr/ref.
1241
1242 PR c++/54532
1243 * expr.c (cplus_expand_constant): Do nothing if the class is
1244 incomplete.
1245 * semantics.c (reduced_constant_expression_p): Allow PTRMEM_CST.
1246 * typeck2.c (store_init_value): Use reduced_constant_expression_p.
1247 * decl.c (maybe_register_incomplete_var): Handle PTRMEM_CST.
1248 (complete_vars): Likewise.
1249
1250 * name-lookup.c (get_anonymous_namespace_name): Never use
1251 get_file_function_name.
1252
1253 * pt.c (retrieve_specialization): Handle null tmpl argument.
1254
1255 PR c++/17232
1256 PR c++/56642
1257 * pt.c (tsubst_decl): Check return value of register_specialization.
1258 * typeck2.c (abstract_virtuals_error_sfinae): Re-apply complete_type
1259 change.
1260
1261 2013-03-17 Jason Merrill <jason@redhat.com>
1262
1263 PR c++/54359
1264 PR c++/56639
1265 * parser.c (cp_parser_direct_declarator): Bail if we see a
1266 qualified-id not at namespace scope.
1267
1268 PR c++/17232
1269 PR c++/56642
1270 * typeck2.c (abstract_virtuals_error_sfinae): Revert complete_type
1271 change for now.
1272
1273 2013-03-16 Jason Merrill <jason@redhat.com>
1274
1275 * decl.c (grokdeclarator): Assert that we won't see a pointer to
1276 METHOD_TYPE.
1277
1278 PR c++/54277
1279 * cp-tree.h (WILDCARD_TYPE_P): Split out from...
1280 (MAYBE_CLASS_TYPE_P): ...here.
1281 * semantics.c (lambda_capture_field_type): Only build a
1282 magic decltype for wildcard types.
1283 (lambda_proxy_type): Likewise.
1284 (finish_non_static_data_member): Get the quals from
1285 the object.
1286
1287 PR c++/55931
1288 * parser.c (cp_parser_template_argument): Don't
1289 fold_non_dependent_expr.
1290
1291 * parser.c (cp_parser_lambda_declarator_opt): Use
1292 cp_parser_trailing_type_id.
1293
1294 PR c++/45917
1295 * parser.c (cp_parser_template_id): Don't forget access checks.
1296
1297 PR c++/52374
1298 * pt.c (tsubst_qualified_id): Use current_nonlambda_class_type.
1299
1300 PR c++/54764
1301 PR c++/55972
1302 * name-lookup.h (tag_scope): Add ts_lambda.
1303 * semantics.c (begin_lambda_type): Use it.
1304 * decl.c (xref_tag_1): Set CLASSTYPE_LAMBDA_EXPR.
1305 * pt.c (check_default_tmpl_args): Ignore lambdas.
1306 (push_template_decl_real): Handle lambdas.
1307 * tree.c (no_linkage_check): Adjust lambda check.
1308
1309 PR c++/56039
1310 * tree.c (strip_typedefs_expr): Complain about lambda, don't abort.
1311
1312 PR c++/54359
1313 * parser.c (cp_parser_direct_declarator): Fix late return
1314 for out-of-class defn of member function.
1315
1316 PR c++/55357
1317 * semantics.c (maybe_add_lambda_conv_op): Clear DECL_NAME of copied
1318 parms to avoid duplicate -Wshadow warnings.
1319
1320 * search.c (lookup_base): Handle NULL_TREE.
1321
1322 PR c++/56481
1323 * semantics.c (potential_constant_expression_1): Use of 'this' in
1324 a non-constexpr function makes the expression not potentially
1325 constant.
1326
1327 N3276
1328 PR c++/52748
1329 * cp-tree.h (tsubst_flags): Add tf_decltype.
1330 * call.c (build_cxx_call): Don't build a temporary if it's set.
1331 (build_over_call): Make sure it's only passed to build_cxx_call.
1332 * parser.c (cp_parser_primary_expression): Add decltype_p parm.
1333 (cp_parser_unary_expression): Likewise.
1334 (cp_parser_cast_expression): Likewise.
1335 (cp_parser_binary_expression): Likewise.
1336 (cp_parser_assignment_expression): Likewise.
1337 (cp_parser_postfix_expression): Likewise. Pass tf_decltype.
1338 (cp_parser_expression): Add decltype_p. Force a
1339 temporary for a call on the LHS of a comma.
1340 (cp_parser_decltype): Pass true to decltype_p parms.
1341 * pt.c (tsubst) [DECLTYPE_TYPE]: Pass tf_decltype.
1342 (tsubst_copy_and_build): Pass tf_decltype down only for
1343 CALL_EXPR and the RHS of COMPOUND_EXPR.
1344 * tree.c (build_cplus_new): Call complete_type_or_maybe_complain.
1345
1346 * cp-tree.h (abstract_class_use): New enum.
1347 * typeck2.c (pending_abstract_type): Add use field.
1348 (abstract_virtuals_error_sfinae): Add overloads taking
1349 abstract_class_use instead of tree.
1350 * typeck.c (build_static_cast_1): Call it.
1351 * except.c (is_admissible_throw_operand_or_catch_parameter): Call it.
1352 * pt.c: Adjust calls.
1353 * decl.c (cp_finish_decl): Don't handle functions specially.
1354 (grokdeclarator): Always check return type.
1355 * init.c (build_new_1): Adjust call.
1356
1357 DR 337
1358 PR c++/17232
1359 * pt.c (tsubst) [ARRAY_TYPE]: Use abstract_virtuals_error_sfinae.
1360 * typeck2.c (abstract_virtuals_error_sfinae): Call complete_type.
1361
1362 DR 657
1363 * pt.c (tsubst_function_type): Call abstract_virtuals_error_sfinae.
1364 (tsubst_arg_types): Likewise.
1365
1366 DR 1518
1367 PR c++/54835
1368 * call.c (convert_like_real): Check for explicit constructors
1369 even for value-initialization.
1370
1371 PR c++/54946
1372 * pt.c (convert_nontype_argument): Handle invalid pointer.
1373
1374 * parser.c (cp_parser_lambda_expression): Use nreverse.
1375
1376 PR c++/56447
1377 PR c++/55532
1378 * pt.c (instantiate_class_template_1): Instantiate lambda capture
1379 list here.
1380 (tsubst_copy_and_build): Not here.
1381
1382 PR c++/55017
1383 * method.c (walk_field_subobs): Disallow copy of rvalue ref.
1384
1385 PR c++/55240
1386 * parser.c (parsing_nsdmi): New.
1387 * semantics.c (outer_automatic_var_p): Check it.
1388 (finish_id_expression): Likewise.
1389 * cp-tree.h: Declare it.
1390
1391 PR c++/55241
1392 * error.c (dump_expr) [SIZEOF_EXPR]: Print sizeof... properly.
1393
1394 * parser.c (lookup_literal_operator): Correct parm/arg naming
1395 mixup.
1396
1397 PR c++/56238
1398 * pt.c (fold_non_dependent_expr_sfinae): Check
1399 instantiation_dependent_expression_p.
1400
1401 PR c++/56095
1402 * class.c (resolve_address_of_overloaded_function): Accept a
1403 reference to function for target_type.
1404 (instantiate_type): Likewise.
1405 * pt.c (convert_nontype_argument): Pass it to
1406 convert_nontype_argument_function.
1407
1408 2013-03-16 Jakub Jelinek <jakub@redhat.com>
1409
1410 * tree.c (cp_tree_equal): Fix a pasto.
1411
1412 PR c++/56607
1413 * typeck.c (cp_build_binary_op): When calling warn_for_div_by_zero,
1414 pass op1 through maybe_constant_value first.
1415
1416 2013-03-16 Paolo Carlini <paolo.carlini@oracle.com>
1417
1418 PR c++/56582
1419 * semantics.c (cxx_eval_array_reference): Check for negative index.
1420
1421 2013-03-14 Jason Merrill <jason@redhat.com>
1422
1423 PR c++/56614
1424 * decl.c (local_variable_p_walkfn): Check DECL_ARTIFICIAL again.
1425
1426 PR c++/56346
1427 * decl.c (register_dtor_fn): Pass null to __cxa_thread_atexit
1428 dso_handle parm on targets without __cxa_atexit.
1429
1430 2013-03-11 Jason Merrill <jason@redhat.com>
1431
1432 PR c++/56567
1433 * typeck.c (check_return_expr): Disallow returning init list here.
1434 * semantics.c (apply_deduced_return_type): Not here.
1435
1436 2013-03-08 Paolo Carlini <paolo.carlini@oracle.com>
1437
1438 PR c++/51412
1439 * cxx-pretty-print.c (pp_cxx_expression): Handle LAMBDA_EXPR.
1440 * error.c (dump_expr): Likewise.
1441
1442 2013-03-08 Jason Merrill <jason@redhat.com>
1443
1444 PR c++/51884
1445 * class.c (modify_all_vtables): Mangle the vtable name before
1446 entering dfs_walk.
1447
1448 * semantics.c (lambda_expr_this_capture): In unevaluated context,
1449 just return the nearest 'this'.
1450
1451 PR c++/51494
1452 PR c++/52183
1453 PR c++/56222
1454 * tree.c (maybe_dummy_object): Don't capture 'this'.
1455 * semantics.c (maybe_resolve_dummy): New.
1456 (finish_non_static_data_member): Use it.
1457 (finish_qualified_id_expr): Don't test is_dummy_object.
1458 * cp-tree.h: Declare maybe_resolve_dummy.
1459 * call.c (build_new_method_call_1): Use it.
1460
1461 PR c++/56567
1462 * semantics.c (apply_deduced_return_type): Don't allow returning
1463 std::initializer_list.
1464
1465 2013-03-06 Paolo Carlini <paolo.carlini@oracle.com>
1466
1467 PR c++/56534
1468 * parser.c (cp_parser_elaborated_type_specifier): Don't call
1469 check_elaborated_type_specifier when TREE_CODE (decl) != TYPE_DECL.
1470 * decl.c (check_elaborated_type_specifier): Tidy.
1471
1472 2013-03-06 Jakub Jelinek <jakub@redhat.com>
1473
1474 PR c++/56543
1475 * tree.c (strip_typedefs): Don't copy args if they are NULL.
1476
1477 2013-03-05 Jakub Jelinek <jakub@redhat.com>
1478
1479 * parser.c (cp_parser_braced_list): For {} initialize
1480 *non_constant_p to false.
1481
1482 2013-03-04 Jason Merrill <jason@redhat.com>
1483
1484 PR c++/56464
1485 PR c++/54383
1486 * semantics.c (lambda_expr_this_capture): Handle NSDMI
1487 and non-class scopes.
1488
1489 2013-03-01 Paolo Carlini <paolo.carlini@oracle.com>
1490
1491 * decl.c (grokdeclarator): Remove dead code.
1492
1493 2013-02-28 Jason Merrill <jason@redhat.com>
1494
1495 PR c++/56481
1496 * semantics.c (potential_constant_expression_1): Use
1497 cxx_eval_outermost_constant_expr rather than maybe_constant_value.
1498
1499 PR c++/56243
1500 * call.c (build_over_call): Avoid virtual lookup in a template.
1501
1502 2013-02-27 Jason Merrill <jason@redhat.com>
1503
1504 PR c++/56358
1505 PR c++/56323
1506 * name-lookup.c (do_class_using_decl): Use ctor_identifier instead
1507 of the base name for inheriting ctors.
1508 (push_class_level_binding_1): Remove inheriting ctor handling.
1509 * pt.c (tsubst_decl) [USING_DECL]: Likewise.
1510 * class.c (add_implicitly_declared_members): Adjust.
1511
1512 2013-02-26 David Binderman <dcb314@hotmail.com>
1513
1514 PR c++/55632
1515 * decl.c (grokdeclarator): Tidy publicp assignment.
1516
1517 2013-02-25 Aldy Hernandez <aldyh@redhat.com>
1518
1519 PR c++/56419
1520 * semantics.c (begin_transaction_stmt): Set TREE_SIDE_EFFECTS.
1521 (build_transaction_expr): Same.
1522
1523 2013-02-25 Jason Merrill <jason@redhat.com>
1524
1525 PR c++/56377
1526 * pt.c (fn_type_unification): Wait to call push_tinst_level until
1527 we know what args we're looking at.
1528
1529 PR c++/56438
1530 * semantics.c (potential_constant_expression_1): In C++98, a cast
1531 to non-integral type can't be a constant expression.
1532
1533 2013-02-24 Jakub Jelinek <jakub@redhat.com>
1534
1535 PR c++/56403
1536 * init.c (build_zero_init_1): Use RECORD_OR_UNION_CODE_P instead
1537 of CLASS_TYPE_P.
1538
1539 2013-02-22 Jason Merrill <jason@redhat.com>
1540
1541 PR c++/40405
1542 * pt.c (push_template_decl_real): Set DECL_INTERFACE_KNOWN
1543 if we got the wrong number of template parms.
1544
1545 PR c++/56377
1546 * pt.c (fn_type_unification): Use explicit args in template
1547 instantiation context.
1548
1549 PR c++/56359
1550 * call.c (can_convert_arg): Discard access checks.
1551
1552 PR c++/56395
1553 * tree.c (strip_typedefs): Strip typedefs from TYPENAME_TYPE template
1554 args.
1555
1556 2013-02-20 Paolo Carlini <paolo.carlini@oracle.com>
1557
1558 PR c++/56373
1559 * tree.c (maybe_warn_zero_as_null_pointer_constant): Add.
1560 * cvt.c (ocp_convert): Use the latter.
1561 (cp_convert_to_pointer): Likewise.
1562 * decl.c (check_default_argument): Likewise.
1563 * typeck.c (cp_build_binary_op): Likewise.
1564 * cp-tree.h (maybe_warn_zero_as_null_pointer_constant): Declare.
1565
1566 2013-02-15 Jonathan Wakely <jwakely.gcc@gmail.com>
1567 Paolo Carlini <paolo.carlini@oracle.com>
1568
1569 PR c++/51242
1570 * decl2.c (grokbitfield): Allow scoped enumeration types.
1571
1572 2013-02-15 Jason Merrill <jason@redhat.com>
1573
1574 PR c++/54276
1575 * semantics.c (finish_id_expression): Also return the identifier
1576 for an outer local static.
1577
1578 PR c++/56343
1579 * class.c (check_bases_and_members): Deduce noexcept after
1580 checking bases.
1581
1582 PR c++/52026
1583 * semantics.c (finish_id_expression): In a template, return
1584 the identifier for a constant variable.
1585
1586 2013-02-14 Jason Merrill <jason@redhat.com>
1587
1588 PR c++/54922
1589 * semantics.c (build_anon_member_initialization): New.
1590 (build_data_member_initialization): Use it.
1591
1592 PR c++/55003
1593 * decl.c (cp_finish_decl): Force instantiation of an
1594 auto static data member.
1595
1596 PR c++/55220
1597 * pt.c (unify): A pack expansion that is not the last template
1598 argument makes the entire template argument list non-deduced.
1599
1600 PR c++/56323
1601 * name-lookup.c (do_class_using_decl): Handle typedefs with
1602 inheriting constructors.
1603 (push_class_level_binding_1): Allow inheriting from template
1604 template parameter, too.
1605 * pt.c (tsubst_decl) [USING_DECL]: Likewise.
1606
1607 PR c++/55223
1608 * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Fix handling of
1609 default argument scope.
1610 * mangle.c (write_name): Likewise.
1611
1612 PR c++/55232
1613 * error.c (find_typenames_r): Don't walk into a pack expansion.
1614
1615 2013-02-13 Jason Merrill <jason@redhat.com>
1616
1617 PR c++/55670
1618 * parser.c (cp_parser_member_declaration): Check the declarator
1619 form when detecting a function declaration via typedef.
1620
1621 PR c++/55680
1622 * pt.c (maybe_process_partial_specialization): A lambda
1623 isn't what's being specialized.
1624
1625 PR c++/55710
1626 * semantics.c (maybe_add_lambda_conv_op): Mark static thunk
1627 TREE_USED.
1628
1629 PR c++/55879
1630 * semantics.c (cxx_bind_parameters_in_call): Undo DECL_BY_REFERENCE.
1631
1632 PR c++/55993
1633 * semantics.c (cxx_fold_indirect_ref): Handle empty bases at
1634 non-zero offsets, too.
1635
1636 PR c++/56155
1637 * decl.c (build_enumerator): Always convert the value to a
1638 fixed underlying type.
1639
1640 PR c++/56135
1641 * pt.c (tsubst_copy_and_build): Don't forget any new
1642 captures that arose from use of dependent names.
1643
1644 2013-02-13 Jakub Jelinek <jakub@redhat.com>
1645
1646 PR c++/56302
1647 * semantics.c (finish_asm_stmt): If input constraints allow
1648 neither register nor memory, try maybe_constant_value to get
1649 a constant if possible.
1650
1651 2013-02-12 Jason Merrill <jason@redhat.com>
1652
1653 PR c++/56285
1654 * method.c (add_one_base_init): Handle base constructor
1655 taking rvalue reference parm.
1656
1657 PR c++/56291
1658 * semantics.c (sort_constexpr_mem_initializers): Handle
1659 vptr out of order.
1660
1661 2013-02-09 Jason Merrill <jason@redhat.com>
1662
1663 PR c++/56268
1664 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Call
1665 maybe_instantiate_noexcept.
1666
1667 PR c++/56247
1668 * pt.c (eq_specializations): Set comparing_specializations.
1669 * tree.c (cp_tree_equal): Check it.
1670 * cp-tree.h: Declare it.
1671
1672 * decl.c (decls_match): Check versions later.
1673
1674 PR c++/56238
1675 * pt.c (build_non_dependent_expr): Don't try to fold
1676 instantiation-dependent expressions.
1677 (instantiation_dependent_r) [TRAIT_EXPR]: Split out.
1678 [BIND_EXPR]: Treat as dependent.
1679
1680 2013-02-07 Jakub Jelinek <jakub@redhat.com>
1681
1682 PR c++/56241
1683 * init.c (build_vec_init): Don't append NULL values into new_vec.
1684 (build_zero_init_1): Don't push anything into v if recursive call
1685 returned NULL_TREE.
1686 (build_value_init_noctor): Don't push anything into v if
1687 build_value_init call returned NULL_TREE.
1688
1689 PR c++/56239
1690 * parser.c (cp_parser_token_starts_cast_expression): Renamed to...
1691 (cp_parser_tokens_start_cast_expression): ... this. Change parameter
1692 to cp_parser *, call cp_lexer_peek_token first. For CPP_OPEN_PAREN,
1693 return true only if 2nd token isn't CPP_CLOSE_PAREN.
1694 (cp_parser_cast_expression): Adjust caller.
1695
1696 PR c++/56237
1697 * decl.c (push_local_name): Look at DECL_DISCRIMINATOR (t)
1698 only if DECL_DISCRIMINATOR_SET_P (t) rather than just
1699 DECL_LANG_SPECIFIC (t).
1700
1701 2013-02-07 Jason Merrill <jason@redhat.com>
1702
1703 PR c++/56235
1704 * method.c (do_build_copy_constructor): Don't bother turning
1705 scalars from lvalues to xvalues.
1706 (do_build_copy_assign): Likewise.
1707
1708 2013-02-06 Jason Merrill <jason@redhat.com>
1709
1710 * parser.c (cp_parser_enum_specifier): Check for error_mark_node.
1711
1712 2013-02-05 Jason Merrill <jason@redhat.com>
1713
1714 PR c++/54122
1715 * tree.c (lvalue_kind) [INDIRECT_REF]: Don't check for
1716 METHOD_TYPE.
1717
1718 PR c++/56177
1719 * decl.c (start_preparsed_function): Update restype if we change
1720 decl1.
1721
1722 PR c++/56208
1723 * pt.c (fn_type_unification): Discard any access checks from
1724 substituting explicit args.
1725
1726 2013-01-31 Jason Merrill <jason@redhat.com>
1727
1728 PR c++/56162
1729 PR c++/56104
1730 * typeck.c (get_member_function_from_ptrfunc): Fix
1731 ptrmemfunc_vbit_in_delta case.
1732
1733 2013-01-29 Jason Merrill <jason@redhat.com>
1734
1735 PR libstdc++/54314
1736 * class.c (build_ctor_vtbl_group): Give construction vtables
1737 hidden visibility.
1738
1739 2013-01-25 Jason Merrill <jason@redhat.com>
1740
1741 PR c++/56095
1742 * pt.c (convert_nontype_argument_function): Handle invalid input.
1743 (convert_nontype_argument): Likewise.
1744
1745 PR c++/56104
1746 * typeck.c (get_member_function_from_ptrfunc): Optimize if the
1747 dynamic type has no virtual functions.
1748
1749 2013-01-22 Paolo Carlini <paolo.carlini@oracle.com>
1750
1751 PR c++/55944
1752 * decl.c (check_initializer): Use TARGET_EXPR_DIRECT_INIT_P only
1753 on TARGET_EXPR nodes.
1754
1755 2013-01-22 Jason Merrill <jason@redhat.com>
1756
1757 PR c++/56071
1758 * pt.c (maybe_instantiate_noexcept): Don't defer access checks.
1759
1760 2013-01-22 Dodji Seketeli <dodji@redhat.com>
1761
1762 PR c++/53609
1763 * pt.c (argument_pack_element_is_expansion_p)
1764 (make_argument_pack_select, use_pack_expansion_extra_args_p)
1765 (gen_elem_of_pack_expansion_instantiation): New static functions.
1766 (tsubst): When looking through an ARGUMENT_PACK_SELECT tree node,
1767 look through the possibly resulting pack expansion as well.
1768 (tsubst_pack_expansion): Use use_pack_expansion_extra_p to
1769 generalize when to use the PACK_EXPANSION_EXTRA_ARGS mechanism.
1770 Use gen_elem_of_pack_expansion_instantiation to build the
1771 instantiation piece-wise. Don't use arg_from_parm_pack_p anymore,
1772 as gen_elem_of_pack_expansion_instantiation and the change in
1773 tsubst above generalize this particular case.
1774 (arg_from_parm_pack_p): Remove this for it's not used by
1775 tsubst_pack_expansion anymore.
1776
1777 2013-01-21 Jason Merrill <jason@redhat.com>
1778
1779 PR c++/56059
1780 * tree.c (strip_typedefs_expr) [TREE_VEC]: Preserve non-default
1781 template args count.
1782
1783 2013-01-18 Jason Merrill <jason@redhat.com>
1784
1785 PR target/54908
1786 * decl2.c (get_local_tls_init_fn): New.
1787 (get_tls_init_fn): Handle flag_extern_tls_init. Don't bother
1788 with aliases for internal variables. Don't use weakrefs if
1789 the variable needs destruction.
1790 (generate_tls_wrapper): Mark the wrapper as const if no
1791 initialization is needed.
1792 (handle_tls_init): Don't require aliases.
1793
1794 2013-01-15 Dodji Seketeli <dodji@redhat.com>
1795
1796 PR c++/55663
1797 * pt.c (coerce_innermost_template_parms): New static function.
1798 (instantiate_alias_template): Use it here.
1799
1800 2013-01-09 Jason Merrill <jason@redhat.com>
1801
1802 PR c++/55878
1803 * rtti.c (build_typeid, get_typeid): Add complain parm.
1804 (get_tinfo_decl_dynamic): Likewise.
1805 * cp-tree.h, parser.c, pt.c: Adjust.
1806
1807 PR c++/55893
1808 * decl.c (cp_finish_decl): Clear TREE_READONLY if the variable
1809 needs destruction.
1810
1811 2013-01-09 Jakub Jelinek <jakub@redhat.com>
1812
1813 PR c/48418
1814 * typeck.c (cp_build_binary_op): For LSHIFT_EXPR and RSHIFT_EXPR,
1815 call maybe_constant_value for the negative or too big shift
1816 count warnings.
1817
1818 2013-01-09 Paolo Carlini <paolo.carlini@oracle.com>
1819
1820 PR c++/55801
1821 * decl2.c (var_needs_tls_wrapper): Return false when error_operand_p
1822 of the argument is true.
1823
1824 2013-01-08 Joel Brobecker <brobecker@adacore.com>
1825
1826 * parser.c (cp_parser_initializer_list): Move declaration
1827 of variable non_const to start of lexical block.
1828
1829 2013-01-07 Jason Merrill <jason@redhat.com>
1830
1831 PR c++/55753
1832 * tree.c (build_aggr_init_expr): Do nothing in a template.
1833 * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Strip an ADDR_EXPR off
1834 a FUNCTION_DECL before tsubsting.
1835
1836 2013-01-04 Dodji Seketeli <dodji@redhat.com>
1837
1838 PR c++/52343
1839 * pt.c (check_instantiated_arg): Allow type template arguments.
1840
1841 2013-01-04 Jason Merrill <jason@redhat.com>
1842
1843 PR c++/55877
1844 * decl.c (reset_type_linkage, bt_reset_linkage): New.
1845 (grokdeclarator): Use reset_type_linkage.
1846 * name-lookup.c (binding_table_foreach): Handle null table.
1847 * tree.c (decl_anon_ns_mem_p): Check TYPE_MAIN_DECL, not TYPE_NAME.
1848
1849 2013-01-04 Paolo Carlini <paolo.carlini@oracle.com>
1850
1851 PR c++/54526 (again)
1852 * parser.c (cp_parser_template_id): Revert core of previous change
1853 (keep adjusted inform message).
1854
1855 2013-01-03 Jason Merrill <jason@redhat.com>
1856
1857 PR c++/55419
1858 PR c++/55753
1859 * pt.c (tsubst_copy_and_build) [TARGET_EXPR]: Don't touch
1860 TREE_CONSTANT.
1861
1862 PR c++/55842
1863 * semantics.c (trait_expr_value): Call maybe_instantiate_noexcept.
1864
1865 PR c++/55856
1866 * semantics.c (build_data_member_initialization): Handle DECL_EXPR.
1867
1868 PR c++/53650
1869 * call.c (type_has_extended_temps): New.
1870 * cp-tree.h: Declare it.
1871 * decl.c (check_initializer): Use build_aggr_init for arrays
1872 if it is false.
1873 * init.c (build_vec_init): Avoid mixed signed/unsigned arithmetic.
1874
1875 2013-01-02 Jason Merrill <jason@redhat.com>
1876
1877 PR c++/54325
1878 * call.c (build_new_method_call_1): Don't use build_value_init for
1879 user-provided default constructors.
1880
1881 * decl.c (check_default_argument): Use LOOKUP_IMPLICIT.
1882
1883 PR c++/55032
1884 PR c++/55245
1885 * tree.c (build_cplus_array_type): Copy layout information
1886 to main variant if necessary.
1887 \f
1888 Copyright (C) 2013 Free Software Foundation, Inc.
1889
1890 Copying and distribution of this file, with or without modification,
1891 are permitted in any medium without royalty provided the copyright
1892 notice and this notice are preserved.