<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/58788>58788</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Boost test accumulators/valarray.cpp fails to compile with LLVM headers.
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          edfvogel
      </td>
    </tr>
</table>

<pre>
    I am using the latest LLVM on cygwin.   I have also downloaded Boost 1.79.0.  

When I try to compile the Boost test accumulators/test/valarray.cpp it will compile if I use the g++ headers, but not if I add -stdlib=libc++

Here is a reduced example called t.cpp

#include <valarray>
#include <boost/accumulators/accumulators.hpp>
#include <boost/accumulators/numeric/functional/valarray.hpp>
#include <boost/accumulators/statistics/stats.hpp>
#include <boost/accumulators/statistics/weighted_mean.hpp>

using namespace boost;
using namespace accumulators;

template<typename T>
void is_equal(std::valarray<T> const &left, std::valarray<T> const &right)
{
}

void test_stat()
{
  //  std::valarray<double>(6.,3);
  typedef std::valarray<int> sample_t;
  accumulator_set<sample_t, stats<tag::weighted_mean(immediate)>, int>
    acc2(sample = sample_t(0,3));
  is_equal(std::valarray<double>(6.,3), weighted_mean(acc2));
}

Assuming that boost_1_79_0 is put in the area boost_1_79_0.  A cut paste will look like:
VogelEd@XLB3502Q4E ~
$ clang++ -c -Iboost_1_79_0 -w  t.cpp

VogelEd@XLB3502Q4E ~
$ clang++ -c -Iboost_1_79_0 -w -stdlib=libc++ t.cpp
In file included from t.cpp:5:
boost_1_79_0/boost/accumulators/statistics/weighted_mean.hpp:73:13: error: no
      matching constructor for initialization of
      'boost::accumulators::impl::immediate_weighted_mean_impl<std::__1::valarray<int>,
      int, boost::accumulators::tag::sample>::result_type'
      (aka 'valarray<double>')
          : mean(
            ^
boost_1_79_0/boost/accumulators/framework/depends_on.hpp:326:17: note: in
      instantiation of function template specialization
      'boost::accumulators::impl::immediate_weighted_mean_impl<std::__1::valarray<int>,
<Remaining message removed>

Not an important issue, but I thought I would report it.

Thank you in advance for your time.

Ed Vogel




</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzFVttu4zYQ_Rr5ZRBBF9uyH_zgJA4aIC3QYrHbN4ESRxYbinRJyq779R1KliNlvV1kUaCBQkviXM7cjlhoft48A2ugtULtwdUIkjm0Dl5ePv8MWkF53p-ECgHgGWp2RGDSauD6pKRmHDnca03icZitw4jEgugxiLb9-qVGRWrOnMFpKHVzEBI7J71S54iVZdu05FUbGyRP_h39HJlkxrBzWB4OIBychJRXC6Iiq63tTe2D5J4uqJHgeBMPULQOlHa9HOMc7qzjUhRB-khr2SuMgf6EhqxaYGCQtyVFhX-x5kCuSiYlPTqPY6wRJKlQpWw5QpA-DGiDdHdru_DRUlDvQh0_hjXZ_5C2ahs0goJ5qlpVOqEVk-PEfdigdcwJ60Q5PPwAqImNE4p97ZDnDTI1tdWtfc8p1qA9sBKht5ne396deEon5XNItaK2JVzufECvA5-uzo5acCpujn-2PkMr6oUg3dL1VrUHL03tpagfg2QpsXK-j74vaXyEQbK-oMkGWNnjGF-HwDd27vNDEL7WoMFJnuiCm065bguJPqJktQwJWuotpFddHzXH6qauUM5Dtl0_526kNcpobpF2Hq5CXfDUAT6jbN_bnJSTgIimQS582j2WndfpfQ32Ow-Jz3g_SzR-bzCSVTTEMQnlO4W6nQly_R5d73pi_F1Vtta2Tc96zPXNl8d5ts4jTwUH4hChOoZhBtlkn2huCyUJHJh12HOT1PoVpHhFD7mz_1nvUe54MI9-f7lPF1Hy63wHQXYdpzmUkqmBvu5KuHuegLg7wde88x8YvUWGY0fPCqqOZftp51AZ3VwE0u3iGt_YLnXuDzLCNktpif0CaIw2_kbptx4CaJgra1-obuxMW5JpqOhfKOEEk-Jv5ukPdDXWCpLsQii-habs4d8IasTh7tLI-QRf3ks8XNswz-NvTBc14Ni1f-k_Q__m_jpW_UR4I92jQdt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