[llvm-branch-commits] [cfe-branch] r261002 - Merging r260370:

Hans Wennborg via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Feb 16 11:47:17 PST 2016


Author: hans
Date: Tue Feb 16 13:47:16 2016
New Revision: 261002

URL: http://llvm.org/viewvc/llvm-project?rev=261002&view=rev
Log:
Merging r260370:
------------------------------------------------------------------------
r260370 | abataev | 2016-02-10 02:50:12 -0800 (Wed, 10 Feb 2016) | 1 line

Fix PR26543: add a check for definition in CXXRecordDecl.
------------------------------------------------------------------------

Modified:
    cfe/branches/release_38/   (props changed)
    cfe/branches/release_38/lib/Sema/SemaOpenMP.cpp
    cfe/branches/release_38/test/OpenMP/parallel_messages.cpp

Propchange: cfe/branches/release_38/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Feb 16 13:47:16 2016
@@ -1,4 +1,4 @@
 /cfe/branches/type-system-rewrite:134693-134817
-/cfe/trunk:257652,257695,257710,257831,257838,257853,257861,257869-257871,257947,258110,258396,259183,259260,259598,259931,260616,260637
+/cfe/trunk:257652,257695,257710,257831,257838,257853,257861,257869-257871,257947,258110,258396,259183,259260,259598,259931,260370,260616,260637
 /cfe/trunk/test:170344
 /cfe/trunk/test/SemaTemplate:126920

Modified: cfe/branches/release_38/lib/Sema/SemaOpenMP.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_38/lib/Sema/SemaOpenMP.cpp?rev=261002&r1=261001&r2=261002&view=diff
==============================================================================
--- cfe/branches/release_38/lib/Sema/SemaOpenMP.cpp (original)
+++ cfe/branches/release_38/lib/Sema/SemaOpenMP.cpp Tue Feb 16 13:47:16 2016
@@ -634,7 +634,8 @@ DSAStackTy::DSAVarData DSAStackTy::getTo
     if (auto *CTD = CTSD->getSpecializedTemplate())
       RD = CTD->getTemplatedDecl();
   if (IsConstant &&
-      !(SemaRef.getLangOpts().CPlusPlus && RD && RD->hasMutableFields())) {
+      !(SemaRef.getLangOpts().CPlusPlus && RD && RD->hasDefinition() &&
+        RD->hasMutableFields())) {
     // Variables with const-qualified type having no mutable member may be
     // listed in a firstprivate clause, even if they are static data members.
     DSAVarData DVarTemp = hasDSA(D, MatchesAnyClause(OMPC_firstprivate),

Modified: cfe/branches/release_38/test/OpenMP/parallel_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_38/test/OpenMP/parallel_messages.cpp?rev=261002&r1=261001&r2=261002&view=diff
==============================================================================
--- cfe/branches/release_38/test/OpenMP/parallel_messages.cpp (original)
+++ cfe/branches/release_38/test/OpenMP/parallel_messages.cpp Tue Feb 16 13:47:16 2016
@@ -5,7 +5,12 @@ void foo() {
 
 #pragma omp parallel // expected-error {{unexpected OpenMP directive '#pragma omp parallel'}}
 
+struct S;
+S& bar();
 int main(int argc, char **argv) {
+  S &s = bar();
+  #pragma omp parallel
+  (void)&s;
   #pragma omp parallel { // expected-warning {{extra tokens at the end of '#pragma omp parallel' are ignored}}
   foo();
   #pragma omp parallel ( // expected-warning {{extra tokens at the end of '#pragma omp parallel' are ignored}}




More information about the llvm-branch-commits mailing list