diff options
Diffstat (limited to 'test/CXX/class/class.union/p1.cpp')
-rw-r--r-- | test/CXX/class/class.union/p1.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/CXX/class/class.union/p1.cpp b/test/CXX/class/class.union/p1.cpp index e974d82..b5dd4df 100644 --- a/test/CXX/class/class.union/p1.cpp +++ b/test/CXX/class/class.union/p1.cpp @@ -90,6 +90,14 @@ union U3 { } m7; }; +union U4 { + static int i1; // expected-error {{static data member 'i1' not allowed in union}} +}; + +union U5 { + int& i1; // expected-error {{union member 'i1' has reference type 'int &'}} +}; + template <class A, class B> struct Either { bool tag; union { |