P4004R0 — Reconsider CWG 1395 "Partial ordering of variadic templates reconsidered"
(6 items)
EWG
This paper proposes reverting most of the DR resolution of CWG 1395, which fundamentally changed how function parameter packs are handled during partial ordering of function templates. The CWG 1395 resolution is implemented only by EDG and conflicts with the behavior of GCC, Clang, and MSVC, causing real-world code breakage; additionally, the current wording has normative gaps that leave certain overload resolution cases ambiguous. The paper presents two options, with Option 1 providing concrete wording to restore pre-CWG 1395 deduction failure semantics while retaining the existing pack-vs-non-pack tie-breaker in [temp.deduct.partial]/11.
- Page 1, Introduction — "widereaching" is not a standard English word; should be hyphenated as "wide-reaching." [1]
- Page 2, CWG 1825 example discussion — "currently chose" uses past tense where present tense is required; should read "currently choose." [2]
- Page 2, first paragraph — Doubled "the" in "from the the type of the pack." [3]
- Page 3, Acknowledgements — "I like to thank" is missing "would"; should read "I would like to thank." [4]
References — Anthropic Citations API
[1]
"- 2 - from the the type of the pack for each remaining parameter type. "
"- 2 - from the the type of the pack for each remaining parameter type. "
[2]
"Introduction CWG 1395 "Partial ordering of variadic templates reconsidered" was raised to address the ambiguity for a trailing function parameter pack: template
void print(ostream..."
"Introduction CWG 1395 "Partial ordering of variadic templates reconsidered" was raised to address the ambiguity for a trailing function parameter pack: template
[3]
"GCC and MSVC currently chose #2, and Clang says it's ambiguous."
"GCC and MSVC currently chose #2, and Clang says it's ambiguous."
[4]
"Keep [temp.deduct.partial] paragraph 11 unchanged: If, after considering the above, function template F is at least as specialized as function template G and vice-versa, and if G has a trailing..."
"Keep [temp.deduct.partial] paragraph 11 unchanged: If, after considering the above, function template F is at least as specialized as function template G and vice-versa, and if G has a trailing..."
Summary: P4004R0 proposes reverting or revising CWG 1395's changes to partial ordering of variadic templates in [temp.deduct.partial], arguing the resolution introduced unintended behavioral changes and divergent implementation strategies across major compilers. Four surface-level text errors were found.
Pipeline: Discovery (Anthropic Opus + Citations API) → Verification Gate (OpenRouter Opus) → Report Writer (OpenRouter Opus)
Provenance: All references are machine-verified character positions from the Anthropic Citations API — deterministic, exact substrings, not model-generated quotes.
Provenance: All references are machine-verified character positions from the Anthropic Citations API — deterministic, exact substrings, not model-generated quotes.