1 2013-11-25 Paolo Carlini <paolo.carlini@oracle.com>
4 * decl.c (duplicate_decls): Enforce 8.3.6/6 about default arguments
5 for member functions of class templates.
7 2013-11-25 Paolo Carlini <paolo.carlini@oracle.com>
10 * semantics.c (check_constexpr_ctor_body): Check for BIND_EXPR_VARS.
12 2013-11-25 Paolo Carlini <paolo.carlini@oracle.com>
15 * decl.c (grokdeclarator): Don't handle qualified free functions here,
16 leave the diagnostic to grokfndecl.
18 2013-11-25 Paolo Carlini <paolo.carlini@oracle.com>
21 * pt.c (unify): Don't call unify_array_domain with a NULL_TREE
25 * pt.c (apply_late_template_attributes): Check that TREE_VALUE
26 isn't NULL_TREE in the attribute_takes_identifier_p case.
28 2013-11-25 Adam Butcher <adam@jessamine.co.uk>
32 * parser.c (cp_parser_parameter_declaration_clause): Disallow implicit
33 function templates in local functions unless defining a lambda.
35 2013-11-23 Easwaran Raman <eraman@google.com>
38 * call.c (build_new_method_call_1): Comnpare function context
39 with BASELINK_BINFO type rather than instance type before
40 marking the call with LOOKUP_NONVIRTUAL.
42 2013-11-23 Jason Merrill <jason@redhat.com>
45 * init.c (build_aggr_init): Don't clobber the type of init
46 if we got an INIT_EXPR back from build_vec_init.
47 (build_vec_init): Do digest_init on trivial initialization.
49 2013-11-23 Alexander Ivchenko <alexander.ivchenko@intel.com>
52 * call.c (build_operator_new_call): Add flag_exceptions check.
53 * decl.c (compute_array_index_type): Ditto.
54 * init.c (build_new_1): Ditto.
55 (build_vec_init): Ditto.
57 2013-11-22 Jakub Jelinek <jakub@redhat.com>
59 * cp-gimplify.c: Include target.h and c-family/c-ubsan.h.
60 (cp_ubsan_maybe_instrument_return): New function.
61 (cp_genericize): Call it if -fsanitize=return.
63 * decl2.c: Include asan.h.
64 (one_static_initialization_or_destruction): If -fsanitize=address,
65 init is non-NULL and guard is NULL, set
66 vnode->dynamically_initialized.
67 (do_static_initialization_or_destruction): Call
68 __asan_{before,after}_dynamic_init around the static initialization.
70 2013-11-22 Andrew MacLeod <amacleod@redhat.com>
72 * class.c: Add required include files from gimple.h.
73 * cp-gimplify.c: Likewise
76 * optimize.c: Likewise
78 * semantics.c: Likewise
81 * vtable-class-hierarchy.c: Likewise
83 2013-11-22 David Malcolm <dmalcolm@redhat.com>
85 * call.c (build_integral_nontype_arg_conv): Remove use of
86 EXPR_LOC_OR_HERE macro.
87 (convert_like_real): Likewise.
88 (convert_arg_to_ellipsis): Likewise.
89 (build_cxx_call): Likewise.
90 (perform_implicit_conversion_flags): Likewise.
91 (initialize_reference): Likewise.
92 * cvt.c (cp_convert_to_pointer): Likewise.
93 (convert_to_reference): Likewise.
94 (ocp_convert): Likewise.
95 (convert_to_void): Likewise.
96 * decl.c (pop_label): Update comment.
97 (pop_switch): Remove use of EXPR_LOC_OR_HERE macro.
98 (check_tag_decl): Remove use of in_system_header macro.
99 (make_rtl_for_nonlocal_decl): Remove use of input_filename
101 (compute_array_index_type): Remove use of in_system_header
103 (grokdeclarator): Likewise.
104 * error.c (dump_global_iord): Remove use of input_filename
106 (location_of): Remove use of EXPR_LOC_OR_HERE macro.
107 (maybe_warn_cpp0x): Remove use of in_system_header macro.
108 * init.c (build_new_1): Remove use of EXPR_LOC_OR_HERE macro.
109 * lex.c (handle_pragma_interface): Remove use of input_filename
111 (handle_pragma_implementation): Likewise.
112 (cxx_make_type): Likewise.
113 (in_main_input_context): Likewise.
114 * name-lookup.c (push_binding_level): Remove use of
116 (leave_scope): Likewise.
117 (resume_scope): Likewise.
118 * parser.c (cp_parser_unqualified_id): Remove use of
119 in_system_header macro.
120 (cp_parser_cast_expression): Likewise.
121 (cp_parser_declaration_seq_opt): Likewise.
122 (cp_parser_enumerator_list): Likewise.
123 (cp_parser_parameter_declaration_clause): Likewise.
124 (cp_parser_exception_specification_opt): Likewise.
125 * pt.c (unify_arg_conversion): Remove use of EXPR_LOC_OR_HERE
127 (convert_nontype_argument): Likewise.
128 (push_tinst_level): Remove use of in_system_header macro.
129 (tsubst_copy_and_build): Remove use of EXPR_LOC_OR_HERE
131 (do_decl_instantiation): Remove use of in_system_header macro.
132 (do_type_instantiation): Likewise.
133 * semantics.c (finish_call_expr): Remove use of EXPR_LOC_OR_HERE
135 (begin_class_definition): Remove use of input_filename macro.
136 (cxx_eval_call_expression): Remove use of EXPR_LOC_OR_HERE
138 (cxx_eval_constant_expression): Likewise.
139 (potential_constant_expression_1): Likewise.
140 * typeck.c (decay_conversion): Likewise.
141 (rationalize_conditional_expr): Likewise.
142 (build_x_compound_expr_from_list): Likewise.
143 (convert_for_assignment): Likewise.
144 * typeck2.c (check_narrowing): Likewise.
146 2013-11-22 Trevor Saunders <tsaunders@mozilla.com>
148 * parser.c, semantics.c: Change some local variables from vec to
149 auto_vec or stack_vec.
151 2013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
153 * decl.c (reshape_init_array_1): Use tree_to_uhwi rather than
155 (grokdeclarator): Update comment to refer to tree_to_[su]hwi rather
158 2013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
160 * call.c, class.c, decl.c, error.c: Replace tree_low_cst (..., 1) with
161 tree_to_uhwi throughout.
163 2013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
165 * class.c, dump.c, error.c, init.c, method.c, parser.c, semantics.c:
166 Replace tree_low_cst (..., 0) with tree_to_shwi throughout.
168 2013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
170 * decl.c: Replace host_integerp (..., 1) with tree_fits_uhwi_p
173 2013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
175 * error.c, init.c, parser.c, semantics.c: Replace
176 host_integerp (..., 0) with tree_fits_shwi_p throughout.
178 2013-11-17 Paolo Carlini <paolo.carlini@oracle.com>
181 * decl.c (validate_constexpr_redeclaration): Redeclarations of
182 variables can differ in constexpr.
184 2013-11-16 Paolo Carlini <paolo.carlini@oracle.com>
187 * semantics.c (finish_call_expr): Ensure that for OVERLOADs too
188 '(&f)(...)' is the same as '(f)(...)', per 13.3.1.1.
190 2013-11-15 Aldy Hernandez <aldyh@redhat.com>
192 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Depend on cp/cp-cilkplus.o.
193 * cp-cilkplus.c: New file.
194 * cp-tree.h (cpp_validate_cilk_plus_loop): Protoize.
195 * parser.c (cp_parser_cilk_simd): New.
196 (cp_debug_parser): Add case for IN_CILK_SIMD_FOR.
197 (cp_parser_jump_statement): Same.
198 (cp_parser_omp_for_cond): Add new argument.
199 Add case for NE_EXPR.
200 (cp_parser_omp_for_loop): Pass new argument to
201 cp_parser_omp_for_cond.
202 Handle CILK_SIMD nodes.
203 Abstract initilization code to..
204 (cp_parser_omp_for_loop_init): ...here.
205 (cp_parser_pragma): Add case for PRAGMA_CILK_SIMD.
206 (cp_parser_cilk_simd_vectorlength): New.
207 (cp_parser_cilk_simd_linear): New.
208 (cp_parser_cilk_simd_clause_name): New.
209 (cp_parser_cilk_simd_all_clauses): New.
210 (cp_parser_cilk_simd): New.
211 * parser.h (IN_CILK_SIMD_FOR): New macro.
212 * pt.c (tsubst_expr): Add case for CILK_SIMD.
213 * typeck2.c (cxx_readonly_error): Pass location argument to
216 2013-11-14 Paolo Carlini <paolo.carlini@oracle.com>
219 * parser.c (cp_parser_late_parsing_nsdmi): Call
220 maybe_begin_member_template_processing.
221 * pt.c (maybe_begin_member_template_processing): Handle NSDMIs.
222 (inline_needs_template_parms): Adjust.
224 2013-11-14 Andrew MacLeod <amacleod@redhat.com>
226 * class.c: Include only gimplify.h and gimple.h as needed.
227 * cp-gimplify.c: Likewise.
230 * optimize.c: Likewise.
232 * semantics.c: Likewise.
234 * vtable-class-hierarchy.c: Likewise.
236 2013-11-14 Diego Novillo <dnovillo@google.com>
238 * call.c: Include stor-layout.h.
240 Include stringpool.h.
241 * class.c: Include stringpool.h.
242 Include stor-layout.h.
244 * cp-gimplify.c: Include stor-layout.h.
245 * cvt.c: Include stor-layout.h.
246 * decl.c: Include stringpool.h.
247 Include stor-layout.h.
251 * decl2.c: Include stringpool.h.
254 Include stor-layout.h.
256 * error.c: Include stringpool.h.
257 * except.c: Include stringpool.h.
260 * init.c: Include stringpool.h.
262 * lambda.c: Include stringpool.h.
263 * lex.c: Include stringpool.h.
264 * mangle.c: Include stor-layout.h.
265 Include stringpool.h.
266 * method.c: Include stringpool.h.
268 * name-lookup.c: Include stringpool.h.
269 Include print-tree.h.
271 * optimize.c: Include stringpool.h.
272 * parser.c: Include print-tree.h.
273 Include stringpool.h.
276 * pt.c: Include stringpool.h.
279 Include stor-layout.h.
280 * ptree.c: Include print-tree.h.
281 * repo.c: Include stringpool.h.
282 * rtti.c: Include stringpool.h.
283 Include stor-layout.h.
284 * semantics.c: Include stmt.h.
286 Include stor-layout.h.
287 Include stringpool.h.
288 * tree.c: Include stor-layout.h.
289 Include print-tree.h.
290 Include tree-iterator.h.
291 * typeck.c: Include stor-layout.h.
293 * typeck2.c: Include stor-layout.h.
295 * vtable-class-hierarchy.c: Include stringpool.h.
296 Include stor-layout.h.
298 2013-11-12 Andrew MacLeod <amacleod@redhat.com>
300 * class.c: Include gimplify.h.
301 * cp-gimplify.c: Likewise.
304 * optimize.c: Likewise.
306 * semantics.c: Likewise.
308 * vtable-class-hierarchy.c: Likewise.
309 * decl2.c: Don't include gimple.h.
310 * except.c: Likewise.
311 * method.c: Include pointer-set.h instead of gimple.h.
313 2013-11-12 Adam Butcher <adam@jessamine.co.uk>
315 * pt.c (convert_generic_types_to_packs): New function to transform
316 a range of implicitly introduced non-pack template parms to be parameter
318 * cp-tree.h (convert_generic_types_to_packs): Declare.
319 * parser.c (cp_parser_parameter_declaration_list): If a function
320 parameter pack contains generic types, convert them to packs prior to
323 2013-11-12 Adam Butcher <adam@jessamine.co.uk>
330 * parser.h (struct cp_parser): New members implicit_template_parms,
331 implicit_template_scope and auto_is_implicit_function_template_parm_p.
332 * parser.c (add_implicit_template_parms): Refactor as ...
333 (synthesize_implicit_template_parm): ... this to append a new template
334 type parm to the current template parameter list (introducing a new list
335 if necessary). Removed push_deferring_access_checks.
336 (finish_fully_implicit_template): Removed pop_deferring_access_checks.
337 (cp_parser_new): Initialize new cp_parser members.
338 (cp_parser_parameter_declaration_clause): Consider auto as implicit
339 template parm when parsing a parameter declaration (unless parsing an
340 explicit specialization).
341 (cp_parser_parameter_declaration_list): Remove local
342 implicit_template_parms counter and reset cp_parser implicit template
344 (cp_parser_lambda_expression): Reset implicit template cp_parser members
345 whilst generating lambda class.
346 (cp_parser_function_definition_after_declarator): Reset implicit
347 template cp_parser members whilst parsing function definition.
348 (make_generic_type_name): Respell '<autoN>' as 'auto:N' which works
349 better with template diagnostics.
350 (cp_parser_simple_type_specifier): Synthesize implicit template parm on
351 parsing 'auto' if auto_is_implicit_function_template_parm_p and provide
353 * decl.c (grokdeclarator): ... that were previously done here.
355 2013-11-12 Paolo Carlini <paolo.carlini@oracle.com>
358 * pt.c (lookup_template_class_1): Handle alias template declarations
359 of enumeration types.
361 2013-11-10 Paolo Carlini <paolo.carlini@oracle.com>
363 * cvt.c (cp_convert_to_pointer): Call build_ptrmemfunc before
364 maybe_warn_zero_as_null_pointer_constant to avoid duplicate
365 -Wzero-as-null-pointer-constant diagnostics.
367 * typeck.c (build_ptrmemfunc): Use cp_build_c_cast.
369 2013-11-06 Paolo Carlini <paolo.carlini@oracle.com>
372 * init.c (build_new_1): Don't call build_java_class_ref on non-class
375 2013-11-05 Jason Merrill <jason@redhat.com>
378 * decl.c (check_initializer): Don't use build_vec_init for arrays
381 2013-11-05 Paolo Carlini <paolo.carlini@oracle.com>
384 * name-lookup.c (handle_namespace_attrs): Use get_attribute_name.
386 2013-11-05 Tobias Burnus <burnus@net-b.de>
388 * parser.c (cp_parser_omp_for, cp_parser_omp_parallel,
389 cp_parser_omp_distribute, cp_parser_omp_teams, cp_parser_omp_target,
390 cp_parser_omp_declare): Handle -fopenmp-simd.
392 2013-11-04 Eric Botcazou <ebotcazou@adacore.com>
394 * decl2.c (cpp_check): Change type of first parameter and deal with
397 2013-11-03 Paolo Carlini <paolo.carlini@oracle.com>
400 * parser.c (cp_parser_constructor_declarator_p): Check that the
401 class-name matches current_class_type.
403 2013-11-03 Marek Polacek <polacek@redhat.com>
405 * decl.c (cp_finish_decl): Move C++1y bounds checking...
406 (compute_array_index_type): ...here. Add VLA instrumentation.
407 Call stabilize_vla_size.
408 (grokdeclarator): Don't call stabilize_vla_size here.
410 2013-11-02 Paolo Carlini <paolo.carlini@oracle.com>
414 * parser.c (cp_parser_cast_expression): If we aren't looking at
415 a cast-expression don't call cp_parser_type_id.
416 (cp_parser_postfix_expression): Likewise for compound-literal.
417 (cp_parser_tokens_start_cast_expression): Adjust.
419 2013-11-01 Edward Smith-Rowland <3dw4rd@verizon.net>
422 * parser.c (make_string_pack): Discover non-const type and size
423 of character and build parm pack with correct type and chars.
425 2013-11-01 Trevor Saunders <tsaunders@mozilla.com>
427 * semantics.c (build_anon_member_initialization): Convert fields to be
430 2013-11-01 Marc Glisse <marc.glisse@inria.fr>
433 * pt.c (type_dependent_expression_p): Handle null argument.
435 2013-11-01 Jakub Jelinek <jakub@redhat.com>
437 * semantics.c (finish_omp_clauses) <case OMP_CLAUSE_UNIFORM>: Go to
438 check_dup_generic at the end, unless remove is true.
439 (finish_omp_clauses) <case OMP_CLAUSE_LINEAR>: Add break; after
442 2013-10-31 Jakub Jelinek <jakub@redhat.com>
444 * semantics.c (finish_omp_clauses): Diagnose aligned clause
445 with decl that is not pointer nor array nor reference to those.
447 2013-10-31 Jason Merrill <jason@redhat.com>
449 * semantics.c (cxx_eval_call_expression): Handle trivial
450 value-initialization.
451 * typeck2.c (store_init_value): Call maybe_constant_init after
454 * decl.c (cxx_maybe_build_cleanup): Always set LOOKUP_NONVIRTUAL.
455 * decl2.c (build_cleanup): Just call cxx_maybe_build_cleanup.
458 * parser.c (cp_parser_late_parse_one_default_arg): Set
459 TARGET_EXPR_DIRECT_INIT_P.
461 * class.c (type_build_ctor_call): Return early in C++98 mode.
462 (type_build_dtor_call): Likewise.
464 2013-10-31 Paolo Carlini <paolo.carlini@oracle.com>
468 2013-10-18 Paolo Carlini <paolo.carlini@oracle.com>
471 * pt.c (most_specialized_class): Bump processing_template_decl for
474 2013-10-30 Paolo Carlini <paolo.carlini@oracle.com>
477 * call.c (build_over_call): Check return value of mark_used.
479 2013-10-30 Jason Merrill <jason@redhat.com>
481 * semantics.c (finish_compound_literal): Don't create a static variable
482 inside cp_unevaluated_operand.
484 * init.c (push_base_cleanups): Check ANON_AGGR_TYPE_P.
486 2013-10-30 Tobias Burnus <burnus@net-b.de>
489 * cp-tree.h (RANGE_FOR_IVDEP): Define.
490 (cp_convert_range_for, finish_while_stmt_cond, finish_do_stmt,
491 finish_for_cond): Take 'bool ivdep' parameter.
492 * cp-array-notation.c (create_an_loop): Update call.
493 * init.c (build_vec_init): Ditto.
494 * pt.c (tsubst_expr): Ditto.
495 * parser.c (cp_parser_iteration_statement, cp_parser_for,
496 cp_parser_range_for, cp_convert_range_for): Update calls.
497 (cp_parser_pragma): Accept GCC ivdep for 'while' and 'do'.
498 * semantics.c (finish_while_stmt_cond, finish_do_stmt,
499 finish_for_cond): Optionally build ivdep annotation.
501 2013-10-30 Jason Merrill <jason@redhat.com>
503 * decl.c (cp_finish_decl): Never throw for VLA bound == 0.
505 2013-10-29 David Malcolm <dmalcolm@redhat.com>
507 Patch autogenerated by refactor_symtab.py from
508 https://github.com/davidmalcolm/gcc-refactoring-scripts
509 revision 58bb219cc090b2f4516a9297d868c245495ee622
511 * call.c (mark_versions_used): Update for conversion of symtab types
512 to a true class hierarchy.
513 * decl2.c (cp_write_global_declarations): Likewise.
514 (clear_decl_external): Likewise.
515 (build_java_method_aliases): Likewise.
516 (collect_candidates_for_java_method_aliases): Likewise.
517 (mark_needed): Likewise.
518 (var_finalized_p): Likewise.
519 (maybe_make_one_only): Likewise.
520 (maybe_emit_vtables): Likewise.
521 * lambda.c (maybe_add_lambda_conv_op): Likewise.
522 * method.c (use_thunk): Likewise.
523 * optimize.c (maybe_clone_body): Likewise.
524 * tree.c (cp_fix_function_decl_p): Likewise.
526 2013-10-29 Paolo Carlini <paolo.carlini@oracle.com>
529 * decl2.c (grokfield): Handle auto like NSDMI.
531 2013-10-25 Paolo Carlini <paolo.carlini@oracle.com>
534 * pt.c (check_template_shadow): Don't skip declarations in inline
537 2013-10-25 Tobias Burnus <burnus@net-b.de>
540 * parser.c (cp_parser_iteration_statement,
541 cp_parser_for, cp_parser_c_for, cp_parser_pragma): Handle
544 2013-10-24 Marek Polacek <polacek@redhat.com>
547 * typeck2.c (check_narrowing): Don't check narrowing when the scalar
548 initializer is empty.
550 2013-10-23 Jason Merrill <jason@redhat.com>
553 * method.c (defaulted_late_check): Delete on eh-spec mismatch.
554 (maybe_explain_implicit_delete): Explain it.
556 * error.c (eh_spec_to_string): New.
557 (cp_printer): Use it for %X.
559 In C++11 a trivial [cd]tor might not be callable.
560 * class.c (user_provided_p): A function deleted on its declation
561 in the class is not user-provided.
562 (type_build_ctor_call): Also force a ctor call if we
563 might have a deleted or private trivial ctor.
564 (type_build_dtor_call): New.
565 (deduce_noexcept_on_destructors): Remove obsolete code.
566 * cp-tree.h: Declare type_build_dtor_call.
567 * decl.c (expand_static_init): Make sure trivial dtors are callable.
568 (cxx_maybe_build_cleanup): Likewise.
569 * except.c (build_throw): Likewise.
570 * init.c (build_value_init): Handle trivial but not callable ctors.
571 (perform_target_ctor): Make sure trivial dtor is callable.
572 (perform_member_init): Likewise.
573 (expand_cleanup_for_base): Likewise.
574 (build_vec_delete_1): Likewise.
575 (build_delete): Likewise.
576 (push_base_cleanups): Likewise.
577 (build_new_1): Avoid redundant error.
578 * method.c (synthesized_method_walk): Can't ever exit early in C++11.
579 Always process the subobject destructor.
580 * semantics.c (finish_compound_literal): Make sure trivial dtor is
582 * typeck2.c (split_nonconstant_init): Likewise.
584 2013-10-23 Edward Smith-Rowland <3dw4rd@verizon.net>
586 Implement C++14 [[deprecated]] modulo [[gnu::deprecated]] bugs.
587 * parser.c (cp_parser_std_attribute): Interpret [[deprecated]]
588 as [[gnu::deprecated]].
590 2013-10-22 Paolo Carlini <paolo.carlini@oracle.com>
593 * pt.c (apply_late_template_attributes): Use get_attribute_name,
596 2013-10-18 Paolo Carlini <paolo.carlini@oracle.com>
599 * pt.c (most_specialized_class): Bump processing_template_decl for
602 2013-10-18 Paolo Carlini <paolo.carlini@oracle.com>
604 * parser.c (cp_parser_lookup_name): Tidy.
606 2013-10-17 Andrew MacLeod <amacleod@redhat.com>
608 * parser.c: Include omp-low.h.
609 * semantics.c: Likewise.
611 2013-10-17 Paolo Carlini <paolo.carlini@oracle.com>
614 * lambda.c (lambda_expr_this_capture): Handle NSDMIs in the
615 cp_unevaluated_operand case.
617 2013-10-16 Jason Merrill <jason@redhat.com>
619 * pt.c (apply_late_template_attributes): Use
620 attribute_takes_identifier_p.
622 * error.c (dump_exception_spec): Print "noexcept" rather than
626 * pt.c (unify_array_domain): Split out from unify.
627 (unify): Use it for list deduction, too.
630 * decl2.c (dump_tu): Split out from...
631 (cp_write_global_declarations): ...here. Call it in PCH mode.
633 2013-10-16 Paolo Carlini <paolo.carlini@oracle.com>
635 * pt.c (tsubst): Fix typo in last commit.
637 2013-10-16 Paulo Matos <pmatos@broadcom.com>
639 * error.c (code_to_string): Use new wrapper get_tree_code_name.
640 * cxx-pretty-print.c (pp_cxx_assignment_operator): Likewise.
641 * pt.c (tsubst): Likewise.
642 * semantics.c (cxx_eval_constant_expression,
643 potential_constant_expression_1): Likewise.
644 * mangle.c (MANGLE_TRACE_TREE, dump_substitution_candidates,
645 add_substitution, find_substitution): Likewise.
647 2013-10-15 Paolo Carlini <paolo.carlini@oracle.com>
650 * parser.c (cp_parser_postfix_open_square_expression): Set
651 parser->greater_than_is_operator_p for the argument.
653 2013-10-11 Paolo Carlini <paolo.carlini@oracle.com>
656 * parser.c (cp_parser_commit_to_topmost_tentative_parse): New.
657 (cp_parser_pseudo_destructor_name): Use it.
659 2013-10-11 Paolo Carlini <paolo.carlini@oracle.com>
662 * pt.c (convert_nontype_argument): Set expr_type to
663 TREE_TYPE (probe_type).
665 2013-10-11 Jakub Jelinek <jakub@redhat.com>
667 * decl.c (duplicate_decls): Error out for redeclaration of UDRs.
668 (declare_simd_adjust_this): New function.
669 (grokfndecl): If "omp declare simd" attribute is present,
670 call declare_simd_adjust_this if needed and
671 c_omp_declare_simd_clauses_to_numbers.
672 * cp-array-notation.c (expand_array_notation_exprs): Handle
674 * cp-gimplify.c (cp_gimplify_expr): Handle OMP_SIMD and
675 OMP_DISTRIBUTE. Handle is_invisiref_parm decls in
676 OMP_CLAUSE_REDUCTION.
677 (cp_genericize_r): Handle OMP_SIMD and OMP_DISTRIBUTE like
679 (cxx_omp_privatize_by_reference): Return true for
680 is_invisiref_parm decls.
681 (cxx_omp_finish_clause): Adjust cxx_omp_create_clause_info
683 * pt.c (apply_late_template_attributes): For "omp declare simd"
684 attribute call tsubst_omp_clauses,
685 c_omp_declare_simd_clauses_to_decls, finish_omp_clauses
686 and c_omp_declare_simd_clauses_to_numbers.
687 (instantiate_class_template_1): Call cp_check_omp_declare_reduction
689 (tsubst_decl): Handle UDRs.
690 (tsubst_omp_clauses): Add declare_simd argument, if true don't
691 call finish_omp_clauses. Handle new OpenMP 4.0 clauses.
692 Handle non-NULL OMP_CLAUSE_REDUCTION_PLACEHOLDER on
693 OMP_CLAUSE_REDUCTION.
694 (tsubst_expr): For UDRs call pushdecl and
695 cp_check_omp_declare_reduction. Adjust tsubst_omp_clauses
696 callers. Handle OMP_SIMD, OMP_DISTRIBUTE, OMP_TEAMS,
697 OMP_TARGET_DATA, OMP_TARGET_UPDATE, OMP_TARGET, OMP_TASKGROUP.
698 Adjust finish_omp_atomic caller.
699 (tsubst_omp_udr): New function.
700 (instantiate_decl): For UDRs at block scope, don't call
701 start_preparsed_function/finish_function. Call tsubst_omp_udr.
702 * semantics.c (cxx_omp_create_clause_info): Add need_dtor argument,
703 use it instead of need_default_ctor || need_copy_ctor.
704 (struct cp_check_omp_declare_reduction_data): New type.
705 (handle_omp_array_sections_1, handle_omp_array_sections,
706 omp_reduction_id, omp_reduction_lookup,
707 cp_remove_omp_priv_cleanup_stmt, cp_check_omp_declare_reduction_r,
708 cp_check_omp_declare_reduction, clone_omp_udr,
709 find_omp_placeholder_r, finish_omp_reduction_clause): New functions.
710 (finish_omp_clauses): Handle new OpenMP 4.0 clauses and user defined
712 (finish_omp_for): Add CODE argument, use it instead of hardcoded
713 OMP_FOR. Adjust c_finish_omp_for caller.
714 (finish_omp_atomic): Add seq_cst argument, adjust
715 c_finish_omp_atomic callers, handle seq_cst and new OpenMP 4.0
717 (finish_omp_cancel, finish_omp_cancellation_point): New functions.
718 * decl2.c (mark_used): Force immediate instantiation of
719 DECL_OMP_DECLARE_REDUCTION_P decls.
720 (is_late_template_attribute): Return true for "omp declare simd"
722 (cp_omp_mappable_type): New function.
723 (cplus_decl_attributes): Add implicit "omp declare target" attribute
725 * parser.c (cp_debug_parser): Print
726 parser->colon_doesnt_start_class_def_p.
727 (cp_ensure_no_omp_declare_simd, cp_finalize_omp_declare_simd): New
729 (enum pragma_context): Add pragma_member and pragma_objc_icode.
730 (cp_parser_binary_expression): Handle no_toplevel_fold_p
731 even for binary operations other than comparison.
732 (cp_parser_linkage_specification): Call
733 cp_ensure_no_omp_declare_simd if needed.
734 (cp_parser_namespace_definition): Likewise.
735 (cp_parser_init_declarator): Call cp_finalize_omp_declare_simd.
736 (cp_parser_direct_declarator): Pass declarator to
737 cp_parser_late_return_type_opt.
738 (cp_parser_late_return_type_opt): Add declarator argument,
739 call cp_parser_late_parsing_omp_declare_simd for declare simd.
740 (cp_parser_class_specifier_1): Call cp_ensure_no_omp_declare_simd.
741 Parse UDRs before all other methods.
742 (cp_parser_member_specification_opt): Use pragma_member instead of
744 (cp_parser_member_declaration): Call cp_finalize_omp_declare_simd.
745 (cp_parser_function_definition_from_specifiers_and_declarator,
746 cp_parser_save_member_function_body): Likewise.
747 (cp_parser_late_parsing_for_member): Handle UDRs specially.
748 (cp_parser_next_token_starts_class_definition_p): Don't allow
749 CPP_COLON if colon_doesnt_start_class_def_p flag is true.
750 (cp_parser_objc_interstitial_code): Use pragma_objc_icode
751 instead of pragma_external.
752 (cp_parser_omp_clause_name): Parse new OpenMP 4.0 clause names.
753 (cp_parser_omp_var_list_no_open): Parse array sections for
754 OMP_CLAUSE_{DEPEND,MAP,TO,FROM} clauses. Add COLON argument,
755 if non-NULL, allow parsing to end with a colon rather than close
757 (cp_parser_omp_var_list): Adjust cp_parser_omp_var_list_no_open
759 (cp_parser_omp_clause_reduction): Handle user defined reductions.
760 (cp_parser_omp_clause_branch, cp_parser_omp_clause_cancelkind,
761 cp_parser_omp_clause_num_teams, cp_parser_omp_clause_thread_limit,
762 cp_parser_omp_clause_aligned, cp_parser_omp_clause_linear,
763 cp_parser_omp_clause_safelen, cp_parser_omp_clause_simdlen,
764 cp_parser_omp_clause_depend, cp_parser_omp_clause_map,
765 cp_parser_omp_clause_device, cp_parser_omp_clause_dist_schedule,
766 cp_parser_omp_clause_proc_bind, cp_parser_omp_clause_to,
767 cp_parser_omp_clause_from, cp_parser_omp_clause_uniform): New
769 (cp_parser_omp_all_clauses): Add finish_p argument. Don't call
770 finish_omp_clauses if it is false. Handle new OpenMP 4.0 clauses.
771 (cp_parser_omp_atomic): Parse seq_cst clause, pass
772 true if it is present to finish_omp_atomic. Handle new OpenMP 4.0
774 (cp_parser_omp_for_loop): Add CODE argument, pass it through
775 to finish_omp_for. Change last argument to cclauses,
776 and adjust uses to grab parallel clauses from the array of all
778 (cp_omp_split_clauses): New function.
779 (cp_parser_omp_simd): New function.
780 (cp_parser_omp_for): Add p_name, mask and cclauses arguments.
781 Allow the function to be called also when parsing combined constructs,
782 and call c_parser_omp_simd when parsing for simd.
783 (cp_parser_omp_sections_scope): If section-sequence doesn't start with
784 #pragma omp section, require exactly one structured-block instead of
785 sequence of statements.
786 (cp_parser_omp_sections): Add p_name, mask and cclauses arguments.
787 Allow the function to be called also when parsing combined constructs.
788 (cp_parser_omp_parallel): Add p_name, mask and cclauses arguments.
789 Allow the function to be called also when parsing combined
791 (cp_parser_omp_taskgroup, cp_parser_omp_cancel,
792 cp_parser_omp_cancellation_point, cp_parser_omp_distribute,
793 cp_parser_omp_teams, cp_parser_omp_target_data,
794 cp_parser_omp_target_update, cp_parser_omp_target,
795 cp_parser_omp_declare_simd, cp_parser_late_parsing_omp_declare_simd,
796 cp_parser_omp_declare_target, cp_parser_omp_end_declare_target,
797 cp_parser_omp_declare_reduction_exprs, cp_parser_omp_declare_reduction,
798 cp_parser_omp_declare): New functions.
799 (cp_parser_omp_construct): Add p_name and mask vars. Handle
800 PRAGMA_OMP_DISTRIBUTE, PRAGMA_OMP_SIMD, PRAGMA_OMP_TASKGROUP,
801 PRAGMA_OMP_TEAMS. Adjust cp_parser_omp_for, cp_parser_omp_parallel
802 and cp_parser_omp_sections callers.
803 (cp_parser_pragma): Handle PRAGMA_OMP_CANCEL,
804 PRAGMA_OMP_CANCELLATION_POINT, PRAGMA_OMP_DECLARE_REDUCTION,
805 PRAGMA_OMP_DISTRIBUTE, PRAGMA_OMP_SIMD, PRAGMA_OMP_TASKGROUP,
806 PRAGMA_OMP_TEAMS, PRAGMA_OMP_TARGET, PRAGMA_OMP_END_DECLARE_TARGET.
807 Handle pragma_member and pragma_objc_icode like pragma_external.
808 (OMP_FOR_CLAUSE_MASK, OMP_SECTIONS_CLAUSE_MASK,
809 OMP_SINGLE_CLAUSE_MASK): Use OMP_CLAUSE_MASK_1 instead of 1.
810 (OMP_PARALLEL_CLAUSE_MASK): Likewise. Add OMP_CLAUSE_PROC_BIND.
811 (OMP_TASK_CLAUSE_MASK): Use OMP_CLAUSE_MASK_1 instead of 1. Add
813 (OMP_SIMD_CLAUSE_MASK, OMP_CANCEL_CLAUSE_MASK,
814 OMP_CANCELLATION_POINT_CLAUSE_MASK, OMP_DISTRIBUTE_CLAUSE_MASK,
815 OMP_TEAMS_CLAUSE_MASK, OMP_TARGET_DATA_CLAUSE_MASK,
816 OMP_TARGET_UPDATE_CLAUSE_MASK, OMP_TARGET_CLAUSE_MASK,
817 OMP_DECLARE_SIMD_CLAUSE_MASK): Define.
818 * parser.h (struct cp_omp_declare_simd_data): New type.
819 (struct cp_parser): Add colon_doesnt_start_class_def_p and
820 omp_declare_simd fields.
821 * cp-objcp-common.h (LANG_HOOKS_OMP_MAPPABLE_TYPE): Define.
822 * cp-tree.h (struct lang_decl_fn): Add omp_declare_reduction_p
824 (DECL_OMP_DECLARE_REDUCTION_P): Define.
825 (OMP_FOR_GIMPLIFYING_P): Use OMP_LOOP_CHECK macro.
826 (struct saved_scope): Add omp_declare_target_attribute field.
827 (cp_omp_mappable_type, omp_reduction_id,
828 cp_remove_omp_priv_cleanup_stmt, cp_check_omp_declare_reduction,
829 finish_omp_cancel, finish_omp_cancellation_point): New prototypes.
830 (finish_omp_for): Add CODE argument.
831 (finish_omp_atomic): Add seq_cst argument.
832 (cxx_omp_create_clause_info): Add need_dtor argument.
834 2013-10-09 Marek Polacek <polacek@redhat.com>
837 * semantics.c (finish_return_stmt): Return error_mark_node
838 when error_operand_p of the expr is true.
839 (build_transaction_expr): Check for EXPR_P before setting the
842 2013-10-08 Paolo Carlini <paolo.carlini@oracle.com>
845 * lambda.c (begin_lambda_type): Check return value of xref_tag
846 for error_mark_node; tidy.
847 * decl.c (grokdeclarator): Tweak error message.
849 2013-10-08 Paolo Carlini <paolo.carlini@oracle.com>
853 2013-10-04 Paolo Carlini <paolo.carlini@oracle.com>
856 * pt.c (tsubst): Use error_operand_p on parameter t.
858 2013-10-06 Paolo Carlini <paolo.carlini@oracle.com>
861 * class.c (check_bases): Propagate CLASSTYPE_READONLY_FIELDS_NEED_INIT
862 and CLASSTYPE_REF_FIELDS_NEED_INIT from bases to derived.
863 * init.c (diagnose_uninitialized_cst_or_ref_member_1): Extend error
864 messages about uninitialized const and references members to mention
867 2013-10-06 Paolo Carlini <paolo.carlini@oracle.com>
870 * pt.c (type_dependent_expression_p): Handle EXPR_PACK_EXPANSION.
872 2013-10-04 Paolo Carlini <paolo.carlini@oracle.com>
875 * typeck2.c (build_functional_cast): Use error_operand_p on exp.
877 2013-10-04 Paolo Carlini <paolo.carlini@oracle.com>
880 * parser.c (cp_parser_perform_range_for_lookup): If eventually
881 either *begin or *end is type-dependent, return NULL_TREE.
882 (do_range_for_auto_deduction): If cp_parser_perform_range_for_lookup
883 returns NULL_TREE, don't actually do_auto_deduction.
885 2013-10-04 Paolo Carlini <paolo.carlini@oracle.com>
888 * pt.c (tsubst): Use error_operand_p on parameter t.
890 2013-10-04 Marc Glisse <marc.glisse@inria.fr>
893 * decl.c (cxx_init_decl_processing): Set operator_new_flag.
895 2013-10-04 Paolo Carlini <paolo.carlini@oracle.com>
898 * decl2.c (save_template_attributes): Handle error_mark_node as
900 (cp_check_const_attributes): Likewise for attributes.
901 * parser.c (cp_parser_std_attribute_spec): When alignas_expr is an
902 error_mark_node call cp_parser_skip_to_end_of_statement.
904 2013-10-03 Easwaran Raman <eraman@google.com>
907 * parser.c (cp_parser_init_declarator): Do not drop attributes
908 of template member functions.
910 2013-10-03 Marek Polacek <polacek@redhat.com>
913 * init.c (sort_mem_initializers): Splice when giving an error.
915 2013-10-02 Paolo Carlini <paolo.carlini@oracle.com>
918 * parser.c (cp_parser_function_specifier_opt): Upon error about
919 virtual templates don't set ds_virtual.
920 (finish_fully_implicit_template): Reject virtual implicit templates.
922 2013-10-02 Paolo Carlini <paolo.carlini@oracle.com>
925 * semantics.c (potential_constant_expression_1): Handle LABEL_EXPR.
927 2013-10-01 Paolo Carlini <paolo.carlini@oracle.com>
930 * parser.c (cp_parser_lookup_name): Check make_typename_type return
931 value for error_mark_node.
933 2013-09-25 Tom Tromey <tromey@redhat.com>
935 * Make-lang.in (CXX_TREE_H, CXX_PARSER_H, CXX_PRETTY_PRINT_H):
938 2013-09-25 Tom Tromey <tromey@redhat.com>
940 * Make-lang.in (g++spec.o): Remove.
941 (CFLAGS-cp/g++spec.o): New variable.
942 (GXX_OBJS): Reference cp/g++spec.o.
943 (cc1plus-checksum.o, cp/lex.o, cp/cp-array-notation.o)
944 (cp/cp-lang.o, cp/decl.o, cp/decl2.o, cp/cp-objcp-common.o)
945 (cp/typeck2.o, cp/typeck.o, cp/class.o, cp/call.o)
946 (cp/friend.o, cp/init.o, cp/method.o, cp/cvt.o, cp/search.o)
947 (cp/tree.o, cp/ptree.o, cp/rtti.o, cp/except.o, cp/expr.o)
948 (cp/pt.o, cp/error.o, cp/repo.o, cp/semantics.o, cp/dump.o)
949 (cp/optimize.o, cp/mangle.o, cp/parser.o, cp/cp-gimplify.o)
950 (cp/name-lookup.o, cp/cxx-pretty-print.o): Remove.
952 2013-09-25 Tom Tromey <tromey@redhat.com>
954 * Make-lang.in (g++spec.o): Don't use subshell.
956 2013-09-25 Marek Polacek <polacek@redhat.com>
959 * semantics.c (finish_transaction_stmt): Check for EXPR_P before
960 setting the expr location.
962 2013-09-23 Adam Butcher <adam@jessamine.co.uk>
965 * type-utils.h (find_type_usage): Only traverse one type level into
966 member function pointers.
968 2013-09-23 Adam Butcher <adam@jessamine.co.uk>
970 * parser.c (cp_parser_init_declarator): Defer calling
971 finish_fully_implicit_template for forward declarations until after
972 other decl processing is complete. Cleanup for clarity: Extract 'else'
973 case after 'if' containing unconditional return.
975 2013-09-23 Adam Butcher <adam@jessamine.co.uk>
977 * parser.c (make_generic_type_name): Spell generic type names '<autoN>'
978 rather than '__GenN'.
980 2013-09-23 Adam Butcher <adam@jessamine.co.uk>
982 * lambda.c (maybe_add_lambda_conv_op): Don't check for instantiated
983 callop in the case of generic lambdas.
985 2013-09-23 Adam Butcher <adam@jessamine.co.uk>
987 * parser.c (make_generic_type_name): Use global count rather than
989 (add_implicit_template_parms): ... propagate interface change here.
991 2013-09-20 Paolo Carlini <paolo.carlini@oracle.com>
994 * pt.c (tsubst_copy): Use current_nonlambda_class_type to
995 call tsubst_baselink.
997 2013-09-18 Paolo Carlini <paolo.carlini@oracle.com>
1000 * class.c (instantiate_type): Loosen a bit the gcc_assert.
1002 2013-09-18 Marek Polacek <polacek@redhat.com>
1005 * typeck.c (cp_build_binary_op): Properly honor -fsanitize options.
1006 Remove unnecessary check.
1008 2013-09-18 Marek Polacek <polacek@redhat.com>
1011 * typeck.c (cp_build_binary_op): Don't sanitize function if it has the
1012 no_sanitize_undefined attribute.
1014 2013-09-17 Paolo Carlini <paolo.carlini@oracle.com>
1017 * pt.c (tsubst, [BOUND_TEMPLATE_TEMPLATE_PARM]): Take into account
1018 the cp_type_quals (r) too.
1020 2013-09-16 Adam Butcher <adam@jessamine.co.uk>
1022 * cp-tree.h (type_uses_auto_or_concept): Declare.
1023 (is_auto_or_concept): Declare.
1024 * decl.c (grokdeclarator): Allow 'auto' parameters in lambdas with
1025 -std=gnu++1y or -std=c++1y or, as a GNU extension, in plain functions.
1026 * type-utils.h: New header defining ...
1027 (find_type_usage): ... this new function based on pt.c (type_uses_auto)
1028 for searching a type tree given a predicate.
1029 * pt.c (type_uses_auto): Reimplement via type-utils.h (find_type_usage).
1030 (is_auto_or_concept): New function.
1031 (type_uses_auto_or_concept): New function.
1032 * parser.h (struct cp_parser): Add fully_implicit_function_template_p.
1033 * parser.c (cp_parser_new): Initialize
1034 fully_implicit_function_template_p.
1035 (cp_parser_new): Initialize fully_implicit_function_template_p.
1036 (cp_parser_lambda_expression): Copy and restore value of
1037 fully_implicit_function_template_p as per other parser fields.
1038 (cp_parser_parameter_declaration_list): Count generic
1039 parameters and call ...
1040 (add_implicit_template_parms): ... this new function to synthesize them
1041 with help from type-utils.h (find_type_usage), ...
1042 (tree_type_is_auto_or_concept): ... this new static function and ...
1043 (make_generic_type_name): ... this new static function.
1044 (cp_parser_direct_declarator): Account for implicit template parameters.
1045 (cp_parser_lambda_declarator_opt): Finish fully implicit template if
1046 necessary by calling ...
1047 (finish_fully_implicit_template): ... this new function.
1048 (cp_parser_init_declarator): Likewise.
1049 (cp_parser_function_definition_after_declarator): Likewise.
1050 (cp_parser_member_declaration): Likewise.
1051 * Make-lang.in (cp/pt.o): Add dependency on type-utils.h.
1052 (cp/parser.o): Likewise.
1054 2013-09-16 Adam Butcher <adam@jessamine.co.uk>
1056 * parser.c (cp_parser_lambda_declarator_opt): Accept template parameter
1057 list with std=c++1y or std=gnu++1y.
1058 (cp_parser_lambda_body): Don't call 'expand_or_defer_fn' for lambda call
1059 operator template to avoid adding template result to symbol table.
1060 * lambda.c (lambda_function): Return template result if call operator is
1062 (maybe_add_lambda_conv_op): Move declarations to point of use. Refactor
1063 operator call building in order to support conversion of a non-capturing
1064 lambda template to a function pointer with help from ...
1065 (prepare_op_call): ... this new function.
1066 * decl2.c (check_member_template): Don't reject lambda call operator
1067 template in local [lambda] class.
1068 * pt.c (instantiate_class_template_1): Don't instantiate lambda call
1069 operator template when instantiating lambda class.
1071 2013-09-16 Adam Butcher <adam@jessamine.co.uk>
1073 * pt.c (make_auto_1): Use input_location rather than BUILTINS_LOCATION.
1075 2013-09-15 Jason Merrill <jason@redhat.com>
1079 * parser.c (cp_parser_lambda_introducer): Handle variadic capture.
1080 * lambda.c (add_capture): Handle variadic capture.
1081 (add_default_capture, lambda_capture_field_type): Likewise.
1082 (build_capture_proxy, register_capture_members): Likewise.
1083 * pt.c (register_specialization): Allow FIELD_DECL.
1084 (retrieve_specialization): Likewise.
1085 (find_parameter_packs_r): Handle FIELD_DECL and VAR_DECL.
1086 (tsubst_pack_expansion): Handle FIELD_DECL packs.
1087 (gen_elem_of_pack_expansion_instantiation): Likewise.
1088 (instantiate_class_template_1): Likewise.
1089 (tsubst_decl, tsubst_copy): Likewise.
1090 (tsubst_expr) [DECL_EXPR]: Handle capture proxy packs.
1091 (tsubst_copy_and_build) [VAR_DECL]: Likewise.
1092 * semantics.c (finish_non_static_data_member): Don't try to represent
1093 the type of a COMPOUND_REF of a FIELD_DECL pack.
1096 * cp-tree.h (DECL_PACK_P): Replace FUNCTION_PARAMETER_PACK_P.
1097 * cxx-pretty-print.c (direct_declarator): Adjust.
1098 * decl2.c (cp_build_parm_decl): Adjust.
1099 * pt.c (function_parameter_pack_p): Adjust.
1100 (find_parameter_packs_r, push_template_decl_real): Adjust.
1101 (tsubst_pack_expansion, tsubst_decl): Adjust.
1102 (regenerate_decl_from_template, instantiate_decl): Adjust.
1104 * lambda.c (add_capture): Don't add DECL_LANG_SPECIFIC.
1106 2013-09-13 Jason Merrill <jason@redhat.com>
1109 * pt.c (any_type_dependent_elements_p): Actually check for
1110 type-dependence, not value-dependence.
1112 2013-09-13 Jacek Caban <jacek@codeweavers.com>
1114 * decl.c: Use new cxx_implicit_extern_c hook
1116 2013-09-12 Brooks Moses <bmoses@google.com>
1119 * Make-lang.in: Do not install driver binaries in $(target)/bin.
1121 2013-09-12 Adam Butcher <adam@jessamine.co.uk>
1123 * pt.c (instantiate_decl): Save/restore cp_unevaluated_operand and
1124 c_inhibit_evaluation_warnings. Reset if instantiating within a
1125 function-local template.
1127 2013-09-12 Paolo Carlini <paolo.carlini@oracle.com>
1129 * semantics.c (finish_pseudo_destructor_expr): Add location_t
1131 * pt.c (unify_arg_conversion): Use EXPR_LOC_OR_HERE.
1132 (tsubst_copy_and_build): Adjust finish_pseudo_destructor_expr
1134 * parser.c (cp_parser_postfix_dot_deref_expression): Likewise.
1135 (cp_parser_postfix_expression): Pass the proper location to
1136 cp_parser_postfix_dot_deref_expression.
1137 * cp-tree.h (finish_pseudo_destructor_expr): Update declaration.
1139 2013-09-10 Jan Hubicka <jh@suse.cz>
1140 Paolo Carlini <paolo.carlini@oracle.com>
1142 * error.c (print_instantiation_partial_context_line): If
1143 loc == UNKNOWN_LOCATION return immediately.
1145 2013-09-09 Jakub Jelinek <jakub@redhat.com>
1148 * init.c (build_vec_delete): Call mark_rvalue_use on base.
1150 2013-09-09 Paolo Carlini <paolo.carlini@oracle.com>
1153 * init.c (build_vec_delete_1): When the type is incomplete emit a
1154 warning, enabled by default (not an error).
1155 (build_delete): Adjust to use OPT_Wdelete_incomplete.
1157 2013-09-09 Paolo Carlini <paolo.carlini@oracle.com>
1160 * error.c (location_of): Don't handle PARM_DECLs specially.
1162 2013-09-09 Paolo Carlini <paolo.carlini@oracle.com>
1164 * error.c (dump_expr, [PSEUDO_DTOR_EXPR]): Fix.
1165 * cxx-pretty-print.c (cxx_pretty_printer::postfix_expression):
1166 Tweak, TREE_OPERAND (t, 1) may be null.
1168 2013-09-08 Caroline Tice <cmtice@google.com>
1171 * vtable-class-hierarchy.c (vtv_generate_init_routine): In
1172 preinit case, move call to assemble_vtv_preinit_initializer to
1173 after call to cgraph_process_new_functions.
1175 2013-09-08 Tom de Vries <tom@codesourcery.com>
1178 * except.c (build_must_not_throw_expr): Handle
1181 2013-09-08 Joern Rennecke <joern.rennecke@embecosm.com>
1183 * typeck.c (cp_build_binary_op): Use vector_types_compatible_elements_p.
1185 2013-09-04 Paolo Carlini <paolo.carlini@oracle.com>
1188 * class.c (finish_struct_anon_r): New.
1189 (finish_struct_anon): Use it.
1191 2013-09-04 Gabriel Dos Reis <gdr@integrable-solutions.net>
1193 * cxx-pretty-print.h (cxx_pretty_printer::simple_type_specifier):
1194 Declare as overrider.
1195 * cxx-pretty-print.c (cxx_pretty_printer::simple_type_specifier):
1196 Rename from pp_cxx_simple_type_specifier.
1197 (cxx_pretty_printer::cxx_pretty_printer): Do not assign to
1198 simple_type_specifier.
1200 2013-09-03 Paolo Carlini <paolo.carlini@oracle.com>
1203 * typeck2.c (build_functional_cast): Maybe warn_deprecated_use.
1205 2013-09-03 Mike Stump <mikestump@comcast.net>
1207 * Make-lang.in (cp/lambda.o): Add dependencies.
1209 2013-09-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
1211 * cxx-pretty-print.h (cxx_pretty_printer::type_id): Declare as
1213 * cxx-pretty-print.c (pp_cxx_storage_class_specifier): Remove.
1214 (pp_cxx_userdef_literal): Tidy.
1215 (pp_cxx_template_argument_list): Likewise.
1216 (pp_cxx_typeid_expression): Likewise.
1217 (pp_cxx_offsetof_expression_1): Likewise.
1218 (cxx_pretty_printer::postfix_expression): Likewise.
1219 (cxx_pretty_printer::unary_expression): Likewise.
1220 (cxx_pretty_printer::statement): Likewise.
1221 (cxx_pretty_printer::type_id): Rename from pp_cxx_type_id.
1222 (c_pretty_printer::cxx_pretty_printer): Do not assign to type_id.
1223 * error.c (dump_decl): Tidy.
1224 (dump_expr): Likewise.
1226 2013-09-02 Paolo Carlini <paolo.carlini@oracle.com>
1228 PR c++/21682, implement DR 565
1229 * name-lookup.c (compparms_for_decl_and_using_decl): New.
1230 (push_overloaded_decl_1, do_nonmember_using_decl): Use it.
1232 2013-08-30 Marek Polacek <polacek@redhat.com>
1234 * typeck.c (cp_build_binary_op): Add division by zero and shift
1236 * error.c (dump_expr): Special-case ubsan builtins.
1238 2013-08-30 Paolo Carlini <paolo.carlini@oracle.com>
1241 * cp-tree.h (LOOKUP_DELEGATING_CONS): Add.
1242 * init.c (perform_target_ctor): Use it.
1243 * call.c (build_special_member_call): Diagnose self-delegating
1246 2013-08-30 Gabriel Dos Reis <gdr@integrable-solutions.net>
1248 * cxx-pretty-print.h (cxx_pretty_printer::declaration): Declare as
1250 (cxx_pretty_printer::declaration_specifiers): Likewise.
1251 (cxx_pretty_printer::function_specifier): Likewise.
1252 (cxx_pretty_printer::declarator): Likewise.
1253 (cxx_pretty_printer::direct_declarator): Likewise.
1254 (cxx_pretty_printer::abstract_declarator): Likewise.
1255 (cxx_pretty_printer::direct_abstract_declarator): Likewise.
1256 (pp_cxx_declaration): Remove.
1257 * cxx-pretty-print.c (cxx_pretty_printer::function_specifier):
1258 Rename from pp_cxx_function_specifier. Adjust.
1259 (cxx_pretty_printer::declaration_specifiers): Rename from
1260 pp_cxx_decl_specifier_seq. Adjust.
1261 (cxx_pretty_printer::direct_declarator): Rename from
1262 pp_cxx_direct_declarator. Adjust.
1263 (cxx_pretty_printer::declarator): Rename from pp_cxx_declarator.
1265 (cxx_pretty_printer::abstract_declarator): Rename from
1266 pp_cxx_abstract_declarator. Adjust.
1267 (cxx_pretty_printer::direct_abstract_declarator): Rename from
1268 pp_cxx_direct_abstract_declarator. Adjust.
1269 (cxx_pretty_printer::declaration): Rename from
1270 pp_cxx_declaration. Adjust.
1271 (cxx_pretty_printer::cxx_pretty_printer): Do not assign to
1272 declaration, declaration_specifiers, function_specifier,
1273 declarator, direct_declarator, abstract_declarator,
1274 direct_abstract_declarator.
1275 * error.c (dump_decl): Adjust.
1277 2013-08-29 Jan Hubicka <jh@suse.cz>
1279 Correct previous patch to not mark terminate as LEAF.
1280 * class.c (build_vtbl_initializer): Drop LEAF
1281 * decl.c (cxx_init_decl_processing): Likewise.
1282 (push_throw_library_fn): Likewise.
1283 * except.c (init_exception_processing): Likewise.
1284 (do_begin_catch): Likewise.
1285 (do_end_catch): Likewise.
1286 (do_allocate_exception): Likewise.
1288 2013-08-29 Jan Hubicka <jh@suse.cz>
1290 * class.c (build_vtbl_initializer): Make __cxa_deleted_virtual
1291 ECF_NORETURN | ECF_LEAF
1292 * cp-tree.h (build_library_fn_ptr, build_cp_library_fn_ptr,
1293 push_library_fn, push_void_library_fn): Update prototype.
1294 * decl.c (build_library_fn_1): Remove.
1295 (push_cp_library_fn, build_cp_library_fn): Update to take ECF flags.
1296 (cxx_init_decl_processing): Update; global_delete_fndecl is ECF_NOTROW;
1297 __cxa_pure_virtual is ECF_NORETURN | ECF_NORETURN | ECF_LEAF.
1298 (build_library_fn_1): Add ecf_flags argument; rename to ...
1299 (build_library_fn): ... this one.
1300 (build_cp_library_fn): Take ecf_flags; do not copy NOTHROW flag.
1301 (build_library_fn_ptr): Take ecf_flags.
1302 (build_cp_library_fn_ptr): Likewise.
1303 (push_library_fn): Likewise.
1304 (push_cp_library_fn): Likewise.
1305 (push_void_library_fn): Likewise.
1306 (push_throw_library_fn): All throws are ECF_NORETURN.
1307 (__cxa_atexit, __cxa_thread_atexit): Add ECF_LEAF | ECF_NOTHROW attributes.
1308 (expand_static_init): __cxa_guard_acquire, __cxa_guard_release,
1309 __cxa_guard_abort are ECF_NOTHROW | ECF_LEAF.
1310 * except.c (init_exception_processing): terminate is
1311 ECF_NOTHROW | ECF_NORETURN | ECF_LEAF.
1312 (declare_nothrow_library_fn): Add ecf_flags parameter.
1313 (__cxa_get_exception_ptr): Is ECF_NOTHROW | ECF_PURE | ECF_LEAF |
1315 (do_begin_catch): cxa_begin_catch and _ITM_cxa_begin_catch
1316 are ECF_NOTHROW | ECF_LEAF.
1317 (do_end_catch): __cxa_end_catch and _ITM_cxa_end_catch is
1319 (do_allocate_exception): _cxa_allocate_exception
1320 and _ITM_cxa_allocate_exception are ECF_NOTHROW | ECF_MALLOC
1322 (do_free_exception): __cxa_free_exception is
1323 ECF_NOTHROW | ECF_LEAF.
1324 * rtti.c (build_dynamic_cast_1): __dynamic_cast
1325 is ECF_LEAF | ECF_PURE | ECF_NOTHROW.
1327 2013-08-29 Adam Butcher <adam@jessamine.co.uk>
1329 * error.c (dump_lambda_function): New function, dependent on ...
1330 (dump_substitution): ... this new function, factored out of ...
1331 (subst_to_string): ... here and ...
1332 (dump_function_decl): ... here. Updated to early-out with call to
1333 dump_lambda_function after determining template bindings.
1335 2013-08-28 Paolo Carlini <paolo.carlini@oracle.com>
1338 * init.c (build_aggr_init): When init == void_type_node do not
1339 set LOOKUP_ONLYCONVERTING.
1341 2013-08-27 Caroline Tice <cmtice@google.com>
1343 * vtable-class-hierarchy.c: Remove unnecessary include statements.
1344 (MAX_SET_SIZE): Remove unnecessary constant.
1345 (register_construction_vtables): Make vtable_ptr_array parameter
1346 into a vector; remove num_args parameter. Change array accesses to
1348 (register_other_binfo_vtables): Ditto.
1349 (insert_call_to_register_set): Ditto.
1350 (insert_call_to_register_pair): Ditto.
1351 (output_set_info): Ditto. Also change warning calls to warning_at
1352 calls, and fix format of warning messages.
1353 (register_all_pairs): Change vtbl_ptr_array from an array into a
1354 vector. Remove num_vtable_args (replace with calls to vector length).
1355 Change array stores & accesses to vector functions. Change calls to
1356 register_construction_vtables, register_other_binfo_vtables,
1357 insert_call_to_register_set, insert_call_to_register_pair and
1358 output_set_info to match their new signatures. Change warning to
1359 warning_at and fix the format of the warning message.
1361 2013-08-27 Jakub Jelinek <jakub@redhat.com>
1362 Aldy Hernandez <aldyh@redhat.com>
1364 * cp-tree.h (CP_OMP_CLAUSE_INFO): Adjust range for new clauses.
1366 2013-08-27 Paolo Carlini <paolo.carlini@oracle.com>
1368 * decl.c (grokfndecl): Remove old bison hack.
1370 2013-08-26 Jan Hubicka <jh@suse.cz>
1372 * cp-tree.h (DECL_CONSTRUCTOR_P, DECL_DESTRUCTOR_P): Use
1375 2013-08-26 Gabriel Dos Reis <gdr@integrable-solutions.net>
1377 * cxx-pretty-print.h (cxx_pretty_printer::unary_expression):
1378 Declare as overrider.
1379 (cxx_pretty_printer::multiplicative_expression): Likewise.
1380 (cxx_pretty_printer::conditional_expression): Likewise.
1381 (cxx_pretty_printer::assignment_expression): Likewise.
1382 (cxx_pretty_printer::expression): Likewise.
1383 * cxx-pretty-print.c (cxx_pretty_printer::unary_expression):
1384 Rename from pp_cxx_unary_expression. Adjust.
1385 (cxx_pretty_printer::multiplicative_expression): Rename from
1386 pp_cxx_multiplicative_expression. Adjust.
1387 (cxx_pretty_printer::conditional_expression): Rename from
1388 pp_cxx_conditional_expression. Adjust.
1389 (cxx_pretty_printer::assignment_expression): Rename from
1390 pp_cxx_assignment_expression. Adjust.
1391 (cxx_pretty_printer::expression): Rename from pp_cxx_expression.
1393 (cxx_pretty_printer::cxx_pretty_printer): Dot not assign to
1394 unary_expression, multiplicative_expression,
1395 conditional_expression, assignment_expression, expression.
1397 2013-08-25 Gabriel Dos Reis <gdr@integrable-solutions.net>
1399 * cxx-pretty-print.h (cxx_pretty_printer::postfix_expression):
1400 Declare as overrider.
1401 * cxx-pretty-print.c (cxx_pretty_printer::postfix_expression):
1402 Rename from pp_cxx_postfix_expression. Adjust.
1403 (pp_cxx_expression): Use pp_postfix_expression.
1404 (cxx_pretty_printer::cxx_pretty_printer): Do not assign to
1407 2013-08-25 Gabriel Dos Reis <gdr@integrable-solutions.net>
1409 * cxx-pretty-print.h (cxx_pretty_printer::primary_expression): Now
1410 an overrider of c_pretty_printer::primary_expression.
1411 * cxx-pretty-print.c (cxx_pretty_printer::primary_expression):
1412 Rename from pp_cxx_primary_expression. Adjust.
1413 (pp_cxx_postfix_expression): Use pp_primary_expression.
1414 (pp_cxx_ctor_initializer): Likewise.
1415 (cxx_pretty_printer::cxx_pretty_printer): Do not assign to
1418 2013-08-23 Jan Hubicka <jh@suse.cz>
1420 * cp-tree.h (struct lang_type_class): Free is_final bit.
1421 (CLASSTYPE_FINAL): Define using TYPE_FINAL_P.
1422 (DECL_FINAL_P): Remove.
1423 * pt.c (instantiate_class_template_1): Guard that CLASSTYPE_FINAL
1424 is called on CLASS_TYPE_P.
1426 2013-08-25 Gabriel Dos Reis <gdr@integrable-solutions.net>
1428 * cxx-pretty-print.c (M_): Remove.
1429 (pp_cxx_unqualified_id): Use translate_string instead of M_.
1430 (pp_cxx_canonical_template_parameter): Likewise.
1432 2013-08-24 Gabriel Dos Reis <gdr@integrable-solutions.net>
1434 * cxx-pretty-print.h (cxx_pretty_printer::id_expression): Declare.
1435 * cxx-pretty-print.c (cxx_pretty_printer::id_expression): Rename
1436 from pp_cxx_id_expression. Adjust.
1437 (pp_cxx_userdef_literal): Use pp_id_expression.
1438 (pp_cxx_primary_expression): Likewise.
1439 (pp_cxx_direct_declarator): Likewise.
1440 (cxx_pretty_printer::cxx_pretty_printer): Do not assign to
1443 2013-08-24 Gabriel Dos Reis <gdr@integrable-solutions.net>
1445 * cxx-pretty-print.h (cxx_pretty_printer::constant): Now a member
1446 function, overriding c_pretty_printer::constant.
1447 * cxx-pretty-print.c (cxx_pretty_printer::constant): Rename from
1448 pp_cxx_constant. Adjust.
1449 (cxx_pretty_printer::cxx_pretty_printer): Do not assign to constant.
1451 2013-08-23 Gabriel Dos Reis <gdr@integrable-solutiobs.net>
1453 * cp-objcp-common.c (cxx_initialize_diagnostics): Call a
1454 destructor for the early printer.
1455 * error.c (type_to_string): Use pp_buffer.
1457 2013-08-22 Paolo Carlini <paolo.carlini@oracle.com>
1460 * class.c (check_field_decls): Check for const mutable and const
1461 reference data members.
1463 2013-08-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
1465 * error.c (init_error): Remove calls to pp_construct and
1466 pp_cxx_pretty_printer_init. Initialize cxx_pp with placement-new.
1467 * cxx-pretty-print.h (cxx_pretty_printer::cxx_pretty_printer): Declare.
1468 (cxx_pretty_printer_init): Remove.
1469 * cxx-pretty-print.c (cxx_pretty_printer::cxx_pretty_printer):
1470 Rename from cxx_pretty_printer_init. Adjust.
1471 * cp-objcp-common.c (cxx_initialize_diagnostics): Simplify
1472 initialization of C++ diagnostics pretty printer.
1474 2013-08-21 Paolo Carlini <paolo.carlini@oracle.com>
1476 * call.c (build_new_method_call_1): Use INDIRECT_REF_P.
1477 * cp-tree.h (REFERENCE_REF_P): Likewise.
1478 * semantics.c (finish_offsetof): Likewise.
1480 2013-08-21 Paolo Carlini <paolo.carlini@oracle.com>
1483 * semantics.c (finish_id_expression): Handle deprecated references.
1485 2013-08-20 Jason Merrill <jason@redhat.com>
1488 * cvt.c (build_expr_type_conversion): Don't complain about a
1489 template that can't match the desired type category.
1491 2013-08-20 Gabriel Dos Reis <gdr@integrable-solutions.net>
1493 * error.c (pp_ggc_formatted_text): New.
1494 (type_as_string): Use it in lieu of pp_formatted_text.
1495 (type_as_string_translate): Likewise.
1496 (expr_as_string): Likewise.
1497 (decl_as_string): Likewise.
1498 (decl_as_string_translate): Likewise.
1499 (lang_decl_name): Likewise.
1500 (decl_to_string): Likewise.
1501 (expr_to_string): Likewise.
1502 (fndecl_to_string): Likewise.
1503 (parm_to_string): Likewise.
1504 (type_to_string): Likewise.
1505 (args_to_string): Likewise.
1506 (subst_to_string): Likewise.
1508 2013-08-19 Balaji V. Iyer <balaji.v.iyer@intel.com>
1511 * cp-array-notation.c (cp_expand_cond_array_notations): Added a
1512 check for truth values.
1513 (expand_array_notation_exprs): Added truth values case. Removed an
1514 unwanted else. Added for-loop to walk through subtrees in default
1516 * call.c (build_cxx_call): Inherited the type of the array notation for
1517 certain built-in array notation functions.
1519 2013-08-19 Paolo Carlini <paolo.carlini@oracle.com>
1521 * parser.c (cp_parser_lambda_introducer, cp_parser_decltype_expr):
1522 Use cp_parser_lookup_name_simple.
1524 2013-08-19 Paolo Carlini <paolo.carlini@oracle.com>
1526 * name-lookup.h (pop_bindings_and_leave_scope): Declare.
1527 * name-lookup.c (pop_bindings_and_leave_scope): Define.
1528 * parser.c (cp_parser_lambda_declarator_opt,
1529 cp_parser_direct_declarator, cp_parser_cache_defarg): Use it.
1531 2013-08-17 Jason Merrill <jason@redhat.com>
1534 * name-lookup.c (push_class_level_binding_1): It's OK to push a
1535 lambda type after the enclosing type is complete.
1537 2013-08-17 Gabriel Dos Reis <gdr@integrable-solutions.net>
1539 * error.c (dump_scope): Add a cxx_pretty_printer parameter.
1541 (dump_template_argument): Likewise.
1542 (dump_template_argument_list): Likewise.
1543 (dump_template_parameter): Likewise.
1544 (dump_template_bindings): Likewise.
1545 (dump_alias_template_specialization): Likewise.
1546 (dump_type): Likewise.
1547 (dump_typename): Likewise.
1548 (dump_aggr_type): Likewise.
1549 (dump_type_prefix): Likewise.
1550 (dump_type_suffix): Likewise.
1551 (dump_global_iord): Likewise.
1552 (dump_simple_decl): Likewise.
1553 (dump_decl): Likewise.
1554 (dump_template_decl): Likewise.
1555 (dump_function_decl): Likewise.
1556 (dump_parameters): Likewise.
1557 (dump_ref_qualifier): Likewise.
1558 (dump_exception_spec): Likewise.
1559 (dump_function_name): Likewise.
1560 (dump_template_parms): Likewise.
1561 (dump_call_expr_args): Likewise.
1562 (dump_aggr_init_expr_args): Likewise.
1563 (dump_expr_list): Likewise.
1564 (dump_expr_init_vec): Likewise.
1565 (dump_expr): Likewise.
1566 (dump_binary_op): Likewise.
1567 (dump_unary_op): Likewise.
1569 2013-08-14 Paolo Carlini <paolo.carlini@oracle.com>
1572 * cp-tree.h (LOOKUP_NO_NON_INTEGRAL): Add.
1573 * decl.c (case_conversion): Use it.
1574 * call.c (standard_conversion): Likewise.
1575 (implicit_conversion): Adjust.
1577 2013-08-13 Adam Butcher <adam@jessamine.co.uk>
1579 * pt.c: Grammar fix in comments ("it's" to "its").
1581 2013-08-12 Paolo Carlini <paolo.carlini@oracle.com>
1583 * decl.c (warn_extern_redeclared_static, duplicate_decls,
1584 check_elaborated_type_specifier): Use error + inform.
1585 * friend.c (make_friend_class): Likewise.
1586 * semantics.c (finish_id_expression): Likewise.
1588 2013-08-09 Paolo Carlini <paolo.carlini@oracle.com>
1591 2013-08-07 Paolo Carlini <paolo.carlini@oracle.com>
1594 * name-lookup.c (lookup_name_real_1): Handle iter->type before
1597 2013-08-07 Paolo Carlini <paolo.carlini@oracle.com>
1600 * name-lookup.c (lookup_name_real_1): Handle iter->type before
1603 2013-08-06 Caroline Tice <cmtice@google.com>
1605 * Make-lang.in (*CXX_AND_OBJCXX_OBJS): Add vtable-class-hierarchy.o to
1607 (vtable-class-hierarchy.o): Add build rule.
1608 * cp-tree.h (vtv_start_verification_constructor_init_function): New
1609 extern function decl.
1610 (vtv_finish_verification_constructor_init_function): New extern
1612 (build_vtbl_address): New extern function decl.
1613 (get_mangled_vtable_map_var_name): New extern function decl.
1614 (vtv_compute_class_hierarchy_transitive_closure): New extern function
1616 (vtv_generate_init_routine): New extern function decl.
1617 (vtv_save_class_info): New extern function decl.
1618 (vtv_recover_class_info): New extern function decl.
1619 (vtv_build_vtable_verify_fndecl): New extern function decl.
1620 * class.c (finish_struct_1): Add call to vtv_save_class_info if
1621 flag_vtable_verify is true.
1622 * config-lang.in: Add vtable-class-hierarchy.c to gtfiles list.
1623 * vtable-class-hierarchy.c: New file.
1624 * mangle.c (get_mangled_vtable_map_var_name): New function.
1625 * decl2.c (start_objects): Update function comment.
1626 (cp_write_global_declarations): Call vtv_recover_class_info,
1627 vtv_compute_class_hierarchy_transitive_closure and
1628 vtv_build_vtable_verify_fndecl, before calling
1629 finalize_compilation_unit, and call vtv_generate_init_rount after, IFF
1630 flag_vtable_verify is true.
1631 (vtv_start_verification_constructor_init_function): New function.
1632 (vtv_finish_verification_constructor_init_function): New function.
1633 * init.c (build_vtbl_address): Remove static qualifier from function.
1635 2013-08-06 Jason Merrill <jason@redhat.com>
1638 * tree.c (strip_typedefs) [METHOD_TYPE]: Preserve ref-qualifier.
1640 2013-08-05 Paolo Carlini <paolo.carlini@oracle.com>
1643 * typeck.c (cp_pointer_int_sum): Add tsubst_flags_t parameter.
1644 (cp_build_binary_op): Adjust.
1646 2013-08-04 Gabriel Dos Reis <gdr@integrable-solutions.net>
1648 * cxx-pretty-print.h (pp_c_base): Remove.
1649 (cxx_pretty_printer): Derive from c_pretty_printer.
1650 Adjust macros using pp_c_base.
1651 * cp-objcp-common.c (cxx_initialize_diagnostics): Do not call pp_base.
1652 * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): Likewise.
1653 (pp_cxx_colon_colon): Likewise.
1654 (pp_cxx_separate_with): Likewise.
1655 (pp_cxx_storage_class_specifier): Do not call pp_c_base.
1656 (pp_cxx_expression_list): Likewise.
1657 (pp_cxx_space_for_pointer_operator): Likewise.
1658 (pp_cxx_init_declarator): Likewise.
1659 (pp_cxx_call_argument_list): Likewise.
1660 (pp_cxx_constant): Likewise.
1661 (pp_cxx_postfix_expression): Likewise.
1662 (pp_cxx_new_expression): Likewise.
1663 (pp_cxx_unary_expression): Likewise.
1664 (pp_cxx_cast_expression): Likewise.
1665 (pp_cxx_conditional_expression): Likewise.
1666 (pp_cxx_assignment_expression): Likewise.
1667 (pp_cxx_expression): Likewise.
1668 (pp_cxx_function_specifier): Likewise.
1669 (pp_cxx_decl_specifier_seq): Likewise.
1670 (pp_cxx_simple_type_specifier): Likewise.
1671 (pp_cxx_type_specifier_seq): Likewise.
1672 (pp_cxx_ptr_operator): Likewise.
1673 (pp_cxx_parameter_declaration_clause): Likewise.
1674 (pp_cxx_direct_declarator): Likewise.
1675 (pp_cxx_direct_abstract_declarator): Likewise.
1676 (pp_cxx_type_id): Likewise.
1677 (pp_cxx_statement): Likewise.
1678 (pp_cxx_pretty_printer_init): Tidy.
1679 * error.c (init_error): Do not use pp_base.
1680 (dump_aggr_type): Likewise.
1681 (dump_type_prefix): Likewise.
1682 (dump_type_suffix): Likewise.
1683 (dump_global_iord): Likewise.
1684 (dump_decl): Likewise.
1685 (dump_function_decl): Likewise.
1686 (dump_ref_qualifier): Likewise.
1687 (reinit_cxx_pp): Likewise.
1688 (decl_as_dwarf_string): Likewise.
1689 (lang_decl_dwarf_name): Likewise.
1690 (type_to_string): Likewise.
1691 (cv_to_string): Likewise.
1692 (cxx_print_error_function): Likewise.
1693 (cp_diagnostic_starter): Likewise.
1694 (cp_diagnostic_finalizer): Likewise.
1695 (cp_print_error_function): Likewise.
1696 (print_instantiation_context): Likewise.
1697 (cp_printer): Likewise.
1699 2013-08-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
1701 * error.c (dump_type_prefix): Use specialized pretty printer
1702 functions instead of pp_string or operators and punctuators.
1703 (dump_decl): Likewise.
1704 (dump_expr): Likewise.
1706 2013-08-03 Jason Merrill <jason@redhat.com>
1709 * pt.c (get_underlying_template): New.
1710 (convert_template_argument, lookup_template_class_1): Use it.
1714 * pt.c (pack_expansion_args_count): Rename from
1715 any_pack_expanson_args_p.
1716 (coerce_template_parms): Reject pack expansion to
1717 non-pack template parameter of alias template.
1719 2013-08-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
1721 * error.c (dump_aggr_type): Use specialized pretty printer
1722 functions instead of pp_character.
1723 (dump_type_prefix): Likewise.
1724 (dump_simple_decl): Likewise.
1725 (type_to_string): Likewise.
1727 2013-08-02 Paolo Carlini <paolo.carlini@oracle.com>
1729 * cp-tree.h (finish_stmt): Do not declare.
1730 * decl.c (finish_stmt): Do not define.
1731 * parser.c (cp_parser_expression_statement,
1732 cp_parser_declaration_statement,
1733 cp_parser_transaction_cancel): Don't call finish_stmt.
1734 * semantics.c (finish_expr_stmt, finish_if_stmt,
1735 finish_while_stmt, finish_do_stmt, finish_return_stmt,
1736 finish_for_stmt, finish_switch_stmt, finish_compound_stmt,
1737 finish_transaction_stmt): Likewise.
1739 2013-08-01 Fabien Chêne <fabien@gcc.gnu.org>
1742 * cp-tree.h: Check OVL_USED with OVERLOAD_CHECK.
1743 * name-lookup.c (do_nonmember_using_decl): Make sure we have an
1744 OVERLOAD before calling OVL_USED. Call diagnose_name_conflict
1745 instead of issuing an error without mentioning the conflicting
1748 2013-07-31 Paolo Carlini <paolo.carlini@oracle.com>
1750 * parser.c (cp_parser_sizeof_pack): Check cp_parser_identifier
1751 return value for error_mark_node.
1753 2013-07-30 Paolo Carlini <paolo.carlini@oracle.com>
1756 * parser.c (cp_parser_cache_defarg): In an NSDMI don't stop when
1757 token->type == CPP_ELLIPSIS.
1759 2013-07-30 Paolo Carlini <paolo.carlini@oracle.com>
1762 * call.c (is_std_init_list): Return false if cxx_dialect == cxx98.
1764 2013-07-29 Jason Merrill <jason@redhat.com>
1767 * semantics.c (build_data_member_initialization, constexpr_fn_retval):
1768 Use break_out_target_exprs instead of unshare_expr.
1770 2013-07-29 Paolo Carlini <paolo.carlini@oracle.com>
1773 * call.c (initialize_reference): Don't crash when reference_binding
1774 returns a conv with conv->kind == ck_ambig.
1776 2013-07-29 Jason Merrill <jason@redhat.com>
1778 * mangle.c (write_name): Check for null context.
1779 (write_unscoped_name): Allow PARM_DECL context.
1781 2013-07-25 Paolo Carlini <paolo.carlini@oracle.com>
1784 * decl.c (check_default_argument): Take a tsubst_flags_t parameter.
1785 (grokparms): Adjust.
1786 * parser.c (cp_parser_late_parse_one_default_arg): Likewise.
1787 * pt.c (tsubst_default_argument, tsubst_default_arguments): Take
1788 a tsubst_flags_t parameter.
1789 (tsubst_decl): Adjust.
1790 * call.c (convert_default_arg): Likewise.
1791 * cp-tree.h (check_default_argument, tsubst_default_argument):
1792 Update declarations.
1794 2013-07-25 Paolo Carlini <paolo.carlini@oracle.com>
1797 * parser.c (cp_parser_operator, case CPP_WSTRING, CPP_STRING16,
1798 CPP_STRING32, CPP_UTF8STRING, CPP_WSTRING_USERDEF,
1799 CPP_STRING16_USERDEF, CPP_STRING32_USERDEF, CPP_UTF8STRING_USERDEF):
1800 Fix string_len management, tidy.
1802 2013-07-24 Paolo Carlini <paolo.carlini@oracle.com>
1805 * typeck.c (ptr_reasonably_similar): Use COMPARE_STRICT if either
1806 target type is incomplete; return a bool, not an int.
1807 * cp-tree.h (ptr_reasonably_similar): Adjust declaration.
1809 2013-07-22 Paolo Carlini <paolo.carlini@oracle.com>
1811 * cp-tree.h (DERIVED_FROM_P): Pass tf_none to lookup_base, not
1812 tf_warning_or_error.
1814 2013-07-21 Ondřej BÃÂlka <neleai@seznam.cz>
1816 * class.c: Fix typos.
1817 * cp-array-notation.c: Likewise.
1818 * cp-objcp-common.c: Likewise.
1821 * mangle.c: Likewise.
1822 * parser.c: Likewise.
1824 * semantics.c: Likewise.
1826 2013-07-14 Adam Butcher <adam@jessamine.co.uk>
1828 * semantics.c (build_lambda_expr),
1829 (build_lambda_object), (begin_lambda_type), (lambda_return_type),
1830 (lambda_function), (lambda_capture_field_type), (is_capture_proxy),
1831 (is_normal_capture_proxy), (insert_capture_proxy),
1832 (insert_pending_capture_proxies), (lambda_proxy_type),
1833 (build_capture_proxy), (vla_capture_type),
1834 (register_capture_members), (add_default_capture),
1835 (lambda_expr_this_capture), (maybe_resolve_dummy),
1836 (nonlambda_method_basetype), (maybe_add_lambda_conv_op) and
1837 (is_lambda_ignored_entity): Moved definitions into ...
1838 * lambda.c: ... this new file.
1840 2013-07-14 Marc Glisse <marc.glisse@inria.fr>
1842 * call.c (build_conditional_expr_1): Handle the case with 1 vector
1843 and 2 scalars. Call save_expr before building a vector.
1844 * typeck.c (cp_build_binary_op): Check complain before complaining.
1846 2013-07-13 Lubos Lunak <l.lunak@suse.cz>
1849 * init.c (build_aggr_init): Check for warn_unused attribute.
1850 * decl.c (poplevel): Likewise.
1852 2013-07-13 Jason Merrill <jason@redhat.com>
1855 * init.c (build_vec_init): Use {} for arrays of class type.
1856 (build_vec_delete): Don't take the address of the array.
1859 * class.c (layout_class_type): Check for too-large class.
1861 * call.c (can_convert): Allow user-defined conversions.
1862 (can_convert_standard): New.
1863 * cp-tree.h: Declare it.
1864 * cvt.c (convert_to_reference): Use it.
1865 * pt.c (convert_nontype_argument): Likewise.
1866 * search.c (check_final_overrider): Likewise.
1867 Don't worry about user-defined conversions.
1869 2013-07-10 Paolo Carlini <paolo.carlini@oracle.com>
1872 * typeck.c (build_reinterpret_cast_1): With -Wconditionally-supported
1873 warn about casting between pointer-to-function and pointer-to-object.
1875 2013-07-09 Jason Merrill <jason@redhat.com>
1878 * init.c (build_vec_init): Don't take shortcuts when initializing
1882 * parser.c (cp_parser_sizeof_pack): Clear parser scopes.
1885 * semantics.c (finish_id_expression): Return the id for an
1886 unevaluated outer variable.
1889 * semantics.c (lambda_capture_field_type): Build a DECLTYPE_TYPE
1890 if the variable type uses 'auto'.
1893 * typeck.c (check_return_expr): Lambda proxies aren't eligible
1894 for nrv or return by move.
1897 * parser.c (cp_parser_ref_qualifier_opt): Don't tentatively parse
1898 a ref-qualifier in C++98 mode.
1901 * pt.c (convert_nontype_argument) [INTEGER_CST]: Force the
1902 argument to have the exact type of the parameter.
1905 * semantics.c (cxx_eval_indirect_ref): Don't try to look through
1906 a POINTER_PLUS_EXPR for type punning diagnostic.
1909 * pt.c (tsubst_copy): Handle USING_DECL.
1911 2013-07-09 Marc Glisse <marc.glisse@inria.fr>
1914 * semantics.c (cxx_eval_bit_field_ref): Handle VECTOR_CST.
1916 2013-07-09 Marc Glisse <marc.glisse@inria.fr>
1919 * call.c (build_conditional_expr_1): Preserve xvalues.
1921 2013-07-09 Paolo Carlini <paolo.carlini@oracle.com>
1924 * parser.c (cp_parser_simple_declaration): Before calling shadow_tag
1925 also check declares_class_or_enum.
1927 2013-07-08 Jason Merrill <jason@redhat.com>
1930 * pt.c (fn_type_unification): Only defer during substitution.
1931 (type_unification_real): Defer during defarg substitution,
1932 add checks parm to pass back deferred checks.
1933 (unify, do_auto_deduction): Adjust.
1934 * semantics.c (reopen_deferring_access_checks): New.
1935 * cp-tree.h: Declare it.
1937 2013-07-06 Paolo Carlini <paolo.carlini@oracle.com>
1940 * parser.c (cp_parser_init_declarator): If we are parsing a typedef
1941 set parser->default_arg_ok_p to false before cp_parser_declarator.
1943 2013-07-05 Paolo Carlini <paolo.carlini@oracle.com>
1946 * class.c (build_base_path): Improve diagnostic.
1948 2013-07-04 Paolo Carlini <paolo.carlini@oracle.com>
1951 * decl.c (start_preparsed_function): Return a bool, false if
1952 push_template_decl fails.
1953 (start_function): Adjust.
1954 * cp-tree.h: Update.
1956 2013-07-03 Jakub Jelinek <jakub@redhat.com>
1959 * parser.c (cp_parser_postfix_expression) <case RID_STATCAST>
1960 Temporarily set parser->greater_than_is_operator_p for
1961 cp_parser_expression and restore from saved value afterwards.
1963 2013-06-28 Ed Smith-Rowland <3dw4rd@verizon.net>
1965 * cp-tree.h (UDLIT_OP_ANSI_PREFIX): Remove space.
1966 * parser.c (cp_parser_operator()): Parse user-defined string
1967 literal as literal operator.
1969 2013-06-28 Paolo Carlini <paolo.carlini@oracle.com>
1972 * class.c (deduce_noexcept_on_destructors): Save, set, and restore
1973 TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t) around the main loop over the
1976 2013-06-28 Balaji V. Iyer <balaji.v.iyer@intel.com>
1978 * parser.c (cp_parser_array_notation): Removed rejection array notation
1979 of type function pointers. Added handling of array expressions when
1980 Cilk Plus is enabled. Took out type-checking.
1981 (cp_parser_postfix_open_square_expression): Moved normal array expr.
1982 parsing into cp_parser_array_notation when cilkplus is enabled.
1983 (cp_parser_compound_statement): Removed expansion of array notations.
1984 (cp_parser_ctor_initializer_opt_and_function_body): Likewise.
1985 (cp_parser_function_definition_after_declarator): Likewise.
1986 (cp_parser_selection_statement): Removed error reporting.
1987 (cp_parser_iteration_statement): Likewise.
1988 (cp_parser_direct_declarator): Removed error checking/reporting if
1989 array notations are used in the declarator.
1990 * pt.c (instantiate_decl): Likewise.
1991 (type_unification_real): Removed a check for ARRAY_NOTATION_REF.
1992 (cxx_eval_constant_expression): Removed ARRAY_NOTATION_REF case.
1993 (potential_constant_expression_1): Returned false for
1994 ARRAY_NOTATION_REF case.
1995 * cp-gimplify.c (cp_genericize): Added expansion of array notation
1997 * cp-array-notation.c (make_triplet_val_inv): Removed loc and cry
1998 parameters. Replaced build_decls with get_temp_regvar with type as
2000 (create_array_refs): Made the type-casting to ptrdiff_type.
2001 (replace_invariant_var): Added a check for void return type before
2002 creating new var. Replaced build_decl and build_min_nt_loc with
2004 (expand_an_in_modify_expr): Ditto. Replaced body of redundant else
2005 with gcc_unreachable. Removed few unwanted checks. Made induction
2006 variable type as ptrdiff_type. Removed loc and complain arguments
2007 passed into make_triplet_val_inv. Replaced all modify expression's
2008 code from NOP EXPR to INIT EXPR. Replaced all forceful appending
2009 into stmt. list with the non-forceful one. Replaced some integer
2010 conversion and equality-checking to using tree_int_cst_equal.
2011 (expand_sec_reduce_builtin): All changes mentioned in above function
2012 expand_an_in_modify_expr. Made the new variable type of
2013 SEC_REDUCE_ANY/ALL_{NON}ZERO intrinsic functions as bool.
2014 (expand_array_notation_exprs): Removed SWITCH_EXPR case. Moved all
2015 the error reporting from parser to this function. Removed unwanted
2016 statements and checks from SWITCH_STMT, WHILE_STMT, and DO_STMT cases.
2017 (cilkplus_an_triplet_types_ok_p): Removed rejection of array notation
2018 in function pointers.
2019 (cp_expand_cond_array_notations): Added a new if statements to check
2020 if condition has a zero rank. If so, then just return.
2021 (expand_return_expr): Added a check for return expressions with a rank.
2022 Replaced get_tmp_regvar with a create_temporary_var.
2023 (build_array_notation_ref): Simplified and removed unwanted if-stmts.
2024 Moved common code outside if-statements. Moved type-checking from
2026 * semantics.c (finish_return_stmt): Removed a check for return exprs.
2028 * call.c (convert_like_real): Removed a check for array notation
2029 expression in a function.
2030 (build_over_call): Likewise.
2031 (magic_varargs_p): Added a check for builtin array notation function.
2032 Made this function non-static and removed its prototype.
2033 * cp-tree.h (magic_varargs_p): New prototype.
2034 * typeck.c (cp_build_function_call_vec): Removed automatic setting of
2035 nargs to the param->length when builtin reduction function is used.
2036 (convert_arguments): Replaced check for a constant_p function with
2037 margic_varargs_p function call.
2038 (cp_build_binary_op): Removed calling of the function
2039 find_correct_array_notation_type.
2040 (cp_build_addr_expr_1): Removed an unwanted if-statement.
2041 (convert_for_assignment): Removed automatic return of rhs when array
2042 notation builtin function is used.
2044 2013-06-28 Paolo Carlini <paolo.carlini@oracle.com>
2047 * parser.c (cp_parser_save_member_function_body): Handle correctly
2048 curly braces in function-try-block mem-initializers.
2050 2013-06-27 Marc Glisse <marc.glisse@inria.fr>
2053 * typeck.c (cp_build_vec_perm_expr): New function.
2054 * cp-tree.h: Declare it.
2055 * parser.c (cp_parser_postfix_expression): Call it.
2056 * pt.c (tsubst_copy): Handle VEC_PERM_EXPR.
2057 (tsubst_copy_and_build): Likewise.
2059 2013-06-27 Marc Glisse <marc.glisse@inria.fr>
2062 * pt.c (more_specialized_fn): If both arguments are references,
2063 give priority to an lvalue.
2065 2013-06-26 Jason Merrill <jason@redhat.com>
2067 * typeck2.c (store_init_value): Diagnose a non-constant
2068 initializer for in-class static.
2071 * semantics.c (add_capture): Set type to error_mark_node after
2074 2013-06-25 Ed Smith-Rowland <3dw4rd@verizon.net>
2077 * parser.c (cp_parser_unqualified_id): Add declarator_p to checks
2078 to trigger warning, (cp_literal_operator_id): Remove bogus TODO comment.
2080 2013-06-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
2082 * call.c (null_ptr_cst_p): Use cxx11 in lieu of cxx0x.
2083 * class.c (add_implicitly_declared_members): Likewise.
2084 (check_field_decl): Likewise.
2085 (finalize_literal_type_property): Likewise.
2086 (check_bases_and_members): Likewise.
2087 * decl.c (poplevel): Likewise.
2088 (case_conversion): Likewise.
2089 (check_initializer): Likewise.
2090 (grokfndecl): Likewise.
2091 (check_static_variable_definition): Likewise.
2092 (compute_array_index_type): Likewise.
2093 (grokdeclarator): Likewise.
2094 (build_enumerator): Likewise.
2095 * friend.c (make_friend_class): Likewise.
2096 * lex.c (init_reswords): Likewise.
2097 * method.c (synthesized_method_walk): Likewise.
2098 (implicitly_declare_fn): Likewise.
2099 * parser.c (cp_parser_diagnose_invalid_type_name): Likewise.
2100 (cp_parser_constant_expression): Likewise.
2101 (cp_parser_for_init_statement): Likewise.
2102 (cp_parser_block_declaration): Likewise.
2103 (cp_parser_type_name): Likewise.
2104 (cp_parser_enum_specifier): Likewise.
2105 (cp_parser_enumerator_list): Likewise.
2106 (cp_parser_member_declaration): Likewise.
2107 (cp_nth_tokens_can_be_std_attribute_p): Likewise.
2108 (cp_parser_template_declaration_after_export): Likewise.
2109 * pt.c (convert_nontype_argument_function): Likewise.
2110 (convert_nontype_argument): Likewise.
2111 (convert_template_argument): Likewise.
2112 (tsubst_copy_and_build): Likewise.
2113 (build_non_dependent_expr): Likewise.
2114 * semantics.c (non_const_var_error): Likewise.
2115 (potential_constant_expression_1): Likewise.
2116 * tree.c (lvalue_kind): Likewise.
2117 (build_vec_init_expr): Likewise.
2118 (cast_valid_in_integral_constant_expression_p): Likewise.
2119 * typeck.c (build_x_conditional_expr): Likewise.
2120 * typeck2.c (check_narrowing): Likewise.
2122 2013-06-21 Balaji V. Iyer <balaji.v.iyer@intel.com>
2124 * cp-array-notation.c (cp_length_mismatch_in_expr_p): Remove.
2125 (expand_an_in_modify_expr): Changed a function call from the above
2126 removed function to length_mismatch_in_expr_p.
2128 2013-06-21 Balaji V. Iyer <balaji.v.iyer@intel.com>
2130 * call.c (convert_like_real): Added a check if array notation is present
2131 in expression. If so, then no conversion of arguments is necessary.
2132 (build_over_call): Likewise.
2133 * typeck.c (cp_build_function_call_vec): Likewise.
2134 (convert_for_assignment): Likewise.
2135 (cp_build_array_ref): Reject array notations with a rank greater than 1
2136 as an array's index.
2137 (cp_build_binary_op): If array notations are preent in op, then call
2138 find_correct_array_notation_type.
2139 (cp_build_addr_expr_1): Handle ARRAY_NOTATION_REF similar to ARRAY_REF.
2140 * cp-array-notation.c: New file.
2141 * cp-objcp-common.c (cp_common_init_ts): Marked ARRAY_NOTATION_REF tree
2143 * cp-tree.h (fix_array_notation_exprs): New prototype.
2144 * semantics.c (finish_return_stmt): Reject array notations as
2146 (cxx_eval_constant_expression): Added ARRAY_NOTATION_REF case.
2147 (potential_constant_expression_1): Likewise.
2148 * tree.c (lvalue_kind): Likewise.
2149 * error.c (dump_decl): Likewise.
2150 (dump_expr): Likewise.
2151 * pt.c (ARRAY_NOTATION_REF): Likewise.
2152 (type_unification_real): Do not unify any arguments if array notations
2154 (instantiate_decl): Added a check for array notaitons inside the
2155 function body. If so, then expand them.
2156 * parser.c (cp_parser_array_notation): New function.
2157 (cp_parser_postfix_open_square_expression): Added a check for colons
2158 inside square braces. If found, then handle the array access as an
2159 array notation access. Also, disable auto-correction from a single
2160 colon to scope when Cilk Plus is enabled.
2161 (cp_parser_compound_statement): Added a check for array notations
2162 inside the statement. If found, then expand them.
2163 (cp_parser_ctor_initializer_opt_and_function_body): Likewise.
2164 (cp_parser_function_definition_after_declarator): Likewise.
2165 (cp_parser_selection_statement): Searched for array notations inside
2166 condition. If so, then emit an error.
2167 (cp_parser_iteration_statement): Likewise.
2168 (cp_parser_direct_declarator): Reject array notations inside a
2169 variable or array declaration.
2170 * Make-lang.in (CXX_AND_OBJCXX_OBJS): Added cp/cp-array-notation.o.
2172 2013-06-20 Jason Merrill <jason@redhat.com>
2175 * decl.c (compute_array_index_type): Don't reject VLAs in SFINAE
2176 context if we're in C++14 mode.
2177 * tree.c (array_of_runtime_bound_p): Return true for a dependent
2178 bound that is not potentually constant.
2179 * cp-tree.h (DECL_VLA_CAPTURE_P, REFERENCE_VLA_OK): New.
2180 * pt.c (tsubst) [REFERENCE_TYPE]: Check REFERENCE_VLA_OK.
2181 * semantics.c (build_lambda_object): Don't rvalue a VLA capture.
2182 (build_capture_proxy): Set REFERENCE_VLA_OK.
2183 (vla_capture_type): Make it a proper C++ class.
2184 (add_capture): Set DECL_VLA_CAPTURE_P. Don't pre-digest the
2187 * decl.c (compute_array_index_type): Use size_one_node.
2189 * pt.c (process_partial_specialization): Build a TEMPLATE_DECL for
2190 a partial specialization.
2191 (tsubst_decl): Don't clobber CLASSTYPE_TI_TEMPLATE of a partial
2193 (most_specialized_class): Adjust.
2195 * cp-tree.h (DECL_TEMPLATE_PARMS, DECL_TEMPLATE_RESULT)
2196 (DECL_TEMPLATE_INSTANTIATIONS, DECL_TEMPLATE_SPECIALIZATIONS): Use
2197 TEMPLATE_DECL_CHECK.
2199 2013-06-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2202 * pt.c (unify, [TEMPLATE_PARM_INDEX]): Pass to unify_type_mismatch
2203 TREE_TYPE (arg), not arg itself.
2205 2013-06-18 Paolo Carlini <paolo.carlini@oracle.com>
2208 * pt.c (type_dependent_expression_p): Handle an array of unknown
2209 bound depending on a variadic parameter.
2210 * parser.c (cp_parser_range_for): Revert PR56794 changes.
2212 2013-06-17 Richard Biener <rguenther@suse.de>
2214 * cp-tree.h (ANON_AGGRNAME_FORMAT, ANON_AGGRNAME_P): Move to tree.h.
2216 2013-06-17 Paolo Carlini <paolo.carlini@oracle.com>
2219 * parser.c (cp_parser_expression_statement): Check whether
2220 cp_parser_expression returns error_mark_node.
2222 2013-06-14 Paolo Carlini <paolo.carlini@oracle.com>
2225 * semantics.c (finish_offsetof): Handle INDIRECT_REF as expr.
2227 2013-06-14 Paolo Carlini <paolo.carlini@oracle.com>
2230 * rtti.c (build_dynamic_cast_1): In case of cast to an unambiguous
2231 accessible base simply forward to build_static_cast.
2233 2013-06-12 Paolo Carlini <paolo.carlini@oracle.com>
2236 * decl.c (poplevel): For the benefit of -Wunused-variable see
2239 2013-06-12 Paolo Carlini <paolo.carlini@oracle.com>
2241 * parser.c (cp_parser_nested_name_specifier_opt): Fix typo in comment.
2243 2013-06-12 Paolo Carlini <paolo.carlini@oracle.com>
2246 * parser.c (cp_parser_nested_name_specifier_opt): Avoid emitting
2247 again diagnostic already emitted by cp_parser_lookup_name.
2249 2013-06-11 Jan Hubicka <jh@suse.cz>
2252 * cp/pt.c (mark_decl_instantiated): Do not export explicit
2253 instantiations of anonymous namespace templates.
2255 2013-06-10 Jason Merrill <jason@redhat.com>
2257 * name-lookup.c (add_decl_to_level): Add decls in an anonymous
2258 namespace to static_decls.
2260 2013-06-07 Sriraman Tallam <tmsriram@google.com>
2263 * call.c (build_over_call): Check if current_function_decl is
2266 2013-06-07 Paolo Carlini <paolo.carlini@oracle.com>
2269 * pt.c (lookup_template_class_1): Consistently use TYPE_MAIN_DECL,
2270 not TYPE_STUB_DECL, to access the _DECL for a _TYPE.
2272 2013-06-06 Jason Merrill <jason@redhat.com>
2275 * semantics.c (add_capture): Diagnose capture of variable-size
2276 type that is not a C++1y array of runtime bound.
2278 * decl.c (grokdeclarator): Keep a decl with error type.
2279 (grokfield, grokbitfield): Likewise.
2280 * pt.c (instantiate_class_template_1): Likewise.
2281 (tsubst_decl): Drop redundant error.
2282 * class.c (walk_subobject_offsets): Handle erroneous fields.
2283 * typeck2.c (process_init_constructor_record): Likewise.
2285 2013-06-05 Paolo Carlini <paolo.carlini@oracle.com>
2288 * parser.c (cp_parser_postfix_expression [RID_*CAST]): Set
2289 parser->in_type_id_in_expr_p before calling cp_parser_type_id.
2291 2013-06-03 Jan Hubicka <jh@suse.cz>
2293 * decl2.c (maybe_make_one_only): Use forced_by_abi instead of
2294 mark_decl_referenced.
2295 (mark_needed): Likewise.
2297 2013-06-03 Jason Merrill <jason@redhat.com>
2299 * class.c (mark_type_abi_tags): New.
2300 (check_abi_tags): Use it.
2302 2013-06-03 Paolo Carlini <paolo.carlini@oracle.com>
2305 * decl2.c (mark_used): Add overload taking a tsubst_flags_t too.
2306 * semantics.c (finish_qualified_id_expr): Use it.
2307 * cp-tree.h: Update.
2309 2013-06-01 Jan Hubicka <jh@suse.cz>
2311 * decl2.c (cp_write_global_declarations): Replace same_body_alias
2312 by symbol.cpp_implicit_alias.
2314 2013-05-30 Jason Merrill <jason@redhat.com>
2317 * cp-lang.c (cp_classify_record): Handle structs without
2321 * class.c (common_enclosing_class): New.
2322 * cp-tree.h: Declare it.
2323 * init.c (sort_mem_initializers): Don't splice out a union member
2326 2013-05-29 Jan Hubicka <jh@suse.cz>
2328 * tree.c (cp_fix_function_decl_p): Update for new symtab flags.
2329 * decl2.c )var_finalized_p, cp_write_global_declarations): Likewise.
2331 2013-05-25 Paolo Carlini <paolo.carlini@oracle.com>
2334 * decl2.c (check_classfn): Check for destructors declared as member
2337 2013-05-24 Jason Merrill <jason@redhat.com>
2340 * pt.c (any_template_arguments_need_structural_equality_p): A
2341 TEMPLATE_TEMPLATE_PARM can require structural type comparison.
2343 2013-05-24 Paolo Carlini <paolo.carlini@oracle.com>
2346 * class.c (check_bitfield_decl): Warn for bool and enum bitfields
2347 with width exceeding the type.
2349 2013-05-24 Jason Merrill <jason@redhat.com>
2352 * semantics.c (cxx_eval_constant_expression): Handle FMA_EXPR.
2353 (cxx_eval_trinary_expression): Rename from cxx_eval_vec_perm_expr.
2355 2013-05-23 Jason Merrill <jason@redhat.com>
2358 * tree.c (build_ref_qualified_type): Clear
2359 FUNCTION_RVALUE_QUALIFIED for lvalue ref-qualifier.
2361 2013-05-22 Jason Merrill <jason@redhat.com>
2364 * call.c (convert_like_real): Use cp_convert_and_check.
2365 * cvt.c (cp_convert_and_check): Use maybe_constant_value.
2366 * semantics.c (cxx_eval_constant_expression): Handle LTGT_EXPR.
2367 (potential_constant_expression_1): Handle OMP_ATOMIC*.
2370 * semantics.c (maybe_add_lambda_conv_op): Give up if the call op
2373 2013-05-22 Paolo Carlini <paolo.carlini@oracle.com>
2376 * parser.c (cp_parser_conversion_type_id): Set up
2377 parser->type_definition_forbidden_message before calling
2378 cp_parser_type_specifier_seq.
2380 2013-05-22 Paolo Carlini <paolo.carlini@oracle.com>
2383 * method.c (defaultable_fn_check): Avoid do_warn_unused_parameter
2384 warnings about defaulted functions.
2386 2013-05-21 Paolo Carlini <paolo.carlini@oracle.com>
2388 * call.c (build_conditional_expr_1): Add location_t parameter.
2389 (build_conditional_expr): Likewise.
2390 * typeck.c (rationalize_conditional_expr, cp_build_array_ref,
2391 get_member_function_from_ptrfunc, build_x_conditional_expr,
2392 cp_build_modify_expr): Update.
2393 * init.c (build_new_1): Likewise.
2394 * cp-tree.h: Update declaration.
2396 2013-05-20 Jason Merrill <jason@redhat.com>
2399 * pt.c (instantiation_dependent_r) [TRAIT_EXPR]: Only check type2
2403 * decl.c (fndecl_declared_return_type): Also look in
2404 DECL_SAVED_FUNCTION_DATA.
2406 2013-05-20 Paolo Carlini <paolo.carlini@oracle.com>
2409 * parser.c (cp_parser_parameter_declaration): Check return value
2410 of cp_parser_parse_and_diagnose_invalid_type_name.
2412 2013-05-20 Jason Merrill <jason@redhat.com>
2415 * class.c (vbase_has_user_provided_move_assign): New.
2416 * method.c (synthesized_method_walk): Check it.
2417 * cp-tree.h: Declare it.
2420 * tree.c (build_cplus_array_type): Copy layout info if element
2423 2013-05-20 Paolo Carlini <paolo.carlini@oracle.com>
2426 * call.c (build_new_op_1): Propagate loc to cp_build_binary_op.
2428 2013-05-20 Jason Merrill <jason@redhat.com>
2431 * decl2.c (determine_visibility): Use PRIMARY_TEMPLATE_P to decide
2432 whether a template has its own args.
2434 2013-05-20 Paolo Carlini <paolo.carlini@oracle.com>
2437 * pt.c (unify_no_common_base): Swap arg and parm arguments to inform.
2439 2013-05-20 Paolo Carlini <paolo.carlini@oracle.com>
2442 * parser.c (cp_parser_postfix_expression): Use cp_parser_braced_list
2443 instead of cp_parser_initializer_list for compound-literals.
2445 2013-05-20 Marc Glisse <marc.glisse@inria.fr>
2448 * typeck.c (check_return_expr): Reverse the alignment comparison.
2450 2013-05-17 Paolo Carlini <paolo.carlini@oracle.com>
2453 * parser.c (cp_parser_sizeof_operand): As a GNU Extension, parse
2454 correctly sizeof compound-literal; update comments.
2456 2013-05-16 Marc Glisse <marc.glisse@inria.fr>
2458 * call.c (build_conditional_expr_1): Use cp_build_binary_op
2459 instead of directly calling fold_build2.
2461 2013-05-16 Jason Merrill <jason@redhat.com>
2463 * Make-lang.in (cc1plus$(exeext)): Use link mutex.
2466 * decl.c (grokdeclarator): Allow member function qualifiers in
2467 TYPENAME context in C++11 mode.
2469 2013-05-16 Dodji Seketeli <dodji@redhat.com>
2471 PR c++/56782 - Regression with empty pack expansions
2472 * pt.c (use_pack_expansion_extra_args_p): When at least a
2473 parameter pack has an empty argument pack, and another parameter
2474 pack has no argument pack at all, use the PACK_EXPANSION_EXTRA
2477 2013-05-15 Paolo Carlini <paolo.carlini@oracle.com>
2479 * name-lookup.c (pushdecl_maybe_friend_1): Replace pairs of
2480 warning_at and permerror with warning_at/inform and permerror/
2481 inform, respectively.
2483 2013-05-15 Paolo Carlini <paolo.carlini@oracle.com>
2486 * name-lookup.c (pushdecl_maybe_friend_1): Diagnose illegal
2489 2013-05-14 Jason Merrill <jason@redhat.com>
2492 * parser.c (cp_parser_range_for): Call complete_type.
2495 * pt.c (tsubst_copy_and_build): Don't recur into a designator.
2497 2013-05-14 Paolo Carlini <paolo.carlini@oracle.com>
2500 * method.c (defaulted_late_check): Check for compatible exception
2501 specification out of class explicitly defaulted functions too.
2503 2013-05-14 Jason Merrill <jason@redhat.com>
2506 * semantics.c (potential_constant_expression_1): Make sure the
2507 called function is potentially constant.
2508 * call.c (null_ptr_cst_p): Revert earlier change.
2510 2013-05-13 Jason Merrill <jason@redhat.com>
2513 * call.c (null_ptr_cst_p): An expression with side-effects can't
2514 be a C++03 null pointer constant.
2517 * decl.c (reshape_init_class): Handle error_mark_node.
2520 * typeck.c (merge_types): Propagate ref-qualifier
2521 in METHOD_TYPE case.
2524 * decl.c (grokdeclarator): Apply ref-qualifier
2525 in the TYPENAME case.
2528 * decl.c (decls_match): Compare ref-qualifiers.
2530 2013-05-10 Jason Merrill <jason@redhat.com>
2533 * pt.c (convert_template_argument): Use dependent_template_arg_p,
2534 not uses_template_parms.
2537 * semantics.c (cxx_fold_indirect_ref): Fix thinko.
2540 * semantics.c (add_capture): Error rather than abort on copy
2542 * typeck.c (maybe_warn_about_returning_address_of_local): Don't
2543 warn about capture proxy.
2545 2013-05-09 Jason Merrill <jason@redhat.com>
2547 * decl.c (cp_finish_decl): Only check VLA bound in C++1y mode.
2550 * pt.c (lookup_template_class_1): Handle getting a template
2551 template parameter as D1.
2553 N3639 C++1y VLA diagnostics
2554 * decl.c (grokdeclarator): Complain about reference, pointer, or
2556 (create_array_type_for_decl): Complain about array of VLA.
2557 * pt.c (tsubst): Likewise.
2558 * rtti.c (get_tinfo_decl): Talk about "array of runtime bound".
2559 * semantics.c (finish_decltype_type): Complain about decltype of VLA.
2560 * typeck.c (cp_build_addr_expr_1): Complain about VLA.
2561 (cxx_sizeof_or_alignof_type): Likewise.
2563 N3639 C++1y VLA support
2564 * decl.c (compute_array_index_type): Allow VLAs in C++1y mode.
2565 (check_array_initializer): Allow VLA init.
2566 (reshape_init_array_1): Adjust.
2567 (cp_finish_decl): Check for invalid VLA length.
2568 * typeck2.c (process_init_constructor_array): Adjust.
2569 (store_init_value): Use build_vec_init for VLAs.
2570 * semantics.c (add_capture): Capture VLA as ptr+len.
2571 (vla_capture_type): New.
2572 (build_capture_proxy): Rebuild the VLA.
2573 * typeck.c (build_simple_component_ref): Split out from...
2574 (build_ptrmemfunc_access_expr): ...here.
2575 * tree.c (array_of_runtime_bound_p): New.
2576 * init.c (throw_bad_array_length): New.
2577 (build_vec_init): Use it.
2578 * parser.c (cp_convert_range_for): When iterating over a VLA,
2579 use it directly rather than bind a reference.
2580 * cp-tree.h: Declare new functions.
2582 2013-05-08 Jason Merrill <jason@redhat.com>
2584 * except.c (is_admissible_throw_operand_or_catch_parameter): Check
2585 variably_modified_type_p.
2586 (expand_start_catch_block): Mark the typeinfo used here.
2587 * semantics.c (finish_handler_parms): Not here.
2589 * error.c (dump_type_suffix): Try harder on VLA length.
2592 * init.c (throw_bad_array_new_length): New.
2593 (build_new_1): Use it. Don't warn about braced-init-list.
2594 (build_vec_init): Use it.
2595 * call.c (build_operator_new_call): Use it.
2598 * decl.c (grokdeclarator): Warn about ref-qualifiers here.
2599 * parser.c (cp_parser_ref_qualifier_seq_opt): Not here.
2600 * error.c (maybe_warn_cpp0x): s/0x/11/.
2602 2013-05-08 Paolo Carlini <paolo.carlini@oracle.com>
2605 * parser.c (cp_parser_enum_specifier): Handle nested_name_specifier
2608 2013-05-06 Marc Glisse <marc.glisse@inria.fr>
2610 * typeck.c (cp_build_binary_op): Call save_expr before
2611 build_vector_from_val.
2613 2013-05-06 Paolo Carlini <paolo.carlini@oracle.com>
2616 * decl.c (cp_finish_decl): After do_auto_deduction copy the
2617 qualifers with cp_apply_type_quals_to_decl.
2619 2013-05-05 Paolo Carlini <paolo.carlini@oracle.com>
2621 * pt.c (convert_nontype_argument): Add missing whitespace in
2624 2013-05-04 Paolo Carlini <paolo.carlini@oracle.com>
2627 * decl.c (build_enumerator): Improve error message.
2629 2013-05-03 Paolo Carlini <paolo.carlini@oracle.com>
2632 * parser.c (cp_parser_diagnose_invalid_type_name): Improve error
2633 messages for template types and fix column numbers.
2635 2013-05-01 Paolo Carlini <paolo.carlini@oracle.com>
2638 * pt.c (tsubst_copy_and_build, MODOP_EXPR): Increase / decrease
2639 c_inhibit_evaluation_warnings around build_x_modify_expr call.
2641 2013-05-01 Paolo Carlini <paolo.carlini@oracle.com>
2644 * semantics.c (finish_decltype_type): Handle instantiated template
2647 2013-04-28 Paolo Carlini <paolo.carlini@oracle.com>
2650 * semantics.c (finish_decltype_type): Handle COMPOUND_EXPR.
2652 2013-04-26 Jakub Jelinek <jakub@redhat.com>
2654 * error.c (cp_print_error_function): Adjust file_name_as_prefix
2657 2013-04-25 Jason Merrill <jason@redhat.com>
2660 * typeck.c (cxx_alignas_expr): Handle value-dependence properly.
2663 * init.c (perform_member_init): Call reshape_init.
2665 2013-04-24 Jason Merrill <jason@redhat.com>
2668 * parser.c (cp_parser_postfix_dot_deref_expression): Fix thinko.
2670 2013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
2672 * typeck.c (cxx_sizeof_or_alignof_type): Change -Wpointer-arith
2673 pedwarn to simply use OPT_Wpointer_arith.
2674 (cp_build_unary_op): Likewise.
2676 2013-04-24 Jason Merrill <jason@redhat.com>
2678 N3648: init-captures are named.
2679 * semantics.c (add_capture): Don't prepend "__" to init-captures.
2680 (build_capture_proxy): Adjust.
2681 * error.c (dump_simple_decl): Check DECL_NORMAL_CAPTURE_P.
2683 N3648: Allow braced and parenthesized initializers.
2684 * parser.c (cp_parser_lambda_introducer): Use cp_parser_initializer.
2685 * pt.c (tsubst) [DECLTYPE_TYPE]: Handle DECLTYPE_FOR_INIT_CAPTURE.
2686 * semantics.c (lambda_capture_field_type): Use do_auto_deduction.
2687 (add_capture): Collapse a parenthesized initializer into a single
2689 * cp-tree.h (DECLTYPE_FOR_INIT_CAPTURE): New.
2691 2013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
2694 * init.c (build_offset_ref): Add tsubst_flags_t parameter.
2695 * semantics.c (finish_qualified_id_expr): Likewise.
2696 (finish_id_expression): Update.
2697 * typeck.c (cp_build_addr_expr_1): Likewise.
2698 * pt.c (tsubst_qualified_id, resolve_nondeduced_context): Likewise.
2699 * cp-tree.h: Update declarations.
2701 2013-04-22 Jason Merrill <jason@redhat.com>
2704 * parser.c (cp_parser_unqualified_id): Handle ~auto.
2705 (cp_parser_pseudo_destructor_name): Likewise.
2706 (cp_parser_postfix_dot_deref_expression): Adjust.
2707 (cp_lexer_nth_token_is_keyword): New.
2708 * semantics.c (finish_pseudo_destructor_expr): Handle ~auto.
2709 * typeck.c (lookup_destructor): Handle ~auto.
2711 * pt.c (fn_type_unification): Push tinst level around
2712 type_unification_real if we aren't explaining.
2713 * cp-tree.h (TFF_NO_TEMPLATE_BINDINGS): New.
2714 * error.c (dump_function_decl): Respect it.
2715 (subst_to_string): Pass it.
2718 * rtti.c (get_typeid): Diagnose qualified function type.
2719 * pt.c (tsubst) [POINTER_TYPE]: Likewise.
2721 * error.c (dump_aggr_type): Fix lambda detection.
2722 (dump_simple_decl): Pretty-print capture field.
2725 * cvt.c (build_expr_type_conversion): Two conversions that return
2726 the same type aren't necessarily ambiguous.
2729 * parser.c (cp_parser_lambda_introducer): Make lambda capture init
2730 pedwarn unconditional except in C++1y mode.
2732 * semantics.c (potential_constant_expression_1): Don't crash on
2736 * semantics.c (finish_id_expression): Reject capture of anonymous
2740 * decl2.c (check_default_args): Check for pack expansion.
2742 * mangle.c (write_type): Mangle decltype(auto).
2744 2013-04-19 Jason Merrill <jason@redhat.com>
2746 N3638 changes to return type deduction
2747 * decl.c (undeduced_auto_decl): New.
2748 (require_deduced_type): New.
2749 (fndecl_declared_return_type): New.
2750 (decls_match): Use it.
2751 (duplicate_decls): Don't check for auto return.
2752 (grokdeclarator): Reject virtual auto.
2753 * class.c (resolve_address_of_overloaded_function): Handle
2754 auto function templates.
2755 * decl2.c (mark_used): Use undeduced_auto_decl, require_deduced_type.
2756 * cp-tree.h: Declare new fns.
2757 * error.c (dump_function_decl): Use fndecl_declared_return_type.
2758 * search.c (check_final_overrider): Likewise.
2759 * pt.c (make_decltype_auto): New.
2760 (do_auto_deduction): Require plain decltype(auto).
2764 * decl.c (duplicate_decls): Don't propagate DECL_DELETED_FN to
2765 template specializations.
2767 2013-04-16 Ed Smith-Rowland <3dw4rd@verizon.net>
2769 Implement n3599 - Literal operator templates for strings.
2770 * parser.c (make_string_pack (tree value)): New function.
2771 (cp_parser_userdef_string_literal (cp_token *)): Use it
2772 to construct calls to character string literal operator templates.
2773 (cp_parser_template_declaration_after_export): Check for new string
2774 literal operator template parameter form.
2776 2013-04-15 Jason Merrill <jason@redhat.com>
2778 * pt.c (tsubst) [DECLTYPE_TYPE]: Use tsubst_copy_and_build.
2781 * pt.c (tsubst) [DECLTYPE_TYPE]: If ~id is an expression
2782 rather than a destructor name, it isn't an unqualified-name.
2783 (tsubst_copy_and_build): Pass down decltype_flag to operator
2787 * semantics.c (insert_capture_proxy): Just use index 1 in the
2790 2013-04-12 Jakub Jelinek <jakub@redhat.com>
2792 * error.c (cp_print_error_function,
2793 print_instantiation_partial_context_line,
2794 maybe_print_constexpr_context): Colorize locus strings.
2796 2013-04-11 Jason Merrill <jason@redhat.com>
2799 * parser.c (complain_flags): New.
2800 (cp_parser_postfix_expression): Use it.
2801 (cp_parser_unary_expression): Likewise.
2802 (cp_parser_binary_expression): Likewise.
2803 (cp_parser_assignment_expression): Likewise.
2804 (cp_parser_expression): Likewise.
2805 (cp_parser_postfix_open_square_expression): Take decltype_p.
2806 (cp_parser_builtin_offsetof): Adjust.
2807 (cp_convert_range_for): Pass complain to finish_unary_op_expr.
2808 * decl2.c (grok_array_decl): Add decltype_p parm.
2809 * cp-tree.h: Adjust prototype.
2810 * semantics.c (finish_unary_op_expr): Add complain parm.
2812 2013-04-11 Jakub Jelinek <jakub@redhat.com>
2815 * call.c (null_ptr_cst_p): Call fold_non_dependent_expr_sfinae before
2816 calling maybe_constant_value for C++98.
2818 2013-04-11 Jason Merrill <jason@redhat.com>
2821 * semantics.c (lambda_capture_field_type, lambda_proxy_type):
2822 Strip references before checking WILDCARD_TYPE_P.
2824 2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
2826 * call.c (build_conditional_expr_1, build_over_call): Protect
2827 error calls with complain & tf_error.
2828 * typeck.c (finish_class_member_access_expr, cp_build_binary_op,
2829 build_x_unary_op, cp_build_unary_op, cp_build_compound_expr,
2830 build_ptrmemfunc): Likewise.
2831 (lookup_destructor): Take tsubst_flags_t parameter, adjust.
2833 * cvt.c (warn_ref_binding): Rename to diagnose_ref_binding.
2834 (convert_to_reference): Adjust.
2836 2013-04-11 Jason Merrill <jason@redhat.com>
2838 * pt.c (tsubst_copy) [VAR_DECL]: Don't call tsubst for
2839 local variables, look them up instead.
2840 (tsubst_decl) [VAR_DECL]: Remove handling for anonymous union
2841 proxies and substitution in unevaluated context.
2842 (tsubst_expr) [OMP_FOR]: Instantiate OMP_FOR_PRE_BODY
2843 before the iterators.
2846 * pt.c (uses_deducible_template_parms): New.
2847 (deducible_array_bound, deducible_expression): New.
2848 (deducible_template_args): New.
2849 (unify_one_argument): Call uses_deducible_template_parms.
2851 2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
2854 * typeck2.c (build_m_component_ref): Protect error calls with
2855 (complain & tf_error).
2857 2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
2860 * parser.c (cp_parser_enum_specifier): Check for empty
2861 anonymous enums and anonymous scoped enums.
2863 2013-04-10 Jakub Jelinek <jakub@redhat.com>
2866 * typeck.c (cp_build_binary_op): Call fold_non_dependent_expr_sfinae
2867 first before calling maybe_constant_value for warn_for_div_by_zero
2868 or invalid shift count warning purposes.
2870 2013-04-09 Jason Merrill <jason@redhat.com>
2873 * rtti.c (build_typeid): Check the address of the argument
2874 rather than looking for an INDIRECT_REF.
2876 2013-04-04 Jason Merrill <jason@redhat.com>
2880 * typeck2.c (abstract_virtuals_error_sfinae): Disable
2881 complete_type again.
2883 2013-04-08 Paolo Carlini <paolo.carlini@oracle.com>
2886 * decl.c (validate_constexpr_redeclaration): Allow an explicit
2887 specialization to be different wrt the constexpr specifier.
2889 2013-04-06 Jason Merrill <jason@redhat.com>
2891 * parser.c (cp_parser_std_attribute): Treat [[noreturn]] like GNU
2894 2013-04-05 Ed Smith-Rowland <3dw4rd@verizon.net>
2896 * parser.c (cp_parser_ref_qualifier_seq_opt): Move to
2897 cp_parser_ref_qualifier_opt. Error if more than one ref-qual found.
2899 2013-04-03 Jason Merrill <jason@redhat.com>
2901 * cp-tree.h (FUNCTION_OR_METHOD_TYPE_CHECK): Remove.
2902 (TYPE_RAISES_EXCEPTIONS): Use FUNC_OR_METHOD_CHECK instead.
2903 (FUNCTION_REF_QUALIFIED, FUNCTION_RVALUE_QUALIFIED): Likewise.
2905 * mangle.c (write_type): When writing a function type with
2906 function-cv-quals, don't add the unqualified type as a
2907 substitution candidate.
2909 2013-04-03 Paolo Carlini <paolo.carlini@oracle.com>
2912 * typeck.c (cp_build_unary_op): Change -Wpointer-arith permerror to
2915 2013-04-03 Jakub Jelinek <jakub@redhat.com>
2918 * tree.c (strip_typedefs): Copy NON_DEFAULT_TEMPLATE_ARGS_COUNT
2919 from args to new_args.
2920 (strip_typedefs_expr): Copy NON_DEFAULT_TEMPLATE_ARGS_COUNT from t to
2921 r instead of doing {S,G}ET_NON_DEFAULT_TEMPLATE_ARGS_COUNT.
2923 2013-04-02 Jason Merrill <jason@redhat.com>
2926 * mangle.c (write_function_type): Mangle ref-qualifier.
2927 (write_nested_name): Likewise.
2928 (canonicalize_for_substitution): Preserve ref-qualifier.
2929 (write_type): Likewise.
2932 * decl.c (begin_destructor_body): Clobber the object in a cleanup.
2934 2013-04-02 Paolo Carlini <paolo.carlini@oracle.com>
2936 * friend.c (do_friend): Use COMPLETE_OR_OPEN_TYPE_P.
2937 * pt.c (find_parameter_packs_r): Use TYPE_ALIAS_P and TYPE_TI_ARGS.
2938 (for_each_template_parm_r): Use TYPE_TI_ARGS.
2940 2013-04-02 Paolo Carlini <paolo.carlini@oracle.com>
2942 * cp-tree.h (TAGGED_TYPE_P): Remove.
2943 (IS_OVERLOAD_TYPE): Rename to OVERLOAD_TYPE_P, adjust.
2944 (TYPE_ANONYMOUS_P): Adjust.
2945 * call.c (build_new_op_1): Likewise.
2946 * class.c (find_abi_tags_r): Likewise.
2947 * decl.c (warn_misplaced_attr_for_class_type, start_decl,
2948 type_is_deprecated): Likewise.
2949 * decl2.c (grokfield, min_vis_r): Likewise.
2950 * pt.c (get_template_info): Likewise.
2951 * tree.c (handle_abi_tag_attribute): Likewise.
2953 2013-04-01 Jason Merrill <jason@redhat.com>
2955 * semantics.c (maybe_constant_value): Check
2956 instantiation_dependent_expression_p.
2957 * pt.c (build_non_dependent_expr): Don't check it here.
2960 * init.c (build_new): Don't try to process an array initializer
2961 at template definition time.
2964 * typeck.c (finish_class_member_access_expr): Handle enum scope.
2967 * parser.c (cp_parser_range_for): Don't try to do auto deduction
2968 in a template if the type of the range is incomplete.
2970 * call.c (add_function_candidate): Take the address of 'this' here.
2971 (build_over_call): And here.
2972 (build_new_method_call_1, build_op_call_1): Not here.
2973 (build_user_type_conversion_1): Or here.
2974 (add_candidates): Adjust.
2976 * cxx-pretty-print.h (pp_cxx_cv_qualifiers): New.
2977 * class.c (same_signature_p): Use type_memfn_quals.
2978 * cp-tree.h (TYPE_RAISES_EXCEPTIONS): Use
2979 FUNCTION_OR_METHOD_TYPE_CHECK.
2980 * error.c (dump_type_suffix): Add padding before cv-qualifiers.
2981 * pt.c (unify): Use static_fn_type.
2983 2013-04-01 Bronek Kozicki <b.kozicki@gmail.com>
2984 Jason Merrill <jason@redhat.com>
2986 Implement N2439 (ref-qualifiers for 'this')
2987 * cp-tree.h (FUNCTION_REF_QUALIFIED): New.
2988 (FUNCTION_RVALUE_QUALIFIED): New.
2989 (FUNCTION_OR_METHOD_TYPE_CHECK): New.
2990 (cpp0x_warn_str): Add CPP0X_REF_QUALIFIER.
2991 (cp_ref_qualifier): New enum.
2992 (cp_declarator): Add ref_qualifier.
2993 * parser.c (cp_parser_ref_qualifier_seq_opt): New.
2994 (cp_parser_direct_declarator): Use it.
2995 (make_call_declarator): Adjust.
2996 (cp_parser_lambda_declarator_opt): Adjust.
2997 * call.c (add_function_candidate): Handle ref-qualifier overload
2998 resolution semantics.
2999 (standard_conversion): Adjust.
3000 * class.c (add_method, same_signature_p): Compare ref-qualifiers.
3001 * decl.c (grokdeclarator): Handle ref-qualifiers.
3002 (grokfndecl): Check for invalid ref-qualifiers.
3003 (static_fn_type, revert_static_member_fn): Adjust.
3004 * decl2.c (build_memfn_type): Handle ref-qualifiers.
3005 (check_classfn): Check them.
3006 (cp_reconstruct_complex_type): Retain them.
3007 * error.c (dump_ref_qualifier): New.
3008 (dump_type_suffix, dump_function_decl): Use it.
3009 (maybe_warn_cpp0x): Handle CPP0X_REF_QUALIFIER.
3010 * pt.c (tsubst, tsubst_function_type): Instantiate ref-quals.
3011 (unify): Retain them.
3012 * tree.c (cp_check_qualified_type): New.
3013 (cp_build_qualified_type_real): Keep exception spec and ref-qual.
3014 (build_ref_qualified_type): New.
3015 (strip_typedefs, build_exception_variant): Keep ref-qualifier.
3016 (cp_build_type_attribute_variant): Keep ref-qualifier.
3017 * typeck.c (merge_types): Keep ref-qualifier.
3018 (structural_comptypes): Compare ref-qualifier.
3019 (type_memfn_rqual): New.
3020 (apply_memfn_quals): Take ref-qual argument.
3021 * typeck2.c (build_m_component_ref): Check ref-qualifier.
3023 2013-04-01 Paolo Carlini <paolo.carlini@oracle.com>
3025 * cp-tree.h (DECL_UNBOUND_CLASS_TEMPLATE_P): Remove.
3026 (DECL_FUNCTION_TEMPLATE_P): Adjust.
3028 * cxx-pretty-print.c (pp_cxx_nested_name_specifier,
3029 pp_cxx_qualified_id): Use get_containing_scope.
3030 * parser.c (cp_parser_class_head): Likewise.
3031 * pt.c (push_template_decl_real): Likewise.
3033 * decl2.c (import_export_decl): Use DECL_TEMPLOID_INSTANTIATION.
3034 * pt.c (unify): Use CP_INTEGRAL_TYPE_P.
3036 2013-03-31 Paolo Carlini <paolo.carlini@oracle.com>
3038 * decl2.c (collect_candidates_for_java_method_aliases): Use
3040 * name-lookup.c (pushtag_1) Use TYPE_FUNCTION_SCOPE_P.
3041 (pushdecl_maybe_friend_1): Use DECL_DECLARES_FUNCTION_P.
3042 * decl.c (duplicate_decls): Likewise.
3043 * parser.c (cp_parser_template_declaration_after_export): Likewise,
3044 also DECL_DECLARES_TYPE_P.
3045 * pt.c (instantiate_class_template_1): Likewise.
3046 * search.c (lookup_field_1): Use DECL_DECLARES_TYPE_P.
3047 (lookup_field_r): Likewise.
3048 (friend_accessible_p): Use DECL_DECLARES_FUNCTION_P.
3049 (lookup_fnfields_slot_nolazy): Likewise.
3050 * semantics.c (finish_member_declaration): Likewise.
3051 * typeck.c (convert_for_initialization): Use TYPE_REFFN_P.
3053 2013-03-29 Gabriel Dos Reis <gdr@integrable-solutions.net>
3055 * pt.c (template_parms_to_args): Fix typo in comment.
3057 2013-03-29 Paolo Carlini <paolo.carlini@oracle.com>
3059 * call.c (build_op_call_1): Use TYPE_PTRFN_P and TYPE_REFFN_P.
3061 2013-03-29 Paolo Carlini <paolo.carlini@oracle.com>
3063 * call.c (add_builtin_candidate): Use TYPE_PTR_P and VOID_TYPE_P.
3064 (build_op_call_1): Likewise.
3065 (build_over_call): Likewise.
3066 (compare_ics): Likewise.
3067 * class.c (build_base_path): Likewise.
3068 (resolve_address_of_overloaded_function): Likewise.
3069 * cp-tree.h: Likewise.
3070 * cvt.c (cp_convert_to_pointer): Likewise.
3071 (convert_to_reference): Likewise.
3072 (ocp_convert): Likewise.
3073 (convert_force): Likewise, tidy.
3074 * cxx-pretty-print.c (pp_cxx_postfix_expression): Likewise.
3075 (pp_cxx_ptr_operator): Likewise.
3076 * decl.c (duplicate_decls): Likewise.
3077 (start_decl): Likewise.
3078 (grok_op_properties): Likewise.
3079 (start_preparsed_function): Likewise.
3080 (store_parm_decls): Likewise.
3081 (finish_function): Likewise.
3082 * decl2.c (delete_sanity): Likewise.
3083 (acceptable_java_type): Likewise.
3084 (grokbitfield): Likewise.
3085 (cp_reconstruct_complex_type): Likewise.
3086 * error.c (dump_type_prefix): Likewise.
3087 (dump_expr): Likewise.
3088 * except.c (push_eh_cleanup): Likewise.
3089 (complete_ptr_ref_or_void_ptr_p): Likewise.
3090 (can_convert_eh): Likewise.
3091 * init.c (build_new_1): Likewise.
3092 (build_delete): Likewise.
3093 (build_vec_delete): Likewise.
3094 * mangle.c (write_type): Likewise.
3095 * parser.c (lookup_literal_operator): Likewise.
3096 * pt.c (convert_nontype_argument_function): Likewise.
3097 (convert_nontype_argument): Likewise.
3100 (dependent_type_p_r): Likewise.
3101 * rtti.c (build_headof): Likewise.
3102 (build_typeid): Likewise.
3103 (build_dynamic_cast_1): Likewise.
3104 (target_incomplete_p): Likewise.
3105 (typeinfo_in_lib_p): Likewise.
3106 * semantics.c (finish_omp_for): Likewise.
3107 (cxx_eval_call_expression): Likewise.
3108 (maybe_resolve_dummy): Likewise.
3109 * tree.c (build_target_expr): Likewise.
3110 (cp_build_qualified_type_real): Likewise.
3111 * typeck.c (composite_pointer_type_r): Likewise.
3112 (composite_pointer_type): Likewise.
3113 (comp_except_types): Likewise.
3114 (cxx_sizeof_nowarn): Likewise.
3115 (string_conv_p): Likewise.
3116 (cp_build_array_ref): Likewise.
3117 (cp_build_function_call_vec): Likewise, also use TYPE_PTRFN_P.
3118 (pointer_diff): Likewise.
3119 (cp_build_addr_expr_1): Likewise.
3120 (cp_build_unary_op): Likewise.
3121 (build_static_cast_1): Likewise.
3122 (cp_build_c_cast): Likewise.
3123 (comp_ptr_ttypes_real): Likewise.
3124 (ptr_reasonably_similar): Likewise.
3125 (comp_ptr_ttypes_const): Likewise.
3126 (casts_away_constness): Likewise.
3127 (check_literal_operator_args): Likewise.
3128 * typeck2.c (build_x_arrow): Likewise.
3129 (add_exception_specifier): Likewise.
3131 2013-03-29 Jason Merrill <jason@redhat.com>
3134 * cp-tree.h (AUTO_IS_DECLTYPE): New.
3135 * parser.c (cp_parser_decltype): Handle decltype(auto).
3136 (cp_parser_type_id_1): Allow auto without a late-specified
3138 (cp_parser_primary_expression): Use the return value of
3139 finish_parenthesized_expr.
3140 (cp_parser_transaction_expression): Likewise.
3141 * semantics.c (force_paren_expr): New.
3142 (finish_parenthesized_expr): Use it.
3143 * call.c (build_conditional_expr_1): Likewise.
3144 * pt.c (do_auto_deduction): Handle decltype(auto).
3145 (tsubst_copy): Handle PAREN_EXPR.
3146 (tsubst_copy_and_build): Likewise.
3147 * error.c (dump_expr): Handle PAREN_EXPR.
3148 * cxx-pretty-print.c (pp_cxx_expression): Likewise.
3149 * mangle.c (write_expression): Ignore PAREN_EXPR.
3151 * parser.c (cp_parser_decltype_expr): Split out...
3152 (cp_parser_decltype): ...from here.
3156 * pt.c (unify_pack_expansion): Fix indexing.
3158 2013-03-29 Gabriel Dos Reis <gdr@integrable-solutions.net>
3160 * call.c (build_java_interface_fn_ref): Likewise.
3161 (make_temporary_var_for_ref_to_temp): Likewise.
3162 * class.c (check_field_decls): Likewise.
3163 (layout_class_type): Likewise.
3164 (finish_struct_1): Likewise.
3165 (fixed_type_or_null): Likewise.
3166 (get_vtbl_decl_for_binfo): Likewise.
3167 * cp-gimplify.c (omp_var_to_track): Likewise.
3168 (cp_genericize_r): Likewise.
3169 * cp-objcp-common.c (cxx_warn_unused_global_decl): Likewise.
3170 * cp-tree.h (LANG_DECL_HAS_MIN): Likewise.
3171 (DECL_DISCRIMINATOR_P): Likewise.
3172 * decl.c (poplevel): Likewise.
3173 (decls_match): Likewise.
3174 (duplicate_decls): Likewise.
3175 (decl_jump_unsafe): Likewise.
3176 (start_decl): Likewise.
3177 (check_for_uninitialized_const_var): Likewise.
3178 (make_rtl_for_nonlocal_decl): Likewise.
3179 (cp_finish_decl): Likewise.
3180 (expand_static_init): Likewise.
3181 (local_variable_p): Likewise.
3182 (maybe_register_incomplete_var): Likewise.
3183 * decl2.c (grokfield): Likewise.
3184 (comdat_linkage): Likewise.
3185 (determine_visibility): Likewise.
3186 (import_export_decl): Likewise.
3187 (prune_vars_needing_no_initialization): Likewise.
3188 (decl_maybe_constant_var_p): Likewise.
3189 * error.c (dump_simple_decl): Likewise.
3190 (dump_template_decl): Likewise.
3191 (cp_printer): Likewise.
3192 * except.c (build_throw): Likewise.
3193 * init.c (build_vtbl_address): Likewise.
3194 (member_init_ok_or_else): Likewise.
3195 (build_aggr_init): Likewise.
3196 (expand_aggr_init_1): Likewise.
3197 (build_offset_ref): Likewise.
3198 (constant_value_1): Likewise.
3199 * mangle.c (write_mangled_name): Likewise.
3200 (write_prefix): Likewise.
3201 * name-lookup.c (supplement_binding_1): Likewise.
3202 (add_decl_to_level): Likewise.
3203 (pushdecl_maybe_friend_1): Likewise.
3204 (check_for_out_of_scope_variable): Likewise.
3205 (validate_nonmember_using_decl): Likewise.
3206 (lookup_name_innermost_nonclass_level_1): Likewise.
3207 (lookup_arg_dependent_1): Likewise.
3208 * parser.c (cp_parser_lambda_introducer): Likewise.
3209 (cp_parser_template_argument): Likewise.
3210 (cp_parser_single_declaration): Likewise.
3211 * pt.c (convert_nontype_argument): Likewise.
3212 (instantiate_class_template_1): Likewise.
3213 (tsubst_decl): Likewise.
3214 (tsubst_expr): Likewise.
3215 (do_decl_instantiation): Likewise.
3216 (do_type_instantiation): Likewise.
3217 (regenerate_decl_from_template): Likewise.
3218 (always_instantiate_p): Likewise.
3219 (instantiate_decl): Likewise.
3220 (type_dependent_expression_p): Likewise.
3221 (build_non_dependent_expr): Likewise.
3222 * repo.c (repo_emit_p): Likewise.
3223 * rtti.c (build_dynamic_cast_1): Likewise.
3224 * search.c (shared_member_p): Likewise.
3225 * semantics.c (outer_var_p): Likewise.
3226 (finish_id_expression): Likewise.
3227 (finish_omp_clauses): Likewise.
3228 (finish_decltype_type): Likewise.
3229 (ensure_literal_type_for_constexpr_object): Likewise.
3230 * tree.c (lvalue_kind): Likewise.
3231 (bot_replace): Likewise.
3232 (cp_tree_equal): Likewise.
3233 (handle_init_priority_attribute): Likewise.
3234 (decl_storage_duration): Likewise.
3235 * typeck.c (cxx_sizeof_expr): Likewise.
3236 (cxx_alignof_expr): Likewise.
3237 (decay_conversion): Likewise.
3238 (build_class_member_access_expr): Likewise.
3239 (cp_build_array_ref): Likewise.
3240 (cxx_mark_addressable): Likewise.
3241 (maybe_warn_about_returning_address_of_local): Likewise.
3242 (check_return_expr): Likewise.
3243 * typeck2.c (cxx_readonly_error): Likewise.
3244 (abstract_virtuals_error_sfinae): Likewise.
3245 (cxx_incomplete_type_diagnostic): Likewise.
3247 2013-03-28 Lawrence Crowl <crowl@google.com>
3250 (CXX_PARSER_H): Add header dependence.
3252 (extern debug (cp_binding_level &)): New.
3253 (extern debug (cp_binding_level *)): New.
3255 (debug (cp_binding_level &)): New.
3256 (debug (cp_binding_level *)): New.
3258 (debug (cp_parser &)): New.
3259 (debug (cp_parser *)): New.
3260 (debug (cp_token &)): New.
3261 (debug (cp_token *)): New.
3262 (debug (vec<cp_token, va_gc> &)): New.
3263 (debug (vec<cp_token, va_gc> *)): New.
3264 * parser.c: Add header dependence.
3265 (extern debug (cp_parser &)): New.
3266 (extern debug (cp_parser *)): New.
3267 (extern debug (cp_token &)): New.
3268 (extern debug (cp_token *)): New.
3269 (extern debug (vec<cp_token, va_gc> &)): New.
3270 (extern debug (vec<cp_token, va_gc> *)): New.
3272 2013-03-28 Jason Merrill <jason@redhat.com>
3276 * typeck2.c (abstract_virtuals_error_sfinae): Don't complete
3277 the type if tf_decltype is set.
3278 * pt.c (fn_type_unification): Add decltype_p parm.
3279 (get_bindings): Adjust.
3280 * cp-tree.h: Adjust.
3281 * class.c (resolve_address_of_overloaded_function): Adjust.
3282 * call.c (add_template_candidate_real, print_z_candidate): Adjust.
3285 * parser.c (cp_parser_sizeof_pack): Split out from...
3286 (cp_parser_sizeof_operand): ...here. Require (id).
3289 * semantics.c (finish_this_expr): 'this' is an rvalue.
3290 * typeck.c (cp_build_indirect_ref): Handle NOP_EXPR of 'this'.
3293 * semantics.c (finish_member_declaration): Don't push closure
3296 * name-lookup.c (pushdecl_maybe_friend_1): Use
3297 nonlambda_method_basetype and current_nonlambda_class_type.
3300 * semantics.c (potential_constant_expression_1) [NOP_EXPR]: Reject
3301 conversion from integer to pointer.
3302 (cxx_eval_constant_expression): Likewise.
3303 (cxx_eval_indirect_ref): Use the folded operand if we still think
3304 this might be constant.
3306 2013-03-28 Paolo Carlini <paolo.carlini@oracle.com>
3307 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
3310 * call.c (convert_like_real): Change series of two permerrors
3311 to permerror + inform (and likewise for two errors).
3312 (build_new_method_call_1): Likewise.
3313 * typeck.c (convert_for_initialization): Change additional
3314 warning or error to inform.
3316 2013-03-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
3318 * cp-tree.h (next_aggr_init_expr_arg): Remove static specifier.
3319 (first_aggr_init_expr): Likewise.
3320 (more_aggr_init_expr_args_p): Likewise.
3321 (type_of_this_parm): Likewise.
3322 (class_of_this_parm): Likewise.
3323 * name-lookup.h (get_global_value_if_present): Likewise.
3324 (is_typename_at_global_scope): Likewise.
3326 2013-03-28 Paolo Carlini <paolo.carlini@oracle.com>
3328 * call.c (joust): Don't call inform for a permerror returning false.
3329 * parser.c (cp_parser_check_class_key): Likewise.
3330 * pt.c (tsubst_copy_and_build): Likewise.
3332 2013-03-27 Jason Merrill <jason@redhat.com>
3335 * semantics.c (finish_qualified_id_expr): Return early
3338 2013-03-26 Gabriel Dos Reis <gdr@integrable-solutions.net>
3340 * call.c (build_new_method_call_1): Use INDIRECT_REF_P.
3341 * cvt.c (convert_to_void): Likewise.
3342 * error.c (dump_expr): Likewise.
3343 * mangle.c (write_expression): Likewise.
3344 * parser.c (cp_parser_template_argument): Likewise.
3345 * pt.c (convert_nontype_argument): Likewise.
3346 (tsubst_copy_and_build): Likewise.
3347 * rtti.c (build_typeid): Likewise.
3348 * semantics.c (finish_call_expr): Likewise.
3349 (finish_decltype_type): Likewise.
3350 (build_data_member_initialization): Likewise.
3351 * tree.c (is_dummy_object): Likewise.
3352 * typeck.c (decay_conversion): Likewise.
3353 (build_class_member_access_expr): Likewise.
3354 (cp_build_addr_expr_1): Likewise.
3355 (unary_complex_lvalue): Likewise.
3356 (check_return_expr): Likewise.
3357 * typeck2.c (cxx_readonly_error): Likewise.
3359 2013-03-26 Jason Merrill <jason@redhat.com>
3362 * typeck.c (invalid_nonstatic_memfn_p): Use get_first_fn. Take tree.
3363 * semantics.c (finish_decltype_type): Check it before type_unknown_p.
3364 * cp-tree.h: Adjust prototype.
3367 * typeck2.c (build_m_component_ref): Handle prvalue object.
3369 2013-03-26 Gabriel Dos Reis <gdr@integrable-solutions.net>
3371 * cp-gimplify.c (cp_genericize_r): Use VAR_OR_FUNCTION_DECL_P.
3372 * decl.c (duplicate_decls): Likewise.
3373 (cp_finish_decl): Likewise.
3374 (check_class_member_definition_namespace): Likewise.
3375 * decl2.c (grokfield): Likewise.
3376 (decl_needed_p): Likewise.
3377 (import_export_decl): Likewise.
3378 (mark_used): Likewise.
3379 * name-lookup.c (pushdecl_maybe_friend_1): Likewise.
3380 * pt.c (push_access_scope): Likewise.
3381 (instantiate_decl): Likewise.
3382 * ptree.c (cxx_print_decl): Likewise.
3383 * repo.c (repo_emit_p): Likewise.
3384 * semantics.c (note_decl_for_pch): Likewise.
3385 * tree.c (decl_linkage): Likewise.
3387 2013-03-26 Paolo Carlini <paolo.carlini@oracle.com>
3390 * decl.c (check_array_designated_initializer): Handle CONST_DECL
3393 2013-03-26 Paolo Carlini <paolo.carlini@oracle.com>
3395 * decl.c (grokfndecl): Handle separately <inline> and <constexpr>
3398 * decl.c (grokdeclarator): Declare typedef_p and use it everywhere.
3400 2013-03-25 Jason Merrill <jason@redhat.com>
3403 * semantics.c (maybe_resolve_dummy): Make sure that the enclosing
3404 class is derived from the type of the object.
3407 * semantics.c (lambda_expr_this_capture): Don't capture 'this' in
3408 unevaluated context.
3410 2013-03-25 Paolo Carlini <paolo.carlini@oracle.com>
3413 * decl.c (cp_finish_decl): Check DECL_LANG_SPECIFIC before
3414 DECL_TEMPLATE_INSTANTIATION.
3416 2013-03-22 Jason Merrill <jason@redhat.com>
3419 * pt.c (instantiation_dependent_r): Check DECL_INITIAL of VAR_DECL
3422 2013-03-21 Gabriel Dos Reis <gdr@integrable-solutions.net>
3424 * cp-tree.h (identifier_p): New.
3425 * call.c: Throughout, call identifier_p insstead of direct
3426 comparaison of TREE_CODE against IDENTIFIER_NODE.
3427 * decl.c: Likewisse.
3428 * decl2.c: Likewise.
3430 * mangle.c: Likewise.
3431 * name-lookup.c: Likewise.
3432 * parser.c: Likewise.
3434 * search.c: Likewise.
3435 * semantics.c: Likewise.
3437 * typeck.c: Likewise.
3438 * typeck2.c: Likewise.
3440 2013-03-21 Jakub Jelinek <jakub@redhat.com>
3443 * pt.c (convert_nontype_argument): Count werrorcount as warnings.
3444 * call.c (build_temp): Likewise.
3445 * method.c (synthesize_method): Likewise.
3446 * typeck.c (convert_for_initialization): Likewise.
3448 2013-03-21 Marc Glisse <marc.glisse@inria.fr>
3450 * call.c (build_conditional_expr_1): Fold VEC_COND_EXPR.
3452 2013-03-21 Richard Biener <rguenther@suse.de>
3454 * error.c (cp_printer): Use DECL_HAS_DEBUG_EXPR_P instead of
3455 DECL_DEBUG_EXPR_IS_FROM. Guard properly.
3457 2013-03-20 Jason Merrill <jason@redhat.com>
3460 * parser.c (cp_parser_late_return_type_opt): Save and restore
3461 current_class_ptr/ref.
3464 * expr.c (cplus_expand_constant): Do nothing if the class is
3466 * semantics.c (reduced_constant_expression_p): Allow PTRMEM_CST.
3467 * typeck2.c (store_init_value): Use reduced_constant_expression_p.
3468 * decl.c (maybe_register_incomplete_var): Handle PTRMEM_CST.
3469 (complete_vars): Likewise.
3471 * name-lookup.c (get_anonymous_namespace_name): Never use
3472 get_file_function_name.
3474 * pt.c (retrieve_specialization): Handle null tmpl argument.
3478 * pt.c (tsubst_decl): Check return value of register_specialization.
3479 * typeck2.c (abstract_virtuals_error_sfinae): Re-apply complete_type
3482 2013-03-17 Jason Merrill <jason@redhat.com>
3486 * parser.c (cp_parser_direct_declarator): Bail if we see a
3487 qualified-id not at namespace scope.
3491 * typeck2.c (abstract_virtuals_error_sfinae): Revert complete_type
3494 2013-03-16 Jason Merrill <jason@redhat.com>
3496 * decl.c (grokdeclarator): Assert that we won't see a pointer to
3500 * cp-tree.h (WILDCARD_TYPE_P): Split out from...
3501 (MAYBE_CLASS_TYPE_P): ...here.
3502 * semantics.c (lambda_capture_field_type): Only build a
3503 magic decltype for wildcard types.
3504 (lambda_proxy_type): Likewise.
3505 (finish_non_static_data_member): Get the quals from
3509 * parser.c (cp_parser_template_argument): Don't
3510 fold_non_dependent_expr.
3512 * parser.c (cp_parser_lambda_declarator_opt): Use
3513 cp_parser_trailing_type_id.
3516 * parser.c (cp_parser_template_id): Don't forget access checks.
3519 * pt.c (tsubst_qualified_id): Use current_nonlambda_class_type.
3523 * name-lookup.h (tag_scope): Add ts_lambda.
3524 * semantics.c (begin_lambda_type): Use it.
3525 * decl.c (xref_tag_1): Set CLASSTYPE_LAMBDA_EXPR.
3526 * pt.c (check_default_tmpl_args): Ignore lambdas.
3527 (push_template_decl_real): Handle lambdas.
3528 * tree.c (no_linkage_check): Adjust lambda check.
3531 * tree.c (strip_typedefs_expr): Complain about lambda, don't abort.
3534 * parser.c (cp_parser_direct_declarator): Fix late return
3535 for out-of-class defn of member function.
3538 * semantics.c (maybe_add_lambda_conv_op): Clear DECL_NAME of copied
3539 parms to avoid duplicate -Wshadow warnings.
3541 * search.c (lookup_base): Handle NULL_TREE.
3544 * semantics.c (potential_constant_expression_1): Use of 'this' in
3545 a non-constexpr function makes the expression not potentially
3550 * cp-tree.h (tsubst_flags): Add tf_decltype.
3551 * call.c (build_cxx_call): Don't build a temporary if it's set.
3552 (build_over_call): Make sure it's only passed to build_cxx_call.
3553 * parser.c (cp_parser_primary_expression): Add decltype_p parm.
3554 (cp_parser_unary_expression): Likewise.
3555 (cp_parser_cast_expression): Likewise.
3556 (cp_parser_binary_expression): Likewise.
3557 (cp_parser_assignment_expression): Likewise.
3558 (cp_parser_postfix_expression): Likewise. Pass tf_decltype.
3559 (cp_parser_expression): Add decltype_p. Force a
3560 temporary for a call on the LHS of a comma.
3561 (cp_parser_decltype): Pass true to decltype_p parms.
3562 * pt.c (tsubst) [DECLTYPE_TYPE]: Pass tf_decltype.
3563 (tsubst_copy_and_build): Pass tf_decltype down only for
3564 CALL_EXPR and the RHS of COMPOUND_EXPR.
3565 * tree.c (build_cplus_new): Call complete_type_or_maybe_complain.
3567 * cp-tree.h (abstract_class_use): New enum.
3568 * typeck2.c (pending_abstract_type): Add use field.
3569 (abstract_virtuals_error_sfinae): Add overloads taking
3570 abstract_class_use instead of tree.
3571 * typeck.c (build_static_cast_1): Call it.
3572 * except.c (is_admissible_throw_operand_or_catch_parameter): Call it.
3573 * pt.c: Adjust calls.
3574 * decl.c (cp_finish_decl): Don't handle functions specially.
3575 (grokdeclarator): Always check return type.
3576 * init.c (build_new_1): Adjust call.
3580 * pt.c (tsubst) [ARRAY_TYPE]: Use abstract_virtuals_error_sfinae.
3581 * typeck2.c (abstract_virtuals_error_sfinae): Call complete_type.
3584 * pt.c (tsubst_function_type): Call abstract_virtuals_error_sfinae.
3585 (tsubst_arg_types): Likewise.
3589 * call.c (convert_like_real): Check for explicit constructors
3590 even for value-initialization.
3593 * pt.c (convert_nontype_argument): Handle invalid pointer.
3595 * parser.c (cp_parser_lambda_expression): Use nreverse.
3599 * pt.c (instantiate_class_template_1): Instantiate lambda capture
3601 (tsubst_copy_and_build): Not here.
3604 * method.c (walk_field_subobs): Disallow copy of rvalue ref.
3607 * parser.c (parsing_nsdmi): New.
3608 * semantics.c (outer_automatic_var_p): Check it.
3609 (finish_id_expression): Likewise.
3610 * cp-tree.h: Declare it.
3613 * error.c (dump_expr) [SIZEOF_EXPR]: Print sizeof... properly.
3615 * parser.c (lookup_literal_operator): Correct parm/arg naming
3619 * pt.c (fold_non_dependent_expr_sfinae): Check
3620 instantiation_dependent_expression_p.
3623 * class.c (resolve_address_of_overloaded_function): Accept a
3624 reference to function for target_type.
3625 (instantiate_type): Likewise.
3626 * pt.c (convert_nontype_argument): Pass it to
3627 convert_nontype_argument_function.
3629 2013-03-16 Jakub Jelinek <jakub@redhat.com>
3631 * tree.c (cp_tree_equal): Fix a pasto.
3634 * typeck.c (cp_build_binary_op): When calling warn_for_div_by_zero,
3635 pass op1 through maybe_constant_value first.
3637 2013-03-16 Paolo Carlini <paolo.carlini@oracle.com>
3640 * semantics.c (cxx_eval_array_reference): Check for negative index.
3642 2013-03-14 Jason Merrill <jason@redhat.com>
3645 * decl.c (local_variable_p_walkfn): Check DECL_ARTIFICIAL again.
3648 * decl.c (register_dtor_fn): Pass null to __cxa_thread_atexit
3649 dso_handle parm on targets without __cxa_atexit.
3651 2013-03-11 Jason Merrill <jason@redhat.com>
3654 * typeck.c (check_return_expr): Disallow returning init list here.
3655 * semantics.c (apply_deduced_return_type): Not here.
3657 2013-03-08 Paolo Carlini <paolo.carlini@oracle.com>
3660 * cxx-pretty-print.c (pp_cxx_expression): Handle LAMBDA_EXPR.
3661 * error.c (dump_expr): Likewise.
3663 2013-03-08 Jason Merrill <jason@redhat.com>
3666 * class.c (modify_all_vtables): Mangle the vtable name before
3669 * semantics.c (lambda_expr_this_capture): In unevaluated context,
3670 just return the nearest 'this'.
3675 * tree.c (maybe_dummy_object): Don't capture 'this'.
3676 * semantics.c (maybe_resolve_dummy): New.
3677 (finish_non_static_data_member): Use it.
3678 (finish_qualified_id_expr): Don't test is_dummy_object.
3679 * cp-tree.h: Declare maybe_resolve_dummy.
3680 * call.c (build_new_method_call_1): Use it.
3683 * semantics.c (apply_deduced_return_type): Don't allow returning
3684 std::initializer_list.
3686 2013-03-06 Paolo Carlini <paolo.carlini@oracle.com>
3689 * parser.c (cp_parser_elaborated_type_specifier): Don't call
3690 check_elaborated_type_specifier when TREE_CODE (decl) != TYPE_DECL.
3691 * decl.c (check_elaborated_type_specifier): Tidy.
3693 2013-03-06 Jakub Jelinek <jakub@redhat.com>
3696 * tree.c (strip_typedefs): Don't copy args if they are NULL.
3698 2013-03-05 Jakub Jelinek <jakub@redhat.com>
3700 * parser.c (cp_parser_braced_list): For {} initialize
3701 *non_constant_p to false.
3703 2013-03-04 Jason Merrill <jason@redhat.com>
3707 * semantics.c (lambda_expr_this_capture): Handle NSDMI
3708 and non-class scopes.
3710 2013-03-01 Paolo Carlini <paolo.carlini@oracle.com>
3712 * decl.c (grokdeclarator): Remove dead code.
3714 2013-02-28 Jason Merrill <jason@redhat.com>
3717 * semantics.c (potential_constant_expression_1): Use
3718 cxx_eval_outermost_constant_expr rather than maybe_constant_value.
3721 * call.c (build_over_call): Avoid virtual lookup in a template.
3723 2013-02-27 Jason Merrill <jason@redhat.com>
3727 * name-lookup.c (do_class_using_decl): Use ctor_identifier instead
3728 of the base name for inheriting ctors.
3729 (push_class_level_binding_1): Remove inheriting ctor handling.
3730 * pt.c (tsubst_decl) [USING_DECL]: Likewise.
3731 * class.c (add_implicitly_declared_members): Adjust.
3733 2013-02-26 David Binderman <dcb314@hotmail.com>
3736 * decl.c (grokdeclarator): Tidy publicp assignment.
3738 2013-02-25 Aldy Hernandez <aldyh@redhat.com>
3741 * semantics.c (begin_transaction_stmt): Set TREE_SIDE_EFFECTS.
3742 (build_transaction_expr): Same.
3744 2013-02-25 Jason Merrill <jason@redhat.com>
3747 * pt.c (fn_type_unification): Wait to call push_tinst_level until
3748 we know what args we're looking at.
3751 * semantics.c (potential_constant_expression_1): In C++98, a cast
3752 to non-integral type can't be a constant expression.
3754 2013-02-24 Jakub Jelinek <jakub@redhat.com>
3757 * init.c (build_zero_init_1): Use RECORD_OR_UNION_CODE_P instead
3760 2013-02-22 Jason Merrill <jason@redhat.com>
3763 * pt.c (push_template_decl_real): Set DECL_INTERFACE_KNOWN
3764 if we got the wrong number of template parms.
3767 * pt.c (fn_type_unification): Use explicit args in template
3768 instantiation context.
3771 * call.c (can_convert_arg): Discard access checks.
3774 * tree.c (strip_typedefs): Strip typedefs from TYPENAME_TYPE template
3777 2013-02-20 Paolo Carlini <paolo.carlini@oracle.com>
3780 * tree.c (maybe_warn_zero_as_null_pointer_constant): Add.
3781 * cvt.c (ocp_convert): Use the latter.
3782 (cp_convert_to_pointer): Likewise.
3783 * decl.c (check_default_argument): Likewise.
3784 * typeck.c (cp_build_binary_op): Likewise.
3785 * cp-tree.h (maybe_warn_zero_as_null_pointer_constant): Declare.
3787 2013-02-15 Jonathan Wakely <jwakely.gcc@gmail.com>
3788 Paolo Carlini <paolo.carlini@oracle.com>
3791 * decl2.c (grokbitfield): Allow scoped enumeration types.
3793 2013-02-15 Jason Merrill <jason@redhat.com>
3796 * semantics.c (finish_id_expression): Also return the identifier
3797 for an outer local static.
3800 * class.c (check_bases_and_members): Deduce noexcept after
3804 * semantics.c (finish_id_expression): In a template, return
3805 the identifier for a constant variable.
3807 2013-02-14 Jason Merrill <jason@redhat.com>
3810 * semantics.c (build_anon_member_initialization): New.
3811 (build_data_member_initialization): Use it.
3814 * decl.c (cp_finish_decl): Force instantiation of an
3815 auto static data member.
3818 * pt.c (unify): A pack expansion that is not the last template
3819 argument makes the entire template argument list non-deduced.
3822 * name-lookup.c (do_class_using_decl): Handle typedefs with
3823 inheriting constructors.
3824 (push_class_level_binding_1): Allow inheriting from template
3825 template parameter, too.
3826 * pt.c (tsubst_decl) [USING_DECL]: Likewise.
3829 * pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Fix handling of
3830 default argument scope.
3831 * mangle.c (write_name): Likewise.
3834 * error.c (find_typenames_r): Don't walk into a pack expansion.
3836 2013-02-13 Jason Merrill <jason@redhat.com>
3839 * parser.c (cp_parser_member_declaration): Check the declarator
3840 form when detecting a function declaration via typedef.
3843 * pt.c (maybe_process_partial_specialization): A lambda
3844 isn't what's being specialized.
3847 * semantics.c (maybe_add_lambda_conv_op): Mark static thunk
3851 * semantics.c (cxx_bind_parameters_in_call): Undo DECL_BY_REFERENCE.
3854 * semantics.c (cxx_fold_indirect_ref): Handle empty bases at
3855 non-zero offsets, too.
3858 * decl.c (build_enumerator): Always convert the value to a
3859 fixed underlying type.
3862 * pt.c (tsubst_copy_and_build): Don't forget any new
3863 captures that arose from use of dependent names.
3865 2013-02-13 Jakub Jelinek <jakub@redhat.com>
3868 * semantics.c (finish_asm_stmt): If input constraints allow
3869 neither register nor memory, try maybe_constant_value to get
3870 a constant if possible.
3872 2013-02-12 Jason Merrill <jason@redhat.com>
3875 * method.c (add_one_base_init): Handle base constructor
3876 taking rvalue reference parm.
3879 * semantics.c (sort_constexpr_mem_initializers): Handle
3882 2013-02-09 Jason Merrill <jason@redhat.com>
3885 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Call
3886 maybe_instantiate_noexcept.
3889 * pt.c (eq_specializations): Set comparing_specializations.
3890 * tree.c (cp_tree_equal): Check it.
3891 * cp-tree.h: Declare it.
3893 * decl.c (decls_match): Check versions later.
3896 * pt.c (build_non_dependent_expr): Don't try to fold
3897 instantiation-dependent expressions.
3898 (instantiation_dependent_r) [TRAIT_EXPR]: Split out.
3899 [BIND_EXPR]: Treat as dependent.
3901 2013-02-07 Jakub Jelinek <jakub@redhat.com>
3904 * init.c (build_vec_init): Don't append NULL values into new_vec.
3905 (build_zero_init_1): Don't push anything into v if recursive call
3907 (build_value_init_noctor): Don't push anything into v if
3908 build_value_init call returned NULL_TREE.
3911 * parser.c (cp_parser_token_starts_cast_expression): Renamed to...
3912 (cp_parser_tokens_start_cast_expression): ... this. Change parameter
3913 to cp_parser *, call cp_lexer_peek_token first. For CPP_OPEN_PAREN,
3914 return true only if 2nd token isn't CPP_CLOSE_PAREN.
3915 (cp_parser_cast_expression): Adjust caller.
3918 * decl.c (push_local_name): Look at DECL_DISCRIMINATOR (t)
3919 only if DECL_DISCRIMINATOR_SET_P (t) rather than just
3920 DECL_LANG_SPECIFIC (t).
3922 2013-02-07 Jason Merrill <jason@redhat.com>
3925 * method.c (do_build_copy_constructor): Don't bother turning
3926 scalars from lvalues to xvalues.
3927 (do_build_copy_assign): Likewise.
3929 2013-02-06 Jason Merrill <jason@redhat.com>
3931 * parser.c (cp_parser_enum_specifier): Check for error_mark_node.
3933 2013-02-05 Jason Merrill <jason@redhat.com>
3936 * tree.c (lvalue_kind) [INDIRECT_REF]: Don't check for
3940 * decl.c (start_preparsed_function): Update restype if we change
3944 * pt.c (fn_type_unification): Discard any access checks from
3945 substituting explicit args.
3947 2013-01-31 Jason Merrill <jason@redhat.com>
3951 * typeck.c (get_member_function_from_ptrfunc): Fix
3952 ptrmemfunc_vbit_in_delta case.
3954 2013-01-29 Jason Merrill <jason@redhat.com>
3957 * class.c (build_ctor_vtbl_group): Give construction vtables
3960 2013-01-25 Jason Merrill <jason@redhat.com>
3963 * pt.c (convert_nontype_argument_function): Handle invalid input.
3964 (convert_nontype_argument): Likewise.
3967 * typeck.c (get_member_function_from_ptrfunc): Optimize if the
3968 dynamic type has no virtual functions.
3970 2013-01-22 Paolo Carlini <paolo.carlini@oracle.com>
3973 * decl.c (check_initializer): Use TARGET_EXPR_DIRECT_INIT_P only
3974 on TARGET_EXPR nodes.
3976 2013-01-22 Jason Merrill <jason@redhat.com>
3979 * pt.c (maybe_instantiate_noexcept): Don't defer access checks.
3981 2013-01-22 Dodji Seketeli <dodji@redhat.com>
3984 * pt.c (argument_pack_element_is_expansion_p)
3985 (make_argument_pack_select, use_pack_expansion_extra_args_p)
3986 (gen_elem_of_pack_expansion_instantiation): New static functions.
3987 (tsubst): When looking through an ARGUMENT_PACK_SELECT tree node,
3988 look through the possibly resulting pack expansion as well.
3989 (tsubst_pack_expansion): Use use_pack_expansion_extra_p to
3990 generalize when to use the PACK_EXPANSION_EXTRA_ARGS mechanism.
3991 Use gen_elem_of_pack_expansion_instantiation to build the
3992 instantiation piece-wise. Don't use arg_from_parm_pack_p anymore,
3993 as gen_elem_of_pack_expansion_instantiation and the change in
3994 tsubst above generalize this particular case.
3995 (arg_from_parm_pack_p): Remove this for it's not used by
3996 tsubst_pack_expansion anymore.
3998 2013-01-21 Jason Merrill <jason@redhat.com>
4001 * tree.c (strip_typedefs_expr) [TREE_VEC]: Preserve non-default
4002 template args count.
4004 2013-01-18 Jason Merrill <jason@redhat.com>
4007 * decl2.c (get_local_tls_init_fn): New.
4008 (get_tls_init_fn): Handle flag_extern_tls_init. Don't bother
4009 with aliases for internal variables. Don't use weakrefs if
4010 the variable needs destruction.
4011 (generate_tls_wrapper): Mark the wrapper as const if no
4012 initialization is needed.
4013 (handle_tls_init): Don't require aliases.
4015 2013-01-15 Dodji Seketeli <dodji@redhat.com>
4018 * pt.c (coerce_innermost_template_parms): New static function.
4019 (instantiate_alias_template): Use it here.
4021 2013-01-09 Jason Merrill <jason@redhat.com>
4024 * rtti.c (build_typeid, get_typeid): Add complain parm.
4025 (get_tinfo_decl_dynamic): Likewise.
4026 * cp-tree.h, parser.c, pt.c: Adjust.
4029 * decl.c (cp_finish_decl): Clear TREE_READONLY if the variable
4032 2013-01-09 Jakub Jelinek <jakub@redhat.com>
4035 * typeck.c (cp_build_binary_op): For LSHIFT_EXPR and RSHIFT_EXPR,
4036 call maybe_constant_value for the negative or too big shift
4039 2013-01-09 Paolo Carlini <paolo.carlini@oracle.com>
4042 * decl2.c (var_needs_tls_wrapper): Return false when error_operand_p
4043 of the argument is true.
4045 2013-01-08 Joel Brobecker <brobecker@adacore.com>
4047 * parser.c (cp_parser_initializer_list): Move declaration
4048 of variable non_const to start of lexical block.
4050 2013-01-07 Jason Merrill <jason@redhat.com>
4053 * tree.c (build_aggr_init_expr): Do nothing in a template.
4054 * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Strip an ADDR_EXPR off
4055 a FUNCTION_DECL before tsubsting.
4057 2013-01-04 Dodji Seketeli <dodji@redhat.com>
4060 * pt.c (check_instantiated_arg): Allow type template arguments.
4062 2013-01-04 Jason Merrill <jason@redhat.com>
4065 * decl.c (reset_type_linkage, bt_reset_linkage): New.
4066 (grokdeclarator): Use reset_type_linkage.
4067 * name-lookup.c (binding_table_foreach): Handle null table.
4068 * tree.c (decl_anon_ns_mem_p): Check TYPE_MAIN_DECL, not TYPE_NAME.
4070 2013-01-04 Paolo Carlini <paolo.carlini@oracle.com>
4072 PR c++/54526 (again)
4073 * parser.c (cp_parser_template_id): Revert core of previous change
4074 (keep adjusted inform message).
4076 2013-01-03 Jason Merrill <jason@redhat.com>
4080 * pt.c (tsubst_copy_and_build) [TARGET_EXPR]: Don't touch
4084 * semantics.c (trait_expr_value): Call maybe_instantiate_noexcept.
4087 * semantics.c (build_data_member_initialization): Handle DECL_EXPR.
4090 * call.c (type_has_extended_temps): New.
4091 * cp-tree.h: Declare it.
4092 * decl.c (check_initializer): Use build_aggr_init for arrays
4094 * init.c (build_vec_init): Avoid mixed signed/unsigned arithmetic.
4096 2013-01-02 Jason Merrill <jason@redhat.com>
4099 * call.c (build_new_method_call_1): Don't use build_value_init for
4100 user-provided default constructors.
4102 * decl.c (check_default_argument): Use LOOKUP_IMPLICIT.
4106 * tree.c (build_cplus_array_type): Copy layout information
4107 to main variant if necessary.
4109 Copyright (C) 2013 Free Software Foundation, Inc.
4111 Copying and distribution of this file, with or without modification,
4112 are permitted in any medium without royalty provided the copyright
4113 notice and this notice are preserved.