summaryrefslogtreecommitdiffstats
path: root/lib/Sema/CXXFieldCollector.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sema/CXXFieldCollector.h')
-rw-r--r--lib/Sema/CXXFieldCollector.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Sema/CXXFieldCollector.h b/lib/Sema/CXXFieldCollector.h
index 69d1351..63c6ee3 100644
--- a/lib/Sema/CXXFieldCollector.h
+++ b/lib/Sema/CXXFieldCollector.h
@@ -58,7 +58,10 @@ public:
}
/// getCurNumField - The number of fields added to the currently parsed class.
- size_t getCurNumFields() const { return FieldCount.back(); }
+ size_t getCurNumFields() const {
+ assert(!FieldCount.empty() && "no currently-parsed class");
+ return FieldCount.back();
+ }
/// getCurFields - Pointer to array of fields added to the currently parsed
/// class.
OpenPOWER on IntegriCloud