Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Problems with parser

Hi,

I do hope that this is the right mailing list to report bugs / ask for help.

I'm using eclipse 3.0 and cdt 2.0.

I get a lot of parsing errors in my project (using a standard make project out of an existing project).


For instance in the following snippet (at the end of mail) will cause problems.

It looks like although the parser could determine which specialisation of my template is used it will always use the default one, which in my case will lead to the problem that _all_ of my types are unkown to cdt.

Aw, after fixing that I've found another nasty problem with templates:


I've got a template class with a template parameter which specifies it's subclass. In this case the methods inherited from this subclass are not visible to cdt and I get parsing errors whereever I use them.

At least thats what I think is happening, is there an easy way to get more detailed output on what causes parse errors?

My Code is perfectly legal (compiles on a lot of platforms), so I dont think that the problems are due to coding errors.

And, both visual studio .net 2003 and visual assist x parse the source correctly and provide me with (more or less) usefull code completion.

with kind regards Philip


-------8<-----------------

namespace XYZ_
{

   enum
   {
      OS_TYPE_UNKOWN=0,
      OS_TYPE_WINDOWS,
      OS_TYPE_LINUX,
      OS_TYPE_UNIX
   };

   template <int os_type>
   struct FF_BaseTypes
   {
   };

#ifdef OS_WINDOWS
   int const OS_TYPE = OS_TYPE_WINDOWS;
#endif
#ifdef OS_LINUX
   int const OS_TYPE = OS_TYPE_LINUX;
#endif
}

#ifdef OS_WINDOWS
#include "FF_BaseTypesWindows.h"
#endif
#ifdef OS_LINUX
#include "FF_BaseTypesLinux.h"
#endif

namespace XYZ_
{
   typedef FF_BaseTypes<OS_TYPE>::FF_Int32 FF_Int32;
   typedef FF_BaseTypes<OS_TYPE>::FF_Uint32 FF_Uint32;
}

In FF_BaseTypesLinux.h I just have a specialistation of the FF_BaseTypes template providing the types i then use in my Namespace
------8<-------------------




Back to the top