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.