-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Originally reported as DevCom-246257 / internal VSO-275595 by constructing regex{"meow"}, but regex calls use_facet so the repro can be reduced:
Important
This repro requires you to temporarily modify your system's locale settings.
C:\Temp>type meow.cpp
// Settings > Time & language > Date & time > Change the date and time format > Long time
// Change "9:40:07 AM / 2:40:07 PM" to "09:40:07 / 14:40:07"
#include <clocale>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <locale>
#include <thread>
using namespace std;
void run_on_other_thread() {
locale loc{};
(void) use_facet<collate<char>>(loc);
}
int main() {
tm t{};
t.tm_hour = 14;
t.tm_min = 30;
t.tm_sec = 45;
setlocale(LC_ALL, "");
char out1[100];
strftime(out1, sizeof(out1), "%X", &t);
puts(out1);
{
jthread thread(&run_on_other_thread);
}
char out2[100];
strftime(out2, sizeof(out2), "%X", &t);
puts(out2);
if (strcmp(out1, out2) == 0) {
puts("PASS");
} else {
puts("FAIL");
}
}C:\Temp>cl /EHsc /nologo /W4 /std:c++latest /MTd /Od /Zi /Fdmeow.pdb meow.cpp
meow.cpp
C:\Temp>meow
14:30:45
2:30:45 PM
FAIL
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working