annotate clang/test/SemaObjCXX/missing-lhs-gun-extension.mm @ 236:c4bab56944e8 llvm-original

LLVM 16
author kono
date Wed, 09 Nov 2022 17:45:10 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
anatofuz
parents:
diff changeset
2 // expected-no-diagnostics
anatofuz
parents:
diff changeset
3 // rdar://13749180
anatofuz
parents:
diff changeset
4
anatofuz
parents:
diff changeset
5 @interface NSDictionary
anatofuz
parents:
diff changeset
6 - (id)objectForKeyedSubscript:(id)key;
anatofuz
parents:
diff changeset
7 - (void)setObject:(id)object forKeyedSubscript:(id)key;
anatofuz
parents:
diff changeset
8 - (int &) random;
anatofuz
parents:
diff changeset
9 @end
anatofuz
parents:
diff changeset
10
anatofuz
parents:
diff changeset
11 @class NSString;
anatofuz
parents:
diff changeset
12
anatofuz
parents:
diff changeset
13 template <class T, class U = T> T tfoo(U x) { return x; }
anatofuz
parents:
diff changeset
14
anatofuz
parents:
diff changeset
15 void func() {
anatofuz
parents:
diff changeset
16 NSDictionary* foo;
anatofuz
parents:
diff changeset
17 NSString* result = foo[@"bar"] ? : foo[@"baz"];
anatofuz
parents:
diff changeset
18
anatofuz
parents:
diff changeset
19 int (*fn)(int) = (&tfoo<int> ?: 0);
anatofuz
parents:
diff changeset
20
anatofuz
parents:
diff changeset
21 int x = 0;
anatofuz
parents:
diff changeset
22 const int &y = foo.random ?: x;
anatofuz
parents:
diff changeset
23 }