+2004-03-09 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/14397
+ * call.c (convert_like_real): Build a const qualified temporary,
+ when testing ctor access.
+
2004-03-09 Mark Mitchell <mark@codesourcery.com>
* call.c (initialize_reference): Fix typo.
if (convs->check_copy_constructor_p)
/* Generate a temporary copy purely to generate the required
diagnostics. */
- build_temp (build_dummy_object (totype), totype,
- LOOKUP_NORMAL|LOOKUP_ONLYCONVERTING,
- &diagnostic_fn);
+ build_temp
+ (build_dummy_object
+ (build_qualified_type (totype, TYPE_QUAL_CONST)),
+ totype, LOOKUP_NORMAL|LOOKUP_ONLYCONVERTING, &diagnostic_fn);
return expr;
case ck_ambig:
/* Call build_user_type_conversion again for the error. */
+2004-03-09 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/14397
+ * g++.dg/overload/ref1.C: New.
+
2004-03-09 Giovanni Bajo <giovannibajo@gcc.gnu.org>
PR c++/14409
--- /dev/null
+// Copyright (C) 2004 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 5 Mar 2004 <nathan@codesourcery.com>
+
+// Origin: schmid@snake.iap.physik.tu-darmstadt.de
+// Bug 14397: Bogus access error.
+
+struct S {
+ S (int);
+ S(S const&);
+ private:
+ S(S&);
+};
+
+S foo()
+{
+ int result = 0;
+
+ S s ((0,S (result)));
+
+ return S (result);
+}