-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
MSVC STL's time_get::do_get doesn't know the %% specifier. It should recognize this specifier and consume a literal %.
Command-line test case
D:\test>type test-time-get-do-get.cpp
#include <cassert>
#include <ctime>
#include <iomanip>
#include <sstream>
int main() {
std::tm t{};
std::stringstream ss{"% "};
ss >> std::get_time(&t, "%%");
assert(!ss.fail());
}D:\test>cl /EHsc test-time-get-do-get.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.50.35725 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
test-time-get-do-get.cpp
Microsoft (R) Incremental Linker Version 14.50.35725.0
Copyright (C) Microsoft Corporation. All rights reserved.
/out:test-time-get-do-get.exe
test-time-get-do-get.obj
D:\test>test-time-get-do-get.exe
Assertion failed: !ss.fail(), file test-time-get-do-get.cpp, line 10
Expected behavior
Assertion passed.
STL version
Additional context
Both #6129 and this issue concern time_get::do_get (and affect the same libcxx test file), but they can be fixed independently.
In fact, IMO this issue is much easier to fix and could be a "good first issue".
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working