🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

incorrect "bitwise copy" warning

#95
From: Glen Ditchfield
Date: Wed, 05 Jul 1989 18:43
35 lines
1585 bytes
g++ 1.35.1- complains that it must do a bitwise copy on a class with a
member with an operator=().  But the class doesn't have any members at all!
----- g++-op=.c -----
class string {
    friend class strsub;
  public:
    strsub operator()( short p, short l);
    };

class strsub {
    friend class string;
    strsub( string&, short, short);
  public:
    string& operator=(string&);
    };

strsub string::operator()( short pos, short len) {
    strsub sub( *this, pos, len);
    return sub;
    };
----- compiler messages -----
cd /u/gjditchfield/C++/Bugs/
g++ -v -c g++-op=.cc
g++ version 1.35.1-
 /usr/local/lib/gcc-cpp -+ -v -undef -D__GNU__ -D__GNUG__ -D__cplusplus -Dvax -Dunix -D__vax__ -D__unix__ g++-op=.cc /tmp/cc011719.cpp
GNU CPP version 1.35.93
 /usr/local/lib/gcc-cc1plus /tmp/cc011719.cpp -quiet -dumpbase g++-op=.cc -noreg -version -o /tmp/cc011719.s
GNU C++ version 1.35.1- (vax) compiled by GNU C version 1.35.
In method struct strsub string::operator () (short int, short int):
g++-op=.cc:16: warning: bitwise copy: `strsub' has a member with operator=()
 /usr/local/lib/gcc-as /tmp/cc011719.s -o g++-op=.o


... on a vax running BSD 4.3, with md -> vax.md, tm.h -> tm-vax+.h
Technical Details
Message-ID: <27525@watmath.waterloo.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!usc!cs.utexas.edu!uunet!watmath!watmsg!gjditchfield

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!usc!cs.utexas.edu!uunet!watmath!watmsg!gjditchfield
From: gjditchfield@watmsg.waterloo.edu (Glen Ditchfield)
Newsgroups: gnu.g++.bug
Subject: incorrect "bitwise copy" warning
Message-ID: <27525@watmath.waterloo.edu>
Date: 5 Jul 89 18:43:51 GMT
Sender: daemon@watmath.waterloo.edu
Lines: 35