Skip to content

Do not bind to functions with unsatisfied trailing results clauses - #1858

Merged
copybara-service[bot] merged 1 commit into
mainfrom
test_967592498
Aug 25, 2026
Merged

Do not bind to functions with unsatisfied trailing results clauses#1858
copybara-service[bot] merged 1 commit into
mainfrom
test_967592498

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Aug 24, 2026

Copy link
Copy Markdown

Do not bind to functions with unsatisfied trailing results clauses

... or to functions that would transitively depend on same.

A previous version of this CL looked at isIneligibleOrNotSelected(),
but this bit is apparently changed at various points during typechecking,
and is not reliable for making this determination.

Documentation about this seems to be sparse (Clang says:

    /// For member functions of complete types, whether this is an ineligible
    /// special member function or an unselected destructor. See
    /// [class.mem.special].

)

but class.mem.special doesn't seem to be a valid standard reference?

The relevant thing that's happening here is that we have a default member
function that won't be generated because its requires clause is not
satisfied:

  _LIBCPP_HIDE_FROM_ABI atomic()
    requires is_default_constructible_v<_Tp>
  = default;

This change directly checks whether the trailing constraint is satisfied.
If not, we will not bind the function.

@copybara-service
copybara-service Bot force-pushed the test_967592498 branch 2 times, most recently from 33989c5 to ffb9ae9 Compare August 25, 2026 02:21
@copybara-service copybara-service Bot changed the title Do not bind to ineligible special member functions, or to Do not bind to functions with unsatisfied trailing results clauses Aug 25, 2026
@copybara-service
copybara-service Bot force-pushed the test_967592498 branch 2 times, most recently from 77ca4bc to 4442e3d Compare August 25, 2026 17:21
... or to functions that would transitively depend on same.

A previous version of this CL looked at isIneligibleOrNotSelected(),
but this bit is apparently changed at various points during typechecking,
and is not reliable for making this determination.

Documentation about this seems to be sparse (Clang says:
```
    /// For member functions of complete types, whether this is an ineligible
    /// special member function or an unselected destructor. See
    /// [class.mem.special].
```
)

but `class.mem.special` doesn't seem to be a valid standard reference?

The relevant thing that's happening here is that we have a default member
function that won't be generated because its requires clause is not
satisfied:

```
  _LIBCPP_HIDE_FROM_ABI atomic()
    requires is_default_constructible_v<_Tp>
  = default;
```

This change directly checks whether the trailing constraint is satisfied.
If not, we will not bind the function.

PiperOrigin-RevId: 970646733
@copybara-service
copybara-service Bot merged commit 1602287 into main Aug 25, 2026
7 checks passed
@copybara-service
copybara-service Bot deleted the test_967592498 branch August 25, 2026 17:36
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.

1 participant