This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] Base __get_classname on char_class_type.
ClosedPublic

Authored by danalbert on Jul 23 2014, 10:40 AM.

Details

Summary

get_classname() and bracket_expression were assuming that char_class_type was ctype_base::mask rather than using regex_traits<_CharT>::char_class_type.

This change allows char_class_type to be defined to something other than ctype_base::mask so that the implementation will still work for platforms with an 8-bit ctype mask (such as Android and OpenBSD).

Diff Detail

Event Timeline

danalbert updated this revision to Diff 11814.Jul 23 2014, 10:40 AM
danalbert retitled this revision from to [libcxx] Base __get_classname on char_class_type..
danalbert updated this object.
danalbert edited the test plan for this revision. (Show Details)
danalbert added a reviewer: mclow.lists.
danalbert added a subscriber: Unknown Object (MLST).
mclow.lists edited edge metadata.Jul 24 2014, 8:50 AM

This all looks reasonable to me, but I wonder about the class __bracket_expression, which also contains reference to ctype_base::mask.

Should those be changed to std::regex_traits<_CharT>::char_class_type as well?
See lines 2187, 2188, 2284 and 2287 of <regex>

Yeah, those should probably be changed as well. I'll grep around for anything else that's suspicious while I'm at it.

danalbert updated this revision to Diff 11861.Jul 24 2014, 4:30 PM
danalbert updated this object.
danalbert edited edge metadata.

Extend the change to also fix __bracket_expression.

EricWF accepted this revision.Jul 30 2014, 6:51 PM
EricWF edited edge metadata.

Accepting then Closing this. It was commited as r214201.

This revision is now accepted and ready to land.Jul 30 2014, 6:51 PM
EricWF closed this revision.Jul 30 2014, 6:52 PM