diff options
Diffstat (limited to 'test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p2.cpp')
-rw-r--r-- | test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p2.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p2.cpp b/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p2.cpp index 25470779e6..77a3e26de4 100644 --- a/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p2.cpp +++ b/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p2.cpp @@ -3,6 +3,7 @@ // constexpr functions and constexpr constructors are implicitly inline. struct S { constexpr S(int n); + constexpr int g(); int n; }; @@ -12,9 +13,14 @@ constexpr S f(S s) { return s.n * 2; } +constexpr int S::g() { + return f(*this).n; +} + // CHECK: define linkonce_odr {{.*}} @_Z1f1S( // CHECK: define linkonce_odr {{.*}} @_ZN1SC1Ei( +// CHECK: define linkonce_odr {{.*}} @_ZNK1S1gEv( int g() { - return f(42).n; + return f(42).g(); } |