public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: libstdc++/9580: basic_filebuf<> with custom traits_type fails to link
@ 2003-02-13 21:26 Paolo Carlini
  0 siblings, 0 replies; 10+ messages in thread
From: Paolo Carlini @ 2003-02-13 21:26 UTC (permalink / raw)
  To: paolo; +Cc: gcc-prs

The following reply was made to PR libstdc++/9580; it has been noted by GNATS.

From: Paolo Carlini <pcarlini@unitus.it>
To: Gabriel Dos Reis <gdr@integrable-solutions.net>
Cc: gcc-gnats@gcc.gnu.org,  peturr02@ru.is,  gcc-bugs@gcc.gnu.org, 
 gcc-prs@gcc.gnu.org
Subject: Re: libstdc++/9580: basic_filebuf<> with custom traits_type fails
 to link
Date: Thu, 13 Feb 2003 22:16:41 +0100

 Gabriel Dos Reis wrote:
 
 >This is something we should fix.  However I don't have necessary time
 >next week to work on it. I'm sorry.
 >
 Well, so *I* will fix it ;)
 
 Seriously, the PR is regression from 3.0.x, "due" to this checkin of 
 yours and
 Benjamin, apparently
 (the problem is with std::basic_filebuf<char, 
 MyTraits>::_M_underflow_common(bool):
 
 2002-07-30  Benjamin Kosnik  <bkoz@redhat.com>
             Gabriel Dos Reis  <gdr@nerim.net>
 
 ...
 
     * include/std/std_fstream.h: Declare _M_underflow_common
     specializations.
     * src/fstream.cc: New. Add _M_underflow_common specializations.
     * include/bits/fstream.tcc (filebuf::close): Use traits_type.
     (filebuf::_M_underflow_common(bool)): Remove generic version, as
     sys_ungetc and custom int_types don't get along.
 
 ...
 
 Can you please help me a bit understanding these Changelog entries?
 
 Thanks,
 Paolo.
 


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

* Re: libstdc++/9580: basic_filebuf<> with custom traits_type fails to link
@ 2003-02-17 20:10 paolo
  0 siblings, 0 replies; 10+ messages in thread
From: paolo @ 2003-02-17 20:10 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, paolo, peturr02

Synopsis: basic_filebuf<> with custom traits_type fails to link

State-Changed-From-To: analyzed->closed
State-Changed-By: paolo
State-Changed-When: Mon Feb 17 20:10:53 2003
State-Changed-Why:
    Fixed for 3.4.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9580


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

* Re: libstdc++/9580: basic_filebuf<> with custom traits_type fails to link
@ 2003-02-13 21:46 Paolo Carlini
  0 siblings, 0 replies; 10+ messages in thread
From: Paolo Carlini @ 2003-02-13 21:46 UTC (permalink / raw)
  To: paolo; +Cc: gcc-prs

The following reply was made to PR libstdc++/9580; it has been noted by GNATS.

From: Paolo Carlini <pcarlini@unitus.it>
To: Gabriel Dos Reis <gdr@integrable-solutions.net>
Cc: gcc-gnats@gcc.gnu.org,  peturr02@ru.is,  gcc-bugs@gcc.gnu.org
Subject: Re: libstdc++/9580: basic_filebuf<> with custom traits_type fails
 to link
Date: Thu, 13 Feb 2003 22:40:15 +0100

 Gabriel Dos Reis wrote:
 
 >If I recall correctly, this change was made because of some
 >differences in the way a narrow character stream based on
 >char_traits<char> behaves and the way the general Traits may behave.
 >At that point, I seem to recall that the goal was to have a general
 >implementation  of that function plus the special case.  I'll have to
 >go back and check my logs, unless Benjamin has a better recollection. 
 >
 Thanks Gaby. Well, I'd like to ask a little bit more help. Perhaps we are
 on the right track.
 
 The complete error message at link time is the following:
 
 /tmp/ccVSVF9A.o: In function `std::basic_filebuf<char, 
 MyTraits>::underflow()':
 /tmp/ccVSVF9A.o(.gnu.linkonce.t._ZNSt13basic_filebufIc8MyTraitsE9underflowEv+0x15): 
 undefined reference to `std::basic_filebuf<char, 
 MyTraits>::_M_underflow_common(bool)'
 /tmp/ccVSVF9A.o: In function `std::basic_filebuf<char, MyTraits>::uflow()':
 /tmp/ccVSVF9A.o(.gnu.linkonce.t._ZNSt13basic_filebufIc8MyTraitsE5uflowEv+0x15): 
 undefined reference to `std::basic_filebuf<char, 
 MyTraits>::_M_underflow_common(bool)'
 
 As you can see, underflow and uflow are missing the generic 
 _M_underflow_common.
 
 Now, in the current std_fstream.h there is:
 
   // Explicit specialization declarations, defined in src/fstream.cc.
   template<>
     basic_filebuf<char>::int_type
     basic_filebuf<char>::_M_underflow_common(bool __bump);
 
  #ifdef _GLIBCPP_USE_WCHAR_T
   template<>
     basic_filebuf<wchar_t>::int_type
     basic_filebuf<wchar_t>::_M_underflow_common(bool __bump);
  #endif
 
   // Generic definitions.
   template <typename _CharT, typename _Traits>
     typename basic_filebuf<_CharT, _Traits>::int_type
     basic_filebuf<_CharT, _Traits>::underflow()
     { return _M_underflow_common(false); }
 
   template <typename _CharT, typename _Traits>
     typename basic_filebuf<_CharT, _Traits>::int_type
     basic_filebuf<_CharT, _Traits>::uflow()
     { return _M_underflow_common(true); }
 
 Naively, something seems suspect here: the *generic* underflow and uflow 
 are still there!!
 
 Shouldn't they be disposed too, for the time being, at least?
 Paolo.
 
 


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

* Re: libstdc++/9580: basic_filebuf<> with custom traits_type fails to link
@ 2003-02-13 21:36 Gabriel Dos Reis
  0 siblings, 0 replies; 10+ messages in thread
From: Gabriel Dos Reis @ 2003-02-13 21:36 UTC (permalink / raw)
  To: paolo; +Cc: gcc-prs

The following reply was made to PR libstdc++/9580; it has been noted by GNATS.

From: Gabriel Dos Reis <gdr@integrable-solutions.net>
To: Paolo Carlini <pcarlini@unitus.it>
Cc: gcc-gnats@gcc.gnu.org, peturr02@ru.is, gcc-bugs@gcc.gnu.org
Subject: Re: libstdc++/9580: basic_filebuf<> with custom traits_type fails to link
Date: 13 Feb 2003 22:27:40 +0100

 Paolo Carlini <pcarlini@unitus.it> writes:
 
 | Gabriel Dos Reis wrote:
 | 
 | >This is something we should fix.  However I don't have necessary time
 | >next week to work on it. I'm sorry.
 | >
 | Well, so *I* will fix it ;)
 | 
 | Seriously, the PR is regression from 3.0.x, "due" to this checkin of
 | yours and
 
 Aha, I'm a silly boy :-(
 
 | Benjamin, apparently
 | (the problem is with std::basic_filebuf<char,
 | MyTraits>::_M_underflow_common(bool):
 | 
 | 2002-07-30  Benjamin Kosnik  <bkoz@redhat.com>
 |             Gabriel Dos Reis  <gdr@nerim.net>
 | 
 | ...
 | 
 |     * include/std/std_fstream.h: Declare _M_underflow_common
 |     specializations.
 |     * src/fstream.cc: New. Add _M_underflow_common specializations.
 |     * include/bits/fstream.tcc (filebuf::close): Use traits_type.
 |     (filebuf::_M_underflow_common(bool)): Remove generic version, as
 |     sys_ungetc and custom int_types don't get along.
 | 
 | ...
 | 
 | Can you please help me a bit understanding these Changelog entries?
 
 If I recall correctly, this change was made because of some
 differences in the way a narrow character stream based on
 char_traits<char> behaves and the way the general Traits may behave.
 At that point, I seem to recall that the goal was to have a general
 implementation  of that function plus the special case.  I'll have to
 go back and check my logs, unless Benjamin has a better recollection. 
 
 -- Gaby


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

* Re: libstdc++/9580: basic_filebuf<> with custom traits_type fails to link
@ 2003-02-13 21:21 paolo
  0 siblings, 0 replies; 10+ messages in thread
From: paolo @ 2003-02-13 21:21 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, gdr, paolo, peturr02

Synopsis: basic_filebuf<> with custom traits_type fails to link

Responsible-Changed-From-To: gdr->paolo
Responsible-Changed-By: paolo
Responsible-Changed-When: Thu Feb 13 21:21:58 2003
Responsible-Changed-Why:
    Ok, I will work on it (with Gaby's help!)

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9580


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

* Re: libstdc++/9580: basic_filebuf<> with custom traits_type fails to link
@ 2003-02-13 21:16 Gabriel Dos Reis
  0 siblings, 0 replies; 10+ messages in thread
From: Gabriel Dos Reis @ 2003-02-13 21:16 UTC (permalink / raw)
  To: gdr; +Cc: gcc-prs

The following reply was made to PR libstdc++/9580; it has been noted by GNATS.

From: Gabriel Dos Reis <gdr@integrable-solutions.net>
To: Paolo Carlini <pcarlini@unitus.it>
Cc: gcc-gnats@gcc.gnu.org, peturr02@ru.is, gcc-bugs@gcc.gnu.org,
   gcc-prs@gcc.gnu.org
Subject: Re: libstdc++/9580: basic_filebuf<> with custom traits_type fails to link
Date: 13 Feb 2003 22:07:39 +0100

 Paolo Carlini <pcarlini@unitus.it> writes:
 
 |  > I'm tempted to see this as a bug in our library...
 |  > Can someone recall me briefly why we can't make this work?
 | 
 | Probably we can! The bug was still in the open state, nobody had really
 | looked at it and if there are no infrastructural serious impediments
 | (can you confirm that?) probably someone (you? Benjamin? me?) will
 | fix it soon!
 
 This is something we should fix.  However I don't have necessary time
 next week to work on it. I'm sorry.
 
 -- Gaby


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

* Re: libstdc++/9580: basic_filebuf<> with custom traits_type fails to link
@ 2003-02-13 21:06 Paolo Carlini
  0 siblings, 0 replies; 10+ messages in thread
From: Paolo Carlini @ 2003-02-13 21:06 UTC (permalink / raw)
  To: gdr; +Cc: gcc-prs

The following reply was made to PR libstdc++/9580; it has been noted by GNATS.

From: Paolo Carlini <pcarlini@unitus.it>
To: gcc-gnats@gcc.gnu.org,  peturr02@ru.is,  gcc-bugs@gcc.gnu.org, 
 gdr@gcc.gnu.org,  gcc-prs@gcc.gnu.org
Cc:  
Subject: Re: libstdc++/9580: basic_filebuf<> with custom traits_type fails
 to link
Date: Thu, 13 Feb 2003 22:03:01 +0100

  > I'm tempted to see this as a bug in our library...
  > Can someone recall me briefly why we can't make this work?
 
 Probably we can! The bug was still in the open state, nobody had really
 looked at it and if there are no infrastructural serious impediments
 (can you confirm that?) probably someone (you? Benjamin? me?) will
 fix it soon!
 
 Paolo.
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9580
 


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

* Re: libstdc++/9580: basic_filebuf<> with custom traits_type fails to link
@ 2003-02-13 20:56 Gabriel Dos Reis
  0 siblings, 0 replies; 10+ messages in thread
From: Gabriel Dos Reis @ 2003-02-13 20:56 UTC (permalink / raw)
  To: gdr; +Cc: gcc-prs

The following reply was made to PR libstdc++/9580; it has been noted by GNATS.

From: Gabriel Dos Reis <gdr@integrable-solutions.net>
To: paolo@gcc.gnu.org
Cc: gcc-bugs@gcc.gnu.org, peturr02@ru.is, gcc-gnats@gcc.gnu.org
Subject: Re: libstdc++/9580: basic_filebuf<> with custom traits_type fails to link
Date: 13 Feb 2003 21:54:39 +0100

 paolo@gcc.gnu.org writes:
 
 | Synopsis: basic_filebuf<> with custom traits_type fails to link
 | 
 | Responsible-Changed-From-To: unassigned->gdr
 | Responsible-Changed-By: paolo
 | Responsible-Changed-When: Thu Feb 13 20:11:34 2003
 | Responsible-Changed-Why:
 |     traits guru
 | State-Changed-From-To: open->analyzed
 | State-Changed-By: paolo
 | State-Changed-When: Thu Feb 13 20:11:34 2003
 | State-Changed-Why:
 |     Hi Gaby, could you please have a look at this one?
 |     It bears some similarities with libstdc++/8836, which you
 |     triaged as not a bug. Thanks!
 
 I'm tempted to see this as a bug in our library...
 Can someone recall me briefly why we can't make this work?
 
 -- Gaby


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

* Re: libstdc++/9580: basic_filebuf<> with custom traits_type fails to link
@ 2003-02-13 20:11 paolo
  0 siblings, 0 replies; 10+ messages in thread
From: paolo @ 2003-02-13 20:11 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, gdr, nobody, peturr02

Synopsis: basic_filebuf<> with custom traits_type fails to link

Responsible-Changed-From-To: unassigned->gdr
Responsible-Changed-By: paolo
Responsible-Changed-When: Thu Feb 13 20:11:34 2003
Responsible-Changed-Why:
    traits guru
State-Changed-From-To: open->analyzed
State-Changed-By: paolo
State-Changed-When: Thu Feb 13 20:11:34 2003
State-Changed-Why:
    Hi Gaby, could you please have a look at this one?
    It bears some similarities with libstdc++/8836, which you
    triaged as not a bug. Thanks!

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9580


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

* libstdc++/9580: basic_filebuf<> with custom traits_type fails to link
@ 2003-02-05 10:36 peturr02
  0 siblings, 0 replies; 10+ messages in thread
From: peturr02 @ 2003-02-05 10:36 UTC (permalink / raw)
  To: gcc-gnats


>Number:         9580
>Category:       libstdc++
>Synopsis:       basic_filebuf<> with custom traits_type fails to link
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Feb 05 10:36:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     peturr02@ru.is
>Release:        gcc-3.2.1
>Organization:
>Environment:
Red Hat Linux 8.0
>Description:
basic_filebuf<CharT, Traits> fails to link if CharT is any type other than char or wchar_t or if Traits is any type other than char_traits<CharT>.

I think the attached program is required to link and run, in particular it satisfies the requirements for Traits in 21.1.1, 27.1.2 and 27.8.1.1.
>How-To-Repeat:
See attachment.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="instbug.cc"
Content-Disposition: inline; filename="instbug.cc"

#include <fstream>
using namespace std;

class MyTraits : public char_traits<char>
{
};

int main()
{
	basic_filebuf<char, MyTraits> fb;
	return 0;
}


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

end of thread, other threads:[~2003-02-17 20:10 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-13 21:26 libstdc++/9580: basic_filebuf<> with custom traits_type fails to link Paolo Carlini
  -- strict thread matches above, loose matches on Subject: below --
2003-02-17 20:10 paolo
2003-02-13 21:46 Paolo Carlini
2003-02-13 21:36 Gabriel Dos Reis
2003-02-13 21:21 paolo
2003-02-13 21:16 Gabriel Dos Reis
2003-02-13 21:06 Paolo Carlini
2003-02-13 20:56 Gabriel Dos Reis
2003-02-13 20:11 paolo
2003-02-05 10:36 peturr02

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