Re: [PATCH] D22392: [Sema] Fix an invalid nullability warning for binary conditional operators

2016-07-19 Thread Akira Hatanaka via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL276076: [Sema] Compute the nullability of a conditional expression based on the (authored by ahatanak). Changed prior to commit: https://reviews.llvm.org/D22392?vs=64557=64628#toc Repository: rL

Re: [PATCH] D22392: [Sema] Fix an invalid nullability warning for binary conditional operators

2016-07-19 Thread Doug Gregor via cfe-commits
doug.gregor accepted this revision. doug.gregor added a comment. This revision is now accepted and ready to land. LGTM! https://reviews.llvm.org/D22392 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

Re: [PATCH] D22392: [Sema] Fix an invalid nullability warning for binary conditional operators

2016-07-19 Thread Akira Hatanaka via cfe-commits
ahatanak updated this revision to Diff 64557. ahatanak added a comment. Remove the check "if (LHSKind == RHSKind)" in computeConditionalNullability as it's not needed. https://reviews.llvm.org/D22392 Files: lib/Sema/SemaExpr.cpp test/Sema/nullability.c test/SemaCXX/nullability.cpp

Re: [PATCH] D22392: [Sema] Fix an invalid nullability warning for binary conditional operators

2016-07-19 Thread Akira Hatanaka via cfe-commits
ahatanak updated this revision to Diff 64551. ahatanak added a comment. Address review comments. - Rename function to computeConditionalNullability. - Rewrite the function to compute the nullability of both normal and binary conditional expressions. - Add more test cases.

Re: [PATCH] D22392: [Sema] Fix an invalid nullability warning for binary conditional operators

2016-07-15 Thread Akira Hatanaka via cfe-commits
ahatanak added a comment. I'm thinking about taking the following steps to compute the nullability of ternary operators. The first step is to compute the "merged" nullability of the LHS and RHS. For normal ternary operators (not the shorthand version): - If both LHS and RHS have the same

Re: [PATCH] D22392: [Sema] Fix an invalid nullability warning for binary conditional operators

2016-07-15 Thread Akira Hatanaka via cfe-commits
ahatanak added inline comments. Comment at: lib/Sema/SemaExpr.cpp:7007 @@ +7006,3 @@ +/// expression. +static QualType modifyNullability(QualType ResTy, Expr *RHSExpr, + ASTContext ) { doug.gregor wrote: > This name could be

Re: [PATCH] D22392: [Sema] Fix an invalid nullability warning for binary conditional operators

2016-07-14 Thread Doug Gregor via cfe-commits
doug.gregor added a comment. A bunch of comments above. This needs much more extensive testing, because there are numerous paths through the ternary operator code and the results need to be symmetric. Comment at: lib/Sema/SemaExpr.cpp:7007 @@ +7006,3 @@ +/// expression.

Re: [PATCH] D22392: [Sema] Fix an invalid nullability warning for binary conditional operators

2016-07-14 Thread Akira Hatanaka via cfe-commits
ahatanak updated this revision to Diff 64077. ahatanak added a comment. Remove unused variable. https://reviews.llvm.org/D22392 Files: lib/Sema/SemaExpr.cpp test/Sema/nullability.c Index: test/Sema/nullability.c === ---

[PATCH] D22392: [Sema] Fix an invalid nullability warning for binary conditional operators

2016-07-14 Thread Akira Hatanaka via cfe-commits
ahatanak created this revision. ahatanak added a reviewer: doug.gregor. ahatanak added a subscriber: cfe-commits. Currently clang issues a warning when the following code using a shorthand form of the conditional operator is compiled: $ cat test1.c ``` void foo() { int * _Nullable p0; int *