From 85198c771c74d8e2ac1d028543075c1323208c11 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Sun, 3 Nov 2019 11:20:12 +0000 Subject: [PATCH] Fix line_iterator uninitialized variable warnings. NFCI. Allows us to auto define the default constructor as well. --- include/llvm/Support/LineIterator.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/llvm/Support/LineIterator.h b/include/llvm/Support/LineIterator.h index c9f10ca975a..2a1e47bfe5b 100644 --- a/include/llvm/Support/LineIterator.h +++ b/include/llvm/Support/LineIterator.h @@ -30,16 +30,16 @@ class MemoryBuffer; /// Note that this iterator requires the buffer to be nul terminated. class line_iterator : public std::iterator { - const MemoryBuffer *Buffer; - char CommentMarker; - bool SkipBlanks; + const MemoryBuffer *Buffer = nullptr; + char CommentMarker = '\0'; + bool SkipBlanks = true; - unsigned LineNumber; + unsigned LineNumber = 1; StringRef CurrentLine; public: /// Default construct an "end" iterator. - line_iterator() : Buffer(nullptr) {} + line_iterator() = default; /// Construct a new iterator around some memory buffer. explicit line_iterator(const MemoryBuffer &Buffer, bool SkipBlanks = true,