Opened 13 years ago
Closed 13 years ago
#3067 closed Bugs (fixed)
[regex] regression test failures on VC10 beta 1
Reported by: | Owned by: | John Maddock | |
---|---|---|---|
Milestone: | Boost 1.40.0 | Component: | regex |
Version: | Boost Development Trunk | Severity: | Problem |
Keywords: | Cc: |
Description
The regex regression tests are pretty much all failing in VC 10 beta 1, due to the 'stdext' namespace not being defined. e.g.
Looking at the VC10 <algorithm> header, there is no mention of stdext any more.
Attachments (2)
Change History (11)
comment:1 by , 13 years ago
comment:2 by , 13 years ago
_STDEXT is defined after including <algorithm> (it's defined in yvals.h), but is no longer used in the <algorithm> header.
The beta documentation @ http://msdn.microsoft.com/en-us/library/aa985849(VS.100).aspx describes unchecked_copy but it doesn't exist in the installed headers. I assume that this is a case of the docs having not been updated yet, but i'll open a ticket on MS Connect to confirm that it's intentional.
by , 13 years ago
Attachment: | regex_workaround-vc10.patch added |
---|
comment:3 by , 13 years ago
Can you give the attached patch a test?
Unfortunately if MS has retained the old safe/non-standard algorithms then this may not compile either :-(
Thanks, John.
comment:4 by , 13 years ago
I've done a few more tests with this, and found the following:
Your patch fixes the initial errors, but the compile still fails with a number of other errors (see the attached logs for full details).
The first errors are :
wc_regex_traits.cpp(48) : error C2910: 'std::char_traits<unsigned short>::length' : cannot be explicitly specialized usinstances.cpp(47) : error C2910: 'std::char_traits<unsigned short>::length' : cannot be explicitly specialized
Removing those workarounds allows the code to compile, but results in linker errors. e.g.:
w32_regex_traits.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >(unsigned short const *)" (__imp_??0?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@PBG@Z) referenced in function "class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > __cdecl boost::re_detail::w32_cat_get(class boost::shared_ptr<void> const &,unsigned long,int,class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > const &)" (?w32_cat_get@re_detail@boost@@YA?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@ABV?$shared_ptr@X@2@KHABV34@@Z)
Looking at the VC10 headers, i see that they contain definitions for std::u16string (where u16string is basic_string<char16_t> and char16_t is an unsigned short), so i'm thinking that theres a clash between the definitions.
Indeed, removing all the workarounds from the 2 cpp files mentioned above along with the 'extern template...' on line 169 of regex/config.hpp seems to fix the failures.
comment:5 by , 13 years ago
I opened a ticked about the stdext issue @ http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=456327, and it's just been updated by MS with a comment about the changes they're thinking about and a request for info.
Do you have any comments about the Boost usage or requirements?
Thanks, Richard Webb
comment:6 by , 13 years ago
Apologies, I've let this one drop off my radar :-(
The reason I started using these functions in the first place, was that VC++ would fail to compile std conforming code, if a user-defined OutputIterator was passed to certain std lib algorithms. Since the additional requirements on an OutputIterator to make it "safe" weren't documented, the only alternative was to use the unchecked_* functions as a workaround :-(
If the new versions will accept any OutputIterators, including ones the implementation knows nothing about, then I'd be happy.
HTH, John.
comment:7 by , 13 years ago
The recent changes to the regex code allow it to compile, but it still fails to link.
it links ok if the
extern template class declspec(dllimport) std::basic_string<unsigned short>;
on line 169 of regex/config.hpp is removed.
comment:9 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
What happened to unchecked_equal and unchecked_copy then? Or have these been removed?
Is the macro _STDEXT still defined after including <algorithm>
Thanks, John.