diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-01-27 01:14:48 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-01-27 01:14:48 +0000 |
commit | 745f5147e065900267c85a5568785a1991d4838f (patch) | |
tree | d0cb69f2ed53871b2be9b574062cbaa0060ae6b9 /test/CodeGenCXX/const-init-cxx11.cpp | |
parent | 30ae84cfd175f913436fb078188d754d166d987c (diff) |
constexpr: Implement the [dcl.constexpr]p5 check for whether a constexpr
function definition can produce a constant expression. This also provides the
last few checks for [dcl.constexpr]p3 and [dcl.constexpr]p4.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149108 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/const-init-cxx11.cpp')
-rw-r--r-- | test/CodeGenCXX/const-init-cxx11.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/CodeGenCXX/const-init-cxx11.cpp b/test/CodeGenCXX/const-init-cxx11.cpp index 84459fdbb0..6f13faa2fc 100644 --- a/test/CodeGenCXX/const-init-cxx11.cpp +++ b/test/CodeGenCXX/const-init-cxx11.cpp @@ -190,8 +190,8 @@ namespace MemberPtr { namespace CrossFuncLabelDiff { // Make sure we refuse to constant-fold the variable b. - constexpr long a() { return (long)&&lbl + (0 && ({lbl: 0;})); } - void test() { static long b = (long)&&lbl - a(); lbl: return; } + constexpr long a(bool x) { return x ? 0 : (long)&&lbl + (0 && ({lbl: 0;})); } + void test() { static long b = (long)&&lbl - a(false); lbl: return; } // CHECK: sub nsw i64 ptrtoint (i8* blockaddress(@_ZN18CrossFuncLabelDiff4testEv, {{.*}}) to i64), // CHECK: store i64 {{.*}}, i64* @_ZZN18CrossFuncLabelDiff4testEvE1b, align 8 } |