Invalid template parameter packs dependent upon other template parameter packs in the same template parameter list are incorrectly accepted
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
```cpp
templatestruct S{};
templatevoid foo(S...){}
int main(){
foo();
}
```
```cpp
templatevoid foo(){}
int main(){
foo();
}
```
These should both be invalid because of [[temp.param]/6](https://eel.is/c++draft/temp.param#6.sentence-5) "A template parameter pack that is a pack expansion shall not expand a template parameter pack declared in the same template-parameter-list.". GCC rejects the former but allows the latter, and MSVC rejects the latter but allows the former. See also: [CWG778](https://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#778)
Contributor guide
Research direction
Start by compiling both reduced C++ examples and compare Clang's behavior with the standard rule and the GCC/MSVC results described. Trace the compiler's validation of dependent template parameter packs and add regression coverage so both invalid forms are rejected consistently.
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