Commit 2811f33d by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/33501 (Copy constructor assumed to exist for undefined class)

	PR c++/33501
	* call.c (build_over_call): Don't check TREE_ADDRESSABLE
	on incomplete type.

	* g++.dg/warn/incomplete2.C: New test.
	* g++.dg/template/incomplete4.C: New test.
	* g++.dg/template/incomplete5.C: New test.

From-SVN: r129968
parent 5cd53742
2007-11-07 Jakub Jelinek <jakub@redhat.com>
PR c++/33501
* call.c (build_over_call): Don't check TREE_ADDRESSABLE
on incomplete type.
2007-11-06 Douglas Gregor <doug.gregor@gmail.com>
PR c++/33977
......
......@@ -4993,7 +4993,8 @@ build_over_call (struct z_candidate *cand, int flags)
/* Don't make a copy here if build_call is going to. */
if (conv->kind == ck_rvalue
&& !TREE_ADDRESSABLE (complete_type (type)))
&& COMPLETE_TYPE_P (complete_type (type))
&& !TREE_ADDRESSABLE (type))
conv = conv->u.next;
val = convert_like_with_context
......
2007-11-07 Jakub Jelinek <jakub@redhat.com>
PR c++/33501
* g++.dg/warn/incomplete2.C: New test.
* g++.dg/template/incomplete4.C: New test.
* g++.dg/template/incomplete5.C: New test.
2007-11-07 Olivier Hainque <hainque@adacore.com>
* gnat.dg/max_align.adb: New test.
// PR c++/33501
// { dg-do compile }
class A; // { dg-error "forward declaration" }
template <typename T> struct X
{
static int f (T);
static const T &make ();
};
int
main ()
{
return X<A>::f (X<A>::make ()); // { dg-error "invalid use of incomplete type|initializing argument" }
}
// PR c++/33501
// { dg-do compile }
class A; // { dg-error "forward declaration" }
template <typename T> struct X
{
static int f (T);
static const T &make ();
static const bool value = sizeof (f (make ())) == sizeof (int); // { dg-error "invalid use of incomplete type|initializing argument" }
};
int
main ()
{
return X <A>::value;
}
// PR c++/33501
// { dg-do compile }
class A; // { dg-error "forward declaration" }
int f (A);
const A &make ();
int
main ()
{
return f (make ()); // { dg-error "invalid use of incomplete type|initializing argument" }
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment