llvm / llvm/llvm-project

auto function parameter not reported as CXType_Auto

Open
#172,072 1 comment 0 reactions 0 assignees View on GitHub
clang:as-a-library
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

with the function:

`int bar(auto p){};`

using the C api,
- `auto` is reported as a `TypeRef` with kind `unexposed`
- `p` is reported as `ParmDecl` with kind `unexposed`

I believe it should be only reporting `p` as `ParmDecl` with type `Auto` ( `CXType_Auto` in Index.h), not visiting the "auto" keyword at all. (Same as happens with `VarDecl` in the case of `auto i = 42` )

Contributor guide

Open the contributing guide

Research direction

Start by tracing how the C API represents the `auto` function parameter, using `Index.h` and the reported `TypeRef` and `ParmDecl` nodes as entry points. Compare this with the existing `VarDecl` handling for `auto i = 42`. Done means the parameter is reported as `ParmDecl` with type `CXType_Auto`, without a separate `auto` keyword node.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, cpp
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.