This is the mail archive of the libstdc++@sourceware.cygnus.com mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: potential identifier collision in locale_facets.h



hi -

Just found a problem with the patch i sent earlier today to locale_facets.h:
the types need to be declared public.  Here's an updated patch.  Sorry
for the confusion.

thanks,
sss


2000-03-13  scott snyder  <snyder@fnal.gov>

	* bits/locale_facets.h (class ctype, class ctype<char>, class
	ctype<wchar_t>): More mask fixes.
	* testsuite/22_locale/ctype.cc: Test for the problem.


Index: bits/locale_facets.h
===================================================================
RCS file: /cvs/libstdc++/libstdc++/bits/locale_facets.h,v
retrieving revision 1.20
diff -u -p -r1.20 locale_facets.h
--- locale_facets.h	2000/03/09 20:42:16	1.20
+++ locale_facets.h	2000/03/13 23:36:47
@@ -209,10 +209,11 @@ namespace std
   template<typename _CharT>
     class ctype : public _Ctype<_CharT>
     {
+    public:
       // Types:
       typedef _CharT 					char_type;
+      typedef typename _Ctype_nois<_CharT>::mask 	mask;
 
-    public:
       explicit 
       ctype(size_t __refs = 0) : _Ctype<_CharT>(__refs) { }
 
@@ -303,9 +304,11 @@ namespace std
   template<>
     class ctype<char> : public _Ctype_nois<char>
     {
+    public:
       // Types:
       typedef char 					char_type;
       typedef size_t					__table_type;
+      typedef _Ctype_nois<char>::mask 			mask;
 
     private:
       // Data Members:
@@ -383,9 +386,11 @@ namespace std
   template<>
     class ctype<wchar_t> : public _Ctype<wchar_t>
     {
+    public:
      // Types:
       typedef wchar_t 					char_type;
       typedef size_t					__table_type;
+      typedef _Ctype_nois<wchar_t>::mask 		mask;
 
     private:
       __to_type const& 		_M_toupper;
Index: testsuite/22_locale/ctype.cc
===================================================================
RCS file: /cvs/libstdc++/libstdc++/testsuite/22_locale/ctype.cc,v
retrieving revision 1.2
diff -u -p -r1.2 ctype.cc
--- ctype.cc	1999/11/19 09:09:11	1.2
+++ ctype.cc	2000/03/13 23:37:05
@@ -20,6 +20,10 @@
 
 // 22.2.1 the ctype category
 
+// Test that the locale headers are picking up the correct declaration
+// of the internal type `ctype_base::mask'.
+int mask ();
+
 #include <locale>
 
 // 1 should be able to instantiate this for other types besides char, wchar_t

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]