public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/109480] New: g++-12 and g++-11 failed to compile the attached source file while g++-10 and clang can.
@ 2023-04-12  5:38 ishikawa at yk dot rim.or.jp
  2023-04-12  5:51 ` [Bug c++/109480] " pinskia at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: ishikawa at yk dot rim.or.jp @ 2023-04-12  5:38 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109480

            Bug ID: 109480
           Summary: g++-12 and g++-11 failed to compile the attached
                    source file while g++-10 and clang can.
           Product: gcc
           Version: 11.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ishikawa at yk dot rim.or.jp
  Target Milestone: ---

Created attachment 54837
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54837&action=edit
target.cpp:  this shows the compiler issue for g++-10 and g++-11

I am reporting a reduced case of a compilation issue noticed when we compile
mozilla firefox browser, and thunderbird mail client software.
For the original problem report and the workaround (basically rewriting the
source code), see the bugzilla entry at mozilla's bugzilla, 
https://bugzilla.mozilla.org/show_bug.cgi?id=1825516

Now, I am a newbie to c-vise source coded reduction tool, but managed to create
the attached reduced source file.
That file shows the symptom.

I am using the following compiler for testing.
Version Info:
g++-10 --version
g++-10 (Debian 10.4.0-7) 10.4.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

ishikawa@ip030:~/Dropbox/TB-DIR/WALL-PATCH-DIR$ g++-11 --version
g++-11 (Debian 11.3.0-12) 11.3.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

ishikawa@ip030:~/Dropbox/TB-DIR/WALL-PATCH-DIR$ g++-12 --version
g++-12 (Debian 12.2.0-14) 12.2.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

ishikawa@ip030:~/Dropbox/TB-DIR/WALL-PATCH-DIR$ clang --version
clang version 15.0.5 (taskcluster-ETTsfeYjQ76jbYk0xzOrPA)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/ishikawa/.mozbuild/clang/bin


The clang compiler I use is a version compiled by mozilla to facilitate that
the developer community uses the same clang everywhere.

g++-10 can compile it.
g++-11 can not.
g++-12 can not.
clang can.
See the console log below.

ishikawa@ip030:~/Dropbox/TB-DIR/WALL-PATCH-DIR$ g++-10 -c target.cpp
ishikawa@ip030:~/Dropbox/TB-DIR/WALL-PATCH-DIR$ g++-11 -c target.cpp
target.cpp: In member function ‘void
mozilla::a11y::RemoteAccessibleBase<Derived>::BoundsWithOffset() const’:
target.cpp:14:57: error: ‘bool
mozilla::a11y::RemoteAccessibleBase<Derived>::ApplyScrollOffset(nsRect&) const
[with Derived = mozilla::a11y::RemoteAccessible]’ is protected within this
context
   14 |   const bool hasScrollArea = remoteAcc.ApplyScrollOffset(bounds);
      |                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
target.cpp:6:14: note: declared protected here
    6 |         bool ApplyScrollOffset(nsRect & a) const { return a.x > 0 ?
true: false; } ;
      |              ^~~~~~~~~~~~~~~~~
ishikawa@ip030:~/Dropbox/TB-DIR/WALL-PATCH-DIR$ g++-12 -c target.cpp
target.cpp: In member function ‘void
mozilla::a11y::RemoteAccessibleBase<Derived>::BoundsWithOffset() const’:
target.cpp:14:57: error: ‘bool
mozilla::a11y::RemoteAccessibleBase<Derived>::ApplyScrollOffset(nsRect&) const
[with Derived = mozilla::a11y::RemoteAccessible]’ is protected within this
context
   14 |   const bool hasScrollArea = remoteAcc.ApplyScrollOffset(bounds);
      |                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
target.cpp:6:14: note: declared protected here
    6 |         bool ApplyScrollOffset(nsRect & a) const { return a.x > 0 ?
true: false; } ;
      |              ^~~~~~~~~~~~~~~~~
ishikawa@ip030:~/Dropbox/TB-DIR/WALL-PATCH-DIR$ clang -c target.cpp
ishikawa@ip030:~/Dropbox/TB-DIR/WALL-PATCH-DIR$ 


Thank you for sharing the great compiler suite with the developer community.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-05-29 10:08 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-12  5:38 [Bug c++/109480] New: g++-12 and g++-11 failed to compile the attached source file while g++-10 and clang can ishikawa at yk dot rim.or.jp
2023-04-12  5:51 ` [Bug c++/109480] " pinskia at gcc dot gnu.org
2023-04-12  6:02 ` [Bug c++/109480] [11/12/13 Regression] non-depedent access goes wrong in a template method sometimes pinskia at gcc dot gnu.org
2023-04-12  6:06 ` pinskia at gcc dot gnu.org
2023-04-12  6:55 ` [Bug c++/109480] [11/12/13 Regression] non-depedent access goes wrong in a template method sometimes since r11-1350-g92bed036098928 marxin at gcc dot gnu.org
2023-04-12 10:31 ` rguenth at gcc dot gnu.org
2023-04-12 12:40 ` ppalka at gcc dot gnu.org
2023-05-07 14:29 ` [Bug c++/109480] [11/12/13/14 " cvs-commit at gcc dot gnu.org
2023-05-07 14:30 ` cvs-commit at gcc dot gnu.org
2023-05-07 14:31 ` [Bug c++/109480] [11/12/13 " ppalka at gcc dot gnu.org
2023-05-29 10:08 ` jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).