aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaChecking.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-02-19 19:28:43 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-02-19 19:28:43 +0000
commit403bc2bd9edffe51d73776643fa87696c9417678 (patch)
treed16f45f6ca9e9d64cf334b043797945081823250 /lib/Sema/SemaChecking.cpp
parent81ebbde0fb30a40df0f5e913d8a1f71c383d271a (diff)
Arguments to unordered comparison builtins may need implicit casts.
- <rdar://problem/6094103> sema fails to promote type arguments to __builtin_isgreater (and friends) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65059 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaChecking.cpp')
-rw-r--r--lib/Sema/SemaChecking.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp
index 2f837822f8..fdd22fa4bf 100644
--- a/lib/Sema/SemaChecking.cpp
+++ b/lib/Sema/SemaChecking.cpp
@@ -267,6 +267,12 @@ bool Sema::SemaBuiltinUnorderedCompare(CallExpr *TheCall) {
// Do standard promotions between the two arguments, returning their common
// type.
QualType Res = UsualArithmeticConversions(OrigArg0, OrigArg1, false);
+
+ // Make sure any conversions are pushed back into the call; this is
+ // type safe since unordered compare builtins are declared as "_Bool
+ // foo(...)".
+ TheCall->setArg(0, OrigArg0);
+ TheCall->setArg(1, OrigArg1);
// If the common type isn't a real floating type, then the arguments were
// invalid for this operation.