This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH C++] Fix PR77489 -- mangling of discriminator >= 10
- From: Markus Trippelsdorf <markus at trippelsdorf dot de>
- To: Jason Merrill <jason at redhat dot com>
- Cc: Jakub Jelinek <jakub at redhat dot com>, gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 18 Jan 2017 16:16:44 +0100
- Subject: Re: [PATCH C++] Fix PR77489 -- mangling of discriminator >= 10
- Authentication-results: sourceware.org; auth=none
- References: <20170111114829.GA288@x4> <20170111120330.GM21933@tucnak> <20170112073634.GA301@x4> <CADzB+2=FAJYrQBmgME+VHXn4Fh6GXTyitrf0ekTTLTBHiLV2_A@mail.gmail.com> <20170118085516.GA6668@x4> <CADzB+2me7wywZMgL97UNsZE1d5vZ_gxw8EUn5Sg-yVRYYxLyqw@mail.gmail.com> <20170118142357.GC6668@x4> <CADzB+2kM0n1AvZS_+PH29L7TbCQWRC27VhABkeFeX2kBzLueAQ@mail.gmail.com>
On 2017.01.18 at 10:03 -0500, Jason Merrill wrote:
> On Wed, Jan 18, 2017 at 9:23 AM, Markus Trippelsdorf
> <markus@trippelsdorf.de> wrote:
> > On 2017.01.18 at 09:11 -0500, Jason Merrill wrote:
> >> On Wed, Jan 18, 2017 at 3:55 AM, Markus Trippelsdorf
> >> <markus@trippelsdorf.de> wrote:
> >> > On 2017.01.17 at 13:26 -0500, Jason Merrill wrote:
> >> >> On Thu, Jan 12, 2017 at 2:36 AM, Markus Trippelsdorf
> >> >> <markus@trippelsdorf.de> wrote:
> >> > + if (abi_version_at_least (11) && discriminator - 1 >= 10)
> >> > + {
> >> > + write_char ('_');
> >> > + if (abi_warn_or_compat_version_crosses (11))
> >> > + G.need_abi_warning = 1;
> >>
> >> This check should be outside the abi_version_at_least block; we want
> >> to warn if -fabi-version=10 and -Wabi=11.
> >
> > + if (abi_warn_or_compat_version_crosses (11))
> > + G.need_abi_warning = 1;
> > write_char ('_');
> > if (abi_version_at_least (11) && discriminator - 1 >= 10)
>
> Ah, but it does need to be controlled by the second part of this test;
> we only want the warning if the discriminator will be two digits.
No. It appears to work even without the additional condition:
% g++ -fabi-version=10 -Wabi=11 -Wall -c gcc/testsuite/g++.dg/abi/pr77489.C
gcc/testsuite/g++.dg/abi/pr77489.C:56:16: warning: the mangled name of ‘localVar’ changes between -fabi-version=10 (_ZZ3foovE8localVar_11) and -fabi-version=11 (_ZZ3foovE8localVar__11_) [-Wabi]
static int localVar = 12;
^~~~~~~~
gcc/testsuite/g++.dg/abi/pr77489.C:52:16: warning: the mangled name of ‘localVar’ changes between -fabi-version=10 (_ZZ3foovE8localVar_10) and -fabi-version=11 (_ZZ3foovE8localVar__10_) [-Wabi]
static int localVar = 11;
^~~~~~~~
--
Markus