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? | | | | re: Visual C++ 7.1 INTERNAL COMPILER ERROR -- crossposted clc++ and microsoft.public.vstudio.general
"Alf P. Steinbach" <alfps@start.no> schrieb im Newsbeitrag
news:40982cdf.1787618500@news.individual.net...
[color=blue]
> // It does not work with some compiler options, which means e.g. Andrei
> // Alexandrescu's ScopeGuard does not compile with this compiler.
>
>[/color]
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 | | | | re: Visual C++ 7.1 INTERNAL COMPILER ERROR -- crossposted clc++ and microsoft.public.vstudio.general
* "Arne Adams" <arne.adams@t-online.de> schriebt:[color=blue]
> "Alf P. Steinbach" <alfps@start.no> schrieb im Newsbeitrag
> news:40982cdf.1787618500@news.individual.net...
>[color=green]
> > // It does not work with some compiler options, which means e.g. Andrei
> > // Alexandrescu's ScopeGuard does not compile with this compiler.
> >
> >[/color]
> 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[/color]
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.
[color=blue]
> and which are the effects?[/color]
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?
[color=blue]
> As to syntax errors leading to ICEs in template code - that's nothing new for
> VC++.[/color]
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? | | | | re: Visual C++ 7.1 INTERNAL COMPILER ERROR -- crossposted clc++ and microsoft.public.vstudio.general
* "Arne Adams" <arne.adams@t-online.de> schriebt:[color=blue]
>
> As to syntax errors leading to ICEs in template code - that's nothing new for
> VC++.[/color]
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? | | | | re: Visual C++ 7.1 INTERNAL COMPILER ERROR -- crossposted clc++ and microsoft.public.vstudio.general
"Alf P. Steinbach" <alfps@start.no> wrote in message
news:409975ed.1871777625@news.individual.net...[color=blue]
> * "Arne Adams" <arne.adams@t-online.de> schriebt:[color=green]
> >
> > As to syntax errors leading to ICEs in template code - that's nothing[/color][/color]
new for[color=blue][color=green]
> > VC++.[/color]
>
> 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[/color]
have[color=blue]
> reported any bugs, especially not in our compilers (muu haa, evil[/color]
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 | | | | re: Visual C++ 7.1 INTERNAL COMPILER ERROR -- crossposted clc++ and microsoft.public.vstudio.general
"Mike Wahler" <mkwahler@mkwahler.net> wrote in message
news:r_gmc.8712$Hs1.5515@newsread2.news.pas.earthl ink.net...[color=blue]
>
> "Alf P. Steinbach" <alfps@start.no> wrote in message
> news:409975ed.1871777625@news.individual.net...[color=green]
>> * "Arne Adams" <arne.adams@t-online.de> schriebt:[color=darkred]
>> >
>> > As to syntax errors leading to ICEs in template code - that's nothing[/color][/color]
> new for[color=green][color=darkred]
>> > VC++.[/color]
>>
>> 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[/color]
> have[color=green]
>> reported any bugs, especially not in our compilers (muu haa, evil[/color]
> 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'. :-)[/color]
"To bug or not to bug... or is it a feature?
What was the question?"
--
Unforgiven | | | | re: Visual C++ 7.1 INTERNAL COMPILER ERROR -- crossposted clc++ and microsoft.public.vstudio.general
"Alf P. Steinbach" <alfps@start.no> wrote in message
news:40982cdf.1787618500@news.individual.net...[color=blue]
> // 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;
> }
> }[/color]
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 | | | | re: Visual C++ 7.1 INTERNAL COMPILER ERROR -- crossposted clc++ and microsoft.public.vstudio.general
"Ioannis Vranos" <ivr@guesswh.at.grad.com> wrote in message
news:c7e1nc$2vni$1@ulysses.noc.ntua.gr...[color=blue]
>
>
> 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[/color]
type[color=blue]
> 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.[/color]
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 | | | | re: Visual C++ 7.1 INTERNAL COMPILER ERROR -- crossposted clc++ and microsoft.public.vstudio.general
* "Ioannis Vranos" <ivr@guesswh.at.grad.com> schriebt:[color=blue]
> "Ioannis Vranos" <ivr@guesswh.at.grad.com> wrote in message
> news:c7e1nc$2vni$1@ulysses.noc.ntua.gr...[color=green]
> >
> >
> > Your code does not compile under GCC:[/color][/color]
It should not, since it contains a bug at the line that says "bug".
[color=blue]
> 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[/color]
Yep.
[color=blue]
> 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).[/color]
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? | | | | re: Visual C++ 7.1 INTERNAL COMPILER ERROR -- crossposted clc++ and microsoft.public.vstudio.general
"Alf P. Steinbach" <alfps@start.no> wrote in message
news:409aa80c.1950145109@news.individual.net...[color=blue]
>[color=green]
> > Well you can contact Technical Support on this (also tell them to fix[/color][/color]
the[color=blue][color=green]
> > Start Page::Online Resources issue (works only for Administrator account[/color][/color]
in[color=blue][color=green]
> > my PC).[/color]
>
> It doesn't work at all on one PC.
>
> Seems it has to do with national language support.[/color]
Meaning?
Regards,
Ioannis Vranos | | | | re: Visual C++ 7.1 INTERNAL COMPILER ERROR -- crossposted clc++ and microsoft.public.vstudio.general
* "Ioannis Vranos" <ivr@guesswh.at.grad.com> schriebt:[color=blue]
> "Alf P. Steinbach" <alfps@start.no> wrote in message
> news:409aa80c.1950145109@news.individual.net...[color=green]
> >[color=darkred]
> > > Well you can contact Technical Support on this (also tell them to fix[/color][/color]
> the[color=green][color=darkred]
> > > Start Page::Online Resources issue (works only for Administrator account[/color][/color]
> in[color=green][color=darkred]
> > > my PC).[/color]
> >
> > It doesn't work at all on one PC.
> >
> > Seems it has to do with national language support.[/color]
>
> Meaning?[/color]
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? | | | | re: Visual C++ 7.1 INTERNAL COMPILER ERROR -- crossposted clc++ and microsoft.public.vstudio.general
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:
[color=blue]
> VectorImpl( T const (&values)[N] ): elem( values, values+N ) {}[/color]
Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq |  | | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 226,419 network members.
|