Skip to content

[C++20] [Modules] Error with modules, format, pipe operator - function with deduced return type cannot be used #61912

Open
@rnikander

Description

@rnikander

This seems to be a bug.

https://godbolt.org/z/T7Y934rz3

Something bad happening with C++20 modules + <format> causes this confusing error. Remove the #include <format> and it goes away.

In module 'Mod' imported from /app/main.cc:2:
PartA.cc:13:32: error: function 'operator|<std::vector<int> &, std::__range_adaptor_closure_t<std::__bind_back_t<std::ranges::views::__drop::__fn, std::tuple<int>>>>' with deduced return type cannot be used before it is defined
        auto wtf = b_thing.vec | std::views::drop(1);
                               ^          

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:modulesC++20 modules and Clang Header Modules

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions