Skip to content

Surface newly-reachable clang 22 lambda, record, and constexpr accessors#808

Merged
tannergooding merged 3 commits into
dotnet:mainfrom
tannergooding:tannergooding-v22-lambda
Jul 17, 2026
Merged

Surface newly-reachable clang 22 lambda, record, and constexpr accessors#808
tannergooding merged 3 commits into
dotnet:mainfrom
tannergooding:tannergooding-v22-lambda

Conversation

@tannergooding

Copy link
Copy Markdown
Member

Surfaces newly-reachable clang 22 AST accessors on the mid- and high-level managed layers now that the v22 libClangSharp port (#805) has landed. Managed-only; no native or generated-binding changes.


LambdaExpr cluster -- adds LambdaClass, CaptureDefault, IsGenericLambda, and IsCapturelessLambda, all routed through the lambda's CXXRecordDecl (where the native predicates dispatch). Capture enumeration is intentionally not surfaced: the getNumCaptures/getCapturesCXXThis/getCaptureKind/getCapturedVar bridges dispatch only on BlockDecl/CapturedStmt, never on the LambdaExpr, so exposing them would need new native shims.

CXXRecordDecl structural predicates -- 10 Is* (aggregate, empty, polymorphic, trivial, standard-layout, ...) and 9 Has* special-member/field flags. The native shims already guard on getDefinition(), so these are well-defined (return false) on incomplete types.

constexpr family -- FunctionDecl.ConstexprKind (plus derived IsConstexpr/IsConsteval), VarDecl.InitStyle, and IfStmt.StatementKind. VarDecl.isConstexpr has no bridge so it stays unsurfaced; the existing IfStmt-scoped Cursor.IsConstexpr is unchanged.

Each cluster forwards through a new mid-layer CXCursor accessor (25 total). Interop tests cover all three; full suite green, 0 warnings.

Note

Authored with Copilot.

tannergooding and others added 3 commits July 16, 2026 18:34
Add mid-layer CXCursor accessors (IsCapturelessLambda, IsGenericLambda,
LambdaCaptureDefault) and forward them from LambdaExpr through its lambda
class, alongside LambdaClass. The capture-enumeration bridges only dispatch
on BlockDecl/CapturedStmt, so they stay unsurfaced for lambdas.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Wrap the CXXRecordDecl structural bridges at the mid layer (Is* aggregate/
empty/polymorphic/trivial/standard-layout family and the Has* special-member
and field flags) and surface them on CXXRecordDecl. The native shims already
guard on getDefinition(), so they stay well-defined on incomplete types.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Wrap Cursor_getConstexprKind/getInitStyle/getIfStatementKind at the mid layer
and surface FunctionDecl.ConstexprKind (with derived IsConstexpr/IsConsteval),
VarDecl.InitStyle, and IfStmt.StatementKind. VarDecl.isConstexpr has no bridge,
so it stays unsurfaced; the IfStmt-scoped Cursor.IsConstexpr is unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@tannergooding
tannergooding merged commit 91a3860 into dotnet:main Jul 17, 2026
12 checks passed
@tannergooding
tannergooding deleted the tannergooding-v22-lambda branch July 17, 2026 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant