Commit Graph

148657 Commits

Author SHA1 Message Date
Matthew Wahab
69ba69c9ec [ARM] Fix new constraints and attributes of SI/HI data movement patterns
* config/arm/arm.md (*arm_movsi_insn): Replace "t2" arch attribute
	with "v6t2".  Move "arch" attribute above "pool_range".
	* config/arm/vfp.md (*arm_movhi_vfp): Replace "t2" arch attribute
	with "v6t2".
	(*thumb2_movhi_vfp): Likewise.
	(*arm_movhi_fp16): Likewise.
	(*thumb2_movhi_fp16): Likewise.
	(*arm_movsi_vfp): Remove "arch" attribute.
	(*thumb2_movsi_vfp): Likewise.

From-SVN: r240622
2016-09-29 13:50:55 +00:00
Marek Polacek
4d258d094a * g++.dg/cpp0x/fallthrough2.C: Use the c++14_down target.
From-SVN: r240621
2016-09-29 13:27:48 +00:00
Jonathan Wakely
998e01a6d5 Define C++17 std::hypot without _GLIBCXX_USE_C99_MATH_TR1
* include/c_global/cmath (hypot, __hypot3): Move C++17 overloads
	outside _GLIBCXX_USE_C99_MATH_TR1 condition.

From-SVN: r240620
2016-09-29 14:25:48 +01:00
Marek Polacek
a9087411ad fallthrough2.C: Only expect the warning in C++11 and C++14.
* g++.dg/cpp0x/fallthrough2.C: Only expect the warning in C++11 and
	C++14.

From-SVN: r240619
2016-09-29 13:15:21 +00:00
Martin Liska
fa0a064ae8 objc: update documetation and add test-case of
* doc/extend.texi: Remove limitation of Objective C for
	__attribute__((constructor)) and __attribute__((destructor)).
	* objc/execute/construct1.m: New test.

From-SVN: r240618
2016-09-29 12:58:28 +00:00
Richard Biener
0ce1ecc7be re PR bootstrap/77768 (LTO/PGO -O3 bootstrap broken: tree-vrp.c:11053:0: internal compiler error: Segmentation fault)
2016-09-29  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/77768
	* tree-ssa-pre.c (eliminate_dom_walker::before_dom_children):
	Handle stores to readonly memory when removing redundant stores.

	* gcc.dg/torture/pr77768.c: New testcase.

From-SVN: r240617
2016-09-29 12:31:02 +00:00
Richard Biener
da186c1f43 re PR middle-end/77407 (Optimize integer i / abs (i) into the sign of i)
2016-09-29  Richard Biener  <rguenther@suse.de>

	PR middle-end/77407
	* match.pd: Add X / abs (X) -> X < 0 ? -1 : 1 and
	X / -X -> -1 simplifications.

	* gcc.dg/pr77407.c: New testcase.

From-SVN: r240616
2016-09-29 12:28:19 +00:00
Richard Biener
d657e99522 re PR middle-end/55152 (MAX_EXPR(a,-a) is really ABS_EXPR(a))
2016-09-29  Richard Biener  <rguenther@suse.de>

	PR middle-end/55152
	* match.pd: Add max(a,-a) -> abs(a) pattern.
	* tree-ssa-phiopt.c (minmax_replacement): Disable for
	HONOR_SIGNED_ZEROS types.

	* gcc.dg/pr55152.c: New testcase.
	* gcc.dg/tree-ssa/phi-opt-5.c: Adjust.

From-SVN: r240615
2016-09-29 12:27:19 +00:00
James Greenhalgh
75304c8793 [Patch] Remove all uses of TARGET_FLT_EVAL_METHOD_NON_DEFAULT and poison it
I'm going to hookize TARGET_FLT_EVAL_METHOD, so the current definition
of TARGET_FLT_EVAL_METHOD_NON_DEFAULT will stop working.

The relaxation enabled by TARGET_FLT_METHOD_NON_DEFAULT isn't portable,
and keeping it in place is tricky, so this patch removes it, and poisons
TARGET_FLT_EVAL_METHOD_NON_DEFAULT in system.h to prevent future use.

gcc/

	* defaults.h (TARGET_FLT_EVAL_METHOD_NON_DEFAULT): Remove.
	* system.h (TARGET_FLT_EVAL_METHOD_NON_DEFAULT): Poison.

gcc/c-family/

	* c-opts.c (c_common_post_options): Remove special case for
	TARGET_FLT_EVAL_METHOD_NON_DEFAULT with -fexcess-precision=standard
	in C++.

