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) {
4535
4535
return VisitBuiltinCallExpr (E, Builtin::BI__builtin_operator_delete);
4536
4536
}
4537
4537
}
4538
+ // Explicit calls to trivial destructors
4539
+ if (const auto *DD = dyn_cast_if_present<CXXDestructorDecl>(FuncDecl);
4540
+ DD && DD->isTrivial ())
4541
+ return true ;
4538
4542
4539
4543
QualType ReturnType = E->getCallReturnType (Ctx.getASTContext ());
4540
4544
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() {
311
311
return u.b == 2 ;
312
312
}
313
313
static_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