From f92bd8cf22890f2070c87dc4a38d989a317f94fa Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Fri, 3 Sep 2010 21:54:20 +0000 Subject: Fix PR7402 when it strikes via template instantiation. llvm-svn: 113019 --- .../test/SemaTemplate/instantiate-anonymous-union.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'clang/test/SemaTemplate/instantiate-anonymous-union.cpp') diff --git a/clang/test/SemaTemplate/instantiate-anonymous-union.cpp b/clang/test/SemaTemplate/instantiate-anonymous-union.cpp index 255454b2ebf..f2862db6bb7 100644 --- a/clang/test/SemaTemplate/instantiate-anonymous-union.cpp +++ b/clang/test/SemaTemplate/instantiate-anonymous-union.cpp @@ -47,3 +47,22 @@ namespace PR7088 { template void f(); } + +// Check for problems related to PR7402 that occur when template instantiation +// instantiates implicit initializers. +namespace PR7402 { + struct X { + union { + struct { + int x; + int y; + }; + int v[2]; + }; + + // Check that this requirement survives instantiation. + template X(const T& t) : x(t), y(t) {} + }; + + X x(42.0); +} -- cgit v1.2.3