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
e36badb9
Kaydet (Commit)
e36badb9
authored
Eyl 16, 2014
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix workaround for bug in Clang 3.2 FunctionDecl::isInlined
Change-Id: I9b0b6affc60ae030b644fdd13eecfb1aed1f472a
üst
3bd267a3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
14 deletions
+17
-14
salbool.cxx
compilerplugins/clang/salbool.cxx
+17
-14
No files found.
compilerplugins/clang/salbool.cxx
Dosyayı görüntüle @
e36badb9
...
...
@@ -24,6 +24,20 @@ bool isSalBool(QualType type) {
return
t
!=
nullptr
&&
t
->
getDecl
()
->
getNameAsString
()
==
"sal_Bool"
;
}
// Clang 3.2 FunctionDecl::isInlined doesn't work as advertised ("Determine
// whether this function should be inlined, because it is either marked 'inline'
// or 'constexpr' or is a member function of a class that was defined in the
// class body.") but mis-classifies salhelper::Timer's isTicking, isExpired, and
// expiresBefore members as defined in salhelper/source/timer.cxx as inlined:
bool
isInlined
(
FunctionDecl
const
&
decl
)
{
#if (__clang_major__ == 3 && __clang_minor__ >= 3) || __clang_major__ > 3
return
decl
->
isInlined
();
#else
(
void
)
decl
;
return
false
;
#endif
}
// It appears that, given a function declaration, there is no way to determine
// the language linkage of the function's type, only of the function's name
// (via FunctionDecl::isExternC); however, in a case like
...
...
@@ -324,7 +338,7 @@ bool SalBool::VisitParmVarDecl(ParmVarDecl const * decl) {
||
(
isInUnoIncludeFile
(
compiler
.
getSourceManager
().
getSpellingLoc
(
f
->
getNameInfo
().
getLoc
()))
&&
(
!
f
->
isInlined
(
)
||
f
->
hasAttr
<
DeprecatedAttr
>
()
&&
(
!
isInlined
(
*
f
)
||
f
->
hasAttr
<
DeprecatedAttr
>
()
||
decl
->
getType
()
->
isReferenceType
()
||
hasBoolOverload
(
f
,
false
)))
||
f
->
isDeleted
()
||
hasBoolOverload
(
f
,
true
)))
...
...
@@ -497,18 +511,7 @@ bool SalBool::VisitFunctionDecl(FunctionDecl const * decl) {
||
(
isInUnoIncludeFile
(
compiler
.
getSourceManager
().
getSpellingLoc
(
f
->
getNameInfo
().
getLoc
()))
&&
(
// Clang 3.2 FunctionDecl::isInlined doesn't work as advertised ("Determine
// whether this function should be inlined, because it is either marked 'inline'
// or 'constexpr' or is a member function of a class that was defined in the
// class body.") but mis-classifies salhelper::Timer's isTicking, isExpired, and
// expiresBefore members as defined in salhelper/source/timer.cxx as inlined:
#if (__clang_major__ == 3 && __clang_minor__ >= 3) || __clang_major__ > 3
!
f
->
isInlined
()
#else
true
#endif
||
f
->
hasAttr
<
DeprecatedAttr
>
()))))
&&
(
!
isInlined
(
*
f
)
||
f
->
hasAttr
<
DeprecatedAttr
>
()))))
{
SourceLocation
loc
{
decl
->
getLocStart
()
};
SourceLocation
l
{
compiler
.
getSourceManager
().
getExpansionLoc
(
...
...
@@ -544,7 +547,7 @@ bool SalBool::VisitFunctionDecl(FunctionDecl const * decl) {
{
report
(
DiagnosticsEngine
::
Warning
,
"use
\"
bool
\"
instead of
\"
sal_Bool
\"
as return type%0"
,
"use
\"
bool
\"
instead of
\"
sal_Bool
\"
as return type%0
[%1 %2]
"
,
loc
)
<<
(
k
==
OverrideKind
::
MAYBE
?
(
" (unless this member function overrides a dependent"
...
...
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