diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-10-25 01:33:02 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-10-25 01:33:02 +0000 |
commit | ba0513de93d2fab6db5ab30b6927209fcc883078 (patch) | |
tree | 75067afaf5c45f10ab9a9647d6a372ddd925e4a1 /lib/Parse/ParseStmt.cpp | |
parent | f11e923433b62efb0fbaeb2573e8457f1c4a1b1e (diff) |
Implement support for dependent Microsoft __if_exists/__if_not_exists
statements. As noted in the documentation for the AST node, the
semantics of __if_exists/__if_not_exists are somewhat different from
the way Visual C++ implements them, because our parsed-template
representation can't accommodate VC++ semantics without serious
contortions. Hopefully this implementation is "good enough".
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142901 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseStmt.cpp')
-rw-r--r-- | lib/Parse/ParseStmt.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/Parse/ParseStmt.cpp b/lib/Parse/ParseStmt.cpp index 5c2ed4e5f5..fb88434929 100644 --- a/lib/Parse/ParseStmt.cpp +++ b/lib/Parse/ParseStmt.cpp @@ -2152,7 +2152,16 @@ void Parser::ParseMicrosoftIfExistsStatement(StmtVector &Stmts) { ParsedAttributes Attrs(AttrFactory); StmtResult Compound = ParseCompoundStatement(Attrs); - // FIXME: We're dropping these statements on the floor. + if (Compound.isInvalid()) + return; + + StmtResult DepResult = Actions.ActOnMSDependentExistsStmt(Result.KeywordLoc, + Result.IsIfExists, + Result.SS, + Result.Name, + Compound.get()); + if (DepResult.isUsable()) + Stmts.push_back(DepResult.get()); return; } |