[clang] Moves destructor type-trait deduction to a public function (PR #238456)
Timm Baeder via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 23 22:10:59 PST 2026
================
@@ -16112,6 +16112,48 @@ class Sema final : public SemaBase {
///@}
};
+/// Evaluates whether a type is trivially-destructible, non-trivially
+/// destructible, or cannot be destroyed in the current context. Caches
+/// the results from evaluation to allow for independently determining
+/// if the type's destructor throws.
+class DestructibleTraits {
+public:
+ /// Indicates whether a type is trivially-destructible, non-trivially
+ /// destructible, or not destructible.
+ enum class Destructibility : std::uint8_t {
+ /// Type is not destructible from this context.
+ NotAvailable,
+
+ /// Type is trivially-destructible.
+ TriviallyDestructible,
+
+ /// Type is destructible, but not trivially-destructible.
+ Destructible,
+ };
+
+ DestructibleTraits(Sema &S, const ASTContext &C, SourceLocation Loc,
+ QualType T);
+
+ /// Returns the raw destructor kind.
+ Destructibility GetKind() const;
----------------
tbaederr wrote:
```suggestion
Destructibility getKind() const;
```
https://github.com/llvm/llvm-project/pull/238456
More information about the cfe-commits
mailing list