-
Notifications
You must be signed in to change notification settings - Fork 608
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
default initialization of an object of const type 'const struct (anonymous struct at ./hb-algs.hh:35:14)' without a user-provided default constructor #1651
Comments
Sounds like a compiler bug. I don't think that's a requirement of the language. We have dozens o bots which build this happily. If you can suggest a simple workaround, we'd be happy to take in. Not adding constructors though, which would be unnecessary and add up to the library static initialization (which we prohibit). |
Yeah but that's adding constructor, which is option I prefer not to do. I'm sure there's some other way... I mean, technically we are not even using the 'const' part. |
Okay looks like this was a fault in the standard indeed: I'm fine dropping the const. Or maybe I add a macro: which would drop the const on affected compilers. |
@ebraminio reason to add that macro we were talking about the other day. ^^ |
Sorry, I meant to respond earlier after I found that Stack Overflow thread you mentioned above. I also did some further testing, and just to give you an idea of the compiler versions affected, I observed the error on the following compilers included with Xcode:
I also tested a couple compiler versions in MacPorts, which did not exhibit the error:
|
Just sending this to bots to see if all happy, then turn it into macro and apply everywhere. Part of #1651
what do you think about tagging a patch version, like 2.4.1? |
Does it work for you? Last time we had some hiccups making a release. I'll make one soonish. |
Now, I receive the following error ./hb-array.hh:303:3: error: invalid operands to binary expression ('decltype((rhs(lhs)))' (aka 'hb_map_iter_t<hb_array_t<const char>, <anonymous struct at ./hb-algs.hh:49:1> &>') and 'hb_reduce_t<<lambda at ./hb-array.hh:303:16>, int>')
| hb_reduce ([] (uint32_t a, uint32_t b) -> uint32_t { return a * 31 + b; }, 0)
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ with Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)� and macOS 10.9. |
Yes, I agree with @ra1nb0w, an error like that does occur with Apple LLVM version 6.0 (clang-600.0.57) on OS X 10.9. Here is a build failure log for harfbuzz 2.5.1 on that system. It builds fine with Apple LLVM version 7.0.2 (clang-700.1.81) on OS X 10.10 and on later systems. |
If there's something that you think should be fixed, please file a new issue. |
Hello,
harfbuzz 2.4.0 fails to build on OS X 10.11 El Capitan with Xcode 7.3.1 and its clang 703.0.31; the first errors look like this:
Is this something that can/should be changed in harfbuzz, or does Harfbuzz now require a newer compiler?
It builds fine on macOS 10.12 Sierra with Xcode 8.3.3 and its clang 802.0.42.
I didn't see anything about compiler requirements in README.md or BUILD.md; maybe something could be added; I know you mentioned you're using C++11 now.
The text was updated successfully, but these errors were encountered: