[Bug c++/24983] Needs a warning?

pinskia at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Tue Nov 22 03:01:00 GMT 2005



------- Comment #2 from pinskia at gcc dot gnu dot org  2005-11-22 03:01 -------
Different versions give different diagnostics:
earth:~>gcc t.cc
t.cc:2: error: prototype for 'void foo::f()' does not match any in class 'foo'
t.cc:1: error: candidate is: const void foo::f()
t.cc:2: error: 'void foo::f()' cannot be overloaded
t.cc:1: error: with 'const void foo::f()'
earth:~>~/ia32_linux_gcc3_4/bin/gcc t.cc
t.cc:2: error: prototype for `void foo::f()' does not match any in class `foo'
t.cc:1: error: candidate is: const void foo::f()
t.cc:2: error: `void foo::f()' and `const void foo::f()' cannot be overloaded
earth:~>~/ia32_linux_gcc3_3/bin/gcc t.cc
t.cc:2: error: prototype for `void foo::f()' does not match any in class `foo'
t.cc:1: error: candidate is: const void foo::f()
t.cc:2: error: `void foo::f()' and `const void foo::f()' cannot be overloaded
earth:~>~/ia32_linux_gcc3_2/bin/gcc t.cc
t.cc:2: prototype for `void foo::f()' does not match any in class `foo'
t.cc:1: candidate is: const void foo::f()
t.cc:2: `void foo::f()' and `const void foo::f()' cannot be overloaded
earth:~>~/ia32_linux_gcc3_0/bin/gcc t.cc
t.cc:2: prototype for `void foo::f()' does not match any in class `foo'
t.cc:1: candidate is: const void foo::f()
earth:~>~/ia32_linux_gcc2_95//bin/gcc t.cc
t.cc:2: new declaration `void foo::f()'
t.cc:1: ambiguates old declaration `const void foo::f()'


I say that 3.0.x is the best if it is what we should say then we have a
regression.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24983



More information about the Gcc-bugs mailing list