[Bug c++/26036] New: Treating a class object as a function with member variables causes hang

2006-01-30 Thread ben at pc-doctor dot com
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



[Bug c++/26036] Treating a class object as a function with member variables causes hang

2006-01-30 Thread ben at pc-doctor dot com


--- Comment #1 from ben at pc-doctor dot com  2006-01-30 17:41 ---
(In reply to comment #0)
>  Please note that "i" is also undeclared. 
Err, i is not a variable so ignore that statement.  I am assuming gcc is
treating the "WrapperClass wrapper0(TestClass(i));" as a declaration instead of
instantiation.  Still, the compiler should not hang.


-- 


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