1// RUN: %clang_cc1 -fsyntax-only -fblocks -verify -std=c++11 %s
2
3enum NSEventType {
4  NSEventTypeFlagsChanged = 12
5};
6
7enum NSEventMask {
8  NSEventMaskLeftMouseDown = 1
9};
10
11static const NSEventType NSFlagsChanged = NSEventTypeFlagsChanged;
12
13@interface NSObject
14@end
15@interface NSEvent : NSObject {
16}
17+ (nullable id)
18addMonitor:(NSEventMask)mask handler:(NSEvent *_Nullable (^)(NSEvent *))block;
19@end
20
21void test(id weakThis) {
22  id m_flagsChangedEventMonitor = [NSEvent
23      addMonitor:NSFlagsChangedMask //expected-error {{use of undeclared identifier 'NSFlagsChangedMask'}}
24         handler:[weakThis](NSEvent *flagsChangedEvent) {
25             return flagsChangedEvent;
26         }];
27}
28