This revision was automatically updated to reflect the committed changes.
Closed by commit rL316605: Ignore implicity casts for
zero-as-null-pointer-constant warning (authored by erichkeane).
Changed prior to commit:
https://reviews.llvm.org/D39301?vs=120289&id=120301#toc
Repository:
rL LLVM
aaron.ballman added a comment.
In https://reviews.llvm.org/D39301#906911, @thakis wrote:
> Awesome, thanks much! Like lebedev.ri says, adding a test for the "Parens"
> part would be good.
I agree. I should have been more explicit with my LGTM, but I presumed you knew
to add the tests already.
erichkeane added a comment.
They've got me presenting in the next meeting, but i'll add said test and
commit after. Thanks for the reviews guys!
https://reviews.llvm.org/D39301
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.l
thakis accepted this revision.
thakis added a comment.
Awesome, thanks much! Like lebedev.ri says, adding a test for the "Parens" part
would be good.
https://reviews.llvm.org/D39301
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lis
aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.
LGTM!
https://reviews.llvm.org/D39301
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman
lebedev.ri added inline comments.
Comment at: lib/Sema/Sema.cpp:441
return;
- if (E->getType()->isNullPtrType())
+ if (E->IgnoreImpCasts()->getType()->isNullPtrType())
return;
erichkeane wrote:
> aaron.ballman wrote:
> > Do we also want to ignore pare
erichkeane updated this revision to Diff 120289.
erichkeane added a comment.
Lets ignore parens too!
https://reviews.llvm.org/D39301
Files:
lib/Sema/Sema.cpp
test/SemaCXX/warn-zero-nullptr.cpp
Index: lib/Sema/Sema.cpp
===
---
erichkeane added inline comments.
Comment at: lib/Sema/Sema.cpp:441
return;
- if (E->getType()->isNullPtrType())
+ if (E->IgnoreImpCasts()->getType()->isNullPtrType())
return;
aaron.ballman wrote:
> Do we also want to ignore parens here as well with
aaron.ballman added inline comments.
Comment at: lib/Sema/Sema.cpp:441
return;
- if (E->getType()->isNullPtrType())
+ if (E->IgnoreImpCasts()->getType()->isNullPtrType())
return;
Do we also want to ignore parens here as well with
`Expr::IgnoreParenIm
erichkeane updated this revision to Diff 120288.
erichkeane marked an inline comment as done.
erichkeane added a comment.
Response to Roman's comment.
https://reviews.llvm.org/D39301
Files:
lib/Sema/Sema.cpp
test/SemaCXX/warn-zero-nullptr.cpp
Index: lib/Sema/Sema.cpp
=
lebedev.ri added inline comments.
Comment at: test/SemaCXX/warn-zero-nullptr.cpp:29
+
+// Shouldn't warn.
+struct pr34362 { operator int*() { return nullptr; } };
Maybe wrap into a `namespace PR34362 {}`
https://reviews.llvm.org/D39301
__
erichkeane created this revision.
The repro in https://bugs.llvm.org/show_bug.cgi?id=34362
caused the left nullptr to be cast to a int* implicitly, which
resulted diagnosing this falsely.
https://reviews.llvm.org/D39301
Files:
lib/Sema/Sema.cpp
test/SemaCXX/warn-zero-nullptr.cpp
Index: li
12 matches
Mail list logo