Skip to content

<ranges>: namespace views not available with clang-cl #2232

@AlexGuteniev

Description

@AlexGuteniev

Describe the bug
<ranges>: namespace views not available with clang-cl

Command-line test case

#include <iostream>
#include <ranges>
#include <vector>

int main()
{
    std::vector<int> ints{ 0, 1, 2, 3, 4, 5 };

    auto x = ints | std::ranges::views::transform([](auto i) { return i * i; });
}
d:\temp2>cl /std:c++latest test.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.30.30528 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

/std:c++latest is provided as a preview of language features from the latest C++
working draft, and we're eager to hear about bugs and suggestions for improvements.
However, note that these features are provided as-is without support, and subject
to changes or removal as the working draft evolves. See
https://go.microsoft.com/fwlink/?linkid=2045807 for details.

test.cpp
Microsoft (R) Incremental Linker Version 14.30.30528.0
Copyright (C) Microsoft Corporation.  All rights reserved.

/out:test.exe
test.obj

d:\temp2>clang-cl /std:c++latest test.cpp
test.cpp(9,34): error: no member named 'views' in namespace 'std::ranges'
    auto x = ints | std::ranges::views::transform([](auto i) { return i * i; });
                    ~~~~~~~~~~~~~^
1 error generated.

Expected behavior
clang-cl should compile it

STL version

Version 17.0.0 Preview 4.1

Additional context
This is also tracked as DevCom-1544711

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfixedSomething works now, yay!

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions