This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/19950] error: incomplete type `Environment' used in nested name specifier


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]