1 2013-12-23 Stuart Hastings <stuart@apple.com>
2 Bill Maddox <maddox@google.com>
3 Jason Merrill <jason@redhat.com>
6 * optimize.c (can_alias_cdtor, populate_clone_array): Split out
8 (maybe_thunk_body): New function.
9 (maybe_clone_body): Call it.
10 * mangle.c (write_mangled_name): Remove code to suppress
11 writing of mangled name for cloned constructor or destructor.
12 (write_special_name_constructor): Handle decloned constructor.
13 (write_special_name_destructor): Handle decloned destructor.
14 * method.c (trivial_fn_p): Handle decloning.
15 * semantics.c (expand_or_defer_fn_1): Clone after setting linkage.
17 2013-12-23 Marek Polacek <polacek@redhat.com>
20 * search.c (lookup_conversions): Return NULL_TREE if !CLASS_TYPE_P.
22 2013-12-20 Trevor saunders <tsaunders@mozilla.com>
24 * semantics.c (build_anon_member_initialization): Replace
25 stack_vec<T, N> with auto_vec<T, N>.
27 2013-12-18 Balaji V. Iyer <balaji.v.iyer@intel.com>
29 * parser.c (cp_parser_cilk_simd_clause_name): Changed cilk_clause_name
32 2013-12-17 Thomas Schwinge <thomas@codesourcery.com>
34 * parser.c (cp_parser_omp_parallel): Fix description.
36 2013-12-12 Jason Merrill <jason@redhat.com>
39 * pt.c (resolve_overloaded_unification): Use instantiate_template.
41 2013-12-12 Jakub Jelinek <jakub@redhat.com>
44 * class.c (resolve_address_of_overloaded_function): Don't call ggc_free
47 2013-12-11 Balaji V. Iyer <balaji.v.iyer@intel.com>
49 * cp-tree.h (cilk_valid_spawn): New prototype.
50 (gimplify_cilk_spawn): Likewise.
51 (create_try_catch_expr): Likewise.
52 * decl.c (finish_function): Insert Cilk function-calls when a
53 _Cilk_spawn is used in a function.
54 * parser.c (cp_parser_postfix_expression): Added RID_CILK_SPAWN and
56 * cp-cilkplus.c (set_cilk_except_flag): New function.
57 (set_cilk_except_data): Likewise.
58 (cilk_install_body_with_frame_cleanup): Likewise.
59 * except.c (create_try_catch_expr): Likewise.
60 * parser.h (IN_CILK_SPAWN): New #define.
61 * pt.c (tsubst_expr): Added CILK_SPAWN_STMT and CILK_SYNC_STMT cases.
62 * semantics.c (potential_constant_expression_1): Likewise.
63 * typeck.c (cp_build_compound_expr): Reject a spawned function in a
65 (check_return_expr): Reject a spawned function in a return expression.
66 * cp-gimplify.c (cp_gimplify_expr): Added a CILK_SPAWN_STMT and
67 CALL_EXPR case. Added handling of spawned function in MODIFY_EXPR
70 2013-12-09 Paolo Carlini <paolo.carlini@oracle.com>
73 * parser.c (cp_parser_cache_defarg): sizeof ... ( p ) can
74 occur in a default argument too.
76 2013-12-06 Caroline Tice <cmtice@google.com>
78 Submitting patch from Stephen Checkoway, s@cs.jhu.edu
79 * vtable-class-hierarchy.c (init_functions): Make the libvtv
80 function decls externally visible.
82 2013-12-06 Oleg Endo <olegendo@gcc.gnu.org>
84 * decl2.c: Remove struct tags when referring to class varpool_node.
86 2013-12-05 Jason Merrill <jason@redhat.com>
90 * pt.c (most_specialized_class): Use the partially instantiated
91 template for deduction. Drop the TMPL parameter.
93 2013-12-05 Paolo Carlini <paolo.carlini@oracle.com>
95 * decl.c (duplicate_decls): Replace pairs of errors and permerrors
96 with error + inform (permerror + inform, respectively).
98 2013-12-04 Joseph Myers <joseph@codesourcery.com>
101 * typeck.c (cxx_sizeof_or_alignof_type): Update call to
102 c_sizeof_or_alignof_type.
104 2013-12-04 Jakub Jelinek <jakub@redhat.com>
107 * pt.c (tsubst_copy_and_build): Handle POINTER_PLUS_EXPR.
109 2013-11-29 Marek Polacek <polacek@redhat.com>
112 * decl.c (compute_array_index_type): Don't build COMPOUND_EXPR for
115 2013-11-28 Jakub Jelinek <jakub@redhat.com>
118 * semantics.c (finish_omp_atomic): Call finish_expr_stmt
119 rather than add_stmt.
121 2013-11-28 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
123 * g++spec.c (TIMELIB): Define.
124 (WITHLIBC, SKIPOPT): Adjust values.
125 (lang_specific_driver): Add TIME_LIBRARY if not passed explicitly.
127 2013-11-28 Jakub Jelinek <jakub@redhat.com>
130 * parser.c (cp_parser_omp_target): Call keep_next_level only
133 2013-11-27 Paolo Carlini <paolo.carlini@oracle.com>
136 * semantics.c (cxx_eval_constant_expression, [COMPONENT_REF]):
137 Handle function COMPONENT_REFs.
139 2013-11-27 Aldy Hernandez <aldyh@redhat.com>
140 Jakub Jelinek <jakub@redhat.com>
142 * semantics.c (finish_omp_clauses): For #pragma omp declare simd
143 linear clause step call maybe_constant_value.
145 2013-11-27 Tom de Vries <tom@codesourcery.com>
146 Marc Glisse <marc.glisse@inria.fr>
149 * typeck.c (cp_build_unary_op): Allow vector increment and decrement.
151 2013-11-27 Tom de Vries <tom@codesourcery.com>
152 Marc Glisse <marc.glisse@inria.fr>
155 * semantics.c (cxx_fold_indirect_ref): Don't create out-of-bounds
158 2013-11-26 Jakub Jelinek <jakub@redhat.com>
161 * parser.c (cp_parser_late_parsing_for_member): For OpenMP UDRs
162 pass 2 instead of 0 to finish_function.
164 2013-11-26 Paolo Carlini <paolo.carlini@oracle.com>
167 * decl.c (grokdeclarator): Don't try to pass declarator->id_loc
168 to build_lang_decl_loc when declarator is null.
170 2013-11-26 Paolo Carlini <paolo.carlini@oracle.com>
172 * cvt.c (cp_convert_and_check): Avoid calling cp_convert
175 2013-11-25 Paolo Carlini <paolo.carlini@oracle.com>
178 * decl.c (duplicate_decls): Enforce 8.3.6/6 about default arguments
179 for member functions of class templates.
181 2013-11-25 Paolo Carlini <paolo.carlini@oracle.com>
184 * semantics.c (check_constexpr_ctor_body): Check for BIND_EXPR_VARS.
186 2013-11-25 Paolo Carlini <paolo.carlini@oracle.com>
189 * decl.c (grokdeclarator): Don't handle qualified free functions here,
190 leave the diagnostic to grokfndecl.
192 2013-11-25 Paolo Carlini <paolo.carlini@oracle.com>
195 * pt.c (unify): Don't call unify_array_domain with a NULL_TREE
199 * pt.c (apply_late_template_attributes): Check that TREE_VALUE
200 isn't NULL_TREE in the attribute_takes_identifier_p case.
202 2013-11-25 Adam Butcher <adam@jessamine.co.uk>
206 * parser.c (cp_parser_parameter_declaration_clause): Disallow implicit
207 function templates in local functions unless defining a lambda.
209 2013-11-23 Easwaran Raman <eraman@google.com>
212 * call.c (build_new_method_call_1): Comnpare function context
213 with BASELINK_BINFO type rather than instance type before
214 marking the call with LOOKUP_NONVIRTUAL.
216 2013-11-23 Jason Merrill <jason@redhat.com>
219 * init.c (build_aggr_init): Don't clobber the type of init
220 if we got an INIT_EXPR back from build_vec_init.
221 (build_vec_init): Do digest_init on trivial initialization.
223 2013-11-23 Alexander Ivchenko <alexander.ivchenko@intel.com>
226 * call.c (build_operator_new_call): Add flag_exceptions check.
227 * decl.c (compute_array_index_type): Ditto.
228 * init.c (build_new_1): Ditto.
229 (build_vec_init): Ditto.
231 2013-11-22 Jakub Jelinek <jakub@redhat.com>
233 * cp-gimplify.c: Include target.h and c-family/c-ubsan.h.
234 (cp_ubsan_maybe_instrument_return): New function.
235 (cp_genericize): Call it if -fsanitize=return.
237 * decl2.c: Include asan.h.
238 (one_static_initialization_or_destruction): If -fsanitize=address,
239 init is non-NULL and guard is NULL, set
240 vnode->dynamically_initialized.
241 (do_static_initialization_or_destruction): Call
242 __asan_{before,after}_dynamic_init around the static initialization.
244 2013-11-22 Andrew MacLeod <amacleod@redhat.com>
246 * class.c: Add required include files from gimple.h.
247 * cp-gimplify.c: Likewise
250 * optimize.c: Likewise
252 * semantics.c: Likewise
255 * vtable-class-hierarchy.c: Likewise
257 2013-11-22 David Malcolm <dmalcolm@redhat.com>
259 * call.c (build_integral_nontype_arg_conv): Remove use of
260 EXPR_LOC_OR_HERE macro.
261 (convert_like_real): Likewise.
262 (convert_arg_to_ellipsis): Likewise.
263 (build_cxx_call): Likewise.
264 (perform_implicit_conversion_flags): Likewise.
265 (initialize_reference): Likewise.
266 * cvt.c (cp_convert_to_pointer): Likewise.
267 (convert_to_reference): Likewise.
268 (ocp_convert): Likewise.
269 (convert_to_void): Likewise.
270 * decl.c (pop_label): Update comment.
271 (pop_switch): Remove use of EXPR_LOC_OR_HERE macro.
272 (check_tag_decl): Remove use of in_system_header macro.
273 (make_rtl_for_nonlocal_decl): Remove use of input_filename
275 (compute_array_index_type): Remove use of in_system_header
277 (grokdeclarator): Likewise.
278 * error.c (dump_global_iord): Remove use of input_filename
280 (location_of): Remove use of EXPR_LOC_OR_HERE macro.
281 (maybe_warn_cpp0x): Remove use of in_system_header macro.
282 * init.c (build_new_1): Remove use of EXPR_LOC_OR_HERE macro.
283 * lex.c (handle_pragma_interface): Remove use of input_filename
285 (handle_pragma_implementation): Likewise.
286 (cxx_make_type): Likewise.
287 (in_main_input_context): Likewise.
288 * name-lookup.c (push_binding_level): Remove use of
290 (leave_scope): Likewise.
291 (resume_scope): Likewise.
292 * parser.c (cp_parser_unqualified_id): Remove use of
293 in_system_header macro.
294 (cp_parser_cast_expression): Likewise.
295 (cp_parser_declaration_seq_opt): Likewise.
296 (cp_parser_enumerator_list): Likewise.
297 (cp_parser_parameter_declaration_clause): Likewise.
298 (cp_parser_exception_specification_opt): Likewise.
299 * pt.c (unify_arg_conversion): Remove use of EXPR_LOC_OR_HERE
301 (convert_nontype_argument): Likewise.
302 (push_tinst_level): Remove use of in_system_header macro.
303 (tsubst_copy_and_build): Remove use of EXPR_LOC_OR_HERE
305 (do_decl_instantiation): Remove use of in_system_header macro.
306 (do_type_instantiation): Likewise.
307 * semantics.c (finish_call_expr): Remove use of EXPR_LOC_OR_HERE
309 (begin_class_definition): Remove use of input_filename macro.
310 (cxx_eval_call_expression): Remove use of EXPR_LOC_OR_HERE
312 (cxx_eval_constant_expression): Likewise.
313 (potential_constant_expression_1): Likewise.
314 * typeck.c (decay_conversion): Likewise.
315 (rationalize_conditional_expr): Likewise.
316 (build_x_compound_expr_from_list): Likewise.
317 (convert_for_assignment): Likewise.
318 * typeck2.c (check_narrowing): Likewise.
320 2013-11-22 Trevor Saunders <tsaunders@mozilla.com>
322 * parser.c, semantics.c: Change some local variables from vec to
323 auto_vec or stack_vec.
325 2013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
327 * decl.c (reshape_init_array_1): Use tree_to_uhwi rather than
329 (grokdeclarator): Update comment to refer to tree_to_[su]hwi rather
332 2013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
334 * call.c, class.c, decl.c, error.c: Replace tree_low_cst (..., 1) with
335 tree_to_uhwi throughout.
337 2013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
339 * class.c, dump.c, error.c, init.c, method.c, parser.c, semantics.c:
340 Replace tree_low_cst (..., 0) with tree_to_shwi throughout.
342 2013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
344 * decl.c: Replace host_integerp (..., 1) with tree_fits_uhwi_p
347 2013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
349 * error.c, init.c, parser.c, semantics.c: Replace
350 host_integerp (..., 0) with tree_fits_shwi_p throughout.
352 2013-11-17 Paolo Carlini <paolo.carlini@oracle.com>
355 * decl.c (validate_constexpr_redeclaration): Redeclarations of
356 variables can differ in constexpr.
358 2013-11-16 Paolo Carlini <paolo.carlini@oracle.com>
361 * semantics.c (finish_call_expr): Ensure that for OVERLOADs too
362 '(&f)(...)' is the same as '(f)(...)', per 13.3.1.1.
364 2013-11-15 Aldy Hernandez <aldyh@redhat.com>
366 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Depend on cp/cp-cilkplus.o.
367 * cp-cilkplus.c: New file.
368 * cp-tree.h (cpp_validate_cilk_plus_loop): Protoize.
369 * parser.c (cp_parser_cilk_simd): New.
370 (cp_debug_parser): Add case for IN_CILK_SIMD_FOR.
371 (cp_parser_jump_statement): Same.
372 (cp_parser_omp_for_cond): Add new argument.
373 Add case for NE_EXPR.
374 (cp_parser_omp_for_loop): Pass new argument to
375 cp_parser_omp_for_cond.
376 Handle CILK_SIMD nodes.
377 Abstract initilization code to..
378 (cp_parser_omp_for_loop_init): ...here.
379 (cp_parser_pragma): Add case for PRAGMA_CILK_SIMD.
380 (cp_parser_cilk_simd_vectorlength): New.
381 (cp_parser_cilk_simd_linear): New.
382 (cp_parser_cilk_simd_clause_name): New.
383 (cp_parser_cilk_simd_all_clauses): New.
384 (cp_parser_cilk_simd): New.
385 * parser.h (IN_CILK_SIMD_FOR): New macro.
386 * pt.c (tsubst_expr): Add case for CILK_SIMD.
387 * typeck2.c (cxx_readonly_error): Pass location argument to
390 2013-11-14 Paolo Carlini <paolo.carlini@oracle.com>
393 * parser.c (cp_parser_late_parsing_nsdmi): Call
394 maybe_begin_member_template_processing.
395 * pt.c (maybe_begin_member_template_processing): Handle NSDMIs.
396 (inline_needs_template_parms): Adjust.
398 2013-11-14 Andrew MacLeod <amacleod@redhat.com>
400 * class.c: Include only gimplify.h and gimple.h as needed.
401 * cp-gimplify.c: Likewise.
404 * optimize.c: Likewise.
406 * semantics.c: Likewise.
408 * vtable-class-hierarchy.c: Likewise.
410 2013-11-14 Diego Novillo <dnovillo@google.com>
412 * call.c: Include stor-layout.h.
414 Include stringpool.h.
415 * class.c: Include stringpool.h.
416 Include stor-layout.h.
418 * cp-gimplify.c: Include stor-layout.h.
419 * cvt.c: Include stor-layout.h.
420 * decl.c: Include stringpool.h.
421 Include stor-layout.h.
425 * decl2.c: Include stringpool.h.
428 Include stor-layout.h.
430 * error.c: Include stringpool.h.
431 * except.c: Include stringpool.h.
434 * init.c: Include stringpool.h.
436 * lambda.c: Include stringpool.h.
437 * lex.c: Include stringpool.h.
438 * mangle.c: Include stor-layout.h.
439 Include stringpool.h.
440 * method.c: Include stringpool.h.
442 * name-lookup.c: Include stringpool.h.
443 Include print-tree.h.
445 * optimize.c: Include stringpool.h.
446 * parser.c: Include print-tree.h.
447 Include stringpool.h.
450 * pt.c: Include stringpool.h.
453 Include stor-layout.h.
454 * ptree.c: Include print-tree.h.
455 * repo.c: Include stringpool.h.
456 * rtti.c: Include stringpool.h.
457 Include stor-layout.h.
458 * semantics.c: Include stmt.h.
460 Include stor-layout.h.
461 Include stringpool.h.
462 * tree.c: Include stor-layout.h.
463 Include print-tree.h.
464 Include tree-iterator.h.
465 * typeck.c: Include stor-layout.h.
467 * typeck2.c: Include stor-layout.h.
469 * vtable-class-hierarchy.c: Include stringpool.h.
470 Include stor-layout.h.
472 2013-11-12 Andrew MacLeod <amacleod@redhat.com>
474 * class.c: Include gimplify.h.
475 * cp-gimplify.c: Likewise.
478 * optimize.c: Likewise.
480 * semantics.c: Likewise.
482 * vtable-class-hierarchy.c: Likewise.
483 * decl2.c: Don't include gimple.h.
484 * except.c: Likewise.
485 * method.c: Include pointer-set.h instead of gimple.h.
487 2013-11-12 Adam Butcher <adam@jessamine.co.uk>
489 * pt.c (convert_generic_types_to_packs): New function to transform
490 a range of implicitly introduced non-pack template parms to be parameter
492 * cp-tree.h (convert_generic_types_to_packs): Declare.
493 * parser.c (cp_parser_parameter_declaration_list): If a function
494 parameter pack contains generic types, convert them to packs prior to
497 2013-11-12 Adam Butcher <adam@jessamine.co.uk>
504 * parser.h (struct cp_parser): New members implicit_template_parms,
505 implicit_template_scope and auto_is_implicit_function_template_parm_p.
506 * parser.c (add_implicit_template_parms): Refactor as ...
507 (synthesize_implicit_template_parm): ... this to append a new template
508 type parm to the current template parameter list (introducing a new list
509 if necessary). Removed push_deferring_access_checks.
510 (finish_fully_implicit_template): Removed pop_deferring_access_checks.
511 (cp_parser_new): Initialize new cp_parser members.
512 (cp_parser_parameter_declaration_clause): Consider auto as implicit
513 template parm when parsing a parameter declaration (unless parsing an
514 explicit specialization).
515 (cp_parser_parameter_declaration_list): Remove local
516 implicit_template_parms counter and reset cp_parser implicit template
518 (cp_parser_lambda_expression): Reset implicit template cp_parser members
519 whilst generating lambda class.
520 (cp_parser_function_definition_after_declarator): Reset implicit
521 template cp_parser members whilst parsing function definition.
522 (make_generic_type_name): Respell '<autoN>' as 'auto:N' which works
523 better with template diagnostics.
524 (cp_parser_simple_type_specifier): Synthesize implicit template parm on
525 parsing 'auto' if auto_is_implicit_function_template_parm_p and provide
527 * decl.c (grokdeclarator): ... that were previously done here.
529 2013-11-12 Paolo Carlini <paolo.carlini@oracle.com>
532 * pt.c (lookup_template_class_1): Handle alias template declarations
533 of enumeration types.
535 2013-11-10 Paolo Carlini <paolo.carlini@oracle.com>
537 * cvt.c (cp_convert_to_pointer): Call build_ptrmemfunc before
538 maybe_warn_zero_as_null_pointer_constant to avoid duplicate
539 -Wzero-as-null-pointer-constant diagnostics.
541 * typeck.c (build_ptrmemfunc): Use cp_build_c_cast.
543 2013-11-06 Paolo Carlini <paolo.carlini@oracle.com>
546 * init.c (build_new_1): Don't call build_java_class_ref on non-class
549 2013-11-05 Jason Merrill <jason@redhat.com>
552 * decl.c (check_initializer): Don't use build_vec_init for arrays
555 2013-11-05 Paolo Carlini <paolo.carlini@oracle.com>
558 * name-lookup.c (handle_namespace_attrs): Use get_attribute_name.
560 2013-11-05 Tobias Burnus <burnus@net-b.de>
562 * parser.c (cp_parser_omp_for, cp_parser_omp_parallel,
563 cp_parser_omp_distribute, cp_parser_omp_teams, cp_parser_omp_target,
564 cp_parser_omp_declare): Handle -fopenmp-simd.
566 2013-11-04 Eric Botcazou <ebotcazou@adacore.com>
568 * decl2.c (cpp_check): Change type of first parameter and deal with
571 2013-11-03 Paolo Carlini <paolo.carlini@oracle.com>
574 * parser.c (cp_parser_constructor_declarator_p): Check that the
575 class-name matches current_class_type.
577 2013-11-03 Marek Polacek <polacek@redhat.com>
579 * decl.c (cp_finish_decl): Move C++1y bounds checking...
580 (compute_array_index_type): ...here. Add VLA instrumentation.
581 Call stabilize_vla_size.
582 (grokdeclarator): Don't call stabilize_vla_size here.
584 2013-11-02 Paolo Carlini <paolo.carlini@oracle.com>
588 * parser.c (cp_parser_cast_expression): If we aren't looking at
589 a cast-expression don't call cp_parser_type_id.
590 (cp_parser_postfix_expression): Likewise for compound-literal.
591 (cp_parser_tokens_start_cast_expression): Adjust.
593 2013-11-01 Edward Smith-Rowland <3dw4rd@verizon.net>
596 * parser.c (make_string_pack): Discover non-const type and size
597 of character and build parm pack with correct type and chars.
599 2013-11-01 Trevor Saunders <tsaunders@mozilla.com>
601 * semantics.c (build_anon_member_initialization): Convert fields to be
604 2013-11-01 Marc Glisse <marc.glisse@inria.fr>
607 * pt.c (type_dependent_expression_p): Handle null argument.
609 2013-11-01 Jakub Jelinek <jakub@redhat.com>
611 * semantics.c (finish_omp_clauses) <case OMP_CLAUSE_UNIFORM>: Go to
612 check_dup_generic at the end, unless remove is true.
613 (finish_omp_clauses) <case OMP_CLAUSE_LINEAR>: Add break; after
616 2013-10-31 Jakub Jelinek <jakub@redhat.com>
618 * semantics.c (finish_omp_clauses): Diagnose aligned clause
619 with decl that is not pointer nor array nor reference to those.
621 2013-10-31 Jason Merrill <jason@redhat.com>
623 * semantics.c (cxx_eval_call_expression): Handle trivial
624 value-initialization.
625 * typeck2.c (store_init_value): Call maybe_constant_init after
628 * decl.c (cxx_maybe_build_cleanup): Always set LOOKUP_NONVIRTUAL.
629 * decl2.c (build_cleanup): Just call cxx_maybe_build_cleanup.
632 * parser.c (cp_parser_late_parse_one_default_arg): Set
633 TARGET_EXPR_DIRECT_INIT_P.
635 * class.c (type_build_ctor_call): Return early in C++98 mode.
636 (type_build_dtor_call): Likewise.
638 2013-10-31 Paolo Carlini <paolo.carlini@oracle.com>
642 2013-10-18 Paolo Carlini <paolo.carlini@oracle.com>
645 * pt.c (most_specialized_class): Bump processing_template_decl for
648 2013-10-30 Paolo Carlini <paolo.carlini@oracle.com>
651 * call.c (build_over_call): Check return value of mark_used.
653 2013-10-30 Jason Merrill <jason@redhat.com>
655 * semantics.c (finish_compound_literal): Don't create a static variable
656 inside cp_unevaluated_operand.
658 * init.c (push_base_cleanups): Check ANON_AGGR_TYPE_P.
660 2013-10-30 Tobias Burnus <burnus@net-b.de>
663 * cp-tree.h (RANGE_FOR_IVDEP): Define.
664 (cp_convert_range_for, finish_while_stmt_cond, finish_do_stmt,
665 finish_for_cond): Take 'bool ivdep' parameter.
666 * cp-array-notation.c (create_an_loop): Update call.
667 * init.c (build_vec_init): Ditto.
668 * pt.c (tsubst_expr): Ditto.
669 * parser.c (cp_parser_iteration_statement, cp_parser_for,
670 cp_parser_range_for, cp_convert_range_for): Update calls.
671 (cp_parser_pragma): Accept GCC ivdep for 'while' and 'do'.
672 * semantics.c (finish_while_stmt_cond, finish_do_stmt,
673 finish_for_cond): Optionally build ivdep annotation.
675 2013-10-30 Jason Merrill <jason@redhat.com>
677 * decl.c (cp_finish_decl): Never throw for VLA bound == 0.
679 2013-10-29 David Malcolm <dmalcolm@redhat.com>
681 Patch autogenerated by refactor_symtab.py from
682 https://github.com/davidmalcolm/gcc-refactoring-scripts
683 revision 58bb219cc090b2f4516a9297d868c245495ee622
685 * call.c (mark_versions_used): Update for conversion of symtab types
686 to a true class hierarchy.
687 * decl2.c (cp_write_global_declarations): Likewise.
688 (clear_decl_external): Likewise.
689 (build_java_method_aliases): Likewise.
690 (collect_candidates_for_java_method_aliases): Likewise.
691 (mark_needed): Likewise.
692 (var_finalized_p): Likewise.
693 (maybe_make_one_only): Likewise.
694 (maybe_emit_vtables): Likewise.
695 * lambda.c (maybe_add_lambda_conv_op): Likewise.
696 * method.c (use_thunk): Likewise.
697 * optimize.c (maybe_clone_body): Likewise.
698 * tree.c (cp_fix_function_decl_p): Likewise.
700 2013-10-29 Paolo Carlini <paolo.carlini@oracle.com>
703 * decl2.c (grokfield): Handle auto like NSDMI.
705 2013-10-25 Paolo Carlini <paolo.carlini@oracle.com>
708 * pt.c (check_template_shadow): Don't skip declarations in inline
711 2013-10-25 Tobias Burnus <burnus@net-b.de>
714 * parser.c (cp_parser_iteration_statement,
715 cp_parser_for, cp_parser_c_for, cp_parser_pragma): Handle
718 2013-10-24 Marek Polacek <polacek@redhat.com>
721 * typeck2.c (check_narrowing): Don't check narrowing when the scalar
722 initializer is empty.
724 2013-10-23 Jason Merrill <jason@redhat.com>
727 * method.c (defaulted_late_check): Delete on eh-spec mismatch.
728 (maybe_explain_implicit_delete): Explain it.
730 * error.c (eh_spec_to_string): New.
731 (cp_printer): Use it for %X.
733 In C++11 a trivial [cd]tor might not be callable.
734 * class.c (user_provided_p): A function deleted on its declation
735 in the class is not user-provided.
736 (type_build_ctor_call): Also force a ctor call if we
737 might have a deleted or private trivial ctor.
738 (type_build_dtor_call): New.
739 (deduce_noexcept_on_destructors): Remove obsolete code.
740 * cp-tree.h: Declare type_build_dtor_call.
741 * decl.c (expand_static_init): Make sure trivial dtors are callable.
742 (cxx_maybe_build_cleanup): Likewise.
743 * except.c (build_throw): Likewise.
744 * init.c (build_value_init): Handle trivial but not callable ctors.
745 (perform_target_ctor): Make sure trivial dtor is callable.
746 (perform_member_init): Likewise.
747 (expand_cleanup_for_base): Likewise.
748 (build_vec_delete_1): Likewise.
749 (build_delete): Likewise.
750 (push_base_cleanups): Likewise.
751 (build_new_1): Avoid redundant error.
752 * method.c (synthesized_method_walk): Can't ever exit early in C++11.
753 Always process the subobject destructor.
754 * semantics.c (finish_compound_literal): Make sure trivial dtor is
756 * typeck2.c (split_nonconstant_init): Likewise.
758 2013-10-23 Edward Smith-Rowland <3dw4rd@verizon.net>
760 Implement C++14 [[deprecated]] modulo [[gnu::deprecated]] bugs.
761 * parser.c (cp_parser_std_attribute): Interpret [[deprecated]]
762 as [[gnu::deprecated]].
764 2013-10-22 Paolo Carlini <paolo.carlini@oracle.com>
767 * pt.c (apply_late_template_attributes): Use get_attribute_name,
770 2013-10-18 Paolo Carlini <paolo.carlini@oracle.com>
773 * pt.c (most_specialized_class): Bump processing_template_decl for
776 2013-10-18 Paolo Carlini <paolo.carlini@oracle.com>
778 * parser.c (cp_parser_lookup_name): Tidy.
780 2013-10-17 Andrew MacLeod <amacleod@redhat.com>
782 * parser.c: Include omp-low.h.
783 * semantics.c: Likewise.
785 2013-10-17 Paolo Carlini <paolo.carlini@oracle.com>
788 * lambda.c (lambda_expr_this_capture): Handle NSDMIs in the
789 cp_unevaluated_operand case.
791 2013-10-16 Jason Merrill <jason@redhat.com>
793 * pt.c (apply_late_template_attributes): Use
794 attribute_takes_identifier_p.
796 * error.c (dump_exception_spec): Print "noexcept" rather than
800 * pt.c (unify_array_domain): Split out from unify.
801 (unify): Use it for list deduction, too.
804 * decl2.c (dump_tu): Split out from...
805 (cp_write_global_declarations): ...here. Call it in PCH mode.
807 2013-10-16 Paolo Carlini <paolo.carlini@oracle.com>
809 * pt.c (tsubst): Fix typo in last commit.
811 2013-10-16 Paulo Matos <pmatos@broadcom.com>
813 * error.c (code_to_string): Use new wrapper get_tree_code_name.
814 * cxx-pretty-print.c (pp_cxx_assignment_operator): Likewise.
815 * pt.c (tsubst): Likewise.
816 * semantics.c (cxx_eval_constant_expression,
817 potential_constant_expression_1): Likewise.
818 * mangle.c (MANGLE_TRACE_TREE, dump_substitution_candidates,
819 add_substitution, find_substitution): Likewise.
821 2013-10-15 Paolo Carlini <paolo.carlini@oracle.com>
824 * parser.c (cp_parser_postfix_open_square_expression): Set
825 parser->greater_than_is_operator_p for the argument.
827 2013-10-11 Paolo Carlini <paolo.carlini@oracle.com>
830 * parser.c (cp_parser_commit_to_topmost_tentative_parse): New.
831 (cp_parser_pseudo_destructor_name): Use it.
833 2013-10-11 Paolo Carlini <paolo.carlini@oracle.com>
836 * pt.c (convert_nontype_argument): Set expr_type to
837 TREE_TYPE (probe_type).
839 2013-10-11 Jakub Jelinek <jakub@redhat.com>
841 * decl.c (duplicate_decls): Error out for redeclaration of UDRs.
842 (declare_simd_adjust_this): New function.
843 (grokfndecl): If "omp declare simd" attribute is present,
844 call declare_simd_adjust_this if needed and
845 c_omp_declare_simd_clauses_to_numbers.
846 * cp-array-notation.c (expand_array_notation_exprs): Handle
848 * cp-gimplify.c (cp_gimplify_expr): Handle OMP_SIMD and
849 OMP_DISTRIBUTE. Handle is_invisiref_parm decls in
850 OMP_CLAUSE_REDUCTION.
851 (cp_genericize_r): Handle OMP_SIMD and OMP_DISTRIBUTE like
853 (cxx_omp_privatize_by_reference): Return true for
854 is_invisiref_parm decls.
855 (cxx_omp_finish_clause): Adjust cxx_omp_create_clause_info
857 * pt.c (apply_late_template_attributes): For "omp declare simd"
858 attribute call tsubst_omp_clauses,
859 c_omp_declare_simd_clauses_to_decls, finish_omp_clauses
860 and c_omp_declare_simd_clauses_to_numbers.
861 (instantiate_class_template_1): Call cp_check_omp_declare_reduction
863 (tsubst_decl): Handle UDRs.
864 (tsubst_omp_clauses): Add declare_simd argument, if true don't
865 call finish_omp_clauses. Handle new OpenMP 4.0 clauses.
866 Handle non-NULL OMP_CLAUSE_REDUCTION_PLACEHOLDER on
867 OMP_CLAUSE_REDUCTION.
868 (tsubst_expr): For UDRs call pushdecl and
869 cp_check_omp_declare_reduction. Adjust tsubst_omp_clauses
870 callers. Handle OMP_SIMD, OMP_DISTRIBUTE, OMP_TEAMS,
871 OMP_TARGET_DATA, OMP_TARGET_UPDATE, OMP_TARGET, OMP_TASKGROUP.
872 Adjust finish_omp_atomic caller.
873 (tsubst_omp_udr): New function.
874 (instantiate_decl): For UDRs at block scope, don't call
875 start_preparsed_function/finish_function. Call tsubst_omp_udr.
876 * semantics.c (cxx_omp_create_clause_info): Add need_dtor argument,
877 use it instead of need_default_ctor || need_copy_ctor.
878 (struct cp_check_omp_declare_reduction_data): New type.
879 (handle_omp_array_sections_1, handle_omp_array_sections,
880 omp_reduction_id, omp_reduction_lookup,
881 cp_remove_omp_priv_cleanup_stmt, cp_check_omp_declare_reduction_r,
882 cp_check_omp_declare_reduction, clone_omp_udr,
883 find_omp_placeholder_r, finish_omp_reduction_clause): New functions.
884 (finish_omp_clauses): Handle new OpenMP 4.0 clauses and user defined
886 (finish_omp_for): Add CODE argument, use it instead of hardcoded
887 OMP_FOR. Adjust c_finish_omp_for caller.
888 (finish_omp_atomic): Add seq_cst argument, adjust
889 c_finish_omp_atomic callers, handle seq_cst and new OpenMP 4.0
891 (finish_omp_cancel, finish_omp_cancellation_point): New functions.
892 * decl2.c (mark_used): Force immediate instantiation of
893 DECL_OMP_DECLARE_REDUCTION_P decls.
894 (is_late_template_attribute): Return true for "omp declare simd"
896 (cp_omp_mappable_type): New function.
897 (cplus_decl_attributes): Add implicit "omp declare target" attribute
899 * parser.c (cp_debug_parser): Print
900 parser->colon_doesnt_start_class_def_p.
901 (cp_ensure_no_omp_declare_simd, cp_finalize_omp_declare_simd): New
903 (enum pragma_context): Add pragma_member and pragma_objc_icode.
904 (cp_parser_binary_expression): Handle no_toplevel_fold_p
905 even for binary operations other than comparison.
906 (cp_parser_linkage_specification): Call
907 cp_ensure_no_omp_declare_simd if needed.
908 (cp_parser_namespace_definition): Likewise.
909 (cp_parser_init_declarator): Call cp_finalize_omp_declare_simd.
910 (cp_parser_direct_declarator): Pass declarator to
911 cp_parser_late_return_type_opt.
912 (cp_parser_late_return_type_opt): Add declarator argument,
913 call cp_parser_late_parsing_omp_declare_simd for declare simd.
914 (cp_parser_class_specifier_1): Call cp_ensure_no_omp_declare_simd.
915 Parse UDRs before all other methods.
916 (cp_parser_member_specification_opt): Use pragma_member instead of
918 (cp_parser_member_declaration): Call cp_finalize_omp_declare_simd.
919 (cp_parser_function_definition_from_specifiers_and_declarator,
920 cp_parser_save_member_function_body): Likewise.
921 (cp_parser_late_parsing_for_member): Handle UDRs specially.
922 (cp_parser_next_token_starts_class_definition_p): Don't allow
923 CPP_COLON if colon_doesnt_start_class_def_p flag is true.
924 (cp_parser_objc_interstitial_code): Use pragma_objc_icode
925 instead of pragma_external.
926 (cp_parser_omp_clause_name): Parse new OpenMP 4.0 clause names.
927 (cp_parser_omp_var_list_no_open): Parse array sections for
928 OMP_CLAUSE_{DEPEND,MAP,TO,FROM} clauses. Add COLON argument,
929 if non-NULL, allow parsing to end with a colon rather than close
931 (cp_parser_omp_var_list): Adjust cp_parser_omp_var_list_no_open
933 (cp_parser_omp_clause_reduction): Handle user defined reductions.
934 (cp_parser_omp_clause_branch, cp_parser_omp_clause_cancelkind,
935 cp_parser_omp_clause_num_teams, cp_parser_omp_clause_thread_limit,
936 cp_parser_omp_clause_aligned, cp_parser_omp_clause_linear,
937 cp_parser_omp_clause_safelen, cp_parser_omp_clause_simdlen,
938 cp_parser_omp_clause_depend, cp_parser_omp_clause_map,
939 cp_parser_omp_clause_device, cp_parser_omp_clause_dist_schedule,
940 cp_parser_omp_clause_proc_bind, cp_parser_omp_clause_to,
941 cp_parser_omp_clause_from, cp_parser_omp_clause_uniform): New
943 (cp_parser_omp_all_clauses): Add finish_p argument. Don't call
944 finish_omp_clauses if it is false. Handle new OpenMP 4.0 clauses.
945 (cp_parser_omp_atomic): Parse seq_cst clause, pass
946 true if it is present to finish_omp_atomic. Handle new OpenMP 4.0
948 (cp_parser_omp_for_loop): Add CODE argument, pass it through
949 to finish_omp_for. Change last argument to cclauses,
950 and adjust uses to grab parallel clauses from the array of all
952 (cp_omp_split_clauses): New function.
953 (cp_parser_omp_simd): New function.
954 (cp_parser_omp_for): Add p_name, mask and cclauses arguments.
955 Allow the function to be called also when parsing combined constructs,
956 and call c_parser_omp_simd when parsing for simd.
957 (cp_parser_omp_sections_scope): If section-sequence doesn't start with
958 #pragma omp section, require exactly one structured-block instead of
959 sequence of statements.
960 (cp_parser_omp_sections): Add p_name, mask and cclauses arguments.
961 Allow the function to be called also when parsing combined constructs.
962 (cp_parser_omp_parallel): Add p_name, mask and cclauses arguments.
963 Allow the function to be called also when parsing combined
965 (cp_parser_omp_taskgroup, cp_parser_omp_cancel,
966 cp_parser_omp_cancellation_point, cp_parser_omp_distribute,
967 cp_parser_omp_teams, cp_parser_omp_target_data,
968 cp_parser_omp_target_update, cp_parser_omp_target,
969 cp_parser_omp_declare_simd, cp_parser_late_parsing_omp_declare_simd,
970 cp_parser_omp_declare_target, cp_parser_omp_end_declare_target,
971 cp_parser_omp_declare_reduction_exprs, cp_parser_omp_declare_reduction,
972 cp_parser_omp_declare): New functions.
973 (cp_parser_omp_construct): Add p_name and mask vars. Handle
974 PRAGMA_OMP_DISTRIBUTE, PRAGMA_OMP_SIMD, PRAGMA_OMP_TASKGROUP,
975 PRAGMA_OMP_TEAMS. Adjust cp_parser_omp_for, cp_parser_omp_parallel
976 and cp_parser_omp_sections callers.
977 (cp_parser_pragma): Handle PRAGMA_OMP_CANCEL,
978 PRAGMA_OMP_CANCELLATION_POINT, PRAGMA_OMP_DECLARE_REDUCTION,
979 PRAGMA_OMP_DISTRIBUTE, PRAGMA_OMP_SIMD, PRAGMA_OMP_TASKGROUP,
980 PRAGMA_OMP_TEAMS, PRAGMA_OMP_TARGET, PRAGMA_OMP_END_DECLARE_TARGET.
981 Handle pragma_member and pragma_objc_icode like pragma_external.
982 (OMP_FOR_CLAUSE_MASK, OMP_SECTIONS_CLAUSE_MASK,
983 OMP_SINGLE_CLAUSE_MASK): Use OMP_CLAUSE_MASK_1 instead of 1.
984 (OMP_PARALLEL_CLAUSE_MASK): Likewise. Add OMP_CLAUSE_PROC_BIND.
985 (OMP_TASK_CLAUSE_MASK): Use OMP_CLAUSE_MASK_1 instead of 1. Add
987 (OMP_SIMD_CLAUSE_MASK, OMP_CANCEL_CLAUSE_MASK,
988 OMP_CANCELLATION_POINT_CLAUSE_MASK, OMP_DISTRIBUTE_CLAUSE_MASK,
989 OMP_TEAMS_CLAUSE_MASK, OMP_TARGET_DATA_CLAUSE_MASK,
990 OMP_TARGET_UPDATE_CLAUSE_MASK, OMP_TARGET_CLAUSE_MASK,
991 OMP_DECLARE_SIMD_CLAUSE_MASK): Define.
992 * parser.h (struct cp_omp_declare_simd_data): New type.
993 (struct cp_parser): Add colon_doesnt_start_class_def_p and
994 omp_declare_simd fields.
995 * cp-objcp-common.h (LANG_HOOKS_OMP_MAPPABLE_TYPE): Define.
996 * cp-tree.h (struct lang_decl_fn): Add omp_declare_reduction_p
998 (DECL_OMP_DECLARE_REDUCTION_P): Define.
999 (OMP_FOR_GIMPLIFYING_P): Use OMP_LOOP_CHECK macro.
1000 (struct saved_scope): Add omp_declare_target_attribute field.
1001 (cp_omp_mappable_type, omp_reduction_id,
1002 cp_remove_omp_priv_cleanup_stmt, cp_check_omp_declare_reduction,
1003 finish_omp_cancel, finish_omp_cancellation_point): New prototypes.
1004 (finish_omp_for): Add CODE argument.
1005 (finish_omp_atomic): Add seq_cst argument.
1006 (cxx_omp_create_clause_info): Add need_dtor argument.
1008 2013-10-09 Marek Polacek <polacek@redhat.com>
1011 * semantics.c (finish_return_stmt): Return error_mark_node
1012 when error_operand_p of the expr is true.
1013 (build_transaction_expr): Check for EXPR_P before setting the
1016 2013-10-08 Paolo Carlini <paolo.carlini@oracle.com>
1019 * lambda.c (begin_lambda_type): Check return value of xref_tag
1020 for error_mark_node; tidy.
1021 * decl.c (grokdeclarator): Tweak error message.
1023 2013-10-08 Paolo Carlini <paolo.carlini@oracle.com>
1027 2013-10-04 Paolo Carlini <paolo.carlini@oracle.com>
1030 * pt.c (tsubst): Use error_operand_p on parameter t.
1032 2013-10-06 Paolo Carlini <paolo.carlini@oracle.com>
1035 * class.c (check_bases): Propagate CLASSTYPE_READONLY_FIELDS_NEED_INIT
1036 and CLASSTYPE_REF_FIELDS_NEED_INIT from bases to derived.
1037 * init.c (diagnose_uninitialized_cst_or_ref_member_1): Extend error
1038 messages about uninitialized const and references members to mention
1041 2013-10-06 Paolo Carlini <paolo.carlini@oracle.com>
1044 * pt.c (type_dependent_expression_p): Handle EXPR_PACK_EXPANSION.
1046 2013-10-04 Paolo Carlini <paolo.carlini@oracle.com>
1049 * typeck2.c (build_functional_cast): Use error_operand_p on exp.
1051 2013-10-04 Paolo Carlini <paolo.carlini@oracle.com>
1054 * parser.c (cp_parser_perform_range_for_lookup): If eventually
1055 either *begin or *end is type-dependent, return NULL_TREE.
1056 (do_range_for_auto_deduction): If cp_parser_perform_range_for_lookup
1057 returns NULL_TREE, don't actually do_auto_deduction.
1059 2013-10-04 Paolo Carlini <paolo.carlini@oracle.com>
1062 * pt.c (tsubst): Use error_operand_p on parameter t.
1064 2013-10-04 Marc Glisse <marc.glisse@inria.fr>
1067 * decl.c (cxx_init_decl_processing): Set operator_new_flag.
1069 2013-10-04 Paolo Carlini <paolo.carlini@oracle.com>
1072 * decl2.c (save_template_attributes): Handle error_mark_node as
1074 (cp_check_const_attributes): Likewise for attributes.
1075 * parser.c (cp_parser_std_attribute_spec): When alignas_expr is an
1076 error_mark_node call cp_parser_skip_to_end_of_statement.
1078 2013-10-03 Easwaran Raman <eraman@google.com>
1081 * parser.c (cp_parser_init_declarator): Do not drop attributes
1082 of template member functions.
1084 2013-10-03 Marek Polacek <polacek@redhat.com>
1087 * init.c (sort_mem_initializers): Splice when giving an error.
1089 2013-10-02 Paolo Carlini <paolo.carlini@oracle.com>
1092 * parser.c (cp_parser_function_specifier_opt): Upon error about
1093 virtual templates don't set ds_virtual.
1094 (finish_fully_implicit_template): Reject virtual implicit templates.
1096 2013-10-02 Paolo Carlini <paolo.carlini@oracle.com>
1099 * semantics.c (potential_constant_expression_1): Handle LABEL_EXPR.
1101 2013-10-01 Paolo Carlini <paolo.carlini@oracle.com>
1104 * parser.c (cp_parser_lookup_name): Check make_typename_type return
1105 value for error_mark_node.
1107 2013-09-25 Tom Tromey <tromey@redhat.com>
1109 * Make-lang.in (CXX_TREE_H, CXX_PARSER_H, CXX_PRETTY_PRINT_H):
1112 2013-09-25 Tom Tromey <tromey@redhat.com>
1114 * Make-lang.in (g++spec.o): Remove.
1115 (CFLAGS-cp/g++spec.o): New variable.
1116 (GXX_OBJS): Reference cp/g++spec.o.
1117 (cc1plus-checksum.o, cp/lex.o, cp/cp-array-notation.o)
1118 (cp/cp-lang.o, cp/decl.o, cp/decl2.o, cp/cp-objcp-common.o)
1119 (cp/typeck2.o, cp/typeck.o, cp/class.o, cp/call.o)
1120 (cp/friend.o, cp/init.o, cp/method.o, cp/cvt.o, cp/search.o)
1121 (cp/tree.o, cp/ptree.o, cp/rtti.o, cp/except.o, cp/expr.o)
1122 (cp/pt.o, cp/error.o, cp/repo.o, cp/semantics.o, cp/dump.o)
1123 (cp/optimize.o, cp/mangle.o, cp/parser.o, cp/cp-gimplify.o)
1124 (cp/name-lookup.o, cp/cxx-pretty-print.o): Remove.
1126 2013-09-25 Tom Tromey <tromey@redhat.com>
1128 * Make-lang.in (g++spec.o): Don't use subshell.
1130 2013-09-25 Marek Polacek <polacek@redhat.com>
1133 * semantics.c (finish_transaction_stmt): Check for EXPR_P before
1134 setting the expr location.
1136 2013-09-23 Adam Butcher <adam@jessamine.co.uk>
1139 * type-utils.h (find_type_usage): Only traverse one type level into
1140 member function pointers.
1142 2013-09-23 Adam Butcher <adam@jessamine.co.uk>
1144 * parser.c (cp_parser_init_declarator): Defer calling
1145 finish_fully_implicit_template for forward declarations until after
1146 other decl processing is complete. Cleanup for clarity: Extract 'else'
1147 case after 'if' containing unconditional return.
1149 2013-09-23 Adam Butcher <adam@jessamine.co.uk>
1151 * parser.c (make_generic_type_name): Spell generic type names '<autoN>'
1152 rather than '__GenN'.
1154 2013-09-23 Adam Butcher <adam@jessamine.co.uk>
1156 * lambda.c (maybe_add_lambda_conv_op): Don't check for instantiated
1157 callop in the case of generic lambdas.
1159 2013-09-23 Adam Butcher <adam@jessamine.co.uk>
1161 * parser.c (make_generic_type_name): Use global count rather than
1163 (add_implicit_template_parms): ... propagate interface change here.
1165 2013-09-20 Paolo Carlini <paolo.carlini@oracle.com>
1168 * pt.c (tsubst_copy): Use current_nonlambda_class_type to
1169 call tsubst_baselink.
1171 2013-09-18 Paolo Carlini <paolo.carlini@oracle.com>
1174 * class.c (instantiate_type): Loosen a bit the gcc_assert.
1176 2013-09-18 Marek Polacek <polacek@redhat.com>
1179 * typeck.c (cp_build_binary_op): Properly honor -fsanitize options.
1180 Remove unnecessary check.
1182 2013-09-18 Marek Polacek <polacek@redhat.com>
1185 * typeck.c (cp_build_binary_op): Don't sanitize function if it has the
1186 no_sanitize_undefined attribute.
1188 2013-09-17 Paolo Carlini <paolo.carlini@oracle.com>
1191 * pt.c (tsubst, [BOUND_TEMPLATE_TEMPLATE_PARM]): Take into account
1192 the cp_type_quals (r) too.
1194 2013-09-16 Adam Butcher <adam@jessamine.co.uk>
1196 * cp-tree.h (type_uses_auto_or_concept): Declare.
1197 (is_auto_or_concept): Declare.
1198 * decl.c (grokdeclarator): Allow 'auto' parameters in lambdas with
1199 -std=gnu++1y or -std=c++1y or, as a GNU extension, in plain functions.
1200 * type-utils.h: New header defining ...
1201 (find_type_usage): ... this new function based on pt.c (type_uses_auto)
1202 for searching a type tree given a predicate.
1203 * pt.c (type_uses_auto): Reimplement via type-utils.h (find_type_usage).
1204 (is_auto_or_concept): New function.
1205 (type_uses_auto_or_concept): New function.
1206 * parser.h (struct cp_parser): Add fully_implicit_function_template_p.
1207 * parser.c (cp_parser_new): Initialize
1208 fully_implicit_function_template_p.
1209 (cp_parser_new): Initialize fully_implicit_function_template_p.
1210 (cp_parser_lambda_expression): Copy and restore value of
1211 fully_implicit_function_template_p as per other parser fields.
1212 (cp_parser_parameter_declaration_list): Count generic
1213 parameters and call ...
1214 (add_implicit_template_parms): ... this new function to synthesize them
1215 with help from type-utils.h (find_type_usage), ...
1216 (tree_type_is_auto_or_concept): ... this new static function and ...
1217 (make_generic_type_name): ... this new static function.
1218 (cp_parser_direct_declarator): Account for implicit template parameters.
1219 (cp_parser_lambda_declarator_opt): Finish fully implicit template if
1220 necessary by calling ...
1221 (finish_fully_implicit_template): ... this new function.
1222 (cp_parser_init_declarator): Likewise.
1223 (cp_parser_function_definition_after_declarator): Likewise.
1224 (cp_parser_member_declaration): Likewise.
1225 * Make-lang.in (cp/pt.o): Add dependency on type-utils.h.
1226 (cp/parser.o): Likewise.
1228 2013-09-16 Adam Butcher <adam@jessamine.co.uk>
1230 * parser.c (cp_parser_lambda_declarator_opt): Accept template parameter
1231 list with std=c++1y or std=gnu++1y.
1232 (cp_parser_lambda_body): Don't call 'expand_or_defer_fn' for lambda call
1233 operator template to avoid adding template result to symbol table.
1234 * lambda.c (lambda_function): Return template result if call operator is
1236 (maybe_add_lambda_conv_op): Move declarations to point of use. Refactor
1237 operator call building in order to support conversion of a non-capturing
1238 lambda template to a function pointer with help from ...
1239 (prepare_op_call): ... this new function.
1240 * decl2.c (check_member_template): Don't reject lambda call operator
1241 template in local [lambda] class.
1242 * pt.c (instantiate_class_template_1): Don't instantiate lambda call
1243 operator template when instantiating lambda class.
1245 2013-09-16 Adam Butcher <adam@jessamine.co.uk>
1247 * pt.c (make_auto_1): Use input_location rather than BUILTINS_LOCATION.
1249 2013-09-15 Jason Merrill <jason@redhat.com>
1253 * parser.c (cp_parser_lambda_introducer): Handle variadic capture.
1254 * lambda.c (add_capture): Handle variadic capture.
1255 (add_default_capture, lambda_capture_field_type): Likewise.
1256 (build_capture_proxy, register_capture_members): Likewise.
1257 * pt.c (register_specialization): Allow FIELD_DECL.
1258 (retrieve_specialization): Likewise.
1259 (find_parameter_packs_r): Handle FIELD_DECL and VAR_DECL.
1260 (tsubst_pack_expansion): Handle FIELD_DECL packs.
1261 (gen_elem_of_pack_expansion_instantiation): Likewise.
1262 (instantiate_class_template_1): Likewise.
1263 (tsubst_decl, tsubst_copy): Likewise.
1264 (tsubst_expr) [DECL_EXPR]: Handle capture proxy packs.
1265 (tsubst_copy_and_build) [VAR_DECL]: Likewise.
1266 * semantics.c (finish_non_static_data_member): Don't try to represent
1267 the type of a COMPOUND_REF of a FIELD_DECL pack.
1270 * cp-tree.h (DECL_PACK_P): Replace FUNCTION_PARAMETER_PACK_P.
1271 * cxx-pretty-print.c (direct_declarator): Adjust.
1272 * decl2.c (cp_build_parm_decl): Adjust.
1273 * pt.c (function_parameter_pack_p): Adjust.
1274 (find_parameter_packs_r, push_template_decl_real): Adjust.
1275 (tsubst_pack_expansion, tsubst_decl): Adjust.
1276 (regenerate_decl_from_template, instantiate_decl): Adjust.
1278 * lambda.c (add_capture): Don't add DECL_LANG_SPECIFIC.
1280 2013-09-13 Jason Merrill <jason@redhat.com>
1283 * pt.c (any_type_dependent_elements_p): Actually check for
1284 type-dependence, not value-dependence.
1286 2013-09-13 Jacek Caban <jacek@codeweavers.com>
1288 * decl.c: Use new cxx_implicit_extern_c hook
1290 2013-09-12 Brooks Moses <bmoses@google.com>
1293 * Make-lang.in: Do not install driver binaries in $(target)/bin.
1295 2013-09-12 Adam Butcher <adam@jessamine.co.uk>
1297 * pt.c (instantiate_decl): Save/restore cp_unevaluated_operand and
1298 c_inhibit_evaluation_warnings. Reset if instantiating within a
1299 function-local template.
1301 2013-09-12 Paolo Carlini <paolo.carlini@oracle.com>
1303 * semantics.c (finish_pseudo_destructor_expr): Add location_t
1305 * pt.c (unify_arg_conversion): Use EXPR_LOC_OR_HERE.
1306 (tsubst_copy_and_build): Adjust finish_pseudo_destructor_expr
1308 * parser.c (cp_parser_postfix_dot_deref_expression): Likewise.
1309 (cp_parser_postfix_expression): Pass the proper location to
1310 cp_parser_postfix_dot_deref_expression.
1311 * cp-tree.h (finish_pseudo_destructor_expr): Update declaration.
1313 2013-09-10 Jan Hubicka <jh@suse.cz>
1314 Paolo Carlini <paolo.carlini@oracle.com>
1316 * error.c (print_instantiation_partial_context_line): If
1317 loc == UNKNOWN_LOCATION return immediately.
1319 2013-09-09 Jakub Jelinek <jakub@redhat.com>
1322 * init.c (build_vec_delete): Call mark_rvalue_use on base.
1324 2013-09-09 Paolo Carlini <paolo.carlini@oracle.com>
1327 * init.c (build_vec_delete_1): When the type is incomplete emit a
1328 warning, enabled by default (not an error).
1329 (build_delete): Adjust to use OPT_Wdelete_incomplete.
1331 2013-09-09 Paolo Carlini <paolo.carlini@oracle.com>
1334 * error.c (location_of): Don't handle PARM_DECLs specially.
1336 2013-09-09 Paolo Carlini <paolo.carlini@oracle.com>
1338 * error.c (dump_expr, [PSEUDO_DTOR_EXPR]): Fix.
1339 * cxx-pretty-print.c (cxx_pretty_printer::postfix_expression):
1340 Tweak, TREE_OPERAND (t, 1) may be null.
1342 2013-09-08 Caroline Tice <cmtice@google.com>
1345 * vtable-class-hierarchy.c (vtv_generate_init_routine): In
1346 preinit case, move call to assemble_vtv_preinit_initializer to
1347 after call to cgraph_process_new_functions.
1349 2013-09-08 Tom de Vries <tom@codesourcery.com>
1352 * except.c (build_must_not_throw_expr): Handle
1355 2013-09-08 Joern Rennecke <joern.rennecke@embecosm.com>
1357 * typeck.c (cp_build_binary_op): Use vector_types_compatible_elements_p.
1359 2013-09-04 Paolo Carlini <paolo.carlini@oracle.com>
1362 * class.c (finish_struct_anon_r): New.
1363 (finish_struct_anon): Use it.
1365 2013-09-04 Gabriel Dos Reis <gdr@integrable-solutions.net>
1367 * cxx-pretty-print.h (cxx_pretty_printer::simple_type_specifier):
1368 Declare as overrider.
1369 * cxx-pretty-print.c (cxx_pretty_printer::simple_type_specifier):
1370 Rename from pp_cxx_simple_type_specifier.
1371 (cxx_pretty_printer::cxx_pretty_printer): Do not assign to
1372 simple_type_specifier.
1374 2013-09-03 Paolo Carlini <paolo.carlini@oracle.com>
1377 * typeck2.c (build_functional_cast): Maybe warn_deprecated_use.
1379 2013-09-03 Mike Stump <mikestump@comcast.net>
1381 * Make-lang.in (cp/lambda.o): Add dependencies.
1383 2013-09-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
1385 * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as
1387 * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove.
1388 (pp_cxx_userdef_literal): Tidy.
1389 (pp_cxx_template_argument_list): Likewise.
1390 (pp_cxx_typeid_expression): Likewise.
1391 (pp_cxx_offsetof_expression_1): Likewise.
1392 (cxx_pretty_printer::postfix_expression): Likewise.
1393 (cxx_pretty_printer::unary_expression): Likewise.
1394 (cxx_pretty_printer::statement): Likewise.
1395 (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id.
1396 (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id.
1397 * error.c (dump_decl): Tidy.
1398 (dump_expr): Likewise.
1400 2013-09-02 Paolo Carlini <paolo.carlini@oracle.com>
1402 PR c++/21682, implement DR 565
1403 * name-lookup.c (compparms_for_decl_and_using_decl): New.
1404 (push_overloaded_decl_1, do_nonmember_using_decl): Use it.
1406 2013-08-30 Marek Polacek <polacek@redhat.com>
1408 * typeck.c (cp_build_binary_op): Add division by zero and shift
1410 * error.c (dump_expr): Special-case ubsan builtins.
1412 2013-08-30 Paolo Carlini <paolo.carlini@oracle.com>
1415 * cp-tree.h (LOOKUP_DELEGATING_CONS): Add.
1416 * init.c (perform_target_ctor): Use it.
1417 * call.c (build_special_member_call): Diagnose self-delegating
1420 2013-08-30 Gabriel Dos Reis <gdr@integrable-solutions.net>
1422 * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as
1424 (cxx_pretty_printer::declaration_specifiers): Likewise.
1425 (cxx_pretty_printer::function_specifier): Likewise.
1426 (cxx_pretty_printer::declarator): Likewise.
1427 (cxx_pretty_printer::direct_declarator): Likewise.
1428 (cxx_pretty_printer::abstract_declarator): Likewise.
1429 (cxx_pretty_printer::direct_abstract_declarator): Likewise.
1430 (pp_cxx_declaration): Remove.
1431 * cxx-pretty-print.c (cxx_pretty_printer::function_specifier):
1432 Rename from pp_cxx_function_specifier. Adjust.
1433 (cxx_pretty_printer::declaration_specifiers): Rename from
1434 pp_cxx_decl_specifier_seq. Adjust.
1435 (cxx_pretty_printer::direct_declarator): Rename from
1436 pp_cxx_direct_declarator. Adjust.
1437 (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator.
1439 (cxx_pretty_printer::abstract_declarator): Rename from
1440 pp_cxx_abstract_declarator. Adjust.
1441 (cxx_pretty_printer::direct_abstract_declarator): Rename from
1442 pp_cxx_direct_abstract_declarator. Adjust.
1443 (cxx_pretty_printer::declaration): Rename from
1444 pp_cxx_declaration. Adjust.
1445 (cxx_pretty_printer::cxx_pretty_printer): Do not assign to
1446 declaration, declaration_specifiers, function_specifier,
1447 declarator, direct_declarator, abstract_declarator,
1448 direct_abstract_declarator.
1449 * error.c (dump_decl): Adjust.
1451 2013-08-29 Jan Hubicka <jh@suse.cz>
1453 Correct previous patch to not mark terminate as LEAF.
1454 * class.c (build_vtbl_initializer): Drop LEAF
1455 * decl.c (cxx_init_decl_processing): Likewise.
1456 (push_throw_library_fn): Likewise.
1457 * except.c (init_exception_processing): Likewise.
1458 (do_begin_catch): Likewise.
1459 (do_end_catch): Likewise.
1460 (do_allocate_exception): Likewise.
1462 2013-08-29 Jan Hubicka <jh@suse.cz>
1464 * class.c (build_vtbl_initializer): Make __cxa_deleted_virtual
1465 ECF_NORETURN | ECF_LEAF
1466 * cp-tree.h (build_library_fn_ptr, build_cp_library_fn_ptr,
1467 push_library_fn, push_void_library_fn): Update prototype.
1468 * decl.c (build_library_fn_1): Remove.
1469 (push_cp_library_fn, build_cp_library_fn): Update to take ECF flags.
1470 (cxx_init_decl_processing): Update; global_delete_fndecl is ECF_NOTROW;
1471 __cxa_pure_virtual is ECF_NORETURN | ECF_NORETURN | ECF_LEAF.
1472 (build_library_fn_1): Add ecf_flags argument; rename to ...
1473 (build_library_fn): ... this one.
1474 (build_cp_library_fn): Take ecf_flags; do not copy NOTHROW flag.
1475 (build_library_fn_ptr): Take ecf_flags.
1476 (build_cp_library_fn_ptr): Likewise.
1477 (push_library_fn): Likewise.
1478 (push_cp_library_fn): Likewise.
1479 (push_void_library_fn): Likewise.
1480 (push_throw_library_fn): All throws are ECF_NORETURN.
1481 (__cxa_atexit, __cxa_thread_atexit): Add ECF_LEAF | ECF_NOTHROW attributes.
1482 (expand_static_init): __cxa_guard_acquire, __cxa_guard_release,
1483 __cxa_guard_abort are ECF_NOTHROW | ECF_LEAF.
1484 * except.c (init_exception_processing): terminate is
1485 ECF_NOTHROW | ECF_NORETURN | ECF_LEAF.
1486 (declare_nothrow_library_fn): Add ecf_flags parameter.
1487 (__cxa_get_exception_ptr): Is ECF_NOTHROW | ECF_PURE | ECF_LEAF |
1489 (do_begin_catch): cxa_begin_catch and _ITM_cxa_begin_catch
1490 are ECF_NOTHROW | ECF_LEAF.
1491 (do_end_catch): __cxa_end_catch and _ITM_cxa_end_catch is
1493 (do_allocate_exception): _cxa_allocate_exception
1494 and _ITM_cxa_allocate_exception are ECF_NOTHROW | ECF_MALLOC
1496 (do_free_exception): __cxa_free_exception is
1497 ECF_NOTHROW | ECF_LEAF.
1498 * rtti.c (build_dynamic_cast_1): __dynamic_cast
1499 is ECF_LEAF | ECF_PURE | ECF_NOTHROW.
1501 2013-08-29 Adam Butcher <adam@jessamine.co.uk>
1503 * error.c (dump_lambda_function): New function, dependent on ...
1504 (dump_substitution): ... this new function, factored out of ...
1505 (subst_to_string): ... here and ...
1506 (dump_function_decl): ... here. Updated to early-out with call to
1507 dump_lambda_function after determining template bindings.
1509 2013-08-28 Paolo Carlini <paolo.carlini@oracle.com>
1512 * init.c (build_aggr_init): When init == void_type_node do not
1513 set LOOKUP_ONLYCONVERTING.
1515 2013-08-27 Caroline Tice <cmtice@google.com>
1517 * vtable-class-hierarchy.c: Remove unnecessary include statements.
1518 (MAX_SET_SIZE): Remove unnecessary constant.
1519 (register_construction_vtables): Make vtable_ptr_array parameter
1520 into a vector; remove num_args parameter. Change array accesses to
1522 (register_other_binfo_vtables): Ditto.
1523 (insert_call_to_register_set): Ditto.
1524 (insert_call_to_register_pair): Ditto.
1525 (output_set_info): Ditto. Also change warning calls to warning_at
1526 calls, and fix format of warning messages.
1527 (register_all_pairs): Change vtbl_ptr_array from an array into a
1528 vector. Remove num_vtable_args (replace with calls to vector length).
1529 Change array stores & accesses to vector functions. Change calls to
1530 register_construction_vtables, register_other_binfo_vtables,
1531 insert_call_to_register_set, insert_call_to_register_pair and
1532 output_set_info to match their new signatures. Change warning to
1533 warning_at and fix the format of the warning message.
1535 2013-08-27 Jakub Jelinek <jakub@redhat.com>
1536 Aldy Hernandez <aldyh@redhat.com>
1538 * cp-tree.h (CP_OMP_CLAUSE_INFO): Adjust range for new clauses.
1540 2013-08-27 Paolo Carlini <paolo.carlini@oracle.com>
1542 * decl.c (grokfndecl): Remove old bison hack.
1544 2013-08-26 Jan Hubicka <jh@suse.cz>
1546 * cp-tree.h (DECL_CONSTRUCTOR_P, DECL_DESTRUCTOR_P): Use
1549 2013-08-26 Gabriel Dos Reis <gdr@integrable-solutions.net>
1551 * cxx-pretty-print.h (cxx_pretty_printer::unary_expression):
1552 Declare as overrider.
1553 (cxx_pretty_printer::multiplicative_expression): Likewise.
1554 (cxx_pretty_printer::conditional_expression): Likewise.
1555 (cxx_pretty_printer::assignment_expression): Likewise.
1556 (cxx_pretty_printer::expression): Likewise.
1557 * cxx-pretty-print.c (cxx_pretty_printer::unary_expression):
1558 Rename from pp_cxx_unary_expression. Adjust.
1559 (cxx_pretty_printer::multiplicative_expression): Rename from
1560 pp_cxx_multiplicative_expression. Adjust.
1561 (cxx_pretty_printer::conditional_expression): Rename from
1562 pp_cxx_conditional_expression. Adjust.
1563 (cxx_pretty_printer::assignment_expression): Rename from
1564 pp_cxx_assignment_expression. Adjust.
1565 (cxx_pretty_printer::expression): Rename from pp_cxx_expression.
1567 (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to
1568 unary_expression, multiplicative_expression,
1569 conditional_expression, assignment_expression, expression.
1571 2013-08-25 Gabriel Dos Reis <gdr@integrable-solutions.net>
1573 * cxx-pretty-print.h (cxx_pretty_printer::postfix_expression):
1574 Declare as overrider.
1575 * cxx-pretty-print.c (cxx_pretty_printer::postfix_expression):
1576 Rename from pp_cxx_postfix_expression. Adjust.
1577 (pp_cxx_expression): Use pp_postfix_expression.
1578 (cxx_pretty_printer::cxx_pretty_printer): Do not assign to
1581 2013-08-25 Gabriel Dos Reis <gdr@integrable-solutions.net>
1583 * cxx-pretty-print.h (cxx_pretty_printer::primary_expression): Now
1584 an overrider of c_pretty_printer::primary_expression.
1585 * cxx-pretty-print.c (cxx_pretty_printer::primary_expression):
1586 Rename from pp_cxx_primary_expression. Adjust.
1587 (pp_cxx_postfix_expression): Use pp_primary_expression.
1588 (pp_cxx_ctor_initializer): Likewise.
1589 (cxx_pretty_printer::cxx_pretty_printer): Do not assign to
1592 2013-08-23 Jan Hubicka <jh@suse.cz>
1594 * cp-tree.h (struct lang_type_class): Free is_final bit.
1595 (CLASSTYPE_FINAL): Define using TYPE_FINAL_P.
1596 (DECL_FINAL_P): Remove.
1597 * pt.c (instantiate_class_template_1): Guard that CLASSTYPE_FINAL
1598 is called on CLASS_TYPE_P.
1600 2013-08-25 Gabriel Dos Reis <gdr@integrable-solutions.net>
1602 * cxx-pretty-print.c (M_): Remove.
1603 (pp_cxx_unqualified_id): Use translate_string instead of M_.
1604 (pp_cxx_canonical_template_parameter): Likewise.
1606 2013-08-24 Gabriel Dos Reis <gdr@integrable-solutions.net>
1608 * cxx-pretty-print.h (cxx_pretty_printer::id_expression): Declare.
1609 * cxx-pretty-print.c (cxx_pretty_printer::id_expression): Rename
1610 from pp_cxx_id_expression. Adjust.
1611 (pp_cxx_userdef_literal): Use pp_id_expression.
1612 (pp_cxx_primary_expression): Likewise.
1613 (pp_cxx_direct_declarator): Likewise.
1614 (cxx_pretty_printer::cxx_pretty_printer): Do not assign to
1617 2013-08-24 Gabriel Dos Reis <gdr@integrable-solutions.net>
1619 * cxx-pretty-print.h (cxx_pretty_printer::constant): Now a member
1620 function, overriding c_pretty_printer::constant.
1621 * cxx-pretty-print.c (cxx_pretty_printer::constant): Rename from
1622 pp_cxx_constant. Adjust.
1623 (cxx_pretty_printer::cxx_pretty_printer): Do not assign to constant.
1625 2013-08-23 Gabriel Dos Reis <gdr@integrable-solutiobs.net>
1627 * cp-objcp-common.c (cxx_initialize_diagnostics): Call a
1628 destructor for the early printer.
1629 * error.c (type_to_string): Use pp_buffer.
1631 2013-08-22 Paolo Carlini <paolo.carlini@oracle.com>
1634 * class.c (check_field_decls): Check for const mutable and const
1635 reference data members.
1637 2013-08-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
1639 * error.c (init_error): Remove calls to pp_construct and
1640 pp_cxx_pretty_printer_init. Initialize cxx_pp with placement-new.
1641 * cxx-pretty-print.h (cxx_pretty_printer::cxx_pretty_printer): Declare.
1642 (cxx_pretty_printer_init): Remove.
1643 * cxx-pretty-print.c (cxx_pretty_printer::cxx_pretty_printer):
1644 Rename from cxx_pretty_printer_init. Adjust.
1645 * cp-objcp-common.c (cxx_initialize_diagnostics): Simplify
1646 initialization of C++ diagnostics pretty printer.
1648 2013-08-21 Paolo Carlini <paolo.carlini@oracle.com>
1650 * call.c (build_new_method_call_1): Use INDIRECT_REF_P.
1651 * cp-tree.h (REFERENCE_REF_P): Likewise.
1652 * semantics.c (finish_offsetof): Likewise.
1654 2013-08-21 Paolo Carlini <paolo.carlini@oracle.com>
1657 * semantics.c (finish_id_expression): Handle deprecated references.
1659 2013-08-20 Jason Merrill <jason@redhat.com>
1662 * cvt.c (build_expr_type_conversion): Don't complain about a
1663 template that can't match the desired type category.
1665 2013-08-20 Gabriel Dos Reis <gdr@integrable-solutions.net>
1667 * error.c (pp_ggc_formatted_text): New.
1668 (type_as_string): Use it in lieu of pp_formatted_text.
1669 (type_as_string_translate): Likewise.
1670 (expr_as_string): Likewise.
1671 (decl_as_string): Likewise.
1672 (decl_as_string_translate): Likewise.
1673 (lang_decl_name): Likewise.
1674 (decl_to_string): Likewise.
1675 (expr_to_string): Likewise.
1676 (fndecl_to_string): Likewise.
1677 (parm_to_string): Likewise.
1678 (type_to_string): Likewise.
1679 (args_to_string): Likewise.
1680 (subst_to_string): Likewise.
1682 2013-08-19 Balaji V. Iyer <balaji.v.iyer@intel.com>
1685 * cp-array-notation.c (cp_expand_cond_array_notations): Added a
1686 check for truth values.
1687 (expand_array_notation_exprs): Added truth values case. Removed an
1688 unwanted else. Added for-loop to walk through subtrees in default
1690 * call.c (build_cxx_call): Inherited the type of the array notation for
1691 certain built-in array notation functions.
1693 2013-08-19 Paolo Carlini <paolo.carlini@oracle.com>
1695 * parser.c (cp_parser_lambda_introducer, cp_parser_decltype_expr):
1696 Use cp_parser_lookup_name_simple.
1698 2013-08-19 Paolo Carlini <paolo.carlini@oracle.com>
1700 * name-lookup.h (pop_bindings_and_leave_scope): Declare.
1701 * name-lookup.c (pop_bindings_and_leave_scope): Define.
1702 * parser.c (cp_parser_lambda_declarator_opt,
1703 cp_parser_direct_declarator, cp_parser_cache_defarg): Use it.
1705 2013-08-17 Jason Merrill <jason@redhat.com>
1708 * name-lookup.c (push_class_level_binding_1): It's OK to push a
1709 lambda type after the enclosing type is complete.
1711 2013-08-17 Gabriel Dos Reis <gdr@integrable-solutions.net>
1713 * error.c (dump_scope): Add a cxx_pretty_printer parameter.
1715 (dump_template_argument): Likewise.
1716 (dump_template_argument_list): Likewise.
1717 (dump_template_parameter): Likewise.
1718 (dump_template_bindings): Likewise.
1719 (dump_alias_template_specialization): Likewise.
1720 (dump_type): Likewise.
1721 (dump_typename): Likewise.
1722 (dump_aggr_type): Likewise.
1723 (dump_type_prefix): Likewise.
1724 (dump_type_suffix): Likewise.
1725 (dump_global_iord): Likewise.
1726 (dump_simple_decl): Likewise.
1727 (dump_decl): Likewise.
1728 (dump_template_decl): Likewise.
1729 (dump_function_decl): Likewise.
1730 (dump_parameters): Likewise.
1731 (dump_ref_qualifier): Likewise.
1732 (dump_exception_spec): Likewise.
1733 (dump_function_name): Likewise.
1734 (dump_template_parms): Likewise.
1735 (dump_call_expr_args): Likewise.
1736 (dump_aggr_init_expr_args): Likewise.
1737 (dump_expr_list): Likewise.
1738 (dump_expr_init_vec): Likewise.
1739 (dump_expr): Likewise.
1740 (dump_binary_op): Likewise.
1741 (dump_unary_op): Likewise.
1743 2013-08-14 Paolo Carlini <paolo.carlini@oracle.com>
1746 * cp-tree.h (LOOKUP_NO_NON_INTEGRAL): Add.
1747 * decl.c (case_conversion): Use it.
1748 * call.c (standard_conversion): Likewise.
1749 (implicit_conversion): Adjust.
1751 2013-08-13 Adam Butcher <adam@jessamine.co.uk>
1753 * pt.c: Grammar fix in comments ("it's" to "its").
1755 2013-08-12 Paolo Carlini <paolo.carlini@oracle.com>
1757 * decl.c (warn_extern_redeclared_static, duplicate_decls,
1758 check_elaborated_type_specifier): Use error + inform.
1759 * friend.c (make_friend_class): Likewise.
1760 * semantics.c (finish_id_expression): Likewise.
1762 2013-08-09 Paolo Carlini <paolo.carlini@oracle.com>
1765 2013-08-07 Paolo Carlini <paolo.carlini@oracle.com>
1768 * name-lookup.c (lookup_name_real_1): Handle iter->type before
1771 2013-08-07 Paolo Carlini <paolo.carlini@oracle.com>
1774 * name-lookup.c (lookup_name_real_1): Handle iter->type before
1777 2013-08-06 Caroline Tice <cmtice@google.com>
1779 * Make-lang.in (*CXX_AND_OBJCXX_OBJS): Add vtable-class-hierarchy.o to
1781 (vtable-class-hierarchy.o): Add build rule.
1782 * cp-tree.h (vtv_start_verification_constructor_init_function): New
1783 extern function decl.
1784 (vtv_finish_verification_constructor_init_function): New extern
1786 (build_vtbl_address): New extern function decl.
1787 (get_mangled_vtable_map_var_name): New extern function decl.
1788 (vtv_compute_class_hierarchy_transitive_closure): New extern function
1790 (vtv_generate_init_routine): New extern function decl.
1791 (vtv_save_class_info): New extern function decl.
1792 (vtv_recover_class_info): New extern function decl.
1793 (vtv_build_vtable_verify_fndecl): New extern function decl.
1794 * class.c (finish_struct_1): Add call to vtv_save_class_info if
1795 flag_vtable_verify is true.
1796 * config-lang.in: Add vtable-class-hierarchy.c to gtfiles list.
1797 * vtable-class-hierarchy.c: New file.
1798 * mangle.c (get_mangled_vtable_map_var_name): New function.
1799 * decl2.c (start_objects): Update function comment.
1800 (cp_write_global_declarations): Call vtv_recover_class_info,
1801 vtv_compute_class_hierarchy_transitive_closure and
1802 vtv_build_vtable_verify_fndecl, before calling
1803 finalize_compilation_unit, and call vtv_generate_init_rount after, IFF
1804 flag_vtable_verify is true.
1805 (vtv_start_verification_constructor_init_function): New function.
1806 (vtv_finish_verification_constructor_init_function): New function.
1807 * init.c (build_vtbl_address): Remove static qualifier from function.
1809 2013-08-06 Jason Merrill <jason@redhat.com>
1812 * tree.c (strip_typedefs) [METHOD_TYPE]: Preserve ref-qualifier.
1814 2013-08-05 Paolo Carlini <paolo.carlini@oracle.com>
1817 * typeck.c (cp_pointer_int_sum): Add tsubst_flags_t parameter.
1818 (cp_build_binary_op): Adjust.
1820 2013-08-04 Gabriel Dos Reis <gdr@integrable-solutions.net>
1822 * cxx-pretty-print.h (pp_c_base): Remove.
1823 (cxx_pretty_printer): Derive from c_pretty_printer.
1824 Adjust macros using pp_c_base.
1825 * cp-objcp-common.c (cxx_initialize_diagnostics): Do not call pp_base.
1826 * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): Likewise.
1827 (pp_cxx_colon_colon): Likewise.
1828 (pp_cxx_separate_with): Likewise.
1829 (pp_cxx_storage_class_specifier): Do not call pp_c_base.
1830 (pp_cxx_expression_list): Likewise.
1831 (pp_cxx_space_for_pointer_operator): Likewise.
1832 (pp_cxx_init_declarator): Likewise.
1833 (pp_cxx_call_argument_list): Likewise.
1834 (pp_cxx_constant): Likewise.
1835 (pp_cxx_postfix_expression): Likewise.
1836 (pp_cxx_new_expression): Likewise.
1837 (pp_cxx_unary_expression): Likewise.
1838 (pp_cxx_cast_expression): Likewise.
1839 (pp_cxx_conditional_expression): Likewise.
1840 (pp_cxx_assignment_expression): Likewise.
1841 (pp_cxx_expression): Likewise.
1842 (pp_cxx_function_specifier): Likewise.
1843 (pp_cxx_decl_specifier_seq): Likewise.
1844 (pp_cxx_simple_type_specifier): Likewise.
1845 (pp_cxx_type_specifier_seq): Likewise.
1846 (pp_cxx_ptr_operator): Likewise.
1847 (pp_cxx_parameter_declaration_clause): Likewise.
1848 (pp_cxx_direct_declarator): Likewise.
1849 (pp_cxx_direct_abstract_declarator): Likewise.
1850 (pp_cxx_type_id): Likewise.
1851 (pp_cxx_statement): Likewise.
1852 (pp_cxx_pretty_printer_init): Tidy.
1853 * error.c (init_error): Do not use pp_base.
1854 (dump_aggr_type): Likewise.
1855 (dump_type_prefix): Likewise.
1856 (dump_type_suffix): Likewise.
1857 (dump_global_iord): Likewise.
1858 (dump_decl): Likewise.
1859 (dump_function_decl): Likewise.
1860 (dump_ref_qualifier): Likewise.
1861 (reinit_cxx_pp): Likewise.
1862 (decl_as_dwarf_string): Likewise.
1863 (lang_decl_dwarf_name): Likewise.
1864 (type_to_string): Likewise.
1865 (cv_to_string): Likewise.
1866 (cxx_print_error_function): Likewise.
1867 (cp_diagnostic_starter): Likewise.
1868 (cp_diagnostic_finalizer): Likewise.
1869 (cp_print_error_function): Likewise.
1870 (print_instantiation_context): Likewise.
1871 (cp_printer): Likewise.
1873 2013-08-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
1875 * error.c (dump_type_prefix): Use specialized pretty printer
1876 functions instead of pp_string or operators and punctuators.
1877 (dump_decl): Likewise.
1878 (dump_expr): Likewise.
1880 2013-08-03 Jason Merrill <jason@redhat.com>
1883 * pt.c (get_underlying_template): New.
1884 (convert_template_argument, lookup_template_class_1): Use it.
1888 * pt.c (pack_expansion_args_count): Rename from
1889 any_pack_expanson_args_p.
1890 (coerce_template_parms): Reject pack expansion to
1891 non-pack template parameter of alias template.
1893 2013-08-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
1895 * error.c (dump_aggr_type): Use specialized pretty printer
1896 functions instead of pp_character.
1897 (dump_type_prefix): Likewise.
1898 (dump_simple_decl): Likewise.
1899 (type_to_string): Likewise.
1901 2013-08-02 Paolo Carlini <paolo.carlini@oracle.com>
1903 * cp-tree.h (finish_stmt): Do not declare.
1904 * decl.c (finish_stmt): Do not define.
1905 * parser.c (cp_parser_expression_statement,
1906 cp_parser_declaration_statement,
1907 cp_parser_transaction_cancel): Don't call finish_stmt.
1908 * semantics.c (finish_expr_stmt, finish_if_stmt,
1909 finish_while_stmt, finish_do_stmt, finish_return_stmt,
1910 finish_for_stmt, finish_switch_stmt, finish_compound_stmt,
1911 finish_transaction_stmt): Likewise.
1913 2013-08-01 Fabien Chêne <fabien@gcc.gnu.org>
1916 * cp-tree.h: Check OVL_USED with OVERLOAD_CHECK.
1917 * name-lookup.c (do_nonmember_using_decl): Make sure we have an
1918 OVERLOAD before calling OVL_USED. Call diagnose_name_conflict
1919 instead of issuing an error without mentioning the conflicting
1922 2013-07-31 Paolo Carlini <paolo.carlini@oracle.com>
1924 * parser.c (cp_parser_sizeof_pack): Check cp_parser_identifier
1925 return value for error_mark_node.
1927 2013-07-30 Paolo Carlini <paolo.carlini@oracle.com>
1930 * parser.c (cp_parser_cache_defarg): In an NSDMI don't stop when
1931 token->type == CPP_ELLIPSIS.
1933 2013-07-30 Paolo Carlini <paolo.carlini@oracle.com>
1936 * call.c (is_std_init_list): Return false if cxx_dialect == cxx98.
1938 2013-07-29 Jason Merrill <jason@redhat.com>
1941 * semantics.c (build_data_member_initialization, constexpr_fn_retval):
1942 Use break_out_target_exprs instead of unshare_expr.
1944 2013-07-29 Paolo Carlini <paolo.carlini@oracle.com>
1947 * call.c (initialize_reference): Don't crash when reference_binding
1948 returns a conv with conv->kind == ck_ambig.
1950 2013-07-29 Jason Merrill <jason@redhat.com>
1952 * mangle.c (write_name): Check for null context.
1953 (write_unscoped_name): Allow PARM_DECL context.
1955 2013-07-25 Paolo Carlini <paolo.carlini@oracle.com>
1958 * decl.c (check_default_argument): Take a tsubst_flags_t parameter.
1959 (grokparms): Adjust.
1960 * parser.c (cp_parser_late_parse_one_default_arg): Likewise.
1961 * pt.c (tsubst_default_argument, tsubst_default_arguments): Take
1962 a tsubst_flags_t parameter.
1963 (tsubst_decl): Adjust.
1964 * call.c (convert_default_arg): Likewise.
1965 * cp-tree.h (check_default_argument, tsubst_default_argument):
1966 Update declarations.
1968 2013-07-25 Paolo Carlini <paolo.carlini@oracle.com>
1971 * parser.c (cp_parser_operator, case CPP_WSTRING, CPP_STRING16,
1972 CPP_STRING32, CPP_UTF8STRING, CPP_WSTRING_USERDEF,
1973 CPP_STRING16_USERDEF, CPP_STRING32_USERDEF, CPP_UTF8STRING_USERDEF):
1974 Fix string_len management, tidy.
1976 2013-07-24 Paolo Carlini <paolo.carlini@oracle.com>
1979 * typeck.c (ptr_reasonably_similar): Use COMPARE_STRICT if either
1980 target type is incomplete; return a bool, not an int.
1981 * cp-tree.h (ptr_reasonably_similar): Adjust declaration.
1983 2013-07-22 Paolo Carlini <paolo.carlini@oracle.com>
1985 * cp-tree.h (DERIVED_FROM_P): Pass tf_none to lookup_base, not
1986 tf_warning_or_error.
1988 2013-07-21 OndÃ…
\99ej BÃÂlka <neleai@seznam.cz>
1990 * class.c: Fix typos.
1991 * cp-array-notation.c: Likewise.
1992 * cp-objcp-common.c: Likewise.
1995 * mangle.c: Likewise.
1996 * parser.c: Likewise.
1998 * semantics.c: Likewise.
2000 2013-07-14 Adam Butcher <adam@jessamine.co.uk>
2002 * semantics.c (build_lambda_expr),
2003 (build_lambda_object), (begin_lambda_type), (lambda_return_type),
2004 (lambda_function), (lambda_capture_field_type), (is_capture_proxy),
2005 (is_normal_capture_proxy), (insert_capture_proxy),
2006 (insert_pending_capture_proxies), (lambda_proxy_type),
2007 (build_capture_proxy), (vla_capture_type),
2008 (register_capture_members), (add_default_capture),
2009 (lambda_expr_this_capture), (maybe_resolve_dummy),
2010 (nonlambda_method_basetype), (maybe_add_lambda_conv_op) and
2011 (is_lambda_ignored_entity): Moved definitions into ...
2012 * lambda.c: ... this new file.
2014 2013-07-14 Marc Glisse <marc.glisse@inria.fr>
2016 * call.c (build_conditional_expr_1): Handle the case with 1 vector
2017 and 2 scalars. Call save_expr before building a vector.
2018 * typeck.c (cp_build_binary_op): Check complain before complaining.
2020 2013-07-13 Lubos Lunak <l.lunak@suse.cz>
2023 * init.c (build_aggr_init): Check for warn_unused attribute.
2024 * decl.c (poplevel): Likewise.
2026 2013-07-13 Jason Merrill <jason@redhat.com>
2029 * init.c (build_vec_init): Use {} for arrays of class type.
2030 (build_vec_delete): Don't take the address of the array.
2033 * class.c (layout_class_type): Check for too-large class.
2035 * call.c (can_convert): Allow user-defined conversions.
2036 (can_convert_standard): New.
2037 * cp-tree.h: Declare it.
2038 * cvt.c (convert_to_reference): Use it.
2039 * pt.c (convert_nontype_argument): Likewise.
2040 * search.c (check_final_overrider): Likewise.
2041 Don't worry about user-defined conversions.
2043 2013-07-10 Paolo Carlini <paolo.carlini@oracle.com>
2046 * typeck.c (build_reinterpret_cast_1): With -Wconditionally-supported
2047 warn about casting between pointer-to-function and pointer-to-object.
2049 2013-07-09 Jason Merrill <jason@redhat.com>
2052 * init.c (build_vec_init): Don't take shortcuts when initializing
2056 * parser.c (cp_parser_sizeof_pack): Clear parser scopes.
2059 * semantics.c (finish_id_expression): Return the id for an
2060 unevaluated outer variable.
2063 * semantics.c (lambda_capture_field_type): Build a DECLTYPE_TYPE
2064 if the variable type uses 'auto'.
2067 * typeck.c (check_return_expr): Lambda proxies aren't eligible
2068 for nrv or return by move.
2071 * parser.c (cp_parser_ref_qualifier_opt): Don't tentatively parse
2072 a ref-qualifier in C++98 mode.
2075 * pt.c (convert_nontype_argument) [INTEGER_CST]: Force the
2076 argument to have the exact type of the parameter.
2079 * semantics.c (cxx_eval_indirect_ref): Don't try to look through
2080 a POINTER_PLUS_EXPR for type punning diagnostic.
2083 * pt.c (tsubst_copy): Handle USING_DECL.
2085 2013-07-09 Marc Glisse <marc.glisse@inria.fr>
2088 * semantics.c (cxx_eval_bit_field_ref): Handle VECTOR_CST.
2090 2013-07-09 Marc Glisse <marc.glisse@inria.fr>
2093 * call.c (build_conditional_expr_1): Preserve xvalues.
2095 2013-07-09 Paolo Carlini <paolo.carlini@oracle.com>
2098 * parser.c (cp_parser_simple_declaration): Before calling shadow_tag
2099 also check declares_class_or_enum.
2101 2013-07-08 Jason Merrill <jason@redhat.com>
2104 * pt.c (fn_type_unification): Only defer during substitution.
2105 (type_unification_real): Defer during defarg substitution,
2106 add checks parm to pass back deferred checks.
2107 (unify, do_auto_deduction): Adjust.
2108 * semantics.c (reopen_deferring_access_checks): New.
2109 * cp-tree.h: Declare it.
2111 2013-07-06 Paolo Carlini <paolo.carlini@oracle.com>
2114 * parser.c (cp_parser_init_declarator): If we are parsing a typedef
2115 set parser->default_arg_ok_p to false before cp_parser_declarator.
2117 2013-07-05 Paolo Carlini <paolo.carlini@oracle.com>
2120 * class.c (build_base_path): Improve diagnostic.
2122 2013-07-04 Paolo Carlini <paolo.carlini@oracle.com>
2125 * decl.c (start_preparsed_function): Return a bool, false if
2126 push_template_decl fails.
2127 (start_function): Adjust.
2128 * cp-tree.h: Update.
2130 2013-07-03 Jakub Jelinek <jakub@redhat.com>
2133 * parser.c (cp_parser_postfix_expression) <case RID_STATCAST>
2134 Temporarily set parser->greater_than_is_operator_p for
2135 cp_parser_expression and restore from saved value afterwards.
2137 2013-06-28 Ed Smith-Rowland <3dw4rd@verizon.net>
2139 * cp-tree.h (UDLIT_OP_ANSI_PREFIX): Remove space.
2140 * parser.c (cp_parser_operator()): Parse user-defined string
2141 literal as literal operator.
2143 2013-06-28 Paolo Carlini <paolo.carlini@oracle.com>
2146 * class.c (deduce_noexcept_on_destructors): Save, set, and restore
2147 TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t) around the main loop over the
2150 2013-06-28 Balaji V. Iyer <balaji.v.iyer@intel.com>
2152 * parser.c (cp_parser_array_notation): Removed rejection array notation
2153 of type function pointers. Added handling of array expressions when
2154 Cilk Plus is enabled. Took out type-checking.
2155 (cp_parser_postfix_open_square_expression): Moved normal array expr.
2156 parsing into cp_parser_array_notation when cilkplus is enabled.
2157 (cp_parser_compound_statement): Removed expansion of array notations.
2158 (cp_parser_ctor_initializer_opt_and_function_body): Likewise.
2159 (cp_parser_function_definition_after_declarator): Likewise.
2160 (cp_parser_selection_statement): Removed error reporting.
2161 (cp_parser_iteration_statement): Likewise.
2162 (cp_parser_direct_declarator): Removed error checking/reporting if
2163 array notations are used in the declarator.
2164 * pt.c (instantiate_decl): Likewise.
2165 (type_unification_real): Removed a check for ARRAY_NOTATION_REF.
2166 (cxx_eval_constant_expression): Removed ARRAY_NOTATION_REF case.
2167 (potential_constant_expression_1): Returned false for
2168 ARRAY_NOTATION_REF case.
2169 * cp-gimplify.c (cp_genericize): Added expansion of array notation
2171 * cp-array-notation.c (make_triplet_val_inv): Removed loc and cry
2172 parameters. Replaced build_decls with get_temp_regvar with type as
2174 (create_array_refs): Made the type-casting to ptrdiff_type.
2175 (replace_invariant_var): Added a check for void return type before
2176 creating new var. Replaced build_decl and build_min_nt_loc with
2178 (expand_an_in_modify_expr): Ditto. Replaced body of redundant else
2179 with gcc_unreachable. Removed few unwanted checks. Made induction
2180 variable type as ptrdiff_type. Removed loc and complain arguments
2181 passed into make_triplet_val_inv. Replaced all modify expression's
2182 code from NOP EXPR to INIT EXPR. Replaced all forceful appending
2183 into stmt. list with the non-forceful one. Replaced some integer
2184 conversion and equality-checking to using tree_int_cst_equal.
2185 (expand_sec_reduce_builtin): All changes mentioned in above function
2186 expand_an_in_modify_expr. Made the new variable type of
2187 SEC_REDUCE_ANY/ALL_{NON}ZERO intrinsic functions as bool.
2188 (expand_array_notation_exprs): Removed SWITCH_EXPR case. Moved all
2189 the error reporting from parser to this function. Removed unwanted
2190 statements and checks from SWITCH_STMT, WHILE_STMT, and DO_STMT cases.
2191 (cilkplus_an_triplet_types_ok_p): Removed rejection of array notation
2192 in function pointers.
2193 (cp_expand_cond_array_notations): Added a new if statements to check
2194 if condition has a zero rank. If so, then just return.
2195 (expand_return_expr): Added a check for return expressions with a rank.
2196 Replaced get_tmp_regvar with a create_temporary_var.
2197 (build_array_notation_ref): Simplified and removed unwanted if-stmts.
2198 Moved common code outside if-statements. Moved type-checking from
2200 * semantics.c (finish_return_stmt): Removed a check for return exprs.
2202 * call.c (convert_like_real): Removed a check for array notation
2203 expression in a function.
2204 (build_over_call): Likewise.
2205 (magic_varargs_p): Added a check for builtin array notation function.
2206 Made this function non-static and removed its prototype.
2207 * cp-tree.h (magic_varargs_p): New prototype.
2208 * typeck.c (cp_build_function_call_vec): Removed automatic setting of
2209 nargs to the param->length when builtin reduction function is used.
2210 (convert_arguments): Replaced check for a constant_p function with
2211 margic_varargs_p function call.
2212 (cp_build_binary_op): Removed calling of the function
2213 find_correct_array_notation_type.
2214 (cp_build_addr_expr_1): Removed an unwanted if-statement.
2215 (convert_for_assignment): Removed automatic return of rhs when array
2216 notation builtin function is used.
2218 2013-06-28 Paolo Carlini <paolo.carlini@oracle.com>
2221 * parser.c (cp_parser_save_member_function_body): Handle correctly
2222 curly braces in function-try-block mem-initializers.
2224 2013-06-27 Marc Glisse <marc.glisse@inria.fr>
2227 * typeck.c (cp_build_vec_perm_expr): New function.
2228 * cp-tree.h: Declare it.
2229 * parser.c (cp_parser_postfix_expression): Call it.
2230 * pt.c (tsubst_copy): Handle VEC_PERM_EXPR.
2231 (tsubst_copy_and_build): Likewise.
2233 2013-06-27 Marc Glisse <marc.glisse@inria.fr>
2236 * pt.c (more_specialized_fn): If both arguments are references,
2237 give priority to an lvalue.
2239 2013-06-26 Jason Merrill <jason@redhat.com>
2241 * typeck2.c (store_init_value): Diagnose a non-constant
2242 initializer for in-class static.
2245 * semantics.c (add_capture): Set type to error_mark_node after
2248 2013-06-25 Ed Smith-Rowland <3dw4rd@verizon.net>
2251 * parser.c (cp_parser_unqualified_id): Add declarator_p to checks
2252 to trigger warning, (cp_literal_operator_id): Remove bogus TODO comment.
2254 2013-06-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
2256 * call.c (null_ptr_cst_p): Use cxx11 in lieu of cxx0x.
2257 * class.c (add_implicitly_declared_members): Likewise.
2258 (check_field_decl): Likewise.
2259 (finalize_literal_type_property): Likewise.
2260 (check_bases_and_members): Likewise.
2261 * decl.c (poplevel): Likewise.
2262 (case_conversion): Likewise.
2263 (check_initializer): Likewise.
2264 (grokfndecl): Likewise.
2265 (check_static_variable_definition): Likewise.
2266 (compute_array_index_type): Likewise.
2267 (grokdeclarator): Likewise.
2268 (build_enumerator): Likewise.
2269 * friend.c (make_friend_class): Likewise.
2270 * lex.c (init_reswords): Likewise.
2271 * method.c (synthesized_method_walk): Likewise.
2272 (implicitly_declare_fn): Likewise.
2273 * parser.c (cp_parser_diagnose_invalid_type_name): Likewise.
2274 (cp_parser_constant_expression): Likewise.
2275 (cp_parser_for_init_statement): Likewise.
2276 (cp_parser_block_declaration): Likewise.
2277 (cp_parser_type_name): Likewise.
2278 (cp_parser_enum_specifier): Likewise.
2279 (cp_parser_enumerator_list): Likewise.
2280 (cp_parser_member_declaration): Likewise.
2281 (cp_nth_tokens_can_be_std_attribute_p): Likewise.
2282 (cp_parser_template_declaration_after_export): Likewise.
2283 * pt.c (convert_nontype_argument_function): Likewise.
2284 (convert_nontype_argument): Likewise.
2285 (convert_template_argument): Likewise.
2286 (tsubst_copy_and_build): Likewise.
2287 (build_non_dependent_expr): Likewise.
2288 * semantics.c (non_const_var_error): Likewise.
2289 (potential_constant_expression_1): Likewise.
2290 * tree.c (lvalue_kind): Likewise.
2291 (build_vec_init_expr): Likewise.
2292 (cast_valid_in_integral_constant_expression_p): Likewise.
2293 * typeck.c (build_x_conditional_expr): Likewise.
2294 * typeck2.c (check_narrowing): Likewise.
2296 2013-06-21 Balaji V. Iyer <balaji.v.iyer@intel.com>
2298 * cp-array-notation.c (cp_length_mismatch_in_expr_p): Remove.
2299 (expand_an_in_modify_expr): Changed a function call from the above
2300 removed function to length_mismatch_in_expr_p.
2302 2013-06-21 Balaji V. Iyer <balaji.v.iyer@intel.com>
2304 * call.c (convert_like_real): Added a check if array notation is present
2305 in expression. If so, then no conversion of arguments is necessary.
2306 (build_over_call): Likewise.
2307 * typeck.c (cp_build_function_call_vec): Likewise.
2308 (convert_for_assignment): Likewise.
2309 (cp_build_array_ref): Reject array notations with a rank greater than 1
2310 as an array's index.
2311 (cp_build_binary_op): If array notations are preent in op, then call
2312 find_correct_array_notation_type.
2313 (cp_build_addr_expr_1): Handle ARRAY_NOTATION_REF similar to ARRAY_REF.
2314 * cp-array-notation.c: New file.
2315 * cp-objcp-common.c (cp_common_init_ts): Marked ARRAY_NOTATION_REF tree
2317 * cp-tree.h (fix_array_notation_exprs): New prototype.
2318 * semantics.c (finish_return_stmt): Reject array notations as
2320 (cxx_eval_constant_expression): Added ARRAY_NOTATION_REF case.
2321 (potential_constant_expression_1): Likewise.
2322 * tree.c (lvalue_kind): Likewise.
2323 * error.c (dump_decl): Likewise.
2324 (dump_expr): Likewise.
2325 * pt.c (ARRAY_NOTATION_REF): Likewise.
2326 (type_unification_real): Do not unify any arguments if array notations
2328 (instantiate_decl): Added a check for array notaitons inside the
2329 function body. If so, then expand them.
2330 * parser.c (cp_parser_array_notation): New function.
2331 (cp_parser_postfix_open_square_expression): Added a check for colons
2332 inside square braces. If found, then handle the array access as an
2333 array notation access. Also, disable auto-correction from a single
2334 colon to scope when Cilk Plus is enabled.
2335 (cp_parser_compound_statement): Added a check for array notations
2336 inside the statement. If found, then expand them.
2337 (cp_parser_ctor_initializer_opt_and_function_body): Likewise.
2338 (cp_parser_function_definition_after_declarator): Likewise.
2339 (cp_parser_selection_statement): Searched for array notations inside
2340 condition. If so, then emit an error.
2341 (cp_parser_iteration_statement): Likewise.
2342 (cp_parser_direct_declarator): Reject array notations inside a
2343 variable or array declaration.
2344 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Added cp/cp-array-notation.o.
2346 2013-06-20 Jason Merrill <jason@redhat.com>
2349 * decl.c (compute_array_index_type): Don't reject VLAs in SFINAE
2350 context if we're in C++14 mode.
2351 * tree.c (array_of_runtime_bound_p): Return true for a dependent
2352 bound that is not potentually constant.
2353 * cp-tree.h (DECL_VLA_CAPTURE_P, REFERENCE_VLA_OK): New.
2354 * pt.c (tsubst) [REFERENCE_TYPE]: Check REFERENCE_VLA_OK.
2355 * semantics.c (build_lambda_object): Don't rvalue a VLA capture.
2356 (build_capture_proxy): Set REFERENCE_VLA_OK.
2357 (vla_capture_type): Make it a proper C++ class.
2358 (add_capture): Set DECL_VLA_CAPTURE_P. Don't pre-digest the
2361 * decl.c (compute_array_index_type): Use size_one_node.
2363 * pt.c (process_partial_specialization): Build a TEMPLATE_DECL for
2364 a partial specialization.
2365 (tsubst_decl): Don't clobber CLASSTYPE_TI_TEMPLATE of a partial
2367 (most_specialized_class): Adjust.
2369 * cp-tree.h (DECL_TEMPLATE_PARMS, DECL_TEMPLATE_RESULT)
2370 (DECL_TEMPLATE_INSTANTIATIONS, DECL_TEMPLATE_SPECIALIZATIONS): Use
2371 TEMPLATE_DECL_CHECK.
2373 2013-06-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2376 * pt.c (unify, [TEMPLATE_PARM_INDEX]): Pass to unify_type_mismatch
2377 TREE_TYPE (arg), not arg itself.
2379 2013-06-18 Paolo Carlini <paolo.carlini@oracle.com>
2382 * pt.c (type_dependent_expression_p): Handle an array of unknown
2383 bound depending on a variadic parameter.
2384 * parser.c (cp_parser_range_for): Revert PR56794 changes.
2386 2013-06-17 Richard Biener <rguenther@suse.de>
2388 * cp-tree.h (ANON_AGGRNAME_FORMAT, ANON_AGGRNAME_P): Move to tree.h.
2390 2013-06-17 Paolo Carlini <paolo.carlini@oracle.com>
2393 * parser.c (cp_parser_expression_statement): Check whether
2394 cp_parser_expression returns error_mark_node.
2396 2013-06-14 Paolo Carlini <paolo.carlini@oracle.com>
2399 * semantics.c (finish_offsetof): Handle INDIRECT_REF as expr.
2401 2013-06-14 Paolo Carlini <paolo.carlini@oracle.com>
2404 * rtti.c (build_dynamic_cast_1): In case of cast to an unambiguous
2405 accessible base simply forward to build_static_cast.
2407 2013-06-12 Paolo Carlini <paolo.carlini@oracle.com>
2410 * decl.c (poplevel): For the benefit of -Wunused-variable see
2413 2013-06-12 Paolo Carlini <paolo.carlini@oracle.com>
2415 * parser.c (cp_parser_nested_name_specifier_opt): Fix typo in comment.
2417 2013-06-12 Paolo Carlini <paolo.carlini@oracle.com>
2420 * parser.c (cp_parser_nested_name_specifier_opt): Avoid emitting
2421 again diagnostic already emitted by cp_parser_lookup_name.
2423 2013-06-11 Jan Hubicka <jh@suse.cz>
2426 * cp/pt.c (mark_decl_instantiated): Do not export explicit
2427 instantiations of anonymous namespace templates.
2429 2013-06-10 Jason Merrill <jason@redhat.com>
2431 * name-lookup.c (add_decl_to_level): Add decls in an anonymous
2432 namespace to static_decls.
2434 2013-06-07 Sriraman Tallam <tmsriram@google.com>
2437 * call.c (build_over_call): Check if current_function_decl is
2440 2013-06-07 Paolo Carlini <paolo.carlini@oracle.com>
2443 * pt.c (lookup_template_class_1): Consistently use TYPE_MAIN_DECL,
2444 not TYPE_STUB_DECL, to access the _DECL for a _TYPE.
2446 2013-06-06 Jason Merrill <jason@redhat.com>
2449 * semantics.c (add_capture): Diagnose capture of variable-size
2450 type that is not a C++1y array of runtime bound.
2452 * decl.c (grokdeclarator): Keep a decl with error type.
2453 (grokfield, grokbitfield): Likewise.
2454 * pt.c (instantiate_class_template_1): Likewise.
2455 (tsubst_decl): Drop redundant error.
2456 * class.c (walk_subobject_offsets): Handle erroneous fields.
2457 * typeck2.c (process_init_constructor_record): Likewise.
2459 2013-06-05 Paolo Carlini <paolo.carlini@oracle.com>
2462 * parser.c (cp_parser_postfix_expression [RID_*CAST]): Set
2463 parser->in_type_id_in_expr_p before calling cp_parser_type_id.
2465 2013-06-03 Jan Hubicka <jh@suse.cz>
2467 * decl2.c (maybe_make_one_only): Use forced_by_abi instead of
2468 mark_decl_referenced.
2469 (mark_needed): Likewise.
2471 2013-06-03 Jason Merrill <jason@redhat.com>
2473 * class.c (mark_type_abi_tags): New.
2474 (check_abi_tags): Use it.
2476 2013-06-03 Paolo Carlini <paolo.carlini@oracle.com>
2479 * decl2.c (mark_used): Add overload taking a tsubst_flags_t too.
2480 * semantics.c (finish_qualified_id_expr): Use it.
2481 * cp-tree.h: Update.
2483 2013-06-01 Jan Hubicka <jh@suse.cz>
2485 * decl2.c (cp_write_global_declarations): Replace same_body_alias
2486 by symbol.cpp_implicit_alias.
2488 2013-05-30 Jason Merrill <jason@redhat.com>
2491 * cp-lang.c (cp_classify_record): Handle structs without
2495 * class.c (common_enclosing_class): New.
2496 * cp-tree.h: Declare it.
2497 * init.c (sort_mem_initializers): Don't splice out a union member
2500 2013-05-29 Jan Hubicka <jh@suse.cz>
2502 * tree.c (cp_fix_function_decl_p): Update for new symtab flags.
2503 * decl2.c )var_finalized_p, cp_write_global_declarations): Likewise.
2505 2013-05-25 Paolo Carlini <paolo.carlini@oracle.com>
2508 * decl2.c (check_classfn): Check for destructors declared as member
2511 2013-05-24 Jason Merrill <jason@redhat.com>
2514 * pt.c (any_template_arguments_need_structural_equality_p): A
2515 TEMPLATE_TEMPLATE_PARM can require structural type comparison.
2517 2013-05-24 Paolo Carlini <paolo.carlini@oracle.com>
2520 * class.c (check_bitfield_decl): Warn for bool and enum bitfields
2521 with width exceeding the type.
2523 2013-05-24 Jason Merrill <jason@redhat.com>
2526 * semantics.c (cxx_eval_constant_expression): Handle FMA_EXPR.
2527 (cxx_eval_trinary_expression): Rename from cxx_eval_vec_perm_expr.
2529 2013-05-23 Jason Merrill <jason@redhat.com>
2532 * tree.c (build_ref_qualified_type): Clear
2533 FUNCTION_RVALUE_QUALIFIED for lvalue ref-qualifier.
2535 2013-05-22 Jason Merrill <jason@redhat.com>
2538 * call.c (convert_like_real): Use cp_convert_and_check.
2539 * cvt.c (cp_convert_and_check): Use maybe_constant_value.
2540 * semantics.c (cxx_eval_constant_expression): Handle LTGT_EXPR.
2541 (potential_constant_expression_1): Handle OMP_ATOMIC*.
2544 * semantics.c (maybe_add_lambda_conv_op): Give up if the call op
2547 2013-05-22 Paolo Carlini <paolo.carlini@oracle.com>
2550 * parser.c (cp_parser_conversion_type_id): Set up
2551 parser->type_definition_forbidden_message before calling
2552 cp_parser_type_specifier_seq.
2554 2013-05-22 Paolo Carlini <paolo.carlini@oracle.com>
2557 * method.c (defaultable_fn_check): Avoid do_warn_unused_parameter
2558 warnings about defaulted functions.
2560 2013-05-21 Paolo Carlini <paolo.carlini@oracle.com>
2562 * call.c (build_conditional_expr_1): Add location_t parameter.
2563 (build_conditional_expr): Likewise.
2564 * typeck.c (rationalize_conditional_expr, cp_build_array_ref,
2565 get_member_function_from_ptrfunc, build_x_conditional_expr,
2566 cp_build_modify_expr): Update.
2567 * init.c (build_new_1): Likewise.
2568 * cp-tree.h: Update declaration.
2570 2013-05-20 Jason Merrill <jason@redhat.com>
2573 * pt.c (instantiation_dependent_r) [TRAIT_EXPR]: Only check type2
2577 * decl.c (fndecl_declared_return_type): Also look in
2578 DECL_SAVED_FUNCTION_DATA.
2580 2013-05-20 Paolo Carlini <paolo.carlini@oracle.com>
2583 * parser.c (cp_parser_parameter_declaration): Check return value
2584 of cp_parser_parse_and_diagnose_invalid_type_name.
2586 2013-05-20 Jason Merrill <jason@redhat.com>
2589 * class.c (vbase_has_user_provided_move_assign): New.
2590 * method.c (synthesized_method_walk): Check it.
2591 * cp-tree.h: Declare it.
2594 * tree.c (build_cplus_array_type): Copy layout info if element
2597 2013-05-20 Paolo Carlini <paolo.carlini@oracle.com>
2600 * call.c (build_new_op_1): Propagate loc to cp_build_binary_op.
2602 2013-05-20 Jason Merrill <jason@redhat.com>
2605 * decl2.c (determine_visibility): Use PRIMARY_TEMPLATE_P to decide
2606 whether a template has its own args.
2608 2013-05-20 Paolo Carlini <paolo.carlini@oracle.com>
2611 * pt.c (unify_no_common_base): Swap arg and parm arguments to inform.
2613 2013-05-20 Paolo Carlini <paolo.carlini@oracle.com>
2616 * parser.c (cp_parser_postfix_expression): Use cp_parser_braced_list
2617 instead of cp_parser_initializer_list for compound-literals.
2619 2013-05-20 Marc Glisse <marc.glisse@inria.fr>
2622 * typeck.c (check_return_expr): Reverse the alignment comparison.
2624 2013-05-17 Paolo Carlini <paolo.carlini@oracle.com>
2627 * parser.c (cp_parser_sizeof_operand): As a GNU Extension, parse
2628 correctly sizeof compound-literal; update comments.
2630 2013-05-16 Marc Glisse <marc.glisse@inria.fr>
2632 * call.c (build_conditional_expr_1): Use cp_build_binary_op
2633 instead of directly calling fold_build2.
2635 2013-05-16 Jason Merrill <jason@redhat.com>
2637 * Make-lang.in (cc1plus$(exeext)): Use link mutex.
2640 * decl.c (grokdeclarator): Allow member function qualifiers in
2641 TYPENAME context in C++11 mode.
2643 2013-05-16 Dodji Seketeli <dodji@redhat.com>
2645 PR c++/56782 - Regression with empty pack expansions
2646 * pt.c (use_pack_expansion_extra_args_p): When at least a
2647 parameter pack has an empty argument pack, and another parameter
2648 pack has no argument pack at all, use the PACK_EXPANSION_EXTRA
2651 2013-05-15 Paolo Carlini <paolo.carlini@oracle.com>
2653 * name-lookup.c (pushdecl_maybe_friend_1): Replace pairs of
2654 warning_at and permerror with warning_at/inform and permerror/
2655 inform, respectively.
2657 2013-05-15 Paolo Carlini <paolo.carlini@oracle.com>
2660 * name-lookup.c (pushdecl_maybe_friend_1): Diagnose illegal
2663 2013-05-14 Jason Merrill <jason@redhat.com>
2666 * parser.c (cp_parser_range_for): Call complete_type.
2669 * pt.c (tsubst_copy_and_build): Don't recur into a designator.
2671 2013-05-14 Paolo Carlini <paolo.carlini@oracle.com>
2674 * method.c (defaulted_late_check): Check for compatible exception
2675 specification out of class explicitly defaulted functions too.
2677 2013-05-14 Jason Merrill <jason@redhat.com>
2680 * semantics.c (potential_constant_expression_1): Make sure the
2681 called function is potentially constant.
2682 * call.c (null_ptr_cst_p): Revert earlier change.
2684 2013-05-13 Jason Merrill <jason@redhat.com>
2687 * call.c (null_ptr_cst_p): An expression with side-effects can't
2688 be a C++03 null pointer constant.
2691 * decl.c (reshape_init_class): Handle error_mark_node.
2694 * typeck.c (merge_types): Propagate ref-qualifier
2695 in METHOD_TYPE case.
2698 * decl.c (grokdeclarator): Apply ref-qualifier
2699 in the TYPENAME case.
2702 * decl.c (decls_match): Compare ref-qualifiers.
2704 2013-05-10 Jason Merrill <jason@redhat.com>
2707 * pt.c (convert_template_argument): Use dependent_template_arg_p,
2708 not uses_template_parms.
2711 * semantics.c (cxx_fold_indirect_ref): Fix thinko.
2714 * semantics.c (add_capture): Error rather than abort on copy
2716 * typeck.c (maybe_warn_about_returning_address_of_local): Don't
2717 warn about capture proxy.
2719 2013-05-09 Jason Merrill <jason@redhat.com>
2721 * decl.c (cp_finish_decl): Only check VLA bound in C++1y mode.
2724 * pt.c (lookup_template_class_1): Handle getting a template
2725 template parameter as D1.
2727 N3639 C++1y VLA diagnostics
2728 * decl.c (grokdeclarator): Complain about reference, pointer, or
2730 (create_array_type_for_decl): Complain about array of VLA.
2731 * pt.c (tsubst): Likewise.
2732 * rtti.c (get_tinfo_decl): Talk about "array of runtime bound".
2733 * semantics.c (finish_decltype_type): Complain about decltype of VLA.
2734 * typeck.c (cp_build_addr_expr_1): Complain about VLA.
2735 (cxx_sizeof_or_alignof_type): Likewise.
2737 N3639 C++1y VLA support
2738 * decl.c (compute_array_index_type): Allow VLAs in C++1y mode.
2739 (check_array_initializer): Allow VLA init.
2740 (reshape_init_array_1): Adjust.
2741 (cp_finish_decl): Check for invalid VLA length.
2742 * typeck2.c (process_init_constructor_array): Adjust.
2743 (store_init_value): Use build_vec_init for VLAs.
2744 * semantics.c (add_capture): Capture VLA as ptr+len.
2745 (vla_capture_type): New.
2746 (build_capture_proxy): Rebuild the VLA.
2747 * typeck.c (build_simple_component_ref): Split out from...
2748 (build_ptrmemfunc_access_expr): ...here.
2749 * tree.c (array_of_runtime_bound_p): New.
2750 * init.c (throw_bad_array_length): New.
2751 (build_vec_init): Use it.
2752 * parser.c (cp_convert_range_for): When iterating over a VLA,
2753 use it directly rather than bind a reference.
2754 * cp-tree.h: Declare new functions.
2756 2013-05-08 Jason Merrill <jason@redhat.com>
2758 * except.c (is_admissible_throw_operand_or_catch_parameter): Check
2759 variably_modified_type_p.
2760 (expand_start_catch_block): Mark the typeinfo used here.
2761 * semantics.c (finish_handler_parms): Not here.
2763 * error.c (dump_type_suffix): Try harder on VLA length.
2766 * init.c (throw_bad_array_new_length): New.
2767 (build_new_1): Use it. Don't warn about braced-init-list.
2768 (build_vec_init): Use it.
2769 * call.c (build_operator_new_call): Use it.
2772 * decl.c (grokdeclarator): Warn about ref-qualifiers here.
2773 * parser.c (cp_parser_ref_qualifier_seq_opt): Not here.
2774 * error.c (maybe_warn_cpp0x): s/0x/11/.
2776 2013-05-08 Paolo Carlini <paolo.carlini@oracle.com>
2779 * parser.c (cp_parser_enum_specifier): Handle nested_name_specifier
2782 2013-05-06 Marc Glisse <marc.glisse@inria.fr>
2784 * typeck.c (cp_build_binary_op): Call save_expr before
2785 build_vector_from_val.
2787 2013-05-06 Paolo Carlini <paolo.carlini@oracle.com>
2790 * decl.c (cp_finish_decl): After do_auto_deduction copy the
2791 qualifers with cp_apply_type_quals_to_decl.
2793 2013-05-05 Paolo Carlini <paolo.carlini@oracle.com>
2795 * pt.c (convert_nontype_argument): Add missing whitespace in
2798 2013-05-04 Paolo Carlini <paolo.carlini@oracle.com>
2801 * decl.c (build_enumerator): Improve error message.
2803 2013-05-03 Paolo Carlini <paolo.carlini@oracle.com>
2806 * parser.c (cp_parser_diagnose_invalid_type_name): Improve error
2807 messages for template types and fix column numbers.
2809 2013-05-01 Paolo Carlini <paolo.carlini@oracle.com>
2812 * pt.c (tsubst_copy_and_build, MODOP_EXPR): Increase / decrease
2813 c_inhibit_evaluation_warnings around build_x_modify_expr call.
2815 2013-05-01 Paolo Carlini <paolo.carlini@oracle.com>
2818 * semantics.c (finish_decltype_type): Handle instantiated template
2821 2013-04-28 Paolo Carlini <paolo.carlini@oracle.com>
2824 * semantics.c (finish_decltype_type): Handle COMPOUND_EXPR.
2826 2013-04-26 Jakub Jelinek <jakub@redhat.com>
2828 * error.c (cp_print_error_function): Adjust file_name_as_prefix
2831 2013-04-25 Jason Merrill <jason@redhat.com>
2834 * typeck.c (cxx_alignas_expr): Handle value-dependence properly.
2837 * init.c (perform_member_init): Call reshape_init.
2839 2013-04-24 Jason Merrill <jason@redhat.com>
2842 * parser.c (cp_parser_postfix_dot_deref_expression): Fix thinko.
2844 2013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
2846 * typeck.c (cxx_sizeof_or_alignof_type): Change -Wpointer-arith
2847 pedwarn to simply use OPT_Wpointer_arith.
2848 (cp_build_unary_op): Likewise.
2850 2013-04-24 Jason Merrill <jason@redhat.com>
2852 N3648: init-captures are named.
2853 * semantics.c (add_capture): Don't prepend "__" to init-captures.
2854 (build_capture_proxy): Adjust.
2855 * error.c (dump_simple_decl): Check DECL_NORMAL_CAPTURE_P.
2857 N3648: Allow braced and parenthesized initializers.
2858 * parser.c (cp_parser_lambda_introducer): Use cp_parser_initializer.
2859 * pt.c (tsubst) [DECLTYPE_TYPE]: Handle DECLTYPE_FOR_INIT_CAPTURE.
2860 * semantics.c (lambda_capture_field_type): Use do_auto_deduction.
2861 (add_capture): Collapse a parenthesized initializer into a single
2863 * cp-tree.h (DECLTYPE_FOR_INIT_CAPTURE): New.
2865 2013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
2868 * init.c (build_offset_ref): Add tsubst_flags_t parameter.
2869 * semantics.c (finish_qualified_id_expr): Likewise.
2870 (finish_id_expression): Update.
2871 * typeck.c (cp_build_addr_expr_1): Likewise.
2872 * pt.c (tsubst_qualified_id, resolve_nondeduced_context): Likewise.
2873 * cp-tree.h: Update declarations.
2875 2013-04-22 Jason Merrill <jason@redhat.com>
2878 * parser.c (cp_parser_unqualified_id): Handle ~auto.
2879 (cp_parser_pseudo_destructor_name): Likewise.
2880 (cp_parser_postfix_dot_deref_expression): Adjust.
2881 (cp_lexer_nth_token_is_keyword): New.
2882 * semantics.c (finish_pseudo_destructor_expr): Handle ~auto.
2883 * typeck.c (lookup_destructor): Handle ~auto.
2885 * pt.c (fn_type_unification): Push tinst level around
2886 type_unification_real if we aren't explaining.
2887 * cp-tree.h (TFF_NO_TEMPLATE_BINDINGS): New.
2888 * error.c (dump_function_decl): Respect it.
2889 (subst_to_string): Pass it.
2892 * rtti.c (get_typeid): Diagnose qualified function type.
2893 * pt.c (tsubst) [POINTER_TYPE]: Likewise.
2895 * error.c (dump_aggr_type): Fix lambda detection.
2896 (dump_simple_decl): Pretty-print capture field.
2899 * cvt.c (build_expr_type_conversion): Two conversions that return
2900 the same type aren't necessarily ambiguous.
2903 * parser.c (cp_parser_lambda_introducer): Make lambda capture init
2904 pedwarn unconditional except in C++1y mode.
2906 * semantics.c (potential_constant_expression_1): Don't crash on
2910 * semantics.c (finish_id_expression): Reject capture of anonymous
2914 * decl2.c (check_default_args): Check for pack expansion.
2916 * mangle.c (write_type): Mangle decltype(auto).
2918 2013-04-19 Jason Merrill <jason@redhat.com>
2920 N3638 changes to return type deduction
2921 * decl.c (undeduced_auto_decl): New.
2922 (require_deduced_type): New.
2923 (fndecl_declared_return_type): New.
2924 (decls_match): Use it.
2925 (duplicate_decls): Don't check for auto return.
2926 (grokdeclarator): Reject virtual auto.
2927 * class.c (resolve_address_of_overloaded_function): Handle
2928 auto function templates.
2929 * decl2.c (mark_used): Use undeduced_auto_decl, require_deduced_type.
2930 * cp-tree.h: Declare new fns.
2931 * error.c (dump_function_decl): Use fndecl_declared_return_type.
2932 * search.c (check_final_overrider): Likewise.
2933 * pt.c (make_decltype_auto): New.
2934 (do_auto_deduction): Require plain decltype(auto).
2938 * decl.c (duplicate_decls): Don't propagate DECL_DELETED_FN to
2939 template specializations.
2941 2013-04-16 Ed Smith-Rowland <3dw4rd@verizon.net>
2943 Implement n3599 - Literal operator templates for strings.
2944 * parser.c (make_string_pack (tree value)): New function.
2945 (cp_parser_userdef_string_literal (cp_token *)): Use it
2946 to construct calls to character string literal operator templates.
2947 (cp_parser_template_declaration_after_export): Check for new string
2948 literal operator template parameter form.
2950 2013-04-15 Jason Merrill <jason@redhat.com>
2952 * pt.c (tsubst) [DECLTYPE_TYPE]: Use tsubst_copy_and_build.
2955 * pt.c (tsubst) [DECLTYPE_TYPE]: If ~id is an expression
2956 rather than a destructor name, it isn't an unqualified-name.
2957 (tsubst_copy_and_build): Pass down decltype_flag to operator
2961 * semantics.c (insert_capture_proxy): Just use index 1 in the
2964 2013-04-12 Jakub Jelinek <jakub@redhat.com>
2966 * error.c (cp_print_error_function,
2967 print_instantiation_partial_context_line,
2968 maybe_print_constexpr_context): Colorize locus strings.
2970 2013-04-11 Jason Merrill <jason@redhat.com>
2973 * parser.c (complain_flags): New.
2974 (cp_parser_postfix_expression): Use it.
2975 (cp_parser_unary_expression): Likewise.
2976 (cp_parser_binary_expression): Likewise.
2977 (cp_parser_assignment_expression): Likewise.
2978 (cp_parser_expression): Likewise.
2979 (cp_parser_postfix_open_square_expression): Take decltype_p.
2980 (cp_parser_builtin_offsetof): Adjust.
2981 (cp_convert_range_for): Pass complain to finish_unary_op_expr.
2982 * decl2.c (grok_array_decl): Add decltype_p parm.
2983 * cp-tree.h: Adjust prototype.
2984 * semantics.c (finish_unary_op_expr): Add complain parm.
2986 2013-04-11 Jakub Jelinek <jakub@redhat.com>
2989 * call.c (null_ptr_cst_p): Call fold_non_dependent_expr_sfinae before
2990 calling maybe_constant_value for C++98.
2992 2013-04-11 Jason Merrill <jason@redhat.com>
2995 * semantics.c (lambda_capture_field_type, lambda_proxy_type):
2996 Strip references before checking WILDCARD_TYPE_P.
2998 2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
3000 * call.c (build_conditional_expr_1, build_over_call): Protect
3001 error calls with complain & tf_error.
3002 * typeck.c (finish_class_member_access_expr, cp_build_binary_op,
3003 build_x_unary_op, cp_build_unary_op, cp_build_compound_expr,
3004 build_ptrmemfunc): Likewise.
3005 (lookup_destructor): Take tsubst_flags_t parameter, adjust.
3007 * cvt.c (warn_ref_binding): Rename to diagnose_ref_binding.
3008 (convert_to_reference): Adjust.
3010 2013-04-11 Jason Merrill <jason@redhat.com>
3012 * pt.c (tsubst_copy) [VAR_DECL]: Don't call tsubst for
3013 local variables, look them up instead.
3014 (tsubst_decl) [VAR_DECL]: Remove handling for anonymous union
3015 proxies and substitution in unevaluated context.
3016 (tsubst_expr) [OMP_FOR]: Instantiate OMP_FOR_PRE_BODY
3017 before the iterators.
3020 * pt.c (uses_deducible_template_parms): New.
3021 (deducible_array_bound, deducible_expression): New.
3022 (deducible_template_args): New.
3023 (unify_one_argument): Call uses_deducible_template_parms.
3025 2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
3028 * typeck2.c (build_m_component_ref): Protect error calls with
3029 (complain & tf_error).
3031 2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
3034 * parser.c (cp_parser_enum_specifier): Check for empty
3035 anonymous enums and anonymous scoped enums.
3037 2013-04-10 Jakub Jelinek <jakub@redhat.com>
3040 * typeck.c (cp_build_binary_op): Call fold_non_dependent_expr_sfinae
3041 first before calling maybe_constant_value for warn_for_div_by_zero
3042 or invalid shift count warning purposes.
3044 2013-04-09 Jason Merrill <jason@redhat.com>
3047 * rtti.c (build_typeid): Check the address of the argument
3048 rather than looking for an INDIRECT_REF.
3050 2013-04-04 Jason Merrill <jason@redhat.com>
3054 * typeck2.c (abstract_virtuals_error_sfinae): Disable
3055 complete_type again.
3057 2013-04-08 Paolo Carlini <paolo.carlini@oracle.com>
3060 * decl.c (validate_constexpr_redeclaration): Allow an explicit
3061 specialization to be different wrt the constexpr specifier.
3063 2013-04-06 Jason Merrill <jason@redhat.com>
3065 * parser.c (cp_parser_std_attribute): Treat [[noreturn]] like GNU
3068 2013-04-05 Ed Smith-Rowland <3dw4rd@verizon.net>
3070 * parser.c (cp_parser_ref_qualifier_seq_opt): Move to
3071 cp_parser_ref_qualifier_opt. Error if more than one ref-qual found.
3073 2013-04-03 Jason Merrill <jason@redhat.com>
3075 * cp-tree.h (FUNCTION_OR_METHOD_TYPE_CHECK): Remove.
3076 (TYPE_RAISES_EXCEPTIONS): Use FUNC_OR_METHOD_CHECK instead.
3077 (FUNCTION_REF_QUALIFIED, FUNCTION_RVALUE_QUALIFIED): Likewise.
3079 * mangle.c (write_type): When writing a function type with
3080 function-cv-quals, don't add the unqualified type as a
3081 substitution candidate.
3083 2013-04-03 Paolo Carlini <paolo.carlini@oracle.com>
3086 * typeck.c (cp_build_unary_op): Change -Wpointer-arith permerror to
3089 2013-04-03 Jakub Jelinek <jakub@redhat.com>
3092 * tree.c (strip_typedefs): Copy NON_DEFAULT_TEMPLATE_ARGS_COUNT
3093 from args to new_args.
3094 (strip_typedefs_expr): Copy NON_DEFAULT_TEMPLATE_ARGS_COUNT from t to
3095 r instead of doing {S,G}ET_NON_DEFAULT_TEMPLATE_ARGS_COUNT.
3097 2013-04-02 Jason Merrill <jason@redhat.com>
3100 * mangle.c (write_function_type): Mangle ref-qualifier.
3101 (write_nested_name): Likewise.
3102 (canonicalize_for_substitution): Preserve ref-qualifier.
3103 (write_type): Likewise.
3106 * decl.c (begin_destructor_body): Clobber the object in a cleanup.
3108 2013-04-02 Paolo Carlini <paolo.carlini@oracle.com>
3110 * friend.c (do_friend): Use COMPLETE_OR_OPEN_TYPE_P.
3111 * pt.c (find_parameter_packs_r): Use TYPE_ALIAS_P and TYPE_TI_ARGS.
3112 (for_each_template_parm_r): Use TYPE_TI_ARGS.
3114 2013-04-02 Paolo Carlini <paolo.carlini@oracle.com>
3116 * cp-tree.h (TAGGED_TYPE_P): Remove.
3117 (IS_OVERLOAD_TYPE): Rename to OVERLOAD_TYPE_P, adjust.
3118 (TYPE_ANONYMOUS_P): Adjust.
3119 * call.c (build_new_op_1): Likewise.
3120 * class.c (find_abi_tags_r): Likewise.
3121 * decl.c (warn_misplaced_attr_for_class_type, start_decl,
3122 type_is_deprecated): Likewise.
3123 * decl2.c (grokfield, min_vis_r): Likewise.
3124 * pt.c (get_template_info): Likewise.
3125 * tree.c (handle_abi_tag_attribute): Likewise.
3127 2013-04-01 Jason Merrill <jason@redhat.com>
3129 * semantics.c (maybe_constant_value): Check
3130 instantiation_dependent_expression_p.
3131 * pt.c (build_non_dependent_expr): Don't check it here.
3134 * init.c (build_new): Don't try to process an array initializer
3135 at template definition time.
3138 * typeck.c (finish_class_member_access_expr): Handle enum scope.
3141 * parser.c (cp_parser_range_for): Don't try to do auto deduction
3142 in a template if the type of the range is incomplete.
3144 * call.c (add_function_candidate): Take the address of 'this' here.
3145 (build_over_call): And here.
3146 (build_new_method_call_1, build_op_call_1): Not here.
3147 (build_user_type_conversion_1): Or here.
3148 (add_candidates): Adjust.
3150 * cxx-pretty-print.h (pp_cxx_cv_qualifiers): New.
3151 * class.c (same_signature_p): Use type_memfn_quals.
3152 * cp-tree.h (TYPE_RAISES_EXCEPTIONS): Use
3153 FUNCTION_OR_METHOD_TYPE_CHECK.
3154 * error.c (dump_type_suffix): Add padding before cv-qualifiers.
3155 * pt.c (unify): Use static_fn_type.
3157 2013-04-01 Bronek Kozicki <b.kozicki@gmail.com>
3158 Jason Merrill <jason@redhat.com>
3160 Implement N2439 (ref-qualifiers for 'this')
3161 * cp-tree.h (FUNCTION_REF_QUALIFIED): New.
3162 (FUNCTION_RVALUE_QUALIFIED): New.
3163 (FUNCTION_OR_METHOD_TYPE_CHECK): New.
3164 (cpp0x_warn_str): Add CPP0X_REF_QUALIFIER.
3165 (cp_ref_qualifier): New enum.
3166 (cp_declarator): Add ref_qualifier.
3167 * parser.c (cp_parser_ref_qualifier_seq_opt): New.
3168 (cp_parser_direct_declarator): Use it.
3169 (make_call_declarator): Adjust.
3170 (cp_parser_lambda_declarator_opt): Adjust.
3171 * call.c (add_function_candidate): Handle ref-qualifier overload
3172 resolution semantics.
3173 (standard_conversion): Adjust.
3174 * class.c (add_method, same_signature_p): Compare ref-qualifiers.
3175 * decl.c (grokdeclarator): Handle ref-qualifiers.
3176 (grokfndecl): Check for invalid ref-qualifiers.
3177 (static_fn_type, revert_static_member_fn): Adjust.
3178 * decl2.c (build_memfn_type): Handle ref-qualifiers.
3179 (check_classfn): Check them.
3180 (cp_reconstruct_complex_type): Retain them.
3181 * error.c (dump_ref_qualifier): New.
3182 (dump_type_suffix, dump_function_decl): Use it.
3183 (maybe_warn_cpp0x): Handle CPP0X_REF_QUALIFIER.
3184 * pt.c (tsubst, tsubst_function_type): Instantiate ref-quals.
3185 (unify): Retain them.
3186 * tree.c (cp_check_qualified_type): New.
3187 (cp_build_qualified_type_real): Keep exception spec and ref-qual.
3188 (build_ref_qualified_type): New.
3189 (strip_typedefs, build_exception_variant): Keep ref-qualifier.
3190 (cp_build_type_attribute_variant): Keep ref-qualifier.
3191 * typeck.c (merge_types): Keep ref-qualifier.
3192 (structural_comptypes): Compare ref-qualifier.
3193 (type_memfn_rqual): New.
3194 (apply_memfn_quals): Take ref-qual argument.
3195 * typeck2.c (build_m_component_ref): Check ref-qualifier.
3197 2013-04-01 Paolo Carlini <paolo.carlini@oracle.com>
3199 * cp-tree.h (DECL_UNBOUND_CLASS_TEMPLATE_P): Remove.
3200 (DECL_FUNCTION_TEMPLATE_P): Adjust.
3202 * cxx-pretty-print.c (pp_cxx_nested_name_specifier,
3203 pp_cxx_qualified_id): Use get_containing_scope.
3204 * parser.c (cp_parser_class_head): Likewise.
3205 * pt.c (push_template_decl_real): Likewise.
3207 * decl2.c (import_export_decl): Use DECL_TEMPLOID_INSTANTIATION.
3208 * pt.c (unify): Use CP_INTEGRAL_TYPE_P.
3210 2013-03-31 Paolo Carlini <paolo.carlini@oracle.com>
3212 * decl2.c (collect_candidates_for_java_method_aliases): Use
3214 * name-lookup.c (pushtag_1) Use TYPE_FUNCTION_SCOPE_P.
3215 (pushdecl_maybe_friend_1): Use DECL_DECLARES_FUNCTION_P.
3216 * decl.c (duplicate_decls): Likewise.
3217 * parser.c (cp_parser_template_declaration_after_export): Likewise,
3218 also DECL_DECLARES_TYPE_P.
3219 * pt.c (instantiate_class_template_1): Likewise.
3220 * search.c (lookup_field_1): Use DECL_DECLARES_TYPE_P.
3221 (lookup_field_r): Likewise.
3222 (friend_accessible_p): Use DECL_DECLARES_FUNCTION_P.
3223 (lookup_fnfields_slot_nolazy): Likewise.
3224 * semantics.c (finish_member_declaration): Likewise.
3225 * typeck.c (convert_for_initialization): Use TYPE_REFFN_P.
3227 2013-03-29 Gabriel Dos Reis <gdr@integrable-solutions.net>
3229 * pt.c (template_parms_to_args): Fix typo in comment.
3231 2013-03-29 Paolo Carlini <paolo.carlini@oracle.com>
3233 * call.c (build_op_call_1): Use TYPE_PTRFN_P and TYPE_REFFN_P.
3235 2013-03-29 Paolo Carlini <paolo.carlini@oracle.com>
3237 * call.c (add_builtin_candidate): Use TYPE_PTR_P and VOID_TYPE_P.
3238 (build_op_call_1): Likewise.
3239 (build_over_call): Likewise.
3240 (compare_ics): Likewise.
3241 * class.c (build_base_path): Likewise.
3242 (resolve_address_of_overloaded_function): Likewise.
3243 * cp-tree.h: Likewise.
3244 * cvt.c (cp_convert_to_pointer): Likewise.
3245 (convert_to_reference): Likewise.
3246 (ocp_convert): Likewise.
3247 (convert_force): Likewise, tidy.
3248 * cxx-pretty-print.c (pp_cxx_postfix_expression): Likewise.
3249 (pp_cxx_ptr_operator): Likewise.
3250 * decl.c (duplicate_decls): Likewise.
3251 (start_decl): Likewise.
3252 (grok_op_properties): Likewise.
3253 (start_preparsed_function): Likewise.
3254 (store_parm_decls): Likewise.
3255 (finish_function): Likewise.
3256 * decl2.c (delete_sanity): Likewise.
3257 (acceptable_java_type): Likewise.
3258 (grokbitfield): Likewise.
3259 (cp_reconstruct_complex_type): Likewise.
3260 * error.c (dump_type_prefix): Likewise.
3261 (dump_expr): Likewise.
3262 * except.c (push_eh_cleanup): Likewise.
3263 (complete_ptr_ref_or_void_ptr_p): Likewise.
3264 (can_convert_eh): Likewise.
3265 * init.c (build_new_1): Likewise.
3266 (build_delete): Likewise.
3267 (build_vec_delete): Likewise.
3268 * mangle.c (write_type): Likewise.
3269 * parser.c (lookup_literal_operator): Likewise.
3270 * pt.c (convert_nontype_argument_function): Likewise.
3271 (convert_nontype_argument): Likewise.
3274 (dependent_type_p_r): Likewise.
3275 * rtti.c (build_headof): Likewise.
3276 (build_typeid): Likewise.
3277 (build_dynamic_cast_1): Likewise.
3278 (target_incomplete_p): Likewise.
3279 (typeinfo_in_lib_p): Likewise.
3280 * semantics.c (finish_omp_for): Likewise.
3281 (cxx_eval_call_expression): Likewise.
3282 (maybe_resolve_dummy): Likewise.
3283 * tree.c (build_target_expr): Likewise.
3284 (cp_build_qualified_type_real): Likewise.
3285 * typeck.c (composite_pointer_type_r): Likewise.
3286 (composite_pointer_type): Likewise.
3287 (comp_except_types): Likewise.
3288 (cxx_sizeof_nowarn): Likewise.
3289 (string_conv_p): Likewise.
3290 (cp_build_array_ref): Likewise.
3291 (cp_build_function_call_vec): Likewise, also use TYPE_PTRFN_P.
3292 (pointer_diff): Likewise.
3293 (cp_build_addr_expr_1): Likewise.
3294 (cp_build_unary_op): Likewise.
3295 (build_static_cast_1): Likewise.
3296 (cp_build_c_cast): Likewise.
3297 (comp_ptr_ttypes_real): Likewise.
3298 (ptr_reasonably_similar): Likewise.
3299 (comp_ptr_ttypes_const): Likewise.
3300 (casts_away_constness): Likewise.
3301 (check_literal_operator_args): Likewise.
3302 * typeck2.c (build_x_arrow): Likewise.
3303 (add_exception_specifier): Likewise.
3305 2013-03-29 Jason Merrill <jason@redhat.com>
3308 * cp-tree.h (AUTO_IS_DECLTYPE): New.
3309 * parser.c (cp_parser_decltype): Handle decltype(auto).
3310 (cp_parser_type_id_1): Allow auto without a late-specified
3312 (cp_parser_primary_expression): Use the return value of
3313 finish_parenthesized_expr.
3314 (cp_parser_transaction_expression): Likewise.
3315 * semantics.c (force_paren_expr): New.
3316 (finish_parenthesized_expr): Use it.
3317 * call.c (build_conditional_expr_1): Likewise.
3318 * pt.c (do_auto_deduction): Handle decltype(auto).
3319 (tsubst_copy): Handle PAREN_EXPR.
3320 (tsubst_copy_and_build): Likewise.
3321 * error.c (dump_expr): Handle PAREN_EXPR.
3322 * cxx-pretty-print.c (pp_cxx_expression): Likewise.
3323 * mangle.c (write_expression): Ignore PAREN_EXPR.
3325 * parser.c (cp_parser_decltype_expr): Split out...
3326 (cp_parser_decltype): ...from here.
3330 * pt.c (unify_pack_expansion): Fix indexing.
3332 2013-03-29 Gabriel Dos Reis <gdr@integrable-solutions.net>
3334 * call.c (build_java_interface_fn_ref): Likewise.
3335 (make_temporary_var_for_ref_to_temp): Likewise.
3336 * class.c (check_field_decls): Likewise.
3337 (layout_class_type): Likewise.
3338 (finish_struct_1): Likewise.
3339 (fixed_type_or_null): Likewise.
3340 (get_vtbl_decl_for_binfo): Likewise.
3341 * cp-gimplify.c (omp_var_to_track): Likewise.
3342 (cp_genericize_r): Likewise.
3343 * cp-objcp-common.c (cxx_warn_unused_global_decl): Likewise.
3344 * cp-tree.h (LANG_DECL_HAS_MIN): Likewise.
3345 (DECL_DISCRIMINATOR_P): Likewise.
3346 * decl.c (poplevel): Likewise.
3347 (decls_match): Likewise.
3348 (duplicate_decls): Likewise.
3349 (decl_jump_unsafe): Likewise.
3350 (start_decl): Likewise.
3351 (check_for_uninitialized_const_var): Likewise.
3352 (make_rtl_for_nonlocal_decl): Likewise.
3353 (cp_finish_decl): Likewise.
3354 (expand_static_init): Likewise.
3355 (local_variable_p): Likewise.
3356 (maybe_register_incomplete_var): Likewise.
3357 * decl2.c (grokfield): Likewise.
3358 (comdat_linkage): Likewise.
3359 (determine_visibility): Likewise.
3360 (import_export_decl): Likewise.
3361 (prune_vars_needing_no_initialization): Likewise.
3362 (decl_maybe_constant_var_p): Likewise.
3363 * error.c (dump_simple_decl): Likewise.
3364 (dump_template_decl): Likewise.
3365 (cp_printer): Likewise.
3366 * except.c (build_throw): Likewise.
3367 * init.c (build_vtbl_address): Likewise.
3368 (member_init_ok_or_else): Likewise.
3369 (build_aggr_init): Likewise.
3370 (expand_aggr_init_1): Likewise.
3371 (build_offset_ref): Likewise.
3372 (constant_value_1): Likewise.
3373 * mangle.c (write_mangled_name): Likewise.
3374 (write_prefix): Likewise.
3375 * name-lookup.c (supplement_binding_1): Likewise.
3376 (add_decl_to_level): Likewise.
3377 (pushdecl_maybe_friend_1): Likewise.
3378 (check_for_out_of_scope_variable): Likewise.
3379 (validate_nonmember_using_decl): Likewise.
3380 (lookup_name_innermost_nonclass_level_1): Likewise.
3381 (lookup_arg_dependent_1): Likewise.
3382 * parser.c (cp_parser_lambda_introducer): Likewise.
3383 (cp_parser_template_argument): Likewise.
3384 (cp_parser_single_declaration): Likewise.
3385 * pt.c (convert_nontype_argument): Likewise.
3386 (instantiate_class_template_1): Likewise.
3387 (tsubst_decl): Likewise.
3388 (tsubst_expr): Likewise.
3389 (do_decl_instantiation): Likewise.
3390 (do_type_instantiation): Likewise.
3391 (regenerate_decl_from_template): Likewise.
3392 (always_instantiate_p): Likewise.
3393 (instantiate_decl): Likewise.
3394 (type_dependent_expression_p): Likewise.
3395 (build_non_dependent_expr): Likewise.
3396 * repo.c (repo_emit_p): Likewise.
3397 * rtti.c (build_dynamic_cast_1): Likewise.
3398 * search.c (shared_member_p): Likewise.
3399 * semantics.c (outer_var_p): Likewise.
3400 (finish_id_expression): Likewise.
3401 (finish_omp_clauses): Likewise.
3402 (finish_decltype_type): Likewise.
3403 (ensure_literal_type_for_constexpr_object): Likewise.
3404 * tree.c (lvalue_kind): Likewise.
3405 (bot_replace): Likewise.
3406 (cp_tree_equal): Likewise.
3407 (handle_init_priority_attribute): Likewise.
3408 (decl_storage_duration): Likewise.
3409 * typeck.c (cxx_sizeof_expr): Likewise.
3410 (cxx_alignof_expr): Likewise.
3411 (decay_conversion): Likewise.
3412 (build_class_member_access_expr): Likewise.
3413 (cp_build_array_ref): Likewise.
3414 (cxx_mark_addressable): Likewise.
3415 (maybe_warn_about_returning_address_of_local): Likewise.
3416 (check_return_expr): Likewise.
3417 * typeck2.c (cxx_readonly_error): Likewise.
3418 (abstract_virtuals_error_sfinae): Likewise.
3419 (cxx_incomplete_type_diagnostic): Likewise.
3421 2013-03-28 Lawrence Crowl <crowl@google.com>
3424 (CXX_PARSER_H): Add header dependence.
3426 (extern debug (cp_binding_level &)): New.
3427 (extern debug (cp_binding_level *)): New.
3429 (debug (cp_binding_level &)): New.
3430 (debug (cp_binding_level *)): New.
3432 (debug (cp_parser &)): New.
3433 (debug (cp_parser *)): New.
3434 (debug (cp_token &)): New.
3435 (debug (cp_token *)): New.
3436 (debug (vec<cp_token, va_gc> &)): New.
3437 (debug (vec<cp_token, va_gc> *)): New.
3438 * parser.c: Add header dependence.
3439 (extern debug (cp_parser &)): New.
3440 (extern debug (cp_parser *)): New.
3441 (extern debug (cp_token &)): New.
3442 (extern debug (cp_token *)): New.
3443 (extern debug (vec<cp_token, va_gc> &)): New.
3444 (extern debug (vec<cp_token, va_gc> *)): New.
3446 2013-03-28 Jason Merrill <jason@redhat.com>
3450 * typeck2.c (abstract_virtuals_error_sfinae): Don't complete
3451 the type if tf_decltype is set.
3452 * pt.c (fn_type_unification): Add decltype_p parm.
3453 (get_bindings): Adjust.
3454 * cp-tree.h: Adjust.
3455 * class.c (resolve_address_of_overloaded_function): Adjust.
3456 * call.c (add_template_candidate_real, print_z_candidate): Adjust.
3459 * parser.c (cp_parser_sizeof_pack): Split out from...
3460 (cp_parser_sizeof_operand): ...here. Require (id).
3463 * semantics.c (finish_this_expr): 'this' is an rvalue.
3464 * typeck.c (cp_build_indirect_ref): Handle NOP_EXPR of 'this'.
3467 * semantics.c (finish_member_declaration): Don't push closure
3470 * name-lookup.c (pushdecl_maybe_friend_1): Use
3471 nonlambda_method_basetype and current_nonlambda_class_type.
3474 * semantics.c (potential_constant_expression_1) [NOP_EXPR]: Reject
3475 conversion from integer to pointer.
3476 (cxx_eval_constant_expression): Likewise.
3477 (cxx_eval_indirect_ref): Use the folded operand if we still think
3478 this might be constant.
3480 2013-03-28 Paolo Carlini <paolo.carlini@oracle.com>
3481 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
3484 * call.c (convert_like_real): Change series of two permerrors
3485 to permerror + inform (and likewise for two errors).
3486 (build_new_method_call_1): Likewise.
3487 * typeck.c (convert_for_initialization): Change additional
3488 warning or error to inform.
3490 2013-03-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
3492 * cp-tree.h (next_aggr_init_expr_arg): Remove static specifier.
3493 (first_aggr_init_expr): Likewise.
3494 (more_aggr_init_expr_args_p): Likewise.
3495 (type_of_this_parm): Likewise.
3496 (class_of_this_parm): Likewise.
3497 * name-lookup.h (get_global_value_if_present): Likewise.
3498 (is_typename_at_global_scope): Likewise.
3500 2013-03-28 Paolo Carlini <paolo.carlini@oracle.com>
3502 * call.c (joust): Don't call inform for a permerror returning false.
3503 * parser.c (cp_parser_check_class_key): Likewise.
3504 * pt.c (tsubst_copy_and_build): Likewise.
3506 2013-03-27 Jason Merrill <jason@redhat.com>
3509 * semantics.c (finish_qualified_id_expr): Return early
3512 2013-03-26 Gabriel Dos Reis <gdr@integrable-solutions.net>
3514 * call.c (build_new_method_call_1): Use INDIRECT_REF_P.
3515 * cvt.c (convert_to_void): Likewise.
3516 * error.c (dump_expr): Likewise.
3517 * mangle.c (write_expression): Likewise.
3518 * parser.c (cp_parser_template_argument): Likewise.
3519 * pt.c (convert_nontype_argument): Likewise.
3520 (tsubst_copy_and_build): Likewise.
3521 * rtti.c (build_typeid): Likewise.
3522 * semantics.c (finish_call_expr): Likewise.
3523 (finish_decltype_type): Likewise.
3524 (build_data_member_initialization): Likewise.
3525 * tree.c (is_dummy_object): Likewise.
3526 * typeck.c (decay_conversion): Likewise.
3527 (build_class_member_access_expr): Likewise.
3528 (cp_build_addr_expr_1): Likewise.
3529 (unary_complex_lvalue): Likewise.
3530 (check_return_expr): Likewise.
3531 * typeck2.c (cxx_readonly_error): Likewise.
3533 2013-03-26 Jason Merrill <jason@redhat.com>
3536 * typeck.c (invalid_nonstatic_memfn_p): Use get_first_fn. Take tree.
3537 * semantics.c (finish_decltype_type): Check it before type_unknown_p.
3538 * cp-tree.h: Adjust prototype.
3541 * typeck2.c (build_m_component_ref): Handle prvalue object.
3543 2013-03-26 Gabriel Dos Reis <gdr@integrable-solutions.net>
3545 * cp-gimplify.c (cp_genericize_r): Use VAR_OR_FUNCTION_DECL_P.
3546 * decl.c (duplicate_decls): Likewise.
3547 (cp_finish_decl): Likewise.
3548 (check_class_member_definition_namespace): Likewise.
3549 * decl2.c (grokfield): Likewise.
3550 (decl_needed_p): Likewise.
3551 (import_export_decl): Likewise.
3552 (mark_used): Likewise.
3553 * name-lookup.c (pushdecl_maybe_friend_1): Likewise.
3554 * pt.c (push_access_scope): Likewise.
3555 (instantiate_decl): Likewise.
3556 * ptree.c (cxx_print_decl): Likewise.
3557 * repo.c (repo_emit_p): Likewise.
3558 * semantics.c (note_decl_for_pch): Likewise.
3559 * tree.c (decl_linkage): Likewise.
3561 2013-03-26 Paolo Carlini <paolo.carlini@oracle.com>
3564 * decl.c (check_array_designated_initializer): Handle CONST_DECL
3567 2013-03-26 Paolo Carlini <paolo.carlini@oracle.com>
3569 * decl.c (grokfndecl): Handle separately <inline> and <constexpr>
3572 * decl.c (grokdeclarator): Declare typedef_p and use it everywhere.
3574 2013-03-25 Jason Merrill <jason@redhat.com>
3577 * semantics.c (maybe_resolve_dummy): Make sure that the enclosing
3578 class is derived from the type of the object.
3581 * semantics.c (lambda_expr_this_capture): Don't capture 'this' in
3582 unevaluated context.
3584 2013-03-25 Paolo Carlini <paolo.carlini@oracle.com>
3587 * decl.c (cp_finish_decl): Check DECL_LANG_SPECIFIC before
3588 DECL_TEMPLATE_INSTANTIATION.
3590 2013-03-22 Jason Merrill <jason@redhat.com>
3593 * pt.c (instantiation_dependent_r): Check DECL_INITIAL of VAR_DECL
3596 2013-03-21 Gabriel Dos Reis <gdr@integrable-solutions.net>
3598 * cp-tree.h (identifier_p): New.
3599 * call.c: Throughout, call identifier_p insstead of direct
3600 comparaison of TREE_CODE against IDENTIFIER_NODE.
3601 * decl.c: Likewisse.
3602 * decl2.c: Likewise.
3604 * mangle.c: Likewise.
3605 * name-lookup.c: Likewise.
3606 * parser.c: Likewise.
3608 * search.c: Likewise.
3609 * semantics.c: Likewise.
3611 * typeck.c: Likewise.
3612 * typeck2.c: Likewise.
3614 2013-03-21 Jakub Jelinek <jakub@redhat.com>
3617 * pt.c (convert_nontype_argument): Count werrorcount as warnings.
3618 * call.c (build_temp): Likewise.
3619 * method.c (synthesize_method): Likewise.
3620 * typeck.c (convert_for_initialization): Likewise.
3622 2013-03-21 Marc Glisse <marc.glisse@inria.fr>
3624 * call.c (build_conditional_expr_1): Fold VEC_COND_EXPR.
3626 2013-03-21 Richard Biener <rguenther@suse.de>
3628 * error.c (cp_printer): Use DECL_HAS_DEBUG_EXPR_P instead of
3629 DECL_DEBUG_EXPR_IS_FROM. Guard properly.
3631 2013-03-20 Jason Merrill <jason@redhat.com>
3634 * parser.c (cp_parser_late_return_type_opt): Save and restore
3635 current_class_ptr/ref.
3638 * expr.c (cplus_expand_constant): Do nothing if the class is
3640 * semantics.c (reduced_constant_expression_p): Allow PTRMEM_CST.
3641 * typeck2.c (store_init_value): Use reduced_constant_expression_p.
3642 * decl.c (maybe_register_incomplete_var): Handle PTRMEM_CST.
3643 (complete_vars): Likewise.
3645 * name-lookup.c (get_anonymous_namespace_name): Never use
3646 get_file_function_name.
3648 * pt.c (retrieve_specialization): Handle null tmpl argument.
3652 * pt.c (tsubst_decl): Check return value of register_specialization.
3653 * typeck2.c (abstract_virtuals_error_sfinae): Re-apply complete_type
3656 2013-03-17 Jason Merrill <jason@redhat.com>
3660 * parser.c (cp_parser_direct_declarator): Bail if we see a
3661 qualified-id not at namespace scope.
3665 * typeck2.c (abstract_virtuals_error_sfinae): Revert complete_type
3668 2013-03-16 Jason Merrill <jason@redhat.com>
3670 * decl.c (grokdeclarator): Assert that we won't see a pointer to
3674 * cp-tree.h (WILDCARD_TYPE_P): Split out from...
3675 (MAYBE_CLASS_TYPE_P): ...here.
3676 * semantics.c (lambda_capture_field_type): Only build a
3677 magic decltype for wildcard types.
3678 (lambda_proxy_type): Likewise.
3679 (finish_non_static_data_member): Get the quals from
3683 * parser.c (cp_parser_template_argument): Don't
3684 fold_non_dependent_expr.
3686 * parser.c (cp_parser_lambda_declarator_opt): Use
3687 cp_parser_trailing_type_id.
3690 * parser.c (cp_parser_template_id): Don't forget access checks.
3693 * pt.c (tsubst_qualified_id): Use current_nonlambda_class_type.
3697 * name-lookup.h (tag_scope): Add ts_lambda.
3698 * semantics.c (begin_lambda_type): Use it.
3699 * decl.c (xref_tag_1): Set CLASSTYPE_LAMBDA_EXPR.
3700 * pt.c (check_default_tmpl_args): Ignore lambdas.
3701 (push_template_decl_real): Handle lambdas.
3702 * tree.c (no_linkage_check): Adjust lambda check.
3705 * tree.c (strip_typedefs_expr): Complain about lambda, don't abort.
3708 * parser.c (cp_parser_direct_declarator): Fix late return
3709 for out-of-class defn of member function.
3712 * semantics.c (maybe_add_lambda_conv_op): Clear DECL_NAME of copied
3713 parms to avoid duplicate -Wshadow warnings.
3715 * search.c (lookup_base): Handle NULL_TREE.
3718 * semantics.c (potential_constant_expression_1): Use of 'this' in
3719 a non-constexpr function makes the expression not potentially
3724 * cp-tree.h (tsubst_flags): Add tf_decltype.
3725 * call.c (build_cxx_call): Don't build a temporary if it's set.
3726 (build_over_call): Make sure it's only passed to build_cxx_call.
3727 * parser.c (cp_parser_primary_expression): Add decltype_p parm.
3728 (cp_parser_unary_expression): Likewise.
3729 (cp_parser_cast_expression): Likewise.
3730 (cp_parser_binary_expression): Likewise.
3731 (cp_parser_assignment_expression): Likewise.
3732 (cp_parser_postfix_expression): Likewise. Pass tf_decltype.
3733 (cp_parser_expression): Add decltype_p. Force a
3734 temporary for a call on the LHS of a comma.
3735 (cp_parser_decltype): Pass true to decltype_p parms.
3736 * pt.c (tsubst) [DECLTYPE_TYPE]: Pass tf_decltype.
3737 (tsubst_copy_and_build): Pass tf_decltype down only for
3738 CALL_EXPR and the RHS of COMPOUND_EXPR.
3739 * tree.c (build_cplus_new): Call complete_type_or_maybe_complain.
3741 * cp-tree.h (abstract_class_use): New enum.
3742 * typeck2.c (pending_abstract_type): Add use field.
3743 (abstract_virtuals_error_sfinae): Add overloads taking
3744 abstract_class_use instead of tree.
3745 * typeck.c (build_static_cast_1): Call it.
3746 * except.c (is_admissible_throw_operand_or_catch_parameter): Call it.
3747 * pt.c: Adjust calls.
3748 * decl.c (cp_finish_decl): Don't handle functions specially.
3749 (grokdeclarator): Always check return type.
3750 * init.c (build_new_1): Adjust call.
3754 * pt.c (tsubst) [ARRAY_TYPE]: Use abstract_virtuals_error_sfinae.
3755 * typeck2.c (abstract_virtuals_error_sfinae): Call complete_type.
3758 * pt.c (tsubst_function_type): Call abstract_virtuals_error_sfinae.
3759 (tsubst_arg_types): Likewise.
3763 * call.c (convert_like_real): Check for explicit constructors
3764 even for value-initialization.
3767 * pt.c (convert_nontype_argument): Handle invalid pointer.
3769 * parser.c (cp_parser_lambda_expression): Use nreverse.
3773 * pt.c (instantiate_class_template_1): Instantiate lambda capture
3775 (tsubst_copy_and_build): Not here.
3778 * method.c (walk_field_subobs): Disallow copy of rvalue ref.
3781 * parser.c (parsing_nsdmi): New.
3782 * semantics.c (outer_automatic_var_p): Check it.
3783 (finish_id_expression): Likewise.
3784 * cp-tree.h: Declare it.
3787 * error.c (dump_expr) [SIZEOF_EXPR]: Print sizeof... properly.
3789 * parser.c (lookup_literal_operator): Correct parm/arg naming
3793 * pt.c (fold_non_dependent_expr_sfinae): Check
3794 instantiation_dependent_expression_p.
3797 * class.c (resolve_address_of_overloaded_function): Accept a
3798 reference to function for target_type.
3799 (instantiate_type): Likewise.
3800 * pt.c (convert_nontype_argument): Pass it to
3801 convert_nontype_argument_function.
3803 2013-03-16 Jakub Jelinek <jakub@redhat.com>
3805 * tree.c (cp_tree_equal): Fix a pasto.
3808 * typeck.c (cp_build_binary_op): When calling warn_for_div_by_zero,
3809 pass op1 through maybe_constant_value first.
3811 2013-03-16 Paolo Carlini <paolo.carlini@oracle.com>
3814 * semantics.c (cxx_eval_array_reference): Check for negative index.
3816 2013-03-14 Jason Merrill <jason@redhat.com>
3819 * decl.c (local_variable_p_walkfn): Check DECL_ARTIFICIAL again.
3822 * decl.c (register_dtor_fn): Pass null to __cxa_thread_atexit
3823 dso_handle parm on targets without __cxa_atexit.
3825 2013-03-11 Jason Merrill <jason@redhat.com>
3828 * typeck.c (check_return_expr): Disallow returning init list here.
3829 * semantics.c (apply_deduced_return_type): Not here.
3831 2013-03-08 Paolo Carlini <paolo.carlini@oracle.com>
3834 * cxx-pretty-print.c (pp_cxx_expression): Handle LAMBDA_EXPR.
3835 * error.c (dump_expr): Likewise.
3837 2013-03-08 Jason Merrill <jason@redhat.com>
3840 * class.c (modify_all_vtables): Mangle the vtable name before
3843 * semantics.c (lambda_expr_this_capture): In unevaluated context,
3844 just return the nearest 'this'.
3849 * tree.c (maybe_dummy_object): Don't capture 'this'.
3850 * semantics.c (maybe_resolve_dummy): New.
3851 (finish_non_static_data_member): Use it.
3852 (finish_qualified_id_expr): Don't test is_dummy_object.
3853 * cp-tree.h: Declare maybe_resolve_dummy.
3854 * call.c (build_new_method_call_1): Use it.
3857 * semantics.c (apply_deduced_return_type): Don't allow returning
3858 std::initializer_list.
3860 2013-03-06 Paolo Carlini <paolo.carlini@oracle.com>
3863 * parser.c (cp_parser_elaborated_type_specifier): Don't call
3864 check_elaborated_type_specifier when TREE_CODE (decl) != TYPE_DECL.
3865 * decl.c (check_elaborated_type_specifier): Tidy.
3867 2013-03-06 Jakub Jelinek <jakub@redhat.com>
3870 * tree.c (strip_typedefs): Don't copy args if they are NULL.
3872 2013-03-05 Jakub Jelinek <jakub@redhat.com>
3874 * parser.c (cp_parser_braced_list): For {} initialize
3875 *non_constant_p to false.
3877 2013-03-04 Jason Merrill <jason@redhat.com>
3881 * semantics.c (lambda_expr_this_capture): Handle NSDMI
3882 and non-class scopes.
3884 2013-03-01 Paolo Carlini <paolo.carlini@oracle.com>
3886 * decl.c (grokdeclarator): Remove dead code.
3888 2013-02-28 Jason Merrill <jason@redhat.com>
3891 * semantics.c (potential_constant_expression_1): Use
3892 cxx_eval_outermost_constant_expr rather than maybe_constant_value.
3895 * call.c (build_over_call): Avoid virtual lookup in a template.
3897 2013-02-27 Jason Merrill <jason@redhat.com>
3901 * name-lookup.c (do_class_using_decl): Use ctor_identifier instead
3902 of the base name for inheriting ctors.
3903 (push_class_level_binding_1): Remove inheriting ctor handling.
3904 * pt.c (tsubst_decl) [USING_DECL]: Likewise.
3905 * class.c (add_implicitly_declared_members): Adjust.
3907 2013-02-26 David Binderman <dcb314@hotmail.com>
3910 * decl.c (grokdeclarator): Tidy publicp assignment.
3912 2013-02-25 Aldy Hernandez <aldyh@redhat.com>
3915 * semantics.c (begin_transaction_stmt): Set TREE_SIDE_EFFECTS.
3916 (build_transaction_expr): Same.
3918 2013-02-25 Jason Merrill <jason@redhat.com>
3921 * pt.c (fn_type_unification): Wait to call push_tinst_level until
3922 we know what args we're looking at.
3925 * semantics.c (potential_constant_expression_1): In C++98, a cast
3926 to non-integral type can't be a constant expression.
3928 2013-02-24 Jakub Jelinek <jakub@redhat.com>
3931 * init.c (build_zero_init_1): Use RECORD_OR_UNION_CODE_P instead
3934 2013-02-22 Jason Merrill <jason@redhat.com>
3937 * pt.c (push_template_decl_real): Set DECL_INTERFACE_KNOWN
3938 if we got the wrong number of template parms.
3941 * pt.c (fn_type_unification): Use explicit args in template
3942 instantiation context.
3945 * call.c (can_convert_arg): Discard access checks.
3948 * tree.c (strip_typedefs): Strip typedefs from TYPENAME_TYPE template
3951 2013-02-20 Paolo Carlini <paolo.carlini@oracle.com>
3954 * tree.c (maybe_warn_zero_as_null_pointer_constant): Add.
3955 * cvt.c (ocp_convert): Use the latter.
3956 (cp_convert_to_pointer): Likewise.
3957 * decl.c (check_default_argument): Likewise.
3958 * typeck.c (cp_build_binary_op): Likewise.
3959 * cp-tree.h (maybe_warn_zero_as_null_pointer_constant): Declare.
3961 2013-02-15 Jonathan Wakely <jwakely.gcc@gmail.com>
3962 Paolo Carlini <paolo.carlini@oracle.com>
3965 * decl2.c (grokbitfield): Allow scoped enumeration types.
3967 2013-02-15 Jason Merrill <jason@redhat.com>
3970 * semantics.c (finish_id_expression): Also return the identifier
3971 for an outer local static.
3974 * class.c (check_bases_and_members): Deduce noexcept after
3978 * semantics.c (finish_id_expression): In a template, return
3979 the identifier for a constant variable.
3981 2013-02-14 Jason Merrill <jason@redhat.com>
3984 * semantics.c (build_anon_member_initialization): New.
3985 (build_data_member_initialization): Use it.
3988 * decl.c (cp_finish_decl): Force instantiation of an
3989 auto static data member.
3992 * pt.c (unify): A pack expansion that is not the last template
3993 argument makes the entire template argument list non-deduced.
3996 * name-lookup.c (do_class_using_decl): Handle typedefs with
3997 inheriting constructors.
3998 (push_class_level_binding_1): Allow inheriting from template
3999 template parameter, too.
4000 * pt.c (tsubst_decl) [USING_DECL]: Likewise.
4003 * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Fix handling of
4004 default argument scope.
4005 * mangle.c (write_name): Likewise.
4008 * error.c (find_typenames_r): Don't walk into a pack expansion.
4010 2013-02-13 Jason Merrill <jason@redhat.com>
4013 * parser.c (cp_parser_member_declaration): Check the declarator
4014 form when detecting a function declaration via typedef.
4017 * pt.c (maybe_process_partial_specialization): A lambda
4018 isn't what's being specialized.
4021 * semantics.c (maybe_add_lambda_conv_op): Mark static thunk
4025 * semantics.c (cxx_bind_parameters_in_call): Undo DECL_BY_REFERENCE.
4028 * semantics.c (cxx_fold_indirect_ref): Handle empty bases at
4029 non-zero offsets, too.
4032 * decl.c (build_enumerator): Always convert the value to a
4033 fixed underlying type.
4036 * pt.c (tsubst_copy_and_build): Don't forget any new
4037 captures that arose from use of dependent names.
4039 2013-02-13 Jakub Jelinek <jakub@redhat.com>
4042 * semantics.c (finish_asm_stmt): If input constraints allow
4043 neither register nor memory, try maybe_constant_value to get
4044 a constant if possible.
4046 2013-02-12 Jason Merrill <jason@redhat.com>
4049 * method.c (add_one_base_init): Handle base constructor
4050 taking rvalue reference parm.
4053 * semantics.c (sort_constexpr_mem_initializers): Handle
4056 2013-02-09 Jason Merrill <jason@redhat.com>
4059 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Call
4060 maybe_instantiate_noexcept.
4063 * pt.c (eq_specializations): Set comparing_specializations.
4064 * tree.c (cp_tree_equal): Check it.
4065 * cp-tree.h: Declare it.
4067 * decl.c (decls_match): Check versions later.
4070 * pt.c (build_non_dependent_expr): Don't try to fold
4071 instantiation-dependent expressions.
4072 (instantiation_dependent_r) [TRAIT_EXPR]: Split out.
4073 [BIND_EXPR]: Treat as dependent.
4075 2013-02-07 Jakub Jelinek <jakub@redhat.com>
4078 * init.c (build_vec_init): Don't append NULL values into new_vec.
4079 (build_zero_init_1): Don't push anything into v if recursive call
4081 (build_value_init_noctor): Don't push anything into v if
4082 build_value_init call returned NULL_TREE.
4085 * parser.c (cp_parser_token_starts_cast_expression): Renamed to...
4086 (cp_parser_tokens_start_cast_expression): ... this. Change parameter
4087 to cp_parser *, call cp_lexer_peek_token first. For CPP_OPEN_PAREN,
4088 return true only if 2nd token isn't CPP_CLOSE_PAREN.
4089 (cp_parser_cast_expression): Adjust caller.
4092 * decl.c (push_local_name): Look at DECL_DISCRIMINATOR (t)
4093 only if DECL_DISCRIMINATOR_SET_P (t) rather than just
4094 DECL_LANG_SPECIFIC (t).
4096 2013-02-07 Jason Merrill <jason@redhat.com>
4099 * method.c (do_build_copy_constructor): Don't bother turning
4100 scalars from lvalues to xvalues.
4101 (do_build_copy_assign): Likewise.
4103 2013-02-06 Jason Merrill <jason@redhat.com>
4105 * parser.c (cp_parser_enum_specifier): Check for error_mark_node.
4107 2013-02-05 Jason Merrill <jason@redhat.com>
4110 * tree.c (lvalue_kind) [INDIRECT_REF]: Don't check for
4114 * decl.c (start_preparsed_function): Update restype if we change
4118 * pt.c (fn_type_unification): Discard any access checks from
4119 substituting explicit args.
4121 2013-01-31 Jason Merrill <jason@redhat.com>
4125 * typeck.c (get_member_function_from_ptrfunc): Fix
4126 ptrmemfunc_vbit_in_delta case.
4128 2013-01-29 Jason Merrill <jason@redhat.com>
4131 * class.c (build_ctor_vtbl_group): Give construction vtables
4134 2013-01-25 Jason Merrill <jason@redhat.com>
4137 * pt.c (convert_nontype_argument_function): Handle invalid input.
4138 (convert_nontype_argument): Likewise.
4141 * typeck.c (get_member_function_from_ptrfunc): Optimize if the
4142 dynamic type has no virtual functions.
4144 2013-01-22 Paolo Carlini <paolo.carlini@oracle.com>
4147 * decl.c (check_initializer): Use TARGET_EXPR_DIRECT_INIT_P only
4148 on TARGET_EXPR nodes.
4150 2013-01-22 Jason Merrill <jason@redhat.com>
4153 * pt.c (maybe_instantiate_noexcept): Don't defer access checks.
4155 2013-01-22 Dodji Seketeli <dodji@redhat.com>
4158 * pt.c (argument_pack_element_is_expansion_p)
4159 (make_argument_pack_select, use_pack_expansion_extra_args_p)
4160 (gen_elem_of_pack_expansion_instantiation): New static functions.
4161 (tsubst): When looking through an ARGUMENT_PACK_SELECT tree node,
4162 look through the possibly resulting pack expansion as well.
4163 (tsubst_pack_expansion): Use use_pack_expansion_extra_p to
4164 generalize when to use the PACK_EXPANSION_EXTRA_ARGS mechanism.
4165 Use gen_elem_of_pack_expansion_instantiation to build the
4166 instantiation piece-wise. Don't use arg_from_parm_pack_p anymore,
4167 as gen_elem_of_pack_expansion_instantiation and the change in
4168 tsubst above generalize this particular case.
4169 (arg_from_parm_pack_p): Remove this for it's not used by
4170 tsubst_pack_expansion anymore.
4172 2013-01-21 Jason Merrill <jason@redhat.com>
4175 * tree.c (strip_typedefs_expr) [TREE_VEC]: Preserve non-default
4176 template args count.
4178 2013-01-18 Jason Merrill <jason@redhat.com>
4181 * decl2.c (get_local_tls_init_fn): New.
4182 (get_tls_init_fn): Handle flag_extern_tls_init. Don't bother
4183 with aliases for internal variables. Don't use weakrefs if
4184 the variable needs destruction.
4185 (generate_tls_wrapper): Mark the wrapper as const if no
4186 initialization is needed.
4187 (handle_tls_init): Don't require aliases.
4189 2013-01-15 Dodji Seketeli <dodji@redhat.com>
4192 * pt.c (coerce_innermost_template_parms): New static function.
4193 (instantiate_alias_template): Use it here.
4195 2013-01-09 Jason Merrill <jason@redhat.com>
4198 * rtti.c (build_typeid, get_typeid): Add complain parm.
4199 (get_tinfo_decl_dynamic): Likewise.
4200 * cp-tree.h, parser.c, pt.c: Adjust.
4203 * decl.c (cp_finish_decl): Clear TREE_READONLY if the variable
4206 2013-01-09 Jakub Jelinek <jakub@redhat.com>
4209 * typeck.c (cp_build_binary_op): For LSHIFT_EXPR and RSHIFT_EXPR,
4210 call maybe_constant_value for the negative or too big shift
4213 2013-01-09 Paolo Carlini <paolo.carlini@oracle.com>
4216 * decl2.c (var_needs_tls_wrapper): Return false when error_operand_p
4217 of the argument is true.
4219 2013-01-08 Joel Brobecker <brobecker@adacore.com>
4221 * parser.c (cp_parser_initializer_list): Move declaration
4222 of variable non_const to start of lexical block.
4224 2013-01-07 Jason Merrill <jason@redhat.com>
4227 * tree.c (build_aggr_init_expr): Do nothing in a template.
4228 * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Strip an ADDR_EXPR off
4229 a FUNCTION_DECL before tsubsting.
4231 2013-01-04 Dodji Seketeli <dodji@redhat.com>
4234 * pt.c (check_instantiated_arg): Allow type template arguments.
4236 2013-01-04 Jason Merrill <jason@redhat.com>
4239 * decl.c (reset_type_linkage, bt_reset_linkage): New.
4240 (grokdeclarator): Use reset_type_linkage.
4241 * name-lookup.c (binding_table_foreach): Handle null table.
4242 * tree.c (decl_anon_ns_mem_p): Check TYPE_MAIN_DECL, not TYPE_NAME.
4244 2013-01-04 Paolo Carlini <paolo.carlini@oracle.com>
4246 PR c++/54526 (again)
4247 * parser.c (cp_parser_template_id): Revert core of previous change
4248 (keep adjusted inform message).
4250 2013-01-03 Jason Merrill <jason@redhat.com>
4254 * pt.c (tsubst_copy_and_build) [TARGET_EXPR]: Don't touch
4258 * semantics.c (trait_expr_value): Call maybe_instantiate_noexcept.
4261 * semantics.c (build_data_member_initialization): Handle DECL_EXPR.
4264 * call.c (type_has_extended_temps): New.
4265 * cp-tree.h: Declare it.
4266 * decl.c (check_initializer): Use build_aggr_init for arrays
4268 * init.c (build_vec_init): Avoid mixed signed/unsigned arithmetic.
4270 2013-01-02 Jason Merrill <jason@redhat.com>
4273 * call.c (build_new_method_call_1): Don't use build_value_init for
4274 user-provided default constructors.
4276 * decl.c (check_default_argument): Use LOOKUP_IMPLICIT.
4280 * tree.c (build_cplus_array_type): Copy layout information
4281 to main variant if necessary.
4283 Copyright (C) 2013 Free Software Foundation, Inc.
4285 Copying and distribution of this file, with or without modification,
4286 are permitted in any medium without royalty provided the copyright
4287 notice and this notice are preserved.