public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jason at gcc dot gnu.org" <gcc-bugzilla@gcc.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	[thread overview]
Message-ID: <bug-91706-4-fYSAJKDg1J@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-91706-4@http.gcc.gnu.org/bugzilla/>

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|ice-on-invalid-code         |ice-on-valid-code

--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> ---
Valid variant:

template <bool> struct A;

struct B { static constexpr bool g = false; };

struct C {
  template <typename> static B c ();
};

template <class T> struct D : C {
  using c = decltype (c<T>());
  using E = A<c::g>;
};

D<int> g;

This is a complex interaction of issues.  Looking up c<T> 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 template
argument, leaving

using E = A<decltype(c<T>())>;

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.

  parent reply	other threads:[~2021-04-16 16:07 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-91706-4@http.gcc.gnu.org/bugzilla/>
2020-04-24 14:56 ` [Bug c++/91706] [8/9/10 " ppalka at gcc dot gnu.org
2021-04-16 14:12 ` [Bug c++/91706] [8/9/10/11 " jason at gcc dot gnu.org
2021-04-16 16:07 ` jason at gcc dot gnu.org [this message]
2021-04-20  4:40 ` jason at gcc dot gnu.org
2021-05-14  9:52 ` [Bug c++/91706] [9/10/11/12 " jakub at gcc dot gnu.org
2021-06-01  8:15 ` rguenth at gcc dot gnu.org
2021-06-08  3:56 ` cvs-commit at gcc dot gnu.org
2021-06-08  3:56 ` cvs-commit at gcc dot gnu.org
2021-06-08 13:24 ` cvs-commit at gcc dot gnu.org
2021-06-08 21:20 ` [Bug c++/91706] [9/10 " jason at gcc dot gnu.org
2021-06-16 21:29 ` cvs-commit at gcc dot gnu.org
2022-05-13 20:11 ` jason at gcc dot gnu.org
2022-05-27  9:41 ` [Bug c++/91706] [10 " rguenth at gcc dot gnu.org
2022-06-28 10:38 ` jakub at gcc dot gnu.org
2023-07-07  8:34 ` rguenth at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-91706-4-fYSAJKDg1J@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).