Skip to content

Reject binary operator* with a clear diagnostic - #367

Merged
jbcoe merged 7 commits into
mainfrom
jbcoe-reject-binary-operator-star
Sep 13, 2026
Merged

jbcoe merged 7 commits into
mainfrom
jbcoe-reject-binary-operator-star

Conversation

@jbcoe

@jbcoe jbcoe commented Sep 12, 2026

Copy link
Copy Markdown
Owner

Fixes @philipcraig 's review comment on conformance.hh:146 (PR #355): a binary operator* fell through to the unspecialised operator_thunk primary template instead of failing with a clear diagnostic. Full binary operator* support is deferred; this rejects it explicitly at the interface boundary instead.

@jbcoe
jbcoe marked this pull request as ready for review September 12, 2026 19:29
@codecov

codecov Bot commented Sep 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.79%. Comparing base (ba3ce6c) to head (31d7c3c).

Additional details and impacted files
@@                        Coverage Diff                        @@
##           jbcoe-split-detail-logical-parts     #367   +/-   ##
=================================================================
  Coverage                             72.79%   72.79%           
=================================================================
  Files                                    12       12           
  Lines                                   838      838           
  Branches                                221      221           
=================================================================
  Hits                                    610      610           
  Misses                                   22       22           
  Partials                                206      206           
Flag Coverage Δ
consteval 100.00% <ø> (ø)
runtime 72.39% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jbcoe
jbcoe added this pull request to stack #362 September 12, 2026 20:29
@jbcoe
jbcoe removed this pull request from stack #362 September 12, 2026 22:29
@jbcoe
jbcoe added this pull request to stack #370 September 12, 2026 22:29
@jbcoe
jbcoe requested a review from philipcraig September 12, 2026 22:29
@jbcoe
jbcoe removed this pull request from stack #370 September 12, 2026 22:34
@jbcoe
jbcoe added this pull request to stack #371 September 12, 2026 22:46

@philipcraig philipcraig left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Second-round pass over the whole stack (#336#369). The guard does what the title says for the ordinary binary form; two gaps inline.

Comment thread conformance.hh
Comment thread conformance.hh
@jbcoe
jbcoe force-pushed the jbcoe-reject-binary-operator-star branch from 695cd34 to d76436b Compare September 13, 2026 13:37
@jbcoe
jbcoe force-pushed the jbcoe-reject-binary-operator-star branch 2 times, most recently from 31d7c3c to ad67466 Compare September 13, 2026 15:27
@jbcoe
jbcoe force-pushed the jbcoe-reject-binary-operator-star branch 2 times, most recently from bf2c77a to 1cf2118 Compare September 13, 2026 15:33
@jbcoe
jbcoe force-pushed the jbcoe-reject-binary-operator-star branch from 1cf2118 to 67189f0 Compare September 13, 2026 15:34
@jbcoe
jbcoe force-pushed the jbcoe-reject-binary-operator-star branch from 67189f0 to 7b85ab6 Compare September 13, 2026 15:37
@jbcoe
jbcoe force-pushed the jbcoe-reject-binary-operator-star branch from 7b85ab6 to 6e79f39 Compare September 13, 2026 15:37
@jbcoe
jbcoe force-pushed the jbcoe-reject-binary-operator-star branch from 6e79f39 to 2cf261a Compare September 13, 2026 15:38
@jbcoe
jbcoe force-pushed the jbcoe-reject-binary-operator-star branch from 2cf261a to fbc8fc9 Compare September 13, 2026 15:39
@jbcoe
jbcoe force-pushed the jbcoe-reject-binary-operator-star branch from fbc8fc9 to c16f82e Compare September 13, 2026 15:41
@jbcoe
jbcoe force-pushed the jbcoe-reject-binary-operator-star branch from c16f82e to dafe80e Compare September 13, 2026 15:44
@jbcoe
jbcoe force-pushed the jbcoe-reject-binary-operator-star branch 2 times, most recently from e7c6920 to 4f48c2f Compare September 13, 2026 15:47
@jbcoe
jbcoe force-pushed the jbcoe-reject-binary-operator-star branch 2 times, most recently from 55b920d to 3300c62 Compare September 13, 2026 15:51
@jbcoe
jbcoe force-pushed the jbcoe-reject-binary-operator-star branch from 3300c62 to f54b829 Compare September 13, 2026 15:52
@jbcoe
jbcoe force-pushed the jbcoe-reject-binary-operator-star branch 2 times, most recently from f266d7c to a63c073 Compare September 13, 2026 15:53
Base automatically changed from jbcoe-split-detail-logical-parts to main September 13, 2026 15:53
jbcoe and others added 7 commits September 13, 2026 09:53
operator_thunk only specialised the nullary R(*)() form for op_star, so
an interface with a binary operator* (e.g. `Vec operator*(double) const`)
never matched a partial specialisation and fell through to the deleted
primary template, producing an opaque error deep inside
operator_overload_set instead of a clear diagnostic. Binary operator*
support is deferred; for now, reject it explicitly in
protocol_interface_function_infos, next to the ref-qualified check, so
the error surfaces at the interface.

The arity check excludes an explicit object parameter ("deducing this")
so a unary operator* declared that way isn't misclassified as binary.

Addresses philipcraig's review comment on conformance.hh:146 in #355.
@jbcoe
jbcoe force-pushed the jbcoe-reject-binary-operator-star branch from a63c073 to f3e6cab Compare September 13, 2026 15:54
@jbcoe
jbcoe merged commit 57aceb4 into main Sep 13, 2026
0 of 8 checks passed
@jbcoe
jbcoe deleted the jbcoe-reject-binary-operator-star branch September 13, 2026 15:54
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