2010-11-25 22:39:17 +01:00
|
|
|
// RUN: %llvmgxx -xc++ %s -S -o - | grep callDefaultCtor | \
|
2007-04-15 22:41:31 +02:00
|
|
|
// RUN: not grep declare
|
2004-11-30 19:25:12 +01:00
|
|
|
|
|
|
|
// This is a testcase for LLVM PR445, which was a problem where the
|
|
|
|
// instantiation of callDefaultCtor was not being emitted correctly.
|
|
|
|
|
|
|
|
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>); }
|
|
|
|
|