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
274c836c
Kaydet (Commit)
274c836c
authored
May 12, 2015
tarafından
Noel Grandin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
check for static fields that needs to be wrapped in VclPtr
Change-Id: I6135cfd9aa70f90d58150733b6b48525e5c347c8
üst
be316c62
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
14 deletions
+19
-14
vclwidgets.cxx
compilerplugins/clang/vclwidgets.cxx
+19
-14
No files found.
compilerplugins/clang/vclwidgets.cxx
Dosyayı görüntüle @
274c836c
...
...
@@ -228,23 +228,10 @@ bool VCLWidgets::VisitVarDecl(const VarDecl * pVarDecl) {
if
(
ignoreLocation
(
pVarDecl
))
{
return
true
;
}
const
RecordType
*
recordType
=
pVarDecl
->
getType
()
->
getAs
<
RecordType
>
();
if
(
recordType
==
nullptr
)
{
return
true
;
}
const
CXXRecordDecl
*
recordDecl
=
dyn_cast
<
CXXRecordDecl
>
(
recordType
->
getDecl
());
if
(
recordDecl
==
nullptr
)
{
if
(
isa
<
ParmVarDecl
>
(
pVarDecl
)
||
pVarDecl
->
isLocalVarDecl
()
)
{
return
true
;
}
// check if this field is derived from Window
if
(
isDerivedFromWindow
(
recordDecl
))
{
report
(
DiagnosticsEngine
::
Warning
,
"OutputDevice subclass allocated on stack, should be allocated via VclPtr or via *."
,
pVarDecl
->
getLocation
())
<<
pVarDecl
->
getSourceRange
();
}
if
(
!
startsWith
(
pVarDecl
->
getType
().
getAsString
(),
"std::vector<vcl::Window *>"
)
&&
!
startsWith
(
pVarDecl
->
getType
().
getAsString
(),
"std::map<vcl::Window *, Size>"
)
&&
!
startsWith
(
pVarDecl
->
getType
().
getAsString
(),
"std::map<vcl::Window *, class Size>"
)
...
...
@@ -270,6 +257,24 @@ bool VCLWidgets::VisitVarDecl(const VarDecl * pVarDecl) {
"OutputDevice subclass should be wrapped in VclPtr. "
+
pVarDecl
->
getType
().
getAsString
(),
pVarDecl
->
getLocation
())
<<
pVarDecl
->
getSourceRange
();
return
true
;
}
const
RecordType
*
recordType
=
pVarDecl
->
getType
()
->
getAs
<
RecordType
>
();
if
(
recordType
==
nullptr
)
{
return
true
;
}
const
CXXRecordDecl
*
recordDecl
=
dyn_cast
<
CXXRecordDecl
>
(
recordType
->
getDecl
());
if
(
recordDecl
==
nullptr
)
{
return
true
;
}
// check if this field is derived from Window
if
(
isDerivedFromWindow
(
recordDecl
))
{
report
(
DiagnosticsEngine
::
Warning
,
"OutputDevice subclass allocated on stack, should be allocated via VclPtr or via *."
,
pVarDecl
->
getLocation
())
<<
pVarDecl
->
getSourceRange
();
}
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