| Issue |
166580
|
| Summary |
concept constraining auto return type doesn't have a cursor
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
Serafean
|
clang 21.1.4 , using `libclang`'s `clang_visitChlidren` .
Example:
```
template<typename T>
concept Decrementable = requires (T t){ --t; };
Decrementable auto bar(){return 5;};
```
`clang-21 -cc1 -std=c++20 -ast-dump` output:
```
|-ConceptDecl 0x562aefcdfaf8 <con.cpp:1:1, line:2:46> col:9 Decrementable
| |-TemplateTypeParmDecl 0x562aefcdfa18 <line:1:10, col:19> col:19 referenced typename depth 0 index 0 T
| `-RequiresExpr 0x562aefcdfc90 <line:2:25, col:46> 'bool'
| |-ParmVarDecl 0x562aefcdfb58 <col:35, col:37> col:37 referenced t 'T'
| `-SimpleRequirement 0x562aefcdfc60 dependent
| `-UnaryOperator 0x562aefcdfc48 <col:41, col:43> '<dependent type>' lvalue prefix '--' cannot overflow
| `-DeclRefExpr 0x562aefcdfc28 <col:43> 'T' lvalue ParmVar 0x562aefcdfb58 't' 'T' non_odr_use_unevaluated
|-FunctionDecl 0x562aefcdfdd8 <line:4:1, col:35> col:20 bar 'int ()'
| `-CompoundStmt 0x562aefce0280 <col:25, col:35>
| `-ReturnStmt 0x562aefce0270 <col:26, col:33>
| `-IntegerLiteral 0x562aefcdfee8 <col:33> 'int' 5
`-EmptyDecl 0x562aefce02a0 <col:36> col:36
```
I would expect to get a `ConceptSpecializationExpr`, same as for
```
auto bar(Decrementable auto i){}
```
Also note that the return type is reported as `int` for some reason.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs