Visual C ++ 7.1内部编译器错误 - 交叉发布的clc ++和microsoft.public.vstudio.general [英] Visual C++ 7.1 INTERNAL COMPILER ERROR -- crossposted clc++ and microsoft.public.vstudio.general

查看:53
本文介绍了Visual C ++ 7.1内部编译器错误 - 交叉发布的clc ++和microsoft.public.vstudio.general的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

//像往常一样,错误消息将一个人指向报告错误。

//

//和往常一样,没有办法这样做没有支付

//权限...

//

//或者使用三到四个小时来查找_current_报告页面。 ..

//

//由于我现在花了很多时间报告这个编译器错误,请

//也修复__LINE__宏。

//

//它不适用于某些编译器选项,这意味着例如Andrei

// Alexandrescu的ScopeGuard不能用这个编译器编译。

#include< vector>

#include< iostream> ;


模板< typename T,size_t N>

struct ArrayHolder

{

T elem [N];

};


模板< typename T>

class VectorImpl

{

private:

std :: vector< T> elem;

public:

template< size_t N>

VectorImpl(T const(& values)[N]):elem(值,值+ N){}


T& operator [](size_t i){return elem.at(i); }

T const& operator [](size_t i)const {return elem.at(i); }

};


模板< typename T>

class Vector:public VectorImpl< T>

{

public:

template< size_t N>


//这是一个错误。它会导致编译器崩溃。也就是说,一个ICE。

VectorImpl(T const(& values)[N]):VectorImpl(values){}

};


int main()

{

typedef ArrayHolder< double,6> DoubleArray6;

static DoubleArray6 const x = {10,20,30,40,50,60};

static DoubleArray6 const xArray [] = {x};


Vector< DoubleArray6> v(xArray);

for(size_t i = 0; i< 6; ++ i)

{

std :: cout << v [0] .elem [i]<< std :: endl;

}

}


-

A:因为它混乱了人们通常阅读文字的顺序。

问:为什么顶级发布这么糟糕的事情?

A:热门发布。

问:usenet和电子邮件中最烦人的事情是什么?

// As usual the error message directs one to the report the bug.
//
// And as usual there is absolutely no way to do so without paying for
// the privilege...
//
// Or using three or four hours to find the _current_ reporting page...
//
// Since I''m now using much time on reporting this compiler bug, please
// do also fix the __LINE__ macro.
//
// It does not work with some compiler options, which means e.g. Andrei
// Alexandrescu''s ScopeGuard does not compile with this compiler.
#include <vector>
#include <iostream>

template< typename T, size_t N >
struct ArrayHolder
{
T elem[N];
};

template< typename T >
class VectorImpl
{
private:
std::vector<T> elem;
public:
template< size_t N >
VectorImpl( T const (&values)[N] ): elem( values, values+N ) {}

T& operator[]( size_t i ){ return elem.at( i ); }
T const& operator[]( size_t i ) const { return elem.at( i ); }
};

template< typename T >
class Vector: public VectorImpl< T >
{
public:
template< size_t N >

// This is a bug. It causes a compiler crash. That is, an ICE.
VectorImpl( T const (&values)[N] ): VectorImpl( values ) {}
};

int main()
{
typedef ArrayHolder<double, 6> DoubleArray6;
static DoubleArray6 const x = { 10, 20, 30, 40, 50, 60 };
static DoubleArray6 const xArray[] = { x };

Vector<DoubleArray6> v( xArray );
for( size_t i = 0; i < 6; ++i )
{
std::cout << v[0].elem[i] << std::endl;
}
}

--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?

推荐答案

" Alf P. Steinbach" <人*** @ start.no> schrieb im Newsbeitrag

新闻:40 ***************** @ news.individual.net ...
"Alf P. Steinbach" <al***@start.no> schrieb im Newsbeitrag
news:40*****************@news.individual.net...
//它不适用于某些编译器选项,这意味着例如Andrei
// Alexandrescu的ScopeGuard不能用这个编译器编译。
// It does not work with some compiler options, which means e.g. Andrei
// Alexandrescu''s ScopeGuard does not compile with this compiler.



我在模板中使用__LINE__宏作为整数常量参数

(还有VC7.1)因此它不仅仅是好奇心:

您指的是哪些选项以及哪些是效果?

至于导致模板代码中的ICE的语法错误 - 这对于

VC ++来说并不新鲜。


-

问候,


Arne


I use the __LINE__ Macro a lot as integral constant parameter in my templates
(with VC7.1 as well) hence it is more than just curiosity:
which options do you refer to and which are the effects?

As to syntax errors leading to ICEs in template code - that''s nothing new for
VC++.

--
Regards,

Arne


