diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp1z/decomp31.C')
-rw-r--r-- | gcc/testsuite/g++.dg/cpp1z/decomp31.C | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp1z/decomp31.C b/gcc/testsuite/g++.dg/cpp1z/decomp31.C new file mode 100644 index 00000000000..04b2516dada --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/decomp31.C @@ -0,0 +1,18 @@ +// PR c++/81888 +// { dg-do compile { target c++1z } } + +struct S { + bool s = true; +}; + +auto [a] = S{}; + +template <class T> +bool +foo () noexcept +{ + auto [c] = T{}; + return c; +} + +const bool b = foo<S> (); |