This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ PATCH] Fix option handling when -std=gnu++14 is not used (PR 69865)
- From: Bernd Edlinger <bernd dot edlinger at hotmail dot de>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Jason Merrill <jason at redhat dot com>, Jonathan Wakely <jwakely at redhat dot com>
- Date: Fri, 19 Feb 2016 11:08:48 +0000
- Subject: Re: [C++ PATCH] Fix option handling when -std=gnu++14 is not used (PR 69865)
- Authentication-results: sourceware.org; auth=none
- Authentication-results: gcc.gnu.org; dkim=none (message not signed) header.d=none;gcc.gnu.org; dmarc=none action=none header.from=hotmail.de;
- References: <HE1PR07MB090548A2180950184AF65A60E4A00 at HE1PR07MB0905 dot eurprd07 dot prod dot outlook dot com>,<20160219105612 dot GA3017 at tucnak dot redhat dot com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:23
On 19.02.2016 11:56, Jakub Jelinek wrote:
>
> On Fri, Feb 19, 2016 at 10:50:34AM +0000, Bernd Edlinger wrote:
> > While I think that we should probably not define __GNUC_GNU_INLINE__ at all for C++,
> > because it is meaningless, I am warned that this could break (already broken) header files.
>
> It is not meaningless. The various headers need to know if it is safe to
> use the gnu_inline attribute in C++.
>
> In any case, the desirable state is that e.g. the -E -dD output should be
> identical if you explicitly request the default -std= version vs. if it is
> set implicitly. We should verify it is the case even for C.
>
> Jakub
I absolutely agree with you.
The correct solution is probably doing this:
--- gcc/cp/cfns.h.jj 2016-01-04 15:30:50.000000000 +0100
+++ gcc/cp/cfns.h 2016-02-19 12:00:15.730375049 +0100
@@ -124,9 +124,6 @@
#ifdef __GNUC__
__inline
-#ifdef __GNUC_STDC_INLINE__
-__attribute__ ((__gnu_inline__))
-#endif
#endif
const char *
libc_name_p (register const char *str, register unsigned int len)
and remove this hunk instead:
@@ -786,7 +790,7 @@ c_common_post_options (const char **pfilename)
/* By default we use C99 inline semantics in GNU99 or C99 mode. C99
inline semantics are not supported in GNU89 or C89 mode. */
if (flag_gnu89_inline == -1)
- flag_gnu89_inline = !flag_isoc99;
+ flag_gnu89_inline = c_dialect_cxx () || !flag_isoc99;
else if (!flag_gnu89_inline && !flag_isoc99)
error ("-fno-gnu89-inline is only supported in GNU99 or C99 mode");
Would you like that better?
Thanks
Bernd.