]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/SemaObjCXX/missing-lhs-gun-extension.mm
Vendor import of clang release_34 branch r197841 (effectively, 3.4 RC3):
[FreeBSD/FreeBSD.git] / test / SemaObjCXX / missing-lhs-gun-extension.mm
1 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
2 // expected-no-diagnostics
3 // rdar://13749180
4
5 @interface NSDictionary
6 - (id)objectForKeyedSubscript:(id)key;
7 - (void)setObject:(id)object forKeyedSubscript:(id)key;
8 - (int &) random;
9 @end
10
11 @class NSString;
12
13 template <class T, class U = T> T tfoo(U x) { return x; }
14
15 void func() {
16   NSDictionary* foo;
17   NSString* result = foo[@"bar"] ? : foo[@"baz"];
18
19   int (*fn)(int) = (&tfoo<int> ?: 0);
20
21   int x = 0;
22   const int &y = foo.random ?: x;
23 }