This is the mail archive of the
mailing list for the GCC project.
erroneous error -- inconsistent application of const
- To: egcs-bugs at cygnus dot com
- Subject: erroneous error -- inconsistent application of const
- From: "E. Jay Berkenbilt" <ejb at ql dot org>
- Date: Wed, 4 Mar 1998 15:47:56 -0500
- CC: ldd at apexinc dot com
This bug involves the following EGCS release
egcs-2.90.23 980102 (egcs-1.0.1 release)
compiled with just configure and make. egcs was built with gcc
My system is a vanilla RedHat 4.2 with nearly all patches available
Try compiling this file (a.cc)
static void f(char const * const * const argv);
void f(char const * const * const argv);
with the command g++ -pedantic -c a.cc
You get the error
a.cc: In function `void g()':
a.cc:13: no matching function for call to `A::f (char **&)'
a.cc:5: candidates are: A::f(const char *const *) <near match>
Note that it doesn't care about the global f; it just cares about the
f inside of A. My understanding is that neither is wrong, but it is
certainly a bug that the compiler complains about one without
complaining about the other.
The last time I looked at a draft standard (actually, the ARM, with
revisions from April, 1995), "const" could be applied as many times as
necessary to function arguments....
E. Jay Berkenbilt (firstname.lastname@example.org) | Member, League for Programming Freedom
http://www.ql.org/q/ | email@example.com, http://www.lpf.org