<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="/rss.xsl.xml"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
    <title>Changes in make_pair.pass.cpp</title>
    <description></description>
    <language>en</language>
    <copyright>Copyright 2015</copyright>
    <generator>Java</generator><item>
        <title>2df59c50 - Support tests in freestanding</title>
        <link>http://172.16.0.5:8080/history/llvm-project-15.0.7/libcxx/test/std/utilities/utility/pairs/pairs.spec/make_pair.pass.cpp#2df59c50</link>
        <description>Support tests in freestandingSummary:Freestanding is *weird*. The standard allows it to differ in a bunch of oddmanners from regular C++, and the committee would like to improve thatsituation. I&apos;d like to make libc++ behave better with what freestanding shouldbe, so that it can be a tool we use in improving the standard. To do that weneed to try stuff out, both with &quot;freestanding the language mode&quot; and&quot;freestanding the library subset&quot;.Let&apos;s start with the super basic: run the libc++ tests in freestanding, usingclang as the compiler, and see what works. The easiest hack to do this:In utils/libcxx/test/config.py add:  self.cxx.compile_flags += [&apos;-ffreestanding&apos;]Run the tests and they all fail.Why? Because in freestanding `main` isn&apos;t special. This &quot;not special&quot; propertyhas two effects: main doesn&apos;t get mangled, and main isn&apos;t allowed to omit its`return` statement. The first means main gets mangled and the linker can&apos;tcreate a valid executable for us to test. The second means we spew out warnings(ew) and the compiler doesn&apos;t insert the `return` we omitted, and main justfalls of the end and does whatever undefined behavior (if you&apos;re luck, ud2leading to non-zero return code).Let&apos;s start my work with the basics. This patch changes all libc++ tests todeclare `main` as `int main(int, char**` so it mangles consistently (enabling usto declare another `extern &quot;C&quot;` main for freestanding which calls the mangledone), and adds `return 0;` to all places where it was missing. This touches 6124files, and I apologize.The former was done with The Magic Of Sed.The later was done with a (not quite correct but decent) clang tool:  https://gist.github.com/jfbastien/793819ff360baa845483dde81170feedThis works for most tests, though I did have to adjust a few places when e.g.the test runs with `-x c`, macros are used for main (such as for the filesystemtests), etc.Once this is in we can create a freestanding bot which will prevent furtherregressions. After that, we can start the real work of supporting C++freestanding fairly well in libc++.&lt;rdar://problem/47754795&gt;Reviewers: ldionne, mclow.lists, EricWFSubscribers: christof, jkorous, dexonsmith, arphaman, miyuki, libcxx-commitsDifferential Revision: https://reviews.llvm.org/D57624llvm-svn: 353086

            List of files:
            /llvm-project-15.0.7/libcxx/test/std/utilities/utility/pairs/pairs.spec/make_pair.pass.cpp</description>
        <pubDate>Mon, 04 Feb 2019 20:31:13 +0000</pubDate>
        <dc:creator>JF Bastien &lt;jfbastien@apple.com&gt;</dc:creator>
    </item>
<item>
        <title>f2e24f56 - [libcxx] [test] Fix MSVC warning C4244 &quot;conversion from &apos;X&apos; to &apos;Y&apos;, possible loss of data&quot;, part 7/7.</title>
        <link>http://172.16.0.5:8080/history/llvm-project-15.0.7/libcxx/test/std/utilities/utility/pairs/pairs.spec/make_pair.pass.cpp#f2e24f56</link>
        <description>[libcxx] [test] Fix MSVC warning C4244 &quot;conversion from &apos;X&apos; to &apos;Y&apos;, possible loss of data&quot;, part 7/7.test/std/input.output/iostream.format/input.streams/istream.unformatted/get.pass.cppAdd static_cast&lt;char&gt; because basic_istream::get() returns int_type (N4606 27.7.2.3 [istream.unformatted]/4).test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/minus1.pass.cppAdd static_cast&lt;char&gt; because toupper() returns int (C11 7.4.2.2/1).test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.ops/assign_t.pass.cppThis test is intentionally writing doubles to ostream_iterator&lt;int&gt;.It&apos;s silencing -Wliteral-conversion for Clang, so I&apos;m adding C4244 silencing for MSVC.test/std/language.support/support.limits/limits/numeric.limits.members/infinity.pass.cppGiven `extern float zero;`, the expression `1./zero` has type double, which emits a truncation warningwhen being passed to test&lt;float&gt;() taking float. The fix is to say `1.f/zero` which has type float.test/std/numerics/complex.number/cmplx.over/arg.pass.cpptest/std/numerics/complex.number/cmplx.over/norm.pass.cppThese tests were constructing std::complex&lt;double&gt;(x, 0), emitting truncation warnings when x is long long.Saying static_cast&lt;double&gt;(x) avoids this.test/std/numerics/rand/rand.eng/rand.eng.lcong/seed_result_type.pass.cppThis was using `int s` to construct and seed a linear_congruential_engine&lt;T, stuff&gt;, where T isunsigned short/unsigned int/unsigned long/unsigned long long. That emits a truncation warning in theunsigned short case. Because the range [0, 20) is tiny and we aren&apos;t doing anything else with the index,we can just iterate with `T s`.test/std/re/re.traits/value.pass.cppregex_traits&lt;wchar_t&gt;::value()&apos;s first parameter is wchar_t (N4606 28.7 [re.traits]/13). This loop isusing int to iterate through [&apos;g&apos;, 0xFFFF), emitting a truncation warning from int to wchar_t(which is 16-bit for some of us). Because the bound is exclusive, we can just iterate with wchar_t.test/std/strings/basic.string/string.cons/size_char_alloc.pass.cppThis test is a little strange. It&apos;s trying to verify that basic_string&apos;s (InIt, InIt) range constructorisn&apos;t confused by &quot;N copies of C&quot; when N and C have the same integral type. To do this, it wastesting (100, 65), but that eventually emits truncation warnings from int to char. There&apos;s a simple wayto avoid this - passing (static_cast&lt;char&gt;(100), static_cast&lt;char&gt;(65)) also exercises the disambiguation.(And 100 is representable even when char has a signed range.)test/std/strings/string.view/string.view.hash/string_view.pass.cppAdd static_cast&lt;char_type&gt; because `&apos;0&apos; + i` has type int.test/std/utilities/function.objects/bind/func.bind/func.bind.bind/nested.pass.cppWhat&apos;s more horrible than nested bind()? pow() overloads! This operator()(T a, T b) was assuming thatstd::pow(a, b) can be returned as T. (In this case, T is int.) However, N4606 26.9.1 [cmath.syn]/2says that pow(int, int) returns double, so this was truncating double to int.Adding static_cast&lt;T&gt; silences this.test/std/utilities/function.objects/unord.hash/integral.pass.cppThis was iterating `for (int i = 0; i &lt;= 5; ++i)` and constructing `T t(i);` but that&apos;s truncatingwhen T is short. (And super truncating when T is bool.) Adding static_cast&lt;T&gt; silences this.test/std/utilities/utility/exchange/exchange.pass.cppFirst, this was exchanging 67.2 into an int, but that&apos;s inherently truncating.Changing this to static_cast&lt;short&gt;(67) avoids the truncation while preserving the&quot;what if T and U are different&quot; test coverage.Second, this was exchanging {} with the explicit type float into an int, and that&apos;s alsoinherently truncating. Specifying short is just as good.test/std/utilities/utility/pairs/pairs.spec/make_pair.pass.cppAdd static_cast&lt;short&gt;. Note that this affects template argument deduction for make_pair(),better fulfilling the test&apos;s intent. For example, this was saying`typedef std::pair&lt;int, short&gt; P1; P1 p1 = std::make_pair(3, 4);` but that was askingmake_pair() to return pair&lt;int, int&gt;, which was then being converted to pair&lt;int, short&gt;.(pair&apos;s converting constructors are tested elsewhere.)Now, std::make_pair(3, static_cast&lt;short&gt;(4)) actually returns pair&lt;int, short&gt;.(There&apos;s still a conversion from pair&lt;nullptr_t, short&gt; to pair&lt;unique_ptr&lt;int&gt;, short&gt;.)Fixes D27544.llvm-svn: 289111

            List of files:
            /llvm-project-15.0.7/libcxx/test/std/utilities/utility/pairs/pairs.spec/make_pair.pass.cpp</description>
        <pubDate>Thu, 08 Dec 2016 21:38:57 +0000</pubDate>
        <dc:creator>Stephan T. Lavavej &lt;stl@exchange.microsoft.com&gt;</dc:creator>
    </item>
<item>
        <title>2c8c71f1 - Remove all instances of _LIBCPP_HAS_NO_RVALUE_REFERENCES from test/std/utilities</title>
        <link>http://172.16.0.5:8080/history/llvm-project-15.0.7/libcxx/test/std/utilities/utility/pairs/pairs.spec/make_pair.pass.cpp#2c8c71f1</link>
        <description>Remove all instances of _LIBCPP_HAS_NO_RVALUE_REFERENCES from test/std/utilitiesllvm-svn: 283032

            List of files:
            /llvm-project-15.0.7/libcxx/test/std/utilities/utility/pairs/pairs.spec/make_pair.pass.cpp</description>
        <pubDate>Sat, 01 Oct 2016 10:46:01 +0000</pubDate>
        <dc:creator>Eric Fiselier &lt;eric@efcs.ca&gt;</dc:creator>
    </item>
<item>
        <title>4a9578ae - Removing some trailing whitespace</title>
        <link>http://172.16.0.5:8080/history/llvm-project-15.0.7/libcxx/test/std/utilities/utility/pairs/pairs.spec/make_pair.pass.cpp#4a9578ae</link>
        <description>Removing some trailing whitespacellvm-svn: 268543

            List of files:
            /llvm-project-15.0.7/libcxx/test/std/utilities/utility/pairs/pairs.spec/make_pair.pass.cpp</description>
        <pubDate>Wed, 04 May 2016 20:29:19 +0000</pubDate>
        <dc:creator>Eric Fiselier &lt;eric@efcs.ca&gt;</dc:creator>
    </item>
<item>
        <title>5a83710e - Move test into test/std subdirectory.</title>
        <link>http://172.16.0.5:8080/history/llvm-project-15.0.7/libcxx/test/std/utilities/utility/pairs/pairs.spec/make_pair.pass.cpp#5a83710e</link>
        <description>Move test into test/std subdirectory.llvm-svn: 224658

            List of files:
            /llvm-project-15.0.7/libcxx/test/std/utilities/utility/pairs/pairs.spec/make_pair.pass.cpp</description>
        <pubDate>Sat, 20 Dec 2014 01:40:03 +0000</pubDate>
        <dc:creator>Eric Fiselier &lt;eric@efcs.ca&gt;</dc:creator>
    </item>
</channel>
</rss>
