Skip to content

Set adl_enclosing_record on friend declarations in FunctionDeclImporter::Import.#1434

Open
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_947915008
Open

Set adl_enclosing_record on friend declarations in FunctionDeclImporter::Import.#1434
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_947915008

Conversation

@copybara-service

Copy link
Copy Markdown

Set adl_enclosing_record on friend declarations in FunctionDeclImporter::Import.

When a friend function is imported by FunctionDeclImporter::Import, compute and populate its .adl_enclosing_record from its lexical CXXRecordDecl context.

Without .adl_enclosing_record, the bindings generator treats the friend function as a normal namespace function and emits a namespace-qualified call, which disables ADL and errors out as it doesn't exist in the namespace scope.

…er::Import.

When a friend function is imported by `FunctionDeclImporter::Import`, compute and populate its `.adl_enclosing_record` from its lexical `CXXRecordDecl` context.

Without `.adl_enclosing_record`, the bindings generator treats the friend function as a normal namespace function and emits a namespace-qualified call, which disables ADL and errors out as it doesn't exist in the namespace scope.

PiperOrigin-RevId: 947915008
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