Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
5f500ade
Kaydet (Commit)
5f500ade
authored
Haz 13, 2014
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
loplugin:staticcall
Change-Id: Id46b391c09555c9ec30916fdd93b05455835d81b
üst
c21979a3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
0 deletions
+49
-0
staticcall.cxx
compilerplugins/clang/staticcall.cxx
+49
-0
No files found.
compilerplugins/clang/staticcall.cxx
0 → 100644
Dosyayı görüntüle @
5f500ade
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include "plugin.hxx"
namespace
{
class
StaticCall
:
public
RecursiveASTVisitor
<
StaticCall
>
,
public
loplugin
::
Plugin
{
public
:
explicit
StaticCall
(
InstantiationData
const
&
data
)
:
Plugin
(
data
)
{}
void
run
()
override
{
TraverseDecl
(
compiler
.
getASTContext
().
getTranslationUnitDecl
());
}
bool
VisitCallExpr
(
CallExpr
const
*
expr
);
};
bool
StaticCall
::
VisitCallExpr
(
CallExpr
const
*
expr
)
{
if
(
ignoreLocation
(
expr
)
||
!
isa
<
MemberExpr
>
(
expr
->
getCallee
()
->
IgnoreImpCasts
()))
{
return
true
;
}
CXXMethodDecl
const
*
decl
=
dyn_cast_or_null
<
CXXMethodDecl
>
(
expr
->
getDirectCallee
());
if
(
decl
!=
nullptr
&&
decl
->
isStatic
())
{
report
(
DiagnosticsEngine
::
Warning
,
(
"calling static member function through member call syntax, use"
" '%0' instead"
),
expr
->
getLocStart
())
<<
decl
->
getQualifiedNameAsString
()
<<
expr
->
getSourceRange
();
}
return
true
;
}
loplugin
::
Plugin
::
Registration
<
StaticCall
>
X
(
"staticcall"
);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment