[EMAIL PROTECTED] wrote:
Author: elemings
Date: Thu May 8 10:48:37 2008
New Revision: 654588
URL: http://svn.apache.org/viewvc?rev=654588&view=rev
Log:
2008-05-08 Eric Lemings <[EMAIL PROTECTED]>
STDCXX-905
* branches/4.2.x/tests/localization/22.locale.synopsis.cpp:
Added collate class template specialization for UDC type (just
prior to CollateDerived class template) to define protected
virtual functions expected by test cases.
This change appears to be causing compilation errors with
HP aCC 3.74:
aCC -c -I$(TOPDIR)/include -I$(BUILDDIR)/include
-I$(TOPDIR)/tests/include -AA +O2 +w +W392,655,684,818,819,849
$(TOPDIR)/tests/localization/22.locale.synopsis.cpp
Error 173: "$(TOPDIR)/tests/localization/22.locale.synopsis.cpp", line
1349 # Redefined symbol 'collate<int>'; previously defined at
["$(TOPDIR)/include/loc/_collate.h", line 58].
struct collate<UDC>: locale::facet
^^^^^^^^^^^^^^^^^^^
Error 705: "$(TOPDIR)/tests/localization/22.locale.synopsis.cpp", line
1348 # A template must be declared before it can be explicitly specialized.
_RWSTD_SPECIALIZED_CLASS
^^^^^^^^^^^^^^^^^^^^^^^^
Error 445: "$(TOPDIR)/tests/localization/22.locale.synopsis.cpp", line
1348 # Cannot recover from earlier errors.
_RWSTD_SPECIALIZED_CLASS
^^^^^^^^^^^^^^^^^^^^^^^^
gmake: *** [22.locale.synopsis.o] Error 2
Martin
Modified:
stdcxx/branches/4.2.x/tests/localization/22.locale.synopsis.cpp
Modified: stdcxx/branches/4.2.x/tests/localization/22.locale.synopsis.cpp
URL:
http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/localization/22.locale.synopsis.cpp?rev=654588&r1=654587&r2=654588&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/tests/localization/22.locale.synopsis.cpp (original)
+++ stdcxx/branches/4.2.x/tests/localization/22.locale.synopsis.cpp Thu May 8
10:48:37 2008
@@ -1342,6 +1342,53 @@
// collate category
+_RWSTD_NAMESPACE (std) {
+
+// class template specialization for UDC type
+_RWSTD_SPECIALIZED_CLASS
+struct collate<UDC>: locale::facet
+{
+ typedef UDC char_type;
+ typedef basic_string<UDC> string_type;
+
+ static locale::id id;
+
+ int
+ compare (const char_type* begin1, const char_type* end1,
+ const char_type* begin2, const char_type* end2) const {
+ return do_compare (begin1, end1, begin2, end2) ;
+ }
+
+protected:
+
+ // define (no-op) virtual functions for UDC type
+ virtual int
+ do_compare (const char_type*, const char_type*,
+ const char_type*, const char_type*) const
+ {
+ return int ();
+ }
+
+ virtual string_type
+ do_transform (const char_type*, const char_type*) const
+ {
+ return string_type ();
+ }
+
+
+ virtual long
+ do_hash (const char_type*, const char_type*) const
+ {
+ return long ();
+ }
+
+};
+
+locale::id collate<UDC>::id;
+
+} // namespace std
+
+
template <class charT>
struct CollateDerived: std::collate<charT>
{