From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30775 invoked by alias); 17 Jan 2008 17:00:12 -0000 Received: (qmail 30267 invoked by uid 48); 17 Jan 2008 16:59:32 -0000 Date: Thu, 17 Jan 2008 17:20:00 -0000 Subject: [Bug c++/34829] New: [4.3 Regression] placement new with primitive Java types rejected X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "rguenth at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-01/txt/msg01782.txt.bz2 You can no longer use types like 'jint' together with libstdc++ containers as the fix for PR30293 disallows placement new of types that have TYPE_FOR_JAVA set. Now, the gcj/javaprims.h header has extern "Java" { typedef __java_byte jbyte; typedef __java_short jshort; typedef __java_int jint; typedef __java_long jlong; typedef __java_float jfloat; ... etc., which is unfortunate, as this results in (from pdftk build): g++ pdftk.cc -I../java_libs -O2 -DPATH_DELIM=0x2f -DASK_ABOUT_WARNINGS=false -fdollars-in-identifiers -DPDFTK_VER=\"1.41\" -c /usr/include/c++/4.3/ext/new_allocator.h: In member function 'void __gnu_cxx::new_allocator<_Tp>::construct(_Tp*, const _Tp&) [with _Tp = __java_int]': /usr/include/c++/4.3/bits/stl_tree.h:368: instantiated from 'std::_Rb_tree_node<_Val>* std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_create_node(const _Val&) [with _Key = __java_int, _Val = __java_int, _KeyOfValue = std::_Identity<__java_int>, _Compare = std::less<__java_int>, _Alloc = std::allocator<__java_int>]' /usr/include/c++/4.3/bits/stl_tree.h:852: instantiated from 'typename std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_insert_(const std::_Rb_tree_node_base*, const std::_Rb_tree_node_base*, const _Val&) [with _Key = __java_int, _Val = __java_int, _KeyOfValue = std::_Identity<__java_int>, _Compare = std::less<__java_int>, _Alloc = std::allocator<__java_int>]' /usr/include/c++/4.3/bits/stl_tree.h:1148: instantiated from 'std::pair::iterator, bool> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_insert_unique(const _Val&) [with _Key = __java_int, _Val = __java_int, _KeyOfValue = std::_Identity<__java_int>, _Compare = std::less<__java_int>, _Alloc = std::allocator<__java_int>]' /usr/include/c++/4.3/bits/stl_set.h:383: instantiated from 'std::pair, _Compare, typename _Alloc::rebind<_Key>::other>::const_iterator, bool> std::set<_Key, _Compare, _Alloc>::insert(const _Key&) [with _Key = __java_int, _Compare = std::less<__java_int>, _Alloc = std::allocator<__java_int>]' pdftk.cc:1355: instantiated from here /usr/include/c++/4.3/ext/new_allocator.h:108: error: Java class '__java_int' object allocated using placement new Can we restrict this placement new restriction to types that would need a constructor please? -- Summary: [4.3 Regression] placement new with primitive Java types rejected Product: gcc Version: 4.3.0 Status: UNCONFIRMED Keywords: rejects-valid Severity: blocker Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: rguenth at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34829