This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/16635] New: g++ doesn't diagnose instantiation of template that uses incomplete type
- From: "geoffk at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Jul 2004 19:45:22 -0000
- Subject: [Bug c++/16635] New: g++ doesn't diagnose instantiation of template that uses incomplete type
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Consider the following:
template <class T> T * foo (T * x)
{
return x++;
}
struct aclass;
aclass *
addone (aclass * x)
{
return foo<aclass>(x);
}
struct aclass
{
int x;
};
At the point where foo<aclass> is instantiated, 'aclass' is incomplete, and 'x++' requires it to be
complete, so this program is not well-formed, and a diagnostic is required.
--
Summary: g++ doesn't diagnose instantiation of template that uses
incomplete type
Product: gcc
Version: 3.5.0
Status: UNCONFIRMED
Keywords: accepts-invalid
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: geoffk at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
GCC host triplet: powerpc-apple-darwin7.3
GCC target triplet: powerpc-apple-darwin7.3
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16635