public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/34829]  New: [4.3 Regression] placement new with primitive Java types rejected
Date: Thu, 17 Jan 2008 17:20:00 -0000	[thread overview]
Message-ID: <bug-34829-10053@http.gcc.gnu.org/bugzilla/> (raw)

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


             reply	other threads:[~2008-01-17 17:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-17 17:20 rguenth at gcc dot gnu dot org [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-34829-10053@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).