]> granicus.if.org Git - clang/commit
Handle overloaded operators in ?: precedence warning
authorHans Wennborg <hans@hanshq.net>
Thu, 9 Jun 2011 17:06:51 +0000 (17:06 +0000)
committerHans Wennborg <hans@hanshq.net>
Thu, 9 Jun 2011 17:06:51 +0000 (17:06 +0000)
commit2f072b442879b8bba8c5dea11d7c61bedb1924ae
tree5fa094e1f4ec6f64cb8db3d06824c1364eb49952
parentd7bc7a210993fc4f67cdf5764ce4ef33f2a8ede3
Handle overloaded operators in ?: precedence warning

This is a follow-up to r132565, and should address the rest of PR9969:

Warn about cases such as

int foo(A a, bool b) {
 return a + b ? 1 : 2; // user probably meant a + (b ? 1 : 2);
}

also when + is an overloaded operator call.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132784 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/AST/Expr.h
lib/AST/Expr.cpp
lib/Sema/SemaExpr.cpp
test/Sema/parentheses.cpp