Skip to content

foundationdb: name constructors without template-ids (C++20, gcc 16) - #1467

Merged
bryan-minimal merged 1 commit into
mainfrom
foundationdb-cxx20-cdtor
Nov 13, 2026
Merged

bryan-minimal merged 1 commit into
mainfrom
foundationdb-cxx20-cdtor

Conversation

@bryan-minimal

Copy link
Copy Markdown
Member

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:

flow/include/flow/flow.h:1072  explicit Promise<T>(SAV<T>* ptr)            -Wtemplate-id-cdtor
fdbrpc/include/fdbrpc/RangeMap.h:99  explicit IteratorImpl<isConst>(...)   -Wtemplate-id-cdtor

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>) and flow/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 -i does 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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bryan-minimal
bryan-minimal requested a review from a team as a code owner November 12, 2026 20:57
@coderabbitai

coderabbitai Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

  • Run on-demand review

This review includes 1 billable file and costs up to $0.25.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 73 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 15031cd and 042b648.

Files selected for processing: 1

  • packages/foundationdb/build.sh
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@norrietaylor norrietaylor left a comment

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.

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

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.

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.

@bryan-minimal
bryan-minimal added this pull request to the merge queue Nov 13, 2026
Merged via the queue into main with commit a8f9637 Nov 13, 2026
15 checks passed
@bryan-minimal
bryan-minimal deleted the foundationdb-cxx20-cdtor branch November 13, 2026 18:11
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.

2 participants