llvm / llvm/llvm-project

Clang rejects valid program when delete move ctor is used in decltype

Open
#208,137 3 comments 0 reactions 0 assignees View on GitHub
clang:frontend
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

The following valid program is rejected by clang, gcc and msvc:

```c++
struct NoMove {
NoMove(NoMove&&) = delete;
};

NoMove&& DeclVal();
void F1(...);
void F2(auto);

using Type1 = decltype(F1(DeclVal())); // #1: this compiles
using Type2 = decltype(F2(DeclVal())); // #2: this doesn't compile when it should
```

Contributor guide

Open the contributing guide

Research direction

Start with the supplied C++ reproducer, focusing on the contrast between decltype(F1(DeclVal())) (#1) and decltype(F2(DeclVal())) (#2), and compare the compiler diagnostics. Done means the valid program is accepted consistently for the Type2 declaration while preserving the existing behavior of Type1.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.