<exception>: std::exception::what has wrong signature
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 11.2k
- Forks
- 1.7k
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 22
Description
Describe the bug
std::exception::what is not noexcept.
See also #882 - should probably be fixed together. #808 is also in similar area
Command-line test case
d:\Temp2>type repro.cpp
#include <cstdio>
#include <exception>
int main()
{
auto b = noexcept(std::exception{}.what());
std::printf("%d\n", (int)b);
}
d:\Temp2>cl /EHsc /permissive- /std:c++latest /Zc:__cplusplus /Zc:externConstexpr repro.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.27.29009.1 for x86
Copyright (C) Microsoft Corporation. All rights reserved.
/std:c++latest is provided as a preview of language features from the latest C++
working draft, and we're eager to hear about bugs and suggestions for improvements.
However, note that these features are provided as-is without support, and subject
to changes or removal as the working draft evolves. See
https://go.microsoft.com/fwlink/?linkid=2045807 for details.
repro.cpp
Microsoft (R) Incremental Linker Version 14.27.29009.1
Copyright (C) Microsoft Corporation. All rights reserved.
/out:repro.exe
repro.obj
d:\Temp2>.\repro.exe
0
Expected behavior
Should print 1 as ctor is noexcept.
STL version
Microsoft Visual Studio Professional 2019 Preview
Version 16.7.0 Preview 3.1
Additional context
This item is also tracked on Developer Community as DevCom-785027 and by Microsoft-internal VSO-1006425 / AB#1006425.
vNext note: Resolving this issue will require breaking binary compatibility. We won't be able to accept pull requests for this issue until the vNext branch is available. See #169 for more information.
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
Start with the command-line reproduction in repro.cpp and confirm that noexcept(std::exception{}.what()) currently prints 0. Read the related issues #882 and #808, then check the vNext branch and the binary-compatibility guidance in #169. Done means the test prints 1 without violating the stated compatibility constraints.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 20/100