diff --git a/gitnexus/src/core/ingestion/languages/cpp/adl.ts b/gitnexus/src/core/ingestion/languages/cpp/adl.ts index ec1c83e49..8d6c1563d 100644 --- a/gitnexus/src/core/ingestion/languages/cpp/adl.ts +++ b/gitnexus/src/core/ingestion/languages/cpp/adl.ts @@ -69,9 +69,6 @@ export interface CppAdlArgInfo { /** Simple class-like type name (last segment of qualified name); empty * for primitives, literals, function pointers, template specs, etc. */ readonly simpleClassName: string; - /** True when the variable's declarator contained one or more - * `pointer_declarator` wrappers. */ - readonly isPointer: boolean; } const argInfoBySite = new Map(); diff --git a/gitnexus/src/core/ingestion/languages/cpp/captures.ts b/gitnexus/src/core/ingestion/languages/cpp/captures.ts index 9bd2cbef9..75ef30804 100644 --- a/gitnexus/src/core/ingestion/languages/cpp/captures.ts +++ b/gitnexus/src/core/ingestion/languages/cpp/captures.ts @@ -743,7 +743,7 @@ function inferCppCallAdlArgs(callNode: SyntaxNode): CppAdlArgInfo[] { return out; } -const EMPTY_ADL_ARG: CppAdlArgInfo = { simpleClassName: '', isPointer: false }; +const EMPTY_ADL_ARG: CppAdlArgInfo = { simpleClassName: '' }; function classifyAdlArg(argNode: SyntaxNode): CppAdlArgInfo { // Literals and primitive-shaped expressions never have associated namespaces. @@ -799,7 +799,6 @@ function lookupAdlIdentifierType(identNode: SyntaxNode): CppAdlArgInfo { // `init_declarator > identifier` is value. // Function-pointer wrappers (`pointer_declarator > function_declarator`) // must not contribute ADL associated namespaces. - let isPointer = false; let isFunctionPointer = false; let inner: SyntaxNode = declarator; let nameText: string | null = null; @@ -810,7 +809,6 @@ function lookupAdlIdentifierType(identNode: SyntaxNode): CppAdlArgInfo { isFunctionPointer = true; break; } - isPointer = true; const next = inner.childForFieldName('declarator'); if (next === null) break; inner = next; @@ -847,7 +845,7 @@ function lookupAdlIdentifierType(identNode: SyntaxNode): CppAdlArgInfo { if (isFunctionPointer || nameText !== varName) continue; const simpleClassName = extractAdlSimpleTypeName(typeNode); - return { simpleClassName, isPointer }; + return { simpleClassName }; } return EMPTY_ADL_ARG; } diff --git a/gitnexus/test/fixtures/lang-resolution/cpp-adl-rvalue-ref/audit.h b/gitnexus/test/fixtures/lang-resolution/cpp-adl-rvalue-ref/audit.h index 9e2fb5c88..4b4600381 100644 --- a/gitnexus/test/fixtures/lang-resolution/cpp-adl-rvalue-ref/audit.h +++ b/gitnexus/test/fixtures/lang-resolution/cpp-adl-rvalue-ref/audit.h @@ -2,5 +2,4 @@ namespace audit { struct Event {}; - void record(Event&& e); } diff --git a/gitnexus/test/fixtures/lang-resolution/cpp-adl-rvalue-ref/record-rvalue.h b/gitnexus/test/fixtures/lang-resolution/cpp-adl-rvalue-ref/record-rvalue.h new file mode 100644 index 000000000..ae3cf7462 --- /dev/null +++ b/gitnexus/test/fixtures/lang-resolution/cpp-adl-rvalue-ref/record-rvalue.h @@ -0,0 +1,7 @@ +#pragma once + +#include "audit.h" + +namespace audit { + void record(Event&& e); +} diff --git a/gitnexus/test/integration/resolvers/cpp.test.ts b/gitnexus/test/integration/resolvers/cpp.test.ts index 025fcb462..7bc040182 100644 --- a/gitnexus/test/integration/resolvers/cpp.test.ts +++ b/gitnexus/test/integration/resolvers/cpp.test.ts @@ -2205,7 +2205,7 @@ describe('C++ ADL — rvalue reference args participate', () => { const calls = getRelationships(result, 'CALLS'); const recordCalls = calls.filter((c) => c.source === 'runRvalueRef' && c.target === 'record'); expect(recordCalls.length).toBe(1); - expect(recordCalls[0].targetFilePath).toContain('audit.h'); + expect(recordCalls[0].targetFilePath).toContain('record-rvalue.h'); }); });