diff options
Diffstat (limited to 'include/clang/Parse/Parser.h')
-rw-r--r-- | include/clang/Parse/Parser.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/include/clang/Parse/Parser.h b/include/clang/Parse/Parser.h index c6dad07aaa..1b2c32cddb 100644 --- a/include/clang/Parse/Parser.h +++ b/include/clang/Parse/Parser.h @@ -30,6 +30,7 @@ namespace clang { class DiagnosticBuilder; class Parser; class PragmaUnusedHandler; + class ColonProtectionRAIIObject; /// PrettyStackTraceParserEntry - If a crash happens while the parser is active, /// an entry is printed for it. @@ -47,6 +48,7 @@ public: /// class Parser { friend class PragmaUnusedHandler; + friend class ColonProtectionRAIIObject; PrettyStackTraceParserEntry CrashInfo; Preprocessor &PP; @@ -90,6 +92,12 @@ class Parser { /// template argument list, where the '>' closes the template /// argument list. bool GreaterThanIsOperator; + + /// ColonIsSacred - When this is false, we aggressively try to recover from + /// code like "foo : bar" as if it were a typo for "foo :: bar". This is not + /// safe in case statements and a few other things. This is managed by the + /// ColonProtectionRAIIObject RAII object. + bool ColonIsSacred; /// The "depth" of the template parameters currently being parsed. unsigned TemplateParameterDepth; @@ -890,8 +898,7 @@ private: bool ParseOptionalCXXScopeSpecifier(CXXScopeSpec &SS, TypeTy *ObjectType, - bool EnteringContext, - bool ColonIsSacred = false); + bool EnteringContext); //===--------------------------------------------------------------------===// // C++ 5.2p1: C++ Casts |