Bug 58083
Summary: | bastring.h:342: .c_str() error for wchar_t template instance | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Retired] Red Hat Linux | Reporter: | Need Real Name <jfox> | ||||||
Component: | gcc | Assignee: | Jakub Jelinek <jakub> | ||||||
Status: | CLOSED NOTABUG | QA Contact: | Brian Brock <bbrock> | ||||||
Severity: | medium | Docs Contact: | |||||||
Priority: | medium | ||||||||
Version: | 8.0 | CC: | mseitz | ||||||
Target Milestone: | --- | ||||||||
Target Release: | --- | ||||||||
Hardware: | All | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2004-10-01 15:22:54 UTC | Type: | --- | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Attachments: |
|
Description
Need Real Name
2002-01-08 04:38:04 UTC
Created attachment 41972 [details]
Sample file showing compile error for basic_string<wchar_t>.c_str()
Created attachment 94273 [details]
Allow basic_string::c_str to work with all character types
I am having the same problem with "basic_string<unsigned char>" on Red Hat 7.3
(libstdc++-devel-2.96-113, /usr/include/g++-3/std/bastring.h:343). The
attached patch fixes this problem.
The "component" field of this bug report should be changed to "libstdc++". This is a feature request: gcc pre 3.0 didn't support wstring. Testcase is in error: basic_string::c_str() returns const _CharT* not _CharT*. With this testcase, gcc-3.2, gcc-3.3, gcc-3.4 pass. #include <wchar.h> #include <stdio.h> #include <string> int main(int, char**) { std::basic_string<wchar_t> wsTest(L"This is a test string"); const wchar_t *pwcTest = wsTest.c_str(); printf("The pointer to the wide character string is %p\n", pwcTest); return 0; } |