From: Nathan Sidwell Date: Thu, 5 Jul 2018 13:11:44 +0000 (+0000) Subject: Replace NO_IMPLICIT_EXTERN_C with SYSTEM_IMPLICIT_EXTERN_C. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=09cff37bfdcc9407a72262cbdd6fd3350488d934;p=gcc.git Replace NO_IMPLICIT_EXTERN_C with SYSTEM_IMPLICIT_EXTERN_C. gcc/ Replace NO_IMPLICIT_EXTERN_C with SYSTEM_IMPLICIT_EXTERN_C. * doc/cpp.texi: Update comment. * doc/tm.texi: Rebuilt. * doc/tm.texi.in (NO_IMPLICIT_EXTERN_C): Replace with ... (SYSTEM_IMPLICIT_EXTERN_C): ... this, opposite sense. * doc/extend.texi (Backwards Compatibility): Clarify it is system headers affected by extern "C". * system.h: Poison NO_IMPLICIT_EXTERN_C. * config/alpha/alpha.h, config/arm/uclinux-elf.h, config/bfin/elf.h, config/cris/cris.h, config/darwin.h, config/dragonfly.h, config/freebsd.h, config/gnu-user.h, config/i386/cygming.h, config/i386/djgpp.h, config/i386/nto.h, config/ia64/hpux.h, config/lm32/lm32.h, config/lm32/uclinux-elf.h, config/lynx.h, config/mips/elf.h, config/mmix/mmix.h, config/netbsd.h, config/pa/pa-hpux.h, config/powerpcspe/sysv4.h, config/riscv/elf.h, config/rs6000/sysv4.h, config/rtems.h, config/s390/tpf.h, config/sh/newlib.h, config/sol2.h, config/sparc/openbsd64.h, config/sparc/sp-elf.h, config/sparc/sp64-elf.h, config/spu/spu.h, config/stormy16/stormy16.h, config/v850/v850.h, config/visium/visium.h, config/vx-common.h, config/xtensa/elf.h: Don't define NO_IMPLICIT_EXTERN_C. * config/rs6000/aix.h: Set SYSTEM_IMPLICIT_EXTERN_C. gcc/c-family/ * c-lex.c (fe_file_change): Check SYSTEM_IMPLICIT_EXTERN_C not NO_IMPLICIT_EXTERN_C. gcc/cp/ * cp/decl.c (decls_match): Check SYSTEM_IMPLICIT_EXTERN_C not NO_IMPLICIT_EXTERN_C. * cp/parser.c (cp_parser_parameter_declaration_clause): Likewise. From-SVN: r262437 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3f6d410bcad..87cfd18bb26 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,29 @@ +2018-07-05 Nathan Sidwell + + Replace NO_IMPLICIT_EXTERN_C with SYSTEM_IMPLICIT_EXTERN_C. + * doc/cpp.texi: Update comment. + * doc/tm.texi: Rebuilt. + * doc/tm.texi.in (NO_IMPLICIT_EXTERN_C): Replace with ... + (SYSTEM_IMPLICIT_EXTERN_C): ... this, opposite sense. + * doc/extend.texi (Backwards Compatibility): Clarify it is system + headers affected by extern "C". + * system.h: Poison NO_IMPLICIT_EXTERN_C. + * config/alpha/alpha.h, config/arm/uclinux-elf.h, + config/bfin/elf.h, config/cris/cris.h, config/darwin.h, + config/dragonfly.h, config/freebsd.h, config/gnu-user.h, + config/i386/cygming.h, config/i386/djgpp.h, config/i386/nto.h, + config/ia64/hpux.h, config/lm32/lm32.h, config/lm32/uclinux-elf.h, + config/lynx.h, config/mips/elf.h, config/mmix/mmix.h, + config/netbsd.h, config/pa/pa-hpux.h, config/powerpcspe/sysv4.h, + config/riscv/elf.h, config/rs6000/sysv4.h, config/rtems.h, + config/s390/tpf.h, config/sh/newlib.h, config/sol2.h, + config/sparc/openbsd64.h, config/sparc/sp-elf.h, + config/sparc/sp64-elf.h, config/spu/spu.h, + config/stormy16/stormy16.h, config/v850/v850.h, + config/visium/visium.h, config/vx-common.h, config/xtensa/elf.h: Don't + define NO_IMPLICIT_EXTERN_C. + * config/rs6000/aix.h: Set SYSTEM_IMPLICIT_EXTERN_C. + 2018-07-05 Tamar Christina PR target/84711 @@ -1939,7 +1965,7 @@ * tree-cfgcleanup.c (tree_forwarder_block_p): Do not return false at -O0 if the locus represent UNKNOWN_LOCATION but have different values. - + 2018-06-19 Aaron Sawdey * config/rs6000/rs6000-string.c (select_block_compare_mode): Check diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 9596eec56bc..24eaf6ad632 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,8 @@ +2018-07-05 Nathan Sidwell + + * c-lex.c (fe_file_change): Check SYSTEM_IMPLICIT_EXTERN_C not + NO_IMPLICIT_EXTERN_C. + 2018-06-28 Martin Liska * cppspec.c: Include opt-suggestions.h. diff --git a/gcc/c-family/c-lex.c b/gcc/c-family/c-lex.c index 3cd24ac40dc..074c2d2b86e 100644 --- a/gcc/c-family/c-lex.c +++ b/gcc/c-family/c-lex.c @@ -206,7 +206,7 @@ fe_file_change (const line_map_ordinary *new_map) input_location = new_map->start_location; (*debug_hooks->start_source_file) (line, LINEMAP_FILE (new_map)); -#ifndef NO_IMPLICIT_EXTERN_C +#ifdef SYSTEM_IMPLICIT_EXTERN_C if (c_header_level) ++c_header_level; else if (LINEMAP_SYSP (new_map) == 2) @@ -219,7 +219,7 @@ fe_file_change (const line_map_ordinary *new_map) } else if (new_map->reason == LC_LEAVE) { -#ifndef NO_IMPLICIT_EXTERN_C +#ifdef SYSTEM_IMPLICIT_EXTERN_C if (c_header_level && --c_header_level == 0) { if (LINEMAP_SYSP (new_map) == 2) diff --git a/gcc/config/alpha/alpha.h b/gcc/config/alpha/alpha.h index 1d3238565d5..6802ef386ed 100644 --- a/gcc/config/alpha/alpha.h +++ b/gcc/config/alpha/alpha.h @@ -922,7 +922,4 @@ extern long alpha_auto_offset; /* By default, turn on GDB extensions. */ #define DEFAULT_GDB_EXTENSIONS 1 -/* The system headers under Alpha systems are generally C++-aware. */ -#define NO_IMPLICIT_EXTERN_C - #define TARGET_SUPPORTS_WIDE_INT 1 diff --git a/gcc/config/arm/uclinux-elf.h b/gcc/config/arm/uclinux-elf.h index 54879c7b7e3..f78f279f0ab 100644 --- a/gcc/config/arm/uclinux-elf.h +++ b/gcc/config/arm/uclinux-elf.h @@ -48,9 +48,6 @@ } \ while (false) -/* Do not assume anything about header files. */ -#define NO_IMPLICIT_EXTERN_C - /* The GNU C++ standard library requires that these macros be defined. */ #undef CPLUSPLUS_CPP_SPEC #define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)" diff --git a/gcc/config/bfin/elf.h b/gcc/config/bfin/elf.h index d8b0f377c47..ae160507491 100644 --- a/gcc/config/bfin/elf.h +++ b/gcc/config/bfin/elf.h @@ -70,5 +70,3 @@ asm (TEXT_SECTION_ASM_OP); #undef SUBTARGET_DRIVER_SELF_SPECS #define SUBTARGET_DRIVER_SELF_SPECS \ "%{mfdpic:-msim} %{mid-shared-library:-msim}" - -#define NO_IMPLICIT_EXTERN_C diff --git a/gcc/config/cris/cris.h b/gcc/config/cris/cris.h index 84c92929b4a..e15f3f645ce 100644 --- a/gcc/config/cris/cris.h +++ b/gcc/config/cris/cris.h @@ -1030,8 +1030,6 @@ enum cris_symbol_type #define FUNCTION_MODE QImode -#define NO_IMPLICIT_EXTERN_C - /* * Local variables: * eval: (c-set-style "gnu") diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h index 16c3b60bb07..591188a1d19 100644 --- a/gcc/config/darwin.h +++ b/gcc/config/darwin.h @@ -43,9 +43,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define DARWIN_X86 0 #define DARWIN_PPC 0 -/* Don't assume anything about the header files. */ -#define NO_IMPLICIT_EXTERN_C - /* Suppress g++ attempt to link in the math library automatically. */ #define MATH_LIBRARY "" diff --git a/gcc/config/dragonfly.h b/gcc/config/dragonfly.h index ec9d9e0bf81..4f53d2224a1 100644 --- a/gcc/config/dragonfly.h +++ b/gcc/config/dragonfly.h @@ -104,10 +104,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #undef OBJECT_FORMAT_ELF #define OBJECT_FORMAT_ELF -/* Don't assume anything about the header files. */ -#undef NO_IMPLICIT_EXTERN_C -#define NO_IMPLICIT_EXTERN_C 1 - /* Follow DragonFly's standard headers (, etc...). */ #undef WCHAR_TYPE diff --git a/gcc/config/freebsd.h b/gcc/config/freebsd.h index 0c8bd29d278..9463deabf7f 100644 --- a/gcc/config/freebsd.h +++ b/gcc/config/freebsd.h @@ -68,10 +68,6 @@ along with GCC; see the file COPYING3. If not see #undef OBJECT_FORMAT_ELF #define OBJECT_FORMAT_ELF -/* Don't assume anything about the header files. */ -#undef NO_IMPLICIT_EXTERN_C -#define NO_IMPLICIT_EXTERN_C 1 - /* Follow FreeBSD's standard headers ( etc...). */ #undef WCHAR_TYPE diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h index cba3c0b92e3..aff034d5523 100644 --- a/gcc/config/gnu-user.h +++ b/gcc/config/gnu-user.h @@ -26,9 +26,6 @@ a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ -/* Don't assume anything about the header files. */ -#define NO_IMPLICIT_EXTERN_C - #undef ASM_APP_ON #define ASM_APP_ON "#APP\n" diff --git a/gcc/config/i386/cygming.h b/gcc/config/i386/cygming.h index 1d358858106..80a0a37e308 100644 --- a/gcc/config/i386/cygming.h +++ b/gcc/config/i386/cygming.h @@ -378,9 +378,6 @@ do { \ #endif #endif -/* Don't assume anything about the header files. */ -#define NO_IMPLICIT_EXTERN_C - #undef PROFILE_HOOK #define PROFILE_HOOK(LABEL) \ if (MAIN_NAME_P (DECL_NAME (current_function_decl))) \ diff --git a/gcc/config/i386/djgpp.h b/gcc/config/i386/djgpp.h index 42130edf95c..01774cea4d6 100644 --- a/gcc/config/i386/djgpp.h +++ b/gcc/config/i386/djgpp.h @@ -23,9 +23,6 @@ along with GCC; see the file COPYING3. If not see #undef PREFERRED_DEBUGGING_TYPE #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG -/* Don't assume anything about the header files. */ -#define NO_IMPLICIT_EXTERN_C - #undef BSS_SECTION_ASM_OP #define BSS_SECTION_ASM_OP "\t.section\t.bss" diff --git a/gcc/config/i386/nto.h b/gcc/config/i386/nto.h index 339b0d1d878..fbcc668c079 100644 --- a/gcc/config/i386/nto.h +++ b/gcc/config/i386/nto.h @@ -98,8 +98,6 @@ crti.o%s \ #undef WCHAR_TYPE_SIZE #define WCHAR_TYPE_SIZE BITS_PER_WORD -#define NO_IMPLICIT_EXTERN_C 1 - #define TARGET_POSIX_IO #undef DBX_REGISTER_NUMBER diff --git a/gcc/config/ia64/hpux.h b/gcc/config/ia64/hpux.h index 5c5cf7ffa3d..d50c6abf76b 100644 --- a/gcc/config/ia64/hpux.h +++ b/gcc/config/ia64/hpux.h @@ -185,9 +185,6 @@ do { \ #define FLOAT_LIB_COMPARE_RETURNS_BOOL(MODE, COMPARISON) ((MODE) == TFmode) -/* HP-UX headers are C++-compatible. */ -#define NO_IMPLICIT_EXTERN_C - /* HP-UX uses PROFILE_HOOK instead of FUNCTION_PROFILER but we need a FUNCTION_PROFILER defined because its use is not ifdefed. When using PROFILE_HOOK, the profile call comes after the prologue. */ diff --git a/gcc/config/lm32/lm32.h b/gcc/config/lm32/lm32.h index c1b69fa80bc..2a4a2759419 100644 --- a/gcc/config/lm32/lm32.h +++ b/gcc/config/lm32/lm32.h @@ -516,8 +516,4 @@ do { \ #define FUNCTION_MODE SImode -#ifndef NO_IMPLICIT_EXTERN_C -#define NO_IMPLICIT_EXTERN_C -#endif - #define STORE_FLAG_VALUE 1 diff --git a/gcc/config/lm32/uclinux-elf.h b/gcc/config/lm32/uclinux-elf.h index f6413c47a3b..cfaca372462 100644 --- a/gcc/config/lm32/uclinux-elf.h +++ b/gcc/config/lm32/uclinux-elf.h @@ -21,10 +21,6 @@ /* elfos.h should have already been included. Now just override any conflicting definitions and add any extras. */ -/* Do not assume anything about header files. */ -#undef NO_IMPLICIT_EXTERN_C -#define NO_IMPLICIT_EXTERN_C - /* The GNU C++ standard library requires that these macros be defined. */ #undef CPLUSPLUS_CPP_SPEC #define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)" diff --git a/gcc/config/lynx.h b/gcc/config/lynx.h index 50c6d07aa12..e2f768b9f7e 100644 --- a/gcc/config/lynx.h +++ b/gcc/config/lynx.h @@ -165,12 +165,6 @@ along with GCC; see the file COPYING3. If not see # define PREFERRED_DEBUGGING_TYPE DBX_DEBUG #endif -/* We have C++ support in our system headers. */ - -#ifndef NO_IMPLICIT_EXTERN_C -# define NO_IMPLICIT_EXTERN_C -#endif - #ifndef TARGET_POSIX_IO # define TARGET_POSIX_IO #endif diff --git a/gcc/config/mips/elf.h b/gcc/config/mips/elf.h index dab96a69d28..98d4f806ee9 100644 --- a/gcc/config/mips/elf.h +++ b/gcc/config/mips/elf.h @@ -46,5 +46,3 @@ along with GCC; see the file COPYING3. If not see #undef ENDFILE_SPEC #define ENDFILE_SPEC "crtend%O%s crtn%O%s" - -#define NO_IMPLICIT_EXTERN_C 1 diff --git a/gcc/config/mmix/mmix.h b/gcc/config/mmix/mmix.h index aa998c294d5..7b46afcf707 100644 --- a/gcc/config/mmix/mmix.h +++ b/gcc/config/mmix/mmix.h @@ -789,8 +789,6 @@ typedef struct { int regs; int lib; } CUMULATIVE_ARGS; #define FUNCTION_MODE QImode -#define NO_IMPLICIT_EXTERN_C - /* mmix-knuth-mmixware target has no support of C99 runtime */ #undef TARGET_LIBC_HAS_FUNCTION #define TARGET_LIBC_HAS_FUNCTION no_c99_libc_has_function diff --git a/gcc/config/netbsd.h b/gcc/config/netbsd.h index 8f9d5d35580..dfd7c302176 100644 --- a/gcc/config/netbsd.h +++ b/gcc/config/netbsd.h @@ -149,10 +149,6 @@ along with GCC; see the file COPYING3. If not see #undef TARGET_POSIX_IO #define TARGET_POSIX_IO -/* Don't assume anything about the header files. */ -#undef NO_IMPLICIT_EXTERN_C -#define NO_IMPLICIT_EXTERN_C 1 - /* Define some types that are the same on all NetBSD platforms, making them agree with . */ diff --git a/gcc/config/pa/pa-hpux.h b/gcc/config/pa/pa-hpux.h index 19a632b7cfd..496cfb80cc1 100644 --- a/gcc/config/pa/pa-hpux.h +++ b/gcc/config/pa/pa-hpux.h @@ -102,10 +102,6 @@ along with GCC; see the file COPYING3. If not see "%{mlinker-opt:-O} %{!shared:-u main} %{static:-a archive} %{g*:-a archive} %{shared:-b}" #endif -/* hpux8 and later have C++ compatible include files, so do not - pretend they are `extern "C"'. */ -#define NO_IMPLICIT_EXTERN_C - /* hpux11 and earlier don't have fputc_unlocked, so we must inhibit the transformation of fputs_unlocked and fprintf_unlocked to fputc_unlocked. */ #define DONT_HAVE_FPUTC_UNLOCKED diff --git a/gcc/config/powerpcspe/sysv4.h b/gcc/config/powerpcspe/sysv4.h index 4f352746151..756e9e5649b 100644 --- a/gcc/config/powerpcspe/sysv4.h +++ b/gcc/config/powerpcspe/sysv4.h @@ -23,10 +23,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ -/* Header files should be C++ aware in general. */ -#undef NO_IMPLICIT_EXTERN_C -#define NO_IMPLICIT_EXTERN_C - /* Yes! We are ELF. */ #define TARGET_OBJECT_FORMAT OBJECT_ELF diff --git a/gcc/config/riscv/elf.h b/gcc/config/riscv/elf.h index a8357bb6e18..0a4686a693b 100644 --- a/gcc/config/riscv/elf.h +++ b/gcc/config/riscv/elf.h @@ -32,5 +32,3 @@ along with GCC; see the file COPYING3. If not see #undef ENDFILE_SPEC #define ENDFILE_SPEC "crtend%O%s" - -#define NO_IMPLICIT_EXTERN_C 1 diff --git a/gcc/config/rs6000/aix.h b/gcc/config/rs6000/aix.h index 0a931639413..2d585d84d01 100644 --- a/gcc/config/rs6000/aix.h +++ b/gcc/config/rs6000/aix.h @@ -23,6 +23,9 @@ #undef TARGET_AIX #define TARGET_AIX 1 +/* System headers are not C++-aware. */ +#define SYSTEM_IMPLICIT_EXTERN_C 1 + /* Linux64.h wants to redefine TARGET_AIX based on -m64, but it can't be used in the #if conditional in options-default.h, so provide another macro. */ #undef TARGET_AIX_OS diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h index 6b709fb6bab..0c676349cf7 100644 --- a/gcc/config/rs6000/sysv4.h +++ b/gcc/config/rs6000/sysv4.h @@ -23,10 +23,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ -/* Header files should be C++ aware in general. */ -#undef NO_IMPLICIT_EXTERN_C -#define NO_IMPLICIT_EXTERN_C - /* Yes! We are ELF. */ #define TARGET_OBJECT_FORMAT OBJECT_ELF diff --git a/gcc/config/rtems.h b/gcc/config/rtems.h index af58eb16115..9879d5259cd 100644 --- a/gcc/config/rtems.h +++ b/gcc/config/rtems.h @@ -22,10 +22,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ -/* The system headers under RTEMS are C++-aware. */ -#undef NO_IMPLICIT_EXTERN_C -#define NO_IMPLICIT_EXTERN_C - /* * Dummy start/end specification to let linker work as * needed by autoconf scripts using this compiler. diff --git a/gcc/config/s390/tpf.h b/gcc/config/s390/tpf.h index 96802c61c02..5871a6bd3fb 100644 --- a/gcc/config/s390/tpf.h +++ b/gcc/config/s390/tpf.h @@ -30,7 +30,6 @@ along with GCC; see the file COPYING3. If not see #define ASM_APP_ON "#APP\n" #undef ASM_APP_OFF #define ASM_APP_OFF "#NO_APP\n" -#define NO_IMPLICIT_EXTERN_C #define TARGET_POSIX_IO #undef SIZE_TYPE diff --git a/gcc/config/sh/newlib.h b/gcc/config/sh/newlib.h index 4d3ff025a4e..9884856a988 100644 --- a/gcc/config/sh/newlib.h +++ b/gcc/config/sh/newlib.h @@ -23,7 +23,3 @@ along with GCC; see the file COPYING3. If not see #undef LIB_SPEC #define LIB_SPEC "-lc -lgloss" - -#undef NO_IMPLICIT_EXTERN_C -#define NO_IMPLICIT_EXTERN_C 1 - diff --git a/gcc/config/sol2.h b/gcc/config/sol2.h index bc4f63df03b..8b67e78dee0 100644 --- a/gcc/config/sol2.h +++ b/gcc/config/sol2.h @@ -423,9 +423,6 @@ along with GCC; see the file COPYING3. If not see produce the same format. */ #define NM_FLAGS "-png" -/* The system headers under Solaris 2 are C++-aware since 2.0. */ -#define NO_IMPLICIT_EXTERN_C - #define STDC_0_IN_SYSTEM_HEADERS 1 /* Support Solaris-specific format checking for cmn_err. */ diff --git a/gcc/config/sparc/openbsd64.h b/gcc/config/sparc/openbsd64.h index 653eee9fc89..55880f841fc 100644 --- a/gcc/config/sparc/openbsd64.h +++ b/gcc/config/sparc/openbsd64.h @@ -41,9 +41,6 @@ along with GCC; see the file COPYING3. If not see } \ while (0) -/* Inherited from sp64-elf. */ -#undef NO_IMPLICIT_EXTERN_C - #undef ASM_SPEC #define ASM_SPEC "\ -s %{" FPIE_OR_FPIC_SPEC ":-K PIC} \ diff --git a/gcc/config/sparc/sp-elf.h b/gcc/config/sparc/sp-elf.h index 0ee607cbe62..0c533322251 100644 --- a/gcc/config/sparc/sp-elf.h +++ b/gcc/config/sparc/sp-elf.h @@ -18,9 +18,6 @@ You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see . */ -/* Don't assume anything about the header files. */ -#define NO_IMPLICIT_EXTERN_C - /* It's safe to pass -s always, even if -g is not used. */ #undef ASM_SPEC #define ASM_SPEC \ diff --git a/gcc/config/sparc/sp64-elf.h b/gcc/config/sparc/sp64-elf.h index 5414b2de69a..3af2af0b77a 100644 --- a/gcc/config/sparc/sp64-elf.h +++ b/gcc/config/sparc/sp64-elf.h @@ -27,9 +27,6 @@ along with GCC; see the file COPYING3. If not see #undef SPARC_DEFAULT_CMODEL #define SPARC_DEFAULT_CMODEL CM_EMBMEDANY -/* Don't assume anything about the header files. */ -#define NO_IMPLICIT_EXTERN_C - #undef ASM_SPEC #define ASM_SPEC "\ -s %{" FPIE_OR_FPIC_SPEC ":-K PIC} \ diff --git a/gcc/config/spu/spu.h b/gcc/config/spu/spu.h index e846f1c2512..af7395852ce 100644 --- a/gcc/config/spu/spu.h +++ b/gcc/config/spu/spu.h @@ -483,8 +483,6 @@ do { \ #define FUNCTION_MODE QImode -#define NO_IMPLICIT_EXTERN_C 1 - /* Address spaces. */ #define ADDR_SPACE_EA 1 diff --git a/gcc/config/stormy16/stormy16.h b/gcc/config/stormy16/stormy16.h index 4667d8d96dc..8adc6bedcae 100644 --- a/gcc/config/stormy16/stormy16.h +++ b/gcc/config/stormy16/stormy16.h @@ -476,5 +476,3 @@ enum reg_class #define Pmode HImode #define FUNCTION_MODE HImode - -#define NO_IMPLICIT_EXTERN_C diff --git a/gcc/config/v850/v850.h b/gcc/config/v850/v850.h index 04d226a8e05..d3391a68bec 100644 --- a/gcc/config/v850/v850.h +++ b/gcc/config/v850/v850.h @@ -834,12 +834,6 @@ extern const char * GHS_current_section_names [(int) COUNT_OF_GHS_SECTION_KINDS] #define TARGET_ASM_INIT_SECTIONS v850_asm_init_sections -/* Define this so that the cc1plus will not think that system header files - need an implicit 'extern "C" { ... }' assumed. This breaks testing C++ - in a build directory where the libstdc++ header files are found via a - -isystem . */ -#define NO_IMPLICIT_EXTERN_C - #define ADJUST_INSN_LENGTH(INSN, LENGTH) \ ((LENGTH) = v850_adjust_insn_length ((INSN), (LENGTH))) diff --git a/gcc/config/visium/visium.h b/gcc/config/visium/visium.h index dac9a4565d5..f1bd00fadb7 100644 --- a/gcc/config/visium/visium.h +++ b/gcc/config/visium/visium.h @@ -1211,14 +1211,6 @@ do \ machines this should be `QImode'. */ #define FUNCTION_MODE SImode -/* `NO_IMPLICIT_EXTERN_C' - - Define this macro if the system header files support C++ as well as - C. This macro inhibits the usual method of using system header - files in C++, which is to pretend that the file's contents are - enclosed in `extern "C" {...}'. */ -#define NO_IMPLICIT_EXTERN_C - /* Dividing the Output into Sections (Texts, Data, ...) An object file is divided into sections containing different types diff --git a/gcc/config/vx-common.h b/gcc/config/vx-common.h index f5c398ee4b9..d83cbfb7cc9 100644 --- a/gcc/config/vx-common.h +++ b/gcc/config/vx-common.h @@ -18,10 +18,6 @@ You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see . */ -/* VxWorks headers are C++-aware. */ -#undef NO_IMPLICIT_EXTERN_C -#define NO_IMPLICIT_EXTERN_C - /* Most of these will probably be overridden by subsequent headers. We undefine them here just in case, and define VXWORKS_ versions of each, to be used in port-specific vxworks.h. */ diff --git a/gcc/config/xtensa/elf.h b/gcc/config/xtensa/elf.h index a95d7b34229..736fd2d4eb5 100644 --- a/gcc/config/xtensa/elf.h +++ b/gcc/config/xtensa/elf.h @@ -20,9 +20,6 @@ along with GCC; see the file COPYING3. If not see #define TARGET_SECTION_TYPE_FLAGS xtensa_multibss_section_type_flags -/* Don't assume anything about the header files. */ -#define NO_IMPLICIT_EXTERN_C - #undef ASM_APP_ON #define ASM_APP_ON "#APP\n" diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index efa3cbdd653..fc14d6a8af8 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2018-07-05 Nathan Sidwell + + * cp/decl.c (decls_match): Check SYSTEM_IMPLICIT_EXTERN_C not + NO_IMPLICIT_EXTERN_C. + * cp/parser.c (cp_parser_parameter_declaration_clause): Likewise. + 2018-07-04 Ville Voutilainen PR c++/86398 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 0ea3c4a3490..6cfd1a005a8 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -967,7 +967,7 @@ decls_match (tree newdecl, tree olddecl, bool record_versions /* = true */) { if (!prototype_p (f2) && DECL_EXTERN_C_P (olddecl) && (DECL_BUILT_IN (olddecl) -#ifndef NO_IMPLICIT_EXTERN_C +#ifdef SYSTEM_IMPLICIT_EXTERN_C || (DECL_IN_SYSTEM_HEADER (newdecl) && !DECL_CLASS_SCOPE_P (newdecl)) || (DECL_IN_SYSTEM_HEADER (olddecl) && !DECL_CLASS_SCOPE_P (olddecl)) #endif @@ -977,7 +977,7 @@ decls_match (tree newdecl, tree olddecl, bool record_versions /* = true */) if (p1 == void_list_node) TREE_TYPE (newdecl) = TREE_TYPE (olddecl); } -#ifndef NO_IMPLICIT_EXTERN_C +#ifdef SYSTEM_IMPLICIT_EXTERN_C else if (!prototype_p (f1) && (DECL_EXTERN_C_P (olddecl) && DECL_IN_SYSTEM_HEADER (olddecl) diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 5edd0eed76e..366a0d89460 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -21363,7 +21363,7 @@ cp_parser_parameter_declaration_clause (cp_parser* parser) else if (token->type == CPP_CLOSE_PAREN) /* There are no parameters. */ { -#ifndef NO_IMPLICIT_EXTERN_C +#ifdef SYSTEM_IMPLICIT_EXTERN_C if (in_system_header_at (input_location) && current_class_type == NULL && current_lang_name == lang_name_c) diff --git a/gcc/doc/cpp.texi b/gcc/doc/cpp.texi index 4297c0ca9ce..3f7a8fc15f8 100644 --- a/gcc/doc/cpp.texi +++ b/gcc/doc/cpp.texi @@ -3735,7 +3735,7 @@ so certain warnings should be suppressed. @item 4 This indicates that the following text should be treated as being wrapped in an implicit @code{extern "C"} block. -@c maybe cross reference NO_IMPLICIT_EXTERN_C +@c maybe cross reference SYSTEM_IMPLICIT_EXTERN_C @end table As an extension, the preprocessor accepts linemarkers in non-assembler diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index 071d0ffc414..c7745c4efb7 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -23475,7 +23475,7 @@ deprecated. @xref{Deprecated Features}. @item Implicit C language Old C system header files did not contain an @code{extern "C" @{@dots{}@}} -scope to set the language. On such systems, all header files are +scope to set the language. On such systems, all system header files are implicitly scoped inside a C language scope. Also, an empty prototype @code{()} is treated as an unspecified number of arguments, rather than no arguments, as C++ demands. diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index 1c5a80920f1..057d650a61f 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -11149,11 +11149,10 @@ Define this hook to return the name of a header file to be included at the start Define this hook to add target-specific C++ implicit extern C functions. If this function returns true for the name of a file-scope function, that function implicitly gets extern "C" linkage rather than whatever language linkage the declaration would normally have. An example of such function is WinMain on Win32 targets. @end deftypefn -@defmac NO_IMPLICIT_EXTERN_C -Define this macro if the system header files support C++ as well as C@. -This macro inhibits the usual method of using system header files in -C++, which is to pretend that the file's contents are enclosed in -@samp{extern "C" @{@dots{}@}}. +@defmac SYSTEM_IMPLICIT_EXTERN_C +Define this macro if the system header files do not support C++@. +This macro handles system header files by pretending that system +header files are enclosed in @samp{extern "C" @{@dots{}@}}. @end defmac @findex #pragma diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in index bf2c64e15db..7579423668e 100644 --- a/gcc/doc/tm.texi.in +++ b/gcc/doc/tm.texi.in @@ -7657,11 +7657,10 @@ files @code{__STDC__} will always expand to 1. @hook TARGET_CXX_IMPLICIT_EXTERN_C -@defmac NO_IMPLICIT_EXTERN_C -Define this macro if the system header files support C++ as well as C@. -This macro inhibits the usual method of using system header files in -C++, which is to pretend that the file's contents are enclosed in -@samp{extern "C" @{@dots{}@}}. +@defmac SYSTEM_IMPLICIT_EXTERN_C +Define this macro if the system header files do not support C++@. +This macro handles system header files by pretending that system +header files are enclosed in @samp{extern "C" @{@dots{}@}}. @end defmac @findex #pragma diff --git a/gcc/system.h b/gcc/system.h index 88dffccb8ab..8295577618a 100644 --- a/gcc/system.h +++ b/gcc/system.h @@ -1025,7 +1025,7 @@ extern void fancy_abort (const char *, int, const char *) LIBGCC2_LONG_DOUBLE_TYPE_SIZE STRUCT_VALUE \ EH_FRAME_IN_DATA_SECTION TARGET_FLT_EVAL_METHOD_NON_DEFAULT \ JCR_SECTION_NAME TARGET_USE_JCR_SECTION SDB_DEBUGGING_INFO \ - SDB_DEBUG + SDB_DEBUG NO_IMPLICIT_EXTERN_C /* Hooks that are no longer used. */ #pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE \