1. 21 Nov, 2017 27 commits
    • * gcc.target/i386/pr82713.c: Fix dg directive. · 40a90224
      From-SVN: r255016
      Uros Bizjak committed
    • re PR c++/83020 (('17) Class template constructor call skipped with no error… · 00709c08
      re PR c++/83020 (('17) Class template constructor call skipped with no error when substitution fails in default argument)
      
      2017-11-21  Paolo Carlini  <paolo.carlini@oracle.com>
      
      	PR c++/83020
      	* g++.dg/cpp1z/pr83020.C: New.
      
      From-SVN: r255006
      Paolo Carlini committed
    • Remove not needed xstrdup_for_dump. · 769ae3bb
      2017-11-21  Martin Liska  <mliska@suse.cz>
      
      	* tree-inline.c (expand_call_inline):
      	  Remove not needed xstrdup_for_dump.
      
      From-SVN: r255005
      Martin Liska committed
    • re PR target/82880 (gcc --help=target --help=optimizers hangs on mips) · 06988296
      	PR target/82880
      	* config/mips/frame-header-opt.c (mips_register_frame_header_opt):
      	Remove static keyword from f variable.
      
      	* gcc.dg/opts-8.c: New test.
      
      From-SVN: r255004
      Jakub Jelinek committed
    • * c-common.c (get_nonnull_operand): Use tree_to_uhwi. · 7d2f0f9b
      From-SVN: r255003
      Jakub Jelinek committed
    • re PR tree-optimization/83086 (valgrind error in gimple-ssa-store-merging.c for recent build) · aa11164a
      	PR tree-optimization/83086
      	* gimple-ssa-store-merging.c
      	(imm_store_chain_info::try_coalesce_bswap): Test this_n.base_addr
      	rather than n.base_addr.
      
      From-SVN: r255002
      Jakub Jelinek committed
    • Fix UBSAN errors in dse.c (PR rtl-optimization/82044). · 938f9248
      2017-11-21  Martin Liska  <mliska@suse.cz>
      
      	PR rtl-optimization/82044
      	PR tree-optimization/82042
      	* dse.c (check_mem_read_rtx): Check for overflow.
      
      From-SVN: r255001
      Martin Liska committed
    • tree-ssa-threadbackward.c (find_jump_threads_backwards): Fix typo in comment. · ddc1759a
      	* tree-ssa-threadbackward.c (find_jump_threads_backwards): Fix
      	typo in comment.
      
      From-SVN: r254999
      Aldy Hernandez committed
    • Don't split call from its call arg location. · 13f5d5e0
      gcc/
      2017-11-21  Claudiu Zissulescu  <claziss@synopsys.com>
      
      	* cfgrtl.c (force_nonfallthru_and_redirect): Don't split a call
      	and its corresponding call arg location note.
      
      testsuite/
      2017-11-21  Claudiu Zissulescu  <claziss@synopsys.com>
      
      	* gcc.target/arc/loop-5.cpp: New test.
      
      From-SVN: r254998
      Claudiu Zissulescu committed
    • [ARC] Reimplement exception handling support. · 6fe5e235
      2016-06-09  Claudiu Zissulescu  <claziss@synopsys.com>
      	    Andrew Burgess  <andrew.burgess@embecosm.com>
      
      	* config/arc/arc-protos.h (arc_compute_frame_size): Delete
      	declaration.
      	(arc_return_slot_offset): Likewise.
      	(arc_eh_return_address_location): New declaration.
      	* config/arc/arc.c (TARGET_BUILTIN_SETJMP_FRAME_VALUE): Define.
      	(MUST_SAVE_REGISTER): Add exception handler case.
      	(MUST_SAVE_RETURN_ADDR): Likewise.
      	(arc_frame_pointer_required): Likewise.
      	(arc_frame_pointer_needed): New function.
      	(arc_compute_frame_size): Changed.
      	(arc_expand_prologue): Likewise.
      	(arc_expand_epilogue): Likewise.
      	(arc_initial_elimination_offset): Likewise.
      	(arc_return_slot_offset): Delete.
      	(arc_eh_return_address_location): New function.
      	(arc_builtin_setjmp_frame_value): Likewise.
      	* config/arc/arc.h (EH_RETURN_DATA_REGNO): Use 2 registers.
      	(EH_RETURN_STACKADJ_RTX): Define.
      	(EH_RETURN_HANDLER_RTX): Likewise.
      	* config/arc/arc.md (eh_return): Delete.
      
      Co-Authored-By: Andrew Burgess <andrew.burgess@embecosm.com>
      
      From-SVN: r254997
      Claudiu Zissulescu committed
    • print-tree.h (debug_vec_tree): Remove prototype. · 24d39222
      	* print-tree.h (debug_vec_tree): Remove prototype.
      	* gdbinit.in (pvt): Remove macro.
      
      From-SVN: r254996
      Aldy Hernandez committed
    • re PR tree-optimization/83047 (glibc/crypt/crypt_util.c gets miscompiled) · 97031af7
      	PR tree-optimization/83047
      	* gimple-ssa-store-merging.c
      	(imm_store_chain_info::output_merged_store): If the loads with the
      	same vuse are in different basic blocks, for load_gsi pick a load
      	location that is dominated by the other loads.
      
      	* gcc.dg/pr83047.c: New test.
      
      From-SVN: r254992
      Jakub Jelinek committed
    • P0428R2 - familiar template syntax for generic lambdas · 7768f20b
      	P0428R2 - familiar template syntax for generic lambdas
      	* parser.c (cp_parser_lambda_declarator_opt): Don't pedwarn
      	for cxx2a and above, reword pedwarn for C++14/C++17.
      
      	* g++.dg/cpp1y/lambda-generic-x.C: Adjust warnings and limit
      	to c++17_down target.
      	* g++.dg/cpp1y/lambda-generic-dep.C: Likewise.
      	* g++.dg/cpp1y/lambda-generic-77914.C: Adjust error and limit
      	to c++17_down target.
      	* g++.dg/cpp2a/lambda-generic1.C: New test.
      	* g++.dg/cpp2a/lambda-generic2.C: New test.
      	* g++.dg/cpp2a/lambda-generic3.C: New test.
      	* g++.dg/cpp2a/lambda-generic4.C: New test.
      	* g++.dg/cpp2a/lambda-generic5.C: New test.
      
      From-SVN: r254991
      Jakub Jelinek committed
    • re PR c++/83059 (ICE on invalid C++ code: in tree_to_uhwi, at tree.c:6633) · d44ed508
      	PR c++/83059
      	* c-common.c (get_atomic_generic_size): Use TREE_INT_CST_LOW
      	instead of tree_to_uhwi, formatting fix.
      	* config/i386/i386.c (ix86_memmodel_check): Start
      	-Winvalid-memory-model diagnostics with lowercase letter.
      
      	* c-c++-common/pr83059.c: New test.
      
      From-SVN: r254990
      Jakub Jelinek committed
    • re PR debug/82718 (Bad DWARF5 .debug_loclists generation) · 8b87e0d1
      	PR debug/82718
      	* dwarf2out.c (dw_loc_list): If crtl->has_bb_partition, temporarily
      	set in_cold_section_p to the partition containing loc_list->first.
      	When seeing loc_list->last_before_switch node, update secname and
      	perform range_across_switch second partition handling only after that.
      
      	* gcc.dg/debug/dwarf2/pr82718-1.c: New test.
      	* gcc.dg/debug/dwarf2/pr82718-2.c: New test.
      
      From-SVN: r254989
      Jakub Jelinek committed
    • re PR debug/82933 (valgrind error in set_cur_line_info_table with -g) · 83087d65
      	PR debug/82933
      	* run-rtl-passes.c: Include debug.h.
      	(run_rtl_passes): Call debug_hooks->assembly_start.
      	* dwarf2out.c (dwarf2out_assembly_start): Return early if invoked
      	multiple times.
      
      	* gcc.dg/rtl/x86_64/pr82933.c: New test.
      
      From-SVN: r254987
      Jakub Jelinek committed
    • re PR target/82981 (unnecessary __multi3 call for mips64r6 linux kernel) · 644f0132
      	PR target/82981
      	* internal-fn.c (expand_mul_overflow): Use OPTAB_WIDEN instead of
      	OPTAB_DIRECT in calls to expand_simple_binop.
      
      From-SVN: r254986
      Jakub Jelinek committed
    • RTEMS: Enable some libstdc++ features · b76602dc
      libstdc++/
      
      	* acinclude.m4 (GLIBCXX_ENABLE_LIBSTDCXX_TIME): Add rtems*.
      	(GLIBCXX_ENABLE_FILESYSTEM_TS): Likewise.
      	* configure: Regenerate.
      
      From-SVN: r254985
      Sebastian Huber committed
    • libgo: fix makefile buglet · c9548fa4
          
          Fix a small bug in the libgo Makefile recipe that constructs the
          directory from which to pick up libgcc_s.so ; the gccgo invocation
          with -print-libgcc-file-name was missing the flags, which meant that
          for -m32 builds we'd see the 64-bit libgcc dir.
          
          Reviewed-on: https://go-review.googlesource.com/78836
      
      From-SVN: r254984
      Ian Lance Taylor committed
    • compiler: report error for ++/-- applied to a non-numeric type · 5e43a9ee
          
          This avoids a compiler crash.
          
          Fixes GCC PR 83071.
          
          Reviewed-on: https://go-review.googlesource.com/78875
      
      From-SVN: r254983
      Ian Lance Taylor committed
    • re PR libfortran/78549 (Very slow formatted internal file output) · 8c098567
      2017-11-20  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
      
      	PR libgfortran/78549
      	* io/io.h (newunit_free): Add declaration. Clean some whitespace.
      	* io/transfer.c (st_read_done, st_write_done): Call newunit_free.
      	* io/unit.c (newunit_free): Change type from static void to void.
      
      From-SVN: r254982
      Jerry DeLisle committed
    • Use -Wtraditional for "would be stringified in traditional C" (PR preprocessor/81794) · 34b81eb9
      libcpp/ChangeLog:
      
      2017-03-24  Eric Gallager  <egall@gwmail.gwu.edu>
      
      	PR preprocessor/81794
      	* macro.c (check_trad_stringification): Have warning be controlled
      	by -Wtraditional.
      
      gcc/testsuite/ChangeLog:
      
      2017-09-17  Eric Gallager  <egall@gwmail.gwu.edu>
      
      	PR preprocessor/81794
      	* gcc.dg/pragma-diag-7.c: Update to include check for
      	stringification.
      
      From-SVN: r254981
      Eric Gallager committed
    • C/C++: more stdlib header hints (PR c/81404) · 26edace6
      This patch extends the C frontend's "knowledge" of the C stdlib within
      get_c_name_hint to cover some more macros and functions, covering
      a case reported in PR c/81404 ("INT_MAX"), so that rather than printing:
      
        t.c:5:12: error: 'INT_MAX' undeclared here (not in a function); did you mean '__INT_MAX__'?
         int test = INT_MAX;
                    ^~~~~~~
                    __INT_MAX__
      
      we instead print:
      
        t.c:5:12: error: 'INT_MAX' undeclared here (not in a function)
         int test = INT_MAX;
                    ^~~~~~~
        t.c:5:12: note: 'INT_MAX' is defined in header '<limits.h>'; did you forget to '#include <limits.h>'?
        t.c:1:1:
        +#include <limits.h>
      
        t.c:5:12:
          int test = INT_MAX;
                     ^~~~~~~
      
      It also adds generalizes some of the code for this (and for the "std::"
      namespace hints in the C++ frontend), moving it to a new
      c-family/known-headers.cc and .h, and introducing a class known_headers.
      This currently just works by scanning a hardcoded array of known
      name/header associations, but perhaps in the future could be turned
      into some kind of symbol database so that the compiler could record API
      uses and use that to offer suggestions e.g.
      
      foo.cc: error: 'myapi::foo' was not declared in this scope
      foo.cc: note: 'myapi::foo" was declared in header 'myapi/private.h'
      (included via 'myapi/public.h') when compiling 'bar.cc'; did you forget to
      '#include "myapi/public.h"'?
      
      or somesuch.
      
      In any case, moving this to a class gives an easier way to locate the
      hardcoded knowledge about the stdlib.
      
      The patch also adds similar code to the C++ frontend covering
      unqualified names in the standard library, so that rather than just
      e.g.:
      
        t.cc:19:13: error: 'NULL' was not declared in this scope
         void *ptr = NULL;
                     ^~~~
      
      we can emit:
      
        t.cc:19:13: error: 'NULL' was not declared in this scope
         void *ptr = NULL;
                     ^~~~
        t.cc:19:13: note: 'NULL' is defined in header '<cstddef>'; did you forget
        to '#include <cstddef>'?
        t.cc:1:1:
        +#include <cstddef>
      
        t.cc:19:13:
         void *ptr = NULL;
                     ^~~~
      
      (Also XFAIL for PR c++/80567 added for the C++ testcase; this is a
      separate pre-existing bug exposed by the testcase for PR 81404).
      
      gcc/ChangeLog:
      	PR c/81404
      	* Makefile.in (C_COMMON_OBJS): Add c-family/known-headers.o.
      
      gcc/c-family/ChangeLog:
      	PR c/81404
      	* known-headers.cc: New file, based on material from c/c-decl.c.
      	(suggest_missing_header): Copied as-is.
      	(get_stdlib_header_for_name): New, based on get_c_name_hint but
      	heavily edited to add C++ support.  Add some knowledge about
      	<limits.h>, <stdint.h>, and <wchar.h>.
      	* known-headers.h: Likewise.
      
      gcc/c/ChangeLog:
      	PR c/81404
      	* c-decl.c: Include "c-family/known-headers.h".
      	(get_c_name_hint): Rename to get_stdlib_header_for_name and move
      	to known-headers.cc.
      	(class suggest_missing_header): Move to known-header.h.
      	(lookup_name_fuzzy): Call get_c_stdlib_header_for_name rather
      	than get_c_name_hint.
      
      gcc/cp/ChangeLog:
      	PR c/81404
      	* name-lookup.c: Include "c-family/known-headers.h"
      	(lookup_name_fuzzy): Call get_cp_stdlib_header_for_name and
      	potentially return a new suggest_missing_header hint.
      
      gcc/testsuite/ChangeLog:
      	PR c/81404
      	* g++.dg/spellcheck-stdlib.C: New.
      	* gcc.dg/spellcheck-stdlib.c (test_INT_MAX): New.
      
      From-SVN: r254980
      David Malcolm committed
    • C: hints for missing stdlib includes for macros and types · b1212255
      The C frontend already "knows" about many common functions in
      the C standard library:
      
        test.c: In function 'test':
        test.c:3:3: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
           printf ("hello world\n");
           ^~~~~~
        test.c:3:3: warning: incompatible implicit declaration of built-in function 'printf'
        test.c:3:3: note: include '<stdio.h>' or provide a declaration of 'printf'
      
      and which header file they are in.
      
      However it doesn't know about various types and macros:
      
      test.c:1:13: error: 'NULL' undeclared here (not in a function)
       void *ptr = NULL;
                   ^~~~
      
      This patch uses the name_hint/deferred_diagnostic machinery to
      add hints for missing C standard library headers for some of the
      most common type and macro names.
      
      For example, the above becomes:
      test.c:1:13: error: 'NULL' undeclared here (not in a function)
       void *ptr = NULL;
                   ^~~~
      test.c:1:13: note: 'NULL' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
      
      gcc/c/ChangeLog:
      	* c-decl.c (get_c_name_hint): New function.
      	(class suggest_missing_header): New class.
      	(lookup_name_fuzzy): Call get_c_name_hint and use it to
      	suggest missing headers to the user.
      
      gcc/testsuite/ChangeLog:
      	* gcc.dg/spellcheck-stdlib.c: New test case.
      
      From-SVN: r254979
      David Malcolm committed
    • C++: provide macro used-before-defined hint (PR c++/72786) · 01ada121
      This patch uses the name_hint/deferred_diagnostic to provide
      a message in the C++ frontend if a macro is used before it is defined
      e.g.:
      
      test.c:6:24: error: expected ';' at end of member declaration
         virtual void clone() const OVERRIDE { }
                              ^~~~~
                                   ;
      test.c:6:30: error: 'OVERRIDE' does not name a type
         virtual void clone() const OVERRIDE { }
                                    ^~~~~~~~
      test.c:6:30: note: the macro 'OVERRIDE' had not yet been defined
      test.c:15:0: note: it was later defined here
       #define OVERRIDE override
      
      It's possible to do it from the C++ frontend as tokenization happens
      up-front (and hence the macro already exists when the above is parsed);
      I attempted to do it from the C frontend, but because the C frontend only
      tokenizes on-demand during parsing, the macro isn't known about until
      later.
      
      gcc/cp/ChangeLog:
      	PR c++/72786
      	* name-lookup.c (class macro_use_before_def): New class.
      	(lookup_name_fuzzy): Detect macro that were used before being
      	defined, and report them as such.
      
      gcc/ChangeLog:
      	PR c++/72786
      	* spellcheck.h (best_match::blithely_get_best_candidate): New
      	accessor.
      
      gcc/testsuite/ChangeLog:
      	PR c++/72786
      	* g++.dg/spellcheck-macro-ordering-2.C: New test case.
      	* g++.dg/spellcheck-macro-ordering.C: Add dg-message directives
      	for macro used-before-defined.
      
      libcpp/ChangeLog:
      	PR c++/72786
      	* include/cpplib.h (cpp_macro_definition_location): New decl.
      	* macro.c (cpp_macro_definition): New function.
      
      From-SVN: r254978
      David Malcolm committed
    • re PR target/81356 (__builtin_strcpy is not good for copying an empty string on aarch64) · 874b8068
      2017-11-20  Steve Ellcey  <sellcey@cavium.com>
      
      	PR target/81356
      	* gfortran.dg/pr45636.f90 (aarch64*-*-*): Remove from xfail list.
      
      From-SVN: r254977
      Steve Ellcey committed
    • Daily bump. · a121f822
      From-SVN: r254976
      GCC Administrator committed
  2. 20 Nov, 2017 13 commits
    • Avoid duplicate visibility warning. · 753c2e69
      	* decl2.c (constrain_class_visibility): Don't warn about artificial
      	fields.
      
      From-SVN: r254973
      Jason Merrill committed
    • streambuf_iterator.h (istreambuf_iterator<>): Declare std::advance for… · e324f9cb
      streambuf_iterator.h (istreambuf_iterator<>): Declare std::advance for istreambuf_iterator of char types to be friend.
      
      2017-11-20  François Dumont  <fdumont@gcc.gnu.org>
      
      	* include/bits/streambuf_iterator.h (istreambuf_iterator<>): Declare
      	std::advance for istreambuf_iterator of char types to be friend.
      	(std::advance(istreambuf_iterator&, _Distance)): New overload.
      	* include/std/streambuf (basic_streambuf<>): Declare std::advance for
      	istreambuf_iterator of char types to be friend.
      	* testsuite/22_locale/money_get/get/char/9.cc: Have
      	istreambuf_iterator created on the fly when calling money_get<>::get.
      	* testsuite/22_locale/money_get/get/wchar_t/9.cc: Likewise.
      	* testsuite/24_iterators/istreambuf_iterator/debug/1_neg.cc: New.
      	* testsuite/24_iterators/istreambuf_iterator/debug/2_neg.cc: New.
      	* testsuite/25_algorithms/advance/istreambuf_iterators/char/1.cc: New.
      	* testsuite/25_algorithms/advance/istreambuf_iterators/char/1_neg.cc:
      	New.
      	* testsuite/25_algorithms/advance/istreambuf_iterators/char/2.cc: New.
      	* testsuite/25_algorithms/advance/istreambuf_iterators/char/2_neg.cc:
      	New.
      	* testsuite/25_algorithms/advance/istreambuf_iterators/char/3_neg.cc:
      	New.
      	* testsuite/25_algorithms/advance/istreambuf_iterators/wchar_t/1.cc:
      	New.
      	* testsuite/25_algorithms/advance/istreambuf_iterators/wchar_t/1_neg.cc:
      	New.
      	* testsuite/25_algorithms/advance/istreambuf_iterators/wchar_t/2.cc:
      	New.
      	* testsuite/25_algorithms/advance/istreambuf_iterators/wchar_t/2_neg.cc:
      	New.
      	* testsuite/25_algorithms/advance/istreambuf_iterators/wchar_t/3_neg.cc:
      	New.
      	* testsuite/25_algorithms/find/istreambuf_iterators/char/2.cc: Leverage
      	on std::advance overload.
      	* testsuite/25_algorithms/find/istreambuf_iterators/wchar_t/2.cc:
      	Likewise.
      
      From-SVN: r254972
      François Dumont committed
    • Fix failing tests caused by duplicate dg-options · 9be0a9d6
      	* testsuite/special_functions/18_riemann_zeta/check_value.cc: Fix
      	duplicate dg-options directive.
      	* testsuite/tr1/5_numerical_facilities/special_functions/
      	20_riemann_zeta/check_value_neg.cc: Likewise.
      
      From-SVN: r254971
      Jonathan Wakely committed
    • i386.c (parse_mtune_ctrl_str): Start diagnostics with lower case letter. · 49e68526
      	* config/i386/i386.c (parse_mtune_ctrl_str): Start diagnostics
      	with lower case letter.
      
      From-SVN: r254970
      Jakub Jelinek committed
    • i386.md (bswaphi2): New expander. · 121075d7
      	* config/i386/i386.md (bswaphi2): New expander.
      	(*bswaphi2_movbe): New insn pattern.
      	(bswaphi -> rorhi pepehole2): New peephole pattern.
      
      testsuite/ChangeLog:
      
      	* gcc.target/i386/movbe-5.c: New test.
      
      From-SVN: r254967
      Uros Bizjak committed
    • re PR fortran/79072 (ICE with class(*) pointer function result and character value) · 6017b8f0
      2017-11-20  Paul Thomas  <pault@gcc.gnu.org>
      
      	PR fortran/79072
      	* trans-expr.c (trans_class_vptr_len_assignment): Set from_len
      	if the temporary is unlimited polymorphic.
      	* trans-stmt.c (trans_associate_var): Use the fake result decl
      	to obtain the 'len' field from an explicit function result when
      	in that function scope.
      
      2017-11-20  Paul Thomas  <pault@gcc.gnu.org>
      
      	PR fortran/79072
      	* gfortran.dg/class_result_5.f90: New test.
      
      From-SVN: r254966
      Paul Thomas committed
    • RISC-V: Implement __umulsidi3, umul_ppmm and __muluw3 · ee1c2133
      2017-11-20  Kito Cheng  <kito.cheng@gmail.com>
      
              * longlong.h [__riscv] (__umulsidi3): Define.
              [__riscv] (umul_ppmm): Likewise.
              [__riscv] (__muluw3): Likewise.
      
      From-SVN: r254965
      Kito Cheng committed
    • P0329R4: Designated Initialization · d68ddd2b
      	P0329R4: Designated Initialization
      	* parser.c (cp_parser_initializer_clause): List in comment grammar
      	designated-initializer-list.
      	(cp_parser_initializer_list): Allow .identifier = without pedwarn for
      	C++2A, parse .identifier { ... }.  Improve location_t argument to
      	pedwarn.  Add pedwarn for [cst] = designators.  Diagnose ... in
      	designated initializer list.  Diagnose mixing designated and
      	non-designated initializer clauses for C++2A.  Diagnose duplicated
      	identifiers in designators.
      	* name-lookup.h (search_anon_aggr): New declaration.
      	* name-lookup.c (fields_linear_search): Use search_anon_aggr.
      	(search_anon_aggr): New function.
      	* typeck2.c (process_init_constructor_record): Allow designator
      	to skip over some non-static data members.  Handle anonymous
      	aggregates.  Add diagnostics for designator order not matching
      	member declaration order.
      
      	* g++.dg/ext/desig2.C: Adjust comment, no sorry about designator
      	refering to second member.
      	(b): New variable and associated expected diagnostic.
      	* g++.dg/ext/desig4.C: For C++2A expect diagnostics.
      	* g++.dg/ext/desig5.C: Add dg-do dg-compile and empty dg-options.
      	* g++.dg/ext/desig8.C: Likewise.
      	* g++.dg/ext/desig9.C: New test.
      	* g++.dg/ext/pr27019.C: Don't expect any diagnostics.
      	* g++.dg/init/error2.C: Adjust expected diagnostics.
      	* g++.dg/cpp0x/desig1.C: Add dg-options with -pedantic, expect
      	warning on C99 designators.
      	* g++.dg/cpp2a/desig1.C: New test.
      	* g++.dg/cpp2a/desig2.C: New test.
      	* g++.dg/cpp2a/desig3.C: New test.
      	* g++.dg/cpp2a/desig4.C: New test.
      	* g++.dg/cpp2a/desig5.C: New test.
      	* g++.dg/cpp2a/desig6.C: New test.
      
      From-SVN: r254964
      Jakub Jelinek committed
    • c-family: add name_hint/deferred_diagnostic · 6c7a259b
      In various places we use lookup_name_fuzzy to provide a hint,
      and can report messages of the form:
        error: unknown foo named 'bar'
      or:
        error: unknown foo named 'bar'; did you mean 'SUGGESTION?
      
      This patch provides a way for lookup_name_fuzzy to provide
      both the suggestion above, and (optionally) additional hints
      that can be printed e.g.
      
        note: did you forget to include <SOME_HEADER.h>?
      
      This patch provides the mechanism and ports existing users
      of lookup_name_fuzzy to the new return type.
      There are no uses of such hints in this patch, but followup
      patches provide various front-end specific uses of this.
      
      gcc/c-family/ChangeLog:
      	* c-common.h (enum lookup_name_fuzzy_kind): Move to name-hint.h.
      	(lookup_name_fuzzy): Likewise.  Convert return type from
      	const char * to name_hint.  Add location_t param.
      	* name-hint.h: New header.
      
      gcc/c/ChangeLog:
      	* c-decl.c: Define INCLUDE_UNIQUE_PTR before including system.h.
      	Include "c-family/name-hint.h"
      	(implicit_decl_warning): Convert "hint" from
      	const char * to name_hint.  Pass location to
      	lookup_name_fuzzy.  Suppress any deferred diagnostic if the
      	warning was not printed.
      	(undeclared_variable): Likewise for "guessed_id".
      	(lookup_name_fuzzy): Convert return type from const char *
      	to name_hint.  Add location_t param.
      	* c-parser.c: Define INCLUDE_UNIQUE_PTR before including system.h.
      	Include "c-family/name-hint.h"
      	(c_parser_declaration_or_fndef): Convert "hint" from
      	const char * to name_hint.  Pass location to lookup_name_fuzzy.
      	(c_parser_parameter_declaration): Likewise.
      
      gcc/cp/ChangeLog:
      	* name-lookup.c: Define INCLUDE_UNIQUE_PTR before including system.h.
      	Include "c-family/name-hint.h"
      	(suggest_alternatives_for): Convert "fuzzy_name" from const char *
      	to name_hint, and rename to "hint".  Pass location to
      	lookup_name_fuzzy.
      	(lookup_name_fuzzy): Convert return type from const char *
      	to name_hint.  Add location_t param.
      	* parser.c: Define INCLUDE_UNIQUE_PTR before including system.h.
      	Include "c-family/name-hint.h"
      	(cp_parser_diagnose_invalid_type_name): Convert
      	"suggestion" from const char * to name_hint, and rename to "hint".
      	Pass location to lookup_name_fuzzy.
      
      From-SVN: r254963
      David Malcolm committed
    • Makefile.in (OBJS): Add gimple-ssa-evrp-analyze.o. · 74ba745b
      	* Makefile.in (OBJS): Add gimple-ssa-evrp-analyze.o.
      	* gimple-ssa-evrp-analyze.c: New file pulled from gimple-ssa-evrp.c.
      	* gimple-ssa-evrp-analyze.h: New file pulled from gimple-ssa-evrp.c.
      	* gimple-ssa-evrp.c: Remove bits moved into new files.  Include
      	gimple-ssa-evrp-analyze.h.
      
      From-SVN: r254961
      Jeff Law committed
    • gimple-ssa-evrp.c (evrp_dom_walker::before_dom_children): Do not set BB_VISITED here. · 8c66dd9b
      	* gimple-ssa-evrp.c (evrp_dom_walker::before_dom_children): Do not
      	set BB_VISITED here.
      	(evrp_range_analyzer::enter): Set BB_VISITED here instead.
      
      From-SVN: r254960
      Jeff Law committed
    • [PR c++/82878] pass-by-invisiref in lambda · 6aa80414
      https://gcc.gnu.org/ml/gcc-patches/2017-11/msg01115.html
      	PR c++/82878
      	PR c++/78495
      	* call.c (build_call_a): Don't set CALL_FROM_THUNK_P for inherited
      	ctor.
      	* cp-gimplify.c	(cp_genericize_r): Restore THUNK dereference
      	inhibibition check removed in previous c++/78495 change.
      
      	PR c++/82878
      	* g++.dg/cpp0x/pr82878.C: New.
      	* g++.dg/cpp1z/inh-ctor38.C: Check moves too.
      
      From-SVN: r254958
      Nathan Sidwell committed
    • Implement LWG 2353 · 7b7b60c8
      * include/bits/stl_iterator_base_funcs.h (next):
      Use InputIterator instead of ForwardIterator.
      * testsuite/24_iterators/operations/lwg2353.cc: New.
      * testsuite/24_iterators/operations/next_neg.cc: Remove.
      
      From-SVN: r254957
      Ville Voutilainen committed