summaryrefslogtreecommitdiffstats
path: root/test/CXX/drs/dr9xx.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/CXX/drs/dr9xx.cpp')
-rw-r--r--test/CXX/drs/dr9xx.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/CXX/drs/dr9xx.cpp b/test/CXX/drs/dr9xx.cpp
index 4bcd656..b37e17d 100644
--- a/test/CXX/drs/dr9xx.cpp
+++ b/test/CXX/drs/dr9xx.cpp
@@ -44,3 +44,32 @@ namespace dr990 { // dr990: 3.5
D d{};
#endif
}
+
+namespace dr948 { // dr948: 3.7
+#if __cplusplus >= 201103L
+ class A {
+ public:
+ constexpr A(int v) : v(v) { }
+ constexpr operator int() const { return v; }
+ private:
+ int v;
+ };
+
+ constexpr int id(int x)
+ {
+ return x;
+ }
+
+ void f() {
+ if (constexpr int i = id(101)) { }
+ switch (constexpr int i = id(2)) { default: break; case 2: break; }
+ for (; constexpr int i = id(0); ) { }
+ while (constexpr int i = id(0)) { }
+
+ if (constexpr A i = 101) { }
+ switch (constexpr A i = 2) { default: break; case 2: break; }
+ for (; constexpr A i = 0; ) { }
+ while (constexpr A i = 0) { }
+ }
+#endif
+}
OpenPOWER on IntegriCloud