View Issue Details

IDProjectCategoryView StatusLast Update
0002387NoesisGUIC++ SDKpublic2022-07-28 20:22
Reporterpdx_lysannschlegel Assigned Tojsantos  
PrioritynormalSeverityminor 
Status resolvedResolutionfixed 
Product Version3.1.4 
Target Version3.1.6Fixed in Version3.1.6 
Summary0002387: clang warnings in NsMath/Vector.h and NsMath/Transform.h (deprecated-copy)
Description

When building anything that includes NsMath/Vector.h or NsMath/Transform.h with Xcode clang version at least 14, and -Wdeprecated-copy enabled, the warning is triggered in several places:

NsMath/Vector.h:30:5: error: definition of implicit copy assignment operator for 'Vector2' is deprecated because it has a user-declared copy constructor [-Werror,-Wdeprecated-copy]
Vector2(const Vector2& v) = default;
^
NsMath/Matrix.inl:16:13: note: in implicit copy assignment operator for 'Noesis::Vector2' first required here
mVal[0] = Vector2(v00, v01);
^
NsMath/Vector.h:99:5: error: definition of implicit copy assignment operator for 'Vector3' is deprecated because it has a user-declared copy constructor [-Werror,-Wdeprecated-copy]
Vector3(const Vector3& v) = default;
^
NsMath/Matrix.inl:244:13: note: in implicit copy assignment operator for 'Noesis::Vector3' first required here
mVal[0] = Vector3(v00, v01, v02);
^
NsMath/Vector.h:168:5: error: definition of implicit copy assignment operator for 'Vector4' is deprecated because it has a user-declared copy constructor [-Werror,-Wdeprecated-copy]
Vector4(const Vector4& v) = default;
^
NsMath/Matrix.inl:612:13: note: in implicit copy assignment operator for 'Noesis::Vector4' first required here
mVal[0] = Vector4(v00, v01, v02, v03);
^
NsMath/Transform.h:31:5: error: definition of implicit copy assignment operator for 'Transform2' is deprecated because it has a user-declared copy constructor [-Werror,-Wdeprecated-copy]
Transform2(const Transform2& m) = default;
^
NsMath/Transform.inl:126:11: note: in implicit copy assignment operator for 'Noesis::Transform2' first required here
this = PostTrans(this, -centerX, -centerY);
^

The above output is when building with version 3.1.4, but I did a quick check and looks like 3.1.5 headers still look the same, I just haven't tested it.

This issue is especially annoying when building with -Werror. Of course, we can work around it by disabling the warning before including these, but would be nice if it wasn't required.

Steps To Reproduce

I don't have very easy steps to reproduce but the warning should be pretty clear as to what's wrong.
But the general idea should be:

  1. Set up a C++ project, set to compile with clang on Xcode 14, and enable -Wdeprecated-copy (and optionally -Werror) compiler flags.
  2. Include NsMath/Vector.h or Transform.h in any file that builds with these warning flags enabled.
  3. Compile.

Potentially this can be reproduced with older clang versions or non Xcode clang as well, but I cannot currently test this.

PlatformmacOS

Activities

jsantos

jsantos

2022-07-28 20:22

manager   ~0008036

I was only able to reproduce this with the latest beta of Xcode 14 (b4).

These warnings and more issues related to clang14 has been fixed in r11522

Thanks for your great feedback!

Issue History

Date Modified Username Field Change
2022-07-26 15:51 pdx_lysannschlegel New Issue
2022-07-27 09:14 jsantos Assigned To => jsantos
2022-07-27 09:14 jsantos Status new => assigned
2022-07-27 09:14 jsantos Target Version => 3.1.6
2022-07-28 20:22 jsantos Status assigned => resolved
2022-07-28 20:22 jsantos Resolution open => fixed
2022-07-28 20:22 jsantos Fixed in Version => 3.1.6
2022-07-28 20:22 jsantos Note Added: 0008036