Commit acb044ee by Gabriel Dos Reis Committed by Gabriel Dos Reis

re PR c++/3656 (ICE when incorrectly deriving a class from a templated base in another namespace)

cp/
        PR C++/3656
        * semantics.c (finish_base_specifier): Handle erronous base
        classes.

testsuite/
        * g++.dg/inherit/template-as-base.C: New test.

From-SVN: r51214
parent c58408bf
2002-03-21 Gabriel Dos Reis <gdr@merlin.codesourcery.com>
PR C++/3656
* semantics.c (finish_base_specifier): Handle erronous base
classes.
2002-03-22 Zack Weinberg <zack@codesourcery.com> 2002-03-22 Zack Weinberg <zack@codesourcery.com>
* error.c: Always use REAL_VALUE_TO_DECIMAL; don't test * error.c: Always use REAL_VALUE_TO_DECIMAL; don't test
......
...@@ -2026,7 +2026,12 @@ finish_base_specifier (access_specifier, base_class) ...@@ -2026,7 +2026,12 @@ finish_base_specifier (access_specifier, base_class)
{ {
tree result; tree result;
if (! is_aggr_type (base_class, 1)) if (base_class == error_mark_node)
{
error ("invalid base-class specification");
result = NULL_TREE;
}
else if (! is_aggr_type (base_class, 1))
result = NULL_TREE; result = NULL_TREE;
else else
{ {
......
2002-03-22 Gabriel Dos Reis <gdr@merlin.codesourcery.com>
* g++.dg/inherit/template-as-base.C: New test.
2002-03-22 Jakub Jelinek <jakub@redhat.com> 2002-03-22 Jakub Jelinek <jakub@redhat.com>
* g++.old-deja/g++.other/dwarf2-1.C: Move... * g++.old-deja/g++.other/dwarf2-1.C: Move...
......
// Contributed by Gabriel Dos Reis <gdr@codesourcery.com>
// Distilled from PR C++/3656
namespace N
{
template<typename> struct X { };
}
struct A : N::X { };
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