OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [obj-c++.dg/] [super-dealloc-1.mm] - Diff between revs 154 and 816

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 154 Rev 816
/* Check for warnings about missing [super dealloc] calls.  */
/* Check for warnings about missing [super dealloc] calls.  */
/* Author: Ziemowit Laski   */
/* Author: Ziemowit Laski   */
/* { dg-do compile } */
/* { dg-do compile } */
@interface Foo {
@interface Foo {
  void *isa;
  void *isa;
}
}
- (void) dealloc;
- (void) dealloc;
- (void) some_other;
- (void) some_other;
@end
@end
@interface Bar: Foo {
@interface Bar: Foo {
  void *casa;
  void *casa;
}
}
- (void) dealloc;
- (void) dealloc;
@end
@end
@interface Baz: Bar {
@interface Baz: Bar {
  void *usa;
  void *usa;
}
}
- (void) dealloc;
- (void) dealloc;
@end
@end
@implementation Foo
@implementation Foo
- (void) dealloc {
- (void) dealloc {
  isa = 0;   /* Should not warn here.  */
  isa = 0;   /* Should not warn here.  */
}
}
- (void) some_other {
- (void) some_other {
  isa = (void *)-1;
  isa = (void *)-1;
}
}
@end
@end
@implementation Bar
@implementation Bar
- (void) dealloc {
- (void) dealloc {
  casa = 0;
  casa = 0;
  [super some_other];
  [super some_other];
}  /* { dg-warning "method possibly missing a .super dealloc. call" } */
}  /* { dg-warning "method possibly missing a .super dealloc. call" } */
@end
@end
@implementation Baz
@implementation Baz
- (void) dealloc {
- (void) dealloc {
  usa = 0;
  usa = 0;
  [super dealloc];  /* Should not warn here.  */
  [super dealloc];  /* Should not warn here.  */
}
}
@end
@end
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.