From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 118E33848011; Thu, 18 Mar 2021 20:33:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 118E33848011 From: "msebor at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/99642] Compiler error while using precompiled header and -Wmismatched-tags flag Date: Thu, 18 Mar 2021 20:33:52 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 10.2.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: msebor at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Mar 2021 20:33:53 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99642 --- Comment #3 from Martin Sebor --- Type and spec are the messages facet, but the same problem happens with oth= er types. A simpler test case is: $ (set -x && cat pch.h && cat main.cpp) + cat pch.h #include + cat main.cpp #include #include "pch.h" int main () {} which aborts for basic_istream (and basic_ostream, but no other types). The problem is that some of these types are added to class2loc mapping as t= hey should be, but with a different address than when they're looked up.=20 Instrumenting the code to print out the tree node (as @%p) shows this. The address after type_decl, @0x7fdba48705f0, in the first message, doesn't mat= ch the address after spec, @0x10001df1f0: /build/gcc-master/x86_64-pc-linux-gnu/libstdc++-v3/include/iosfwd:83:11: no= te: add: type_decl @0x7fdba48705f0: =E2=80=98class std::basic_istream<_CharT, _= Traits>=E2=80=99, exist: 0, def_p: 0, complete: 0, template_decl: 1 83 | class basic_istream; | ^~~~~~~~~~~~~ and then /build/gcc-master/x86_64-pc-linux-gnu/libstdc++-v3/include/iosfwd:83:11: no= te: diag_mismatched_tags: type_decl: =E2=80=98class std::basic_istream<_CharT, = _Traits>=E2=80=99 83 | class basic_istream; | ^~~~~~~~~~~~~ main.cpp:3:14: note: diag_mismatched_tags: type: =E2=80=98std::basic_istrea= m<_CharT, _Traits>=E2=80=99, spec @0x10001df1f0: =E2=80=98std::basic_istream<_CharT, = _Traits>=E2=80=99 3 | int main () {} | ^ A record of basic_istream exists but can't be looked up.=