1// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -debug-info-kind=limited -emit-llvm %s -o /dev/null
2
3// This test passes if clang doesn't crash.
4
5template <class C> class scoped_ptr {
6public:
7  C* operator->() const { return 0; }
8};
9
10@class NSWindow;
11@class NSImage;
12@interface NSWindow {
13  NSImage *_miniIcon;
14}
15-(id)windowController;
16@end
17
18class AutomationResourceTracker {
19public:
20  NSWindow* GetResource(int handle) { return 0; }
21};
22
23# 13 "automation/automation_window_tracker.h"
24class AutomationWindowTracker : public AutomationResourceTracker { };
25
26template<typename NST> class scoped_nsobject { };
27
28@interface TabStripController{
29  scoped_nsobject<NSImage> defaultFavicon_;
30}
31@end
32
33@interface BrowserWindowController {
34  TabStripController* tabStripController_;
35}
36@end
37
38void WindowGetViewBounds(scoped_ptr<AutomationWindowTracker> window_tracker_) {
39  NSWindow* window = window_tracker_->GetResource(42);
40  BrowserWindowController* controller = [window windowController];
41}
42