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)

Details

Provenance
jhaleAuthored on Oct 28 2022, 1:37 AM
Parents
R11:376c30a320ee: mail/snappymail: Update to 2.19.4
Branches
Unknown
Tags
Unknown