[Libreoffice-commits] core.git: compilerplugins/clang slideshow/source sw/inc sw/source writerfilter/source

2021-10-15 Thread Stephan Bergmann (via logerrit)
 compilerplugins/clang/test/unnecessaryoverride-dtor.cxx |4 +-
 compilerplugins/clang/unnecessaryoverride.cxx   |6 ++-
 slideshow/source/engine/opengl/TransitionImpl.hxx   |   27 +++-
 sw/inc/swcrsr.hxx   |8 +++-
 sw/source/core/layout/layhelp.hxx   |   12 +--
 writerfilter/source/dmapper/DomainMapper_Impl.hxx   |   14 
 6 files changed, 49 insertions(+), 22 deletions(-)

New commits:
commit af908d9f18fbb83a5c393f856026cebefd821f18
Author: Stephan Bergmann 
AuthorDate: Fri Oct 15 10:33:07 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Oct 15 13:20:21 2021 +0200

Avoid usage of incomplete types in member functions defined in-class

...that started to fail now at least with clang-cl (where the MSVC rules 
when to
emit inline member function definitions are more aggressive than for other 
ABIs)
with --with-latest-c++ and --with-visual-studio=2022 (where usage of 
incomplete
types in std::vector now triggered

> In file included from 
C:/lo-clang/core/slideshow/source/engine/opengl/TransitionerImpl.cxx:31:
> In file included from 
C:/PROGRA~1/MIB055~1/2022/Preview/VC/Tools/MSVC/1430~1.305/Include\memory:11:
> In file included from 
C:/PROGRA~1/MIB055~1/2022/Preview/VC/Tools/MSVC/1430~1.305/Include\exception:12:
> 
C:/PROGRA~1/MIB055~1/2022/Preview/VC/Tools/MSVC/1430~1.305/Include\type_traits(744,50):
 error: incomplete type 'Primitive' used in type trait expression
> struct is_trivially_destructible : 
bool_constant<__is_trivially_destructible(_Ty)> {
>  ^
> 
C:/PROGRA~1/MIB055~1/2022/Preview/VC/Tools/MSVC/1430~1.305/Include\type_traits(59,53):
 note: in instantiation of template class 
'std::is_trivially_destructible' requested here
> struct conjunction<_First, _Rest...> : _Conjunction<_First::value, 
_First, _Rest...>::type {
> ^
> 
C:/PROGRA~1/MIB055~1/2022/Preview/VC/Tools/MSVC/1430~1.305/Include\type_traits(64,44):
 note: in instantiation of template class 
'std::conjunction, 
std::disjunction>, 
std::_Has_no_alloc_destroy, Primitive *>>>' requested 
here
> _INLINE_VAR constexpr bool conjunction_v = conjunction<_Traits...>::value;
>^
> 
C:/PROGRA~1/MIB055~1/2022/Preview/VC/Tools/MSVC/1430~1.305/Include\xmemory(934,20):
 note: in instantiation of variable template specialization 
'std::conjunction_v, 
std::disjunction>, 
std::_Has_no_alloc_destroy, Primitive *>>>' requested 
here
> if constexpr (!conjunction_v, 
_Uses_default_destroy<_Alloc, _Ty*>>) {
>^
> 
C:/PROGRA~1/MIB055~1/2022/Preview/VC/Tools/MSVC/1430~1.305/Include\vector(1632,13):
 note: in instantiation of function template specialization 
'std::_Destroy_range>' requested here
> _Destroy_range(_Myfirst, _Mylast, _Al);
> ^
> 
C:/PROGRA~1/MIB055~1/2022/Preview/VC/Tools/MSVC/1430~1.305/Include\vector(583,9):
 note: in instantiation of member function 'std::vector::_Tidy' 
requested here
> _Tidy();
> ^
> C:/lo-clang/core/slideshow/source/engine/opengl/TransitionImpl.hxx(74,5): 
note: in instantiation of member function 'std::vector::~vector' 
requested here
> TransitionScene(
> ^
> C:/lo-clang/core/slideshow/source/engine/opengl/TransitionImpl.hxx(42,7): 
note: forward declaration of 'Primitive'
> class Primitive;
>   ^

etc.).

Which in turn required tweaking of loplugin:unnecessaryoverride to avoid 
false

> In file included from 
C:/lo-clang/core/slideshow/source/engine/opengl/TransitionerImpl.cxx:67:
> 
C:/lo-clang/core/slideshow/source/engine/opengl/TransitionImpl.hxx(389,18): 
error: unnecessary user-declared destructor [loplugin:unnecessaryoverride]
> TransitionScene::~TransitionScene() = default;
> ~^~
> 
C:/lo-clang/core/slideshow/source/engine/opengl/TransitionImpl.hxx(81,12): 
note: declared here [loplugin:unnecessaryoverride]
> inline ~TransitionScene();
> ~~~^~

Change-Id: Ia72fb44e6e92ff47376d7b7159c0df7cbf883b69
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123648
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/compilerplugins/clang/test/unnecessaryoverride-dtor.cxx 
b/compilerplugins/clang/test/unnecessaryoverride-dtor.cxx
index b54957be2d7a..8ed472749105 100644
--- a/compilerplugins/clang/test/unnecessaryoverride-dtor.cxx
+++ b/compilerplugins/clang/test/unnecessaryoverride-dtor.cxx
@@ -78,10 +78,10 @@ struct DefaultDerived1: VirtualBase {
 };
 
 struct DefaultDerived2: VirtualBase {
-~DefaultDerived2() override; // expected-note {{declared here 
[loplugin:unnecessaryoverride]}}
+~DefaultDerived2() override;

[Libreoffice-commits] core.git: compilerplugins/clang slideshow/source

2019-09-27 Thread Noel Grandin (via logerrit)
 compilerplugins/clang/virtualdead.results   |3 ---
 slideshow/source/engine/slide/slideimpl.cxx |5 -
 slideshow/source/engine/slideshowimpl.cxx   |2 --
 slideshow/source/inc/slide.hxx  |1 -
 4 files changed, 11 deletions(-)

New commits:
commit 5e1b57b8e6482616a415f995c2fa261d5a189973
Author: Noel Grandin 
AuthorDate: Thu Sep 26 11:23:34 2019 +0200
Commit: Noel Grandin 
CommitDate: Fri Sep 27 19:35:05 2019 +0200

loplugin:virtualdead in slideshow

Change-Id: Ie158b76e6d552b1189173e30fbea5a43a774180b
Reviewed-on: https://gerrit.libreoffice.org/79640
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/compilerplugins/clang/virtualdead.results 
b/compilerplugins/clang/virtualdead.results
index bd25262008c9..e5a3dfcd5c59 100644
--- a/compilerplugins/clang/virtualdead.results
+++ b/compilerplugins/clang/virtualdead.results
@@ -128,9 +128,6 @@ sd/source/ui/inc/smarttag.hxx:171
 slideshow/source/engine/animationfactory.cxx:443
 void slideshow::internal::(anonymous 
namespace)::GenericAnimation::prefetch(const class std::shared_ptr &,const class std::shared_ptr &,)
 empty
-slideshow/source/inc/slide.hxx:118
-void slideshow::internal::Slide::disablePaintOverlay()
-empty
 vcl/inc/salframe.hxx:145
 void SalFrame::SetRepresentedURL(const class rtl::OUString &,)
 empty
diff --git a/slideshow/source/engine/slide/slideimpl.cxx 
b/slideshow/source/engine/slide/slideimpl.cxx
index b23ad397093e..fecbe82df2d1 100644
--- a/slideshow/source/engine/slide/slideimpl.cxx
+++ b/slideshow/source/engine/slide/slideimpl.cxx
@@ -119,7 +119,6 @@ public:
 virtual void drawPolygons() const override;
 virtual bool isPaintOverlayActive() const override;
 virtual void enablePaintOverlay() override;
-virtual void disablePaintOverlay() override;
 virtual void update_settings( bool bUserPaintEnabled, RGBColor const& 
aUserPaintColor, double dUserPaintStrokeWidth ) override;
 
 
@@ -795,10 +794,6 @@ void SlideImpl::enablePaintOverlay()
 }
 }
 
-void SlideImpl::disablePaintOverlay()
-{
-}
-
 void SlideImpl::activatePaintOverlay()
 {
 if( mbUserPaintOverlayEnabled || !maPolygons.empty() )
diff --git a/slideshow/source/engine/slideshowimpl.cxx 
b/slideshow/source/engine/slideshowimpl.cxx
index e5bfcc5146be..13d03bf484e4 100644
--- a/slideshow/source/engine/slideshowimpl.cxx
+++ b/slideshow/source/engine/slideshowimpl.cxx
@@ -1543,8 +1543,6 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue 
const& rProperty )
 // disable user paint
 maUserPaintColor.reset();
 maEventMultiplexer.notifyUserPaintDisabled();
-if( mpCurrentSlide )
-mpCurrentSlide->disablePaintOverlay();
 }
 
 resetCursor();
diff --git a/slideshow/source/inc/slide.hxx b/slideshow/source/inc/slide.hxx
index 0f1e2dc205e9..c269b9f4164d 100644
--- a/slideshow/source/inc/slide.hxx
+++ b/slideshow/source/inc/slide.hxx
@@ -115,7 +115,6 @@ namespace slideshow
 virtual bool isPaintOverlayActive() const = 0;
 
 virtual void enablePaintOverlay() = 0;
-virtual void disablePaintOverlay() = 0;
 
 virtual void update_settings( bool bUserPaintEnabled, RGBColor 
const& aUserPaintColor, double dUserPaintStrokeWidth ) = 0;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: compilerplugins/clang slideshow/source

2015-07-17 Thread Noel Grandin
 compilerplugins/clang/unusedmethods.cxx  |   92 
++
 slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.hxx |   16 -
 slideshow/source/engine/animationnodes/animationbasenode.hxx |3 
 slideshow/source/engine/animationnodes/basenode.hxx  |6 
 slideshow/source/engine/pointersymbol.hxx|7 
 slideshow/source/engine/rehearsetimingsactivity.cxx  |   14 -
 slideshow/source/engine/shapes/viewshape.hxx |   10 -
 slideshow/source/engine/slide/shapemanagerimpl.cxx   |   23 --
 slideshow/source/engine/slide/shapemanagerimpl.hxx   |6 
 slideshow/source/engine/slide/userpaintoverlay.cxx   |   23 --
 slideshow/source/engine/transitions/slidechangebase.hxx  |3 
 slideshow/source/engine/usereventqueue.cxx   |2 
 slideshow/source/inc/activitiesqueue.hxx |7 
 slideshow/source/inc/doctreenode.hxx |7 
 slideshow/source/inc/listenercontainer.hxx   |1 
 slideshow/source/inc/mouseeventhandler.hxx   |   30 ---
 slideshow/source/inc/shapemanager.hxx|8 
 slideshow/source/inc/slidebitmap.hxx |1 
 slideshow/source/inc/unoviewcontainer.hxx|4 
 slideshow/source/inc/viewupdate.hxx  |7 
 20 files changed, 58 insertions(+), 212 deletions(-)