gcc/java/

	* lang.c (java_post_options): Remove special case for
	TARGET_FLT_EVAL_METHOD_NON_DEFAULT with -fexcess-precision=standard.

gcc/fortran/

	* options.c (gfc_post_options): Remove special case for
	TARGET_FLT_EVAL_METHOD_NON_DEFAULT with -fexcess-precision=standard.

gcc/ada/

	* gcc-interface/misc.c (gnat_post_options): Remove special case for
	TARGET_FLT_EVAL_METHOD_NON_DEFAULT with -fexcess-precision=standard.

From-SVN: r240614
2016-09-29 08:41:34 +00:00
Rainer Orth
cadf629619 Fix 64-bit gcc.dg/profile-update-warning.c on 32-bit-default x86
* gcc.dg/profile-update-warning.c: Restrict to ia32.
	(dg-options): Remove -m32.

From-SVN: r240613
2016-09-29 08:39:04 +00:00
Richard Biener
4d6484dd58 tree-vrp.c (set_defs_to_varying): New helper avoiding writing to vr_const_varying.
2016-09-29  Richard Biener  <rguenther@suse.de>

	* tree-vrp.c (set_defs_to_varying): New helper avoiding
	writing to vr_const_varying.
	(vrp_initialize): Call it.
	(vrp_visit_stmt): Likewise.
	(evrp_dom_walker::before_dom_children): Likewise.

From-SVN: r240612
2016-09-29 07:20:13 +00:00
Richard Biener
ea60dd34cd tree-vect-stmts.c (vectorizable_load): Avoid emitting vector constructors with vector elements.
2016-09-29  Richard Biener  <rguenther@suse.de>

	* tree-vect-stmts.c (vectorizable_load): Avoid emitting vector
	constructors with vector elements.

From-SVN: r240611
2016-09-29 07:16:10 +00:00
Richard Biener
ca0e1607e9 re PR bootstrap/77768 (LTO/PGO -O3 bootstrap broken: tree-vrp.c:11053:0: internal compiler error: Segmentation fault)
2016-09-29  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/77768
	* tree-ssa-sccvn.c (visit_reference_op_store): Properly deal
	with stores to a place we know has a constant value.

From-SVN: r240610
2016-09-29 07:15:13 +00:00
Ian Lance Taylor
6748787813 runtime: copy runtime.go and runtime1.go from Go 1.7
Also copy over cputicks.go, env_posix.go, vdso_none.go, stubs2.go, and a
    part of os_linux.go.  Remove the corresponding functions from the C code
    in libgo/go/runtime.  Add some transitional support functions to
    stubs.go.  This converts several minor functions from C to Go.
    
    Reviewed-on: https://go-review.googlesource.com/29962

From-SVN: r240609
2016-09-29 00:56:44 +00:00
GCC Administrator
83194649d2 Daily bump.
From-SVN: r240607
2016-09-29 00:16:15 +00:00
Alan Modra
6d49b790fd Disable .gnu.attributes tags in compatibility-ldbl.o
compatibility-ldbl.o is compiled with -mlong-double-64.  When
long double .gnu.attributes tags are checked by the linker, it
complains about the mismatch between this file and others in
libstdc++.

	* configure.ac (LONG_DOUBLE_COMPAT_FLAGS): New ACSUBST.
	* src/Makefile.am (compatibility-ldbl.o, compatibility-ldbl.lo):
	Use LONG_DOUBLE_COMPAT_FLAGS.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* doc/Makefile.in: Regenerate.
	* include/Makefile.in: Regenerate.
	* libsupc++/Makefile.in: Regenerate.
	* po/Makefile.in: Regenerate.
	* python/Makefile.in: Regenerate.
	* src/Makefile.in: Regenerate.
	* src/c++11/Makefile.in: Regenerate.
	* src/c++98/Makefile.in: Regenerate.
	* src/filesystem/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.

From-SVN: r240602
2016-09-29 07:33:17 +09:30
Alan Modra
e9dda04f07 [RS6000] .gnu.attributes Tag_GNU_Power_ABI_FP
Extend this attribute to cover long double ABIs, for 64-bit too.

