From 5747b06b8dd7dc366994d55c4af7d905bb3af7c9 Mon Sep 17 00:00:00 2001 From: Paul Molodowitch Date: Fri, 31 Jan 2020 10:47:26 -0800 Subject: [PATCH] [fileio] fix a clang warning about default ctor + const member 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.) --- lib/fileio/primUpdater.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/fileio/primUpdater.h b/lib/fileio/primUpdater.h index 928d2f27d3..4115ab74cc 100644 --- a/lib/fileio/primUpdater.h +++ b/lib/fileio/primUpdater.h @@ -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 {