================
@@ -0,0 +1,89 @@
+// RUN: %clang_cc1 -std=c++26 -ast-print %s | FileCheck %s
+
+// The `[a, b]` binding list must survive -ast-print, not just the type.
+
+namespace std {
+using size_t = decltype(sizeof(0));
+template <typename> struct tuple_size;
+template <size_t, typename> struct tuple_element;
+} // namespace std
+
+namespace Aggregate {
+struct Pair { int a, b; };
+Pair get();
+Pair &getref();
+
+// CHECK-LABEL: void local() {
+void local() {
+  // CHECK-NEXT: auto [x, y] = get();
+  auto [x, y] = get();
+  // CHECK-NEXT: auto & [rx, ry] = getref();
+  auto &[rx, ry] = getref();
+  // CHECK-NEXT: const auto [cx, cy] = get();
+  const auto [cx, cy] = get();
+  // CHECK-NEXT: static auto [sx, sy] = get();
+  static auto [sx, sy] = get();
+}
+} // namespace Aggregate
+
+namespace Array {
+// CHECK-LABEL: void local() {
+void local() {
+  // CHECK-NEXT: int arr[3] = {1, 2, 3};
+  int arr[3] = {1, 2, 3};
+  // CHECK-NEXT: auto [a, b, c]
----------------
AaronBallman wrote:

Where is the initializer?

https://github.com/llvm/llvm-project/pull/221711
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to