libstdc++/9582: ODR violation in std::allocator

2003-02-05 Thread peturr02

>Number: 9582
>Category:   libstdc++
>Synopsis:   ODR violation in std::allocator
>Confidential:   no
>Severity:   serious
>Priority:   medium
>Responsible:unassigned
>State:  open
>Class:  sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Feb 05 10:56:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: [EMAIL PROTECTED]
>Release:gcc 3.4 from 20030205
>Organization:
>Environment:
Red Hat Linux 8.0
>Description:
std::allocator<>::allocate calls __pool_alloc<>::allocate which uses the macro assert. 
The definition of assert depends on whether NDEBUG is defined before stl_alloc.h is 
included. If NDEBUG is defined in one source file before stl_alloc.h is included, but 
not in another source file, and those files are then linked together, the 
one-definition-rule is broken.

Also, as a QoI issue, I think that the contents of standard headers (other than 
cassert) should not depend on the macro NDEBUG, and cassert should not be included by 
other standard headers.
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:



[Bug libstdc++/19535] New: Wrong return types for __pair_get<1>

2005-01-19 Thread peturr02 at ru dot is
In tr1/utility:

  template<>
struct __pair_get<1>
{
  template
  static _Tp1& __get(std::pair<_Tp1, _Tp2>& __pair)
  { return __pair.second; }

  template
  static const _Tp1& __const_get(const std::pair<_Tp1, _Tp2>& __pair)
  { return __pair.second; }
};

These functions should return (const) _Tp2&, since the type of __pair.second
is _Tp2.

-- 
   Summary: Wrong return types for __pair_get<1>
   Product: gcc
   Version: 4.0.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: libstdc++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: peturr02 at ru dot is
CC: gcc-bugs at gcc dot gnu dot org


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


[Bug libstdc++/19535] Wrong return types for __pair_get<1>

2005-01-19 Thread peturr02 at ru dot is

--- Additional Comments From peturr02 at ru dot is  2005-01-19 17:06 ---
Created an attachment (id=7993)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=7993&action=view)
Test case

Compiling this fails with:

g++0116 -Wall  -static  1.cc   -o 1
/usr/local/lib/gcc/i686-pc-linux-gnu/4.0.0/include/c++/tr1/utility: In function
‘typename std::tr1::tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type&
std::tr1::get(std::pair<_Tp1, _Tp2>&) [with int _Int = 1, _Tp1 = A, _Tp2 = B]’:

1.cc:9:   instantiated from here
/usr/local/lib/gcc/i686-pc-linux-gnu/4.0.0/include/c++/tr1/utility:80: error:
invalid initialization of reference of type ‘B&’ from expression of type ‘A’
/usr/local/lib/gcc/i686-pc-linux-gnu/4.0.0/include/c++/tr1/utility: In function
‘const typename std::tr1::tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type&
std::tr1::get(const std::pair<_Tp1, _Tp2>&) [with int _Int = 1, _Tp1 = B, _Tp2
= A]’:
1.cc:12:   instantiated from here
/usr/local/lib/gcc/i686-pc-linux-gnu/4.0.0/include/c++/tr1/utility:85: error:
invalid initialization of reference of type ‘const A&’ from expression of type
‘const B’
/usr/local/lib/gcc/i686-pc-linux-gnu/4.0.0/include/c++/tr1/utility: In static
member function ‘static _Tp1& std::tr1::__pair_get<1>::__get(std::pair<_T1,
_T2>&) [with _Tp1 = A, _Tp2 = B]’:
/usr/local/lib/gcc/i686-pc-linux-gnu/4.0.0/include/c++/tr1/utility:80:  
instantiated from ‘typename std::tr1::tuple_element<_Int, std::pair<_Tp1, _Tp2>
>::type& std::tr1::get(std::pair<_Tp1, _Tp2>&) [with int _Int = 1, _Tp1 = A,
_Tp2 = B]’
1.cc:9:   instantiated from here
/usr/local/lib/gcc/i686-pc-linux-gnu/4.0.0/include/c++/tr1/utility:70: error:
invalid initialization of reference of type ‘A&’ from expression of type ‘B’
/usr/local/lib/gcc/i686-pc-linux-gnu/4.0.0/include/c++/tr1/utility: In static
member function ‘static const _Tp1& std::tr1::__pair_get<1>::__const_get(const
std::pair<_T1, _T2>&) [with _Tp1 = B, _Tp2 = A]’:
/usr/local/lib/gcc/i686-pc-linux-gnu/4.0.0/include/c++/tr1/utility:85:  
instantiated from ‘const typename std::tr1::tuple_element<_Int, std::pair<_Tp1,
_Tp2> >::type& std::tr1::get(const std::pair<_Tp1, _Tp2>&) [with int _Int = 1,
_Tp1 = B, _Tp2 = A]’
1.cc:12:   instantiated from here
/usr/local/lib/gcc/i686-pc-linux-gnu/4.0.0/include/c++/tr1/utility:74: error:
invalid initialization of reference of type ‘const B&’ from expression of type
‘const A’
make: *** [1] Error 1


-- 


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


[Bug c++/18462] New: [3.4 Regression] Segfault on declaration of large array member

2004-11-13 Thread peturr02 at ru dot is
The compiler segfaults when compiling a class declaration that has a very large
array member of class type. This works fine with an array of int and also works
with gcc 3.3.5 and earlier, but fails with all gcc 3.4 releases.

-- 
   Summary: [3.4 Regression] Segfault on declaration of large array
member
   Product: gcc
   Version: 3.4.3
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: peturr02 at ru dot is
CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


[Bug c++/18462] [3.4 Regression] Segfault on declaration of large array member

2004-11-13 Thread peturr02 at ru dot is

--- Additional Comments From peturr02 at ru dot is  2004-11-13 16:26 ---
Created an attachment (id=7539)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=7539&action=view)
Preprocessed source code


-- 


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