http://llvm.org/bugs/show_bug.cgi?id=9170
Summary: Bad diagnostic when passing non-rvalue to
rvalue-reference
Product: clang
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++0x
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
The below diagnostic should say something about how you can't bind an lvalue
(even one declared as T&&, although that's not the problem in this case) to an
rvalue parameter.
$ cat ~/tmp/test.cc
struct vector {
void swap(vector&& __x);
};
void foo() {
vector v, u;
v.swap(u);
}
$ clang++ -std=gnu++0x -c ~/tmp/test.cc
/home/jyasskin/tmp/test.cc:7:10: error: binding of reference to type 'vector'
to a value
of type 'vector' drops qualifiers
v.swap(u);
^
/home/jyasskin/tmp/test.cc:2:22: note: passing argument to parameter '__x' here
void swap(vector&& __x);
^
1 error generated.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs