diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-03-06 09:03:20 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-03-06 09:03:20 +0000 |
commit | 5453d93ab8668f2d9d0bc02182695b02d207e32d (patch) | |
tree | c7c45222b687bdae965ef5dee147aff2e1e8eeeb /test/SemaCXX/conversion-function.cpp | |
parent | 708a86690469474f0a8149abca71aa4c62bf9710 (diff) |
When performing template argument deduction for a non-reference
conversion function when we're binding the result to a reference, drop
cv-qualifiers on the type we're referring to, since we should be
deducing a type that can be adjusted (via cv-qualification) to the
requested type. Fixes PR9336, and the remaining Boost.Assign failure.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127117 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/conversion-function.cpp')
-rw-r--r-- | test/SemaCXX/conversion-function.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/SemaCXX/conversion-function.cpp b/test/SemaCXX/conversion-function.cpp index 61c8ada62f..aa47ae0f48 100644 --- a/test/SemaCXX/conversion-function.cpp +++ b/test/SemaCXX/conversion-function.cpp @@ -353,3 +353,28 @@ namespace PR8034 { }; int x = C().operator int(); } + +namespace PR9336 { + template<class T> + struct generic_list + { + template<class Container> + operator Container() + { + Container ar; + T* i; + ar[0]=*i; + return ar; + } + }; + + template<class T> + struct array + { + T& operator[](int); + const T& operator[](int)const; + }; + + generic_list<generic_list<int> > l; + array<array<int> > a = l; +} |