8000 Fix compilation with clang8 #1674 by Lomadriel · Pull Request #1675 · polybar/polybar · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix compilation with clang8 #1674 #1675

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
Mar 6, 2019

Conversation

Lomadriel
Copy link
Member
@Lomadriel Lomadriel commented Mar 6, 2019

This PR fixes #1674 by removing the copy ctor and assignment operator of tray_client.

Copy assignment was marked as defaulted however as stated in the C++ standard:

A defaulted copy/move assignment operator for class X is defined as deleted if X has:

  • […]
  • non-static data member of reference type, or
  • […]

§ 12.8

Since a reference can't be reassigned, I just marked this operator as explicitly deleted.

The copy ctor was also defaulted and it is well-formed but the dtor unembed the window so copying that class may cause bugs, so I also marked it as explicitly deleted. Another solution if copying this class is needed is to do the "unembeding" in a custom deleter of m_xembed.

tray_client class contains a reference so copy assignment operator is implicitly deleted.
the dtor unembed the window so copying the class could lead to bug so the copy ctor is also deleted.
@patrick96 patrick96 added this to the 3.3.1 milestone Mar 6, 2019
@patrick96
Copy link
Member

Oh, so because m_connection is of reference type, the move assignment operator is implicitly deleted?

Copy link
Member
@patrick96 patrick96 left a comment

Choose a reason for hiding this comment

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

Thanks!

@patrick96 patrick96 merged commit 25ef029 into polybar:master Mar 6, 2019 10000
@Lomadriel
Copy link
Member Author

Oh, so because m_connection is of reference type, the move assignment operator is implicitly deleted?

Yeap, the move assignment operator is also implicitly deleted. Moreover there is no move ctor because there is a destructor declared. So this class is non-movable and non-copyable.
The move constructor can be declared and implemented without causing any problem, but it is needed to add a condition to not free the resource in the dtor.

patrick96 pushed a commit that referenced this pull request Mar 25, 2019
tray_client class contains a reference so copy assignment operator is implicitly deleted.
the dtor unembed the window so copying the class could lead to bug so the copy ctor is also deleted.

Fixes #1674
patrick96 added a commit that referenced this pull request Mar 25, 2019
Changelog

