• FEATURED

View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

# Microsoft (R) Optimizing Compiler Has Stopped Working

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

4 replies to this topic

### #1KingofNoobs  Members

Posted 18 November 2012 - 10:28 AM

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

I wonder as I wander...

http://www.davesgameoflife.com

### #2Nik02  Members

Posted 19 November 2012 - 01:46 AM

Check your lambda capture syntax (the [&] stuff).

Alternatively, use a conventional function (and its pointer) in place of the lambda expression.

Niko Suni

### #3rip-off  Moderators

Posted 19 November 2012 - 02:34 AM

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:
#include <string>

using std::string;

enum FileSection {
};

int main() {
auto ExtractString = [&](string& dest, char source, FileSection& currentFileSection, FileSection nextFileSection = END_OF_HEADER) {
};
std::string string;
ExtractString(string, 'a', current);
}

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.

### #4BitMaster  Members

Posted 19 November 2012 - 02:43 AM

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.

### #5Khatharr  Members

Posted 19 November 2012 - 06:32 PM

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

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

Edited by Khatharr, 19 November 2012 - 06:34 PM.

void hurrrrrrrr() {__asm sub [ebp+4],5;}

There are ten kinds of people in this world: those who understand binary and those who don't.

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.