2011-06-04 06:24:54 +08:00
|
|
|
// REQUIRES: x86-registered-target,x86-64-registered-target
|
2011-10-14 06:29:44 +08:00
|
|
|
// RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++11 -S %s -o %t-64.s
|
2013-08-12 20:51:05 +08:00
|
|
|
// RUN: FileCheck -check-prefix CHECK-LP64 --input-file=%t-64.s %s
|
2011-10-14 06:29:44 +08:00
|
|
|
// RUN: %clang_cc1 -triple i386-apple-darwin -std=c++11 -S %s -o %t-32.s
|
2013-08-12 20:51:05 +08:00
|
|
|
// RUN: FileCheck -check-prefix CHECK-LP32 --input-file=%t-32.s %s
|
2009-09-02 05:04:42 +08:00
|
|
|
|
|
|
|
// PR4826
|
|
|
|
struct A {
|
|
|
|
A() {
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template<typename T>
|
|
|
|
struct B {
|
|
|
|
B(T) {}
|
|
|
|
|
|
|
|
A nodes;
|
|
|
|
};
|
|
|
|
|
2009-09-03 07:02:57 +08:00
|
|
|
|
|
|
|
// PR4853
|
|
|
|
template <typename T> class List {
|
|
|
|
public:
|
2009-09-09 23:08:12 +08:00
|
|
|
List(){ } // List<BinomialNode<int>*>::List() remains undefined.
|
2009-09-04 07:18:17 +08:00
|
|
|
~List() {}
|
2009-09-03 07:02:57 +08:00
|
|
|
};
|
|
|
|
|
2009-09-04 05:32:41 +08:00
|
|
|
template <typename T> class Node {
|
|
|
|
int i;
|
|
|
|
public:
|
|
|
|
Node(){ } // Node<BinomialNode<int>*>::Node() remains undefined.
|
2009-09-04 07:18:17 +08:00
|
|
|
~Node() {}
|
2009-09-04 05:32:41 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
template<typename T> class BinomialNode : Node<BinomialNode<T>*> {
|
2009-09-03 07:02:57 +08:00
|
|
|
public:
|
|
|
|
BinomialNode(T value) {}
|
|
|
|
List<BinomialNode<T>*> nodes;
|
|
|
|
};
|
|
|
|
|
2009-09-02 05:04:42 +08:00
|
|
|
int main() {
|
|
|
|
B<int> *n = new B<int>(4);
|
2009-09-03 07:02:57 +08:00
|
|
|
BinomialNode<int> *node = new BinomialNode<int>(1);
|
2009-09-04 07:18:17 +08:00
|
|
|
delete node;
|
2009-09-02 05:04:42 +08:00
|
|
|
}
|
2009-09-03 07:02:57 +08:00
|
|
|
|
2010-01-02 09:01:18 +08:00
|
|
|
// CHECK-LP64: __ZN4NodeIP12BinomialNodeIiEEC2Ev:
|
2009-09-03 07:02:57 +08:00
|
|
|
// CHECK-LP64: __ZN4ListIP12BinomialNodeIiEEC1Ev:
|
2009-12-15 11:22:41 +08:00
|
|
|
// CHECK-LP64: __ZN4ListIP12BinomialNodeIiEED1Ev:
|
2009-09-03 07:02:57 +08:00
|
|
|
|
2010-01-02 09:01:18 +08:00
|
|
|
// CHECK-LP32: __ZN4NodeIP12BinomialNodeIiEEC2Ev:
|
2009-09-04 05:32:41 +08:00
|
|
|
// CHECK-LP32: __ZN4ListIP12BinomialNodeIiEEC1Ev:
|
2009-12-15 11:22:41 +08:00
|
|
|
// CHECK-LP32: __ZN4ListIP12BinomialNodeIiEED1Ev:
|