diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2019-10-02 01:13:57 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2019-10-02 01:13:57 +0000 |
commit | 5e18f4db08dc4df3d91869cea1c39810b3e0c83b (patch) | |
tree | 2a5ee05947509aa203a06c47bad69a9fef8d8b26 /clang/test/SemaCXX/constant-expression-cxx2a.cpp | |
parent | 86f864dacee0c1c65841723e84503ff1927bf28a (diff) | |
download | bcm5719-llvm-5e18f4db08dc4df3d91869cea1c39810b3e0c83b.tar.gz bcm5719-llvm-5e18f4db08dc4df3d91869cea1c39810b3e0c83b.zip |
Fix crash on constant-evaluation of pseudo-destruction of a pointer.
We got confused and thought we might be pseudo-destroying the pointee
instead.
llvm-svn: 373418
Diffstat (limited to 'clang/test/SemaCXX/constant-expression-cxx2a.cpp')
-rw-r--r-- | clang/test/SemaCXX/constant-expression-cxx2a.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/constant-expression-cxx2a.cpp b/clang/test/SemaCXX/constant-expression-cxx2a.cpp index ef3ce5c0ccb..cb8f16a8b0f 100644 --- a/clang/test/SemaCXX/constant-expression-cxx2a.cpp +++ b/clang/test/SemaCXX/constant-expression-cxx2a.cpp @@ -1283,6 +1283,15 @@ namespace dtor_call { // FIXME: This diagnostic is wrong; the union has no active member now. as.b.~A(); // expected-note {{destruction of member 'b' of union with active member 'a'}} } + + constexpr void destroy_pointer() { + using T = int*; + T p; + // We used to think this was an -> member access because its left-hand side + // is a pointer. Ensure we don't crash. + p.~T(); + } + static_assert((destroy_pointer(), true)); } namespace temp_dtor { |