This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Problems compiling a small C++ test with gcc
- To: gcc at gcc dot gnu dot org
- Subject: Problems compiling a small C++ test with gcc
- From: Denis Perchine <dyp at perchine dot com>
- Date: Sun, 1 Jul 2001 14:26:01 +0700
Hello,
I have quite strange problems with one C++ program.
I have made a test to reproduce the problem.
namespace aa {
static const long pr_val = 21;
class base {
public:
int gg;
};
};
namespace cc {
class dd_rec : aa::base {
public:
int aa;
};
typedef dd_rec *dd;
};
namespace bb {
static void pr_val(cc::dd a) {
return pr_val(a);
}
};
Trying to compile this program I get:
bash-2.04$ gcc -c -o a.o a.cpp
a.cpp: In function `void bb::pr_val(cc::dd_rec *)':
a.cpp:2: `aa::pr_val' is not a function,
a.cpp:20: conflict with `bb::pr_val(cc::dd_rec *)'
a.cpp:21: in call to `pr_val'
gcc-2.95.3, and 3.0 behaves the same way.
Actually I can not understand why it tried to lookup pr_val in aa namespace
also... I can not find anything like this in standards.
Any comments?
--
Sincerely Yours,
Denis Perchine
----------------------------------
E-Mail: dyp@perchine.com
HomePage: http://www.perchine.com/dyp/
FidoNet: 2:5000/120.5
----------------------------------