public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/105725] [ICE] segfault with `-Wmismatched-tags`
Date: Fri, 27 May 2022 16:03:36 +0000	[thread overview]
Message-ID: <bug-105725-4-VGuWfRbLBw@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-105725-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Marek Polacek <mpolacek@gcc.gnu.org>:

https://gcc.gnu.org/g:d822f4bbd714c6595f70cc68888dcebecfb6662d

commit r13-803-gd822f4bbd714c6595f70cc68888dcebecfb6662d
Author: Marek Polacek <polacek@redhat.com>
Date:   Fri May 27 10:51:30 2022 -0400

    c++: Fix ICE with -Wmismatched-tags [PR105725]

    Here we ICE with -Wmismatched-tags on something like

      template <class T>
      bool B<T, enable_if_t<is_class_v<class T::foo>>>;

    Specifically, the "class T::foo" bit.  There, class_decl_loc_t::add gets
    a TYPENAME_TYPE as TYPE, rather than a class/union type, so checking
    TYPE_BEING_DEFINED will crash.  I think it's OK to allow a TYPENAME_TYPE to
    slip into that function; we just shouldn't consider the 'class' tag
redundant
    (which works as a 'typename').  In fact, every other compiler *requires*
it.

            PR c++/105725

    gcc/cp/ChangeLog:

            * parser.cc (class_decl_loc_t::add): Check CLASS_TYPE_P.

    gcc/testsuite/ChangeLog:

            * g++.dg/warn/Wmismatched-tags-10.C: New test.

  parent reply	other threads:[~2022-05-27 16:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-25  3:46 [Bug c++/105725] New: " tim at klingt dot org
2022-05-25  8:38 ` [Bug c++/105725] " tim at klingt dot org
2022-05-25 11:25 ` mpolacek at gcc dot gnu.org
2022-05-27 14:25 ` mpolacek at gcc dot gnu.org
2022-05-27 16:03 ` cvs-commit at gcc dot gnu.org [this message]
2022-05-27 16:08 ` cvs-commit at gcc dot gnu.org
2022-05-27 16:09 ` mpolacek at gcc dot gnu.org
2022-10-24  8:50 ` cvs-commit at gcc dot gnu.org
2022-10-24  8:51 ` rguenth at gcc dot gnu.org
2022-10-25 22:34 ` pinskia 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-105725-4-VGuWfRbLBw@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).