summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorArtem Belevich <tra@google.com>2016-12-07 19:27:16 +0000
committerArtem Belevich <tra@google.com>2016-12-07 19:27:16 +0000
commit13e9b4d76851d987381d650f63fad1c272fc0239 (patch)
tree481481d7409f445b65d7982d1f3776bfbb28cf12 /clang/lib/Sema/SemaDecl.cpp
parent34264e17699d56deb8051de2f9ae28abb948bb05 (diff)
downloadbcm5719-llvm-13e9b4d76851d987381d650f63fad1c272fc0239.tar.gz
bcm5719-llvm-13e9b4d76851d987381d650f63fad1c272fc0239.zip
[CUDA] Improve target attribute checking for function templates.
* __host__ __device__ functions are no longer considered to be redeclarations of __host__ or __device__ functions. This prevents unintentional merging of target attributes across them. * Function target attributes are not considered (and must match) during explicit instantiation and specialization of function templates. Differential Revision: https://reviews.llvm.org/D25809 llvm-svn: 288962
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 1650a11222c..be2466c9235 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -9090,6 +9090,9 @@ bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD,
diag::warn_cxx1z_compat_exception_spec_in_signature)
<< NewFD;
}
+
+ if (!Redeclaration && LangOpts.CUDA)
+ checkCUDATargetOverload(NewFD, Previous);
}
return Redeclaration;
}
OpenPOWER on IntegriCloud