New commits:
commit 5a7bf1b32c3699c9ca40d60e61403a3b587f35ff
Author: Noel Grandin n...@peralex.com
Date:   Thu Jul 16 14:45:53 2015 +0200

loplugin:unusedmethods slideshow

Change-Id: I66b6cddb638a9fc1228d3ea9df5d112300a00eb3
Reviewed-on: https://gerrit.libreoffice.org/17128
Tested-by: Jenkins c...@libreoffice.org
Reviewed-by: Noel Grandin noelgran...@gmail.com

diff --git a/compilerplugins/clang/unusedmethods.cxx 
b/compilerplugins/clang/unusedmethods.cxx
index 6d0303d..a137a21 100644
--- a/compilerplugins/clang/unusedmethods.cxx
+++ b/compilerplugins/clang/unusedmethods.cxx
@@ -35,9 +35,6 @@ to get it to work :-)
 
 TODO deal with calls to superclass/member constructors from other 
constructors, so
  we can find unused constructors
-TODO deal with free functions and static methods
-TODO track instantiations of template class constructor methods
-TODO track instantiation of overridden methods when a template class is 
instantiated
 */
 
 namespace {
@@ -71,18 +68,20 @@ public:
 }
 
 bool VisitCallExpr(CallExpr* );
-bool VisitCXXMethodDecl( const CXXMethodDecl* decl );
+bool VisitFunctionDecl( const FunctionDecl* decl );
 bool VisitDeclRefExpr( const DeclRefExpr* );
-bool TraverseCXXMethodDecl(CXXMethodDecl * decl) { return 
RecursiveASTVisitor::TraverseCXXMethodDecl(decl); }
+bool VisitCXXConstructExpr( const CXXConstructExpr* );
 };
 
-static std::string niceName(const CXXMethodDecl* functionDecl)
+static std::string niceName(const FunctionDecl* functionDecl)
 {
 std::string s =
 compat::getReturnType(*functionDecl).getCanonicalType().getAsString()
-+   + functionDecl-getParent()-getQualifiedNameAsString()
-+ :: + functionDecl-getNameAsString()
-+ (;
++  ;
+if (isaCXXMethodDecl(functionDecl)) {
+s += 
dyn_castCXXMethodDecl(functionDecl)-getParent()-getQualifiedNameAsString() 
+ ::;
+}
+s += functionDecl-getNameAsString() + (;
 bool bFirst = true;
 for (const ParmVarDecl *pParmVarDecl : functionDecl-params()) {
 if (bFirst)
@@ -92,27 +91,30 @@ static std::string niceName(const CXXMethodDecl* 
functionDecl)
 s += pParmVarDecl-getType().getCanonicalType().getAsString();
 }
 s += );
-if (functionDecl-isConst()) {
+if (isaCXXMethodDecl(functionDecl)  
dyn_castCXXMethodDecl(functionDecl)-isConst()) {
 s +=  const;
 }
 return s;
 }
 
-static void logCallToRootMethods(const CXXMethodDecl* decl)
+static void logCallToRootMethods(const FunctionDecl* functionDecl)
 {
-// For virtual/overriding methods, we need to pretend we called the root 
method(s),
-// so that they get marked as used.
-decl = decl-getCanonicalDecl();
+functionDecl = functionDecl-getCanonicalDecl();
 bool bPrinted = false;
-for(CXXMethodDecl::method_iterator it = decl-begin_overridden_methods();
-it != decl-end_overridden_methods(); ++it)
-{
-logCallToRootMethods(*it);
-bPrinted = true;
+if (isaCXXMethodDecl(functionDecl)) {
+// For virtual/overriding methods, we need to pretend we called the 
root method(s),
+// so that they get marked as used.
+const CXXMethodDecl* methodDecl = 
dyn_castCXXMethodDecl(functionDecl);
+for(CXXMethodDecl::method_iterator it =