[fileio] fix a clang warning about default ctor + const member #234
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It seems the strict c++ spec used to state that a const class could only be constructed if it had an explicitly define constructor - even if there was an "obvious" default constructor, that wouldn't leave uninitialized items.
A defect was filed, and later accepted:
http://open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#253
...but it seems clang, as of Apple clang version 11.0.0, still warns if
you're using --std=c++11
(GCC lets this pass.)
The full error message I got when compiling (using OSX catalina, Apple clang version 11.0.0), was:
For what it's worth, I only got this when I completely deleted my old build dir, and started a build fresh - perhaps because
PXR_STRICT_BUILD_MODE=OFF
was cached in CMakeCache.txt?Definitely a big fan of PXR_STRICT_BUILD_MODE being on, though - it's going to make for some things to fixup like this, but definitely worth it in the long run!