-
Notifications
You must be signed in to change notification settings - Fork 289
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
clang notices that constexpr can't be used on a mutating function #1242
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strange, I wonder how that got by the other compilers.
Is the inline
keyword needed since the function definition is inside the class?
Older versions of xcode/clang don't flag it either, and by older, I mean from versions released earlier this year.
|
I found this FAQ from a quick search that looks like the "inline" is not needed when the function is inside the class body: I liked this quote from the description:
|
I looked up the spec ~ https://en.cppreference.com/w/cpp/language/inline ~
Sounds like removing it is fine since We might be forced to move to the out-of-class definition pattern at that point, but I don't want to take on a refactoring of this header to get over this clang-bump. I don't think Spock would approve of his name being used to justify C++ isms. I have it on good authority he programs with a version of |
Codecov Report
@@ Coverage Diff @@
## main #1242 +/- ##
=======================================
Coverage 86.15% 86.15%
=======================================
Files 196 196
Lines 19632 19632
Branches 2302 2302
=======================================
Hits 16913 16913
Misses 2161 2161
Partials 558 558
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
PS, per @darbyjohnston's note, I removed the inline keyword. |
* main: Add Python 3.10 to CI (AcademySoftwareFoundation#1256) Fix missing init metadata (AcademySoftwareFoundation#1251) Support OTIO_PLUGIN_MANIFEST_PATH being set to an emptry string (AcademySoftwareFoundation#1253) Add ALE adapter argument `ale_name_column_key` (AcademySoftwareFoundation#1248) AAF Adapter: Mob transcription heuristics (AcademySoftwareFoundation#1249) Bump src/deps/Imath from `bd6f74c` to `bd254da` (AcademySoftwareFoundation#1245) clang notices that constexpr can't be used on a mutating function (AcademySoftwareFoundation#1242)
) * clang notices that constexpr can't be used on a mutating function * Update src/opentime/rationalTime.h Co-authored-by: Nick Porcino <[email protected]>
This PR fixes an issue raised by the version of Clang bundled with XCode 13.x, see below. Clang correctly notices that constexpr can't be used on a mutating function.