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++/48386] "Cannot declare static function inside another function"


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

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-03-31 13:40:52 UTC ---
(In reply to comment #2)
> all works, so I have decide that is a bug, sorry for wasted time.

It compiles, but it doesn't do what you think: it declares a function "b" not a
variable.

Try this, which shows that b is not an object of type B:

struct A {};

struct B 
{
    B( A ) {}
    int f() { return 0; }
};

int main()
{
    B b( A() );
    return b.f();
}


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