diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2010-09-03 21:54:20 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2010-09-03 21:54:20 +0000 |
commit | f92bd8cf22890f2070c87dc4a38d989a317f94fa (patch) | |
tree | 9b83770b67d721c5e88645658e915face2b9df29 /clang/test/SemaTemplate/instantiate-anonymous-union.cpp | |
parent | f849774495503e3a53b31bdbaf813f5bc3c0d92a (diff) | |
download | bcm5719-llvm-f92bd8cf22890f2070c87dc4a38d989a317f94fa.tar.gz bcm5719-llvm-f92bd8cf22890f2070c87dc4a38d989a317f94fa.zip |
Fix PR7402 when it strikes via template instantiation.
llvm-svn: 113019
Diffstat (limited to 'clang/test/SemaTemplate/instantiate-anonymous-union.cpp')
-rw-r--r-- | clang/test/SemaTemplate/instantiate-anonymous-union.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
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<double>(); } + +// 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 <typename T> X(const T& t) : x(t), y(t) {} + }; + + X x(42.0); +} |