public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/102551] New: Failing compile-time comparison of std::type_info addresses
@ 2021-10-01 8:03 fchelnokov at gmail dot com
2021-10-01 8:13 ` [Bug c++/102551] " pinskia at gcc dot gnu.org
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: fchelnokov at gmail dot com @ 2021-10-01 8:03 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102551
Bug ID: 102551
Summary: Failing compile-time comparison of std::type_info
addresses
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: fchelnokov at gmail dot com
Target Milestone: ---
The following valid code is rejected by GCC:
```
#include <typeinfo>
int main() {
constexpr auto v1 = &typeid(int);
constexpr auto v2 = &typeid(char);
static_assert( v1 != v2 );
}
```
Demo: https://gcc.godbolt.org/z/eexj7vcPG
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/102551] Failing compile-time comparison of std::type_info addresses
2021-10-01 8:03 [Bug c++/102551] New: Failing compile-time comparison of std::type_info addresses fchelnokov at gmail dot com
@ 2021-10-01 8:13 ` pinskia at gcc dot gnu.org
2021-10-01 8:13 ` pinskia at gcc dot gnu.org
2022-01-06 14:49 ` ppalka at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-10-01 8:13 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102551
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |rejects-valid, wrong-code
Known to fail| |4.6.4
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
It has always been broken since C++11 support was added:
#include <typeinfo>
static_assert( &typeid(int) != &typeid(char) ,"");
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/102551] Failing compile-time comparison of std::type_info addresses
2021-10-01 8:03 [Bug c++/102551] New: Failing compile-time comparison of std::type_info addresses fchelnokov at gmail dot com
2021-10-01 8:13 ` [Bug c++/102551] " pinskia at gcc dot gnu.org
@ 2021-10-01 8:13 ` pinskia at gcc dot gnu.org
2022-01-06 14:49 ` ppalka at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-10-01 8:13 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102551
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
Last reconfirmed| |2021-10-01
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/102551] Failing compile-time comparison of std::type_info addresses
2021-10-01 8:03 [Bug c++/102551] New: Failing compile-time comparison of std::type_info addresses fchelnokov at gmail dot com
2021-10-01 8:13 ` [Bug c++/102551] " pinskia at gcc dot gnu.org
2021-10-01 8:13 ` pinskia at gcc dot gnu.org
@ 2022-01-06 14:49 ` ppalka at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: ppalka at gcc dot gnu.org @ 2022-01-06 14:49 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102551
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |ppalka at gcc dot gnu.org
Resolution|--- |DUPLICATE
Depends on|103600 |
--- Comment #2 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Let's call this a dup of the recently fixed PR103600
*** This bug has been marked as a duplicate of bug 103600 ***
Referenced Bugs:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103600
[Bug 103600] Cannot use typeid result in constant expressions
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-01-06 14:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-01 8:03 [Bug c++/102551] New: Failing compile-time comparison of std::type_info addresses fchelnokov at gmail dot com
2021-10-01 8:13 ` [Bug c++/102551] " pinskia at gcc dot gnu.org
2021-10-01 8:13 ` pinskia at gcc dot gnu.org
2022-01-06 14:49 ` ppalka at gcc dot gnu.org
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).