From c7e2dba59a4b35a09c955a21194a6bcd996990a5 Mon Sep 17 00:00:00 2001 From: Benjamin Kosnik Date: Wed, 31 Oct 2001 20:05:33 +0000 Subject: [PATCH] codecvt.h: Add virtual member function declarations. 2001-10-31 Benjamin Kosnik libstdc++/4749 * include/bits/codecvt.h: Add virtual member function declarations. * src/codecvt.cc: Tweaks. * testsuite/22_locale/codecvt.cc: Test compilation only, non-required facets not required to have linkage. From-SVN: r46685 --- libstdc++-v3/ChangeLog | 8 +++++ libstdc++-v3/include/bits/codecvt.h | 33 ++++++++++++++++++--- libstdc++-v3/src/codecvt.cc | 18 +++++------ libstdc++-v3/testsuite/22_locale/codecvt.cc | 2 ++ 4 files changed, 47 insertions(+), 14 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index db31eeecc18..bf6780e8de2 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,11 @@ +2001-10-31 Benjamin Kosnik + + libstdc++/4749 + * include/bits/codecvt.h: Add virtual member function declarations. + * src/codecvt.cc: Tweaks. + * testsuite/22_locale/codecvt.cc: Test compilation only, + non-required facets not required to have linkage. + 2001-10-31 Edward E. Meyer libstdc++/4622 diff --git a/libstdc++-v3/include/bits/codecvt.h b/libstdc++-v3/include/bits/codecvt.h index 448cffacdf6..441f40c9fe3 100644 --- a/libstdc++-v3/include/bits/codecvt.h +++ b/libstdc++-v3/include/bits/codecvt.h @@ -171,6 +171,35 @@ protected: virtual ~codecvt() { } + + virtual result + do_out(state_type& __state, const intern_type* __from, + const intern_type* __from_end, const intern_type*& __from_next, + extern_type* __to, extern_type* __to_end, + extern_type*& __to_next) const; + + virtual result + do_unshift(state_type& __state, extern_type* __to, + extern_type* __to_end, extern_type*& __to_next) const; + + virtual result + do_in(state_type& __state, const extern_type* __from, + const extern_type* __from_end, const extern_type*& __from_next, + intern_type* __to, intern_type* __to_end, + intern_type*& __to_next) const; + + virtual int + do_encoding() const throw(); + + virtual bool + do_always_noconv() const throw(); + + virtual int + do_length(const state_type&, const extern_type* __from, + const extern_type* __end, size_t __max) const; + + virtual int + do_max_length() const throw(); }; template @@ -302,7 +331,3 @@ #endif #endif // _CPP_BITS_CODECVT_H - - - - diff --git a/libstdc++-v3/src/codecvt.cc b/libstdc++-v3/src/codecvt.cc index 3a798fc5182..5e7cdb69bdb 100644 --- a/libstdc++-v3/src/codecvt.cc +++ b/libstdc++-v3/src/codecvt.cc @@ -46,7 +46,7 @@ namespace std codecvt_base::result codecvt:: - do_out(state_type& /*__state*/, const intern_type* __from, + do_out(state_type&, const intern_type* __from, const intern_type* __from_end, const intern_type*& __from_next, extern_type* __to, extern_type* __to_end, extern_type*& __to_next) const @@ -60,8 +60,8 @@ namespace std codecvt_base::result codecvt:: - do_unshift(state_type& /*__state*/, extern_type* __to, - extern_type* /*__to_end*/, extern_type*& __to_next) const + do_unshift(state_type&, extern_type* __to, + extern_type*, extern_type*& __to_next) const { __to_next = __to; return noconv; @@ -69,7 +69,7 @@ namespace std codecvt_base::result codecvt:: - do_in(state_type& /*__state*/, const extern_type* __from, + do_in(state_type&, const extern_type* __from, const extern_type* __from_end, const extern_type*& __from_next, intern_type* __to, intern_type* __to_end, intern_type*& __to_next) const @@ -93,7 +93,7 @@ namespace std int codecvt:: - do_length (const state_type& /*__state*/, const extern_type* __from, + do_length (const state_type&, const extern_type* __from, const extern_type* __end, size_t __max) const { return min(__max, static_cast(__end - __from)); } @@ -142,8 +142,8 @@ namespace std codecvt_base::result codecvt:: - do_unshift(state_type& /*__state*/, extern_type* __to, - extern_type* /*__to_end*/, extern_type*& __to_next) const + do_unshift(state_type&, extern_type* __to, + extern_type*, extern_type*& __to_next) const { __to_next = __to; return noconv; @@ -190,7 +190,7 @@ namespace std int codecvt:: - do_length(const state_type& /*__state*/, const extern_type* __from, + do_length(const state_type&, const extern_type* __from, const extern_type* __end, size_t __max) const { return min(__max, static_cast(__end - __from)); } @@ -200,5 +200,3 @@ namespace std { return 1; } #endif // _GLIBCPP_USE_WCHAR_T } // namespace std - - diff --git a/libstdc++-v3/testsuite/22_locale/codecvt.cc b/libstdc++-v3/testsuite/22_locale/codecvt.cc index 19dc2717681..a4670b7c9b5 100644 --- a/libstdc++-v3/testsuite/22_locale/codecvt.cc +++ b/libstdc++-v3/testsuite/22_locale/codecvt.cc @@ -20,6 +20,8 @@ // 22.2.1.5 Template class codecvt +// { dg-do compile } + #include void test01() -- 2.30.2