[Bug c++/52755] Error on use of implicitly deleted operator=

holger.hopp at sap dot com gcc-bugzilla@gcc.gnu.org
Thu Mar 29 11:51:00 GMT 2012


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

--- Comment #3 from Holger Hopp <holger.hopp at sap dot com> 2012-03-29 11:50:25 UTC ---
I agree that it is possible to define operator= for each struct that
is using t1 (in the original code (C code, but compiled as C++ code)
there is not only t2, and in all of them there are more members).

There are simpler methods to fix the code, e.g. to define  
  typedef struct t1s { volatile int a; } t1;
It should be equivalent in the volatile qualifier behavior when the
volatile qualifier is set for each member of t1. This compiles also
fine with gcc-4.6 and does not need several operator= definitions.

But that is not the question. The question is if that is a gcc bug or
not. If C++11 is really different compared to C++98 here (I'm not sure
about that), then I would prefer _one_ clear error message like
"error: C++11 does not allow ..." or "error: C++11 demands ..." or
similar, and not that weird 3 error messages plus 5 notes about
implicitly deleted simple assignments operators.



More information about the Gcc-bugs mailing list