[cfe-commits] Patch - PR9548 - "no known conversion from 'vector<string>' to 'vector<string>'"

Richard Trieu rtrieu at google.com
Fri Apr 15 22:25:45 PDT 2011


See http://llvm.org/bugs/show_bug.cgi?id=9548

When two different types has the same text representation in the same
diagnostic message, print an a.k.a. after the type if the a.k.a. gives extra
information about the type.

class versa_string;

typedef versa_string string;

namespace std {template <typename T> class vector;}

using std::vector;

void f(vector<string> v);

namespace std {
class basic_string;
typedef basic_string string;
template <typename T> class vector {};
void g() {
vector<string> v;
f(v);
}
}

Old message:
----------------
test.cc:15:3: error: no matching function for call to 'f'
f(&v);
^
test.cc:7:6: note: candidate function not viable: no known conversion from
'vector<string>' to 'vector<string>' for 1st argument
void f(vector<string> v);
^
1 error generated.

New message:
---------------
test.cc:15:3: error: no matching function for call to 'f' f(v); ^
test.cc:7:6: note: candidate function not viable: no known conversion from
'vector<string>' (aka 'std::vector<std::basic_string>') to 'vector<string>'
(aka 'std::vector<versa_string>') for 1st argument void f(vector<string> v);
^ 1 error generated.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110415/b1c937d9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: force-aka.patch
Type: text/x-patch
Size: 10233 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110415/b1c937d9/attachment.bin>


More information about the cfe-commits mailing list