summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/RAIIObjectsForParser.h
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Parse/RAIIObjectsForParser.h')
-rw-r--r--clang/lib/Parse/RAIIObjectsForParser.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/clang/lib/Parse/RAIIObjectsForParser.h b/clang/lib/Parse/RAIIObjectsForParser.h
index d18d2f80263..bacdf29c8ae 100644
--- a/clang/lib/Parse/RAIIObjectsForParser.h
+++ b/clang/lib/Parse/RAIIObjectsForParser.h
@@ -50,9 +50,15 @@ namespace clang {
P.ColonIsSacred = true;
}
- ~ColonProtectionRAIIObject() {
+ /// restore - This can be used to restore the state early, before the dtor
+ /// is run.
+ void restore() {
P.ColonIsSacred = OldVal;
}
+
+ ~ColonProtectionRAIIObject() {
+ restore();
+ }
};
} // end namespace clang
OpenPOWER on IntegriCloud