<div dir="auto">LGTM</div><div class="gmail_extra"><br><div class="gmail_quote">On 6 Oct 2016 8:58 am, "David Sheinkman via cfe-commits" <<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: davidsh<br>
Date: Thu Oct 6 10:47:36 2016<br>
New Revision: 283460<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=283460&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=283460&view=rev</a><br>
Log:<br>
[OpenMP] Check if the template specialization is mappable instead of specialized template Differential Revision: <a href="https://reviews.llvm.org/D25252" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D25252</a><br>
<br>
Modified:<br>
cfe/trunk/lib/Sema/SemaOpenMP.<wbr>cpp<br>
cfe/trunk/test/OpenMP/target_<wbr>map_messages.cpp<br>
<br>
Modified: cfe/trunk/lib/Sema/SemaOpenMP.<wbr>cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOpenMP.cpp?rev=283460&r1=283459&r2=283460&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/lib/Sema/<wbr>SemaOpenMP.cpp?rev=283460&r1=<wbr>283459&r2=283460&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/lib/Sema/SemaOpenMP.<wbr>cpp (original)<br>
+++ cfe/trunk/lib/Sema/SemaOpenMP.<wbr>cpp Thu Oct 6 10:47:36 2016<br>
@@ -10523,9 +10523,6 @@ static bool IsCXXRecordForMappable(Sema<br>
if (!RD || RD->isInvalidDecl())<br>
return true;<br>
<br>
- if (auto *CTSD = dyn_cast<<wbr>ClassTemplateSpecializationDec<wbr>l>(RD))<br>
- if (auto *CTD = CTSD->getSpecializedTemplate()<wbr>)<br>
- RD = CTD->getTemplatedDecl();<br>
auto QTy = SemaRef.Context.getRecordType(<wbr>RD);<br>
if (RD->isDynamicClass()) {<br>
SemaRef.Diag(Loc, diag::err_omp_not_mappable_<wbr>type) << QTy;<br>
<br>
Modified: cfe/trunk/test/OpenMP/target_<wbr>map_messages.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/target_map_messages.cpp?rev=283460&r1=283459&r2=283460&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/test/OpenMP/<wbr>target_map_messages.cpp?rev=<wbr>283460&r1=283459&r2=283460&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/test/OpenMP/target_<wbr>map_messages.cpp (original)<br>
+++ cfe/trunk/test/OpenMP/target_<wbr>map_messages.cpp Thu Oct 6 10:47:36 2016<br>
@@ -347,6 +347,15 @@ public:<br>
S5(int v):a(v) { }<br>
};<br>
<br>
+template <class T><br>
+struct S6;<br>
+<br>
+template<><br>
+struct S6<int> // expected-note {{mappable type cannot be polymorphic}}<br>
+{<br>
+ virtual void foo();<br>
+};<br>
+<br>
S3 h;<br>
#pragma omp threadprivate(h) // expected-note 2 {{defined as threadprivate or thread local}}<br>
<br>
@@ -451,6 +460,7 @@ int main(int argc, char **argv) {<br>
int i;<br>
int &j = i;<br>
int *k = &j;<br>
+ S6<int> m;<br>
int x;<br>
int y;<br>
int to, tofrom, always;<br>
@@ -513,6 +523,8 @@ int main(int argc, char **argv) {<br>
{}<br>
#pragma omp target firstprivate(j) map(j) // expected-error {{firstprivate variable cannot be in a map clause in '#pragma omp target' directive}} expected-note {{defined as firstprivate}}<br>
{}<br>
+#pragma omp target map(m) // expected-error {{type 'S6<int>' is not mappable to target}}<br>
+ {}<br>
return tmain<int, 3>(argc)+tmain<from, 4>(argc); // expected-note {{in instantiation of function template specialization 'tmain<int, 3>' requested here}} expected-note {{in instantiation of function template specialization 'tmain<int, 4>' requested here}}<br>
}<br>
#endif<br>
<br>
<br>
______________________________<wbr>_________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-commits</a><br>
</blockquote></div></div>