public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/29063]  New: valarray does not undefine all temp macros
@ 2006-09-13 15:29 lidaobing at gmail dot com
  2006-09-13 16:27 ` [Bug libstdc++/29063] " pinskia at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: lidaobing at gmail dot com @ 2006-09-13 15:29 UTC (permalink / raw)
  To: gcc-bugs

valarray should undefine all temp macros, but it does not

$ cat test.cpp
#include <valarray>
$ g++-4.0 -E -dM test.cpp | grep _DEFINE_ | wc
      2     546    4236
$ g++-4.1 -E -dM test.cpp | grep _DEFINE_ | wc
      2     546    4236
$ g++-4.2 -E -dM test.cpp | grep _DEFINE_ | wc
      2     546    4236
$ g++-4.0 -E -dM test.cpp | grep _DEFINE_
#define _DEFINE_ARRAY_FUNCTION(_Op,_Name) template<typename _Tp> inline void
_Array_augmented_ ##_Name(_Array<_Tp> __a, size_t __n, const _Tp& __t) { for
(_Tp* __p = __a._M_data; __p < __a._M_data + __n; ++__p) *__p _Op ##= __t; }
template<typename _Tp> inline void _Array_augmented_ ##_Name(_Array<_Tp> __a,
size_t __n, _Array<_Tp> __b) { _Tp* __p = __a._M_data; for (_Tp* __q =
__b._M_data; __q < __b._M_data + __n; ++__p, ++__q) *__p _Op ##= *__q; }
template<typename _Tp, class _Dom> void _Array_augmented_ ##_Name(_Array<_Tp>
__a, const _Expr<_Dom, _Tp>& __e, size_t __n) { _Tp* __p(__a._M_data); for
(size_t __i = 0; __i < __n; ++__i, ++__p) *__p _Op ##= __e[__i]; }
template<typename _Tp> inline void _Array_augmented_ ##_Name(_Array<_Tp> __a,
size_t __n, size_t __s, _Array<_Tp> __b) { _Tp* __q(__b._M_data); for (_Tp* __p
= __a._M_data; __p < __a._M_data + __s * __n; __p += __s, ++__q) *__p _Op ##=
*__q; } template<typename _Tp> inline void _Array_augmented_
##_Name(_Array<_Tp> __a, _Array<_Tp> __b, size_t __n, size_t __s) { _Tp*
__q(__b._M_data); for (_Tp* __p = __a._M_data; __p < __a._M_data + __n; ++__p,
__q += __s) *__p _Op ##= *__q; } template<typename _Tp, class _Dom> void
_Array_augmented_ ##_Name(_Array<_Tp> __a, size_t __s, const _Expr<_Dom, _Tp>&
__e, size_t __n) { _Tp* __p(__a._M_data); for (size_t __i = 0; __i < __n;
++__i, __p += __s) *__p _Op ##= __e[__i]; } template<typename _Tp> inline void
_Array_augmented_ ##_Name(_Array<_Tp> __a, _Array<size_t> __i, _Array<_Tp> __b,
size_t __n) { _Tp* __q(__b._M_data); for (size_t* __j = __i._M_data; __j <
__i._M_data + __n; ++__j, ++__q) __a._M_data[*__j] _Op ##= *__q; }
template<typename _Tp> inline void _Array_augmented_ ##_Name(_Array<_Tp> __a,
size_t __n, _Array<_Tp> __b, _Array<size_t> __i) { _Tp* __p(__a._M_data); for
(size_t* __j = __i._M_data; __j<__i._M_data + __n; ++__j, ++__p) *__p _Op ##=
__b._M_data[*__j]; } template<typename _Tp, class _Dom> void _Array_augmented_
##_Name(_Array<_Tp> __a, _Array<size_t> __i, const _Expr<_Dom, _Tp>& __e,
size_t __n) { size_t* __j(__i._M_data); for (size_t __k = 0; __k<__n; ++__k,
++__j) __a._M_data[*__j] _Op ##= __e[__k]; } template<typename _Tp> void
_Array_augmented_ ##_Name(_Array<_Tp> __a, _Array<bool> __m, _Array<_Tp> __b,
size_t __n) { bool* __ok(__m._M_data); _Tp* __p(__a._M_data); for (_Tp* __q =
__b._M_data; __q < __b._M_data + __n; ++__q, ++__ok, ++__p) { while (! *__ok) {
++__ok; ++__p; } *__p _Op ##= *__q; } } template<typename _Tp> void
_Array_augmented_ ##_Name(_Array<_Tp> __a, size_t __n, _Array<_Tp> __b,
_Array<bool> __m) { bool* __ok(__m._M_data); _Tp* __q(__b._M_data); for (_Tp*
__p = __a._M_data; __p < __a._M_data + __n; ++__p, ++__ok, ++__q) { while (!
*__ok) { ++__ok; ++__q; } *__p _Op ##= *__q; } } template<typename _Tp, class
_Dom> void _Array_augmented_ ##_Name(_Array<_Tp> __a, _Array<bool> __m, const
_Expr<_Dom, _Tp>& __e, size_t __n) { bool* __ok(__m._M_data); _Tp*
__p(__a._M_data); for (size_t __i = 0; __i < __n; ++__i, ++__ok, ++__p) { while
(! *__ok) { ++__ok; ++__p; } *__p _Op ##= __e[__i]; } }
#define _DEFINE_BINARY_OPERATOR(_Op,_Name) template<typename _Tp> inline
_Expr<_BinClos<_Name, _ValArray, _ValArray, _Tp, _Tp>, typename __fun<_Name,
_Tp>::result_type> operator _Op(const valarray<_Tp>& __v, const valarray<_Tp>&
__w) { _GLIBCXX_DEBUG_ASSERT(__v.size() == __w.size()); typedef _BinClos<_Name,
_ValArray, _ValArray, _Tp, _Tp> _Closure; typedef typename __fun<_Name,
_Tp>::result_type _Rt; return _Expr<_Closure, _Rt>(_Closure(__v, __w)); }
template<typename _Tp> inline _Expr<_BinClos<_Name, _ValArray,_Constant, _Tp,
_Tp>, typename __fun<_Name, _Tp>::result_type> operator _Op(const
valarray<_Tp>& __v, const _Tp& __t) { typedef _BinClos<_Name, _ValArray,
_Constant, _Tp, _Tp> _Closure; typedef typename __fun<_Name, _Tp>::result_type
_Rt; return _Expr<_Closure, _Rt>(_Closure(__v, __t)); } template<typename _Tp>
inline _Expr<_BinClos<_Name, _Constant, _ValArray, _Tp, _Tp>, typename
__fun<_Name, _Tp>::result_type> operator _Op(const _Tp& __t, const
valarray<_Tp>& __v) { typedef _BinClos<_Name, _Constant, _ValArray, _Tp, _Tp>
_Closure; typedef typename __fun<_Name, _Tp>::result_type _Rt; return
_Expr<_Closure, _Tp>(_Closure(__t, __v)); }
$ g++-4.0 -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,c++,java
--prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--program-suffix=-4.0 --enable-__cxa_atexit --enable-clocale=gnu
--enable-libstdcxx-debug --enable-java-awt=gtk --enable-gtk-cairo
--with-java-home=/usr/lib/jvm/java-1.4.2-gcj-4.0-1.4.2.0/jre
--enable-checking=release x86_64-linux-gnu
Thread model: posix
gcc version 4.0.4 20060904 (prerelease) (Debian 4.0.3-7)


-- 
           Summary: valarray does not undefine all temp macros
           Product: gcc
           Version: 4.0.4
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: lidaobing at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29063


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug libstdc++/29063] valarray does not undefine all temp macros
  2006-09-13 15:29 [Bug libstdc++/29063] New: valarray does not undefine all temp macros lidaobing at gmail dot com
@ 2006-09-13 16:27 ` pinskia at gcc dot gnu dot org
  2006-09-13 16:52 ` pcarlini at suse dot de
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-09-13 16:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-09-13 16:27 -------
_D is in the reserved identifier space IIRC so I think this is a non bug.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29063


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug libstdc++/29063] valarray does not undefine all temp macros
  2006-09-13 15:29 [Bug libstdc++/29063] New: valarray does not undefine all temp macros lidaobing at gmail dot com
  2006-09-13 16:27 ` [Bug libstdc++/29063] " pinskia at gcc dot gnu dot org
