This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

[Bug c++/15624] Defined types lose const qualifiers in certain method signatures.


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


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