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

libc++ rejects std::format("{{:{}^1}}", ' ') #60536

Closed
hewillk opened this issue Feb 5, 2023 · 2 comments
Closed

libc++ rejects std::format("{{:{}^1}}", ' ') #60536

hewillk opened this issue Feb 5, 2023 · 2 comments
Assignees
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

Comments

@hewillk
Copy link

hewillk commented Feb 5, 2023

The following valid format strings are rejected by libc++.

#include <format>
#include <iostream>

int main() {
  std::cout << std::format("{{:{}^5}}", ' ');
}

https://godbolt.org/z/9bsPP7bjq

@EugeneZelenko EugeneZelenko added libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. and removed new issue labels Feb 5, 2023
@mordante mordante self-assigned this Feb 6, 2023
@mordante
Copy link
Member

mordante commented Feb 6, 2023

Thanks for the report. Indeed the constexpr validation code had a bug. I've created a fix https://reviews.llvm.org/D143402.

@mordante
Copy link
Member

mordante commented Feb 7, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

No branches or pull requests

3 participants