diff options
Diffstat (limited to 'Tests/CompileFeatures/cxx_relaxed_constexpr.cpp')
-rw-r--r-- | Tests/CompileFeatures/cxx_relaxed_constexpr.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Tests/CompileFeatures/cxx_relaxed_constexpr.cpp b/Tests/CompileFeatures/cxx_relaxed_constexpr.cpp index bce82e3..7b3602c 100644 --- a/Tests/CompileFeatures/cxx_relaxed_constexpr.cpp +++ b/Tests/CompileFeatures/cxx_relaxed_constexpr.cpp @@ -1,12 +1,16 @@ -struct X { - constexpr X() : n(5) { +struct X +{ + constexpr X() + : n(5) + { n *= 2; } int n; }; -constexpr int g(const int (&is)[4]) { +constexpr int g(const int (&is)[4]) +{ X x; int r = x.n; for (int i = 0; i < 5; ++i) |