blob: 706d541bee678e292bb0d7b15c06f53828e1098b [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001// RUN: %llvmgxx -xc++ %s -c -o - | llvm-dis | grep callDefaultCtor | \
2// RUN: not grep declare
3
4// This is a testcase for LLVM PR445, which was a problem where the
5// instantiation of callDefaultCtor was not being emitted correctly.
6
7struct Pass {};
8
9template<typename PassName>
10Pass *callDefaultCtor() { return new Pass(); }
11
12void foo(Pass *(*C)());
13
14struct basic_string {
15 bool empty() const { return true; }
16};
17
18
19bool foo2(basic_string &X) {
20 return X.empty();
21}
22void baz() { foo(callDefaultCtor<Pass>); }
23