summaryrefslogtreecommitdiffstats
path: root/clang/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/Sema/SemaExpr.cpp')
-rw-r--r--clang/Sema/SemaExpr.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/Sema/SemaExpr.cpp b/clang/Sema/SemaExpr.cpp
index 8a3576aaf3a..6b871b4812b 100644
--- a/clang/Sema/SemaExpr.cpp
+++ b/clang/Sema/SemaExpr.cpp
@@ -22,6 +22,7 @@
#include "clang/Basic/LangOptions.h"
#include "clang/Basic/TargetInfo.h"
#include "llvm/ADT/SmallString.h"
+#include "llvm/ADT/StringExtras.h"
using namespace clang;
/// ParseStringLiteral - The specified tokens were lexed as pasted string
@@ -555,6 +556,13 @@ ParseCallExpr(ExprTy *fn, SourceLocation LParenLoc,
if (NumArgsInCall != NumArgsInProto && !proto->isVariadic())
return true;
}
+
+ // Do special checking on direct calls to functions.
+ if (ImplicitCastExpr *IcExpr = dyn_cast<ImplicitCastExpr>(Fn))
+ if (DeclRefExpr *DRExpr = dyn_cast<DeclRefExpr>(IcExpr->getSubExpr()))
+ if (FunctionDecl *FDecl = dyn_cast<FunctionDecl>(DRExpr->getDecl()))
+ CheckFunctionCall(Fn, FDecl, Args, NumArgsInCall);
+
return new CallExpr(Fn, Args, NumArgsInCall, resultType, RParenLoc);
}
OpenPOWER on IntegriCloud