teak-llvm/clang/test/CodeGenObjCXX/instantiate-return.mm
Akira Hatanaka ff6c4f3702 [Sema][ObjC] Ensure that the return type of an ObjC method is a complete
type.

Copy the code in ActOnStartOfFunctionDef that checks a function's return
type to ActOnStartOfObjCMethodDef. This fixes an assertion failure in
IRGen caused by an uninstantiated return type.

rdar://problem/38691818

llvm-svn: 329879
2018-04-12 06:01:41 +00:00

23 lines
416 B
Plaintext

// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -std=c++11 -o - %s | FileCheck %s
template <class T>
struct TemplateClass {
int a = 0;
};
struct S0;
@interface C1
- (TemplateClass<S0>)m1;
@end
// This code used to assert in CodeGen because the return type TemplateClass<S0>
// wasn't instantiated.
// CHECK: define internal i32 @"\01-[C1 m1]"(
@implementation C1
- (TemplateClass<S0>)m1 {
}
@end