aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2007-08-31 00:32:44 +0000
committerSteve Naroff <snaroff@apple.com>2007-08-31 00:32:44 +0000
commit711602bb16b25fd29b951193a5f8bcc8d7def56e (patch)
treeaab259e815ee76b523b57e0b0e8191b2cce5176f
parent42471f8bc6c1179a54941fac3c483ec1bd319436 (diff)
Sema::ParseCastExpr() missing call to UsualUnaryConversions().
The following case now works... void empty(void * a ) {} void test() { unsigned char A[4]; empty( (void *) A); } Thanks to Patrick Flannery for finding this... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41630 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--Sema/SemaExpr.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/Sema/SemaExpr.cpp b/Sema/SemaExpr.cpp
index 615b243334..a32e607aa4 100644
--- a/Sema/SemaExpr.cpp
+++ b/Sema/SemaExpr.cpp
@@ -657,6 +657,8 @@ ParseCastExpr(SourceLocation LParenLoc, TypeTy *Ty,
Expr *castExpr = static_cast<Expr*>(Op);
QualType castType = QualType::getFromOpaquePtr(Ty);
+ UsualUnaryConversions(castExpr);
+
// C99 6.5.4p2: the cast type needs to be void or scalar and the expression
// type needs to be scalar.
if (!castType->isScalarType() && !castType->isVoidType()) {