diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-11-05 13:06:35 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-11-05 13:06:35 +0000 |
commit | 393896f49d5248435cf203cf1de60a86dc507c44 (patch) | |
tree | 2d1266a6f4ce90085c4b8104f62752dbca8bfffb /test/SemaTemplate/instantiate-complete.cpp | |
parent | b13c87f0c9705d91d5a3e134be9934c9ad531071 (diff) |
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!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86129 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/instantiate-complete.cpp')
-rw-r--r-- | test/SemaTemplate/instantiate-complete.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/SemaTemplate/instantiate-complete.cpp b/test/SemaTemplate/instantiate-complete.cpp index babc55217a..507894a2ff 100644 --- a/test/SemaTemplate/instantiate-complete.cpp +++ b/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; +} |