------- Comment #3 from dodji at gcc dot gnu dot org  2009-04-10 11:46 -------
Subject: Re:  No error reporting when function and variable
 have the same name

alpha dot super-one at laposte dot net a écrit :
> ------- Comment #2 from alpha dot super-one at laposte dot net  2009-04-10 
> 04:47 -------

So I compiled this program:

     1  class toto
     2  {
     3        enum e {a,b};
     4        e test_example();
     5        e test_example;
     6  };
     7
     8  toto t;

with the -Wall option of g++ 4.3.2, I got:

test.cc:5: error: declaration of 'toto::e toto::test_example'
test.cc:4: error: conflicts with previous declaration 'toto::e
toto::test_example()'

So that does what you want I guess.


-- 


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

Reply via email to