summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseExpr.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-01-27 20:28:01 +0000
committerDouglas Gregor <dgregor@apple.com>2011-01-27 20:28:01 +0000
commit8006e76b4edfffacb7946fa08ddad2996fe730b2 (patch)
tree0cf03fb15105d705726163273fa74f80ec503405 /clang/lib/Parse/ParseExpr.cpp
parenta462f5cc073a5103850ca9508faa33bfb848a2f0 (diff)
downloadbcm5719-llvm-8006e76b4edfffacb7946fa08ddad2996fe730b2.tar.gz
bcm5719-llvm-8006e76b4edfffacb7946fa08ddad2996fe730b2.zip
Implement the Microsoft __is_convertible_to type trait, modeling the
semantics after the C++0x is_convertible type trait. This implementation is not 100% complete, because it allows access errors to be hard errors (rather than just evaluating false). Original patch by Steven Watanabe! llvm-svn: 124425
Diffstat (limited to 'clang/lib/Parse/ParseExpr.cpp')
-rw-r--r--clang/lib/Parse/ParseExpr.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Parse/ParseExpr.cpp b/clang/lib/Parse/ParseExpr.cpp
index 67351f7e2fc..5928871987f 100644
--- a/clang/lib/Parse/ParseExpr.cpp
+++ b/clang/lib/Parse/ParseExpr.cpp
@@ -537,8 +537,9 @@ ExprResult Parser::ParseCastExpression(bool isUnaryExpression,
/// '__is_polymorphic'
/// '__is_union'
///
-/// [GNU] binary-type-trait:
-/// '__is_base_of' [TODO]
+/// binary-type-trait:
+/// [GNU] '__is_base_of'
+/// [MS] '__is_convertible_to'
///
ExprResult Parser::ParseCastExpression(bool isUnaryExpression,
bool isAddressOfOperand,
@@ -988,6 +989,7 @@ ExprResult Parser::ParseCastExpression(bool isUnaryExpression,
case tok::kw___builtin_types_compatible_p:
case tok::kw___is_base_of:
+ case tok::kw___is_convertible_to:
return ParseBinaryTypeTrait();
case tok::at: {
OpenPOWER on IntegriCloud