HomeFreeBSD

cad/librecad: Fix orthogonal and rel angle tools

Description

cad/librecad: Fix orthogonal and rel angle tools

When using Tools > Line > Orthogonal or Tools > Line > Relative angle,
it is not possible to select the base entity.

Apparently, the code works with GCC, but Clang warns:
In file included from actions/rs_actiondrawlinerelangle.cpp:27:
actions/rs_actiondrawlinerelangle.h:116:53: warning: array backing local initializer list 'enTypeList' will be destroyed at the end of the full-expression [-Wdangling]

const EntityTypeList enTypeList = EntityTypeList{RS2::EntityLine, RS2::EntityArc, RS2::EntityCircle,RS2::EntityEllipse};

actions/rs_actiondrawlinerelangle.cpp:41:28: warning: backing array for 'std::initializer_list' member 'enTypeList' is a temporary object whose lifetime is shorter than the lifetime of the constructed object [-Wdangling-field]
RS_ActionDrawLineRelAngle::RS_ActionDrawLineRelAngle(

Patch reverts upstream commits eb2e146 [1] and d0a0ef2 [2] which were
intended to fix the build with the now unsupported GCC 9.

[1] https://github.com/LibreCAD/LibreCAD/commit/eb2e1465bb6186de155fc1b68e4aa5580e6990dc
[2] https://github.com/LibreCAD/LibreCAD/commit/d0a0ef284b7fcc5c0d65b92c30855f62b637653f

Reported by: slovkam u sebi <slovkamusebi@protonmail.com> (via private mail)

(cherry picked from commit 9fe9575a924774bdd1ee00b08ae0d91d412b4af9)

Details

Provenance
jhaleAuthored on Oct 28 2022, 1:37 AM
Parents
R11:ae4de8c86c33: net-mgmt/netbox: Update to 3.3.6
Branches
Unknown
Tags
Unknown