public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/16844] New: Explicit instantiation failing
@ 2004-07-31 10:22 larsbj at lyx dot org
  2004-07-31 23:35 ` [Bug libstdc++/16844] " bangerth at dealii dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: larsbj at lyx dot org @ 2004-07-31 10:22 UTC (permalink / raw)
  To: gcc-bugs

This is adapted from code in connection.hpp in boost.

Should it work or is the code in fact wrong, and makes assumptions
that the standard does not provide?

------
#include <list>

struct bound_object {
        bool operator==(const bound_object& other) const;
        bool operator<(const bound_object& other) const;
};

template class std::list<bound_object>;
--------

g++ (GCC) 3.5.0 20040731 (experimental)

g++ -c -o alloc.o alloc.C
/opt/gcc-head/lib/gcc/i686-pc-linux-gnu/3.5.0/../../../../include/c++/3.5.0/bits/stl_list.h:
In member function `std::_List_node<_Tp>* std::list<_Tp,
_Alloc>::_M_create_node() [with _Tp = bound_object, _Alloc =
std::allocator<bound_object>]':
alloc.C:8:   instantiated from here
/opt/gcc-head/lib/gcc/i686-pc-linux-gnu/3.5.0/../../../../include/c++/3.5.0/bits/stl_list.h:460:
error: no matching function for call to
`std::allocator<bound_object>::construct(bound_object*)'
/opt/gcc-head/lib/gcc/i686-pc-linux-gnu/3.5.0/../../../../include/c++/3.5.0/ext/mt_allocator.h:106:
note: candidates are: void __gnu_cxx::__mt_alloc<_Tp>::construct(_Tp*, const
_Tp&) [with _Tp = bound_object]

-- 
           Summary: Explicit instantiation failing
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: larsbj at lyx dot org
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: i686-pc-linux-gnu


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


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

* [Bug libstdc++/16844] Explicit instantiation failing
  2004-07-31 10:22 [Bug libstdc++/16844] New: Explicit instantiation failing larsbj at lyx dot org
@ 2004-07-31 23:35 ` bangerth at dealii dot org
  2004-08-01  0:16 ` [Bug libstdc++/16844] [3.5 Regression] " pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: bangerth at dealii dot org @ 2004-07-31 23:35 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-07-31 23:35 -------
I can't see any reason why this shouldn't work. And indeed it does 
with my mainline snapshot from 2004-07-27 and all the releases 
I have. Can someone confirm with a newer snapshot? 
 
W. 

-- 


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


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

* [Bug libstdc++/16844] [3.5 Regression] Explicit instantiation failing
  2004-07-31 10:22 [Bug libstdc++/16844] New: Explicit instantiation failing larsbj at lyx dot org
  2004-07-31 23:35 ` [Bug libstdc++/16844] " bangerth at dealii dot org
@ 2004-08-01  0:16 ` pinskia at gcc dot gnu dot org
  2004-08-01  6:12 ` austern at apple dot com
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-08-01  0:16 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-08-01 00:16 -------
Well it looks like a regression caused by:
2004-07-28  Matt Austern  <austern@apple.com>

        .....
        * include/ext/hashtable.h: Use rebind so that allocator_type
        has correct type for a container's allocator.  Replace use of
        single-argument _Construct and _Destroy with use of allocator's
        construct and destroy methods.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |austern at apple dot com
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |rejects-valid
      Known to fail|                            |3.5.0
      Known to work|                            |3.4.0
   Last reconfirmed|0000-00-00 00:00:00         |2004-08-01 00:16:55
               date|                            |
            Summary|Explicit instantiation      |[3.5 Regression] Explicit
                   |failing                     |instantiation failing
   Target Milestone|---                         |3.5.0


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


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

* [Bug libstdc++/16844] [3.5 Regression] Explicit instantiation failing
  2004-07-31 10:22 [Bug libstdc++/16844] New: Explicit instantiation failing larsbj at lyx dot org
  2004-07-31 23:35 ` [Bug libstdc++/16844] " bangerth at dealii dot org
  2004-08-01  0:16 ` [Bug libstdc++/16844] [3.5 Regression] " pinskia at gcc dot gnu dot org
