Well this is fun. Usually, when others (esp. junior programmers) tell me there must be a bug in the compiler, I tell them to check their code first, because it's usually related to undefined behavior. This month, however, I managed to run into a grand total of 3 actual compiler bugs. One in GCC, two in Visual Studio.
- GCC can't handle thread_local variables captured by a generic lambda ( https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67436 )
- Visual Studio only generates one virtual function table if there is more than one anonymous member struct ( http://stackoverflow.com/questions/2082339/virtual-tables-on-anonymous-classes )
- Visual Studio (up to and including VS2013) can't deal with range-based for loops directly followed by a do { } while, which can easily occur due to a macro ( https://connect.microsoft.com/VisualStudio/feedback/details/855078 )
And in fact I encountered the latter two today. And it's only 2 PM.