P2285R1 — Are default function arguments in the immediate context?
(9 items)
EWG
This paper analyzes whether default function arguments and default member initializers should be considered part of the immediate context of their enclosing construct for SFINAE/concept-checking purposes. Compilers currently diverge significantly on this question, producing inconsistent results when checking type traits or concepts involving types with such defaults. The paper recommends that the Standard mandate these constructs be treated as immediate context, so that substitution failures in default arguments cause a function to be excluded from overload resolution rather than causing a hard error, while also recommending that defaulted default constructors be deleted when their associated default member initializers are ill-formed.
- §3.2 (Consistency with default member initializers), commented-out constructor — Member initializer list x{x} y{y} is missing a comma between x{x} and y{y}; this code is ill-formed if uncommented, yet the surrounding text presents it as a valid equivalent constructor. [2] [1]
- Section headings for Implementability and Our Recommendation — Both Implementability and Our Recommendation are numbered section 4; subsequent sections 5-7 continue from the first 4, leaving the entire tail misnumbered. [2]
- §2.2 and §2.3 headings — Both section 2.2 (Function address) and section 2.3 (Function's source location) share the HTML id model.address; IDs must be unique per document. [3]
- §1 (Motivation), all compiler-comparison tables — A stray closing td tag appears before the fourth cell in every data row across at least three tables, a systematic copy-paste error. [4]
- §4 (Implementability), paragraph on MSVC — Subject-verb disagreement: mechanism end up should be mechanism ends up. [5]
- §4 (Implementability), second paragraph — still not trigger is missing an auxiliary verb; should be still do not trigger or still does not trigger. [6]
- §1 (introductory paragraph, item 2) — Form is a misspelling of From. [7]
- §4 (Implementability), first paragraph — forntend is a misspelling of frontend. [1] [8]
- §4 (Implementability), paragraph on ABI impact — nave is a misspelling of have. [9]
References — Anthropic Citations API
[1]
"Form the users' perspective (both these who call functions/create objects, and who define them)"
"Form the users' perspective (both these who call functions/create objects, and who define them)"
[2]
chars 17526–18001
"Implementability
"Implementability
From the presented compiler tests, it looks like Clang and ICX (using EDG forntend) have taken the same approach: because both default function arguments and..."
[3]
"This might nave an impact on the ABI."
"This might nave an impact on the ABI."
[4]
"the mechanism end up being, "if the default function argument exists assume it will be valid"."
"the mechanism end up being, "if the default function argument exists assume it will be valid"."
[5]
"The template instantiation that needs to happen here is either not performed, or its effects still not trigger the hard error."
"The template instantiation that needs to happen here is either not performed, or its effects still not trigger the hard error."
[8]
chars 16376–16685
"Consider:
"Consider:
template <typename T>
struct S
{
T x;
T y = T{};
// explicit S(T x, T y = T{}) : x{x} y{y} {}
};
S x (1); // ok
S y (1, 2); //..."
[8]
chars 16376–16685
"Consider:
"Consider:
template <typename T>
struct S
{
T x;
T y = T{};
// explicit S(T x, T y = T{}) : x{x} y{y} {}
};
S x (1); // ok
S y (1, 2); //..."
[9]
"outputs ill-formed "
"
1
Summary: P2285R1 asks whether substitution failures in default function arguments should be treated as SFINAE (immediate context) or hard errors, surveys existing compiler divergence on the question, and recommends that such failures be non-erroneous. Nine items were found, including a missing comma in a code example presented as valid, duplicate section numbering, and several spelling and grammar errors.
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.