This patch also corrects an error that crept in to code setting
rs6000_passes_float.  See the added comment.  Passing IEEE128 values
in vsx regs ought to set both Tag_GNU_Power_ABI_FP and
Tag_GNU_Power_ABI_Vector.  Also adds a new option, default on, that
disables output of .gnu_attribute assembly directives.

	* config/rs6000/sysv4.opt (mgnu-attribute): New option.
	* doc/invoke.texi: Document it.
	* config/rs6000/rs6000.c (HAVE_LD_PPC_GNU_ATTR_LONG_DOUBLE): Define.
	(rs6000_passes_float): Comment.
	(rs6000_passes_long_double): New static var.
	(call_ABI_of_interest): Return false unless rs6000_gnu_attr is set.
	(init_cumulative_args): Set up to emit fp .gnu_attribute for
	ELF 64-bit ABIs as well as 32-bit ELF.  Correct rs6000_passes_float
	to include fp values returned in vectors.
	Set rs6000_passes_long_double.
	(rs6000_function_arg_advance_1): Likewise for function args.
	(rs6000_elf_file_end): Emit fp .gnu_attribute for ELF 64-bit ABIs,
	and SPE.  Emit long double tag value too.
	(rs6000_opt_vars): Add gnu-attr.
	* configure.ac (HAVE_LD_PPC_GNU_ATTR_LONG_DOUBLE): New ppc32 test.
	* configure: Regenerate.
	* config.in: Regenerate.

From-SVN: r240601
2016-09-29 07:31:48 +09:30
Jakub Jelinek
91eaca5e32 gimple-ssa-sprintf.c (pass_sprintf_length::gate): Use x > 0 instead of 0 < x.
* gimple-ssa-sprintf.c (pass_sprintf_length::gate): Use x > 0 instead
	of 0 < x.
	(format_floating, format_string, format_directive,
	get_destination_size, pass_sprintf_length::handle_gimple_call):
	Likewise.

From-SVN: r240600
2016-09-28 23:52:53 +02:00
Uros Bizjak
12a813c16f re PR target/77756 (__get_cpuid() returns wrong values for level 7 (extended features))
PR target/77756
	* config/i386/cpuid.h (__get_cpuid): Handle CPUID level >= 7.

testsuite/ChangeLog:

	PR target/77756
	* gcc.target/i386/pr77756.c: New test.

From-SVN: r240597
2016-09-28 23:29:47 +02:00
Martin Sebor
88000fd1dc PR middle-end/77721 - -Wformat-length not uses arg range for converted vars
gcc/testsuite/ChangeLog:
	PR middle-end/77721
	* gcc.dg/tree-ssa/builtin-sprintf-warn-6.c: New test.

From-SVN: r240595
2016-09-28 13:51:08 -06:00
Jakub Jelinek
5fe39ec007 gimple-ssa-sprintf.c: Fix comment formatting.
* gimple-ssa-sprintf.c: Fix comment formatting.
	(format_integer): Use is_gimple_assign.
	(pass_sprintf_length::handle_gimple_call): Use gimple_call_builtin_p
	and gimple_call_fndecl.  Reorder case BUILT_IN_SPRINTF_CHK.  Fix up
	BUILT_IN_SNPRINTF_CHK comment.  Replace "to to" with "to" in comment.
	(pass_sprintf_length::execute): Use is_gimple_call.

From-SVN: r240594
2016-09-28 21:47:04 +02:00
Jerry DeLisle
0c1729748b re PR fortran/77707 (formatted direct access: nextrec off by one)
2016-09-28  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/77707
	* gfortran.dg/inquire_17.f90: New test.

From-SVN: r240593
2016-09-28 19:43:03 +00:00
Jerry DeLisle
b89f743da8 re PR fortran/77707 (formatted direct access: nextrec off by one)
2016-09-28  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/77707
	io/transfer.c (next_record): Flush before calculating next_record.
	Correctly calculate.

From-SVN: r240592
2016-09-28 19:38:03 +00:00
Jakub Jelinek
4b3906980a re PR c++/77467 (Segmentation fault with switch statement in constexpr function)
PR c++/77467
	* constexpr.c (enum constexpr_switch_state): New.
	(struct constexpr_ctx): Add css_state field.
	(label_matches): Add CTX and STMT arguments, remove I and
	DEFAULT_LABEL.  For CASE_LABEL_EXPR assert ctx->css_state != NULL,
	handle default labels according to css_state.
	(cxx_eval_statement_list): Remove statement skipping, label_matches
	and default_label handling code.
	(cxx_eval_loop_expr): Exit after first iteration even if
	switches (jump_target).
	(cxx_eval_switch_expr): Set up css_state field in ctx, if default
	label has been seen in the body, but no cases matched, evaluate
	the body second time.
	(cxx_eval_constant_expression): Handle stmt skipping and label_matches
	here.  Handle PREDICT_EXPR.  For MODIFY_EXPR or INIT_EXPR, assert
	statement is not skipped.  For COND_EXPR during skipping, don't
	evaluate condition, just the then block and if still skipping at the
	end also the else block.
	(cxx_eval_outermost_constant_expr): Adjust constexpr_ctx initializer.
	(is_sub_constant_expr): Likewise.

	* g++.dg/cpp1y/constexpr-77467.C: New test.