@ 2006-09-13 16:52 ` pcarlini at suse dot de
  2006-09-18  9:20 ` paolo at gcc dot gnu dot org
  2006-09-18  9:20 ` pcarlini at suse dot de
  3 siblings, 0 replies; 5+ messages in thread
From: pcarlini at suse dot de @ 2006-09-13 16:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pcarlini at suse dot de  2006-09-13 16:51 -------
As a matter of fact valarray *always* undefines the macros, besides in those
two specific cases (and the first one is even undefined weren't for a typo ;)
So, we can as well do the two-lines change...


-- 

pcarlini at suse dot de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2006-09-13 16:51:59
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29063


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug libstdc++/29063] valarray does not undefine all temp macros
  2006-09-13 15:29 [Bug libstdc++/29063] New: valarray does not undefine all temp macros lidaobing at gmail dot com
                   ` (2 preceding siblings ...)
  2006-09-18  9:20 ` paolo at gcc dot gnu dot org
@ 2006-09-18  9:20 ` pcarlini at suse dot de
  3 siblings, 0 replies; 5+ messages in thread
From: pcarlini at suse dot de @ 2006-09-18  9:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pcarlini at suse dot de  2006-09-18 09:20 -------
Fixed for 4.2.0.


-- 

pcarlini at suse dot de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.2.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29063


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug libstdc++/29063] valarray does not undefine all temp macros
  2006-09-13 15:29 [Bug libstdc++/29063] New: valarray does not undefine all temp macros lidaobing at gmail dot com
  2006-09-13 16:27 ` [Bug libstdc++/29063] " pinskia at gcc dot gnu dot org
  2006-09-13 16:52 ` pcarlini at suse dot de
@ 2006-09-18  9:20 ` paolo at gcc dot gnu dot org
  2006-09-18  9:20 ` pcarlini at suse dot de
  3 siblings, 0 replies; 5+ messages in thread
From: paolo at gcc dot gnu dot org @ 2006-09-18  9:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from paolo at gcc dot gnu dot org  2006-09-18 09:19 -------
Subject: Bug 29063

Author: paolo
Date: Mon Sep 18 09:19:36 2006
New Revision: 117019

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117019
Log:
2006-09-18  Paolo Carlini  <pcarlini@suse.de>

        PR libstdc++/29063
        * include/bits/valarray_array.h: Fix typo, undefine
        _DEFINE_ARRAY_FUNCTION.
        * include/std/std_valarray.h: Undefine _DEFINE_BINARY_OPERATOR.

Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/include/bits/valarray_array.h
    trunk/libstdc++-v3/include/std/std_valarray.h


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29063


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-09-18  9:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-13 15:29 [Bug libstdc++/29063] New: valarray does not undefine all temp macros lidaobing at gmail dot com
2006-09-13 16:27 ` [Bug libstdc++/29063] " pinskia at gcc dot gnu dot org
2006-09-13 16:52 ` pcarlini at suse dot de
2006-09-18  9:20 ` paolo at gcc dot gnu dot org
2006-09-18  9:20 ` pcarlini at suse dot de

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).