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
b16a3372
Kaydet (Commit)
b16a3372
authored
Kas 05, 2015
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Improve warning messages
Change-Id: I75eb9f17a3dcc688314355fa957e3f34086b161a
üst
ffde331f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
vclwidgets.cxx
compilerplugins/clang/vclwidgets.cxx
+12
-12
No files found.
compilerplugins/clang/vclwidgets.cxx
Dosyayı görüntüle @
b16a3372
...
@@ -189,7 +189,7 @@ bool VCLWidgets::VisitCXXDestructorDecl(const CXXDestructorDecl* pCXXDestructorD
...
@@ -189,7 +189,7 @@ bool VCLWidgets::VisitCXXDestructorDecl(const CXXDestructorDecl* pCXXDestructorD
if
(
bFoundVclPtrField
&&
pCompoundStatement
&&
pCompoundStatement
->
size
()
==
0
)
{
if
(
bFoundVclPtrField
&&
pCompoundStatement
&&
pCompoundStatement
->
size
()
==
0
)
{
report
(
report
(
DiagnosticsEngine
::
Warning
,
DiagnosticsEngine
::
Warning
,
"OutputDevice subclass with VclPtr field must call disposeOnce() from its destructor
.
"
,
"OutputDevice subclass with VclPtr field must call disposeOnce() from its destructor"
,
pCXXDestructorDecl
->
getLocStart
())
pCXXDestructorDecl
->
getLocStart
())
<<
pCXXDestructorDecl
->
getSourceRange
();
<<
pCXXDestructorDecl
->
getSourceRange
();
return
true
;
return
true
;
...
@@ -225,7 +225,7 @@ bool VCLWidgets::VisitCXXDestructorDecl(const CXXDestructorDecl* pCXXDestructorD
...
@@ -225,7 +225,7 @@ bool VCLWidgets::VisitCXXDestructorDecl(const CXXDestructorDecl* pCXXDestructorD
{
{
report
(
report
(
DiagnosticsEngine
::
Warning
,
DiagnosticsEngine
::
Warning
,
"OutputDevice subclass should have nothing in its destructor but a call to disposeOnce()
.
"
,
"OutputDevice subclass should have nothing in its destructor but a call to disposeOnce()"
,
pCXXDestructorDecl
->
getLocStart
())
pCXXDestructorDecl
->
getLocStart
())
<<
pCXXDestructorDecl
->
getSourceRange
();
<<
pCXXDestructorDecl
->
getSourceRange
();
}
}
...
@@ -264,9 +264,9 @@ bool VCLWidgets::VisitVarDecl(const VarDecl * pVarDecl) {
...
@@ -264,9 +264,9 @@ bool VCLWidgets::VisitVarDecl(const VarDecl * pVarDecl) {
{
{
report
(
report
(
DiagnosticsEngine
::
Warning
,
DiagnosticsEngine
::
Warning
,
"OutputDevice subclass
should be wrapped in VclPtr. "
+
pVarDecl
->
getType
().
getAsString
()
,
"OutputDevice subclass
%0 should be wrapped in VclPtr"
,
pVarDecl
->
getLocation
())
pVarDecl
->
getLocation
())
<<
pVarDecl
->
getSourceRange
();
<<
pVarDecl
->
getType
()
<<
pVarDecl
->
getSourceRange
();
return
true
;
return
true
;
}
}
...
@@ -282,7 +282,7 @@ bool VCLWidgets::VisitVarDecl(const VarDecl * pVarDecl) {
...
@@ -282,7 +282,7 @@ bool VCLWidgets::VisitVarDecl(const VarDecl * pVarDecl) {
if
(
isDerivedFromWindow
(
recordDecl
))
{
if
(
isDerivedFromWindow
(
recordDecl
))
{
report
(
report
(
DiagnosticsEngine
::
Warning
,
DiagnosticsEngine
::
Warning
,
"OutputDevice subclass allocated on stack, should be allocated via VclPtr or via *
.
"
,
"OutputDevice subclass allocated on stack, should be allocated via VclPtr or via *"
,
pVarDecl
->
getLocation
())
pVarDecl
->
getLocation
())
<<
pVarDecl
->
getSourceRange
();
<<
pVarDecl
->
getSourceRange
();
}
}
...
@@ -302,9 +302,9 @@ bool VCLWidgets::VisitFieldDecl(const FieldDecl * fieldDecl) {
...
@@ -302,9 +302,9 @@ bool VCLWidgets::VisitFieldDecl(const FieldDecl * fieldDecl) {
if
(
!
(
pParentRecordDecl
!=
nullptr
&&
pParentRecordDecl
->
getQualifiedNameAsString
()
==
"ErrorContextImpl"
))
{
if
(
!
(
pParentRecordDecl
!=
nullptr
&&
pParentRecordDecl
->
getQualifiedNameAsString
()
==
"ErrorContextImpl"
))
{
report
(
report
(
DiagnosticsEngine
::
Warning
,
DiagnosticsEngine
::
Warning
,
"OutputDevice subclass
declared as a pointer field, should be wrapped in VclPtr."
+
fieldDecl
->
getType
().
getAsString
()
,
"OutputDevice subclass
%0 declared as a pointer member, should be wrapped in VclPtr"
,
fieldDecl
->
getLocation
())
fieldDecl
->
getLocation
())
<<
fieldDecl
->
getSourceRange
();
<<
fieldDecl
->
getType
()
<<
fieldDecl
->
getSourceRange
();
return
true
;
return
true
;
}
}
}
}
...
@@ -321,7 +321,7 @@ bool VCLWidgets::VisitFieldDecl(const FieldDecl * fieldDecl) {
...
@@ -321,7 +321,7 @@ bool VCLWidgets::VisitFieldDecl(const FieldDecl * fieldDecl) {
if
(
isDerivedFromWindow
(
recordDecl
))
{
if
(
isDerivedFromWindow
(
recordDecl
))
{
report
(
report
(
DiagnosticsEngine
::
Warning
,
DiagnosticsEngine
::
Warning
,
"OutputDevice subclass allocated as a class member, should be allocated via VclPtr
.
"
,
"OutputDevice subclass allocated as a class member, should be allocated via VclPtr"
,
fieldDecl
->
getLocation
())
fieldDecl
->
getLocation
())
<<
fieldDecl
->
getSourceRange
();
<<
fieldDecl
->
getSourceRange
();
}
}
...
@@ -342,14 +342,14 @@ bool VCLWidgets::VisitFieldDecl(const FieldDecl * fieldDecl) {
...
@@ -342,14 +342,14 @@ bool VCLWidgets::VisitFieldDecl(const FieldDecl * fieldDecl) {
if
(
!
bFoundDispose
)
{
if
(
!
bFoundDispose
)
{
report
(
report
(
DiagnosticsEngine
::
Warning
,
DiagnosticsEngine
::
Warning
,
"OutputDevice subclass with a VclPtr field MUST
have a dispose() method.
"
,
"OutputDevice subclass with a VclPtr field MUST
override dispose() (and call its superclass dispose() as the last thing it does)
"
,
fieldDecl
->
getLocation
())
fieldDecl
->
getLocation
())
<<
fieldDecl
->
getSourceRange
();
<<
fieldDecl
->
getSourceRange
();
}
}
if
(
!
pParentRecordDecl
->
hasUserDeclaredDestructor
())
{
if
(
!
pParentRecordDecl
->
hasUserDeclaredDestructor
())
{
report
(
report
(
DiagnosticsEngine
::
Warning
,
DiagnosticsEngine
::
Warning
,
"OutputDevice subclass with a VclPtr field MUST have a
n explicit destructor.
"
,
"OutputDevice subclass with a VclPtr field MUST have a
user-provided destructor (that calls disposeOnce())
"
,
fieldDecl
->
getLocation
())
fieldDecl
->
getLocation
())
<<
fieldDecl
->
getSourceRange
();
<<
fieldDecl
->
getSourceRange
();
}
}
...
@@ -402,7 +402,7 @@ bool VCLWidgets::VisitFunctionDecl( const FunctionDecl* functionDecl )
...
@@ -402,7 +402,7 @@ bool VCLWidgets::VisitFunctionDecl( const FunctionDecl* functionDecl )
if
(
!
isDisposeCallingSuperclassDispose
(
pMethodDecl
))
{
if
(
!
isDisposeCallingSuperclassDispose
(
pMethodDecl
))
{
report
(
report
(
DiagnosticsEngine
::
Warning
,
DiagnosticsEngine
::
Warning
,
"OutputDevice subclass dispose()
method
MUST call dispose() of its superclass as the last thing it does"
,
"OutputDevice subclass dispose()
function
MUST call dispose() of its superclass as the last thing it does"
,
functionDecl
->
getLocStart
())
functionDecl
->
getLocStart
())
<<
functionDecl
->
getSourceRange
();
<<
functionDecl
->
getSourceRange
();
}
}
...
@@ -601,7 +601,7 @@ bool VCLWidgets::VisitCXXConstructExpr( const CXXConstructExpr* constructExpr )
...
@@ -601,7 +601,7 @@ bool VCLWidgets::VisitCXXConstructExpr( const CXXConstructExpr* constructExpr )
if
(
isDerivedFromWindow
(
recordDecl
))
{
if
(
isDerivedFromWindow
(
recordDecl
))
{
report
(
report
(
DiagnosticsEngine
::
Warning
,
DiagnosticsEngine
::
Warning
,
"Calling constructor of a Window-derived type directly
. A
ll such creation should go via VclPtr<>::Create"
,
"Calling constructor of a Window-derived type directly
; a
ll such creation should go via VclPtr<>::Create"
,
constructExpr
->
getExprLoc
());
constructExpr
->
getExprLoc
());
}
}
return
true
;
return
true
;
...
...
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