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
This commit is contained in:
parent
5cd537421e
commit
2811f33dcd
@ -1,3 +1,9 @@
|
||||
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
|
||||
|
@ -1,3 +1,10 @@
|
||||
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.
|
||||
|
16
gcc/testsuite/g++.dg/template/incomplete4.C
Normal file
16
gcc/testsuite/g++.dg/template/incomplete4.C
Normal file
@ -0,0 +1,16 @@
|
||||
// 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" }
|
||||
}
|
17
gcc/testsuite/g++.dg/template/incomplete5.C
Normal file
17
gcc/testsuite/g++.dg/template/incomplete5.C
Normal file
@ -0,0 +1,17 @@
|
||||
// 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;
|
||||
}
|
13
gcc/testsuite/g++.dg/warn/incomplete2.C
Normal file
13
gcc/testsuite/g++.dg/warn/incomplete2.C
Normal file
@ -0,0 +1,13 @@
|
||||
// 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" }
|
||||
}
|
Loading…
Reference in New Issue
Block a user