mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-09-11 22:53:04 +00:00
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:
parent
fc4e813a5c
commit
f57ea8d2cb
5 changed files with 10 additions and 9 deletions
|
|
@ -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[]>();
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,5 +2,4 @@
|
|||
|
||||
namespace audit {
|
||||
struct Event {};
|
||||
void record(Event&& e);
|
||||
}
|
||||
|
|
|
|||
7
gitnexus/test/fixtures/lang-resolution/cpp-adl-rvalue-ref/record-rvalue.h
vendored
Normal file
7
gitnexus/test/fixtures/lang-resolution/cpp-adl-rvalue-ref/record-rvalue.h
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "audit.h"
|
||||
|
||||
namespace audit {
|
||||
void record(Event&& e);
|
||||
}
|
||||
|
|
@ -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');
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue