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 | d99609ae48ac1c440173e6d69cddca09c12c293d (patch) | |
tree | 65b96b67cf64df998292e13314cf724047a05e8c /clang/test/SemaCXX/conversion-function.cpp | |
parent | 92db8e8e392757768b58950a6b92bd1be0d358b7 (diff) | |
download | bcm5719-llvm-d99609ae48ac1c440173e6d69cddca09c12c293d.tar.gz bcm5719-llvm-d99609ae48ac1c440173e6d69cddca09c12c293d.zip |
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.
llvm-svn: 127117
Diffstat (limited to 'clang/test/SemaCXX/conversion-function.cpp')
-rw-r--r-- | clang/test/SemaCXX/conversion-function.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/conversion-function.cpp b/clang/test/SemaCXX/conversion-function.cpp index 61c8ada62fb..aa47ae0f482 100644 --- a/clang/test/SemaCXX/conversion-function.cpp +++ b/clang/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; +} |