Fix UB in one libcxx test, when deleting D through a pointer to B.

This undefined behavior was found by applying Lénárd Szolnoki's proposal
to disable implicit conversion of default_delete<D> to default_delete<B>.

The offending part of the test is circa line 243.

The wording that makes it undefined behavior is http://eel.is/c++draft/expr.delete#3 .

Differential Revision: https://reviews.llvm.org/D90536
This commit is contained in:
Arthur O'Dwyer
2020-11-04 17:34:05 -05:00
parent 09ec07827b
commit 418de7d5d8

View File

@@ -51,7 +51,7 @@ struct Y2
Y2& operator=(const int&) { return *this; }
};
class B {};
struct B { virtual ~B() = default; };
class D : public B {};