summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/drs/dr13xx.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2016-06-13 19:04:44 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2016-06-13 19:04:44 +0000
commit4bc32f28a91be3fef62cfdb64ea992229f6de30f (patch)
tree0e819ed3828ebd5b8c7b6339d272257ce8e772ce /clang/test/CXX/drs/dr13xx.cpp
parent6ff8f25a51e2642336f2910c115051f074c90248 (diff)
downloadbcm5719-llvm-4bc32f28a91be3fef62cfdb64ea992229f6de30f.tar.gz
bcm5719-llvm-4bc32f28a91be3fef62cfdb64ea992229f6de30f.zip
Add test for DR1359.
llvm-svn: 272575
Diffstat (limited to 'clang/test/CXX/drs/dr13xx.cpp')
-rw-r--r--clang/test/CXX/drs/dr13xx.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/test/CXX/drs/dr13xx.cpp b/clang/test/CXX/drs/dr13xx.cpp
index 37c144eb0e0..8c3e7f2a04c 100644
--- a/clang/test/CXX/drs/dr13xx.cpp
+++ b/clang/test/CXX/drs/dr13xx.cpp
@@ -28,3 +28,19 @@ namespace dr1346 { // dr1346: 3.5
}
#endif
}
+
+namespace dr1359 { // dr1359: 3.5
+#if __cplusplus >= 201103L
+ union A { constexpr A() = default; };
+ union B { constexpr B() = default; int a; }; // expected-error {{not constexpr}} expected-note 2{{candidate}}
+ union C { constexpr C() = default; int a, b; }; // expected-error {{not constexpr}} expected-note 2{{candidate}}
+ struct X { constexpr X() = default; union {}; };
+ struct Y { constexpr Y() = default; union { int a; }; }; // expected-error {{not constexpr}} expected-note 2{{candidate}}
+
+ constexpr A a = A();
+ constexpr B b = B(); // expected-error {{no matching}}
+ constexpr C c = C(); // expected-error {{no matching}}
+ constexpr X x = X();
+ constexpr Y y = Y(); // expected-error {{no matching}}
+#endif
+}
OpenPOWER on IntegriCloud