Fixes:
* `internal/xworkspaces`:
    * Crash when WM doesn't set `_NET_DESKTOP_NAMES` (#1576), see #1462
    * Workspace removal not always detected (#1579), see #1491, #248
* `internal/i3`: Crash when `<label-state>` was not added to `format` (#1591), see #975
* `internal/fs`: Incorrect sizes on some machines (#1612, #1699), see #743
* `internal/network`: Buffer overflow with ipv6 addresses (#1514)
* renderer: Show proper error when imagemagick is used to set the background (#1608), see #1582, #1585
* tray:
    * Wrong background for transparent trays when using `tray-offset-*` (#1571)
    * Build failure on clang8 (#1675), #1674
    * Allow negative offset values for `tray-offset-*` (#1669), see #1666
* build: Link failure when configuring with `-DBUILD_SHARED_LIBS=ON` (#1647, polybar/xpp#15), see #1628
* controller: Crash when reloading via `SIGUSR1` too fast (#1678), #428
@patrick96 patrick96 mentioned this pull request Mar 25, 2019
patrick96 added a commit that referenced this pull request Mar 25, 2019
Changelog

Fixes:
* `internal/xworkspaces`:
    * Crash when WM doesn't set `_NET_DESKTOP_NAMES` (#1576), see #1462
    * Workspace removal not always detected (#1579), see #1491, #248
* `internal/i3`: Crash when `<label-state>` was not added to `format` (#1591), see #975
* `internal/fs`: Incorrect sizes on some machines (#1612, #1699), see #743
* `internal/network`: Buffer overflow with ipv6 addresses (#1514)
* renderer: Show proper error when imagemagick is used to set the background (#1608), see #1582, #1585
* tray:
    * Wrong background for transparent trays when using `tray-offset-*` (#1571)
    * Build failure on clang8 (#1675), #1674
    * Allow negative offset values for `tray-offset-*` (#1669), see #1666
* build: Link failure when configuring with `-DBUILD_SHARED_LIBS=ON` (#1647, polybar/xpp#15), see #1628
* controller: Crash when reloading via `SIGUSR1` too fast (#1678), #428
@Lomadriel Lomadriel deleted the fix/tray_client_copy branch August 4, 2019 19:05
doronbehar pushed a commit to doronbehar/polybar that referenced this pull request Aug 5, 2019
Changelog

Fixes:
* `internal/xworkspaces`:
    * Crash when WM doesn't set `_NET_DESKTOP_NAMES` (polybar#1576), see polybar#1462
    * Workspace removal not always detected (polybar#1579), see polybar#1491, polybar#248
* `internal/i3`: Crash when `<label-state>` was not added to `format` (polybar#1591), see polybar#975
* `internal/fs`: Incorrect sizes on some machines (polybar#1612, polybar#1699), see polybar#743
* `internal/network`: Buffer overflow with ipv6 addresses (polybar#1514)
* renderer: Show proper error when imagemagick is used to set the background (polybar#1608), see polybar#1582, polybar#1585
* tray:
    * Wrong background for transparent trays when using `tray-offset-*` (polybar#1571)
    * Build failure on clang8 (polybar#1675), polybar#1674
    * Allow negative offset values for `tray-offset-*` (polybar#1669), see polybar#1666
* build: Link failure when configuring with `-DBUILD_SHARED_LIBS=ON` (polybar#1647, polybar/xpp#15), see polybar#1628
* controller: Crash when reloading via `SIGUSR1` too fast (polybar#1678), polybar#428
doronbehar pushed a commit to doronbehar/polybar that referenced this pull request Feb 11, 2020
Changelog

Fixes:
* `internal/xworkspaces`:
    * Crash when WM doesn't set `_NET_DESKTOP_NAMES` (polybar#1576), see polybar#1462
    * Workspace removal not always detected (polybar#1579), see polybar#1491, polybar#248
* `internal/i3`: Crash when `<label-state>` was not added to `format` (polybar#1591), see polybar#975
* `internal/fs`: Incorrect sizes on some machines (polybar#1612, polybar#1699), see polybar#743
* `internal/network`: Buffer overflow with ipv6 addresses (polybar#1514)
* renderer: Show proper error when imagemagick is used to set the background (polybar#1608), see polybar#1582, polybar#1585
* tray:
    * Wrong background for transparent trays when using `tray-offset-*` (polybar#1571)
    * Build failure on clang8 (polybar#1675), polybar#1674
    * Allow negative offset values for `tray-offset-*` (polybar#1669), see polybar#1666
* build: Link failure when configuring with `-DBUILD_SHARED_LIBS=ON` (polybar#1647, polybar/xpp#15), see polybar#1628
* controller: Crash when reloading via `SIGUSR1` too fast (polybar#1678), polybar#428
doronbehar pushed a commit to doronbehar/polybar that referenced this pull request Mar 19, 2020
Changelog

Fixes:
* `internal/xworkspaces`:
    * Crash when WM doesn't set `_NET_DESKTOP_NAMES` (polybar#1576), see polybar#1462
    * Workspace removal not always detected (polybar#1579), see polybar#1491, polybar#248
* `internal/i3`: Crash when `<label-state>` was not added to `format` (polybar#1591), see polybar#975
* `internal/fs`: Incorrect sizes on some machines (polybar#1612, polybar#1699), see polybar#743
* `internal/network`: Buffer overflow with ipv6 addresses (polybar#1514)
* renderer: Show proper error when imagemagick is used to set the background (polybar#1608), see polybar#1582, polybar#1585
* tray:
    * Wrong background for transparent trays when using `tray-offset-*` (polybar#1571)
    * Build failure on clang8 (polybar#1675), polybar#1674
    * Allow negative offset values for `tray-offset-*` (polybar#1669), see polybar#1666
* build: Link failure when configuring with `-DBUILD_SHARED_LIBS=ON` (polybar#1647, polybar/xpp#15), see polybar#1628
* controller: Crash when reloading via `SIGUSR1` too fast (polybar#1678), polybar#428
doronbehar pushed a commit to doronbehar/polybar that referenced this pull request Mar 19, 2020
Changelog

Fixes:
* `internal/xworkspaces`:
    * C
9135
rash when WM doesn't set `_NET_DESKTOP_NAMES` (polybar#1576), see polybar#1462
    * Workspace removal not always detected (polybar#1579), see polybar#1491, polybar#248
* `internal/i3`: Crash when `<label-state>` was not added to `format` (polybar#1591), see polybar#975
* `internal/fs`: Incorrect sizes on some machines (polybar#1612, polybar#1699), see polybar#743
* `internal/network`: Buffer overflow with ipv6 addresses (polybar#1514)
* renderer: Show proper error when imagemagick is used to set the background (polybar#1608), see polybar#1582, polybar#1585
* tray:
    * Wrong background for transparent trays when using `tray-offset-*` (polybar#1571)
    * Build failure on clang8 (polybar#1675), polybar#1674
    * Allow negative offset values for `tray-offset-*` (polybar#1669), see polybar#1666
* build: Link failure when configuring with `-DBUILD_SHARED_LIBS=ON` (polybar#1647, polybar/xpp#15), see polybar#1628
* controller: Crash when reloading via `SIGUSR1` too fast (polybar#1678), polybar#428
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.

Fail to build with LLVM8/Clang8.
2 participants
0