public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/34829]  New: [4.3 Regression] placement new with primitive Java types rejected
@ 2008-01-17 17:20 rguenth at gcc dot gnu dot org
  2008-01-17 17:21 ` [Bug c++/34829] " rguenth at gcc dot gnu dot org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-01-17 17:20 UTC (permalink / raw)
  To: gcc-bugs

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<typename std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare,
_Alloc>::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<typename std::_Rb_tree<_Key, _Key, std::_Identity<_Key>, _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


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

end of thread, other threads:[~2008-01-23 16:50 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-17 17:20 [Bug c++/34829] New: [4.3 Regression] placement new with primitive Java types rejected rguenth at gcc dot gnu dot org
2008-01-17 17:21 ` [Bug c++/34829] " rguenth at gcc dot gnu dot org
2008-01-17 17:26 ` rguenth at gcc dot gnu dot org
2008-01-17 18:01 ` daney at gcc dot gnu dot org
2008-01-17 21:06 ` tromey at gcc dot gnu dot org
2008-01-17 21:18 ` tromey at gcc dot gnu dot org
2008-01-22 14:50 ` jakub at gcc dot gnu dot org
2008-01-22 18:39 ` tromey at gcc dot gnu dot org
2008-01-22 19:37 ` tromey at gcc dot gnu dot org
2008-01-23  5:42 ` pinskia at gcc dot gnu dot org
2008-01-23  9:07 ` jakub at gcc dot gnu dot org
2008-01-23 16:49 ` tromey at gcc dot gnu dot org
2008-01-23 17:29 ` pinskia at gcc dot gnu dot org

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).