From: NAKAMURA Takumi Date: Wed, 29 Oct 2014 13:27:44 +0000 (+0000) Subject: clang/lib/AST/Decl.cpp: Tweak isVLATypeCapturingAllowed() for -Asserts. [-Wunused... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bd51d2f5496d0e6c9412b6409d1db1437564d67f;p=clang clang/lib/AST/Decl.cpp: Tweak isVLATypeCapturingAllowed() for -Asserts. [-Wunused-function] git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220853 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index 431adaf184..4337eab16b 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -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");