blob: 7472d7e5bc63accc5aad94fdaa2b60397480fdbb [file] [log] [blame]
Galina Kistanova0ccb31c2011-06-03 22:24:54 +00001// REQUIRES: x86-registered-target,x86-64-registered-target
Daniel Dunbara5728872009-12-15 20:14:24 +00002// RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++0x -S %s -o %t-64.s
Daniel Dunbar4fcfde42009-11-08 01:45:36 +00003// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
Daniel Dunbara5728872009-12-15 20:14:24 +00004// RUN: %clang_cc1 -triple i386-apple-darwin -std=c++0x -S %s -o %t-32.s
Daniel Dunbar4fcfde42009-11-08 01:45:36 +00005// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s
Douglas Gregor72f6d672009-09-01 21:04:42 +00006
7// PR4826
8struct A {
9 A() {
10 }
11};
12
13template<typename T>
14struct B {
15 B(T) {}
16
17 A nodes;
18};
19
Fariborz Jahaniancf1b9c72009-09-02 23:02:57 +000020
21// PR4853
22template <typename T> class List {
23public:
Mike Stump1eb44332009-09-09 15:08:12 +000024 List(){ } // List<BinomialNode<int>*>::List() remains undefined.
Fariborz Jahanian34374e62009-09-03 23:18:17 +000025 ~List() {}
Fariborz Jahaniancf1b9c72009-09-02 23:02:57 +000026};
27
Fariborz Jahanian9d436202009-09-03 21:32:41 +000028template <typename T> class Node {
29 int i;
30public:
31 Node(){ } // Node<BinomialNode<int>*>::Node() remains undefined.
Fariborz Jahanian34374e62009-09-03 23:18:17 +000032 ~Node() {}
Fariborz Jahanian9d436202009-09-03 21:32:41 +000033};
34
35
36template<typename T> class BinomialNode : Node<BinomialNode<T>*> {
Fariborz Jahaniancf1b9c72009-09-02 23:02:57 +000037public:
38 BinomialNode(T value) {}
39 List<BinomialNode<T>*> nodes;
40};
41
Douglas Gregor72f6d672009-09-01 21:04:42 +000042int main() {
43 B<int> *n = new B<int>(4);
Fariborz Jahaniancf1b9c72009-09-02 23:02:57 +000044 BinomialNode<int> *node = new BinomialNode<int>(1);
Fariborz Jahanian34374e62009-09-03 23:18:17 +000045 delete node;
Douglas Gregor72f6d672009-09-01 21:04:42 +000046}
Fariborz Jahaniancf1b9c72009-09-02 23:02:57 +000047
Anders Carlssonc997d422010-01-02 01:01:18 +000048// CHECK-LP64: __ZN4NodeIP12BinomialNodeIiEEC2Ev:
Fariborz Jahaniancf1b9c72009-09-02 23:02:57 +000049// CHECK-LP64: __ZN4ListIP12BinomialNodeIiEEC1Ev:
Eli Friedman34531472009-12-15 03:22:41 +000050// CHECK-LP64: __ZN4ListIP12BinomialNodeIiEED1Ev:
Fariborz Jahaniancf1b9c72009-09-02 23:02:57 +000051
Anders Carlssonc997d422010-01-02 01:01:18 +000052// CHECK-LP32: __ZN4NodeIP12BinomialNodeIiEEC2Ev:
Fariborz Jahanian9d436202009-09-03 21:32:41 +000053// CHECK-LP32: __ZN4ListIP12BinomialNodeIiEEC1Ev:
Eli Friedman34531472009-12-15 03:22:41 +000054// CHECK-LP32: __ZN4ListIP12BinomialNodeIiEED1Ev: