diff options
-rw-r--r-- | Sema/SemaExpr.cpp | 4 | ||||
-rw-r--r-- | clang.xcodeproj/project.pbxproj | 1 | ||||
-rw-r--r-- | test/Sema/usual-float.c | 8 |
3 files changed, 10 insertions, 3 deletions
diff --git a/Sema/SemaExpr.cpp b/Sema/SemaExpr.cpp index 111ddbaaad..47cbbcabf3 100644 --- a/Sema/SemaExpr.cpp +++ b/Sema/SemaExpr.cpp @@ -870,8 +870,8 @@ QualType Sema::UsualArithmeticConversions(Expr *&lhsExpr, Expr *&rhsExpr, } // For conversion purposes, we ignore any qualifiers. // For example, "const float" and "float" are equivalent. - QualType lhs = lhsExpr->getType().getUnqualifiedType(); - QualType rhs = rhsExpr->getType().getUnqualifiedType(); + QualType lhs = lhsExpr->getType().getCanonicalType().getUnqualifiedType(); + QualType rhs = rhsExpr->getType().getCanonicalType().getUnqualifiedType(); // If both types are identical, no conversion is needed. if (lhs == rhs) diff --git a/clang.xcodeproj/project.pbxproj b/clang.xcodeproj/project.pbxproj index ffe6580cb2..b9eb859d85 100644 --- a/clang.xcodeproj/project.pbxproj +++ b/clang.xcodeproj/project.pbxproj @@ -764,6 +764,7 @@ 08FB7793FE84155DC02AAC07 /* Project object */ = { isa = PBXProject; buildConfigurationList = 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "clang" */; + compatibilityVersion = "Xcode 2.4"; hasScannedForEncodings = 1; mainGroup = 08FB7794FE84155DC02AAC07 /* clang */; projectDirPath = ""; diff --git a/test/Sema/usual-float.c b/test/Sema/usual-float.c index 81e9e6d04b..9c1977ff24 100644 --- a/test/Sema/usual-float.c +++ b/test/Sema/usual-float.c @@ -1,6 +1,12 @@ // RUN: clang %s -fsyntax-only +typedef float CGFloat; + +extern void func(CGFloat); void foo(int dir, int n, int tindex) { const float PI = 3.142; -float ang = (float) tindex * (-dir*2.0f*PI/n); + CGFloat cgf = 3.4; + + float ang = (float) tindex * (-dir*2.0f*PI/n); + func((CGFloat)cgf/65535.0f); } |