http://llvm.org/bugs/show_bug.cgi?id=13134
Bug #: 13134
Summary: Diagnostics for "no viable conversion" with
ref-qualified conversion operators.
Product: new-bugs
Version: trunk
Platform: All
OS/Version: All
Status: NEW
Severity: enhancement
Priority: P
Component: new bugs
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
Classification: Unclassified
Give the code:
struct B {
};
struct C {
operator B() && {
return B();
}
};
int main() {
C c;
B b = c;
}
clang -std=c++11 currently prints:
refqual.cpp:13:5: error: no viable conversion from 'C' to 'B'
B b = c;
^ ~
refqual.cpp:1:8: note: candidate constructor (the implicit copy constructor)
not viable: no known conversion from 'C' to
'const B &' for 1st argument;
struct B {
^
refqual.cpp:1:8: note: candidate constructor (the implicit move constructor)
not viable: no known conversion from 'C' to
'B &&' for 1st argument;
struct B {
^
refqual.cpp:6:3: note: candidate function not viable: no known conversion from
'C' to 'C' for object argument;
operator B() && {
^
The first two notes are useless, and the last doesn't explain why C is not C.
It should at least mention that c is not an rvalue.
I would love it if clang proved a fixit to add std::move(c), but I'm not sure
this would be valid in most cases.
--
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