From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22252 invoked by alias); 5 Dec 2003 21:01:52 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 22245 invoked by uid 48); 5 Dec 2003 21:01:51 -0000 Date: Fri, 05 Dec 2003 21:01:00 -0000 From: "david dot lee at teracruz dot com" To: gcc-bugs@gcc.gnu.org Message-ID: <20031205210149.13323.david.lee@teracruz.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/13323] New: Template code does not compile in presence of typedef X-Bugzilla-Reason: CC X-SW-Source: 2003-12/txt/msg00680.txt.bz2 List-Id: The following code compiles fine with gcc 3.2. However, with 3.3.2, I get an error. [dlee@d100-devel cpp]$ cat > bug.cpp < class TypedIfc { public: virtual ~TypedIfc() { } virtual operator const T&() const = 0; virtual const T& operator= (const T& t) = 0; }; template class NullIfc : public TypedIfc { public: const Tnative& operator= (const Tnative& t) { return t; } operator const Tnative&() const { return *(Tnative *)0; } }; #ifndef DONTBREAK // -DDONTBREAK to get a build that works. typedef TypedIfc INT_TYPEDEFIfc; #endif NullIfc i32; EOF [dlee@d100-devel cpp]$ i686-linux-g++ bug.cpp -o /dev/null -c -DDONTBREAK [dlee@d100-devel cpp]$ i686-linux-g++ bug.cpp -o /dev/null -c bug.cpp:24: error: cannot declare variable `i32' to be of type `NullIfc' bug.cpp:24: error: because the following virtual functions are abstract: bug.cpp:8: error: TypedIfc::operator const T&() const [with T = INT_TYPEDEF] Here's the info for my compiler: [dlee@d100-devel cpp]$ i686-linux-g++ --verbose Reading specs from /tools/i386/lib/gcc-lib/i686-linux/3.3.2/specs Configured with: /src/gcc-3.3.2/configure --target=i686-linux --host=i686- host_pc-linux-gnu --prefix=/tools/i386 --with-headers=/tools/i386/i686- linux/include --disable-nls --enable-symvers=gnu --enable-threads=posix -- enable-__cxa_atexit --enable-languages=c,c++ --enable-clocale=gnu --with-local- prefix=/home/dlee/vcs/Products/Breeze/Dev/Prj/LinuxRH8/tscale2/tools/i386/i686- linux --disable-multilib Thread model: posix gcc version 3.3.2 -- Summary: Template code does not compile in presence of typedef Product: gcc Version: 3.3.2 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: david dot lee at teracruz dot com CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: i686-pc-linux GCC host triplet: i686-pc-linux GCC target triplet: i686-pc-linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13323