public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/30127]  New: std::has_facet returns true for not installed derived facets
@ 2006-12-09  0:30 sebor at roguewave dot com
  2006-12-11 13:49 ` [Bug libstdc++/30127] " bkoz at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: sebor at roguewave dot com @ 2006-12-09  0:30 UTC (permalink / raw)
  To: gcc-bugs

The program below is expected to run successfully to completion since there
is no MyCtype facet installed in the classic locale (and, in fact, no facet
of that type can exist since it doesn't have an accessible ctor).

$ cat u.cpp && g++ -dumpversion && g++ u.cpp -static && ./a.out
#include <cassert>
#include <locale>

struct MyCtype: std::ctype<char> { private: MyCtype (); };

int main ()
{
    assert (std::has_facet<std::ctype<char> >(std::locale::classic ()));
    assert (!std::has_facet<MyCtype>(std::locale::classic ()));
}
4.1.0
Assertion failed: !std::has_facet<MyCtype>(std::locale::classic ()), file
u.cpp, line 9
Abort (core dumped)


-- 
           Summary: std::has_facet returns true for not installed derived
                    facets
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sebor at roguewave dot com


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


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

end of thread, other threads:[~2008-01-05 11:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-09  0:30 [Bug libstdc++/30127] New: std::has_facet returns true for not installed derived facets sebor at roguewave dot com
2006-12-11 13:49 ` [Bug libstdc++/30127] " bkoz at gcc dot gnu dot org
2007-12-14 19:32 ` bkoz at gcc dot gnu dot org
2007-12-14 21:27 ` bkoz at gcc dot gnu dot org
2007-12-25 14:55 ` pcarlini at suse dot de
2008-01-05 11:07 ` paolo at gcc dot gnu dot org
2008-01-05 11:26 ` pcarlini at suse dot de

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