-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[C++23][Modules] imported function with auto return type causes lambda does not satisfy 'move_constructible' #130080
Comments
@llvm/issue-subscribers-clang-modules Author: None (thbwd)
A.ixx:
```c++
module;
#include <vector> export module A; export auto f(const std::vector<int> &vec) { /void clang_bug_fix() {
Produces:
Even though the lambda is move constructible. The bug disappears when uncommenting the function clang_bug_fix. CMakeLists.txt: cmake_minimum_required(VERSION 3.30)
project(test)
set(CMAKE_CXX_STANDARD 23)
add_executable(test main.cpp)
target_sources(test
PUBLIC
FILE_SET all_my_modules TYPE CXX_MODULES FILES
A.ixx
) |
@llvm/issue-subscribers-clang-frontend Author: None (thbwd)
A.ixx:
```c++
module;
#include <vector> export module A; export auto f(const std::vector<int> &vec) { /void clang_bug_fix() {
Produces:
Even though the lambda is move constructible. The bug disappears when uncommenting the function clang_bug_fix. CMakeLists.txt: cmake_minimum_required(VERSION 3.30)
project(test)
set(CMAKE_CXX_STANDARD 23)
add_executable(test main.cpp)
target_sources(test
PUBLIC
FILE_SET all_my_modules TYPE CXX_MODULES FILES
A.ixx
) |
Is this reproducible when replacing the lambda with an equivalent hand-write function object? |
I didn't specifically test a separate function but just converting the lambda to a function pointer with the unary + makes the bug go away:
|
Ah, I think I misunderstood. I haven't tried writing an equivalent "functor" so far. |
I am not sure if this relates to #116087 Can you verify by adding an And also |
A.ixx:
main.cpp:
Produces:
Even though the lambda is move constructible. The bug disappears when uncommenting the function clang_bug_fix.
CMakeLists.txt:
The text was updated successfully, but these errors were encountered: