Skip to content

Commit

Permalink
Fix UB in one libcxx test, when deleting D through a pointer to B.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Arthur O'Dwyer committed Nov 4, 2020
1 parent 09ec078 commit 418de7d
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -51,7 +51,7 @@ struct Y2
Y2& operator=(const int&) { return *this; }
};

class B {};
struct B { virtual ~B() = default; };
class D : public B {};


Expand Down

0 comments on commit 418de7d

Please sign in to comment.