-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[C++20] [Modules] Handling capturing strucuted bindings
Close #72828. This should be an overlook that we extend the type of captures but we forgot to fix it in deserializer side.
- Loading branch information
1 parent
e399a31
commit 649e811
Showing
2 changed files
with
25 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Test that we can handle capturing structured bindings. | ||
// | ||
// RUN: rm -fr %t | ||
// RUN: mkdir %t | ||
// | ||
// RUN: %clang_cc1 -std=c++23 -triple %itanium_abi_triple \ | ||
// RUN: %s -emit-module-interface -o %t/m.pcm | ||
// RUN: %clang_cc1 -std=c++23 -triple %itanium_abi_triple \ | ||
// RUN: -S -emit-llvm -disable-llvm-passes %t/m.pcm \ | ||
// RUN: -o - | FileCheck %s | ||
|
||
export module m; | ||
|
||
struct s { | ||
int m; | ||
}; | ||
|
||
void f() { | ||
auto [x] = s(); | ||
[x] {}; | ||
} | ||
|
||
// Check that we can generate the LLVM IR expectedly. | ||
// CHECK: define{{.*}}@_ZGIW1m |