]> granicus.if.org Git - clang/commit
Make sure the arithmetic conversion are done for relation and equality operators.
authorSteve Naroff <snaroff@apple.com>
Fri, 10 Aug 2007 18:26:40 +0000 (18:26 +0000)
committerSteve Naroff <snaroff@apple.com>
Fri, 10 Aug 2007 18:26:40 +0000 (18:26 +0000)
commit30bf7710b5c64deb318752343bb80a70b3c53429
tree9418066da4b061ad34ce2cc233105f59cde1d424
parentcff944ba2616e00b8753c0630ff727889802c061
Make sure the arithmetic conversion are done for relation and equality operators.

This fixes the following...

eypedef short S;
int test(S X, long long Y) {
  return X < Y;
}

Before...

(CompoundStmt 0x2905d00
  (ReturnStmt 0x2905cf0
    (BinaryOperator 0x2905cd0 'int' '<'
      (ImplicitCastExpr 0x2905cc0 'int'
        (DeclRefExpr 0x2905c80 'S':'short' Decl='X' 0x2905c20))
      (DeclRefExpr 0x2905ca0 'long long' Decl='Y' 0x2905c50))))

After...

(CompoundStmt 0x2b05c30
  (ReturnStmt 0x2b05c20
    (BinaryOperator 0x2b05c00 'int' '<'
      (ImplicitCastExpr 0x2b05bf0 'long long'
        (DeclRefExpr 0x2b05bb0 'S':'short' Decl='X' 0x2b05b50))
      (DeclRefExpr 0x2b05bd0 'long long' Decl='Y' 0x2b05b80))))

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40999 91177308-0d34-0410-b5e6-96231b3b80d8
Sema/SemaExpr.cpp