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

           Summary: GCC 4.2.1 [FreeBSD] segfaults with certain use of void
                    typedefs with debugging symbols
           Product: gcc
           Version: 4.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: darkuran...@gmail.com


Created attachment 24375
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24375
Test file showing the bug

The following makes GCC segfault:
namespace foo
{
    typedef void Fvoid;
}
using foo::Fvoid;

int main()
{
    return 0;
} // < segfault reported on this line

Note that the code should be compiled with debugging symbols activated (I've
tested with -g or -ggdb) - without them, the bug does not get triggered.

Namespaces can be nested deeper ("using foo::bar::Fvoid;") and the bug still
appears.

Merely using the type does NOT trigger a segfault:
// these do NOT segfault:
foo::Fvoid* v1;
using namespace foo;
Fvoid* v2;

Compile the test file with: g++ -g "test.cpp"

Error reported: test.cpp:25: internal compiler error: Segmentation fault: 11

Reply via email to