From f8a964d2b0ce123314504deccfbb7020f1062289 Mon Sep 17 00:00:00 2001 From: Ankur Dave Date: Wed, 21 Dec 2016 17:49:45 -0800 Subject: [PATCH] Fix call to Verifier::VerifyBuffer from BufferRef (#4124) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 3a1f776132cf9377e3a85a888e6ff2bc12c7248c added a required identifier parameter to Verifier::VerifyBuffer but did not update the templated call site in BufferRef. This causes errors like the following when trying to instantiate the call site by calling BufferRef::Verify(): include/flatbuffers/flatbuffers.h: In instantiation of ‘bool flatbuffers::BufferRef::Verify() [with T = MyType]’: MyApp.cpp:16:3: required from here include/flatbuffers/flatbuffers.h:1421:37: error: no matching function for call to ‘flatbuffers::Verifier::VerifyBuffer()’ return verifier.VerifyBuffer(); ^ include/flatbuffers/flatbuffers.h:1421:37: note: candidate is: include/flatbuffers/flatbuffers.h:1352:29: note: template bool flatbuffers::Verifier::VerifyBuffer(const char*) template bool VerifyBuffer(const char *identifier) { ^ include/flatbuffers/flatbuffers.h:1352:29: note: template argument deduction/substitution failed: include/flatbuffers/flatbuffers.h:1421:37: note: candidate expects 1 argument, 0 provided return verifier.VerifyBuffer(); ^ This commit fixes the BufferRef call site by adding a nullptr argument. --- include/flatbuffers/flatbuffers.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/flatbuffers/flatbuffers.h b/include/flatbuffers/flatbuffers.h index bae169803..99d1ca818 100644 --- a/include/flatbuffers/flatbuffers.h +++ b/include/flatbuffers/flatbuffers.h @@ -1502,7 +1502,7 @@ template struct BufferRef : BufferRefBase { bool Verify() { Verifier verifier(buf, len); - return verifier.VerifyBuffer(); + return verifier.VerifyBuffer(nullptr); } uint8_t *buf;