blob: 66b970cb6fd8fcc883765e21805c2aab0febb562 [file] [log] [blame]
Duncan Sands5fe97a02010-11-25 21:39:17 +00001// RUN: %llvmgxx -xc++ %s -S -o - | grep callDefaultCtor | \
Reid Spencercf94fb92007-04-15 20:41:31 +00002// RUN: not grep declare
Chris Lattnera6992ae2004-11-30 18:25:12 +00003
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