The following code, while invalid, causes g++ >= 4.0.0 to hang while compiling.
 Please note that "i" is also undeclared.  GCC 3.4.4 errors out as expected.


class TestClass {
public:
        int m_z;
};

class WrapperClass {
public:
        TestClass m_test;
};

int main()
{
   WrapperClass wrapper0(TestClass(i));
   return wrapper0().m_test.m_z++;
}


-- 
           Summary: Treating a class object as a function with member
                    variables causes hang
           Product: gcc
           Version: 4.0.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ben at pc-doctor dot com
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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

Reply via email to