diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-10-21 03:57:52 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-10-21 03:57:52 +0000 |
commit | b57791e5b40afa6691063c83d0e95c416fb19fde (patch) | |
tree | d78816125dc3762c59239aa6630851f0c0b77ef3 /lib/Parse/ParseStmt.cpp | |
parent | 258f9a2c33b010ddeca6902012461cdd4d5f14ef (diff) |
Treat the Microsoft/Borland keyword "__except" as a context-sensitive
keyword, because both libstdc++ and libc++ use "__except" as an
identifier. Fixes <rdar://problem/10322555>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142636 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseStmt.cpp')
-rw-r--r-- | lib/Parse/ParseStmt.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/Parse/ParseStmt.cpp b/lib/Parse/ParseStmt.cpp index 3df761af44..8968a43480 100644 --- a/lib/Parse/ParseStmt.cpp +++ b/lib/Parse/ParseStmt.cpp @@ -355,7 +355,8 @@ StmtResult Parser::ParseSEHTryBlockCommon(SourceLocation TryLoc) { return move(TryBlock); StmtResult Handler; - if(Tok.is(tok::kw___except)) { + if (Tok.is(tok::identifier) && + Tok.getIdentifierInfo() == getSEHExceptKeyword()) { SourceLocation Loc = ConsumeToken(); Handler = ParseSEHExceptBlock(Loc); } else if (Tok.is(tok::kw___finally)) { @@ -2037,10 +2038,13 @@ StmtResult Parser::ParseCXXTryBlockCommon(SourceLocation TryLoc) { return move(TryBlock); // Borland allows SEH-handlers with 'try' - if(Tok.is(tok::kw___except) || Tok.is(tok::kw___finally)) { + + if((Tok.is(tok::identifier) && + Tok.getIdentifierInfo() == getSEHExceptKeyword()) || + Tok.is(tok::kw___finally)) { // TODO: Factor into common return ParseSEHHandlerCommon(...) StmtResult Handler; - if(Tok.is(tok::kw___except)) { + if(Tok.getIdentifierInfo() == getSEHExceptKeyword()) { SourceLocation Loc = ConsumeToken(); Handler = ParseSEHExceptBlock(Loc); } |