]> granicus.if.org Git - clang/commit
Apply patch from Richard Trieu to fix PR9548:
authorChandler Carruth <chandlerc@gmail.com>
Mon, 11 Jul 2011 17:49:21 +0000 (17:49 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Mon, 11 Jul 2011 17:49:21 +0000 (17:49 +0000)
commit0673cb30340aadaede7b795c763b00f6b64e611c
tree57d43b23d2e6ab0dc4b7d0c1737fd0028ce81261
parenta5ca112ced1c0856187fe6717d36ce614f20d4a6
Apply patch from Richard Trieu to fix PR9548:

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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134904 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/AST/ASTDiagnostic.h
include/clang/Basic/Diagnostic.h
lib/AST/ASTDiagnostic.cpp
lib/Basic/Diagnostic.cpp
test/Misc/diag-aka-types.cpp