[Bug c++/15624] Defined types lose const qualifiers in certain method signatures.
bangerth at dealii dot org
gcc-bugzilla@gcc.gnu.org
Tue May 25 19:32:00 GMT 2004
------- Additional Comments From bangerth at dealii dot org 2004-05-25 00:09 -------
No, gcc is still correct since from a language viewpoint, the
following two declarations are exactly identical:
void f(char *);
void f(char *const);
For the argument signature, the const in the second case is irrelevant,
and is thus dropped. You can see this by simply compiling these two
lines above (as a C file; remember that C does not have function
overloading) -- the compiler accepts this as a duplicate declaration,
whereas it does not accept these two lines:
void f(char *);
void f(const char*);
generating an error about conflicting declarations.
W.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15624
More information about the Gcc-bugs
mailing list