<locale>: the enum value of std::money_base is not correct
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 11.1k
- Forks
- 1.7k
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 22
Description
Describe the bug
money_base is defined as follows in C++ standard N3797:
class money_base {
public:
enum part { none, space, symbol, sign, value };
struct pattern { char field[4]; };
};
Command-line test case
1. >type repro.cpp
#include <locale>
#include <iostream>
int main()
{
std::money_base mb;
std::cout << mb.none << std::endl;
std::cout << mb.space << std::endl;
std::cout << mb.symbol<< std::endl;
std::cout << mb.sign << std::endl;
std::cout << mb.value << std::endl;
}
2. >cl /EHsc /W4 /WX .\repro.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.27.29009.1 for x86
Copyright (C) Microsoft Corporation. All rights reserved.
repro.cpp
Microsoft (R) Incremental Linker Version 14.27.29009.1
Copyright (C) Microsoft Corporation. All rights reserved.
/out:repro.exe
repro.obj
3. >.\repro.exe
120
32
36
43
118
Expected behavior
0
1
2
3
4
STL version
Microsoft Visual Studio Community 2019 Preview
Version 16.7.0 Preview 3.0
Additional context
-
Skipped libcxx test:
https://github.com/microsoft/STL/blob/faccf0084ed9b8b58df103358174537233b178c7/tests/libcxx/expected_results.txt#L404-L405 -
Also tracked by Microsoft-internal AB#121977
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce with repro.cpp using the shown cl command, then inspect the implementation of std::money_base and the skipped libcxx result at tests/libcxx/expected_results.txt. Done means the enum members print 0, 1, 2, 3, and 4 as expected and the related libcxx test is no longer skipped.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100