ICE with template function pointer

D

Drew

VS.NET 2003 V7.1.3088 - Unmanaged code

I'm getting:

c:\Proj\pt.h(581) : fatal error C1001: INTERNAL COMPILER ERROR
(compiler file 'msc1.cpp', line 2701)
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information

Pseudo code:

template <class T> class Vec2
{
protected:
T n[2];
public:
Vec2() { n[0] = n[1] = 0; }
};

template <class T> class Pt2 : public Vec2<T>
{
public:
Pt2() {}

static void (*circfcn)( T x, T y, T rad);
};

// Chokes here:
template <class T> void (*Pt2<T>::circfcn)( T x, T y, T rad);

Any fix/workaround?

Thanks,
Drew
 
D

David Lowndes

VS.NET 2003 V7.1.3088 - Unmanaged code
I'm getting:

c:\Proj\pt.h(581) : fatal error C1001: INTERNAL COMPILER ERROR
(compiler file 'msc1.cpp', line 2701)
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information

Pseudo code:

template <class T> class Vec2
{
protected:
T n[2];
public:
Vec2() { n[0] = n[1] = 0; }
};

template <class T> class Pt2 : public Vec2<T>
{
public:
Pt2() {}

static void (*circfcn)( T x, T y, T rad);
};

// Chokes here:
template <class T> void (*Pt2<T>::circfcn)( T x, T y, T rad);

Drew,

Pasting your code snippet into a VS2003 C++ console framework doesn't
give the ICE for me. Do you have a short console example that you can
reproduce the problem with?

Dave
 
D

David Lowndes

Just getting back to this. Here's a .zip with a small project.
It's actually a static lib project, I don't know if that matters.

Drew.

That does reproduce the problem with the VS2003 compiler. The good
news is that it compiles fine with the Whidbey alpha release compiler,
so presumably it's something that MS are aware of and have already
fixed.

If you can't see a work-around for this problem with VS2003, I suggest
that you report the issue with MS PSS (phone). I don't think you
shouldn't be charged - since it's a bug, and they may be able to come
up with a work-around.

Dave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top