This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
gcc 3.0 and C++
- To: gcc at gcc dot gnu dot org
- Subject: gcc 3.0 and C++
- From: Bohdan Vlasyuk <bohdan at kivc dot vstu dot vinnica dot ua>
- Date: Thu, 19 Jul 2001 20:59:58 +0300
I have strange feeling that it's a kind of `something wrong' with
gcc. Trying to compile my program on gcc 3.0, have this error:
language.cpp: In constructor `LangList::LangList()':
language.cpp:285: no matching function for call to `Data::Data(Data)'
data.h:13: candidates are: Data::Data(Data&)
data.h:11: Data::Data(char*)
data.h:10: Data::Data(long int)
language.cpp:285: initializing argument 1 of `Language::Language(Data)' from
result of `Data::Data(char*)'
relevant lines:
if(S_ISREG(statistics.st_mode)) {
Language * newlang = new Language(directory->d_name);
directory->d_name is char*
Language has only one constructor:
Language(Data);
Data is a kind of universal malloc'ed type, that'd be used [in future
version :-)] for garbage collection. It can be constructed with:
Data(long new_size);
Data(char*s);
Data();
Data(Data& new_d);
I don't understand, why can't Language(char*) just make it
Language(Data(char*)), and why does it complain..
I'm sorry if that's not actually bug, and I admit I'm not very good in
C++.
P.s.: I could send actual preprocessed output, but I guess it'll wait
until anyone would actually confirm it's bug.
thanks!
--
You love peace.