public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "bduerner at gmx dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/21238] conflicting "typedef __numpunct_cache<_CharT>    __cache_type;" in std::numpunct<CharT> makes specialization impossible
Date: Wed, 27 Apr 2005 11:34:00 -0000	[thread overview]
Message-ID: <20050427113404.15098.qmail@sourceware.org> (raw)
In-Reply-To: <20050426232113.21238.bduerner@gmx.de>


------- Additional Comments From bduerner at gmx dot de  2005-04-27 11:33 -------
This testcase gives the following error: 
numpunct_test.cpp:106:   instantiated from here 
/usr/lib/gcc/i586-ark-linux/3.4.4/../../../../include/c++/3.4.4/bits/locale_facets.tcc:435: 
error: no type named `__cache_type' in `class std::numpunct<MyChar>' 
 
 
--------------------------------------------------------------------- 
#include <streambuf> 
#include <exception> 
#include <string> 
#include <iostream> 
#include <locale> 
using namespace std; 
 
 
struct MyChar {}; 
 
 
namespace std { 
 
  template<> 
  struct char_traits<MyChar> { 
    typedef MyChar char_type; 
    typedef int int_type; 
    typedef streamoff off_type; 
    typedef off_t pos_type; 
    typedef mbstate_t state_type; 
 
    static void assign(char_type& c1, const char_type& c2) {} 
    static bool eq(const char_type& c1, const char_type& c2) {} 
    static bool lt(const char_type& c1, const char_type& c2) {} 
    static int compare(const char_type* c1, const char_type* c2, size_t n) {} 
    static size_t length(const char_type* s) {} 
    static const char_type* find(const char_type* s, size_t n, const char_type& 
a) {} 
    static char_type* move(char_type* s1, const char_type* s2, int_type n) {} 
    static char_type* copy(char_type* s1, const char_type* s2, size_t n) {} 
    static char_type* assign(char_type* s, size_t n, char_type a) {} 
    static char_type to_char_type(const int_type& c) {} 
    static int_type to_int_type(const char_type& c) {} 
    static bool eq_int_type(const int_type& c1, const int_type& c2) {} 
    static int_type eof() {} 
    static int_type not_eof(const int_type& c) {} 
  }; 
 
 
  template <> 
  class numpunct<MyChar> : public locale::facet { 
    public: 
      typedef MyChar char_type; 
      typedef basic_string<MyChar> string_type; 
 
      // BUG: I would need to include this internally used typedef 
      // to make it compile successfully. 
      // typedef __numpunct_cache<MyChar>  __cache_type; 
 
    public: 
      static locale::id id; 
 
    public: 
      explicit numpunct<MyChar>(size_t refs = 0) : locale::facet(refs) 
        { } 
 
      char_type decimal_point() const 
        { return this->do_decimal_point(); } 
 
      char_type thousands_sep() const 
        { return this->do_thousands_sep(); } 
 
      string grouping() const 
        { return this->do_grouping(); } 
 
      string_type truename() const 
        { return this->do_truename(); } 
 
      string_type falsename() const 
        { return this->do_falsename(); } 
 
    protected: 
      ~numpunct<MyChar>() 
        { } 
 
      virtual char_type do_decimal_point() const 
        { return MyChar(); } 
 
      virtual char_type do_thousands_sep() const 
        { return MyChar(); } 
 
      virtual string do_grouping() const 
        { return ""; } 
 
      virtual string_type do_truename() const 
        { /* whatever */ } 
 
      virtual string_type do_falsename() const 
        { /* whatever*/ } 
  }; 
 
  std::locale::id std::numpunct<MyChar>::id; 
 
} 
 
 
class MyStream : public std::basic_iostream<MyChar> { 
  public: 
    MyStream() : std::basic_iostream<MyChar>() 
    {} 
}; 
 
 
int main() { 
	MyStream mystream; 
 
	std::locale loc( mystream.getloc(), new std::numpunct<MyChar>() ); 
	mystream.imbue(loc); 
 
	int n; 
	mystream >> n; 
 
  return 0; 
} 
------------------------------------------------------------ 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bero at arklinux dot org


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


  parent reply	other threads:[~2005-04-27 11:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-26 23:21 [Bug libstdc++/21238] New: conflicting "typedef __numpunct_cache<_CharT> bduerner at gmx dot de
2005-04-26 23:25 ` [Bug libstdc++/21238] conflicting "typedef __numpunct_cache<_CharT> __cache_type;" in std::numpunct<CharT> makes specialization impossible pinskia at gcc dot gnu dot org
2005-04-27  8:24 ` pcarlini at suse dot de
2005-04-27 11:34 ` bduerner at gmx dot de [this message]
2005-04-27 12:13 ` pcarlini at suse dot de
2005-04-29  9:39 ` pcarlini at suse dot de
2005-04-29 10:25 ` pcarlini at suse dot de
2005-04-29 18:51 ` cvs-commit at gcc dot gnu dot org
2005-05-09 19:59 ` cvs-commit at gcc dot gnu dot org
2005-05-09 20:01 ` pcarlini at suse dot de

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=20050427113404.15098.qmail@sourceware.org \
    --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).