juce_AudioFormatManager.cpp(43): error C2059: syntax error: '}'


#1

Don’t know why, but i get this error in VS2015, latest develop tip

modules\juce_audio_formats\format/juce_AudioFormatManager.cpp(43): error C2059: syntax error: '}'

after i added these brackets, the compiler was satisfied

 #if JUCE_DEBUG
        for (auto* af : knownFormats)
		{ // <- new
	        if (af->getFormatName() == newFormat->getFormatName())
                jassertfalse; // trying to add the same format twice!
		} // <- new
  #endif

#2

I had this issue just yesterday and noticed a cleaning and rebuilding fixed it.


#3

It’s a VS2015 compiler bug. We’ve hit it before, but it’s hard to remember to avoid it…


#4

Another reason to avoid raw loops, I guess. :wink: