2010-11-25 21:39:17 +00:00
|
|
|
// RUN: %llvmgxx -xc++ %s -S -o - | grep callDefaultCtor | \
|
2007-04-15 20:41:31 +00:00
|
|
|
// RUN: not grep declare
|
2004-11-30 18:25:12 +00: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>); }
|
|
|
|
|