@ 2004-08-01  6:12 ` austern at apple dot com
  2004-08-01 10:21 ` pcarlini at suse dot de
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: austern at apple dot com @ 2004-08-01  6:12 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From austern at apple dot com  2004-08-01 06:12 -------
I agree that this is almost certainly caused by my change.  This should be assigned to me.  I expect that 
the fix will be easy.  (The most interesting part of the fix will be coming up with a new test case, since 
this wasn't caught by anything in the existing test suite.)

-- 


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


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

* [Bug libstdc++/16844] [3.5 Regression] Explicit instantiation failing
  2004-07-31 10:22 [Bug libstdc++/16844] New: Explicit instantiation failing larsbj at lyx dot org
                   ` (2 preceding siblings ...)
  2004-08-01  6:12 ` austern at apple dot com
@ 2004-08-01 10:21 ` pcarlini at suse dot de
  2004-08-01 11:37 ` larsbj at lyx dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pcarlini at suse dot de @ 2004-08-01 10:21 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pcarlini at suse dot de  2004-08-01 10:21 -------
Isn't just

diff -urN libstdc++-v3-orig/include/bits/stl_list.h
libstdc++-v3/include/bits/stl_list.h
--- libstdc++-v3-orig/include/bits/stl_list.h   2004-07-28 18:37:17.000000000 +0200
+++ libstdc++-v3/include/bits/stl_list.h        2004-08-01 12:10:20.000000000 +0200
@@ -457,7 +457,7 @@
        _Node* __p = this->_M_get_node();
        try
          {
-           this->get_allocator().construct(&__p->_M_data);
+           this->get_allocator().construct(&__p->_M_data, value_type());
          }
        catch(...)
          {

???

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |austern at apple dot com
                   |dot org                     |
             Status|NEW                         |ASSIGNED


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


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

* [Bug libstdc++/16844] [3.5 Regression] Explicit instantiation failing
  2004-07-31 10:22 [Bug libstdc++/16844] New: Explicit instantiation failing larsbj at lyx dot org
                   ` (3 preceding siblings ...)
  2004-08-01 10:21 ` pcarlini at suse dot de
@ 2004-08-01 11:37 ` larsbj at lyx dot org
  2004-08-01 22:53 ` austern at apple dot com
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: larsbj at lyx dot org @ 2004-08-01 11:37 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From larsbj at lyx dot org  2004-08-01 11:37 -------
The patch in #4 fixes the compile.
I have no idea if this is the correct fix.


-- 


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


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

* [Bug libstdc++/16844] [3.5 Regression] Explicit instantiation failing
  2004-07-31 10:22 [Bug libstdc++/16844] New: Explicit instantiation failing larsbj at lyx dot org
                   ` (4 preceding siblings ...)
  2004-08-01 11:37 ` larsbj at lyx dot org
@ 2004-08-01 22:53 ` austern at apple dot com
  2004-08-02  4:40 ` cvs-commit at gcc dot gnu dot org
  2004-08-02  4:56 ` pinskia at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: austern at apple dot com @ 2004-08-01 22:53 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From austern at apple dot com  2004-08-01 22:53 -------
That's a correct fix, but it's not the best fix.

This is a bug in an unused private member function.  (For history buffs: it was once an auxiliary 
member function for an SGI extension.  We removed the extension itself, but neglected to get around to 
removing the auxiliary that it used.)  So the best fix is to remove it.

And, of course: the reason we are seeing a bug in an unused member function is that we're doing an 
explicit instantiation.  Conclusion: our test suite needs to do explicit instantiations, not just tests of 
correct functionality.

I'm testing a patch now, including the new test cases.

-- 


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


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

* [Bug libstdc++/16844] [3.5 Regression] Explicit instantiation failing
  2004-07-31 10:22 [Bug libstdc++/16844] New: Explicit instantiation failing larsbj at lyx dot org
                   ` (5 preceding siblings ...)
  2004-08-01 22:53 ` austern at apple dot com
@ 2004-08-02  4:40 ` cvs-commit at gcc dot gnu dot org
  2004-08-02  4:56 ` pinskia at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-08-02  4:40 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-08-02 04:40 -------
Subject: Bug 16844

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	austern@gcc.gnu.org	2004-08-02 04:40:20

Modified files:
	libstdc++-v3   : ChangeLog 
	libstdc++-v3/include/bits: stl_list.h 
	libstdc++-v3/include/ext: slist 
Added files:
	libstdc++-v3/testsuite/23_containers/deque: 
	                                            explicit_instantiation.cc 
	libstdc++-v3/testsuite/23_containers/list: 
	                                           explicit_instantiation.cc 
	libstdc++-v3/testsuite/23_containers/map: 
	                                          explicit_instantiation.cc 
	libstdc++-v3/testsuite/23_containers/multimap: 
	                                               explicit_instantiation.cc 
	libstdc++-v3/testsuite/23_containers/multiset: 
	                                               explicit_instantiation.cc 
	libstdc++-v3/testsuite/23_containers/set: 
	                                          explicit_instantiation.cc 
	libstdc++-v3/testsuite/23_containers/vector: 
	                                             explicit_instantiation.cc 
	libstdc++-v3/testsuite/ext: hash_set_explicit_instantiation.cc 
	                            slist_explicit_instantiation.cc 

Log message:
	PR libstdc++/16844
	* include/bits/stl_list.h (_M_create_node): Remove unused
	zero-argument version.
	* include/ext/slist (_M_create_node): Pass two arguments to
	allocator's construct() member function.
	* testsuite/23_containers/deque/explicit_instantiation.cc: New.
	* testsuite/23_containers/list/explicit_instantiation.cc: New.
	* testsuite/23_containers/vector/explicit_instantiation.cc: New.
	* testsuite/23_containers/map/explicit_instantiation.cc: New.
	* testsuite/23_containers/set/explicit_instantiation.cc: New.
	* testsuite/23_containers/multimap/explicit_instantiation.cc: New.
	* testsuite/23_containers/multiset/explicit_instantiation.cc: New.
	* testsuite/ext/hash_set_explicit_instantiation.cc: New.
	* testsuite/ext/slist_explicit_instantiation.cc: New.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&r1=1.2594&r2=1.2595
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/stl_list.h.diff?cvsroot=gcc&r1=1.42&r2=1.43
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/ext/slist.diff?cvsroot=gcc&r1=1.23&r2=1.24
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/23_containers/deque/explicit_instantiation.cc.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/23_containers/list/explicit_instantiation.cc.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/23_containers/map/explicit_instantiation.cc.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/23_containers/multimap/explicit_instantiation.cc.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/23_containers/multiset/explicit_instantiation.cc.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/23_containers/set/explicit_instantiation.cc.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/23_containers/vector/explicit_instantiation.cc.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/ext/hash_set_explicit_instantiation.cc.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/ext/slist_explicit_instantiation.cc.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


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


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

* [Bug libstdc++/16844] [3.5 Regression] Explicit instantiation failing
  2004-07-31 10:22 [Bug libstdc++/16844] New: Explicit instantiation failing larsbj at lyx dot org
                   ` (6 preceding siblings ...)
  2004-08-02  4:40 ` cvs-commit at gcc dot gnu dot org
@ 2004-08-02  4:56 ` pinskia at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-08-02  4:56 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-08-02 04:56 -------
Fixed.

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


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


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

end of thread, other threads:[~2004-08-02  4:56 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-31 10:22 [Bug libstdc++/16844] New: Explicit instantiation failing larsbj at lyx dot org
2004-07-31 23:35 ` [Bug libstdc++/16844] " bangerth at dealii dot org
2004-08-01  0:16 ` [Bug libstdc++/16844] [3.5 Regression] " pinskia at gcc dot gnu dot org
2004-08-01  6:12 ` austern at apple dot com
2004-08-01 10:21 ` pcarlini at suse dot de
2004-08-01 11:37 ` larsbj at lyx dot org
2004-08-01 22:53 ` austern at apple dot com
2004-08-02  4:40 ` cvs-commit at gcc dot gnu dot org
2004-08-02  4:56 ` 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).