aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/RAIIObjectsForParser.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-12-10 02:08:07 +0000
committerChris Lattner <sabre@nondot.org>2009-12-10 02:08:07 +0000
commit932dff777d58a23e3a26967a61bb52697c542fd4 (patch)
tree15c343d9ba56c3a30f25c816c4bfa1cffbfabc09 /lib/Parse/RAIIObjectsForParser.h
parenta69d0ed3ab66e96393586664a103e9482ec59e6f (diff)
If we enter parens, colons can become un-sacred, allowing us to emit
a better diagnostic in the second example. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91040 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/RAIIObjectsForParser.h')
-rw-r--r--lib/Parse/RAIIObjectsForParser.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Parse/RAIIObjectsForParser.h b/lib/Parse/RAIIObjectsForParser.h
index 93b9a82fdc..d048f04341 100644
--- a/lib/Parse/RAIIObjectsForParser.h
+++ b/lib/Parse/RAIIObjectsForParser.h
@@ -48,8 +48,9 @@ namespace clang {
Parser &P;
bool OldVal;
public:
- ColonProtectionRAIIObject(Parser &p) : P(p), OldVal(P.ColonIsSacred) {
- P.ColonIsSacred = true;
+ ColonProtectionRAIIObject(Parser &p, bool Value = true)
+ : P(p), OldVal(P.ColonIsSacred) {
+ P.ColonIsSacred = Value;
}
/// restore - This can be used to restore the state early, before the dtor