From-SVN: r240591
2016-09-28 21:21:47 +02:00
Uros Bizjak
e0ab375340 cpuinfo.c (__get_cpuid_output): Remove.
* config/i386/cpuinfo.c (__get_cpuid_output): Remove.
	(__cpu_indicator_init): Call __get_cpuid, not __get_cpuid_output.

From-SVN: r240590
2016-09-28 20:22:16 +02:00
Jonathan Wakely
b236debd3b * include/std/chrono (system_clock): Fix typo in comment.
From-SVN: r240589
2016-09-28 19:04:23 +01:00
Ian Lance Taylor
58920998e3 libgo: fix for runtime/check failure with "-O0 -g"
Tweak the makefile rules for the runtime/check test to
    insure that the runtime package is compiled with
    "-fgo-compiling-runtime". This resolves a test failure
    (unsat on runtime.getcallerpc) when in a build directory where the
    compiler flags have been configured to disable optimization.
    
    Reviewed-on: https://go-review.googlesource.com/30010

From-SVN: r240588
2016-09-28 18:02:40 +00:00
Jonathan Wakely
fd5effb17e Check for overflow in filesystem::last_write_time
* include/experimental/bits/fs_fwd.h (file_time_type): Simplify
	definition.
	* src/filesystem/ops.cc (file_time): Take error_code parameter and
	check for overflow.
	(do_copy_file, last_write_time): Pass error_code in file_time calls.
	* testsuite/experimental/filesystem/operations/last_write_time.cc:
	New.
	* testsuite/util/testsuite_fs.h (scoped_file): Define RAII helper.

From-SVN: r240587
2016-09-28 19:02:25 +01:00
Wilco Dijkstra
93c9b105be If strchr can't be folded in gimple-fold...
If strchr can't be folded in gimple-fold, we still need to fall into
the generic code so the folding code in builtins.c is also called.

    gcc/
	* gimple-fold.c (gimple_fold_builtin): After failing to fold
	strchr, also try the generic folding.

From-SVN: r240585
2016-09-28 16:31:34 +00:00
Martin Sebor
2b1b593842 PR c/77762 - Incorrect destination buffer length in -Wformat-length warning
gcc/testsuite/ChangeLog:

	PR c/77762
	* gcc.dg/tree-ssa/builtin-sprintf-warn-1.c (test_vsnprintf_chk_s):
	Call __builtin___vsnprintf_chk, not __builtin___snprintf_chk.
	(test_sprintf_p_const): Adjust line numbers to avoid failures
	introduced in r240503.

gcc/ChangeLog:

	PR c/77762
	* gimple-ssa-sprintf.c (pass_sprintf_length::handle_gimple_call):
	Fix typos.

From-SVN: r240584
2016-09-28 10:24:35 -06:00
Martin Sebor
30dc6ee970 PR middle-end/77683 - ICE on %lf directive in format_floating in
gcc/testsuite/ChangeLog:

	PR middle-end/77683
	* gcc.dg/tree-ssa/builtin-sprintf-warn-1.c: Add test cases.

gcc/ChangeLog:

	PR middle-end/77683
	* gimple-ssa-sprintf.c (format_integer): Fail gracefully when
	length modifier is not expected.
	(format_floating): Ignore l length modifier and fail gracefuly
	when it isn't one of the other expected ones.

From-SVN: r240583
2016-09-28 10:13:12 -06:00
Martin Sebor
c5a1399870 PR bootstrap/77753 - [7 Regression] broken profiledbootstrap due to
gcc/ChangeLog:

	PR bootstrap/77753
	* varasm.c (assemble_addr_to_section): Increase local buffer size.

