Repository navigation
foundationdb: name constructors without template-ids (C++20, gcc 16) - #1467
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reached
This review includes 1 billable file and costs up to $0.25.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 27 minutes for your next included review. View limit details
|
norrietaylor
left a comment
There was a problem hiding this comment.
Scope matches the title. The diff adds four sed edits and a grep guard to packages/foundationdb/build.sh. Nothing else changes. Clobber none. git log on packages/foundationdb/ shows no recent fix that this diff touches. The new block sits after the toml11 edit and leaves the older edits as they were. Correctness The sed expressions are valid BRE. They change only the constructor name, which is correct in every C++ standard. The guard after them cannot fire. It searches for the same text that sed just replaced, so a missed substitution also misses the grep. Under gcc 16 the compiler still rejects a missed site, so nothing ships broken. The guard and its comment do not do what they say. Not checked I did not build the package or run the edits on the 7.3.81 sources. I depended on the PR body for the claim that each sed matches exactly one site. A scratch run of the guard logic was also not possible in this sandbox, so that finding comes from reading the code.
| fdbrpc/include/fdbrpc/RangeMap.h flow/include/flow/IndexedSet.h; then | ||
| echo "foundationdb: template-id constructor fix did not apply" >&2 | ||
| exit 1 | ||
| fi |
There was a problem hiding this comment.
low · The guard cannot catch the failure that it is for. It greps for the same text that the sed commands just replaced. If upstream changes the line (spacing, parameter name, a line break), sed does not match and grep does not match either. So the build continues silently, which the comment at line 41 and the PR body say cannot happen. The guard fires only if a matching line survives sed, and that never occurs. Check for the replaced text instead. For example, run grep -q 'explicit Promise(SAV<T>\* ptr)' flow/include/flow/flow.h || exit 1 for each of the four sites. The other sed edits in this file (lines 19, 22, 32, 35) have no guard, so this problem is local to the new block. Today gcc 16 still rejects a missed site at compile time. For that reason nothing breaks. The guard and its comment will mislead the next person who bumps the version.
This clears foundationdb's gcc 16 build failure ahead of the compiler flip (gominimal/pkgmgr-rs#1182). On the gcc 16.2 world-build canary (#1340), foundationdb was the first package to fail:
C++20 forbids naming a constructor with a template-id. A full-tree scan of 7.3.81 found two more sites of the same kind that the canary hadn't reached yet:
fdbrpc/include/fdbrpc/fdbrpc.h:202(ReplyPromise<T>) andflow/include/flow/IndexedSet.h:94(IteratorImpl<isConst>). Upstream still has all four on main and on 7.4.8.build.sh now drops the template arguments from those four constructor names. The plain name means the same thing in every C++ standard, so the change is a no-op under today's gcc 15. Because
sed -idoes nothing silently when it doesn't match, a grep afterwards fails the build if any of the four is still present. The substitutions were tested off-host on the 7.3.81 sources: each replaces exactly one site and leaves none behind.Rebuilds: 1 (foundationdb;
mip dump --packages, amd64).The scan matches single-line declarations only, so a multi-line template-id constructor would still show up on the next canary run.
🤖 Generated with Claude Code