re PR c++/8031 (ICE in comptypes, at cp/typeck.c:913)

PR C++/8031
* cvt.c (convert_to_pointer_force): Don't try comparing	against
erronous type.

From-SVN: r60106
This commit is contained in:
Gabriel Dos Reis 2002-12-13 21:58:54 +00:00 committed by Gabriel Dos Reis
parent 8c6ae51fa9
commit 75c525d71b
3 changed files with 23 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2002-12-13 Gabriel Dos Reis <gdr@integrable-solutions.net>
PR C++/8031
* cvt.c (convert_to_pointer_force): Don't try comparing against
erronous type.
2002-12-13 Geoffrey Keating <geoffk@apple.com>
* cp-tree.h: Have the multiple-include guards around

View File

@ -322,6 +322,8 @@ convert_to_pointer_force (type, expr)
if (binfo)
{
expr = build_base_path (code, expr, binfo, 0);
if (expr == error_mark_node)
return error_mark_node;
/* Add any qualifier conversions. */
if (!same_type_p (TREE_TYPE (TREE_TYPE (expr)),
TREE_TYPE (type)))

View File

@ -0,0 +1,15 @@
// Copyright (C) 2002 Free Software Foundation
// Contributed by Gabriel Dos Reis <gdr@integrable-solutions.net>
struct A {
virtual void f(const A* a) = 0;
};
struct B : virtual A {
virtual void f(const A* a);
};
void B::f(const A* a)
{
static_cast<const B&>(*a); // { dg-error "" }
}