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

color.h fails to compile with clang #1063

Closed
riccozzz opened this issue Mar 3, 2019 · 2 comments
Closed

color.h fails to compile with clang #1063

riccozzz opened this issue Mar 3, 2019 · 2 comments

Comments

@riccozzz
Copy link
Contributor

riccozzz commented Mar 3, 2019

This godbolt example does not compile with any version of clang with the latest version of the library. The code in question I believe was introduced in #994.

/opt/compiler-explorer/libs/fmt/trunk/include/fmt/color.h:517:35: error: invalid application of 'sizeof' to an incomplete type 'const char []'
  const char* end = begin + sizeof(data::RESET_COLOR) - 1;

Compiles without issue with gcc, icc, MSVC, ect, and 5.3.0 works fine. Though it does compile in header only mode.

@mwinterb
Copy link
Contributor

mwinterb commented Mar 4, 2019

VS2019 preview also fails with this. I had been holding off reporting it since I wasn't sure if that was because of a bug in the preview or not as clang-cl was compiling it just fine.

mwinterb added a commit to mwinterb/fmt that referenced this issue Mar 6, 2019
This is so that the format with a text_tyle will compile even if
header-only mode isn't enabled. Addresses fmtlib#1063.
vitaut pushed a commit that referenced this issue Mar 6, 2019
This is so that the format with a text_tyle will compile even if
header-only mode isn't enabled. Addresses #1063.
@vitaut
Copy link
Contributor

vitaut commented Mar 6, 2019

Fixed by #1068.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants