]> granicus.if.org Git - clang/commitdiff
clang/lib/AST/Decl.cpp: Tweak isVLATypeCapturingAllowed() for -Asserts. [-Wunused...
authorNAKAMURA Takumi <geek4civic@gmail.com>
Wed, 29 Oct 2014 13:27:44 +0000 (13:27 +0000)
committerNAKAMURA Takumi <geek4civic@gmail.com>
Wed, 29 Oct 2014 13:27:44 +0000 (13:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220853 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/Decl.cpp

index 431adaf184f75e09161d384c5751d79b70a8e9ba..4337eab16b7e52c0edbfde542d1bba6310286b61 100644 (file)
@@ -3330,8 +3330,10 @@ SourceRange FieldDecl::getSourceRange() const {
 }
 
 void FieldDecl::setCapturedVLAType(const VariableArrayType *VLAType) {
-  assert(isVLATypeCapturingAllowed(getParent()) &&
+  bool fVLATypeCapturingAllowed = isVLATypeCapturingAllowed(getParent());
+  assert(fVLATypeCapturingAllowed &&
          "capturing type in non-lambda or captured record.");
+  (void)fVLATypeCapturingAllowed;
   assert(InitStorage.getInt() == ISK_BitWidthOrNothing &&
          InitStorage.getPointer() == nullptr &&
          "bit width, initializer or captured type already set");