473,756 Members | 2,558 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C1001 internal error - templates, regression from VC++ 6.0

VC++ .NET 7.1 gives me an internal error from this code.
It worked fine in VC++ 6.0 and other compilers.
Are there any patches/SP's available for the 7.1 compiler?

template<typena me T> struct a { char d; T o; };
#define A(T) (sizeof(a<T>) - sizeof(T))
template<int N> struct AS { char x[N]; };
template<typena me T> AS<A(T)> AF(T const &);
#define AE(E) sizeof(AF(E))
int main(int n, char **) { return AE(n); }
/* ends */

Nov 16 '05 #1
2 1360
>VC++ .NET 7.1 gives me an internal error from this code.
It worked fine in VC++ 6.0 and other compilers.


FWIW, I can reproduce the ICE with 7.1, but it compiles cleanly with
the Whidbey compiler so it looks like MS have fixed this already - not
that that's much use to you at the minute!

If no one here comes up with a suggested work-around, I recommend that
you contact MS product support - they may be able to tell you how to
work around it, and if there isn't a work-around, there may be a fix
they can supply you with.

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
Nov 16 '05 #2
On Fri, 21 Nov 2003 07:20:58 -0800, "Al Grant"
<an*******@disc ussions.microso ft.com> wrote:
VC++ .NET 7.1 gives me an internal error from this code.
It worked fine in VC++ 6.0 and other compilers.
Are there any patches/SP's available for the 7.1 compiler?

template<typen ame T> struct a { char d; T o; };
#define A(T) (sizeof(a<T>) - sizeof(T))
template<int N> struct AS { char x[N]; };
template<typen ame T> AS<A(T)> AF(T const &);
#define AE(E) sizeof(AF(E))
int main(int n, char **) { return AE(n); }
/* ends */

Try this as a replacement for the A macro - it works for me.

template <typename T>
struct gs
{
static const size_t ret = sizeof (T);
};
#define A(T) ( gs< a<T> >::ret - gs<T>::ret)
Graeme

Nov 16 '05 #3

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

Similar topics

6
8624
by: paul calvert | last post by:
I hope somewhere here has encountered and solved a similar problem in the past. 1) on a new Win2000 PC: installed Visual C++ 6.0 download & install single file Service Pack 5.0 2) try to build my gui and dll projects, whose project, workspace, source files all resided on network drive mapped to H. The H mapping,
0
1719
by: JimmyS | last post by:
I am getting this error .. c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\stl_alloc.h(305) : fatal error C1001: INTERNAL COMPILER ERROR (compiler file 'msc1.cpp', line 2701) when including any files for templates .. #include <fstream> , #include <string>, #include <vector>, #include <list> etc... The funny thing is that was not happening before, it really used to work fine with templates. By removing the STL include...
1
1479
by: CB | last post by:
I'm upgrading our product from VC6 to the VC7 compiler and came across the C1001 error: fatal error C1001: INTERNAL COMPILER ERROR (compiler file 'f:\vs70builds\3077\vc\Compiler\CxxFE\sl\P1 \C\toil.c', line 6931) I've managed to reliably reproduce it using the few lines of code below that does not use any of my own product code:
1
4070
by: Irakli Lomidze | last post by:
Internal Compiler Error VS.NET 2003 Enterprise Architect Windowx XP SP1 RAM 1GB Free DiskSpacs 20GB
1
336
by: Irakli Lomidze | last post by:
Internal Compiler Error VS.NET 2003 Enterprise Architect Windowx XP SP1 RAM 1GB Free DiskSpacs 20GB
10
3284
by: PufferFish | last post by:
Hi folks, I hope that this is the correct group for these things, apologies if not. I've got a strange compiler error. It appears to be similar to the issue described in knowledgebase article 320004 except that particular problem was
4
3057
by: cgparis | last post by:
Dear forum members, I am trying to compile C++ code under MS Visual Studio .NET 2003, which references the latest Xerces C++ release library (2.6.0). This Xerces release was made available recently by the Apache organization. I've defined a system variable on windows as follows: XERCESCROOT: <...>\xerces-c_2_6_0-windows_nt-msvc_60
2
2953
by: Itjalve | last post by:
This gives me a fatal error. I'm using .NET VC7.1 and made a win32 consol app, I have no problems with VC6. Debug build. I have removed nearly all my code this is whats left. From the beginning the template was defined in a .h file, but that has no effect, same error. I have seen when searching for fatal error that there are some problems with templates and optimization, but nothing as simple like this. I'm i doing something wrong?
1
9531
by: Anonymous | last post by:
My code has suddenly stopped compiling after some refactoring I carried out last week. I am using VC8 on W2K professional I get the following cryptic error: Error 77 fatal error C1001: An internal error has occurred in the compiler. c:\program files\microsoft visual studio 8\vc\include\xmemory 155
0
9287
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9886
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9857
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8723
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7259
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6542
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5155
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5318
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3369
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.