This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/15624] Defined types lose const qualifiers in certain method signatures.
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 May 2004 00:09:29 -0000
- Subject: [Bug c++/15624] Defined types lose const qualifiers in certain method signatures.
- References: <20040524010314.15624.sbrenneis@surry.net>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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