Home Dashboard Directory Help
Search

This instantiation of std::codecvt template does not meet standard requirements for std::codecvt::out by Seth__


Status: 

Closed
 as Fixed Help for as Fixed


1
0
Sign in
to vote
Type: Bug
ID: 705152
Opened: 11/17/2011 10:17:51 AM
Access Restriction: Public
Moderator Decision: Sent to Engineering Team for consideration
0
Workaround(s)
view
0
User(s) can reproduce this bug

Description

I'm calling the member function 'out' on a particular instantiation of the codecvt template. For this instantiation the behavior of this member function does not match the standard's specifications. The standard states that if 'out' returns the value 'noconv' then the internal character type and the external character type of the codecvt are the same (C++11 § 22.4.1.4.2 p2). I am receiving this return value but the internal and external character types for my codecvt instantiation are not the same.


Here's a snippet of the code I'm using that demonstrates the bug:

        typedef char32_t CharT;
        typedef char_traits<CharT>::state_type StateT;
        typedef codecvt<CharT,char,StateT> CodecvtT;

        std::locale l;
        if (has_facet<CodecvtT>(l))
        {
            CodecvtT const &a_codecvt = use_facet<CodecvtT>(l);
            StateT state = StateT();
            CharT A[] = {'H'};
            CharT const *a;
            char B[4] = {};
            char *b;
            auto result = a_codecvt.out(state,A,A+1,a,B,B+1,b);

            if (CodecvtT::noconv == result)
            {
                assert(typeid(CharT)==typeid(char));
            }
        }


Details
Sign in to post a comment.
Posted by Seth__ on 2/27/2012 at 5:16 PM
As of the VS11 DP I can't see that the behavior of this code has changed at all.
Posted by Microsoft on 1/6/2012 at 5:30 PM
Hi,

Thanks for reporting this bug. We've fixed it, and the fix will be available in VC11.

If you have any further questions, feel free to E-mail me at stl@microsoft.com .

Stephan T. Lavavej
Visual C++ Libraries Developer
Posted by MS-Moderator10 [Feedback Moderator] on 11/17/2011 at 10:07 PM
Thank you for submitting feedback on Visual Studio 2010 and .NET Framework. Your issue has been routed to the appropriate VS development team for investigation. We will contact you if we require any additional information.
Posted by MS-Moderator01 on 11/17/2011 at 6:25 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.