From bd51d2f5496d0e6c9412b6409d1db1437564d67f Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Wed, 29 Oct 2014 13:27:44 +0000 Subject: [PATCH] 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 --- lib/AST/Decl.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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"); -- 2.40.0