🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.bug
Article #1137

Parsing templates with gcc 2.3.1

#1137
From: lewis
Date: Tue, 10 Nov 1992 13:05
38 lines
1450 bytes
        Getting rid of the parameter to ArrayNode::CTOR () makes
everything compile OK.

        Getting rid of the DTOR also makes things compile.
I've tried dozens of different syntaxes to try to get something
like this to compile. Is there any syntax gcc 2.3.1 will accept
for a templated class with CTOR (with arguments) and DTOR????



/*
 * This template code fails to compile with g++ 2.3.1.
 *
 * Compiled as:
 *		g++ -c Bug.cc
 *
 * Produces:
 * 	Bug.cc:18: inconsistent return types for method `ArrayNode' in class `ArrayNode<int>'
 * 	/usr/local/bin/gcc: Internal compiler error: program cc1plus got fatal signal 11
 *
 */
template    <class  T>  class   ArrayNode {
    public:
        ArrayNode (int a);
        ~ArrayNode ();

        T   fItem;
};

template    <class  T>      ArrayNode<T>::ArrayNode (int a)
{
}
template    <class  T>      ArrayNode<T>::~ArrayNode ()
{
}

ArrayNode<int> f(1);
Lewis Gordon Pringle, Jr.                                (lewis@sophists.com)
Technical Details
Message-ID: <m0mp4eK-000AWzC@sophists.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!sophists.COM!lewis

Show Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!sophists.COM!lewis
From: lewis@sophists.COM
Subject: Parsing templates with gcc 2.3.1
Message-ID: <m0mp4eK-000AWzC@sophists.com>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Tue, 10 Nov 1992 13:05:32 GMT
Approved: bug-g++@prep.ai.mit.edu
Lines: 40