*" Arne Adams" < AR ******** @ t-online.de> schriebt:
* "Arne Adams" <ar********@t-online.de> schriebt:
" Alf P. Steinbach" <人*** @ start.no> schrieb im Newsbeitrag
新闻:40 ***************** @ news.individual.net ...
"Alf P. Steinbach" <al***@start.no> schrieb im Newsbeitrag
news:40*****************@news.individual.net...
//它不适用于某些编译器选项,这意味着例如Andrei
// Alexandrescu的ScopeGuard不能用这个编译器编译。

我在模板中使用__LINE__宏作为整数常量参数
(使用VC7.1因此,它不仅仅是好奇心:
你指的是哪些选项
// It does not work with some compiler options, which means e.g. Andrei
// Alexandrescu''s ScopeGuard does not compile with this compiler.

I use the __LINE__ Macro a lot as integral constant parameter in my templates
(with VC7.1 as well) hence it is more than just curiosity:
which options do you refer to




必须检查。一种这样的选择是/ ZI。 (大写),编辑并继续,

默认情况下在Visual Studio项目中设置...别认识其他人。


哪些是影响?


它不会产生新的行号;我记得它不会产生行数。


用于例如STATIC_ASSERT这是固定的。通过另一个bug(虽然不是一个/ b $ b ICE),即只要

定义相同,VC就允许多个同名的typedef - 而且对于我而言知道并注意检查,

也许当它们不同时。


在ScopeGuard中使用时,typedef bug不会修复 __LINE__错误,所以两个

ScopeGuards或更多在同一范围内无法编译(我也不在乎检查

这里的细节,也许就是那个即使一个人不编译......

;-))。解决方法是使用非标准的Microsoft __COUNTER__宏。

但是为什么一个人必须特殊情况下编译这个编译器?


关于语法在模板代码中导致ICE的错误 - 这对于VC ++来说并不是什么新鲜事。



Had to check that. One such option is "/ZI" (uppercase), edit-and-continue,
which is set by default in a Visual Studio project... Don''t know others.

and which are the effects?
It does not generate new line numbers as it should; as I recall it does not
even generate line numbers.

For use in e.g. STATIC_ASSERT this is "fixed" by another bug (although not an
ICE), namely that VC allows multiple typedefs of same name as long as the
definitions are the same -- and for all that I know and care to check,
perhaps also when they are different.

For use in ScopeGuard the typedef bug does not "fix" the __LINE__ bug, so two
ScopeGuards or more in the same scope does not compile (I don''t care to check
the details here either, perhaps it was that even one does not compile...
;-)). A workaround is to use the non-standard Microsoft __COUNTER__ macro.
But why should one have to special-case this compiler, always?

As to syntax errors leading to ICEs in template code - that''s nothing new for
VC++.




如果假设编译器只会被赋予正确的代码

然后它可以在极端程度上进行优化。


-

答:因为它弄乱了订单人们通常会阅读文字。

问:为什么顶级发布这么糟糕的事情?

A:热门发布。

问: usenet和电子邮件中最烦人的事情是什么?



If the assumption is that the compiler will only ever be given correct code
then it can be optimized to an extreme degree.

--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?


*" Arne Adams" < AR ******** @ t-online.de> schriebt:
* "Arne Adams" <ar********@t-online.de> schriebt:

关于在模板代码中导致ICE的语法错误 - 这对于VC ++来说并不是什么新鲜事。

As to syntax errors leading to ICEs in template code - that''s nothing new for
VC++.




这是一个令人遗憾的羞耻微软无法报告编译器

崩溃(ICE),除非_paying_他们接受报告,然后忘记了。

对于GNU编译器,OTOH。,它真的很简单:上次我报告了一个ICE

有人修复了这个bug并在半小时内报告了。


微软:bug?什么虫子?我们没有任何错误 - 也就是说,没有人会报告任何错误,特别是在我们的编译器中没有(muu haa,邪恶的笑声)。


-

答:因为它弄乱了人们通常阅读文字的顺序。

问:为什么顶级发布这么糟糕的事情?

A:热门发布。

问:usenet和电子邮件中最烦人的是什么?



It is a crying shame that Microsoft provides no way to report a compiler
crash (ICE), except by _paying_ them to accept a report, then forgotten.

For the GNU compiler, OTOH., it''s real easy: last time I reported an ICE
someone had fixed the bug and reported back within half an hour.

Microsoft: bug? What bug? We don''t have any bugs -- to wit, nobody have
reported any bugs, especially not in our compilers (muu haa, evil laughter).

--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?


这篇关于Visual C ++ 7.1内部编译器错误 - 交叉发布的clc ++和microsoft.public.vstudio.general的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