473,323 Members | 1,589 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

Visual C++ 7.1 INTERNAL COMPILER ERROR -- crossposted clc++ and microsoft.public.vstudio.general

// 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?
Jul 22 '05 #1
11 2392
"Alf P. Steinbach" <al***@start.no> schrieb im Newsbeitrag
news:40*****************@news.individual.net...
// 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 and which are the effects?

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

--
Regards,

Arne
Jul 22 '05 #2
* "Arne Adams" <ar********@t-online.de> schriebt:
"Alf P. Steinbach" <al***@start.no> schrieb im Newsbeitrag
news:40*****************@news.individual.net...
// 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


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++.


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?
Jul 22 '05 #3
* "Arne Adams" <ar********@t-online.de> schriebt:

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


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?
Jul 22 '05 #4

"Alf P. Steinbach" <al***@start.no> wrote in message
news:40*****************@news.individual.net...
* "Arne Adams" <ar********@t-online.de> schriebt:

As to syntax errors leading to ICEs in template code - that's nothing new for VC++.
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).

Anecdote: When I was doing telephone tech support for
several Microsoft compilers (back in the 80's), we were
prohibited from using the word 'bug' when talking to
customers. We were instructed to use the word 'problem',
and in some cases, 'feature'. :-)

-Mike
Jul 22 '05 #5
"Mike Wahler" <mk******@mkwahler.net> wrote in message
news:r_*****************@newsread2.news.pas.earthl ink.net...

"Alf P. Steinbach" <al***@start.no> wrote in message
news:40*****************@news.individual.net...
* "Arne Adams" <ar********@t-online.de> schriebt:
>
> As to syntax errors leading to ICEs in template code - that's nothing new for > VC++.


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).

Anecdote: When I was doing telephone tech support for
several Microsoft compilers (back in the 80's), we were
prohibited from using the word 'bug' when talking to
customers. We were instructed to use the word 'problem',
and in some cases, 'feature'. :-)

"To bug or not to bug... or is it a feature?
What was the question?"

--
Unforgiven

Jul 22 '05 #6
"Alf P. Steinbach" <al***@start.no> wrote in message
news:40*****************@news.individual.net...
// 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;
}
}

Your code does not compile under GCC:
Executing: C:\Program Files\ConTEXT\ConExec.exe
"c:\mingw\bin\g++.exe" -std=c++98 -pedantic-errors -O3 -Wall "temp.cpp" -o
temp

temp.cpp:44: error: ISO C++ forbids declaration of `VectorImpl' with no type
temp.cpp: In member function `int Vector<T>::VectorImpl(const T (&)[N])':
temp.cpp:44: error: only constructors take base initializers
temp.cpp:44: error: class `Vector<T>' does not have any field named
`VectorImpl
'
temp.cpp: At global scope:
temp.cpp: In instantiation of `Vector<main()::DoubleArray6>':
temp.cpp:53: instantiated from here
temp.cpp:39: error: base `VectorImpl<main()::DoubleArray6>' with only
non-default constructor in class without a constructor
temp.cpp: In function `int main()':
temp.cpp:53: error: no matching function for call to `
Vector<main()::DoubleArray6>::Vector(const main()::DoubleArray6[1])'
temp.cpp:39: error: candidates are:
Vector<main()::DoubleArray6>::Vector(const
Vector<main()::DoubleArray6>&)

Execution finished.


Regards,

Ioannis Vranos

Jul 22 '05 #7
"Ioannis Vranos" <iv*@guesswh.at.grad.com> wrote in message
news:c7***********@ulysses.noc.ntua.gr...


Your code does not compile under GCC:
Executing: C:\Program Files\ConTEXT\ConExec.exe
"c:\mingw\bin\g++.exe" -std=c++98 -pedantic-errors -O3 -Wall "temp.cpp" -o
temp

temp.cpp:44: error: ISO C++ forbids declaration of `VectorImpl' with no type temp.cpp: In member function `int Vector<T>::VectorImpl(const T (&)[N])':
temp.cpp:44: error: only constructors take base initializers
temp.cpp:44: error: class `Vector<T>' does not have any field named
`VectorImpl
'
temp.cpp: At global scope:
temp.cpp: In instantiation of `Vector<main()::DoubleArray6>':
temp.cpp:53: instantiated from here
temp.cpp:39: error: base `VectorImpl<main()::DoubleArray6>' with only
non-default constructor in class without a constructor
temp.cpp: In function `int main()':
temp.cpp:53: error: no matching function for call to `
Vector<main()::DoubleArray6>::Vector(const main()::DoubleArray6[1])'
temp.cpp:39: error: candidates are:
Vector<main()::DoubleArray6>::Vector(const
Vector<main()::DoubleArray6>&)

