Sign in to follow this  
KingofNoobs

Microsoft (R) Optimizing Compiler Has Stopped Working

Recommended Posts

KingofNoobs    305
Hello,

I have just received the error in the title when trying to compile the following code

auto ExtractString = [&](string& dest, char source, FileSection& currentFileSection, FileSection nextFileSection = END_OF_HEADER)
{ ... };

Just for context, I am writing a custom file format parser.

Am I just hosed here, or is there some way to work around a broken compiler?

Thanks and best,

Dave

Share this post


Link to post
Share on other sites
rip-off    10979
What is the minimal source file that reproduces the error?

For example, I get "error C3486: a parameter for a lambda cannot have a default argument" with the following code:
[code]
#include <string>

using std::string;

enum FileSection {
START_OF_HEADER,
END_OF_HEADER
};

int main() {
auto ExtractString = [&](string& dest, char source, FileSection& currentFileSection, FileSection nextFileSection = END_OF_HEADER) {
};
std::string string;
FileSection current = START_OF_HEADER;
ExtractString(string, 'a', current);
}
[/code]
Some light Googling suggests this is actually compliant with the standard and not an incomplete implementation.

It would be interesting to know what changes you have to make to generate the crash. Even if it is not legal code, it shouldn't crash the compiler so you should look into reporting this.

Share this post


Link to post
Share on other sites
BitMaster    8651
While I have found sporadically code that could crash an MSVC compiler in practically every instance it was rather clear that the code was wrong and needed to be fixed anyway (admittedly, that would have been easier with a proper error message).

That said, such cases have always been extremely rare for me. Infrequently the compiler crashes, but usually that is fixed by just trying again or doing a clean first. There was one instance where I had to manually (clean or rebuild explicitly did not do the job) delete all intermediate files to get things working again, but that was back in MSVC 2003.

Share this post


Link to post
Share on other sites
Khatharr    8812
Yeah, I tanked it once myself, though now I can't remember what it was I did. (It was something really crazy that came out of a typo.)

I just remember laughing for about 10 minutes about it.

Your compiler is fine. It's just a microsoft product. Edited by Khatharr

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this