This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/48386] "Cannot declare static function inside another function"
- From: "zxfox at mail dot ru" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 31 Mar 2011 13:37:06 +0000
- Subject: [Bug c++/48386] "Cannot declare static function inside another function"
- Auto-submitted: auto-generated
- References: <bug-48386-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48386
--- Comment #2 from zxfox at mail dot ru 2011-03-31 13:37:05 UTC ---
(In reply to comment #1)
> This is not a bug, G++ is correct.
>
> Are you trying to create a static variable?
>
> The rules of C++ say that "B b( A() )" is interpreted as a declaration of a
> function called "b" which takes a single parameter and returns "B"
For:
struct A {};
struct B
{
B( A ) {}
};
int main()
{
B b( A() );
}
all works, so I have decide that is a bug, sorry for wasted time.