summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseStmt.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-10-25 01:33:02 +0000
committerDouglas Gregor <dgregor@apple.com>2011-10-25 01:33:02 +0000
commitdeb4a2be6742e9457e639548a05615c9674c22d4 (patch)
tree6d51e5336be7c931aed6c37a45227e981d076a87 /clang/lib/Parse/ParseStmt.cpp
parent4223b3b380d11a86d64ff370bf2742961d5d9fff (diff)
downloadbcm5719-llvm-deb4a2be6742e9457e639548a05615c9674c22d4.tar.gz
bcm5719-llvm-deb4a2be6742e9457e639548a05615c9674c22d4.zip
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". llvm-svn: 142901
Diffstat (limited to 'clang/lib/Parse/ParseStmt.cpp')
-rw-r--r--clang/lib/Parse/ParseStmt.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseStmt.cpp b/clang/lib/Parse/ParseStmt.cpp
index 5c2ed4e5f52..fb884349291 100644
--- a/clang/lib/Parse/ParseStmt.cpp
+++ b/clang/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;
}
OpenPOWER on IntegriCloud