public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/25548] Rejects dependent destructor on a non dedendent name (for basic types) too late
[not found] <bug-25548-4@http.gcc.gnu.org/bugzilla/>
@ 2024-04-04 1:15 ` pinskia at gcc dot gnu.org
0 siblings, 0 replies; only message in thread
From: pinskia at gcc dot gnu.org @ 2024-04-04 1:15 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25548
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to fail| |
Keywords|accepts-invalid |rejects-valid
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Hmm, EDG and MSVC accept the code for both GetChar having Foo and char as
return types. Even accepts this and runs correctly:
```
class Foo {};
Foo a;
struct Bing
{
Foo *GetChar(){return &a;}
};
template<typename T> struct Bar
{
void Wibble()
{
bing.GetChar()->~T(); // How can this be legal if T isn't char?
}
Bing bing;
};
int main(){Bar<Foo> a;a.Wibble();}
```
Also Clang has the same error message as GCC here (for `Foo*` return type
only). I am not sure if there is not a defect report in this area even.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-04-04 1:15 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-25548-4@http.gcc.gnu.org/bugzilla/>
2024-04-04 1:15 ` [Bug c++/25548] Rejects dependent destructor on a non dedendent name (for basic types) too late pinskia 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).