llvm / llvm/llvm-project

CTAD is not valid with a dependent nested-name-specifier

Open
#189,292 4 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 program demonstrates the issue:
```cpp
templatestruct foo{
T x;
};
struct bar{
templateusing baz=foo;
};
templatevoid qux(){
typename T::baz v{0};
}
int main(){
qux();
}
```
CTAD is not valid when the nested-name-specifier is dependent, so this should be rejected. See also: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124687

Contributor guide

Open the contributing guide

Research direction

Start with the provided C++ reproducer and investigate the compiler's class template argument deduction handling for a dependent nested-name-specifier. Locate the relevant semantic-analysis tests and add a regression test showing that this program is rejected, then run the focused compiler test suite to verify the diagnostic and avoid regressions.

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
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.