Return-Path: Delivered-To: apmail-incubator-stdcxx-dev-archive@www.apache.org Received: (qmail 7450 invoked from network); 8 Aug 2007 21:25:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Aug 2007 21:25:30 -0000 Received: (qmail 7186 invoked by uid 500); 8 Aug 2007 21:25:29 -0000 Delivered-To: apmail-incubator-stdcxx-dev-archive@incubator.apache.org Received: (qmail 7168 invoked by uid 500); 8 Aug 2007 21:25:29 -0000 Mailing-List: contact stdcxx-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: stdcxx-dev@incubator.apache.org Delivered-To: mailing list stdcxx-dev@incubator.apache.org Received: (qmail 7150 invoked by uid 99); 8 Aug 2007 21:25:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Aug 2007 14:25:28 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Aug 2007 21:25:19 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 455B1714168 for ; Wed, 8 Aug 2007 14:24:59 -0700 (PDT) Message-ID: <17014135.1186608299281.JavaMail.jira@brutus> Date: Wed, 8 Aug 2007 14:24:59 -0700 (PDT) From: "Martin Sebor (JIRA)" To: stdcxx-dev@incubator.apache.org Subject: [jira] Commented: (STDCXX-512) std::valarray computed assignment operators don't compile with a user-defined class In-Reply-To: <13176951.1186607939221.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/STDCXX-512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12518554 ] Martin Sebor commented on STDCXX-512: ------------------------------------- A test that demonstrates this problem was added to the test suite here: http://svn.apache.org/viewvc?view=rev&revision=559650 See the following thread for a discussion of the test failures: http://www.mail-archive.com/stdcxx-dev@incubator.apache.org/msg04053.html > std::valarray computed assignment operators don't compile with a user-defined class > ----------------------------------------------------------------------------------- > > Key: STDCXX-512 > URL: https://issues.apache.org/jira/browse/STDCXX-512 > Project: C++ Standard Library > Issue Type: Bug > Components: 26. Numerics > Affects Versions: 4.1.3 > Reporter: Martin Sebor > Assignee: Martin Sebor > > The program below fails to compile because the valarray computed assignment operators make use of operator@ (T, T) instead of the corresponding computed assignment operators defined by T (i.e., T::operator@(T)). > $ cat u.cpp && make u > #include > struct Value { > Value& operator*= (const Value&) { return *this; } > Value& operator/= (const Value&) { return *this; } > Value& operator+= (const Value&) { return *this; } > Value& operator-= (const Value&) { return *this; } > Value& operator%= (const Value&) { return *this; } > Value& operator^= (const Value&) { return *this; } > Value& operator&= (const Value&) { return *this; } > Value& operator|= (const Value&) { return *this; } > Value& operator<<= (const Value&) { return *this; } > Value& operator>>= (const Value&) { return *this; } > }; > int main () > { > std::valarray val; > val *= val; > val /= val; > val += val; > val -= val; > val %= val; > val ^= val; > val &= val; > val |= val; > val <<= val; > val >>= val; > } > gcc -c -I/amd/devco/sebor/stdcxx-4.1.3/include/ansi -D_RWSTDDEBUG -pthread -D_RWSTD_USE_CONFIG -I/build/sebor/stdcxx-4.1.3-gcc-3.4.3_6-15D/include -I/amd/devco/sebor/stdcxx-4.1.3/include -I/amd/devco/sebor/stdcxx-4.1.3/examples/include -pedantic -nostdinc++ -g -m64 -Wall -W -Wcast-qual -Winline -Wshadow -Wwrite-strings -Wno-long-long -Wcast-align u.cpp > /amd/devco/sebor/stdcxx-4.1.3/include/functional: In member function `typename std::binary_function<_TypeT, _TypeT, _TypeT>::result_type std::multiplies<_TypeT>::operator()(const typename std::binary_function<_TypeT, _TypeT, _TypeT>::first_argument_type&, const typename std::binary_function<_TypeT, _TypeT, _TypeT>::second_argument_type&) const [with _TypeT = Value]': > /amd/devco/sebor/stdcxx-4.1.3/include/algorithm:353: instantiated from `_OutputIter std::transform(_InputIter1, _InputIter1, _InputIter2, _OutputIter, _BinaryOperation) [with _InputIter1 = Value*, _InputIter2 = const Value*, _OutputIter = Value*, _BinaryOperation = std::multiplies]' > /amd/devco/sebor/stdcxx-4.1.3/include/valarray:363: instantiated from `std::valarray<_TypeT>& std::valarray<_TypeT>::operator*=(const std::valarray<_TypeT>&) [with _TypeT = Value]' > u.cpp:20: instantiated from here > /amd/devco/sebor/stdcxx-4.1.3/include/functional:83: error: no match for 'operator*' in '__x * __y' > /amd/devco/sebor/stdcxx-4.1.3/include/functional: In member function `typename std::binary_function<_TypeT, _TypeT, _TypeT>::result_type std::divides<_TypeT>::operator()(const typename std::binary_function<_TypeT, _TypeT, _TypeT>::first_argument_type&, const typename std::binary_function<_TypeT, _TypeT, _TypeT>::second_argument_type&) const [with _TypeT = Value]': > /amd/devco/sebor/stdcxx-4.1.3/include/algorithm:353: instantiated from `_OutputIter std::transform(_InputIter1, _InputIter1, _InputIter2, _OutputIter, _BinaryOperation) [with _InputIter1 = Value*, _InputIter2 = const Value*, _OutputIter = Value*, _BinaryOperation = std::divides]' > /amd/devco/sebor/stdcxx-4.1.3/include/valarray:376: instantiated from `std::valarray<_TypeT>& std::valarray<_TypeT>::operator/=(const std::valarray<_TypeT>&) [with _TypeT = Value]' > u.cpp:21: instantiated from here > /amd/devco/sebor/stdcxx-4.1.3/include/functional:96: error: no match for 'operator/' in '__x / __y' > /amd/devco/sebor/stdcxx-4.1.3/include/functional: In member function `typename std::binary_function<_TypeT, _TypeT, _TypeT>::result_type std::plus<_TypeT>::operator()(const typename std::binary_function<_TypeT, _TypeT, _TypeT>::first_argument_type&, const typename std::binary_function<_TypeT, _TypeT, _TypeT>::second_argument_type&) const [with _TypeT = Value]': > /amd/devco/sebor/stdcxx-4.1.3/include/algorithm:353: instantiated from `_OutputIter std::transform(_InputIter1, _InputIter1, _InputIter2, _OutputIter, _BinaryOperation) [with _InputIter1 = Value*, _InputIter2 = const Value*, _OutputIter = Value*, _BinaryOperation = std::plus]' > /amd/devco/sebor/stdcxx-4.1.3/include/valarray:389: instantiated from `std::valarray<_TypeT>& std::valarray<_TypeT>::operator+=(const std::valarray<_TypeT>&) [with _TypeT = Value]' > u.cpp:22: instantiated from here > /amd/devco/sebor/stdcxx-4.1.3/include/functional:57: error: no match for 'operator+' in '__x + __y' > /amd/devco/sebor/stdcxx-4.1.3/include/functional: In member function `typename std::binary_function<_TypeT, _TypeT, _TypeT>::result_type std::minus<_TypeT>::operator()(const typename std::binary_function<_TypeT, _TypeT, _TypeT>::first_argument_type&, const typename std::binary_function<_TypeT, _TypeT, _TypeT>::second_argument_type&) const [with _TypeT = Value]': > /amd/devco/sebor/stdcxx-4.1.3/include/algorithm:353: instantiated from `_OutputIter std::transform(_InputIter1, _InputIter1, _InputIter2, _OutputIter, _BinaryOperation) [with _InputIter1 = Value*, _InputIter2 = const Value*, _OutputIter = Value*, _BinaryOperation = std::minus]' > /amd/devco/sebor/stdcxx-4.1.3/include/valarray:402: instantiated from `std::valarray<_TypeT>& std::valarray<_TypeT>::operator-=(const std::valarray<_TypeT>&) [with _TypeT = Value]' > u.cpp:23: instantiated from here > /amd/devco/sebor/stdcxx-4.1.3/include/functional:70: error: no match for 'operator-' in '__x - __y' > /amd/devco/sebor/stdcxx-4.1.3/include/functional: In member function `typename std::binary_function<_TypeT, _TypeT, _TypeT>::result_type std::modulus<_TypeT>::operator()(const typename std::binary_function<_TypeT, _TypeT, _TypeT>::first_argument_type&, const typename std::binary_function<_TypeT, _TypeT, _TypeT>::second_argument_type&) const [with _TypeT = Value]': > /amd/devco/sebor/stdcxx-4.1.3/include/algorithm:353: instantiated from `_OutputIter std::transform(_InputIter1, _InputIter1, _InputIter2, _OutputIter, _BinaryOperation) [with _InputIter1 = Value*, _InputIter2 = const Value*, _OutputIter = Value*, _BinaryOperation = std::modulus]' > /amd/devco/sebor/stdcxx-4.1.3/include/valarray:415: instantiated from `std::valarray<_TypeT>& std::valarray<_TypeT>::operator%=(const std::valarray<_TypeT>&) [with _TypeT = Value]' > u.cpp:24: instantiated from here > /amd/devco/sebor/stdcxx-4.1.3/include/functional:109: error: no match for 'operator%' in '__x % __y' > /amd/devco/sebor/stdcxx-4.1.3/include/functional: In member function `typename std::binary_function<_TypeT, _TypeT, _TypeT>::result_type __rw::exclusive_or<_TypeT>::operator()(const typename std::binary_function<_TypeT, _TypeT, _TypeT>::first_argument_type&, const typename std::binary_function<_TypeT, _TypeT, _TypeT>::second_argument_type&) const [with _TypeT = Value]': > /amd/devco/sebor/stdcxx-4.1.3/include/algorithm:353: instantiated from `_OutputIter std::transform(_InputIter1, _InputIter1, _InputIter2, _OutputIter, _BinaryOperation) [with _InputIter1 = Value*, _InputIter2 = const Value*, _OutputIter = Value*, _BinaryOperation = __rw::exclusive_or]' > /amd/devco/sebor/stdcxx-4.1.3/include/valarray:428: instantiated from `std::valarray<_TypeT>& std::valarray<_TypeT>::operator^=(const std::valarray<_TypeT>&) [with _TypeT = Value]' > u.cpp:25: instantiated from here > /amd/devco/sebor/stdcxx-4.1.3/include/functional:732: error: no match for 'operator^' in '__x ^ __y' > /amd/devco/sebor/stdcxx-4.1.3/include/functional: In member function `typename std::binary_function<_TypeT, _TypeT, _TypeT>::result_type __rw::bitwise_and<_TypeT>::operator()(const typename std::binary_function<_TypeT, _TypeT, _TypeT>::first_argument_type&, const typename std::binary_function<_TypeT, _TypeT, _TypeT>::second_argument_type&) const [with _TypeT = Value]': > /amd/devco/sebor/stdcxx-4.1.3/include/algorithm:353: instantiated from `_OutputIter std::transform(_InputIter1, _InputIter1, _InputIter2, _OutputIter, _BinaryOperation) [with _InputIter1 = Value*, _InputIter2 = const Value*, _OutputIter = Value*, _BinaryOperation = __rw::bitwise_and]' > /amd/devco/sebor/stdcxx-4.1.3/include/valarray:441: instantiated from `std::valarray<_TypeT>& std::valarray<_TypeT>::operator&=(const std::valarray<_TypeT>&) [with _TypeT = Value]' > u.cpp:26: instantiated from here > /amd/devco/sebor/stdcxx-4.1.3/include/functional:719: error: no match for 'operator&' in '__x & __y' > /amd/devco/sebor/stdcxx-4.1.3/include/functional: In member function `typename std::binary_function<_TypeT, _TypeT, _TypeT>::result_type __rw::bitwise_or<_TypeT>::operator()(const typename std::binary_function<_TypeT, _TypeT, _TypeT>::first_argument_type&, const typename std::binary_function<_TypeT, _TypeT, _TypeT>::second_argument_type&) const [with _TypeT = Value]': > /amd/devco/sebor/stdcxx-4.1.3/include/algorithm:353: instantiated from `_OutputIter std::transform(_InputIter1, _InputIter1, _InputIter2, _OutputIter, _BinaryOperation) [with _InputIter1 = Value*, _InputIter2 = const Value*, _OutputIter = Value*, _BinaryOperation = __rw::bitwise_or]' > /amd/devco/sebor/stdcxx-4.1.3/include/valarray:454: instantiated from `std::valarray<_TypeT>& std::valarray<_TypeT>::operator|=(const std::valarray<_TypeT>&) [with _TypeT = Value]' > u.cpp:27: instantiated from here > /amd/devco/sebor/stdcxx-4.1.3/include/functional:706: error: no match for 'operator|' in '__x | __y' > /amd/devco/sebor/stdcxx-4.1.3/include/functional: In member function `typename std::binary_function<_TypeT, _TypeT, _TypeT>::result_type __rw::shift_left<_TypeT>::operator()(const typename std::binary_function<_TypeT, _TypeT, _TypeT>::first_argument_type&, const typename std::binary_function<_TypeT, _TypeT, _TypeT>::second_argument_type&) const [with _TypeT = Value]': > /amd/devco/sebor/stdcxx-4.1.3/include/algorithm:353: instantiated from `_OutputIter std::transform(_InputIter1, _InputIter1, _InputIter2, _OutputIter, _BinaryOperation) [with _InputIter1 = Value*, _InputIter2 = const Value*, _OutputIter = Value*, _BinaryOperation = __rw::shift_left]' > /amd/devco/sebor/stdcxx-4.1.3/include/valarray:467: instantiated from `std::valarray<_TypeT>& std::valarray<_TypeT>::operator<<=(const std::valarray<_TypeT>&) [with _TypeT = Value]' > u.cpp:28: instantiated from here > /amd/devco/sebor/stdcxx-4.1.3/include/functional:745: error: no match for 'operator<<' in '__x << __y' > /amd/devco/sebor/stdcxx-4.1.3/include/functional: In member function `typename std::binary_function<_TypeT, _TypeT, _TypeT>::result_type __rw::shift_right<_TypeT>::operator()(const typename std::binary_function<_TypeT, _TypeT, _TypeT>::first_argument_type&, const typename std::binary_function<_TypeT, _TypeT, _TypeT>::second_argument_type&) const [with _TypeT = Value]': > /amd/devco/sebor/stdcxx-4.1.3/include/algorithm:353: instantiated from `_OutputIter std::transform(_InputIter1, _InputIter1, _InputIter2, _OutputIter, _BinaryOperation) [with _InputIter1 = Value*, _InputIter2 = const Value*, _OutputIter = Value*, _BinaryOperation = __rw::shift_right]' > /amd/devco/sebor/stdcxx-4.1.3/include/valarray:480: instantiated from `std::valarray<_TypeT>& std::valarray<_TypeT>::operator>>=(const std::valarray<_TypeT>&) [with _TypeT = Value]' > u.cpp:29: instantiated from here > /amd/devco/sebor/stdcxx-4.1.3/include/functional:758: error: no match for 'operator>>' in '__x >> __y' > make: *** [u.o] Error 1 -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.