This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/25548] New: Rejects dependent deconstructor on a non depdendent name (for basic types) too late
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Dec 2005 16:01:44 -0000
- Subject: [Bug c++/25548] New: Rejects dependent deconstructor on a non depdendent name (for basic types) too late
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Testcase:
class Foo {};
struct Bing
{
char *GetChar();
};
template<typename T> struct Bar
{
void Wibble()
{
bing.GetChar()->~T(); // How can this be legal if T isn't char?
}
Bing bing;
};
-----
If we change the return type of GetChar() to Foo * (from char*), we get an
error:
t.cc: In member function ?void Bar<T>::Wibble()?:
t.cc:12: error: the type being destroyed is ?Foo?, but the destructor refers to
?T?
--
Summary: Rejects dependent deconstructor on a non depdendent name
(for basic types) too late
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Keywords: accepts-invalid
Severity: minor
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pinskia at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25548