This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Problems compiling a small C++ test with gcc


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
----------------------------------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]