summaryrefslogtreecommitdiffstats
path: root/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p4.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-02-09 06:40:58 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-02-09 06:40:58 +0000
commit30ecfad3af057bff74d1c98099eda0677525574e (patch)
tree5a8c3f5a0718e3c0f236529fed67a4ed8c5b2420 /test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p4.cpp
parentff3b9fdbfd4ff3a8361640c0d8a12d9f0cc1ce6f (diff)
DR1359: A constexpr constructor does not need to initialize an empty struct or
empty union. This still rejects anonymous member structs or unions which only contain such empty class types, pending standard wording defining exactly what an empty class type is. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150157 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p4.cpp')
-rw-r--r--test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p4.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p4.cpp b/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p4.cpp
index abd5292ada..86b7ded959 100644
--- a/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p4.cpp
+++ b/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p4.cpp
@@ -151,6 +151,16 @@ struct AnonMembers {
constexpr AnonMembers(int(&)[6]) {} // expected-error {{constexpr constructor must initialize all members}}
};
+union Empty {
+ constexpr Empty() {} // ok
+} constexpr empty1;
+
+struct EmptyVariant {
+ union {};
+ struct {};
+ constexpr EmptyVariant() {} // ok
+} constexpr empty2;
+
template<typename T> using Int = int;
template<typename T>
struct TemplateInit {