This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH C++] Fix PR77489 -- mangling of discriminator >= 10


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]