This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/19950] error: incomplete type `Environment' used in nested name specifier
- 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: 14 Feb 2005 20:08:22 -0000
- Subject: [Bug c++/19950] error: incomplete type `Environment' used in nested name specifier
- References: <20050214114402.19950.ddonovan@latentzero.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-02-14 20:08 -------
(In reply to comment #3)
> I don't understand!
If I reduce the source further we get:
class Environment;
template<class T> struct ArrayCollection
{
int insert(const T& theObj)
{
Environment::ReportError();
}
};
struct Environment
{
static void ReportError(void);
};
At the point were we call Environment::ReportError, Environment is not a complete class so we don't
know what the functions are at this point. If we had changed the template class ArrayCollection to a
non template, we would get the error before 3.4.0 also because it needs to be defined before.
To fix your code, maybe move a header file includes around but I did not look into where the header
files are.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19950