内部编译器使用包含gcroot的临时对象时出错 [英] Internal Compiler Error using temporary object containing gcroot
本文介绍了内部编译器使用包含gcroot的临时对象时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
#using< mscorlib.dll>
#include< vcclr.h>
public __gc class A {};
struct B {
void f(A * e);
gcroot< A *> e;
};
int main(){
B()。f(new A()); //注意B b; b.f(新A));工作正常
返回0;
}
#using <mscorlib.dll>
#include <vcclr.h>
public __gc class A {};
struct B {
void f(A* e);
gcroot<A*> e;
};
int main() {
B().f(new A()); // note that B b; b.f(new A)); works fine
return 0;
}
推荐答案
哦,好吧。
每个人都知道或者没有人关心......
Vladimir Kouznetsov < VL ***************** @ ngrain.com>在消息中写道
news:eG ************** @ TK2MSFTNGP09.phx.gbl ...
Oh, well.
Either everybody knows or nobody cares...
"Vladimir Kouznetsov" <vl*****************@ngrain.com> wrote in message
news:eG**************@TK2MSFTNGP09.phx.gbl...
#using< mscorlib .dll>
#include< vcclr.h>
public __gc class A {};
struct B {
void f(A * e);
gcroot< ; A *> e;
};
int main(){
B()。f(new A()); //注意B b; b.f(新A));工作正常
返回0;
}
#using <mscorlib.dll>
#include <vcclr.h>
public __gc class A {};
struct B {
void f(A* e);
gcroot<A*> e;
};
int main() {
B().f(new A()); // note that B b; b.f(new A)); works fine
return 0;
}
>哦,好吧。
每个人都知道或者没有人关心...
Either everybody knows or nobody cares...
FWIW,ICE也发布了alpha版Whidbey编译器 -
我会尝试向MS报告。
Dave
-
MVP VC ++ FAQ: http://www.mvps.org/vcfaq
> #using< mscorlib.dll>
>#using <mscorlib.dll>
#include< vcclr.h>
public __gc class A {};
struct B {
void f(A * e);
gcroot< A *> e;
};
int main(){
B()。f(new A()); //注意B b; b.f(新A));工作正常
返回0;
}
#include <vcclr.h>
public __gc class A {};
struct B {
void f(A* e);
gcroot<A*> e;
};
int main() {
B().f(new A()); // note that B b; b.f(new A)); works fine
return 0;
}
虽然编译器提供ICE不正确,但代码是
示例有效吗?
Dave
-
MVP VC ++ FAQ: http://www.mvps.org/vcfaq
这篇关于内部编译器使用包含gcroot的临时对象时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文