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

* [Bug c++/34829] [4.3 Regression] placement new with primitive Java types rejected
  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 ` rguenth at gcc dot gnu dot org
  2008-01-17 17:26 ` rguenth at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-01-17 17:21 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at redhat dot com, aph
                   |                            |at gcc dot gnu dot org
           Priority|P3                          |P1


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


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

* [Bug c++/34829] [4.3 Regression] placement new with primitive Java types rejected
  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
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-01-17 17:26 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.3.0


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


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

* [Bug c++/34829] [4.3 Regression] placement new with primitive Java types rejected
  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
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: daney at gcc dot gnu dot org @ 2008-01-17 18:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from daney at gcc dot gnu dot org  2008-01-17 17:44 -------
I wonder what would happen (but not enough to actually test it) if these:

  typedef __java_byte jbyte;
  typedef __java_short jshort;
  typedef __java_int jint;
  typedef __java_long jlong;
  typedef __java_float jfloat;
  typedef __java_double jdouble;
  typedef __java_char jchar;
  typedef __java_boolean jboolean;
  typedef jint jsize;

Were moved outside of the extern "Java" block.


-- 

daney at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daney 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

* [Bug c++/34829] [4.3 Regression] placement new with primitive Java types rejected
  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
                   ` (2 preceding siblings ...)
  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
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: tromey at gcc dot gnu dot org @ 2008-01-17 21:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from tromey at gcc dot gnu dot org  2008-01-17 20:19 -------
Confirmed.
>From the ChangeLog it looks like the intent was to only reject
aggregate types.


-- 

tromey at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-01-17 20:19:56
               date|                            |


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


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

* [Bug c++/34829] [4.3 Regression] placement new with primitive Java types rejected
  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
                   ` (3 preceding siblings ...)
  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
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: tromey at gcc dot gnu dot org @ 2008-01-17 21:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from tromey at gcc dot gnu dot org  2008-01-17 20:23 -------
Testing a patch.


-- 

tromey at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |tromey at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2008-01-17 20:19:56         |2008-01-17 20:23:26
               date|                            |


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


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

* [Bug c++/34829] [4.3 Regression] placement new with primitive Java types rejected
  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
                   ` (4 preceding siblings ...)
  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
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-01-22 14:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jakub at gcc dot gnu dot org  2008-01-22 14:47 -------
Yeah, that was the intent.


-- 


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


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

* [Bug c++/34829] [4.3 Regression] placement new with primitive Java types rejected
  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
                   ` (5 preceding siblings ...)
  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
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: tromey at gcc dot gnu dot org @ 2008-01-22 18:39 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from tromey at gcc dot gnu dot org  2008-01-22 17:55 -------
Subject: Bug 34829

Author: tromey
Date: Tue Jan 22 17:54:59 2008
New Revision: 131732

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=131732
Log:
gcc/testsuite
        PR c++/34829:
        * g++.dg/ext/pr34829.C: New file.
gcc/cp
        PR c++/34829:
        * init.c (build_new_1): Only disallow Java aggregates.

Added:
    trunk/gcc/testsuite/g++.dg/ext/pr34829.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/init.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/34829] [4.3 Regression] placement new with primitive Java types rejected
  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
                   ` (6 preceding siblings ...)
  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
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: tromey at gcc dot gnu dot org @ 2008-01-22 19:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from tromey at gcc dot gnu dot org  2008-01-22 17:57 -------
Fix checked in.


-- 

tromey at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


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

* [Bug c++/34829] [4.3 Regression] placement new with primitive Java types rejected
  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
                   ` (7 preceding siblings ...)
  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
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-01-23  5:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from pinskia at gcc dot gnu dot org  2008-01-23 04:01 -------
This testcase fails on some targets where size_t is not unsigned int (like
i386-darwin and x86_64-linux-gnu) .

/Users/apinski/src/local/gcc/gcc/testsuite/g++.dg/ext/pr34829.C:12: error:
'operator new' takes type 'size_t' ('long unsigned int') as first parameter


Thanks,
Andrew Pinski


-- 


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


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

* [Bug c++/34829] [4.3 Regression] placement new with primitive Java types rejected
  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
                   ` (8 preceding siblings ...)
  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
  11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-01-23  9:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from jakub at gcc dot gnu dot org  2008-01-23 08:34 -------
Subject: Bug 34829

Author: jakub
Date: Wed Jan 23 08:33:22 2008
New Revision: 131756

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=131756
Log:
        PR c++/34829
        * g++.dg/ext/pr34829.C (operator new): Use size_t instead of
        unsigned int for the first argument.

Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/ext/pr34829.C


-- 


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


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

* [Bug c++/34829] [4.3 Regression] placement new with primitive Java types rejected
  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
                   ` (9 preceding siblings ...)
  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
  11 siblings, 0 replies; 13+ messages in thread
From: tromey at gcc dot gnu dot org @ 2008-01-23 16:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from tromey at gcc dot gnu dot org  2008-01-23 16:43 -------
Reopened while I look at the new problem


-- 

tromey at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |


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


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

* [Bug c++/34829] [4.3 Regression] placement new with primitive Java types rejected
  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
                   ` (10 preceding siblings ...)
  2008-01-23 16:49 ` tromey at gcc dot gnu dot org
@ 2008-01-23 17:29 ` pinskia at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-01-23 17:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from pinskia at gcc dot gnu dot org  2008-01-23 16:49 -------
(In reply to comment #9)
> Reopened while I look at the new problem
> 

Jakub fixed it last night with:

Author: jakub
Date: Wed Jan 23 08:33:22 2008
New Revision: 131756

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=131756
Log:
        PR c++/34829
        * g++.dg/ext/pr34829.C (operator new): Use size_t instead of
        unsigned int for the first argument.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED


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