diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2011-10-02 23:49:15 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2011-10-02 23:49:15 +0000 |
commit | 8591a7f5215f6469603e6bc8f4fdbcc78e215ab9 (patch) | |
tree | e99806082ae238b244b91942709764bc87ab3928 /lib/Sema/SemaExpr.cpp | |
parent | 80d2355df4a87b52412cc7481496c4a4eccd3db1 (diff) |
CUDA: diagnose unconfigured calls to global functions
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140975 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index d0a3f6b5ec..eb5678e7f0 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -3655,6 +3655,11 @@ Sema::BuildResolvedCallExpr(Expr *Fn, NamedDecl *NDecl, if (!FuncT->getResultType()->isVoidType()) return ExprError(Diag(LParenLoc, diag::err_kern_type_not_void_return) << Fn->getType() << Fn->getSourceRange()); + } else { + // CUDA: Calls to global functions must be configured + if (FDecl && FDecl->hasAttr<CUDAGlobalAttr>()) + return ExprError(Diag(LParenLoc, diag::err_global_call_not_config) + << FDecl->getName() << Fn->getSourceRange()); } } |