------- Comment #1 from bangerth at dealii dot org 2006-09-28 06:15 -------
This is what is listed in the release notes of gcc 3.4:
http://gcc.gnu.org/gcc-3.4/changes.html
They say this:
-------------
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 might be surprising at first sight, especially since most popular
compilers do not correctly implement this rule (further details).
----------------------
The further references are a link to
http://gcc.gnu.org/bugs.html#cxx_rvalbind
W.
--
bangerth at dealii dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bangerth at dealii dot org
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
Summary|Hiding constructior is |Hiding constructior is
|required while no direct |required while no direct
|invocation to it with G++ 4 |invocation to it with G++ 4
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29261