LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 2592 - Classes with only SEL ivars flagged as missing -dealloc
Summary: Classes with only SEL ivars flagged as missing -dealloc
Status: RESOLVED FIXED
Alias: None
Product: clang
Classification: Unclassified
Component: Static Analyzer (show other bugs)
Version: unspecified
Hardware: PC All
: P normal
Assignee: Ted Kremenek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-24 02:20 PDT by Quentin Carnicelli
Modified: 2018-11-07 00:22 PST (History)
3 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Quentin Carnicelli 2008-07-24 02:20:29 PDT
The following class generates a MissingDealloc warning:

@interface TestSELs : NSObject
{
	SEL a;
	SEL b;
}

@end

@implementation TestSELs

- (id)init
{
	if( (self = [super init]) )
	{
		a = @selector(a);
		b = @selector(b);
	}
	
	return self;
}

@end

Selectors aren't releasable objects (as far as anybody has ever told me...), so a -dealloc method isn't required. Not generating a MissingDealloc warning would thus be preferred.
Comment 1 Ted Kremenek 2008-07-24 13:15:05 PDT
Fixed in r53987:

http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20080721/006662.html

Included in checker-68.

Quentin: If it isn't any trouble, please verify that this fix does the right thing on your own code.