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:
@@ -51,7 +51,7 @@ struct Y2
|
||||
Y2& operator=(const int&) { return *this; }
|
||||
};
|
||||
|
||||
class B {};
|
||||
struct B { virtual ~B() = default; };
|
||||
class D : public B {};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user