* [Bug c++/105725] [ICE] segfault with `-Wmismatched-tags`
2022-05-25 3:46 [Bug c++/105725] New: [ICE] segfault with `-Wmismatched-tags` tim at klingt dot org
@ 2022-05-25 8:38 ` tim at klingt dot org
2022-05-25 11:25 ` mpolacek at gcc dot gnu.org
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: tim at klingt dot org @ 2022-05-25 8:38 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105725
--- Comment #1 from tim blechmann <tim at klingt dot org> ---
it also ICEs on valid code:
```
template <bool> struct enable_if;
template <bool _Cond> using enable_if_t = typename enable_if<_Cond>::type;
template <typename> bool is_class_v;
template <class, class> bool IsPrivateSignalArg;
template <class T>
bool IsPrivateSignalArg<T, enable_if_t<is_class_v<class T::QPrivateSignal>>>;
```
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/105725] [ICE] segfault with `-Wmismatched-tags`
2022-05-25 3:46 [Bug c++/105725] New: [ICE] segfault with `-Wmismatched-tags` 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
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-05-25 11:25 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105725
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed| |2022-05-25
Ever confirmed|0 |1
CC| |mpolacek at gcc dot gnu.org
Status|UNCONFIRMED |NEW
Keywords|ice-on-invalid-code |ice-on-valid-code
--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Confirmed. Started with r10-7424-g04dd734b52de1218 when the warning was added.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/105725] [ICE] segfault with `-Wmismatched-tags`
2022-05-25 3:46 [Bug c++/105725] New: [ICE] segfault with `-Wmismatched-tags` 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
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-05-27 14:25 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105725
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |mpolacek at gcc dot gnu.org
Status|NEW |ASSIGNED
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/105725] [ICE] segfault with `-Wmismatched-tags`
2022-05-25 3:46 [Bug c++/105725] New: [ICE] segfault with `-Wmismatched-tags` tim at klingt dot org
` (2 preceding siblings ...)
2022-05-27 14:25 ` mpolacek at gcc dot gnu.org
@ 2022-05-27 16:03 ` cvs-commit at gcc dot gnu.org
2022-05-27 16:08 ` cvs-commit at gcc dot gnu.org
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-27 16:03 UTC (permalink / raw)
To: gcc-bugs
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.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/105725] [ICE] segfault with `-Wmismatched-tags`
2022-05-25 3:46 [Bug c++/105725] New: [ICE] segfault with `-Wmismatched-tags` tim at klingt dot org
` (3 preceding siblings ...)
2022-05-27 16:03 ` cvs-commit at gcc dot gnu.org
@ 2022-05-27 16:08 ` cvs-commit at gcc dot gnu.org
2022-05-27 16:09 ` mpolacek at gcc dot gnu.org
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-27 16:08 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105725
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Marek Polacek
<mpolacek@gcc.gnu.org>:
https://gcc.gnu.org/g:2c11a9a380e7af333e19d6e576a889646d699b2a
commit r12-8419-g2c11a9a380e7af333e19d6e576a889646d699b2a
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.
(cherry picked from commit d822f4bbd714c6595f70cc68888dcebecfb6662d)
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/105725] [ICE] segfault with `-Wmismatched-tags`
2022-05-25 3:46 [Bug c++/105725] New: [ICE] segfault with `-Wmismatched-tags` tim at klingt dot org
` (4 preceding siblings ...)
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
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-05-27 16:09 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105725
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #5 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed for GCC 12.2 and 13.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/105725] [ICE] segfault with `-Wmismatched-tags`
2022-05-25 3:46 [Bug c++/105725] New: [ICE] segfault with `-Wmismatched-tags` tim at klingt dot org
` (5 preceding siblings ...)
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
8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-10-24 8:50 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105725
--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Richard Biener
<rguenth@gcc.gnu.org>:
https://gcc.gnu.org/g:bd0c76a2329e7fe6d6612c2259647bbb67f5866a
commit r11-10332-gbd0c76a2329e7fe6d6612c2259647bbb67f5866a
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.c (class_decl_loc_t::add): Check CLASS_TYPE_P.
gcc/testsuite/ChangeLog:
* g++.dg/warn/Wmismatched-tags-10.C: New test.
(cherry picked from commit d822f4bbd714c6595f70cc68888dcebecfb6662d)
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/105725] [ICE] segfault with `-Wmismatched-tags`
2022-05-25 3:46 [Bug c++/105725] New: [ICE] segfault with `-Wmismatched-tags` tim at klingt dot org
` (6 preceding siblings ...)
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
8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-10-24 8:51 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105725
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to fail| |10.4.0, 11.3.0
Known to work| |11.3.1
--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
And eleven based on request.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/105725] [ICE] segfault with `-Wmismatched-tags`
2022-05-25 3:46 [Bug c++/105725] New: [ICE] segfault with `-Wmismatched-tags` tim at klingt dot org
` (7 preceding siblings ...)
2022-10-24 8:51 ` rguenth at gcc dot gnu.org
@ 2022-10-25 22:34 ` pinskia at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-10-25 22:34 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105725
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |11.4
^ permalink raw reply [flat|nested] 10+ messages in thread