llvm-project/clang/test/SemaObjC/default-synthesize-sourceloc.m
Adrian Prantl a1a9aa17b4 Set a source location for Objective-C accessor stubs
even when there is no explicit synthesize statement.

This fixes a regression introduced in https://reviews.llvm.org/D68108
that could lead to missing debug locations in cleanup code in
synthesized Objective-C++ properties.

rdar://57630879

Differential Revision: https://reviews.llvm.org/D71084
2019-12-05 12:45:10 -08:00

24 lines
519 B
Objective-C

// RUN: %clang_cc1 -ast-dump %s | FileCheck %s
// Test that accessor stubs for default-synthesized ObjC accessors
// have a valid source location.
__attribute__((objc_root_class))
@interface NSObject
+ (id)alloc;
@end
@interface NSString : NSObject
@end
@interface MyData : NSObject
struct Data {
NSString *name;
};
@property struct Data data;
@end
// CHECK: ObjCImplementationDecl {{.*}}line:[[@LINE+2]]{{.*}} MyData
// CHECK: ObjCMethodDecl {{.*}}col:23 implicit - setData: 'void'
@implementation MyData
@end