commit | f2e4cd760a5836ee8941d1b9be6b2e2c2dde23e6 | [log] [tgz] |
---|---|---|
author | Richard Smith <richard-llvm@metafoo.co.uk> | Thu Jan 26 04:47:34 2012 +0000 |
committer | Richard Smith <richard-llvm@metafoo.co.uk> | Thu Jan 26 04:47:34 2012 +0000 |
tree | 8151f4c5c980c7594c60bde85347299f97c36792 | |
parent | 98b940b7feda40c7440762d85b22d06c9aeb2587 [diff] [blame] |
constexpr: evaluate (bool)&x as true when x is a local variable or a temporary. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149045 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/constant-expression-cxx11.cpp b/test/SemaCXX/constant-expression-cxx11.cpp index af66acd..3c85adc 100644 --- a/test/SemaCXX/constant-expression-cxx11.cpp +++ b/test/SemaCXX/constant-expression-cxx11.cpp
@@ -737,6 +737,9 @@ constexpr int n = f(T(5)); static_assert(f(T(5)) == 5, ""); +constexpr bool b(int n) { return &n; } +static_assert(b(0), ""); + } namespace Union {