diff options
Diffstat (limited to 'test/SemaTemplate/instantiate-anonymous-union.cpp')
-rw-r--r-- | test/SemaTemplate/instantiate-anonymous-union.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/SemaTemplate/instantiate-anonymous-union.cpp b/test/SemaTemplate/instantiate-anonymous-union.cpp new file mode 100644 index 0000000..375c1da --- /dev/null +++ b/test/SemaTemplate/instantiate-anonymous-union.cpp @@ -0,0 +1,31 @@ +// RUN: clang-cc -fsyntax-only %s -Wall + +template <typename T> class A { struct { }; }; + +A<int> a0; + +template <typename T> struct B { + union { + int a; + void* b; + }; + + void f() { + a = 10; + b = 0; + } +}; + +B<int> b0; + +template <typename T> struct C { + union { + int a; + void* b; + }; + + C(int a) : a(a) { } + C(void* b) : b(b) { } +}; + +C<int> c0(0); |