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

std::to_chars generates exception code #45361

Closed
hanickadot opened this issue May 21, 2020 · 3 comments
Closed

std::to_chars generates exception code #45361

hanickadot opened this issue May 21, 2020 · 3 comments
Assignees
Labels
bugzilla Issues migrated from bugzilla confirmed Verified by a second party libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

Comments

@hanickadot
Copy link
Contributor

Bugzilla Link 46016
Version 10.0
OS All
CC @ldionne,@mclow

Extended Description

std::to_chars is generating exception handling code, because internals functions are not marked noexcept and clang can't proof they won't throw:

namespace __itoa {
_LIBCPP_FUNC_VIS char* __u64toa(uint64_t __value, char* __buffer);
_LIBCPP_FUNC_VIS char* __u32toa(uint32_t __value, char* __buffer);
}

if you add noexcept there it will generate more efficient code:

https://compiler-explorer.com/z/H29awf

@hanickadot
Copy link
Contributor Author

assigned to @mclow

@ldionne
Copy link
Member

ldionne commented May 21, 2020

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
@llvmbot llvmbot added the confirmed Verified by a second party label Jan 26, 2022
@philnik777
Copy link
Contributor

This bug has been addressed by https://llvm.org/D80379.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla confirmed Verified by a second party libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

No branches or pull requests

4 participants