Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dcl.fct.def.delete] Make terms cover semantic deletedness #3952

Conversation

hubert-reinterpretcast
Copy link
Contributor

The definition of "deleted definition" in [dcl.fct.def.delete] is not written in the form of a definition and neither is the definition of "deleted function". Most problematically, these definitions encompass only the syntactic case of explicitly deleting a function but the terms are used where semantic deletedness is meant.

Applying the syntactic interpretation of the definition could lead to the conclusion that the following is ill-formed:

struct A { ~A() = delete; };
struct B {
    A a;
      virtual ~B() = default;
};
struct C : B { virtual ~C() = delete; };

This patch changes the definitions to cover semantic deletion.

Drafting notes:

  • It appears that uses of "deleted definition" in the text is usually refer to physical definitions (but not necessarily to explicit deletions).
  • The increased verbosity is somewhat necessary to meet the ideal that uses of a term may be replaced with the definition of the term with minimal adjustments.

Copy link
Member

@jensmaurer jensmaurer left a comment

Choose a reason for hiding this comment

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

Looks like an improvement to me.

When we talk about "delete function", we don't care how it ends up being deleted.

source/classes.tex Outdated Show resolved Hide resolved
source/declarations.tex Outdated Show resolved Hide resolved
@zygoloid zygoloid added changes requested Changes to the wording or approach have been requested and not yet applied. needs rebase The pull request needs a git rebase to resolve merge conflicts. labels Oct 18, 2020
@hubert-reinterpretcast hubert-reinterpretcast force-pushed the fix_deleted_def_fun_syntactic_semantic branch from abe7b94 to 486d813 Compare January 4, 2021 16:55
Copy link
Member

@jensmaurer jensmaurer left a comment

Choose a reason for hiding this comment

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

needs squashing; looks good

@jensmaurer jensmaurer removed changes requested Changes to the wording or approach have been requested and not yet applied. needs rebase The pull request needs a git rebase to resolve merge conflicts. labels Jan 4, 2021
The definition of "deleted definition" in [dcl.fct.def.delete] is not
written in the form of a definition and neither is the definition of
"deleted function". Most problematically, these definitions encompass
only the syntactic case of explicitly deleting a function but the terms
are used where semantic deletedness is meant.

Applying the syntactic interpretation of the definition could lead to
the conclusion that the following is ill-formed:
```cpp
struct A { ~A() = delete; };
struct B {
  A a;
  virtual ~B() = default;
};
struct C : B { virtual ~C() = delete; };
```

This patch changes the definitions to cover semantic deletion.

**Drafting notes:**

- It appears that uses of "deleted definition" in the text is usually
  refer to physical definitions (but not necessarily to explicit
  deletions).
- The increased verbosity is somewhat necessary to meet the ideal that
  uses of a term may be replaced with the definition of the term with
  minimal adjustments.
@hubert-reinterpretcast hubert-reinterpretcast force-pushed the fix_deleted_def_fun_syntactic_semantic branch from 486d813 to 1836b20 Compare January 4, 2021 21:18
@hubert-reinterpretcast
Copy link
Contributor Author

Ping @zygoloid.

@jensmaurer
Copy link
Member

@tkoeppe, this looks ready to go.

@tkoeppe
Copy link
Contributor

tkoeppe commented Mar 15, 2021

Great, thanks!

@tkoeppe tkoeppe merged commit e66bf8f into cplusplus:master Mar 15, 2021
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.

None yet

4 participants