This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/12337] New: infinite loop in g++
- From: "matias at ssc dot upenn dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Sep 2003 03:58:37 -0000
- Subject: [Bug c++/12337] New: infinite loop in g++
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12337
Summary: infinite loop in g++
Product: gcc
Version: 3.2.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: matias at ssc dot upenn dot edu
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i386-redhat-linux
GCC host triplet: i386-redhat-linux
GCC target triplet: i386-redhat-linux
When compiling the following code, g++ goes into an infinite loop.
--- start of loop.cpp ------------------
class A {};
template <typename T>
class X : public A {
public:
X(T&);
};
class B {
public:
bool foo(A*);
template <typename T>
bool foo(T& t) { return foo(new X<T>(t)); }
};
int main()
{
B x, y;
x.foo(y);
}
--- end of loop.cpp ----------------
$ g++ -c loop.cpp
[never finishes]
Compiler version is:
$ g++ -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--disable-checking --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux
Thread model: posix
gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
Also verified the same behavior with g++ 3.3.1, compiled with the same configure
options.