Hi All,

Here is some code from another thread in 'comp.lang.c++'. I get ICE on
the line that contains 'friend' keyword.

void Function();
int main() {
Function(); // This does not work
}

#include <stdio.h>

template <typename T>
class Test
{
public:
friend void Function() { printf("Function()"); }
};

template class Test<int>; // explicit instantiation

(compiler file 'msc1.cpp', line 1411)

Any clues?

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask

Re: ICE compiling template code by David

David
Fri Jul 11 12:37:49 CDT 2008

>Here is some code from another thread in 'comp.lang.c++'. I get ICE on
>the line that contains 'friend' keyword.

Which version of VC++ are you using?

Dave

Re: ICE compiling template code by Victor

Victor
Fri Jul 11 12:48:32 CDT 2008

David Lowndes wrote:
>> Here is some code from another thread in 'comp.lang.c++'. I get ICE on
>> the line that contains 'friend' keyword.
>
> Which version of VC++ are you using?

Sorry... VS Team System 2008.

I've submitted a bug report. See

https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=355868

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask

Re: ICE compiling template code by David

David
Fri Jul 11 19:04:15 CDT 2008

>>> Here is some code from another thread in 'comp.lang.c++'. I get ICE on
>>> the line that contains 'friend' keyword.
>>
>> Which version of VC++ are you using?
>
>Sorry... VS Team System 2008.

Have you tried it with the beta SP1 version?

Dave

Re: ICE compiling template code by Victor

Victor
Mon Jul 14 08:49:41 CDT 2008

David Lowndes wrote:
>>>> Here is some code from another thread in 'comp.lang.c++'. I get ICE on
>>>> the line that contains 'friend' keyword.
>>> Which version of VC++ are you using?
>> Sorry... VS Team System 2008.
>
> Have you tried it with the beta SP1 version?

No. But I got a confirmation of the defect from MS. They say the
development team is going to be looking into it.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask