This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/44122] New: Confusing error: cannot convert 'T*’ to ‘T*’
- From: "ppluzhnikov at google dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 May 2010 18:52:48 -0000
- Subject: [Bug c++/44122] New: Confusing error: cannot convert 'T*’ to ‘T*’
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Here is the complete error message:
g++ -c t.cc
t.cc: In function ?int bar()?:
t.cc:8:18: error: cannot convert ?Py_ssize_t*? to ?Py_ssize_t*? for argument
?1? to ?int foo(Py_ssize_t*)?
How is that even possible?
cat t.cc
typedef long Py_ssize_t;
int foo(Py_ssize_t *);
int bar() {
typedef int Py_ssize_t;
Py_ssize_t pos;
return foo(&pos);
}
Suggested improvement:
t.cc:8: error: cannot convert '{bar}::Py_ssize_t* [int*]' to 'Py_ssize_t*
[long*]' for 1st argument to 'int foo(Py_ssize_t*)'
--
Summary: Confusing error: cannot convert 'T*? to ?T*?
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: ppluzhnikov at google dot com
GCC build triplet: x86_64-unknown-linux-gnu
GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44122