[cfe-commits] r166562 - /cfe/trunk/test/SemaObjCXX/decltype.mm

Douglas Gregor dgregor at apple.com
Wed Oct 24 07:13:21 PDT 2012


Author: dgregor
Date: Wed Oct 24 09:13:21 2012
New Revision: 166562

URL: http://llvm.org/viewvc/llvm-project?rev=166562&view=rev
Log:
Add a simple test involving decltype on Objective-C properties and ivars

Added:
    cfe/trunk/test/SemaObjCXX/decltype.mm

Added: cfe/trunk/test/SemaObjCXX/decltype.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjCXX/decltype.mm?rev=166562&view=auto
==============================================================================
--- cfe/trunk/test/SemaObjCXX/decltype.mm (added)
+++ cfe/trunk/test/SemaObjCXX/decltype.mm Wed Oct 24 09:13:21 2012
@@ -0,0 +1,25 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
+// expected-no-diagnostics
+struct HasValueType {
+  typedef int value_type;
+};
+
+__attribute__((objc_root_class))
+ at interface Foo
+{
+ at protected
+    HasValueType foo;
+}
+
+ at property (nonatomic) HasValueType bar;
+ at end
+
+ at implementation Foo
+ at synthesize bar;
+
+- (void)test {
+  decltype(foo)::value_type vt1;
+  decltype(self->foo)::value_type vt2;
+  decltype(self.bar)::value_type vt3;
+}
+ at end





More information about the cfe-commits mailing list