Add pre- and post-increment/decrement operators to CharUnits.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127937 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/clang/AST/CharUnits.h b/include/clang/AST/CharUnits.h
index cf909e8..5bfa19d 100644
--- a/include/clang/AST/CharUnits.h
+++ b/include/clang/AST/CharUnits.h
@@ -70,10 +70,24 @@
Quantity += Other.Quantity;
return *this;
}
+ CharUnits& operator++ () {
+ ++Quantity;
+ return *this;
+ }
+ CharUnits operator++ (int) {
+ return CharUnits(Quantity++);
+ }
CharUnits& operator-= (const CharUnits &Other) {
Quantity -= Other.Quantity;
return *this;
}
+ CharUnits& operator-- () {
+ --Quantity;
+ return *this;
+ }
+ CharUnits operator-- (int) {
+ return CharUnits(Quantity--);
+ }
// Comparison operators.
bool operator== (const CharUnits &Other) const {