From-SVN: r240581
2016-09-28 10:02:06 -06:00
Richard Biener
b23d063b52 dwarf2out.c (cu_die_list): New global.
2016-09-27  Richard Biener  <rguenther@suse.de>

	* dwarf2out.c (cu_die_list): New global.
	(dwarf2out_finish): Walk cu_die_list instead of limbo DIEs.  Add
	main_comp_unit_die to cu_die_list if we created it.
	Move break_out_includes ...
	(dwarf2out_early_finish): ... here.  Push created CU DIEs onto
	the cu_die_list.

From-SVN: r240579
2016-09-28 14:31:04 +00:00
Richard Biener
8fd57d049f dwarf2out.c (struct die_struct): Add removed flag.
2016-09-28  Richard Biener  <rguenther@suse.de>

	* dwarf2out.c (struct die_struct): Add removed flag.
	(lookup_type_die): If the DIE is marked as removed, clear
	TYPE_SYMTAB_DIE and return NULL.
	(lookup_decl_die): If the DIE is marked as removed, remove it
	from the hash and return NULL.
	(mark_removed): New helper.
	(prune_unused_types_prune): Call it for removed DIEs.
	(gen_subprogram_die): Move the premark_used_types call to after
	DIEs for the functions scopes are generated.
	(process_scope_var): Do not re-create pruned types or type decls.
	Make sure to also re-parent type decls.
	(dwarf2out_finish): Move unused type pruning and debug_types
	handling ...
	(dwarf2out_early_finish): ... here.

From-SVN: r240578
2016-09-28 14:30:19 +00:00
Claudiu Zissulescu
cf07c3ded0 [ARC] New CPU C-define handler.
gcc/
2016-09-29  Claudiu Zissulescu  <claziss@synopsys.com>

	* config/arc/arc-c.c: New file.
	* config/arc/arc-c.def: Likewise.
	* config/arc/t-arc: Likewise.
	* config.gcc: Include arc-c.o as c and cpp object.
	* config/arc/arc-protos.h (arc_cpu_cpp_builtins): Add prototype.
	* config/arc/arc.h (TARGET_CPU_CPP_BUILTINS): Use
	arc_cpu_cpp_builtins.

From-SVN: r240577
2016-09-28 16:25:21 +02:00
Claudiu Zissulescu
c6d66e9077 [ARC] Add simple shift/rotate ops.
2016-09-29  Claudiu Zissulescu  <claziss@synopsys.com>

	* config/arc/arc.md (*rotrsi3_cnt1): New pattern,
	(*ashlsi2_cnt1, *lshrsi3_cnt1, *ashrsi3_cnt1): Likewise.

From-SVN: r240576
2016-09-28 15:26:32 +02:00
Bernd Edlinger
fcf32bad2d re PR c++/77748 (pr77550.C fails on arm-none-eabi)
2016-09-28  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        PR c++/77748
        * g++.dg/pr77550.C: Avoid undefined behavior.

From-SVN: r240573
2016-09-28 12:11:57 +00:00
Bernd Edlinger
7d290e9393 pr68198.c: Fix dg-final.
2016-09-28  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * gcc.dg/tree-ssa/pr68198.c: Fix dg-final.

From-SVN: r240572
2016-09-28 12:08:11 +00:00
Nathan Sidwell
bc43e0ec4b gimple-pretty-print.c (dump_gimple_call_args): Simplify "' " printing.
* gimple-pretty-print.c (dump_gimple_call_args): Simplify "' "
	printing.

From-SVN: r240570
2016-09-28 11:26:16 +00:00
Claudiu Zissulescu
a29b7214dd [ARC COMMITTED] MAINTAINERS (Reviewers): Add myself.
2016-09-28  Claudiu Zissulescu  <claziss@synopsys.com>

	* MAINTAINERS (Reviewers): Add myself.

From-SVN: r240569
2016-09-28 13:12:41 +02:00
Wilco Dijkstra
912d9ec300 Optimize strchr (s, 0) to s + strlen (s).
Optimize strchr (s, 0) to s + strlen (s).  strchr (s, 0) appears a common
idiom for finding the end of a string, however it is not a very efficient
way of doing so.  Strlen is a much simpler operation which is significantly
faster (eg. on x86 strlen is 50% faster for strings of 8 bytes and about
twice as fast as strchr on strings of 1KB).

    gcc/
	* gimple-fold.c (gimple_fold_builtin_strchr):
	New function to optimize strchr (s, 0) to strlen.
	(gimple_fold_builtin): Add BUILT_IN_STRCHR case.

    testsuite/
	* gcc.dg/strlenopt-20.c: Update test.
	* gcc.dg/strlenopt-21.c: Likewise.
	* gcc.dg/strlenopt-22.c: Likewise.
	* gcc.dg/strlenopt-22g.c: Likewise.
	* gcc.dg/strlenopt-26.c: Likewise.
	* gcc.dg/strlenopt-5.c: Likewise.
	* gcc.dg/strlenopt-7.c: Likewise.
	* gcc.dg/strlenopt-9.c: Likewise.

