File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -4535,6 +4535,10 @@ bool Compiler<Emitter>::VisitCallExpr(const CallExpr *E) {
45354535 return VisitBuiltinCallExpr (E, Builtin::BI__builtin_operator_delete);
45364536 }
45374537 }
4538+ // Explicit calls to trivial destructors
4539+ if (const auto *DD = dyn_cast_if_present<CXXDestructorDecl>(FuncDecl);
4540+ DD && DD->isTrivial ())
4541+ return true ;
45384542
45394543 QualType ReturnType = E->getCallReturnType (Ctx.getASTContext ());
45404544 std::optional<PrimType> T = classify (ReturnType);
Original file line number Diff line number Diff line change @@ -311,3 +311,16 @@ constexpr bool change_union_member() {
311311 return u.b == 2 ;
312312}
313313static_assert (change_union_member());
314+
315+ namespace PR48606 {
316+ struct A { mutable int n = 0 ; };
317+
318+ constexpr bool f () {
319+ A a;
320+ A *p = &a;
321+ p->~A ();
322+ std::construct_at<A>(p);
323+ return true ;
324+ }
325+ static_assert (f());
326+ }
You can’t perform that action at this time.
0 commit comments