Skip to content

Commit

Permalink
[fileio] fix a clang warning about default ctor + const member
Browse files Browse the repository at this point in the history
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.)
  • Loading branch information
pmolodo committed Jan 31, 2020
1 parent ec6750b commit 5747b06
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/fileio/primUpdater.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ class UsdMayaPrimUpdater
UsdMayaPrimUpdater(const MFnDependencyNode& depNodeFn,
const SdfPath& usdPath);

UsdMayaPrimUpdater() = default;
// clang errors if you use "= default" here, due to const SdfPath member
// see: http://open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#253
// ...which it seems clang only implements if using newer version + cpp std
UsdMayaPrimUpdater() {}

virtual ~UsdMayaPrimUpdater() = default;

enum class Supports {
Expand Down

0 comments on commit 5747b06

Please sign in to comment.