mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-27 12:46:08 +00:00

2004-03-08-ReinterpretCastCopy.cpp 2004-03-09-UnmangledBuiltinMethods.cpp 2004-03-15-CleanupsAndGotos.cpp 2004-06-08-LateTemplateInstantiation.cpp 2004-09-27-CompilerCrash.cpp 2004-09-27-DidntEmitTemplate.cpp 2004-11-27-ExceptionCleanupAssertion.cpp 2004-11-27-FriendDefaultArgCrash.cpp 2005-01-03-StaticInitializers.cpp from llvm/test/FrontendC++. llvm-svn: 138157
23 lines
512 B
C++
23 lines
512 B
C++
// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
|
|
|
|
// This is a testcase for LLVM PR445, which was a problem where the
|
|
// instantiation of callDefaultCtor was not being emitted correctly.
|
|
|
|
// CHECK-NOT: declare{{.*}}callDefaultCtor
|
|
struct Pass {};
|
|
|
|
template<typename PassName>
|
|
Pass *callDefaultCtor() { return new Pass(); }
|
|
|
|
void foo(Pass *(*C)());
|
|
|
|
struct basic_string {
|
|
bool empty() const { return true; }
|
|
};
|
|
|
|
|
|
bool foo2(basic_string &X) {
|
|
return X.empty();
|
|
}
|
|
void baz() { foo(callDefaultCtor<Pass>); }
|