Skip to content

Improve diagnostic for std::function<void() noexcept>#350

Merged
StephanTLavavej merged 1 commit intomicrosoft:masterfrom
CaseyCarter:replay
Dec 5, 2019
Merged

Improve diagnostic for std::function<void() noexcept>#350
StephanTLavavej merged 1 commit intomicrosoft:masterfrom
CaseyCarter:replay

Conversation

@CaseyCarter
Copy link
Copy Markdown
Contributor

Description

Programs that include such specializations are ill-formed, since the Standard only specifies a partial specialization of std::function<T> for non-noexcept function types T. The current diagnostic:

error C2027: use of undefined type 'std::_Get_function_impl<_Fty>'

is not great.

Fixes DevCom-825902.

[This is a replay of Microsoft-internal MSVC-PR-215822.]

Checklist

Be sure you've read README.md and understand the scope of this repo.

If you're unsure about a box, leave it unchecked. A maintainer will help you.

  • Identifiers in product code changes are properly _Ugly as per
    https://eel.is/c++draft/lex.name#3.1 or there are no product code changes.
  • The STL builds successfully and all tests have passed (must be manually
    verified by an STL maintainer before automated testing is enabled on GitHub,
    leave this unchecked for initial submission).
  • These changes introduce no known ABI breaks (adding members, renaming
    members, adding virtual functions, changing whether a type is an aggregate
    or trivially copyable, etc.).
  • These changes were written from scratch using only this repository,
    the C++ Working Draft (including any cited standards), other WG21 papers
    (excluding reference implementations outside of proposed standard wording),
    and LWG issues as reference material. If they were derived from a project
    that's already listed in NOTICE.txt, that's fine, but please mention it.
    If they were derived from any other project (including Boost and libc++,
    which are not yet listed in NOTICE.txt), you must mention it here,
    so we can determine whether the license is compatible and what else needs
    to be done.

Programs that include such specializations are ill-formed, since the Standard only specifies a partial specialization of `std::function<T>` for non-`noexcept` function types `T`. The current diagnostic:
```
error C2027: use of undefined type 'std::_Get_function_impl<_Fty>'
```
is not great.

Fixes DevCom-825902.

[This is a replay of Microsoft-internal MSVC-PR-215822.]
@CaseyCarter CaseyCarter requested a review from a team as a code owner December 4, 2019 18:28
@StephanTLavavej StephanTLavavej merged commit 4001720 into microsoft:master Dec 5, 2019
@CaseyCarter CaseyCarter deleted the replay branch December 5, 2019 15:41
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.

3 participants