------- Additional Comments From pinskia at gcc dot gnu dot org  2005-08-10 
13:53 -------
Please read: http://gcc.gnu.org/gcc-3.4/changes.html:
When binding an rvalue of class type to a reference, the copy constructor of 
the class must be 
accessible. For instance, consider the following code:
        class A 
        {
        public:
          A();
          
        private:
          A(const A&);   // private copy ctor
        };
        
        A makeA(void);
        void foo(const A&);
        
        void bar(void)
        {
          foo(A());       // error, copy ctor is not accessible
          foo(makeA());   // error, copy ctor is not accessible
          
          A a1;
          foo(a1);        // OK, a1 is a lvalue
        }

-----

This is invalid and is rejected as expected.

-- 


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

Reply via email to