This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFH] Update on collate_members_wchar_t.cc


Hi all,

after Jakub patch, things are becoming clearer, but this testsuite file still
fails :-( albeit in a different way: it turns out that the VERIFY at line 129
used to pass by shear chance. Now we are back, I think, to a "pure v3"-bug, but
a very tough one. This is the reduced testcase I'm playing with:

///////////////////////////////
#include <locale>
#include <cassert>

int main()
{
  using namespace std;

  locale loc_de("de_DE");
  const collate<wchar_t>& coll_de = use_facet<collate<wchar_t> >(loc_de);

  int i1, i2;

  const wchar_t* strlit3 = L"a";
  const wchar_t* strlit4 = L"m";

  wstring str3 = coll_de.transform(strlit3, strlit3 + 1);
  wstring str4 = coll_de.transform(strlit4, strlit4 + 1);

  i1 = coll_de.compare(str3.c_str(), str3.c_str() + str3.size(),
         str4.c_str(), str4.c_str() + str4.size());
  i2 = coll_de.compare(strlit3, strlit3 + 1, strlit4, strlit4 + 1);

  assert(i1 == i2);
}
////////////////////////////////

The correct result is -1 (i2 == -1), but processing via transform leads
incorrectly to (i1 == +1). This should be reproducable on many different
platforms.

RFH == Request For Help ;)

Ciao, Paolo.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]