summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate/instantiate-complete.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-11-05 13:06:35 +0000
committerDouglas Gregor <dgregor@apple.com>2009-11-05 13:06:35 +0000
commit3ec1bf240d4abb4aebe20a7608ab7ebbfe68cbea (patch)
treedceb48748a4f4691452947651d5d8f03e441b78b /clang/test/SemaTemplate/instantiate-complete.cpp
parent1fa36b7cabfa24ec4f61e2fb3807af3891dc9ee4 (diff)
downloadbcm5719-llvm-3ec1bf240d4abb4aebe20a7608ab7ebbfe68cbea.tar.gz
bcm5719-llvm-3ec1bf240d4abb4aebe20a7608ab7ebbfe68cbea.zip
Fixed two places where we needed to force completion of a type
(without complaining if it fails) to get proper semantics: reference binding with a derived-to-base conversion and the enumeration of constructors for user-defined conversions. There are probably more cases to fix, but my prior attempt at statically ensuring that complete-type checking always happens failed. Perhaps I'll try again. With this change, Clang can parse include/llvm/*.h! llvm-svn: 86129
Diffstat (limited to 'clang/test/SemaTemplate/instantiate-complete.cpp')
-rw-r--r--clang/test/SemaTemplate/instantiate-complete.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/instantiate-complete.cpp b/clang/test/SemaTemplate/instantiate-complete.cpp
index babc55217a9..507894a2ff6 100644
--- a/clang/test/SemaTemplate/instantiate-complete.cpp
+++ b/clang/test/SemaTemplate/instantiate-complete.cpp
@@ -45,3 +45,24 @@ void test_memptr(X<long> *p1, long X<long>::*pm1,
(void)(p1->*pm1);
(void)((p2->*pm2)(0));
}
+
+// Reference binding to a base
+template<typename T>
+struct X1 { };
+
+template<typename T>
+struct X2 : public T { };
+
+void refbind_base(X2<X1<int> > &x2) {
+ X1<int> &x1 = x2;
+}
+
+// Enumerate constructors for user-defined conversion.
+template<typename T>
+struct X3 {
+ X3(T);
+};
+
+void enum_constructors(X1<float> &x1) {
+ X3<X1<float> > x3 = x1;
+}
OpenPOWER on IntegriCloud