re PR c++/40373 (ICE with invalid destructor call)
PR c++/40373 * call.c (check_dtor_name): Return false even if get_type_value (name) is error_mark_node. * g++.dg/template/dtor7.C: New test. From-SVN: r148282
This commit is contained in:
parent
5f4a82c0c5
commit
b792a33ca4
4 changed files with 32 additions and 1 deletions
|
@ -1,5 +1,9 @@
|
|||
2009-06-08 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR c++/40373
|
||||
* call.c (check_dtor_name): Return false even if
|
||||
get_type_value (name) is error_mark_node.
|
||||
|
||||
PR c++/40370
|
||||
PR c++/40372
|
||||
* parser.c (cp_parser_direct_declarator): Don't set TREE_SIDE_EFFECTS
|
||||
|
|
|
@ -242,7 +242,7 @@ check_dtor_name (tree basetype, tree name)
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!name)
|
||||
if (!name || name == error_mark_node)
|
||||
return false;
|
||||
return same_type_p (TYPE_MAIN_VARIANT (basetype), TYPE_MAIN_VARIANT (name));
|
||||
}
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
* gcc.dg/builtin-object-size-4.c (test1): Adjust expected results.
|
||||
* gcc.dg/builtin-object-size-6.c: New test.
|
||||
|
||||
PR c++/40373
|
||||
* g++.dg/template/dtor7.C: New test.
|
||||
|
||||
PR c++/40370
|
||||
PR c++/40372
|
||||
* g++.dg/template/error41.C: New test.
|
||||
|
|
24
gcc/testsuite/g++.dg/template/dtor7.C
Normal file
24
gcc/testsuite/g++.dg/template/dtor7.C
Normal file
|
@ -0,0 +1,24 @@
|
|||
// PR c++/40373
|
||||
// { dg-compile }
|
||||
|
||||
struct A; // { dg-bogus "candidates are" "" { xfail *-*-* } }
|
||||
namespace
|
||||
{
|
||||
struct A; // { dg-bogus "struct" "" { xfail *-*-* } }
|
||||
}
|
||||
|
||||
struct B {};
|
||||
|
||||
template <typename T> void
|
||||
foo (T t)
|
||||
{
|
||||
t.~A (); // { dg-error "does not match destructor name" }
|
||||
}
|
||||
|
||||
void
|
||||
bar ()
|
||||
{
|
||||
foo (B ()); // { dg-bogus "instantiated from here" "" { xfail *-*-* } }
|
||||
}
|
||||
|
||||
// { dg-bogus "is ambiguous" "" { xfail *-*-* } 15 }
|
Loading…
Add table
Reference in a new issue