[cfe-commits] r41630 - /cfe/trunk/Sema/SemaExpr.cpp
    Steve Naroff 
    snaroff at apple.com
       
    Thu Aug 30 17:32:45 PDT 2007
    
    
  
Author: snaroff
Date: Thu Aug 30 19:32:44 2007
New Revision: 41630
URL: http://llvm.org/viewvc/llvm-project?rev=41630&view=rev
Log:
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...
Modified:
    cfe/trunk/Sema/SemaExpr.cpp
Modified: cfe/trunk/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Sema/SemaExpr.cpp?rev=41630&r1=41629&r2=41630&view=diff
==============================================================================
--- cfe/trunk/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/Sema/SemaExpr.cpp Thu Aug 30 19:32:44 2007
@@ -657,6 +657,8 @@
   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()) { 
    
    
More information about the cfe-commits
mailing list