diff options
Diffstat (limited to 'clang/test/SemaCXX/cxx1z-decomposition.cpp')
-rw-r--r-- | clang/test/SemaCXX/cxx1z-decomposition.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/cxx1z-decomposition.cpp b/clang/test/SemaCXX/cxx1z-decomposition.cpp index 3c9b181f1c8..8b5fd6809bb 100644 --- a/clang/test/SemaCXX/cxx1z-decomposition.cpp +++ b/clang/test/SemaCXX/cxx1z-decomposition.cpp @@ -81,4 +81,21 @@ struct PR37352 { void f() { static auto [a] = *this; } // expected-error {{cannot be declared 'static'}} }; +namespace instantiate_template { + +template <typename T1, typename T2> +struct pair { + T1 a; + T2 b; +}; + +const pair<int, int> &f1(); + +int f2() { + const auto &[a, b] = f1(); + return a + b; +} + +} // namespace instantiate_template + // FIXME: by-value array copies |