[LLVMbugs] [Bug 9548] New: "no known conversion from 'vector<string>' to 'vector<string>'"

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Mar 24 19:34:11 PDT 2011


           Summary: "no known conversion from 'vector<string>' to
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: matthewbg at google.com
                CC: llvmbugs at cs.uiuc.edu

$ cat test.cc
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;
$ clang -fsyntax-only test.cc
test.cc:15:3: error: no matching function for call to 'f'
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.

Wait, no known conversion from what to what?

If 'string' is a class rather than a typedef, we print "... from
'vector<std::string>...". If 'string' is the bare parameter type rather than a
template argument in the parameter type, we print "... from 'string' (aka
'std::basic_string'...". Either of these styles would avoid printing textually
identical types in the note.

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.

More information about the llvm-bugs mailing list