r360089 - [Sema] Fix for P41774 where `ExpectNoDerefChunk` is assigned twice

Leonard Chan via cfe-commits cfe-commits at lists.llvm.org
Mon May 6 15:09:12 PDT 2019


Author: leonardchan
Date: Mon May  6 15:09:12 2019
New Revision: 360089

URL: http://llvm.org/viewvc/llvm-project?rev=360089&view=rev
Log:
[Sema] Fix for P41774 where `ExpectNoDerefChunk` is assigned twice

Modified:
    cfe/trunk/lib/Sema/SemaType.cpp

Modified: cfe/trunk/lib/Sema/SemaType.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaType.cpp?rev=360089&r1=360088&r2=360089&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaType.cpp (original)
+++ cfe/trunk/lib/Sema/SemaType.cpp Mon May  6 15:09:12 2019
@@ -4979,11 +4979,8 @@ static TypeSourceInfo *GetFullTypeForDec
     processTypeAttrs(state, T, TAL_DeclChunk, DeclType.getAttrs());
 
     if (DeclType.Kind != DeclaratorChunk::Paren) {
-      if (ExpectNoDerefChunk) {
-        if (!IsNoDerefableChunk(DeclType))
-          S.Diag(DeclType.Loc, diag::warn_noderef_on_non_pointer_or_array);
-        ExpectNoDerefChunk = false;
-      }
+      if (ExpectNoDerefChunk && !IsNoDerefableChunk(DeclType))
+        S.Diag(DeclType.Loc, diag::warn_noderef_on_non_pointer_or_array);
 
       ExpectNoDerefChunk = state.didParseNoDeref();
     }




More information about the cfe-commits mailing list