__normalize(_InputIterator __first, _InputIterator __last,
_OutputIterator __result, const _Tp& __factor)
{
- for (; __first != __last; ++__first, ++__result)
+ for (; __first != __last; ++__first, (void) ++__result)
*__result = *__first / __factor;
return __result;
}
_InputIteratorW __wbegin)
: _M_int(), _M_den(), _M_cp(), _M_m()
{
- for (; __bbegin != __bend; ++__bbegin, ++__wbegin)
+ for (; __bbegin != __bend; ++__bbegin, (void) ++__wbegin)
{
_M_int.push_back(*__bbegin);
_M_den.push_back(*__wbegin);
--- /dev/null
+// { dg-do compile { target c++11 } }
+
+// PR libstdc++/122062
+// piecewise_linear_distribution(firstB, lastB, firstW) invokes comma operator
+
+#include <random>
+#include <testsuite_iterators.h>
+
+void
+test_pr122062()
+{
+ double b[1]{};
+ double w[1]{};
+ __gnu_test::random_access_container<double> B(b), W(w);
+ std::piecewise_linear_distribution<double> p(B.begin(), B.end(), W.begin());
+}