MantisBT
Mantis Bug Tracker Workflow

View Revisions: Issue #30683 All Revisions ] Back to Issue ]
Summary 0030683: Coding Rules - eliminate CLang compiler warnings -Wreturn-std-move
Revision 2019-04-30 13:12 by kgv
Description CLang (XCode 10.2) generates the following compiler warnings in a numerous (100+) places:
Apple LLVM version 10.0.1 (clang-1001.0.46.3)
Target: x86_64-apple-darwin18.5.0
...
/Users/kgv/Develop/occt.git/src/BRepTools/BRepTools_Quilt.cxx:527: warning: local variable 'result' will 
be copied despite being returned by name [-Wreturn-std-move]
  return result;
         ^~~~~~


The usual location for this warning in OCCT is a function returning TopoDS_Shape from a local variable declared as TopoDS_Compound.

Note that motivation around -Wreturn-std-move in CLang seems to be unrelated to warning appearance in OCCT - hence might be a compiler bug.
Although the rationale can be found - indeed, all sub-classes of TopoDS_Shape a dummy and can be used for moving to TopoDS_Shape without copy.

It might be reasonable also marking TopoDS_Shape sub-classes as final classes.
Revision 2019-04-30 13:10 by kgv
Description CLang (XCode 10.2) generates the following compiler warnings in a numerous (100+) places:
Apple LLVM version 10.0.1 (clang-1001.0.46.3)
Target: x86_64-apple-darwin18.5.0
...
/Users/kgv/Develop/occt.git/src/BRepTools/BRepTools_Quilt.cxx:527: warning: local variable 'result' will 
be copied despite being returned by name [-Wreturn-std-move]
  return result;
         ^~~~~~


The usual location for this warning in OCCT is a function returning TopoDS_Shape from a local variable declared as TopoDS_Compound.

Note that motivation around -Wreturn-std-move in CLang seems to be unrelated to warning appearance in OCCT - hence might be a compiler bug.
Although the rationale can be found - indeed, all sub-classes of TopoDS_Shape a dummy and can be used for moving to TopoDS_Shape without copy.
Revision 2019-04-30 13:10 by kgv
Description CLang (XCode 10.2) generates the following compiler warnings in a numerous (100+) places:
Apple LLVM version 10.0.1 (clang-1001.0.46.3)
Target: x86_64-apple-darwin18.5.0
...
/Users/kgv/Develop/occt.git/src/BRepTools/BRepTools_Quilt.cxx:527: warning: local variable 'result' will 
be copied despite being returned by name [-Wreturn-std-move]
  return result;
         ^~~~~~


The usual location for this warning in OCCT is a function returning TopoDS_Shape from a local variable declared as TopoDS_Compound.

Note that motivation around -Wreturn-std-move in CLang seems to be unrelated to warning appearance in OCCT - hence might be a compiler bug. Although the rationale can be found - indeed, all sub-classes of TopoDS_Shape a dummy and can be used for moving to TopoDS_Shape without copy.
Revision 2019-04-29 19:17 by kgv
Description CLang (XCode 10.2) generates the following compiler warnings in a numerous places:
Apple LLVM version 10.0.1 (clang-1001.0.46.3)
Target: x86_64-apple-darwin18.5.0
...
/Users/kgv/Develop/occt.git/src/BRepTools/BRepTools_Quilt.cxx:527: warning: local variable 'result' will 
be copied despite being returned by name [-Wreturn-std-move]
  return result;
         ^~~~~~
Revision 2019-04-29 19:17 by kgv
Description CLang generates the following compiler warnings in a numerous places:
Apple LLVM version 10.0.1 (clang-1001.0.46.3)
Target: x86_64-apple-darwin18.5.0
...
/Users/kgv/Develop/occt.git/src/BRepTools/BRepTools_Quilt.cxx:527: warning: local variable 'result' will 
be copied despite being returned by name [-Wreturn-std-move]
  return result;
         ^~~~~~


Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker