]> granicus.if.org Git - clang/commit
Fix false positive in -Wunsequenced and templates.
authorRichard Trieu <rtrieu@google.com>
Fri, 5 Aug 2016 21:02:34 +0000 (21:02 +0000)
committerRichard Trieu <rtrieu@google.com>
Fri, 5 Aug 2016 21:02:34 +0000 (21:02 +0000)
commit3ff0fb57b3a6405b3fc75393f007af59495f098f
treed4976eca0aaf916ef647658f4f2dbfba865a282f
parent7eec7194665d48fb270d0d937923c203c0ccabbc
Fix false positive in -Wunsequenced and templates.

For builtin logical operators, there is a well-defined ordering of argument
evaluation.  For overloaded operator of the same type, there is no argument
evaluation order, similar to other function calls.  When both are present,
uninstantiated templates with an operator&& is treated as an unresolved
function call.  Unresolved function calls are treated as normal function calls,
and may result in false positives when the builtin logical operator is used.
Have the unsequenced checker ignore dependent expressions to avoid this
false positive.  The check also happens in template instantiations to catch
when the overloaded operator is used.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@277866 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaChecking.cpp
test/SemaCXX/warn-unsequenced.cpp