Date: Wed, 4 Mar 2015 21:19:43 +0100 From: Dimitry Andric <dim@FreeBSD.org> To: "O. Hartmann" <ohartman@zedat.fu-berlin.de> Cc: freebsd-current <freebsd-current@freebsd.org>, Ryan Stone <rysto32@gmail.com> Subject: Re: r279514: buildworld failure: /usr/src/lib/libnv/tests/dnv_tests.cc:453:2: error: use of overloaded operator '<<' is ambiguous Message-ID: <6CB3E761-8EFA-4DB4-8395-E15151F4F547@FreeBSD.org> In-Reply-To: <20150304181852.7bae1df4.ohartman@zedat.fu-berlin.de> References: <20150302115057.62d2c74c@prometheus> <CAFMmRNzssU_2uQD%2BurtRowVuDJX3=GjStFiZyKKAmbJHBFiCbQ@mail.gmail.com> <20150304123110.48aa4abb@prometheus> <9DE59FA1-D495-4796-B3F5-F96D1472F66C@andric.com> <20150304181852.7bae1df4.ohartman@zedat.fu-berlin.de>
next in thread | previous in thread | raw e-mail | index | archive | help
--Apple-Mail=_2B7170FA-C029-400A-B905-12DDCAAD69A4 Content-Type: multipart/mixed; boundary="Apple-Mail=_815E300D-235D-4BB8-904F-B7F6C7430420" --Apple-Mail=_815E300D-235D-4BB8-904F-B7F6C7430420 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 04 Mar 2015, at 18:18, O. Hartmann <ohartman@zedat.fu-berlin.de> = wrote: >=20 > Am Wed, 4 Mar 2015 14:10:00 +0100 > Dimitry Andric <dimitry@andric.com> schrieb: >=20 >> On 04 Mar 2015, at 12:31, O. Hartmann <ohartman@zedat.fu-berlin.de> = wrote: >>> On Mon, 2 Mar 2015 08:58:05 -0500 >>> Ryan Stone <rysto32@gmail.com> wrote: >>>=20 >>>> Can you post the contents of your make.conf and src.conf? I didn't >>>> see this in any of my "make tinderbox" runs >>>> _______________________________________________ >>>> freebsd-current@freebsd.org mailing list >>>> http://lists.freebsd.org/mailman/listinfo/freebsd-current >>>> To unsubscribe, send any mail to = "freebsd-current-unsubscribe@freebsd.org" >>>=20 >>> The culprit is the option >>>=20 >>> CXXFLAGS+=3D -std=3Dc++11 >>>=20 >>> in /etc/src.conf >>=20 >> Right, it would be nice to have libnv compiling for C++11 though. = I'll have a look >> later today. ... It is caused by the following test in lib/libnv/tests/dnv_tests.cc: ATF_REQUIRE_EQ(actual_val, NULL); In C++ mode, ATF_REQUIRE_EQ will attempt to output the value of NULL onto a std::ostringstream, but this has become ambiguous in C++11. [1] The fix is to cast the NULL value to the specific pointer type ATF is testing against, 'nvlist_t *' in this case. See the attached diff. -Dimitry [1] Before C++11, NULL is defined as 0, e.g. plain zero, and it will therefore be printed as an integer "0". In C++11 and later, NULL is defined as the keyword nullptr, e.g. the null pointer literal. Since the null pointer can be converted to any other pointer type, and there are many different operators defined in C++ to output those operators, the call is ambiguous, and must be resolved by the developer. --Apple-Mail=_815E300D-235D-4BB8-904F-B7F6C7430420 Content-Disposition: attachment; filename=libnv-fix-tests-cxx11-1.diff Content-Type: application/octet-stream; name="libnv-fix-tests-cxx11-1.diff" Content-Transfer-Encoding: 7bit Index: lib/libnv/tests/dnv_tests.cc =================================================================== --- lib/libnv/tests/dnv_tests.cc (revision 279596) +++ lib/libnv/tests/dnv_tests.cc (working copy) @@ -450,7 +450,7 @@ nvl = nvlist_create(0); actual_val = dnvlist_take_nvlist(nvl, "123", NULL); - ATF_REQUIRE_EQ(actual_val, NULL); + ATF_REQUIRE_EQ(actual_val, static_cast<nvlist_t *>(NULL)); free(actual_val); nvlist_destroy(nvl); --Apple-Mail=_815E300D-235D-4BB8-904F-B7F6C7430420-- --Apple-Mail=_2B7170FA-C029-400A-B905-12DDCAAD69A4 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.26 iEYEARECAAYFAlT3aOoACgkQsF6jCi4glqOGnwCgp9QO0/+dFWRqY0oJZg0Z4hKX ph4An2T9ZTSd7vHhhegOOCBhATieypyF =51Q+ -----END PGP SIGNATURE----- --Apple-Mail=_2B7170FA-C029-400A-B905-12DDCAAD69A4--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6CB3E761-8EFA-4DB4-8395-E15151F4F547>