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
e823a9bd
Kaydet (Commit)
e823a9bd
authored
Eyl 15, 2014
tarafından
Luboš Luňák
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
do not warn about "null pointer conversions" from integers in C++98 mode
Change-Id: I15c7f52c542549ad131400c9b5395a06a4777687
üst
aa2444c6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
10 deletions
+6
-10
literaltoboolconversion.cxx
compilerplugins/clang/literaltoboolconversion.cxx
+6
-10
No files found.
compilerplugins/clang/literaltoboolconversion.cxx
Dosyayı görüntüle @
e823a9bd
...
@@ -116,18 +116,15 @@ bool LiteralToBoolConversion::VisitImplicitCastExpr(
...
@@ -116,18 +116,15 @@ bool LiteralToBoolConversion::VisitImplicitCastExpr(
<<
expr
->
getCastKindName
()
<<
expr
->
getSubExpr
()
->
getType
()
<<
expr
->
getCastKindName
()
<<
expr
->
getSubExpr
()
->
getType
()
<<
expr
->
getType
()
<<
expr
->
getSourceRange
();
<<
expr
->
getType
()
<<
expr
->
getSourceRange
();
}
}
// At least Clang 3.2 would erroneously warn about Cache::add
// (binaryurp/source/cache.hxx:53)
//
// if( !size_) {
//
// as "implicit conversion (IntegralToBoolean) of null pointer constant of type
// 'std::size_t' (aka 'unsigned long') to 'bool'":
#if (__clang_major__ == 3 && __clang_minor__ >= 4) || __clang_major__ > 3
}
else
if
(
sub
->
isNullPointerConstant
(
}
else
if
(
sub
->
isNullPointerConstant
(
compiler
.
getASTContext
(),
Expr
::
NPC_ValueDependentIsNull
)
compiler
.
getASTContext
(),
Expr
::
NPC_ValueDependentIsNull
)
!=
Expr
::
NPCK_NotNull
)
>
Expr
::
NPCK_ZeroExpression
)
{
{
// The test above originally checked for != Expr::NPCK_NotNull, but in non-C++11
// mode we can get also Expr::NPCK_ZeroExpression inside templates, even though
// the expression is actually not a null pointer. Clang bug or C++98 misfeature?
// See Clang's NPCK_ZeroExpression declaration and beginning of isNullPointerConstant().
static_assert
(
Expr
::
NPCK_NotNull
==
0
&&
Expr
::
NPCK_ZeroExpression
==
1
,
"Clang API change"
);
report
(
report
(
DiagnosticsEngine
::
Warning
,
DiagnosticsEngine
::
Warning
,
(
"implicit conversion (%0) of null pointer constant of type %1 to"
(
"implicit conversion (%0) of null pointer constant of type %1 to"
...
@@ -135,7 +132,6 @@ bool LiteralToBoolConversion::VisitImplicitCastExpr(
...
@@ -135,7 +132,6 @@ bool LiteralToBoolConversion::VisitImplicitCastExpr(
expr
->
getLocStart
())
expr
->
getLocStart
())
<<
expr
->
getCastKindName
()
<<
expr
->
getSubExpr
()
->
getType
()
<<
expr
->
getCastKindName
()
<<
expr
->
getSubExpr
()
->
getType
()
<<
expr
->
getType
()
<<
expr
->
getSourceRange
();
<<
expr
->
getType
()
<<
expr
->
getSourceRange
();
#endif
}
else
if
(
sub
->
isIntegerConstantExpr
(
res
,
compiler
.
getASTContext
()))
{
}
else
if
(
sub
->
isIntegerConstantExpr
(
res
,
compiler
.
getASTContext
()))
{
report
(
report
(
DiagnosticsEngine
::
Warning
,
DiagnosticsEngine
::
Warning
,
...
...
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