[cfe-commits] r39598 - /cfe/cfe/trunk/Sema/SemaExpr.cpp

clattner at cs.uiuc.edu clattner at cs.uiuc.edu
Wed Jul 11 09:46:05 PDT 2007


Author: clattner
Date: Wed Jul 11 11:46:05 2007
New Revision: 39598

URL: http://llvm.org/viewvc/llvm-project?rev=39598&view=rev
Log:
Fix semantic analysis of calls on stuff like:

int func() {
 int (*FP)();
 FP();
 (*****FP)();
}

Modified:
    cfe/cfe/trunk/Sema/SemaExpr.cpp

Modified: cfe/cfe/trunk/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Sema/SemaExpr.cpp?rev=39598&r1=39597&r2=39598&view=diff

==============================================================================
--- cfe/cfe/trunk/Sema/SemaExpr.cpp (original)
+++ cfe/cfe/trunk/Sema/SemaExpr.cpp Wed Jul 11 11:46:05 2007
@@ -364,10 +364,12 @@
   Expr *funcExpr = (Expr *)Fn;
   assert(funcExpr && "no function call expression");
   
-  QualType qType = funcExpr->getType();
+  QualType qType = UsualUnaryConversions(funcExpr->getType());
   assert(!qType.isNull() && "no type for function call expression");
 
-  const FunctionType *funcT = dyn_cast<FunctionType>(qType.getCanonicalType());
+  const PointerType *PT = dyn_cast<PointerType>(qType.getCanonicalType());
+  
+  const FunctionType *funcT = dyn_cast<FunctionType>(PT->getPointeeType());
   assert(funcT && "ParseCallExpr(): not a function type");
     
   // If a prototype isn't declared, the parser implicitly defines a func decl





More information about the cfe-commits mailing list