std::scoped_lock and warning ctad-maybe-unsupported
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
`std::scoped_lock` supports CTAD by design, yet clang complains that it might not be the case
```c++
#include
void foo(){
std::mutex m;
std::scoped_lock lock( m );
}
```
Example on godbolt: https://compiler-explorer.com/z/von4463eK
Since `std::scoped_lock` comes from the standard library, I cannot add deduction guides to make clang happy, I would expect clang to "know" that `std::scoped_lock lock( m );` is not problematic (if it compiles), no matter from which standard library it comes.
Contributor guide
Research direction
Reproduce the warning from the supplied C++ snippet, using the Compiler Explorer example as the first reference. Locate the implementation and tests for the `ctad-maybe-unsupported` diagnostic, then verify that this `std::scoped_lock` case no longer produces the warning.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 62/100