summaryrefslogtreecommitdiff
path: root/test/SemaTemplate/instantiate-init.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2018-07-28 11:06:01 +0000
committerDimitry Andric <dim@FreeBSD.org>2018-07-28 11:06:01 +0000
commit486754660bb926339aefcf012a3f848592babb8b (patch)
treeecdbc446c9876f4f120f701c243373cd3cb43db3 /test/SemaTemplate/instantiate-init.cpp
parent55e6d896ad333f07bb3b1ba487df214fc268a4ab (diff)
Notes
Diffstat (limited to 'test/SemaTemplate/instantiate-init.cpp')
-rw-r--r--test/SemaTemplate/instantiate-init.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/SemaTemplate/instantiate-init.cpp b/test/SemaTemplate/instantiate-init.cpp
index 244e94f6d6056..51fa6955d0c02 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}}
+}