diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-07-08 15:50:43 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-07-08 15:50:43 +0000 |
commit | 032c86921177031ecbb46c398b3e710758ba915e (patch) | |
tree | 67dcb165082b840302ec061c3865d478a167254c /test/SemaTemplate/unresolved-construct.cpp | |
parent | fd8bcd2520bd107ae5699536d776ed39487a5e6e (diff) |
Teach CXXUnresolvedConstructExpr when it should be an
lvalue/xvalue/rvalue, rather than just (incorrectly) assuming it's an
lvalue. Fixes PR10285 / <rdar://problem/9743926>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134700 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/unresolved-construct.cpp')
-rw-r--r-- | test/SemaTemplate/unresolved-construct.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/SemaTemplate/unresolved-construct.cpp b/test/SemaTemplate/unresolved-construct.cpp new file mode 100644 index 0000000000..0d1ba17a01 --- /dev/null +++ b/test/SemaTemplate/unresolved-construct.cpp @@ -0,0 +1,19 @@ +// RUN: %clang_cc1 -std=c++0x -fsyntax-only -verify %s +class A +{ +public: + A() {} + + template <class _F> + explicit A(_F&& __f); + + A(A&&) {} + A& operator=(A&&) {return *this;} +}; + +template <class T> +void f(T t) +{ + A a; + a = f(t); +} |