From-SVN: r240568
2016-09-28 11:06:41 +00:00
Jonathan Wakely
1b4be62ad3 libstdc++/77686 use may_alias for std::function storage
PR libstdc++/77686
	* include/std/functional (_Any_data): Add may_alias attribute.

From-SVN: r240567
2016-09-28 11:57:46 +01:00
Robin Dapp
1f56389164 re PR tree-optimization/77724 (bootstrap-O3 broken: ICE: in tree_to_uhwi, at tree.c:7330)
Fix PR tree-optimization/77724

2016-09-27  Robin Dapp  <rdapp@linux.vnet.ibm.com>

        PR tree-optimization/77724
        * tree-vect-loop-manip.c (create_intersect_range_checks_index):
        Add tree_fits_shwi_p check.

From-SVN: r240565
2016-09-28 05:13:19 +00:00
Jeff Law
c03049b614 Fix Liu Hao's name in ChangeLog entry
From-SVN: r240564
2016-09-27 22:47:13 -06:00
GCC Administrator
8233c743ca Daily bump.
From-SVN: r240563
2016-09-28 00:16:17 +00:00
Ian Lance Taylor
14cda8a1cf libgo: separate mksysinfo inputs into separate Makefile targets
This is a step toward a version of mksysinfo that generates information
    for the runtime package.  This will be used to generate the
    runtime_sysinfo.go file, which is currently directly generated by a
    Makefile target.
    
    Reviewed-on: https://go-review.googlesource.com/29683

From-SVN: r240560
2016-09-27 21:32:50 +00:00
Ian Lance Taylor
c7ff137489 compiler: avoid call duplication during order eval.
During the compiler's order_evaluations() pass, duplicate
    call statements were being created and inserted into block
    statement lists in situations where there were calls returning
    multiple arguments. These duplicates were benign in that they
    were ignored during backend code generation, however they
    did cause duplicate calls in AST dumps. Tweak the order
    evaluation code to handle this case better and avoid inserting
    these duplicates.
    
    Fixes golang/go#17237
    
    Reviewed-on: https://go-review.googlesource.com/29857

From-SVN: r240559
2016-09-27 21:25:42 +00:00
Than McIntosh
437018ea2b compiler: add src information to AST dumps (part 1 of 2).
When emitting AST dumps, tag the end of selected statements with with
    source file and line number information where available. Example:
    
      tmp.76832448 = 0 // p.go:6
    
    Requires a corresponding change in gcc/go as well as this change to
    gofrontend.
    
    Reviewed-on: https://go-review.googlesource.com/29856

	* go-linemap.cc (Gcc_linemap::to_string): New method.

From-SVN: r240558
2016-09-27 20:49:05 +00:00
Jakub Jelinek
6e39060a7f c-cppbuiltin.c (c_cpp_builtins): Define __cpp_capture_star_this for -std=c++1z.
* c-cppbuiltin.c (c_cpp_builtins): Define __cpp_capture_star_this for
	-std=c++1z.

	* g++.dg/cpp1z/feat-cxx1z.C: Add __cpp_capture_star_this test.

From-SVN: r240557
2016-09-27 21:59:41 +02:00
Jakub Jelinek
8ca3334717 Implement P0018R3, C++17 lambda capture of *this by value as [=,*this]
Implement P0018R3, C++17 lambda capture of *this by value as [=,*this]
	* parser.c (cp_parser_lambda_introducer): Formatting fix.  Pass
	true instead of false as by_reference_p to add_capture for 'this'.
	Parse '*this' simple-capture.
	* lambda.c (build_capture_proxy): Handle '*this' capture by value.
	(add_capture): Adjust function comment.  For id == this_identifier,
	treat by_reference_p as capturing '*this' by reference, i.e. 'this'
	by value, and !by_reference_p as capturing '*this' by value.
	(add_default_capture): For implicit 'this' capture, always pass
	by_reference_p true rather than false.

	* g++.dg/cpp1z/lambda-this1.C: New test.
	* g++.dg/cpp1z/lambda-this2.C: New test.

From-SVN: r240556
2016-09-27 21:10:38 +02:00