Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<vcruntime_exception.h>: std::exception::what is not marked noexcept #2089

Closed
fsb4000 opened this issue Aug 1, 2021 · 1 comment
Closed
Labels
duplicate This issue or pull request already exists

Comments

@fsb4000
Copy link
Contributor

fsb4000 commented Aug 1, 2021

Describe the bug
https://en.cppreference.com/w/cpp/error/exception/what says virtual const char* what() const noexcept;
but it is not:
изображение

test case

C:\Temp>type repro.cpp
#include <exception>
#include <stdio.h>

void myfunc() noexcept {
  try {
    // do work
    throw std::exception("my text");
  }
  catch (const std::exception& err) {
    printf("%s", err.what());
  }
}

int main() noexcept {
  myfunc();
}

Build from IDE:

изображение

Expected behavior
It should be marked noexcept and no warning should be generated.

STL version
Microsoft Visual Studio Community 2022 Preview Version 17.0.0 Preview 2.1

Additional context
DevCom-1491683

P.S. I know that <vcruntime_exception.h> is not a part of the repo. But as far as I understood it will be soon. So I decided to create the issue.

@AlexGuteniev
Copy link
Contributor

Duplicate of #948

@fsb4000 fsb4000 closed this as completed Aug 3, 2021
@StephanTLavavej StephanTLavavej added the duplicate This issue or pull request already exists label Aug 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants