public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/14823] New: the copy constructor is called unnecessarily/incorrectly when passing an arg by reference to the base class
@ 2004-04-02 14:30 robert dot schweikert at abaqus dot com
  2004-04-02 14:31 ` [Bug c++/14823] " robert dot schweikert at abaqus dot com
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: robert dot schweikert at abaqus dot com @ 2004-04-02 14:30 UTC (permalink / raw)
  To: gcc-bugs

This may or may not be related to the fact that the argument being passed is a
template.

The copy ctor of the template is private and thus we get the compiler error.
Since the argument is passed straight through to the bass class ctor during
construction of the derived object I see no reason why the compiler would need
to invoke the copy constructor at this point.

I tested a relatively recent snapshot on IA32:

g++ (GCC) 3.4.0 20040319 (prerelease)

-> g++ -c rgnF_Property.i
/myPath/include/omu_Varray.h: In constructor
`rgnF_Property::rgnF_Property(ftr_FeatureList*, const omu_VarrayPtr&, const
omu_VarrayPtr&, const omu_VarrayPtr&, const omu_VarrayPtr&, omu_VarrayInt32&,
const cow_String&, cax_MigrationType, cax_MigrationType, cax_PropertyKind, uint32)':
/myPath/include/omu_Varray.h:52: error: `omu_Varray<T>::omu_Varray(const
omu_Varray<T>&) [with T = void*]' is private
/myPath/module/rgn/ftr/impl/rgnF_Property.C:87: error: within this context

-- 
           Summary: the copy constructor is called unnecessarily/incorrectly
                    when passing an arg by reference to the base class
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: robert dot schweikert at abaqus dot com
                CC: gcc-bugs at gcc dot gnu dot org,robert dot schweikert at
                    abaqus dot com


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


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2004-08-27  8:48 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-02 14:30 [Bug c++/14823] New: the copy constructor is called unnecessarily/incorrectly when passing an arg by reference to the base class robert dot schweikert at abaqus dot com
2004-04-02 14:31 ` [Bug c++/14823] " robert dot schweikert at abaqus dot com
2004-04-02 14:47 ` pinskia at gcc dot gnu dot org
2004-04-02 15:18 ` robert dot schweikert at abaqus dot com
2004-04-02 17:41 ` bangerth at dealii dot org
2004-04-02 18:01 ` pinskia at gcc dot gnu dot org
2004-04-02 18:22 ` robert dot schweikert at abaqus dot com
2004-04-03 17:08 ` giovannibajo at libero dot it
2004-04-05 13:17 ` robert dot schweikert at abaqus dot com
2004-04-05 13:20 ` robert dot schweikert at abaqus dot com
2004-04-05 13:45 ` robert dot schweikert at abaqus dot com
2004-04-05 13:50 ` giovannibajo at libero dot it
2004-04-07 13:57 ` robert dot schweikert at abaqus dot com
2004-08-27  8:51 ` pinskia at gcc dot gnu dot org
2004-08-27  8:51 ` pinskia at gcc dot gnu dot org

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).