From f57ea8d2cb3a6a9752ddefa6f2a31cd605effcc4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 14 May 2026 18:41:17 +0000 Subject: [PATCH] test(cpp): isolate rvalue-ref ADL fixture and drop dead pointer flag Agent-Logs-Url: https://github.com/abhigyanpatwari/GitNexus/sessions/fd8b59a5-6490-41f6-9732-0861e8cb47de --- gitnexus/src/core/ingestion/languages/cpp/adl.ts | 3 --- gitnexus/src/core/ingestion/languages/cpp/captures.ts | 6 ++---- .../fixtures/lang-resolution/cpp-adl-rvalue-ref/audit.h | 1 - .../lang-resolution/cpp-adl-rvalue-ref/record-rvalue.h | 7 +++++++ gitnexus/test/integration/resolvers/cpp.test.ts | 2 +- 5 files changed, 10 insertions(+), 9 deletions(-) create mode 100644 gitnexus/test/fixtures/lang-resolution/cpp-adl-rvalue-ref/record-rvalue.h 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'); }); });