This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/1631: placement new broken for enumeration types
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c++/1631: placement new broken for enumeration types
- From: fsm at robots dot ox dot ac dot uk
- Date: 12 Jan 2001 15:03:56 -0000
- Reply-To: fsm at robots dot ox dot ac dot uk
>Number: 1631
>Category: c++
>Synopsis: placement new broken for enumeration types
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Jan 12 07:06:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator: Frederik Schaffalitzky
>Release: gcc version 2.97 20010111 (experimental)
>Organization:
>Environment:
Linux 2.2.17 #3 SMP i686 unknown
>Description:
Compiler emits error when compiling the source file
enum.cxx (attached) which instantiates a vector<> of
enumeration type.
$ g++ -c enum.cxx
/include/g++-v3/bits/stl_construct.h: In function
`void std::_Construct(_T1*) [with _T1 = X]':
/include/g++-v3/bits/stl_construct.h:105: instantiated from `void std::construct(_T1*) [with _T1 = X]'
/include/g++-v3/bits/stl_vector.h:689: instantiated from `void std::vector<_Tp, _Alloc>::_M_insert_aux(std::__normal_iterator<_Tp*, std::vector<_Tp, _Alloc> >) [with _Tp = X, _Alloc = std::allocator<X>]'
enum.cxx:9: instantiated from here
/include/g++-v3/bits/stl_construct.h:53: cannot
convert `int' to `X' in initialization
>How-To-Repeat:
Compile attached source file.
>Fix:
This appears to be a compiler bug (i.e. not libstdc++), as
the distilled example shows (change #if 1 to #if 0).
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="enum.cxx"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="enum.cxx"
ZW51bSBYIHsgYWxwaGEsIGJldGEgfTsKCiNpZiAxCi8vIGV4YW1wbGUgdXNpbmcgc3RkOjp2ZWN0
b3I8PjoKIyBpbmNsdWRlIDx2ZWN0b3I+CiMgZGVmaW5lIHN0ZF92ZWN0b3Igc3RkOjp2ZWN0b3IK
CiNlbHNlCi8vIGRpc3RpbGxlZCBleGFtcGxlOgojIGluY2x1ZGUgPG5ldz4KCi8vIGFkYXB0ZWQg
ZnJvbSBiaXRzL3N0bF9jb25zdHJ1Y3QuaAp0ZW1wbGF0ZSA8dHlwZW5hbWUgVD4KaW5saW5lIHZv
aWQgY29uc3RydWN0KFQgKiBwKSB7CiAgbmV3IChwKSBUKCk7ICAvLyA8LS0gaGVyZQp9Cgp0ZW1w
bGF0ZSA8dHlwZW5hbWUgVD4Kc3RydWN0IHN0ZF92ZWN0b3IgewogIGNoYXIgYnl0ZXNbc2l6ZW9m
KFQpXTsKICBzdGRfdmVjdG9yKCkgeyBjb25zdHJ1Y3QoKFQgKikgYnl0ZXMpOyB9Cn07CiNlbmRp
ZgoKdm9pZCBmKCkKewogIFggeCA9IFgoKTsgLy8gdGhpcyBpcyBPSwp9Cgp0ZW1wbGF0ZSBjbGFz
cyBzdGRfdmVjdG9yPFg+OyAgLy8gYnV0IHRoaXMgYnJlYWtzCg==