From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D9AB4389247D; Fri, 16 Apr 2021 16:07:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D9AB4389247D From: "jason at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/91706] [8/9/10/11 Regression] ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in equate_type_number_to_die, at dwarf2out.c:5782 Date: Fri, 16 Apr 2021 16:07:39 +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.0 X-Bugzilla-Keywords: accepts-invalid, ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jason at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: jason at gcc dot gnu.org X-Bugzilla-Target-Milestone: 8.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: keywords 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: Fri, 16 Apr 2021 16:07:40 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D91706 Jason Merrill changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|ice-on-invalid-code |ice-on-valid-code --- Comment #6 from Jason Merrill --- Valid variant: template struct A; struct B { static constexpr bool g =3D false; }; struct C { template static B c (); }; template struct D : C { using c =3D decltype (c()); using E =3D A; }; D g; This is a complex interaction of issues. Looking up c in the definition= of D::c finds C::c, OK. Looking up c in the definition of E finds D::c, which= is depedent, OK. Since the alias is not dependent, we strip it from the templ= ate argument, leaving using E =3D A())>; where 'c' still refers to C::c. But instantiating E looks up 'c' again and finds D::c, which isn't a function, so things go wrong. I think the bug here is looking up 'c' in D at instantiation time; the declaration we found before is not dependent.=