[Bug c++/48386] New: "Cannot declare static function inside another function"

zxfox at mail dot ru gcc-bugzilla@gcc.gnu.org
Thu Mar 31 13:10:00 GMT 2011


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

           Summary: "Cannot declare static function inside another
                    function"
           Product: gcc
           Version: 4.4.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: zxfox@mail.ru


Sample code:

struct A {};

struct B 
{
    B( A ) {}
};

int main()
{
    static B b( A() );
}

On build:

g++ ./1.cpp
./1.cpp: In function ‘int main()’:
./1.cpp:10: error: cannot declare static function inside another function

P.S. my English too ugly, please change summary to some adequate if that is
real bug.



More information about the Gcc-bugs mailing list