Skip to content

[2026-11 CWG Motion 3] P4451R2 Early Adoption of an Always-Enforced Label - #9418

Merged
tkoeppe merged 2 commits into
cplusplus:mainfrom
notadragon:p4451r2_early_adoption_of_an_always_enforced_label
Nov 29, 2026
Merged

tkoeppe merged 2 commits into
cplusplus:mainfrom
notadragon:p4451r2_early_adoption_of_an_always_enforced_label

Conversation

@notadragon

@notadragon notadragon commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #9399
Also fixes cplusplus/papers#2950
Also fixes cplusplus/nbballot#1001

Comment thread source/basic.tex Resolved
Comment thread source/preprocessor.tex Outdated
\defnxname{cpp_constexpr_virtual_inheritance} & \tcode{202506L} \\ \rowsep
\defnxname{cpp_constinit} & \tcode{201907L} \\ \rowsep
\defnxname{cpp_contracts} & \tcode{202606L} \\ \rowsep
\defnxname{cpp_contracts} & \tcode{202611L} \\ \rowsep

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously __cpp_contracts was bumped to 202606L by P3097R3. IIUC P3097R3 targets C++29 while P4451R2 targets C++26. Could the value 202611L cause problem in C++26, as it indicates that P3097R3 is supported, but in fact it's not in C++26?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesting times call for interesting solutions.

i think we will want to leave this alone, and then possiblely open a core issue to bump the c++29 macro version.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although the value could be arbitrary, I personally slightly prefer to make the C++26 value lower than or equal to 202603L (the value of __cplusplus).

@notadragon notadragon Nov 22, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i wouldn't object to that, but I would revert it from this pr and then just update it in the DIS. (the WD would stay with the p3097 value)

@tkoeppe tkoeppe Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see no reason to diverge from the wording that the working group has just approved. I assume they had their reasons.

@jensmaurer Is there an oversight here that we should correct?

@tkoeppe tkoeppe Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not quorate unless @jensmaurer was present :-)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to match the date of the DIS.

Dis is very imprecisely worded.

@notadragon notadragon Nov 22, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the entire admin group moved to form the van group with me as chair. lewgi and sg23 seconded.

@jensmaurer jensmaurer Nov 27, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we had a reflector discussion about this topic, with a sort-of consensus outcome. The issue was not mentioned in CWG.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, let's adopt the paper as is into both documents, and then separately update the value to 202612L for the C++29 working draft only, with the intention of indicatiing support for P3097.

@tkoeppe
tkoeppe force-pushed the p4451r2_early_adoption_of_an_always_enforced_label branch from 932073f to 559872f Compare November 22, 2026 18:36
@tkoeppe
tkoeppe force-pushed the p4451r2_early_adoption_of_an_always_enforced_label branch from 559872f to b1a3b7b Compare November 29, 2026 19:48
Paper P3097R3 was adopted in Brno 2026 for C++29 and changed the
__cpp_contracts macro to "202606L". At that point, the first DIS
for C++26 retained the previous value "202502L".

With the adoption of P4451R2 for the second DIS for C++26 as well
as for the C++29 working draft, the value of the macro needs to be
changed again, but we need for C++26 to not depend on any material
from C++29. We are therefore updating __cpp_contracts as well as
__cplusplus to "202611L" for P4451R2, and conformance with P3097R3
in C++29 is now indicated by the value "202612L".
@tkoeppe
tkoeppe merged commit 7a8ec04 into cplusplus:main Nov 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[2026-11 CWG Motion 3] P4451R2 Early Adoption of an Always-Enforced Label P4451 R0 Early Adoption of an Always-Enforced Label

6 participants