mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-10-09 03:17:54 +00:00
fix(cpp): remove dead ADL arg flags and align capture docs
Agent-Logs-Url: https://github.com/abhigyanpatwari/GitNexus/sessions/54a87ec9-b5fa-4d59-aece-e69e56417e66
This commit is contained in:
parent
af29b53a95
commit
88b21628c4
2 changed files with 7 additions and 18 deletions
|
|
@ -69,11 +69,6 @@ export interface CppAdlArgInfo {
|
|||
/** Simple class-like type name (last segment of qualified name); empty
|
||||
* for primitives, literals, function pointers, etc. */
|
||||
readonly simpleClassName: string;
|
||||
/** True when the variable's declarator contained one or more
|
||||
* `pointer_declarator` wrappers. */
|
||||
readonly isPointer: boolean;
|
||||
/** True when the variable's declarator was a `reference_declarator`. */
|
||||
readonly isReference: boolean;
|
||||
/** Template's own simple class-like name (e.g. `vector` for
|
||||
* `std::vector<N::T>`), empty when arg type is not a template spec. */
|
||||
readonly templateSimpleClassName: string;
|
||||
|
|
|
|||
|
|
@ -720,12 +720,14 @@ function isParenthesizedFunctionCall(callNode: SyntaxNode): boolean {
|
|||
|
||||
/**
|
||||
* Per-argument ADL classification: walk each argument of a free call and
|
||||
* decide whether it resolves to a directly-named class or class-pointer
|
||||
* type (ADL fires) or to an excluded shape such as a reference, function
|
||||
* pointer, primitive, literal, or template specialization.
|
||||
* classify its declared type for associated-namespace lookup.
|
||||
*
|
||||
* Class-typed values and class pointers (`N::S`, `N::S*`, `N::S**`) all
|
||||
* preserve the pointee class name for associated-namespace lookup.
|
||||
* Value/pointer/reference class-typed args and template specializations
|
||||
* with explicit type arguments contribute; function pointers, primitives,
|
||||
* literals, and other unsupported shapes produce an empty result.
|
||||
*
|
||||
* Class-typed values/pointers/references (`N::S`, `N::S*`, `N::S&`) all
|
||||
* preserve the class name for associated-namespace lookup.
|
||||
* Function pointers remain excluded even when their return type names a
|
||||
* class, because the associated entity is the pointed-to function type,
|
||||
* not the return type.
|
||||
|
|
@ -746,8 +748,6 @@ function inferCppCallAdlArgs(callNode: SyntaxNode): CppAdlArgInfo[] {
|
|||
const ADL_TEMPLATE_RECURSION_MAX_DEPTH = 8;
|
||||
const EMPTY_ADL_ARG: CppAdlArgInfo = {
|
||||
simpleClassName: '',
|
||||
isPointer: false,
|
||||
isReference: false,
|
||||
templateSimpleClassName: '',
|
||||
templateNamespace: '',
|
||||
templateArgClassNames: [],
|
||||
|
|
@ -808,8 +808,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 isReference = false;
|
||||
let isFunctionPointer = false;
|
||||
let inner: SyntaxNode = declarator;
|
||||
let nameText: string | null = null;
|
||||
|
|
@ -820,14 +818,12 @@ function lookupAdlIdentifierType(identNode: SyntaxNode): CppAdlArgInfo {
|
|||
isFunctionPointer = true;
|
||||
break;
|
||||
}
|
||||
isPointer = true;
|
||||
const next = inner.childForFieldName('declarator');
|
||||
if (next === null) break;
|
||||
inner = next;
|
||||
continue;
|
||||
}
|
||||
if (inner.type === 'reference_declarator' || inner.type === 'rvalue_reference_declarator') {
|
||||
isReference = true;
|
||||
// reference_declarator has a single child (the inner declarator).
|
||||
let next: SyntaxNode | null = null;
|
||||
for (let j = 0; j < inner.namedChildCount; j++) {
|
||||
|
|
@ -866,8 +862,6 @@ function lookupAdlIdentifierType(identNode: SyntaxNode): CppAdlArgInfo {
|
|||
} = extractAdlTemplateInfo(typeNode);
|
||||
return {
|
||||
simpleClassName,
|
||||
isPointer,
|
||||
isReference,
|
||||
templateSimpleClassName,
|
||||
templateNamespace,
|
||||
templateArgClassNames,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue