Commit 8f7b9f93 authored by erikchen's avatar erikchen Committed by Commit bot

mac: Suppress a clang warning in CustomFrameView.

Clang's static analyzer emits the warning "-Wobjc-designated-initializers" for
CustomFrameView, because CustomFrameView overrides two designated initializers,
but the methods don't call super. The methods throw exceptions, which Clang's
static analyzer isn't smart enough to catch. Declaring the methods with
NS_UNAVAILABLE suppresses the clang warning.

BUG=

Review URL: https://codereview.chromium.org/1101923002

Cr-Commit-Position: refs/heads/master@{#329971}
parent 1a4bbd1c
......@@ -23,6 +23,12 @@
@interface CustomFrameView : NSView
// Clang emits a warning if designated initializers don't call the super
// initializer, even if the method raises an exception.
// http://www.crbug.com/479019.
- (id)initWithFrame:(NSRect)frame UNAVAILABLE_ATTRIBUTE;
- (id)initWithCoder:(NSCoder*)coder UNAVAILABLE_ATTRIBUTE;
@end
@implementation CustomFrameView
......@@ -77,12 +83,6 @@
}
}
// TODO(erikchen): Clang throws a warning if a designated initializer doesn't
// call the super initializer, even if the method raises an exception. These
// pragmas shouldn't be necessary.
// http://www.crbug.com/479019.
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wobjc-designated-initializers"
- (id)initWithFrame:(NSRect)frame {
// This class is not for instantiating.
[self doesNotRecognizeSelector:_cmd];
......@@ -94,7 +94,6 @@
[self doesNotRecognizeSelector:_cmd];
return nil;
}
#pragma clang diagnostic pop
// Override to move the fullscreen button to the left of the profile avatar.
- (NSPoint)_fullScreenButtonOrigin {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment