diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2018-02-16 19:10:26 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2018-02-16 19:10:26 +0000 |
commit | 6eea8b8c1aad853d6161709d8b3035dfd867fa1c (patch) | |
tree | 195fb543fdb28a1c2a6baf81d96adc1bc302f8ca /test/SemaTemplate/instantiate-init.cpp | |
parent | 660d91aa9ee00f68bdb884b29845a39be78bc557 (diff) |
Notes
Diffstat (limited to 'test/SemaTemplate/instantiate-init.cpp')
-rw-r--r-- | test/SemaTemplate/instantiate-init.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/SemaTemplate/instantiate-init.cpp b/test/SemaTemplate/instantiate-init.cpp index 244e94f6d605..51fa6955d0c0 100644 --- a/test/SemaTemplate/instantiate-init.cpp +++ b/test/SemaTemplate/instantiate-init.cpp @@ -142,3 +142,17 @@ namespace ReturnStmtIsInitialization { template<typename T> X f() { return {}; } auto &&x = f<void>(); } + +namespace InitListUpdate { + struct A { int n; }; + using AA = A[1]; + + // Check that an init list update doesn't "lose" the pack-ness of an expression. + template <int... N> void f() { + g(AA{0, [0].n = N} ...); // expected-warning 3{{overrides prior init}} expected-note 3{{previous init}} + g(AA{N, [0].n = 0} ...); // expected-warning 3{{overrides prior init}} expected-note 3{{previous init}} + }; + + void g(AA, AA); + void h() { f<1, 2>(); } // expected-note {{instantiation of}} +} |