This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/12226] [3.3 Regression] g++ fails to enforce accessibility requirement for copy constructor


------- Additional Comments From dbaron at dbaron dot org  2004-01-05 22:52 -------
Before I go fix Mozilla to deal with this
( http://bugzilla.mozilla.org/show_bug.cgi?id=230118 ), I just want to
double-check that this change was intended to apply to calls to functions taking
reference types in addition to initialization of reference variables.  That is,
the program:

class C {
  public:  C() {}
  private: C(const C&) {}
};
                                                                                
void f(const C& c) { }
                                                                                
int main()
{
  f(C());
  return 0;
}

now yields an error.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dbaron at dbaron dot org


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]