diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2011-10-11 00:13:24 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2011-10-11 00:13:24 +0000 |
commit | db924224b51b153f24fbe492102d4edebcbbb7f4 (patch) | |
tree | 8c8b57005b13161d1df9fae00bf39076d7662537 /test | |
parent | f4f5003041ca88e0efe81ef8b5d7f0c499da4bf8 (diff) |
Extend lvalue evaluation in ExprConstant.cpp to handle CK_LValueBitCast (which is completely trivial). PR8836.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141604 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/SemaCXX/i-c-e-cxx.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/SemaCXX/i-c-e-cxx.cpp b/test/SemaCXX/i-c-e-cxx.cpp index 4ebdada492..4d02ca8f17 100644 --- a/test/SemaCXX/i-c-e-cxx.cpp +++ b/test/SemaCXX/i-c-e-cxx.cpp @@ -57,3 +57,7 @@ int foo() { return A::B; } // PR11040 const int x = 10; int* y = reinterpret_cast<const char&>(x); // expected-error {{cannot initialize}} + +// This isn't an integral constant expression, but make sure it folds anyway. +struct PR8836 { char _; long long a; }; +int PR8836test[(__typeof(sizeof(int)))&reinterpret_cast<const volatile char&>((((PR8836*)0)->a))]; |