-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Closed
Labels
Description
| Bugzilla Link | 9170 |
| Resolution | FIXED |
| Resolved on | Apr 09, 2013 18:48 |
| Version | trunk |
| OS | Linux |
| Reporter | LLVM Bugzilla Contributor |
| CC | @DougGregor,@belkadan |
Extended Description
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.