Visual C++ 2017 compiler bugs

Back to Blog

Here are some of the bugs I have found in the Visual C++ 2017 compiler.

Coroutines cause ICE

22.03.2017

The following causes an internal compiler error when the build mode is not debug.

#include <experimental/generator>

struct B {
    ~B() {}
};

struct Vector {
    ~Vector() {
        B* data = 0;
        data->~B();
    }
};

std::experimental::generator<int> xSet() {
    Vector aSet;
    B b;
    Vector bSet;
    co_yield 4;
}

int main() {
    for (auto&& x : xSet()) {}
    return 0;
}