Bug report: static string in dllimport-ed class causes internal co

G

Guest

[ Microsoft Visual C++ .NET 69586-335-0000007-18332 ]

Hi,

I'm not sure this is the right place to report bugs in MS Visual C++ .NET
2003. I posted the same message on MSDN forums
(http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=95745).

In any case, the code below causes the following error:

main.cpp(22): fatal error C1001: INTERNAL COMPILER ERROR (compiler file
'f:\vs70builds\3077\vc\Compiler\Utc\src\P2\p2symtab.c', line 4533)

My code:

// Bug report: static string variable in dllimport-ed class causes
// internal compiler error in p2symtab, line 4553

#include <iostream>
#include <string>

using namespace std;

class __declspec(dllimport) input_port {

public:
int foo() {
static string str = "ABCD" ;
return 2;
}
};

int main()
{
cout << __FILE__ << endl;

string r ("ABCD");
return 0;
}

The two strings (str in foo, and 'r' in main) need to be the same for the
bug to occur.
 
D

David Lowndes

I'm not sure this is the right place to report bugs in MS Visual C++ .NET
2003. I posted the same message on MSDN forums
(http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=95745).

In any case, the code below causes the following error:

main.cpp(22): fatal error C1001: INTERNAL COMPILER ERROR (compiler file
'f:\vs70builds\3077\vc\Compiler\Utc\src\P2\p2symtab.c', line 4533)

FWIW, your example compiles cleanly with the VS2005 beta. I could
reproduce the problem with VS2003.

Dave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top