Skip to content

Explicitly define copy ctors etc in classes with virtual dtors #24502

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

Merged
merged 1 commit into from
Apr 25, 2024

Conversation

vadz
Copy link
Contributor

@vadz vadz commented Apr 24, 2024

This avoids gcc 14 giving -Wdeprecated-copy-dtor for these classes.

This warning was fixed by fc35ad9 (Remove unnecessary empty destructors, 2024-01-26) in master, but we can't remove the dtors in this branch, so add copy ctors and assignment operators here using new wxDECLARE_DEFAULT_COPY() and wxDECLARE_DEFAULT_COPY_AND_DEF() macros, which can be fine-tuned later (e.g. to do it only for gcc 14, if it has any adverse effects on some other compiler) if necessary.

Note that this also required adding some default ctors, as adding the copy ctor suppressed the generation of the default compiler-generated default ctor.

@vadz vadz force-pushed the 3.2-deprecated-copy-dtor branch 2 times, most recently from 6bd1d2a to 1213b4c Compare April 25, 2024 14:47
vadz added a commit to vadz/wxWidgets that referenced this pull request Apr 25, 2024
This avoids gcc 14 giving -Wdeprecated-copy-dtor for these classes.

This warning was fixed by fc35ad9 (Remove unnecessary empty
destructors, 2024-01-26) in master, but we can't remove the dtors in
this branch, so add copy ctors and assignment operators here using new
wxDECLARE_DEFAULT_COPY() and wxDECLARE_DEFAULT_COPY_AND_DEF() macros,
which can be fine-tuned later (e.g. to do it only for gcc 14, if it has
any adverse effects on some other compiler) if necessary.

Note that this also required adding some default ctors, as adding the
copy ctor suppressed the generation of the default compiler-generated
default ctor.

Closes wxWidgets#24502.
@vadz vadz force-pushed the 3.2-deprecated-copy-dtor branch 2 times, most recently from fad28bf to 1d13d7f Compare April 25, 2024 15:42
vadz added a commit to vadz/wxWidgets that referenced this pull request Apr 25, 2024
These macros are not used in this version, but define them just in case
people use them in their own code (they shouldn't, but they probably
will) when using wx 3.2 where they have been added in df7812e
(Explicitly define copy ctors etc in classes with virtual dtors,
2024-04-25).

See wxWidgets#24502.
vadz added a commit to vadz/wxWidgets that referenced this pull request Apr 25, 2024
This avoids gcc 14 giving -Wdeprecated-copy-dtor for these classes.

This warning was fixed by fc35ad9 (Remove unnecessary empty
destructors, 2024-01-26) in master, but we can't remove the dtors in
this branch, so add copy ctors and assignment operators here using new
wxDECLARE_DEFAULT_COPY() and wxDECLARE_DEFAULT_COPY_AND_DEF() macros,
which can be fine-tuned later (e.g. to do it only for gcc 14, if it has
any adverse effects on some other compiler) if necessary.

Note that this also required adding some default ctors, as adding the
copy ctor suppressed the generation of the default compiler-generated
default ctor.

Closes wxWidgets#24502.
@vadz vadz force-pushed the 3.2-deprecated-copy-dtor branch from 1d13d7f to df7812e Compare April 25, 2024 15:43
vadz added a commit to vadz/wxWidgets that referenced this pull request Apr 25, 2024
This avoids gcc 14 giving -Wdeprecated-copy-dtor for these classes.

This warning was fixed by fc35ad9 (Remove unnecessary empty
destructors, 2024-01-26) in master, but we can't remove the dtors in
this branch, so add copy ctors and assignment operators here using new
wxDECLARE_DEFAULT_COPY() and wxDECLARE_DEFAULT_COPY_AND_DEF() macros,
which can be fine-tuned later (e.g. to do it only for gcc 14, if it has
any adverse effects on some other compiler) if necessary.

Note that this also required adding some default ctors, as adding the
copy ctor suppressed the generation of the default compiler-generated
default ctor.

Closes wxWidgets#24502.
@vadz vadz force-pushed the 3.2-deprecated-copy-dtor branch from df7812e to 418e850 Compare April 25, 2024 16:40
This avoids gcc 14 giving -Wdeprecated-copy-dtor for these classes.

This warning was fixed by fc35ad9 (Remove unnecessary empty
destructors, 2024-01-26) in master, but we can't remove the dtors in
this branch, so add copy ctors and assignment operators here using new
wxDECLARE_DEFAULT_COPY() and wxDECLARE_DEFAULT_COPY_AND_DEF() macros,
which can be fine-tuned later (e.g. to do it only for gcc 14, if it has
any adverse effects on some other compiler) if necessary.

Note that this also required adding some default ctors, as adding the
copy ctor suppressed the generation of the default compiler-generated
default ctor.

Closes wxWidgets#24502.
@vadz vadz force-pushed the 3.2-deprecated-copy-dtor branch from 418e850 to 5c249cb Compare April 25, 2024 19:31
@vadz vadz merged commit 5c249cb into wxWidgets:3.2 Apr 25, 2024
@vadz vadz deleted the 3.2-deprecated-copy-dtor branch April 25, 2024 20:02
vadz added a commit that referenced this pull request Apr 25, 2024
These macros are not used in this version, but define them just in case
people use them in their own code (they shouldn't, but they probably
will) when using wx 3.2 where they have been added in 5c249cb
(Explicitly define copy ctors etc in classes with virtual dtors,
2024-04-25).

See #24502.
MapleLeaf-X pushed a commit to MapleLeaf-X/wxWidgets that referenced this pull request Apr 25, 2024
These macros are not used in this version, but define them just in case
people use them in their own code (they shouldn't, but they probably
will) when using wx 3.2 where they have been added in 5c249cb
(Explicitly define copy ctors etc in classes with virtual dtors,
2024-04-25).

See wxWidgets#24502.
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