diff options
| author | Douglas Gregor <dgregor@apple.com> | 2010-04-17 22:01:05 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2010-04-17 22:01:05 +0000 |
| commit | 5ab116553171e67015f63178a3927de22400e3da (patch) | |
| tree | 783c4344096e148c8bcfb1303c6b1987ccb48c44 /clang/test/SemaTemplate/constructor-template.cpp | |
| parent | 8345a70c671dbd5d7dcfbd1e0e1f68fc9ed0e0c6 (diff) | |
| download | bcm5719-llvm-5ab116553171e67015f63178a3927de22400e3da.tar.gz bcm5719-llvm-5ab116553171e67015f63178a3927de22400e3da.zip | |
Improve our handling of user-defined conversions as part of overload
resolution. There are two sources of problems involving user-defined
conversions that this change eliminates, along with providing simpler
interfaces for checking implicit conversions:
- It eliminates a case of infinite recursion found in Boost.
- It eliminates the search for the constructor needed to copy a temporary
generated by an implicit conversion from overload
resolution. Overload resolution assumes that, if it gets a value
of the parameter's class type (or a derived class thereof), there
is a way to copy if... even if there isn't. We now model this
properly.
llvm-svn: 101680
Diffstat (limited to 'clang/test/SemaTemplate/constructor-template.cpp')
| -rw-r--r-- | clang/test/SemaTemplate/constructor-template.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/constructor-template.cpp b/clang/test/SemaTemplate/constructor-template.cpp index 82c2aa4cc3e..b6ca72e9e14 100644 --- a/clang/test/SemaTemplate/constructor-template.cpp +++ b/clang/test/SemaTemplate/constructor-template.cpp @@ -94,3 +94,18 @@ void default_ctor_inst() { } template void default_ctor_inst<int>(); + +template<typename T> +struct X5 { + X5(); + X5(const T &); +}; + +struct X6 { + template<typename T> X6(T); +}; + +void test_X5_X6() { + X5<X6> tf; + X5<X6> tf2(tf); +} |

