public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/2769: Compiler doesn't find existing copy constructor
@ 2001-05-07 21:06 jungdl
0 siblings, 0 replies; only message in thread
From: jungdl @ 2001-05-07 21:06 UTC (permalink / raw)
To: gcc-gnats
>Number: 2769
>Category: c++
>Synopsis: Compiler doesn't find existing copy constructor
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Mon May 07 21:06:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: David Jung
>Release: g++ v3.0, daily snapshot 7th May 2001 from codesourcery.com
>Organization:
>Environment:
Standard i686 Redhat 6.2 install with snapshot installed (replacing default installed 2.96 develop snapshot shipped)
>Description:
Compiler appears to complain about a missing copy constructor that is actually defined.
Compiles fine on IRIX 6.5.x MIPSpro 7.3.1.1m compiler.
>How-To-Repeat:
==== Place in TriangleIterator.hpp ====
#ifndef _GFX_TRIANGLEITERATOR_HPP_
#define _GFX_TRIANGLEITERATOR_HPP_
#include <stdexcept>
typedef unsigned int Int;
class Triangle
{
public:
Triangle() {}
Triangle(const Triangle& t);
virtual ~Triangle() {}
};
class TriangleContainer;
class TriangleIterator
: public std::iterator<std::input_iterator_tag, Triangle, Int, const Triangle*, const Triangle&>
{
public:
explicit TriangleIterator(const TriangleIterator& iter);
virtual ~TriangleIterator();
TriangleIterator(const TriangleContainer& triangles, bool begin);
};
#endif
===== Place in TriangleContainer.hpp ===========
#ifndef _GFX_TRIANGLECONTAINER_HPP_
#define _GFX_TRIANGLECONTAINER_HPP_
class TriangleIterator;
class TriangleContainer
{
public:
typedef TriangleIterator const_iterator;
virtual const_iterator begin() const;
protected:
friend class TriangleIterator;
};
#endif
======== Place in TriangleContainer.cpp ===========
#include "TriangleContainer.hpp"
#include "TriangleIterator.hpp"
TriangleContainer::const_iterator TriangleContainer::begin() const
{
return TriangleIterator(*this, true);
}
====== Issue compile command: =========
g++ -c TriangleContainer.cpp -o TriangleContainer.o
TriangleContainer.cpp: In method `TriangleIterator
TriangleContainer::begin () const':
TriangleContainer.cpp:6: no matching function for call to
`TriangleIterator::TriangleIterator (TriangleIterator)'
>Fix:
none known
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2001-05-07 21:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-07 21:06 c++/2769: Compiler doesn't find existing copy constructor jungdl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).