ericniebler / range-v3

Range library for C++14/17/20, basis for C++20's std::ranges
Other
4.11k stars 440 forks source link

ICE in view.cache1 with VS2019 16.8.3 (and VS2019 16.9.0 Preview 2.0) (only in module interface units) #1595

Open szilardszaloki opened 3 years ago

szilardszaloki commented 3 years ago

Hi there, I don't know if this is the right place to report this, but here it goes: ice.ixx:

module;
#include <string>
#include <range/v3/view/cache1.hpp>
#include <range/v3/view/iota.hpp>
#include <range/v3/view/join.hpp>
#include <range/v3/view/transform.hpp>
export module ice;

export void Ice() {
    auto rng =
          ranges::views::iota(1, 4)
        | ranges::views::transform([](int const i) { return std::string(i, 'a' + i); })
        | ranges::views::cache1
      //| ranges::views::join('-')
    ;
}

main.cpp:

import ice;

int main(int const, char const* const []) {
    Ice();
    return 0;
}

If you comment out | ranges::views::cache1, then it just goes away. Let me know if I should submit this problem for Visual Studio instead.

JohelEGP commented 3 years ago

All ICEs are compiler bugs, so yes. Instead of an ICE, it should either work or give you an error. In case of an error, you can come back here.

szilardszaloki commented 3 years ago

Alright, thanks! I saw #1222, so I wasn't sure.

szilardszaloki commented 3 years ago

In case anyone is interested: the Visual Studio ticket.