Bug 206650 - x11/leechcraft: fix build with clang 3.8.0
Summary: x11/leechcraft: fix build with clang 3.8.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Dimitry Andric
URL:
Keywords:
Depends on:
Blocks: 206074
  Show dependency treegraph
 
Reported: 2016-01-26 18:56 UTC by Dimitry Andric
Modified: 2016-01-27 21:13 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (vg)


Attachments
Fix braced init lists for conforming to C++ N3922 (3.37 KB, patch)
2016-01-26 18:56 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer freebsd_triage 2016-01-26 18:56:14 UTC
Created attachment 166153 [details]
Fix braced init lists for conforming to C++ N3922

During the exp-run in bug 206074, it was found that x11/leechcraft gives errors with a recent clang 3.8.0 snapshot [1]:

/wrkdirs/usr/ports/x11/leechcraft/work/leechcraft-0.6.70/src/util/network/addresses.cpp:44:4:
error: initializer for variable 'locals' with type 'const auto' contains
multiple expressions
                        QHostAddress::parseSubnet ("172.16.0.0/12"),
                        ^

and a number of similar errors.  This is because after the C++ Working Group issue N3922, a C++11/14 braced initializer for more than one element should be prefixed by an assignment operator, e.g. instead of:

    auto foo { 1, 2, 3, 4 };

one should write:

    auto foo = { 1, 2, 3, 4 };

The attached patch changes the few initializers in leechcraft to conform to this new syntax.  This fix should probably be upstreamed too.

[1] http://package18.nyi.freebsd.org/data/headamd64PR206074-default/2016-01-15_15h26m58s/logs/errors/leechcraft-0.6.70_7.log
[2] http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2014/n3922.html
Comment 1 Veniamin Gvozdikov freebsd_committer freebsd_triage 2016-01-27 14:15:56 UTC
Please build it, if it's ok - commit.
Comment 2 Dimitry Andric freebsd_committer freebsd_triage 2016-01-27 17:31:01 UTC
(In reply to Veniamin Gvozdikov from comment #1)
> Please build it, if it's ok - commit.

Yes, it built OK for me, though it took a long time, it has a LOT of dependencies! :)
Comment 3 commit-hook freebsd_committer freebsd_triage 2016-01-27 19:52:47 UTC
A commit references this bug:

Author: dim
Date: Wed Jan 27 19:52:04 UTC 2016
New revision: 407380
URL: https://svnweb.freebsd.org/changeset/ports/407380

Log:
  In x11/leechcraft, change the syntax of C++11 braced initializers with
  multiple elements to correspond to C++ WG paper N3922.  E.g, instead of:

      auto foo { 1, 2, 3, 4 };

  one should write:

      auto foo = { 1, 2, 3, 4 };

  This makes the port compile with clang 3.8.0 and higher, or gcc 5.0 and
  higher.

  Approved by:	vg (maintainer)
  PR:		206650
  MFH:		2016Q1

Changes:
  head/x11/leechcraft/files/patch-plugins_azoth_plugins_otroid_otrhandler.cpp
  head/x11/leechcraft/files/patch-util_network_addresses.cpp
  head/x11/leechcraft/files/patch-util_xdg_xdg.cpp
Comment 4 commit-hook freebsd_committer freebsd_triage 2016-01-27 21:02:59 UTC
A commit references this bug:

Author: dim
Date: Wed Jan 27 21:02:31 UTC 2016
New revision: 407389
URL: https://svnweb.freebsd.org/changeset/ports/407389

Log:
  MFH: r407380

  In x11/leechcraft, change the syntax of C++11 braced initializers with
  multiple elements to correspond to C++ WG paper N3922.  E.g, instead of:

      auto foo { 1, 2, 3, 4 };

  one should write:

      auto foo = { 1, 2, 3, 4 };

  This makes the port compile with clang 3.8.0 and higher, or gcc 5.0 and
  higher.

  Approved by:	ports-secteam (feld)
  PR:		206650

Changes:
_U  branches/2016Q1/
  branches/2016Q1/x11/leechcraft/files/patch-plugins_azoth_plugins_otroid_otrhandler.cpp
  branches/2016Q1/x11/leechcraft/files/patch-util_network_addresses.cpp
  branches/2016Q1/x11/leechcraft/files/patch-util_xdg_xdg.cpp