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
This commit is contained in:
copilot-swe-agent[bot] 2026-05-14 18:41:17 +00:00 committed by GitHub
parent fc4e813a5c
commit f57ea8d2cb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 10 additions and 9 deletions

View file

@ -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<string, readonly CppAdlArgInfo[]>();

View file

@ -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;
}

View file

@ -2,5 +2,4 @@
namespace audit {
struct Event {};
void record(Event&& e);
}

View file

@ -0,0 +1,7 @@
#pragma once
#include "audit.h"
namespace audit {
void record(Event&& e);
}

View file

@ -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');
});
});