diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2013-07-20 00:40:58 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2013-07-20 00:40:58 +0000 |
commit | a5e660188a3c654cf0c88ed1093b28207e870b2b (patch) | |
tree | d6fbac0c3542c6428acd7c93ce9bfd7bb0bb1ff0 /test/SemaObjC/property-choose-expr.m | |
parent | 4384712b3a0aedd7c68d6abdb0407850f7b46c8b (diff) | |
download | clang-a5e660188a3c654cf0c88ed1093b28207e870b2b.tar.gz |
Make IgnoreParens() look through ChooseExprs.
This is the same way GenericSelectionExpr works, and it's generally a
more consistent approach.
A large part of this patch is devoted to caching the value of the condition
of a ChooseExpr; it's needed to avoid threading an ASTContext into
IgnoreParens().
Fixes <rdar://problem/14438917>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186738 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaObjC/property-choose-expr.m')
-rw-r--r-- | test/SemaObjC/property-choose-expr.m | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/SemaObjC/property-choose-expr.m b/test/SemaObjC/property-choose-expr.m new file mode 100644 index 0000000000..71265e5f8c --- /dev/null +++ b/test/SemaObjC/property-choose-expr.m @@ -0,0 +1,14 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s +// expected-no-diagnostics + +@interface NSArray +-(int)count; +@end + +// <rdar://problem/14438917> +char* f(NSArray *array) { + return _Generic(__builtin_choose_expr(__builtin_types_compatible_p(__typeof__(array.count), void), 0.f, array.count), + unsigned int:"uint", + float:"void", + default: "ignored"); +} |