diff options
Diffstat (limited to 'clang/test/AST/ByteCode/cxx11.cpp')
| -rw-r--r-- | clang/test/AST/ByteCode/cxx11.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/AST/ByteCode/cxx11.cpp b/clang/test/AST/ByteCode/cxx11.cpp index 753e51df..9561535 100644 --- a/clang/test/AST/ByteCode/cxx11.cpp +++ b/clang/test/AST/ByteCode/cxx11.cpp @@ -387,3 +387,14 @@ struct Counter { // Passing an lvalue by value makes a non-elidable copy. constexpr int PassByValue(Counter c) { return c.copies; } static_assert(PassByValue(Counter(0)) == 0, "expect no copies"); + +namespace PointerCast { + /// The two interpreters disagree here. + struct S { int x, y; } s; + constexpr S* sptr = &s; + struct U {}; + struct Str { + int e : (Str*)(sptr) == (Str*)(sptr); // expected-error {{not an integral constant expression}} \ + // expected-note {{cast that performs the conversions of a reinterpret_cast}} + }; +} |