Execution finished.


And it indeed causes problem to the VC++ 7.1 compiler:

test.cpp(49): 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

Well you can contact Technical Support on this (also tell them to fix the
Start Page::Online Resources issue (works only for Administrator account in
my PC).


Regards,

Ioannis Vranos

Jul 22 '05 #8
* "Ioannis Vranos" <iv*@guesswh.at.grad.com> schriebt:
"Ioannis Vranos" <iv*@guesswh.at.grad.com> wrote in message
news:c7***********@ulysses.noc.ntua.gr...


Your code does not compile under GCC:

It should not, since it contains a bug at the line that says "bug".
And it indeed causes problem to the VC++ 7.1 compiler:

test.cpp(49): 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
Yep.
Well you can contact Technical Support on this (also tell them to fix the
Start Page::Online Resources issue (works only for Administrator account in
my PC).


It doesn't work at all on one PC.

Seems it has to do with national language support.

--
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?
Jul 22 '05 #9
"Alf P. Steinbach" <al***@start.no> wrote in message
news:40*****************@news.individual.net...
Well you can contact Technical Support on this (also tell them to fix the Start Page::Online Resources issue (works only for Administrator account in my PC).


It doesn't work at all on one PC.

Seems it has to do with national language support.

Meaning?


Regards,

Ioannis Vranos

Jul 22 '05 #10
* "Ioannis Vranos" <iv*@guesswh.at.grad.com> schriebt:
"Alf P. Steinbach" <al***@start.no> wrote in message
news:40*****************@news.individual.net...
Well you can contact Technical Support on this (also tell them to fix the Start Page::Online Resources issue (works only for Administrator account in my PC).


It doesn't work at all on one PC.

Seems it has to do with national language support.


Meaning?


Meaning I found several pages on the net with supposed fixes, involving
some language setting in Internet Explorer, which didn't work but have
worked for some others. It reminds of the old Class Wizard that only
worked properly with US English (and perhaps French or German) settings.
How is it even _possible_ to bring in an English dependency,
and how is it _possible_ to ignore such blatant bugs for years on end?

Follow-up to set to [microsoft.public.vstudio.general].

--
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?
Jul 22 '05 #11
FWIW, the C1001 ICE doesn't occur when compiled with the Whidbey
compiler - it generates several compiler errors, starting with:

error C2143: syntax error : missing ')' before 'const'"

For this indicated incorrect line:
VectorImpl( T const (&values)[N] ): elem( values, values+N ) {}


Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
Jul 22 '05 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Raziel? | last post by:
Greetings, When Installing Visual Studio .NET the following error occurs: Internal Error 25300 I've tried setup in safemode and the same error occurs. The disk is brand new and clean.
19
by: Alf P. Steinbach | last post by:
// 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...
5
by: Somesh | last post by:
#include<map> #include<iostream> #include<string> using namespace std; int main() { map <string,int> test;
5
by: Anton Noll | last post by:
We are using Visual Studio 2003.NET (C++) for the development of our software in the fields digital signal processing and numerical acoustics. One of our programs was working correctly if we are...
26
by: Bruno Jouhier [MVP] | last post by:
I'm currently experiencing a strange phenomenon: At my Office, Visual Studio takes a very long time to compile our solution (more than 1 minute for the first project). At home, Visual Studio...
19
by: Martin Oddman | last post by:
Hi, I have a compiling problem. Please take a look at the code below. I have an application that is built upon three tiers: one data tier (Foo.DataManager), one business tier (Foo.Kernel) and...
2
by: newsgroup.poster | last post by:
Hello, I'm encounterring the following problem when I try to add object datasource to my C# project: - the wizzard form open - I choose object, then click on next - the next screen display...
5
by: user923005 | last post by:
I seem to recall that if a macro is evaluated and the macro is defined, but a value for the macro does not exist, it should be evaluated as zero, but I can't find it in the standard. There is a...
2
by: blogman | last post by:
I am getting a Visual studio 2008 IDE application R6034 runtime error. This means that the IDE application is raising the error not the application I am building. This means that Microsoft did not...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.