* call.c (convert_like_real): Do not perform an additional
direct-initialization when binding to a reference.
PR c++/13478
* g++.dg/init/ref10.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@75979
138bc75d-0d04-0410-961f-
82ee72b054a4
+2004-01-16 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/13478
+ * call.c (convert_like_real): Do not perform an additional
+ direct-initialization when binding to a reference.
+
2004-01-15 Giovanni Bajo <giovannibajo@gcc.gnu.org>
PR c++/13407
conversion, but is not considered during overload resolution.
If the target is a class, that means call a ctor. */
- if (IS_AGGR_TYPE (totype)
- && (inner >= 0 || !lvalue_p (expr)))
+ if (IS_AGGR_TYPE (totype) && inner >= 0)
{
expr = (build_temp
(expr, totype,
+2004-01-16 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/13478
+ * g++.dg/init/ref10.C: New test.
+
2004-01-15 Giovanni Bajo <giovannibajo@gcc.gnu.org>
PR c++/13407
--- /dev/null
+// PR c++/13478
+
+struct A {};
+struct B : protected A {
+ B() {};
+ B(const A& ) {};
+private:
+ B(const B& ) {};
+};
+
+void foo(const A* ap)
+{
+ const B& br = *ap;
+}