diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-12-09 22:56:20 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-12-09 22:56:20 +0000 |
| commit | 4b46cb9190504d59ffee001e36ee56634a76b241 (patch) | |
| tree | 8bac6dbdebc8ecd002313a1e64b4e123fc1c4d5b /clang/test/Parser/cxx1z-decomposition.cpp | |
| parent | e4600d330f9892bd49edbe0bb914a35cf59e5b17 (diff) | |
| download | bcm5719-llvm-4b46cb9190504d59ffee001e36ee56634a76b241.tar.gz bcm5719-llvm-4b46cb9190504d59ffee001e36ee56634a76b241.zip | |
[c++17] P0490R0, NB comment FI 20: allow direct-initialization of decomposition declarations.
llvm-svn: 289286
Diffstat (limited to 'clang/test/Parser/cxx1z-decomposition.cpp')
| -rw-r--r-- | clang/test/Parser/cxx1z-decomposition.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/test/Parser/cxx1z-decomposition.cpp b/clang/test/Parser/cxx1z-decomposition.cpp index c5651c56588..9cbe70e3c69 100644 --- a/clang/test/Parser/cxx1z-decomposition.cpp +++ b/clang/test/Parser/cxx1z-decomposition.cpp @@ -139,9 +139,11 @@ namespace Init { int arr[1]; struct S { int n; }; auto &[bad1]; // expected-error {{decomposition declaration '[bad1]' requires an initializer}} - const auto &[bad2](S{}); // expected-error {{decomposition declaration '[bad2]' cannot have a parenthesized initializer}} + const auto &[bad2](S{}, S{}); // expected-error {{initializer for variable '[bad2]' with type 'const auto &' contains multiple expressions}} + const auto &[bad3](); // expected-error {{expected expression}} auto &[good1] = arr; auto &&[good2] = S{}; + const auto &[good3](S{}); S [goodish3] = { 4 }; // expected-error {{cannot be declared with type 'S'}} S [goodish4] { 4 }; // expected-error {{cannot be declared with type 'S'}} } |

