summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-09-26 14:00:45 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-09-26 14:01:09 (GMT)
commit5f702f97a89129a39bcf1ecf9823d60a2793e35e (patch)
tree58f4c2d6d0bc9c1f7a8518b76f1a19404ba38c4a /Source
parent3181f8405bc949affb8ea321ec7746b44717fd99 (diff)
parent3c8187f68730b180cd6fad898eb81bdeaf488bb8 (diff)
downloadCMake-5f702f97a89129a39bcf1ecf9823d60a2793e35e.zip
CMake-5f702f97a89129a39bcf1ecf9823d60a2793e35e.tar.gz
CMake-5f702f97a89129a39bcf1ecf9823d60a2793e35e.tar.bz2
Merge topic 'refactor-backtrace'
3c8187f687 clang-tidy: restore 'misc-noexcept-move-constructor' 6c2af9d302 cmListFileCache: Add missing assertion in backtrace Top method Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2415
Diffstat (limited to 'Source')
-rw-r--r--Source/cmListFileCache.cxx1
-rw-r--r--Source/cmListFileCache.h8
2 files changed, 6 insertions, 3 deletions
diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx
index e465e1a..4d7e1e2 100644
--- a/Source/cmListFileCache.cxx
+++ b/Source/cmListFileCache.cxx
@@ -377,6 +377,7 @@ cmListFileBacktrace cmListFileBacktrace::Pop() const
cmListFileContext const& cmListFileBacktrace::Top() const
{
assert(this->TopEntry);
+ assert(!this->TopEntry->IsBottom());
return this->TopEntry->Context;
}
diff --git a/Source/cmListFileCache.h b/Source/cmListFileCache.h
index 2c91f7a..3d3afdf 100644
--- a/Source/cmListFileCache.h
+++ b/Source/cmListFileCache.h
@@ -124,9 +124,11 @@ public:
// Backtraces may be copied, moved, and assigned as values.
cmListFileBacktrace(cmListFileBacktrace const&) = default;
- cmListFileBacktrace(cmListFileBacktrace&&) noexcept = default;
+ cmListFileBacktrace(cmListFileBacktrace&&) // NOLINT(clang-tidy)
+ noexcept = default;
cmListFileBacktrace& operator=(cmListFileBacktrace const&) = default;
- cmListFileBacktrace& operator=(cmListFileBacktrace&&) noexcept = default;
+ cmListFileBacktrace& operator=(cmListFileBacktrace&&) // NOLINT(clang-tidy)
+ noexcept = default;
~cmListFileBacktrace() = default;
cmStateSnapshot GetBottom() const;
@@ -144,7 +146,7 @@ public:
cmListFileBacktrace Pop() const;
// Get the context at the top of the backtrace.
- // Returns an empty context if the backtrace is empty.
+ // This may be called only if Empty() would return false.
cmListFileContext const& Top() const;
// Print the top of the backtrace.