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] New: "Cannot declare static function inside another function"


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.


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