build failure with boost 1.56 and C++11

Bug #1357411 reported by Liam P. White on 2014-08-15
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
High
Liam P. White

Bug Description

Ubuntu 14.04
clang 3.5 with libc++ 1.0~svn199600
Boost 1.56
C++11 support enabled

../../src/object-snapper.cpp:680:34: error: no matching constructor for initialization of 'Inkscape::SnappedPoint'
                SnappedPoint s = SnappedPoint(*p_inters, p.getSourceType(), p.getSourceNum(), k->target_type, dist, getSnapperTolerance(), getSnapperAlwaysSnap(), true, k->target_bbox);;

../../src/snapped-point.h:31:5: note: candidate constructor not viable: no known conversion from 'const Geom::OptRect' to 'const bool' for 9th argument
    SnappedPoint(Geom::Point const &p, SnapSourceType const &source, long source_num, SnapTargetType const &target, Geom::Coord const &d, Geom::Coord const &t, bool const &a, bool const &constrained_snap...
    ^
../../src/snapped-point.h:32:5: note: candidate constructor not viable: requires 7 arguments, but 9 were provided
    SnappedPoint(SnapCandidatePoint const &p, SnapTargetType const &target, Geom::Coord const &d, Geom::Coord const &t, bool const &a, bool const &constrained_snap, bool const &fully_constrained);
    ^
1 error generated.

Related MacPorts trac ticket: https://trac.macports.org/ticket/44657

summary: - trunk: build failure with boost 1.56 and C++11
+ build failure with boost 1.56 and C++11
su_v (suv-lp) wrote :

Reproduced with Inkscape 0.48.5, boost 1.56 on OS X 10.7.5 if compiling with clang and '-std=c++11' (used in upstream portfile).

Stable and current trunk (r13520) compiled ok with clang on Lion without '-std=c++11' (not required on Lion and Mavericks for clang builds).

--
Replaces comment #1: fix typo in revno for current trunk.

Changed in inkscape:
importance: Undecided → High
milestone: none → 0.91
status: New → Confirmed
Liam P. White (liampwhite) wrote :

Looks more like a clang bug than our fault, actually. It's not recognizing implicit bool conversion.

Changed in inkscape:
assignee: nobody → Liam P. White (inkscapebrony)
status: Confirmed → In Progress
Liam P. White (liampwhite) wrote :

Attaching patch for stable too.

Liam P. White (liampwhite) wrote :

Above patch for trunk does not compile cleanly with older boost versions / non C++11 build environment.

Proposing new patch for trunk.

Liam P. White (liampwhite) wrote :

The compiler error may have exposed a logic issue in the code.

Attempting third patch.

su_v (suv-lp) wrote :

Third version of patch tested successfully with 0.48.5 and trunk (r13520), boost 1.56, clang with '-std=c++11'.
(Note: no tests so far with other compilers, and older versions of boost)

Patch used for stable 0.48.5 attached.

David Evans (devans-n) wrote :

Confirming that most recent patches fix MacPorts' build issues with 0.48.5, trunk (r13528), experimental (r13488) and 0.91pre2 tarball using boost 1.56.

0.48.5, trunk built successfully on MacPorts buildbots as follows:

OS X 10.6 (Snow Leopard): Apple gcc-4.2 (g++-4.2)
OS X 10.7, 10.8, 10.9 (Lion, Mountain Lion, Mavericks): clang with '-std=c++11'.

experimental and 0.91pre2 tested on OS X 10.9 (Mavericks) using clang with '-std=c++11'.

See also:

https://trac.macports.org/ticket/44657
https://trac.macports.org/ticket/44670

Liam P. White (liampwhite) wrote :

@Diederik — can you confirm that the third version of the patch will work as expected?

You were right in concluding that the compiler revealed a logic error here, good catch! I've checked trunk, but couldn't find any other occurrences of this bug.

The patch looks fine, go ahead and apply it, both to 0.48.X as well as to trunk (in which the code has moved to line 680)

Changed in inkscape:
status: In Progress → Fix Committed
su_v (suv-lp) on 2014-09-09
tags: added: backport-proposed
su_v (suv-lp) wrote :

Fix backported to lp:inkscape/0.48.x in revision 10041.

tags: removed: backport-proposed
Bryce Harrington (bryce) on 2015-02-21
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.