Issue 129631
Summary [clang] the "cleanup" attribute prevents type deduction
Labels clang
Assignees
Reporter shynur
    ```cpp
/* a.cpp */
int open() { return 0; }
void close(decltype(open()) *) {}
int main() {
  auto fd [[gnu::cleanup(close)]] = open();
}
```

```bash
$ clang-21 a.cpp
a.cpp:4:26: error: 'cleanup' function 'close' parameter has type 'decltype(open()) *' (aka 'int *') which is incompatible with type 'auto *'
    4 |   auto fd [[gnu::cleanup(close)]] = open();
      | ^
1 error generated.
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to